[PATCH v1 0/5] 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(-)

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.
Signed-off-by: Lukasz Majewski lukma@denx.de ---
configs/imx28_xea_defconfig | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/configs/imx28_xea_defconfig b/configs/imx28_xea_defconfig index 02c66bda30..7281e86d96 100644 --- a/configs/imx28_xea_defconfig +++ b/configs/imx28_xea_defconfig @@ -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

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. Signed-off-by: Lukasz Majewski lukma@denx.de
Applied to u-boot-imx, master, thanks !
Best regards, Stefano Babic

The 'local-mac-address' property needs to be adjusted to the MAC address value stored in U-Boot's 'ethaddr' env variable.
Signed-off-by: Lukasz Majewski lukma@denx.de ---
board/liebherr/xea/xea.c | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+)
diff --git a/board/liebherr/xea/xea.c b/board/liebherr/xea/xea.c index 1d47f67a7f..bdc073664c 100644 --- a/board/liebherr/xea/xea.c +++ b/board/liebherr/xea/xea.c @@ -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@80080000/switch@800f0000", + "local-mac-address", ethaddr, 6, 1); + if (ret < 0) + printf("%s: can't find usbether@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@800f0000" + * node, not set by default FIT image handling code in + * "ethernet@800f0000" + */ + fdt_fixup_l2switch(blob); + + return 0; +} +#endif + #endif /* CONFIG_SPL_BUILD */

The 'local-mac-address' property needs to be adjusted to the MAC address value stored in U-Boot's 'ethaddr' env variable. Signed-off-by: Lukasz Majewski lukma@denx.de
Applied to u-boot-imx, master, thanks !
Best regards, Stefano Babic

This patch enables support for CONFIG_OF_BOARD_SETUP in xea defconfig.
Signed-off-by: Lukasz Majewski lukma@denx.de ---
configs/imx28_xea_defconfig | 1 + 1 file changed, 1 insertion(+)
diff --git a/configs/imx28_xea_defconfig b/configs/imx28_xea_defconfig index 7281e86d96..ef83e4d3ff 100644 --- a/configs/imx28_xea_defconfig +++ b/configs/imx28_xea_defconfig @@ -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

This patch enables support for CONFIG_OF_BOARD_SETUP in xea defconfig. Signed-off-by: Lukasz Majewski lukma@denx.de
Applied to u-boot-imx, master, thanks !
Best regards, Stefano Babic

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).
Signed-off-by: Lukasz Majewski lukma@denx.de ---
board/liebherr/xea/xea.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-)
diff --git a/board/liebherr/xea/xea.c b/board/liebherr/xea/xea.c index bdc073664c..df5d316717 100644 --- a/board/liebherr/xea/xea.c +++ b/board/liebherr/xea/xea.c @@ -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");

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). Signed-off-by: Lukasz Majewski lukma@denx.de
Applied to u-boot-imx, master, thanks !
Best regards, Stefano Babic

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.
Signed-off-by: Lukasz Majewski lukma@denx.de ---
arch/arm/dts/imx28-xea.dts | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/arch/arm/dts/imx28-xea.dts b/arch/arm/dts/imx28-xea.dts index 5de6774c5a..de049042f8 100644 --- a/arch/arm/dts/imx28-xea.dts +++ b/arch/arm/dts/imx28-xea.dts @@ -38,6 +38,8 @@ regulator-min-microvolt = <3300000>; regulator-max-microvolt = <3300000>; gpio = <&gpio0 0 GPIO_ACTIVE_HIGH>; + enable-active-high; + regulator-boot-on; }; };

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. Signed-off-by: Lukasz Majewski lukma@denx.de
Applied to u-boot-imx, master, thanks !
Best regards, Stefano Babic
participants (2)
-
Lukasz Majewski
-
sbabic@denx.de