summaryrefslogtreecommitdiff
path: root/board/phytec/phycore_imx8mp/spl.c
diff options
context:
space:
mode:
authorTeresa Remmet <t.remmet@phytec.de>2023-08-17 10:57:08 +0200
committerStefano Babic <sbabic@denx.de>2023-10-16 11:29:23 +0200
commit5445f293c4d49612f4d5220cf3a6841dfb6a7f5d (patch)
treed9360baa005d64d7b1f814c4e2cf845240379186 /board/phytec/phycore_imx8mp/spl.c
parent44c82e7c90be700719a4b105ec97ff328a40d675 (diff)
board: phytec: phycore-imx8mp: Add EEPROM detection initialisation
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>
Diffstat (limited to 'board/phytec/phycore_imx8mp/spl.c')
-rw-r--r--board/phytec/phycore_imx8mp/spl.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/board/phytec/phycore_imx8mp/spl.c b/board/phytec/phycore_imx8mp/spl.c
index faed6fc3b76..49406f2eafa 100644
--- a/board/phytec/phycore_imx8mp/spl.c
+++ b/board/phytec/phycore_imx8mp/spl.c
@@ -21,8 +21,13 @@
#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);
}