board: sama5d2_ptc_ek: add pda detect call at init time
authorEugen Hristev <eugen.hristev@microchip.com>
Tue, 18 Sep 2018 07:35:46 +0000 (10:35 +0300)
committerTom Rini <trini@konsulko.com>
Sat, 29 Sep 2018 00:22:40 +0000 (20:22 -0400)
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
board/atmel/sama5d2_ptc_ek/sama5d2_ptc_ek.c

index 3784cbb70b9922f113e87c62e30bf75d0713c14f..a6329dc0220973c094cea2ccf4cb7a7c7426bbfd 100644 (file)
@@ -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"
index 789841e45a94cb06ba0fd4b8e7c4b7fb70d6d5ea..17e08fa9b267931f674df5443e80183073797b2c 100644 (file)
@@ -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);