diff options
65 files changed, 865 insertions, 952 deletions
@@ -20,6 +20,8 @@ Allen Martin <amartin@nvidia.com> Andreas Bießmann <andreas.devel@googlemail.com> Andreas Bießmann <andreas@biessmann.org> Aneesh V <aneesh@ti.com> +Anup Patel <anup@brainfault.org> <anup.patel@wdc.com> +Atish Patra <atishp@atishpatra.org> <atish.patra@wdc.com> Boris Brezillon <bbrezillon@kernel.org> <boris.brezillon@bootlin.com> Boris Brezillon <bbrezillon@kernel.org> <boris.brezillon@free-electrons.com> Dirk Behme <dirk.behme@googlemail.com> @@ -3,7 +3,7 @@ VERSION = 2022 PATCHLEVEL = 01 SUBLEVEL = -EXTRAVERSION = -rc4 +EXTRAVERSION = NAME = # *DOCUMENTATION* @@ -1327,6 +1327,7 @@ cmd_binman = $(srctree)/tools/binman/binman $(if $(BINMAN_DEBUG),-D) \ -a tpl-bss-pad=$(if $(CONFIG_TPL_SEPARATE_BSS),,1) \ -a spl-dtb=$(CONFIG_SPL_OF_REAL) \ -a tpl-dtb=$(CONFIG_TPL_OF_REAL) \ + $(if $(BINMAN_FAKE_EXT_BLOBS),--fake-ext-blobs) \ $(BINMAN_$(@F)) OBJCOPYFLAGS_u-boot.ldr.hex := -I binary -O ihex diff --git a/arch/arm/dts/imx6qdl-udoo.dtsi b/arch/arm/dts/imx6qdl-udoo.dtsi index d07d8f8345..2d0d102661 100644 --- a/arch/arm/dts/imx6qdl-udoo.dtsi +++ b/arch/arm/dts/imx6qdl-udoo.dtsi @@ -4,7 +4,7 @@ * * Author: Fabio Estevam <fabio.estevam@freescale.com> */ - +#include <dt-bindings/gpio/gpio.h> / { aliases { backlight = &backlight; @@ -226,6 +226,7 @@ MX6QDL_PAD_SD3_DAT1__SD3_DATA1 0x17059 MX6QDL_PAD_SD3_DAT2__SD3_DATA2 0x17059 MX6QDL_PAD_SD3_DAT3__SD3_DATA3 0x17059 + MX6QDL_PAD_SD3_DAT5__GPIO7_IO00 0x1b0b0 >; }; @@ -304,7 +305,7 @@ &usdhc3 { pinctrl-names = "default"; pinctrl-0 = <&pinctrl_usdhc3>; - non-removable; + cd-gpios = <&gpio7 0 GPIO_ACTIVE_LOW>; status = "okay"; }; diff --git a/arch/arm/dts/imx6sx-udoo-neo-u-boot.dtsi b/arch/arm/dts/imx6sx-udoo-neo-u-boot.dtsi deleted file mode 100644 index daf2489cfd..0000000000 --- a/arch/arm/dts/imx6sx-udoo-neo-u-boot.dtsi +++ /dev/null @@ -1,7 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0+ - -/ { - aliases { - mmc0 = &usdhc2; - }; -}; diff --git a/arch/arm/dts/imx8mm-cl-iot-gate-optee-u-boot.dtsi b/arch/arm/dts/imx8mm-cl-iot-gate-optee-u-boot.dtsi index 12065935e4..5cbc70faaa 100644 --- a/arch/arm/dts/imx8mm-cl-iot-gate-optee-u-boot.dtsi +++ b/arch/arm/dts/imx8mm-cl-iot-gate-optee-u-boot.dtsi @@ -3,74 +3,50 @@ * Copyright 2019 NXP */ -/ { - binman: binman { - multiple-images; - }; - - wdt-reboot { - compatible = "wdt-reboot"; - wdt = <&wdog1>; - u-boot,dm-spl; - }; +#include "imx8mm-u-boot.dtsi" +/ { firmware { optee { compatible = "linaro,optee-tz"; method = "smc"; }; }; -}; - -&{/soc@0} { - u-boot,dm-pre-reloc; - u-boot,dm-spl; -}; - -&clk { - u-boot,dm-spl; - u-boot,dm-pre-reloc; - /delete-property/ assigned-clocks; - /delete-property/ assigned-clock-parents; - /delete-property/ assigned-clock-rates; -}; - -&osc_24m { - u-boot,dm-spl; - u-boot,dm-pre-reloc; -}; - -&aips1 { - u-boot,dm-spl; - u-boot,dm-pre-reloc; -}; -&aips2 { - u-boot,dm-spl; + wdt-reboot { + compatible = "wdt-reboot"; + u-boot,dm-spl; + wdt = <&wdog1>; + }; }; -&aips3 { +&{/soc@0/bus@30800000/i2c@30a30000/pmic@4b} { u-boot,dm-spl; }; -&iomuxc { +&{/soc@0/bus@30800000/i2c@30a30000/pmic@4b/regulators} { u-boot,dm-spl; }; -&pinctrl_uart3 { - u-boot,dm-spl; -}; +&binman_fip { + arch = "arm64"; + compression = "none"; + description = "Trusted Firmware FIP"; + load = <0x40310000>; + type = "firmware"; -&pinctrl_usdhc2_gpio { - u-boot,dm-spl; + fip_blob { + filename = "fip.bin"; + type = "blob-ext"; + }; }; -&pinctrl_usdhc2 { - u-boot,dm-spl; +&binman_configuration { + loadables = "atf", "fip"; }; -&pinctrl_usdhc3 { - u-boot,dm-spl; +&fec1 { + phy-reset-gpios = <&gpio4 22 GPIO_ACTIVE_LOW>; }; &gpio1 { @@ -93,163 +69,54 @@ u-boot,dm-spl; }; -&uart3 { +&i2c1 { u-boot,dm-spl; }; -&usdhc1 { +&i2c2 { u-boot,dm-spl; }; -&usdhc2 { +&pinctrl_i2c2 { u-boot,dm-spl; }; -&usdhc3 { +&pinctrl_pmic { u-boot,dm-spl; }; -&i2c1 { +&pinctrl_uart3 { u-boot,dm-spl; }; -&i2c2 { +&pinctrl_usdhc2 { u-boot,dm-spl; }; -&{/soc@0/bus@30800000/i2c@30a30000/pmic@4b} { +&pinctrl_usdhc2_gpio { u-boot,dm-spl; }; -&{/soc@0/bus@30800000/i2c@30a30000/pmic@4b/regulators} { +&pinctrl_usdhc3 { u-boot,dm-spl; }; -&pinctrl_i2c2 { +&uart3 { u-boot,dm-spl; }; -&pinctrl_pmic { +&usdhc1 { u-boot,dm-spl; }; -&fec1 { - phy-reset-gpios = <&gpio4 22 GPIO_ACTIVE_LOW>; +&usdhc2 { + u-boot,dm-spl; }; -&wdog1 { +&usdhc3 { u-boot,dm-spl; }; -&binman { - u-boot-spl-ddr { - filename = "u-boot-spl-ddr.bin"; - pad-byte = <0xff>; - align-size = <4>; - align = <4>; - - u-boot-spl { - align-end = <4>; - }; - - blob_1: blob-ext@1 { - filename = "lpddr4_pmu_train_1d_imem.bin"; - size = <0x8000>; - }; - - blob_2: blob-ext@2 { - filename = "lpddr4_pmu_train_1d_dmem.bin"; - size = <0x4000>; - }; - - blob_3: blob-ext@3 { - filename = "lpddr4_pmu_train_2d_imem.bin"; - size = <0x8000>; - }; - - blob_4: blob-ext@4 { - filename = "lpddr4_pmu_train_2d_dmem.bin"; - size = <0x4000>; - }; - }; - - flash { - mkimage { - args = "-n spl/u-boot-spl.cfgout -T imx8mimage -e 0x7e1000"; - - blob { - filename = "u-boot-spl-ddr.bin"; - }; - }; - }; - - itb { - filename = "u-boot.itb"; - - fit { - description = "Configuration to load ATF before U-Boot"; - #address-cells = <1>; - fit,external-offset = <CONFIG_FIT_EXTERNAL_OFFSET>; - - images { - uboot { - description = "U-Boot (64-bit)"; - type = "standalone"; - arch = "arm64"; - compression = "none"; - load = <CONFIG_SYS_TEXT_BASE>; - - uboot_blob: blob-ext { - filename = "u-boot-nodtb.bin"; - }; - }; - - atf { - description = "ARM Trusted Firmware"; - type = "firmware"; - arch = "arm64"; - compression = "none"; - load = <0x920000>; - entry = <0x920000>; - - atf_blob: blob-ext { - filename = "bl2.bin"; - }; - }; - - fip { - description = "Trusted Firmware FIP"; - type = "firmware"; - arch = "arm64"; - compression = "none"; - load = <0x40310000>; - - fip_blob: blob-ext{ - filename = "fip.bin"; - }; - }; - - fdt { - description = "NAME"; - type = "flat_dt"; - compression = "none"; - - uboot_fdt_blob: blob-ext { - filename = "u-boot.dtb"; - }; - }; - }; - - configurations { - default = "conf"; - - conf { - description = "NAME"; - firmware = "uboot"; - loadables = "atf", "fip"; - fdt = "fdt"; - }; - }; - }; - }; +&wdog1 { + u-boot,dm-spl; }; diff --git a/arch/arm/dts/imx8mm-cl-iot-gate-u-boot.dtsi b/arch/arm/dts/imx8mm-cl-iot-gate-u-boot.dtsi index 00927c1574..433b02ccee 100644 --- a/arch/arm/dts/imx8mm-cl-iot-gate-u-boot.dtsi +++ b/arch/arm/dts/imx8mm-cl-iot-gate-u-boot.dtsi @@ -3,93 +3,84 @@ * Copyright 2019 NXP */ -/ { - binman: binman { - multiple-images; - }; - - wdt-reboot { - compatible = "wdt-reboot"; - wdt = <&wdog1>; - u-boot,dm-spl; - }; +#include "imx8mm-u-boot.dtsi" +/ { firmware { optee { compatible = "linaro,optee-tz"; method = "smc"; }; }; + + wdt-reboot { + compatible = "wdt-reboot"; + u-boot,dm-spl; + wdt = <&wdog1>; + }; }; -&{/soc@0} { - u-boot,dm-pre-reloc; +&{/soc@0/bus@30800000/i2c@30a30000/pmic@4b} { u-boot,dm-spl; }; -&clk { +&{/soc@0/bus@30800000/i2c@30a30000/pmic@4b/regulators} { u-boot,dm-spl; - u-boot,dm-pre-reloc; - /delete-property/ assigned-clocks; - /delete-property/ assigned-clock-parents; - /delete-property/ assigned-clock-rates; }; -&osc_24m { - u-boot,dm-spl; - u-boot,dm-pre-reloc; +&fec1 { + phy-reset-gpios = <&gpio4 22 GPIO_ACTIVE_LOW>; }; -&aips1 { +&gpio1 { u-boot,dm-spl; - u-boot,dm-pre-reloc; }; -&aips2 { +&gpio2 { u-boot,dm-spl; }; -&aips3 { +&gpio3 { u-boot,dm-spl; }; -&iomuxc { +&gpio4 { u-boot,dm-spl; }; -&pinctrl_uart3 { +&gpio5 { u-boot,dm-spl; }; -&pinctrl_usdhc2_gpio { +&i2c1 { u-boot,dm-spl; }; -&pinctrl_usdhc2 { +&i2c2 { u-boot,dm-spl; }; -&pinctrl_usdhc3 { +&pinctrl_i2c2 { u-boot,dm-spl; }; -&gpio1 { +&pinctrl_pmic { u-boot,dm-spl; }; -&gpio2 { +&pinctrl_uart3 { u-boot,dm-spl; }; -&gpio3 { +&pinctrl_usdhc2 { u-boot,dm-spl; }; -&gpio4 { +&pinctrl_usdhc2_gpio { u-boot,dm-spl; }; -&gpio5 { +&pinctrl_usdhc3 { u-boot,dm-spl; }; @@ -109,135 +100,6 @@ u-boot,dm-spl; }; -&i2c1 { - u-boot,dm-spl; -}; - -&i2c2 { - u-boot,dm-spl; -}; - -&{/soc@0/bus@30800000/i2c@30a30000/pmic@4b} { - u-boot,dm-spl; -}; - -&{/soc@0/bus@30800000/i2c@30a30000/pmic@4b/regulators} { - u-boot,dm-spl; -}; - -&pinctrl_i2c2 { - u-boot,dm-spl; -}; - -&pinctrl_pmic { - u-boot,dm-spl; -}; - -&fec1 { - phy-reset-gpios = <&gpio4 22 GPIO_ACTIVE_LOW>; -}; - &wdog1 { u-boot,dm-spl; }; - -&binman { - u-boot-spl-ddr { - filename = "u-boot-spl-ddr.bin"; - pad-byte = <0xff>; - align-size = <4>; - align = <4>; - - u-boot-spl { - align-end = <4>; - }; - - blob_1: blob-ext@1 { - filename = "lpddr4_pmu_train_1d_imem.bin"; - size = <0x8000>; - }; - - blob_2: blob-ext@2 { - filename = "lpddr4_pmu_train_1d_dmem.bin"; - size = <0x4000>; - }; - - blob_3: blob-ext@3 { - filename = "lpddr4_pmu_train_2d_imem.bin"; - size = <0x8000>; - }; - - blob_4: blob-ext@4 { - filename = "lpddr4_pmu_train_2d_dmem.bin"; - size = <0x4000>; - }; - }; - - flash { - mkimage { - args = "-n spl/u-boot-spl.cfgout -T imx8mimage -e 0x7e1000"; - - blob { - filename = "u-boot-spl-ddr.bin"; - }; - }; - }; - - itb { - filename = "u-boot.itb"; - - fit { - description = "Configuration to load ATF before U-Boot"; - #address-cells = <1>; - fit,external-offset = <CONFIG_FIT_EXTERNAL_OFFSET>; - - images { - uboot { - description = "U-Boot (64-bit)"; - type = "standalone"; - arch = "arm64"; - compression = "none"; - load = <CONFIG_SYS_TEXT_BASE>; - - uboot_blob: blob-ext { - filename = "u-boot-nodtb.bin"; - }; - }; - - atf { - description = "ARM Trusted Firmware"; - type = "firmware"; - arch = "arm64"; - compression = "none"; - load = <0x920000>; - entry = <0x920000>; - - atf_blob: blob-ext { - filename = "bl31.bin"; - }; - }; - - fdt { - description = "NAME"; - type = "flat_dt"; - compression = "none"; - - uboot_fdt_blob: blob-ext { - filename = "u-boot.dtb"; - }; - }; - }; - - configurations { - default = "conf"; - - conf { - description = "NAME"; - firmware = "uboot"; - loadables = "atf"; - fdt = "fdt"; - }; - }; - }; - }; -}; diff --git a/arch/arm/dts/imx8mm-evk-u-boot.dtsi b/arch/arm/dts/imx8mm-evk-u-boot.dtsi index 3c75415e8f..6b459831e7 100644 --- a/arch/arm/dts/imx8mm-evk-u-boot.dtsi +++ b/arch/arm/dts/imx8mm-evk-u-boot.dtsi @@ -6,10 +6,6 @@ #include "imx8mm-u-boot.dtsi" / { - binman: binman { - multiple-images; - }; - wdt-reboot { compatible = "wdt-reboot"; wdt = <&wdog1>; @@ -116,122 +112,3 @@ &wdog1 { u-boot,dm-spl; }; - -&binman { - u-boot-spl-ddr { - filename = "u-boot-spl-ddr.bin"; - pad-byte = <0xff>; - align-size = <4>; - align = <4>; - - u-boot-spl { - align-end = <4>; - }; - - blob_1: blob-ext@1 { - filename = "lpddr4_pmu_train_1d_imem.bin"; - size = <0x8000>; - }; - - blob_2: blob-ext@2 { - filename = "lpddr4_pmu_train_1d_dmem.bin"; - size = <0x4000>; - }; - - blob_3: blob-ext@3 { - filename = "lpddr4_pmu_train_2d_imem.bin"; - size = <0x8000>; - }; - - blob_4: blob-ext@4 { - filename = "lpddr4_pmu_train_2d_dmem.bin"; - size = <0x4000>; - }; - }; - - - spl { - filename = "spl.bin"; - - mkimage { - args = "-n spl/u-boot-spl.cfgout -T imx8mimage -e 0x7e1000"; - - blob { - filename = "u-boot-spl-ddr.bin"; - }; - }; - }; - - itb { - filename = "u-boot.itb"; - - fit { - description = "Configuration to load ATF before U-Boot"; - #address-cells = <1>; - fit,external-offset = <CONFIG_FIT_EXTERNAL_OFFSET>; - - images { - uboot { - description = "U-Boot (64-bit)"; - type = "standalone"; - arch = "arm64"; - compression = "none"; - load = <CONFIG_SYS_TEXT_BASE>; - - uboot_blob: blob-ext { - filename = "u-boot-nodtb.bin"; - }; - }; - - atf { - description = "ARM Trusted Firmware"; - type = "firmware"; - arch = "arm64"; - compression = "none"; - load = <0x920000>; - entry = <0x920000>; - - atf_blob: blob-ext { - filename = "bl31.bin"; - }; - }; - - fdt { - description = "NAME"; - type = "flat_dt"; - compression = "none"; - - uboot_fdt_blob: blob-ext { - filename = "u-boot.dtb"; - }; - }; - }; - - configurations { - default = "conf"; - - conf { - description = "NAME"; - firmware = "uboot"; - loadables = "atf"; - fdt = "fdt"; - }; - }; - }; - }; - - imx-boot { - filename = "flash.bin"; - pad-byte = <0x00>; - - spl: blob-ext@1 { - offset = <0x0>; - filename = "spl.bin"; - }; - - uboot: blob-ext@2 { - offset = <0x57c00>; - filename = "u-boot.itb"; - }; - }; -}; diff --git a/arch/arm/dts/imx8mm-kontron-n801x-s-u-boot.dtsi b/arch/arm/dts/imx8mm-kontron-n801x-s-u-boot.dtsi index 5e368a61bc..22d18e6f1c 100644 --- a/arch/arm/dts/imx8mm-kontron-n801x-s-u-boot.dtsi +++ b/arch/arm/dts/imx8mm-kontron-n801x-s-u-boot.dtsi @@ -11,10 +11,6 @@ usb1 = &usbotg2; }; - binman: binman { - multiple-images; - }; - wdt-reboot { compatible = "wdt-reboot"; wdt = <&wdog1>; @@ -130,145 +126,3 @@ &wdog1 { u-boot,dm-spl; }; - -&binman { - u-boot-spl-ddr { - filename = "u-boot-spl-ddr.bin"; - pad-byte = <0xff>; - align-size = <4>; - align = <4>; - - u-boot-spl { - align-end = <4>; - }; - - blob_1: blob-ext@1 { - filename = "lpddr4_pmu_train_1d_imem.bin"; - size = <0x8000>; - }; - - blob_2: blob-ext@2 { - filename = "lpddr4_pmu_train_1d_dmem.bin"; - size = <0x4000>; - }; - - blob_3: blob-ext@3 { - filename = "lpddr4_pmu_train_2d_imem.bin"; - size = <0x8000>; - }; - - blob_4: blob-ext@4 { - filename = "lpddr4_pmu_train_2d_dmem.bin"; - size = <0x4000>; - }; - }; - - spl { - filename = "spl.bin"; - - mkimage { - args = "-n spl/u-boot-spl.cfgout -T imx8mimage -e 0x7e1000"; - - blob { - filename = "u-boot-spl-ddr.bin"; - }; - }; - }; - - itb { - filename = "u-boot.itb"; - - fit { - description = "Configuration to load ATF before U-Boot"; - #address-cells = <1>; - fit,external-offset = <CONFIG_FIT_EXTERNAL_OFFSET>; - - images { - uboot { - description = "U-Boot (64-bit)"; - type = "standalone"; - arch = "arm64"; - compression = "none"; - load = <CONFIG_SYS_TEXT_BASE>; - - uboot_blob: blob-ext { - filename = "u-boot-nodtb.bin"; - }; - }; - - atf { - description = "ARM Trusted Firmware"; - type = "firmware"; - arch = "arm64"; - compression = "none"; - load = <0x920000>; - entry = <0x920000>; - - atf_blob: blob-ext { - filename = "bl31.bin"; - }; - }; - - fdt { - description = "NAME"; - type = "flat_dt"; - compression = "none"; - - uboot_fdt_blob: blob-ext { - filename = "u-boot.dtb"; - }; - }; - }; - - configurations { - default = "conf"; - - conf { - description = "NAME"; - firmware = "uboot"; - loadables = "atf"; - fdt = "fdt"; - }; - }; - }; - }; - - imx-boot { - filename = "flash.bin"; - pad-byte = <0x00>; - - spl: blob-ext@1 { - offset = <0x0>; - filename = "spl.bin"; - }; - - uboot: blob-ext@2 { - offset = <0x57c00>; - filename = "u-boot.itb"; - }; - }; - - u-boot-update { - filename = "firmware-update.itb"; - - fit { - description = "Configuration for firmware update file"; - - images { - flash-bin { - description = "U-Boot flash image"; - type = "firmware"; - os = "u-boot"; - arch = "arm"; - compress = "none"; - load = <0>; /* unused */ - - blob { - filename = "flash.bin"; - }; - - }; - }; - }; - }; -}; diff --git a/arch/arm/dts/imx8mm-u-boot.dtsi b/arch/arm/dts/imx8mm-u-boot.dtsi index f833d9df59..7882fe7316 100644 --- a/arch/arm/dts/imx8mm-u-boot.dtsi +++ b/arch/arm/dts/imx8mm-u-boot.dtsi @@ -3,14 +3,20 @@ * Copyright (C) 2020 Jagan Teki <jagan@amarulasolutions.com> */ +/ { + binman: binman { + multiple-images; + }; +}; + &{/soc@0} { u-boot,dm-pre-reloc; u-boot,dm-spl; }; &aips1 { - u-boot,dm-spl; u-boot,dm-pre-reloc; + u-boot,dm-spl; }; &aips2 { @@ -21,9 +27,146 @@ u-boot,dm-spl; }; +&binman { + u-boot-spl-ddr { + align = <4>; + align-size = <4>; + filename = "u-boot-spl-ddr.bin"; + pad-byte = <0xff>; + + u-boot-spl { + align-end = <4>; + filename = "u-boot-spl.bin"; + }; + + 1d-imem { + filename = "lpddr4_pmu_train_1d_imem.bin"; + size = <0x8000>; + type = "blob-ext"; + }; + + 1d_dmem { + filename = "lpddr4_pmu_train_1d_dmem.bin"; + size = <0x4000>; + type = "blob-ext"; + }; + + 2d_imem { + filename = "lpddr4_pmu_train_2d_imem.bin"; + size = <0x8000>; + type = "blob-ext"; + }; + + 2d_dmem { + filename = "lpddr4_pmu_train_2d_dmem.bin"; + size = <0x4000>; + type = "blob-ext"; + }; + }; + + spl { + filename = "spl.bin"; + + mkimage { + args = "-n spl/u-boot-spl.cfgout -T imx8mimage -e 0x7e1000"; + + blob { + filename = "u-boot-spl-ddr.bin"; + }; + }; + }; + + itb { + filename = "u-boot.itb"; + + fit { + description = "Configuration to load ATF before U-Boot"; + fit,external-offset = <CONFIG_FIT_EXTERNAL_OFFSET>; + fit,fdt-list = "of-list"; + #address-cells = <1>; + + images { + uboot { + arch = "arm64"; + compression = "none"; + description = "U-Boot (64-bit)"; + load = <CONFIG_SYS_TEXT_BASE>; + type = "standalone"; + + uboot_blob { + filename = "u-boot-nodtb.bin"; + type = "blob-ext"; + }; + }; + + atf { + arch = "arm64"; + compression = "none"; + description = "ARM Trusted Firmware"; + entry = <0x920000>; + load = <0x920000>; + type = "firmware"; + + atf_blob { + filename = "bl31.bin"; + type = "blob-ext"; + }; + }; + + binman_fip: fip { + arch = "arm64"; + compression = "none"; + description = "Trusted Firmware FIP"; + load = <0x40310000>; + type = "firmware"; + }; + + @fdt-SEQ { + compression = "none"; + description = "NAME"; + type = "flat_dt"; + + uboot_fdt_blob { + filename = "u-boot.dtb"; + type = "blob-ext"; + }; + }; + }; + + configurations { + default = "@config-DEFAULT-SEQ"; + + binman_configuration: @config-SEQ { + description = "NAME"; + fdt = "fdt-SEQ"; + firmware = "uboot"; + loadables = "atf"; + }; + }; + }; + }; + + imx-boot { + filename = "flash.bin"; + pad-byte = <0x00>; + + spl { + filename = "spl.bin"; + offset = <0x0>; + type = "blob-ext"; + }; + + binman_uboot: uboot { + filename = "u-boot.itb"; + offset = <0x57c00>; + type = "blob-ext"; + }; + }; +}; + &clk { - u-boot,dm-spl; u-boot,dm-pre-reloc; + u-boot,dm-spl; /delete-property/ assigned-clocks; /delete-property/ assigned-clock-parents; /delete-property/ assigned-clock-rates; @@ -34,6 +177,6 @@ }; &osc_24m { - u-boot,dm-spl; u-boot,dm-pre-reloc; + u-boot,dm-spl; }; diff --git a/arch/arm/dts/imx8mm-verdin-u-boot.dtsi b/arch/arm/dts/imx8mm-verdin-u-boot.dtsi index 9fb4d8aa8c..976399ad60 100644 --- a/arch/arm/dts/imx8mm-verdin-u-boot.dtsi +++ b/arch/arm/dts/imx8mm-verdin-u-boot.dtsi @@ -6,10 +6,6 @@ #include "imx8mm-u-boot.dtsi" / { - binman: binman { - multiple-images; - }; - firmware { optee { compatible = "linaro,optee-tz"; @@ -100,120 +96,6 @@ u-boot,dm-spl; }; -&binman { - u-boot-spl-ddr { - filename = "u-boot-spl-ddr.bin"; - pad-byte = <0xff>; - align-size = <4>; - align = <4>; - - u-boot-spl { - align-end = <4>; - }; - - blob_1: blob-ext@1 { - filename = "lpddr4_pmu_train_1d_imem.bin"; - size = <0x8000>; - }; - - blob_2: blob-ext@2 { - filename = "lpddr4_pmu_train_1d_dmem.bin"; - size = <0x4000>; - }; - - blob_3: blob-ext@3 { - filename = "lpddr4_pmu_train_2d_imem.bin"; - size = <0x8000>; - }; - - blob_4: blob-ext@4 { - filename = "lpddr4_pmu_train_2d_dmem.bin"; - size = <0x4000>; - }; - }; - - spl { - filename = "spl.bin"; - - mkimage { - args = "-n spl/u-boot-spl.cfgout -T imx8mimage -e 0x7e1000"; - - blob { - filename = "u-boot-spl-ddr.bin"; - }; - }; - }; - - itb { - filename = "u-boot.itb"; - - fit { - description = "Configuration to load ATF before U-Boot"; - #address-cells = <1>; - fit,external-offset = <CONFIG_FIT_EXTERNAL_OFFSET>; - - images { - uboot { - description = "U-Boot (64-bit)"; - type = "standalone"; - arch = "arm64"; - compression = "none"; - load = <CONFIG_SYS_TEXT_BASE>; - - uboot_blob: blob-ext { - filename = "u-boot-nodtb.bin"; - }; - }; - - atf { - description = "ARM Trusted Firmware"; - type = "firmware"; - arch = "arm64"; - compression = "none"; - load = <0x920000>; - entry = <0x920000>; - - atf_blob: blob-ext { - filename = "bl31.bin"; - }; - }; - - fdt { - description = "NAME"; - type = "flat_dt"; - compression = "none"; - - uboot_fdt_blob: blob-ext { - filename = "u-boot.dtb"; - }; - }; - }; - - configurations { - default = "conf"; - - conf { - description = "NAME"; - firmware = "uboot"; - loadables = "atf"; - fdt = "fdt"; - }; - }; - }; - }; - - imx-boot { - filename = "flash.bin"; - pad-byte = <0x00>; - - spl: blob-ext@1 { - offset = <0x0>; - filename = "spl.bin"; - }; - - uboot: blob-ext@2 { - offset = <0x5fc00>; - filename = "u-boot.itb"; - }; - }; +&binman_uboot { + offset = <0x5fc00>; }; diff --git a/arch/arm/dts/imx8mn-beacon-kit-u-boot.dtsi b/arch/arm/dts/imx8mn-beacon-kit-u-boot.dtsi index bbc64a2819..69fd69c8d0 100644 --- a/arch/arm/dts/imx8mn-beacon-kit-u-boot.dtsi +++ b/arch/arm/dts/imx8mn-beacon-kit-u-boot.dtsi @@ -4,6 +4,10 @@ */ / { + binman: binman { + multiple-images; + }; + wdt-reboot { compatible = "wdt-reboot"; wdt = <&wdog1>; @@ -40,6 +44,9 @@ &clk { u-boot,dm-spl; u-boot,dm-pre-reloc; + /delete-property/ assigned-clocks; + /delete-property/ assigned-clock-parents; + /delete-property/ assigned-clock-rates; }; &gpio1 { @@ -99,6 +106,10 @@ u-boot,off-on-delay-us = <20000>; }; +&uart2 { + u-boot,dm-spl; +}; + &usdhc1 { u-boot,dm-spl; sd-uhs-sdr104; @@ -120,3 +131,122 @@ &wdog1 { u-boot,dm-spl; }; + +&binman { + u-boot-spl-ddr { + filename = "u-boot-spl-ddr.bin"; + pad-byte = <0xff>; + align-size = <4>; + align = <4>; + + u-boot-spl { + align-end = <4>; + }; + + blob_1: blob-ext@1 { + filename = "lpddr4_pmu_train_1d_imem.bin"; + size = <0x8000>; + }; + + blob_2: blob-ext@2 { + filename = "lpddr4_pmu_train_1d_dmem.bin"; + size = <0x4000>; + }; + + blob_3: blob-ext@3 { + filename = "lpddr4_pmu_train_2d_imem.bin"; + size = <0x8000>; + }; + + blob_4: blob-ext@4 { + filename = "lpddr4_pmu_train_2d_dmem.bin"; + size = <0x4000>; + }; + }; + + + spl { + filename = "spl.bin"; + + mkimage { + args = "-n spl/u-boot-spl.cfgout -T imx8mimage -e 0x912000"; + + blob { + filename = "u-boot-spl-ddr.bin"; + }; + }; + }; + + itb { + filename = "u-boot.itb"; + + fit { + description = "Configuration to load ATF before U-Boot"; + #address-cells = <1>; + fit,external-offset = <CONFIG_FIT_EXTERNAL_OFFSET>; + + images { + uboot { + description = "U-Boot (64-bit)"; + type = "standalone"; + arch = "arm64"; + compression = "none"; + load = <CONFIG_SYS_TEXT_BASE>; + + uboot_blob: blob-ext { + filename = "u-boot-nodtb.bin"; + }; + }; + + atf { + description = "ARM Trusted Firmware"; + type = "firmware"; + arch = "arm64"; + compression = "none"; + load = <0x960000>; + entry = <0x960000>; + + atf_blob: blob-ext { + filename = "bl31.bin"; + }; + }; + + fdt { + description = "NAME"; + type = "flat_dt"; + compression = "none"; + + uboot_fdt_blob: blob-ext { + filename = "u-boot.dtb"; + }; + }; + }; + + configurations { + default = "conf"; + + conf { + description = "NAME"; + firmware = "uboot"; + loadables = "atf"; + fdt = "fdt"; + }; + }; + }; + }; + + imx-boot { + filename = "flash.bin"; + pad-byte = <0x00>; + + spl: blob-ext@1 { + offset = <0x0>; + filename = "spl.bin"; + }; + + uboot: blob-ext@2 { + offset = <0x58000>; + filename = "u-boot.itb"; + }; + }; +}; diff --git a/arch/arm/dts/imx8mq-evk-u-boot.dtsi b/arch/arm/dts/imx8mq-evk-u-boot.dtsi index 2cfc12b7e0..6f9c81462e 100644 --- a/arch/arm/dts/imx8mq-evk-u-boot.dtsi +++ b/arch/arm/dts/imx8mq-evk-u-boot.dtsi @@ -1,5 +1,7 @@ // SPDX-License-Identifier: (GPL-2.0 OR MIT) +#include "imx8mq-u-boot.dtsi" + &usdhc1 { mmc-hs400-1_8v; }; diff --git a/arch/arm/dts/imx8mq-phanbell-u-boot.dtsi b/arch/arm/dts/imx8mq-phanbell-u-boot.dtsi index 4712cf6a44..a65a942ee7 100644 --- a/arch/arm/dts/imx8mq-phanbell-u-boot.dtsi +++ b/arch/arm/dts/imx8mq-phanbell-u-boot.dtsi @@ -1,5 +1,7 @@ // SPDX-License-Identifier: (GPL-2.0 OR MIT) +#include "imx8mq-u-boot.dtsi" + ®_usdhc2_vmmc { u-boot,off-on-delay-us = <20000>; }; diff --git a/arch/arm/dts/imx8mq-pico-pi.dts b/arch/arm/dts/imx8mq-pico-pi.dts index d2af18ad0e..8ed6e9166b 100644 --- a/arch/arm/dts/imx8mq-pico-pi.dts +++ b/arch/arm/dts/imx8mq-pico-pi.dts @@ -9,6 +9,7 @@ /dts-v1/; #include "imx8mq.dtsi" +#include "imx8mq-u-boot.dtsi" / { model = "TechNexion PICO-PI-8M"; diff --git a/arch/arm/dts/imx8mq-u-boot.dtsi b/arch/arm/dts/imx8mq-u-boot.dtsi new file mode 100644 index 0000000000..8a6075c77b --- /dev/null +++ b/arch/arm/dts/imx8mq-u-boot.dtsi @@ -0,0 +1,139 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright 2021 NXP + */ + +/ { + binman: binman { + multiple-images; + }; + +}; + +&binman { + u-boot-spl-ddr { + filename = "u-boot-spl-ddr.bin"; + pad-byte = <0xff>; + align-size = <4>; + align = <4>; + + u-boot-spl { + align-end = <4>; + }; + + blob_1: blob-ext@1 { + filename = "lpddr4_pmu_train_1d_imem.bin"; + size = <0x8000>; + }; + + blob_2: blob-ext@2 { + filename = "lpddr4_pmu_train_1d_dmem.bin"; + size = <0x4000>; + }; + + blob_3: blob-ext@3 { + filename = "lpddr4_pmu_train_2d_imem.bin"; + size = <0x8000>; + }; + + blob_4: blob-ext@4 { + filename = "lpddr4_pmu_train_2d_dmem.bin"; + size = <0x4000>; + }; + }; + + signed_hdmi { + filename = "signed_hdmi.bin"; + + blob_5: blob-ext@5 { + filename = "signed_hdmi_imx8m.bin"; + }; + }; + + spl { + filename = "spl.bin"; + + mkimage { + args = "-n spl/u-boot-spl.cfgout -T imx8mimage -e 0x7e1000"; + + blob { + filename = "u-boot-spl-ddr.bin"; + }; + + }; + + }; + + itb { + filename = "u-boot.itb"; + + fit { + description = "Configuration to load ATF before U-Boot"; + #address-cells = <1>; + fit,external-offset = <CONFIG_FIT_EXTERNAL_OFFSET>; + + images { + uboot { + description = "U-Boot (64-bit)"; + type = "standalone"; + arch = "arm64"; + compression = "none"; + load = <CONFIG_SYS_TEXT_BASE>; + + uboot_blob: blob-ext { + filename = "u-boot-nodtb.bin"; + }; + }; + + atf { + description = "ARM Trusted Firmware"; + type = "firmware"; + arch = "arm64"; + compression = "none"; + load = <0x910000>; + entry = <0x910000>; + + atf_blob: blob-ext { + filename = "bl31.bin"; + }; + }; + + fdt { + description = "NAME"; + type = "flat_dt"; + compression = "none"; + + uboot_fdt_blob: blob-ext { + filename = "u-boot.dtb"; + }; + }; + }; + + configurations { + default = "conf"; + + conf { + description = "NAME"; + firmware = "uboot"; + loadables = "atf"; + fdt = "fdt"; + }; + }; + }; + }; + + imx-boot { + filename = "flash.bin"; + pad-byte = <0x00>; + + spl: blob-ext@1 { + offset = <0x0>; + filename = "spl.bin"; + }; + + uboot: blob-ext@2 { + offset = <0x57c00>; + filename = "u-boot.itb"; + }; + }; +}; diff --git a/arch/arm/dts/phycore-imx8mm-u-boot.dtsi b/arch/arm/dts/phycore-imx8mm-u-boot.dtsi index f842e02c77..7c2dfb4a27 100644 --- a/arch/arm/dts/phycore-imx8mm-u-boot.dtsi +++ b/arch/arm/dts/phycore-imx8mm-u-boot.dtsi @@ -7,10 +7,6 @@ #include "imx8mm-u-boot.dtsi" / { - binman: binman { - multiple-images; - }; - wdt-reboot { compatible = "wdt-reboot"; wdt = <&wdog1>; @@ -73,121 +69,3 @@ &wdog1 { u-boot,dm-spl; }; - -&binman { - u-boot-spl-ddr { - filename = "u-boot-spl-ddr.bin"; - pad-byte = <0xff>; - align-size = <4>; - align = <4>; - - u-boot-spl { - align-end = <4>; - }; - - blob_1: blob-ext@1 { - filename = "lpddr4_pmu_train_1d_imem.bin"; - size = <0x8000>; - }; - - blob_2: blob-ext@2 { - filename = "lpddr4_pmu_train_1d_dmem.bin"; - size = <0x4000>; - }; - - blob_3: blob-ext@3 { - filename = "lpddr4_pmu_train_2d_imem.bin"; - size = <0x8000>; - }; - - blob_4: blob-ext@4 { - filename = "lpddr4_pmu_train_2d_dmem.bin"; - size = <0x4000>; - }; - }; - - spl { - filename = "spl.bin"; - - mkimage { - args = "-n spl/u-boot-spl.cfgout -T imx8mimage -e 0x7e1000"; - - blob { - filename = "u-boot-spl-ddr.bin"; - }; - }; - }; - - itb { - filename = "u-boot.itb"; - - fit { - description = "Configuration to load ATF before U-Boot"; - #address-cells = <1>; - fit,external-offset = <CONFIG_FIT_EXTERNAL_OFFSET>; - - images { - uboot { - description = "U-Boot (64-bit)"; - type = "standalone"; - arch = "arm64"; - compression = "none"; - load = <CONFIG_SYS_TEXT_BASE>; - - uboot_blob: blob-ext { - filename = "u-boot-nodtb.bin"; - }; - }; - - atf { - description = "ARM Trusted Firmware"; - type = "firmware"; - arch = "arm64"; - compression = "none"; - load = <0x920000>; - entry = <0x920000>; - - atf_blob: blob-ext { - filename = "bl31.bin"; - }; - }; - - fdt { - description = "NAME"; - type = "flat_dt"; - compression = "none"; - - uboot_fdt_blob: blob-ext { - filename = "u-boot.dtb"; - }; - }; - }; - - configurations { - default = "conf"; - - conf { - description = "NAME"; - firmware = "uboot"; - loadables = "atf"; - fdt = "fdt"; - }; - }; - }; - }; - - imx-boot { - filename = "flash.bin"; - pad-byte = <0x00>; - - spl: blob-ext@1 { - filename = "spl.bin"; - offset = <0x0>; - }; - - uboot: blob-ext@2 { - filename = "u-boot.itb"; - offset = <0x57c00>; - }; - }; -}; diff --git a/arch/arm/mach-imx/imx8m/Kconfig b/arch/arm/mach-imx/imx8m/Kconfig index 276b8bd974..d6a869068a 100644 --- a/arch/arm/mach-imx/imx8m/Kconfig +++ b/arch/arm/mach-imx/imx8m/Kconfig @@ -36,13 +36,15 @@ config TARGET_IMX8MQ_CM config TARGET_IMX8MQ_EVK bool "imx8mq_evk" + select BINMAN select IMX8MQ select IMX8M_LPDDR4 config TARGET_IMX8MQ_PHANBELL - bool "imx8mq_phanbell" - select IMX8MQ - select IMX8M_LPDDR4 + bool "imx8mq_phanbell" + select BINMAN + select IMX8MQ + select IMX8M_LPDDR4 config TARGET_IMX8MM_EVK bool "imx8mm LPDDR4 EVK board" @@ -71,6 +73,7 @@ config TARGET_IMX8MM_ICORE_MX8MM config TARGET_IMX8MM_VENICE bool "Support Gateworks Venice iMX8M Mini module" + select BINMAN select IMX8MM select SUPPORT_SPL select IMX8M_LPDDR4 @@ -105,6 +108,7 @@ config TARGET_IMX8MP_EVK config TARGET_PICO_IMX8MQ bool "Support Technexion Pico iMX8MQ" + select BINMAN select IMX8MQ select IMX8M_LPDDR4 @@ -117,12 +121,14 @@ config TARGET_VERDIN_IMX8MM config TARGET_IMX8MM_BEACON bool "imx8mm Beacon Embedded devkit" + select BINMAN select IMX8MM select SUPPORT_SPL select IMX8M_LPDDR4 config TARGET_IMX8MN_BEACON bool "imx8mn Beacon Embedded devkit" + select BINMAN select IMX8MN select SUPPORT_SPL select IMX8M_LPDDR4 diff --git a/arch/arm/mach-imx/imx8m/imximage.cfg b/arch/arm/mach-imx/imx8m/imximage.cfg index 714b24273b..2a3f959183 100644 --- a/arch/arm/mach-imx/imx8m/imximage.cfg +++ b/arch/arm/mach-imx/imx8m/imximage.cfg @@ -1,17 +1,11 @@ /* SPDX-License-Identifier: GPL-2.0+ */ /* - * Copyright 2018 NXP + * Copyright 2018-2021 NXP */ #define __ASSEMBLY__ FIT BOOT_FROM sd -SIGNED_HDMI signed_hdmi_imx8m.bin -LOADER spl/u-boot-spl-ddr.bin 0x7E1000 -SECOND_LOADER u-boot.itb 0x40200000 0x60000 - -DDR_FW lpddr4_pmu_train_1d_imem.bin -DDR_FW lpddr4_pmu_train_1d_dmem.bin -DDR_FW lpddr4_pmu_train_2d_imem.bin -DDR_FW lpddr4_pmu_train_2d_dmem.bin +SIGNED_HDMI signed_hdmi.bin +LOADER u-boot-spl-ddr.bin 0x7e1000 diff --git a/arch/arm/mach-imx/mx6/Kconfig b/arch/arm/mach-imx/mx6/Kconfig index 62de942a32..98df4d4e42 100644 --- a/arch/arm/mach-imx/mx6/Kconfig +++ b/arch/arm/mach-imx/mx6/Kconfig @@ -588,6 +588,7 @@ config TARGET_UDOO depends on MX6QDL select BOARD_LATE_INIT select SUPPORT_SPL + imply CMD_DM config TARGET_UDOO_NEO bool "UDOO Neo" diff --git a/board/beacon/imx8mm/Kconfig b/board/beacon/imx8mm/Kconfig index 58799c1a65..63f064e8cb 100644 --- a/board/beacon/imx8mm/Kconfig +++ b/board/beacon/imx8mm/Kconfig @@ -10,7 +10,7 @@ config SYS_CONFIG_NAME default "imx8mm_beacon" config IMX_CONFIG - default "arch/arm/mach-imx/imx8m/imximage-8mm-lpddr4.cfg" + default "board/beacon/imx8mm/imximage-8mm-lpddr4.cfg" source "board/freescale/common/Kconfig" diff --git a/board/beacon/imx8mm/README b/board/beacon/imx8mm/README index dce176fa0b..03d9412f0d 100644 --- a/board/beacon/imx8mm/README +++ b/board/beacon/imx8mm/README @@ -12,8 +12,8 @@ Get and Build the ARM Trusted firmware Note: $(srctree) is U-Boot source directory $ git clone https://source.codeaurora.org/external/imx/imx-atf -$ git checkout imx_4.19.35_1.0.0 -$ make PLAT=imx8mm bl31 ARCH=arm CROSS_COMPILE=aarch64-linux-gnu- +$ git checkout imx_5.4.70_2.3.0 +$ make PLAT=imx8mm bl31 CROSS_COMPILE=aarch64-linux-gnu- $ cp build/imx8mm/release/bl31.bin $(srctree) Get the DDR firmware @@ -26,7 +26,7 @@ $ cp firmware-imx-8.5/firmware/ddr/synopsys/lpddr4*.bin $(srctree) Build U-Boot ============ $ make imx8mm_beacon_defconfig -$ make flash.bin CROSS_COMPILE=aarch64-linux-gnu- ATF_LOAD_ADDR=0x920000 +$ make flash.bin CROSS_COMPILE=aarch64-linux-gnu- Burn U-Boot to microSD Card =========================== diff --git a/board/beacon/imx8mm/imximage-8mm-lpddr4.cfg b/board/beacon/imx8mm/imximage-8mm-lpddr4.cfg new file mode 100644 index 0000000000..90573be5fd --- /dev/null +++ b/board/beacon/imx8mm/imximage-8mm-lpddr4.cfg @@ -0,0 +1,9 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* + * Copyright 2021 NXP + */ + +#define __ASSEMBLY__ + +BOOT_FROM sd +LOADER u-boot-spl-ddr.bin 0x7E1000 diff --git a/board/beacon/imx8mn/Kconfig b/board/beacon/imx8mn/Kconfig index 65d2923918..fb301397b1 100644 --- a/board/beacon/imx8mn/Kconfig +++ b/board/beacon/imx8mn/Kconfig @@ -16,7 +16,7 @@ config IMX8MN_BEACON_2GB_LPDDR bool "Enable 2GB LPDDR" config IMX_CONFIG - default "arch/arm/mach-imx/imx8m/imximage-8mn-lpddr4.cfg" + default "board/beacon/imx8mn/imximage-8mn-lpddr4.cfg" source "board/freescale/common/Kconfig" diff --git a/board/beacon/imx8mn/imximage-8mn-lpddr4.cfg b/board/beacon/imx8mn/imximage-8mn-lpddr4.cfg new file mode 100644 index 0000000000..7286b26494 --- /dev/null +++ b/board/beacon/imx8mn/imximage-8mn-lpddr4.cfg @@ -0,0 +1,10 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* + * Copyright 2021 NXP + */ + +#define __ASSEMBLY__ + +ROM_VERSION v2 +BOOT_FROM sd +LOADER u-boot-spl-ddr.bin 0x912000 diff --git a/board/compulab/imx8mm-cl-iot-gate/imximage-8mm-lpddr4.cfg b/board/compulab/imx8mm-cl-iot-gate/imximage-8mm-lpddr4.cfg index b89092a559..4071219fbf 100644 --- a/board/compulab/imx8mm-cl-iot-gate/imximage-8mm-lpddr4.cfg +++ b/board/compulab/imx8mm-cl-iot-gate/imximage-8mm-lpddr4.cfg @@ -6,4 +6,4 @@ #define __ASSEMBLY__ BOOT_FROM sd -LOADER mkimage.flash.mkimage 0x7E1000 +LOADER u-boot-spl-ddr.bin 0x7e1000 diff --git a/board/gateworks/venice/Kconfig b/board/gateworks/venice/Kconfig index 639bf35d20..687b94f24d 100644 --- a/board/gateworks/venice/Kconfig +++ b/board/gateworks/venice/Kconfig @@ -10,6 +10,5 @@ config SYS_CONFIG_NAME default "imx8mm_venice" config IMX_CONFIG - default "arch/arm/mach-imx/imx8m/imximage-8mm-lpddr4.cfg" - + default "board/gateworks/venice/imximage-8mm-lpddr4.cfg" endif diff --git a/board/gateworks/venice/README b/board/gateworks/venice/README index 6a0ab1ef10..773cc09e87 100644 --- a/board/gateworks/venice/README +++ b/board/gateworks/venice/README @@ -25,7 +25,7 @@ $ cp firmware-imx-8.9/firmware/ddr/synopsys/lpddr4*.bin . Build U-Boot ============ $ make imx8mm_venice_defconfig -$ make flash.bin CROSS_COMPILE=aarch64-linux-gnu- ATF_LOAD_ADDR=0x920000 +$ make CROSS_COMPILE=aarch64-linux-gnu- Update eMMC =========== diff --git a/board/gateworks/venice/imximage-8mm-lpddr4.cfg b/board/gateworks/venice/imximage-8mm-lpddr4.cfg new file mode 100644 index 0000000000..ccaa765cb7 --- /dev/null +++ b/board/gateworks/venice/imximage-8mm-lpddr4.cfg @@ -0,0 +1,9 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* + * Copyright 2021 Gateworks Corporation + */ + +#define __ASSEMBLY__ + +BOOT_FROM sd +LOADER u-boot-spl-ddr.bin 0x7E1000 diff --git a/board/sifive/unleashed/unleashed.c b/board/sifive/unleashed/unleashed.c index 3c3e0e1d0d..f8aad862c6 100644 --- a/board/sifive/unleashed/unleashed.c +++ b/board/sifive/unleashed/unleashed.c @@ -117,7 +117,7 @@ int misc_init_r(void) void *board_fdt_blob_setup(int *err) { *err = 0; - if (IS_ENABLED(CONFIG_OF_SEPARATE)) { + if (IS_ENABLED(CONFIG_OF_SEPARATE) || IS_ENABLED(CONFIG_OF_BOARD)) { if (gd->arch.firmware_fdt_addr) return (ulong *)(uintptr_t)gd->arch.firmware_fdt_addr; } diff --git a/board/sifive/unmatched/unmatched.c b/board/sifive/unmatched/unmatched.c index 4895909f8d..6295deeae2 100644 --- a/board/sifive/unmatched/unmatched.c +++ b/board/sifive/unmatched/unmatched.c @@ -14,7 +14,7 @@ void *board_fdt_blob_setup(int *err) { *err = 0; - if (IS_ENABLED(CONFIG_OF_SEPARATE)) { + if (IS_ENABLED(CONFIG_OF_SEPARATE) || IS_ENABLED(CONFIG_OF_BOARD)) { if (gd->arch.firmware_fdt_addr) return (ulong *)(uintptr_t)gd->arch.firmware_fdt_addr; } diff --git a/board/theobroma-systems/lion_rk3368/MAINTAINERS b/board/theobroma-systems/lion_rk3368/MAINTAINERS index 857f784d21..a5b4cb31b4 100644 --- a/board/theobroma-systems/lion_rk3368/MAINTAINERS +++ b/board/theobroma-systems/lion_rk3368/MAINTAINERS @@ -1,5 +1,5 @@ LION-RK3368 (RK3368-uQ7 system-on-module) -M: Philipp Tomsich <philipp.tomsich@theobroma-systems.com> +M: Quentin Schulz <quentin.schulz@theobroma-systems.com> M: Klaus Goger <klaus.goger@theobroma-systems.com> S: Maintained F: board/theobroma-systems/lion_rk3368 diff --git a/board/theobroma-systems/puma_rk3399/MAINTAINERS b/board/theobroma-systems/puma_rk3399/MAINTAINERS index ccec09c386..1ec2dd72d6 100644 --- a/board/theobroma-systems/puma_rk3399/MAINTAINERS +++ b/board/theobroma-systems/puma_rk3399/MAINTAINERS @@ -1,5 +1,5 @@ PUMA-RK3399 -M: Philipp Tomsich <philipp.tomsich@theobroma-systems.com> +M: Quentin Schulz <quentin.schulz@theobroma-systems.com> M: Klaus Goger <klaus.goger@theobroma-systems.com> S: Maintained F: board/theobroma-systems/puma_rk3399 diff --git a/board/udoo/neo/neo.c b/board/udoo/neo/neo.c index ce005d31cc..5e40583ab4 100644 --- a/board/udoo/neo/neo.c +++ b/board/udoo/neo/neo.c @@ -19,6 +19,8 @@ #include <asm/mach-imx/iomux-v3.h> #include <dm.h> #include <env.h> +#include <mmc.h> +#include <fsl_esdhc_imx.h> #include <asm/arch/crm_regs.h> #include <asm/io.h> #include <asm/mach-imx/mxc_i2c.h> @@ -73,6 +75,8 @@ enum { #define BOARD_DETECT_PAD_CFG (MUX_PAD_CTRL(BOARD_DETECT_PAD_CTRL) | \ MUX_MODE_SION) +#define OCRAM_START 0x8f8000 + int dram_init(void) { gd->ram_size = imx_ddr_size(); @@ -214,19 +218,25 @@ static iomux_v3_cfg_t const uart1_pads[] = { MX6_PAD_GPIO1_IO05__UART1_RX | MUX_PAD_CTRL(UART_PAD_CTRL), }; +static iomux_v3_cfg_t const usdhc2_pads[] = { + MX6_PAD_SD2_CLK__USDHC2_CLK | MUX_PAD_CTRL(USDHC_PAD_CTRL), + MX6_PAD_SD2_CMD__USDHC2_CMD | MUX_PAD_CTRL(USDHC_PAD_CTRL), + MX6_PAD_SD2_DATA0__USDHC2_DATA0 | MUX_PAD_CTRL(USDHC_PAD_CTRL), + MX6_PAD_SD2_DATA1__USDHC2_DATA1 | MUX_PAD_CTRL(USDHC_PAD_CTRL), + MX6_PAD_SD2_DATA2__USDHC2_DATA2 | MUX_PAD_CTRL(USDHC_PAD_CTRL), + MX6_PAD_SD2_DATA3__USDHC2_DATA3 | MUX_PAD_CTRL(USDHC_PAD_CTRL), + /* CD pin */ + MX6_PAD_SD1_DATA0__GPIO6_IO_2 | MUX_PAD_CTRL(NO_PAD_CTRL), + /* Power */ + MX6_PAD_SD1_CMD__GPIO6_IO_1 | MUX_PAD_CTRL(NO_PAD_CTRL), +}; + static iomux_v3_cfg_t const phy_control_pads[] = { /* 25MHz Ethernet PHY Clock */ MX6_PAD_ENET2_RX_CLK__ENET2_REF_CLK_25M | MUX_PAD_CTRL(ENET_CLK_PAD_CTRL), }; -static iomux_v3_cfg_t const board_recognition_pads[] = { - /*Connected to R184*/ - MX6_PAD_NAND_READY_B__GPIO4_IO_13 | BOARD_DETECT_PAD_CFG, - /*Connected to R185*/ - MX6_PAD_NAND_ALE__GPIO4_IO_0 | BOARD_DETECT_PAD_CFG, -}; - static iomux_v3_cfg_t const wdog_b_pad = { MX6_PAD_GPIO1_IO13__GPIO1_IO_13 | MUX_PAD_CTRL(WDOG_PAD_CTRL), }; @@ -249,6 +259,7 @@ static int setup_fec(void) ARRAY_SIZE(phy_control_pads)); /* Reset PHY */ + gpio_request(IMX_GPIO_NR(2, 1), "enet_rst"); gpio_direction_output(IMX_GPIO_NR(2, 1) , 0); udelay(10000); gpio_set_value(IMX_GPIO_NR(2, 1), 1); @@ -280,52 +291,53 @@ int board_init(void) ARRAY_SIZE(peri_3v3_pads)); /* Active high for ncp692 */ + gpio_request(IMX_GPIO_NR(4, 16), "ncp692"); gpio_direction_output(IMX_GPIO_NR(4, 16) , 1); #ifdef CONFIG_SYS_I2C_MXC setup_i2c(0, CONFIG_SYS_I2C_SPEED, 0x7f, &i2c_pad_info1); #endif + setup_fec(); + return 0; } -static int get_board_value(void) +int board_early_init_f(void) { - int r184, r185; - - imx_iomux_v3_setup_multiple_pads(board_recognition_pads, - ARRAY_SIZE(board_recognition_pads)); + setup_iomux_uart(); - gpio_direction_input(IMX_GPIO_NR(4, 13)); - gpio_direction_input(IMX_GPIO_NR(4, 0)); + return 0; +} - r184 = gpio_get_value(IMX_GPIO_NR(4, 13)); - r185 = gpio_get_value(IMX_GPIO_NR(4, 0)); +static struct fsl_esdhc_cfg usdhc_cfg[1] = { + {USDHC2_BASE_ADDR}, +}; - /* - * Machine selection - - * Machine r184, r185 - * --------------------------------- - * Basic 0 0 - * Basic Ks 0 1 - * Full 1 0 - * Extended 1 1 - */ +#define USDHC2_PWR_GPIO IMX_GPIO_NR(6, 1) +#define USDHC2_CD_GPIO IMX_GPIO_NR(6, 2) - return (r184 << 1) + r185; +int board_mmc_getcd(struct mmc *mmc) +{ + return !gpio_get_value(USDHC2_CD_GPIO); } -int board_early_init_f(void) +int board_mmc_init(struct bd_info *bis) { - setup_iomux_uart(); - setup_fec(); - - return 0; + SETUP_IOMUX_PADS(usdhc2_pads); + usdhc_cfg[0].sdhc_clk = mxc_get_clock(MXC_ESDHC2_CLK); + usdhc_cfg[0].max_bus_width = 4; + gpio_request(IMX_GPIO_NR(6, 1), "usdhc2_pwr"); + gpio_request(IMX_GPIO_NR(6, 2), "usdhc2_cd"); + gpio_direction_input(USDHC2_CD_GPIO); + gpio_direction_output(USDHC2_PWR_GPIO, 1); + + return fsl_esdhc_initialize(bis, &usdhc_cfg[0]); } -static char *board_string(void) +static char *board_string(int type) { - switch (get_board_value()) { + switch (type) { case UDOO_NEO_TYPE_BASIC: return "BASIC"; case UDOO_NEO_TYPE_BASIC_KS: @@ -338,16 +350,21 @@ static char *board_string(void) return "UNDEFINED"; } -int checkboard(void) +/* Override the default implementation, DT model is not accurate */ +int show_board_info(void) { - printf("Board: UDOO Neo %s\n", board_string()); + int *board_type = (int *)OCRAM_START; + + printf("Board: UDOO Neo %s\n", board_string(*board_type)); return 0; } int board_late_init(void) { + int *board_type = (int *)OCRAM_START; + #ifdef CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG - env_set("board_name", board_string()); + env_set("board_name", board_string(*board_type)); #endif return 0; @@ -358,6 +375,41 @@ int board_late_init(void) #include <linux/libfdt.h> #include <asm/arch/mx6-ddr.h> +static const iomux_v3_cfg_t board_recognition_pads[] = { + /*Connected to R184*/ + MX6_PAD_NAND_READY_B__GPIO4_IO_13 | BOARD_DETECT_PAD_CFG, + /*Connected to R185*/ + MX6_PAD_NAND_ALE__GPIO4_IO_0 | BOARD_DETECT_PAD_CFG, +}; + +static int get_board_value(void) +{ + int r184, r185; + + imx_iomux_v3_setup_multiple_pads(board_recognition_pads, + ARRAY_SIZE(board_recognition_pads)); + + gpio_request(IMX_GPIO_NR(4, 13), "r184"); + gpio_request(IMX_GPIO_NR(4, 0), "r185"); + gpio_direction_input(IMX_GPIO_NR(4, 13)); + gpio_direction_input(IMX_GPIO_NR(4, 0)); + + r184 = gpio_get_value(IMX_GPIO_NR(4, 13)); + r185 = gpio_get_value(IMX_GPIO_NR(4, 0)); + + /* + * Machine selection - + * Machine r184, r185 + * --------------------------------- + * Basic 0 0 + * Basic Ks 0 1 + * Full 1 0 + * Extended 1 1 + */ + + return (r184 << 1) + r185; +} + static const struct mx6sx_iomux_ddr_regs mx6_ddr_ioregs = { .dram_dqm0 = 0x00000028, .dram_dqm1 = 0x00000028, @@ -453,7 +505,7 @@ static void ccgr_init(void) static void spl_dram_init(void) { - int board = get_board_value(); + int *board_type = (int *)OCRAM_START; struct mx6_ddr_sysinfo sysinfo = { .dsize = 1, /* width of data bus: 1 = 32 bits */ @@ -470,8 +522,11 @@ static void spl_dram_init(void) .rst_to_cke = 0x23, /* 33 cycles, 500us (JEDEC default) */ }; + *board_type = get_board_value(); + mx6sx_dram_iocfg(32, &mx6_ddr_ioregs, &mx6_grp_ioregs); - if (board == UDOO_NEO_TYPE_BASIC || board == UDOO_NEO_TYPE_BASIC_KS) + if (*board_type == UDOO_NEO_TYPE_BASIC || + *board_type == UDOO_NEO_TYPE_BASIC_KS) mx6_dram_cfg(&sysinfo, &neo_basic_mmcd_calib, &neo_basic_mem_ddr); else diff --git a/board/udoo/udoo.c b/board/udoo/udoo.c index 5c49388cbf..9e0365615d 100644 --- a/board/udoo/udoo.c +++ b/board/udoo/udoo.c @@ -90,6 +90,14 @@ int mx6_rgmii_rework(struct phy_device *phydev) static void setup_iomux_enet(void) { + gpio_request(IMX_GPIO_NR(2, 31), "eth_power"); + gpio_request(IMX_GPIO_NR(3, 23), "eth_phy_reset"); + gpio_request(IMX_GPIO_NR(6, 24), "strap1"); + gpio_request(IMX_GPIO_NR(6, 25), "strap2"); + gpio_request(IMX_GPIO_NR(6, 27), "strap3"); + gpio_request(IMX_GPIO_NR(6, 28), "strap4"); + gpio_request(IMX_GPIO_NR(6, 29), "strap5"); + gpio_direction_output(IMX_GPIO_NR(2, 31), 1); /* Power supply on */ gpio_direction_output(IMX_GPIO_NR(3, 23), 0); /* assert PHY rst */ diff --git a/board/udoo/udoo_spl.c b/board/udoo/udoo_spl.c index d9afbbb741..647380e1db 100644 --- a/board/udoo/udoo_spl.c +++ b/board/udoo/udoo_spl.c @@ -254,4 +254,39 @@ void board_init_f(ulong dummy) /* DDR initialization */ spl_dram_init(); } + +#define USDHC3_CD_GPIO IMX_GPIO_NR(7, 0) + +#define USDHC_PAD_CTRL (PAD_CTL_PUS_47K_UP | \ + PAD_CTL_SPEED_LOW | PAD_CTL_DSE_80ohm | \ + PAD_CTL_SRE_FAST | PAD_CTL_HYS) + +static struct fsl_esdhc_cfg usdhc_cfg[2] = { + {USDHC3_BASE_ADDR}, +}; + +static const iomux_v3_cfg_t usdhc3_pads[] = { + IOMUX_PADS(PAD_SD3_CLK__SD3_CLK | MUX_PAD_CTRL(USDHC_PAD_CTRL)), + IOMUX_PADS(PAD_SD3_CMD__SD3_CMD | MUX_PAD_CTRL(USDHC_PAD_CTRL)), + IOMUX_PADS(PAD_SD3_DAT0__SD3_DATA0 | MUX_PAD_CTRL(USDHC_PAD_CTRL)), + IOMUX_PADS(PAD_SD3_DAT1__SD3_DATA1 | MUX_PAD_CTRL(USDHC_PAD_CTRL)), + IOMUX_PADS(PAD_SD3_DAT2__SD3_DATA2 | MUX_PAD_CTRL(USDHC_PAD_CTRL)), + IOMUX_PADS(PAD_SD3_DAT3__SD3_DATA3 | MUX_PAD_CTRL(USDHC_PAD_CTRL)), + IOMUX_PADS(PAD_SD3_DAT5__GPIO7_IO00 | MUX_PAD_CTRL(NO_PAD_CTRL)), +}; + +int board_mmc_getcd(struct mmc *mmc) +{ + return !gpio_get_value(USDHC3_CD_GPIO); +} + +int board_mmc_init(struct bd_info *bis) +{ + SETUP_IOMUX_PADS(usdhc3_pads); + usdhc_cfg[0].sdhc_clk = mxc_get_clock(MXC_ESDHC3_CLK); + usdhc_cfg[0].max_bus_width = 4; + gpio_direction_input(USDHC3_CD_GPIO); + + return fsl_esdhc_initialize(bis, &usdhc_cfg[0]); +} #endif diff --git a/configs/imx8mm_beacon_defconfig b/configs/imx8mm_beacon_defconfig index 8ce78d56cb..ba9c9a3ee0 100644 --- a/configs/imx8mm_beacon_defconfig +++ b/configs/imx8mm_beacon_defconfig @@ -21,7 +21,7 @@ CONFIG_SYS_LOAD_ADDR=0x40480000 CONFIG_FIT=y CONFIG_FIT_EXTERNAL_OFFSET=0x3000 CONFIG_SPL_LOAD_FIT=y -CONFIG_SPL_FIT_GENERATOR="arch/arm/mach-imx/mkimage_fit_atf.sh" +# CONFIG_USE_SPL_FIT_GENERATOR is not set CONFIG_OF_SYSTEM_SETUP=y CONFIG_USE_BOOTCOMMAND=y CONFIG_BOOTCOMMAND="mmc dev ${mmcdev}; if mmc rescan; then if run loadbootscript; then run bootscript; else if run loadimage; then run mmcboot; else run netboot; fi; fi; fi;" diff --git a/configs/imx8mm_venice_defconfig b/configs/imx8mm_venice_defconfig index 3bcafb3e15..02a65c5abf 100644 --- a/configs/imx8mm_venice_defconfig +++ b/configs/imx8mm_venice_defconfig @@ -25,7 +25,7 @@ CONFIG_SYS_LOAD_ADDR=0x40480000 CONFIG_FIT=y CONFIG_FIT_EXTERNAL_OFFSET=0x3000 CONFIG_SPL_LOAD_FIT=y -CONFIG_SPL_FIT_GENERATOR="arch/arm/mach-imx/mkimage_fit_atf.sh" +# CONFIG_USE_SPL_FIT_GENERATOR is not set CONFIG_OF_BOARD_SETUP=y CONFIG_OF_SYSTEM_SETUP=y # CONFIG_USE_BOOTCOMMAND is not set @@ -58,7 +58,7 @@ CONFIG_CMD_EXT4_WRITE=y # CONFIG_SPL_EFI_PARTITION is not set CONFIG_OF_CONTROL=y CONFIG_SPL_OF_CONTROL=y -CONFIG_OF_LIST="imx8mm-venice-gw71xx-0x imx8mm-venice-gw72xx-0x imx8mm-venice-gw73xx-0x imx8mm-venice-gw7901 imx8mm-venice-gw7902" +CONFIG_OF_LIST="imx8mm-venice imx8mm-venice-gw71xx-0x imx8mm-venice-gw72xx-0x imx8mm-venice-gw73xx-0x imx8mm-venice-gw7901 imx8mm-venice-gw7902" CONFIG_ENV_IS_IN_MMC=y CONFIG_SYS_REDUNDAND_ENVIRONMENT=y CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y diff --git a/configs/imx8mn_beacon_2g_defconfig b/configs/imx8mn_beacon_2g_defconfig index 934ca56183..8b98d687ec 100644 --- a/configs/imx8mn_beacon_2g_defconfig +++ b/configs/imx8mn_beacon_2g_defconfig @@ -26,7 +26,7 @@ CONFIG_SYS_LOAD_ADDR=0x40480000 CONFIG_FIT=y CONFIG_FIT_EXTERNAL_OFFSET=0x3000 CONFIG_SPL_LOAD_FIT=y -CONFIG_SPL_FIT_GENERATOR="arch/arm/mach-imx/mkimage_fit_atf.sh" +# CONFIG_USE_SPL_FIT_GENERATOR is not set CONFIG_OF_SYSTEM_SETUP=y CONFIG_USE_BOOTCOMMAND=y CONFIG_BOOTCOMMAND="mmc dev ${mmcdev}; if mmc rescan; then if run loadbootscript; then run bootscript; else if run loadimage; then run mmcboot; else run netboot; fi; fi; else booti ${loadaddr} - ${fdt_addr}; fi" diff --git a/configs/imx8mn_beacon_defconfig b/configs/imx8mn_beacon_defconfig index 49b6d1edac..cfe43102a7 100644 --- a/configs/imx8mn_beacon_defconfig +++ b/configs/imx8mn_beacon_defconfig @@ -25,7 +25,7 @@ CONFIG_SYS_LOAD_ADDR=0x40480000 CONFIG_FIT=y CONFIG_FIT_EXTERNAL_OFFSET=0x3000 CONFIG_SPL_LOAD_FIT=y -CONFIG_SPL_FIT_GENERATOR="arch/arm/mach-imx/mkimage_fit_atf.sh" +# CONFIG_USE_SPL_FIT_GENERATOR is not set CONFIG_OF_SYSTEM_SETUP=y CONFIG_USE_BOOTCOMMAND=y CONFIG_BOOTCOMMAND="mmc dev ${mmcdev}; if mmc rescan; then if run loadbootscript; then run bootscript; else if run loadimage; then run mmcboot; else run netboot; fi; fi; else booti ${loadaddr} - ${fdt_addr}; fi" @@ -38,6 +38,7 @@ CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR=y CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR=0x300 CONFIG_SPL_I2C=y CONFIG_SPL_POWER=y +CONFIG_SPL_WATCHDOG=y CONFIG_HUSH_PARSER=y CONFIG_SYS_PROMPT="u-boot=> " # CONFIG_BOOTM_NETBSD is not set @@ -64,7 +65,6 @@ CONFIG_CMD_EXT4_WRITE=y CONFIG_CMD_FAT=y CONFIG_OF_CONTROL=y CONFIG_SPL_OF_CONTROL=y -CONFIG_OF_SPL_REMOVE_PROPS="interrupt-parent interrupts" CONFIG_ENV_OVERWRITE=y CONFIG_ENV_IS_IN_MMC=y CONFIG_SYS_RELOC_GD_ENV_ADDR=y @@ -107,6 +107,7 @@ CONFIG_PHY_GIGE=y CONFIG_FEC_MXC=y CONFIG_MII=y CONFIG_PINCTRL=y +CONFIG_SPL_PINCTRL=y CONFIG_PINCTRL_IMX8M=y CONFIG_DM_PMIC=y # CONFIG_SPL_PMIC_CHILDREN is not set @@ -123,7 +124,9 @@ CONFIG_SPI=y CONFIG_DM_SPI=y CONFIG_NXP_FSPI=y CONFIG_SYSRESET=y +CONFIG_SPL_SYSRESET=y CONFIG_SYSRESET_PSCI=y +CONFIG_SYSRESET_WATCHDOG=y CONFIG_DM_THERMAL=y CONFIG_USB=y # CONFIG_SPL_DM_USB is not set @@ -135,3 +138,4 @@ CONFIG_USB_GADGET_PRODUCT_NUM=0xa4a5 CONFIG_CI_UDC=y CONFIG_SDP_LOADADDR=0x0 CONFIG_OF_LIBFDT_OVERLAY=y +CONFIG_IMX_WATCHDOG=y diff --git a/configs/imx8mq_evk_defconfig b/configs/imx8mq_evk_defconfig index c63cf236d6..389a5cb00e 100644 --- a/configs/imx8mq_evk_defconfig +++ b/configs/imx8mq_evk_defconfig @@ -24,7 +24,7 @@ CONFIG_SYS_LOAD_ADDR=0x40480000 CONFIG_FIT=y CONFIG_FIT_EXTERNAL_OFFSET=0x3000 CONFIG_SPL_LOAD_FIT=y -CONFIG_SPL_FIT_GENERATOR="arch/arm/mach-imx/mkimage_fit_atf.sh" +# CONFIG_USE_SPL_FIT_GENERATOR is not set CONFIG_OF_SYSTEM_SETUP=y CONFIG_BOARD_EARLY_INIT_F=y CONFIG_BOARD_LATE_INIT=y diff --git a/configs/imx8mq_phanbell_defconfig b/configs/imx8mq_phanbell_defconfig index 7714951dd2..d5f45a4b01 100644 --- a/configs/imx8mq_phanbell_defconfig +++ b/configs/imx8mq_phanbell_defconfig @@ -24,7 +24,7 @@ CONFIG_SYS_LOAD_ADDR=0x40480000 CONFIG_FIT=y CONFIG_FIT_EXTERNAL_OFFSET=0x3000 CONFIG_SPL_LOAD_FIT=y -CONFIG_SPL_FIT_GENERATOR="arch/arm/mach-imx/mkimage_fit_atf.sh" +# CONFIG_USE_SPL_FIT_GENERATOR is not set CONFIG_OF_SYSTEM_SETUP=y CONFIG_SD_BOOT=y CONFIG_USE_BOOTCOMMAND=y diff --git a/configs/nitrogen6dl2g_defconfig b/configs/nitrogen6dl2g_defconfig index 553c7b39b0..553380e663 100644 --- a/configs/nitrogen6dl2g_defconfig +++ b/configs/nitrogen6dl2g_defconfig @@ -70,6 +70,8 @@ CONFIG_PHY_MICREL=y CONFIG_PHY_MICREL_KSZ90X1=y CONFIG_FEC_MXC=y CONFIG_MII=y +CONFIG_PINCTRL=y +CONFIG_PINCTRL_IMX6=y CONFIG_MXC_UART=y CONFIG_SPI=y CONFIG_DM_SPI=y diff --git a/configs/nitrogen6dl_defconfig b/configs/nitrogen6dl_defconfig index f5208b3e08..336e3b264b 100644 --- a/configs/nitrogen6dl_defconfig +++ b/configs/nitrogen6dl_defconfig @@ -70,6 +70,8 @@ CONFIG_PHY_MICREL=y CONFIG_PHY_MICREL_KSZ90X1=y CONFIG_FEC_MXC=y CONFIG_MII=y +CONFIG_PINCTRL=y +CONFIG_PINCTRL_IMX6=y CONFIG_MXC_UART=y CONFIG_SPI=y CONFIG_DM_SPI=y diff --git a/configs/nitrogen6q2g_defconfig b/configs/nitrogen6q2g_defconfig index c8f94f6bde..dbc1818caa 100644 --- a/configs/nitrogen6q2g_defconfig +++ b/configs/nitrogen6q2g_defconfig @@ -72,6 +72,8 @@ CONFIG_PHY_MICREL=y CONFIG_PHY_MICREL_KSZ90X1=y CONFIG_FEC_MXC=y CONFIG_MII=y +CONFIG_PINCTRL=y +CONFIG_PINCTRL_IMX6=y CONFIG_MXC_UART=y CONFIG_SPI=y CONFIG_DM_SPI=y diff --git a/configs/nitrogen6q_defconfig b/configs/nitrogen6q_defconfig index 9793c73f9c..d88d071940 100644 --- a/configs/nitrogen6q_defconfig +++ b/configs/nitrogen6q_defconfig @@ -72,6 +72,8 @@ CONFIG_PHY_MICREL=y CONFIG_PHY_MICREL_KSZ90X1=y CONFIG_FEC_MXC=y CONFIG_MII=y +CONFIG_PINCTRL=y +CONFIG_PINCTRL_IMX6=y CONFIG_MXC_UART=y CONFIG_SPI=y CONFIG_DM_SPI=y diff --git a/configs/nitrogen6s1g_defconfig b/configs/nitrogen6s1g_defconfig index c678e400e5..6c7b8b7491 100644 --- a/configs/nitrogen6s1g_defconfig +++ b/configs/nitrogen6s1g_defconfig @@ -70,6 +70,8 @@ CONFIG_PHY_MICREL=y CONFIG_PHY_MICREL_KSZ90X1=y CONFIG_FEC_MXC=y CONFIG_MII=y +CONFIG_PINCTRL=y +CONFIG_PINCTRL_IMX6=y CONFIG_MXC_UART=y CONFIG_SPI=y CONFIG_DM_SPI=y diff --git a/configs/nitrogen6s_defconfig b/configs/nitrogen6s_defconfig index 8431e6ffc9..440c7733ea 100644 --- a/configs/nitrogen6s_defconfig +++ b/configs/nitrogen6s_defconfig @@ -70,6 +70,8 @@ CONFIG_PHY_MICREL=y CONFIG_PHY_MICREL_KSZ90X1=y CONFIG_FEC_MXC=y CONFIG_MII=y +CONFIG_PINCTRL=y +CONFIG_PINCTRL_IMX6=y CONFIG_MXC_UART=y CONFIG_SPI=y CONFIG_DM_SPI=y diff --git a/configs/pico-imx8mq_defconfig b/configs/pico-imx8mq_defconfig index e2c6790e03..fae9dfd1f3 100644 --- a/configs/pico-imx8mq_defconfig +++ b/configs/pico-imx8mq_defconfig @@ -23,7 +23,7 @@ CONFIG_SYS_LOAD_ADDR=0x40480000 CONFIG_FIT=y CONFIG_FIT_EXTERNAL_OFFSET=0x3000 CONFIG_SPL_LOAD_FIT=y -CONFIG_SPL_FIT_GENERATOR="arch/arm/mach-imx/mkimage_fit_atf.sh" +# CONFIG_USE_SPL_FIT_GENERATOR is not set CONFIG_OF_SYSTEM_SETUP=y CONFIG_USE_BOOTCOMMAND=y CONFIG_BOOTCOMMAND="mmc dev ${mmcdev}; if mmc rescan; then if run loadbootscript; then run bootscript; else if run loadimage; then run mmcboot; else run netboot; fi; fi; else booti ${loadaddr} - ${fdt_addr}; fi" diff --git a/configs/udoo_defconfig b/configs/udoo_defconfig index 8e1bba1120..ab2b2ee675 100644 --- a/configs/udoo_defconfig +++ b/configs/udoo_defconfig @@ -7,7 +7,7 @@ CONFIG_SPL_LIBCOMMON_SUPPORT=y CONFIG_SPL_LIBGENERIC_SUPPORT=y CONFIG_NR_DRAM_BANKS=1 CONFIG_ENV_SIZE=0x2000 -CONFIG_ENV_OFFSET=0x60000 +CONFIG_ENV_OFFSET=0xC0000 CONFIG_MX6QDL=y CONFIG_TARGET_UDOO=y CONFIG_DM_GPIO=y @@ -35,6 +35,7 @@ CONFIG_OF_CONTROL=y CONFIG_ENV_OVERWRITE=y CONFIG_ENV_IS_IN_MMC=y CONFIG_SYS_RELOC_GD_ENV_ADDR=y +CONFIG_SYS_MMC_ENV_DEV=2 CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y CONFIG_DM=y CONFIG_BOUNCE_BUFFER=y diff --git a/configs/udoo_neo_defconfig b/configs/udoo_neo_defconfig index b2a3e9be4c..ca08de1bd4 100644 --- a/configs/udoo_neo_defconfig +++ b/configs/udoo_neo_defconfig @@ -27,6 +27,7 @@ CONFIG_SPL_FS_EXT4=y CONFIG_SPL_WATCHDOG=y CONFIG_CMD_GPIO=y CONFIG_CMD_MMC=y +CONFIG_CMD_USB=y # CONFIG_CMD_PINMUX is not set # CONFIG_CMD_SETEXPR is not set CONFIG_CMD_CACHE=y @@ -35,6 +36,7 @@ CONFIG_CMD_EXT4_WRITE=y CONFIG_OF_CONTROL=y CONFIG_ENV_OVERWRITE=y CONFIG_SYS_RELOC_GD_ENV_ADDR=y +CONFIG_SYS_MMC_ENV_DEV=1 CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y CONFIG_BOUNCE_BUFFER=y CONFIG_SYS_I2C_LEGACY=y @@ -45,12 +47,18 @@ CONFIG_PHYLIB=y CONFIG_PHY_MICREL=y CONFIG_PHY_MICREL_KSZ8XXX=y CONFIG_DM_ETH=y +CONFIG_DM_MDIO=y CONFIG_FEC_MXC=y -CONFIG_RGMII=y CONFIG_MII=y CONFIG_PINCTRL=y CONFIG_PINCTRL_IMX6=y CONFIG_POWER_LEGACY=y CONFIG_POWER_I2C=y +CONFIG_DM_REGULATOR=y +CONFIG_DM_REGULATOR_ANATOP=y +CONFIG_DM_REGULATOR_FIXED=y +CONFIG_USB=y +CONFIG_DM_USB=y +CONFIG_USB_STORAGE=y CONFIG_MXC_UART=y CONFIG_IMX_THERMAL=y diff --git a/doc/board/nxp/imx8mq_evk.rst b/doc/board/nxp/imx8mq_evk.rst index c269fdebe3..aa1ecfb47a 100644 --- a/doc/board/nxp/imx8mq_evk.rst +++ b/doc/board/nxp/imx8mq_evk.rst @@ -43,7 +43,7 @@ Build U-Boot $ export CROSS_COMPILE=aarch64-poky-linux- $ make imx8mq_evk_defconfig - $ make flash.bin + $ make Burn the flash.bin to MicroSD card offset 33KB: diff --git a/drivers/clk/clk-uclass.c b/drivers/clk/clk-uclass.c index f2d2642754..094b1abf13 100644 --- a/drivers/clk/clk-uclass.c +++ b/drivers/clk/clk-uclass.c @@ -846,17 +846,13 @@ void devm_clk_put(struct udevice *dev, struct clk *clk) int clk_uclass_post_probe(struct udevice *dev) { - int ret; - /* * when a clock provider is probed. Call clk_set_defaults() * also after the device is probed. This takes care of cases * where the DT is used to setup default parents and rates * using assigned-clocks */ - ret = clk_set_defaults(dev, CLK_DEFAULTS_POST); - if (ret) - return log_ret(ret); + clk_set_defaults(dev, CLK_DEFAULTS_POST); return 0; } diff --git a/drivers/usb/gadget/dwc2_udc_otg.c b/drivers/usb/gadget/dwc2_udc_otg.c index 2f31814442..fb10884755 100644 --- a/drivers/usb/gadget/dwc2_udc_otg.c +++ b/drivers/usb/gadget/dwc2_udc_otg.c @@ -655,6 +655,7 @@ static int dwc2_ep_enable(struct usb_ep *_ep, return -ESHUTDOWN; } + _ep->desc = desc; ep->stopped = 0; ep->desc = desc; ep->pio_irqs = 0; @@ -695,6 +696,7 @@ static int dwc2_ep_disable(struct usb_ep *_ep) /* Nuke all pending requests */ nuke(ep, -ESHUTDOWN); + _ep->desc = NULL; ep->desc = 0; ep->stopped = 1; diff --git a/include/configs/udoo.h b/include/configs/udoo.h index fe6ea68dd4..4bddc0eca3 100644 --- a/include/configs/udoo.h +++ b/include/configs/udoo.h @@ -28,7 +28,7 @@ "fdt_addr=0x18000000\0" \ "fdt_addr_r=0x18000000\0" \ "ip_dyn=yes\0" \ - "mmcdev=0\0" \ + "mmcdev=2\0" \ "mmcrootfstype=ext4\0" \ "findfdt="\ "if test ${board_rev} = MX6Q; then " \ @@ -44,7 +44,7 @@ BOOTENV #define BOOT_TARGET_DEVICES(func) \ - func(MMC, mmc, 0) \ + func(MMC, mmc, 2) \ func(SATA, sata, 0) \ func(DHCP, dhcp, na) diff --git a/include/configs/udoo_neo.h b/include/configs/udoo_neo.h index b06abc9286..3a7cb050b1 100644 --- a/include/configs/udoo_neo.h +++ b/include/configs/udoo_neo.h @@ -29,7 +29,7 @@ "fdt_addr=0x83000000\0" \ "fdt_addr_r=0x83000000\0" \ "ip_dyn=yes\0" \ - "mmcdev=0\0" \ + "mmcdev=1\0" \ "mmcrootfstype=ext4\0" \ "findfdt="\ "if test $board_name = BASIC; then " \ @@ -49,7 +49,8 @@ BOOTENV #define BOOT_TARGET_DEVICES(func) \ - func(MMC, mmc, 0) \ + func(MMC, mmc, 1) \ + func(USB, usb, 0) \ func(DHCP, dhcp, na) #include <config_distro_bootcmd.h> diff --git a/lib/rsa/rsa-sign.c b/lib/rsa/rsa-sign.c index 44f21416ce..3b6e5f0f86 100644 --- a/lib/rsa/rsa-sign.c +++ b/lib/rsa/rsa-sign.c @@ -628,7 +628,7 @@ int rsa_add_verify_data(struct image_sign_info *info, void *keydest) if (ret) goto err_get_pub_key; - rsa = EVP_PKEY_get0_RSA(pkey); + rsa = (RSA *)EVP_PKEY_get0_RSA(pkey); ret = rsa_get_params(rsa, &exponent, &n0_inv, &modulus, &r_squared); if (ret) goto err_get_params; diff --git a/tools/binman/cmdline.py b/tools/binman/cmdline.py index adc17547ae..6c68595461 100644 --- a/tools/binman/cmdline.py +++ b/tools/binman/cmdline.py @@ -103,6 +103,8 @@ controlled by a description in the board device tree.''' help='Configuration file (.dtb) to use') build_parser.add_argument('--fake-dtb', action='store_true', help='Use fake device tree contents (for testing only)') + build_parser.add_argument('--fake-ext-blobs', action='store_true', + help='Create fake ext blobs with dummy content (for testing only)') build_parser.add_argument('-i', '--image', type=str, action='append', help='Image filename to build (if not specified, build all)') build_parser.add_argument('-I', '--indir', action='append', diff --git a/tools/binman/control.py b/tools/binman/control.py index dcf070da85..4b3ce23fb4 100644 --- a/tools/binman/control.py +++ b/tools/binman/control.py @@ -500,7 +500,8 @@ def PrepareImagesAndDtbs(dtb_fname, select_images, update_fdt, use_expanded): def ProcessImage(image, update_fdt, write_map, get_contents=True, - allow_resize=True, allow_missing=False): + allow_resize=True, allow_missing=False, + allow_fake_blobs=False): """Perform all steps for this image, including checking and # writing it. This means that errors found with a later image will be reported after @@ -516,12 +517,15 @@ def ProcessImage(image, update_fdt, write_map, get_contents=True, allow_resize: True to allow entries to change size (this does a re-pack of the entries), False to raise an exception allow_missing: Allow blob_ext objects to be missing + allow_fake_blobs: Allow blob_ext objects to be faked with dummy files Returns: - True if one or more external blobs are missing, False if all are present + True if one or more external blobs are missing or faked, + False if all are present """ if get_contents: image.SetAllowMissing(allow_missing) + image.SetAllowFakeBlob(allow_fake_blobs) image.GetEntryContents() image.GetEntryOffsets() @@ -570,7 +574,13 @@ def ProcessImage(image, update_fdt, write_map, get_contents=True, tout.Warning("Image '%s' is missing external blobs and is non-functional: %s" % (image.name, ' '.join([e.name for e in missing_list]))) _ShowHelpForMissingBlobs(missing_list) - return bool(missing_list) + faked_list = [] + image.CheckFakedBlobs(faked_list) + if faked_list: + tout.Warning("Image '%s:%s' has faked external blobs and is non-functional: %s" % + (image.name, image.image_name, + ' '.join([e.GetDefaultFilename() for e in faked_list]))) + return bool(missing_list) or bool(faked_list) def Binman(args): @@ -657,13 +667,15 @@ def Binman(args): images = PrepareImagesAndDtbs(dtb_fname, args.image, args.update_fdt, use_expanded) + if args.test_section_timeout: # Set the first image to timeout, used in testThreadTimeout() images[list(images.keys())[0]].test_section_timeout = True - missing = False + invalid = False for image in images.values(): - missing |= ProcessImage(image, args.update_fdt, args.map, - allow_missing=args.allow_missing) + invalid |= ProcessImage(image, args.update_fdt, args.map, + allow_missing=args.allow_missing, + allow_fake_blobs=args.fake_ext_blobs) # Write the updated FDTs to our output files for dtb_item in state.GetAllFdts(): @@ -673,7 +685,7 @@ def Binman(args): data = state.GetFdtForEtype('u-boot-dtb').GetContents() elf.UpdateFile(*elf_params, data) - if missing: + if invalid: tout.Warning("\nSome images are invalid") # Use this to debug the time take to pack the image diff --git a/tools/binman/entry.py b/tools/binman/entry.py index 61642bf501..54cc3726b9 100644 --- a/tools/binman/entry.py +++ b/tools/binman/entry.py @@ -70,6 +70,8 @@ class Entry(object): missing: True if this entry is missing its contents allow_missing: Allow children of this entry to be missing (used by subclasses such as Entry_section) + allow_fake: Allow creating a dummy fake file if the blob file is not + available. This is mainly used for testing. external: True if this entry contains an external binary blob """ def __init__(self, section, etype, node, name_prefix=''): @@ -98,8 +100,10 @@ class Entry(object): self.expand_size = False self.compress = 'none' self.missing = False + self.faked = False self.external = False self.allow_missing = False + self.allow_fake = False @staticmethod def FindEntryClass(etype, expanded): @@ -949,6 +953,14 @@ features to produce new behaviours. # This is meaningless for anything other than sections pass + def SetAllowFakeBlob(self, allow_fake): + """Set whether a section allows to create a fake blob + + Args: + allow_fake: True if allowed, False if not allowed + """ + pass + def CheckMissing(self, missing_list): """Check if any entries in this section have missing external blobs @@ -960,6 +972,17 @@ features to produce new behaviours. if self.missing: missing_list.append(self) + def CheckFakedBlobs(self, faked_blobs_list): + """Check if any entries in this section have faked external blobs + + If there are faked blobs, the entries are added to the list + + Args: + fake_blobs_list: List of Entry objects to be added to + """ + # This is meaningless for anything other than blobs + pass + def GetAllowMissing(self): """Get whether a section allows missing external blobs diff --git a/tools/binman/etype/blob.py b/tools/binman/etype/blob.py index 8c1b809e8d..65ebb2ecf4 100644 --- a/tools/binman/etype/blob.py +++ b/tools/binman/etype/blob.py @@ -5,6 +5,8 @@ # Entry-type module for blobs, which are binary objects read from files # +import pathlib + from binman.entry import Entry from binman import state from dtoc import fdt_util @@ -36,6 +38,11 @@ class Entry_blob(Entry): self._filename = fdt_util.GetString(self._node, 'filename', self.etype) def ObtainContents(self): + if self.allow_fake and not pathlib.Path(self._filename).is_file(): + with open(self._filename, "wb") as out: + out.truncate(1024) + self.faked = True + self._filename = self.GetDefaultFilename() self._pathname = tools.GetInputFilename(self._filename, self.external and self.section.GetAllowMissing()) @@ -85,3 +92,14 @@ class Entry_blob(Entry): def ProcessContents(self): # The blob may have changed due to WriteSymbols() return self.ProcessContentsUpdate(self.data) + + def CheckFakedBlobs(self, faked_blobs_list): + """Check if any entries in this section have faked external blobs + + If there are faked blobs, the entries are added to the list + + Args: + fake_blobs_list: List of Entry objects to be added to + """ + if self.faked: + faked_blobs_list.append(self) diff --git a/tools/binman/etype/blob_ext.py b/tools/binman/etype/blob_ext.py index d6b0ca17c3..fba6271de2 100644 --- a/tools/binman/etype/blob_ext.py +++ b/tools/binman/etype/blob_ext.py @@ -26,3 +26,11 @@ class Entry_blob_ext(Entry_blob): def __init__(self, section, etype, node): Entry_blob.__init__(self, section, etype, node) self.external = True + + def SetAllowFakeBlob(self, allow_fake): + """Set whether the entry allows to create a fake blob + + Args: + allow_fake_blob: True if allowed, False if not allowed + """ + self.allow_fake = allow_fake diff --git a/tools/binman/etype/mkimage.py b/tools/binman/etype/mkimage.py index c08fd9dc0b..190398728e 100644 --- a/tools/binman/etype/mkimage.py +++ b/tools/binman/etype/mkimage.py @@ -61,3 +61,23 @@ class Entry_mkimage(Entry): entry = Entry.Create(self, node) entry.ReadNode() self._mkimage_entries[entry.name] = entry + + def SetAllowFakeBlob(self, allow_fake): + """Set whether the sub nodes allows to create a fake blob + + Args: + allow_fake: True if allowed, False if not allowed + """ + for entry in self._mkimage_entries.values(): + entry.SetAllowFakeBlob(allow_fake) + + def CheckFakedBlobs(self, faked_blobs_list): + """Check if any entries in this section have faked external blobs + + If there are faked blobs, the entries are added to the list + + Args: + faked_blobs_list: List of Entry objects to be added to + """ + for entry in self._mkimage_entries.values(): + entry.CheckFakedBlobs(faked_blobs_list) diff --git a/tools/binman/etype/section.py b/tools/binman/etype/section.py index 43436a11f2..7a55d03231 100644 --- a/tools/binman/etype/section.py +++ b/tools/binman/etype/section.py @@ -799,6 +799,15 @@ class Entry_section(Entry): for entry in self._entries.values(): entry.SetAllowMissing(allow_missing) + def SetAllowFakeBlob(self, allow_fake): + """Set whether a section allows to create a fake blob + + Args: + allow_fake_blob: True if allowed, False if not allowed + """ + for entry in self._entries.values(): + entry.SetAllowFakeBlob(allow_fake) + def CheckMissing(self, missing_list): """Check if any entries in this section have missing external blobs @@ -810,6 +819,17 @@ class Entry_section(Entry): for entry in self._entries.values(): entry.CheckMissing(missing_list) + def CheckFakedBlobs(self, faked_blobs_list): + """Check if any entries in this section have faked external blobs + + If there are faked blobs, the entries are added to the list + + Args: + fake_blobs_list: List of Entry objects to be added to + """ + for entry in self._entries.values(): + entry.CheckFakedBlobs(faked_blobs_list) + def _CollectEntries(self, entries, entries_by_name, add_entry): """Collect all the entries in an section diff --git a/tools/binman/ftest.py b/tools/binman/ftest.py index 2f3ec69709..a9b7880f36 100644 --- a/tools/binman/ftest.py +++ b/tools/binman/ftest.py @@ -311,7 +311,7 @@ class TestFunctional(unittest.TestCase): def _DoTestFile(self, fname, debug=False, map=False, update_dtb=False, entry_args=None, images=None, use_real_dtb=False, use_expanded=False, verbosity=None, allow_missing=False, - extra_indirs=None, threads=None, + allow_fake_blobs=False, extra_indirs=None, threads=None, test_section_timeout=False, update_fdt_in_elf=None): """Run binman with a given test file @@ -334,6 +334,7 @@ class TestFunctional(unittest.TestCase): verbosity: Verbosity level to use (0-3, None=don't set it) allow_missing: Set the '--allow-missing' flag so that missing external binaries just produce a warning instead of an error + allow_fake_blobs: Set the '--fake-ext-blobs' flag extra_indirs: Extra input directories to add using -I threads: Number of threads to use (None for default, 0 for single-threaded) @@ -372,6 +373,8 @@ class TestFunctional(unittest.TestCase): args.append('-a%s=%s' % (arg, value)) if allow_missing: args.append('-M') + if allow_fake_blobs: + args.append('--fake-ext-blobs') if update_fdt_in_elf: args += ['--update-fdt-in-elf', update_fdt_in_elf] if images: @@ -4664,6 +4667,16 @@ class TestFunctional(unittest.TestCase): str(e.exception), "Not enough space in '.*u_boot_binman_embed_sm' for data length.*") + def testFakeBlob(self): + """Test handling of faking an external blob""" + with test_util.capture_sys_output() as (stdout, stderr): + self._DoTestFile('203_fake_blob.dts', allow_missing=True, + allow_fake_blobs=True) + err = stderr.getvalue() + self.assertRegex(err, + "Image '.*' has faked external blobs and is non-functional: .*") + os.remove('binman_faking_test_blob') + def testVersion(self): """Test we can get the binman version""" version = '(unreleased)' @@ -4952,6 +4965,5 @@ fdt fdtmap Extract the devicetree blob from the fdtmap # There should be a U-Boot after the final FIP self.assertEqual(U_BOOT_DATA, data[-4:]) - if __name__ == "__main__": unittest.main() diff --git a/tools/binman/test/203_fake_blob.dts b/tools/binman/test/203_fake_blob.dts new file mode 100644 index 0000000000..22cf67f4f8 --- /dev/null +++ b/tools/binman/test/203_fake_blob.dts @@ -0,0 +1,14 @@ +// SPDX-License-Identifier: GPL-2.0+ + +/dts-v1/; + +/ { + #address-cells = <1>; + #size-cells = <1>; + + binman { + blob-ext { + filename = "binman_faking_test_blob"; + }; + }; +}; |