]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
board: phytec: phycore-imx8mp: Add EEPROM detection initialisation
authorTeresa Remmet <t.remmet@phytec.de>
Thu, 17 Aug 2023 08:57:08 +0000 (10:57 +0200)
committerStefano Babic <sbabic@denx.de>
Mon, 16 Oct 2023 09:29:23 +0000 (11:29 +0200)
Add EEPROM detection initialisation for phyCORE-i.MX8MM and
print SoM information during boot when successful.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
board/phytec/phycore_imx8mp/Kconfig
board/phytec/phycore_imx8mp/spl.c
configs/phycore-imx8mp_defconfig

index c053a46fc9d1b1b936a31ee9e61eef5788fffb50..f846d10bad9ef38b80a3ce55430bdf216b24c5ec 100644 (file)
@@ -12,4 +12,5 @@ config SYS_CONFIG_NAME
 config IMX_CONFIG
        default "board/phytec/phycore_imx8mp/imximage-8mp-sd.cfg"
 
+source "board/phytec/common/Kconfig"
 endif
index faed6fc3b76d7e95b7e24da0815efa0b57a9321b..49406f2eafad1959f774111b406417858db111bc 100644 (file)
 #include <power/pca9450.h>
 #include <spl.h>
 
+#include "../common/imx8m_som_detection.h"
+
 DECLARE_GLOBAL_DATA_PTR;
 
+#define EEPROM_ADDR             0x51
+#define EEPROM_ADDR_FALLBACK    0x59
+
 int spl_board_boot_device(enum boot_device boot_dev_spl)
 {
        return BOOT_DEVICE_BOOTROM;
@@ -30,6 +35,18 @@ int spl_board_boot_device(enum boot_device boot_dev_spl)
 
 void spl_dram_init(void)
 {
+       int ret;
+
+       ret = phytec_eeprom_data_setup_fallback(NULL, 0, EEPROM_ADDR,
+                                               EEPROM_ADDR_FALLBACK);
+       if (ret)
+               goto out;
+
+       ret = phytec_imx8m_detect(NULL);
+       if (!ret)
+               phytec_print_som_info(NULL);
+
+out:
        ddr_init(&dram_timing);
 }
 
index 32845fd19f240e0f6f162d50f4fa1d4055629ee0..46efe181c37b09a621014faa5b2989259aac5dcf 100644 (file)
@@ -12,6 +12,7 @@ CONFIG_DM_GPIO=y
 CONFIG_DEFAULT_DEVICE_TREE="imx8mp-phyboard-pollux-rdk"
 CONFIG_SPL_TEXT_BASE=0x920000
 CONFIG_TARGET_PHYCORE_IMX8MP=y
+CONFIG_PHYTEC_SOM_DETECTION=y
 CONFIG_SYS_MONITOR_LEN=524288
 CONFIG_SPL_MMC=y
 CONFIG_SPL_SERIAL=y