[PATCH 00/12] 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%)

XEA is not supporting and using I2S codec, so there is no need to configure pins for it.
Signed-off-by: Lukasz Majewski lukma@denx.de ---
board/liebherr/xea/spl_xea.c | 7 ------- 1 file changed, 7 deletions(-)
diff --git a/board/liebherr/xea/spl_xea.c b/board/liebherr/xea/spl_xea.c index df354cac64..551ed6fbae 100644 --- a/board/liebherr/xea/spl_xea.c +++ b/board/liebherr/xea/spl_xea.c @@ -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,

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.
Signed-off-by: Lukasz Majewski lukma@denx.de ---
board/liebherr/xea/spl_xea.c | 11 +++++++++++ board/liebherr/xea/xea.c | 29 +++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+)
diff --git a/board/liebherr/xea/spl_xea.c b/board/liebherr/xea/spl_xea.c index 551ed6fbae..71194db235 100644 --- a/board/liebherr/xea/spl_xea.c +++ b/board/liebherr/xea/spl_xea.c @@ -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[] = { diff --git a/board/liebherr/xea/xea.c b/board/liebherr/xea/xea.c index c8ac526cb4..d9cf27c81b 100644 --- a/board/liebherr/xea/xea.c +++ b/board/liebherr/xea/xea.c @@ -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); + u8 id = (tmp & XEA_SOM_REV_MASK) >> XEA_SOM_REV_SHIFT; + + return id; +} + static void init_clocks(void) { /* IO0 clock at 480MHz */

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.
Signed-off-by: Lukasz Majewski lukma@denx.de ---
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%)
diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile index b102ffb5f6..4fc508bcfc 100644 --- a/arch/arm/dts/Makefile +++ b/arch/arm/dts/Makefile @@ -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 diff --git a/arch/arm/dts/imx28-xea-1-u-boot.dtsi b/arch/arm/dts/imx28-xea-1-u-boot.dtsi new file mode 100644 index 0000000000..4b2b21eeae --- /dev/null +++ b/arch/arm/dts/imx28-xea-1-u-boot.dtsi @@ -0,0 +1,11 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/* + * Copyright 2024 + * Lukasz Majewski, DENX Software Engineering, lukma@denx.de + */ + +/* + * The minimal augmentation DTS U-Boot file to allow eMMC driver + * configuration in SPL for falcon boot. + */ +#include "imx28-xea-u-boot.dtsi" diff --git a/arch/arm/dts/imx28-xea-1.dts b/arch/arm/dts/imx28-xea-1.dts new file mode 100644 index 0000000000..8cb1190ba5 --- /dev/null +++ b/arch/arm/dts/imx28-xea-1.dts @@ -0,0 +1,8 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/* + * Copyright 2024 + * Lukasz Majewski, DENX Software Engineering, lukma@denx.de + */ + +/dts-v1/; +#include "imx28-xea.dtsi" diff --git a/arch/arm/dts/imx28-xea.dts b/arch/arm/dts/imx28-xea.dtsi similarity index 100% rename from arch/arm/dts/imx28-xea.dts rename to arch/arm/dts/imx28-xea.dtsi diff --git a/board/liebherr/xea/xea.env b/board/liebherr/xea/xea.env index 043099ae87..ac6ac898ec 100644 --- a/board/liebherr/xea/xea.env +++ b/board/liebherr/xea/xea.env @@ -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 diff --git a/configs/imx28_xea_defconfig b/configs/imx28_xea_defconfig index 64a0561a34..42cbc3d34c 100644 --- a/configs/imx28_xea_defconfig +++ b/configs/imx28_xea_defconfig @@ -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 diff --git a/configs/imx28_xea_sb_defconfig b/configs/imx28_xea_sb_defconfig index 9872d35c1b..30b3568e7f 100644 --- a/configs/imx28_xea_sb_defconfig +++ b/configs/imx28_xea_sb_defconfig @@ -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

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.
Signed-off-by: Lukasz Majewski lukma@denx.de ---
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(-)
diff --git a/arch/arm/dts/imx28-xea-1-u-boot.dtsi b/arch/arm/dts/imx28-xea-1-u-boot.dtsi index 4b2b21eeae..2903be2089 100644 --- a/arch/arm/dts/imx28-xea-1-u-boot.dtsi +++ b/arch/arm/dts/imx28-xea-1-u-boot.dtsi @@ -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>; +}; diff --git a/arch/arm/dts/imx28-xea-u-boot.dtsi b/arch/arm/dts/imx28-xea-u-boot.dtsi index bdbeca528c..13a581f7a6 100644 --- a/arch/arm/dts/imx28-xea-u-boot.dtsi +++ b/arch/arm/dts/imx28-xea-u-boot.dtsi @@ -50,7 +50,6 @@ pinctrl-names = "default"; pinctrl-0 = <&mac0_pins_a>; phy-supply = <®_fec_3v3>; - phy-reset-gpios = <&gpio2 13 GPIO_ACTIVE_LOW>; phy-reset-duration = <1>; phy-reset-post-delay = <1>; status = "okay";

The comment in u-boot specific adjustment to XEA DTS is not valid anymore.
Signed-off-by: Lukasz Majewski lukma@denx.de ---
arch/arm/dts/imx28-xea-1-u-boot.dtsi | 4 ---- 1 file changed, 4 deletions(-)
diff --git a/arch/arm/dts/imx28-xea-1-u-boot.dtsi b/arch/arm/dts/imx28-xea-1-u-boot.dtsi index 2903be2089..6cb6c66924 100644 --- a/arch/arm/dts/imx28-xea-1-u-boot.dtsi +++ b/arch/arm/dts/imx28-xea-1-u-boot.dtsi @@ -4,10 +4,6 @@ * Lukasz Majewski, DENX Software Engineering, lukma@denx.de */
-/* - * The minimal augmentation DTS U-Boot file to allow eMMC driver - * configuration in SPL for falcon boot. - */ #include "imx28-xea-u-boot.dtsi"
&mac0 {

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).
Signed-off-by: Lukasz Majewski lukma@denx.de ---
board/liebherr/xea/xea.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+)
diff --git a/board/liebherr/xea/xea.c b/board/liebherr/xea/xea.c index d9cf27c81b..615d266b8f 100644 --- a/board/liebherr/xea/xea.c +++ b/board/liebherr/xea/xea.c @@ -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) {

For SPL and u-boot proper, the difference between revsions boils down only to the GPIO pin for PHY reset.
Signed-off-by: Lukasz Majewski lukma@denx.de ---
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
diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile index 4fc508bcfc..69131599ae 100644 --- a/arch/arm/dts/Makefile +++ b/arch/arm/dts/Makefile @@ -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 diff --git a/arch/arm/dts/imx28-xea-2-u-boot.dtsi b/arch/arm/dts/imx28-xea-2-u-boot.dtsi new file mode 100644 index 0000000000..6ce82531d5 --- /dev/null +++ b/arch/arm/dts/imx28-xea-2-u-boot.dtsi @@ -0,0 +1,11 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/* + * Copyright 2024 + * Lukasz Majewski, DENX Software Engineering, lukma@denx.de + */ + +#include "imx28-xea-u-boot.dtsi" + +&mac0 { + phy-reset-gpios = <&gpio3 21 GPIO_ACTIVE_LOW>; +}; diff --git a/arch/arm/dts/imx28-xea-2.dts b/arch/arm/dts/imx28-xea-2.dts new file mode 100644 index 0000000000..8cb1190ba5 --- /dev/null +++ b/arch/arm/dts/imx28-xea-2.dts @@ -0,0 +1,8 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/* + * Copyright 2024 + * Lukasz Majewski, DENX Software Engineering, lukma@denx.de + */ + +/dts-v1/; +#include "imx28-xea.dtsi"

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).
Signed-off-by: Lukasz Majewski lukma@denx.de ---
board/liebherr/xea/spl_xea.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/board/liebherr/xea/spl_xea.c b/board/liebherr/xea/spl_xea.c index 71194db235..6cf8f8390e 100644 --- a/board/liebherr/xea/spl_xea.c +++ b/board/liebherr/xea/spl_xea.c @@ -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 */

After this change u-boot proper is able to support two HW revisions of the XEA board.
Signed-off-by: Lukasz Majewski lukma@denx.de ---
configs/imx28_xea_defconfig | 2 ++ configs/imx28_xea_sb_defconfig | 2 ++ 2 files changed, 4 insertions(+)
diff --git a/configs/imx28_xea_defconfig b/configs/imx28_xea_defconfig index 42cbc3d34c..bc8c167b1f 100644 --- a/configs/imx28_xea_defconfig +++ b/configs/imx28_xea_defconfig @@ -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 diff --git a/configs/imx28_xea_sb_defconfig b/configs/imx28_xea_sb_defconfig index 30b3568e7f..691edc2834 100644 --- a/configs/imx28_xea_sb_defconfig +++ b/configs/imx28_xea_sb_defconfig @@ -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

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 615d266b8f..5bac614153 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 bc8c167b1f..c416635b24 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 691edc2834..78e59b4cb2 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

As now XEA has its second HW revision - this information is printed when u-boot proper starts.
Signed-off-by: Lukasz Majewski lukma@denx.de ---
board/liebherr/xea/xea.c | 9 +++++++++ 1 file changed, 9 insertions(+)
diff --git a/board/liebherr/xea/xea.c b/board/liebherr/xea/xea.c index 5bac614153..876e8a70ab 100644 --- a/board/liebherr/xea/xea.c +++ b/board/liebherr/xea/xea.c @@ -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();

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.
Signed-off-by: Lukasz Majewski lukma@denx.de
---
board/liebherr/xea/xea.env | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/board/liebherr/xea/xea.env b/board/liebherr/xea/xea.env index ac6ac898ec..9dec4016a0 100644 --- a/board/liebherr/xea/xea.env +++ b/board/liebherr/xea/xea.env @@ -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

Hi Lukasz,
On Fri, Mar 22, 2024 at 8:43 AM Lukasz Majewski lukma@denx.de wrote:
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.
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%)
You should upstream imx28-xea-1.dts and imx28-xea-2.dts first.

Hi Fabio,
Hi Lukasz,
On Fri, Mar 22, 2024 at 8:43 AM Lukasz Majewski lukma@denx.de wrote:
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.
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%)
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: lukma@denx.de

Hi Lukasz,
On Mon, Mar 25, 2024 at 5:48 AM Lukasz Majewski lukma@denx.de wrote:
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%)
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?
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

Hi Fabio,
Hi Lukasz,
On Mon, Mar 25, 2024 at 5:48 AM Lukasz Majewski lukma@denx.de wrote:
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%)
Yes, exactly.
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.
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...
Adding -u-boot.dtsi files is OK though.
Yes, this is a good way (with /delete-node) to reduce the size.
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.
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.
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: lukma@denx.de

Hi Fabio,
Hi Lukasz,
On Mon, Mar 25, 2024 at 5:48 AM Lukasz Majewski lukma@denx.de wrote:
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%)
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?
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/i...
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: lukma@denx.de
participants (2)
-
Fabio Estevam
-
Lukasz Majewski