]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
board: at91: sama5d2: set blue led on at boot time
authorMihai Sain <mihai.sain@microchip.com>
Mon, 7 Mar 2022 09:20:50 +0000 (11:20 +0200)
committerEugen Hristev <eugen.hristev@microchip.com>
Fri, 1 Apr 2022 12:42:46 +0000 (15:42 +0300)
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>
board/atmel/sama5d27_som1_ek/sama5d27_som1_ek.c
board/atmel/sama5d27_wlsom1_ek/sama5d27_wlsom1_ek.c
board/atmel/sama5d2_icp/sama5d2_icp.c
board/atmel/sama5d2_ptc_ek/sama5d2_ptc_ek.c
board/atmel/sama5d2_xplained/sama5d2_xplained.c

index 8c0cf3da54ba3aa6538dbde13cd5295d8353a64e..b69f1c8cfaedbe8732a5bd98dd5e2cca963c213e 100644 (file)
@@ -22,6 +22,13 @@ extern void at91_pda_detect(void);
 
 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)
 {
@@ -71,6 +78,8 @@ int board_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
index 32d51bba7d962e3252920b2c09bb7129e63d909b..67ada27072deb2033a29afd3abad6060c4909469 100644 (file)
@@ -22,6 +22,13 @@ extern void at91_pda_detect(void);
 
 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)
 {
@@ -64,6 +71,8 @@ int board_init(void)
        /* address of boot parameters */
        gd->bd->bi_boot_params = CONFIG_SYS_SDRAM_BASE + 0x100;
 
+       rgb_leds_init();
+
        return 0;
 }
 
index 3f33fcfc4665f88c2c0cc4cea41c0d8217296051..da697a7b0fedc41379b436208dfdb5e2f90e6ea2 100644 (file)
 
 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;
@@ -52,6 +59,8 @@ int board_init(void)
        /* address of boot parameters */
        gd->bd->bi_boot_params = CONFIG_SYS_SDRAM_BASE + 0x100;
 
+       rgb_leds_init();
+
        return 0;
 }
 
index 2a2439c53ae45e0006931ac276fd1c82fadcd1d6..cca5bd1d8aacf54a1a50085eaf492dac1e9bccf7 100644 (file)
@@ -25,6 +25,13 @@ extern void at91_pda_detect(void);
 
 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)
 {
@@ -113,6 +120,8 @@ int board_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
index 8b5cd533d04694122b44aeeb631b6a3eff4ba8b5..4bbb05c2fbfdc8942e9443cb1fb669ed66e37611 100644 (file)
@@ -21,6 +21,13 @@ extern void at91_pda_detect(void);
 
 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)
 {
@@ -70,6 +77,8 @@ int board_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