Merge branch 'master' of git://git.denx.de/u-boot-i2c
diff --git a/Makefile b/Makefile
index 0d11ff9..5683714 100644
--- a/Makefile
+++ b/Makefile
@@ -695,7 +695,6 @@
 libs-y += drivers/mtd/spi/
 libs-y += drivers/net/
 libs-y += drivers/net/phy/
-libs-y += drivers/pci/
 libs-y += drivers/power/ \
 	drivers/power/domain/ \
 	drivers/power/fuel_gauge/ \
@@ -948,6 +947,14 @@
 	@echo "See doc/driver-model/MIGRATION.txt for more info."
 	@echo "===================================================="
 endif
+ifeq ($(CONFIG_OF_EMBED),y)
+	@echo "===================== WARNING ======================"
+	@echo "CONFIG_OF_EMBED is enabled. This option should only"
+	@echo "be used for debugging purposes. Please use"
+	@echo "CONFIG_OF_SEPARATE for boards in mainline."
+	@echo "See doc/README.fdt-control for more info."
+	@echo "===================================================="
+endif
 	@# Check that this build does not use CONFIG options that we do not
 	@# know about unless they are in Kconfig. All the existing CONFIG
 	@# options are whitelisted, so new ones should not be added.
diff --git a/arch/arm/mach-omap2/am33xx/Kconfig b/arch/arm/mach-omap2/am33xx/Kconfig
index 3529607..57284c4 100644
--- a/arch/arm/mach-omap2/am33xx/Kconfig
+++ b/arch/arm/mach-omap2/am33xx/Kconfig
@@ -206,6 +206,7 @@
 	bool "Support PDU001"
 	select DM
 	select DM_SERIAL
+	imply SPL_SEPARATE_BSS
 	imply CMD_DM
 	help
 	  Support for PDU001 platform developed by EETS GmbH.
diff --git a/board/davinci/da8xxevm/MAINTAINERS b/board/davinci/da8xxevm/MAINTAINERS
index 5958986..b77a5f6 100644
--- a/board/davinci/da8xxevm/MAINTAINERS
+++ b/board/davinci/da8xxevm/MAINTAINERS
@@ -1,13 +1,16 @@
-DA850_AM18XXEVM BOARD
+DA850_EVM BOARD
 M:	Adam Ford <aford173@gmail.com>
 S:	Maintained
 F:	board/davinci/da8xxevm/
 F:	include/configs/da850evm.h
-F:	configs/da850_am18xxevm_defconfig
 F:	configs/da850evm_defconfig
 F:	configs/da850evm_nand_defconfig
 F:	configs/da850evm_direct_nor_defconfig
 
+AM18XXEVM BOARD
+S:	Orphan
+F:	configs/da850_am18xxevm_defconfig
+
 OMAPL138_LCDK BOARD
 M:	Peter Howard <phoward@gme.net.au>
 S:	Maintained
diff --git a/board/logicpd/omap3som/omap3logic.c b/board/logicpd/omap3som/omap3logic.c
index 691d38f..144e6f6 100644
--- a/board/logicpd/omap3som/omap3logic.c
+++ b/board/logicpd/omap3som/omap3logic.c
@@ -164,61 +164,6 @@
 }
 #endif
 
-#if !CONFIG_IS_ENABLED(DM_USB)
-#ifdef CONFIG_USB_MUSB_OMAP2PLUS
-static struct musb_hdrc_config musb_config = {
-	.multipoint     = 1,
-	.dyn_fifo       = 1,
-	.num_eps        = 16,
-	.ram_bits       = 12,
-};
-
-static struct omap_musb_board_data musb_board_data = {
-	.interface_type	= MUSB_INTERFACE_ULPI,
-};
-
-static struct musb_hdrc_platform_data musb_plat = {
-#if defined(CONFIG_USB_MUSB_HOST)
-	.mode           = MUSB_HOST,
-#elif defined(CONFIG_USB_MUSB_GADGET)
-	.mode		= MUSB_PERIPHERAL,
-#else
-#error "Please define either CONFIG_USB_MUSB_HOST or CONFIG_USB_MUSB_GADGET"
-#endif
-	.config         = &musb_config,
-	.power          = 100,
-	.platform_ops	= &omap2430_ops,
-	.board_data	= &musb_board_data,
-};
-#endif
-
-#if defined(CONFIG_USB_EHCI_HCD) && !defined(CONFIG_SPL_BUILD)
-/* Call usb_stop() before starting the kernel */
-void show_boot_progress(int val)
-{
-	if (val == BOOTSTAGE_ID_RUN_OS)
-		usb_stop();
-}
-
-static struct omap_usbhs_board_data usbhs_bdata = {
-	.port_mode[0] = OMAP_EHCI_PORT_MODE_PHY,
-	.port_mode[1] = OMAP_EHCI_PORT_MODE_PHY,
-	.port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED
-};
-
-int ehci_hcd_init(int index, enum usb_init_type init,
-		struct ehci_hccr **hccr, struct ehci_hcor **hcor)
-{
-	return omap_ehci_hcd_init(index, &usbhs_bdata, hccr, hcor);
-}
-
-int ehci_hcd_stop(int index)
-{
-	return omap_ehci_hcd_stop();
-}
-
-#endif /* CONFIG_USB_EHCI_HCD */
-#endif /* !DM_USB*/
 /*
  * Routine: misc_init_r
  * Description: Configure board specific parts
@@ -227,12 +172,6 @@
 {
 	twl4030_power_init();
 	omap_die_id_display();
-
-#if !CONFIG_IS_ENABLED(DM_USB)
-#ifdef CONFIG_USB_MUSB_OMAP2PLUS
-	musb_register(&musb_plat, &musb_board_data, (void *)MUSB_BASE);
-#endif
-#endif
 	return 0;
 }
 
diff --git a/common/spl/Kconfig b/common/spl/Kconfig
index 0ddbffc..953841e 100644
--- a/common/spl/Kconfig
+++ b/common/spl/Kconfig
@@ -449,6 +449,7 @@
 
 config SPL_LIBDISK_SUPPORT
 	bool "Support disk partitions"
+	select PARTITIONS
 	help
 	  Enable support for disk partitions within SPL. 'Disk' is something
 	  of a misnomer as it includes non-spinning media such as flash (as
@@ -480,6 +481,7 @@
 config SPL_MMC_SUPPORT
 	bool "Support MMC"
 	depends on MMC
+	select HAVE_BLOCK_DEVICE
 	help
 	  Enable support for MMC (Multimedia Card) within SPL. This enables
 	  the MMC protocol implementation and allows any enabled drivers to
@@ -610,7 +612,7 @@
 	  TPL, tpl/u-boot-with-tpl.bin. For new boards, suggest to
 	  use u-boot.img.
 
-config SPL_PCI_SUPPORT
+config SPL_PCI
 	bool "Support PCI drivers"
 	help
 	  Enable support for PCI in SPL. For platforms that need PCI to boot,
@@ -754,6 +756,7 @@
 
 config SPL_USB_HOST_SUPPORT
 	bool "Support USB host drivers"
+	select HAVE_BLOCK_DEVICE
 	help
 	  Enable access to USB (Universal Serial Bus) host devices so that
 	  SPL can load U-Boot from a connected USB peripheral, such as a USB
@@ -1023,7 +1026,7 @@
 	help
 	  Enable support for NAND in TPL. See SPL_NAND_SUPPORT for details.
 
-config TPL_PCI_SUPPORT
+config TPL_PCI
 	bool "Support PCI drivers"
 	help
 	  Enable support for PCI in TPL. For platforms that need PCI to boot,
diff --git a/configs/am335x_hs_evm_defconfig b/configs/am335x_hs_evm_defconfig
index aa6e966..1a7c5cf 100644
--- a/configs/am335x_hs_evm_defconfig
+++ b/configs/am335x_hs_evm_defconfig
@@ -1,6 +1,4 @@
 CONFIG_ARM=y
-# CONFIG_SPL_USE_ARCH_MEMCPY is not set
-# CONFIG_SPL_USE_ARCH_MEMSET is not set
 CONFIG_ARCH_OMAP2PLUS=y
 CONFIG_TI_SECURE_DEVICE=y
 CONFIG_TI_COMMON_CMD_OPTIONS=y
@@ -8,10 +6,11 @@
 CONFIG_ISW_ENTRY_ADDR=0x40300350
 CONFIG_SPL=y
 CONFIG_DISTRO_DEFAULTS=y
-CONFIG_ANDROID_BOOT_IMAGE=y
 CONFIG_FIT_IMAGE_POST_PROCESS=y
 CONFIG_SPL_LOAD_FIT=y
 CONFIG_SPL_FIT_IMAGE_POST_PROCESS=y
+CONFIG_OF_BOARD_SETUP=y
+CONFIG_BOOTCOMMAND="if test ${boot_fit} -eq 1; then run update_to_fit; fi; run findfdt; run init_console; run envboot; run distro_bootcmd"
 CONFIG_LOGLEVEL=3
 CONFIG_SYS_CONSOLE_INFO_QUIET=y
 CONFIG_VERSION_VARIABLE=y
@@ -47,9 +46,9 @@
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_WINBOND=y
 CONFIG_DM_ETH=y
-CONFIG_DRIVER_TI_CPSW=y
 CONFIG_PHY_GIGE=y
 CONFIG_MII=y
+CONFIG_DRIVER_TI_CPSW=y
 CONFIG_SPI=y
 CONFIG_OMAP3_SPI=y
 CONFIG_TIMER=y
@@ -60,7 +59,6 @@
 CONFIG_USB_MUSB_GADGET=y
 CONFIG_USB_MUSB_TI=y
 CONFIG_USB_MUSB_DSPS=y
-CONFIG_USB_STORAGE=y
 CONFIG_USB_GADGET=y
 CONFIG_USB_GADGET_MANUFACTURER="Texas Instruments"
 CONFIG_USB_GADGET_VENDOR_NUM=0x0451
diff --git a/configs/am335x_hs_evm_uart_defconfig b/configs/am335x_hs_evm_uart_defconfig
index 419b41c..147da80 100644
--- a/configs/am335x_hs_evm_uart_defconfig
+++ b/configs/am335x_hs_evm_uart_defconfig
@@ -12,9 +12,13 @@
 CONFIG_FIT_IMAGE_POST_PROCESS=y
 CONFIG_SPL_LOAD_FIT=y
 CONFIG_SPL_FIT_IMAGE_POST_PROCESS=y
+CONFIG_OF_BOARD_SETUP=y
+CONFIG_BOOTCOMMAND="if test ${boot_fit} -eq 1; then run update_to_fit; fi; run findfdt; run init_console; run envboot; run distro_bootcmd"
+CONFIG_LOGLEVEL=3
 CONFIG_SYS_CONSOLE_INFO_QUIET=y
 CONFIG_VERSION_VARIABLE=y
 CONFIG_ARCH_MISC_INIT=y
+CONFIG_SPL_FIT_IMAGE_TINY=y
 # CONFIG_SPL_ENV_SUPPORT is not set
 # CONFIG_SPL_EXT_SUPPORT is not set
 CONFIG_SPL_MTD_SUPPORT=y
@@ -38,14 +42,15 @@
 CONFIG_DM_I2C=y
 CONFIG_MISC=y
 CONFIG_DM_MMC=y
+# CONFIG_MMC_HW_PARTITIONING is not set
 CONFIG_MMC_OMAP_HS=y
 CONFIG_NAND=y
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_WINBOND=y
 CONFIG_DM_ETH=y
-CONFIG_DRIVER_TI_CPSW=y
 CONFIG_PHY_GIGE=y
 CONFIG_MII=y
+CONFIG_DRIVER_TI_CPSW=y
 CONFIG_SPI=y
 CONFIG_OMAP3_SPI=y
 CONFIG_TIMER=y
@@ -56,8 +61,12 @@
 CONFIG_USB_MUSB_GADGET=y
 CONFIG_USB_MUSB_TI=y
 CONFIG_USB_MUSB_DSPS=y
-CONFIG_USB_STORAGE=y
 CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_MANUFACTURER="Texas Instruments"
+CONFIG_USB_GADGET_VENDOR_NUM=0x0451
+CONFIG_USB_GADGET_PRODUCT_NUM=0xd022
 CONFIG_USB_GADGET_DOWNLOAD=y
+CONFIG_USB_ETHER=y
+CONFIG_SPL_TINY_MEMSET=y
 CONFIG_RSA=y
 CONFIG_LZO=y
diff --git a/configs/am335x_pdu001_defconfig b/configs/am335x_pdu001_defconfig
index dc8094e..b69cee0 100644
--- a/configs/am335x_pdu001_defconfig
+++ b/configs/am335x_pdu001_defconfig
@@ -32,7 +32,7 @@
 CONFIG_CMD_REGULATOR=y
 CONFIG_OF_CONTROL=y
 CONFIG_SPL_OF_CONTROL=y
-CONFIG_OF_EMBED=y
+CONFIG_OF_SEPARATE=y
 CONFIG_DEFAULT_DEVICE_TREE="am335x-pdu001"
 # CONFIG_NET is not set
 CONFIG_SPL_DM=y
diff --git a/configs/chromebook_link64_defconfig b/configs/chromebook_link64_defconfig
index 13b90a1..074d333 100644
--- a/configs/chromebook_link64_defconfig
+++ b/configs/chromebook_link64_defconfig
@@ -33,7 +33,7 @@
 CONFIG_SPL_ENV_SUPPORT=y
 CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_SPL_NET_SUPPORT=y
-CONFIG_SPL_PCI_SUPPORT=y
+CONFIG_SPL_PCI=y
 CONFIG_SPL_PCH_SUPPORT=y
 CONFIG_SPL_RTC_SUPPORT=y
 CONFIG_HUSH_PARSER=y
diff --git a/configs/evb-rk3036_defconfig b/configs/evb-rk3036_defconfig
index 787d6f9..439e691 100644
--- a/configs/evb-rk3036_defconfig
+++ b/configs/evb-rk3036_defconfig
@@ -32,6 +32,7 @@
 CONFIG_DEFAULT_DEVICE_TREE="rk3036-sdk"
 CONFIG_REGMAP=y
 CONFIG_SYSCON=y
+# CONFIG_SPL_BLK is not set
 CONFIG_CLK=y
 CONFIG_FASTBOOT_FLASH=y
 CONFIG_FASTBOOT_FLASH_MMC_DEV=0
diff --git a/configs/kylin-rk3036_defconfig b/configs/kylin-rk3036_defconfig
index eb305e0..7650030 100644
--- a/configs/kylin-rk3036_defconfig
+++ b/configs/kylin-rk3036_defconfig
@@ -30,6 +30,7 @@
 CONFIG_ENV_IS_IN_MMC=y
 CONFIG_REGMAP=y
 CONFIG_SYSCON=y
+# CONFIG_SPL_BLK is not set
 CONFIG_CLK=y
 CONFIG_FASTBOOT_FLASH=y
 CONFIG_FASTBOOT_FLASH_MMC_DEV=0
diff --git a/configs/omap35_logic_defconfig b/configs/omap35_logic_defconfig
index 80219ee..82ddaa3 100644
--- a/configs/omap35_logic_defconfig
+++ b/configs/omap35_logic_defconfig
@@ -9,6 +9,7 @@
 CONFIG_SPL=y
 CONFIG_DISTRO_DEFAULTS=y
 CONFIG_NR_DRAM_BANKS=2
+CONFIG_ANDROID_BOOT_IMAGE=y
 # CONFIG_USE_BOOTCOMMAND is not set
 CONFIG_SYS_CONSOLE_INFO_QUIET=y
 CONFIG_VERSION_VARIABLE=y
@@ -34,8 +35,6 @@
 # CONFIG_ENV_IS_IN_FAT is not set
 CONFIG_ENV_IS_IN_NAND=y
 CONFIG_SPL_DM=y
-CONFIG_USB_FUNCTION_FASTBOOT=y
-CONFIG_FASTBOOT_BUF_ADDR=0x82000000
 CONFIG_DM_I2C=y
 CONFIG_DM_MMC=y
 CONFIG_MMC_OMAP_HS=y
@@ -59,14 +58,10 @@
 CONFIG_DM_SPI=y
 CONFIG_OMAP3_SPI=y
 CONFIG_USB=y
+CONFIG_DM_USB=y
+# CONFIG_SPL_DM_USB is not set
 CONFIG_USB_EHCI_HCD=y
-CONFIG_USB_MUSB_GADGET=y
+CONFIG_USB_MUSB_HOST=y
 CONFIG_USB_MUSB_OMAP2PLUS=y
 CONFIG_TWL4030_USB=y
-CONFIG_USB_GADGET=y
-CONFIG_USB_GADGET_MANUFACTURER="TI"
-CONFIG_USB_GADGET_VENDOR_NUM=0x0451
-CONFIG_USB_GADGET_PRODUCT_NUM=0xd022
-CONFIG_USB_ETHER=y
 CONFIG_BCH=y
-# CONFIG_SPL_OF_LIBFDT is not set
diff --git a/configs/omap35_logic_somlv_defconfig b/configs/omap35_logic_somlv_defconfig
index 8a8c714..94f86ef 100644
--- a/configs/omap35_logic_somlv_defconfig
+++ b/configs/omap35_logic_somlv_defconfig
@@ -9,6 +9,7 @@
 CONFIG_SPL=y
 CONFIG_DISTRO_DEFAULTS=y
 CONFIG_NR_DRAM_BANKS=2
+CONFIG_ANDROID_BOOT_IMAGE=y
 # CONFIG_USE_BOOTCOMMAND is not set
 CONFIG_SYS_CONSOLE_INFO_QUIET=y
 CONFIG_VERSION_VARIABLE=y
@@ -34,8 +35,6 @@
 # CONFIG_ENV_IS_IN_FAT is not set
 CONFIG_ENV_IS_IN_NAND=y
 CONFIG_SPL_DM=y
-CONFIG_USB_FUNCTION_FASTBOOT=y
-CONFIG_FASTBOOT_BUF_ADDR=0x82000000
 CONFIG_DM_I2C=y
 CONFIG_DM_MMC=y
 CONFIG_MMC_OMAP_HS=y
@@ -65,14 +64,10 @@
 CONFIG_DM_SPI=y
 CONFIG_OMAP3_SPI=y
 CONFIG_USB=y
+CONFIG_DM_USB=y
+# CONFIG_SPL_DM_USB is not set
 CONFIG_USB_EHCI_HCD=y
-CONFIG_USB_MUSB_GADGET=y
+CONFIG_USB_MUSB_HOST=y
 CONFIG_USB_MUSB_OMAP2PLUS=y
 CONFIG_TWL4030_USB=y
-CONFIG_USB_GADGET=y
-CONFIG_USB_GADGET_MANUFACTURER="TI"
-CONFIG_USB_GADGET_VENDOR_NUM=0x0451
-CONFIG_USB_GADGET_PRODUCT_NUM=0xd022
-CONFIG_USB_ETHER=y
 CONFIG_BCH=y
-# CONFIG_SPL_OF_LIBFDT is not set
diff --git a/configs/omap3_logic_defconfig b/configs/omap3_logic_defconfig
index 3197259..cfb7fd2 100644
--- a/configs/omap3_logic_defconfig
+++ b/configs/omap3_logic_defconfig
@@ -9,6 +9,7 @@
 CONFIG_SPL=y
 CONFIG_DISTRO_DEFAULTS=y
 CONFIG_NR_DRAM_BANKS=2
+CONFIG_ANDROID_BOOT_IMAGE=y
 # CONFIG_USE_BOOTCOMMAND is not set
 CONFIG_SYS_CONSOLE_INFO_QUIET=y
 CONFIG_VERSION_VARIABLE=y
@@ -35,8 +36,6 @@
 CONFIG_ENV_IS_IN_NAND=y
 CONFIG_SPL_DM=y
 CONFIG_SPL_DM_SEQ_ALIAS=y
-CONFIG_USB_FUNCTION_FASTBOOT=y
-CONFIG_FASTBOOT_BUF_ADDR=0x82000000
 CONFIG_DM_I2C=y
 CONFIG_DM_MMC=y
 CONFIG_MMC_OMAP_HS=y
@@ -61,14 +60,10 @@
 CONFIG_DM_SPI=y
 CONFIG_OMAP3_SPI=y
 CONFIG_USB=y
+CONFIG_DM_USB=y
+# CONFIG_SPL_DM_USB is not set
 CONFIG_USB_EHCI_HCD=y
-CONFIG_USB_MUSB_GADGET=y
+CONFIG_USB_MUSB_HOST=y
 CONFIG_USB_MUSB_OMAP2PLUS=y
 CONFIG_TWL4030_USB=y
-CONFIG_USB_GADGET=y
-CONFIG_USB_GADGET_MANUFACTURER="TI"
-CONFIG_USB_GADGET_VENDOR_NUM=0x0451
-CONFIG_USB_GADGET_PRODUCT_NUM=0xd022
-CONFIG_USB_ETHER=y
 CONFIG_BCH=y
-# CONFIG_SPL_OF_LIBFDT is not set
diff --git a/configs/omap3_logic_somlv_defconfig b/configs/omap3_logic_somlv_defconfig
index 396543e..c30c43b 100644
--- a/configs/omap3_logic_somlv_defconfig
+++ b/configs/omap3_logic_somlv_defconfig
@@ -9,6 +9,7 @@
 CONFIG_SPL=y
 CONFIG_DISTRO_DEFAULTS=y
 CONFIG_NR_DRAM_BANKS=2
+CONFIG_ANDROID_BOOT_IMAGE=y
 # CONFIG_USE_BOOTCOMMAND is not set
 CONFIG_SYS_CONSOLE_INFO_QUIET=y
 CONFIG_VERSION_VARIABLE=y
@@ -33,8 +34,6 @@
 # CONFIG_ENV_IS_IN_FAT is not set
 CONFIG_ENV_IS_IN_NAND=y
 CONFIG_SPL_DM=y
-CONFIG_USB_FUNCTION_FASTBOOT=y
-CONFIG_FASTBOOT_BUF_ADDR=0x82000000
 CONFIG_DM_I2C=y
 CONFIG_DM_MMC=y
 CONFIG_MMC_OMAP_HS=y
@@ -65,14 +64,10 @@
 CONFIG_DM_SPI=y
 CONFIG_OMAP3_SPI=y
 CONFIG_USB=y
+CONFIG_DM_USB=y
+# CONFIG_SPL_DM_USB is not set
 CONFIG_USB_EHCI_HCD=y
-CONFIG_USB_MUSB_GADGET=y
+CONFIG_USB_MUSB_HOST=y
 CONFIG_USB_MUSB_OMAP2PLUS=y
 CONFIG_TWL4030_USB=y
-CONFIG_USB_GADGET=y
-CONFIG_USB_GADGET_MANUFACTURER="TI"
-CONFIG_USB_GADGET_VENDOR_NUM=0x0451
-CONFIG_USB_GADGET_PRODUCT_NUM=0xd022
-CONFIG_USB_ETHER=y
 CONFIG_BCH=y
-# CONFIG_SPL_OF_LIBFDT is not set
diff --git a/configs/qemu-x86_64_defconfig b/configs/qemu-x86_64_defconfig
index 32922b8..8d43acd 100644
--- a/configs/qemu-x86_64_defconfig
+++ b/configs/qemu-x86_64_defconfig
@@ -31,7 +31,7 @@
 CONFIG_SPL_CPU_SUPPORT=y
 CONFIG_SPL_ENV_SUPPORT=y
 CONFIG_SPL_NET_SUPPORT=y
-CONFIG_SPL_PCI_SUPPORT=y
+CONFIG_SPL_PCI=y
 CONFIG_SPL_PCH_SUPPORT=y
 CONFIG_SPL_RTC_SUPPORT=y
 CONFIG_HUSH_PARSER=y
diff --git a/configs/qemu_arm64_defconfig b/configs/qemu_arm64_defconfig
index f4502c9..0f13716 100644
--- a/configs/qemu_arm64_defconfig
+++ b/configs/qemu_arm64_defconfig
@@ -29,3 +29,10 @@
 CONFIG_DM_USB=y
 CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_EHCI_PCI=y
+CONFIG_ENV_IS_IN_FLASH=y
+CONFIG_MTD=y
+CONFIG_MTD_NOR_FLASH=y
+CONFIG_FLASH_CFI_DRIVER=y
+CONFIG_CFI_FLASH=y
+CONFIG_SYS_FLASH_USE_BUFFER_WRITE=y
+CONFIG_SYS_FLASH_CFI=y
diff --git a/configs/qemu_arm_defconfig b/configs/qemu_arm_defconfig
index acebdc5..b75363e 100644
--- a/configs/qemu_arm_defconfig
+++ b/configs/qemu_arm_defconfig
@@ -29,3 +29,10 @@
 CONFIG_DM_USB=y
 CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_EHCI_PCI=y
+CONFIG_ENV_IS_IN_FLASH=y
+CONFIG_MTD=y
+CONFIG_MTD_NOR_FLASH=y
+CONFIG_FLASH_CFI_DRIVER=y
+CONFIG_CFI_FLASH=y
+CONFIG_SYS_FLASH_USE_BUFFER_WRITE=y
+CONFIG_SYS_FLASH_CFI=y
diff --git a/doc/README.qemu-arm b/doc/README.qemu-arm
index 2601656..e67bc13 100644
--- a/doc/README.qemu-arm
+++ b/doc/README.qemu-arm
@@ -47,6 +47,12 @@
 Note that for some odd reason qemu-system-aarch64 needs to be explicitly
 told to use a 64-bit CPU or it will boot in 32-bit mode.
 
+Additional persistent U-boot environment support can be added as follows:
+- Create envstore.img using qemu-img:
+    qemu-img create -f raw envstore.img 64M
+- Add a pflash drive parameter to the command line:
+    -drive if=pflash,format=raw,index=1,file=envstore.img
+
 Additional peripherals that have been tested to work in both U-Boot and Linux
 can be enabled with the following command line parameters:
 
diff --git a/doc/driver-model/MIGRATION.txt b/doc/driver-model/MIGRATION.txt
index 6b69133..dce4aa3 100644
--- a/doc/driver-model/MIGRATION.txt
+++ b/doc/driver-model/MIGRATION.txt
@@ -44,7 +44,9 @@
 In concert with maintainers migrating their block device usage to the
 appropriate DM driver, CONFIG_BLK needs to be set as well.  The final deadline
 here coincides with the final deadline for migration of the various block
-subsystems.
+subsystems.  At this point we will be able to audit and correct the logic in
+Kconfig around using CONFIG_PARTITIONS and CONFIG_HAVE_BLOCK_DEVICE and make
+use of CONFIG_BLK / CONFIG_SPL_BLK as needed.
 
 CONFIG_DM_SPI
 CONFIG_DM_SPI_FLASH
diff --git a/drivers/Makefile b/drivers/Makefile
index c425831..752caea 100644
--- a/drivers/Makefile
+++ b/drivers/Makefile
@@ -10,7 +10,7 @@
 obj-$(CONFIG_$(SPL_TPL_)MMC_SUPPORT) += mmc/
 obj-$(CONFIG_$(SPL_TPL_)NAND_SUPPORT) += mtd/nand/raw/
 obj-$(CONFIG_$(SPL_TPL_)PCH_SUPPORT) += pch/
-obj-$(CONFIG_$(SPL_TPL_)PCI_SUPPORT) += pci/
+obj-$(CONFIG_$(SPL_TPL_)PCI) += pci/
 obj-$(CONFIG_$(SPL_TPL_)PHY) += phy/
 obj-$(CONFIG_$(SPL_TPL_)PINCTRL) += pinctrl/
 obj-$(CONFIG_$(SPL_TPL_)RAM) += ram/
@@ -53,8 +53,7 @@
 obj-$(CONFIG_SPL_USB_HOST_SUPPORT) += usb/host/
 obj-$(CONFIG_OMAP_USB_PHY) += usb/phy/
 obj-$(CONFIG_SPL_SATA_SUPPORT) += ata/ scsi/
-obj-$(CONFIG_SPL_USB_HOST_SUPPORT) += block/
-obj-$(CONFIG_SPL_MMC_SUPPORT) += block/
+obj-$(CONFIG_HAVE_BLOCK_DEVICE) += block/
 obj-$(CONFIG_SPL_FPGA_SUPPORT) += fpga/
 obj-$(CONFIG_SPL_THERMAL) += thermal/
 
diff --git a/drivers/block/Makefile b/drivers/block/Makefile
index 055d42f..3feb0aa 100644
--- a/drivers/block/Makefile
+++ b/drivers/block/Makefile
@@ -9,6 +9,8 @@
 obj-y += blk_legacy.o
 endif
 
+ifndef CONFIG_SPL_BUILD
 obj-$(CONFIG_IDE) += ide.o
+endif
 obj-$(CONFIG_SANDBOX) += sandbox.o
 obj-$(CONFIG_$(SPL_TPL_)BLOCK_CACHE) += blkcache.o
diff --git a/drivers/block/blk-uclass.c b/drivers/block/blk-uclass.c
index 65a766e..baaf431 100644
--- a/drivers/block/blk-uclass.c
+++ b/drivers/block/blk-uclass.c
@@ -639,7 +639,7 @@
 
 static int blk_post_probe(struct udevice *dev)
 {
-#if !defined(CONFIG_SPL_BUILD) || defined(CONFIG_SPL_LIBDISK_SUPPORT)
+#if defined(CONFIG_PARTITIONS) && defined(CONFIG_HAVE_BLOCK_DEVICE)
 	struct blk_desc *desc = dev_get_uclass_platdata(dev);
 
 	part_init(desc);
diff --git a/drivers/firmware/Kconfig b/drivers/firmware/Kconfig
index feaea81..7d8f161 100644
--- a/drivers/firmware/Kconfig
+++ b/drivers/firmware/Kconfig
@@ -1,6 +1,10 @@
 config FIRMWARE
 	bool "Enable Firmware driver support"
 
+config SPL_ARM_PSCI_FW
+	bool
+	select FIRMWARE
+
 config ARM_PSCI_FW
 	bool
 	select FIRMWARE
diff --git a/drivers/firmware/Makefile b/drivers/firmware/Makefile
index 6cb8358..6c3e129 100644
--- a/drivers/firmware/Makefile
+++ b/drivers/firmware/Makefile
@@ -1,4 +1,4 @@
 obj-$(CONFIG_FIRMWARE)		+= firmware-uclass.o
-obj-$(CONFIG_ARM_PSCI_FW)	+= psci.o
+obj-$(CONFIG_$(SPL_)ARM_PSCI_FW)	+= psci.o
 obj-$(CONFIG_TI_SCI_PROTOCOL)	+= ti_sci.o
 obj-$(CONFIG_SANDBOX)		+= firmware-sandbox.o
diff --git a/drivers/serial/ns16550.c b/drivers/serial/ns16550.c
index f3bd8db..560ca2a 100644
--- a/drivers/serial/ns16550.c
+++ b/drivers/serial/ns16550.c
@@ -425,7 +425,7 @@
 
 	/* try Processor Local Bus device first */
 	addr = dev_read_addr(dev);
-#if defined(CONFIG_PCI) && defined(CONFIG_DM_PCI)
+#if CONFIG_IS_ENABLED(PCI) && defined(CONFIG_DM_PCI)
 	if (addr == FDT_ADDR_T_NONE) {
 		/* then try pci device */
 		struct fdt_pci_addr pci_addr;
diff --git a/include/configs/am3517_evm.h b/include/configs/am3517_evm.h
index 4e7e520..eb50012 100644
--- a/include/configs/am3517_evm.h
+++ b/include/configs/am3517_evm.h
@@ -88,7 +88,7 @@
 
 #define CONFIG_EXTRA_ENV_SETTINGS \
 	"loadaddr=0x82000000\0" \
-	"console=ttyO2,115200n8\0" \
+	"console=ttyS2,115200n8\0" \
 	"fdtfile=am3517-evm.dtb\0" \
 	"fdtaddr=0x82C00000\0" \
 	"vram=16M\0" \
diff --git a/include/configs/qemu-arm.h b/include/configs/qemu-arm.h
index fedc466..0431a79 100644
--- a/include/configs/qemu-arm.h
+++ b/include/configs/qemu-arm.h
@@ -21,10 +21,12 @@
 #define CONFIG_SYS_HZ                       1000
 
 /* Environment options */
-#define CONFIG_ENV_SIZE				SZ_64K
+#define CONFIG_ENV_ADDR			0x4000000
+#define CONFIG_ENV_SIZE			SZ_256K
 
 #define BOOT_TARGET_DEVICES(func) \
 	func(SCSI, scsi, 0) \
+	func(VIRTIO, virtio, 0) \
 	func(DHCP, dhcp, na)
 
 #include <config_distro_bootcmd.h>
@@ -42,4 +44,9 @@
 
 #define CONFIG_SYS_CBSIZE 512
 
+#define CONFIG_SYS_MONITOR_BASE		CONFIG_SYS_TEXT_BASE
+#define CONFIG_SYS_FLASH_BASE		0x0
+#define CONFIG_SYS_MAX_FLASH_BANKS	2
+#define CONFIG_SYS_MAX_FLASH_SECT	256 /* Sector: 256K, Bank: 64M */
+
 #endif /* __CONFIG_H */
diff --git a/lib/fdtdec.c b/lib/fdtdec.c
index 7bbc6d4..6f8ec0d 100644
--- a/lib/fdtdec.c
+++ b/lib/fdtdec.c
@@ -200,7 +200,7 @@
 	return fdtdec_get_addr_size(blob, node, prop_name, NULL);
 }
 
-#if defined(CONFIG_PCI) && defined(CONFIG_DM_PCI)
+#if CONFIG_IS_ENABLED(PCI) && defined(CONFIG_DM_PCI)
 int fdtdec_get_pci_addr(const void *blob, int node, enum fdt_pci_space type,
 			const char *prop_name, struct fdt_pci_addr *addr)
 {
diff --git a/scripts/Makefile.spl b/scripts/Makefile.spl
index 22bd8f7..2ef19bf 100644
--- a/scripts/Makefile.spl
+++ b/scripts/Makefile.spl
@@ -81,9 +81,11 @@
 else
 libs-$(CONFIG_SPL_LIBCOMMON_SUPPORT) += common/ cmd/ env/
 libs-$(CONFIG_SPL_LIBGENERIC_SUPPORT) += lib/
+ifdef CONFIG_SPL_FRAMEWORK
+libs-$(CONFIG_PARTITIONS) += disk/
+endif
 endif
 
-libs-$(CONFIG_SPL_LIBDISK_SUPPORT) += disk/
 libs-y += drivers/
 libs-$(CONFIG_SPL_USB_GADGET_SUPPORT) += drivers/usb/dwc3/
 libs-y += dts/
diff --git a/test/lib/hexdump.c b/test/lib/hexdump.c
index e8b3e56..567b576 100644
--- a/test/lib/hexdump.c
+++ b/test/lib/hexdump.c
@@ -11,8 +11,6 @@
 
 static int lib_test_hex_to_bin(struct unit_test_state *uts)
 {
-	return 0;
-
 	ut_asserteq(0x0, hex_to_bin('0'));
 	ut_asserteq(0x1, hex_to_bin('1'));
 	ut_asserteq(0x2, hex_to_bin('2'));
@@ -30,6 +28,8 @@
 	ut_asserteq(0xe, hex_to_bin('e'));
 	ut_asserteq(0xf, hex_to_bin('f'));
 	ut_asserteq(-1, hex_to_bin('g'));
+
+	return 0;
 }
 
 DM_TEST(lib_test_hex_to_bin, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
diff --git a/test/overlay/cmd_ut_overlay.c b/test/overlay/cmd_ut_overlay.c
index 3d34c8a..fc2491d 100644
--- a/test/overlay/cmd_ut_overlay.c
+++ b/test/overlay/cmd_ut_overlay.c
@@ -23,6 +23,8 @@
 extern u32 __dtb_test_fdt_overlay_begin;
 extern u32 __dtb_test_fdt_overlay_stacked_begin;
 
+static void *fdt;
+
 static int ut_fdt_getprop_u32_by_index(void *fdt, const char *path,
 				    const char *name, int index,
 				    u32 *out)
@@ -67,7 +69,6 @@
 
 static int fdt_overlay_change_int_property(struct unit_test_state *uts)
 {
-	void *fdt = uts->priv;
 	u32 val = 0;
 
 	ut_assertok(ut_fdt_getprop_u32(fdt, "/test-node", "test-int-property",
@@ -80,7 +81,6 @@
 
 static int fdt_overlay_change_str_property(struct unit_test_state *uts)
 {
-	void *fdt = uts->priv;
 	const char *val = NULL;
 
 	ut_assertok(fdt_getprop_str(fdt, "/test-node", "test-str-property",
@@ -93,7 +93,6 @@
 
 static int fdt_overlay_add_str_property(struct unit_test_state *uts)
 {
-	void *fdt = uts->priv;
 	const char *val = NULL;
 
 	ut_assertok(fdt_getprop_str(fdt, "/test-node", "test-str-property-2",
@@ -106,7 +105,6 @@
 
 static int fdt_overlay_add_node_by_phandle(struct unit_test_state *uts)
 {
-	void *fdt = uts->priv;
 	int off;
 
 	off = fdt_path_offset(fdt, "/test-node/new-node");
@@ -120,7 +118,6 @@
 
 static int fdt_overlay_add_node_by_path(struct unit_test_state *uts)
 {
-	void *fdt = uts->priv;
 	int off;
 
 	off = fdt_path_offset(fdt, "/new-node");
@@ -134,7 +131,6 @@
 
 static int fdt_overlay_add_subnode_property(struct unit_test_state *uts)
 {
-	void *fdt = uts->priv;
 	int off;
 
 	off = fdt_path_offset(fdt, "/test-node/sub-test-node");
@@ -150,7 +146,6 @@
 static int fdt_overlay_local_phandle(struct unit_test_state *uts)
 {
 	uint32_t local_phandle;
-	void *fdt = uts->priv;
 	u32 val = 0;
 	int off;
 
@@ -175,7 +170,6 @@
 static int fdt_overlay_local_phandles(struct unit_test_state *uts)
 {
 	uint32_t local_phandle, test_phandle;
-	void *fdt = uts->priv;
 	u32 val = 0;
 	int off;
 
@@ -205,7 +199,6 @@
 
 static int fdt_overlay_stacked(struct unit_test_state *uts)
 {
-	void *fdt = uts->priv;
 	u32 val = 0;
 
 	ut_assertok(ut_fdt_getprop_u32(fdt, "/new-local-node",
@@ -225,7 +218,7 @@
 	void *fdt_base = &__dtb_test_fdt_base_begin;
 	void *fdt_overlay = &__dtb_test_fdt_overlay_begin;
 	void *fdt_overlay_stacked = &__dtb_test_fdt_overlay_stacked_begin;
-	void *fdt_base_copy, *fdt_overlay_copy, *fdt_overlay_stacked_copy;
+	void *fdt_overlay_copy, *fdt_overlay_stacked_copy;
 	int ret = -ENOMEM;
 
 	uts = calloc(1, sizeof(*uts));
@@ -235,10 +228,9 @@
 	ut_assertok(fdt_check_header(fdt_base));
 	ut_assertok(fdt_check_header(fdt_overlay));
 
-	fdt_base_copy = malloc(FDT_COPY_SIZE);
-	if (!fdt_base_copy)
+	fdt = malloc(FDT_COPY_SIZE);
+	if (!fdt)
 		goto err1;
-	uts->priv = fdt_base_copy;
 
 	fdt_overlay_copy = malloc(FDT_COPY_SIZE);
 	if (!fdt_overlay_copy)
@@ -254,7 +246,7 @@
 	 * (and relocate it since the memory might be mapped
 	 * read-only)
 	 */
-	ut_assertok(fdt_open_into(fdt_base, fdt_base_copy, FDT_COPY_SIZE));
+	ut_assertok(fdt_open_into(fdt_base, fdt, FDT_COPY_SIZE));
 
 	/*
 	 * Resize the overlay to 4k so that we have room to operate on
@@ -275,10 +267,10 @@
 				  FDT_COPY_SIZE));
 
 	/* Apply the overlay */
-	ut_assertok(fdt_overlay_apply(fdt_base_copy, fdt_overlay_copy));
+	ut_assertok(fdt_overlay_apply(fdt, fdt_overlay_copy));
 
 	/* Apply the stacked overlay */
-	ut_assertok(fdt_overlay_apply(fdt_base_copy, fdt_overlay_stacked_copy));
+	ut_assertok(fdt_overlay_apply(fdt, fdt_overlay_stacked_copy));
 
 	ret = cmd_ut_category("overlay", tests, n_ents, argc, argv);
 
@@ -286,9 +278,7 @@
 err3:
 	free(fdt_overlay_copy);
 err2:
-	free(fdt_base_copy);
+	free(fdt);
 err1:
-	free(uts);
-
 	return ret;
 }