board: atmel: sama5d2_icp: enable green led on SPL completion
authorEugen Hristev <eugen.hristev@microchip.com>
Fri, 3 May 2019 13:26:53 +0000 (16:26 +0300)
committerEugen Hristev <eugen.hristev@microchip.com>
Wed, 15 May 2019 06:34:22 +0000 (09:34 +0300)
Enable the green led on SPL completion.
Red led has no pulldown and it will be lighted by default when the
board starts up.
If the PMIC is not configured to enable LDO2, the leds will not light.

Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com>
board/atmel/sama5d2_icp/sama5d2_icp.c

index f55ea2c6f897f86c8b5c981265584cfc7bd57405..1593e2bd4ea33936bc98d8d1afa1b8fe3eb99053 100644 (file)
@@ -79,6 +79,13 @@ static void board_can_stdby_dis(void)
        atmel_pio4_set_pio_output(AT91_PIO_PORTB, 25, 0);
 }
 
+static void board_leds_init(void)
+{
+       atmel_pio4_set_pio_output(AT91_PIO_PORTB, 0, 0); /* RED */
+       atmel_pio4_set_pio_output(AT91_PIO_PORTB, 1, 1); /* GREEN */
+       atmel_pio4_set_pio_output(AT91_PIO_PORTA, 31, 0); /* BLUE */
+}
+
 /* deassert reset lines for external periph in case of warm reboot */
 static void board_reset_additional_periph(void)
 {
@@ -118,6 +125,7 @@ void spl_board_init(void)
 #endif
        board_reset_additional_periph();
        board_can_stdby_dis();
+       board_leds_init();
 }
 
 void spl_display_print(void)