When you are booting u-boot first time, one thing you want is a visual indication that the u-boot has actually booted.
Here is an example how we can make a LED glow for the initial 3 seconds and then make it off. We will do it on the freescale's SabreLite evaluation board. Take a look at the Part of the schematics that has one GPIO pin spare for us - GPIO9 on the connector J7.
We will hook an LED between Pin 4 ( GPIO9) and 7 ( Ground) with a 200 Ohms resistor in series.
At the book time we can make the led glow using the following statement in the file mx6q_sabrelite.c in
It may not be a bad idea to insert it at the time we reset Phy.
/* Sabrelite phy reset: gpio3-23 */
set_gpio_output_val(GPIO3_BASE_ADDR, (1 << 23), 0); // GPIO 9 for testing on Sabre Lite Eval Board set_gpio_output_val(GPIO1_BASE_ADDR, (1 << 9), 1); . . .
set_gpio_output_val(GPIO1_BASE_ADDR, (1 << 9), 1);
makes the LED glow.
To turn the LED off, you can use
set_gpio_output_val(GPIO1_BASE_ADDR, (1 << 9), 0);
after the point where it prints
printf("Hit any key to stop autoboot: %2d ", bootdelay);
Make sure you make the set_gpio_output_val function available in the main.c().