From patchwork Sat Jan 25 08:01:36 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lukasz Majewski X-Patchwork-Id: 240079 List-Id: U-Boot discussion From: lukma at denx.de (Lukasz Majewski) Date: Sat, 25 Jan 2020 09:01:36 +0100 Subject: [PATCH v1 1/5] arm: xea: defconfig: Define space for redundant envs in SPI-NOR flash In-Reply-To: <20200125080140.1267-1-lukma@denx.de> References: <20200125080140.1267-1-lukma@denx.de> Message-ID: <20200125080140.1267-2-lukma@denx.de> 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 --- 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 From patchwork Sat Jan 25 08:01:37 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lukasz Majewski X-Patchwork-Id: 240080 List-Id: U-Boot discussion From: lukma at denx.de (Lukasz Majewski) Date: Sat, 25 Jan 2020 09:01:37 +0100 Subject: [PATCH v1 2/5] arm: xea: Provide function to set L2 switch 'local-mac-address' property In-Reply-To: <20200125080140.1267-1-lukma@denx.de> References: <20200125080140.1267-1-lukma@denx.de> Message-ID: <20200125080140.1267-3-lukma@denx.de> 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 --- 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 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 at 800f0000" + */ + fdt_fixup_l2switch(blob); + + return 0; +} +#endif + #endif /* CONFIG_SPL_BUILD */ From patchwork Sat Jan 25 08:01:38 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lukasz Majewski X-Patchwork-Id: 240081 List-Id: U-Boot discussion From: lukma at denx.de (Lukasz Majewski) Date: Sat, 25 Jan 2020 09:01:38 +0100 Subject: [PATCH v1 3/5] arm: xea: config: Enable support for XEA board specific device tree tweaks In-Reply-To: <20200125080140.1267-1-lukma@denx.de> References: <20200125080140.1267-1-lukma@denx.de> Message-ID: <20200125080140.1267-4-lukma@denx.de> This patch enables support for CONFIG_OF_BOARD_SETUP in xea defconfig. Signed-off-by: Lukasz Majewski --- 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 From patchwork Sat Jan 25 08:01:39 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lukasz Majewski X-Patchwork-Id: 240082 List-Id: U-Boot discussion From: lukma at denx.de (Lukasz Majewski) Date: Sat, 25 Jan 2020 09:01:39 +0100 Subject: [PATCH v1 4/5] arm: xea: spl: Add GPIO0_0 setup on spl_board_init In-Reply-To: <20200125080140.1267-1-lukma@denx.de> References: <20200125080140.1267-1-lukma@denx.de> Message-ID: <20200125080140.1267-5-lukma@denx.de> 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 --- 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"); From patchwork Sat Jan 25 08:01:40 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lukasz Majewski X-Patchwork-Id: 240083 List-Id: U-Boot discussion From: lukma at denx.de (Lukasz Majewski) Date: Sat, 25 Jan 2020 09:01:40 +0100 Subject: [PATCH v1 5/5] arm: xea: dts: Add 'fec-3v3' regulator properties to prevent accidental disablement In-Reply-To: <20200125080140.1267-1-lukma@denx.de> References: <20200125080140.1267-1-lukma@denx.de> Message-ID: <20200125080140.1267-6-lukma@denx.de> 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 --- 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; }; };