Skip to contentSkip to conversation

board: at91: sam9x60: set blue led on at boot time

PATCH In review Mihai Sain 2 participants 2 messages Dec 23, 2022 – Jan 4, 2023 Arm/Microchip (AT91) SoC support

lore
Share & tools
lore

Mihai Sain

author
#0 lore raw

PATCH 1/1 board: at91: sam9x60: set blue led on at boot time

Set blue led on at boot time in order to highlight that u-boot is loaded. This is done for all sam9x60 based boards which contain an RGB led.

---
 board/atmel/sam9x60_curiosity/sam9x60_curiosity.c | 10 ++++++++++
 board/atmel/sam9x60ek/sam9x60ek.c                 |  9 +++++++++
 2 files changed, 19 insertions(+)
board/atmel/sam9x60_curiosity/sam9x60_curiosity.c +10 -0
index 8cf67d148d..0fe0de9fde 100644
@@ -25,6 +25,13 @@ DECLARE_GLOBAL_DATA_PTR;
 
 void at91_prepare_cpu_var(void);
 
+static void board_leds_init(void)
+{
+	at91_set_pio_output(AT91_PIO_PORTD, 17, 0);	/* LED RED */
+	at91_set_pio_output(AT91_PIO_PORTD, 19, 0);	/* LED GREEN */
+	at91_set_pio_output(AT91_PIO_PORTD, 21, 1);	/* LED BLUE */
+}
+
 int board_late_init(void)
 {
 	at91_prepare_cpu_var();
@@ -62,6 +69,9 @@ int board_init(void)
 {
 	/* address of boot parameters */
 	gd->bd->bi_boot_params = gd->bd->bi_dram[0].start + 0x100;
+
+	board_leds_init();
+
 	return 0;
 }
 
board/atmel/sam9x60ek/sam9x60ek.c +9 -0
index d8d2c3a18f..5cd620f1a9 100644
@@ -24,6 +24,13 @@ DECLARE_GLOBAL_DATA_PTR;
 
 void at91_prepare_cpu_var(void);
 
+static void board_leds_init(void)
+{
+	at91_set_pio_output(AT91_PIO_PORTB, 11, 0);	/* LED RED */
+	at91_set_pio_output(AT91_PIO_PORTB, 12, 0);	/* LED GREEN */
+	at91_set_pio_output(AT91_PIO_PORTB, 13, 1);	/* LED BLUE */
+}
+
 #ifdef CONFIG_BOARD_LATE_INIT
 int board_late_init(void)
 {
@@ -66,6 +73,8 @@ int board_init(void)
 	/* address of boot parameters */
 	gd->bd->bi_boot_params = CONFIG_SYS_SDRAM_BASE + 0x100;
 
+	board_leds_init();
+
 	return 0;
 }
 
Signature · 1 line
2.39.0
#1 lore raw
Quoted 5 lines · Mihai Sain

Set blue led on at boot time in order to highlight that u-boot is loaded. This is done for all sam9x60 based boards which contain an RGB led.

---

Applied to u-boot-at91/next, thanks !