Merge branch 'master' of git://git.denx.de/u-boot-spi
authorTom Rini <trini@konsulko.com>
Tue, 2 Oct 2018 17:02:22 +0000 (13:02 -0400)
committerTom Rini <trini@konsulko.com>
Tue, 2 Oct 2018 21:01:46 +0000 (17:01 -0400)
This is the PR for SPI-NAND changes along with few spi changes.

[trini: Re-sync changes for ls1012afrwy_qspi*_defconfig]
Signed-off-by: Tom Rini <trini@konsulko.com>
12 files changed:
1  2 
MAINTAINERS
Makefile
README
cmd/Kconfig
cmd/Makefile
cmd/ubi.c
common/spl/spl_spi.c
configs/ls1012afrwy_qspi_SECURE_BOOT_defconfig
configs/ls1012afrwy_qspi_defconfig
drivers/Makefile
drivers/spi/Kconfig
drivers/spi/Makefile

diff --combined MAINTAINERS
index 6147a4ffafaa42753713ff8eb09825e1036acc06,20a0a5e12bc9395153456e3f24f75f0e8e93bb63..b6d84bc98d31714f1ca1473ef657202a858940af
@@@ -210,7 -210,6 +210,7 @@@ S: Maintaine
  F:    arch/arm/mach-snapdragon/
  F:    drivers/gpio/msm_gpio.c
  F:    drivers/mmc/msm_sdhci.c
 +F:    drivers/phy/msm8916-usbh-phy.c
  F:    drivers/serial/serial_msm.c
  F:    drivers/smem/msm_smem.c
  F:    drivers/usb/host/ehci-msm.c
@@@ -299,7 -298,7 +299,7 @@@ F: drivers/i2c/i2c-cdns.
  F:    drivers/i2c/muxes/pca954x.c
  F:    drivers/i2c/zynq_i2c.c
  F:    drivers/mmc/zynq_sdhci.c
- F:    drivers/mtd/nand/zynq_nand.c
+ F:    drivers/mtd/nand/raw/zynq_nand.c
  F:    drivers/net/phy/xilinx_phy.c
  F:    drivers/net/zynq_gem.c
  F:    drivers/serial/serial_zynq.c
@@@ -323,7 -322,7 +323,7 @@@ F: drivers/i2c/i2c-cdns.
  F:    drivers/i2c/muxes/pca954x.c
  F:    drivers/i2c/zynq_i2c.c
  F:    drivers/mmc/zynq_sdhci.c
- F:    drivers/mtd/nand/zynq_nand.c
+ F:    drivers/mtd/nand/raw/zynq_nand.c
  F:    drivers/net/phy/xilinx_phy.c
  F:    drivers/net/zynq_gem.c
  F:    drivers/serial/serial_zynq.c
@@@ -384,16 -383,12 +384,16 @@@ T:      git git://github.com/agraf/u-boot.gi
  F:    doc/README.uefi
  F:    doc/README.iscsi
  F:    Documentation/efi.rst
 +F:    include/capitalization.h
 +F:    include/cp1250.h
 +F:    include/cp437.h
  F:    include/efi*
  F:    include/pe.h
  F:    include/asm-generic/pe.h
  F:    lib/charset.c
  F:    lib/efi*/
  F:    test/py/tests/test_efi*
 +F:    test/unicode_ut.c
  F:    cmd/bootefi.c
  F:    tools/file2include.c
  
@@@ -441,12 -436,6 +441,12 @@@ F:       cmd/log.
  F:    test/log/log_test.c
  F:    test/py/tests/test_log.py
  
 +MALI DISPLAY PROCESSORS
 +M:    Liviu Dudau <liviu.dudau@foss.arm.com>
 +S:    Supported
 +T:    git git://github.com/ARM-software/u-boot.git
 +F:    drivers/video/mali_dp.c
 +
  MICROBLAZE
  M:    Michal Simek <monstr@monstr.eu>
  S:    Maintained
@@@ -478,7 -467,7 +478,7 @@@ NAND FLAS
  #M:   Scott Wood <oss@buserror.net>
  S:    Orphaned (Since 2018-07)
  T:    git git://git.denx.de/u-boot-nand-flash.git
- F:    drivers/mtd/nand/
+ F:    drivers/mtd/nand/raw/
  
  NDS32
  M:    Macpaul Lin <macpaul@andestech.com>
@@@ -596,11 -585,6 +596,11 @@@ S:       Maintaine
  F:    drivers/spmi/
  F:    include/spmi/
  
 +TDA19988 HDMI ENCODER
 +M:    Liviu Dudau <liviu.dudau@foss.arm.com>
 +S:    Maintained
 +F:    drivers/video/tda19988.c
 +
  TI SYSTEM SECURITY
  M:    Andrew F. Davis <afd@ti.com>
  S:    Supported
@@@ -648,7 -632,6 +648,7 @@@ T: git git://git.denx.de/u-boot-video.g
  F:    drivers/video/
  F:    common/lcd*.c
  F:    include/lcd*.h
 +F:    include/video*.h
  
  X86
  M:    Simon Glass <sjg@chromium.org>
diff --combined Makefile
index 7b5e06a63f30438dea9134b85432eb874359767c,807e803f996dcc53d87e60735833e5c95d2211b4..73a080c2fb92e82b7f14a9bddc137b33fd5850ac
+++ b/Makefile
@@@ -1,9 -1,9 +1,9 @@@
  # SPDX-License-Identifier: GPL-2.0+
  
  VERSION = 2018
 -PATCHLEVEL = 09
 +PATCHLEVEL = 11
  SUBLEVEL =
 -EXTRAVERSION =
 +EXTRAVERSION = -rc1
  NAME =
  
  # *DOCUMENTATION*
@@@ -372,7 -372,7 +372,7 @@@ KBUILD_CPPFLAGS := -D__KERNEL__ -D__UBO
  KBUILD_CFLAGS   := -Wall -Wstrict-prototypes \
                   -Wno-format-security \
                   -fno-builtin -ffreestanding $(CSTD_FLAG)
 -KBUILD_CFLAGS += -fshort-wchar
 +KBUILD_CFLAGS += -fshort-wchar -fno-strict-aliasing
  KBUILD_AFLAGS   := -D__ASSEMBLY__
  
  # Don't generate position independent code
@@@ -689,7 -689,7 +689,7 @@@ libs-y += drivers/dma
  libs-y += drivers/gpio/
  libs-y += drivers/i2c/
  libs-y += drivers/mtd/
- libs-$(CONFIG_CMD_NAND) += drivers/mtd/nand/
+ libs-$(CONFIG_CMD_NAND) += drivers/mtd/nand/raw/
  libs-y += drivers/mtd/onenand/
  libs-$(CONFIG_CMD_UBI) += drivers/mtd/ubi/
  libs-y += drivers/mtd/spi/
@@@ -861,10 -861,6 +861,10 @@@ ifneq ($(CONFIG_SYS_INIT_SP_BSS_OFFSET)
  ALL-y += init_sp_bss_offset_check
  endif
  
 +ifeq ($(CONFIG_MPC85xx)$(CONFIG_OF_SEPARATE),yy)
 +ALL-y += u-boot-with-dtb.bin
 +endif
 +
  LDFLAGS_u-boot += $(LDFLAGS_FINAL)
  
  # Avoid 'Not enough room for program headers' error on binutils 2.28 onwards.
@@@ -987,8 -983,7 +987,8 @@@ spl/u-boot-spl.srec: spl/u-boot-spl FOR
        $(call if_changed,objcopy)
  
  OBJCOPYFLAGS_u-boot-nodtb.bin := -O binary \
 -              $(if $(CONFIG_X86_16BIT_INIT),-R .start16 -R .resetvec)
 +              $(if $(CONFIG_X86_16BIT_INIT),-R .start16 -R .resetvec) \
 +              $(if $(CONFIG_MPC85XX_HAVE_RESET_VECTOR),-R .bootpg -R .resetvec)
  
  OBJCOPYFLAGS_u-boot-spl.hex = $(OBJCOPYFLAGS_u-boot.hex)
  
@@@ -1212,18 -1207,6 +1212,18 @@@ u-boot-with-spl.sfp: spl/u-boot-spl.sf
        $(call if_changed,socboot)
  endif
  
 +ifeq ($(CONFIG_MPC85xx)$(CONFIG_OF_SEPARATE),yy)
 +u-boot-with-dtb.bin: u-boot.bin u-boot.dtb \
 +      $(if $(CONFIG_MPC85XX_HAVE_RESET_VECTOR), u-boot-br.bin) FORCE
 +      $(call if_changed,binman)
 +
 +ifeq ($(CONFIG_MPC85XX_HAVE_RESET_VECTOR),y)
 +OBJCOPYFLAGS_u-boot-br.bin := -O binary -j .bootpg -j .resetvec
 +u-boot-br.bin: u-boot FORCE
 +      $(call if_changed,objcopy)
 +endif
 +endif
 +
  # x86 uses a large ROM. We fill it with 0xff, put the 16-bit stuff (including
  # reset vector) at the top, Intel ME descriptor at the bottom, and U-Boot in
  # the middle. This is handled by binman based on an image description in the
@@@ -1318,12 -1301,8 +1318,12 @@@ spl/u-boot-spl.pbl: spl/u-boot-spl.bin 
  ifeq ($(ARCH),arm)
  UBOOT_BINLOAD := u-boot.img
  else
 +ifeq ($(CONFIG_MPC85xx)$(CONFIG_OF_SEPARATE),yy)
 +UBOOT_BINLOAD := u-boot-with-dtb.bin
 +else
  UBOOT_BINLOAD := u-boot.bin
  endif
 +endif
  
  OBJCOPYFLAGS_u-boot-with-spl-pbl.bin = -I binary -O binary --pad-to=$(CONFIG_SPL_PAD_TO) \
                          --gap-fill=0xff
diff --combined README
index f7ed7eaae16c8460625a6b38727dfab3db7fdb9e,35305a61a3aa314d2871075c32c65927afb9dfa5..a46c7c63a4fed72b16cfbaeb2620e9c1e196b396
--- 1/README
--- 2/README
+++ b/README
@@@ -528,6 -528,25 +528,6 @@@ The following options need to be config
                pointer. This is needed for the temporary stack before
                relocation.
  
 -              CONFIG_SYS_MIPS_CACHE_MODE
 -
 -              Cache operation mode for the MIPS CPU.
 -              See also arch/mips/include/asm/mipsregs.h.
 -              Possible values are:
 -                      CONF_CM_CACHABLE_NO_WA
 -                      CONF_CM_CACHABLE_WA
 -                      CONF_CM_UNCACHED
 -                      CONF_CM_CACHABLE_NONCOHERENT
 -                      CONF_CM_CACHABLE_CE
 -                      CONF_CM_CACHABLE_COW
 -                      CONF_CM_CACHABLE_CUW
 -                      CONF_CM_CACHABLE_ACCELERATED
 -
 -              CONFIG_SYS_XWAY_EBU_BOOTCFG
 -
 -              Special option for Lantiq XWAY SoCs for booting from NOR flash.
 -              See also arch/mips/cpu/mips32/start.S.
 -
                CONFIG_XWAY_SWAP_BYTES
  
                Enable compilation of tools/xway-swap-bytes needed for Lantiq
@@@ -3237,8 -3256,8 +3237,8 @@@ Low Level (hardware related) configurat
                a 16 bit bus.
                Not all NAND drivers use this symbol.
                Example of drivers that use it:
-               - drivers/mtd/nand/ndfc.c
-               - drivers/mtd/nand/mxc_nand.c
+               - drivers/mtd/nand/raw/ndfc.c
+               - drivers/mtd/nand/raw/mxc_nand.c
  
  - CONFIG_SYS_NDFC_EBC0_CFG
                Sets the EBC0_CFG register for the NDFC. If not defined
  - CONFIG_SYS_NAND_NO_SUBPAGE_WRITE
                Option to disable subpage write in NAND driver
                driver that uses this:
-               drivers/mtd/nand/davinci_nand.c
+               drivers/mtd/nand/raw/davinci_nand.c
  
  Freescale QE/FMAN Firmware Support:
  -----------------------------------
diff --combined cmd/Kconfig
index d1f1dc04b4d2adac1650341ee3fc4e16645ac614,12d19fd675c962af06e90d9e12275beee5b33532..7ed3c9c3b30bd90424a3c43ebb18246bb283ff0d
@@@ -304,6 -304,11 +304,6 @@@ config CMD_XIM
        help
          Extract a part of a multi-image.
  
 -config CMD_POWEROFF
 -      bool "poweroff"
 -      help
 -        Poweroff/Shutdown the system
 -
  config CMD_SPL
        bool "spl export - Export boot information for Falcon boot"
        depends on SPL
@@@ -827,13 -832,6 +827,13 @@@ config CMD_I2
        help
          I2C support.
  
 +config CMD_W1
 +      depends on W1
 +      default y if W1
 +      bool "w1 - Support for Dallas 1-Wire protocol"
 +      help
 +        Dallas 1-wire protocol support
 +
  config CMD_LOADB
        bool "loadb"
        default y
@@@ -866,6 -864,12 +866,12 @@@ config CMD_MMC_SWRIT
          Enable support for the "mmc swrite" command to write Android sparse
          images to eMMC.
  
+ config CMD_MTD
+       bool "mtd"
+       select MTD_PARTITIONS
+       help
+         MTD commands support.
  config CMD_NAND
        bool "nand"
        default y if NAND_SUNXI
@@@ -915,14 -919,6 +921,14 @@@ config CMD_ONENAN
          and erasing blocks. It allso provides a way to show and change
          bad blocks, and test the device.
  
 +config CMD_OSD
 +      bool "osd"
 +      help
 +        Enable the 'osd' command which allows to query information from and
 +        write text data to a on-screen display (OSD) device; a virtual device
 +        associated with a display capable of displaying a text overlay on the
 +        display it's associated with..
 +
  config CMD_PART
        bool "part"
        select HAVE_BLOCK_DEVICE
@@@ -947,11 -943,6 +953,11 @@@ config CMD_PCMCI
          about 1990. These devices are typically removable memory or network
          cards using a standard 68-pin connector.
  
 +config CMD_POWEROFF
 +      bool "poweroff"
 +      help
 +        Poweroff/Shutdown the system
 +
  config CMD_READ
        bool "read - Read binary data from a partition"
        help
@@@ -1353,12 -1344,6 +1359,12 @@@ config CMD_CACH
        help
          Enable the "icache" and "dcache" commands
  
 +config CMD_CONITRACE
 +      bool "conitrace - trace console input codes"
 +      help
 +        Enable the 'conitrace' command which displays the codes received
 +        from the console input as hexadecimal numbers.
 +
  config CMD_DISPLAY
        bool "Enable the 'display' command, for character displays"
        help
@@@ -1714,18 -1699,22 +1720,22 @@@ config CMD_MTDPART
        bool "MTD partition support"
        select MTD_DEVICE if (CMD_NAND || NAND)
        help
-         MTD partition support
+         MTD partitioning tool support.
+         It is strongly encouraged to avoid using this command
+         anymore along with 'sf', 'nand', 'onenand'. One can still
+         declare the partitions in the mtdparts environment variable
+         but better use the MTD stack and the 'mtd' command instead.
  
  config MTDIDS_DEFAULT
        string "Default MTD IDs"
-       depends on CMD_MTDPARTS || CMD_NAND || CMD_FLASH
+       depends on CMD_MTD || CMD_MTDPARTS || CMD_NAND || CMD_FLASH
        help
          Defines a default MTD IDs list for use with MTD partitions in the
          Linux MTD command line partitions format.
  
  config MTDPARTS_DEFAULT
        string "Default MTD partition scheme"
-       depends on CMD_MTDPARTS || CMD_NAND || CMD_FLASH
+       depends on CMD_MTD || CMD_MTDPARTS || CMD_NAND || CMD_FLASH
        help
          Defines a default MTD partitioning scheme in the Linux MTD command
          line partitions format
@@@ -1855,6 -1844,8 +1865,8 @@@ config CMD_UB
          capabilities. Please, consult the MTD web site for more details
          (www.linux-mtd.infradead.org). Activate this option if you want
          to use U-Boot UBI commands.
+         It is also strongly encouraged to also enable CONFIG_MTD to get full
+         partition support.
  
  config CMD_UBIFS
        tristate "Enable UBIFS - Unsorted block images filesystem commands"
diff --combined cmd/Makefile
index 2c858f9500a91876f0f2ece830657dc2a6126c03,3ba65d4d936f068697f2a64cfe251e1c94ee04a5..d9cdaf6064b88e682f10bdbc68e576f2112815ff
@@@ -34,7 -34,6 +34,7 @@@ obj-$(CONFIG_CMD_CACHE) += cache.
  obj-$(CONFIG_CMD_CBFS) += cbfs.o
  obj-$(CONFIG_CMD_CLK) += clk.o
  obj-$(CONFIG_CMD_CONFIG) += config.o
 +obj-$(CONFIG_CMD_CONITRACE) += conitrace.o
  obj-$(CONFIG_CMD_CONSOLE) += console.o
  obj-$(CONFIG_CMD_CPU) += cpu.o
  obj-$(CONFIG_DATAFLASH_MMC_SELECT) += dataflash_mmc_mux.o
@@@ -93,11 -92,11 +93,12 @@@ obj-$(CONFIG_CMD_MISC) += misc.
  obj-$(CONFIG_CMD_MMC) += mmc.o
  obj-$(CONFIG_CMD_MMC_SPI) += mmc_spi.o
  obj-$(CONFIG_MP) += mp.o
+ obj-$(CONFIG_CMD_MTD) += mtd.o
  obj-$(CONFIG_CMD_MTDPARTS) += mtdparts.o
  obj-$(CONFIG_CMD_NAND) += nand.o
  obj-$(CONFIG_CMD_NET) += net.o
  obj-$(CONFIG_CMD_ONENAND) += onenand.o
 +obj-$(CONFIG_CMD_OSD) += osd.o
  obj-$(CONFIG_CMD_PART) += part.o
  ifdef CONFIG_PCI
  obj-$(CONFIG_CMD_PCI) += pci.o
@@@ -147,7 -146,6 +148,7 @@@ obj-$(CONFIG_CMD_THOR_DOWNLOAD) += thor
  obj-$(CONFIG_CMD_XIMG) += ximg.o
  obj-$(CONFIG_CMD_YAFFS2) += yaffs2.o
  obj-$(CONFIG_CMD_SPL) += spl.o
 +obj-$(CONFIG_CMD_W1) += w1.o
  obj-$(CONFIG_CMD_ZIP) += zip.o
  obj-$(CONFIG_CMD_ZFS) += zfs.o
  
diff --combined cmd/ubi.c
index 0fa7553072a3b591cd3b0203bcc1c6a4ba40ee15,bb8f97fc2815220ddfc99ba4ffc5e6e66fc5d0c4..767a4a4536407ab5cd47e15e1e89c0a7e9a19d79
+++ b/cmd/ubi.c
@@@ -15,6 -15,7 +15,7 @@@
  #include <command.h>
  #include <exports.h>
  #include <memalign.h>
+ #include <mtd.h>
  #include <nand.h>
  #include <onenand_uboot.h>
  #include <linux/mtd/mtd.h>
  #undef ubi_msg
  #define ubi_msg(fmt, ...) printf("UBI: " fmt "\n", ##__VA_ARGS__)
  
- #define DEV_TYPE_NONE         0
- #define DEV_TYPE_NAND         1
- #define DEV_TYPE_ONENAND      2
- #define DEV_TYPE_NOR          3
  /* Private own data */
  static struct ubi_device *ubi;
- static char buffer[80];
- static int ubi_initialized;
- struct selected_dev {
-       char part_name[80];
-       int selected;
-       int nr;
-       struct mtd_info *mtd_info;
- };
- static struct selected_dev ubi_dev;
  
  #ifdef CONFIG_CMD_UBIFS
 -int ubifs_is_mounted(void);
 -void cmd_ubifs_umount(void);
 +#include <ubifs_uboot.h>
  #endif
  
  static void display_volume_info(struct ubi_device *ubi)
@@@ -408,43 -394,24 +393,24 @@@ int ubi_volume_read(char *volume, char 
        return err;
  }
  
- static int ubi_dev_scan(struct mtd_info *info, char *ubidev,
-               const char *vid_header_offset)
+ static int ubi_dev_scan(struct mtd_info *info, const char *vid_header_offset)
  {
-       struct mtd_device *dev;
-       struct part_info *part;
-       struct mtd_partition mtd_part;
        char ubi_mtd_param_buffer[80];
-       u8 pnum;
        int err;
  
-       if (find_dev_and_part(ubidev, &dev, &pnum, &part) != 0)
-               return 1;
+       if (!vid_header_offset)
+               sprintf(ubi_mtd_param_buffer, "%s", info->name);
+       else
+               sprintf(ubi_mtd_param_buffer, "%s,%s", info->name,
+                       vid_header_offset);
  
-       sprintf(buffer, "mtd=%d", pnum);
-       memset(&mtd_part, 0, sizeof(mtd_part));
-       mtd_part.name = buffer;
-       mtd_part.size = part->size;
-       mtd_part.offset = part->offset;
-       add_mtd_partitions(info, &mtd_part, 1);
-       strcpy(ubi_mtd_param_buffer, buffer);
-       if (vid_header_offset)
-               sprintf(ubi_mtd_param_buffer, "mtd=%d,%s", pnum,
-                               vid_header_offset);
        err = ubi_mtd_param_parse(ubi_mtd_param_buffer, NULL);
-       if (err) {
-               del_mtd_partitions(info);
+       if (err)
                return -err;
-       }
  
        err = ubi_init();
-       if (err) {
-               del_mtd_partitions(info);
+       if (err)
                return -err;
-       }
-       ubi_initialized = 1;
  
        return 0;
  }
@@@ -469,50 -436,33 +435,33 @@@ int ubi_detach(void
        /*
         * Call ubi_exit() before re-initializing the UBI subsystem
         */
-       if (ubi_initialized) {
+       if (ubi)
                ubi_exit();
-               del_mtd_partitions(ubi_dev.mtd_info);
-               ubi_initialized = 0;
-       }
  
-       ubi_dev.selected = 0;
+       ubi = NULL;
        return 0;
  }
  
  int ubi_part(char *part_name, const char *vid_header_offset)
  {
+       struct mtd_info *mtd;
        int err = 0;
-       char mtd_dev[16];
-       struct mtd_device *dev;
-       struct part_info *part;
-       u8 pnum;
  
        ubi_detach();
-       /*
-        * Search the mtd device number where this partition
-        * is located
-        */
-       if (find_dev_and_part(part_name, &dev, &pnum, &part)) {
+       mtd_probe_devices();
+       mtd = get_mtd_device_nm(part_name);
+       if (IS_ERR(mtd)) {
                printf("Partition %s not found!\n", part_name);
                return 1;
        }
-       sprintf(mtd_dev, "%s%d", MTD_DEV_TYPE(dev->id->type), dev->id->num);
-       ubi_dev.mtd_info = get_mtd_device_nm(mtd_dev);
-       if (IS_ERR(ubi_dev.mtd_info)) {
-               printf("Partition %s not found on device %s!\n", part_name,
-                      mtd_dev);
-               return 1;
-       }
+       put_mtd_device(mtd);
  
-       ubi_dev.selected = 1;
-       strcpy(ubi_dev.part_name, part_name);
-       err = ubi_dev_scan(ubi_dev.mtd_info, ubi_dev.part_name,
-                       vid_header_offset);
+       err = ubi_dev_scan(mtd, vid_header_offset);
        if (err) {
                printf("UBI init error %d\n", err);
                printf("Please check, if the correct MTD partition is used (size big enough?)\n");
-               ubi_dev.selected = 0;
                return err;
        }
  
@@@ -543,13 -493,13 +492,13 @@@ static int do_ubi(cmd_tbl_t *cmdtp, in
  
                /* Print current partition */
                if (argc == 2) {
-                       if (!ubi_dev.selected) {
-                               printf("Error, no UBI device/partition selected!\n");
+                       if (!ubi) {
+                               printf("Error, no UBI device selected!\n");
                                return 1;
                        }
  
-                       printf("Device %d: %s, partition %s\n",
-                              ubi_dev.nr, ubi_dev.mtd_info->name, ubi_dev.part_name);
+                       printf("Device %d: %s, MTD partition %s\n",
+                              ubi->ubi_num, ubi->ubi_name, ubi->mtd->name);
                        return 0;
                }
  
                return ubi_part(argv[2], vid_header_offset);
        }
  
-       if ((strcmp(argv[1], "part") != 0) && (!ubi_dev.selected)) {
-               printf("Error, no UBI device/partition selected!\n");
+       if ((strcmp(argv[1], "part") != 0) && !ubi) {
+               printf("Error, no UBI device selected!\n");
                return 1;
        }
  
diff --combined common/spl/spl_spi.c
index e10cf0124fb74bcc888b5e016a16d67a14bb0a07,0016d497390595b5237a3b8af96f671f3da32689..ddc33fd3ce6fb19edb32dfa5a4f145e093961ecf
@@@ -2,7 -2,7 +2,7 @@@
  /*
   * Copyright (C) 2011 OMICRON electronics GmbH
   *
-  * based on drivers/mtd/nand/nand_spl_load.c
+  * based on drivers/mtd/nand/raw/nand_spl_load.c
   *
   * Copyright (C) 2011
   * Heiko Schocher, DENX Software Engineering, hs@denx.de.
@@@ -88,7 -88,8 +88,7 @@@ static int spl_spi_load_image(struct sp
                return -ENODEV;
        }
  
 -      /* use CONFIG_SYS_TEXT_BASE as temporary storage area */
 -      header = (struct image_header *)(CONFIG_SYS_TEXT_BASE);
 +      header = spl_get_load_buffer(-sizeof(*header), 0x40);
  
  #if CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA)
        payload_offs = fdtdec_get_config_int(gd->fdt_blob,
index e8744aa78f69bf1e5f3eee11f4dc723344910c86,e8744aa78f69bf1e5f3eee11f4dc723344910c86..d457d9420b59007ad35a161f55739d1610fb5a46
@@@ -30,6 -30,6 +30,7 @@@ CONFIG_NET_RANDOM_ETHADDR=
  CONFIG_DM=y
  # CONFIG_BLK is not set
  CONFIG_DM_MMC=y
++CONFIG_DM_SPI_FLASH=y
  CONFIG_SPI_FLASH=y
  CONFIG_SPI_FLASH_WINBOND=y
  CONFIG_FSL_PFE=y
@@@ -40,6 -40,6 +41,8 @@@ CONFIG_DM_PCI=
  CONFIG_DM_PCI_COMPAT=y
  CONFIG_PCIE_LAYERSCAPE=y
  CONFIG_SYS_NS16550=y
++CONFIG_SPI=y
++CONFIG_DM_SPI=y
  CONFIG_USB=y
  CONFIG_DM_USB=y
  CONFIG_USB_XHCI_HCD=y
index f2cdcaef5b60efa711faec4e5dbdda3046966d6f,f2cdcaef5b60efa711faec4e5dbdda3046966d6f..7fe9556d047e06ebce4fe1cc0a48384ba2ba0c68
@@@ -31,6 -31,6 +31,7 @@@ CONFIG_NET_RANDOM_ETHADDR=
  CONFIG_DM=y
  # CONFIG_BLK is not set
  CONFIG_DM_MMC=y
++CONFIG_DM_SPI_FLASH=y
  CONFIG_SPI_FLASH=y
  CONFIG_SPI_FLASH_WINBOND=y
  CONFIG_FSL_PFE=y
@@@ -41,6 -41,6 +42,8 @@@ CONFIG_DM_PCI=
  CONFIG_DM_PCI_COMPAT=y
  CONFIG_PCIE_LAYERSCAPE=y
  CONFIG_SYS_NS16550=y
++CONFIG_SPI=y
++CONFIG_DM_SPI=y
  CONFIG_USB=y
  CONFIG_DM_USB=y
  CONFIG_USB_XHCI_HCD=y
diff --combined drivers/Makefile
index 091b5e81190076f541bcb155ef4f361887aa2dc1,fe8d40dddb0106a29f595cc55875f3805816fe06..e3b9e8c635ebb31d852151340b0a50c5cdd9b5f1
@@@ -6,7 -6,7 +6,7 @@@ obj-$(CONFIG_$(SPL_TPL_)DRIVERS_MISC_SU
  obj-$(CONFIG_$(SPL_TPL_)I2C_SUPPORT) += i2c/
  obj-$(CONFIG_$(SPL_TPL_)LED) += led/
  obj-$(CONFIG_$(SPL_TPL_)MMC_SUPPORT) += mmc/
- obj-$(CONFIG_$(SPL_TPL_)NAND_SUPPORT) += mtd/nand/
+ obj-$(CONFIG_$(SPL_TPL_)NAND_SUPPORT) += mtd/nand/raw/
  obj-$(CONFIG_$(SPL_TPL_)PHY) += phy/
  obj-$(CONFIG_$(SPL_TPL_)PINCTRL) += pinctrl/
  obj-$(CONFIG_$(SPL_TPL_)RAM) += ram/
@@@ -71,7 -71,6 +71,7 @@@ obj-y += ata
  obj-$(CONFIG_DM_DEMO) += demo/
  obj-$(CONFIG_BIOSEMU) += bios_emulator/
  obj-y += block/
 +obj-y += board/
  obj-$(CONFIG_BOOTCOUNT_LIMIT) += bootcount/
  obj-$(CONFIG_CPU) += cpu/
  obj-y += crypto/
@@@ -106,8 -105,6 +106,8 @@@ obj-y += smem
  obj-y += soc/
  obj-y += thermal/
  obj-y += axi/
 +obj-$(CONFIG_W1) += w1/
 +obj-$(CONFIG_W1_EEPROM) += w1-eeprom/
  
  obj-$(CONFIG_MACH_PIC32) += ddr/microchip/
  endif
diff --combined drivers/spi/Kconfig
index 7d4d47da4b5a95777ee9f133cdc044613f662c9f,9fbd26740d33dd816a33fad64e6506ce8388b8de..196767a3f6c04383056a60b6c2940a338066e135
@@@ -18,6 -18,13 +18,13 @@@ config DM_SP
  
  if DM_SPI
  
+ config SPI_MEM
+       bool "SPI memory extension"
+       help
+         Enable this option if you want to enable the SPI memory extension.
+         This extension is meant to simplify interaction with SPI memories
+         by providing an high-level interface to send memory-like commands.
  config ALTERA_SPI
        bool "Altera SPI driver"
        help
@@@ -125,14 -132,6 +132,14 @@@ config PIC32_SP
          to access the SPI NOR flash, MMC-over-SPI on platforms based on
          Microchip PIC32 family devices.
  
 +config PL022_SPI
 +      bool "ARM AMBA PL022 SSP controller driver"
 +      depends on ARM
 +      help
 +        This selects the ARM(R) AMBA(R) PrimeCell PL022 SSP
 +        controller. If you have an embedded system with an AMBA(R)
 +        bus and a PL022 controller, say Y or M here.
 +
  config RENESAS_RPC_SPI
        bool "Renesas RPC SPI driver"
        depends on RCAR_GEN3
diff --combined drivers/spi/Makefile
index 6679987cad6745beb6b78e8f435cd384162e09ca,bdb5b5a02fd5585c6152df669055765087849dc4..ee995087662cf86e2c663729b16fb19c773d7322
@@@ -8,6 -8,7 +8,7 @@@ ifdef CONFIG_DM_SP
  obj-y += spi-uclass.o
  obj-$(CONFIG_SANDBOX) += spi-emul-uclass.o
  obj-$(CONFIG_SOFT_SPI) += soft_spi.o
+ obj-$(CONFIG_SPI_MEM) += spi-mem.o
  else
  obj-y += spi.o
  obj-$(CONFIG_SOFT_SPI) += soft_spi_legacy.o
@@@ -38,7 -39,6 +39,7 @@@ obj-$(CONFIG_MXS_SPI) += mxs_spi.
  obj-$(CONFIG_ATCSPI200_SPI) += atcspi200_spi.o
  obj-$(CONFIG_OMAP3_SPI) += omap3_spi.o
  obj-$(CONFIG_PIC32_SPI) += pic32_spi.o
 +obj-$(CONFIG_PL022_SPI) += pl022_spi.o
  obj-$(CONFIG_RENESAS_RPC_SPI) += renesas_rpc_spi.o
  obj-$(CONFIG_ROCKCHIP_SPI) += rk_spi.o
  obj-$(CONFIG_SANDBOX_SPI) += sandbox_spi.o