All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lukasz Majewski <lukma@denx.de>
To: Stefano Babic <sbabic@denx.de>,
	u-boot@lists.denx.de, Fabio Estevam <festevam@gmail.com>
Cc: Lukasz Majewski <lukma@denx.de>,
	Anatolij Gustschin <agust@denx.de>,
	Simon Glass <sjg@chromium.org>, Tom Rini <trini@konsulko.com>
Subject: [PATCH 4/6] config: xea: Enable late board initialization to set revision variable
Date: Thu, 28 Mar 2024 16:34:13 +0100	[thread overview]
Message-ID: <20240328153415.3706637-5-lukma@denx.de> (raw)
In-Reply-To: <20240328153415.3706637-1-lukma@denx.de>

The 'board_som_rev' environment variable will be used to point correct
configuration from the Linux FIT file.

Signed-off-by: Lukasz Majewski <lukma@denx.de>
---

 board/liebherr/xea/xea.c       | 12 ++++++++++++
 configs/imx28_xea_defconfig    |  1 +
 configs/imx28_xea_sb_defconfig |  1 +
 3 files changed, 14 insertions(+)

diff --git a/board/liebherr/xea/xea.c b/board/liebherr/xea/xea.c
index d9cf27c81b..90a1e03077 100644
--- a/board/liebherr/xea/xea.c
+++ b/board/liebherr/xea/xea.c
@@ -282,6 +282,18 @@ int board_init(void)
 	return 0;
 }
 
+#if defined(CONFIG_BOARD_LATE_INIT)
+int board_late_init(void)
+{
+	int ret = env_set_ulong("board_som_rev", get_som_rev());
+
+	if (ret)
+		printf("Cannot set XEA's SoM revision env variable!\n");
+
+	return 0;
+}
+#endif
+
 int dram_init(void)
 {
 	return mxs_dram_init();
diff --git a/configs/imx28_xea_defconfig b/configs/imx28_xea_defconfig
index 64a0561a34..6098c1f3be 100644
--- a/configs/imx28_xea_defconfig
+++ b/configs/imx28_xea_defconfig
@@ -39,6 +39,7 @@ CONFIG_BOOTCOMMAND="run ${bootpri} ; run ${bootsec}"
 CONFIG_USE_PREBOOT=y
 CONFIG_PREBOOT="run prebootcmd"
 CONFIG_BOARD_EARLY_INIT_F=y
+CONFIG_BOARD_LATE_INIT=y
 CONFIG_SPL_NO_BSS_LIMIT=y
 CONFIG_SPL_BOARD_INIT=y
 # CONFIG_SPL_RAW_IMAGE_SUPPORT is not set
diff --git a/configs/imx28_xea_sb_defconfig b/configs/imx28_xea_sb_defconfig
index 9872d35c1b..8d48d8c507 100644
--- a/configs/imx28_xea_sb_defconfig
+++ b/configs/imx28_xea_sb_defconfig
@@ -23,6 +23,7 @@ CONFIG_BOOTARGS="console=ttyAMA0,115200n8"
 CONFIG_USE_PREBOOT=y
 CONFIG_PREBOOT="run prebootcmd"
 CONFIG_BOARD_EARLY_INIT_F=y
+CONFIG_BOARD_LATE_INIT=y
 # CONFIG_SPL_FRAMEWORK is not set
 CONFIG_SPL_NO_BSS_LIMIT=y
 CONFIG_SPL_BOARD_INIT=y
-- 
2.39.2


  parent reply	other threads:[~2024-03-28 15:35 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-28 15:34 [PATCH 0/6] arm: xea: Provide enhancements for XEA board Lukasz Majewski
2024-03-28 15:34 ` [PATCH 1/6] arm: spl: xea: Remove I2S pins configuration from early initialization Lukasz Majewski
2024-03-28 15:34 ` [PATCH 2/6] arm: xea: Add support for reading SoM (CPU) and base board HW revision Lukasz Majewski
2024-03-28 16:42   ` Fabio Estevam
2024-03-28 15:34 ` [PATCH 3/6] arm: spl: Add definition for PHY reset GPIO for XEA HW rev. 2 Lukasz Majewski
2024-03-28 15:34 ` Lukasz Majewski [this message]
2024-03-28 15:34 ` [PATCH 5/6] arm: xea: Print information about XEA's SoM HW revision Lukasz Majewski
2024-03-28 15:34 ` [PATCH 6/6] config: xea: Add limits for SPL and u-boot proper sizes Lukasz Majewski

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=20240328153415.3706637-5-lukma@denx.de \
    --to=lukma@denx.de \
    --cc=agust@denx.de \
    --cc=festevam@gmail.com \
    --cc=sbabic@denx.de \
    --cc=sjg@chromium.org \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.denx.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.