All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/12] arm: xea: Provide support for different XEA board HW versions
@ 2024-03-22 11:43 Lukasz Majewski
  2024-03-22 11:43 ` [PATCH 01/12] arm: spl: xea: Remove I2S pins configuration from early initialization Lukasz Majewski
                   ` (12 more replies)
  0 siblings, 13 replies; 18+ messages in thread
From: Lukasz Majewski @ 2024-03-22 11:43 UTC (permalink / raw
  To: Stefano Babic, u-boot
  Cc: Lukasz Majewski, Anatolij Gustschin, Christian Hewitt,
	FUKAUMI Naoki, Fabio Estevam, Hai Pham, Jonas Karlman, Kever Yang,
	Marek Vasut, Mathieu Othacehe, Michal Simek, NXP i.MX U-Boot Team,
	Neil Armstrong, Simon Glass, Svyatoslav Ryhel, Tianling Shen,
	Tom Rini


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%)

-- 
2.39.2


^ permalink raw reply	[flat|nested] 18+ messages in thread

* [PATCH 01/12] arm: spl: xea: Remove I2S pins configuration from early initialization
  2024-03-22 11:43 [PATCH 00/12] arm: xea: Provide support for different XEA board HW versions Lukasz Majewski
@ 2024-03-22 11:43 ` Lukasz Majewski
  2024-03-22 11:43 ` [PATCH 02/12] arm: xea: Add support for reading SoM (CPU) and base board HW revision Lukasz Majewski
                   ` (11 subsequent siblings)
  12 siblings, 0 replies; 18+ messages in thread
From: Lukasz Majewski @ 2024-03-22 11:43 UTC (permalink / raw
  To: Stefano Babic, u-boot; +Cc: Lukasz Majewski, Tom Rini

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,
 
-- 
2.39.2


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH 02/12] arm: xea: Add support for reading SoM (CPU) and base board HW revision
  2024-03-22 11:43 [PATCH 00/12] arm: xea: Provide support for different XEA board HW versions Lukasz Majewski
  2024-03-22 11:43 ` [PATCH 01/12] arm: spl: xea: Remove I2S pins configuration from early initialization Lukasz Majewski
@ 2024-03-22 11:43 ` Lukasz Majewski
  2024-03-22 11:43 ` [PATCH 03/12] arm: xea: Rename imx28-xea.dts to imx28-xea-1.dts Lukasz Majewski
                   ` (10 subsequent siblings)
  12 siblings, 0 replies; 18+ messages in thread
From: Lukasz Majewski @ 2024-03-22 11:43 UTC (permalink / raw
  To: Stefano Babic, u-boot; +Cc: Lukasz Majewski, Anatolij Gustschin, Tom Rini

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->reg);
+	u8 id = (tmp & XEA_SOM_REV_MASK) >> XEA_SOM_REV_SHIFT;
+
+	return id;
+}
+
 static void init_clocks(void)
 {
 	/* IO0 clock at 480MHz */
-- 
2.39.2


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH 03/12] arm: xea: Rename imx28-xea.dts to imx28-xea-1.dts
  2024-03-22 11:43 [PATCH 00/12] arm: xea: Provide support for different XEA board HW versions Lukasz Majewski
  2024-03-22 11:43 ` [PATCH 01/12] arm: spl: xea: Remove I2S pins configuration from early initialization Lukasz Majewski
  2024-03-22 11:43 ` [PATCH 02/12] arm: xea: Add support for reading SoM (CPU) and base board HW revision Lukasz Majewski
@ 2024-03-22 11:43 ` Lukasz Majewski
  2024-03-22 11:43 ` [PATCH 04/12] dts: xea: Move phy-reset-gpios property to version specific DTS file Lukasz Majewski
                   ` (9 subsequent siblings)
  12 siblings, 0 replies; 18+ messages in thread
From: Lukasz Majewski @ 2024-03-22 11:43 UTC (permalink / raw
  To: Stefano Babic, u-boot
  Cc: Lukasz Majewski, Christian Hewitt, FUKAUMI Naoki, Fabio Estevam,
	Hai Pham, Jonas Karlman, Kever Yang, Marek Vasut,
	Mathieu Othacehe, Michal Simek, NXP i.MX U-Boot Team,
	Neil Armstrong, Simon Glass, Svyatoslav Ryhel, Tianling Shen,
	Tom Rini

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
-- 
2.39.2


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH 04/12] dts: xea: Move phy-reset-gpios property to version specific DTS file
  2024-03-22 11:43 [PATCH 00/12] arm: xea: Provide support for different XEA board HW versions Lukasz Majewski
                   ` (2 preceding siblings ...)
  2024-03-22 11:43 ` [PATCH 03/12] arm: xea: Rename imx28-xea.dts to imx28-xea-1.dts Lukasz Majewski
@ 2024-03-22 11:43 ` Lukasz Majewski
  2024-03-22 11:43 ` [PATCH 05/12] dts: xea: Remove outdated comment Lukasz Majewski
                   ` (8 subsequent siblings)
  12 siblings, 0 replies; 18+ messages in thread
From: Lukasz Majewski @ 2024-03-22 11:43 UTC (permalink / raw
  To: Stefano Babic, u-boot
  Cc: Lukasz Majewski, Fabio Estevam, NXP i.MX U-Boot Team, Tom Rini

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 = <&reg_fec_3v3>;
-	phy-reset-gpios = <&gpio2 13 GPIO_ACTIVE_LOW>;
 	phy-reset-duration = <1>;
 	phy-reset-post-delay = <1>;
 	status = "okay";
-- 
2.39.2


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH 05/12] dts: xea: Remove outdated comment
  2024-03-22 11:43 [PATCH 00/12] arm: xea: Provide support for different XEA board HW versions Lukasz Majewski
                   ` (3 preceding siblings ...)
  2024-03-22 11:43 ` [PATCH 04/12] dts: xea: Move phy-reset-gpios property to version specific DTS file Lukasz Majewski
@ 2024-03-22 11:43 ` Lukasz Majewski
  2024-03-22 11:43 ` [PATCH 06/12] arm: xea: Add support for multiple dtbs in u-boot Lukasz Majewski
                   ` (7 subsequent siblings)
  12 siblings, 0 replies; 18+ messages in thread
From: Lukasz Majewski @ 2024-03-22 11:43 UTC (permalink / raw
  To: Stefano Babic, u-boot
  Cc: Lukasz Majewski, Fabio Estevam, NXP i.MX U-Boot Team, Tom Rini

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 {
-- 
2.39.2


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH 06/12] arm: xea: Add support for multiple dtbs in u-boot
  2024-03-22 11:43 [PATCH 00/12] arm: xea: Provide support for different XEA board HW versions Lukasz Majewski
                   ` (4 preceding siblings ...)
  2024-03-22 11:43 ` [PATCH 05/12] dts: xea: Remove outdated comment Lukasz Majewski
@ 2024-03-22 11:43 ` Lukasz Majewski
  2024-03-22 11:43 ` [PATCH 07/12] dts: xea: Add device tree description for XEA HW rev. 2 Lukasz Majewski
                   ` (6 subsequent siblings)
  12 siblings, 0 replies; 18+ messages in thread
From: Lukasz Majewski @ 2024-03-22 11:43 UTC (permalink / raw
  To: Stefano Babic, u-boot; +Cc: Lukasz Majewski, Anatolij Gustschin, Tom Rini

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)
 {
-- 
2.39.2


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH 07/12] dts: xea: Add device tree description for XEA HW rev. 2
  2024-03-22 11:43 [PATCH 00/12] arm: xea: Provide support for different XEA board HW versions Lukasz Majewski
                   ` (5 preceding siblings ...)
  2024-03-22 11:43 ` [PATCH 06/12] arm: xea: Add support for multiple dtbs in u-boot Lukasz Majewski
@ 2024-03-22 11:43 ` Lukasz Majewski
  2024-03-22 11:43 ` [PATCH 08/12] arm: spl: Add definition for PHY reset GPIO " Lukasz Majewski
                   ` (5 subsequent siblings)
  12 siblings, 0 replies; 18+ messages in thread
From: Lukasz Majewski @ 2024-03-22 11:43 UTC (permalink / raw
  To: Stefano Babic, u-boot
  Cc: Lukasz Majewski, FUKAUMI Naoki, Fabio Estevam, Hai Pham,
	Jonas Karlman, Kever Yang, Marek Vasut, Mathieu Othacehe,
	Michal Simek, NXP i.MX U-Boot Team, Neil Armstrong,
	Svyatoslav Ryhel, Tianling Shen, Tom Rini

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"
-- 
2.39.2


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH 08/12] arm: spl: Add definition for PHY reset GPIO for XEA HW rev. 2
  2024-03-22 11:43 [PATCH 00/12] arm: xea: Provide support for different XEA board HW versions Lukasz Majewski
                   ` (6 preceding siblings ...)
  2024-03-22 11:43 ` [PATCH 07/12] dts: xea: Add device tree description for XEA HW rev. 2 Lukasz Majewski
@ 2024-03-22 11:43 ` Lukasz Majewski
  2024-03-22 11:43 ` [PATCH 09/12] arm: config: xea: Enable support for multiple DTBs for XEA board Lukasz Majewski
                   ` (4 subsequent siblings)
  12 siblings, 0 replies; 18+ messages in thread
From: Lukasz Majewski @ 2024-03-22 11:43 UTC (permalink / raw
  To: Stefano Babic, u-boot; +Cc: Lukasz Majewski, Tom Rini

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 */
-- 
2.39.2


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH 09/12] arm: config: xea: Enable support for multiple DTBs for XEA board
  2024-03-22 11:43 [PATCH 00/12] arm: xea: Provide support for different XEA board HW versions Lukasz Majewski
                   ` (7 preceding siblings ...)
  2024-03-22 11:43 ` [PATCH 08/12] arm: spl: Add definition for PHY reset GPIO " Lukasz Majewski
@ 2024-03-22 11:43 ` Lukasz Majewski
  2024-03-22 11:43 ` [PATCH 10/12] config: xea: Enable late board initialization to set revision variable Lukasz Majewski
                   ` (3 subsequent siblings)
  12 siblings, 0 replies; 18+ messages in thread
From: Lukasz Majewski @ 2024-03-22 11:43 UTC (permalink / raw
  To: Stefano Babic, u-boot; +Cc: Lukasz Majewski, Simon Glass, Tom Rini

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
-- 
2.39.2


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH 10/12] config: xea: Enable late board initialization to set revision variable
  2024-03-22 11:43 [PATCH 00/12] arm: xea: Provide support for different XEA board HW versions Lukasz Majewski
                   ` (8 preceding siblings ...)
  2024-03-22 11:43 ` [PATCH 09/12] arm: config: xea: Enable support for multiple DTBs for XEA board Lukasz Majewski
@ 2024-03-22 11:43 ` Lukasz Majewski
  2024-03-22 11:43 ` [PATCH 11/12] arm: xea: Print information about XEA's SoM HW revision Lukasz Majewski
                   ` (2 subsequent siblings)
  12 siblings, 0 replies; 18+ messages in thread
From: Lukasz Majewski @ 2024-03-22 11:43 UTC (permalink / raw
  To: Stefano Babic, u-boot
  Cc: Lukasz Majewski, Anatolij Gustschin, Simon Glass, Tom Rini

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
-- 
2.39.2


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH 11/12] arm: xea: Print information about XEA's SoM HW revision
  2024-03-22 11:43 [PATCH 00/12] arm: xea: Provide support for different XEA board HW versions Lukasz Majewski
                   ` (9 preceding siblings ...)
  2024-03-22 11:43 ` [PATCH 10/12] config: xea: Enable late board initialization to set revision variable Lukasz Majewski
@ 2024-03-22 11:43 ` Lukasz Majewski
  2024-03-22 11:43 ` [PATCH 12/12] arm: env: Add support for booting different HW revisions of XEA boards Lukasz Majewski
  2024-03-22 13:47 ` [PATCH 00/12] arm: xea: Provide support for different XEA board HW versions Fabio Estevam
  12 siblings, 0 replies; 18+ messages in thread
From: Lukasz Majewski @ 2024-03-22 11:43 UTC (permalink / raw
  To: Stefano Babic, u-boot; +Cc: Lukasz Majewski, Anatolij Gustschin, Tom Rini

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();
-- 
2.39.2


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH 12/12] arm: env: Add support for booting different HW revisions of XEA boards
  2024-03-22 11:43 [PATCH 00/12] arm: xea: Provide support for different XEA board HW versions Lukasz Majewski
                   ` (10 preceding siblings ...)
  2024-03-22 11:43 ` [PATCH 11/12] arm: xea: Print information about XEA's SoM HW revision Lukasz Majewski
@ 2024-03-22 11:43 ` Lukasz Majewski
  2024-03-22 13:47 ` [PATCH 00/12] arm: xea: Provide support for different XEA board HW versions Fabio Estevam
  12 siblings, 0 replies; 18+ messages in thread
From: Lukasz Majewski @ 2024-03-22 11:43 UTC (permalink / raw
  To: Stefano Babic, u-boot; +Cc: Lukasz Majewski, Tom Rini

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
-- 
2.39.2


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* Re: [PATCH 00/12] arm: xea: Provide support for different XEA board HW versions
  2024-03-22 11:43 [PATCH 00/12] arm: xea: Provide support for different XEA board HW versions Lukasz Majewski
                   ` (11 preceding siblings ...)
  2024-03-22 11:43 ` [PATCH 12/12] arm: env: Add support for booting different HW revisions of XEA boards Lukasz Majewski
@ 2024-03-22 13:47 ` Fabio Estevam
  2024-03-25  8:48   ` Lukasz Majewski
  12 siblings, 1 reply; 18+ messages in thread
From: Fabio Estevam @ 2024-03-22 13:47 UTC (permalink / raw
  To: Lukasz Majewski
  Cc: Stefano Babic, u-boot, Anatolij Gustschin, Christian Hewitt,
	FUKAUMI Naoki, Hai Pham, Jonas Karlman, Kever Yang, Marek Vasut,
	Mathieu Othacehe, Michal Simek, NXP i.MX U-Boot Team,
	Neil Armstrong, Simon Glass, Svyatoslav Ryhel, Tianling Shen,
	Tom Rini

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.

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 00/12] arm: xea: Provide support for different XEA board HW versions
  2024-03-22 13:47 ` [PATCH 00/12] arm: xea: Provide support for different XEA board HW versions Fabio Estevam
@ 2024-03-25  8:48   ` Lukasz Majewski
  2024-03-26 11:05     ` Fabio Estevam
  0 siblings, 1 reply; 18+ messages in thread
From: Lukasz Majewski @ 2024-03-25  8:48 UTC (permalink / raw
  To: Fabio Estevam
  Cc: Stefano Babic, u-boot, Anatolij Gustschin, Christian Hewitt,
	FUKAUMI Naoki, Hai Pham, Jonas Karlman, Kever Yang, Marek Vasut,
	Mathieu Othacehe, Michal Simek, NXP i.MX U-Boot Team,
	Neil Armstrong, Simon Glass, Svyatoslav Ryhel, Tianling Shen,
	Tom Rini

[-- Attachment #1: Type: text/plain, Size: 2039 bytes --]

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

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 00/12] arm: xea: Provide support for different XEA board HW versions
  2024-03-25  8:48   ` Lukasz Majewski
@ 2024-03-26 11:05     ` Fabio Estevam
  2024-03-26 13:50       ` Lukasz Majewski
  2024-03-27 12:05       ` Lukasz Majewski
  0 siblings, 2 replies; 18+ messages in thread
From: Fabio Estevam @ 2024-03-26 11:05 UTC (permalink / raw
  To: Lukasz Majewski
  Cc: Stefano Babic, u-boot, Anatolij Gustschin, Christian Hewitt,
	FUKAUMI Naoki, Hai Pham, Jonas Karlman, Kever Yang, Marek Vasut,
	Mathieu Othacehe, Michal Simek, NXP i.MX U-Boot Team,
	Neil Armstrong, Simon Glass, Svyatoslav Ryhel, Tianling Shen,
	Tom Rini

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

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 00/12] arm: xea: Provide support for different XEA board HW versions
  2024-03-26 11:05     ` Fabio Estevam
@ 2024-03-26 13:50       ` Lukasz Majewski
  2024-03-27 12:05       ` Lukasz Majewski
  1 sibling, 0 replies; 18+ messages in thread
From: Lukasz Majewski @ 2024-03-26 13:50 UTC (permalink / raw
  To: Fabio Estevam
  Cc: Stefano Babic, u-boot, Anatolij Gustschin, Christian Hewitt,
	FUKAUMI Naoki, Hai Pham, Jonas Karlman, Kever Yang, Marek Vasut,
	Mathieu Othacehe, Michal Simek, NXP i.MX U-Boot Team,
	Neil Armstrong, Simon Glass, Svyatoslav Ryhel, Tianling Shen,
	Tom Rini

[-- Attachment #1: Type: text/plain, Size: 2148 bytes --]

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

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 00/12] arm: xea: Provide support for different XEA board HW versions
  2024-03-26 11:05     ` Fabio Estevam
  2024-03-26 13:50       ` Lukasz Majewski
@ 2024-03-27 12:05       ` Lukasz Majewski
  1 sibling, 0 replies; 18+ messages in thread
From: Lukasz Majewski @ 2024-03-27 12:05 UTC (permalink / raw
  To: Fabio Estevam
  Cc: Stefano Babic, u-boot, Anatolij Gustschin, Christian Hewitt,
	FUKAUMI Naoki, Hai Pham, Jonas Karlman, Kever Yang, Marek Vasut,
	Mathieu Othacehe, Michal Simek, NXP i.MX U-Boot Team,
	Neil Armstrong, Simon Glass, Svyatoslav Ryhel, Tianling Shen,
	Tom Rini

[-- Attachment #1: Type: text/plain, Size: 2676 bytes --]

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/imx28-xea.dts

> 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

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2024-03-27 12:05 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-22 11:43 [PATCH 00/12] arm: xea: Provide support for different XEA board HW versions Lukasz Majewski
2024-03-22 11:43 ` [PATCH 01/12] arm: spl: xea: Remove I2S pins configuration from early initialization Lukasz Majewski
2024-03-22 11:43 ` [PATCH 02/12] arm: xea: Add support for reading SoM (CPU) and base board HW revision Lukasz Majewski
2024-03-22 11:43 ` [PATCH 03/12] arm: xea: Rename imx28-xea.dts to imx28-xea-1.dts Lukasz Majewski
2024-03-22 11:43 ` [PATCH 04/12] dts: xea: Move phy-reset-gpios property to version specific DTS file Lukasz Majewski
2024-03-22 11:43 ` [PATCH 05/12] dts: xea: Remove outdated comment Lukasz Majewski
2024-03-22 11:43 ` [PATCH 06/12] arm: xea: Add support for multiple dtbs in u-boot Lukasz Majewski
2024-03-22 11:43 ` [PATCH 07/12] dts: xea: Add device tree description for XEA HW rev. 2 Lukasz Majewski
2024-03-22 11:43 ` [PATCH 08/12] arm: spl: Add definition for PHY reset GPIO " Lukasz Majewski
2024-03-22 11:43 ` [PATCH 09/12] arm: config: xea: Enable support for multiple DTBs for XEA board Lukasz Majewski
2024-03-22 11:43 ` [PATCH 10/12] config: xea: Enable late board initialization to set revision variable Lukasz Majewski
2024-03-22 11:43 ` [PATCH 11/12] arm: xea: Print information about XEA's SoM HW revision Lukasz Majewski
2024-03-22 11:43 ` [PATCH 12/12] arm: env: Add support for booting different HW revisions of XEA boards Lukasz Majewski
2024-03-22 13:47 ` [PATCH 00/12] arm: xea: Provide support for different XEA board HW versions Fabio Estevam
2024-03-25  8:48   ` Lukasz Majewski
2024-03-26 11:05     ` Fabio Estevam
2024-03-26 13:50       ` Lukasz Majewski
2024-03-27 12:05       ` Lukasz Majewski

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.