Skip to contentSkip to conversation

arm: xea: Enhancements for i.MX28 based XEA board

PATCH New Lukasz Majewski 2 participants 11 messages Jan 25, 2020 – Feb 10, 2020

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

cover arm: xea: Enhancements for i.MX28 based XEA board

This patch set provides some enhancements for i.MX28 based XEA board. The most notably one is the ethaddr setup for L2 switch based design and the code to very early enable fec regulator.

Lukasz Majewski (5):
arm: xea: defconfig: Define space for redundant envs in SPI-NOR flash
arm: xea: Provide function to set L2 switch 'local-mac-address'
property
arm: xea: config: Enable support for XEA board specific device tree
tweaks
arm: xea: spl: Add GPIO0_0 setup on spl_board_init
arm: xea: dts: Add 'fec-3v3' regulator properties to prevent
accidental disablement

 arch/arm/dts/imx28-xea.dts  |  2 ++
 board/liebherr/xea/xea.c    | 49 ++++++++++++++++++++++++++++++++++++-
 configs/imx28_xea_defconfig |  3 +++
 3 files changed, 53 insertions(+), 1 deletion(-)
Signature · 1 line
2.20.1
#1 lore raw

PATCH 1/5 arm: xea: defconfig: Define space for redundant envs in SPI-NOR flash

Redundant envs help with assuring better reliability for the system as they prevent from the situation when envs are stored only in a single place.

---

 configs/imx28_xea_defconfig | 2 ++
 1 file changed, 2 insertions(+)
configs/imx28_xea_defconfig +2 -0
index 02c66bda30..7281e86d96 100644
@@ -67,6 +67,8 @@ CONFIG_USE_ENV_SPI_MAX_HZ=y
 CONFIG_ENV_SPI_MAX_HZ=40000000
 CONFIG_USE_ENV_SPI_MODE=y
 CONFIG_ENV_SPI_MODE=0x0
+CONFIG_SYS_REDUNDAND_ENVIRONMENT=y
+CONFIG_ENV_OFFSET_REDUND=0x90000
 CONFIG_NET_RANDOM_ETHADDR=y
 CONFIG_DM=y
 CONFIG_SPL_DM=y
Signature · 1 line
2.20.1
#2 lore raw

PATCH 1/5 arm: xea: defconfig: Define space for redundant envs in SPI-NOR flash

Quoted 3 lines

Redundant envs help with assuring better reliability for the system as they prevent from the situation when envs are stored only in a single place.

Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

Signature · 5 lines
=====================================================================
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================
#3 lore raw

PATCH 2/5 arm: xea: Provide function to set L2 switch 'local-mac-address' property

In reply to Lukasz Majewski

The 'local-mac-address' property needs to be adjusted to the MAC address value stored in U-Boot's 'ethaddr' env variable.

---

 board/liebherr/xea/xea.c | 32 ++++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)
board/liebherr/xea/xea.c +32 -0
index 1d47f67a7f..bdc073664c 100644
@@ -150,4 +150,36 @@ int dram_init(void)
 	return mxs_dram_init();
 }
 
+#ifdef CONFIG_OF_BOARD_SETUP
+static int fdt_fixup_l2switch(void *blob)
+{
+	u8 ethaddr[6];
+	int ret;
+
+	if (eth_env_get_enetaddr("ethaddr", ethaddr)) {
+		ret = fdt_find_and_setprop(blob,
+					   "/ahb at 80080000/switch at 800f0000",
+					   "local-mac-address", ethaddr, 6, 1);
+		if (ret < 0)
+			printf("%s: can't find usbether at 1 node: %d\n",
+			       __func__, ret);
+	}
+
+	return 0;
+}
+
+int ft_board_setup(void *blob, bd_t *bd)
+{
+	/*
+	 * i.MX28 L2 switch needs manual update (fixup) of eth MAC address
+	 * (in 'local-mac-address' property) as it uses "switch at 800f0000"
+	 * node, not set by default FIT image handling code in
+	 * "ethernet@800f0000"
+	 */
+	fdt_fixup_l2switch(blob);
+
+	return 0;
+}
+#endif
+
 #endif	/* CONFIG_SPL_BUILD */
Signature · 1 line
2.20.1
#4 lore raw

PATCH 2/5 arm: xea: Provide function to set L2 switch 'local-mac-address' property

Quoted 3 lines

The 'local-mac-address' property needs to be adjusted to the MAC address value stored in U-Boot's 'ethaddr' env variable.

Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

Signature · 5 lines
=====================================================================
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================
#5 lore raw

PATCH 3/5 arm: xea: config: Enable support for XEA board specific device tree tweaks

In reply to Lukasz Majewski

This patch enables support for CONFIG_OF_BOARD_SETUP in xea defconfig.

---

 configs/imx28_xea_defconfig | 1 +
 1 file changed, 1 insertion(+)
configs/imx28_xea_defconfig +1 -0
index 7281e86d96..ef83e4d3ff 100644
@@ -18,6 +18,7 @@ CONFIG_SPL_SPI_FLASH_SUPPORT=y
 CONFIG_SPL_SPI_SUPPORT=y
 CONFIG_SPL_TEXT_BASE=0x1000
 CONFIG_FIT=y
+CONFIG_OF_BOARD_SETUP=y
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_SPL_BOARD_INIT=y
 # CONFIG_SPL_RAW_IMAGE_SUPPORT is not set
Signature · 1 line
2.20.1
#6 lore raw

PATCH 3/5 arm: xea: config: Enable support for XEA board specific device tree tweaks

Quoted 2 lines

This patch enables support for CONFIG_OF_BOARD_SETUP in xea defconfig.

Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

Signature · 5 lines
=====================================================================
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================
#7 lore raw

PATCH 4/5 arm: xea: spl: Add GPIO0_0 setup on spl_board_init

In reply to Lukasz Majewski

Explicitly configure GPIO0_0 in SPL, which controlls 3V3 voltage on the XEA board (it also supplies TIVAs).

This code would enable TIVAs power supply early (also when board uses the falcon boot).

---

 board/liebherr/xea/xea.c | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)
board/liebherr/xea/xea.c +16 -1
index bdc073664c..df5d316717 100644
@@ -64,9 +64,24 @@ static int boot_tiva0, boot_tiva1;
 /* Check if TIVAs request booting via U-Boot proper */
 void spl_board_init(void)
 {
-	struct gpio_desc btiva0, btiva1;
+	struct gpio_desc btiva0, btiva1, en_3_3v;
 	int ret;
 
+	/*
+	 * Setup GPIO0_0 (TIVA power enable pin) to be output high
+	 * to allow TIVA startup.
+	 */
+	ret = dm_gpio_lookup_name("GPIO0_0", &en_3_3v);
+	if (ret)
+		printf("Cannot get GPIO0_0\n");
+
+	ret = dm_gpio_request(&en_3_3v, "pwr_3_3v");
+	if (ret)
+		printf("Cannot request GPIO0_0\n");
+
+	/* Set GPIO0_0 to HIGH */
+	dm_gpio_set_dir_flags(&en_3_3v, GPIOD_IS_OUT | GPIOD_IS_OUT_ACTIVE);
+
 	ret = dm_gpio_lookup_name("GPIO0_23", &btiva0);
 	if (ret)
 		printf("Cannot get GPIO0_23\n");
Signature · 1 line
2.20.1
#8 lore raw

PATCH 4/5 arm: xea: spl: Add GPIO0_0 setup on spl_board_init

Quoted 5 lines

Explicitly configure GPIO0_0 in SPL, which controlls 3V3 voltage on the XEA board (it also supplies TIVAs).
This code would enable TIVAs power supply early (also when board uses the falcon boot).

Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

Signature · 5 lines
=====================================================================
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================
#9 lore raw

PATCH 5/5 arm: xea: dts: Add 'fec-3v3' regulator properties to prevent accidental disablement

In reply to Lukasz Majewski

The 'enable-active-high' DTS property configures GPIO so it is active with HIGH state (by default it is low).

The 'regulator-boot-on' property indicates that the regulator was enabled in the 'earlier' stage - i.e. bootloader/firmware.
In the XEA case the 'fec-3v3' was configured (as a "wrapper" on GPIO0_0) in very early SPL code, so it shouldn't be modified at latter stages.

---

 arch/arm/dts/imx28-xea.dts | 2 ++
 1 file changed, 2 insertions(+)
arch/arm/dts/imx28-xea.dts +2 -0
index 5de6774c5a..de049042f8 100644
@@ -38,6 +38,8 @@
 		regulator-min-microvolt = <3300000>;
 		regulator-max-microvolt = <3300000>;
 		gpio = <&gpio0 0 GPIO_ACTIVE_HIGH>;
+		enable-active-high;
+		regulator-boot-on;
 	};
 };
 
Signature · 1 line
2.20.1
#10 lore raw

PATCH 5/5 arm: xea: dts: Add 'fec-3v3' regulator properties to prevent accidental disablement

Quoted 7 lines

The 'enable-active-high' DTS property configures GPIO so it is active with HIGH state (by default it is low).
The 'regulator-boot-on' property indicates that the regulator was enabled in the 'earlier' stage - i.e. bootloader/firmware.
In the XEA case the 'fec-3v3' was configured (as a "wrapper" on GPIO0_0) in very early SPL code, so it shouldn't be modified at latter stages.

Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

Signature · 5 lines
=====================================================================
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================