Set blue led on at boot time in order to highlight that u-boot is loaded.
This is done for all sama5d2 based boards which contain an RGB led.
Signed-off-by: Mihai Sain <mihai.sain@microchip.com>
DECLARE_GLOBAL_DATA_PTR;
+static void rgb_leds_init(void)
+{
+ atmel_pio4_set_pio_output(AT91_PIO_PORTA, 10, 0); /* LED RED */
+ atmel_pio4_set_pio_output(AT91_PIO_PORTB, 1, 0); /* LED GREEN */
+ atmel_pio4_set_pio_output(AT91_PIO_PORTA, 31, 1); /* LED BLUE */
+}
+
#ifdef CONFIG_CMD_USB
static void board_usb_hw_init(void)
{
/* address of boot parameters */
gd->bd->bi_boot_params = gd->bd->bi_dram[0].start + 0x100;
+ rgb_leds_init();
+
#ifdef CONFIG_CMD_USB
board_usb_hw_init();
#endif
DECLARE_GLOBAL_DATA_PTR;
+static void rgb_leds_init(void)
+{
+ atmel_pio4_set_pio_output(AT91_PIO_PORTA, 6, 0); /* LED RED */
+ atmel_pio4_set_pio_output(AT91_PIO_PORTA, 7, 0); /* LED GREEN */
+ atmel_pio4_set_pio_output(AT91_PIO_PORTA, 8, 1); /* LED BLUE */
+}
+
#ifdef CONFIG_BOARD_LATE_INIT
int board_late_init(void)
{
/* address of boot parameters */
gd->bd->bi_boot_params = CONFIG_SYS_SDRAM_BASE + 0x100;
+ rgb_leds_init();
+
return 0;
}
DECLARE_GLOBAL_DATA_PTR;
+static void rgb_leds_init(void)
+{
+ atmel_pio4_set_pio_output(AT91_PIO_PORTB, 0, 0); /* LED RED */
+ atmel_pio4_set_pio_output(AT91_PIO_PORTB, 1, 0); /* LED GREEN */
+ atmel_pio4_set_pio_output(AT91_PIO_PORTA, 31, 1); /* LED BLUE */
+}
+
int board_late_init(void)
{
return 0;
/* address of boot parameters */
gd->bd->bi_boot_params = CONFIG_SYS_SDRAM_BASE + 0x100;
+ rgb_leds_init();
+
return 0;
}
DECLARE_GLOBAL_DATA_PTR;
+static void rgb_leds_init(void)
+{
+ atmel_pio4_set_pio_output(AT91_PIO_PORTB, 10, 0); /* LED RED */
+ atmel_pio4_set_pio_output(AT91_PIO_PORTB, 8, 0); /* LED GREEN */
+ atmel_pio4_set_pio_output(AT91_PIO_PORTB, 6, 1); /* LED BLUE */
+}
+
#ifdef CONFIG_NAND_ATMEL
static void board_nand_hw_init(void)
{
/* address of boot parameters */
gd->bd->bi_boot_params = CONFIG_SYS_SDRAM_BASE + 0x100;
+ rgb_leds_init();
+
#ifdef CONFIG_NAND_ATMEL
board_nand_hw_init();
#endif
DECLARE_GLOBAL_DATA_PTR;
+static void rgb_leds_init(void)
+{
+ atmel_pio4_set_pio_output(AT91_PIO_PORTB, 6, 1); /* LED RED */
+ atmel_pio4_set_pio_output(AT91_PIO_PORTB, 5, 1); /* LED GREEN */
+ atmel_pio4_set_pio_output(AT91_PIO_PORTB, 0, 0); /* LED BLUE */
+}
+
#ifdef CONFIG_CMD_USB
static void board_usb_hw_init(void)
{
/* address of boot parameters */
gd->bd->bi_boot_params = gd->bd->bi_dram[0].start + 0x100;
+ rgb_leds_init();
+
#ifdef CONFIG_CMD_USB
board_usb_hw_init();
#endif