public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Teresa Remmet <t.remmet@phytec.de>
To: Stefano Babic <sbabic@denx.de>,
	Fabio Estevam <festevam@gmail.com>,
	"NXP i . MX U-Boot Team" <uboot-imx@nxp.com>
Cc: <u-boot@lists.denx.de>, <upstream@lists.phytec.de>,
	Yannic Moog <y.moog@phytec.de>,
	Daniel Schultz <d.schultz@phytec.de>,
	Wadim Egorov <w.egorov@phytec.de>
Subject: [PATCH v2 3/6] board: phytec: phycore-imx8mp: Add EEPROM detection initialisation
Date: Thu, 17 Aug 2023 10:57:08 +0200	[thread overview]
Message-ID: <20230817085711.45339-4-t.remmet@phytec.de> (raw)
In-Reply-To: <20230817085711.45339-1-t.remmet@phytec.de>

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>
---
Changes in v2:
- removed superfluous goto
---
 board/phytec/phycore_imx8mp/Kconfig |  1 +
 board/phytec/phycore_imx8mp/spl.c   | 17 +++++++++++++++++
 configs/phycore-imx8mp_defconfig    |  1 +
 3 files changed, 19 insertions(+)

diff --git a/board/phytec/phycore_imx8mp/Kconfig b/board/phytec/phycore_imx8mp/Kconfig
index c053a46fc9d1..f846d10bad9e 100644
--- a/board/phytec/phycore_imx8mp/Kconfig
+++ b/board/phytec/phycore_imx8mp/Kconfig
@@ -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
diff --git a/board/phytec/phycore_imx8mp/spl.c b/board/phytec/phycore_imx8mp/spl.c
index faed6fc3b76d..49406f2eafad 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);
 }
 
diff --git a/configs/phycore-imx8mp_defconfig b/configs/phycore-imx8mp_defconfig
index 7bf404be860b..7937e15e6422 100644
--- a/configs/phycore-imx8mp_defconfig
+++ b/configs/phycore-imx8mp_defconfig
@@ -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_PROMPT="u-boot=> "
 CONFIG_SYS_MONITOR_LEN=524288
 CONFIG_SPL_MMC=y
-- 
2.34.1


  parent reply	other threads:[~2023-08-17  8:57 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-17  8:57 [PATCH v2 0/6] PHYTEC SoM detection for phyCORE-i.MX8MP Teresa Remmet
2023-08-17  8:57 ` [PATCH v2 1/6] board: phytec: Add common PHYTEC SoM detection Teresa Remmet
2023-08-28 12:32   ` Yannic Moog
2023-10-07 13:00     ` Fabio Estevam
2023-08-17  8:57 ` [PATCH v2 2/6] board: phytec: common: Add imx8m specific EEPROM detection support Teresa Remmet
2023-08-28 12:32   ` Yannic Moog
2023-08-17  8:57 ` Teresa Remmet [this message]
2023-08-28 12:32   ` [PATCH v2 3/6] board: phytec: phycore-imx8mp: Add EEPROM detection initialisation Yannic Moog
2023-08-17  8:57 ` [PATCH v2 4/6] board: phytec: phycore_imx8mp: Update 2GB RAM Timings Teresa Remmet
2023-08-28 12:33   ` Yannic Moog
2023-08-17  8:57 ` [PATCH v2 5/6] board: phytec: common: phytec_som_detection: Add helper for PCB revision Teresa Remmet
2023-08-28 12:33   ` Yannic Moog
2023-08-17  8:57 ` [PATCH v2 6/6] board: phytec: phycore_imx8mp: Add 4000MTS RAM timings based on PCB rev Teresa Remmet
2023-08-28 12:33   ` Yannic Moog
2023-08-24 11:52 ` [PATCH v2 0/6] PHYTEC SoM detection for phyCORE-i.MX8MP Fabio Estevam
2023-08-25 11:46   ` Yannic Moog
  -- strict thread matches above, loose matches on Subject: below --
2023-10-16 11:51 [PATCH v2 3/6] board: phytec: phycore-imx8mp: Add EEPROM detection initialisation sbabic

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230817085711.45339-4-t.remmet@phytec.de \
    --to=t.remmet@phytec.de \
    --cc=d.schultz@phytec.de \
    --cc=festevam@gmail.com \
    --cc=sbabic@denx.de \
    --cc=u-boot@lists.denx.de \
    --cc=uboot-imx@nxp.com \
    --cc=upstream@lists.phytec.de \
    --cc=w.egorov@phytec.de \
    --cc=y.moog@phytec.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox