Skip to contentSkip to conversation

arm: xea: Provide support for different XEA board HW versions

PATCH In review Lukasz Majewski 2 participants 18 messages Mar 22, 2024 – Mar 27, 2024

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover arm: xea: Provide support for different XEA board HW versions

This patch set provides support for different XEA board revisions. Due to very limited SPL size, the board's switch DTB decision is performed very early in u-boot proper; before driver model is set.

Adjustments for DTS between revisions are for the u-boot adjustment code (i.e. tweaks due to functionality not supported in u-boot), hence there is no need to update them from Linux upstream DTS.

Lukasz Majewski (12):
arm: spl: xea: Remove I2S pins configuration from early initialization
arm: xea: Add support for reading SoM (CPU) and base board HW revision
arm: xea: Rename imx28-xea.dts to imx28-xea-1.dts
dts: xea: Move phy-reset-gpios property to version specific DTS file
dts: xea: Remove outdated comment
arm: xea: Add support for multiple dtbs in u-boot
dts: xea: Add device tree description for XEA HW rev. 2
arm: spl: Add definition for PHY reset GPIO for XEA HW rev. 2
arm: config: xea: Enable support for multiple DTBs for XEA board
config: xea: Enable late board initialization to set revision variable
arm: xea: Print information about XEA's SoM HW revision
arm: env: Add support for booting different HW revisions of XEA boards

 arch/arm/dts/Makefile                         |  3 +-
 arch/arm/dts/imx28-xea-1-u-boot.dtsi          | 11 ++++
 arch/arm/dts/imx28-xea-1.dts                  |  8 +++
 arch/arm/dts/imx28-xea-2-u-boot.dtsi          | 11 ++++
 arch/arm/dts/imx28-xea-2.dts                  |  8 +++
 arch/arm/dts/imx28-xea-u-boot.dtsi            |  1 -
 .../arm/dts/{imx28-xea.dts => imx28-xea.dtsi} |  0
 board/liebherr/xea/spl_xea.c                  | 21 +++---
 board/liebherr/xea/xea.c                      | 65 +++++++++++++++++++
 board/liebherr/xea/xea.env                    |  4 +-
 configs/imx28_xea_defconfig                   |  5 +-
 configs/imx28_xea_sb_defconfig                |  5 +-
 12 files changed, 128 insertions(+), 14 deletions(-)
 create mode 100644 arch/arm/dts/imx28-xea-1-u-boot.dtsi
 create mode 100644 arch/arm/dts/imx28-xea-1.dts
 create mode 100644 arch/arm/dts/imx28-xea-2-u-boot.dtsi
 create mode 100644 arch/arm/dts/imx28-xea-2.dts
 rename arch/arm/dts/{imx28-xea.dts => imx28-xea.dtsi} (100%)
Signature · 1 line
2.39.2
#1 lore raw

PATCH 1/12 arm: spl: xea: Remove I2S pins configuration from early initialization

XEA is not supporting and using I2S codec, so there is no need to configure pins for it.

---

 board/liebherr/xea/spl_xea.c | 7 -------
 1 file changed, 7 deletions(-)
board/liebherr/xea/spl_xea.c +0 -7
index df354cac64..551ed6fbae 100644
@@ -112,13 +112,6 @@ const iomux_cfg_t iomux_setup[] = {
 	MX28_PAD_I2C0_SCL__I2C0_SCL,
 	MX28_PAD_I2C0_SDA__I2C0_SDA,
 
-	/* I2S Codec */
-	MX28_PAD_SAIF0_BITCLK__SAIF0_BITCLK,
-	MX28_PAD_SAIF0_LRCLK__SAIF0_LRCLK,
-	MX28_PAD_SAIF0_MCLK__SAIF0_MCLK,
-	MX28_PAD_SAIF0_SDATA0__SAIF0_SDATA0,
-	MX28_PAD_SAIF1_SDATA0__SAIF1_SDATA0,
-
 	/* PWR-Hold */
 	MX28_PAD_SPDIF__GPIO_3_27,
 
Signature · 1 line
2.39.2
#2 lore raw

PATCH 2/12 arm: xea: Add support for reading SoM (CPU) and base board HW revision

In reply to Lukasz Majewski

The XEA board now has several HW revisions for both SoM and base boards. This patch provides support for reading those revision ID values in SPL (u-boot.sb) and then pass this information to u-boot proper, as the maximal SPL size (~55KiB) is not allowing for having FIT support in it.

It was necessary to handle reading GPIOs values solely in u-boot proper as one configuration (i.e. 'single binary' - imx28_xea_sb_defconfig) is not using SPL framework.

---

 board/liebherr/xea/spl_xea.c | 11 +++++++++++
 board/liebherr/xea/xea.c     | 29 +++++++++++++++++++++++++++++
 2 files changed, 40 insertions(+)
board/liebherr/xea/spl_xea.c +11 -0
index 551ed6fbae..71194db235 100644
@@ -230,6 +230,17 @@ const iomux_cfg_t iomux_setup[] = {
 	/* TIVA boot control */
 	MX28_PAD_GPMI_RDY3__GPIO_0_23 | MUX_CONFIG_BOOT, /* TIVA0 */
 	MX28_PAD_GPMI_WRN__GPIO_0_25 | MUX_CONFIG_BOOT, /* TIVA1 */
+
+	/* HW revision ID Base Board */
+	MX28_PAD_LCD_D12__GPIO_1_12,
+	MX28_PAD_LCD_D13__GPIO_1_13,
+	MX28_PAD_LCD_D14__GPIO_1_14,
+
+	/* HW revision ID (SoM) */
+	MX28_PAD_LCD_D15__GPIO_1_15,
+	MX28_PAD_LCD_D16__GPIO_1_16,
+	MX28_PAD_LCD_D17__GPIO_1_17,
+	MX28_PAD_LCD_D18__GPIO_1_18,
 };
 
 u32 mxs_dram_vals[] = {
board/liebherr/xea/xea.c +29 -0
index c8ac526cb4..d9cf27c81b 100644
@@ -48,6 +48,35 @@ DECLARE_GLOBAL_DATA_PTR;
  * Functions
  */
 
+/*
+ * Reading the HW ID number for XEA SoM module
+ *
+ * GPIOs from Port 1 (GPIO1_15, GPIO1_16, GPIO1_17 and GPIO1_18)
+ * are used to store HW revision information.
+ * Reading of GPIOs values is performed before the Device Model is
+ * bring up as the proper DTB needs to be chosen first.
+ *
+ * Moreover, this approach is required as "single binary" configuration
+ * of U-Boot (imx28_xea_sb_defconfig) is NOT using SPL framework, so
+ * only minimal subset of functionality is provided when ID is read.
+ *
+ * Hence, the direct registers' access.
+ */
+#define XEA_SOM_HW_ID_GPIO_PORT (MXS_PINCTRL_BASE + (0x0900 + ((1) * 0x10)))
+#define XEA_SOM_REV_MASK GENMASK(18, 15)
+#define XEA_SOM_REV_SHIFT 15
+
+static inline u8 get_som_rev(void)
+{
+	struct mxs_register_32 *reg =
+		(struct mxs_register_32 *)XEA_SOM_HW_ID_GPIO_PORT;
+
+	u32 tmp = ~readl(&reg->reg);
+	u8 id = (tmp & XEA_SOM_REV_MASK) >> XEA_SOM_REV_SHIFT;
+
+	return id;
+}
+
 static void init_clocks(void)
 {
 	/* IO0 clock at 480MHz */
Signature · 1 line
2.39.2
#3 lore raw

PATCH 3/12 arm: xea: Rename imx28-xea.dts to imx28-xea-1.dts

In reply to Lukasz Majewski

The former imx28-xea.dts file has been renamed to imx28-xea.dtsi, which is included to new imx28-xea-1.dts file.

This is a preparatory work to add support for multiple versions of XEA boards to u-boot.

---

 arch/arm/dts/Makefile                          |  2 +-
 arch/arm/dts/imx28-xea-1-u-boot.dtsi           | 11 +++++++++++
 arch/arm/dts/imx28-xea-1.dts                   |  8 ++++++++
 arch/arm/dts/{imx28-xea.dts => imx28-xea.dtsi} |  0
 board/liebherr/xea/xea.env                     |  2 +-
 configs/imx28_xea_defconfig                    |  2 +-
 configs/imx28_xea_sb_defconfig                 |  2 +-
 7 files changed, 23 insertions(+), 4 deletions(-)
 create mode 100644 arch/arm/dts/imx28-xea-1-u-boot.dtsi
 create mode 100644 arch/arm/dts/imx28-xea-1.dts
 rename arch/arm/dts/{imx28-xea.dts => imx28-xea.dtsi} (100%)
arch/arm/dts/Makefile +1 -1
index b102ffb5f6..4fc508bcfc 100644
@@ -879,7 +879,7 @@ dtb-$(CONFIG_TARGET_MX23_OLINUXINO) += \
 
 dtb-$(CONFIG_MX28) += \
 	imx28-evk.dtb \
-	imx28-xea.dtb
+	imx28-xea-1.dtb
 
 dtb-$(CONFIG_MX51) += \
 	imx51-babbage.dtb
arch/arm/dts/imx28-xea-1-u-boot.dtsi new file +11 -0
new file mode 100644
index 0000000000..4b2b21eeae
@@ -0,0 +1,11 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+/*
+ * Copyright 2024
+ * Lukasz Majewski, DENX Software Engineering, [email protected]
+ */
+
+/*
+ * The minimal augmentation DTS U-Boot file to allow eMMC driver
+ * configuration in SPL for falcon boot.
+ */
+#include "imx28-xea-u-boot.dtsi"
arch/arm/dts/imx28-xea-1.dts new file +8 -0
new file mode 100644
index 0000000000..8cb1190ba5
@@ -0,0 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+/*
+ * Copyright 2024
+ * Lukasz Majewski, DENX Software Engineering, [email protected]
+ */
+
+/dts-v1/;
+#include "imx28-xea.dtsi"
arch/arm/dts/imx28-xea.dtsi renamed from arch/arm/dts/imx28-xea.dts +0 -0
similarity index 100%
rename from arch/arm/dts/imx28-xea.dts
rename to arch/arm/dts/imx28-xea.dtsi
board/liebherr/xea/xea.env +1 -1
index 043099ae87..ac6ac898ec 100644
@@ -3,7 +3,7 @@ bootpri=mmc_mmc
 bootsec=sf_swu
 consdev=ttyAMA0
 baudrate=115200
-dtbfile=imx28-xea.dtb
+dtbfile=imx28-xea-1.dtb
 rootdev=/dev/mmcblk0p2
 netdev=eth0
 swufile=swupdate-image-xea-upd.itb
configs/imx28_xea_defconfig +1 -1
index 64a0561a34..42cbc3d34c 100644
@@ -11,7 +11,7 @@ CONFIG_SF_DEFAULT_SPEED=40000000
 CONFIG_IMX_CONFIG=""
 CONFIG_DM_GPIO=y
 CONFIG_SPL_DM_SPI=y
-CONFIG_DEFAULT_DEVICE_TREE="imx28-xea"
+CONFIG_DEFAULT_DEVICE_TREE="imx28-xea-1"
 CONFIG_SPL_TEXT_BASE=0x1000
 CONFIG_TARGET_XEA=y
 CONFIG_SPL_MXS_PMU_MINIMAL_VDD5V_CURRENT=y
configs/imx28_xea_sb_defconfig +1 -1
index 9872d35c1b..30b3568e7f 100644
@@ -9,7 +9,7 @@ CONFIG_NR_DRAM_BANKS=1
 CONFIG_SF_DEFAULT_SPEED=40000000
 CONFIG_DM_GPIO=y
 CONFIG_SPL_DM_SPI=y
-CONFIG_DEFAULT_DEVICE_TREE="imx28-xea"
+CONFIG_DEFAULT_DEVICE_TREE="imx28-xea-1"
 CONFIG_SPL_TEXT_BASE=0x1000
 CONFIG_TARGET_XEA=y
 CONFIG_SPL=y
Signature · 1 line
2.39.2
#4 lore raw

PATCH 4/12 dts: xea: Move phy-reset-gpios property to version specific DTS file

In reply to Lukasz Majewski

The DTS description in XEA for mac0 node in u-boot differs considerably from what we do have available in Linux, as u-boot is not supporting L2 switch (i.e. 'fixed-link' property is used).

To facilitate HW revision management - this particular property has been moved to version specific file.

---

 arch/arm/dts/imx28-xea-1-u-boot.dtsi | 4 ++++
 arch/arm/dts/imx28-xea-u-boot.dtsi   | 1 -
 2 files changed, 4 insertions(+), 1 deletion(-)
arch/arm/dts/imx28-xea-1-u-boot.dtsi +4 -0
index 4b2b21eeae..2903be2089 100644
@@ -9,3 +9,7 @@
  * configuration in SPL for falcon boot.
  */
 #include "imx28-xea-u-boot.dtsi"
+
+&mac0 {
+	phy-reset-gpios = <&gpio2 13 GPIO_ACTIVE_LOW>;
+};
arch/arm/dts/imx28-xea-u-boot.dtsi +0 -1
index bdbeca528c..13a581f7a6 100644
@@ -50,7 +50,6 @@
 	pinctrl-names = "default";
 	pinctrl-0 = <&mac0_pins_a>;
 	phy-supply = <&reg_fec_3v3>;
-	phy-reset-gpios = <&gpio2 13 GPIO_ACTIVE_LOW>;
 	phy-reset-duration = <1>;
 	phy-reset-post-delay = <1>;
 	status = "okay";
Signature · 1 line
2.39.2
#5 lore raw

PATCH 5/12 dts: xea: Remove outdated comment

In reply to Lukasz Majewski

The comment in u-boot specific adjustment to XEA DTS is not valid anymore.

---

 arch/arm/dts/imx28-xea-1-u-boot.dtsi | 4 ----
 1 file changed, 4 deletions(-)
arch/arm/dts/imx28-xea-1-u-boot.dtsi +0 -4
index 2903be2089..6cb6c66924 100644
@@ -4,10 +4,6 @@
  * Lukasz Majewski, DENX Software Engineering, [email protected]
  */
 
-/*
- * The minimal augmentation DTS U-Boot file to allow eMMC driver
- * configuration in SPL for falcon boot.
- */
 #include "imx28-xea-u-boot.dtsi"
 
 &mac0 {
Signature · 1 line
2.39.2
#6 lore raw

PATCH 6/12 arm: xea: Add support for multiple dtbs in u-boot

In reply to Lukasz Majewski

As XEA board uses imx287, which has some constrains on SPL (u-boot.sb) size - it must be less than ~55 KiB, multiple boards versions are included in u-boot proper's FIT image.

The decision of using proper configuration is based on information passed from SPL (u-boot.sb) in OCRAM dedicated location (0xE000 - 2).

This board also uses falcon boot for production setup, so the proper dtb is flashed during production (also based on GPIO values describing HW ID).

---

 board/liebherr/xea/xea.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
board/liebherr/xea/xea.c +15 -0
index d9cf27c81b..615d266b8f 100644
@@ -287,6 +287,21 @@ int dram_init(void)
 	return mxs_dram_init();
 }
 
+#if defined(CONFIG_MULTI_DTB_FIT)
+int board_fit_config_name_match(const char *name)
+{
+	u8 rev_id = get_som_rev();
+	char board[11];
+
+	sprintf(board, "imx28-xea-%d", rev_id);
+
+	if (!strncmp(name, board, sizeof(board)))
+		return 0;
+
+	return -EINVAL;
+}
+#endif
+
 #ifdef CONFIG_OF_BOARD_SETUP
 static int fdt_fixup_l2switch(void *blob)
 {
Signature · 1 line
2.39.2
#7 lore raw

PATCH 7/12 dts: xea: Add device tree description for XEA HW rev. 2

In reply to Lukasz Majewski

For SPL and u-boot proper, the difference between revsions boils down only to the GPIO pin for PHY reset.

---

 arch/arm/dts/Makefile                |  3 ++-
 arch/arm/dts/imx28-xea-2-u-boot.dtsi | 11 +++++++++++
 arch/arm/dts/imx28-xea-2.dts         |  8 ++++++++
 3 files changed, 21 insertions(+), 1 deletion(-)
 create mode 100644 arch/arm/dts/imx28-xea-2-u-boot.dtsi
 create mode 100644 arch/arm/dts/imx28-xea-2.dts
arch/arm/dts/Makefile +2 -1
index 4fc508bcfc..69131599ae 100644
@@ -879,7 +879,8 @@ dtb-$(CONFIG_TARGET_MX23_OLINUXINO) += \
 
 dtb-$(CONFIG_MX28) += \
 	imx28-evk.dtb \
-	imx28-xea-1.dtb
+	imx28-xea-1.dtb \
+	imx28-xea-2.dtb
 
 dtb-$(CONFIG_MX51) += \
 	imx51-babbage.dtb
arch/arm/dts/imx28-xea-2-u-boot.dtsi new file +11 -0
new file mode 100644
index 0000000000..6ce82531d5
@@ -0,0 +1,11 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+/*
+ * Copyright 2024
+ * Lukasz Majewski, DENX Software Engineering, [email protected]
+ */
+
+#include "imx28-xea-u-boot.dtsi"
+
+&mac0 {
+	phy-reset-gpios = <&gpio3 21 GPIO_ACTIVE_LOW>;
+};
arch/arm/dts/imx28-xea-2.dts new file +8 -0
new file mode 100644
index 0000000000..8cb1190ba5
@@ -0,0 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+/*
+ * Copyright 2024
+ * Lukasz Majewski, DENX Software Engineering, [email protected]
+ */
+
+/dts-v1/;
+#include "imx28-xea.dtsi"
Signature · 1 line
2.39.2
#8 lore raw

PATCH 8/12 arm: spl: Add definition for PHY reset GPIO for XEA HW rev. 2

In reply to Lukasz Majewski

The imx287 based XEA board's revision 2 uses GPIO_3_21 for PHY reset

It is safe to keep the GPIO_2_13 as well, as in the SPL SPI1 is not used for transmission. This simplifies the code, as the proper configuration is performed either in falcon boot's read DTB or in u-boot proper (with correct FIT configuration chosen).

---

 board/liebherr/xea/spl_xea.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
board/liebherr/xea/spl_xea.c +2 -1
index 71194db235..6cf8f8390e 100644
@@ -225,7 +225,8 @@ const iomux_cfg_t iomux_setup[] = {
 	MX28_PAD_ENET0_TXD0__ENET0_TXD0 | MUX_CONFIG_ENET,
 	MX28_PAD_ENET0_TXD1__ENET0_TXD1 | MUX_CONFIG_ENET,
 	MX28_PAD_ENET0_TXD3__ENET1_TXD1 | MUX_CONFIG_ENET,
-	MX28_PAD_SSP1_CMD__GPIO_2_13, /* PHY reset */
+	MX28_PAD_SSP1_CMD__GPIO_2_13, /* PHY reset HW Rev. 1*/
+	MX28_PAD_SAIF0_LRCLK__GPIO_3_21, /* PHY reset HW Rev. 2*/
 
 	/* TIVA boot control */
 	MX28_PAD_GPMI_RDY3__GPIO_0_23 | MUX_CONFIG_BOOT, /* TIVA0 */
Signature · 1 line
2.39.2
#9 lore raw

PATCH 9/12 arm: config: xea: Enable support for multiple DTBs for XEA board

In reply to Lukasz Majewski

After this change u-boot proper is able to support two HW revisions of the XEA board.

---

 configs/imx28_xea_defconfig    | 2 ++
 configs/imx28_xea_sb_defconfig | 2 ++
 2 files changed, 4 insertions(+)
configs/imx28_xea_defconfig +2 -0
index 42cbc3d34c..bc8c167b1f 100644
@@ -81,6 +81,8 @@ CONFIG_CMD_MTDPARTS=y
 CONFIG_DOS_PARTITION=y
 CONFIG_OF_CONTROL=y
 CONFIG_SPL_OF_CONTROL=y
+CONFIG_OF_LIST="imx28-xea-1 imx28-xea-2"
+CONFIG_MULTI_DTB_FIT=y
 CONFIG_OF_SPL_REMOVE_PROPS="pinctrl-0 pinctrl-names clock-names interrupt-parent interrupts"
 CONFIG_SPL_OF_PLATDATA=y
 # CONFIG_SPL_OF_PLATDATA_PARENT is not set
configs/imx28_xea_sb_defconfig +2 -0
index 30b3568e7f..691edc2834 100644
@@ -55,6 +55,8 @@ CONFIG_CMD_FS_GENERIC=y
 CONFIG_CMD_MTDPARTS=y
 CONFIG_OF_CONTROL=y
 CONFIG_SPL_OF_CONTROL=y
+CONFIG_OF_LIST="imx28-xea-1 imx28-xea-2"
+CONFIG_MULTI_DTB_FIT=y
 CONFIG_OF_SPL_REMOVE_PROPS="pinctrl-0 pinctrl-names clock-names interrupt-parent interrupts"
 CONFIG_SPL_OF_PLATDATA=y
 # CONFIG_SPL_OF_PLATDATA_PARENT is not set
Signature · 1 line
2.39.2
#10 lore raw

PATCH 10/12 config: xea: Enable late board initialization to set revision variable

In reply to Lukasz Majewski

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

---

 board/liebherr/xea/xea.c       | 12 ++++++++++++
 configs/imx28_xea_defconfig    |  1 +
 configs/imx28_xea_sb_defconfig |  1 +
 3 files changed, 14 insertions(+)
board/liebherr/xea/xea.c +12 -0
index 615d266b8f..5bac614153 100644
@@ -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();
configs/imx28_xea_defconfig +1 -0
index bc8c167b1f..c416635b24 100644
@@ -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
configs/imx28_xea_sb_defconfig +1 -0
index 691edc2834..78e59b4cb2 100644
@@ -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
Signature · 1 line
2.39.2
#11 lore raw

PATCH 11/12 arm: xea: Print information about XEA's SoM HW revision

In reply to Lukasz Majewski

As now XEA has its second HW revision - this information is printed when u-boot proper starts.

---

 board/liebherr/xea/xea.c | 9 +++++++++
 1 file changed, 9 insertions(+)
board/liebherr/xea/xea.c +9 -0
index 5bac614153..876e8a70ab 100644
@@ -294,6 +294,15 @@ int board_late_init(void)
 }
 #endif
 
+#if defined(CONFIG_DISPLAY_BOARDINFO)
+int checkboard(void)
+{
+	printf("Board: LWE XEA SoM HW rev %d\n", get_som_rev());
+
+	return 0;
+}
+#endif
+
 int dram_init(void)
 {
 	return mxs_dram_init();
Signature · 1 line
2.39.2
#12 lore raw

PATCH 12/12 arm: env: Add support for booting different HW revisions of XEA boards

In reply to Lukasz Majewski

In the scenario of recovery, the FitImage is used to boot the system. This patch provides support for deciding which dtb configuration shall be used.

---

 board/liebherr/xea/xea.env | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
board/liebherr/xea/xea.env +1 -1
index ac6ac898ec..9dec4016a0 100644
@@ -112,7 +112,7 @@ sf_swu=
 	sf read ${loadaddr} ${sf_kernel_offset} ${sf_swu_size} ;
 	setenv bootargs root=/dev/ram0 rw ;
 	run addargs ;
-	bootm ${loadaddr} ;
+	bootm ${loadaddr}#conf-imx28-${arch}-${board_som_rev}.dtb ;
 	fi
 net_mmc=
 	if run netload mmcargs addargs ; then
Signature · 1 line
2.39.2
reviewer
#13 lore raw
In reply to Lukasz Majewski

Hi Lukasz,

Quoted 7 lines · Lukasz Majewski
 arch/arm/dts/Makefile                         |  3 +-
 arch/arm/dts/imx28-xea-1-u-boot.dtsi          | 11 ++++
 arch/arm/dts/imx28-xea-1.dts                  |  8 +++
 arch/arm/dts/imx28-xea-2-u-boot.dtsi          | 11 ++++
 arch/arm/dts/imx28-xea-2.dts                  |  8 +++
 arch/arm/dts/imx28-xea-u-boot.dtsi            |  1 -
 .../arm/dts/{imx28-xea.dts => imx28-xea.dtsi} |  0

This rename deviates from the upstream devicetree name.

Ideally, we should convert to OF_UPSTREAM available in U-Boot next.

Quoted 8 lines
 board/liebherr/xea/spl_xea.c                  | 21 +++---
 board/liebherr/xea/xea.c                      | 65 +++++++++++++++++++
 board/liebherr/xea/xea.env                    |  4 +-
 configs/imx28_xea_defconfig                   |  5 +-
 configs/imx28_xea_sb_defconfig                |  5 +-
 12 files changed, 128 insertions(+), 14 deletions(-)
 create mode 100644 arch/arm/dts/imx28-xea-1-u-boot.dtsi
Quoted 4 lines
 create mode 100644 arch/arm/dts/imx28-xea-1.dts
 create mode 100644 arch/arm/dts/imx28-xea-2-u-boot.dtsi
 create mode 100644 arch/arm/dts/imx28-xea-2.dts
 rename arch/arm/dts/{imx28-xea.dts => imx28-xea.dtsi} (100%)

You should upstream imx28-xea-1.dts and imx28-xea-2.dts first.

#14 lore raw

Hi Fabio,

Quoted 24 lines

Hi Lukasz,

Quoted 7 lines · Lukasz Majewski
 arch/arm/dts/Makefile                         |  3 +-
 arch/arm/dts/imx28-xea-1-u-boot.dtsi          | 11 ++++
 arch/arm/dts/imx28-xea-1.dts                  |  8 +++
 arch/arm/dts/imx28-xea-2-u-boot.dtsi          | 11 ++++
 arch/arm/dts/imx28-xea-2.dts                  |  8 +++
 arch/arm/dts/imx28-xea-u-boot.dtsi            |  1 -
 .../arm/dts/{imx28-xea.dts => imx28-xea.dtsi} |  0  

This rename deviates from the upstream devicetree name.

Ideally, we should convert to OF_UPSTREAM available in U-Boot next.

Quoted 7 lines
 board/liebherr/xea/spl_xea.c                  | 21 +++---
 board/liebherr/xea/xea.c                      | 65
+++++++++++++++++++ board/liebherr/xea/xea.env                    |
 4 +- configs/imx28_xea_defconfig                   |  5 +-
 configs/imx28_xea_sb_defconfig                |  5 +-
 12 files changed, 128 insertions(+), 14 deletions(-)
 create mode 100644 arch/arm/dts/imx28-xea-1-u-boot.dtsi  
Quoted 6 lines
Quoted 4 lines
 create mode 100644 arch/arm/dts/imx28-xea-1.dts
 create mode 100644 arch/arm/dts/imx28-xea-2-u-boot.dtsi
 create mode 100644 arch/arm/dts/imx28-xea-2.dts
 rename arch/arm/dts/{imx28-xea.dts => imx28-xea.dtsi} (100%)  

You should upstream imx28-xea-1.dts and imx28-xea-2.dts first.

The case here is that I'm modifying the *-u-boot.dts{i} files only. In other words, u-boot will not support features described in Linux DTS.

Hence, the rename of files (which would be in sync with Linux at some point) looks like not related to Linux DTS (as even after re-sync with upstream Linux those changes will not be in Linux DTS).

Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH, Managing Director: Erika Unter
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: [email protected]

reviewer
#15 lore raw

Hi Lukasz,

Quoted 1 line · Lukasz Majewski

The case here is that I'm modifying the *-u-boot.dts{i} files only. In

The diff below shows that you are creating imx28-xea-1.dts and imx28-xea-2.dts for U-Boot consumption and renaming the upstream imx28-xea.dts to imx28-xea.dts.

create mode 100644 arch/arm/dts/imx28-xea-1.dts create mode 100644 arch/arm/dts/imx28-xea-2-u-boot.dtsi create mode 100644 arch/arm/dts/imx28-xea-2.dts rename arch/arm/dts/{imx28-xea.dts => imx28-xea.dtsi} (100%)

Quoted 1 line

other words, u-boot will not support features described in Linux DTS.

That's OK and this happens frequently.

For example, upstream devicetree may describes audio codec, but U-Boot does not support audio playback.

Devicetree should be OS agnostic.

In U-Boot, we want to re-use the upstream Linux devicetree files 'as-is'.

Adding -u-boot.dtsi files is OK though.

Can you convert the imx28-xea board to OF_UPSTREAM available in the U-Boot next branch?

Quoted 3 lines

Hence, the rename of files (which would be in sync with Linux at some point) looks like not related to Linux DTS (as even after re-sync with upstream Linux those changes will not be in Linux DTS).

I did not understand this part, do you mean that Linux will also do the imx28-xea.dts => imx28-xea.dtsi rename and will also have the new imx28-xea-1.dts and imx28-xea-2.dts?

Regards,

Fabio Estevam

#16 lore raw

Hi Fabio,

Quoted 7 lines

Hi Lukasz,

Quoted 2 lines · Lukasz Majewski

The case here is that I'm modifying the *-u-boot.dts{i} files only. In

Quoted 9 lines

The diff below shows that you are creating imx28-xea-1.dts and imx28-xea-2.dts for U-Boot consumption and renaming the upstream imx28-xea.dts to imx28-xea.dts.

create mode 100644 arch/arm/dts/imx28-xea-1.dts create mode 100644 arch/arm/dts/imx28-xea-2-u-boot.dtsi create mode 100644 arch/arm/dts/imx28-xea-2.dts rename arch/arm/dts/{imx28-xea.dts => imx28-xea.dtsi} (100%)

Yes, exactly.

Quoted 10 lines
Quoted 2 lines

other words, u-boot will not support features described in Linux DTS.

That's OK and this happens frequently.

For example, upstream devicetree may describes audio codec, but U-Boot does not support audio playback.

Devicetree should be OS agnostic.

Ok.

Quoted 3 lines

In U-Boot, we want to re-use the upstream Linux devicetree files 'as-is'.

Yes, I'm fully aware of this. However, the U-Boot size increases rapidly...

Quoted 2 lines

Adding -u-boot.dtsi files is OK though.

Yes, this is a good way (with /delete-node) to reduce the size.

Quoted 2 lines

Can you convert the imx28-xea board to OF_UPSTREAM available in the U-Boot next branch?

I will check if XEA can be moved to OF_UPSTREAM.

Quoted 9 lines
Quoted 5 lines

Hence, the rename of files (which would be in sync with Linux at some point) looks like not related to Linux DTS (as even after re-sync with upstream Linux those changes will not be in Linux DTS).

I did not understand this part, do you mean that Linux will also do the imx28-xea.dts => imx28-xea.dtsi rename and will also have the new imx28-xea-1.dts and imx28-xea-2.dts?

Yes. Exactly. I started the conversion from u-boot. Updating Linux DTS will be next.

Quoted 4 lines

Regards,

Fabio Estevam

Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH, Managing Director: Erika Unter
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: [email protected]

#17 lore raw
In reply to Fabio Estevam

Hi Fabio,

Quoted 34 lines

Hi Lukasz,

Quoted 2 lines · Lukasz Majewski

The case here is that I'm modifying the *-u-boot.dts{i} files only. In

The diff below shows that you are creating imx28-xea-1.dts and imx28-xea-2.dts for U-Boot consumption and renaming the upstream imx28-xea.dts to imx28-xea.dts.

create mode 100644 arch/arm/dts/imx28-xea-1.dts create mode 100644 arch/arm/dts/imx28-xea-2-u-boot.dtsi create mode 100644 arch/arm/dts/imx28-xea-2.dts rename arch/arm/dts/{imx28-xea.dts => imx28-xea.dtsi} (100%)

Quoted 2 lines

other words, u-boot will not support features described in Linux DTS.

That's OK and this happens frequently.

For example, upstream devicetree may describes audio codec, but U-Boot does not support audio playback.

Devicetree should be OS agnostic.

In U-Boot, we want to re-use the upstream Linux devicetree files 'as-is'.

Adding -u-boot.dtsi files is OK though.

Can you convert the imx28-xea board to OF_UPSTREAM available in the U-Boot next branch?

Quoted 9 lines
Quoted 4 lines

Hence, the rename of files (which would be in sync with Linux at some point) looks like not related to Linux DTS (as even after re-sync with upstream Linux those changes will not be in Linux DTS).

I did not understand this part, do you mean that Linux will also do the imx28-xea.dts => imx28-xea.dtsi rename and will also have the new imx28-xea-1.dts and imx28-xea-2.dts?

Just a small update - the Linux kernel's imx28-xea.dts [1] doesn't have switch/phy properties as the earlier attempts to add L2 switch support for Linux mainline were not accepted by the network stack community.

Hence, the decision to omit those properties (and there is no decision if another attempt for L2 switch support upstreaming will be done in the near future).

In u-boot the -u-boot.dts[i] files were used to add functionality not (yet) supported in Linux kernel.

To sum up - I cannot create imx28-xea-1.dts and imx28-xea-2.dts in Linux as properties which are different in those two revisions are not present in the current Linux dts description. I cannot say when all XEA functionality will be added to Linux.

Links:

[1] -
https://elixir.bootlin.com/linux/v6.9-rc1/source/arch/arm/boot/dts/nxp/mxs/imx28-xea.dts

Quoted 3 lines

Regards,

Fabio Estevam

Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH, Managing Director: Erika Unter
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: [email protected]