Sfoglia il codice sorgente

Merge branch 'master' into next

Merge in v2020.10-rc5
Tom Rini 3 anni fa
parent
commit
751b18b8a1
89 ha cambiato i file con 529 aggiunte e 187 eliminazioni
  1. 12 0
      .azure-pipelines.yml
  2. 28 0
      .gitlab-ci.yml
  3. 28 0
      .travis.yml
  4. 3 1
      MAINTAINERS
  5. 2 2
      Makefile
  6. 3 3
      arch/arm/dts/fsl-imx8qm-apalis.dts
  7. 3 3
      arch/arm/dts/fsl-imx8qxp-colibri.dts
  8. 4 0
      arch/arm/dts/rv1108-u-boot.dtsi
  9. 2 0
      arch/arm/dts/stm32mp15xx-dhcor-avenger96-u-boot.dtsi
  10. 2 2
      arch/arm/dts/stm32mp15xx-dhcor-u-boot.dtsi
  11. 0 2
      arch/arm/include/asm/arch-imx/cpu.h
  12. 5 5
      arch/arm/include/asm/arch-imx8m/clock_imx8mq.h
  13. 1 1
      arch/arm/include/asm/arch-mx7/crm_regs.h
  14. 1 4
      arch/arm/include/asm/mach-imx/sys_proto.h
  15. 0 4
      arch/arm/mach-imx/cpu.c
  16. 1 0
      arch/arm/mach-imx/imx8m/clock_imx8mm.c
  17. 4 8
      arch/arm/mach-imx/imx8m/soc.c
  18. 15 0
      arch/arm/mach-imx/mx6/ddr.c
  19. 3 3
      arch/arm/mach-mediatek/Kconfig
  20. 3 2
      arch/arm/mach-rockchip/make_fit_atf.py
  21. 2 2
      arch/arm/mach-stm32mp/cpu.c
  22. 9 0
      arch/riscv/include/asm/global_data.h
  23. 3 3
      arch/x86/cpu/apollolake/fsp_bindings.c
  24. 5 1
      arch/x86/lib/acpi_table.c
  25. 1 1
      board/elgin/elgin_rv1108/elgin_rv1108.c
  26. 3 0
      board/intel/edison/Kconfig
  27. 1 1
      board/rockchip/evb_rv1108/evb_rv1108.c
  28. 1 1
      board/toradex/apalis-imx8/MAINTAINERS
  29. 0 0
      board/toradex/apalis-imx8/apalis-imx8-imximage.cfg
  30. 0 2
      board/toradex/colibri-imx6ull/colibri-imx6ull.c
  31. 1 1
      board/toradex/colibri-imx8x/MAINTAINERS
  32. 0 0
      board/toradex/colibri-imx8x/colibri-imx8x-imximage.cfg
  33. 2 2
      board/toradex/colibri_imx7/colibri_imx7.c
  34. 0 19
      board/toradex/common/tdx-common.c
  35. 12 0
      cmd/Kconfig
  36. 1 1
      cmd/acpi.c
  37. 16 5
      cmd/mem.c
  38. 7 2
      cmd/nvedit.c
  39. 3 3
      common/Kconfig
  40. 2 0
      common/bootm.c
  41. 5 2
      common/spl/spl_fit.c
  42. 1 1
      configs/apalis-imx8_defconfig
  43. 1 0
      configs/bcm7260_defconfig
  44. 1 0
      configs/bcm7445_defconfig
  45. 2 0
      configs/colibri-imx6ull_defconfig
  46. 1 1
      configs/colibri-imx8x_defconfig
  47. 2 0
      configs/colibri_imx7_defconfig
  48. 2 0
      configs/colibri_imx7_emmc_defconfig
  49. 2 0
      configs/colibri_vf_defconfig
  50. 1 0
      configs/elgin-rv1108_defconfig
  51. 1 0
      configs/evb-rv1108_defconfig
  52. 1 1
      configs/mx6qsabrelite_defconfig
  53. 4 0
      configs/odroid-c4_defconfig
  54. 9 0
      configs/odroid-n2_defconfig
  55. 1 0
      configs/rpi_4_32b_defconfig
  56. 0 1
      configs/tbs2910_defconfig
  57. 10 0
      doc/board/emulation/qemu-arm.rst
  58. 1 1
      doc/board/toradex/apalix-imx8.rst
  59. 1 1
      doc/board/toradex/colibri-imx8x.rst
  60. 119 0
      doc/build/gcc.rst
  61. 2 0
      doc/build/index.rst
  62. 30 0
      doc/build/source.rst
  63. 1 1
      doc/device-tree-bindings/fsp/fsp2/apollolake/fsp-m.txt
  64. 1 1
      doc/device-tree-bindings/fsp/fsp2/apollolake/fsp-s.txt
  65. 6 1
      drivers/mmc/fsl_esdhc_imx.c
  66. 4 0
      drivers/mmc/msm_sdhci.c
  67. 4 14
      drivers/mmc/xenon_sdhci.c
  68. 3 3
      drivers/mtd/nand/raw/nand_util.c
  69. 11 9
      drivers/net/bcmgenet.c
  70. 3 1
      drivers/rng/stm32mp1_rng.c
  71. 13 7
      fs/squashfs/sqfs.c
  72. 1 2
      fs/squashfs/sqfs_dir.c
  73. 4 1
      fs/squashfs/sqfs_inode.c
  74. 2 1
      include/configs/apalis_imx6.h
  75. 4 5
      include/configs/colibri-imx6ull.h
  76. 2 1
      include/configs/colibri_imx6.h
  77. 2 3
      include/configs/colibri_imx7.h
  78. 1 2
      include/configs/colibri_vf.h
  79. 0 4
      include/configs/edison.h
  80. 1 1
      include/phy.h
  81. 9 9
      lib/efi_loader/efi_boottime.c
  82. 1 1
      lib/efi_loader/efi_memory.c
  83. 1 1
      lib/efi_loader/efi_var_mem.c
  84. 4 2
      lib/efi_selftest/efi_selftest.c
  85. 54 14
      lib/efi_selftest/efi_selftest_fdt.c
  86. 2 2
      lib/fdtdec.c
  87. 3 3
      lib/rsa/rsa-keyprop.c
  88. 5 5
      test/dm/acpi.c
  89. 1 1
      test/py/tests/test_env.py

+ 12 - 0
.azure-pipelines.yml

@@ -253,6 +253,18 @@ jobs:
         qemu_x86_64:
           TEST_PY_BD: "qemu-x86_64"
           TEST_PY_TEST_SPEC: "not sleep"
+        r2dplus_i82557c:
+          TEST_PY_BD: "r2dplus"
+          TEST_PY_ID: "--id i82557c_qemu"
+        r2dplus_pcnet:
+          TEST_PY_BD: "r2dplus"
+          TEST_PY_ID: "--id pcnet_qemu"
+        r2dplus_rtl8139:
+          TEST_PY_BD: "r2dplus"
+          TEST_PY_ID: "--id rtl8139_qemu"
+        r2dplus_tulip:
+          TEST_PY_BD: "r2dplus"
+          TEST_PY_ID: "--id tulip_qemu"
         xilinx_zynq_virt:
           TEST_PY_BD: "xilinx_zynq_virt"
           TEST_PY_ID: "--id qemu"

+ 28 - 0
.gitlab-ci.yml

@@ -359,6 +359,34 @@ qemu-x86_64 test.py:
     TEST_PY_TEST_SPEC: "not sleep"
   <<: *buildman_and_testpy_dfn
 
+r2dplus_i82557c test.py:
+  tags: [ 'all' ]
+  variables:
+    TEST_PY_BD: "r2dplus"
+    TEST_PY_ID: "--id i82557c_qemu"
+  <<: *buildman_and_testpy_dfn
+
+r2dplus_pcnet test.py:
+  tags: [ 'all' ]
+  variables:
+    TEST_PY_BD: "r2dplus"
+    TEST_PY_ID: "--id pcnet_qemu"
+  <<: *buildman_and_testpy_dfn
+
+r2dplus_rtl8139 test.py:
+  tags: [ 'all' ]
+  variables:
+    TEST_PY_BD: "r2dplus"
+    TEST_PY_ID: "--id rtl8139_qemu"
+  <<: *buildman_and_testpy_dfn
+
+r2dplus_tulip test.py:
+  tags: [ 'all' ]
+  variables:
+    TEST_PY_BD: "r2dplus"
+    TEST_PY_ID: "--id tulip_qemu"
+  <<: *buildman_and_testpy_dfn
+
 xilinx_zynq_virt test.py:
   tags: [ 'all' ]
   variables:

+ 28 - 0
.travis.yml

@@ -646,6 +646,34 @@ matrix:
           QEMU_TARGET="x86_64-softmmu"
           TOOLCHAIN="i386"
           BUILD_ROM="yes"
+    - name: "test/py r2dplus_i82557c"
+      env:
+        - TEST_PY_BD="r2dplus"
+          TEST_PY_ID="--id i82557c_qemu"
+          QEMU_TARGET="sh4-softmmu"
+          BUILDMAN="sh -x arm"
+          TOOLCHAIN="sh"
+    - name: "test/py r2dplus_pcnet"
+      env:
+        - TEST_PY_BD="r2dplus"
+          TEST_PY_ID="--id pcnet_qemu"
+          QEMU_TARGET="sh4-softmmu"
+          BUILDMAN="sh -x arm"
+          TOOLCHAIN="sh"
+    - name: "test/py r2dplus_rtl8139"
+      env:
+        - TEST_PY_BD="r2dplus"
+          TEST_PY_ID="--id rtl8139_qemu"
+          QEMU_TARGET="sh4-softmmu"
+          BUILDMAN="sh -x arm"
+          TOOLCHAIN="sh"
+    - name: "test/py r2dplus_tulip"
+      env:
+        - TEST_PY_BD="r2dplus"
+          TEST_PY_ID="--id tulip_qemu"
+          QEMU_TARGET="sh4-softmmu"
+          BUILDMAN="sh -x arm"
+          TOOLCHAIN="sh"
     - name: "test/py xilinx_zynq_virt"
       env:
         - TEST_PY_BD="xilinx_zynq_virt"

+ 3 - 1
MAINTAINERS

@@ -625,7 +625,7 @@ F:	drivers/mtd/jedec_flash.c
 CLOCK
 M:	Lukasz Majewski <lukma@denx.de>
 S:	Maintained
-T:	git git://git.denx.de/u-boot-dfu.git
+T:	git https://gitlab.denx.de/u-boot/custodians/u-boot-clk.git
 F:	drivers/clk/
 F:	drivers/clk/imx/
 
@@ -989,6 +989,8 @@ F:	include/spmi/
 
 SQUASHFS
 M:	Joao Marcos Costa <joaomarcos.costa@bootlin.com>
+R:	Thomas Petazzoni <thomas.petazzoni@bootlin.com>
+R:	Miquel Raynal <miquel.raynal@bootlin.com>
 S:	Maintained
 F:	fs/squashfs/
 F:	include/sqfs.h

+ 2 - 2
Makefile

@@ -3,7 +3,7 @@
 VERSION = 2020
 PATCHLEVEL = 10
 SUBLEVEL =
-EXTRAVERSION = -rc4
+EXTRAVERSION = -rc5
 NAME =
 
 # *DOCUMENTATION*
@@ -2025,7 +2025,7 @@ CLEAN_FILES += include/bmp_logo.h include/bmp_logo_data.h tools/version.h \
 
 # Directories & files removed with 'make mrproper'
 MRPROPER_DIRS  += include/config include/generated spl tpl \
-		  .tmp_objdiff
+		  .tmp_objdiff doc/output
 MRPROPER_FILES += .config .config.old include/autoconf.mk* include/config.h \
 		  ctags etags tags TAGS cscope* GPATH GTAGS GRTAGS GSYMS \
 		  drivers/video/fonts/*.S

+ 3 - 3
arch/arm/dts/fsl-imx8qm-apalis.dts

@@ -12,8 +12,8 @@
 #include "fsl-imx8qm-apalis-u-boot.dtsi"
 
 / {
-	model = "Toradex Apalis iMX8QM";
-	compatible = "toradex,apalis-imx8qm", "fsl,imx8qm";
+	model = "Toradex Apalis iMX8";
+	compatible = "toradex,apalis-imx8", "fsl,imx8qm";
 
 	chosen {
 		bootargs = "console=ttyLP1,115200 earlycon=lpuart32,0x5a070000,115200";
@@ -38,7 +38,7 @@
 		    <&pinctrl_qspi1a_gpios>, <&pinctrl_sata1_act>,
 		    <&pinctrl_sim0_gpios>, <&pinctrl_usdhc1_gpios>;
 
-	apalis-imx8qm {
+	apalis-imx8 {
 		pinctrl_gpio12: gpio12grp {
 			fsl,pins = <
 				/* Apalis GPIO1 */

+ 3 - 3
arch/arm/dts/fsl-imx8qxp-colibri.dts

@@ -9,8 +9,8 @@
 #include "fsl-imx8qxp-colibri-u-boot.dtsi"
 
 / {
-	model = "Toradex Colibri iMX8QXP";
-	compatible = "toradex,colibri-imx8qxp", "fsl,imx8qxp";
+	model = "Toradex Colibri iMX8X";
+	compatible = "toradex,colibri-imx8x", "fsl,imx8qxp";
 
 	chosen {
 		bootargs = "console=ttyLP3,115200 earlycon=lpuart32,0x5a090000,115200";
@@ -32,7 +32,7 @@
 	pinctrl-names = "default";
 	pinctrl-0 = <&pinctrl_hog0>, <&pinctrl_hog1>, <&pinctrl_hog2>;
 
-	colibri-imx8qxp {
+	colibri-imx8x {
 		pinctrl_lpuart0: lpuart0grp {
 			fsl,pins = <
 				SC_P_UART0_RX_ADMA_UART0_RX	0x06000020

+ 4 - 0
arch/arm/dts/rv1108-u-boot.dtsi

@@ -4,3 +4,7 @@
  */
 
 #include "rockchip-u-boot.dtsi"
+
+&grf {
+	u-boot,dm-pre-reloc;
+};

+ 2 - 0
arch/arm/dts/stm32mp15xx-dhcor-avenger96-u-boot.dtsi

@@ -75,6 +75,8 @@
 	};
 	pins2 {
 		u-boot,dm-pre-reloc;
+		/delete-property/ bias-disable;
+		bias-pull-up;
 	};
 };
 

+ 2 - 2
arch/arm/dts/stm32mp15xx-dhcor-u-boot.dtsi

@@ -132,11 +132,11 @@
 		u-boot,dm-pre-reloc;
 	};
 
-	/* VCO = 600.0 MHz => P = 100, Q = 50, R = 100 */
+	/* VCO = 600.0 MHz => P = 99, Q = 74, R = 99 */
 	pll4: st,pll@3 {
 		compatible = "st,stm32mp1-pll";
 		reg = <3>;
-		cfg = < 1 49 5 11 5 PQR(1,1,1) >;
+		cfg = < 3 98 5 7 5 PQR(1,1,1) >;
 		u-boot,dm-pre-reloc;
 	};
 };

+ 0 - 2
arch/arm/include/asm/arch-imx/cpu.h

@@ -41,9 +41,7 @@
 #define MXC_CPU_IMX8MNDL		0x8f /* dummy ID */
 #define MXC_CPU_IMX8MNSL		0x181 /* dummy ID */
 #define MXC_CPU_IMX8MP		0x182/* dummy ID */
-#define MXC_CPU_IMX8MP7		0x183 /* dummy ID */
 #define MXC_CPU_IMX8MP6		0x184 /* dummy ID */
-#define MXC_CPU_IMX8MP5		0x185 /* dummy ID */
 #define MXC_CPU_IMX8MPL		0x186 /* dummy ID */
 #define MXC_CPU_IMX8MPD		0x187 /* dummy ID */
 #define MXC_CPU_IMX8QXP_A0	0x90 /* dummy ID */

+ 5 - 5
arch/arm/include/asm/arch-imx8m/clock_imx8mq.h

@@ -316,7 +316,7 @@ enum clk_src_index {
 #define FRAC_PLL_LOCK_MASK		BIT(31)
 #define FRAC_PLL_CLKE_MASK		BIT(21)
 #define FRAC_PLL_PD_MASK		BIT(19)
-#define FRAC_PLL_REFCLK_SEL_MASK	BIT(16)
+#define FRAC_PLL_REFCLK_SEL_MASK	(0x3 << 16)
 #define FRAC_PLL_LOCK_SEL_MASK		BIT(15)
 #define FRAC_PLL_BYPASS_MASK		BIT(14)
 #define FRAC_PLL_COUNTCLK_SEL_MASK	BIT(13)
@@ -358,10 +358,10 @@ enum clk_src_index {
 #define SSCG_PLL_LOCK_SEL_MASK		BIT(3)
 #define SSCG_PLL_COUNTCLK_SEL_MASK	BIT(2)
 #define SSCG_PLL_REFCLK_SEL_MASK	0x3
-#define SSCG_PLL_REFCLK_SEL_OSC_25M	(0 << 16)
-#define SSCG_PLL_REFCLK_SEL_OSC_27M	BIT(16)
-#define SSCG_PLL_REFCLK_SEL_HDMI_PHY_27M (2 << 16)
-#define SSCG_PLL_REFCLK_SEL_CLK_PN	(3 << 16)
+#define SSCG_PLL_REFCLK_SEL_OSC_25M	(0)
+#define SSCG_PLL_REFCLK_SEL_OSC_27M	(1)
+#define SSCG_PLL_REFCLK_SEL_HDMI_PHY_27M (2)
+#define SSCG_PLL_REFCLK_SEL_CLK_PN	(3)
 
 #define SSCG_PLL_SSDS_MASK		BIT(8)
 #define SSCG_PLL_SSMD_MASK		(0x7 << 5)

+ 1 - 1
arch/arm/include/asm/arch-mx7/crm_regs.h

@@ -57,7 +57,7 @@ struct mxc_ccm_reg {
 	uint32_t reserved_0[4092];
 	struct mxc_ccm_ccgr ccgr_array[191];	/* offset 0x4000 */
 	uint32_t reserved_1[3332];
-	struct mxc_ccm_root_slice root[121];	/* offset 0x8000 */
+	struct mxc_ccm_root_slice root[125];	/* offset 0x8000 */
 
 };
 

+ 1 - 4
arch/arm/include/asm/mach-imx/sys_proto.h

@@ -67,13 +67,10 @@ struct bd_info;
 #define is_imx8mndl() (is_cpu_type(MXC_CPU_IMX8MNDL))
 #define is_imx8mnsl() (is_cpu_type(MXC_CPU_IMX8MNSL))
 #define is_imx8mp() (is_cpu_type(MXC_CPU_IMX8MP)  || is_cpu_type(MXC_CPU_IMX8MPD) || \
-	is_cpu_type(MXC_CPU_IMX8MPL) || is_cpu_type(MXC_CPU_IMX8MP7) || \
-	is_cpu_type(MXC_CPU_IMX8MP6) || is_cpu_type(MXC_CPU_IMX8MP5))
+	is_cpu_type(MXC_CPU_IMX8MPL) || is_cpu_type(MXC_CPU_IMX8MP6))
 #define is_imx8mpd() (is_cpu_type(MXC_CPU_IMX8MPD))
 #define is_imx8mpl() (is_cpu_type(MXC_CPU_IMX8MPL))
-#define is_imx8mp7() (is_cpu_type(MXC_CPU_IMX8MP7))
 #define is_imx8mp6() (is_cpu_type(MXC_CPU_IMX8MP6))
-#define is_imx8mp5() (is_cpu_type(MXC_CPU_IMX8MP5))
 
 #define is_imx8qxp() (is_cpu_type(MXC_CPU_IMX8QXP))
 

+ 0 - 4
arch/arm/mach-imx/cpu.c

@@ -102,12 +102,8 @@ const char *get_imx_type(u32 imxtype)
 		return "8MP Dual[3]";	/* Dual-core version of the imx8mp */
 	case MXC_CPU_IMX8MPL:
 		return "8MP Lite[4]";	/* Quad-core Lite version of the imx8mp */
-	case MXC_CPU_IMX8MP7:
-		return "8MP[7]";	/* Quad-core version of the imx8mp, VPU fused */
 	case MXC_CPU_IMX8MP6:
 		return "8MP[6]";	/* Quad-core version of the imx8mp, NPU fused */
-	case MXC_CPU_IMX8MP5:
-		return "8MP[5]";	/* Quad-core version of the imx8mp, ISP fused */
 	case MXC_CPU_IMX8MN:
 		return "8MNano Quad"; /* Quad-core version */
 	case MXC_CPU_IMX8MND:

+ 1 - 0
arch/arm/mach-imx/imx8m/clock_imx8mm.c

@@ -360,6 +360,7 @@ void init_clk_ecspi(u32 index)
 		clock_enable(CCGR_ECSPI2, 0);
 		clock_set_target_val(ECSPI2_CLK_ROOT, CLK_ROOT_ON | CLK_ROOT_SOURCE_SEL(0));
 		clock_enable(CCGR_ECSPI2, 1);
+		return;
 	case 2:
 		clock_enable(CCGR_ECSPI3, 0);
 		clock_set_target_val(ECSPI3_CLK_ROOT, CLK_ROOT_ON | CLK_ROOT_SOURCE_SEL(0));

+ 4 - 8
arch/arm/mach-imx/imx8m/soc.c

@@ -343,12 +343,8 @@ static u32 get_cpu_variant_type(u32 type)
 		switch (flag) {
 		case 7:
 			return MXC_CPU_IMX8MPL;
-		case 6:
-			return MXC_CPU_IMX8MP5;
 		case 2:
 			return MXC_CPU_IMX8MP6;
-		case 1:
-			return MXC_CPU_IMX8MP7;
 		default:
 			break;
 		}
@@ -889,16 +885,16 @@ usb_modify_speed:
 		disable_cpu_nodes(blob, 3);
 
 #elif defined(CONFIG_IMX8MP)
-	if (is_imx8mpl() || is_imx8mp7())
+	if (is_imx8mpl())
 		disable_vpu_nodes(blob);
 
-	if (is_imx8mpl() || is_imx8mp6() || is_imx8mp5())
+	if (is_imx8mpl() || is_imx8mp6())
 		disable_npu_nodes(blob);
 
-	if (is_imx8mpl() || is_imx8mp5())
+	if (is_imx8mpl())
 		disable_isp_nodes(blob);
 
-	if (is_imx8mpl() || is_imx8mp7() || is_imx8mp6() || is_imx8mp5())
+	if (is_imx8mpl() || is_imx8mp6())
 		disable_dsp_nodes(blob);
 
 	if (is_imx8mpd())

+ 15 - 0
arch/arm/mach-imx/mx6/ddr.c

@@ -250,16 +250,31 @@ int mmdc_do_write_level_calibration(struct mx6_ddr_sysinfo const *sysinfo)
 
 static void mmdc_set_sdqs(bool set)
 {
+	struct mx6sdl_iomux_ddr_regs *mx6sdl_ddr_iomux =
+		(struct mx6sdl_iomux_ddr_regs *)MX6SDL_IOM_DDR_BASE;
 	struct mx6dq_iomux_ddr_regs *mx6dq_ddr_iomux =
 		(struct mx6dq_iomux_ddr_regs *)MX6DQ_IOM_DDR_BASE;
 	struct mx6sx_iomux_ddr_regs *mx6sx_ddr_iomux =
 		(struct mx6sx_iomux_ddr_regs *)MX6SX_IOM_DDR_BASE;
+	struct mx6sl_iomux_ddr_regs *mx6sl_ddr_iomux =
+		(struct mx6sl_iomux_ddr_regs *)MX6SL_IOM_DDR_BASE;
+	struct mx6ul_iomux_ddr_regs *mx6ul_ddr_iomux =
+		(struct mx6ul_iomux_ddr_regs *)MX6UL_IOM_DDR_BASE;
 	int i, sdqs_cnt;
 	u32 sdqs;
 
 	if (is_mx6sx()) {
 		sdqs = (u32)(&mx6sx_ddr_iomux->dram_sdqs0);
 		sdqs_cnt = 2;
+	} else if (is_mx6sl()) {
+		sdqs = (u32)(&mx6sl_ddr_iomux->dram_sdqs0);
+		sdqs_cnt = 2;
+	} else if (is_mx6ul() || is_mx6ull()) {
+		sdqs = (u32)(&mx6ul_ddr_iomux->dram_sdqs0);
+		sdqs_cnt = 2;
+	} else if (is_mx6sdl()) {
+		sdqs = (u32)(&mx6sdl_ddr_iomux->dram_sdqs0);
+		sdqs_cnt = 8;
 	} else {	/* MX6DQ */
 		sdqs = (u32)(&mx6dq_ddr_iomux->dram_sdqs0);
 		sdqs_cnt = 8;

+ 3 - 3
arch/arm/mach-mediatek/Kconfig

@@ -47,10 +47,10 @@ config TARGET_MT8512
         select ARM64
 	select MT8512
         help
-          The MediaTek MT8512 is a ARM64-based SoC with a quad-core Cortex-A53.
+          The MediaTek MT8512 is a ARM64-based SoC with a dual-core Cortex-A53.
           including UART, SPI, USB2.0 and OTG, SD and MMC cards, NAND, PWM,
-          Ethernet, IR TX/RX, I2C, I2S, S/PDIF, and built-in Wi-Fi / Bluetooth combo
-          chip and several DDR3 and DDR4 options.
+          IR RX, I2C, I2S, S/PDIF, and built-in Wi-Fi / Bluetooth digital
+          and several LPDDR3 and LPDDR4 options.
 
 config TARGET_MT8516
 	bool "MediaTek MT8516 SoC"

+ 3 - 2
arch/arm/mach-rockchip/make_fit_atf.py

@@ -189,8 +189,9 @@ def unpack_elf(filename):
         p_type, p_flags, p_offset = struct.unpack_from('<LLQ', elf, offset)
         if p_type == 1: # PT_LOAD
             p_paddr, p_filesz = struct.unpack_from('<2Q', elf, offset + 0x18)
-            p_data = elf[p_offset:p_offset + p_filesz]
-            segments.append((index, e_entry, p_paddr, p_data))
+            if p_filesz > 0:
+                p_data = elf[p_offset:p_offset + p_filesz]
+                segments.append((index, e_entry, p_paddr, p_data))
     return segments
 
 def main():

+ 2 - 2
arch/arm/mach-stm32mp/cpu.c

@@ -580,8 +580,8 @@ __weak int setup_mac_address(void)
 		return -EINVAL;
 	}
 	pr_debug("OTP MAC address = %pM\n", enetaddr);
-	ret = !eth_env_set_enetaddr("ethaddr", enetaddr);
-	if (!ret)
+	ret = eth_env_set_enetaddr("ethaddr", enetaddr);
+	if (ret)
 		pr_err("Failed to set mac address %pM from OTP: %d\n",
 		       enetaddr, ret);
 #endif

+ 9 - 0
arch/riscv/include/asm/global_data.h

@@ -39,4 +39,13 @@ struct arch_global_data {
 
 #define DECLARE_GLOBAL_DATA_PTR register gd_t *gd asm ("gp")
 
+static inline void set_gd(volatile gd_t *gd_ptr)
+{
+#ifdef CONFIG_64BIT
+	asm volatile("ld gp, %0\n" : : "m"(gd_ptr));
+#else
+	asm volatile("lw gp, %0\n" : : "m"(gd_ptr));
+#endif
+}
+
 #endif /* __ASM_GBL_DATA_H */

+ 3 - 3
arch/x86/cpu/apollolake/fsp_bindings.c

@@ -555,7 +555,7 @@ const struct fsp_binding fsp_m_bindings[] = {
 	}, {
 	.type = FSP_UINT8,
 	.offset = offsetof(struct fsp_m_config, e_mmc_trace_len),
-	.propname = "fspm,e-mmc-trace-len",
+	.propname = "fspm,emmc-trace-len",
 	}, {
 	.type = FSP_UINT8,
 	.offset = offsetof(struct fsp_m_config, skip_cse_rbp),
@@ -1465,11 +1465,11 @@ const struct fsp_binding fsp_s_bindings[] = {
 	}, {
 	.type = FSP_UINT8,
 	.offset = offsetof(struct fsp_s_config, e_mmc_enabled),
-	.propname = "fsps,e-mmc-enabled",
+	.propname = "fsps,emmc-enabled",
 	}, {
 	.type = FSP_UINT8,
 	.offset = offsetof(struct fsp_s_config, e_mmc_host_max_speed),
-	.propname = "fsps,e-mmc-host-max-speed",
+	.propname = "fsps,emmc-host-max-speed",
 	}, {
 	.type = FSP_UINT8,
 	.offset = offsetof(struct fsp_s_config, ufs_enabled),

+ 5 - 1
arch/x86/lib/acpi_table.c

@@ -252,6 +252,8 @@ static void acpi_create_spcr(struct acpi_spcr *spcr)
 	int space_id;
 	int ret = -ENODEV;
 
+	memset((void *)spcr, 0, sizeof(struct acpi_spcr));
+
 	/* Fill out header fields */
 	acpi_fill_header(header, "SPCR");
 	header->length = sizeof(struct acpi_spcr);
@@ -427,7 +429,7 @@ ulong write_acpi_tables(ulong start_addr)
 	       (char *)&AmlCode + sizeof(struct acpi_table_header),
 	       dsdt->length - sizeof(struct acpi_table_header));
 
-	acpi_inc_align(ctx, dsdt->length - sizeof(struct acpi_table_header));
+	acpi_inc(ctx, dsdt->length - sizeof(struct acpi_table_header));
 
 	/* Pack GNVS into the ACPI table area */
 	for (i = 0; i < dsdt->length; i++) {
@@ -450,6 +452,8 @@ ulong write_acpi_tables(ulong start_addr)
 	dsdt->checksum = 0;
 	dsdt->checksum = table_compute_checksum((void *)dsdt, dsdt->length);
 
+	acpi_align(ctx);
+
 	/*
 	 * Fill in platform-specific global NVS variables. If this fails we
 	 * cannot return the error but this should only happen while debugging.

+ 1 - 1
board/elgin/elgin_rv1108/elgin_rv1108.c

@@ -15,7 +15,7 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
-int mach_cpu_init(void)
+int board_early_init_f(void)
 {
 	struct rv1108_grf *grf;
 	enum {

+ 3 - 0
board/intel/edison/Kconfig

@@ -12,6 +12,9 @@ config SYS_SOC
 config SYS_CONFIG_NAME
 	default "edison"
 
+config SYS_MALLOC_LEN
+	default 0x08000000
+
 config SYS_TEXT_BASE
 	default 0x01101000
 

+ 1 - 1
board/rockchip/evb_rv1108/evb_rv1108.c

@@ -14,7 +14,7 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
-int mach_cpu_init(void)
+int board_early_init_f(void)
 {
 	struct rv1108_grf *grf;
 	enum {

+ 1 - 1
board/toradex/apalis-imx8/MAINTAINERS

@@ -5,6 +5,6 @@ S:	Maintained
 F:	arch/arm/dts/fsl-imx8-apalis.dts
 F:	arch/arm/dts/fsl-imx8-apalis-u-boot.dtsi
 F:	board/toradex/apalis-imx8/
-F:	configs/apalis-imx8qm_defconfig
+F:	configs/apalis-imx8_defconfig
 F:	doc/board/toradex/apalix-imx8.rst
 F:	include/configs/apalis-imx8.h

+ 0 - 0
board/toradex/apalis-imx8/apalis-imx8qm-imximage.cfg → board/toradex/apalis-imx8/apalis-imx8-imximage.cfg


+ 0 - 2
board/toradex/colibri-imx6ull/colibri-imx6ull.c

@@ -173,8 +173,6 @@ int board_late_init(void)
 
 #if defined(CONFIG_DM_VIDEO)
 	setup_lcd();
-
-	show_boot_logo();
 #endif
 
 	return 0;

+ 1 - 1
board/toradex/colibri-imx8x/MAINTAINERS

@@ -5,6 +5,6 @@ S:	Maintained
 F:	arch/arm/dts/fsl-imx8x-colibri.dts
 F:	arch/arm/dts/fsl-imx8x-colibri-u-boot.dtsi
 F:	board/toradex/colibri-imx8x/
-F:	configs/colibri-imx8qxp_defconfig
+F:	configs/colibri-imx8x_defconfig
 F:	doc/board/toradex/colibri-imx8x.rst
 F:	include/configs/colibri-imx8x.h

+ 0 - 0
board/toradex/colibri-imx8x/colibri-imx8qxp-imximage.cfg → board/toradex/colibri-imx8x/colibri-imx8x-imximage.cfg


+ 2 - 2
board/toradex/colibri_imx7/colibri_imx7.c

@@ -133,8 +133,10 @@ static int setup_lcd(void)
  */
 void board_preboot_os(void)
 {
+#ifdef CONFIG_DM_VIDEO
 	gpio_direction_output(GPIO_PWM_A, 1);
 	gpio_direction_output(GPIO_BL_ON, 0);
+#endif
 }
 
 static void setup_iomux_uart(void)
@@ -356,8 +358,6 @@ int board_late_init(void)
 {
 #if defined(CONFIG_DM_VIDEO)
 	setup_lcd();
-
-	show_boot_logo();
 #endif
 	return 0;
 }

+ 0 - 19
board/toradex/common/tdx-common.c

@@ -203,22 +203,3 @@ int ft_common_board_setup(void *blob, struct bd_info *bd)
 }
 
 #endif /* CONFIG_TDX_CFG_BLOCK */
-
-#if defined(CONFIG_DM_VIDEO)
-int show_boot_logo(void)
-{
-	struct udevice *dev;
-	int ret;
-	int xpos, ypos;
-
-	splash_get_pos(&xpos, &ypos);
-
-	ret = uclass_get_device(UCLASS_VIDEO, 0, &dev);
-	if (ret)
-		return ret;
-
-	ret = video_bmp_display(dev, (ulong)bmp_logo_bitmap, xpos, ypos, true);
-
-	return ret;
-}
-#endif /* CONFIG_DM_VIDEO */

+ 12 - 0
cmd/Kconfig

@@ -777,6 +777,18 @@ config SYS_ALT_MEMTEST
 	help
 	  Use a more complete alternative memory test.
 
+if SYS_ALT_MEMTEST
+
+config SYS_ALT_MEMTEST_BITFLIP
+	bool "Bitflip test"
+	default y
+	help
+	  The alternative memory test includes bitflip test since 2020.07.
+	  The bitflip test significantly increases the overall test time.
+	  Bitflip test can optionally be disabled here.
+
+endif
+
 config SYS_MEMTEST_START
 	hex "default start address for mtest"
 	default 0

+ 1 - 1
cmd/acpi.c

@@ -26,7 +26,7 @@ static void dump_hdr(struct acpi_table_header *hdr)
 	printf("%.*s %08lx %06x", ACPI_NAME_LEN, hdr->signature,
 	       (ulong)map_to_sysmem(hdr), hdr->length);
 	if (has_hdr) {
-		printf(" (v%02d %.6s %.8s %u %.4s %d)\n", hdr->revision,
+		printf(" (v%02d %.6s %.8s %x %.4s %x)\n", hdr->revision,
 		       hdr->oem_id, hdr->oem_table_id, hdr->oem_revision,
 		       hdr->aslc_id, hdr->aslc_revision);
 	} else {

+ 16 - 5
cmd/mem.c

@@ -985,6 +985,18 @@ static ulong test_bitflip_comparison(volatile unsigned long *bufa,
 	return errs;
 }
 
+static ulong mem_test_bitflip(vu_long *buf, ulong start, ulong end)
+{
+	/*
+	 * Split the specified range into two halves.
+	 * Note that mtest range is inclusive of start,end.
+	 * Bitflip test instead uses a count (of 32-bit words).
+	 */
+	ulong half_size = (end - start + 1) / 2 / sizeof(unsigned long);
+
+	return test_bitflip_comparison(buf, buf + half_size, half_size);
+}
+
 static ulong mem_test_quick(vu_long *buf, ulong start_addr, ulong end_addr,
 			    vu_long pattern, int iteration)
 {
@@ -1104,11 +1116,10 @@ static int do_mem_mtest(struct cmd_tbl *cmdtp, int flag, int argc,
 			errs = mem_test_alt(buf, start, end, dummy);
 			if (errs == -1UL)
 				break;
-			count += errs;
-			errs = test_bitflip_comparison(buf,
-						       buf + (end - start) / 2,
-						       (end - start) /
-						       sizeof(unsigned long));
+			if (IS_ENABLED(CONFIG_SYS_ALT_MEMTEST_BITFLIP)) {
+				count += errs;
+				errs = mem_test_bitflip(buf, start, end);
+			}
 		} else {
 			errs = mem_test_quick(buf, start, end, pattern,
 					      iteration);

+ 7 - 2
cmd/nvedit.c

@@ -1171,6 +1171,11 @@ static int do_env_import(struct cmd_tbl *cmdtp, int flag,
 		uint32_t crc;
 		env_t *ep = (env_t *)ptr;
 
+		if (size <= offsetof(env_t, data)) {
+			printf("## Error: Invalid size 0x%zX\n", size);
+			return 1;
+		}
+
 		size -= offsetof(env_t, data);
 		memcpy(&crc, &ep->crc, sizeof(crc));
 
@@ -1472,7 +1477,7 @@ static char env_help_text[] =
 	"env select [target] - select environment target\n"
 #endif
 #if defined(CONFIG_CMD_NVEDIT_EFI)
-	"env set -e [-nv][-bs][-rt][-at][-a][-i addr,size][-v] name [arg ...]\n"
+	"env set -e [-nv][-bs][-rt][-at][-a][-i addr:size][-v] name [arg ...]\n"
 	"    - set UEFI variable; unset if '-i' or 'arg' not specified\n"
 #endif
 	"env set [-f] name [arg ...]\n";
@@ -1536,7 +1541,7 @@ U_BOOT_CMD_COMPLETE(
 	"set environment variables",
 #if defined(CONFIG_CMD_NVEDIT_EFI)
 	"-e [-guid guid][-nv][-bs][-rt][-at][-a][-v]\n"
-	"        [-i addr,size name], or [name [value ...]]\n"
+	"        [-i addr:size name], or [name [value ...]]\n"
 	"    - set UEFI variable 'name' to 'value' ...'\n"
 	"      \"-guid\": GUID xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx\n"
 	"      \"-nv\": set non-volatile attribute\n"

+ 3 - 3
common/Kconfig

@@ -378,7 +378,7 @@ config USE_BOOTARGS
 
 config BOOTARGS
 	string "Boot arguments"
-	depends on USE_BOOTARGS
+	depends on USE_BOOTARGS && !USE_DEFAULT_ENV_FILE
 	help
 	  This can be used to pass arguments to the bootm command. The value of
 	  CONFIG_BOOTARGS goes into the environment value "bootargs". Note that
@@ -395,7 +395,7 @@ config USE_BOOTCOMMAND
 
 config BOOTCOMMAND
 	string "bootcmd value"
-	depends on USE_BOOTCOMMAND
+	depends on USE_BOOTCOMMAND && !USE_DEFAULT_ENV_FILE
 	default "run distro_bootcmd" if DISTRO_DEFAULTS
 	help
 	  This is the string of commands that will be used as bootcmd and if
@@ -416,7 +416,7 @@ config USE_PREBOOT
 
 config PREBOOT
 	string "preboot default value"
-	depends on USE_PREBOOT
+	depends on USE_PREBOOT && !USE_DEFAULT_ENV_FILE
 	default ""
 	help
 	  This is the default of "preboot" environment variable.

+ 2 - 0
common/bootm.c

@@ -390,6 +390,8 @@ static int bootm_load_os(bootm_headers_t *images, int boot_progress)
 		bootstage_error(BOOTSTAGE_ID_DECOMP_IMAGE);
 		return err;
 	}
+	/* We need the decompressed image size in the next steps */
+	images->os.image_len = load_end - load;
 
 	flush_cache(flush_start, ALIGN(load_end, ARCH_DMA_MINALIGN) - flush_start);
 

+ 5 - 2
common/spl/spl_fit.c

@@ -349,9 +349,12 @@ static int spl_fit_append_fdt(struct spl_image_info *spl_image,
 
 	/*
 	 * Use the address following the image as target address for the
-	 * device tree.
+	 * device tree. Load address is aligned to 8 bytes to match the required
+	 * alignment specified for linux arm [1] and arm 64 [2] booting
+	 * [1]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/arm/booting.rst#n126
+	 * [2]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/arm64/booting.rst#n45
 	 */
-	image_info.load_addr = spl_image->load_addr + spl_image->size;
+	image_info.load_addr = ALIGN(spl_image->load_addr + spl_image->size, 8);
 
 	/* Figure out which device tree the board wants to use */
 	node = spl_fit_get_image_node(fit, images, FIT_FDT_PROP, index++);

+ 1 - 1
configs/apalis-imx8qm_defconfig → configs/apalis-imx8_defconfig

@@ -11,7 +11,7 @@ CONFIG_DEFAULT_DEVICE_TREE="fsl-imx8qm-apalis"
 CONFIG_DISTRO_DEFAULTS=y
 CONFIG_FIT=y
 CONFIG_OF_SYSTEM_SETUP=y
-CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=board/toradex/apalis-imx8/apalis-imx8qm-imximage.cfg"
+CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=board/toradex/apalis-imx8/apalis-imx8-imximage.cfg"
 CONFIG_LOG=y
 CONFIG_VERSION_VARIABLE=y
 # CONFIG_DISPLAY_BOARDINFO is not set

+ 1 - 0
configs/bcm7260_defconfig

@@ -27,6 +27,7 @@ CONFIG_ENV_OVERWRITE=y
 CONFIG_ENV_IS_IN_MMC=y
 CONFIG_SYS_REDUNDAND_ENVIRONMENT=y
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
+# CONFIG_NET is not set
 CONFIG_DM_MMC=y
 CONFIG_MMC_SDHCI=y
 CONFIG_MMC_SDHCI_BCMSTB=y

+ 1 - 0
configs/bcm7445_defconfig

@@ -28,6 +28,7 @@ CONFIG_ENV_OVERWRITE=y
 CONFIG_ENV_IS_IN_SPI_FLASH=y
 CONFIG_SYS_REDUNDAND_ENVIRONMENT=y
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
+# CONFIG_NET is not set
 CONFIG_DM_MMC=y
 CONFIG_MMC_SDHCI=y
 CONFIG_MMC_SDHCI_BCMSTB=y

+ 2 - 0
configs/colibri-imx6ull_defconfig

@@ -13,6 +13,8 @@ CONFIG_FIT=y
 CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=board/toradex/colibri-imx6ull/imximage.cfg,IMX_NAND"
 CONFIG_BOOTDELAY=1
 # CONFIG_USE_BOOTCOMMAND is not set
+CONFIG_USE_PREBOOT=y
+CONFIG_PREBOOT="setenv fdtfile imx6ull-colibri${variant}-${fdt_board}.dtb"
 # CONFIG_CONSOLE_MUX is not set
 CONFIG_SYS_CONSOLE_IS_IN_ENV=y
 CONFIG_VERSION_VARIABLE=y

+ 1 - 1
configs/colibri-imx8qxp_defconfig → configs/colibri-imx8x_defconfig

@@ -10,7 +10,7 @@ CONFIG_TARGET_COLIBRI_IMX8X=y
 CONFIG_DEFAULT_DEVICE_TREE="fsl-imx8qxp-colibri"
 CONFIG_DISTRO_DEFAULTS=y
 CONFIG_FIT=y
-CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=board/toradex/colibri-imx8x/colibri-imx8qxp-imximage.cfg"
+CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=board/toradex/colibri-imx8x/colibri-imx8x-imximage.cfg"
 CONFIG_LOG=y
 CONFIG_VERSION_VARIABLE=y
 # CONFIG_DISPLAY_BOARDINFO is not set

+ 2 - 0
configs/colibri_imx7_defconfig

@@ -14,6 +14,8 @@ CONFIG_DISTRO_DEFAULTS=y
 CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=board/toradex/colibri_imx7/imximage.cfg,MX7D"
 CONFIG_BOOTDELAY=1
 # CONFIG_USE_BOOTCOMMAND is not set
+CONFIG_USE_PREBOOT=y
+CONFIG_PREBOOT="setenv fdtfile ${soc}-colibri-${fdt_board}.dtb "
 # CONFIG_CONSOLE_MUX is not set
 CONFIG_SYS_CONSOLE_IS_IN_ENV=y
 CONFIG_BOARD_LATE_INIT=y

+ 2 - 0
configs/colibri_imx7_emmc_defconfig

@@ -16,6 +16,8 @@ CONFIG_FIT=y
 CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=board/toradex/colibri_imx7/imximage.cfg,MX7D"
 CONFIG_BOOTDELAY=1
 # CONFIG_USE_BOOTCOMMAND is not set
+CONFIG_USE_PREBOOT=y
+CONFIG_PREBOOT="setenv fdtfile ${soc}-colibri-emmc-${fdt_board}.dtb"
 # CONFIG_CONSOLE_MUX is not set
 CONFIG_SYS_CONSOLE_IS_IN_ENV=y
 CONFIG_BOARD_LATE_INIT=y

+ 2 - 0
configs/colibri_vf_defconfig

@@ -12,6 +12,8 @@ CONFIG_DEFAULT_DEVICE_TREE="vf610-colibri"
 CONFIG_ENV_VARS_UBOOT_CONFIG=y
 CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=board/toradex/colibri_vf/imximage.cfg,IMX_NAND"
 CONFIG_BOOTDELAY=1
+CONFIG_USE_PREBOOT=y
+CONFIG_PREBOOT="setenv fdtfile ${soc}-colibri-${fdt_board}.dtb"
 CONFIG_LOGLEVEL=3
 CONFIG_VERSION_VARIABLE=y
 # CONFIG_DISPLAY_BOARDINFO is not set

+ 1 - 0
configs/elgin-rv1108_defconfig

@@ -15,6 +15,7 @@ CONFIG_DEFAULT_FDT_FILE="rv1108-elgin-r1.dtb"
 CONFIG_BOARD_LATE_INIT=y
 # CONFIG_DISPLAY_CPUINFO is not set
 CONFIG_DISPLAY_BOARDINFO_LATE=y
+CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_CMD_GPIO=y
 CONFIG_RANDOM_UUID=y
 CONFIG_CMD_MMC=y

+ 1 - 0
configs/evb-rv1108_defconfig

@@ -11,6 +11,7 @@ CONFIG_DEBUG_UART=y
 CONFIG_DEFAULT_FDT_FILE="rv1108-evb.dtb"
 # CONFIG_DISPLAY_CPUINFO is not set
 CONFIG_DISPLAY_BOARDINFO_LATE=y
+CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_RANDOM_UUID=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_SETEXPR is not set

+ 1 - 1
configs/mx6qsabrelite_defconfig

@@ -4,7 +4,7 @@ CONFIG_SYS_TEXT_BASE=0x17800000
 CONFIG_SYS_MALLOC_F_LEN=0x4000
 CONFIG_NR_DRAM_BANKS=1
 CONFIG_ENV_SIZE=0x2000
-CONFIG_ENV_OFFSET=0x60000
+CONFIG_ENV_OFFSET=0xC0000
 CONFIG_MX6Q=y
 CONFIG_TARGET_NITROGEN6X=y
 CONFIG_DM_GPIO=y

+ 4 - 0
configs/odroid-c4_defconfig

@@ -49,6 +49,7 @@ CONFIG_USB_XHCI_DWC3=y
 CONFIG_USB_DWC3=y
 # CONFIG_USB_DWC3_GADGET is not set
 CONFIG_USB_DWC3_MESON_G12A=y
+CONFIG_USB_KEYBOARD=y
 CONFIG_USB_GADGET=y
 CONFIG_USB_GADGET_VENDOR_NUM=0x1b8e
 CONFIG_USB_GADGET_PRODUCT_NUM=0xfada
@@ -56,6 +57,9 @@ CONFIG_USB_GADGET_DWC2_OTG=y
 CONFIG_USB_GADGET_DWC2_OTG_PHY_BUS_WIDTH_8=y
 CONFIG_USB_GADGET_DOWNLOAD=y
 CONFIG_DM_VIDEO=y
+# CONFIG_VIDEO_BPP8 is not set
+# CONFIG_VIDEO_BPP16 is not set
+CONFIG_SYS_WHITE_ON_BLACK=y
 CONFIG_VIDEO_MESON=y
 CONFIG_VIDEO_DT_SIMPLEFB=y
 CONFIG_SPLASH_SCREEN=y

+ 9 - 0
configs/odroid-n2_defconfig

@@ -34,6 +34,8 @@ CONFIG_ETH_DESIGNWARE=y
 CONFIG_MESON_G12A_USB_PHY=y
 CONFIG_PINCTRL=y
 CONFIG_PINCTRL_MESON_G12A=y
+CONFIG_POWER_DOMAIN=y
+CONFIG_MESON_EE_POWER_DOMAIN=y
 CONFIG_DM_REGULATOR=y
 CONFIG_DM_REGULATOR_FIXED=y
 CONFIG_DM_RESET=y
@@ -47,10 +49,17 @@ CONFIG_USB_XHCI_DWC3=y
 CONFIG_USB_DWC3=y
 # CONFIG_USB_DWC3_GADGET is not set
 CONFIG_USB_DWC3_MESON_G12A=y
+CONFIG_USB_KEYBOARD=y
 CONFIG_USB_GADGET=y
 CONFIG_USB_GADGET_VENDOR_NUM=0x1b8e
 CONFIG_USB_GADGET_PRODUCT_NUM=0xfada
 CONFIG_USB_GADGET_DWC2_OTG=y
 CONFIG_USB_GADGET_DWC2_OTG_PHY_BUS_WIDTH_8=y
 CONFIG_USB_GADGET_DOWNLOAD=y
+CONFIG_DM_VIDEO=y
+# CONFIG_VIDEO_BPP8 is not set
+# CONFIG_VIDEO_BPP16 is not set
+CONFIG_SYS_WHITE_ON_BLACK=y
+CONFIG_VIDEO_MESON=y
+CONFIG_VIDEO_DT_SIMPLEFB=y
 CONFIG_OF_LIBFDT_OVERLAY=y

+ 1 - 0
configs/rpi_4_32b_defconfig

@@ -42,6 +42,7 @@ CONFIG_DM_USB=y
 CONFIG_DM_USB_GADGET=y
 CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_PCI=y
+CONFIG_USB_KEYBOARD=y
 CONFIG_USB_GADGET=y
 CONFIG_USB_GADGET_MANUFACTURER="FSL"
 CONFIG_USB_GADGET_VENDOR_NUM=0x0525

+ 0 - 1
configs/tbs2910_defconfig

@@ -11,7 +11,6 @@ CONFIG_PRE_CON_BUF_ADDR=0x7c000000
 CONFIG_CMD_HDMIDETECT=y
 CONFIG_DEFAULT_DEVICE_TREE="imx6q-tbs2910"
 CONFIG_AHCI=y
-CONFIG_ENV_VARS_UBOOT_CONFIG=y
 CONFIG_BOOTDELAY=3
 CONFIG_USE_BOOTCOMMAND=y
 CONFIG_BOOTCOMMAND="mmc rescan; if run bootcmd_up1; then run bootcmd_up2; else run bootcmd_mmc || run distro_bootcmd; fi"

+ 10 - 0
doc/board/emulation/qemu-arm.rst

@@ -80,3 +80,13 @@ can be enabled with the following command line parameters:
     -drive if=none,file=disk.img,id=mydisk -device nvme,drive=mydisk,serial=foo
 
 These have been tested in QEMU 2.9.0 but should work in at least 2.5.0 as well.
+
+Debug UART
+----------
+
+The debug UART on the ARM virt board uses these settings::
+
+    CONFIG_DEBUG_UART=y
+    CONFIG_DEBUG_UART_PL010=y
+    CONFIG_DEBUG_UART_BASE=0x9000000
+    CONFIG_DEBUG_UART_CLOCK=0

+ 1 - 1
doc/board/toradex/apalix-imx8.rst

@@ -51,7 +51,7 @@ Build U-Boot
 ------------
 .. code-block:: bash
 
-    $ make apalis-imx8qm_defconfig
+    $ make apalis-imx8_defconfig
     $ make u-boot-dtb.imx
 
 Load the U-Boot Binary Using UUU

+ 1 - 1
doc/board/toradex/colibri-imx8x.rst

@@ -52,7 +52,7 @@ Build U-Boot
 
 .. code-block:: bash
 
-   $ make colibri-imx8qxp_defconfig
+   $ make colibri-imx8x_defconfig
    $ make u-boot-dtb.imx
 
 Load the U-Boot Binary Using UUU

+ 119 - 0
doc/build/gcc.rst

@@ -0,0 +1,119 @@
+Building with GCC
+=================
+
+Dependencies
+------------
+
+For building U-Boot you need a GCC compiler for your host platform. If you
+are not building on the target platform you further need  a GCC cross compiler.
+
+Debian based
+~~~~~~~~~~~~
+
+On Debian based systems the cross compiler packages are named
+gcc-<architecture>-linux-gnu.
+
+You could install GCC and the GCC cross compiler for the ARMv8 architecture with
+
+.. code-block:: bash
+
+    sudo apt-get gcc gcc-aarch64-linux-gnu
+
+Depending on the build targets further packages maybe needed
+
+.. code-block:: bash
+
+    sudo apt-get install bc bison build-essential coccinelle \
+      device-tree-compiler dfu-util efitools flex gdisk liblz4-tool \
+      libguestfs-tools libncurses-dev libpython3-dev libsdl2-dev libssl-dev \
+      lzma-alone openssl python3 python3-coverage python3-pyelftools \
+      python3-pytest python3-sphinxcontrib.apidoc python3-sphinx-rtd-theme swig
+
+Prerequisites
+-------------
+
+For some boards you have to build prerequisite files before you can build
+U-Boot, e.g. for the some boards you will need to build the ARM Trusted Firmware
+beforehand. Please, refer to the board specific documentation
+:doc:`../board/index`.
+
+Configuration
+-------------
+
+Directory configs/ contains the template configuration files for the maintained
+boards following the naming scheme::
+
+    <board name>_defconfig
+
+These files have been stripped of default settings. So you cannot use them
+directly. Instead their name serves as a make target to generate the actual
+configuration file .config. For instance the configuration template for the
+Odroid C2 board is called odroid-c2_defconfig. The corresponding .config file
+is generated by
+
+.. code-block:: bash
+
+    make odroid-c2_defconfig
+
+You can adjust the configuration using
+
+.. code-block:: bash
+
+    make menuconfig
+
+Building
+--------
+
+When cross compiling you will have to specify the prefix of the cross-compiler.
+You can either specify the value of the CROSS_COMPILE variable on the make
+command line or export it beforehand.
+
+.. code-block:: bash
+
+    CROSS_COMPILE=<compiler-prefix> make
+
+Assuming cross compiling on Debian for ARMv8 this would be
+
+.. code-block:: bash
+
+    CROSS_COMPILE=aarch64-linux-gnu- make
+
+Build parameters
+~~~~~~~~~~~~~~~~
+
+A list of available parameters for the make command can be obtained via
+
+.. code-block:: bash
+
+    make help
+
+You can speed up compilation by parallelization using the -j parameter, e.g.
+
+.. code-block:: bash
+
+    CROSS_COMPILE=aarch64-linux-gnu- make -j$(nproc)
+
+Further important build parameters are
+
+* O=<dir> - generate all output files in directory <dir>, including .config
+* V=1 - verbose build
+
+Other build targets
+~~~~~~~~~~~~~~~~~~~
+
+A list of all make targets can be obtained via
+
+.. code-block:: bash
+
+    make help
+
+Important ones are
+
+* clean - remove most generated files but keep the configuration
+* mrproper - remove all generated files + config + various backup files
+
+Installation
+------------
+
+The process for installing U-Boot on the target device is device specific.
+Please, refer to the board specific documentation :doc:`../board/index`.

+ 2 - 0
doc/build/index.rst

@@ -6,5 +6,7 @@ Build U-Boot
 .. toctree::
    :maxdepth: 2
 
+   source
+   gcc
    clang
    tools

+ 30 - 0
doc/build/source.rst

@@ -0,0 +1,30 @@
+Obtaining the source
+=====================
+
+The source of the U-Boot project is maintained in a Git repository.
+
+You can download the source via
+
+.. code-block:: bash
+
+    git clone https://gitlab.denx.de/u-boot/u-boot.git
+
+A mirror of the source is maintained on Github
+
+.. code-block:: bash
+
+    git clone https://github.com/u-boot/u-boot
+
+The released versions are available as tags which use the naming scheme::
+
+    v<year>.<month>
+
+Release candidates are named::
+
+    v<year>.<month>-rc<number>
+
+To checkout the October 2020 release you would use:
+
+.. code-block:: bash
+
+    git checkout v2020.10

+ 1 - 1
doc/device-tree-bindings/fsp/fsp2/apollolake/fsp-m.txt

@@ -174,7 +174,7 @@ Optional properties:
 - fspm,oem-loading-base: OEM File Loading Address
 - fspm,oem-file-name: OEM File Name to Load
 - fspm,mrc-boot-data-ptr:
-- fspm,e-mmc-trace-len: eMMC Trace Length
+- fspm,emmc-trace-len: eMMC Trace Length
   0x0: Long
   0x1: Short
 - fspm,skip-cse-rbp: Skip CSE RBP to support zero sized IBB

+ 1 - 1
doc/device-tree-bindings/fsp/fsp2/apollolake/fsp-s.txt

@@ -318,7 +318,7 @@ Optional properties:
   0x6: warm reset (default)
   0xE: cold reset
 - fsps,sdcard-enabled: SD Card Support (D27:F0)
-- fsps,e-mmc-enabled: SeMMC Support (D28:F0)
+- fsps,emmc-enabled: SeMMC Support (D28:F0)
 - fsps,emmc-host-max-speed: eMMC Max Speed
   0: HS400(default)
   1: HS200

+ 6 - 1
drivers/mmc/fsl_esdhc_imx.c

@@ -36,6 +36,7 @@
 #include <dt-structs.h>
 #include <mapmem.h>
 #include <dm/ofnode.h>
+#include <linux/iopoll.h>
 
 #if !CONFIG_IS_ENABLED(BLK)
 #include "mmc_private.h"
@@ -631,6 +632,8 @@ static void set_sysctl(struct fsl_esdhc_priv *priv, struct mmc *mmc, uint clock)
 {
 	struct fsl_esdhc *regs = priv->esdhc_regs;
 	int div = 1;
+	u32 tmp;
+	int ret;
 #ifdef ARCH_MXC
 #ifdef CONFIG_MX53
 	/* For i.MX53 eSDHCv3, SYSCTL.SDCLKFS may not be set to 0. */
@@ -664,7 +667,9 @@ static void set_sysctl(struct fsl_esdhc_priv *priv, struct mmc *mmc, uint clock)
 
 	esdhc_clrsetbits32(&regs->sysctl, SYSCTL_CLOCK_MASK, clk);
 
-	udelay(10000);
+	ret = readx_poll_timeout(esdhc_read32, &regs->prsstat, tmp, tmp & PRSSTAT_SDSTB, 100);
+	if (ret)
+		pr_warn("fsl_esdhc_imx: Internal clock never stabilised.\n");
 
 #ifdef CONFIG_FSL_USDHC
 	esdhc_setbits32(&regs->vendorspec, VENDORSPEC_PEREN | VENDORSPEC_CKEN);

+ 4 - 0
drivers/mmc/msm_sdhci.c

@@ -142,6 +142,10 @@ static int msm_sdc_probe(struct udevice *dev)
 		writel(caps, host->ioaddr + SDHCI_VENDOR_SPEC_CAPABILITIES0);
 	}
 
+	ret = mmc_of_parse(dev, &plat->cfg);
+	if (ret)
+		return ret;
+
 	host->mmc = &plat->mmc;
 	host->mmc->dev = dev;
 	ret = sdhci_setup_cfg(&plat->cfg, host, 0, 0);

+ 4 - 14
drivers/mmc/xenon_sdhci.c

@@ -485,20 +485,10 @@ static int xenon_sdhci_probe(struct udevice *dev)
 		armada_3700_soc_pad_voltage_set(host);
 
 	host->host_caps = MMC_MODE_HS | MMC_MODE_HS_52MHz | MMC_MODE_DDR_52MHz;
-	switch (fdtdec_get_int(gd->fdt_blob, dev_of_offset(dev), "bus-width",
-		1)) {
-	case 8:
-		host->host_caps |= MMC_MODE_8BIT;
-		break;
-	case 4:
-		host->host_caps |= MMC_MODE_4BIT;
-		break;
-	case 1:
-		break;
-	default:
-		printf("Invalid \"bus-width\" value\n");
-		return -EINVAL;
-	}
+
+	ret = mmc_of_parse(dev, &plat->cfg);
+	if (ret)
+		return ret;
 
 	host->ops = &xenon_sdhci_ops;
 

+ 3 - 3
drivers/mtd/nand/raw/nand_util.c

@@ -635,14 +635,14 @@ int nand_write_skip_bad(struct mtd_info *mtd, loff_t offset, size_t *length,
 	}
 
 	while (left_to_write > 0) {
+		loff_t block_start = offset & ~(loff_t)(mtd->erasesize - 1);
 		size_t block_offset = offset & (mtd->erasesize - 1);
 		size_t write_size, truncated_write_size;
 
 		WATCHDOG_RESET();
 
-		if (nand_block_isbad(mtd, offset & ~(mtd->erasesize - 1))) {
-			printf("Skip bad block 0x%08llx\n",
-				offset & ~(mtd->erasesize - 1));
+		if (nand_block_isbad(mtd, block_start)) {
+			printf("Skip bad block 0x%08llx\n", block_start);
 			offset += mtd->erasesize - block_offset;
 			continue;
 		}

+ 11 - 9
drivers/net/bcmgenet.c

@@ -378,8 +378,6 @@ static void rx_descs_init(struct bcmgenet_eth_priv *priv)
 	u32 len_stat, i;
 	void *desc_base = priv->rx_desc_base;
 
-	priv->c_index = 0;
-
 	len_stat = (RX_BUF_LENGTH << DMA_BUFLENGTH_SHIFT) | DMA_OWN;
 
 	for (i = 0; i < RX_DESCS; i++) {
@@ -403,8 +401,11 @@ static void rx_ring_init(struct bcmgenet_eth_priv *priv)
 	writel(RX_DESCS * DMA_DESC_SIZE / 4 - 1,
 	       priv->mac_reg + RDMA_RING_REG_BASE + DMA_END_ADDR);
 
-	writel(0x0, priv->mac_reg + RDMA_PROD_INDEX);
-	writel(0x0, priv->mac_reg + RDMA_CONS_INDEX);
+	/* cannot init RDMA_PROD_INDEX to 0, so align RDMA_CONS_INDEX on it instead */
+	priv->c_index = readl(priv->mac_reg + RDMA_PROD_INDEX);
+	writel(priv->c_index, priv->mac_reg + RDMA_CONS_INDEX);
+	priv->rx_index = priv->c_index;
+	priv->rx_index &= 0xFF;
 	writel((RX_DESCS << DMA_RING_SIZE_SHIFT) | RX_BUF_LENGTH,
 	       priv->mac_reg + RDMA_RING_REG_BASE + DMA_RING_BUF_SIZE);
 	writel(DMA_FC_THRESH_VALUE, priv->mac_reg + RDMA_XON_XOFF_THRESH);
@@ -421,8 +422,10 @@ static void tx_ring_init(struct bcmgenet_eth_priv *priv)
 	writel(0x0, priv->mac_reg + TDMA_WRITE_PTR);
 	writel(TX_DESCS * DMA_DESC_SIZE / 4 - 1,
 	       priv->mac_reg + TDMA_RING_REG_BASE + DMA_END_ADDR);
-	writel(0x0, priv->mac_reg + TDMA_PROD_INDEX);
-	writel(0x0, priv->mac_reg + TDMA_CONS_INDEX);
+	/* cannot init TDMA_CONS_INDEX to 0, so align TDMA_PROD_INDEX on it instead */
+	priv->tx_index = readl(priv->mac_reg + TDMA_CONS_INDEX);
+	writel(priv->tx_index, priv->mac_reg + TDMA_PROD_INDEX);
+	priv->tx_index &= 0xFF;
 	writel(0x1, priv->mac_reg + TDMA_RING_REG_BASE + DMA_MBUF_DONE_THRESH);
 	writel(0x0, priv->mac_reg + TDMA_FLOW_PERIOD);
 	writel((TX_DESCS << DMA_RING_SIZE_SHIFT) | RX_BUF_LENGTH,
@@ -454,7 +457,8 @@ static int bcmgenet_adjust_link(struct bcmgenet_eth_priv *priv)
 	clrsetbits_32(priv->mac_reg + EXT_RGMII_OOB_CTRL, OOB_DISABLE,
 			RGMII_LINK | RGMII_MODE_EN);
 
-	if (phy_dev->interface == PHY_INTERFACE_MODE_RGMII)
+	if (phy_dev->interface == PHY_INTERFACE_MODE_RGMII ||
+	    phy_dev->interface == PHY_INTERFACE_MODE_RGMII_RXID)
 		setbits_32(priv->mac_reg + EXT_RGMII_OOB_CTRL, ID_MODE_DIS);
 
 	writel(speed << CMD_SPEED_SHIFT, (priv->mac_reg + UMAC_CMD));
@@ -469,8 +473,6 @@ static int bcmgenet_gmac_eth_start(struct udevice *dev)
 
 	priv->tx_desc_base = priv->mac_reg + GENET_TX_OFF;
 	priv->rx_desc_base = priv->mac_reg + GENET_RX_OFF;
-	priv->tx_index = 0x0;
-	priv->rx_index = 0x0;
 
 	bcmgenet_umac_reset(priv);
 

+ 3 - 1
drivers/rng/stm32mp1_rng.c

@@ -3,6 +3,8 @@
  * Copyright (c) 2019, Linaro Limited
  */
 
+#define LOG_CATEGORY UCLASS_RNG
+
 #include <common.h>
 #include <clk.h>
 #include <dm.h>
@@ -53,7 +55,7 @@ static int stm32_rng_read(struct udevice *dev, void *data, size_t len)
 			for (i = 0; i < 12; i++)
 				readl(pdata->base + RNG_DR);
 			if (readl(pdata->base + RNG_SR) & RNG_SR_SEIS) {
-				printf("RNG Noise");
+				log_err("RNG Noise");
 				return -EIO;
 			}
 			/* start again */

+ 13 - 7
fs/squashfs/sqfs.c

@@ -154,7 +154,7 @@ static int sqfs_frag_lookup(u32 inode_fragment_index,
 	header = get_unaligned_le16(metadata_buffer + table_offset);
 	metadata = metadata_buffer + table_offset + SQFS_HEADER_SIZE;
 
-	if (!metadata) {
+	if (!metadata || !header) {
 		ret = -ENOMEM;
 		goto free_buffer;
 	}
@@ -434,9 +434,9 @@ static int sqfs_search_dir(struct squashfs_dir_stream *dirs, char **token_list,
 {
 	struct squashfs_super_block *sblk = ctxt.sblk;
 	char *path, *target, **sym_tokens, *res, *rem;
-	struct squashfs_ldir_inode *ldir = NULL;
 	int j, ret, new_inode_number, offset;
 	struct squashfs_symlink_inode *sym;
+	struct squashfs_ldir_inode *ldir;
 	struct squashfs_dir_inode *dir;
 	struct fs_dir_stream *dirsp;
 	struct fs_dirent *dent;
@@ -448,8 +448,8 @@ static int sqfs_search_dir(struct squashfs_dir_stream *dirs, char **token_list,
 	table = sqfs_find_inode(dirs->inode_table, le32_to_cpu(sblk->inodes),
 				sblk->inodes, sblk->block_size);
 
-	/* root is a regular directory, not an extended one */
 	dir = (struct squashfs_dir_inode *)table;
+	ldir = (struct squashfs_ldir_inode *)table;
 
 	/* get directory offset in directory table */
 	offset = sqfs_dir_offset(table, m_list, m_count);
@@ -1146,7 +1146,10 @@ static int sqfs_get_regfile_info(struct squashfs_reg_inode *reg,
 	finfo->start = get_unaligned_le32(&reg->start_block);
 	finfo->frag = SQFS_IS_FRAGMENTED(get_unaligned_le32(&reg->fragment));
 
-	if (finfo->size < 1 || finfo->offset < 0 || finfo->start < 0)
+	if (finfo->frag && finfo->offset == 0xFFFFFFFF)
+		return -EINVAL;
+
+	if (finfo->size < 1 || finfo->start == 0xFFFFFFFF)
 		return -EINVAL;
 
 	if (finfo->frag) {
@@ -1156,7 +1159,7 @@ static int sqfs_get_regfile_info(struct squashfs_reg_inode *reg,
 		if (ret < 0)
 			return -EINVAL;
 		finfo->comp = true;
-		if (fentry->size < 1 || fentry->start < 0)
+		if (fentry->size < 1 || fentry->start == 0x7FFFFFFF)
 			return -EINVAL;
 	} else {
 		datablk_count = DIV_ROUND_UP(finfo->size, le32_to_cpu(blksz));
@@ -1181,7 +1184,10 @@ static int sqfs_get_lregfile_info(struct squashfs_lreg_inode *lreg,
 	finfo->start = get_unaligned_le64(&lreg->start_block);
 	finfo->frag = SQFS_IS_FRAGMENTED(get_unaligned_le32(&lreg->fragment));
 
-	if (finfo->size < 1 || finfo->offset < 0 || finfo->start < 0)
+	if (finfo->frag && finfo->offset == 0xFFFFFFFF)
+		return -EINVAL;
+
+	if (finfo->size < 1 || finfo->start == 0x7FFFFFFF)
 		return -EINVAL;
 
 	if (finfo->frag) {
@@ -1191,7 +1197,7 @@ static int sqfs_get_lregfile_info(struct squashfs_lreg_inode *lreg,
 		if (ret < 0)
 			return -EINVAL;
 		finfo->comp = true;
-		if (fentry->size < 1 || fentry->start < 0)
+		if (fentry->size < 1 || fentry->start == 0x7FFFFFFF)
 			return -EINVAL;
 	} else {
 		datablk_count = DIV_ROUND_UP(finfo->size, le32_to_cpu(blksz));

+ 1 - 2
fs/squashfs/sqfs_dir.c

@@ -34,8 +34,7 @@ int sqfs_dir_offset(void *dir_i, u32 *m_list, int m_count)
 	struct squashfs_ldir_inode *ldir;
 	struct squashfs_dir_inode *dir;
 	u32 start_block;
-	u16 offset;
-	int j;
+	int j, offset;
 
 	switch (get_unaligned_le16(&base->inode_type)) {
 	case SQFS_DIR_TYPE:

+ 4 - 1
fs/squashfs/sqfs_inode.c

@@ -142,8 +142,11 @@ int sqfs_read_metablock(unsigned char *file_mapping, int offset,
 	u16 header;
 
 	data = file_mapping + offset;
+	if (!data)
+		return -EFAULT;
+
 	header = get_unaligned((u16 *)data);
-	if (!header || !data)
+	if (!header)
 		return -EINVAL;
 
 	*compressed = SQFS_COMPRESSED_METADATA(header);

+ 2 - 1
include/configs/apalis_imx6.h

@@ -135,7 +135,7 @@
 #endif
 #define CONFIG_EXTRA_ENV_SETTINGS \
 	BOOTENV \
-	"bootcmd=setenv fdtfile ${fdt_file}; run distro_bootcmd ; " \
+	"bootcmd=run distro_bootcmd ; " \
 		"usb start ; " \
 		"setenv stdout serial,vidconsole; " \
 		"setenv stdin serial,usbkbd\0" \
@@ -143,6 +143,7 @@
 	"console=ttymxc0\0" \
 	"defargs=enable_wait_mode=off vmalloc=400M\0" \
 	"fdt_file=" FDT_FILE "\0" \
+	"fdtfile=" FDT_FILE "\0" \
 	"fdt_fixup=;\0" \
 	MEM_LAYOUT_ENV_SETTINGS \
 	NFS_BOOTCMD \

+ 4 - 5
include/configs/colibri-imx6ull.h

@@ -35,8 +35,6 @@
 #define CONFIG_NETMASK			255.255.255.0
 #define CONFIG_SERVERIP			192.168.10.1
 
-#define FDT_FILE "imx6ull-colibri${variant}-${fdt_board}.dtb"
-
 #define MEM_LAYOUT_ENV_SETTINGS \
 	"bootm_size=0x10000000\0" \
 	"fdt_addr_r=0x82100000\0" \
@@ -57,7 +55,7 @@
 		"setenv bootargs ${defargs} ${nfsargs} " \
 		"${setupargs} ${vidargs}; echo Booting from NFS...;" \
 		"dhcp ${kernel_addr_r} && " \
-		"tftp ${fdt_addr_r} " FDT_FILE " && " \
+		"tftp ${fdt_addr_r} ${fdtfile} && " \
 		"run fdt_fixup && bootz ${kernel_addr_r} - ${fdt_addr_r}\0" \
 
 #define UBI_BOOTCMD \
@@ -71,8 +69,8 @@
 		"ubi read ${fdt_addr_r} dtb && " \
 		"run fdt_fixup && bootz ${kernel_addr_r} - ${fdt_addr_r}\0" \
 
-#define CONFIG_BOOTCOMMAND "run ubiboot; " \
-	"setenv fdtfile " FDT_FILE " && run distro_bootcmd;"
+/* Run Distro Boot script if ubiboot fails */
+#define CONFIG_BOOTCOMMAND "run ubiboot || run distro_bootcmd;"
 
 #define BOOT_TARGET_DEVICES(func) \
 	func(MMC, mmc, 0) \
@@ -111,6 +109,7 @@
 		"fatload ${interface} 0:1 ${loadaddr} " \
 		"${board}/flash_blk.img && source ${loadaddr}\0" \
 	"splashpos=m,m\0" \
+	"splashimage=" __stringify(CONFIG_LOADADDR) "\0" \
 	"videomode=video=ctfb:x:640,y:480,depth:18,pclk:39722,le:48,ri:16,up:33,lo:10,hs:96,vs:2,sync:0,vmode:0\0" \
 	"vidargs=video=mxsfb:640x480M-16@60"
 

+ 2 - 1
include/configs/colibri_imx6.h

@@ -118,7 +118,7 @@
 #define FDT_FILE "imx6dl-colibri-eval-v3.dtb"
 #define CONFIG_EXTRA_ENV_SETTINGS \
 	BOOTENV \
-	"bootcmd=setenv fdtfile ${fdt_file}; run distro_bootcmd; " \
+	"bootcmd=run distro_bootcmd; " \
 		"usb start ; " \
 		"setenv stdout serial,vidconsole; " \
 		"setenv stdin serial,usbkbd\0" \
@@ -126,6 +126,7 @@
 	"console=ttymxc0\0" \
 	"defargs=enable_wait_mode=off galcore.contiguousSize=50331648\0" \
 	"fdt_file=" FDT_FILE "\0" \
+	"fdtfile=" FDT_FILE "\0" \
 	"fdt_fixup=;\0" \
 	MEM_LAYOUT_ENV_SETTINGS \
 	NFS_BOOTCMD \

+ 2 - 3
include/configs/colibri_imx7.h

@@ -118,13 +118,11 @@
 
 #if defined(CONFIG_TARGET_COLIBRI_IMX7_NAND)
 #define CONFIG_BOOTCOMMAND "run ubiboot ; echo ; echo ubiboot failed ; " \
-	"setenv fdtfile ${soc}-colibri-${fdt_board}.dtb && run distro_bootcmd;"
+	"run distro_bootcmd;"
 #define MODULE_EXTRA_ENV_SETTINGS \
 	"mtdparts=" CONFIG_MTDPARTS_DEFAULT "\0" \
 	UBI_BOOTCMD
 #elif defined(CONFIG_TARGET_COLIBRI_IMX7_EMMC)
-#define CONFIG_BOOTCOMMAND \
-	"setenv fdtfile ${soc}-colibri-emmc-${fdt_board}.dtb && run distro_bootcmd;"
 #define MODULE_EXTRA_ENV_SETTINGS \
 	"variant=-emmc\0" \
 	EMMC_ANDROID_BOOTCMD
@@ -173,6 +171,7 @@
 		"fatload ${interface} 0:1 ${loadaddr} " \
 		"${board}/flash_blk.img && source ${loadaddr}\0" \
 	"splashpos=m,m\0" \
+	"splashimage=" __stringify(CONFIG_LOADADDR) "\0" \
 	"videomode=video=ctfb:x:640,y:480,depth:18,pclk:39722,le:48,ri:16,up:33,lo:10,hs:96,vs:2,sync:0,vmode:0\0" \
 	"updlevel=2\0"
 

+ 1 - 2
include/configs/colibri_vf.h

@@ -76,8 +76,7 @@
 	"ubi read ${fdt_addr_r} dtb && " \
 	"run fdt_fixup && bootz ${kernel_addr_r} - ${fdt_addr_r}\0" \
 
-#define CONFIG_BOOTCOMMAND "run ubiboot; " \
-	"setenv fdtfile ${soc}-colibri-${fdt_board}.dtb && run distro_bootcmd;"
+#define CONFIG_BOOTCOMMAND "run ubiboot || run distro_bootcmd;"
 
 #define BOOT_TARGET_DEVICES(func) \
 	func(MMC, mmc, 0) \

+ 0 - 4
include/configs/edison.h

@@ -23,10 +23,6 @@
 #define CONFIG_SYS_MONITOR_BASE			CONFIG_SYS_TEXT_BASE
 #define CONFIG_SYS_MONITOR_LEN			(256 * 1024)
 
-#define CONFIG_SYS_MALLOC_LEN			(128 * 1024 * 1024)
-
-/* Environment */
-
 /* RTC */
 #define CONFIG_SYS_ISA_IO_BASE_ADDRESS	0
 

+ 1 - 1
include/phy.h

@@ -205,7 +205,7 @@ static inline int phy_write(struct phy_device *phydev, int devad, int regnum,
 {
 	struct mii_dev *bus = phydev->bus;
 
-	if (!bus || !bus->read) {
+	if (!bus || !bus->write) {
 		debug("%s: No bus configured\n", __func__);
 		return -1;
 	}

+ 9 - 9
lib/efi_loader/efi_boottime.c

@@ -42,9 +42,9 @@ LIST_HEAD(efi_register_notify_events);
 /* Handle of the currently executing image */
 static efi_handle_t current_image;
 
-#ifdef CONFIG_ARM
+#if defined(CONFIG_ARM) || defined(CONFIG_RISCV)
 /*
- * The "gd" pointer lives in a register on ARM and AArch64 that we declare
+ * The "gd" pointer lives in a register on ARM and RISC-V that we declare
  * fixed when compiling U-Boot. However, the payload does not know about that
  * restriction so we need to manually swap its and our view of that register on
  * EFI callback entry/exit.
@@ -86,7 +86,7 @@ static efi_status_t EFIAPI efi_disconnect_controller(
 int __efi_entry_check(void)
 {
 	int ret = entry_count++ == 0;
-#ifdef CONFIG_ARM
+#if defined(CONFIG_ARM) || defined(CONFIG_RISCV)
 	assert(efi_gd);
 	app_gd = gd;
 	set_gd(efi_gd);
@@ -98,7 +98,7 @@ int __efi_entry_check(void)
 int __efi_exit_check(void)
 {
 	int ret = --entry_count == 0;
-#ifdef CONFIG_ARM
+#if defined(CONFIG_ARM) || defined(CONFIG_RISCV)
 	set_gd(app_gd);
 #endif
 	return ret;
@@ -107,7 +107,7 @@ int __efi_exit_check(void)
 /**
  * efi_save_gd() - save global data register
  *
- * On the ARM architecture gd is mapped to a fixed register (r9 or x18).
+ * On the ARM and RISC-V architectures gd is mapped to a fixed register.
  * As this register may be overwritten by an EFI payload we save it here
  * and restore it on every callback entered.
  *
@@ -115,7 +115,7 @@ int __efi_exit_check(void)
  */
 void efi_save_gd(void)
 {
-#ifdef CONFIG_ARM
+#if defined(CONFIG_ARM) || defined(CONFIG_RISCV)
 	efi_gd = gd;
 #endif
 }
@@ -123,13 +123,13 @@ void efi_save_gd(void)
 /**
  * efi_restore_gd() - restore global data register
  *
- * On the ARM architecture gd is mapped to a fixed register (r9 or x18).
+ * On the ARM and RISC-V architectures gd is mapped to a fixed register.
  * Restore it after returning from the UEFI world to the value saved via
  * efi_save_gd().
  */
 void efi_restore_gd(void)
 {
-#ifdef CONFIG_ARM
+#if defined(CONFIG_ARM) || defined(CONFIG_RISCV)
 	/* Only restore if we're already in EFI context */
 	if (!efi_gd)
 		return;
@@ -2920,7 +2920,7 @@ efi_status_t EFIAPI efi_start_image(efi_handle_t image_handle,
 		 * us to the current line. This implies that the second half
 		 * of the EFI_CALL macro has not been executed.
 		 */
-#ifdef CONFIG_ARM
+#if defined(CONFIG_ARM) || defined(CONFIG_RISCV)
 		/*
 		 * efi_exit() called efi_restore_gd(). We have to undo this
 		 * otherwise __efi_entry_check() will put the wrong value into

+ 1 - 1
lib/efi_loader/efi_memory.c

@@ -235,7 +235,7 @@ static s64 efi_mem_carve_out(struct efi_mem_list *map,
  * @start:		start address, must be a multiple of EFI_PAGE_SIZE
  * @pages:		number of pages to add
  * @memory_type:	type of memory added
- * @overlap_only_ram:	the memory area must overlap existing
+ * @overlap_only_ram:	region may only overlap RAM
  * Return:		status code
  */
 static efi_status_t efi_add_memory_map_pg(u64 start, u64 pages,

+ 1 - 1
lib/efi_loader/efi_var_mem.c

@@ -211,7 +211,7 @@ static void efi_var_mem_bs_del(void)
  * @event:	callback event
  * @context:	callback context
  */
-static void EFIAPI __efi_runtime
+static void EFIAPI
 efi_var_mem_notify_exit_boot_services(struct efi_event *event, void *context)
 {
 	EFI_ENTRY("%p, %p", event, context);

+ 4 - 2
lib/efi_selftest/efi_selftest.c

@@ -311,11 +311,13 @@ efi_status_t EFIAPI efi_selftest(efi_handle_t image_handle,
 	efi_st_printf("Preparing for reset. Press any key...\n");
 	efi_st_get_key();
 
-	if (IS_ENABLED(CONFIG_EFI_HAVE_RUNTIME_RESET))
+	if (IS_ENABLED(CONFIG_EFI_HAVE_RUNTIME_RESET)) {
 		runtime->reset_system(EFI_RESET_WARM, EFI_NOT_READY,
 				      sizeof(reset_message), reset_message);
-	else
+	} else {
+		efi_restore_gd();
 		do_reset(NULL, 0, 0, NULL);
+	}
 
 	efi_st_printf("\n");
 	efi_st_error("Reset failed\n");

+ 54 - 14
lib/efi_selftest/efi_selftest_fdt.c

@@ -42,35 +42,48 @@ static uint32_t f2h(fdt32_t val)
 	return *(uint32_t *)buf;
 }
 
-/*
- * Return the value of a property of the FDT root node.
+/**
+ * get_property() - return value of a property of an FDT node
+ *
+ * A property of the root node or one of its direct children can be
+ * retrieved.
  *
- * @name	name of the property
+ * @property	name of the property
+ * @node	name of the node or NULL for root node
  * @return	value of the property
  */
-static char *get_property(const u16 *property)
+static char *get_property(const u16 *property, const u16 *node)
 {
 	struct fdt_header *header = (struct fdt_header *)fdt;
+	const fdt32_t *end;
 	const fdt32_t *pos;
 	const char *strings;
+	size_t level = 0;
+	const char *nodelabel = NULL;
 
-	if (!header)
+	if (!header) {
+		efi_st_error("Missing device tree\n");
 		return NULL;
+	}
 
 	if (f2h(header->magic) != FDT_MAGIC) {
-		printf("Wrong magic\n");
+		efi_st_error("Wrong device tree magic\n");
 		return NULL;
 	}
 
 	pos = (fdt32_t *)(fdt + f2h(header->off_dt_struct));
+	end = &pos[f2h(header->totalsize) >> 2];
 	strings = fdt + f2h(header->off_dt_strings);
 
-	for (;;) {
+	for (; pos < end;) {
 		switch (f2h(pos[0])) {
 		case FDT_BEGIN_NODE: {
-			char *c = (char *)&pos[1];
+			const char *c = (char *)&pos[1];
 			size_t i;
 
+			if (level == 1)
+				nodelabel = c;
+			++level;
 			for (i = 0; c[i]; ++i)
 				;
 			pos = &pos[2 + (i >> 2)];
@@ -82,7 +95,10 @@ static char *get_property(const u16 *property)
 			efi_status_t ret;
 
 			/* Check if this is the property to be returned */
-			if (!efi_st_strcmp_16_8(property, label)) {
+			if (!efi_st_strcmp_16_8(property, label) &&
+			    ((level == 1 && !node) ||
+			     (level == 2 && node &&
+			      !efi_st_strcmp_16_8(node, nodelabel)))) {
 				char *str;
 				efi_uintn_t len = f2h(prop->len);
 
@@ -96,7 +112,7 @@ static char *get_property(const u16 *property)
 					EFI_LOADER_DATA, len + 1,
 					(void **)&str);
 				if (ret != EFI_SUCCESS) {
-					efi_st_printf("AllocatePool failed\n");
+					efi_st_error("AllocatePool failed\n");
 					return NULL;
 				}
 				boottime->copy_mem(str, &pos[3], len);
@@ -109,12 +125,21 @@ static char *get_property(const u16 *property)
 			break;
 		}
 		case FDT_NOP:
-			pos = &pos[1];
+			++pos;
+			break;
+		case FDT_END_NODE:
+			--level;
+			++pos;
 			break;
+		case FDT_END:
+			return NULL;
 		default:
+			efi_st_error("Invalid device tree token\n");
 			return NULL;
 		}
 	}
+	efi_st_error("Missing FDT_END token\n");
+	return NULL;
 }
 
 /**
@@ -173,7 +198,7 @@ static int execute(void)
 	char *str;
 	efi_status_t ret;
 
-	str = get_property(L"compatible");
+	str = get_property(L"compatible", NULL);
 	if (str) {
 		efi_st_printf("compatible: %s\n", str);
 		ret = boottime->free_pool(str);
@@ -182,10 +207,10 @@ static int execute(void)
 			return EFI_ST_FAILURE;
 		}
 	} else {
-		efi_st_printf("Missing property 'compatible'\n");
+		efi_st_error("Missing property 'compatible'\n");
 		return EFI_ST_FAILURE;
 	}
-	str = get_property(L"serial-number");
+	str = get_property(L"serial-number", NULL);
 	if (str) {
 		efi_st_printf("serial-number: %s\n", str);
 		ret = boottime->free_pool(str);
@@ -194,6 +219,21 @@ static int execute(void)
 			return EFI_ST_FAILURE;
 		}
 	}
+	str = get_property(L"boot-hartid", L"chosen");
+	if (IS_ENABLED(CONFIG_RISCV)) {
+		if (str) {
+			efi_st_printf("boot-hartid: %u\n",
+				      f2h(*(fdt32_t *)str));
+			ret = boottime->free_pool(str);
+			if (ret != EFI_SUCCESS) {
+				efi_st_error("FreePool failed\n");
+				return EFI_ST_FAILURE;
+			}
+		} else {
+			efi_st_error("boot-hartid not found\n");
+			return EFI_ST_FAILURE;
+		}
+	}
 
 	return EFI_ST_SUCCESS;
 }

+ 2 - 2
lib/fdtdec.c

@@ -1099,7 +1099,7 @@ int fdtdec_setup_memory_banksize(void)
 		if (ret < 0) {
 			reg = 0;
 			mem = get_next_memory_node(mem);
-			if (ofnode_valid(mem))
+			if (!ofnode_valid(mem))
 				break;
 
 			ret = ofnode_read_resource(mem, reg++, &res);
@@ -1144,7 +1144,7 @@ int fdtdec_setup_mem_size_base_lowest(void)
 		if (ret < 0) {
 			reg = 0;
 			mem = get_next_memory_node(mem);
-			if (ofnode_valid(mem))
+			if (!ofnode_valid(mem))
 				break;
 
 			ret = ofnode_read_resource(mem, reg++, &res);

+ 3 - 3
lib/rsa/rsa-keyprop.c

@@ -12,9 +12,9 @@
 #include <common.h>
 #include <image.h>
 #include <malloc.h>
-#include <asm/byteorder.h>
 #include <crypto/internal/rsa.h>
 #include <u-boot/rsa-mod-exp.h>
+#include <asm/unaligned.h>
 
 /**
  * br_dec16be() - Convert 16-bit big-endian integer to native
@@ -23,7 +23,7 @@
  */
 static unsigned br_dec16be(const void *src)
 {
-	return be16_to_cpup(src);
+	return get_unaligned_be16(src);
 }
 
 /**
@@ -33,7 +33,7 @@ static unsigned br_dec16be(const void *src)
  */
 static uint32_t br_dec32be(const void *src)
 {
-	return be32_to_cpup(src);
+	return get_unaligned_be32(src);
 }
 
 /**

+ 5 - 5
test/dm/acpi.c

@@ -366,21 +366,21 @@ static int dm_test_acpi_cmd_list(struct unit_test_state *uts)
 	ut_assert_nextline("RSDP %08lx %06lx (v02 U-BOOT)", addr,
 			   sizeof(struct acpi_rsdp));
 	addr = ALIGN(addr + sizeof(struct acpi_rsdp), 16);
-	ut_assert_nextline("RSDT %08lx %06lx (v01 U-BOOT U-BOOTBL %u INTL 0)",
+	ut_assert_nextline("RSDT %08lx %06lx (v01 U-BOOT U-BOOTBL %x INTL 0)",
 			   addr, sizeof(struct acpi_table_header) +
 			   3 * sizeof(u32), U_BOOT_BUILD_DATE);
 	addr = ALIGN(addr + sizeof(struct acpi_rsdt), 16);
-	ut_assert_nextline("XSDT %08lx %06lx (v01 U-BOOT U-BOOTBL %u INTL 0)",
+	ut_assert_nextline("XSDT %08lx %06lx (v01 U-BOOT U-BOOTBL %x INTL 0)",
 			   addr, sizeof(struct acpi_table_header) +
 			   3 * sizeof(u64), U_BOOT_BUILD_DATE);
 	addr = ALIGN(addr + sizeof(struct acpi_xsdt), 64);
-	ut_assert_nextline("DMAR %08lx %06lx (v01 U-BOOT U-BOOTBL %u INTL 0)",
+	ut_assert_nextline("DMAR %08lx %06lx (v01 U-BOOT U-BOOTBL %x INTL 0)",
 			   addr, sizeof(struct acpi_dmar), U_BOOT_BUILD_DATE);
 	addr = ALIGN(addr + sizeof(struct acpi_dmar), 16);
-	ut_assert_nextline("DMAR %08lx %06lx (v01 U-BOOT U-BOOTBL %u INTL 0)",
+	ut_assert_nextline("DMAR %08lx %06lx (v01 U-BOOT U-BOOTBL %x INTL 0)",
 			   addr, sizeof(struct acpi_dmar), U_BOOT_BUILD_DATE);
 	addr = ALIGN(addr + sizeof(struct acpi_dmar), 16);
-	ut_assert_nextline("DMAR %08lx %06lx (v01 U-BOOT U-BOOTBL %u INTL 0)",
+	ut_assert_nextline("DMAR %08lx %06lx (v01 U-BOOT U-BOOTBL %x INTL 0)",
 			   addr, sizeof(struct acpi_dmar), U_BOOT_BUILD_DATE);
 	ut_assert_console_end();
 

+ 1 - 1
test/py/tests/test_env.py

@@ -151,7 +151,7 @@ def validate_empty(state_test_env, var):
         Nothing.
     """
 
-    response = state_test_env.u_boot_console.run_command('echo $%s' % var)
+    response = state_test_env.u_boot_console.run_command('echo ${%s}' % var)
     assert response == ''
 
 def validate_set(state_test_env, var, value):