Here I have a custom AM3359 based board. I'm using the TI Sitara SDK 05.05.01.00. My task is to set a GPIO to output and let it output a high signal. This should be done from U-Boot.
The problem is that U-Boot stops running as soon as I call gpio_direction_output(). If I do exactly the same in the board file for the Linux kernel, it works perfectly fine. But from U-Boot - no chance.
Here is the code from the U-Boot board file (evm.c customized, the function board_init() should be enough):
int board_init(void)
{
int ret;
/* Configure the i2c0 pin mux */
enable_i2c0_pin_mux();
i2c_init(CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE);
board_id = BONE_BOARD;
//configure_evm_pin_mux(board_id);
enable_minimum_pinmux();
/* my changes... */
printf("--- GPIO Pinmux enable now calling...\n");
enable_gpio3_10_pin_mux();
printf("--- GPIO request now calling...\n");
ret = gpio_request(GPIO_TO_PIN(3, 10), "ETH_RESET");
printf("--- return value: %d. GPIO direction_output now calling...\n", ret);
ret = gpio_direction_output(GPIO_TO_PIN(3, 10), 1); // 1: disables the ethernet reset signal
printf("--- return value: %d. GPIO complete!\n", ret);
/* ...end */
#ifndef CONFIG_SPL_BUILD
board_evm_init();
#endif
gpmc_init();
return 0;
}
This is in mux.c:
void enable_gpio3_10_pin_mux(void)
{
configure_module_pin_mux(gpio3_10_pin_mux);
}
void enable_minimum_pinmux(void)
{
configure_module_pin_mux(uart0_pin_mux);
configure_module_pin_mux(i2c1_pin_mux);
configure_module_pin_mux(mmc0_pin_mux);
configure_module_pin_mux(mmc1_pin_mux);
configure_module_pin_mux(spi0_pin_mux);
}
static struct module_pin_mux gpio3_10_pin_mux[] = {
{OFFSET(mii1_rxclk), MODE(7)}, /* GPIO3_10, ETH-RESET */
{-1},
};
This results in this output from U-Boot:
CCCCCCCC
U-Boot SPL 2011.09-dirty (Feb 26 2013 - 17:45:54)
Texas Instruments Revision detection unimplemented
--- GPIO Pinmux enable now calling...
--- GPIO request now calling...
--- return value: 0. GPIO direction_output now calling...
So what am I doing wrong here?