Merge tag 'efi-2020-07-rc4' of https://gitlab.denx.de/u-boot/custodians/u-boot-efi
authorTom Rini <trini@konsulko.com>
Wed, 3 Jun 2020 18:10:03 +0000 (14:10 -0400)
committerTom Rini <trini@konsulko.com>
Wed, 3 Jun 2020 18:10:03 +0000 (14:10 -0400)
Pull request for UEFI sub-system for efi-2020-07-rc4

This patch series addresses the following issues:

* allow compiling with clang
* add missing function descriptions to the HTML documentation
* simplify the validation of UEFI images
* validate load options in the UEFI boot manager

In a preparatory patch a structure definition is moved.

73 files changed:
.azure-pipelines.yml
MAINTAINERS
arch/arm/include/asm/system.h
arch/arm/mach-sunxi/dram_sunxi_dw.c
board/amlogic/p200/README.nanopi-k2
board/amlogic/p200/README.odroid-c2
board/amlogic/p200/README.p200
board/amlogic/p201/README.p201
board/amlogic/p212/README.khadas-vim
board/amlogic/p212/README.libretech-ac
board/amlogic/p212/README.libretech-cc
board/amlogic/p212/README.p212
board/amlogic/q200/README.khadas-vim2
board/amlogic/q200/README.q200
board/amlogic/s400/README
board/amlogic/sei510/README
board/amlogic/sei610/README
board/amlogic/u200/README
board/amlogic/w400/README.khadas-vim3
board/amlogic/w400/README.khadas-vim3l
board/amlogic/w400/README.odroid-n2
board/amlogic/w400/README.w400
board/beacon/imx8mm/README
board/freescale/c29xpcie/README
board/freescale/p1010rdb/README.P1010RDB-PA
board/freescale/p1010rdb/README.P1010RDB-PB
board/logicpd/imx6/README
board/rockchip/evb_rk3229/README
board/rockchip/evb_rk3399/README
board/sifive/fu540/MAINTAINERS
board/technexion/pico-imx7d/README.pico-imx7d_BL33
board/theobroma-systems/lion_rk3368/README
board/ti/am65x/README
board/ti/j721e/README
board/ti/ks2_evm/README
board/vamrs/rock960_rk3399/README
cmd/Kconfig
cmd/fitupd.c
cmd/sf.c
common/image-android.c
configs/pine_h64_defconfig
doc/arch/m68k.rst
doc/board/actions/cubieboard7.rst
doc/board/sifive/fu540.rst
doc/board/toradex/colibri_imx7.rst
doc/driver-model/migration.rst
doc/uImage.FIT/beaglebone_vboot.txt
drivers/bootcount/Kconfig
drivers/input/Kconfig
drivers/mtd/nand/spi/toshiba.c
drivers/mtd/spi/sf-uclass.c
drivers/mtd/spi/sf_internal.h
drivers/mtd/spi/sf_probe.c
drivers/mtd/spi/spi-nor-core.c
drivers/mtd/spi/spi-nor-tiny.c
drivers/net/sun8i_emac.c
drivers/phy/allwinner/phy-sun4i-usb.c
drivers/spi/Kconfig
drivers/spi/Makefile
drivers/spi/cf_spi.c
drivers/spi/kirkwood_spi.c
drivers/spi/sh_spi.c [deleted file]
drivers/spi/sh_spi.h [deleted file]
drivers/usb/Kconfig
drivers/usb/host/ohci.h
env/sf.c
include/linux/dma-mapping.h
include/spi_flash.h
lib/Kconfig
test/dm/sf.c
test/py/conftest.py
tools/env/fw_env.c
tools/fit_image.c

index 88438e77a1fccd3c3e7a51620e12ca2480ee5604..636500d6cead910a46ff4f758d7152d8ad3f0c81 100644 (file)
@@ -1,6 +1,7 @@
 variables:
   windows_vm: vs2017-win2016
   ubuntu_vm: ubuntu-18.04
+  macos_vm: macOS-10.15
   ci_runner_image: trini/u-boot-gitlab-ci-runner:bionic-20200403-27Apr2020
   # Add '-u 0' options for Azure pipelines, otherwise we get "permission
   # denied" error when it tries to "useradd -m -u 1001 vsts_azpcontainer",
@@ -44,6 +45,20 @@ jobs:
           # Tell MSYS2 not to ‘cd’ our startup directory to HOME
           CHERE_INVOKING: yes
 
+  - job: tools_only_macOS
+    displayName: 'Ensure host tools build for macOS X'
+    pool:
+      vmImage: $(macos_vm)
+    steps:
+      - script: brew install make
+        displayName: Brew install dependencies
+      - script: |
+          gmake tools-only_config tools-only NO_SDL=1 \
+            HOSTCFLAGS="-I/usr/local/opt/openssl@1.1/include" \
+            HOSTLDFLAGS="-L/usr/local/opt/openssl@1.1/lib" \
+            -j$(sysctl -n hw.logicalcpu)
+        displayName: 'Perform tools-only build'
+
   - job: cppcheck
     displayName: 'Static code analysis with cppcheck'
     pool:
index 9da0459bf747a2cddb88bfa299aee65b80b4f432..1fd975c72f0bdb031c0b362e276017988e380c0c 100644 (file)
@@ -275,6 +275,7 @@ M:  Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
 S:     Maintained
 F:     arch/arm/include/asm/arch-owl/
 F:     arch/arm/mach-owl/
+F:     doc/board/actions/
 F:     drivers/clk/owl/
 F:     drivers/serial/serial_owl.c
 F:     include/configs/owl-common.h
@@ -590,6 +591,7 @@ M:  Angelo Dureghello <angelo@sysam.it>
 S:     Maintained
 T:     git https://gitlab.denx.de/u-boot/custodians/u-boot-coldfire.git
 F:     arch/m68k/
+F:     doc/arch/m68k.rst
 
 DFU
 M:     Lukasz Majewski <lukma@denx.de>
index 1e3f574403a05ceb81cbdfd1ec88e8a811480566..7a40b56acdcae28101f8d05eb6159e8167cbf188 100644 (file)
@@ -528,6 +528,7 @@ void mmu_page_table_flush(unsigned long start, unsigned long stop);
 
 #ifdef CONFIG_ARMV7_PSCI
 void psci_arch_cpu_entry(void);
+void psci_arch_init(void);
 u32 psci_version(void);
 s32 psci_features(u32 function_id, u32 psci_fid);
 s32 psci_cpu_off(void);
index 5d84798ca4389d90ac8c1124e707fa2183cea626..a462538521966572997e09c42ca0585cfb01152c 100644 (file)
@@ -79,15 +79,15 @@ enum {
        MBUS_QOS_HIGHEST
 };
 
-inline void mbus_configure_port(u8 port,
-                               bool bwlimit,
-                               bool priority,
-                               u8 qos,         /* MBUS_QOS_LOWEST .. MBUS_QOS_HIGEST */
-                               u8 waittime,    /* 0 .. 0xf */
-                               u8 acs,         /* 0 .. 0xff */
-                               u16 bwl0,       /* 0 .. 0xffff, bandwidth limit in MB/s */
-                               u16 bwl1,
-                               u16 bwl2)
+static inline void mbus_configure_port(u8 port,
+                                      bool bwlimit,
+                                      bool priority,
+                                      u8 qos,         /* MBUS_QOS_LOWEST .. MBUS_QOS_HIGEST */
+                                      u8 waittime,    /* 0 .. 0xf */
+                                      u8 acs,         /* 0 .. 0xff */
+                                      u16 bwl0,       /* 0 .. 0xffff, bandwidth limit in MB/s */
+                                      u16 bwl1,
+                                      u16 bwl2)
 {
        struct sunxi_mctl_com_reg * const mctl_com =
                        (struct sunxi_mctl_com_reg *)SUNXI_DRAM_COM_BASE;
index d450d3c2b2afc7d068d61cb028ac62b3c71b894d..c8dec3569b4d902a876e322ddfeff54be845552a 100644 (file)
@@ -24,7 +24,6 @@ Currently the u-boot port supports the following devices:
 u-boot compilation
 ==================
 
- > export ARCH=arm
  > export CROSS_COMPILE=aarch64-none-elf-
  > make nanopi-k2_defconfig
  > make
index bed48c5728ba9e0200d45773e28a34e949069492..3b9f80df29d8451b49175c68c64c953ffe31369a 100644 (file)
@@ -29,7 +29,6 @@ Currently the u-boot port supports the following devices:
 u-boot compilation
 ==================
 
- > export ARCH=arm
  > export CROSS_COMPILE=aarch64-none-elf-
  > make odroid-c2_defconfig
  > make
index 01d82d1e79e3d7b7550c65debdb88de8f6915499..84d5ca53569170fac3de2349e373249c55edb97b 100644 (file)
@@ -31,7 +31,6 @@ Currently the u-boot port supports the following devices:
 u-boot compilation
 ==================
 
- > export ARCH=arm
  > export CROSS_COMPILE=aarch64-none-elf-
  > make p200_defconfig
  > make
index c251096ce14212820a51a7f537f6c7e48e2a1801..4bb5e95905324c82748b58a8c6cb5d8b243aa58f 100644 (file)
@@ -31,7 +31,6 @@ Currently the u-boot port supports the following devices:
 u-boot compilation
 ==================
 
- > export ARCH=arm
  > export CROSS_COMPILE=aarch64-none-elf-
  > make p201_defconfig
  > make
index a2c7606454f8beed93cd52bedebe0584704752a8..ccf933861b794c42502cd87a43eadc50fa33f8a6 100644 (file)
@@ -30,7 +30,6 @@ Currently the u-boot port supports the following devices:
 U-Boot compilation
 ==================
 
- > export ARCH=arm
  > export CROSS_COMPILE=aarch64-none-elf-
  > make khadas-vim_defconfig
  > make
index 538604261b84978ed90e35021ff9360c79d94a99..3f713ec32634c651b7e7e3dc3d189520dd76484f 100644 (file)
@@ -25,7 +25,6 @@ Currently the U-Boot port supports the following devices:
 U-Boot compilation
 ==================
 
- > export ARCH=arm
  > export CROSS_COMPILE=aarch64-none-elf-
  > make libretech-ac_defconfig
  > make
index 6af7de3cfa7904c679b155950d8b39dbfa305264..74434d4435ec467ceeaed57ea4b1b095fcfae3af 100644 (file)
@@ -30,7 +30,6 @@ Currently the U-Boot port supports the following devices:
 U-Boot compilation
 ==================
 
- > export ARCH=arm
  > export CROSS_COMPILE=aarch64-none-elf-
  > make libretech-cc_defconfig
  > make
index ef5370c763c46d62fc8c7e8531d677b2f42d0db2..3776f24493910ed8187ac0b7b1b31f31e64e53db 100644 (file)
@@ -31,7 +31,6 @@ Currently the u-boot port supports the following devices:
 u-boot compilation
 ==================
 
- > export ARCH=arm
  > export CROSS_COMPILE=aarch64-none-elf-
  > make p212_defconfig
  > make
index 8bcfc296f3e0966c976c9be954568e49a44d40ea..595998c4fabbd19116af18252b680a541fcce82a 100644 (file)
@@ -31,7 +31,6 @@ Currently the u-boot port supports the following devices:
 U-Boot compilation
 ==================
 
- > export ARCH=arm
  > export CROSS_COMPILE=aarch64-none-elf-
  > make khadas-vim2_defconfig
  > make
index 55d730a0d200c80020c5aa2c167c5b386a143ed7..d4142c88bd42ef44d458082324c8c78f95b3d535 100644 (file)
@@ -30,7 +30,6 @@ Currently the u-boot port supports the following devices:
 U-Boot compilation
 ==================
 
- > export ARCH=arm
  > export CROSS_COMPILE=aarch64-none-elf-
  > make khadas-vim2_defconfig
  > make
index ab21998dc8364473f40159bec2ea673dc6a244fa..a48db22a4282c939833e0d224de1b5684f5fc044 100644 (file)
@@ -31,7 +31,6 @@ Currently the u-boot port supports the following devices:
 u-boot compilation
 ==================
 
- > export ARCH=arm
  > export CROSS_COMPILE=aarch64-none-elf-
  > make s400_defconfig
  > make
index e47ebc7b3a5af7d419b85c65e5d3a8d600e2579b..d9358aa50183d68862551e877e8378eeb2d757bd 100644 (file)
@@ -22,7 +22,6 @@ Currently the u-boot port supports the following devices:
 u-boot compilation
 ==================
 
- > export ARCH=arm
  > export CROSS_COMPILE=aarch64-none-elf-
  > make sei510_defconfig
  > make
index 1cc2b3c2a4e94ab542b35f5f6b42a00c8c2d80b9..d96a94b5e970e1d777e158e17ac22e15d4b4dddc 100644 (file)
@@ -18,7 +18,6 @@ specifications:
 u-boot compilation
 ==================
 
- > export ARCH=arm
  > export CROSS_COMPILE=aarch64-none-elf-
  > make sei610_defconfig
  > make
index bffac5e7ae0a20a5493d5a02f37339003d7e8c43..a4080eb299c427776cf2aef8b3bbad28059f4308 100644 (file)
@@ -27,7 +27,6 @@ Currently the u-boot port supports the following devices:
 u-boot compilation
 ==================
 
- > export ARCH=arm
  > export CROSS_COMPILE=aarch64-none-elf-
  > make u200_defconfig
  > make
index 45ef90c1b0a9b991d8315835c69be014b89c44b4..399bf49295f65f792cc1001cef1bb88f4dc65e93 100644 (file)
@@ -29,7 +29,6 @@ Currently the U-Boot port supports the following devices:
 u-boot compilation
 ==================
 
- > export ARCH=arm
  > export CROSS_COMPILE=aarch64-none-elf-
  > make khadas-vim3_defconfig
  > make
index 0afff16c0c26fc37d70cc426f679dff6710c193d..b2d9abbfd9b2981d452c843a1a23d13693e3c1ec 100644 (file)
@@ -29,7 +29,6 @@ Currently the U-Boot port supports the following devices:
 u-boot compilation
 ==================
 
- > export ARCH=arm
  > export CROSS_COMPILE=aarch64-none-elf-
  > make khadas-vim3l_defconfig
  > make
index a8f2c3d7daa6e4402d9c0f637ea2964623debbab..8142eebea007b59cea50e4651e96a87cdb23f6ee 100644 (file)
@@ -28,7 +28,6 @@ Currently the u-boot port supports the following devices:
 u-boot compilation
 ==================
 
- > export ARCH=arm
  > export CROSS_COMPILE=aarch64-none-elf-
  > make odroid-n2_defconfig
  > make
index 25b786d817c4e73b7ae4e624eef4fd2f9e0230a6..c129717a1189a593e301dea57773107bb924d389 100644 (file)
@@ -27,7 +27,6 @@ Currently the u-boot port supports the following devices:
 u-boot compilation
 ==================
 
- > export ARCH=arm
  > export CROSS_COMPILE=aarch64-none-elf-
  > make w400_defconfig
  > make
index 4223fbd15dd60e88427790fec4cf5b477e9f9864..dce176fa0b236ed38071ca074e05eda9af69217b 100644 (file)
@@ -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 ARCH=arm CROSS_COMPILE=aarch64-linux-gnu- ATF_LOAD_ADDR=0x920000
+$ make flash.bin CROSS_COMPILE=aarch64-linux-gnu- ATF_LOAD_ADDR=0x920000
 
 Burn U-Boot to microSD Card
 ===========================
index 2e249cbb3a2e881b3e154a63abf2cede6bebc39b..a6120f1845d2a7af90e5b61d679df246dfc9951a 100644 (file)
@@ -56,7 +56,6 @@ Note: 1 stands for 'off', 0 stands for 'on'
 Build and program U-Boot to NOR flash
 ==================================
 1. Build u-boot.bin image example:
-       export ARCH=powerpc
        export CROSS_COMPILE=/your_path/powerpc-linux-gnu-
        make C293PCIE
 
index 105942f7a54f40b92674d481b6c7327d34ac4710..46c61237c72790f11498e5039c4853d9ac71038a 100644 (file)
@@ -98,7 +98,6 @@ instead of to CAN/UART1.
 Build and burn U-Boot to NOR flash
 ==================================
 1. Build u-boot.bin image
-       export ARCH=powerpc
        export CROSS_COMPILE=/your_path/powerpc-linux-gnu-
        make P1010RDB_NOR
 
index dc82f0df09845f140f052b19a1161baaaed8f44d..4a3b389877fca81b35a6949b7b57e12fb9eab2ff 100644 (file)
@@ -128,7 +128,6 @@ To enable IFC in case of SD boot
 Build images for different boot mode
 ====================================
 First setup cross compile environment on build host
-   $ export ARCH=powerpc
    $ export CROSS_COMPILE=<your-compiler-path>/powerpc-linux-gnu-
 
 1. For NOR boot
index 26d053a32c3bb75c5b905481748d3c135f0631cd..19f79c5734bc544b59561aabc0b7b2fe58ab04a8 100644 (file)
@@ -17,7 +17,7 @@ Building U-Boot for Logic PD Development Kit
 To build U-Boot for the Dual and Quad variants:
 
  make imx6q_logic_defconfig
- make u-boot.imx ARCH=arm CROSS_COMPILE=arm-linux-
+ make u-boot.imx CROSS_COMPILE=arm-linux-
 
 
 Flashing U-Boot into the SD card
index 93328c75b204ded69efcbcab539a4b61dca74573..9068225e2721c5dafd054e1e65a03a9b3a8f331c 100644 (file)
@@ -22,7 +22,6 @@ Compile the U-Boot
 
   > cd ../u-boot
   > export CROSS_COMPILE=arm-linux-gnueabihf-
-  > export ARCH=arm
   > make evb-rk3229_defconfig
   > make
   > make u-boot.itb
index da7ae89ab1e9f6677fb2cb858aaf295093c60f32..c6f58203ebe951b033e4ec2d3fa77a470a4889f6 100644 (file)
@@ -54,7 +54,6 @@ Compile U-Boot
 ==============
 
   > cd ../u-boot
-  > export ARCH=arm64
   > export CROSS_COMPILE=aarch64-linux-gnu-
   > make evb-rk3399_defconfig
   for firefly-rk3399, use below instead:
index 5381fc0639ddea85255c9b535c826c3289d34380..27620727bd9bf3591a0cd39283ab2f2ab6e30ed5 100644 (file)
@@ -5,5 +5,6 @@ M:      Anup Patel <anup.patel@wdc.com>
 M:     Atish Patra <atish.patra@wdc.com>
 S:     Maintained
 F:     board/sifive/fu540/
+F:     doc/board/sifive/fu540.rst
 F:     include/configs/sifive-fu540.h
 F:     configs/sifive_fu540_defconfig
index 40324ffe5f34188ac4265a7e87fbd49c0f00a838..1b346093b88dab334d57bebbb2a6a5de890ee5b7 100644 (file)
@@ -4,7 +4,7 @@ The boot sequence is ATF -> OPTEE -> U-Boot -> Linux. U-Boot is in non-secure
 world in this case.
 
 - Build u-boot
-    Set environment variable of CROSS_COMPILE for your toolchain and ARCH=arm
+    Set environment variable of CROSS_COMPILE for your toolchain
     $ make pico-imx7d_bl33_defconfig
     $ make all
 
index ad3ac93bd44b6f7a4531c3ec869d7daf9dabfb8e..7488b18326b9bee66797881a2c0035ecb9400d08 100644 (file)
@@ -17,12 +17,12 @@ Configure U-Boot
 Build the TPL/SPL stage
 =======================
 
-  > make CROSS_COMPILE=aarch64-unknown-elf- ARCH=arm
+  > make CROSS_COMPILE=aarch64-unknown-elf-
 
 Build the full U-Boot and a FIT image including the ATF
 =======================================================
 
-  > make CROSS_COMPILE=aarch64-unknown-elf- ARCH=arm u-boot.itb
+  > make CROSS_COMPILE=aarch64-unknown-elf- u-boot.itb
 
 Flash the image
 ===============
index 00be1ffe44d6147279a94f1d79cb5090131b9b35..67081ce349dcd8b1969138d5bd5e57dae3b5cb6d 100644 (file)
@@ -133,12 +133,12 @@ $ make PLATFORM=k3-am65x CFG_ARM64_core=y
 4. U-Boot:
 
 4.1. R5:
-$ make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- am65x_evm_r5_defconfig O=/tmp/r5
-$ make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- O=/tmp/r5
+$ make CROSS_COMPILE=arm-linux-gnueabihf- am65x_evm_r5_defconfig O=/tmp/r5
+$ make CROSS_COMPILE=arm-linux-gnueabihf- O=/tmp/r5
 
 4.2. A53:
-$ make ARCH=arm CROSS_COMPILE=aarch64-linux-gnu- am65x_evm_a53_defconfig O=/tmp/a53
-$ make ARCH=arm CROSS_COMPILE=aarch64-linux-gnu- ATF=<path to ATF dir>/build/k3/generic/release/bl31.bin TEE=<path to OPTEE OS dir>/out/arm-plat-k3/core/tee-pager_v2.bin O=/tmp/a53
+$ make CROSS_COMPILE=aarch64-linux-gnu- am65x_evm_a53_defconfig O=/tmp/a53
+$ make CROSS_COMPILE=aarch64-linux-gnu- ATF=<path to ATF dir>/build/k3/generic/release/bl31.bin TEE=<path to OPTEE OS dir>/out/arm-plat-k3/core/tee-pager_v2.bin O=/tmp/a53
 
 Target Images
 --------------
index 7dcf33633294891e61af958b305650b342ebb1f1..757a59cdb44ae7eb4fe03b84b2e9f825d05a20ef 100644 (file)
@@ -149,12 +149,12 @@ $ make PLATFORM=k3-j721e CFG_ARM64_core=y
 4. U-Boot:
 
 4.1. R5:
-$ make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- j721e_evm_r5_defconfig O=/tmp/r5
-$ make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- O=/tmp/r5
+$ make CROSS_COMPILE=arm-linux-gnueabihf- j721e_evm_r5_defconfig O=/tmp/r5
+$ make CROSS_COMPILE=arm-linux-gnueabihf- O=/tmp/r5
 
 4.2. A72:
-$ make ARCH=arm CROSS_COMPILE=aarch64-linux-gnu- j721e_evm_a72_defconfig O=/tmp/a72
-$ make ARCH=arm CROSS_COMPILE=aarch64-linux-gnu- ATF=<path to ATF dir>/build/k3/generic/release/bl31.bin TEE=<path to OPTEE OS dir>/out/arm-plat-k3/core/tee-pager_v2.bin O=/tmp/a72
+$ make CROSS_COMPILE=aarch64-linux-gnu- j721e_evm_a72_defconfig O=/tmp/a72
+$ make CROSS_COMPILE=aarch64-linux-gnu- ATF=<path to ATF dir>/build/k3/generic/release/bl31.bin TEE=<path to OPTEE OS dir>/out/arm-plat-k3/core/tee-pager_v2.bin O=/tmp/a72
 
 Target Images
 --------------
index a26b7f813131bda49b655838a9552daf059587e1..ff0ec5a3637775ddabcbc0088bda1210c93f046e 100644 (file)
@@ -74,7 +74,7 @@ Supported image formats:
 Build instructions:
 ===================
 Examples for k2hk, for k2e, k2l and k2g just replace k2hk prefix accordingly.
-Don't forget to add ARCH=arm and CROSS_COMPILE.
+Don't forget to add CROSS_COMPILE.
 
 To build u-boot.bin, u-boot-spi.gph, MLO:
   >make k2hk_evm_defconfig
index c5c675c4ead12596dea366ec4518d1b8f625050e..15df027fbcd4f4e30405b19dd81b9163ac5dee64 100644 (file)
@@ -57,7 +57,6 @@ Compile the U-Boot
 
   > cd ../u-boot
   > cp ../rkbin/rk33/rk3399_bl31_v1.00.elf ./bl31.elf
-  > export ARCH=arm64
   > export CROSS_COMPILE=aarch64-linux-gnu-
   > make rock960-rk3399_defconfig
   > make
index 153864c58768246dcf17a20db0698587cf7db1b1..192b3b262f1a5c65fb4b3dfe272b95d62860f49f 100644 (file)
@@ -491,6 +491,7 @@ config CMD_SPL_WRITE_SIZE
 
 config CMD_FITUPD
        bool "fitImage update command"
+       depends on UPDATE_TFTP
        help
          Implements the 'fitupd' command, which allows to automatically
          store software updates present on a TFTP server in NOR Flash
index f6270d9c15b4b6761e2dd4d93cb29fa58c3a9a01..0f490c58fc8cbe81a963247d13826d0aeafd4217 100644 (file)
@@ -8,10 +8,6 @@
 #include <command.h>
 #include <net.h>
 
-#if !defined(CONFIG_UPDATE_TFTP)
-#error "CONFIG_UPDATE_TFTP required"
-#endif
-
 static int do_fitupd(struct cmd_tbl *cmdtp, int flag, int argc,
                     char *const argv[])
 {
index 727837d9cd1f7c99d1cb5ed7fbc90d7ca2bdc8fd..d18f6a888ce48c6ec142e7c658a828668d3c079e 100644 (file)
--- a/cmd/sf.c
+++ b/cmd/sf.c
@@ -145,13 +145,10 @@ static int do_spi_flash_probe(int argc, char *const argv[])
 
        new = spi_flash_probe(bus, cs, speed, mode);
        flash = new;
-
        if (!new) {
                printf("Failed to initialize SPI flash at %u:%u\n", bus, cs);
                return 1;
        }
-
-       flash = new;
 #endif
 
        return 0;
index 6af9baa121dbab45a827454b41f02bff895e657f..18f7c8db03ba7284d78d1c1723fd97988093ee0e 100644 (file)
@@ -33,6 +33,13 @@ static ulong android_image_get_kernel_addr(const struct andr_img_hdr *hdr)
        if (hdr->kernel_addr == ANDROID_IMAGE_DEFAULT_KERNEL_ADDR)
                return (ulong)hdr + hdr->page_size;
 
+       /*
+        * abootimg creates images where all load addresses are 0
+        * and we need to fix them.
+        */
+       if (hdr->kernel_addr == 0 && hdr->ramdisk_addr == 0)
+               return env_get_ulong("kernel_addr_r", 16, 0);
+
        return hdr->kernel_addr;
 }
 
index 8937c51bd0e4be52ecda2b9bdbcfb9c79e53c15a..87871fd19f153f37aa3e5863341ea20ea5766e3b 100644 (file)
@@ -10,5 +10,6 @@ CONFIG_SPL_SPI_SUNXI=y
 # CONFIG_PSCI_RESET is not set
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
 CONFIG_DEFAULT_DEVICE_TREE="sun50i-h6-pine-h64"
+CONFIG_SUN8I_EMAC=y
 CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_OHCI_HCD=y
index 34b2593eb85bfaaed6da836bf52f7f71d40816a3..44e1a5dfa38403c931129561a4ab69d21df81eed 100644 (file)
@@ -35,7 +35,7 @@ development boards.
 Supported CPU families
 ----------------------
 
-Please "make menuconfig" with ARCH=m68k, or check arch/m68k/cpu to see the
+Please "make menuconfig" and select "m68k" or check arch/m68k/cpu to see the
 currently supported processor and families.
 
 
@@ -75,8 +75,8 @@ A bash script similar to the one below may be used:
    board=M5475DFE
 
    make distclean
-   make ARCH=m68k ${board}_defconfig
-   make ARCH=m68k KBUILD_VERBOSE=1
+   make ${board}_defconfig
+   make KBUILD_VERBOSE=1
 
 
 Adopted toolchains
index e01d2d0370a10ea6aed33e46272ddfc5f30d6f33..74f2b12e41fe733f7fe81f3bab7cdb7a6ef279ba 100644 (file)
@@ -102,7 +102,7 @@ Building U-BOOT proper image
 
    $ make clean
    $ export CROSS_COMPILE=aarch64-linux-gnu-
-   $ make ARCH=arm cubieboard7_defconfig
+   $ make cubieboard7_defconfig
    $ make u-boot-dtb.img -j16
 
 u-boot-dtb.img can now be flashed to debian image partition mounted on host machine.
index 610ba87074b4673bfbb3768b42dd1c3e772721ef..43402cb2e51ee4bb4d7fff4b2cb0c615541ca2a4 100644 (file)
@@ -39,7 +39,6 @@ Building
 
 .. code-block:: none
 
-   export ARCH=riscv
    export CROSS_COMPILE=<riscv64 toolchain prefix>
 
 3. make sifive_fu540_defconfig
index 6fb952666661da574bf7bc211d0b1f0ca8d5c10b..a30e721379ee4dcd7ba1c8f90f2a5ca540e5c125 100644 (file)
@@ -18,7 +18,6 @@ Build U-Boot
 .. code-block:: bash
 
     $ export CROSS_COMPILE=arm-linux-gnueabi-
-    $ export ARCH=arm
     $ make colibri_imx7_emmc_defconfig # For NAND: colibri_imx7_defconfig
     $ make
 
index d1fc0e6a782986fe2edd19f2e6e3cd88abb11c01..de8c1f9e72071000d2e1a58ac151f9e3ee07c130 100644 (file)
@@ -69,8 +69,6 @@ to move the migration with in the deadline.
 No dm conversion yet::
 
        drivers/spi/fsl_espi.c
-       drivers/spi/lpc32xx_ssp.c
-       drivers/spi/sh_spi.c
        drivers/spi/soft_spi_legacy.c
 
 * Status: In progress
index 685ec1f46d9621fdf278351f662268d605ea8343..ebd2068ed38df2310a714cbba9503c5b2092c8f0 100644 (file)
@@ -67,7 +67,6 @@ or if you just installed gcc-arm-linux-gnueabi then it might be
 
 b. Configure and build U-Boot with verified boot enabled:
 
-   export ARCH=arm
    export UBOOT=/path/to/u-boot
    cd $UBOOT
    # You can add -j10 if you have 10 CPUs to make it faster
index 0356f8ba1815edfe01dba33ad2229019aea2adfd..c8e6fa7f892501b6b615e419310df92616684362 100644 (file)
@@ -27,6 +27,8 @@ config BOOTCOUNT_GENERIC
 
 config BOOTCOUNT_EXT
        bool "Boot counter on EXT filesystem"
+       depends on FS_EXT4
+       select EXT4_WRITE
        help
          Add support for maintaining boot count in a file on an EXT
          filesystem.
index a3bdd9fa3467bcb508e20a6a0c7903106e4c093d..a17e55e9972104e4d1d0f4637eacb1fb4067ea96 100644 (file)
@@ -21,7 +21,7 @@ config DM_KEYBOARD
          input and update LEDs if the keyboard has them.
 
 config SPL_DM_KEYBOARD
-       bool "Enable driver model keyboard support"
+       bool "Enable driver model keyboard support for SPL"
        depends on SPL_DM
        help
          This adds a uclass for keyboards and implements keyboard support
@@ -30,7 +30,7 @@ config SPL_DM_KEYBOARD
          input and update LEDs if the keyboard has them.
 
 config TPL_DM_KEYBOARD
-       bool "Enable driver model keyboard support"
+       bool "Enable driver model keyboard support for TPL"
        depends on TPL_DM
        help
          This adds a uclass for keyboards and implements keyboard support
index c4beefa61764272adfa9a0a681fa35c4c454a350..c2cd3b426b31a42f61faafb479742b9853c16810 100644 (file)
@@ -23,13 +23,25 @@ static SPINAND_OP_VARIANTS(read_cache_variants,
                SPINAND_PAGE_READ_FROM_CACHE_OP(true, 0, 1, NULL, 0),
                SPINAND_PAGE_READ_FROM_CACHE_OP(false, 0, 1, NULL, 0));
 
+static SPINAND_OP_VARIANTS(write_cache_x4_variants,
+               SPINAND_PROG_LOAD_X4(true, 0, NULL, 0),
+               SPINAND_PROG_LOAD(true, 0, NULL, 0));
+
+static SPINAND_OP_VARIANTS(update_cache_x4_variants,
+               SPINAND_PROG_LOAD_X4(false, 0, NULL, 0),
+               SPINAND_PROG_LOAD(false, 0, NULL, 0));
+
+/**
+ * Backward compatibility for 1st generation Serial NAND devices
+ * which don't support Quad Program Load operation.
+ */
 static SPINAND_OP_VARIANTS(write_cache_variants,
                SPINAND_PROG_LOAD(true, 0, NULL, 0));
 
 static SPINAND_OP_VARIANTS(update_cache_variants,
                SPINAND_PROG_LOAD(false, 0, NULL, 0));
 
-static int tc58cxgxsx_ooblayout_ecc(struct mtd_info *mtd, int section,
+static int tx58cxgxsxraix_ooblayout_ecc(struct mtd_info *mtd, int section,
                                     struct mtd_oob_region *region)
 {
        if (section > 0)
@@ -41,7 +53,7 @@ static int tc58cxgxsx_ooblayout_ecc(struct mtd_info *mtd, int section,
        return 0;
 }
 
-static int tc58cxgxsx_ooblayout_free(struct mtd_info *mtd, int section,
+static int tx58cxgxsxraix_ooblayout_free(struct mtd_info *mtd, int section,
                                      struct mtd_oob_region *region)
 {
        if (section > 0)
@@ -54,12 +66,12 @@ static int tc58cxgxsx_ooblayout_free(struct mtd_info *mtd, int section,
        return 0;
 }
 
-static const struct mtd_ooblayout_ops tc58cxgxsx_ooblayout = {
-       .ecc = tc58cxgxsx_ooblayout_ecc,
-       .rfree = tc58cxgxsx_ooblayout_free,
+static const struct mtd_ooblayout_ops tx58cxgxsxraix_ooblayout = {
+       .ecc = tx58cxgxsxraix_ooblayout_ecc,
+       .rfree = tx58cxgxsxraix_ooblayout_free,
 };
 
-static int tc58cxgxsx_ecc_get_status(struct spinand_device *spinand,
+static int tx58cxgxsxraix_ecc_get_status(struct spinand_device *spinand,
                                      u8 status)
 {
        struct nand_device *nand = spinand_to_nand(spinand);
@@ -98,76 +110,151 @@ static int tc58cxgxsx_ecc_get_status(struct spinand_device *spinand,
 }
 
 static const struct spinand_info toshiba_spinand_table[] = {
-       /* 3.3V 1Gb */
-       SPINAND_INFO("TC58CVG0S3", 0xC2,
+       /* 3.3V 1Gb (1st generation) */
+       SPINAND_INFO("TC58CVG0S3HRAIG", 0xC2,
                     NAND_MEMORG(1, 2048, 128, 64, 1024, 1, 1, 1),
                     NAND_ECCREQ(8, 512),
                     SPINAND_INFO_OP_VARIANTS(&read_cache_variants,
                                              &write_cache_variants,
                                              &update_cache_variants),
                     0,
-                    SPINAND_ECCINFO(&tc58cxgxsx_ooblayout,
-                                    tc58cxgxsx_ecc_get_status)),
-       /* 3.3V 2Gb */
-       SPINAND_INFO("TC58CVG1S3", 0xCB,
+                    SPINAND_ECCINFO(&tx58cxgxsxraix_ooblayout,
+                                    tx58cxgxsxraix_ecc_get_status)),
+       /* 3.3V 2Gb (1st generation) */
+       SPINAND_INFO("TC58CVG1S3HRAIG", 0xCB,
                     NAND_MEMORG(1, 2048, 128, 64, 2048, 1, 1, 1),
                     NAND_ECCREQ(8, 512),
                     SPINAND_INFO_OP_VARIANTS(&read_cache_variants,
                                              &write_cache_variants,
                                              &update_cache_variants),
                     0,
-                    SPINAND_ECCINFO(&tc58cxgxsx_ooblayout,
-                                    tc58cxgxsx_ecc_get_status)),
-       /* 3.3V 4Gb */
-       SPINAND_INFO("TC58CVG2S0", 0xCD,
-                    NAND_MEMORG(1, 4096, 256, 64, 2048, 1, 1, 1),
-                    NAND_ECCREQ(8, 512),
-                    SPINAND_INFO_OP_VARIANTS(&read_cache_variants,
-                                             &write_cache_variants,
-                                             &update_cache_variants),
-                    0,
-                    SPINAND_ECCINFO(&tc58cxgxsx_ooblayout,
-                                    tc58cxgxsx_ecc_get_status)),
-       /* 3.3V 4Gb */
-       SPINAND_INFO("TC58CVG2S0", 0xED,
+                    SPINAND_ECCINFO(&tx58cxgxsxraix_ooblayout,
+                                    tx58cxgxsxraix_ecc_get_status)),
+       /* 3.3V 4Gb (1st generation) */
+       SPINAND_INFO("TC58CVG2S0HRAIG", 0xCD,
                     NAND_MEMORG(1, 4096, 256, 64, 2048, 1, 1, 1),
                     NAND_ECCREQ(8, 512),
                     SPINAND_INFO_OP_VARIANTS(&read_cache_variants,
                                              &write_cache_variants,
                                              &update_cache_variants),
                     0,
-                    SPINAND_ECCINFO(&tc58cxgxsx_ooblayout,
-                                    tc58cxgxsx_ecc_get_status)),
-       /* 1.8V 1Gb */
-       SPINAND_INFO("TC58CYG0S3", 0xB2,
+                    SPINAND_ECCINFO(&tx58cxgxsxraix_ooblayout,
+                                    tx58cxgxsxraix_ecc_get_status)),
+       /* 1.8V 1Gb (1st generation) */
+       SPINAND_INFO("TC58CYG0S3HRAIG", 0xB2,
                     NAND_MEMORG(1, 2048, 128, 64, 1024, 1, 1, 1),
                     NAND_ECCREQ(8, 512),
                     SPINAND_INFO_OP_VARIANTS(&read_cache_variants,
                                              &write_cache_variants,
                                              &update_cache_variants),
                     0,
-                    SPINAND_ECCINFO(&tc58cxgxsx_ooblayout,
-                                    tc58cxgxsx_ecc_get_status)),
-       /* 1.8V 2Gb */
-       SPINAND_INFO("TC58CYG1S3", 0xBB,
+                    SPINAND_ECCINFO(&tx58cxgxsxraix_ooblayout,
+                                    tx58cxgxsxraix_ecc_get_status)),
+       /* 1.8V 2Gb (1st generation) */
+       SPINAND_INFO("TC58CYG1S3HRAIG", 0xBB,
                     NAND_MEMORG(1, 2048, 128, 64, 2048, 1, 1, 1),
                     NAND_ECCREQ(8, 512),
                     SPINAND_INFO_OP_VARIANTS(&read_cache_variants,
                                              &write_cache_variants,
                                              &update_cache_variants),
                     0,
-                    SPINAND_ECCINFO(&tc58cxgxsx_ooblayout,
-                                    tc58cxgxsx_ecc_get_status)),
-       /* 1.8V 4Gb */
-       SPINAND_INFO("TC58CYG2S0", 0xBD,
+                    SPINAND_ECCINFO(&tx58cxgxsxraix_ooblayout,
+                                    tx58cxgxsxraix_ecc_get_status)),
+       /* 1.8V 4Gb (1st generation) */
+       SPINAND_INFO("TC58CYG2S0HRAIG", 0xBD,
                     NAND_MEMORG(1, 4096, 256, 64, 2048, 1, 1, 1),
                     NAND_ECCREQ(8, 512),
                     SPINAND_INFO_OP_VARIANTS(&read_cache_variants,
                                              &write_cache_variants,
                                              &update_cache_variants),
                     0,
-                    SPINAND_ECCINFO(&tc58cxgxsx_ooblayout,
-                                    tc58cxgxsx_ecc_get_status)),
+                    SPINAND_ECCINFO(&tx58cxgxsxraix_ooblayout,
+                                    tx58cxgxsxraix_ecc_get_status)),
+
+       /*
+        * 2nd generation serial nand has HOLD_D which is equivalent to
+        * QE_BIT.
+        */
+       /* 3.3V 1Gb (2nd generation) */
+       SPINAND_INFO("TC58CVG0S3HRAIJ", 0xE2,
+                    NAND_MEMORG(1, 2048, 128, 64, 1024, 1, 1, 1),
+                    NAND_ECCREQ(8, 512),
+                    SPINAND_INFO_OP_VARIANTS(&read_cache_variants,
+                                             &write_cache_x4_variants,
+                                             &update_cache_x4_variants),
+                    SPINAND_HAS_QE_BIT,
+                    SPINAND_ECCINFO(&tx58cxgxsxraix_ooblayout,
+                                    tx58cxgxsxraix_ecc_get_status)),
+       /* 3.3V 2Gb (2nd generation) */
+       SPINAND_INFO("TC58CVG1S3HRAIJ", 0xEB,
+                    NAND_MEMORG(1, 2048, 128, 64, 2048, 1, 1, 1),
+                    NAND_ECCREQ(8, 512),
+                    SPINAND_INFO_OP_VARIANTS(&read_cache_variants,
+                                             &write_cache_x4_variants,
+                                             &update_cache_x4_variants),
+                    SPINAND_HAS_QE_BIT,
+                    SPINAND_ECCINFO(&tx58cxgxsxraix_ooblayout,
+                                    tx58cxgxsxraix_ecc_get_status)),
+       /* 3.3V 4Gb (2nd generation) */
+       SPINAND_INFO("TC58CVG2S0HRAIJ", 0xED,
+                    NAND_MEMORG(1, 4096, 256, 64, 2048, 1, 1, 1),
+                    NAND_ECCREQ(8, 512),
+                    SPINAND_INFO_OP_VARIANTS(&read_cache_variants,
+                                             &write_cache_x4_variants,
+                                             &update_cache_x4_variants),
+                    SPINAND_HAS_QE_BIT,
+                    SPINAND_ECCINFO(&tx58cxgxsxraix_ooblayout,
+                                    tx58cxgxsxraix_ecc_get_status)),
+       /* 3.3V 8Gb (2nd generation) */
+       SPINAND_INFO("TH58CVG3S0HRAIJ", 0xE4,
+                    NAND_MEMORG(1, 4096, 256, 64, 4096, 1, 1, 1),
+                    NAND_ECCREQ(8, 512),
+                    SPINAND_INFO_OP_VARIANTS(&read_cache_variants,
+                                             &write_cache_x4_variants,
+                                             &update_cache_x4_variants),
+                    SPINAND_HAS_QE_BIT,
+                    SPINAND_ECCINFO(&tx58cxgxsxraix_ooblayout,
+                                    tx58cxgxsxraix_ecc_get_status)),
+       /* 1.8V 1Gb (2nd generation) */
+       SPINAND_INFO("TC58CYG0S3HRAIJ", 0xD2,
+                    NAND_MEMORG(1, 2048, 128, 64, 1024, 1, 1, 1),
+                    NAND_ECCREQ(8, 512),
+                    SPINAND_INFO_OP_VARIANTS(&read_cache_variants,
+                                             &write_cache_x4_variants,
+                                             &update_cache_x4_variants),
+                    SPINAND_HAS_QE_BIT,
+                    SPINAND_ECCINFO(&tx58cxgxsxraix_ooblayout,
+                                    tx58cxgxsxraix_ecc_get_status)),
+       /* 1.8V 2Gb (2nd generation) */
+       SPINAND_INFO("TC58CYG1S3HRAIJ", 0xDB,
+                    NAND_MEMORG(1, 2048, 128, 64, 2048, 1, 1, 1),
+                    NAND_ECCREQ(8, 512),
+                    SPINAND_INFO_OP_VARIANTS(&read_cache_variants,
+                                             &write_cache_x4_variants,
+                                             &update_cache_x4_variants),
+                    SPINAND_HAS_QE_BIT,
+                    SPINAND_ECCINFO(&tx58cxgxsxraix_ooblayout,
+                                    tx58cxgxsxraix_ecc_get_status)),
+       /* 1.8V 4Gb (2nd generation) */
+       SPINAND_INFO("TC58CYG2S0HRAIJ", 0xDD,
+                    NAND_MEMORG(1, 4096, 256, 64, 2048, 1, 1, 1),
+                    NAND_ECCREQ(8, 512),
+                    SPINAND_INFO_OP_VARIANTS(&read_cache_variants,
+                                             &write_cache_x4_variants,
+                                             &update_cache_x4_variants),
+                    SPINAND_HAS_QE_BIT,
+                    SPINAND_ECCINFO(&tx58cxgxsxraix_ooblayout,
+                                    tx58cxgxsxraix_ecc_get_status)),
+       /* 1.8V 8Gb (2nd generation) */
+       SPINAND_INFO("TH58CYG3S0HRAIJ", 0xD4,
+                    NAND_MEMORG(1, 4096, 256, 64, 4096, 1, 1, 1),
+                    NAND_ECCREQ(8, 512),
+                    SPINAND_INFO_OP_VARIANTS(&read_cache_variants,
+                                             &write_cache_x4_variants,
+                                             &update_cache_x4_variants),
+                    SPINAND_HAS_QE_BIT,
+                    SPINAND_ECCINFO(&tx58cxgxsxraix_ooblayout,
+                                    tx58cxgxsxraix_ecc_get_status)),
 };
 
 static int toshiba_spinand_detect(struct spinand_device *spinand)
index de369aa001dd566a8061a1fe6f00456d9dafd4d9..9ce2ecb99ac2679347499c15aca27b11170304ee 100644 (file)
@@ -30,15 +30,6 @@ int spi_flash_erase_dm(struct udevice *dev, u32 offset, size_t len)
        return log_ret(sf_get_ops(dev)->erase(dev, offset, len));
 }
 
-int spl_flash_get_sw_write_prot(struct udevice *dev)
-{
-       struct dm_spi_flash_ops *ops = sf_get_ops(dev);
-
-       if (!ops->get_sw_write_prot)
-               return -ENOSYS;
-       return log_ret(ops->get_sw_write_prot(dev));
-}
-
 /*
  * TODO(sjg@chromium.org): This is an old-style function. We should remove
  * it when all SPI flash drivers use dm
index ce0cf4c428b1ea61e9323d16e6d871a89cd72b54..dabd40a4cc1ed10ff720dbde03c624d77a81c78b 100644 (file)
@@ -75,12 +75,18 @@ extern const struct flash_info spi_nor_ids[];
 #define JEDEC_MFR(info)        ((info)->id[0])
 #define JEDEC_ID(info)         (((info)->id[1]) << 8 | ((info)->id[2]))
 
-/* Get software write-protect value (BP bits) */
-int spi_flash_cmd_get_sw_write_prot(struct spi_flash *flash);
-
-
 #if CONFIG_IS_ENABLED(SPI_FLASH_MTD)
 int spi_flash_mtd_register(struct spi_flash *flash);
 void spi_flash_mtd_unregister(void);
+#else
+static inline int spi_flash_mtd_register(struct spi_flash *flash)
+{
+       return 0;
+}
+
+static inline void spi_flash_mtd_unregister(void)
+{
+}
 #endif
+
 #endif /* _SF_INTERNAL_H_ */
index c2e51f9c68dfb77e972b24c2d7d4ec005a1475b0..3548d6319b305f491816bf81c0486cd99fc404ff 100644 (file)
@@ -45,9 +45,8 @@ static int spi_flash_probe_slave(struct spi_flash *flash)
        if (ret)
                goto err_read_id;
 
-#if CONFIG_IS_ENABLED(SPI_FLASH_MTD)
-       ret = spi_flash_mtd_register(flash);
-#endif
+       if (CONFIG_IS_ENABLED(SPI_FLASH_MTD))
+               ret = spi_flash_mtd_register(flash);
 
 err_read_id:
        spi_release_bus(spi);
@@ -84,9 +83,9 @@ struct spi_flash *spi_flash_probe(unsigned int busnum, unsigned int cs,
 
 void spi_flash_free(struct spi_flash *flash)
 {
-#if CONFIG_IS_ENABLED(SPI_FLASH_MTD)
-       spi_flash_mtd_unregister();
-#endif
+       if (CONFIG_IS_ENABLED(SPI_FLASH_MTD))
+               spi_flash_mtd_unregister();
+
        spi_free_slave(flash->spi);
        free(flash);
 }
@@ -131,31 +130,22 @@ static int spi_flash_std_erase(struct udevice *dev, u32 offset, size_t len)
        return mtd->_erase(mtd, &instr);
 }
 
-static int spi_flash_std_get_sw_write_prot(struct udevice *dev)
-{
-       struct spi_flash *flash = dev_get_uclass_priv(dev);
-
-       return spi_flash_cmd_get_sw_write_prot(flash);
-}
-
 int spi_flash_std_probe(struct udevice *dev)
 {
        struct spi_slave *slave = dev_get_parent_priv(dev);
-       struct dm_spi_slave_platdata *plat = dev_get_parent_platdata(dev);
        struct spi_flash *flash;
 
        flash = dev_get_uclass_priv(dev);
        flash->dev = dev;
        flash->spi = slave;
-       debug("%s: slave=%p, cs=%d\n", __func__, slave, plat->cs);
        return spi_flash_probe_slave(flash);
 }
 
 static int spi_flash_std_remove(struct udevice *dev)
 {
-#if CONFIG_IS_ENABLED(SPI_FLASH_MTD)
-       spi_flash_mtd_unregister();
-#endif
+       if (CONFIG_IS_ENABLED(SPI_FLASH_MTD))
+               spi_flash_mtd_unregister();
+
        return 0;
 }
 
@@ -163,7 +153,6 @@ static const struct dm_spi_flash_ops spi_flash_std_ops = {
        .read = spi_flash_std_read,
        .write = spi_flash_std_write,
        .erase = spi_flash_std_erase,
-       .get_sw_write_prot = spi_flash_std_get_sw_write_prot,
 };
 
 static const struct udevice_id spi_flash_std_ids[] = {
index 56b44ebbe8d0649ec8dc952b0c58c995fb4015d3..1e3f51d2acbff452c339a95dda6f4edc69d0483f 100644 (file)
@@ -1235,6 +1235,12 @@ static int spi_nor_write(struct mtd_info *mtd, loff_t to, size_t len,
        size_t page_offset, page_remain, i;
        ssize_t ret;
 
+#ifdef CONFIG_SPI_FLASH_SST
+       /* sst nor chips use AAI word program */
+       if (nor->info->flags & SST_WRITE)
+               return sst_write(mtd, to, len, retlen, buf);
+#endif
+
        dev_dbg(nor->dev, "to 0x%08x, len %zd\n", (u32)to, len);
 
        if (!len)
@@ -2530,6 +2536,7 @@ int spi_nor_scan(struct spi_nor *nor)
        mtd->size = params.size;
        mtd->_erase = spi_nor_erase;
        mtd->_read = spi_nor_read;
+       mtd->_write = spi_nor_write;
 
 #if defined(CONFIG_SPI_FLASH_STMICRO) || defined(CONFIG_SPI_FLASH_SST)
        /* NOR protection support for STmicro/Micron chips and similar */
@@ -2553,13 +2560,7 @@ int spi_nor_scan(struct spi_nor *nor)
                nor->flash_unlock = sst26_unlock;
                nor->flash_is_locked = sst26_is_locked;
        }
-
-       /* sst nor chips use AAI word program */
-       if (info->flags & SST_WRITE)
-               mtd->_write = sst_write;
-       else
 #endif
-               mtd->_write = spi_nor_write;
 
        if (info->flags & USE_FSR)
                nor->flags |= SNOR_F_USE_FSR;
@@ -2640,14 +2641,3 @@ int spi_nor_scan(struct spi_nor *nor)
 
        return 0;
 }
-
-/* U-Boot specific functions, need to extend MTD to support these */
-int spi_flash_cmd_get_sw_write_prot(struct spi_nor *nor)
-{
-       int sr = read_sr(nor);
-
-       if (sr < 0)
-               return sr;
-
-       return (sr >> 2) & 7;
-}
index 55f86d51555c68a8390d696bde7238729cbdbb10..9f676c649d88641880e838657d63d0136c2b4b3f 100644 (file)
@@ -798,9 +798,3 @@ int spi_nor_scan(struct spi_nor *nor)
 
        return 0;
 }
-
-/* U-Boot specific functions, need to extend MTD to support these */
-int spi_flash_cmd_get_sw_write_prot(struct spi_nor *nor)
-{
-       return -ENOTSUPP;
-}
index 99e24c634828b6966c6ae06e19d5c338865788a7..e2b05ace8f7189f89304042ece87b43275c4e25b 100644 (file)
@@ -111,6 +111,7 @@ enum emac_variant {
        H3_EMAC,
        A64_EMAC,
        R40_GMAC,
+       H6_EMAC,
 };
 
 struct emac_dma_desc {
@@ -300,9 +301,9 @@ static int sun8i_emac_set_syscon(struct sun8i_eth_pdata *pdata,
        if (priv->variant == R40_GMAC) {
                /* Select RGMII for R40 */
                reg = readl(priv->sysctl_reg + 0x164);
-               reg |= CCM_GMAC_CTRL_TX_CLK_SRC_INT_RGMII |
-                      CCM_GMAC_CTRL_GPIT_RGMII |
-                      CCM_GMAC_CTRL_TX_CLK_DELAY(CONFIG_GMAC_TX_DELAY);
+               reg |= SC_ETCS_INT_GMII |
+                      SC_EPIT |
+                      (CONFIG_GMAC_TX_DELAY << SC_ETXDC_OFFSET);
 
                writel(reg, priv->sysctl_reg + 0x164);
                return 0;
@@ -310,14 +311,16 @@ static int sun8i_emac_set_syscon(struct sun8i_eth_pdata *pdata,
 
        reg = readl(priv->sysctl_reg + 0x30);
 
-       if (priv->variant == H3_EMAC) {
+       if (priv->variant == H3_EMAC || priv->variant == H6_EMAC) {
                ret = sun8i_emac_set_syscon_ephy(priv, &reg);
                if (ret)
                        return ret;
        }
 
        reg &= ~(SC_ETCS_MASK | SC_EPIT);
-       if (priv->variant == H3_EMAC || priv->variant == A64_EMAC)
+       if (priv->variant == H3_EMAC ||
+           priv->variant == A64_EMAC ||
+           priv->variant == H6_EMAC)
                reg &= ~SC_RMII_EN;
 
        switch (priv->interface) {
@@ -329,7 +332,8 @@ static int sun8i_emac_set_syscon(struct sun8i_eth_pdata *pdata,
                break;
        case PHY_INTERFACE_MODE_RMII:
                if (priv->variant == H3_EMAC ||
-                   priv->variant == A64_EMAC) {
+                   priv->variant == A64_EMAC ||
+                   priv->variant == H6_EMAC) {
                        reg |= SC_RMII_EN | SC_ETCS_EXT_GMII;
                break;
                }
@@ -535,7 +539,7 @@ static int parse_phy_pins(struct udevice *dev)
 
                if (priv->variant == H3_EMAC)
                        sunxi_gpio_set_cfgpin(pin, SUN8I_IOMUX_H3);
-               else if (priv->variant == R40_GMAC)
+               else if (priv->variant == R40_GMAC || priv->variant == H6_EMAC)
                        sunxi_gpio_set_cfgpin(pin, SUN8I_IOMUX_R40);
                else
                        sunxi_gpio_set_cfgpin(pin, SUN8I_IOMUX);
@@ -1032,6 +1036,8 @@ static const struct udevice_id sun8i_emac_eth_ids[] = {
                .data = (uintptr_t)A83T_EMAC },
        {.compatible = "allwinner,sun8i-r40-gmac",
                .data = (uintptr_t)R40_GMAC },
+       {.compatible = "allwinner,sun50i-h6-emac",
+               .data = (uintptr_t)H6_EMAC },
        { }
 };
 
index b4bae22c2cf4f6b8f52f71f55cd970ca3cba9832..f050645044c9905327c29cd0ccd3aa9b29767ce2 100644 (file)
@@ -282,7 +282,8 @@ static int sun4i_usb_phy_init(struct phy *phy)
                return ret;
        }
 
-       if (data->cfg->type == sun8i_a83t_phy) {
+       if (data->cfg->type == sun8i_a83t_phy ||
+           data->cfg->type == sun50i_h6_phy) {
                if (phy->id == 0) {
                        val = readl(data->base + data->cfg->phyctl_offset);
                        val |= PHY_CTL_VBUSVLDEXT;
@@ -324,7 +325,8 @@ static int sun4i_usb_phy_exit(struct phy *phy)
        int ret;
 
        if (phy->id == 0) {
-               if (data->cfg->type == sun8i_a83t_phy) {
+               if (data->cfg->type == sun8i_a83t_phy ||
+                   data->cfg->type == sun50i_h6_phy) {
                        void __iomem *phyctl = data->base +
                                data->cfg->phyctl_offset;
 
index dccd5ea0d9a8936cae152975ab340d377bf1914f..59415209ee4ac4071f1a26120e379b4efa71eda8 100644 (file)
@@ -141,6 +141,14 @@ config FSL_DSPI
          this Freescale DSPI IP core. LS102xA and Colibri VF50/VF61 platforms
          use this driver.
 
+config FSL_QSPI
+       bool "Freescale QSPI driver"
+       imply SPI_FLASH_BAR
+       help
+         Enable the Freescale Quad-SPI (QSPI) driver. This driver can be
+         used to access the SPI NOR flash on platforms embedding this
+         Freescale IP core.
+
 config ICH_SPI
        bool "Intel ICH SPI driver"
        help
@@ -167,6 +175,13 @@ config MPC8XXX_SPI
        help
          Enable support for SPI on the MPC8XXX PowerPC SoCs.
 
+config MSCC_BB_SPI
+       bool "MSCC bitbang SPI driver"
+       depends on SOC_VCOREIII
+       help
+         Enable MSCC bitbang SPI driver. This driver can be used on
+         MSCC SOCs.
+
 config MT7621_SPI
        bool "MediaTek MT7621 SPI driver"
        depends on SOC_MT7628
@@ -377,19 +392,6 @@ config SOFT_SPI
         Enable Soft SPI driver. This driver is to use GPIO simulate
         the SPI protocol.
 
-config MSCC_BB_SPI
-       bool "MSCC bitbang SPI driver"
-       depends on SOC_VCOREIII
-       help
-         Enable MSCC bitbang SPI driver. This driver can be used on
-         MSCC SOCs.
-
-config CF_SPI
-       bool "ColdFire SPI driver"
-       help
-         Enable the ColdFire SPI driver. This driver can be used on
-         some m68k SoCs.
-
 config FSL_ESPI
        bool "Freescale eSPI driver"
        imply SPI_FLASH_BAR
@@ -398,27 +400,12 @@ config FSL_ESPI
          access the SPI interface and SPI NOR flash on platforms embedding
          this Freescale eSPI IP core.
 
-config FSL_QSPI
-       bool "Freescale QSPI driver"
-       imply SPI_FLASH_BAR
-       help
-         Enable the Freescale Quad-SPI (QSPI) driver. This driver can be
-         used to access the SPI NOR flash on platforms embedding this
-         Freescale IP core.
-
 config DAVINCI_SPI
        bool "Davinci & Keystone SPI driver"
        depends on ARCH_DAVINCI || ARCH_KEYSTONE
        help
          Enable the Davinci SPI driver
 
-config SH_SPI
-       bool "SuperH SPI driver"
-       depends on DEPRECATED
-       help
-         Enable the SuperH SPI controller driver. This driver can be used
-         on various SuperH SoCs, such as SH7757.
-
 config SH_QSPI
        bool "Renesas Quad SPI driver"
        help
index 6441694c8d86045b969cb1eb6487be7585419359..342776404a50f8ad48f4ff2a0f47b5e5f8f9afcc 100644 (file)
@@ -52,7 +52,6 @@ obj-$(CONFIG_ROCKCHIP_SPI) += rk_spi.o
 obj-$(CONFIG_SANDBOX_SPI) += sandbox_spi.o
 obj-$(CONFIG_SPI_SIFIVE) += spi-sifive.o
 obj-$(CONFIG_SPI_SUNXI) += spi-sunxi.o
-obj-$(CONFIG_SH_SPI) += sh_spi.o
 obj-$(CONFIG_SH_QSPI) += sh_qspi.o
 obj-$(CONFIG_STM32_QSPI) += stm32_qspi.o
 obj-$(CONFIG_STM32_SPI) += stm32_spi.o
index dd9c77281f116cee3b1a1332362c38d9a386b88c..dec92df69bd8986ef2de186d78e65ccc480c9d80 100644 (file)
@@ -383,10 +383,6 @@ static int coldfire_spi_probe(struct udevice *bus)
        return 0;
 }
 
-void spi_init(void)
-{
-}
-
 #if CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA)
 static int coldfire_dspi_ofdata_to_platdata(struct udevice *bus)
 {
index 01fcf6bef5a472d3e62c9a43fafb9e4fe7a7855f..3986b06b25ce2c96a451c54705e9698c1a01c73f 100644 (file)
@@ -183,10 +183,6 @@ int spi_cs_is_valid(unsigned int bus, unsigned int cs)
 }
 #endif
 
-void spi_init(void)
-{
-}
-
 void spi_cs_activate(struct spi_slave *slave)
 {
        _spi_cs_activate(spireg);
diff --git a/drivers/spi/sh_spi.c b/drivers/spi/sh_spi.c
deleted file mode 100644 (file)
index 4ecfe60..0000000
+++ /dev/null
@@ -1,250 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-/*
- * SH SPI driver
- *
- * Copyright (C) 2011-2012 Renesas Solutions Corp.
- */
-
-#include <common.h>
-#include <console.h>
-#include <malloc.h>
-#include <spi.h>
-#include <asm/io.h>
-#include <linux/delay.h>
-#include "sh_spi.h"
-
-static void sh_spi_write(unsigned long data, unsigned long *reg)
-{
-       writel(data, reg);
-}
-
-static unsigned long sh_spi_read(unsigned long *reg)
-{
-       return readl(reg);
-}
-
-static void sh_spi_set_bit(unsigned long val, unsigned long *reg)
-{
-       unsigned long tmp;
-
-       tmp = sh_spi_read(reg);
-       tmp |= val;
-       sh_spi_write(tmp, reg);
-}
-
-static void sh_spi_clear_bit(unsigned long val, unsigned long *reg)
-{
-       unsigned long tmp;
-
-       tmp = sh_spi_read(reg);
-       tmp &= ~val;
-       sh_spi_write(tmp, reg);
-}
-
-static void clear_fifo(struct sh_spi *ss)
-{
-       sh_spi_set_bit(SH_SPI_RSTF, &ss->regs->cr2);
-       sh_spi_clear_bit(SH_SPI_RSTF, &ss->regs->cr2);
-}
-
-static int recvbuf_wait(struct sh_spi *ss)
-{
-       while (sh_spi_read(&ss->regs->cr1) & SH_SPI_RBE) {
-               if (ctrlc())
-                       return 1;
-               udelay(10);
-       }
-       return 0;
-}
-
-static int write_fifo_empty_wait(struct sh_spi *ss)
-{
-       while (!(sh_spi_read(&ss->regs->cr1) & SH_SPI_TBE)) {
-               if (ctrlc())
-                       return 1;
-               udelay(10);
-       }
-       return 0;
-}
-
-static void sh_spi_set_cs(struct sh_spi *ss, unsigned int cs)
-{
-       unsigned long val = 0;
-
-       if (cs & 0x01)
-               val |= SH_SPI_SSS0;
-       if (cs & 0x02)
-               val |= SH_SPI_SSS1;
-
-       sh_spi_clear_bit(SH_SPI_SSS0 | SH_SPI_SSS1, &ss->regs->cr4);
-       sh_spi_set_bit(val, &ss->regs->cr4);
-}
-
-struct spi_slave *spi_setup_slave(unsigned int bus, unsigned int cs,
-               unsigned int max_hz, unsigned int mode)
-{
-       struct sh_spi *ss;
-
-       if (!spi_cs_is_valid(bus, cs))
-               return NULL;
-
-       ss = spi_alloc_slave(struct sh_spi, bus, cs);
-       if (!ss)
-               return NULL;
-
-       ss->regs = (struct sh_spi_regs *)CONFIG_SH_SPI_BASE;
-
-       /* SPI sycle stop */
-       sh_spi_write(0xfe, &ss->regs->cr1);
-       /* CR1 init */
-       sh_spi_write(0x00, &ss->regs->cr1);
-       /* CR3 init */
-       sh_spi_write(0x00, &ss->regs->cr3);
-       sh_spi_set_cs(ss, cs);
-
-       clear_fifo(ss);
-
-       /* 1/8 clock */
-       sh_spi_write(sh_spi_read(&ss->regs->cr2) | 0x07, &ss->regs->cr2);
-       udelay(10);
-
-       return &ss->slave;
-}
-
-void spi_free_slave(struct spi_slave *slave)
-{
-       struct sh_spi *spi = to_sh_spi(slave);
-
-       free(spi);
-}
-
-int spi_claim_bus(struct spi_slave *slave)
-{
-       return 0;
-}
-
-void spi_release_bus(struct spi_slave *slave)
-{
-       struct sh_spi *ss = to_sh_spi(slave);
-
-       sh_spi_write(sh_spi_read(&ss->regs->cr1) &
-               ~(SH_SPI_SSA | SH_SPI_SSDB | SH_SPI_SSD), &ss->regs->cr1);
-}
-
-static int sh_spi_send(struct sh_spi *ss, const unsigned char *tx_data,
-                       unsigned int len, unsigned long flags)
-{
-       int i, cur_len, ret = 0;
-       int remain = (int)len;
-
-       if (len >= SH_SPI_FIFO_SIZE)
-               sh_spi_set_bit(SH_SPI_SSA, &ss->regs->cr1);
-
-       while (remain > 0) {
-               cur_len = (remain < SH_SPI_FIFO_SIZE) ?
-                               remain : SH_SPI_FIFO_SIZE;
-               for (i = 0; i < cur_len &&
-                       !(sh_spi_read(&ss->regs->cr4) & SH_SPI_WPABRT) &&
-                       !(sh_spi_read(&ss->regs->cr1) & SH_SPI_TBF);
-                               i++)
-                       sh_spi_write(tx_data[i], &ss->regs->tbr_rbr);
-
-               cur_len = i;
-
-               if (sh_spi_read(&ss->regs->cr4) & SH_SPI_WPABRT) {
-                       /* Abort the transaction */
-                       flags |= SPI_XFER_END;
-                       sh_spi_set_bit(SH_SPI_WPABRT, &ss->regs->cr4);
-                       ret = 1;
-                       break;
-               }
-
-               remain -= cur_len;
-               tx_data += cur_len;
-
-               if (remain > 0)
-                       write_fifo_empty_wait(ss);
-       }
-
-       if (flags & SPI_XFER_END) {
-               sh_spi_clear_bit(SH_SPI_SSD | SH_SPI_SSDB, &ss->regs->cr1);
-               sh_spi_set_bit(SH_SPI_SSA, &ss->regs->cr1);
-               udelay(100);
-               write_fifo_empty_wait(ss);
-       }
-
-       return ret;
-}
-
-static int sh_spi_receive(struct sh_spi *ss, unsigned char *rx_data,
-                         unsigned int len, unsigned long flags)
-{
-       int i;
-
-       if (len > SH_SPI_MAX_BYTE)
-               sh_spi_write(SH_SPI_MAX_BYTE, &ss->regs->cr3);
-       else
-               sh_spi_write(len, &ss->regs->cr3);
-
-       sh_spi_clear_bit(SH_SPI_SSD | SH_SPI_SSDB, &ss->regs->cr1);
-       sh_spi_set_bit(SH_SPI_SSA, &ss->regs->cr1);
-
-       for (i = 0; i < len; i++) {
-               if (recvbuf_wait(ss))
-                       return 0;
-
-               rx_data[i] = (unsigned char)sh_spi_read(&ss->regs->tbr_rbr);
-       }
-       sh_spi_write(0, &ss->regs->cr3);
-
-       return 0;
-}
-
-int  spi_xfer(struct spi_slave *slave, unsigned int bitlen, const void *dout,
-               void *din, unsigned long flags)
-{
-       struct sh_spi *ss = to_sh_spi(slave);
-       const unsigned char *tx_data = dout;
-       unsigned char *rx_data = din;
-       unsigned int len = bitlen / 8;
-       int ret = 0;
-
-       if (flags & SPI_XFER_BEGIN)
-               sh_spi_write(sh_spi_read(&ss->regs->cr1) & ~SH_SPI_SSA,
-                               &ss->regs->cr1);
-
-       if (tx_data)
-               ret = sh_spi_send(ss, tx_data, len, flags);
-
-       if (ret == 0 && rx_data)
-               ret = sh_spi_receive(ss, rx_data, len, flags);
-
-       if (flags & SPI_XFER_END) {
-               sh_spi_set_bit(SH_SPI_SSD, &ss->regs->cr1);
-               udelay(100);
-
-               sh_spi_clear_bit(SH_SPI_SSA | SH_SPI_SSDB | SH_SPI_SSD,
-                                &ss->regs->cr1);
-               clear_fifo(ss);
-       }
-
-       return ret;
-}
-
-int  spi_cs_is_valid(unsigned int bus, unsigned int cs)
-{
-       if (!bus && cs < SH_SPI_NUM_CS)
-               return 1;
-       else
-               return 0;
-}
-
-void spi_cs_activate(struct spi_slave *slave)
-{
-
-}
-
-void spi_cs_deactivate(struct spi_slave *slave)
-{
-
-}
diff --git a/drivers/spi/sh_spi.h b/drivers/spi/sh_spi.h
deleted file mode 100644 (file)
index 33a4630..0000000
+++ /dev/null
@@ -1,67 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0 */
-/*
- * SH SPI driver
- *
- * Copyright (C) 2011 Renesas Solutions Corp.
- */
-
-#ifndef __SH_SPI_H__
-#define __SH_SPI_H__
-
-#include <spi.h>
-
-struct sh_spi_regs {
-       unsigned long tbr_rbr;
-       unsigned long resv1;
-       unsigned long cr1;
-       unsigned long resv2;
-       unsigned long cr2;
-       unsigned long resv3;
-       unsigned long cr3;
-       unsigned long resv4;
-       unsigned long cr4;
-};
-
-/* CR1 */
-#define SH_SPI_TBE     0x80
-#define SH_SPI_TBF     0x40
-#define SH_SPI_RBE     0x20
-#define SH_SPI_RBF     0x10
-#define SH_SPI_PFONRD  0x08
-#define SH_SPI_SSDB    0x04
-#define SH_SPI_SSD     0x02
-#define SH_SPI_SSA     0x01
-
-/* CR2 */
-#define SH_SPI_RSTF    0x80
-#define SH_SPI_LOOPBK  0x40
-#define SH_SPI_CPOL    0x20
-#define SH_SPI_CPHA    0x10
-#define SH_SPI_L1M0    0x08
-
-/* CR3 */
-#define SH_SPI_MAX_BYTE        0xFF
-
-/* CR4 */
-#define SH_SPI_TBEI    0x80
-#define SH_SPI_TBFI    0x40
-#define SH_SPI_RBEI    0x20
-#define SH_SPI_RBFI    0x10
-#define SH_SPI_SSS1    0x08
-#define SH_SPI_WPABRT  0x04
-#define SH_SPI_SSS0    0x01
-
-#define SH_SPI_FIFO_SIZE       32
-#define SH_SPI_NUM_CS          4
-
-struct sh_spi {
-       struct spi_slave        slave;
-       struct sh_spi_regs      *regs;
-};
-
-static inline struct sh_spi *to_sh_spi(struct spi_slave *slave)
-{
-       return container_of(slave, struct sh_spi, slave);
-}
-
-#endif
index 928a89133cf89dd4f6ee31f22e8b31a6d9d567dd..756a4ec402e7ee1b3b0b369cee82bd51c310c807 100644 (file)
@@ -39,8 +39,8 @@ config DM_USB
        help
          Enable driver model for USB. The USB interface is then implemented
          by the USB uclass. Multiple USB controllers of different types
-         (XHCI, EHCI) can be attached and used. The 'usb' command works as
-         normal. OCHI is not supported at present.
+         (XHCI, EHCI, OHCI) can be attached and used. The 'usb' command works
+         as normal.
 
          Much of the code is shared but with this option enabled the USB
          uclass takes care of device enumeration. USB devices can be
index 9b264bd92ab9e11c8be04700153bdfdb7cd23cc0..a38cd25eb85fc0d24a13b07a58aeaac13232ce16 100644 (file)
@@ -11,6 +11,7 @@
  * e.g. PCI controllers need this
  */
 
+#include <asm/cache.h>
 #include <asm/io.h>
 
 #ifdef CONFIG_SYS_OHCI_SWAP_REG_ACCESS
index 23de5a3495b9a40227b41b2d1b4a2387bd077929..02ed846fc73d0ce892641aedaf708c530f3bd842 100644 (file)
--- a/env/sf.c
+++ b/env/sf.c
@@ -53,15 +53,14 @@ static int setup_flash_device(void)
 
        env_flash = dev_get_uclass_priv(new);
 #else
+       if (env_flash)
+               spi_flash_free(env_flash);
 
+       env_flash = spi_flash_probe(CONFIG_ENV_SPI_BUS, CONFIG_ENV_SPI_CS,
+                                   CONFIG_ENV_SPI_MAX_HZ, CONFIG_ENV_SPI_MODE);
        if (!env_flash) {
-               env_flash = spi_flash_probe(CONFIG_ENV_SPI_BUS,
-                       CONFIG_ENV_SPI_CS,
-                       CONFIG_ENV_SPI_MAX_HZ, CONFIG_ENV_SPI_MODE);
-               if (!env_flash) {
-                       env_set_default("spi_flash_probe() failed", 0);
-                       return -EIO;
-               }
+               env_set_default("spi_flash_probe() failed", 0);
+               return -EIO;
        }
 #endif
        return 0;
index 20b6d60dd880b08e9376fe2cc9bd4e8d62672a85..6a107d52e073498e443e5adc17cdd9dd102ecd63 100644 (file)
@@ -2,6 +2,7 @@
 #ifndef _LINUX_DMA_MAPPING_H
 #define _LINUX_DMA_MAPPING_H
 
+#include <asm/cache.h>
 #include <linux/dma-direction.h>
 #include <linux/types.h>
 #include <asm/dma-mapping.h>
index 0b23f57a71b34f502f8801dcaa11d6f3158e2fd2..d9b2af856c08feb18adda8934452483800f83bb4 100644 (file)
@@ -34,19 +34,6 @@ struct dm_spi_flash_ops {
        int (*write)(struct udevice *dev, u32 offset, size_t len,
                     const void *buf);
        int (*erase)(struct udevice *dev, u32 offset, size_t len);
-       /**
-        * get_sw_write_prot() - Check state of software write-protect feature
-        *
-        * SPI flash chips can lock a region of the flash defined by a
-        * 'protected area'. This function checks if this protected area is
-        * defined.
-        *
-        * @dev:        SPI flash device
-        * @return 0 if no region is write-protected, 1 if a region is
-        *      write-protected, -ENOSYS if the driver does not implement this,
-        *      other -ve value on error
-        */
-       int (*get_sw_write_prot)(struct udevice *dev);
 };
 
 /* Access the serial operations for a device */
@@ -88,20 +75,6 @@ int spi_flash_write_dm(struct udevice *dev, u32 offset, size_t len,
  */
 int spi_flash_erase_dm(struct udevice *dev, u32 offset, size_t len);
 
-/**
- * spl_flash_get_sw_write_prot() - Check state of software write-protect feature
- *
- * SPI flash chips can lock a region of the flash defined by a
- * 'protected area'. This function checks if this protected area is
- * defined.
- *
- * @dev:       SPI flash device
- * @return 0 if no region is write-protected, 1 if a region is
- *     write-protected, -ENOSYS if the driver does not implement this,
- *     other -ve value on error
- */
-int spl_flash_get_sw_write_prot(struct udevice *dev);
-
 /**
  * spi_flash_std_probe() - Probe a SPI flash device
  *
index f18bf3778b9eae882b1703fff0912177663efb92..af5c38afd98b29a05024a7108369fcc1f27ce362 100644 (file)
@@ -162,7 +162,7 @@ config LIB_RAND
        bool "Pseudo-random library support"
 
 config LIB_HW_RAND
-       bool "HW Engine for random libray support"
+       bool "HW Engine for random library support"
 
 endchoice
 
@@ -448,7 +448,7 @@ config ZSTD
 config SPL_LZ4
        bool "Enable LZ4 decompression support in SPL"
        help
-         This enables support for tge LZ4 decompression algorithm in SPL. LZ4
+         This enables support for the LZ4 decompression algorithm in SPL. LZ4
          is a lossless data compression algorithm that is focused on
          fast compression and decompression speed. It belongs to the LZ77
          family of byte-oriented compression schemes.
@@ -456,7 +456,7 @@ config SPL_LZ4
 config SPL_LZMA
        bool "Enable LZMA decompression support for SPL build"
        help
-         This enables support for LZMA compression altorithm for SPL boot.
+         This enables support for LZMA compression algorithm for SPL boot.
 
 config SPL_LZO
        bool "Enable LZO decompression support in SPL"
index 55b8d1545fc59c1328a70bdf2f8a1e5098581265..9e7dead684d34a0158aa3b0fde522fb389b8866a 100644 (file)
@@ -20,7 +20,7 @@
 /* Simple test of sandbox SPI flash */
 static int dm_test_spi_flash(struct unit_test_state *uts)
 {
-       struct udevice *dev, *emul;
+       struct udevice *dev;
        int full_size = 0x200000;
        int size = 0x10000;
        u8 *src, *dst;
@@ -50,14 +50,6 @@ static int dm_test_spi_flash(struct unit_test_state *uts)
        ut_assertok(spi_flash_read_dm(dev, 0, size, dst));
        ut_asserteq_mem(src, dst, size);
 
-       /* Try the write-protect stuff */
-       ut_assertok(uclass_first_device_err(UCLASS_SPI_EMUL, &emul));
-       ut_asserteq(0, spl_flash_get_sw_write_prot(dev));
-       sandbox_sf_set_block_protect(emul, 1);
-       ut_asserteq(1, spl_flash_get_sw_write_prot(dev));
-       sandbox_sf_set_block_protect(emul, 0);
-       ut_asserteq(0, spl_flash_get_sw_write_prot(dev));
-
        /* Check mapping */
        ut_assertok(dm_spi_get_mmap(dev, &map_base, &map_size, &offset));
        ut_asserteq(0x1000, map_base);
index e3392ff6bc4eec691f643555394bea9cac0078db..30920474b3627e9845a09c02d01cfa1491f44113 100644 (file)
@@ -156,7 +156,7 @@ def pytest_configure(config):
                 o_opt = ''
             cmds = (
                 ['make', o_opt, '-s', board_type + '_defconfig'],
-                ['make', o_opt, '-s', '-j8'],
+                ['make', o_opt, '-s', '-j{}'.format(os.cpu_count())],
             )
             name = 'make'
 
index 8734663cd4c770f4a393b23601b78b78084f1e7d..c6378ecf34f696aac6fa0f3c4cf61d7d5e6656de 100644 (file)
@@ -946,11 +946,17 @@ static int flash_read_buf(int dev, int fd, void *buf, size_t count,
                lseek(fd, blockstart + block_seek, SEEK_SET);
 
                rc = read(fd, buf + processed, readlen);
-               if (rc != readlen) {
+               if (rc == -1) {
                        fprintf(stderr, "Read error on %s: %s\n",
                                DEVNAME(dev), strerror(errno));
                        return -1;
                }
+               if (rc != readlen) {
+                       fprintf(stderr, "Read error on %s: "
+                               "Attempted to read %d bytes but got %d\n",
+                               DEVNAME(dev), readlen, rc);
+                       return -1;
+               }
 #ifdef DEBUG
                fprintf(stderr, "Read 0x%x bytes at 0x%llx on %s\n",
                        rc, (unsigned long long)blockstart + block_seek,
index 88ff093d05bed6f5da152dbbad8428eec219e4d7..a082d9386d200d095753eae45fec826b1a718269 100644 (file)
@@ -111,7 +111,7 @@ static int fit_calc_size(struct image_tool_params *params)
                if (size < 0)
                        return -1;
 
-               /* Add space for properties */
+               /* Add space for properties and hash node */
                total_size += size + 300;
        }
 
@@ -192,6 +192,18 @@ static void get_basename(char *str, int size, const char *fname)
        str[len] = '\0';
 }
 
+/**
+ * add_crc_node() - Add a hash node to request a CRC checksum for an image
+ *
+ * @fdt: Device tree to add to (in sequential-write mode)
+ */
+static void add_crc_node(void *fdt)
+{
+       fdt_begin_node(fdt, "hash-1");
+       fdt_property_string(fdt, FIT_ALGO_PROP, "crc32");
+       fdt_end_node(fdt);
+}
+
 /**
  * fit_write_images() - Write out a list of images to the FIT
  *
@@ -230,6 +242,7 @@ static int fit_write_images(struct image_tool_params *params, char *fdt)
        ret = fdt_property_file(params, fdt, FIT_DATA_PROP, params->datafile);
        if (ret)
                return ret;
+       add_crc_node(fdt);
        fdt_end_node(fdt);
 
        /* Now the device tree files if available */
@@ -252,6 +265,7 @@ static int fit_write_images(struct image_tool_params *params, char *fdt)
                                    genimg_get_arch_short_name(params->arch));
                fdt_property_string(fdt, FIT_COMP_PROP,
                                    genimg_get_comp_short_name(IH_COMP_NONE));
+               add_crc_node(fdt);
                fdt_end_node(fdt);
        }
 
@@ -269,7 +283,7 @@ static int fit_write_images(struct image_tool_params *params, char *fdt)
                                        params->fit_ramdisk);
                if (ret)
                        return ret;
-
+               add_crc_node(fdt);
                fdt_end_node(fdt);
        }