diff mbox series

[U-Boot,v4,23/34] board: sama5d2_ptc_ek: add pda detect call at init time

Message ID 1537256157-18001-24-git-send-email-eugen.hristev@microchip.com
State Accepted
Commit cc1bdd23c0c3a30456bd9bd069afe7b6ca1e4f6e
Delegated to: Tom Rini
Headers show
Series Add support for 1wire protocol and 1wire eeproms | expand

Commit Message

Eugen Hristev Sept. 18, 2018, 7:35 a.m. UTC
Call the PDA detection mechanism at boot time so we can have
the pda environment variable ready for use.

Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com>
---
 arch/arm/mach-at91/Kconfig                  |  1 +
 board/atmel/sama5d2_ptc_ek/sama5d2_ptc_ek.c | 10 ++++++++++
 2 files changed, 11 insertions(+)

Comments

Tom Rini Sept. 29, 2018, 3:46 p.m. UTC | #1
On Tue, Sep 18, 2018 at 10:35:46AM +0300, Eugen Hristev wrote:

> Call the PDA detection mechanism at boot time so we can have
> the pda environment variable ready for use.
> 
> Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com>

Applied to u-boot/master, thanks!
diff mbox series

Patch

diff --git a/arch/arm/mach-at91/Kconfig b/arch/arm/mach-at91/Kconfig
index 3784cbb..a6329dc 100644
--- a/arch/arm/mach-at91/Kconfig
+++ b/arch/arm/mach-at91/Kconfig
@@ -151,6 +151,7 @@  config TARGET_SAMA5D2_PTC_EK
 	bool "SAMA5D2 PTC EK board"
 	select BOARD_EARLY_INIT_F
 	select SAMA5D2
+	select BOARD_LATE_INIT
 
 config TARGET_SAMA5D2_XPLAINED
 	bool "SAMA5D2 Xplained board"
diff --git a/board/atmel/sama5d2_ptc_ek/sama5d2_ptc_ek.c b/board/atmel/sama5d2_ptc_ek/sama5d2_ptc_ek.c
index 789841e..17e08fa 100644
--- a/board/atmel/sama5d2_ptc_ek/sama5d2_ptc_ek.c
+++ b/board/atmel/sama5d2_ptc_ek/sama5d2_ptc_ek.c
@@ -20,6 +20,8 @@ 
 #include <asm/arch/sama5d2.h>
 #include <asm/arch/sama5d2_smc.h>
 
+extern void at91_pda_detect(void);
+
 DECLARE_GLOBAL_DATA_PTR;
 
 #ifdef CONFIG_NAND_ATMEL
@@ -65,6 +67,14 @@  static void board_nand_hw_init(void)
 }
 #endif
 
+#ifdef CONFIG_BOARD_LATE_INIT
+int board_late_init(void)
+{
+	at91_pda_detect();
+	return 0;
+}
+#endif
+
 static void board_usb_hw_init(void)
 {
 	atmel_pio4_set_pio_output(AT91_PIO_PORTB, 12, ATMEL_PIO_PUEN_MASK);