From 8a28f12b199e8d6e107006c9849340ce55d0e339 Mon Sep 17 00:00:00 2001 From: Hiago De Franco Date: Thu, 23 Nov 2023 13:04:37 -0300 Subject: u-boot-toradex: Backport patch to fix Colibri iMX7S U-Boot error The following error was spotted during the boot of Colibri iMX7S on Tezi 6: ``` U-Boot 2022.07-6.4.0-devel+git.e092e3250270 (Jul 11 2022 - 13:42:58 +0000) CPU: Freescale i.MX7S rev1.2 800 MHz (running at 792 MHz) CPU: Extended Commercial temperature grade (-20C to 105C) at 29C Reset cause: POR DRAM: initcall sequence 8786b820 failed at call 87818e09 (err=-3) \### ERROR ### Please RESET the board ### ``` This patch solves this issue by calling fdt_increase_size() on colibri_imx7.c file. Related-to: TEI-1138 Signed-off-by: Hiago De Franco (cherry picked from commit 30484414981f3652caf43a0a71b3922e269a643b) --- .../0001-colibri-imx7-Call-fdt_increase_size.patch | 66 ++++++++++++++++++++++ recipes-bsp/u-boot/u-boot-toradex_2022.07.bb | 1 + 2 files changed, 67 insertions(+) create mode 100644 recipes-bsp/u-boot/u-boot-toradex/0001-colibri-imx7-Call-fdt_increase_size.patch diff --git a/recipes-bsp/u-boot/u-boot-toradex/0001-colibri-imx7-Call-fdt_increase_size.patch b/recipes-bsp/u-boot/u-boot-toradex/0001-colibri-imx7-Call-fdt_increase_size.patch new file mode 100644 index 0000000..723e903 --- /dev/null +++ b/recipes-bsp/u-boot/u-boot-toradex/0001-colibri-imx7-Call-fdt_increase_size.patch @@ -0,0 +1,66 @@ +From 92be5e4f74130f704357b8f96d62ae92eb79a2f2 Mon Sep 17 00:00:00 2001 +From: Fabio Estevam +Date: Tue, 4 Jul 2023 14:09:45 -0300 +Subject: [PATCH] colibri-imx7: Call fdt_increase_size() + +For changing the USB OTG node status from "okay" to "disabled" more +space is needed, so call fdt_increase_size() to avoid the following +error: + +``` + U-Boot 2023.07-rc5-0.0.0-devel+git.580eb31199be (Jun 27 2023 - 13:39:58 +0000) + CPU: Freescale i.MX7S rev1.2 800 MHz (running at 792 MHz) + CPU: Extended Commercial temperature grade (-20C to 105C) at 30C + Reset cause: POR + DRAM: initcall sequence 8786eafc failed at call 8781b351 (err=-3) + ### ERROR ### Please RESET the board ### +``` + +Ideally, fdt_status_disabled() should call fdt_increase_size() internally, +so that there would be no need for manually calling it in board code. + +Do it manually for now to fix the regression. + +Based on the code from board/CZ.NIC/turris_omnia/turris_omnia.c. + +Upstream-Status: Backport [92be5e4f74130f704357b8f96d62ae92eb79a2f2] + +Reported-by: Francesco Dolcini +Signed-off-by: Fabio Estevam +Reviewed-by: Francesco Dolcini +Tested-by: Francesco Dolcini # Toradex Colibri iMX7S +--- + board/toradex/colibri_imx7/colibri_imx7.c | 13 +++++++++++++ + 1 file changed, 13 insertions(+) + +diff --git a/board/toradex/colibri_imx7/colibri_imx7.c b/board/toradex/colibri_imx7/colibri_imx7.c +index 3e79ab93a9..119e67b47f 100644 +--- a/board/toradex/colibri_imx7/colibri_imx7.c ++++ b/board/toradex/colibri_imx7/colibri_imx7.c +@@ -311,10 +311,23 @@ int ft_board_setup(void *blob, struct bd_info *bd) + #ifdef CONFIG_USB_EHCI_MX7 + int board_fix_fdt(void *rw_fdt_blob) + { ++ int ret; ++ + /* i.MX 7Solo has only one single USB OTG1 but no USB host port */ + if (is_cpu_type(MXC_CPU_MX7S)) { + int offset = fdt_path_offset(rw_fdt_blob, "/soc/bus@30800000/usb@30b20000"); + ++ /* ++ * We're changing from status = "okay" to status = "disabled". ++ * In this case we'll need more space, so increase the size ++ * a little bit. ++ */ ++ ret = fdt_increase_size(rw_fdt_blob, 32); ++ if (ret < 0) { ++ printf("Cannot increase FDT size: %d\n", ret); ++ return ret; ++ } ++ + return fdt_status_disabled(rw_fdt_blob, offset); + } + +-- +2.42.0 + diff --git a/recipes-bsp/u-boot/u-boot-toradex_2022.07.bb b/recipes-bsp/u-boot/u-boot-toradex_2022.07.bb index 33cddc5..313dc7b 100644 --- a/recipes-bsp/u-boot/u-boot-toradex_2022.07.bb +++ b/recipes-bsp/u-boot/u-boot-toradex_2022.07.bb @@ -27,4 +27,5 @@ TDX_PATCHES = " \ file://0001-arm-dts-Makefile-Prevent-build-errors-from-other-imx.patch \ file://0001-apalis-colibri-imx6-imx6ull-imx7-defconfig-Enable-fa.patch \ file://0002-board-apalis-colibri-imx6-imx6ull-imx7-Add-fastboot-.patch \ + file://0001-colibri-imx7-Call-fdt_increase_size.patch \ " -- cgit v1.2.3