Merge https://source.denx.de/u-boot/custodians/u-boot-riscv
diff --git a/Kconfig b/Kconfig
index acf146c..9dd9ec7 100644
--- a/Kconfig
+++ b/Kconfig
@@ -353,6 +353,13 @@
 	  used to generate a combined image with SPL and main U-Boot
 	  proper as one single image.
 
+config REMAKE_ELF
+	bool "Recreate an ELF image from raw U-Boot binary"
+	help
+	  Enable this to recreate an ELF image (u-boot.elf) from the raw
+	  U-Boot binary (u-boot.bin), which may already have been statically
+	  relocated and may already have a device-tree appended to it.
+
 config BUILD_TARGET
 	string "Build target special images"
 	default "u-boot-with-spl.sfp" if TARGET_SOCFPGA_ARRIA10
diff --git a/MAINTAINERS b/MAINTAINERS
index 54985ae..b6a4b5d 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -278,11 +278,20 @@
 F:	arch/arm/mach-kirkwood/
 F:	arch/arm/mach-mvebu/
 F:	drivers/ata/ahci_mvebu.c
+F:	drivers/clk/mvebu/
 F:	drivers/ddr/marvell/
 F:	drivers/gpio/mvebu_gpio.c
+F:	drivers/i2c/mvtwsi.c
+F:	drivers/mmc/xenon_sdhci.c
+F:	drivers/phy/marvell/
+F:	drivers/pinctrl/mvebu/
+F:	drivers/rtc/armada38x.c
 F:	drivers/spi/kirkwood_spi.c
+F:	drivers/spi/mvebu_a3700_spi.c
 F:	drivers/pci/pcie_dw_mvebu.c
+F:	drivers/watchdog/armada-37xx-wdt.c
 F:	drivers/watchdog/orion_wdt.c
+F:	include/configs/mv-common.h
 
 ARM MARVELL PCIE CONTROLLER DRIVERS
 M:	Pali Rohár <pali@kernel.org>
diff --git a/Makefile b/Makefile
index a69cc08..1ee7089 100644
--- a/Makefile
+++ b/Makefile
@@ -1134,6 +1134,7 @@
 	@# is enable to tell 'deprecated' that one of these symbols exists
 	$(call deprecated,CONFIG_TIMER,Timer drivers,v2023.01,$(if $(strip $(CONFIG_SYS_TIMER_RATE)$(CONFIG_SYS_TIMER_COUNTER)),x))
 	$(call deprecated,CONFIG_DM_SERIAL,Serial drivers,v2023.04,$(CONFIG_SERIAL))
+	$(call deprecated,CONFIG_DM_SCSI,SCSI drivers,v2023.04,$(CONFIG_SCSI))
 	@# 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/README b/README
index 9ebd4f2..f51f392 100644
--- a/README
+++ b/README
@@ -720,17 +720,6 @@
 		CONFIG_SCSI) you must configure support for at
 		least one non-MTD partition type as well.
 
-- IDE Reset method:
-		CONFIG_IDE_RESET - is this is defined, IDE Reset will
-		be performed by calling the function
-			ide_set_reset(int reset)
-		which has to be defined in a board specific file
-
-- ATAPI Support:
-		CONFIG_ATAPI
-
-		Set this to enable ATAPI support.
-
 - LBA48 Support
 		CONFIG_LBA48
 
@@ -743,16 +732,6 @@
 			When enabled, makes the IDE subsystem use 64bit sector addresses.
 			Default is 32bit.
 
-- SCSI Support:
-		CONFIG_SYS_SCSI_MAX_LUN [8], CONFIG_SYS_SCSI_MAX_SCSI_ID [7] and
-		CONFIG_SYS_SCSI_MAX_DEVICE [CONFIG_SYS_SCSI_MAX_SCSI_ID *
-		CONFIG_SYS_SCSI_MAX_LUN] can be adjusted to define the
-		maximum numbers of LUNs, SCSI ID's and target
-		devices.
-
-		The environment variable 'scsidevs' is set to the number of
-		SCSI devices found during the last scan.
-
 - NETWORK Support (PCI):
 		CONFIG_E1000_SPI
 		Utility code for direct access to the SPI bus on Intel 8257x.
@@ -2393,14 +2372,6 @@
 		If this macro is defined, then CONFIG_SYS_CCSRBAR_PHYS will be
 		forced to a value that ensures that CCSR is not relocated.
 
-- CONFIG_IDE_AHB:
-		Most IDE controllers were designed to be connected with PCI
-		interface. Only few of them were designed for AHB interface.
-		When software is doing ATA command and data transfer to
-		IDE devices through IDE-AHB controller, some additional
-		registers accessing to these kind of IDE-AHB controller
-		is required.
-
 - CONFIG_SYS_IMMR:	Physical address of the Internal Memory.
 		DO NOT CHANGE unless you know exactly what you're
 		doing! (11-4) [MPC8xx systems only]
diff --git a/api/api_storage.c b/api/api_storage.c
index a0dacad..adca44b 100644
--- a/api/api_storage.c
+++ b/api/api_storage.c
@@ -9,6 +9,7 @@
 #include <common.h>
 #include <api_public.h>
 #include <part.h>
+#include <scsi.h>
 
 #if defined(CONFIG_CMD_USB) && defined(CONFIG_USB_STORAGE)
 #include <usb.h>
@@ -71,7 +72,7 @@
 	specs[ENUM_SATA].name = "sata";
 #endif
 #if defined(CONFIG_SCSI)
-	specs[ENUM_SCSI].max_dev = CONFIG_SYS_SCSI_MAX_DEVICE;
+	specs[ENUM_SCSI].max_dev = SCSI_MAX_DEVICE;
 	specs[ENUM_SCSI].enum_started = 0;
 	specs[ENUM_SCSI].enum_ended = 0;
 	specs[ENUM_SCSI].type = DEV_TYP_STOR | DT_STOR_SCSI;
diff --git a/arch/Kconfig b/arch/Kconfig
index bea8ead..e619144 100644
--- a/arch/Kconfig
+++ b/arch/Kconfig
@@ -172,7 +172,6 @@
 	imply FIRMWARE
 	imply HASH_VERIFY
 	imply LZMA
-	imply SCSI
 	imply TEE
 	imply AVB_VERIFY
 	imply LIBAVB
diff --git a/arch/arc/dts/Makefile b/arch/arc/dts/Makefile
index 515fe1f..532a813 100644
--- a/arch/arc/dts/Makefile
+++ b/arch/arc/dts/Makefile
@@ -8,6 +8,8 @@
 dtb-$(CONFIG_TARGET_HSDK) +=  hsdk.dtb hsdk-4xd.dtb
 dtb-$(CONFIG_TARGET_IOT_DEVKIT) +=  iot_devkit.dtb
 
+include $(srctree)/scripts/Makefile.dts
+
 targets += $(dtb-y)
 
 DTC_FLAGS += -R 4 -p 0x1000
diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
index 5a57069..c1cec72 100644
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
@@ -1205,6 +1205,8 @@
 
 dtb-$(CONFIG_ARCH_QEMU) += qemu-arm.dtb qemu-arm64.dtb
 
+include $(srctree)/scripts/Makefile.dts
+
 targets += $(dtb-y)
 
 # Add any required device tree compiler flags here
diff --git a/arch/arm/include/asm/arch-ls102xa/config.h b/arch/arm/include/asm/arch-ls102xa/config.h
index 0e1f9e0..86a4e1f 100644
--- a/arch/arm/include/asm/arch-ls102xa/config.h
+++ b/arch/arm/include/asm/arch-ls102xa/config.h
@@ -78,11 +78,6 @@
 
 /* SATA */
 #define AHCI_BASE_ADDR				(CONFIG_SYS_IMMR + 0x02200000)
-#define CONFIG_SCSI_AHCI_PLAT
-#define CONFIG_SYS_SCSI_MAX_SCSI_ID		1
-#define CONFIG_SYS_SCSI_MAX_LUN		1
-#define CONFIG_SYS_SCSI_MAX_DEVICE		(CONFIG_SYS_SCSI_MAX_SCSI_ID * \
-						CONFIG_SYS_SCSI_MAX_LUN)
 #ifdef CONFIG_DDR_SPD
 #define CONFIG_VERY_BIG_RAM
 #define CONFIG_SYS_LS1_DDR_BLOCK1_SIZE		((phys_size_t)2 << 30)
diff --git a/arch/arm/mach-imx/Makefile b/arch/arm/mach-imx/Makefile
index 07954bc..77e7270 100644
--- a/arch/arm/mach-imx/Makefile
+++ b/arch/arm/mach-imx/Makefile
@@ -91,7 +91,7 @@
 endif
 
 quiet_cmd_cpp_cfg = CFGS    $@
-      cmd_cpp_cfg = $(CPP) $(cpp_flags) -x c -o $@ $<
+      cmd_cpp_cfg = $(CPP) $(cpp_flags) -D__ASSEMBLY__ -x c -o $@ $<
 
 # mkimage source config file
 IMX_CONFIG = $(CONFIG_IMX_CONFIG:"%"=%)
diff --git a/arch/arm/mach-imx/imx8m/imximage-8mm-lpddr4.cfg b/arch/arm/mach-imx/imx8m/imximage-8mm-lpddr4.cfg
index 1a2e43e..e06d53e 100644
--- a/arch/arm/mach-imx/imx8m/imximage-8mm-lpddr4.cfg
+++ b/arch/arm/mach-imx/imx8m/imximage-8mm-lpddr4.cfg
@@ -3,7 +3,6 @@
  * Copyright 2019 NXP
  */
 
-#define __ASSEMBLY__
 
 FIT
 BOOT_FROM	sd
diff --git a/arch/arm/mach-imx/imx8m/imximage-8mn-ddr4.cfg b/arch/arm/mach-imx/imx8m/imximage-8mn-ddr4.cfg
index 1405c65..120631a 100644
--- a/arch/arm/mach-imx/imx8m/imximage-8mn-ddr4.cfg
+++ b/arch/arm/mach-imx/imx8m/imximage-8mn-ddr4.cfg
@@ -3,7 +3,6 @@
  * Copyright 2019 NXP
  */
 
-#define __ASSEMBLY__
 
 FIT
 ROM_VERSION	v2
diff --git a/arch/arm/mach-imx/imx8m/imximage-8mn-lpddr4.cfg b/arch/arm/mach-imx/imx8m/imximage-8mn-lpddr4.cfg
index 4c63b31..7dae3fa 100644
--- a/arch/arm/mach-imx/imx8m/imximage-8mn-lpddr4.cfg
+++ b/arch/arm/mach-imx/imx8m/imximage-8mn-lpddr4.cfg
@@ -3,7 +3,6 @@
  * Copyright 2019 NXP
  */
 
-#define __ASSEMBLY__
 
 FIT
 ROM_VERSION	v2
diff --git a/arch/arm/mach-imx/imx8m/imximage-8mp-lpddr4.cfg b/arch/arm/mach-imx/imx8m/imximage-8mp-lpddr4.cfg
index 586a5ff..0fba9f5 100644
--- a/arch/arm/mach-imx/imx8m/imximage-8mp-lpddr4.cfg
+++ b/arch/arm/mach-imx/imx8m/imximage-8mp-lpddr4.cfg
@@ -3,7 +3,6 @@
  * Copyright 2019 NXP
  */
 
-#define __ASSEMBLY__
 
 FIT
 ROM_VERSION	v2
diff --git a/arch/arm/mach-imx/imx8m/imximage.cfg b/arch/arm/mach-imx/imx8m/imximage.cfg
index 2a3f959..30490e0 100644
--- a/arch/arm/mach-imx/imx8m/imximage.cfg
+++ b/arch/arm/mach-imx/imx8m/imximage.cfg
@@ -3,7 +3,6 @@
  * Copyright 2018-2021 NXP
  */
 
-#define __ASSEMBLY__
 
 FIT
 BOOT_FROM	sd
diff --git a/arch/arm/mach-imx/spl_qspi.cfg b/arch/arm/mach-imx/spl_qspi.cfg
index 1e39ae2..6df779b 100644
--- a/arch/arm/mach-imx/spl_qspi.cfg
+++ b/arch/arm/mach-imx/spl_qspi.cfg
@@ -3,7 +3,6 @@
  * Copyright (C) 2014, Compulab Ltd - http://compulab.co.il/
  */
 
-#define __ASSEMBLY__
 #include <config.h>
 
 IMAGE_VERSION	2
diff --git a/arch/arm/mach-imx/spl_sd.cfg b/arch/arm/mach-imx/spl_sd.cfg
index dbaee81..e739b54 100644
--- a/arch/arm/mach-imx/spl_sd.cfg
+++ b/arch/arm/mach-imx/spl_sd.cfg
@@ -3,7 +3,6 @@
  * Copyright (C) 2014, Compulab Ltd - http://compulab.co.il/
  */
 
-#define __ASSEMBLY__
 #include <config.h>
 
 IMAGE_VERSION	2
diff --git a/arch/arm/mach-kirkwood/include/mach/config.h b/arch/arm/mach-kirkwood/include/mach/config.h
index eb95023..b9f836b 100644
--- a/arch/arm/mach-kirkwood/include/mach/config.h
+++ b/arch/arm/mach-kirkwood/include/mach/config.h
@@ -59,18 +59,11 @@
 #ifdef CONFIG_IDE
 #define __io
 /* Data, registers and alternate blocks are at the same offset */
-#define CONFIG_SYS_ATA_DATA_OFFSET	(0x0100)
-#define CONFIG_SYS_ATA_REG_OFFSET	(0x0100)
-#define CONFIG_SYS_ATA_ALT_OFFSET	(0x0100)
 /* Each 8-bit ATA register is aligned to a 4-bytes address */
-#define CONFIG_SYS_ATA_STRIDE		4
 /* Controller supports 48-bits LBA addressing */
 #define CONFIG_LBA48
 /* CONFIG_IDE requires some #defines for ATA registers */
-#define CONFIG_SYS_IDE_MAXBUS		2
-#define CONFIG_SYS_IDE_MAXDEVICE	2
 /* ATA registers base is at SATA controller base */
-#define CONFIG_SYS_ATA_BASE_ADDR	MV_SATA_BASE
 #endif /* CONFIG_IDE */
 
 /* Use common timer */
diff --git a/arch/m68k/dts/Makefile b/arch/m68k/dts/Makefile
index fdd435b..7988522 100644
--- a/arch/m68k/dts/Makefile
+++ b/arch/m68k/dts/Makefile
@@ -18,6 +18,8 @@
 dtb-$(CONFIG_TARGET_AMCORE) += amcore.dtb
 dtb-$(CONFIG_TARGET_STMARK2) += stmark2.dtb
 
+include $(srctree)/scripts/Makefile.dts
+
 targets += $(dtb-y)
 
 DTC_FLAGS += -R 4 -p 0x1000
diff --git a/arch/microblaze/dts/Makefile b/arch/microblaze/dts/Makefile
index 4690dc1..427a8f9 100644
--- a/arch/microblaze/dts/Makefile
+++ b/arch/microblaze/dts/Makefile
@@ -2,6 +2,8 @@
 
 dtb-y += $(shell echo $(CONFIG_DEFAULT_DEVICE_TREE)).dtb
 
+include $(srctree)/scripts/Makefile.dts
+
 targets += $(dtb-y)
 
 DTC_FLAGS += -R 4 -p 0x1000
diff --git a/arch/mips/dts/Makefile b/arch/mips/dts/Makefile
index 215283c..95144b2 100644
--- a/arch/mips/dts/Makefile
+++ b/arch/mips/dts/Makefile
@@ -34,6 +34,8 @@
 dtb-$(CONFIG_SOC_SERVALT) += servalt_pcb116.dtb
 dtb-$(CONFIG_SOC_SERVAL) += serval_pcb105.dtb serval_pcb106.dtb
 
+include $(srctree)/scripts/Makefile.dts
+
 targets += $(dtb-y)
 
 # Add any required device tree compiler flags here
diff --git a/arch/mips/lib/cache.c b/arch/mips/lib/cache.c
index 51a8f43..ec652f0 100644
--- a/arch/mips/lib/cache.c
+++ b/arch/mips/lib/cache.c
@@ -38,7 +38,7 @@
 			l2c = read_c0_config5() & MIPS_CONF5_L2C;
 	}
 
-	if (l2c && config_enabled(CONFIG_MIPS_CM)) {
+	if (l2c && IS_ENABLED(CONFIG_MIPS_CM)) {
 		gd->arch.l2_line_size = mips_cm_l2_line_size();
 	} else if (l2c) {
 		/* We don't know how to retrieve L2 config on this system */
diff --git a/arch/nds32/dts/Makefile b/arch/nds32/dts/Makefile
index a8e23ad..5a09e3b 100644
--- a/arch/nds32/dts/Makefile
+++ b/arch/nds32/dts/Makefile
@@ -2,6 +2,8 @@
 
 dtb-$(CONFIG_TARGET_ADP_AG101P) += ag101p.dtb
 dtb-$(CONFIG_TARGET_ADP_AE3XX) += ae3xx.dtb
+include $(srctree)/scripts/Makefile.dts
+
 targets += $(dtb-y)
 
 DTC_FLAGS += -R 4 -p 0x1000
diff --git a/arch/nios2/dts/Makefile b/arch/nios2/dts/Makefile
index 0014acf..2b29fa9 100644
--- a/arch/nios2/dts/Makefile
+++ b/arch/nios2/dts/Makefile
@@ -2,6 +2,8 @@
 
 dtb-y += $(CONFIG_DEFAULT_DEVICE_TREE:"%"=%).dtb
 
+include $(srctree)/scripts/Makefile.dts
+
 targets += $(dtb-y)
 
 DTC_FLAGS += -R 4 -p 0x1000
diff --git a/arch/powerpc/dts/Makefile b/arch/powerpc/dts/Makefile
index 66d22ae..a4b0d7d 100644
--- a/arch/powerpc/dts/Makefile
+++ b/arch/powerpc/dts/Makefile
@@ -30,6 +30,8 @@
 dtb-$(CONFIG_TARGET_MCR3000) += mcr3000.dtb
 dtb-$(CONFIG_TARGET_GAZERBEAM) += gazerbeam.dtb
 
+include $(srctree)/scripts/Makefile.dts
+
 targets += $(dtb-y)
 
 # Add any required device tree compiler flags here
diff --git a/arch/riscv/dts/Makefile b/arch/riscv/dts/Makefile
index 90d3f35..5c15a0f 100644
--- a/arch/riscv/dts/Makefile
+++ b/arch/riscv/dts/Makefile
@@ -8,6 +8,8 @@
 dtb-$(CONFIG_TARGET_SIFIVE_UNMATCHED) += hifive-unmatched-a00.dtb
 dtb-$(CONFIG_TARGET_SIPEED_MAIX) += k210-maix-bit.dtb
 
+include $(srctree)/scripts/Makefile.dts
+
 targets += $(dtb-y)
 
 DTC_FLAGS += -R 4 -p 0x1000
diff --git a/arch/sandbox/Makefile b/arch/sandbox/Makefile
index f6cf859..a335f8a 100644
--- a/arch/sandbox/Makefile
+++ b/arch/sandbox/Makefile
@@ -4,3 +4,10 @@
 head-$(CONFIG_SANDBOX_SDL) += arch/sandbox/cpu/sdl.o
 libs-y += arch/sandbox/cpu/
 libs-y += arch/sandbox/lib/
+
+# sdl.c fails to compile with -fshort-wchar using musl.
+cmd_cc_sdl.o = $(CC) $(filter-out -nostdinc -fshort-wchar, \
+	$(patsubst -I%,-idirafter%,$(c_flags))) -fno-lto -c -o $@ $<
+
+$(obj)/sdl.o: $(src)/sdl.c FORCE
+	$(call if_changed_dep,cc_sdl.o)
diff --git a/arch/sandbox/cpu/Makefile b/arch/sandbox/cpu/Makefile
index de7fe7f..7c5c526 100644
--- a/arch/sandbox/cpu/Makefile
+++ b/arch/sandbox/cpu/Makefile
@@ -7,7 +7,7 @@
 
 obj-y	:= cache.o cpu.o state.o
 extra-y	:= start.o os.o
-extra-$(CONFIG_SANDBOX_SDL)	+= sdl.o
+extra-$(CONFIG_SANDBOX_SDL)    += sdl.o
 obj-$(CONFIG_SPL_BUILD)	+= spl.o
 obj-$(CONFIG_ETH_SANDBOX_RAW)	+= eth-raw-os.o
 
@@ -19,8 +19,6 @@
 
 $(obj)/os.o: $(src)/os.c FORCE
 	$(call if_changed_dep,cc_os.o)
-$(obj)/sdl.o: $(src)/sdl.c FORCE
-	$(call if_changed_dep,cc_os.o)
 
 # eth-raw-os.c is built in the system env, so needs standard includes
 # CFLAGS_REMOVE_eth-raw-os.o cannot be used to drop header include path
@@ -30,3 +28,10 @@
 
 $(obj)/eth-raw-os.o: $(src)/eth-raw-os.c FORCE
 	$(call if_changed_dep,cc_eth-raw-os.o)
+
+# sdl.c fails to build with -fshort-wchar using musl
+cmd_cc_sdl.o = $(CC) $(filter-out -nostdinc -fshort-wchar, \
+	$(patsubst -I%,-idirafter%,$(c_flags))) -fno-lto -c -o $@ $<
+
+$(obj)/sdl.o: $(src)/sdl.c FORCE
+	$(call if_changed_dep,cc_sdl.o)
diff --git a/arch/sandbox/dts/Makefile b/arch/sandbox/dts/Makefile
index 3e5dc67..6cbc9bb 100644
--- a/arch/sandbox/dts/Makefile
+++ b/arch/sandbox/dts/Makefile
@@ -8,6 +8,8 @@
 dtb-$(CONFIG_UT_DM) += test.dtb
 dtb-$(CONFIG_CMD_EXTENSION) += overlay0.dtbo overlay1.dtbo
 
+include $(srctree)/scripts/Makefile.dts
+
 targets += $(dtb-y)
 
 DTC_FLAGS += -R 4 -p 0x1000
diff --git a/arch/sh/dts/Makefile b/arch/sh/dts/Makefile
index e423bfd..144fd3e 100644
--- a/arch/sh/dts/Makefile
+++ b/arch/sh/dts/Makefile
@@ -1,5 +1,7 @@
 dtb-y += sh7751-r2dplus.dtb
 
+include $(srctree)/scripts/Makefile.dts
+
 targets += $(dtb-y)
 
 # Add any required device tree compiler flags here
diff --git a/arch/x86/cpu/intel_common/acpi.c b/arch/x86/cpu/intel_common/acpi.c
index 15f19da..d94ec20 100644
--- a/arch/x86/cpu/intel_common/acpi.c
+++ b/arch/x86/cpu/intel_common/acpi.c
@@ -31,14 +31,17 @@
 #include <linux/err.h>
 #include <power/acpi_pmc.h>
 
-u32 acpi_fill_mcfg(u32 current)
+int acpi_fill_mcfg(struct acpi_ctx *ctx)
 {
+	size_t size;
+
 	/* PCI Segment Group 0, Start Bus Number 0, End Bus Number is 255 */
-	current += acpi_create_mcfg_mmconfig((void *)current,
-					     CONFIG_MMCONF_BASE_ADDRESS, 0, 0,
-					     (CONFIG_SA_PCIEX_LENGTH >> 20)
-					     - 1);
-	return current;
+	size = acpi_create_mcfg_mmconfig((void *)ctx->current,
+					 CONFIG_MMCONF_BASE_ADDRESS, 0, 0,
+					 (CONFIG_SA_PCIEX_LENGTH >> 20) - 1);
+	acpi_inc(ctx, size);
+
+	return 0;
 }
 
 static int acpi_sci_irq(void)
diff --git a/arch/x86/cpu/tangier/acpi.c b/arch/x86/cpu/tangier/acpi.c
index 12f9289..e3a2fce 100644
--- a/arch/x86/cpu/tangier/acpi.c
+++ b/arch/x86/cpu/tangier/acpi.c
@@ -68,14 +68,17 @@
 	return current;
 }
 
-u32 acpi_fill_mcfg(u32 current)
+int acpi_fill_mcfg(struct acpi_ctx *ctx)
 {
-	/* TODO: Derive parameters from SFI MCFG table */
-	current += acpi_create_mcfg_mmconfig
-		((struct acpi_mcfg_mmconfig *)current,
-		MCFG_BASE_ADDRESS, 0x0, 0x0, 0x0);
+	size_t size;
 
-	return current;
+	/* TODO: Derive parameters from SFI MCFG table */
+	size = acpi_create_mcfg_mmconfig
+		((struct acpi_mcfg_mmconfig *)ctx->current,
+		MCFG_BASE_ADDRESS, 0x0, 0x0, 0x0);
+	acpi_inc(ctx, size);
+
+	return 0;
 }
 
 static u32 acpi_fill_csrt_dma(struct acpi_csrt_group *grp)
diff --git a/arch/x86/dts/Makefile b/arch/x86/dts/Makefile
index 5c8c05e..cd77f4c 100644
--- a/arch/x86/dts/Makefile
+++ b/arch/x86/dts/Makefile
@@ -22,6 +22,8 @@
 	slimbootloader.dtb \
 	baytrail_som-db5800-som-6867.dtb
 
+include $(srctree)/scripts/Makefile.dts
+
 targets += $(dtb-y)
 
 DTC_FLAGS += -R 4 -p $(if $(CONFIG_EFI_APP),0x8000,0x1000)
diff --git a/arch/x86/include/asm/acpi_table.h b/arch/x86/include/asm/acpi_table.h
index 0d07f7c..39547de 100644
--- a/arch/x86/include/asm/acpi_table.h
+++ b/arch/x86/include/asm/acpi_table.h
@@ -34,7 +34,6 @@
 u32 acpi_fill_madt(u32 current);
 int acpi_create_mcfg_mmconfig(struct acpi_mcfg_mmconfig *mmconfig, u32 base,
 			      u16 seg_nr, u8 start, u8 end);
-u32 acpi_fill_mcfg(u32 current);
 
 /**
  * acpi_write_hpet() - Write out a HPET table
diff --git a/arch/x86/lib/acpi_table.c b/arch/x86/lib/acpi_table.c
index c053434..c5b33dc 100644
--- a/arch/x86/lib/acpi_table.c
+++ b/arch/x86/lib/acpi_table.c
@@ -161,28 +161,6 @@
 }
 ACPI_WRITER(5x86, NULL, acpi_write_madt, 0);
 
-int acpi_create_mcfg_mmconfig(struct acpi_mcfg_mmconfig *mmconfig, u32 base,
-			      u16 seg_nr, u8 start, u8 end)
-{
-	memset(mmconfig, 0, sizeof(*mmconfig));
-	mmconfig->base_address_l = base;
-	mmconfig->base_address_h = 0;
-	mmconfig->pci_segment_group_number = seg_nr;
-	mmconfig->start_bus_number = start;
-	mmconfig->end_bus_number = end;
-
-	return sizeof(struct acpi_mcfg_mmconfig);
-}
-
-__weak u32 acpi_fill_mcfg(u32 current)
-{
-	current += acpi_create_mcfg_mmconfig
-		((struct acpi_mcfg_mmconfig *)current,
-		CONFIG_PCIE_ECAM_BASE, 0x0, 0x0, 255);
-
-	return current;
-}
-
 /**
  * acpi_create_tcpa() - Create a TCPA table
  *
@@ -480,36 +458,6 @@
 }
 ACPI_WRITER(4gnvs, "GNVS", acpi_write_gnvs, 0);
 
-/* MCFG is defined in the PCI Firmware Specification 3.0 */
-int acpi_write_mcfg(struct acpi_ctx *ctx, const struct acpi_writer *entry)
-{
-	struct acpi_table_header *header;
-	struct acpi_mcfg *mcfg;
-	u32 current;
-
-	mcfg = ctx->current;
-	header = &mcfg->header;
-
-	current = (u32)mcfg + sizeof(struct acpi_mcfg);
-
-	memset(mcfg, '\0', sizeof(struct acpi_mcfg));
-
-	/* Fill out header fields */
-	acpi_fill_header(header, "MCFG");
-	header->length = sizeof(struct acpi_mcfg);
-	header->revision = 1;
-
-	/* (Re)calculate length and checksum */
-	header->length = current - (u32)mcfg;
-	header->checksum = table_compute_checksum(mcfg, header->length);
-
-	acpi_inc(ctx, mcfg->header.length);
-	acpi_add_table(ctx, mcfg);
-
-	return 0;
-}
-ACPI_WRITER(5mcfg, "MCFG", acpi_write_mcfg, 0);
-
 /**
  * acpi_write_hpet() - Write out a HPET table
  *
diff --git a/arch/xtensa/dts/Makefile b/arch/xtensa/dts/Makefile
index 06ee25d..fbbdefa 100644
--- a/arch/xtensa/dts/Makefile
+++ b/arch/xtensa/dts/Makefile
@@ -2,6 +2,8 @@
 
 dtb-$(CONFIG_XTFPGA) += ml605.dtb ml605_nommu.dtb kc705.dtb kc705_nommu.dtb
 
+include $(srctree)/scripts/Makefile.dts
+
 targets += $(dtb-y)
 
 DTC_FLAGS +=
diff --git a/board/Marvell/dreamplug/MAINTAINERS b/board/Marvell/dreamplug/MAINTAINERS
index 2561ba8..6bad3ea 100644
--- a/board/Marvell/dreamplug/MAINTAINERS
+++ b/board/Marvell/dreamplug/MAINTAINERS
@@ -1,4 +1,5 @@
 DREAMPLUG BOARD
+M:	Tony Dinh <mibodhi@gmail.com>
 M:	Jason Cooper <u-boot@lakedaemon.net>
 S:	Maintained
 F:	board/Marvell/dreamplug/
diff --git a/board/Marvell/dreamplug/dreamplug.c b/board/Marvell/dreamplug/dreamplug.c
index 7ba1402..d15faa1 100644
--- a/board/Marvell/dreamplug/dreamplug.c
+++ b/board/Marvell/dreamplug/dreamplug.c
@@ -1,8 +1,7 @@
 // SPDX-License-Identifier: GPL-2.0+
 /*
- * Copyright (C) 2021  Tony Dinh <mibodhi@gmail.com>
- * (C) Copyright 2011
- * Jason Cooper <u-boot@lakedaemon.net>
+ * Copyright (C) 2021-2022 Tony Dinh <mibodhi@gmail.com>
+ * Copyright (C) 2011 Jason Cooper <u-boot@lakedaemon.net>
  *
  * Based on work by:
  * Marvell Semiconductor <www.marvell.com>
@@ -11,16 +10,19 @@
 
 #include <common.h>
 #include <init.h>
-#include <miiphy.h>
-#include <net.h>
+#include <netdev.h>
 #include <asm/arch/cpu.h>
 #include <asm/arch/soc.h>
 #include <asm/arch/mpp.h>
 #include <asm/global_data.h>
-#include "dreamplug.h"
 
 DECLARE_GLOBAL_DATA_PTR;
 
+#define DREAMPLUG_OE_LOW	(~(0))
+#define DREAMPLUG_OE_HIGH	(~(0))
+#define DREAMPLUG_OE_VAL_LOW	0
+#define DREAMPLUG_OE_VAL_HIGH	(0xf << 16) /* 4 LED Pins high */
+
 int board_early_init_f(void)
 {
 	/*
@@ -90,83 +92,15 @@
 	return 0;
 }
 
+int board_eth_init(struct bd_info *bis)
+{
+	return cpu_eth_init(bis);
+}
+
 int board_init(void)
 {
-	/* adress of boot parameters */
+	/* address of boot parameters */
 	gd->bd->bi_boot_params = mvebu_sdram_bar(0) + 0x100;
 
 	return 0;
 }
-
-static int fdt_get_phy_addr(const char *path)
-{
-	const void *fdt = gd->fdt_blob;
-	const u32 *reg;
-	const u32 *val;
-	int node, phandle, addr;
-
-	/* Find the node by its full path */
-	node = fdt_path_offset(fdt, path);
-	if (node >= 0) {
-		/* Look up phy-handle */
-		val = fdt_getprop(fdt, node, "phy-handle", NULL);
-		if (val) {
-			phandle = fdt32_to_cpu(*val);
-			if (!phandle)
-				return -1;
-			/* Follow it to its node */
-			node = fdt_node_offset_by_phandle(fdt, phandle);
-			if (node) {
-				/* Look up reg */
-				reg = fdt_getprop(fdt, node, "reg", NULL);
-				if (reg) {
-					addr = fdt32_to_cpu(*reg);
-					return addr;
-				}
-			}
-		}
-	}
-	return -1;
-}
-
-#ifdef CONFIG_RESET_PHY_R
-void mv_phy_88e1116_init(const char *name, const char *path)
-{
-	u16 reg;
-	int phyaddr;
-
-	if (miiphy_set_current_dev(name))
-		return;
-
-	phyaddr = fdt_get_phy_addr(path);
-	if (phyaddr < 0)
-		return;
-
-	/*
-	 * Enable RGMII delay on Tx and Rx for CPU port
-	 * Ref: sec 4.7.2 of chip datasheet
-	 */
-	miiphy_write(name, phyaddr, MV88E1116_PGADR_REG, 2);
-	miiphy_read(name, phyaddr, MV88E1116_MAC_CTRL2_REG, &reg);
-	reg |= (MV88E1116_RGMII_RXTM_CTRL | MV88E1116_RGMII_TXTM_CTRL);
-	miiphy_write(name, phyaddr, MV88E1116_MAC_CTRL2_REG, reg);
-	miiphy_write(name, phyaddr, MV88E1116_PGADR_REG, 0);
-
-	/* reset the phy */
-	miiphy_reset(name, phyaddr);
-
-	printf("88E1116 Initialized on %s\n", name);
-}
-
-void reset_phy(void)
-{
-	char *eth0_name = "ethernet-controller@72000";
-	char *eth0_path = "/ocp@f1000000/ethernet-controller@72000/ethernet0-port@0";
-	char *eth1_name = "ethernet-controller@76000";
-	char *eth1_path = "/ocp@f1000000/ethernet-controller@76000/ethernet1-port@0";
-
-	/* configure and initialize both PHY's */
-	mv_phy_88e1116_init(eth0_name, eth0_path);
-	mv_phy_88e1116_init(eth1_name, eth1_path);
-}
-#endif /* CONFIG_RESET_PHY_R */
diff --git a/board/Marvell/dreamplug/dreamplug.h b/board/Marvell/dreamplug/dreamplug.h
deleted file mode 100644
index 6f62238..0000000
--- a/board/Marvell/dreamplug/dreamplug.h
+++ /dev/null
@@ -1,25 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0+ */
-/*
- * (C) Copyright 2011
- * Jason Cooper <u-boot@lakedaemon.net>
- *
- * Based on work by:
- * Marvell Semiconductor <www.marvell.com>
- * Written-by: Siddarth Gore <gores@marvell.com>
- */
-
-#ifndef __DREAMPLUG_H
-#define __DREAMPLUG_H
-
-#define DREAMPLUG_OE_LOW	(~(0))
-#define DREAMPLUG_OE_HIGH	(~(0))
-#define DREAMPLUG_OE_VAL_LOW	0
-#define DREAMPLUG_OE_VAL_HIGH	(0xf << 16) /* 4 LED Pins high */
-
-/* PHY related */
-#define MV88E1116_MAC_CTRL2_REG		21
-#define MV88E1116_PGADR_REG		22
-#define MV88E1116_RGMII_TXTM_CTRL	(1 << 4)
-#define MV88E1116_RGMII_RXTM_CTRL	(1 << 5)
-
-#endif /* __DREAMPLUG_H */
diff --git a/board/Seagate/dockstar/dockstar.c b/board/Seagate/dockstar/dockstar.c
index fb69193..d72e3ef 100644
--- a/board/Seagate/dockstar/dockstar.c
+++ b/board/Seagate/dockstar/dockstar.c
@@ -1,5 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0+
 /*
+ * Copyright (C) 2022 Tony Dinh <mibodhi@gmail.com>
  * Copyright (C) 2010  Eric C. Cooper <ecc@cmu.edu>
  *
  * Based on sheevaplug.c originally written by
@@ -11,18 +12,22 @@
 #include <common.h>
 #include <bootstage.h>
 #include <init.h>
-#include <miiphy.h>
-#include <net.h>
+#include <netdev.h>
 #include <asm/arch/soc.h>
 #include <asm/arch/mpp.h>
 #include <asm/arch/cpu.h>
 #include <asm/global_data.h>
 #include <asm/io.h>
 #include <asm/mach-types.h>
-#include "dockstar.h"
+#include <linux/bitops.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
+#define DOCKSTAR_OE_LOW		(~(0))
+#define DOCKSTAR_OE_HIGH	(~(0))
+#define DOCKSTAR_OE_VAL_LOW	BIT(29)	/* USB_PWEN low */
+#define DOCKSTAR_OE_VAL_HIGH	BIT(17)	/* LED pin high */
+
 int board_early_init_f(void)
 {
 	/*
@@ -92,6 +97,11 @@
 	return 0;
 }
 
+int board_eth_init(struct bd_info *bis)
+{
+	return cpu_eth_init(bis);
+}
+
 int board_init(void)
 {
 	/*
@@ -105,53 +115,21 @@
 	return 0;
 }
 
-#ifdef CONFIG_RESET_PHY_R
-/* Configure and enable MV88E1116 PHY */
-void reset_phy(void)
-{
-	u16 reg;
-	u16 devadr;
-	char *name = "egiga0";
-
-	if (miiphy_set_current_dev(name))
-		return;
-
-	/* command to read PHY dev address */
-	if (miiphy_read(name, 0xEE, 0xEE, (u16 *) &devadr)) {
-		printf("Err..%s could not read PHY dev address\n",
-			__FUNCTION__);
-		return;
-	}
-
-	/*
-	 * Enable RGMII delay on Tx and Rx for CPU port
-	 * Ref: sec 4.7.2 of chip datasheet
-	 */
-	miiphy_write(name, devadr, MV88E1116_PGADR_REG, 2);
-	miiphy_read(name, devadr, MV88E1116_MAC_CTRL_REG, &reg);
-	reg |= (MV88E1116_RGMII_RXTM_CTRL | MV88E1116_RGMII_TXTM_CTRL);
-	miiphy_write(name, devadr, MV88E1116_MAC_CTRL_REG, reg);
-	miiphy_write(name, devadr, MV88E1116_PGADR_REG, 0);
-
-	/* reset the phy */
-	miiphy_reset(name, devadr);
-
-	printf("88E1116 Initialized on %s\n", name);
-}
-#endif /* CONFIG_RESET_PHY_R */
-
 #if CONFIG_IS_ENABLED(BOOTSTAGE)
-#define GREEN_LED	(1 << 14)
-#define ORANGE_LED	(1 << 15)
+#define GREEN_LED	BIT(14)
+#define ORANGE_LED	BIT(15)
 #define BOTH_LEDS	(GREEN_LED | ORANGE_LED)
 #define NEITHER_LED	0
 
 static void set_leds(u32 leds, u32 blinking)
 {
 	struct kwgpio_registers *r = (struct kwgpio_registers *)MVEBU_GPIO1_BASE;
-	u32 oe = readl(&r->oe) | BOTH_LEDS;
+	u32 oe;
+	u32 bl;
+
+	oe = readl(&r->oe) | BOTH_LEDS;
 	writel(oe & ~leds, &r->oe);	/* active low */
-	u32 bl = readl(&r->blink_en) & ~BOTH_LEDS;
+	bl = readl(&r->blink_en) & ~BOTH_LEDS;
 	writel(bl | blinking, &r->blink_en);
 }
 
diff --git a/board/Seagate/dockstar/dockstar.h b/board/Seagate/dockstar/dockstar.h
deleted file mode 100644
index cbb1644..0000000
--- a/board/Seagate/dockstar/dockstar.h
+++ /dev/null
@@ -1,27 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0+ */
-/*
- * Copyright (C) 2010  Eric C. Cooper <ecc@cmu.edu>
- *
- * Based on sheevaplug.h originally written by
- * Prafulla Wadaskar <prafulla@marvell.com>
- * (C) Copyright 2009
- * Marvell Semiconductor <www.marvell.com>
- */
-
-#ifndef __DOCKSTAR_H
-#define __DOCKSTAR_H
-
-#define DOCKSTAR_OE_LOW		(~(0))
-#define DOCKSTAR_OE_HIGH		(~(0))
-#define DOCKSTAR_OE_VAL_LOW		(1 << 29)	/* USB_PWEN low */
-#define DOCKSTAR_OE_VAL_HIGH		(1 << 17)	/* LED pin high */
-
-/* PHY related */
-#define MV88E1116_LED_FCTRL_REG		10
-#define MV88E1116_CPRSP_CR3_REG		21
-#define MV88E1116_MAC_CTRL_REG		21
-#define MV88E1116_PGADR_REG		22
-#define MV88E1116_RGMII_TXTM_CTRL	(1 << 4)
-#define MV88E1116_RGMII_RXTM_CTRL	(1 << 5)
-
-#endif /* __DOCKSTAR_H */
diff --git a/board/advantech/imx8qm_rom7720_a1/imximage.cfg b/board/advantech/imx8qm_rom7720_a1/imximage.cfg
index e324c7c..5ecde0c 100644
--- a/board/advantech/imx8qm_rom7720_a1/imximage.cfg
+++ b/board/advantech/imx8qm_rom7720_a1/imximage.cfg
@@ -3,7 +3,6 @@
  * Copyright 2018 NXP
  */
 
-#define __ASSEMBLY__
 
 /* Boot from SD, sector size 0x400 */
 BOOT_FROM SD 0x400
diff --git a/board/aristainetos/aristainetos2.cfg b/board/aristainetos/aristainetos2.cfg
index d088cc8..2454ac5 100644
--- a/board/aristainetos/aristainetos2.cfg
+++ b/board/aristainetos/aristainetos2.cfg
@@ -21,7 +21,6 @@
  */
 BOOT_FROM      spi
 
-#define __ASSEMBLY__
 #include <config.h>
 #ifdef CONFIG_IMX_HAB
 CSF CONFIG_CSF_SIZE
diff --git a/board/beacon/imx8mm/imximage-8mm-lpddr4.cfg b/board/beacon/imx8mm/imximage-8mm-lpddr4.cfg
index 90573be..2006152 100644
--- a/board/beacon/imx8mm/imximage-8mm-lpddr4.cfg
+++ b/board/beacon/imx8mm/imximage-8mm-lpddr4.cfg
@@ -3,7 +3,6 @@
  * Copyright 2021 NXP
  */
 
-#define __ASSEMBLY__
 
 BOOT_FROM	sd
 LOADER		u-boot-spl-ddr.bin	0x7E1000
diff --git a/board/beacon/imx8mn/imximage-8mn-lpddr4.cfg b/board/beacon/imx8mn/imximage-8mn-lpddr4.cfg
index 7286b26..0edda9c 100644
--- a/board/beacon/imx8mn/imximage-8mn-lpddr4.cfg
+++ b/board/beacon/imx8mn/imximage-8mn-lpddr4.cfg
@@ -3,7 +3,6 @@
  * Copyright 2021 NXP
  */
 
-#define __ASSEMBLY__
 
 ROM_VERSION	v2
 BOOT_FROM	sd
diff --git a/board/boundary/nitrogen6x/nitrogen6dl.cfg b/board/boundary/nitrogen6x/nitrogen6dl.cfg
index 9558e26..a57b16a 100644
--- a/board/boundary/nitrogen6x/nitrogen6dl.cfg
+++ b/board/boundary/nitrogen6x/nitrogen6dl.cfg
@@ -17,7 +17,6 @@
  */
 BOOT_FROM      spi
 
-#define __ASSEMBLY__
 #include <config.h>
 #ifdef CONFIG_IMX_HAB
 CSF CONFIG_CSF_SIZE
diff --git a/board/boundary/nitrogen6x/nitrogen6dl2g.cfg b/board/boundary/nitrogen6x/nitrogen6dl2g.cfg
index f5a107c..7379b89 100644
--- a/board/boundary/nitrogen6x/nitrogen6dl2g.cfg
+++ b/board/boundary/nitrogen6x/nitrogen6dl2g.cfg
@@ -17,7 +17,6 @@
  */
 BOOT_FROM      spi
 
-#define __ASSEMBLY__
 #include <config.h>
 #ifdef CONFIG_IMX_HAB
 CSF CONFIG_CSF_SIZE
diff --git a/board/boundary/nitrogen6x/nitrogen6q.cfg b/board/boundary/nitrogen6x/nitrogen6q.cfg
index b0bbf0d..c7029ab 100644
--- a/board/boundary/nitrogen6x/nitrogen6q.cfg
+++ b/board/boundary/nitrogen6x/nitrogen6q.cfg
@@ -17,7 +17,6 @@
  */
 BOOT_FROM      spi
 
-#define __ASSEMBLY__
 #include <config.h>
 #ifdef CONFIG_IMX_HAB
 CSF CONFIG_CSF_SIZE
diff --git a/board/boundary/nitrogen6x/nitrogen6q2g.cfg b/board/boundary/nitrogen6x/nitrogen6q2g.cfg
index 4999254..1d58cd4 100644
--- a/board/boundary/nitrogen6x/nitrogen6q2g.cfg
+++ b/board/boundary/nitrogen6x/nitrogen6q2g.cfg
@@ -17,7 +17,6 @@
  */
 BOOT_FROM      spi
 
-#define __ASSEMBLY__
 #include <config.h>
 #ifdef CONFIG_IMX_HAB
 CSF CONFIG_CSF_SIZE
diff --git a/board/boundary/nitrogen6x/nitrogen6s.cfg b/board/boundary/nitrogen6x/nitrogen6s.cfg
index 16d7784..b16d944 100644
--- a/board/boundary/nitrogen6x/nitrogen6s.cfg
+++ b/board/boundary/nitrogen6x/nitrogen6s.cfg
@@ -17,7 +17,6 @@
  */
 BOOT_FROM      spi
 
-#define __ASSEMBLY__
 #include <config.h>
 #ifdef CONFIG_IMX_HAB
 CSF CONFIG_CSF_SIZE
diff --git a/board/boundary/nitrogen6x/nitrogen6s1g.cfg b/board/boundary/nitrogen6x/nitrogen6s1g.cfg
index 0320078..debec75 100644
--- a/board/boundary/nitrogen6x/nitrogen6s1g.cfg
+++ b/board/boundary/nitrogen6x/nitrogen6s1g.cfg
@@ -17,7 +17,6 @@
  */
 BOOT_FROM      spi
 
-#define __ASSEMBLY__
 #include <config.h>
 #ifdef CONFIG_IMX_HAB
 CSF CONFIG_CSF_SIZE
diff --git a/board/cloudengines/pogo_e02/pogo_e02.c b/board/cloudengines/pogo_e02/pogo_e02.c
index 039fd6e..59e1218 100644
--- a/board/cloudengines/pogo_e02/pogo_e02.c
+++ b/board/cloudengines/pogo_e02/pogo_e02.c
@@ -1,5 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0+
 /*
+ * Copyright (C) 2022 Tony Dinh <mibodhi@gmail.com>
  * Copyright (C) 2012
  * David Purdy <david.c.purdy@gmail.com>
  *
@@ -12,16 +13,21 @@
 #include <common.h>
 #include <init.h>
 #include <log.h>
-#include <miiphy.h>
-#include <net.h>
+#include <netdev.h>
 #include <asm/arch/cpu.h>
 #include <asm/arch/soc.h>
 #include <asm/arch/mpp.h>
 #include <asm/global_data.h>
-#include "pogo_e02.h"
+#include <linux/bitops.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
+/* GPIO configuration */
+#define POGO_E02_OE_LOW			(~(0))
+#define POGO_E02_OE_HIGH		(~(0))
+#define POGO_E02_OE_VAL_LOW		BIT(29)
+#define POGO_E02_OE_VAL_HIGH		0
+
 int board_early_init_f(void)
 {
 	/*
@@ -64,6 +70,11 @@
 	return 0;
 }
 
+int board_eth_init(struct bd_info *bis)
+{
+	return cpu_eth_init(bis);
+}
+
 int board_init(void)
 {
 	/* Boot parameters address */
@@ -71,37 +82,3 @@
 
 	return 0;
 }
-
-#ifdef CONFIG_RESET_PHY_R
-/* Configure and initialize PHY */
-void reset_phy(void)
-{
-	u16 reg;
-	u16 devadr;
-	char *name = "egiga0";
-
-	if (miiphy_set_current_dev(name))
-		return;
-
-	/* command to read PHY dev address */
-	if (miiphy_read(name, 0xEE, 0xEE, (u16 *) &devadr)) {
-		printf("Err..(%s) could not read PHY dev address\n", __func__);
-		return;
-	}
-
-	/*
-	 * Enable RGMII delay on Tx and Rx for CPU port
-	 * Ref: sec 4.7.2 of chip datasheet
-	 */
-	miiphy_write(name, devadr, MV88E1116_PGADR_REG, 2);
-	miiphy_read(name, devadr, MV88E1116_MAC_CTRL_REG, &reg);
-	reg |= (MV88E1116_RGMII_RXTM_CTRL | MV88E1116_RGMII_TXTM_CTRL);
-	miiphy_write(name, devadr, MV88E1116_MAC_CTRL_REG, reg);
-	miiphy_write(name, devadr, MV88E1116_PGADR_REG, 0);
-
-	/* reset the phy */
-	miiphy_reset(name, devadr);
-
-	debug("88E1116 Initialized on %s\n", name);
-}
-#endif /* CONFIG_RESET_PHY_R */
diff --git a/board/cloudengines/pogo_e02/pogo_e02.h b/board/cloudengines/pogo_e02/pogo_e02.h
deleted file mode 100644
index c8397b4..0000000
--- a/board/cloudengines/pogo_e02/pogo_e02.h
+++ /dev/null
@@ -1,29 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0+ */
-/*
- * Copyright (C) 2012
- * David Purdy <david.c.purdy@gmail.com>
- *
- * Based on Kirkwood support:
- * (C) Copyright 2009
- * Marvell Semiconductor <www.marvell.com>
- * Written-by: Prafulla Wadaskar <prafulla@marvell.com>
- */
-
-#ifndef __POGO_E02_H
-#define __POGO_E02_H
-
-/* GPIO configuration */
-#define POGO_E02_OE_LOW				(~(0))
-#define POGO_E02_OE_HIGH			(~(0))
-#define POGO_E02_OE_VAL_LOW			(1 << 29)
-#define POGO_E02_OE_VAL_HIGH			0
-
-/* PHY related */
-#define MV88E1116_LED_FCTRL_REG			10
-#define MV88E1116_CPRSP_CR3_REG			21
-#define MV88E1116_MAC_CTRL_REG			21
-#define MV88E1116_PGADR_REG			22
-#define MV88E1116_RGMII_TXTM_CTRL		(1 << 4)
-#define MV88E1116_RGMII_RXTM_CTRL		(1 << 5)
-
-#endif /* __POGO_E02_H */
diff --git a/board/compulab/imx8mm-cl-iot-gate/imximage-8mm-lpddr4.cfg b/board/compulab/imx8mm-cl-iot-gate/imximage-8mm-lpddr4.cfg
index 4071219..f9ce7f8 100644
--- a/board/compulab/imx8mm-cl-iot-gate/imximage-8mm-lpddr4.cfg
+++ b/board/compulab/imx8mm-cl-iot-gate/imximage-8mm-lpddr4.cfg
@@ -3,7 +3,6 @@
  * Copyright 2021 NXP
  */
 
-#define __ASSEMBLY__
 
 BOOT_FROM	sd
 LOADER		u-boot-spl-ddr.bin	0x7e1000
diff --git a/board/congatec/cgtqmx8/imximage.cfg b/board/congatec/cgtqmx8/imximage.cfg
index e324c7c..5ecde0c 100644
--- a/board/congatec/cgtqmx8/imximage.cfg
+++ b/board/congatec/cgtqmx8/imximage.cfg
@@ -3,7 +3,6 @@
  * Copyright 2018 NXP
  */
 
-#define __ASSEMBLY__
 
 /* Boot from SD, sector size 0x400 */
 BOOT_FROM SD 0x400
diff --git a/board/ea/mx7ulp_com/imximage.cfg b/board/ea/mx7ulp_com/imximage.cfg
index 1b21899..1731da8 100644
--- a/board/ea/mx7ulp_com/imximage.cfg
+++ b/board/ea/mx7ulp_com/imximage.cfg
@@ -9,7 +9,6 @@
  * The syntax is taken as close as possible with the kwbimage
  */
 
-#define __ASSEMBLY__
 #include <config.h>
 
 /* image version */
diff --git a/board/freescale/imx8mm_evk/imximage-8mm-lpddr4.cfg b/board/freescale/imx8mm_evk/imximage-8mm-lpddr4.cfg
index 90573be..2006152 100644
--- a/board/freescale/imx8mm_evk/imximage-8mm-lpddr4.cfg
+++ b/board/freescale/imx8mm_evk/imximage-8mm-lpddr4.cfg
@@ -3,7 +3,6 @@
  * Copyright 2021 NXP
  */
 
-#define __ASSEMBLY__
 
 BOOT_FROM	sd
 LOADER		u-boot-spl-ddr.bin	0x7E1000
diff --git a/board/freescale/imx8mn_evk/imximage-8mn-ddr4.cfg b/board/freescale/imx8mn_evk/imximage-8mn-ddr4.cfg
index 7286b26..0edda9c 100644
--- a/board/freescale/imx8mn_evk/imximage-8mn-ddr4.cfg
+++ b/board/freescale/imx8mn_evk/imximage-8mn-ddr4.cfg
@@ -3,7 +3,6 @@
  * Copyright 2021 NXP
  */
 
-#define __ASSEMBLY__
 
 ROM_VERSION	v2
 BOOT_FROM	sd
diff --git a/board/freescale/imx8mp_evk/imximage-8mp-lpddr4.cfg b/board/freescale/imx8mp_evk/imximage-8mp-lpddr4.cfg
index 4c3ecf5..6dedf17 100644
--- a/board/freescale/imx8mp_evk/imximage-8mp-lpddr4.cfg
+++ b/board/freescale/imx8mp_evk/imximage-8mp-lpddr4.cfg
@@ -3,7 +3,6 @@
  * Copyright 2021 NXP
  */
 
-#define __ASSEMBLY__
 
 ROM_VERSION	v2
 BOOT_FROM	sd
diff --git a/board/freescale/imx8qm_mek/imximage.cfg b/board/freescale/imx8qm_mek/imximage.cfg
index 7dc6b93..7161267 100644
--- a/board/freescale/imx8qm_mek/imximage.cfg
+++ b/board/freescale/imx8qm_mek/imximage.cfg
@@ -3,7 +3,6 @@
  * Copyright 2018 NXP
  */
 
-#define __ASSEMBLY__
 
 /* Boot from SD, sector size 0x400 */
 BOOT_FROM SD 0x400
diff --git a/board/freescale/imx8qm_mek/uboot-container.cfg b/board/freescale/imx8qm_mek/uboot-container.cfg
index 6cc47cd..93c5d39 100644
--- a/board/freescale/imx8qm_mek/uboot-container.cfg
+++ b/board/freescale/imx8qm_mek/uboot-container.cfg
@@ -3,7 +3,6 @@
  * Copyright 2019 NXP
  */
 
-#define __ASSEMBLY__
 
 /* This file is to create a container image could be loaded by SPL */
 BOOT_FROM SD 0x400
diff --git a/board/freescale/imx8qxp_mek/imximage.cfg b/board/freescale/imx8qxp_mek/imximage.cfg
index cd747d2..89a4736 100644
--- a/board/freescale/imx8qxp_mek/imximage.cfg
+++ b/board/freescale/imx8qxp_mek/imximage.cfg
@@ -6,7 +6,6 @@
  * and create imx8image boot image
  */
 
-#define __ASSEMBLY__
 
 /* Boot from SD, sector size 0x400 */
 BOOT_FROM SD 0x400
diff --git a/board/freescale/imx8qxp_mek/uboot-container.cfg b/board/freescale/imx8qxp_mek/uboot-container.cfg
index 8165811..b53896f 100644
--- a/board/freescale/imx8qxp_mek/uboot-container.cfg
+++ b/board/freescale/imx8qxp_mek/uboot-container.cfg
@@ -3,7 +3,6 @@
  * Copyright 2019 NXP
  */
 
-#define __ASSEMBLY__
 
 /* This file is to create a container image could be loaded by SPL */
 BOOT_FROM SD 0x400
diff --git a/board/freescale/imxrt1020-evk/imximage.cfg b/board/freescale/imxrt1020-evk/imximage.cfg
index 9bcc2c1..0ed7147 100644
--- a/board/freescale/imxrt1020-evk/imximage.cfg
+++ b/board/freescale/imxrt1020-evk/imximage.cfg
@@ -4,7 +4,6 @@
  * Author(s): Giulio Benetti <giulio.benetti@benettiengineering.com>
  */
 
-#define __ASSEMBLY__
 #include <config.h>
 
 /* image version */
diff --git a/board/freescale/imxrt1050-evk/imximage.cfg b/board/freescale/imxrt1050-evk/imximage.cfg
index cf1665b..f1f09fd 100644
--- a/board/freescale/imxrt1050-evk/imximage.cfg
+++ b/board/freescale/imxrt1050-evk/imximage.cfg
@@ -4,7 +4,6 @@
  * Author(s): Giulio Benetti <giulio.benetti@benettiengineering.com>
  */
 
-#define __ASSEMBLY__
 #include <config.h>
 
 /* image version */
diff --git a/board/freescale/mx6slevk/imximage.cfg b/board/freescale/mx6slevk/imximage.cfg
index b97761a..64be101 100644
--- a/board/freescale/mx6slevk/imximage.cfg
+++ b/board/freescale/mx6slevk/imximage.cfg
@@ -7,7 +7,6 @@
  *
  * The syntax is taken as close as possible with the kwbimage
  */
-#define __ASSEMBLY__
 #include <config.h>
 
 /* image version */
diff --git a/board/freescale/mx6sllevk/imximage.cfg b/board/freescale/mx6sllevk/imximage.cfg
index 74b3a90..550be3f 100644
--- a/board/freescale/mx6sllevk/imximage.cfg
+++ b/board/freescale/mx6sllevk/imximage.cfg
@@ -8,7 +8,6 @@
  * The syntax is taken as close as possible with the kwbimage
  */
 
-#define __ASSEMBLY__
 #include <config.h>
 
 /* image version */
diff --git a/board/freescale/mx6sxsabreauto/imximage.cfg b/board/freescale/mx6sxsabreauto/imximage.cfg
index 4a0bcc5..da70309 100644
--- a/board/freescale/mx6sxsabreauto/imximage.cfg
+++ b/board/freescale/mx6sxsabreauto/imximage.cfg
@@ -3,7 +3,6 @@
  * Copyright (C) 2014 Freescale Semiconductor, Inc.
  */
 
-#define __ASSEMBLY__
 #include <config.h>
 
 /* image version */
diff --git a/board/freescale/mx6sxsabresd/imximage.cfg b/board/freescale/mx6sxsabresd/imximage.cfg
index 28ffb2f..313ab58 100644
--- a/board/freescale/mx6sxsabresd/imximage.cfg
+++ b/board/freescale/mx6sxsabresd/imximage.cfg
@@ -3,7 +3,6 @@
  * Copyright (C) 2014 Freescale Semiconductor, Inc.
  */
 
-#define __ASSEMBLY__
 #include <config.h>
 
 /* image version */
diff --git a/board/freescale/mx6ullevk/imximage.cfg b/board/freescale/mx6ullevk/imximage.cfg
index 1555039..0c6f444 100644
--- a/board/freescale/mx6ullevk/imximage.cfg
+++ b/board/freescale/mx6ullevk/imximage.cfg
@@ -8,7 +8,6 @@
  * The syntax is taken as close as possible with the kwbimage
  */
 
-#define __ASSEMBLY__
 #include <config.h>
 
 /* image version */
diff --git a/board/freescale/mx7dsabresd/imximage.cfg b/board/freescale/mx7dsabresd/imximage.cfg
index 05446ac..59e66fb 100644
--- a/board/freescale/mx7dsabresd/imximage.cfg
+++ b/board/freescale/mx7dsabresd/imximage.cfg
@@ -8,7 +8,6 @@
  * The syntax is taken as close as possible with the kwbimage
  */
 
-#define __ASSEMBLY__
 #include <config.h>
 
 /* image version */
diff --git a/board/freescale/mx7ulp_evk/imximage.cfg b/board/freescale/mx7ulp_evk/imximage.cfg
index ec36730..62fd79a 100644
--- a/board/freescale/mx7ulp_evk/imximage.cfg
+++ b/board/freescale/mx7ulp_evk/imximage.cfg
@@ -8,7 +8,6 @@
  * The syntax is taken as close as possible with the kwbimage
  */
 
-#define __ASSEMBLY__
 #include <config.h>
 
 /* image version */
diff --git a/board/gateworks/venice/imximage-8mm-lpddr4.cfg b/board/gateworks/venice/imximage-8mm-lpddr4.cfg
index ccaa765..6bc457c 100644
--- a/board/gateworks/venice/imximage-8mm-lpddr4.cfg
+++ b/board/gateworks/venice/imximage-8mm-lpddr4.cfg
@@ -3,7 +3,6 @@
  * Copyright 2021 Gateworks Corporation
  */
 
-#define __ASSEMBLY__
 
 BOOT_FROM	sd
 LOADER		u-boot-spl-ddr.bin	0x7E1000
diff --git a/board/ge/bx50v3/bx50v3.cfg b/board/ge/bx50v3/bx50v3.cfg
index de3955a..1386516 100644
--- a/board/ge/bx50v3/bx50v3.cfg
+++ b/board/ge/bx50v3/bx50v3.cfg
@@ -13,7 +13,6 @@
 IMAGE_VERSION 2
 BOOT_FROM sd
 
-#define __ASSEMBLY__
 #include <config.h>
 #include "asm/arch/mx6-ddr.h"
 #include "asm/arch/iomux.h"
diff --git a/board/iomega/iconnect/iconnect.c b/board/iomega/iconnect/iconnect.c
index 9e123aa..0387160 100644
--- a/board/iomega/iconnect/iconnect.c
+++ b/board/iomega/iconnect/iconnect.c
@@ -1,5 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0+
 /*
+ * Copyright (C) 2022 Tony Dinh <mibodhi@gmail.com>
  * Copyright (C) 2009-2012
  * Wojciech Dubowik <wojciech.dubowik@neratec.com>
  * Luka Perkov <luka@openwrt.org>
@@ -7,15 +8,20 @@
 
 #include <common.h>
 #include <init.h>
-#include <miiphy.h>
+#include <netdev.h>
 #include <asm/arch/cpu.h>
 #include <asm/arch/soc.h>
 #include <asm/arch/mpp.h>
 #include <asm/global_data.h>
-#include "iconnect.h"
+#include <linux/bitops.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
+#define ICONNECT_OE_LOW                 (~BIT(7))
+#define ICONNECT_OE_HIGH                (~BIT(10))
+#define ICONNECT_OE_VAL_LOW             (0)
+#define ICONNECT_OE_VAL_HIGH            BIT(10)
+
 int board_early_init_f(void)
 {
 	/*
@@ -85,9 +91,14 @@
 	return 0;
 }
 
+int board_eth_init(struct bd_info *bis)
+{
+	return cpu_eth_init(bis);
+}
+
 int board_init(void)
 {
-	/* adress of boot parameters */
+	/* address of boot parameters */
 	gd->bd->bi_boot_params = mvebu_sdram_bar(0) + 0x100;
 
 	return 0;
diff --git a/board/iomega/iconnect/iconnect.h b/board/iomega/iconnect/iconnect.h
deleted file mode 100644
index 4f0be71..0000000
--- a/board/iomega/iconnect/iconnect.h
+++ /dev/null
@@ -1,24 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0+ */
-/*
- * Copyright (C) 2009-2012
- * Wojciech Dubowik <wojciech.dubowik@neratec.com>
- * Luka Perkov <luka@openwrt.org>
- */
-
-#ifndef __ICONNECT_H
-#define __ICONNECT_H
-
-#define ICONNECT_OE_LOW			(~(1 << 7))
-#define ICONNECT_OE_HIGH		(~(1 << 10))
-#define ICONNECT_OE_VAL_LOW		(0)
-#define ICONNECT_OE_VAL_HIGH		(1 << 10)
-
-/* PHY related */
-#define MV88E1116_LED_FCTRL_REG		10
-#define MV88E1116_CPRSP_CR3_REG		21
-#define MV88E1116_MAC_CTRL_REG		21
-#define MV88E1116_PGADR_REG		22
-#define MV88E1116_RGMII_TXTM_CTRL	(1 << 4)
-#define MV88E1116_RGMII_RXTM_CTRL	(1 << 5)
-
-#endif /* __ICONNECT_H */
diff --git a/board/kontron/sl-mx8mm/imximage.cfg b/board/kontron/sl-mx8mm/imximage.cfg
index f101f3d..b538026 100644
--- a/board/kontron/sl-mx8mm/imximage.cfg
+++ b/board/kontron/sl-mx8mm/imximage.cfg
@@ -3,7 +3,6 @@
  * Copyright (C) 2019 Kontron Electronics GmbH
  */
 
-#define __ASSEMBLY__
 
 BOOT_FROM	sd
 LOADER		u-boot-spl-ddr.bin	0x7E1000
diff --git a/board/novtech/meerkat96/imximage.cfg b/board/novtech/meerkat96/imximage.cfg
index 86275b8..a67ce53 100644
--- a/board/novtech/meerkat96/imximage.cfg
+++ b/board/novtech/meerkat96/imximage.cfg
@@ -9,7 +9,6 @@
  * The syntax is taken as close as possible with the kwbimage
  */
 
-#define __ASSEMBLY__
 #include <config.h>
 
 /* image version */
diff --git a/board/out4/o4-imx6ull-nano/K4B4G1646D-BCMA.cfg b/board/out4/o4-imx6ull-nano/K4B4G1646D-BCMA.cfg
index c0dcfe9..38c4572 100644
--- a/board/out4/o4-imx6ull-nano/K4B4G1646D-BCMA.cfg
+++ b/board/out4/o4-imx6ull-nano/K4B4G1646D-BCMA.cfg
@@ -2,7 +2,6 @@
 // Copyright (C) 2016 Freescale Semiconductor, Inc.
 // Copyright (C) 2021 Oleh Kravchenko <oleg@kaa.org.ua>
 
-#define __ASSEMBLY__
 #include <config.h>
 
 /* image version */
diff --git a/board/out4/o4-imx6ull-nano/MT41K256M16HA-125E.cfg b/board/out4/o4-imx6ull-nano/MT41K256M16HA-125E.cfg
index 6f823a7..497e7f8 100644
--- a/board/out4/o4-imx6ull-nano/MT41K256M16HA-125E.cfg
+++ b/board/out4/o4-imx6ull-nano/MT41K256M16HA-125E.cfg
@@ -2,7 +2,6 @@
 // Copyright (C) 2016 Freescale Semiconductor, Inc.
 // Copyright (C) 2021 Oleh Kravchenko <oleg@kaa.org.ua>
 
-#define __ASSEMBLY__
 #include <config.h>
 
 /* image version */
diff --git a/board/phytec/phycore_imx8mm/imximage-8mm-sd.cfg b/board/phytec/phycore_imx8mm/imximage-8mm-sd.cfg
index ea74fb7..722e62c 100644
--- a/board/phytec/phycore_imx8mm/imximage-8mm-sd.cfg
+++ b/board/phytec/phycore_imx8mm/imximage-8mm-sd.cfg
@@ -3,7 +3,6 @@
  * Copyright 2021 Phytec Messtechnik GmbH
  */
 
-#define __ASSEMBLY__
 
 BOOT_FROM       sd
 LOADER          u-boot-spl-ddr.bin      0x7E1000
diff --git a/board/phytec/phycore_imx8mp/imximage-8mp-sd.cfg b/board/phytec/phycore_imx8mp/imximage-8mp-sd.cfg
index 4c3ecf5..6dedf17 100644
--- a/board/phytec/phycore_imx8mp/imximage-8mp-sd.cfg
+++ b/board/phytec/phycore_imx8mp/imximage-8mp-sd.cfg
@@ -3,7 +3,6 @@
  * Copyright 2021 NXP
  */
 
-#define __ASSEMBLY__
 
 ROM_VERSION	v2
 BOOT_FROM	sd
diff --git a/board/ronetix/imx8mq-cm/imximage-8mq-lpddr4.cfg b/board/ronetix/imx8mq-cm/imximage-8mq-lpddr4.cfg
index 268b5ae..fae7ad8 100644
--- a/board/ronetix/imx8mq-cm/imximage-8mq-lpddr4.cfg
+++ b/board/ronetix/imx8mq-cm/imximage-8mq-lpddr4.cfg
@@ -3,7 +3,6 @@
  * Copyright 2021 NXP
  */
 
-#define __ASSEMBLY__
 
 BOOT_FROM	sd
 LOADER		mkimage.flash.mkimage	0x7E1000
\ No newline at end of file
diff --git a/board/siemens/capricorn/imximage.cfg b/board/siemens/capricorn/imximage.cfg
index 9f9df68..fa871ba 100644
--- a/board/siemens/capricorn/imximage.cfg
+++ b/board/siemens/capricorn/imximage.cfg
@@ -6,7 +6,6 @@
  * and create imx8image boot image
  */
 
-#define __ASSEMBLY__
 
 /* Boot from SD, sector size 0x400 */
 BOOT_FROM SD 0x400
diff --git a/board/siemens/capricorn/uboot-container.cfg b/board/siemens/capricorn/uboot-container.cfg
index 8165811..b53896f 100644
--- a/board/siemens/capricorn/uboot-container.cfg
+++ b/board/siemens/capricorn/uboot-container.cfg
@@ -3,7 +3,6 @@
  * Copyright 2019 NXP
  */
 
-#define __ASSEMBLY__
 
 /* This file is to create a container image could be loaded by SPL */
 BOOT_FROM SD 0x400
diff --git a/board/softing/vining_2000/imximage.cfg b/board/softing/vining_2000/imximage.cfg
index f6f59dd..300aafc 100644
--- a/board/softing/vining_2000/imximage.cfg
+++ b/board/softing/vining_2000/imximage.cfg
@@ -4,7 +4,6 @@
  * Copyright (C) 2017-2019 softing automotive electronics gmbH
  */
 
-#define __ASSEMBLY__
 #include <config.h>
 
 /* image version */
diff --git a/board/somlabs/visionsom-6ull/imximage.cfg b/board/somlabs/visionsom-6ull/imximage.cfg
index b49a2df..370b303 100644
--- a/board/somlabs/visionsom-6ull/imximage.cfg
+++ b/board/somlabs/visionsom-6ull/imximage.cfg
@@ -9,7 +9,6 @@
  * The syntax is taken as close as possible with the kwbimage
  */
 
-#define __ASSEMBLY__
 #include <config.h>
 
 /* image version */
diff --git a/board/storopack/smegw01/imximage.cfg b/board/storopack/smegw01/imximage.cfg
index 5ebeea5..f862828 100644
--- a/board/storopack/smegw01/imximage.cfg
+++ b/board/storopack/smegw01/imximage.cfg
@@ -8,7 +8,6 @@
  * The syntax is taken as close as possible with the kwbimage
  */
 
-#define __ASSEMBLY__
 #include <config.h>
 
 IMAGE_VERSION	2
diff --git a/board/tbs/tbs2910/tbs2910.cfg b/board/tbs/tbs2910/tbs2910.cfg
index 3ca807b..2fa7094 100644
--- a/board/tbs/tbs2910/tbs2910.cfg
+++ b/board/tbs/tbs2910/tbs2910.cfg
@@ -3,7 +3,6 @@
  * Copyright (C) 2017 Soeren Moch <smoch@web.de>
  */
 
-#define __ASSEMBLY__
 #include "asm/arch/crm_regs.h"
 #include "asm/arch/iomux.h"
 #include "asm/arch/mx6-ddr.h"
diff --git a/board/technexion/pico-imx6ul/imximage.cfg b/board/technexion/pico-imx6ul/imximage.cfg
index 993c1da..98de178 100644
--- a/board/technexion/pico-imx6ul/imximage.cfg
+++ b/board/technexion/pico-imx6ul/imximage.cfg
@@ -8,7 +8,6 @@
  * The syntax is taken as close as possible with the kwbimage
  */
 
-#define __ASSEMBLY__
 #include <config.h>
 
 /* image version */
diff --git a/board/toradex/apalis-imx8/apalis-imx8-imximage.cfg b/board/toradex/apalis-imx8/apalis-imx8-imximage.cfg
index b8f0f3d..16183f9 100644
--- a/board/toradex/apalis-imx8/apalis-imx8-imximage.cfg
+++ b/board/toradex/apalis-imx8/apalis-imx8-imximage.cfg
@@ -6,7 +6,6 @@
  * and create imx8image boot image
  */
 
-#define __ASSEMBLY__
 
 /* Boot from SD, sector size 0x400 */
 BOOT_FROM EMMC_FASTBOOT 0x400
diff --git a/board/toradex/apalis-imx8x/apalis-imx8x-imximage.cfg b/board/toradex/apalis-imx8x/apalis-imx8x-imximage.cfg
index 58c62d0..c229706 100644
--- a/board/toradex/apalis-imx8x/apalis-imx8x-imximage.cfg
+++ b/board/toradex/apalis-imx8x/apalis-imx8x-imximage.cfg
@@ -6,7 +6,6 @@
  * and create imx8image boot image
  */
 
-#define __ASSEMBLY__
 
 /* Boot from SD, sector size 0x400 */
 BOOT_FROM EMMC_FASTBOOT 0x400
diff --git a/board/toradex/colibri-imx6ull/imximage.cfg b/board/toradex/colibri-imx6ull/imximage.cfg
index e162cff..0d81f9b 100644
--- a/board/toradex/colibri-imx6ull/imximage.cfg
+++ b/board/toradex/colibri-imx6ull/imximage.cfg
@@ -9,7 +9,6 @@
  * The syntax is taken as close as possible with the kwbimage
  */
 
-#define __ASSEMBLY__
 #include <config.h>
 
 /* image version */
diff --git a/board/toradex/colibri-imx8x/colibri-imx8x-imximage.cfg b/board/toradex/colibri-imx8x/colibri-imx8x-imximage.cfg
index 44f6c0c..fa176b0 100644
--- a/board/toradex/colibri-imx8x/colibri-imx8x-imximage.cfg
+++ b/board/toradex/colibri-imx8x/colibri-imx8x-imximage.cfg
@@ -6,7 +6,6 @@
  * and create imx8image boot image
  */
 
-#define __ASSEMBLY__
 
 /* Boot from SD, sector size 0x400 */
 BOOT_FROM EMMC_FASTBOOT 0x400
diff --git a/board/toradex/colibri_imx7/imximage.cfg b/board/toradex/colibri_imx7/imximage.cfg
index bdce48b..41b3577 100644
--- a/board/toradex/colibri_imx7/imximage.cfg
+++ b/board/toradex/colibri_imx7/imximage.cfg
@@ -9,7 +9,6 @@
  * The syntax is taken as close as possible with the kwbimage
  */
 
-#define __ASSEMBLY__
 #include <config.h>
 
 /* image version */
diff --git a/board/toradex/verdin-imx8mm/imximage.cfg b/board/toradex/verdin-imx8mm/imximage.cfg
index fcc9200..0e02e44 100644
--- a/board/toradex/verdin-imx8mm/imximage.cfg
+++ b/board/toradex/verdin-imx8mm/imximage.cfg
@@ -3,7 +3,6 @@
  * Copyright 2020-2021 Toradex
  */
 
-#define __ASSEMBLY__
 
 BOOT_FROM	emmc_fastboot
 LOADER		u-boot-spl-ddr.bin	0x7e1000
diff --git a/board/toradex/verdin-imx8mp/imximage.cfg b/board/toradex/verdin-imx8mp/imximage.cfg
index 7d72de8..969cc73 100644
--- a/board/toradex/verdin-imx8mp/imximage.cfg
+++ b/board/toradex/verdin-imx8mp/imximage.cfg
@@ -3,8 +3,6 @@
  * Copyright 2022 Toradex
  */
 
-#define __ASSEMBLY__
-
 ROM_VERSION	v2
 BOOT_FROM	emmc_fastboot
 LOADER		u-boot-spl-ddr.bin	0x920000
diff --git a/board/tq/tqma6/tqma6dl.cfg b/board/tq/tqma6/tqma6dl.cfg
index 80c7150..8cd1885 100644
--- a/board/tq/tqma6/tqma6dl.cfg
+++ b/board/tq/tqma6/tqma6dl.cfg
@@ -11,7 +11,6 @@
 /* image version */
 IMAGE_VERSION 2
 
-#define __ASSEMBLY__
 #include <config.h>
 
 /*
diff --git a/board/tq/tqma6/tqma6q.cfg b/board/tq/tqma6/tqma6q.cfg
index 82a0a27..a49489a 100644
--- a/board/tq/tqma6/tqma6q.cfg
+++ b/board/tq/tqma6/tqma6q.cfg
@@ -11,7 +11,6 @@
 /* image version */
 IMAGE_VERSION 2
 
-#define __ASSEMBLY__
 #include <config.h>
 
 /*
diff --git a/board/tq/tqma6/tqma6s.cfg b/board/tq/tqma6/tqma6s.cfg
index 9cdbb3c..02f7e10 100644
--- a/board/tq/tqma6/tqma6s.cfg
+++ b/board/tq/tqma6/tqma6s.cfg
@@ -11,7 +11,6 @@
 /* image version */
 IMAGE_VERSION 2
 
-#define __ASSEMBLY__
 #include <config.h>
 
 /*
diff --git a/board/variscite/imx8mn_var_som/imximage-8mn-ddr4.cfg b/board/variscite/imx8mn_var_som/imximage-8mn-ddr4.cfg
index 2083233..a0091cd 100644
--- a/board/variscite/imx8mn_var_som/imximage-8mn-ddr4.cfg
+++ b/board/variscite/imx8mn_var_som/imximage-8mn-ddr4.cfg
@@ -3,8 +3,6 @@
  * Copyright 2021 Collabora Ltd.
  */
 
-#define __ASSEMBLY__
-
 ROM_VERSION	v2
 BOOT_FROM	sd
 LOADER		u-boot-spl-ddr.bin	0x912000
diff --git a/board/warp/imximage.cfg b/board/warp/imximage.cfg
index d952c6f..f6bc604 100644
--- a/board/warp/imximage.cfg
+++ b/board/warp/imximage.cfg
@@ -7,7 +7,6 @@
  *
  * The syntax is taken as close as possible with the kwbimage
  */
-#define __ASSEMBLY__
 #include <config.h>
 
 /* image version */
diff --git a/board/warp7/imximage.cfg b/board/warp7/imximage.cfg
index 9e7d472..ca22ee1 100644
--- a/board/warp7/imximage.cfg
+++ b/board/warp7/imximage.cfg
@@ -8,7 +8,6 @@
  * The syntax is taken as close as possible with the kwbimage
  */
 
-#define __ASSEMBLY__
 #include <config.h>
 
 IMAGE_VERSION	2
diff --git a/cmd/mmc.c b/cmd/mmc.c
index 96d81ff..503dbb6 100644
--- a/cmd/mmc.c
+++ b/cmd/mmc.c
@@ -597,7 +597,7 @@
 				       struct mmc_hwpart_conf *pconf,
 				       char *argv)
 {
-	int ret;
+	int i, ret;
 
 	pconf->user.enh_size = 0;
 
@@ -606,7 +606,7 @@
 		ret = mmc_send_ext_csd(mmc, ext_csd);
 		if (ret)
 			return;
-		/* This value is in 512B block units */
+		/* The enh_size value is in 512B block units */
 		pconf->user.enh_size =
 			((ext_csd[EXT_CSD_MAX_ENH_SIZE_MULT + 2] << 16) +
 			(ext_csd[EXT_CSD_MAX_ENH_SIZE_MULT + 1] << 8) +
@@ -614,6 +614,24 @@
 			ext_csd[EXT_CSD_HC_ERASE_GRP_SIZE] *
 			ext_csd[EXT_CSD_HC_WP_GRP_SIZE];
 		pconf->user.enh_size -= pconf->user.enh_start;
+		for (i = 0; i < ARRAY_SIZE(mmc->capacity_gp); i++) {
+			/*
+			 * If the eMMC already has GP partitions set,
+			 * subtract their size from the maximum USER
+			 * partition size.
+			 *
+			 * Else, if the command was used to configure new
+			 * GP partitions, subtract their size from maximum
+			 * USER partition size.
+			 */
+			if (mmc->capacity_gp[i]) {
+				/* The capacity_gp is in 1B units */
+				pconf->user.enh_size -= mmc->capacity_gp[i] >> 9;
+			} else if (pconf->gp_part[i].size) {
+				/* The gp_part[].size is in 512B units */
+				pconf->user.enh_size -= pconf->gp_part[i].size;
+			}
+		}
 	} else {
 		pconf->user.enh_size = dectoul(argv, NULL);
 	}
diff --git a/common/bloblist.c b/common/bloblist.c
index 056b50c..406073c 100644
--- a/common/bloblist.c
+++ b/common/bloblist.c
@@ -430,18 +430,23 @@
 
 int bloblist_init(void)
 {
+	bool fixed = IS_ENABLED(CONFIG_BLOBLIST_FIXED);
 	int ret = -ENOENT;
 	ulong addr, size;
 	bool expected;
 
 	/**
-	 * Wed expect to find an existing bloblist in the first phase of U-Boot
-	 * that runs
+	 * We don't expect to find an existing bloblist in the first phase of
+	 * U-Boot that runs. Also we have no way to receive the address of an
+	 * allocated bloblist from a previous stage, so it must be at a fixed
+	 * address.
 	 */
-	expected = !u_boot_first_phase();
+	expected = fixed && !u_boot_first_phase();
 	if (spl_prev_phase() == PHASE_TPL && !IS_ENABLED(CONFIG_TPL_BLOBLIST))
 		expected = false;
-	addr = bloblist_addr();
+	if (fixed)
+		addr = IF_ENABLED_INT(CONFIG_BLOBLIST_FIXED,
+				      CONFIG_BLOBLIST_ADDR);
 	size = CONFIG_BLOBLIST_SIZE;
 	if (expected) {
 		ret = bloblist_check(addr, size);
@@ -460,6 +465,8 @@
 			if (!ptr)
 				return log_msg_ret("alloc", -ENOMEM);
 			addr = map_to_sysmem(ptr);
+		} else if (!fixed) {
+			return log_msg_ret("!fixed", ret);
 		}
 		log_debug("Creating new bloblist size %lx at %lx\n", size,
 			  addr);
diff --git a/configs/M5253DEMO_defconfig b/configs/M5253DEMO_defconfig
index 67f9875..348f525 100644
--- a/configs/M5253DEMO_defconfig
+++ b/configs/M5253DEMO_defconfig
@@ -20,6 +20,14 @@
 CONFIG_MAC_PARTITION=y
 CONFIG_ENV_ADDR=0xFF804000
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
+CONFIG_SYS_IDE_MAXBUS=1
+CONFIG_SYS_ATA_STRIDE=4
+CONFIG_SYS_ATA_DATA_OFFSET=0xA0
+CONFIG_SYS_ATA_REG_OFFSET=0xA0
+CONFIG_SYS_ATA_ALT_OFFSET=0xC0
+CONFIG_SYS_ATA_IDE0_OFFSET=0
+CONFIG_ATAPI=y
+CONFIG_IDE_RESET=y
 CONFIG_SYS_I2C_LEGACY=y
 CONFIG_SYS_I2C_FSL=y
 CONFIG_SYS_FSL_I2C_OFFSET=0x280
diff --git a/configs/MPC837XERDB_defconfig b/configs/MPC837XERDB_defconfig
index 192bcae..eac5b74 100644
--- a/configs/MPC837XERDB_defconfig
+++ b/configs/MPC837XERDB_defconfig
@@ -170,6 +170,7 @@
 CONFIG_ENV_ADDR=0xFE080000
 CONFIG_DM=y
 CONFIG_FSL_SATA=y
+CONFIG_SYS_SATA_MAX_DEVICE=2
 CONFIG_SYS_BR0_PRELIM_BOOL=y
 CONFIG_SYS_BR0_PRELIM=0xFE001001
 CONFIG_SYS_OR0_PRELIM=0xFF800193
diff --git a/configs/P1010RDB-PA_36BIT_NAND_defconfig b/configs/P1010RDB-PA_36BIT_NAND_defconfig
index ef7f24b..61fd2a7 100644
--- a/configs/P1010RDB-PA_36BIT_NAND_defconfig
+++ b/configs/P1010RDB-PA_36BIT_NAND_defconfig
@@ -54,6 +54,7 @@
 CONFIG_ENV_IS_IN_NAND=y
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_DM=y
+CONFIG_SYS_SATA_MAX_DEVICE=2
 CONFIG_FSL_CAAM=y
 CONFIG_DDR_CLK_FREQ=66666666
 CONFIG_DM_I2C=y
diff --git a/configs/P1010RDB-PA_36BIT_NOR_defconfig b/configs/P1010RDB-PA_36BIT_NOR_defconfig
index 892a8a6..0e537eb 100644
--- a/configs/P1010RDB-PA_36BIT_NOR_defconfig
+++ b/configs/P1010RDB-PA_36BIT_NOR_defconfig
@@ -36,6 +36,7 @@
 CONFIG_ENV_IS_IN_FLASH=y
 CONFIG_ENV_ADDR=0xEFF20000
 CONFIG_DM=y
+CONFIG_SYS_SATA_MAX_DEVICE=2
 CONFIG_FSL_CAAM=y
 CONFIG_DDR_CLK_FREQ=66666666
 CONFIG_DM_I2C=y
diff --git a/configs/P1010RDB-PA_36BIT_SDCARD_defconfig b/configs/P1010RDB-PA_36BIT_SDCARD_defconfig
index 705d0da..dc113be 100644
--- a/configs/P1010RDB-PA_36BIT_SDCARD_defconfig
+++ b/configs/P1010RDB-PA_36BIT_SDCARD_defconfig
@@ -48,6 +48,7 @@
 CONFIG_ENV_IS_IN_MMC=y
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_DM=y
+CONFIG_SYS_SATA_MAX_DEVICE=2
 CONFIG_FSL_CAAM=y
 CONFIG_DDR_CLK_FREQ=66666666
 CONFIG_DM_I2C=y
diff --git a/configs/P1010RDB-PA_36BIT_SPIFLASH_defconfig b/configs/P1010RDB-PA_36BIT_SPIFLASH_defconfig
index e4ad50f..cd5c80c 100644
--- a/configs/P1010RDB-PA_36BIT_SPIFLASH_defconfig
+++ b/configs/P1010RDB-PA_36BIT_SPIFLASH_defconfig
@@ -50,6 +50,7 @@
 CONFIG_ENV_IS_IN_SPI_FLASH=y
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_DM=y
+CONFIG_SYS_SATA_MAX_DEVICE=2
 CONFIG_FSL_CAAM=y
 CONFIG_DDR_CLK_FREQ=66666666
 CONFIG_DM_I2C=y
diff --git a/configs/P1010RDB-PA_NAND_defconfig b/configs/P1010RDB-PA_NAND_defconfig
index b303c4c..f80a0d9 100644
--- a/configs/P1010RDB-PA_NAND_defconfig
+++ b/configs/P1010RDB-PA_NAND_defconfig
@@ -53,6 +53,7 @@
 CONFIG_ENV_IS_IN_NAND=y
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_DM=y
+CONFIG_SYS_SATA_MAX_DEVICE=2
 CONFIG_FSL_CAAM=y
 CONFIG_DDR_CLK_FREQ=66666666
 CONFIG_DM_I2C=y
diff --git a/configs/P1010RDB-PA_NOR_defconfig b/configs/P1010RDB-PA_NOR_defconfig
index 8db09ba..035aac2 100644
--- a/configs/P1010RDB-PA_NOR_defconfig
+++ b/configs/P1010RDB-PA_NOR_defconfig
@@ -35,6 +35,7 @@
 CONFIG_ENV_IS_IN_FLASH=y
 CONFIG_ENV_ADDR=0xEFF20000
 CONFIG_DM=y
+CONFIG_SYS_SATA_MAX_DEVICE=2
 CONFIG_FSL_CAAM=y
 CONFIG_DDR_CLK_FREQ=66666666
 CONFIG_DM_I2C=y
diff --git a/configs/P1010RDB-PA_SDCARD_defconfig b/configs/P1010RDB-PA_SDCARD_defconfig
index f02757d..cd031d2 100644
--- a/configs/P1010RDB-PA_SDCARD_defconfig
+++ b/configs/P1010RDB-PA_SDCARD_defconfig
@@ -47,6 +47,7 @@
 CONFIG_ENV_IS_IN_MMC=y
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_DM=y
+CONFIG_SYS_SATA_MAX_DEVICE=2
 CONFIG_FSL_CAAM=y
 CONFIG_DDR_CLK_FREQ=66666666
 CONFIG_DM_I2C=y
diff --git a/configs/P1010RDB-PA_SPIFLASH_defconfig b/configs/P1010RDB-PA_SPIFLASH_defconfig
index 9a09473..f339502 100644
--- a/configs/P1010RDB-PA_SPIFLASH_defconfig
+++ b/configs/P1010RDB-PA_SPIFLASH_defconfig
@@ -49,6 +49,7 @@
 CONFIG_ENV_IS_IN_SPI_FLASH=y
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_DM=y
+CONFIG_SYS_SATA_MAX_DEVICE=2
 CONFIG_FSL_CAAM=y
 CONFIG_DDR_CLK_FREQ=66666666
 CONFIG_DM_I2C=y
diff --git a/configs/P1010RDB-PB_36BIT_NAND_defconfig b/configs/P1010RDB-PB_36BIT_NAND_defconfig
index 8582868..ba64f88 100644
--- a/configs/P1010RDB-PB_36BIT_NAND_defconfig
+++ b/configs/P1010RDB-PB_36BIT_NAND_defconfig
@@ -55,6 +55,7 @@
 CONFIG_ENV_IS_IN_NAND=y
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_DM=y
+CONFIG_SYS_SATA_MAX_DEVICE=2
 CONFIG_FSL_CAAM=y
 CONFIG_DDR_CLK_FREQ=66666666
 CONFIG_DM_I2C=y
diff --git a/configs/P1010RDB-PB_36BIT_NOR_defconfig b/configs/P1010RDB-PB_36BIT_NOR_defconfig
index 84173e2..a8e9556 100644
--- a/configs/P1010RDB-PB_36BIT_NOR_defconfig
+++ b/configs/P1010RDB-PB_36BIT_NOR_defconfig
@@ -37,6 +37,7 @@
 CONFIG_ENV_IS_IN_FLASH=y
 CONFIG_ENV_ADDR=0xEFF20000
 CONFIG_DM=y
+CONFIG_SYS_SATA_MAX_DEVICE=2
 CONFIG_FSL_CAAM=y
 CONFIG_DDR_CLK_FREQ=66666666
 CONFIG_DM_I2C=y
diff --git a/configs/P1010RDB-PB_36BIT_SDCARD_defconfig b/configs/P1010RDB-PB_36BIT_SDCARD_defconfig
index 4b0a1ab..8719967 100644
--- a/configs/P1010RDB-PB_36BIT_SDCARD_defconfig
+++ b/configs/P1010RDB-PB_36BIT_SDCARD_defconfig
@@ -49,6 +49,7 @@
 CONFIG_ENV_IS_IN_MMC=y
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_DM=y
+CONFIG_SYS_SATA_MAX_DEVICE=2
 CONFIG_FSL_CAAM=y
 CONFIG_DDR_CLK_FREQ=66666666
 CONFIG_DM_I2C=y
diff --git a/configs/P1010RDB-PB_36BIT_SPIFLASH_defconfig b/configs/P1010RDB-PB_36BIT_SPIFLASH_defconfig
index 986b992..2d646f9 100644
--- a/configs/P1010RDB-PB_36BIT_SPIFLASH_defconfig
+++ b/configs/P1010RDB-PB_36BIT_SPIFLASH_defconfig
@@ -51,6 +51,7 @@
 CONFIG_ENV_IS_IN_SPI_FLASH=y
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_DM=y
+CONFIG_SYS_SATA_MAX_DEVICE=2
 CONFIG_FSL_CAAM=y
 CONFIG_DDR_CLK_FREQ=66666666
 CONFIG_DM_I2C=y
diff --git a/configs/P1010RDB-PB_NAND_defconfig b/configs/P1010RDB-PB_NAND_defconfig
index e436476..f8437ff 100644
--- a/configs/P1010RDB-PB_NAND_defconfig
+++ b/configs/P1010RDB-PB_NAND_defconfig
@@ -54,6 +54,7 @@
 CONFIG_ENV_IS_IN_NAND=y
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_DM=y
+CONFIG_SYS_SATA_MAX_DEVICE=2
 CONFIG_FSL_CAAM=y
 CONFIG_DDR_CLK_FREQ=66666666
 CONFIG_DM_I2C=y
diff --git a/configs/P1010RDB-PB_NOR_defconfig b/configs/P1010RDB-PB_NOR_defconfig
index 62f4c89..b99531c 100644
--- a/configs/P1010RDB-PB_NOR_defconfig
+++ b/configs/P1010RDB-PB_NOR_defconfig
@@ -36,6 +36,7 @@
 CONFIG_ENV_IS_IN_FLASH=y
 CONFIG_ENV_ADDR=0xEFF20000
 CONFIG_DM=y
+CONFIG_SYS_SATA_MAX_DEVICE=2
 CONFIG_FSL_CAAM=y
 CONFIG_DDR_CLK_FREQ=66666666
 CONFIG_DM_I2C=y
diff --git a/configs/P1010RDB-PB_SDCARD_defconfig b/configs/P1010RDB-PB_SDCARD_defconfig
index 9cdb359..ebe2af6 100644
--- a/configs/P1010RDB-PB_SDCARD_defconfig
+++ b/configs/P1010RDB-PB_SDCARD_defconfig
@@ -48,6 +48,7 @@
 CONFIG_ENV_IS_IN_MMC=y
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_DM=y
+CONFIG_SYS_SATA_MAX_DEVICE=2
 CONFIG_FSL_CAAM=y
 CONFIG_DDR_CLK_FREQ=66666666
 CONFIG_DM_I2C=y
diff --git a/configs/P1010RDB-PB_SPIFLASH_defconfig b/configs/P1010RDB-PB_SPIFLASH_defconfig
index 299564c..7893782 100644
--- a/configs/P1010RDB-PB_SPIFLASH_defconfig
+++ b/configs/P1010RDB-PB_SPIFLASH_defconfig
@@ -50,6 +50,7 @@
 CONFIG_ENV_IS_IN_SPI_FLASH=y
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_DM=y
+CONFIG_SYS_SATA_MAX_DEVICE=2
 CONFIG_FSL_CAAM=y
 CONFIG_DDR_CLK_FREQ=66666666
 CONFIG_DM_I2C=y
diff --git a/configs/P2041RDB_NAND_defconfig b/configs/P2041RDB_NAND_defconfig
index 9dc7257..01d6192 100644
--- a/configs/P2041RDB_NAND_defconfig
+++ b/configs/P2041RDB_NAND_defconfig
@@ -40,6 +40,7 @@
 CONFIG_ENV_IS_IN_NAND=y
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_DM=y
+CONFIG_SYS_SATA_MAX_DEVICE=2
 CONFIG_FSL_CAAM=y
 CONFIG_SYS_BR0_PRELIM_BOOL=y
 CONFIG_SYS_BR0_PRELIM=0xFFA00C21
diff --git a/configs/P2041RDB_SDCARD_defconfig b/configs/P2041RDB_SDCARD_defconfig
index 997f461..dc56c79 100644
--- a/configs/P2041RDB_SDCARD_defconfig
+++ b/configs/P2041RDB_SDCARD_defconfig
@@ -41,6 +41,7 @@
 CONFIG_ENV_IS_IN_MMC=y
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_DM=y
+CONFIG_SYS_SATA_MAX_DEVICE=2
 CONFIG_FSL_CAAM=y
 CONFIG_SYS_BR0_PRELIM_BOOL=y
 CONFIG_SYS_BR0_PRELIM=0xE8001001
diff --git a/configs/P2041RDB_SPIFLASH_defconfig b/configs/P2041RDB_SPIFLASH_defconfig
index d54d621..78a2450 100644
--- a/configs/P2041RDB_SPIFLASH_defconfig
+++ b/configs/P2041RDB_SPIFLASH_defconfig
@@ -42,6 +42,7 @@
 CONFIG_ENV_IS_IN_SPI_FLASH=y
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_DM=y
+CONFIG_SYS_SATA_MAX_DEVICE=2
 CONFIG_FSL_CAAM=y
 CONFIG_SYS_BR0_PRELIM_BOOL=y
 CONFIG_SYS_BR0_PRELIM=0xE8001001
diff --git a/configs/P2041RDB_defconfig b/configs/P2041RDB_defconfig
index b2fb18c..f6bf4da 100644
--- a/configs/P2041RDB_defconfig
+++ b/configs/P2041RDB_defconfig
@@ -37,6 +37,7 @@
 CONFIG_ENV_IS_IN_FLASH=y
 CONFIG_ENV_ADDR=0xEFF20000
 CONFIG_DM=y
+CONFIG_SYS_SATA_MAX_DEVICE=2
 CONFIG_FSL_CAAM=y
 CONFIG_SYS_BR0_PRELIM_BOOL=y
 CONFIG_SYS_BR0_PRELIM=0xE8001001
diff --git a/configs/P3041DS_NAND_defconfig b/configs/P3041DS_NAND_defconfig
index 971254a..ec58500 100644
--- a/configs/P3041DS_NAND_defconfig
+++ b/configs/P3041DS_NAND_defconfig
@@ -38,6 +38,7 @@
 CONFIG_ENV_IS_IN_NAND=y
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_DM=y
+CONFIG_SYS_SATA_MAX_DEVICE=2
 CONFIG_FSL_CAAM=y
 CONFIG_DDR_ECC=y
 CONFIG_ECC_INIT_VIA_DDRCONTROLLER=y
diff --git a/configs/P3041DS_SDCARD_defconfig b/configs/P3041DS_SDCARD_defconfig
index 7cf3c22..58a3eae 100644
--- a/configs/P3041DS_SDCARD_defconfig
+++ b/configs/P3041DS_SDCARD_defconfig
@@ -39,6 +39,7 @@
 CONFIG_ENV_IS_IN_MMC=y
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_DM=y
+CONFIG_SYS_SATA_MAX_DEVICE=2
 CONFIG_FSL_CAAM=y
 CONFIG_DDR_ECC=y
 CONFIG_ECC_INIT_VIA_DDRCONTROLLER=y
diff --git a/configs/P3041DS_SPIFLASH_defconfig b/configs/P3041DS_SPIFLASH_defconfig
index 0e810f8..c48976b 100644
--- a/configs/P3041DS_SPIFLASH_defconfig
+++ b/configs/P3041DS_SPIFLASH_defconfig
@@ -40,6 +40,7 @@
 CONFIG_ENV_IS_IN_SPI_FLASH=y
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_DM=y
+CONFIG_SYS_SATA_MAX_DEVICE=2
 CONFIG_FSL_CAAM=y
 CONFIG_DDR_ECC=y
 CONFIG_ECC_INIT_VIA_DDRCONTROLLER=y
diff --git a/configs/P3041DS_defconfig b/configs/P3041DS_defconfig
index db1b5fb..fcc7361 100644
--- a/configs/P3041DS_defconfig
+++ b/configs/P3041DS_defconfig
@@ -35,6 +35,7 @@
 CONFIG_ENV_IS_IN_FLASH=y
 CONFIG_ENV_ADDR=0xEFF20000
 CONFIG_DM=y
+CONFIG_SYS_SATA_MAX_DEVICE=2
 CONFIG_FSL_CAAM=y
 CONFIG_DDR_ECC=y
 CONFIG_ECC_INIT_VIA_DDRCONTROLLER=y
diff --git a/configs/P5040DS_NAND_defconfig b/configs/P5040DS_NAND_defconfig
index 90503b6..279976c 100644
--- a/configs/P5040DS_NAND_defconfig
+++ b/configs/P5040DS_NAND_defconfig
@@ -39,6 +39,7 @@
 CONFIG_ENV_IS_IN_NAND=y
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_DM=y
+CONFIG_SYS_SATA_MAX_DEVICE=2
 CONFIG_FSL_CAAM=y
 CONFIG_DDR_ECC=y
 CONFIG_ECC_INIT_VIA_DDRCONTROLLER=y
diff --git a/configs/P5040DS_SDCARD_defconfig b/configs/P5040DS_SDCARD_defconfig
index 90216f6..34ebc51 100644
--- a/configs/P5040DS_SDCARD_defconfig
+++ b/configs/P5040DS_SDCARD_defconfig
@@ -39,6 +39,7 @@
 CONFIG_ENV_IS_IN_MMC=y
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_DM=y
+CONFIG_SYS_SATA_MAX_DEVICE=2
 CONFIG_FSL_CAAM=y
 CONFIG_DDR_ECC=y
 CONFIG_ECC_INIT_VIA_DDRCONTROLLER=y
diff --git a/configs/P5040DS_SPIFLASH_defconfig b/configs/P5040DS_SPIFLASH_defconfig
index 8b17812..ea8b673 100644
--- a/configs/P5040DS_SPIFLASH_defconfig
+++ b/configs/P5040DS_SPIFLASH_defconfig
@@ -40,6 +40,7 @@
 CONFIG_ENV_IS_IN_SPI_FLASH=y
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_DM=y
+CONFIG_SYS_SATA_MAX_DEVICE=2
 CONFIG_FSL_CAAM=y
 CONFIG_DDR_ECC=y
 CONFIG_ECC_INIT_VIA_DDRCONTROLLER=y
diff --git a/configs/P5040DS_defconfig b/configs/P5040DS_defconfig
index 6836fcf..e9bf7ff 100644
--- a/configs/P5040DS_defconfig
+++ b/configs/P5040DS_defconfig
@@ -35,6 +35,7 @@
 CONFIG_ENV_IS_IN_FLASH=y
 CONFIG_ENV_ADDR=0xEFF20000
 CONFIG_DM=y
+CONFIG_SYS_SATA_MAX_DEVICE=2
 CONFIG_FSL_CAAM=y
 CONFIG_DDR_ECC=y
 CONFIG_ECC_INIT_VIA_DDRCONTROLLER=y
diff --git a/configs/T2080QDS_NAND_defconfig b/configs/T2080QDS_NAND_defconfig
index 521b0cf..1b6ef8a 100644
--- a/configs/T2080QDS_NAND_defconfig
+++ b/configs/T2080QDS_NAND_defconfig
@@ -56,6 +56,7 @@
 CONFIG_ENV_OVERWRITE=y
 CONFIG_ENV_IS_IN_NAND=y
 CONFIG_DM=y
+CONFIG_SYS_SATA_MAX_DEVICE=2
 CONFIG_FSL_CAAM=y
 CONFIG_DYNAMIC_DDR_CLK_FREQ=y
 CONFIG_DDR_ECC=y
diff --git a/configs/T2080QDS_SDCARD_defconfig b/configs/T2080QDS_SDCARD_defconfig
index eb0b341..8ab1c5d 100644
--- a/configs/T2080QDS_SDCARD_defconfig
+++ b/configs/T2080QDS_SDCARD_defconfig
@@ -55,6 +55,7 @@
 CONFIG_ENV_OVERWRITE=y
 CONFIG_ENV_IS_IN_MMC=y
 CONFIG_DM=y
+CONFIG_SYS_SATA_MAX_DEVICE=2
 CONFIG_FSL_CAAM=y
 CONFIG_DYNAMIC_DDR_CLK_FREQ=y
 CONFIG_DDR_ECC=y
diff --git a/configs/T2080QDS_SECURE_BOOT_defconfig b/configs/T2080QDS_SECURE_BOOT_defconfig
index 97bfbd9..a84b7ad 100644
--- a/configs/T2080QDS_SECURE_BOOT_defconfig
+++ b/configs/T2080QDS_SECURE_BOOT_defconfig
@@ -40,6 +40,7 @@
 CONFIG_ENV_OVERWRITE=y
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_DM=y
+CONFIG_SYS_SATA_MAX_DEVICE=2
 CONFIG_DYNAMIC_DDR_CLK_FREQ=y
 CONFIG_DDR_ECC=y
 CONFIG_ECC_INIT_VIA_DDRCONTROLLER=y
diff --git a/configs/T2080QDS_SPIFLASH_defconfig b/configs/T2080QDS_SPIFLASH_defconfig
index a09d147..8fd0248 100644
--- a/configs/T2080QDS_SPIFLASH_defconfig
+++ b/configs/T2080QDS_SPIFLASH_defconfig
@@ -57,6 +57,7 @@
 CONFIG_ENV_OVERWRITE=y
 CONFIG_ENV_IS_IN_SPI_FLASH=y
 CONFIG_DM=y
+CONFIG_SYS_SATA_MAX_DEVICE=2
 CONFIG_FSL_CAAM=y
 CONFIG_DYNAMIC_DDR_CLK_FREQ=y
 CONFIG_DDR_ECC=y
diff --git a/configs/T2080QDS_SRIO_PCIE_BOOT_defconfig b/configs/T2080QDS_SRIO_PCIE_BOOT_defconfig
index db09d3b..f9dbc84 100644
--- a/configs/T2080QDS_SRIO_PCIE_BOOT_defconfig
+++ b/configs/T2080QDS_SRIO_PCIE_BOOT_defconfig
@@ -37,6 +37,7 @@
 CONFIG_ENV_IS_IN_REMOTE=y
 CONFIG_ENV_ADDR=0xFFE20000
 CONFIG_DM=y
+CONFIG_SYS_SATA_MAX_DEVICE=2
 CONFIG_FSL_CAAM=y
 CONFIG_DYNAMIC_DDR_CLK_FREQ=y
 CONFIG_DDR_ECC=y
diff --git a/configs/T2080QDS_defconfig b/configs/T2080QDS_defconfig
index c036d5d..424b3f2 100644
--- a/configs/T2080QDS_defconfig
+++ b/configs/T2080QDS_defconfig
@@ -40,6 +40,7 @@
 CONFIG_ENV_IS_IN_FLASH=y
 CONFIG_ENV_ADDR=0xEFF20000
 CONFIG_DM=y
+CONFIG_SYS_SATA_MAX_DEVICE=2
 CONFIG_FSL_CAAM=y
 CONFIG_DYNAMIC_DDR_CLK_FREQ=y
 CONFIG_DDR_ECC=y
diff --git a/configs/T2080RDB_NAND_defconfig b/configs/T2080RDB_NAND_defconfig
index 17558d4..1c55d30 100644
--- a/configs/T2080RDB_NAND_defconfig
+++ b/configs/T2080RDB_NAND_defconfig
@@ -60,6 +60,7 @@
 CONFIG_ENV_OVERWRITE=y
 CONFIG_ENV_IS_IN_NAND=y
 CONFIG_DM=y
+CONFIG_SYS_SATA_MAX_DEVICE=2
 CONFIG_FSL_CAAM=y
 CONFIG_DDR_CLK_FREQ=133330000
 CONFIG_DDR_ECC=y
diff --git a/configs/T2080RDB_SDCARD_defconfig b/configs/T2080RDB_SDCARD_defconfig
index 949976b..ea9c479 100644
--- a/configs/T2080RDB_SDCARD_defconfig
+++ b/configs/T2080RDB_SDCARD_defconfig
@@ -59,6 +59,7 @@
 CONFIG_ENV_OVERWRITE=y
 CONFIG_ENV_IS_IN_MMC=y
 CONFIG_DM=y
+CONFIG_SYS_SATA_MAX_DEVICE=2
 CONFIG_FSL_CAAM=y
 CONFIG_DDR_CLK_FREQ=133330000
 CONFIG_DDR_ECC=y
diff --git a/configs/T2080RDB_SPIFLASH_defconfig b/configs/T2080RDB_SPIFLASH_defconfig
index 66ca339..5e08b82 100644
--- a/configs/T2080RDB_SPIFLASH_defconfig
+++ b/configs/T2080RDB_SPIFLASH_defconfig
@@ -61,6 +61,7 @@
 CONFIG_ENV_OVERWRITE=y
 CONFIG_ENV_IS_IN_SPI_FLASH=y
 CONFIG_DM=y
+CONFIG_SYS_SATA_MAX_DEVICE=2
 CONFIG_FSL_CAAM=y
 CONFIG_DDR_CLK_FREQ=133330000
 CONFIG_DDR_ECC=y
diff --git a/configs/T2080RDB_defconfig b/configs/T2080RDB_defconfig
index 1e53273..1c1fea6 100644
--- a/configs/T2080RDB_defconfig
+++ b/configs/T2080RDB_defconfig
@@ -44,6 +44,7 @@
 CONFIG_ENV_IS_IN_FLASH=y
 CONFIG_ENV_ADDR=0xEFF20000
 CONFIG_DM=y
+CONFIG_SYS_SATA_MAX_DEVICE=2
 CONFIG_FSL_CAAM=y
 CONFIG_DDR_CLK_FREQ=133330000
 CONFIG_DDR_ECC=y
diff --git a/configs/T2080RDB_revD_NAND_defconfig b/configs/T2080RDB_revD_NAND_defconfig
index 33591c2..ae924b1 100644
--- a/configs/T2080RDB_revD_NAND_defconfig
+++ b/configs/T2080RDB_revD_NAND_defconfig
@@ -61,6 +61,7 @@
 CONFIG_ENV_OVERWRITE=y
 CONFIG_ENV_IS_IN_NAND=y
 CONFIG_DM=y
+CONFIG_SYS_SATA_MAX_DEVICE=2
 CONFIG_FSL_CAAM=y
 CONFIG_DDR_CLK_FREQ=133330000
 CONFIG_DDR_ECC=y
diff --git a/configs/T2080RDB_revD_SDCARD_defconfig b/configs/T2080RDB_revD_SDCARD_defconfig
index 82f6c96..fef0893 100644
--- a/configs/T2080RDB_revD_SDCARD_defconfig
+++ b/configs/T2080RDB_revD_SDCARD_defconfig
@@ -60,6 +60,7 @@
 CONFIG_ENV_OVERWRITE=y
 CONFIG_ENV_IS_IN_MMC=y
 CONFIG_DM=y
+CONFIG_SYS_SATA_MAX_DEVICE=2
 CONFIG_FSL_CAAM=y
 CONFIG_DDR_CLK_FREQ=133330000
 CONFIG_DDR_ECC=y
diff --git a/configs/T2080RDB_revD_SPIFLASH_defconfig b/configs/T2080RDB_revD_SPIFLASH_defconfig
index 075691f..0b7e715 100644
--- a/configs/T2080RDB_revD_SPIFLASH_defconfig
+++ b/configs/T2080RDB_revD_SPIFLASH_defconfig
@@ -62,6 +62,7 @@
 CONFIG_ENV_OVERWRITE=y
 CONFIG_ENV_IS_IN_SPI_FLASH=y
 CONFIG_DM=y
+CONFIG_SYS_SATA_MAX_DEVICE=2
 CONFIG_FSL_CAAM=y
 CONFIG_DDR_CLK_FREQ=133330000
 CONFIG_DDR_ECC=y
diff --git a/configs/T2080RDB_revD_defconfig b/configs/T2080RDB_revD_defconfig
index 1d5628f..c78b21d 100644
--- a/configs/T2080RDB_revD_defconfig
+++ b/configs/T2080RDB_revD_defconfig
@@ -45,6 +45,7 @@
 CONFIG_ENV_IS_IN_FLASH=y
 CONFIG_ENV_ADDR=0xEFF20000
 CONFIG_DM=y
+CONFIG_SYS_SATA_MAX_DEVICE=2
 CONFIG_FSL_CAAM=y
 CONFIG_DDR_CLK_FREQ=133330000
 CONFIG_DDR_ECC=y
diff --git a/configs/T4240RDB_SDCARD_defconfig b/configs/T4240RDB_SDCARD_defconfig
index ef2d1d7..ea6a528 100644
--- a/configs/T4240RDB_SDCARD_defconfig
+++ b/configs/T4240RDB_SDCARD_defconfig
@@ -51,6 +51,7 @@
 CONFIG_ENV_OVERWRITE=y
 CONFIG_ENV_IS_IN_MMC=y
 CONFIG_DM=y
+CONFIG_SYS_SATA_MAX_DEVICE=2
 CONFIG_FSL_CAAM=y
 CONFIG_DDR_CLK_FREQ=133333333
 CONFIG_DDR_ECC=y
diff --git a/configs/T4240RDB_defconfig b/configs/T4240RDB_defconfig
index 6784dd7..e17e8b1 100644
--- a/configs/T4240RDB_defconfig
+++ b/configs/T4240RDB_defconfig
@@ -36,6 +36,7 @@
 CONFIG_ENV_IS_IN_FLASH=y
 CONFIG_ENV_ADDR=0xEFF20000
 CONFIG_DM=y
+CONFIG_SYS_SATA_MAX_DEVICE=2
 CONFIG_FSL_CAAM=y
 CONFIG_DDR_CLK_FREQ=133333333
 CONFIG_DDR_ECC=y
diff --git a/configs/am57xx_hs_evm_usb_defconfig b/configs/am57xx_hs_evm_usb_defconfig
index 7f19d99..10106ab 100644
--- a/configs/am57xx_hs_evm_usb_defconfig
+++ b/configs/am57xx_hs_evm_usb_defconfig
@@ -102,6 +102,7 @@
 CONFIG_PMIC_PALMAS=y
 CONFIG_DM_REGULATOR=y
 CONFIG_DM_REGULATOR_PALMAS=y
+CONFIG_SCSI_AHCI_PLAT=y
 CONFIG_DM_SERIAL=y
 CONFIG_SPI=y
 CONFIG_DM_SPI=y
diff --git a/configs/apalis-imx8_defconfig b/configs/apalis-imx8_defconfig
index 45e0670..43215fa 100644
--- a/configs/apalis-imx8_defconfig
+++ b/configs/apalis-imx8_defconfig
@@ -12,6 +12,7 @@
 CONFIG_DEFAULT_DEVICE_TREE="fsl-imx8qm-apalis"
 CONFIG_TARGET_APALIS_IMX8=y
 CONFIG_DISTRO_DEFAULTS=y
+CONFIG_REMAKE_ELF=y
 CONFIG_SYS_LOAD_ADDR=0x80280000
 CONFIG_FIT=y
 CONFIG_OF_SYSTEM_SETUP=y
diff --git a/configs/apalis-imx8x_defconfig b/configs/apalis-imx8x_defconfig
index 2cd91e1..25da027 100644
--- a/configs/apalis-imx8x_defconfig
+++ b/configs/apalis-imx8x_defconfig
@@ -12,6 +12,7 @@
 CONFIG_DEFAULT_DEVICE_TREE="fsl-imx8qxp-apalis"
 CONFIG_TARGET_APALIS_IMX8X=y
 CONFIG_DISTRO_DEFAULTS=y
+CONFIG_REMAKE_ELF=y
 CONFIG_SYS_LOAD_ADDR=0x89000000
 CONFIG_FIT=y
 CONFIG_OF_SYSTEM_SETUP=y
diff --git a/configs/avnet_ultrazedev_cc_v1_0_ultrazedev_som_v1_0_defconfig b/configs/avnet_ultrazedev_cc_v1_0_ultrazedev_som_v1_0_defconfig
index 3d55cba..083f50e 100644
--- a/configs/avnet_ultrazedev_cc_v1_0_ultrazedev_som_v1_0_defconfig
+++ b/configs/avnet_ultrazedev_cc_v1_0_ultrazedev_som_v1_0_defconfig
@@ -17,6 +17,7 @@
 CONFIG_ZYNQMP_PSU_INIT_ENABLED=y
 CONFIG_DEBUG_UART=y
 CONFIG_DISTRO_DEFAULTS=y
+CONFIG_REMAKE_ELF=y
 CONFIG_SYS_LOAD_ADDR=0x8000000
 CONFIG_FIT=y
 CONFIG_FIT_VERBOSE=y
diff --git a/configs/bananapi-m5_defconfig b/configs/bananapi-m5_defconfig
index 4bf81b2..e61cc90 100644
--- a/configs/bananapi-m5_defconfig
+++ b/configs/bananapi-m5_defconfig
@@ -10,6 +10,7 @@
 CONFIG_DEBUG_UART_CLOCK=24000000
 CONFIG_IDENT_STRING="bpi-m5"
 CONFIG_DEBUG_UART=y
+CONFIG_REMAKE_ELF=y
 CONFIG_SYS_LOAD_ADDR=0x1000000
 CONFIG_OF_BOARD_SETUP=y
 # CONFIG_DISPLAY_CPUINFO is not set
diff --git a/configs/beelink-gsking-x_defconfig b/configs/beelink-gsking-x_defconfig
index e60e754..178afa6 100644
--- a/configs/beelink-gsking-x_defconfig
+++ b/configs/beelink-gsking-x_defconfig
@@ -11,6 +11,7 @@
 CONFIG_DEBUG_UART_CLOCK=24000000
 CONFIG_IDENT_STRING=" beelink"
 CONFIG_DEBUG_UART=y
+CONFIG_REMAKE_ELF=y
 CONFIG_SYS_LOAD_ADDR=0x1000000
 CONFIG_OF_BOARD_SETUP=y
 # CONFIG_DISPLAY_CPUINFO is not set
diff --git a/configs/beelink-gtking_defconfig b/configs/beelink-gtking_defconfig
index 2ec3221..4d6aaa5 100644
--- a/configs/beelink-gtking_defconfig
+++ b/configs/beelink-gtking_defconfig
@@ -11,6 +11,7 @@
 CONFIG_DEBUG_UART_CLOCK=24000000
 CONFIG_IDENT_STRING=" beelink"
 CONFIG_DEBUG_UART=y
+CONFIG_REMAKE_ELF=y
 CONFIG_SYS_LOAD_ADDR=0x1000000
 CONFIG_OF_BOARD_SETUP=y
 # CONFIG_DISPLAY_CPUINFO is not set
diff --git a/configs/beelink-gtkingpro_defconfig b/configs/beelink-gtkingpro_defconfig
index 60d316d..65dab87 100644
--- a/configs/beelink-gtkingpro_defconfig
+++ b/configs/beelink-gtkingpro_defconfig
@@ -11,6 +11,7 @@
 CONFIG_DEBUG_UART_CLOCK=24000000
 CONFIG_IDENT_STRING=" beelink"
 CONFIG_DEBUG_UART=y
+CONFIG_REMAKE_ELF=y
 CONFIG_SYS_LOAD_ADDR=0x1000000
 CONFIG_OF_BOARD_SETUP=y
 # CONFIG_DISPLAY_CPUINFO is not set
diff --git a/configs/bitmain_antminer_s9_defconfig b/configs/bitmain_antminer_s9_defconfig
index 26dce00..7b42b7a 100644
--- a/configs/bitmain_antminer_s9_defconfig
+++ b/configs/bitmain_antminer_s9_defconfig
@@ -15,6 +15,7 @@
 CONFIG_DEBUG_UART_BASE=0xe0001000
 CONFIG_DEBUG_UART_CLOCK=50000000
 CONFIG_DEBUG_UART=y
+CONFIG_REMAKE_ELF=y
 CONFIG_SYS_CUSTOM_LDSCRIPT=y
 CONFIG_SYS_LDSCRIPT="arch/arm/mach-zynq/u-boot.lds"
 CONFIG_SYS_LOAD_ADDR=0x0
diff --git a/configs/cgtqmx8_defconfig b/configs/cgtqmx8_defconfig
index 91b309a..54b2d20 100644
--- a/configs/cgtqmx8_defconfig
+++ b/configs/cgtqmx8_defconfig
@@ -17,6 +17,7 @@
 CONFIG_SPL_SERIAL=y
 CONFIG_SPL_DRIVERS_MISC=y
 CONFIG_SPL=y
+CONFIG_REMAKE_ELF=y
 CONFIG_SYS_LOAD_ADDR=0x80280000
 CONFIG_FIT=y
 CONFIG_SPL_LOAD_FIT=y
diff --git a/configs/colibri-imx8x_defconfig b/configs/colibri-imx8x_defconfig
index a9b0f35..04f7f5b 100644
--- a/configs/colibri-imx8x_defconfig
+++ b/configs/colibri-imx8x_defconfig
@@ -12,6 +12,7 @@
 CONFIG_DEFAULT_DEVICE_TREE="fsl-imx8qxp-colibri"
 CONFIG_TARGET_COLIBRI_IMX8X=y
 CONFIG_DISTRO_DEFAULTS=y
+CONFIG_REMAKE_ELF=y
 CONFIG_SYS_LOAD_ADDR=0x80280000
 CONFIG_FIT=y
 CONFIG_LOG=y
diff --git a/configs/comtrend_ar5315u_ram_defconfig b/configs/comtrend_ar5315u_ram_defconfig
index 2278763..ed25099 100644
--- a/configs/comtrend_ar5315u_ram_defconfig
+++ b/configs/comtrend_ar5315u_ram_defconfig
@@ -13,6 +13,7 @@
 # CONFIG_MIPS_BOOT_ENV_LEGACY is not set
 CONFIG_MIPS_BOOT_FDT=y
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
+CONFIG_REMAKE_ELF=y
 CONFIG_SYS_LOAD_ADDR=0x80100000
 CONFIG_OF_STDOUT_VIA_ALIAS=y
 CONFIG_DISPLAY_CPUINFO=y
diff --git a/configs/comtrend_ar5387un_ram_defconfig b/configs/comtrend_ar5387un_ram_defconfig
index 7497ac2..ea7d7b9 100644
--- a/configs/comtrend_ar5387un_ram_defconfig
+++ b/configs/comtrend_ar5387un_ram_defconfig
@@ -13,6 +13,7 @@
 # CONFIG_MIPS_BOOT_ENV_LEGACY is not set
 CONFIG_MIPS_BOOT_FDT=y
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
+CONFIG_REMAKE_ELF=y
 CONFIG_SYS_LOAD_ADDR=0x80100000
 CONFIG_OF_STDOUT_VIA_ALIAS=y
 CONFIG_DISPLAY_CPUINFO=y
diff --git a/configs/comtrend_ct5361_ram_defconfig b/configs/comtrend_ct5361_ram_defconfig
index d37f9bd..71b4d89 100644
--- a/configs/comtrend_ct5361_ram_defconfig
+++ b/configs/comtrend_ct5361_ram_defconfig
@@ -13,6 +13,7 @@
 # CONFIG_MIPS_BOOT_ENV_LEGACY is not set
 CONFIG_MIPS_BOOT_FDT=y
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
+CONFIG_REMAKE_ELF=y
 CONFIG_SYS_LOAD_ADDR=0x80100000
 CONFIG_OF_STDOUT_VIA_ALIAS=y
 CONFIG_DISPLAY_CPUINFO=y
diff --git a/configs/comtrend_vr3032u_ram_defconfig b/configs/comtrend_vr3032u_ram_defconfig
index c557326..151c623 100644
--- a/configs/comtrend_vr3032u_ram_defconfig
+++ b/configs/comtrend_vr3032u_ram_defconfig
@@ -13,6 +13,7 @@
 # CONFIG_MIPS_BOOT_ENV_LEGACY is not set
 CONFIG_MIPS_BOOT_FDT=y
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
+CONFIG_REMAKE_ELF=y
 CONFIG_SYS_LOAD_ADDR=0x80100000
 CONFIG_OF_STDOUT_VIA_ALIAS=y
 CONFIG_DISPLAY_CPUINFO=y
diff --git a/configs/comtrend_wap5813n_ram_defconfig b/configs/comtrend_wap5813n_ram_defconfig
index 198f13b..722b719 100644
--- a/configs/comtrend_wap5813n_ram_defconfig
+++ b/configs/comtrend_wap5813n_ram_defconfig
@@ -13,6 +13,7 @@
 # CONFIG_MIPS_BOOT_ENV_LEGACY is not set
 CONFIG_MIPS_BOOT_FDT=y
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
+CONFIG_REMAKE_ELF=y
 CONFIG_SYS_LOAD_ADDR=0x80100000
 CONFIG_OF_STDOUT_VIA_ALIAS=y
 CONFIG_DISPLAY_CPUINFO=y
diff --git a/configs/controlcenterdc_defconfig b/configs/controlcenterdc_defconfig
index b6eb955..fa41c5e 100644
--- a/configs/controlcenterdc_defconfig
+++ b/configs/controlcenterdc_defconfig
@@ -77,6 +77,8 @@
 CONFIG_DM_PCI_COMPAT=y
 CONFIG_PCI_MVEBU=y
 CONFIG_SCSI=y
+CONFIG_SCSI_AHCI_PLAT=y
+CONFIG_SYS_SCSI_MAX_SCSI_ID=2
 CONFIG_DEBUG_UART_SHIFT=2
 CONFIG_SYS_NS16550=y
 CONFIG_KIRKWOOD_SPI=y
diff --git a/configs/coreboot64_defconfig b/configs/coreboot64_defconfig
index 8b88a08..933bea6 100644
--- a/configs/coreboot64_defconfig
+++ b/configs/coreboot64_defconfig
@@ -47,6 +47,11 @@
 CONFIG_REGMAP=y
 CONFIG_SYSCON=y
 # CONFIG_ACPIGEN is not set
+CONFIG_SYS_IDE_MAXDEVICE=4
+CONFIG_SYS_ATA_DATA_OFFSET=0
+CONFIG_SYS_ATA_REG_OFFSET=0
+CONFIG_SYS_ATA_ALT_OFFSET=0
+CONFIG_ATAPI=y
 # CONFIG_PCI_PNP is not set
 CONFIG_SOUND=y
 CONFIG_SOUND_I8254=y
diff --git a/configs/coreboot_defconfig b/configs/coreboot_defconfig
index 621b736..dcf8ab3 100644
--- a/configs/coreboot_defconfig
+++ b/configs/coreboot_defconfig
@@ -42,6 +42,11 @@
 CONFIG_REGMAP=y
 CONFIG_SYSCON=y
 # CONFIG_ACPIGEN is not set
+CONFIG_SYS_IDE_MAXDEVICE=4
+CONFIG_SYS_ATA_DATA_OFFSET=0
+CONFIG_SYS_ATA_REG_OFFSET=0
+CONFIG_SYS_ATA_ALT_OFFSET=0
+CONFIG_ATAPI=y
 # CONFIG_PCI_PNP is not set
 CONFIG_SOUND=y
 CONFIG_SOUND_I8254=y
diff --git a/configs/cortina_presidio-asic-base_defconfig b/configs/cortina_presidio-asic-base_defconfig
index a6d7178..b8614ff 100644
--- a/configs/cortina_presidio-asic-base_defconfig
+++ b/configs/cortina_presidio-asic-base_defconfig
@@ -8,6 +8,7 @@
 CONFIG_DM_GPIO=y
 CONFIG_DEFAULT_DEVICE_TREE="ca-presidio-engboard"
 CONFIG_IDENT_STRING="Presidio-SoC"
+CONFIG_REMAKE_ELF=y
 CONFIG_SYS_LOAD_ADDR=0x10000000
 CONFIG_SUPPORT_RAW_INITRD=y
 CONFIG_SHOW_BOOT_PROGRESS=y
diff --git a/configs/cortina_presidio-asic-emmc_defconfig b/configs/cortina_presidio-asic-emmc_defconfig
index 8ba4b67..cbabdab 100644
--- a/configs/cortina_presidio-asic-emmc_defconfig
+++ b/configs/cortina_presidio-asic-emmc_defconfig
@@ -8,6 +8,7 @@
 CONFIG_DM_GPIO=y
 CONFIG_DEFAULT_DEVICE_TREE="ca-presidio-engboard"
 CONFIG_IDENT_STRING="Presidio-SoC"
+CONFIG_REMAKE_ELF=y
 CONFIG_SYS_LOAD_ADDR=0x10000000
 CONFIG_SUPPORT_RAW_INITRD=y
 CONFIG_SHOW_BOOT_PROGRESS=y
diff --git a/configs/cortina_presidio-asic-pnand_defconfig b/configs/cortina_presidio-asic-pnand_defconfig
index 83e3aea..ccc519a 100644
--- a/configs/cortina_presidio-asic-pnand_defconfig
+++ b/configs/cortina_presidio-asic-pnand_defconfig
@@ -8,6 +8,7 @@
 CONFIG_DM_GPIO=y
 CONFIG_DEFAULT_DEVICE_TREE="ca-presidio-engboard"
 CONFIG_IDENT_STRING="Presidio-SoC"
+CONFIG_REMAKE_ELF=y
 CONFIG_SYS_LOAD_ADDR=0x10000000
 CONFIG_SUPPORT_RAW_INITRD=y
 CONFIG_SHOW_BOOT_PROGRESS=y
diff --git a/configs/d2net_v2_defconfig b/configs/d2net_v2_defconfig
index a856202..5e2122a 100644
--- a/configs/d2net_v2_defconfig
+++ b/configs/d2net_v2_defconfig
@@ -47,6 +47,7 @@
 CONFIG_NETCONSOLE=y
 CONFIG_DM=y
 CONFIG_SATA_MV=y
+CONFIG_SYS_SATA_MAX_DEVICE=2
 CONFIG_KIRKWOOD_GPIO=y
 CONFIG_SYS_I2C_LEGACY=y
 CONFIG_SYS_I2C_MVTWSI=y
diff --git a/configs/db-mv784mp-gp_defconfig b/configs/db-mv784mp-gp_defconfig
index 3d0b06f..c42bda2 100644
--- a/configs/db-mv784mp-gp_defconfig
+++ b/configs/db-mv784mp-gp_defconfig
@@ -49,6 +49,7 @@
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_SPL_OF_TRANSLATE=y
 CONFIG_SATA_MV=y
+CONFIG_SYS_SATA_MAX_DEVICE=2
 CONFIG_DM_I2C=y
 CONFIG_SYS_I2C_MVTWSI=y
 # CONFIG_MMC is not set
diff --git a/configs/deneb_defconfig b/configs/deneb_defconfig
index 572d744..3f6d90e 100644
--- a/configs/deneb_defconfig
+++ b/configs/deneb_defconfig
@@ -21,6 +21,7 @@
 CONFIG_IDENT_STRING=" ##v01.06"
 CONFIG_SPL_LOAD_IMX_CONTAINER=y
 CONFIG_IMX_CONTAINER_CFG="board/siemens/capricorn/uboot-container.cfg"
+CONFIG_REMAKE_ELF=y
 CONFIG_SYS_LOAD_ADDR=0x80280000
 CONFIG_OF_BOARD_SETUP=y
 CONFIG_OF_SYSTEM_SETUP=y
diff --git a/configs/dns325_defconfig b/configs/dns325_defconfig
index 144fd30..1d6a24a 100644
--- a/configs/dns325_defconfig
+++ b/configs/dns325_defconfig
@@ -41,6 +41,10 @@
 CONFIG_ENV_IS_IN_NAND=y
 CONFIG_NETCONSOLE=y
 CONFIG_DM=y
+CONFIG_SYS_ATA_STRIDE=4
+CONFIG_SYS_ATA_DATA_OFFSET=0x100
+CONFIG_SYS_ATA_REG_OFFSET=0x100
+CONFIG_SYS_ATA_ALT_OFFSET=0x100
 CONFIG_KIRKWOOD_GPIO=y
 # CONFIG_MMC is not set
 CONFIG_MTD=y
diff --git a/configs/dockstar_defconfig b/configs/dockstar_defconfig
index 6c89a9a..cbc2bf6 100644
--- a/configs/dockstar_defconfig
+++ b/configs/dockstar_defconfig
@@ -2,6 +2,7 @@
 CONFIG_SKIP_LOWLEVEL_INIT=y
 CONFIG_SYS_DCACHE_OFF=y
 CONFIG_ARCH_CPU_INIT=y
+CONFIG_SYS_THUMB_BUILD=y
 CONFIG_ARCH_KIRKWOOD=y
 CONFIG_SYS_KWD_CONFIG="board/Seagate/dockstar/kwbimage.cfg"
 CONFIG_SYS_TEXT_BASE=0x600000
@@ -18,6 +19,7 @@
 CONFIG_BOOTCOMMAND="setenv bootargs ${console} ${mtdparts} ${bootargs_root}; ubi part root; ubifsmount ubi:root; ubifsload 0x800000 ${kernel}; ubifsload 0x1100000 ${initrd}; bootm 0x800000 0x1100000"
 CONFIG_USE_PREBOOT=y
 # CONFIG_DISPLAY_BOARDINFO is not set
+CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="DockStar> "
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_NAND=y
@@ -36,11 +38,14 @@
 CONFIG_OF_CONTROL=y
 CONFIG_ENV_OVERWRITE=y
 CONFIG_ENV_IS_IN_NAND=y
+CONFIG_NET_RANDOM_ETHADDR=y
 CONFIG_NETCONSOLE=y
 CONFIG_DM=y
 # CONFIG_MMC is not set
 CONFIG_MTD=y
 CONFIG_MTD_RAW_NAND=y
+CONFIG_PHY_MARVELL=y
+CONFIG_DM_ETH=y
 CONFIG_MVGBE=y
 CONFIG_MII=y
 CONFIG_SYS_NS16550=y
diff --git a/configs/dragonboard410c_defconfig b/configs/dragonboard410c_defconfig
index 063b6c5..a6a0c66 100644
--- a/configs/dragonboard410c_defconfig
+++ b/configs/dragonboard410c_defconfig
@@ -8,6 +8,7 @@
 CONFIG_DEFAULT_DEVICE_TREE="dragonboard410c"
 CONFIG_IDENT_STRING="\nQualcomm-DragonBoard 410C"
 CONFIG_DISTRO_DEFAULTS=y
+CONFIG_REMAKE_ELF=y
 CONFIG_SYS_LOAD_ADDR=0x80080000
 # CONFIG_ANDROID_BOOT_IMAGE is not set
 CONFIG_FIT=y
diff --git a/configs/dreamplug_defconfig b/configs/dreamplug_defconfig
index 557013d..72ab695 100644
--- a/configs/dreamplug_defconfig
+++ b/configs/dreamplug_defconfig
@@ -41,10 +41,16 @@
 CONFIG_NETCONSOLE=y
 CONFIG_DM=y
 CONFIG_SATA_MV=y
+CONFIG_SYS_SATA_MAX_DEVICE=1
+CONFIG_SYS_ATA_STRIDE=4
+CONFIG_SYS_ATA_DATA_OFFSET=0x100
+CONFIG_SYS_ATA_REG_OFFSET=0x100
+CONFIG_SYS_ATA_ALT_OFFSET=0x100
 # CONFIG_MMC is not set
 CONFIG_MTD=y
 CONFIG_DM_SPI_FLASH=y
 CONFIG_SPI_FLASH_MACRONIX=y
+CONFIG_PHY_MARVELL=y
 CONFIG_DM_ETH=y
 CONFIG_MVGBE=y
 CONFIG_MII=y
diff --git a/configs/ds109_defconfig b/configs/ds109_defconfig
index 8e2aea9..130a927 100644
--- a/configs/ds109_defconfig
+++ b/configs/ds109_defconfig
@@ -39,6 +39,10 @@
 CONFIG_ENV_ADDR=0x3D0000
 CONFIG_NETCONSOLE=y
 CONFIG_DM=y
+CONFIG_SYS_ATA_STRIDE=4
+CONFIG_SYS_ATA_DATA_OFFSET=0x100
+CONFIG_SYS_ATA_REG_OFFSET=0x100
+CONFIG_SYS_ATA_ALT_OFFSET=0x100
 CONFIG_DM_I2C=y
 CONFIG_SYS_I2C_MVTWSI=y
 # CONFIG_MMC is not set
diff --git a/configs/edminiv2_defconfig b/configs/edminiv2_defconfig
index a8f61e4..1108d7c 100644
--- a/configs/edminiv2_defconfig
+++ b/configs/edminiv2_defconfig
@@ -33,6 +33,14 @@
 CONFIG_ENV_IS_IN_FLASH=y
 CONFIG_ENV_ADDR=0xFFF84000
 CONFIG_NETCONSOLE=y
+CONFIG_SYS_IDE_MAXBUS=1
+CONFIG_SYS_IDE_MAXDEVICE=1
+CONFIG_SYS_ATA_BASE_ADDR=0xf1080000
+CONFIG_SYS_ATA_STRIDE=4
+CONFIG_SYS_ATA_DATA_OFFSET=0x100
+CONFIG_SYS_ATA_REG_OFFSET=0x100
+CONFIG_SYS_ATA_ALT_OFFSET=0x100
+CONFIG_SYS_ATA_IDE0_OFFSET=0x4000
 CONFIG_SYS_I2C_LEGACY=y
 CONFIG_SPL_SYS_I2C_LEGACY=y
 CONFIG_SYS_I2C_MVTWSI=y
diff --git a/configs/efi-x86_payload32_defconfig b/configs/efi-x86_payload32_defconfig
index ed6fed2..04573fc 100644
--- a/configs/efi-x86_payload32_defconfig
+++ b/configs/efi-x86_payload32_defconfig
@@ -40,6 +40,11 @@
 CONFIG_REGMAP=y
 CONFIG_SYSCON=y
 # CONFIG_ACPIGEN is not set
+CONFIG_SYS_IDE_MAXDEVICE=4
+CONFIG_SYS_ATA_DATA_OFFSET=0
+CONFIG_SYS_ATA_REG_OFFSET=0
+CONFIG_SYS_ATA_ALT_OFFSET=0
+CONFIG_ATAPI=y
 # CONFIG_PCI_PNP is not set
 # CONFIG_GZIP is not set
 CONFIG_EFI=y
diff --git a/configs/efi-x86_payload64_defconfig b/configs/efi-x86_payload64_defconfig
index 1d4d1f3..df904c8 100644
--- a/configs/efi-x86_payload64_defconfig
+++ b/configs/efi-x86_payload64_defconfig
@@ -40,6 +40,11 @@
 CONFIG_REGMAP=y
 CONFIG_SYSCON=y
 # CONFIG_ACPIGEN is not set
+CONFIG_SYS_IDE_MAXDEVICE=4
+CONFIG_SYS_ATA_DATA_OFFSET=0
+CONFIG_SYS_ATA_REG_OFFSET=0
+CONFIG_SYS_ATA_ALT_OFFSET=0
+CONFIG_ATAPI=y
 # CONFIG_PCI_PNP is not set
 # CONFIG_GZIP is not set
 CONFIG_EFI=y
diff --git a/configs/giedi_defconfig b/configs/giedi_defconfig
index a106b89..6c180b0 100644
--- a/configs/giedi_defconfig
+++ b/configs/giedi_defconfig
@@ -21,6 +21,7 @@
 CONFIG_IDENT_STRING=" ##v01.07"
 CONFIG_SPL_LOAD_IMX_CONTAINER=y
 CONFIG_IMX_CONTAINER_CFG="board/siemens/capricorn/uboot-container.cfg"
+CONFIG_REMAKE_ELF=y
 CONFIG_SYS_LOAD_ADDR=0x80280000
 CONFIG_OF_BOARD_SETUP=y
 CONFIG_OF_SYSTEM_SETUP=y
diff --git a/configs/goflexhome_defconfig b/configs/goflexhome_defconfig
index e6eb00a..8d4cd24 100644
--- a/configs/goflexhome_defconfig
+++ b/configs/goflexhome_defconfig
@@ -45,6 +45,7 @@
 CONFIG_NETCONSOLE=y
 CONFIG_DM=y
 CONFIG_SATA_MV=y
+CONFIG_SYS_SATA_MAX_DEVICE=1
 # CONFIG_MMC is not set
 CONFIG_MTD=y
 CONFIG_MTD_RAW_NAND=y
diff --git a/configs/guruplug_defconfig b/configs/guruplug_defconfig
index e7802af..e304675 100644
--- a/configs/guruplug_defconfig
+++ b/configs/guruplug_defconfig
@@ -43,6 +43,10 @@
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_NETCONSOLE=y
 CONFIG_DM=y
+CONFIG_SYS_ATA_STRIDE=4
+CONFIG_SYS_ATA_DATA_OFFSET=0x100
+CONFIG_SYS_ATA_REG_OFFSET=0x100
+CONFIG_SYS_ATA_ALT_OFFSET=0x100
 # CONFIG_MMC is not set
 CONFIG_MTD=y
 CONFIG_MTD_RAW_NAND=y
diff --git a/configs/highbank_defconfig b/configs/highbank_defconfig
index 3e8bfcf..61a25c2 100644
--- a/configs/highbank_defconfig
+++ b/configs/highbank_defconfig
@@ -29,3 +29,5 @@
 # CONFIG_MMC is not set
 CONFIG_CALXEDA_XGMAC=y
 CONFIG_SCSI=y
+CONFIG_SCSI_AHCI_PLAT=y
+CONFIG_SYS_SCSI_MAX_SCSI_ID=5
diff --git a/configs/hihope_rzg2_defconfig b/configs/hihope_rzg2_defconfig
index 5cc396c..109c1d6 100644
--- a/configs/hihope_rzg2_defconfig
+++ b/configs/hihope_rzg2_defconfig
@@ -10,6 +10,7 @@
 CONFIG_RCAR_GEN3=y
 CONFIG_TARGET_HIHOPE_RZG2=y
 # CONFIG_SPL is not set
+CONFIG_REMAKE_ELF=y
 CONFIG_SYS_LOAD_ADDR=0x58000000
 CONFIG_FIT=y
 CONFIG_SUPPORT_RAW_INITRD=y
diff --git a/configs/hikey_defconfig b/configs/hikey_defconfig
index 12cba86..9f1ce4e 100644
--- a/configs/hikey_defconfig
+++ b/configs/hikey_defconfig
@@ -8,6 +8,7 @@
 CONFIG_DEFAULT_DEVICE_TREE="hi6220-hikey"
 CONFIG_IDENT_STRING="hikey"
 CONFIG_DISTRO_DEFAULTS=y
+CONFIG_REMAKE_ELF=y
 CONFIG_SYS_LOAD_ADDR=0x80000
 CONFIG_BOOTDELAY=10
 CONFIG_USE_BOOTARGS=y
diff --git a/configs/huawei_hg556a_ram_defconfig b/configs/huawei_hg556a_ram_defconfig
index 1a0a13a..9201a00 100644
--- a/configs/huawei_hg556a_ram_defconfig
+++ b/configs/huawei_hg556a_ram_defconfig
@@ -13,6 +13,7 @@
 # CONFIG_MIPS_BOOT_ENV_LEGACY is not set
 CONFIG_MIPS_BOOT_FDT=y
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
+CONFIG_REMAKE_ELF=y
 CONFIG_SYS_LOAD_ADDR=0x80100000
 CONFIG_OF_STDOUT_VIA_ALIAS=y
 CONFIG_DISPLAY_CPUINFO=y
diff --git a/configs/ib62x0_defconfig b/configs/ib62x0_defconfig
index 23a211c..2655124 100644
--- a/configs/ib62x0_defconfig
+++ b/configs/ib62x0_defconfig
@@ -42,6 +42,12 @@
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_NETCONSOLE=y
 CONFIG_DM=y
+CONFIG_SYS_ATA_STRIDE=4
+CONFIG_SYS_ATA_DATA_OFFSET=0x100
+CONFIG_SYS_ATA_REG_OFFSET=0x100
+CONFIG_SYS_ATA_ALT_OFFSET=0x100
+CONFIG_SYS_ATA_IDE0_OFFSET=0x2000
+CONFIG_SYS_ATA_IDE1_OFFSET=0x4000
 # CONFIG_MMC is not set
 CONFIG_MTD=y
 CONFIG_MTD_RAW_NAND=y
diff --git a/configs/iconnect_defconfig b/configs/iconnect_defconfig
index 1c9c77a..336fae2 100644
--- a/configs/iconnect_defconfig
+++ b/configs/iconnect_defconfig
@@ -20,7 +20,8 @@
 CONFIG_USE_PREBOOT=y
 # CONFIG_DISPLAY_BOARDINFO is not set
 CONFIG_BOARD_LATE_INIT=y
-CONFIG_SYS_PROMPT="iconnect => "
+CONFIG_HUSH_PARSER=y
+CONFIG_SYS_PROMPT="iConnect> "
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_NAND=y
 CONFIG_CMD_PCI=y
@@ -39,11 +40,14 @@
 CONFIG_ENV_OVERWRITE=y
 CONFIG_ENV_IS_IN_NAND=y
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
+CONFIG_NET_RANDOM_ETHADDR=y
 CONFIG_NETCONSOLE=y
 CONFIG_DM=y
 # CONFIG_MMC is not set
 CONFIG_MTD=y
 CONFIG_MTD_RAW_NAND=y
+CONFIG_PHY_MARVELL=y
+CONFIG_DM_ETH=y
 CONFIG_MVGBE=y
 CONFIG_MII=y
 CONFIG_PCI=y
diff --git a/configs/imx28_xea_sb_defconfig b/configs/imx28_xea_sb_defconfig
index 8dadae3..332ff3f 100644
--- a/configs/imx28_xea_sb_defconfig
+++ b/configs/imx28_xea_sb_defconfig
@@ -59,14 +59,6 @@
 # CONFIG_SPL_OF_PLATDATA_PARENT is not set
 CONFIG_ENV_OVERWRITE=y
 CONFIG_ENV_IS_IN_SPI_FLASH=y
-CONFIG_USE_ENV_SPI_BUS=y
-CONFIG_ENV_SPI_BUS=3
-CONFIG_USE_ENV_SPI_CS=y
-CONFIG_ENV_SPI_CS=0
-CONFIG_USE_ENV_SPI_MAX_HZ=y
-CONFIG_ENV_SPI_MAX_HZ=40000000
-CONFIG_USE_ENV_SPI_MODE=y
-CONFIG_ENV_SPI_MODE=0x0
 CONFIG_SYS_REDUNDAND_ENVIRONMENT=y
 CONFIG_NET_RANDOM_ETHADDR=y
 CONFIG_DM=y
@@ -80,7 +72,6 @@
 CONFIG_DM_MTD=y
 CONFIG_DM_SPI_FLASH=y
 CONFIG_SF_DEFAULT_BUS=3
-CONFIG_SF_DEFAULT_MODE=0x0
 CONFIG_SF_DEFAULT_SPEED=40000000
 CONFIG_SPI_FLASH_SFDP_SUPPORT=y
 CONFIG_SPI_FLASH_ISSI=y
diff --git a/configs/imx8mn_beacon_2g_defconfig b/configs/imx8mn_beacon_2g_defconfig
index 1766a43..48503f3 100644
--- a/configs/imx8mn_beacon_2g_defconfig
+++ b/configs/imx8mn_beacon_2g_defconfig
@@ -22,6 +22,7 @@
 CONFIG_SPL=y
 CONFIG_SPL_IMX_ROMAPI_LOADADDR=0x48000000
 CONFIG_LTO=y
+CONFIG_REMAKE_ELF=y
 CONFIG_SYS_LOAD_ADDR=0x40480000
 CONFIG_FIT=y
 CONFIG_FIT_EXTERNAL_OFFSET=0x3000
diff --git a/configs/imx8mn_beacon_defconfig b/configs/imx8mn_beacon_defconfig
index 8ac3612..ba8b7b8 100644
--- a/configs/imx8mn_beacon_defconfig
+++ b/configs/imx8mn_beacon_defconfig
@@ -21,6 +21,7 @@
 CONFIG_SPL=y
 CONFIG_SPL_IMX_ROMAPI_LOADADDR=0x48000000
 CONFIG_LTO=y
+CONFIG_REMAKE_ELF=y
 CONFIG_SYS_LOAD_ADDR=0x40480000
 CONFIG_FIT=y
 CONFIG_FIT_EXTERNAL_OFFSET=0x3000
diff --git a/configs/imx8mq_cm_defconfig b/configs/imx8mq_cm_defconfig
index f8a9d70..b272070 100644
--- a/configs/imx8mq_cm_defconfig
+++ b/configs/imx8mq_cm_defconfig
@@ -19,6 +19,7 @@
 CONFIG_SPL=y
 CONFIG_IMX_BOOTAUX=y
 CONFIG_DISTRO_DEFAULTS=y
+CONFIG_REMAKE_ELF=y
 CONFIG_SYS_LOAD_ADDR=0x40480000
 CONFIG_FIT=y
 CONFIG_SPL_FIT_PRINT=y
diff --git a/configs/imx8mq_evk_defconfig b/configs/imx8mq_evk_defconfig
index 389a5cb..323a0f3 100644
--- a/configs/imx8mq_evk_defconfig
+++ b/configs/imx8mq_evk_defconfig
@@ -20,6 +20,7 @@
 CONFIG_SPL=y
 CONFIG_IMX_BOOTAUX=y
 CONFIG_DISTRO_DEFAULTS=y
+CONFIG_REMAKE_ELF=y
 CONFIG_SYS_LOAD_ADDR=0x40480000
 CONFIG_FIT=y
 CONFIG_FIT_EXTERNAL_OFFSET=0x3000
diff --git a/configs/imx8mq_phanbell_defconfig b/configs/imx8mq_phanbell_defconfig
index d5f45a4..a30617d 100644
--- a/configs/imx8mq_phanbell_defconfig
+++ b/configs/imx8mq_phanbell_defconfig
@@ -20,6 +20,7 @@
 CONFIG_SPL_DRIVERS_MISC=y
 CONFIG_SPL=y
 CONFIG_IMX_BOOTAUX=y
+CONFIG_REMAKE_ELF=y
 CONFIG_SYS_LOAD_ADDR=0x40480000
 CONFIG_FIT=y
 CONFIG_FIT_EXTERNAL_OFFSET=0x3000
diff --git a/configs/imx8qm_mek_defconfig b/configs/imx8qm_mek_defconfig
index c58c5ff..6a593f8 100644
--- a/configs/imx8qm_mek_defconfig
+++ b/configs/imx8qm_mek_defconfig
@@ -19,6 +19,7 @@
 CONFIG_SPL=y
 CONFIG_SPL_LOAD_IMX_CONTAINER=y
 CONFIG_IMX_CONTAINER_CFG="board/freescale/imx8qm_mek/uboot-container.cfg"
+CONFIG_REMAKE_ELF=y
 CONFIG_SYS_LOAD_ADDR=0x80280000
 CONFIG_OF_BOARD_SETUP=y
 CONFIG_OF_SYSTEM_SETUP=y
diff --git a/configs/imx8qm_rom7720_a1_4G_defconfig b/configs/imx8qm_rom7720_a1_4G_defconfig
index 0cc30d3..7d6c12c 100644
--- a/configs/imx8qm_rom7720_a1_4G_defconfig
+++ b/configs/imx8qm_rom7720_a1_4G_defconfig
@@ -15,6 +15,7 @@
 CONFIG_SPL_SERIAL=y
 CONFIG_SPL_DRIVERS_MISC=y
 CONFIG_SPL=y
+CONFIG_REMAKE_ELF=y
 CONFIG_SYS_LOAD_ADDR=0x80280000
 CONFIG_FIT=y
 CONFIG_SPL_LOAD_FIT=y
diff --git a/configs/imx8qxp_mek_defconfig b/configs/imx8qxp_mek_defconfig
index 8a336cb..0d5c3f5 100644
--- a/configs/imx8qxp_mek_defconfig
+++ b/configs/imx8qxp_mek_defconfig
@@ -19,6 +19,7 @@
 CONFIG_SPL=y
 CONFIG_SPL_LOAD_IMX_CONTAINER=y
 CONFIG_IMX_CONTAINER_CFG="board/freescale/imx8qxp_mek/uboot-container.cfg"
+CONFIG_REMAKE_ELF=y
 CONFIG_SYS_LOAD_ADDR=0x80280000
 CONFIG_OF_BOARD_SETUP=y
 CONFIG_OF_SYSTEM_SETUP=y
diff --git a/configs/imx8ulp_evk_defconfig b/configs/imx8ulp_evk_defconfig
index b444713..0e2a646 100644
--- a/configs/imx8ulp_evk_defconfig
+++ b/configs/imx8ulp_evk_defconfig
@@ -19,6 +19,7 @@
 CONFIG_SPL_IMX_ROMAPI_LOADADDR=0x88000000
 CONFIG_SPL_LOAD_IMX_CONTAINER=y
 CONFIG_DISTRO_DEFAULTS=y
+CONFIG_REMAKE_ELF=y
 CONFIG_SYS_LOAD_ADDR=0x80480000
 CONFIG_FIT=y
 CONFIG_FIT_VERBOSE=y
diff --git a/configs/inetspace_v2_defconfig b/configs/inetspace_v2_defconfig
index 8779e58..c45156c 100644
--- a/configs/inetspace_v2_defconfig
+++ b/configs/inetspace_v2_defconfig
@@ -47,6 +47,7 @@
 CONFIG_NETCONSOLE=y
 CONFIG_DM=y
 CONFIG_SATA_MV=y
+CONFIG_SYS_SATA_MAX_DEVICE=1
 CONFIG_KIRKWOOD_GPIO=y
 CONFIG_SYS_I2C_LEGACY=y
 CONFIG_SYS_I2C_MVTWSI=y
diff --git a/configs/j721s2_evm_a72_defconfig b/configs/j721s2_evm_a72_defconfig
index 92f668f..f4dc095 100644
--- a/configs/j721s2_evm_a72_defconfig
+++ b/configs/j721s2_evm_a72_defconfig
@@ -1,18 +1,18 @@
 CONFIG_ARM=y
 CONFIG_ARCH_K3=y
+CONFIG_SYS_MALLOC_LEN=0x2000000
+CONFIG_SYS_MALLOC_F_LEN=0x8000
 CONFIG_SPL_GPIO=y
 CONFIG_SPL_LIBCOMMON_SUPPORT=y
 CONFIG_SPL_LIBGENERIC_SUPPORT=y
-CONFIG_SYS_MALLOC_F_LEN=0x8000
 CONFIG_NR_DRAM_BANKS=2
 CONFIG_SOC_K3_J721S2=y
 CONFIG_TARGET_J721S2_A72_EVM=y
 CONFIG_ENV_SIZE=0x20000
 CONFIG_ENV_OFFSET=0x680000
-CONFIG_SYS_MALLOC_LEN=0x2000000
-CONFIG_SYS_SPI_U_BOOT_OFFS=0x280000
 CONFIG_DM_GPIO=y
 CONFIG_SPL_DM_SPI=y
+CONFIG_DEFAULT_DEVICE_TREE="k3-j721s2-common-proc-board"
 CONFIG_SPL_TEXT_BASE=0x80080000
 CONFIG_SPL_MMC=y
 CONFIG_SPL_SERIAL=y
@@ -24,7 +24,6 @@
 CONFIG_SPL_SPI_FLASH_SUPPORT=y
 CONFIG_SPL_SPI=y
 # CONFIG_PSCI_RESET is not set
-CONFIG_DEFAULT_DEVICE_TREE="k3-j721s2-common-proc-board"
 CONFIG_DISTRO_DEFAULTS=y
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
 CONFIG_SPL_LOAD_FIT=y
@@ -47,13 +46,13 @@
 CONFIG_SPL_DM_SPI_FLASH=y
 CONFIG_SPL_NOR_SUPPORT=y
 CONFIG_SPL_DM_RESET=y
-CONFIG_SPL_POWER_SUPPORT=y
 CONFIG_SPL_POWER_DOMAIN=y
 CONFIG_SPL_RAM_SUPPORT=y
 CONFIG_SPL_RAM_DEVICE=y
 # CONFIG_SPL_SPI_FLASH_TINY is not set
 CONFIG_SPL_SPI_FLASH_SFDP_SUPPORT=y
 CONFIG_SPL_SPI_LOAD=y
+CONFIG_SYS_SPI_U_BOOT_OFFS=0x280000
 CONFIG_SPL_THERMAL=y
 CONFIG_SPL_USB_GADGET=y
 CONFIG_SPL_DFU=y
@@ -97,13 +96,13 @@
 CONFIG_SPL_OF_TRANSLATE=y
 CONFIG_CLK=y
 CONFIG_SPL_CLK=y
-CONFIG_CLK_TI_SCI=y
-CONFIG_SYS_DFU_DATA_BUF_SIZE=0x40000
-CONFIG_SYS_DFU_MAX_FILE_SIZE=0x800000
 CONFIG_CLK_CCF=y
+CONFIG_CLK_TI_SCI=y
 CONFIG_DFU_MMC=y
 CONFIG_DFU_RAM=y
 CONFIG_DFU_SF=y
+CONFIG_SYS_DFU_DATA_BUF_SIZE=0x40000
+CONFIG_SYS_DFU_MAX_FILE_SIZE=0x800000
 CONFIG_DMA_CHANNELS=y
 CONFIG_TI_K3_NAVSS_UDMA=y
 CONFIG_USB_FUNCTION_FASTBOOT=y
@@ -120,7 +119,6 @@
 CONFIG_SYS_I2C_OMAP24XX=y
 CONFIG_DM_MAILBOX=y
 CONFIG_K3_SEC_PROXY=y
-CONFIG_DM_MMC=y
 CONFIG_SUPPORT_EMMC_BOOT=y
 CONFIG_MMC_IO_VOLTAGE=y
 CONFIG_MMC_UHS_SUPPORT=y
@@ -133,7 +131,6 @@
 CONFIG_MTD=y
 CONFIG_DM_MTD=y
 CONFIG_MTD_NOR_FLASH=y
-CONFIG_FLASH_CFI_DRIVER=y
 CONFIG_CFI_FLASH=y
 CONFIG_SYS_FLASH_USE_BUFFER_WRITE=y
 CONFIG_FLASH_CFI_MTD=y
@@ -170,8 +167,8 @@
 CONFIG_DM_REGULATOR_GPIO=y
 CONFIG_RAM=y
 CONFIG_SPL_RAM=y
-CONFIG_REMOTEPROC_TI_K3_R5F=y
 CONFIG_REMOTEPROC_TI_K3_DSP=y
+CONFIG_REMOTEPROC_TI_K3_R5F=y
 CONFIG_DM_RESET=y
 CONFIG_RESET_TI_SCI=y
 CONFIG_SCSI=y
@@ -183,13 +180,11 @@
 CONFIG_SPI=y
 CONFIG_DM_SPI=y
 CONFIG_CADENCE_QSPI=y
-CONFIG_CADENCE_QSPI_PHY=y
 CONFIG_SYSRESET=y
 CONFIG_SPL_SYSRESET=y
 CONFIG_SYSRESET_TI_SCI=y
 CONFIG_DM_THERMAL=y
 CONFIG_USB=y
-CONFIG_DM_USB=y
 CONFIG_DM_USB_GADGET=y
 CONFIG_SPL_DM_USB_GADGET=y
 CONFIG_USB_XHCI_HCD=y
diff --git a/configs/j721s2_evm_r5_defconfig b/configs/j721s2_evm_r5_defconfig
index f587ec7..09f832e 100644
--- a/configs/j721s2_evm_r5_defconfig
+++ b/configs/j721s2_evm_r5_defconfig
@@ -1,34 +1,40 @@
-CONFIG_PANIC_HANG=y
 CONFIG_ARM=y
 CONFIG_ARCH_K3=y
+CONFIG_SYS_MALLOC_LEN=0x2000000
+CONFIG_SYS_MALLOC_F_LEN=0x10000
 CONFIG_SPL_GPIO=y
 CONFIG_SPL_LIBCOMMON_SUPPORT=y
 CONFIG_SPL_LIBGENERIC_SUPPORT=y
-CONFIG_SYS_MALLOC_F_LEN=0x10000
 CONFIG_SOC_K3_J721S2=y
 CONFIG_K3_EARLY_CONS=y
 CONFIG_TARGET_J721S2_R5_EVM=y
 CONFIG_ENV_SIZE=0x20000
-CONFIG_SYS_SPI_U_BOOT_OFFS=0x80000
 CONFIG_DM_GPIO=y
 CONFIG_SPL_DM_SPI=y
+CONFIG_DEFAULT_DEVICE_TREE="k3-j721s2-r5-common-proc-board"
 CONFIG_SPL_TEXT_BASE=0x41c00000
 CONFIG_SPL_MMC=y
 CONFIG_SPL_SERIAL=y
 CONFIG_SPL_DRIVERS_MISC=y
 CONFIG_SPL_STACK_R_ADDR=0x82000000
+CONFIG_SPL_SIZE_LIMIT=0x80000
+CONFIG_SPL_SIZE_LIMIT_PROVIDE_STACK=0x4000
 CONFIG_SPL_FS_FAT=y
 CONFIG_SPL_LIBDISK_SUPPORT=y
 CONFIG_SPL_SPI_FLASH_SUPPORT=y
 CONFIG_SPL_SPI=y
-CONFIG_DEFAULT_DEVICE_TREE="k3-j721s2-r5-common-proc-board"
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
 CONFIG_SPL_LOAD_FIT=y
 CONFIG_SPL_LOAD_FIT_ADDRESS=0x80080000
+CONFIG_SPL_FIT_IMAGE_POST_PROCESS=y
 # CONFIG_USE_SPL_FIT_GENERATOR is not set
 CONFIG_USE_BOOTCOMMAND=y
 # CONFIG_DISPLAY_CPUINFO is not set
+CONFIG_SPL_SIZE_LIMIT_SUBTRACT_GD=y
+CONFIG_SPL_SIZE_LIMIT_SUBTRACT_MALLOC=y
+CONFIG_SPL_SYS_REPORT_STACK_F_USAGE=y
 CONFIG_SPL_BOARD_INIT=y
+CONFIG_SPL_SYS_MALLOC_SIMPLE=y
 CONFIG_SPL_STACK_R=y
 CONFIG_SPL_SEPARATE_BSS=y
 CONFIG_SPL_EARLY_BSS=y
@@ -43,7 +49,6 @@
 CONFIG_SPL_DM_SPI_FLASH=y
 CONFIG_SPL_NOR_SUPPORT=y
 CONFIG_SPL_DM_RESET=y
-CONFIG_SPL_POWER_SUPPORT=y
 CONFIG_SPL_POWER_DOMAIN=y
 CONFIG_SPL_RAM_SUPPORT=y
 CONFIG_SPL_RAM_DEVICE=y
@@ -51,10 +56,10 @@
 # CONFIG_SPL_SPI_FLASH_TINY is not set
 CONFIG_SPL_SPI_FLASH_SFDP_SUPPORT=y
 CONFIG_SPL_SPI_LOAD=y
+CONFIG_SYS_SPI_U_BOOT_OFFS=0x80000
 CONFIG_SPL_THERMAL=y
 CONFIG_SPL_USB_GADGET=y
 CONFIG_SPL_DFU=y
-CONFIG_SYS_DFU_DATA_BUF_SIZE=0x40000
 CONFIG_SPL_YMODEM_SUPPORT=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_DFU=y
@@ -78,7 +83,10 @@
 CONFIG_SPL_OF_TRANSLATE=y
 CONFIG_CLK=y
 CONFIG_SPL_CLK=y
-# CONFIG_CLK_TI_SCI is not set
+CONFIG_SPL_CLK_CCF=y
+CONFIG_SPL_CLK_K3_PLL=y
+CONFIG_SPL_CLK_K3=y
+CONFIG_SYS_DFU_DATA_BUF_SIZE=0x40000
 CONFIG_DMA_CHANNELS=y
 CONFIG_TI_K3_NAVSS_UDMA=y
 CONFIG_TI_SCI_PROTOCOL=y
@@ -91,7 +99,6 @@
 CONFIG_K3_SEC_PROXY=y
 CONFIG_FS_LOADER=y
 CONFIG_SPL_FS_LOADER=y
-CONFIG_DM_MMC=y
 CONFIG_SUPPORT_EMMC_BOOT=y
 CONFIG_SPL_MMC_HS400_SUPPORT=y
 CONFIG_MMC_SDHCI=y
@@ -100,7 +107,6 @@
 CONFIG_MTD=y
 CONFIG_DM_MTD=y
 CONFIG_MTD_NOR_FLASH=y
-CONFIG_FLASH_CFI_DRIVER=y
 CONFIG_CFI_FLASH=y
 CONFIG_SYS_FLASH_USE_BUFFER_WRITE=y
 CONFIG_FLASH_CFI_MTD=y
@@ -119,7 +125,7 @@
 # CONFIG_SPL_PINCTRL_GENERIC is not set
 CONFIG_PINCTRL_SINGLE=y
 CONFIG_POWER_DOMAIN=y
-# CONFIG_TI_SCI_POWER_DOMAIN is not set
+CONFIG_TI_POWER_DOMAIN=y
 CONFIG_K3_SYSTEM_CONTROLLER=y
 CONFIG_REMOTEPROC_TI_K3_ARM64=y
 CONFIG_DM_RESET=y
@@ -131,7 +137,6 @@
 CONFIG_SPI=y
 CONFIG_DM_SPI=y
 CONFIG_CADENCE_QSPI=y
-CONFIG_CADENCE_QSPI_PHY=y
 CONFIG_SYSRESET=y
 CONFIG_SPL_SYSRESET=y
 CONFIG_SYSRESET_TI_SCI=y
@@ -140,7 +145,6 @@
 CONFIG_SPL_TIMER=y
 CONFIG_OMAP_TIMER=y
 CONFIG_USB=y
-CONFIG_DM_USB=y
 CONFIG_DM_USB_GADGET=y
 CONFIG_SPL_DM_USB_GADGET=y
 CONFIG_USB_CDNS3=y
@@ -153,20 +157,6 @@
 CONFIG_USB_GADGET_DOWNLOAD=y
 CONFIG_FS_EXT4=y
 CONFIG_FS_FAT_MAX_CLUSTSIZE=16384
-CONFIG_TI_POWER_DOMAIN=y
-CONFIG_SPL_CLK_CCF=y
+CONFIG_PANIC_HANG=y
 CONFIG_LIB_RATIONAL=y
 CONFIG_SPL_LIB_RATIONAL=y
-CONFIG_SPL_CLK_K3_PLL=y
-CONFIG_SPL_CLK_K3=y
-CONFIG_K3_DM_FW=y
-CONFIG_SPL_FIT_IMAGE_POST_PROCESS=y
-CONFIG_OF_LIBFDT=y
-CONFIG_SPL_DM_GPIO=y
-CONFIG_SYS_MALLOC_LEN=0x2000000
-CONFIG_SPL_SIZE_LIMIT_SUBTRACT_GD=y
-CONFIG_SPL_SIZE_LIMIT_SUBTRACT_MALLOC=y
-CONFIG_SPL_SYS_REPORT_STACK_F_USAGE=y
-CONFIG_SPL_SIZE_LIMIT=0x80000
-CONFIG_SPL_SIZE_LIMIT_PROVIDE_STACK=0x4000
-CONFIG_SPL_SYS_MALLOC_SIMPLE=y
diff --git a/configs/jethub_j100_defconfig b/configs/jethub_j100_defconfig
index a81b16c..b1953e3 100644
--- a/configs/jethub_j100_defconfig
+++ b/configs/jethub_j100_defconfig
@@ -12,6 +12,7 @@
 CONFIG_DEBUG_UART_CLOCK=24000000
 CONFIG_IDENT_STRING=" jethubj100"
 CONFIG_DEBUG_UART=y
+CONFIG_REMAKE_ELF=y
 CONFIG_SYS_LOAD_ADDR=0x01000000
 CONFIG_OF_BOARD_SETUP=y
 # CONFIG_DISPLAY_CPUINFO is not set
diff --git a/configs/jethub_j80_defconfig b/configs/jethub_j80_defconfig
index eb1e4c4..f3a2325 100644
--- a/configs/jethub_j80_defconfig
+++ b/configs/jethub_j80_defconfig
@@ -12,6 +12,7 @@
 CONFIG_DEBUG_UART_CLOCK=24000000
 CONFIG_IDENT_STRING=" jethubj80"
 CONFIG_DEBUG_UART=y
+CONFIG_REMAKE_ELF=y
 CONFIG_SYS_LOAD_ADDR=0x01000000
 CONFIG_OF_BOARD_SETUP=y
 CONFIG_CONSOLE_MUX=y
diff --git a/configs/khadas-vim2_defconfig b/configs/khadas-vim2_defconfig
index 81cff3c..9fbb039 100644
--- a/configs/khadas-vim2_defconfig
+++ b/configs/khadas-vim2_defconfig
@@ -10,6 +10,7 @@
 CONFIG_DEBUG_UART_CLOCK=24000000
 CONFIG_IDENT_STRING=" khadas-vim2"
 CONFIG_DEBUG_UART=y
+CONFIG_REMAKE_ELF=y
 CONFIG_SYS_LOAD_ADDR=0x1000000
 CONFIG_OF_BOARD_SETUP=y
 CONFIG_CONSOLE_MUX=y
diff --git a/configs/khadas-vim3_android_ab_defconfig b/configs/khadas-vim3_android_ab_defconfig
index c5aaaf3..34f352f 100644
--- a/configs/khadas-vim3_android_ab_defconfig
+++ b/configs/khadas-vim3_android_ab_defconfig
@@ -12,6 +12,7 @@
 CONFIG_DEBUG_UART_CLOCK=24000000
 CONFIG_IDENT_STRING=" khadas-vim3"
 CONFIG_DEBUG_UART=y
+CONFIG_REMAKE_ELF=y
 CONFIG_SYS_LOAD_ADDR=0x1000000
 CONFIG_OF_BOARD_SETUP=y
 # CONFIG_DISPLAY_CPUINFO is not set
diff --git a/configs/khadas-vim3_android_defconfig b/configs/khadas-vim3_android_defconfig
index f0b2c20..a694005 100644
--- a/configs/khadas-vim3_android_defconfig
+++ b/configs/khadas-vim3_android_defconfig
@@ -12,6 +12,7 @@
 CONFIG_DEBUG_UART_CLOCK=24000000
 CONFIG_IDENT_STRING=" khadas-vim3"
 CONFIG_DEBUG_UART=y
+CONFIG_REMAKE_ELF=y
 CONFIG_SYS_LOAD_ADDR=0x1000000
 CONFIG_OF_BOARD_SETUP=y
 # CONFIG_DISPLAY_CPUINFO is not set
diff --git a/configs/khadas-vim3_defconfig b/configs/khadas-vim3_defconfig
index 65050ef..5d17cd1 100644
--- a/configs/khadas-vim3_defconfig
+++ b/configs/khadas-vim3_defconfig
@@ -11,6 +11,7 @@
 CONFIG_DEBUG_UART_CLOCK=24000000
 CONFIG_IDENT_STRING=" khadas-vim3"
 CONFIG_DEBUG_UART=y
+CONFIG_REMAKE_ELF=y
 CONFIG_SYS_LOAD_ADDR=0x1000000
 CONFIG_OF_BOARD_SETUP=y
 # CONFIG_DISPLAY_CPUINFO is not set
diff --git a/configs/khadas-vim3l_android_ab_defconfig b/configs/khadas-vim3l_android_ab_defconfig
index 3401c51..4d22db2 100644
--- a/configs/khadas-vim3l_android_ab_defconfig
+++ b/configs/khadas-vim3l_android_ab_defconfig
@@ -12,6 +12,7 @@
 CONFIG_DEBUG_UART_CLOCK=24000000
 CONFIG_IDENT_STRING=" khadas-vim3l"
 CONFIG_DEBUG_UART=y
+CONFIG_REMAKE_ELF=y
 CONFIG_SYS_LOAD_ADDR=0x1000000
 CONFIG_OF_BOARD_SETUP=y
 # CONFIG_DISPLAY_CPUINFO is not set
diff --git a/configs/khadas-vim3l_android_defconfig b/configs/khadas-vim3l_android_defconfig
index 429db2b..e376366 100644
--- a/configs/khadas-vim3l_android_defconfig
+++ b/configs/khadas-vim3l_android_defconfig
@@ -12,6 +12,7 @@
 CONFIG_DEBUG_UART_CLOCK=24000000
 CONFIG_IDENT_STRING=" khadas-vim3l"
 CONFIG_DEBUG_UART=y
+CONFIG_REMAKE_ELF=y
 CONFIG_SYS_LOAD_ADDR=0x1000000
 CONFIG_OF_BOARD_SETUP=y
 # CONFIG_DISPLAY_CPUINFO is not set
diff --git a/configs/khadas-vim3l_defconfig b/configs/khadas-vim3l_defconfig
index b9162c9..f76138f 100644
--- a/configs/khadas-vim3l_defconfig
+++ b/configs/khadas-vim3l_defconfig
@@ -11,6 +11,7 @@
 CONFIG_DEBUG_UART_CLOCK=24000000
 CONFIG_IDENT_STRING=" khadas-vim3l"
 CONFIG_DEBUG_UART=y
+CONFIG_REMAKE_ELF=y
 CONFIG_SYS_LOAD_ADDR=0x1000000
 CONFIG_OF_BOARD_SETUP=y
 # CONFIG_DISPLAY_CPUINFO is not set
diff --git a/configs/khadas-vim_defconfig b/configs/khadas-vim_defconfig
index 81eeff4..93b0fb0 100644
--- a/configs/khadas-vim_defconfig
+++ b/configs/khadas-vim_defconfig
@@ -10,6 +10,7 @@
 CONFIG_DEBUG_UART_CLOCK=24000000
 CONFIG_IDENT_STRING=" khadas-vim"
 CONFIG_DEBUG_UART=y
+CONFIG_REMAKE_ELF=y
 CONFIG_SYS_LOAD_ADDR=0x1000000
 CONFIG_OF_BOARD_SETUP=y
 CONFIG_CONSOLE_MUX=y
diff --git a/configs/kontron_sl28_defconfig b/configs/kontron_sl28_defconfig
index 3895cfc..520ab1b 100644
--- a/configs/kontron_sl28_defconfig
+++ b/configs/kontron_sl28_defconfig
@@ -60,6 +60,7 @@
 CONFIG_NET_RANDOM_ETHADDR=y
 CONFIG_NETCONSOLE=y
 CONFIG_SPL_DM_SEQ_ALIAS=y
+CONFIG_SATA=y
 CONFIG_SCSI_AHCI=y
 CONFIG_SATA_CEVA=y
 CONFIG_FSL_CAAM=y
diff --git a/configs/libretech-ac_defconfig b/configs/libretech-ac_defconfig
index 945521b..be6fbe8 100644
--- a/configs/libretech-ac_defconfig
+++ b/configs/libretech-ac_defconfig
@@ -13,6 +13,7 @@
 CONFIG_DEBUG_UART_CLOCK=24000000
 CONFIG_IDENT_STRING=" libretech-ac"
 CONFIG_DEBUG_UART=y
+CONFIG_REMAKE_ELF=y
 CONFIG_SYS_LOAD_ADDR=0x1000000
 CONFIG_OF_BOARD_SETUP=y
 CONFIG_USE_PREBOOT=y
diff --git a/configs/libretech-cc_defconfig b/configs/libretech-cc_defconfig
index b4413ed..fe678d6 100644
--- a/configs/libretech-cc_defconfig
+++ b/configs/libretech-cc_defconfig
@@ -10,6 +10,7 @@
 CONFIG_DEBUG_UART_CLOCK=24000000
 CONFIG_IDENT_STRING=" libretech-cc"
 CONFIG_DEBUG_UART=y
+CONFIG_REMAKE_ELF=y
 CONFIG_SYS_LOAD_ADDR=0x1000000
 CONFIG_OF_BOARD_SETUP=y
 # CONFIG_DISPLAY_CPUINFO is not set
diff --git a/configs/libretech-cc_v2_defconfig b/configs/libretech-cc_v2_defconfig
index 0dae223..4dd668f 100644
--- a/configs/libretech-cc_v2_defconfig
+++ b/configs/libretech-cc_v2_defconfig
@@ -12,6 +12,7 @@
 CONFIG_DEBUG_UART_CLOCK=24000000
 CONFIG_IDENT_STRING=" libretech-cc-v2"
 CONFIG_DEBUG_UART=y
+CONFIG_REMAKE_ELF=y
 CONFIG_SYS_LOAD_ADDR=0x1000000
 CONFIG_OF_BOARD_SETUP=y
 CONFIG_USE_PREBOOT=y
diff --git a/configs/libretech-s905d-pc_defconfig b/configs/libretech-s905d-pc_defconfig
index ca96191..0ef7028 100644
--- a/configs/libretech-s905d-pc_defconfig
+++ b/configs/libretech-s905d-pc_defconfig
@@ -13,6 +13,7 @@
 CONFIG_DEBUG_UART_CLOCK=24000000
 CONFIG_IDENT_STRING=" libretech-s905d-pc"
 CONFIG_DEBUG_UART=y
+CONFIG_REMAKE_ELF=y
 CONFIG_SYS_LOAD_ADDR=0x1000000
 CONFIG_OF_BOARD_SETUP=y
 CONFIG_USE_PREBOOT=y
diff --git a/configs/libretech-s912-pc_defconfig b/configs/libretech-s912-pc_defconfig
index 02626cb..a4f6d54 100644
--- a/configs/libretech-s912-pc_defconfig
+++ b/configs/libretech-s912-pc_defconfig
@@ -12,6 +12,7 @@
 CONFIG_DEBUG_UART_CLOCK=24000000
 CONFIG_IDENT_STRING=" libretech-s912-pc"
 CONFIG_DEBUG_UART=y
+CONFIG_REMAKE_ELF=y
 CONFIG_SYS_LOAD_ADDR=0x1000000
 CONFIG_OF_BOARD_SETUP=y
 CONFIG_USE_PREBOOT=y
diff --git a/configs/licheepi_nano_defconfig b/configs/licheepi_nano_defconfig
index ecec869..2ac0ef4 100644
--- a/configs/licheepi_nano_defconfig
+++ b/configs/licheepi_nano_defconfig
@@ -1,11 +1,11 @@
 CONFIG_ARM=y
-CONFIG_ARCH_SUNXI=y
-CONFIG_MACH_SUNIV=y
 CONFIG_SKIP_LOWLEVEL_INIT_ONLY=y
 CONFIG_SPL_SKIP_LOWLEVEL_INIT_ONLY=y
-CONFIG_DRAM_CLK=156
 CONFIG_SYS_DCACHE_OFF=y
-CONFIG_DRAM_ZQ=0
-# CONFIG_VIDEO_SUNXI is not set
+CONFIG_ARCH_SUNXI=y
 CONFIG_DEFAULT_DEVICE_TREE="suniv-f1c100s-licheepi-nano"
 CONFIG_SPL=y
+CONFIG_MACH_SUNIV=y
+CONFIG_DRAM_CLK=156
+CONFIG_DRAM_ZQ=0
+# CONFIG_VIDEO_SUNXI is not set
diff --git a/configs/ls1012a2g5rdb_qspi_defconfig b/configs/ls1012a2g5rdb_qspi_defconfig
index 312713e..19387ad 100644
--- a/configs/ls1012a2g5rdb_qspi_defconfig
+++ b/configs/ls1012a2g5rdb_qspi_defconfig
@@ -40,6 +40,7 @@
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_NET_RANDOM_ETHADDR=y
 CONFIG_DM=y
+CONFIG_SATA=y
 CONFIG_SCSI_AHCI=y
 CONFIG_SATA_CEVA=y
 CONFIG_MPC8XXX_GPIO=y
diff --git a/configs/ls1012a2g5rdb_tfa_defconfig b/configs/ls1012a2g5rdb_tfa_defconfig
index 6129881..00e8b10 100644
--- a/configs/ls1012a2g5rdb_tfa_defconfig
+++ b/configs/ls1012a2g5rdb_tfa_defconfig
@@ -40,6 +40,7 @@
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_NET_RANDOM_ETHADDR=y
 CONFIG_DM=y
+CONFIG_SATA=y
 CONFIG_SCSI_AHCI=y
 CONFIG_SATA_CEVA=y
 CONFIG_MPC8XXX_GPIO=y
diff --git a/configs/ls1012afrwy_qspi_SECURE_BOOT_defconfig b/configs/ls1012afrwy_qspi_SECURE_BOOT_defconfig
index cb8b288..6eaf0f5 100644
--- a/configs/ls1012afrwy_qspi_SECURE_BOOT_defconfig
+++ b/configs/ls1012afrwy_qspi_SECURE_BOOT_defconfig
@@ -37,6 +37,7 @@
 CONFIG_ENV_OVERWRITE=y
 CONFIG_NET_RANDOM_ETHADDR=y
 CONFIG_DM=y
+CONFIG_SATA=y
 CONFIG_SATA_CEVA=y
 CONFIG_MPC8XXX_GPIO=y
 CONFIG_DM_I2C=y
diff --git a/configs/ls1012afrwy_qspi_defconfig b/configs/ls1012afrwy_qspi_defconfig
index 610f32c..facbb26 100644
--- a/configs/ls1012afrwy_qspi_defconfig
+++ b/configs/ls1012afrwy_qspi_defconfig
@@ -42,6 +42,7 @@
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_NET_RANDOM_ETHADDR=y
 CONFIG_DM=y
+CONFIG_SATA=y
 CONFIG_SATA_CEVA=y
 CONFIG_MPC8XXX_GPIO=y
 CONFIG_DM_I2C=y
diff --git a/configs/ls1012afrwy_tfa_SECURE_BOOT_defconfig b/configs/ls1012afrwy_tfa_SECURE_BOOT_defconfig
index b3cb6f7..6e2118f 100644
--- a/configs/ls1012afrwy_tfa_SECURE_BOOT_defconfig
+++ b/configs/ls1012afrwy_tfa_SECURE_BOOT_defconfig
@@ -37,6 +37,7 @@
 CONFIG_ENV_OVERWRITE=y
 CONFIG_NET_RANDOM_ETHADDR=y
 CONFIG_DM=y
+CONFIG_SATA=y
 CONFIG_SATA_CEVA=y
 CONFIG_MPC8XXX_GPIO=y
 CONFIG_DM_I2C=y
diff --git a/configs/ls1012afrwy_tfa_defconfig b/configs/ls1012afrwy_tfa_defconfig
index afec07c..5370c32 100644
--- a/configs/ls1012afrwy_tfa_defconfig
+++ b/configs/ls1012afrwy_tfa_defconfig
@@ -41,6 +41,7 @@
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_NET_RANDOM_ETHADDR=y
 CONFIG_DM=y
+CONFIG_SATA=y
 CONFIG_SATA_CEVA=y
 CONFIG_MPC8XXX_GPIO=y
 CONFIG_DM_I2C=y
diff --git a/configs/ls1012aqds_qspi_defconfig b/configs/ls1012aqds_qspi_defconfig
index 93e76d9..bac3f91 100644
--- a/configs/ls1012aqds_qspi_defconfig
+++ b/configs/ls1012aqds_qspi_defconfig
@@ -51,6 +51,7 @@
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_NET_RANDOM_ETHADDR=y
 CONFIG_DM=y
+CONFIG_SATA=y
 CONFIG_SCSI_AHCI=y
 CONFIG_SATA_CEVA=y
 CONFIG_MPC8XXX_GPIO=y
diff --git a/configs/ls1012aqds_tfa_defconfig b/configs/ls1012aqds_tfa_defconfig
index d4d9b8f..057c047 100644
--- a/configs/ls1012aqds_tfa_defconfig
+++ b/configs/ls1012aqds_tfa_defconfig
@@ -52,6 +52,7 @@
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_NET_RANDOM_ETHADDR=y
 CONFIG_DM=y
+CONFIG_SATA=y
 CONFIG_SCSI_AHCI=y
 CONFIG_SATA_CEVA=y
 CONFIG_MPC8XXX_GPIO=y
diff --git a/configs/ls1012ardb_qspi_SECURE_BOOT_defconfig b/configs/ls1012ardb_qspi_SECURE_BOOT_defconfig
index 8767c87..771d69e 100644
--- a/configs/ls1012ardb_qspi_SECURE_BOOT_defconfig
+++ b/configs/ls1012ardb_qspi_SECURE_BOOT_defconfig
@@ -40,6 +40,7 @@
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_NET_RANDOM_ETHADDR=y
 CONFIG_DM=y
+CONFIG_SATA=y
 CONFIG_SATA_CEVA=y
 CONFIG_MPC8XXX_GPIO=y
 CONFIG_DM_I2C=y
diff --git a/configs/ls1012ardb_qspi_defconfig b/configs/ls1012ardb_qspi_defconfig
index fccbef7..83ba8ee 100644
--- a/configs/ls1012ardb_qspi_defconfig
+++ b/configs/ls1012ardb_qspi_defconfig
@@ -43,6 +43,7 @@
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_NET_RANDOM_ETHADDR=y
 CONFIG_DM=y
+CONFIG_SATA=y
 CONFIG_SATA_CEVA=y
 CONFIG_MPC8XXX_GPIO=y
 CONFIG_DM_I2C=y
diff --git a/configs/ls1012ardb_tfa_SECURE_BOOT_defconfig b/configs/ls1012ardb_tfa_SECURE_BOOT_defconfig
index bf35286..19550ea 100644
--- a/configs/ls1012ardb_tfa_SECURE_BOOT_defconfig
+++ b/configs/ls1012ardb_tfa_SECURE_BOOT_defconfig
@@ -40,6 +40,7 @@
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_NET_RANDOM_ETHADDR=y
 CONFIG_DM=y
+CONFIG_SATA=y
 CONFIG_SATA_CEVA=y
 CONFIG_MPC8XXX_GPIO=y
 CONFIG_DM_I2C=y
diff --git a/configs/ls1012ardb_tfa_defconfig b/configs/ls1012ardb_tfa_defconfig
index 7a175d3..3df6dd2 100644
--- a/configs/ls1012ardb_tfa_defconfig
+++ b/configs/ls1012ardb_tfa_defconfig
@@ -42,6 +42,7 @@
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_NET_RANDOM_ETHADDR=y
 CONFIG_DM=y
+CONFIG_SATA=y
 CONFIG_SATA_CEVA=y
 CONFIG_MPC8XXX_GPIO=y
 CONFIG_DM_I2C=y
diff --git a/configs/ls1021aiot_qspi_defconfig b/configs/ls1021aiot_qspi_defconfig
index 4705e34..5943fb6 100644
--- a/configs/ls1021aiot_qspi_defconfig
+++ b/configs/ls1021aiot_qspi_defconfig
@@ -37,6 +37,7 @@
 CONFIG_ENV_IS_IN_SPI_FLASH=y
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_DM=y
+CONFIG_SATA=y
 CONFIG_SATA_CEVA=y
 CONFIG_FSL_CAAM=y
 CONFIG_DM_I2C=y
diff --git a/configs/ls1021aiot_sdcard_defconfig b/configs/ls1021aiot_sdcard_defconfig
index e387264..e9e3ee9 100644
--- a/configs/ls1021aiot_sdcard_defconfig
+++ b/configs/ls1021aiot_sdcard_defconfig
@@ -54,6 +54,7 @@
 CONFIG_ENV_IS_IN_MMC=y
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_DM=y
+CONFIG_SATA=y
 CONFIG_SATA_CEVA=y
 CONFIG_FSL_CAAM=y
 CONFIG_DM_I2C=y
diff --git a/configs/ls1021aqds_ddr4_nor_defconfig b/configs/ls1021aqds_ddr4_nor_defconfig
index afd9318..d587c35 100644
--- a/configs/ls1021aqds_ddr4_nor_defconfig
+++ b/configs/ls1021aqds_ddr4_nor_defconfig
@@ -50,6 +50,7 @@
 CONFIG_ENV_IS_IN_FLASH=y
 CONFIG_ENV_ADDR=0x60300000
 CONFIG_DM=y
+CONFIG_SATA=y
 CONFIG_SATA_CEVA=y
 CONFIG_FSL_CAAM=y
 CONFIG_DYNAMIC_DDR_CLK_FREQ=y
diff --git a/configs/ls1021aqds_ddr4_nor_lpuart_defconfig b/configs/ls1021aqds_ddr4_nor_lpuart_defconfig
index b27c67b..ebf724a 100644
--- a/configs/ls1021aqds_ddr4_nor_lpuart_defconfig
+++ b/configs/ls1021aqds_ddr4_nor_lpuart_defconfig
@@ -51,6 +51,7 @@
 CONFIG_ENV_IS_IN_FLASH=y
 CONFIG_ENV_ADDR=0x60300000
 CONFIG_DM=y
+CONFIG_SATA=y
 CONFIG_SATA_CEVA=y
 CONFIG_FSL_CAAM=y
 CONFIG_DYNAMIC_DDR_CLK_FREQ=y
diff --git a/configs/ls1021aqds_nand_defconfig b/configs/ls1021aqds_nand_defconfig
index 915579a..d5a306e 100644
--- a/configs/ls1021aqds_nand_defconfig
+++ b/configs/ls1021aqds_nand_defconfig
@@ -71,6 +71,7 @@
 CONFIG_ENV_IS_IN_NAND=y
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_DM=y
+CONFIG_SATA=y
 CONFIG_SATA_CEVA=y
 CONFIG_FSL_CAAM=y
 CONFIG_DYNAMIC_DDR_CLK_FREQ=y
diff --git a/configs/ls1021aqds_nor_SECURE_BOOT_defconfig b/configs/ls1021aqds_nor_SECURE_BOOT_defconfig
index 5ab7d27..3fcd533 100644
--- a/configs/ls1021aqds_nor_SECURE_BOOT_defconfig
+++ b/configs/ls1021aqds_nor_SECURE_BOOT_defconfig
@@ -49,6 +49,7 @@
 CONFIG_OF_CONTROL=y
 CONFIG_ENV_OVERWRITE=y
 CONFIG_DM=y
+CONFIG_SATA=y
 CONFIG_SATA_CEVA=y
 CONFIG_DYNAMIC_DDR_CLK_FREQ=y
 CONFIG_SYS_FSL_DDR3=y
diff --git a/configs/ls1021aqds_nor_defconfig b/configs/ls1021aqds_nor_defconfig
index 934d44f..dda02ae 100644
--- a/configs/ls1021aqds_nor_defconfig
+++ b/configs/ls1021aqds_nor_defconfig
@@ -50,6 +50,7 @@
 CONFIG_ENV_IS_IN_FLASH=y
 CONFIG_ENV_ADDR=0x60300000
 CONFIG_DM=y
+CONFIG_SATA=y
 CONFIG_SATA_CEVA=y
 CONFIG_FSL_CAAM=y
 CONFIG_DYNAMIC_DDR_CLK_FREQ=y
diff --git a/configs/ls1021aqds_nor_lpuart_defconfig b/configs/ls1021aqds_nor_lpuart_defconfig
index 1cf2086..188f125 100644
--- a/configs/ls1021aqds_nor_lpuart_defconfig
+++ b/configs/ls1021aqds_nor_lpuart_defconfig
@@ -51,6 +51,7 @@
 CONFIG_ENV_IS_IN_FLASH=y
 CONFIG_ENV_ADDR=0x60300000
 CONFIG_DM=y
+CONFIG_SATA=y
 CONFIG_SATA_CEVA=y
 CONFIG_FSL_CAAM=y
 CONFIG_DYNAMIC_DDR_CLK_FREQ=y
diff --git a/configs/ls1021aqds_qspi_defconfig b/configs/ls1021aqds_qspi_defconfig
index f967619..9dad311 100644
--- a/configs/ls1021aqds_qspi_defconfig
+++ b/configs/ls1021aqds_qspi_defconfig
@@ -49,6 +49,7 @@
 CONFIG_ENV_IS_IN_SPI_FLASH=y
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_DM=y
+CONFIG_SATA=y
 CONFIG_SATA_CEVA=y
 CONFIG_FSL_CAAM=y
 CONFIG_SYS_FSL_DDR3=y
diff --git a/configs/ls1021aqds_sdcard_ifc_defconfig b/configs/ls1021aqds_sdcard_ifc_defconfig
index db8a3ae..25afa72 100644
--- a/configs/ls1021aqds_sdcard_ifc_defconfig
+++ b/configs/ls1021aqds_sdcard_ifc_defconfig
@@ -68,6 +68,7 @@
 CONFIG_ENV_IS_IN_MMC=y
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_DM=y
+CONFIG_SATA=y
 CONFIG_SATA_CEVA=y
 CONFIG_FSL_CAAM=y
 CONFIG_DYNAMIC_DDR_CLK_FREQ=y
diff --git a/configs/ls1021aqds_sdcard_qspi_defconfig b/configs/ls1021aqds_sdcard_qspi_defconfig
index 625dd08..3dd2912 100644
--- a/configs/ls1021aqds_sdcard_qspi_defconfig
+++ b/configs/ls1021aqds_sdcard_qspi_defconfig
@@ -66,6 +66,7 @@
 CONFIG_ENV_IS_IN_MMC=y
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_DM=y
+CONFIG_SATA=y
 CONFIG_SATA_CEVA=y
 CONFIG_FSL_CAAM=y
 CONFIG_SYS_FSL_DDR3=y
diff --git a/configs/ls1021atsn_qspi_defconfig b/configs/ls1021atsn_qspi_defconfig
index 5c8cee3..4221060 100644
--- a/configs/ls1021atsn_qspi_defconfig
+++ b/configs/ls1021atsn_qspi_defconfig
@@ -62,6 +62,7 @@
 CONFIG_NVME=y
 CONFIG_PCI=y
 CONFIG_PCIE_LAYERSCAPE_RC=y
+CONFIG_SCSI_AHCI_PLAT=y
 CONFIG_SYS_NS16550=y
 CONFIG_SPI=y
 CONFIG_DM_SPI=y
diff --git a/configs/ls1021atsn_sdcard_defconfig b/configs/ls1021atsn_sdcard_defconfig
index a3b8f24..627038c 100644
--- a/configs/ls1021atsn_sdcard_defconfig
+++ b/configs/ls1021atsn_sdcard_defconfig
@@ -78,6 +78,7 @@
 CONFIG_NVME=y
 CONFIG_PCI=y
 CONFIG_PCIE_LAYERSCAPE_RC=y
+CONFIG_SCSI_AHCI_PLAT=y
 CONFIG_SYS_NS16550=y
 CONFIG_SPI=y
 CONFIG_DM_SPI=y
diff --git a/configs/ls1021atwr_nor_SECURE_BOOT_defconfig b/configs/ls1021atwr_nor_SECURE_BOOT_defconfig
index f61d29c..0c64cf0 100644
--- a/configs/ls1021atwr_nor_SECURE_BOOT_defconfig
+++ b/configs/ls1021atwr_nor_SECURE_BOOT_defconfig
@@ -43,6 +43,7 @@
 CONFIG_OF_CONTROL=y
 CONFIG_ENV_OVERWRITE=y
 CONFIG_DM=y
+CONFIG_SATA=y
 CONFIG_SATA_CEVA=y
 CONFIG_MPC8XXX_GPIO=y
 CONFIG_DM_I2C=y
diff --git a/configs/ls1021atwr_nor_defconfig b/configs/ls1021atwr_nor_defconfig
index 02c25cd..39ba7be 100644
--- a/configs/ls1021atwr_nor_defconfig
+++ b/configs/ls1021atwr_nor_defconfig
@@ -44,6 +44,7 @@
 CONFIG_ENV_IS_IN_FLASH=y
 CONFIG_ENV_ADDR=0x60300000
 CONFIG_DM=y
+CONFIG_SATA=y
 CONFIG_SATA_CEVA=y
 CONFIG_FSL_CAAM=y
 CONFIG_MPC8XXX_GPIO=y
diff --git a/configs/ls1021atwr_nor_lpuart_defconfig b/configs/ls1021atwr_nor_lpuart_defconfig
index 49d6dda..de3183c 100644
--- a/configs/ls1021atwr_nor_lpuart_defconfig
+++ b/configs/ls1021atwr_nor_lpuart_defconfig
@@ -45,6 +45,7 @@
 CONFIG_ENV_IS_IN_FLASH=y
 CONFIG_ENV_ADDR=0x60300000
 CONFIG_DM=y
+CONFIG_SATA=y
 CONFIG_SATA_CEVA=y
 CONFIG_FSL_CAAM=y
 CONFIG_MPC8XXX_GPIO=y
diff --git a/configs/ls1021atwr_qspi_defconfig b/configs/ls1021atwr_qspi_defconfig
index 36a8aee..38f0731 100644
--- a/configs/ls1021atwr_qspi_defconfig
+++ b/configs/ls1021atwr_qspi_defconfig
@@ -45,6 +45,7 @@
 CONFIG_ENV_IS_IN_SPI_FLASH=y
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_DM=y
+CONFIG_SATA=y
 CONFIG_SATA_CEVA=y
 CONFIG_FSL_CAAM=y
 CONFIG_MPC8XXX_GPIO=y
diff --git a/configs/ls1021atwr_sdcard_ifc_SECURE_BOOT_defconfig b/configs/ls1021atwr_sdcard_ifc_SECURE_BOOT_defconfig
index 756e072..a8288e9 100644
--- a/configs/ls1021atwr_sdcard_ifc_SECURE_BOOT_defconfig
+++ b/configs/ls1021atwr_sdcard_ifc_SECURE_BOOT_defconfig
@@ -87,6 +87,7 @@
 CONFIG_PCIE_LAYERSCAPE_RC=y
 CONFIG_U_QE=y
 CONFIG_SYS_QE_FW_ADDR=0x940000
+CONFIG_SCSI_AHCI_PLAT=y
 CONFIG_SYS_NS16550=y
 CONFIG_USB=y
 CONFIG_USB_XHCI_HCD=y
diff --git a/configs/ls1021atwr_sdcard_ifc_defconfig b/configs/ls1021atwr_sdcard_ifc_defconfig
index ede4c95..e43e2ba 100644
--- a/configs/ls1021atwr_sdcard_ifc_defconfig
+++ b/configs/ls1021atwr_sdcard_ifc_defconfig
@@ -62,6 +62,7 @@
 CONFIG_ENV_IS_IN_MMC=y
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_DM=y
+CONFIG_SATA=y
 CONFIG_SATA_CEVA=y
 CONFIG_FSL_CAAM=y
 CONFIG_MPC8XXX_GPIO=y
diff --git a/configs/ls1021atwr_sdcard_qspi_defconfig b/configs/ls1021atwr_sdcard_qspi_defconfig
index 1315043..429adf3 100644
--- a/configs/ls1021atwr_sdcard_qspi_defconfig
+++ b/configs/ls1021atwr_sdcard_qspi_defconfig
@@ -62,6 +62,7 @@
 CONFIG_ENV_IS_IN_MMC=y
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_DM=y
+CONFIG_SATA=y
 CONFIG_SATA_CEVA=y
 CONFIG_FSL_CAAM=y
 CONFIG_MPC8XXX_GPIO=y
diff --git a/configs/ls1028aqds_tfa_SECURE_BOOT_defconfig b/configs/ls1028aqds_tfa_SECURE_BOOT_defconfig
index 4a38c5e..bbb6f1a 100644
--- a/configs/ls1028aqds_tfa_SECURE_BOOT_defconfig
+++ b/configs/ls1028aqds_tfa_SECURE_BOOT_defconfig
@@ -17,6 +17,7 @@
 CONFIG_SEC_FIRMWARE_ARMV8_PSCI=y
 CONFIG_AHCI=y
 CONFIG_DISTRO_DEFAULTS=y
+CONFIG_REMAKE_ELF=y
 CONFIG_MP=y
 CONFIG_FIT_VERBOSE=y
 CONFIG_OF_BOARD_SETUP=y
@@ -43,6 +44,7 @@
 CONFIG_NET_RANDOM_ETHADDR=y
 CONFIG_NETCONSOLE=y
 CONFIG_DM=y
+CONFIG_SATA=y
 CONFIG_SCSI_AHCI=y
 CONFIG_SATA_CEVA=y
 # CONFIG_DDR_SPD is not set
diff --git a/configs/ls1028aqds_tfa_defconfig b/configs/ls1028aqds_tfa_defconfig
index 0aed87b..2b90d8a 100644
--- a/configs/ls1028aqds_tfa_defconfig
+++ b/configs/ls1028aqds_tfa_defconfig
@@ -18,6 +18,7 @@
 CONFIG_SEC_FIRMWARE_ARMV8_PSCI=y
 CONFIG_AHCI=y
 CONFIG_DISTRO_DEFAULTS=y
+CONFIG_REMAKE_ELF=y
 CONFIG_MP=y
 CONFIG_FIT_VERBOSE=y
 CONFIG_OF_BOARD_SETUP=y
@@ -48,6 +49,7 @@
 CONFIG_NET_RANDOM_ETHADDR=y
 CONFIG_NETCONSOLE=y
 CONFIG_DM=y
+CONFIG_SATA=y
 CONFIG_SCSI_AHCI=y
 CONFIG_SATA_CEVA=y
 CONFIG_FSL_CAAM=y
diff --git a/configs/ls1028aqds_tfa_lpuart_defconfig b/configs/ls1028aqds_tfa_lpuart_defconfig
index 9b3f672..84696fc 100644
--- a/configs/ls1028aqds_tfa_lpuart_defconfig
+++ b/configs/ls1028aqds_tfa_lpuart_defconfig
@@ -17,6 +17,7 @@
 CONFIG_SEC_FIRMWARE_ARMV8_PSCI=y
 CONFIG_AHCI=y
 CONFIG_DISTRO_DEFAULTS=y
+CONFIG_REMAKE_ELF=y
 CONFIG_MP=y
 CONFIG_FIT_VERBOSE=y
 CONFIG_OF_BOARD_SETUP=y
@@ -48,6 +49,7 @@
 CONFIG_NET_RANDOM_ETHADDR=y
 CONFIG_NETCONSOLE=y
 CONFIG_DM=y
+CONFIG_SATA=y
 CONFIG_SCSI_AHCI=y
 CONFIG_SATA_CEVA=y
 CONFIG_FSL_CAAM=y
diff --git a/configs/ls1028ardb_tfa_SECURE_BOOT_defconfig b/configs/ls1028ardb_tfa_SECURE_BOOT_defconfig
index 7931b55..7fc8bec 100644
--- a/configs/ls1028ardb_tfa_SECURE_BOOT_defconfig
+++ b/configs/ls1028ardb_tfa_SECURE_BOOT_defconfig
@@ -17,6 +17,7 @@
 CONFIG_SEC_FIRMWARE_ARMV8_PSCI=y
 CONFIG_AHCI=y
 CONFIG_DISTRO_DEFAULTS=y
+CONFIG_REMAKE_ELF=y
 CONFIG_MP=y
 CONFIG_FIT_VERBOSE=y
 CONFIG_OF_BOARD_SETUP=y
@@ -42,6 +43,7 @@
 CONFIG_NET_RANDOM_ETHADDR=y
 CONFIG_NETCONSOLE=y
 CONFIG_DM=y
+CONFIG_SATA=y
 CONFIG_SCSI_AHCI=y
 CONFIG_SATA_CEVA=y
 # CONFIG_DDR_SPD is not set
diff --git a/configs/ls1028ardb_tfa_defconfig b/configs/ls1028ardb_tfa_defconfig
index 91e513e..5653590 100644
--- a/configs/ls1028ardb_tfa_defconfig
+++ b/configs/ls1028ardb_tfa_defconfig
@@ -18,6 +18,7 @@
 CONFIG_SEC_FIRMWARE_ARMV8_PSCI=y
 CONFIG_AHCI=y
 CONFIG_DISTRO_DEFAULTS=y
+CONFIG_REMAKE_ELF=y
 CONFIG_MP=y
 CONFIG_FIT_VERBOSE=y
 CONFIG_OF_BOARD_SETUP=y
@@ -47,6 +48,7 @@
 CONFIG_NET_RANDOM_ETHADDR=y
 CONFIG_NETCONSOLE=y
 CONFIG_DM=y
+CONFIG_SATA=y
 CONFIG_SCSI_AHCI=y
 CONFIG_SATA_CEVA=y
 CONFIG_FSL_CAAM=y
diff --git a/configs/ls1043aqds_defconfig b/configs/ls1043aqds_defconfig
index d79039b..342dea5 100644
--- a/configs/ls1043aqds_defconfig
+++ b/configs/ls1043aqds_defconfig
@@ -21,6 +21,7 @@
 CONFIG_FSL_LS_PPA=y
 CONFIG_AHCI=y
 CONFIG_DISTRO_DEFAULTS=y
+CONFIG_REMAKE_ELF=y
 CONFIG_MP=y
 CONFIG_FIT_VERBOSE=y
 CONFIG_OF_BOARD_SETUP=y
@@ -49,6 +50,7 @@
 CONFIG_ENV_IS_IN_FLASH=y
 CONFIG_ENV_ADDR=0x60300000
 CONFIG_DM=y
+CONFIG_SATA=y
 CONFIG_SATA_CEVA=y
 CONFIG_FSL_CAAM=y
 CONFIG_DYNAMIC_DDR_CLK_FREQ=y
diff --git a/configs/ls1043aqds_lpuart_defconfig b/configs/ls1043aqds_lpuart_defconfig
index acb88cc..dd8188a 100644
--- a/configs/ls1043aqds_lpuart_defconfig
+++ b/configs/ls1043aqds_lpuart_defconfig
@@ -21,6 +21,7 @@
 CONFIG_FSL_LS_PPA=y
 CONFIG_AHCI=y
 CONFIG_DISTRO_DEFAULTS=y
+CONFIG_REMAKE_ELF=y
 CONFIG_MP=y
 CONFIG_FIT_VERBOSE=y
 CONFIG_OF_BOARD_SETUP=y
@@ -50,6 +51,7 @@
 CONFIG_ENV_IS_IN_FLASH=y
 CONFIG_ENV_ADDR=0x60300000
 CONFIG_DM=y
+CONFIG_SATA=y
 CONFIG_SATA_CEVA=y
 CONFIG_FSL_CAAM=y
 CONFIG_DYNAMIC_DDR_CLK_FREQ=y
diff --git a/configs/ls1043aqds_nand_defconfig b/configs/ls1043aqds_nand_defconfig
index a561e8c..6de0666 100644
--- a/configs/ls1043aqds_nand_defconfig
+++ b/configs/ls1043aqds_nand_defconfig
@@ -27,6 +27,7 @@
 CONFIG_SPL=y
 CONFIG_AHCI=y
 CONFIG_DISTRO_DEFAULTS=y
+CONFIG_REMAKE_ELF=y
 CONFIG_MP=y
 CONFIG_FIT_VERBOSE=y
 CONFIG_OF_BOARD_SETUP=y
@@ -69,6 +70,7 @@
 CONFIG_ENV_IS_IN_NAND=y
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_DM=y
+CONFIG_SATA=y
 CONFIG_SATA_CEVA=y
 CONFIG_FSL_CAAM=y
 CONFIG_DYNAMIC_DDR_CLK_FREQ=y
diff --git a/configs/ls1043aqds_nor_ddr3_defconfig b/configs/ls1043aqds_nor_ddr3_defconfig
index cfd03c9..60f9e16 100644
--- a/configs/ls1043aqds_nor_ddr3_defconfig
+++ b/configs/ls1043aqds_nor_ddr3_defconfig
@@ -21,6 +21,7 @@
 CONFIG_FSL_LS_PPA=y
 CONFIG_AHCI=y
 CONFIG_DISTRO_DEFAULTS=y
+CONFIG_REMAKE_ELF=y
 CONFIG_MP=y
 CONFIG_FIT_VERBOSE=y
 CONFIG_OF_BOARD_SETUP=y
@@ -49,6 +50,7 @@
 CONFIG_ENV_IS_IN_FLASH=y
 CONFIG_ENV_ADDR=0x60300000
 CONFIG_DM=y
+CONFIG_SATA=y
 CONFIG_SATA_CEVA=y
 CONFIG_FSL_CAAM=y
 CONFIG_DYNAMIC_DDR_CLK_FREQ=y
diff --git a/configs/ls1043aqds_qspi_defconfig b/configs/ls1043aqds_qspi_defconfig
index 1460844..9724cf9 100644
--- a/configs/ls1043aqds_qspi_defconfig
+++ b/configs/ls1043aqds_qspi_defconfig
@@ -22,6 +22,7 @@
 CONFIG_FSL_LS_PPA=y
 CONFIG_AHCI=y
 CONFIG_DISTRO_DEFAULTS=y
+CONFIG_REMAKE_ELF=y
 CONFIG_MP=y
 CONFIG_FIT_VERBOSE=y
 CONFIG_OF_BOARD_SETUP=y
@@ -50,6 +51,7 @@
 CONFIG_ENV_ADDR=0x40300000
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_DM=y
+CONFIG_SATA=y
 CONFIG_SATA_CEVA=y
 CONFIG_FSL_CAAM=y
 CONFIG_DYNAMIC_DDR_CLK_FREQ=y
diff --git a/configs/ls1043aqds_sdcard_ifc_defconfig b/configs/ls1043aqds_sdcard_ifc_defconfig
index a9a1799..aa5ae5e 100644
--- a/configs/ls1043aqds_sdcard_ifc_defconfig
+++ b/configs/ls1043aqds_sdcard_ifc_defconfig
@@ -28,6 +28,7 @@
 CONFIG_SPL=y
 CONFIG_AHCI=y
 CONFIG_DISTRO_DEFAULTS=y
+CONFIG_REMAKE_ELF=y
 CONFIG_MP=y
 CONFIG_FIT_VERBOSE=y
 CONFIG_OF_BOARD_SETUP=y
@@ -68,6 +69,7 @@
 CONFIG_ENV_IS_IN_MMC=y
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_DM=y
+CONFIG_SATA=y
 CONFIG_SATA_CEVA=y
 CONFIG_FSL_CAAM=y
 CONFIG_DYNAMIC_DDR_CLK_FREQ=y
diff --git a/configs/ls1043aqds_sdcard_qspi_defconfig b/configs/ls1043aqds_sdcard_qspi_defconfig
index 47d6af3..ebbcd74 100644
--- a/configs/ls1043aqds_sdcard_qspi_defconfig
+++ b/configs/ls1043aqds_sdcard_qspi_defconfig
@@ -28,6 +28,7 @@
 CONFIG_SPL=y
 CONFIG_AHCI=y
 CONFIG_DISTRO_DEFAULTS=y
+CONFIG_REMAKE_ELF=y
 CONFIG_MP=y
 CONFIG_FIT_VERBOSE=y
 CONFIG_OF_BOARD_SETUP=y
@@ -67,6 +68,7 @@
 CONFIG_ENV_IS_IN_MMC=y
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_DM=y
+CONFIG_SATA=y
 CONFIG_SATA_CEVA=y
 CONFIG_FSL_CAAM=y
 CONFIG_DYNAMIC_DDR_CLK_FREQ=y
diff --git a/configs/ls1043aqds_tfa_SECURE_BOOT_defconfig b/configs/ls1043aqds_tfa_SECURE_BOOT_defconfig
index 37e51da..15cb28b 100644
--- a/configs/ls1043aqds_tfa_SECURE_BOOT_defconfig
+++ b/configs/ls1043aqds_tfa_SECURE_BOOT_defconfig
@@ -23,6 +23,7 @@
 CONFIG_SEC_FIRMWARE_ARMV8_PSCI=y
 CONFIG_AHCI=y
 CONFIG_DISTRO_DEFAULTS=y
+CONFIG_REMAKE_ELF=y
 CONFIG_MP=y
 CONFIG_FIT_VERBOSE=y
 CONFIG_OF_BOARD_SETUP=y
@@ -49,6 +50,7 @@
 CONFIG_OF_CONTROL=y
 CONFIG_ENV_OVERWRITE=y
 CONFIG_DM=y
+CONFIG_SATA=y
 CONFIG_SATA_CEVA=y
 CONFIG_DYNAMIC_DDR_CLK_FREQ=y
 CONFIG_DDR_ECC=y
diff --git a/configs/ls1043aqds_tfa_defconfig b/configs/ls1043aqds_tfa_defconfig
index c84f709..9bffcf7 100644
--- a/configs/ls1043aqds_tfa_defconfig
+++ b/configs/ls1043aqds_tfa_defconfig
@@ -24,6 +24,7 @@
 CONFIG_SEC_FIRMWARE_ARMV8_PSCI=y
 CONFIG_AHCI=y
 CONFIG_DISTRO_DEFAULTS=y
+CONFIG_REMAKE_ELF=y
 CONFIG_MP=y
 CONFIG_FIT_VERBOSE=y
 CONFIG_OF_BOARD_SETUP=y
@@ -57,6 +58,7 @@
 CONFIG_ENV_ADDR=0x60500000
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_DM=y
+CONFIG_SATA=y
 CONFIG_SATA_CEVA=y
 CONFIG_FSL_CAAM=y
 CONFIG_DYNAMIC_DDR_CLK_FREQ=y
diff --git a/configs/ls1043ardb_SECURE_BOOT_defconfig b/configs/ls1043ardb_SECURE_BOOT_defconfig
index c4b0db2..e2762cd 100644
--- a/configs/ls1043ardb_SECURE_BOOT_defconfig
+++ b/configs/ls1043ardb_SECURE_BOOT_defconfig
@@ -13,6 +13,7 @@
 CONFIG_DEFAULT_DEVICE_TREE="fsl-ls1043a-rdb"
 CONFIG_FSL_LS_PPA=y
 CONFIG_DISTRO_DEFAULTS=y
+CONFIG_REMAKE_ELF=y
 CONFIG_MP=y
 CONFIG_FIT_VERBOSE=y
 CONFIG_OF_BOARD_SETUP=y
diff --git a/configs/ls1043ardb_defconfig b/configs/ls1043ardb_defconfig
index b2cf984..8f3155b 100644
--- a/configs/ls1043ardb_defconfig
+++ b/configs/ls1043ardb_defconfig
@@ -13,6 +13,7 @@
 CONFIG_DEFAULT_DEVICE_TREE="fsl-ls1043a-rdb"
 CONFIG_FSL_LS_PPA=y
 CONFIG_DISTRO_DEFAULTS=y
+CONFIG_REMAKE_ELF=y
 CONFIG_MP=y
 CONFIG_FIT_VERBOSE=y
 CONFIG_OF_BOARD_SETUP=y
diff --git a/configs/ls1043ardb_nand_SECURE_BOOT_defconfig b/configs/ls1043ardb_nand_SECURE_BOOT_defconfig
index 9cb130f..b3c1505 100644
--- a/configs/ls1043ardb_nand_SECURE_BOOT_defconfig
+++ b/configs/ls1043ardb_nand_SECURE_BOOT_defconfig
@@ -15,6 +15,7 @@
 CONFIG_SPL_DRIVERS_MISC=y
 CONFIG_SPL=y
 CONFIG_DISTRO_DEFAULTS=y
+CONFIG_REMAKE_ELF=y
 CONFIG_MP=y
 CONFIG_FIT_VERBOSE=y
 CONFIG_OF_BOARD_SETUP=y
diff --git a/configs/ls1043ardb_nand_defconfig b/configs/ls1043ardb_nand_defconfig
index 58b9215..1780675 100644
--- a/configs/ls1043ardb_nand_defconfig
+++ b/configs/ls1043ardb_nand_defconfig
@@ -19,6 +19,7 @@
 CONFIG_SPL_DRIVERS_MISC=y
 CONFIG_SPL=y
 CONFIG_DISTRO_DEFAULTS=y
+CONFIG_REMAKE_ELF=y
 CONFIG_MP=y
 CONFIG_FIT_VERBOSE=y
 CONFIG_OF_BOARD_SETUP=y
diff --git a/configs/ls1043ardb_sdcard_SECURE_BOOT_defconfig b/configs/ls1043ardb_sdcard_SECURE_BOOT_defconfig
index c11e8ec..61e3482 100644
--- a/configs/ls1043ardb_sdcard_SECURE_BOOT_defconfig
+++ b/configs/ls1043ardb_sdcard_SECURE_BOOT_defconfig
@@ -16,6 +16,7 @@
 CONFIG_SPL_DRIVERS_MISC=y
 CONFIG_SPL=y
 CONFIG_DISTRO_DEFAULTS=y
+CONFIG_REMAKE_ELF=y
 CONFIG_MP=y
 CONFIG_FIT_VERBOSE=y
 CONFIG_OF_BOARD_SETUP=y
diff --git a/configs/ls1043ardb_sdcard_defconfig b/configs/ls1043ardb_sdcard_defconfig
index 13ea66b..4977b4e 100644
--- a/configs/ls1043ardb_sdcard_defconfig
+++ b/configs/ls1043ardb_sdcard_defconfig
@@ -20,6 +20,7 @@
 CONFIG_SPL_DRIVERS_MISC=y
 CONFIG_SPL=y
 CONFIG_DISTRO_DEFAULTS=y
+CONFIG_REMAKE_ELF=y
 CONFIG_MP=y
 CONFIG_FIT_VERBOSE=y
 CONFIG_OF_BOARD_SETUP=y
diff --git a/configs/ls1043ardb_tfa_SECURE_BOOT_defconfig b/configs/ls1043ardb_tfa_SECURE_BOOT_defconfig
index 3ce21ea..d8d65b8 100644
--- a/configs/ls1043ardb_tfa_SECURE_BOOT_defconfig
+++ b/configs/ls1043ardb_tfa_SECURE_BOOT_defconfig
@@ -15,6 +15,7 @@
 CONFIG_ARMV8_SEC_FIRMWARE_SUPPORT=y
 CONFIG_SEC_FIRMWARE_ARMV8_PSCI=y
 CONFIG_DISTRO_DEFAULTS=y
+CONFIG_REMAKE_ELF=y
 CONFIG_MP=y
 CONFIG_FIT_VERBOSE=y
 CONFIG_OF_BOARD_SETUP=y
diff --git a/configs/ls1043ardb_tfa_defconfig b/configs/ls1043ardb_tfa_defconfig
index b7f2c3b..b68c125 100644
--- a/configs/ls1043ardb_tfa_defconfig
+++ b/configs/ls1043ardb_tfa_defconfig
@@ -16,6 +16,7 @@
 CONFIG_ARMV8_SEC_FIRMWARE_SUPPORT=y
 CONFIG_SEC_FIRMWARE_ARMV8_PSCI=y
 CONFIG_DISTRO_DEFAULTS=y
+CONFIG_REMAKE_ELF=y
 CONFIG_MP=y
 CONFIG_FIT_VERBOSE=y
 CONFIG_OF_BOARD_SETUP=y
diff --git a/configs/ls1046afrwy_tfa_SECURE_BOOT_defconfig b/configs/ls1046afrwy_tfa_SECURE_BOOT_defconfig
index 4225f36..ba381bb 100644
--- a/configs/ls1046afrwy_tfa_SECURE_BOOT_defconfig
+++ b/configs/ls1046afrwy_tfa_SECURE_BOOT_defconfig
@@ -14,6 +14,7 @@
 CONFIG_SEC_FIRMWARE_ARMV8_PSCI=y
 CONFIG_AHCI=y
 CONFIG_DISTRO_DEFAULTS=y
+CONFIG_REMAKE_ELF=y
 CONFIG_MP=y
 CONFIG_FIT_VERBOSE=y
 CONFIG_OF_BOARD_SETUP=y
@@ -33,6 +34,7 @@
 CONFIG_ENV_OVERWRITE=y
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_DM=y
+CONFIG_SATA=y
 CONFIG_SATA_CEVA=y
 # CONFIG_DDR_SPD is not set
 CONFIG_MPC8XXX_GPIO=y
diff --git a/configs/ls1046afrwy_tfa_defconfig b/configs/ls1046afrwy_tfa_defconfig
index e3cfb8c..a2ebe52 100644
--- a/configs/ls1046afrwy_tfa_defconfig
+++ b/configs/ls1046afrwy_tfa_defconfig
@@ -15,6 +15,7 @@
 CONFIG_SEC_FIRMWARE_ARMV8_PSCI=y
 CONFIG_AHCI=y
 CONFIG_DISTRO_DEFAULTS=y
+CONFIG_REMAKE_ELF=y
 CONFIG_MP=y
 CONFIG_FIT_VERBOSE=y
 CONFIG_OF_BOARD_SETUP=y
@@ -38,6 +39,7 @@
 CONFIG_ENV_ADDR=0x40500000
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_DM=y
+CONFIG_SATA=y
 CONFIG_SATA_CEVA=y
 CONFIG_FSL_CAAM=y
 # CONFIG_DDR_SPD is not set
diff --git a/configs/ls1046aqds_SECURE_BOOT_defconfig b/configs/ls1046aqds_SECURE_BOOT_defconfig
index cb8246f..8e19249 100644
--- a/configs/ls1046aqds_SECURE_BOOT_defconfig
+++ b/configs/ls1046aqds_SECURE_BOOT_defconfig
@@ -21,6 +21,7 @@
 CONFIG_FSL_LS_PPA=y
 CONFIG_AHCI=y
 CONFIG_DISTRO_DEFAULTS=y
+CONFIG_REMAKE_ELF=y
 CONFIG_MP=y
 CONFIG_FIT_VERBOSE=y
 CONFIG_OF_BOARD_SETUP=y
@@ -48,6 +49,7 @@
 CONFIG_OF_CONTROL=y
 CONFIG_ENV_OVERWRITE=y
 CONFIG_DM=y
+CONFIG_SATA=y
 CONFIG_SATA_CEVA=y
 CONFIG_DYNAMIC_DDR_CLK_FREQ=y
 CONFIG_DDR_ECC=y
diff --git a/configs/ls1046aqds_defconfig b/configs/ls1046aqds_defconfig
index 9eb3caf..f8b4faa 100644
--- a/configs/ls1046aqds_defconfig
+++ b/configs/ls1046aqds_defconfig
@@ -21,6 +21,7 @@
 CONFIG_FSL_LS_PPA=y
 CONFIG_AHCI=y
 CONFIG_DISTRO_DEFAULTS=y
+CONFIG_REMAKE_ELF=y
 CONFIG_MP=y
 CONFIG_FIT_VERBOSE=y
 CONFIG_OF_BOARD_SETUP=y
@@ -50,6 +51,7 @@
 CONFIG_ENV_IS_IN_FLASH=y
 CONFIG_ENV_ADDR=0x60300000
 CONFIG_DM=y
+CONFIG_SATA=y
 CONFIG_SATA_CEVA=y
 CONFIG_FSL_CAAM=y
 CONFIG_DYNAMIC_DDR_CLK_FREQ=y
diff --git a/configs/ls1046aqds_lpuart_defconfig b/configs/ls1046aqds_lpuart_defconfig
index bce8c6c..37b45ee 100644
--- a/configs/ls1046aqds_lpuart_defconfig
+++ b/configs/ls1046aqds_lpuart_defconfig
@@ -21,6 +21,7 @@
 CONFIG_FSL_LS_PPA=y
 CONFIG_AHCI=y
 CONFIG_DISTRO_DEFAULTS=y
+CONFIG_REMAKE_ELF=y
 CONFIG_MP=y
 CONFIG_FIT_VERBOSE=y
 CONFIG_OF_BOARD_SETUP=y
@@ -51,6 +52,7 @@
 CONFIG_ENV_IS_IN_FLASH=y
 CONFIG_ENV_ADDR=0x60300000
 CONFIG_DM=y
+CONFIG_SATA=y
 CONFIG_SATA_CEVA=y
 CONFIG_FSL_CAAM=y
 CONFIG_DYNAMIC_DDR_CLK_FREQ=y
diff --git a/configs/ls1046aqds_nand_defconfig b/configs/ls1046aqds_nand_defconfig
index 36d3072..e0e736f 100644
--- a/configs/ls1046aqds_nand_defconfig
+++ b/configs/ls1046aqds_nand_defconfig
@@ -27,6 +27,7 @@
 CONFIG_SPL=y
 CONFIG_AHCI=y
 CONFIG_DISTRO_DEFAULTS=y
+CONFIG_REMAKE_ELF=y
 CONFIG_MP=y
 CONFIG_FIT_VERBOSE=y
 CONFIG_OF_BOARD_SETUP=y
@@ -69,6 +70,7 @@
 CONFIG_ENV_IS_IN_NAND=y
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_DM=y
+CONFIG_SATA=y
 CONFIG_SATA_CEVA=y
 CONFIG_FSL_CAAM=y
 CONFIG_DYNAMIC_DDR_CLK_FREQ=y
diff --git a/configs/ls1046aqds_qspi_defconfig b/configs/ls1046aqds_qspi_defconfig
index cea7d9b..99177d7 100644
--- a/configs/ls1046aqds_qspi_defconfig
+++ b/configs/ls1046aqds_qspi_defconfig
@@ -22,6 +22,7 @@
 CONFIG_FSL_LS_PPA=y
 CONFIG_AHCI=y
 CONFIG_DISTRO_DEFAULTS=y
+CONFIG_REMAKE_ELF=y
 CONFIG_MP=y
 CONFIG_FIT_VERBOSE=y
 CONFIG_OF_BOARD_SETUP=y
@@ -51,6 +52,7 @@
 CONFIG_ENV_ADDR=0x40300000
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_DM=y
+CONFIG_SATA=y
 CONFIG_SATA_CEVA=y
 CONFIG_FSL_CAAM=y
 CONFIG_DYNAMIC_DDR_CLK_FREQ=y
diff --git a/configs/ls1046aqds_sdcard_ifc_defconfig b/configs/ls1046aqds_sdcard_ifc_defconfig
index a61239c..83c6c93 100644
--- a/configs/ls1046aqds_sdcard_ifc_defconfig
+++ b/configs/ls1046aqds_sdcard_ifc_defconfig
@@ -28,6 +28,7 @@
 CONFIG_SPL=y
 CONFIG_AHCI=y
 CONFIG_DISTRO_DEFAULTS=y
+CONFIG_REMAKE_ELF=y
 CONFIG_MP=y
 CONFIG_FIT_VERBOSE=y
 CONFIG_OF_BOARD_SETUP=y
@@ -70,6 +71,7 @@
 CONFIG_ENV_IS_IN_MMC=y
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_DM=y
+CONFIG_SATA=y
 CONFIG_SATA_CEVA=y
 CONFIG_FSL_CAAM=y
 CONFIG_DYNAMIC_DDR_CLK_FREQ=y
diff --git a/configs/ls1046aqds_sdcard_qspi_defconfig b/configs/ls1046aqds_sdcard_qspi_defconfig
index 4ad624d..291ca2f 100644
--- a/configs/ls1046aqds_sdcard_qspi_defconfig
+++ b/configs/ls1046aqds_sdcard_qspi_defconfig
@@ -28,6 +28,7 @@
 CONFIG_SPL=y
 CONFIG_AHCI=y
 CONFIG_DISTRO_DEFAULTS=y
+CONFIG_REMAKE_ELF=y
 CONFIG_MP=y
 CONFIG_FIT_VERBOSE=y
 CONFIG_OF_BOARD_SETUP=y
@@ -69,6 +70,7 @@
 CONFIG_ENV_IS_IN_MMC=y
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_DM=y
+CONFIG_SATA=y
 CONFIG_SATA_CEVA=y
 CONFIG_FSL_CAAM=y
 CONFIG_DYNAMIC_DDR_CLK_FREQ=y
diff --git a/configs/ls1046aqds_tfa_SECURE_BOOT_defconfig b/configs/ls1046aqds_tfa_SECURE_BOOT_defconfig
index 5041e4e..92f3b17 100644
--- a/configs/ls1046aqds_tfa_SECURE_BOOT_defconfig
+++ b/configs/ls1046aqds_tfa_SECURE_BOOT_defconfig
@@ -23,6 +23,7 @@
 CONFIG_SEC_FIRMWARE_ARMV8_PSCI=y
 CONFIG_AHCI=y
 CONFIG_DISTRO_DEFAULTS=y
+CONFIG_REMAKE_ELF=y
 CONFIG_MP=y
 CONFIG_FIT_VERBOSE=y
 CONFIG_OF_BOARD_SETUP=y
@@ -50,6 +51,7 @@
 CONFIG_OF_CONTROL=y
 CONFIG_ENV_OVERWRITE=y
 CONFIG_DM=y
+CONFIG_SATA=y
 CONFIG_SATA_CEVA=y
 CONFIG_DYNAMIC_DDR_CLK_FREQ=y
 CONFIG_DDR_ECC=y
diff --git a/configs/ls1046aqds_tfa_defconfig b/configs/ls1046aqds_tfa_defconfig
index 4cc84f8..7ac9406 100644
--- a/configs/ls1046aqds_tfa_defconfig
+++ b/configs/ls1046aqds_tfa_defconfig
@@ -24,6 +24,7 @@
 CONFIG_SEC_FIRMWARE_ARMV8_PSCI=y
 CONFIG_AHCI=y
 CONFIG_DISTRO_DEFAULTS=y
+CONFIG_REMAKE_ELF=y
 CONFIG_MP=y
 CONFIG_FIT_VERBOSE=y
 CONFIG_OF_BOARD_SETUP=y
@@ -58,6 +59,7 @@
 CONFIG_ENV_ADDR=0x60500000
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_DM=y
+CONFIG_SATA=y
 CONFIG_SATA_CEVA=y
 CONFIG_FSL_CAAM=y
 CONFIG_DYNAMIC_DDR_CLK_FREQ=y
diff --git a/configs/ls1046ardb_emmc_defconfig b/configs/ls1046ardb_emmc_defconfig
index 358c857..fe06a2e 100644
--- a/configs/ls1046ardb_emmc_defconfig
+++ b/configs/ls1046ardb_emmc_defconfig
@@ -21,6 +21,7 @@
 CONFIG_SPL=y
 CONFIG_AHCI=y
 CONFIG_DISTRO_DEFAULTS=y
+CONFIG_REMAKE_ELF=y
 CONFIG_MP=y
 CONFIG_FIT_VERBOSE=y
 CONFIG_OF_BOARD_SETUP=y
@@ -59,6 +60,7 @@
 CONFIG_ENV_IS_IN_MMC=y
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_DM=y
+CONFIG_SATA=y
 CONFIG_SATA_CEVA=y
 CONFIG_FSL_CAAM=y
 CONFIG_DDR_ECC=y
diff --git a/configs/ls1046ardb_qspi_SECURE_BOOT_defconfig b/configs/ls1046ardb_qspi_SECURE_BOOT_defconfig
index 96733ec..eb94ca3 100644
--- a/configs/ls1046ardb_qspi_SECURE_BOOT_defconfig
+++ b/configs/ls1046ardb_qspi_SECURE_BOOT_defconfig
@@ -15,6 +15,7 @@
 CONFIG_QSPI_AHB_INIT=y
 CONFIG_AHCI=y
 CONFIG_DISTRO_DEFAULTS=y
+CONFIG_REMAKE_ELF=y
 CONFIG_MP=y
 CONFIG_FIT_VERBOSE=y
 CONFIG_OF_BOARD_SETUP=y
@@ -42,6 +43,7 @@
 CONFIG_ENV_OVERWRITE=y
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_DM=y
+CONFIG_SATA=y
 CONFIG_SATA_CEVA=y
 CONFIG_DDR_ECC=y
 CONFIG_ECC_INIT_VIA_DDRCONTROLLER=y
diff --git a/configs/ls1046ardb_qspi_defconfig b/configs/ls1046ardb_qspi_defconfig
index 4b92ba3..41e735d 100644
--- a/configs/ls1046ardb_qspi_defconfig
+++ b/configs/ls1046ardb_qspi_defconfig
@@ -16,6 +16,7 @@
 CONFIG_QSPI_AHB_INIT=y
 CONFIG_AHCI=y
 CONFIG_DISTRO_DEFAULTS=y
+CONFIG_REMAKE_ELF=y
 CONFIG_MP=y
 CONFIG_FIT_VERBOSE=y
 CONFIG_OF_BOARD_SETUP=y
@@ -45,6 +46,7 @@
 CONFIG_ENV_ADDR=0x40300000
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_DM=y
+CONFIG_SATA=y
 CONFIG_SATA_CEVA=y
 CONFIG_FSL_CAAM=y
 CONFIG_DDR_ECC=y
diff --git a/configs/ls1046ardb_qspi_spl_defconfig b/configs/ls1046ardb_qspi_spl_defconfig
index af92ba4..3b4a939 100644
--- a/configs/ls1046ardb_qspi_spl_defconfig
+++ b/configs/ls1046ardb_qspi_spl_defconfig
@@ -23,6 +23,7 @@
 CONFIG_SPL=y
 CONFIG_AHCI=y
 CONFIG_DISTRO_DEFAULTS=y
+CONFIG_REMAKE_ELF=y
 CONFIG_MP=y
 CONFIG_FIT_VERBOSE=y
 CONFIG_SPL_LOAD_FIT=y
@@ -64,6 +65,7 @@
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_SPL_ENV_IS_NOWHERE=y
 CONFIG_DM=y
+CONFIG_SATA=y
 CONFIG_SATA_CEVA=y
 CONFIG_FSL_CAAM=y
 CONFIG_DDR_ECC=y
diff --git a/configs/ls1046ardb_sdcard_SECURE_BOOT_defconfig b/configs/ls1046ardb_sdcard_SECURE_BOOT_defconfig
index 4ee9316..a8d0231 100644
--- a/configs/ls1046ardb_sdcard_SECURE_BOOT_defconfig
+++ b/configs/ls1046ardb_sdcard_SECURE_BOOT_defconfig
@@ -20,6 +20,7 @@
 CONFIG_SPL_DRIVERS_MISC=y
 CONFIG_SPL=y
 CONFIG_DISTRO_DEFAULTS=y
+CONFIG_REMAKE_ELF=y
 CONFIG_MP=y
 CONFIG_FIT_VERBOSE=y
 CONFIG_OF_BOARD_SETUP=y
@@ -87,6 +88,7 @@
 CONFIG_POWER_LEGACY=y
 CONFIG_POWER_I2C=y
 CONFIG_SYS_QE_FMAN_FW_IN_MMC=y
+CONFIG_SCSI_AHCI_PLAT=y
 CONFIG_SYS_NS16550=y
 CONFIG_SPI=y
 CONFIG_DM_SPI=y
diff --git a/configs/ls1046ardb_sdcard_defconfig b/configs/ls1046ardb_sdcard_defconfig
index ece0dc2..eb43d79 100644
--- a/configs/ls1046ardb_sdcard_defconfig
+++ b/configs/ls1046ardb_sdcard_defconfig
@@ -21,6 +21,7 @@
 CONFIG_SPL=y
 CONFIG_AHCI=y
 CONFIG_DISTRO_DEFAULTS=y
+CONFIG_REMAKE_ELF=y
 CONFIG_MP=y
 CONFIG_FIT_VERBOSE=y
 CONFIG_OF_BOARD_SETUP=y
@@ -58,6 +59,7 @@
 CONFIG_ENV_IS_IN_MMC=y
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_DM=y
+CONFIG_SATA=y
 CONFIG_SATA_CEVA=y
 CONFIG_FSL_CAAM=y
 CONFIG_DDR_ECC=y
diff --git a/configs/ls1046ardb_tfa_SECURE_BOOT_defconfig b/configs/ls1046ardb_tfa_SECURE_BOOT_defconfig
index a721704..7e847c8 100644
--- a/configs/ls1046ardb_tfa_SECURE_BOOT_defconfig
+++ b/configs/ls1046ardb_tfa_SECURE_BOOT_defconfig
@@ -17,6 +17,7 @@
 CONFIG_SEC_FIRMWARE_ARMV8_PSCI=y
 CONFIG_AHCI=y
 CONFIG_DISTRO_DEFAULTS=y
+CONFIG_REMAKE_ELF=y
 CONFIG_MP=y
 CONFIG_FIT_VERBOSE=y
 CONFIG_OF_BOARD_SETUP=y
@@ -38,6 +39,7 @@
 CONFIG_OF_CONTROL=y
 CONFIG_ENV_OVERWRITE=y
 CONFIG_DM=y
+CONFIG_SATA=y
 CONFIG_SATA_CEVA=y
 CONFIG_DDR_ECC=y
 CONFIG_ECC_INIT_VIA_DDRCONTROLLER=y
diff --git a/configs/ls1046ardb_tfa_defconfig b/configs/ls1046ardb_tfa_defconfig
index 1c6c157..867acb2 100644
--- a/configs/ls1046ardb_tfa_defconfig
+++ b/configs/ls1046ardb_tfa_defconfig
@@ -18,6 +18,7 @@
 CONFIG_SEC_FIRMWARE_ARMV8_PSCI=y
 CONFIG_AHCI=y
 CONFIG_DISTRO_DEFAULTS=y
+CONFIG_REMAKE_ELF=y
 CONFIG_MP=y
 CONFIG_FIT_VERBOSE=y
 CONFIG_OF_BOARD_SETUP=y
@@ -43,6 +44,7 @@
 CONFIG_ENV_ADDR=0x40500000
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_DM=y
+CONFIG_SATA=y
 CONFIG_SATA_CEVA=y
 CONFIG_FSL_CAAM=y
 CONFIG_DDR_ECC=y
diff --git a/configs/ls1088aqds_defconfig b/configs/ls1088aqds_defconfig
index 994d98b..f51bc3d 100644
--- a/configs/ls1088aqds_defconfig
+++ b/configs/ls1088aqds_defconfig
@@ -19,6 +19,7 @@
 CONFIG_FSL_LS_PPA=y
 CONFIG_AHCI=y
 # CONFIG_SYS_MALLOC_F is not set
+CONFIG_REMAKE_ELF=y
 CONFIG_MP=y
 CONFIG_FIT_VERBOSE=y
 CONFIG_OF_BOARD_SETUP=y
@@ -51,6 +52,7 @@
 CONFIG_ENV_ADDR=0x80300000
 CONFIG_NET_RANDOM_ETHADDR=y
 CONFIG_DM=y
+CONFIG_SATA=y
 CONFIG_SCSI_AHCI=y
 CONFIG_SATA_CEVA=y
 CONFIG_DYNAMIC_DDR_CLK_FREQ=y
diff --git a/configs/ls1088aqds_qspi_SECURE_BOOT_defconfig b/configs/ls1088aqds_qspi_SECURE_BOOT_defconfig
index d98641c..6f6206b 100644
--- a/configs/ls1088aqds_qspi_SECURE_BOOT_defconfig
+++ b/configs/ls1088aqds_qspi_SECURE_BOOT_defconfig
@@ -21,6 +21,7 @@
 CONFIG_AHCI=y
 CONFIG_DISTRO_DEFAULTS=y
 # CONFIG_SYS_MALLOC_F is not set
+CONFIG_REMAKE_ELF=y
 CONFIG_MP=y
 CONFIG_FIT_VERBOSE=y
 CONFIG_OF_BOARD_SETUP=y
@@ -47,6 +48,7 @@
 CONFIG_ENV_OVERWRITE=y
 CONFIG_NET_RANDOM_ETHADDR=y
 CONFIG_DM=y
+CONFIG_SATA=y
 CONFIG_SCSI_AHCI=y
 CONFIG_SATA_CEVA=y
 CONFIG_DDR_ECC=y
diff --git a/configs/ls1088aqds_qspi_defconfig b/configs/ls1088aqds_qspi_defconfig
index 38449f2..68de77e 100644
--- a/configs/ls1088aqds_qspi_defconfig
+++ b/configs/ls1088aqds_qspi_defconfig
@@ -22,6 +22,7 @@
 CONFIG_AHCI=y
 CONFIG_DISTRO_DEFAULTS=y
 # CONFIG_SYS_MALLOC_F is not set
+CONFIG_REMAKE_ELF=y
 CONFIG_MP=y
 CONFIG_FIT_VERBOSE=y
 CONFIG_OF_BOARD_SETUP=y
@@ -50,6 +51,7 @@
 CONFIG_ENV_ADDR=0x20300000
 CONFIG_NET_RANDOM_ETHADDR=y
 CONFIG_DM=y
+CONFIG_SATA=y
 CONFIG_SCSI_AHCI=y
 CONFIG_SATA_CEVA=y
 CONFIG_DDR_ECC=y
diff --git a/configs/ls1088aqds_sdcard_ifc_defconfig b/configs/ls1088aqds_sdcard_ifc_defconfig
index 70634a3..ac0601a 100644
--- a/configs/ls1088aqds_sdcard_ifc_defconfig
+++ b/configs/ls1088aqds_sdcard_ifc_defconfig
@@ -26,6 +26,7 @@
 CONFIG_SPL=y
 CONFIG_AHCI=y
 # CONFIG_SYS_MALLOC_F is not set
+CONFIG_REMAKE_ELF=y
 CONFIG_MP=y
 CONFIG_OF_BOARD_SETUP=y
 CONFIG_DYNAMIC_SYS_CLK_FREQ=y
@@ -62,6 +63,7 @@
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_NET_RANDOM_ETHADDR=y
 CONFIG_DM=y
+CONFIG_SATA=y
 CONFIG_SCSI_AHCI=y
 CONFIG_SATA_CEVA=y
 CONFIG_DYNAMIC_DDR_CLK_FREQ=y
diff --git a/configs/ls1088aqds_sdcard_qspi_defconfig b/configs/ls1088aqds_sdcard_qspi_defconfig
index 21385a9..3a4f696 100644
--- a/configs/ls1088aqds_sdcard_qspi_defconfig
+++ b/configs/ls1088aqds_sdcard_qspi_defconfig
@@ -27,6 +27,7 @@
 CONFIG_AHCI=y
 CONFIG_DISTRO_DEFAULTS=y
 # CONFIG_SYS_MALLOC_F is not set
+CONFIG_REMAKE_ELF=y
 CONFIG_MP=y
 CONFIG_FIT_VERBOSE=y
 CONFIG_OF_BOARD_SETUP=y
@@ -60,6 +61,7 @@
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_NET_RANDOM_ETHADDR=y
 CONFIG_DM=y
+CONFIG_SATA=y
 CONFIG_SCSI_AHCI=y
 CONFIG_SATA_CEVA=y
 CONFIG_DDR_ECC=y
diff --git a/configs/ls1088aqds_tfa_defconfig b/configs/ls1088aqds_tfa_defconfig
index 4ff88a5..d4abdb3 100644
--- a/configs/ls1088aqds_tfa_defconfig
+++ b/configs/ls1088aqds_tfa_defconfig
@@ -24,6 +24,7 @@
 CONFIG_SEC_FIRMWARE_ARMV8_PSCI=y
 CONFIG_AHCI=y
 CONFIG_DISTRO_DEFAULTS=y
+CONFIG_REMAKE_ELF=y
 CONFIG_MP=y
 CONFIG_FIT_VERBOSE=y
 CONFIG_OF_BOARD_SETUP=y
@@ -59,6 +60,7 @@
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_NET_RANDOM_ETHADDR=y
 CONFIG_DM=y
+CONFIG_SATA=y
 CONFIG_SCSI_AHCI=y
 CONFIG_SATA_CEVA=y
 CONFIG_DYNAMIC_DDR_CLK_FREQ=y
diff --git a/configs/ls1088ardb_qspi_SECURE_BOOT_defconfig b/configs/ls1088ardb_qspi_SECURE_BOOT_defconfig
index 614bfca..c4ae4b5 100644
--- a/configs/ls1088ardb_qspi_SECURE_BOOT_defconfig
+++ b/configs/ls1088ardb_qspi_SECURE_BOOT_defconfig
@@ -21,6 +21,7 @@
 CONFIG_AHCI=y
 CONFIG_DISTRO_DEFAULTS=y
 # CONFIG_SYS_MALLOC_F is not set
+CONFIG_REMAKE_ELF=y
 CONFIG_MP=y
 CONFIG_FIT_VERBOSE=y
 CONFIG_OF_BOARD_SETUP=y
@@ -49,6 +50,7 @@
 CONFIG_ENV_OVERWRITE=y
 CONFIG_NET_RANDOM_ETHADDR=y
 CONFIG_DM=y
+CONFIG_SATA=y
 CONFIG_SCSI_AHCI=y
 CONFIG_SATA_CEVA=y
 CONFIG_DDR_ECC=y
diff --git a/configs/ls1088ardb_qspi_defconfig b/configs/ls1088ardb_qspi_defconfig
index d7e935e..f3c0191 100644
--- a/configs/ls1088ardb_qspi_defconfig
+++ b/configs/ls1088ardb_qspi_defconfig
@@ -22,6 +22,7 @@
 CONFIG_AHCI=y
 CONFIG_DISTRO_DEFAULTS=y
 # CONFIG_SYS_MALLOC_F is not set
+CONFIG_REMAKE_ELF=y
 CONFIG_MP=y
 CONFIG_FIT_VERBOSE=y
 CONFIG_OF_BOARD_SETUP=y
@@ -52,6 +53,7 @@
 CONFIG_ENV_ADDR=0x20300000
 CONFIG_NET_RANDOM_ETHADDR=y
 CONFIG_DM=y
+CONFIG_SATA=y
 CONFIG_SCSI_AHCI=y
 CONFIG_SATA_CEVA=y
 CONFIG_DDR_ECC=y
diff --git a/configs/ls1088ardb_sdcard_qspi_SECURE_BOOT_defconfig b/configs/ls1088ardb_sdcard_qspi_SECURE_BOOT_defconfig
index 048b10f..96a96f5 100644
--- a/configs/ls1088ardb_sdcard_qspi_SECURE_BOOT_defconfig
+++ b/configs/ls1088ardb_sdcard_qspi_SECURE_BOOT_defconfig
@@ -26,6 +26,7 @@
 CONFIG_SPL=y
 CONFIG_DISTRO_DEFAULTS=y
 # CONFIG_SYS_MALLOC_F is not set
+CONFIG_REMAKE_ELF=y
 CONFIG_MP=y
 CONFIG_FIT_VERBOSE=y
 CONFIG_OF_BOARD_SETUP=y
@@ -90,6 +91,7 @@
 CONFIG_FSL_LS_MDIO=y
 CONFIG_PCI=y
 CONFIG_PCIE_LAYERSCAPE_RC=y
+CONFIG_SCSI_AHCI_PLAT=y
 CONFIG_SYS_NS16550=y
 CONFIG_SPI=y
 CONFIG_DM_SPI=y
diff --git a/configs/ls1088ardb_sdcard_qspi_defconfig b/configs/ls1088ardb_sdcard_qspi_defconfig
index 6677583..566e1eb 100644
--- a/configs/ls1088ardb_sdcard_qspi_defconfig
+++ b/configs/ls1088ardb_sdcard_qspi_defconfig
@@ -27,6 +27,7 @@
 CONFIG_AHCI=y
 CONFIG_DISTRO_DEFAULTS=y
 # CONFIG_SYS_MALLOC_F is not set
+CONFIG_REMAKE_ELF=y
 CONFIG_MP=y
 CONFIG_FIT_VERBOSE=y
 CONFIG_OF_BOARD_SETUP=y
@@ -62,6 +63,7 @@
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_NET_RANDOM_ETHADDR=y
 CONFIG_DM=y
+CONFIG_SATA=y
 CONFIG_SCSI_AHCI=y
 CONFIG_SATA_CEVA=y
 CONFIG_DDR_ECC=y
diff --git a/configs/ls1088ardb_tfa_SECURE_BOOT_defconfig b/configs/ls1088ardb_tfa_SECURE_BOOT_defconfig
index 579ece1..53244a8 100644
--- a/configs/ls1088ardb_tfa_SECURE_BOOT_defconfig
+++ b/configs/ls1088ardb_tfa_SECURE_BOOT_defconfig
@@ -23,6 +23,7 @@
 CONFIG_SEC_FIRMWARE_ARMV8_PSCI=y
 CONFIG_AHCI=y
 CONFIG_DISTRO_DEFAULTS=y
+CONFIG_REMAKE_ELF=y
 CONFIG_MP=y
 CONFIG_FIT_VERBOSE=y
 CONFIG_OF_BOARD_SETUP=y
@@ -49,6 +50,7 @@
 CONFIG_ENV_OVERWRITE=y
 CONFIG_NET_RANDOM_ETHADDR=y
 CONFIG_DM=y
+CONFIG_SATA=y
 CONFIG_SCSI_AHCI=y
 CONFIG_SATA_CEVA=y
 CONFIG_DDR_ECC=y
diff --git a/configs/ls1088ardb_tfa_defconfig b/configs/ls1088ardb_tfa_defconfig
index 9e4385f..e2f975b 100644
--- a/configs/ls1088ardb_tfa_defconfig
+++ b/configs/ls1088ardb_tfa_defconfig
@@ -24,6 +24,7 @@
 CONFIG_SEC_FIRMWARE_ARMV8_PSCI=y
 CONFIG_AHCI=y
 CONFIG_DISTRO_DEFAULTS=y
+CONFIG_REMAKE_ELF=y
 CONFIG_MP=y
 CONFIG_FIT_VERBOSE=y
 CONFIG_OF_BOARD_SETUP=y
@@ -55,6 +56,7 @@
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_NET_RANDOM_ETHADDR=y
 CONFIG_DM=y
+CONFIG_SATA=y
 CONFIG_SCSI_AHCI=y
 CONFIG_SATA_CEVA=y
 CONFIG_DDR_ECC=y
diff --git a/configs/ls2080aqds_SECURE_BOOT_defconfig b/configs/ls2080aqds_SECURE_BOOT_defconfig
index 680d764..45fe718 100644
--- a/configs/ls2080aqds_SECURE_BOOT_defconfig
+++ b/configs/ls2080aqds_SECURE_BOOT_defconfig
@@ -11,6 +11,7 @@
 CONFIG_FSL_LS_PPA=y
 CONFIG_AHCI=y
 # CONFIG_SYS_MALLOC_F is not set
+CONFIG_REMAKE_ELF=y
 CONFIG_MP=y
 CONFIG_FIT_VERBOSE=y
 CONFIG_OF_BOARD_SETUP=y
@@ -39,6 +40,7 @@
 CONFIG_ENV_OVERWRITE=y
 CONFIG_NET_RANDOM_ETHADDR=y
 CONFIG_DM=y
+CONFIG_SATA=y
 CONFIG_SATA_CEVA=y
 CONFIG_DYNAMIC_DDR_CLK_FREQ=y
 CONFIG_DDR_ECC=y
diff --git a/configs/ls2080aqds_defconfig b/configs/ls2080aqds_defconfig
index bb5de15..b695f8a 100644
--- a/configs/ls2080aqds_defconfig
+++ b/configs/ls2080aqds_defconfig
@@ -11,6 +11,7 @@
 CONFIG_FSL_LS_PPA=y
 CONFIG_AHCI=y
 # CONFIG_SYS_MALLOC_F is not set
+CONFIG_REMAKE_ELF=y
 CONFIG_MP=y
 CONFIG_FIT_VERBOSE=y
 CONFIG_OF_BOARD_SETUP=y
@@ -41,6 +42,7 @@
 CONFIG_ENV_ADDR=0x80300000
 CONFIG_NET_RANDOM_ETHADDR=y
 CONFIG_DM=y
+CONFIG_SATA=y
 CONFIG_SATA_CEVA=y
 CONFIG_FSL_CAAM=y
 CONFIG_DYNAMIC_DDR_CLK_FREQ=y
diff --git a/configs/ls2080aqds_nand_defconfig b/configs/ls2080aqds_nand_defconfig
index 929d591..57622e6 100644
--- a/configs/ls2080aqds_nand_defconfig
+++ b/configs/ls2080aqds_nand_defconfig
@@ -15,6 +15,7 @@
 CONFIG_SPL_DRIVERS_MISC=y
 CONFIG_SPL=y
 CONFIG_AHCI=y
+CONFIG_REMAKE_ELF=y
 CONFIG_MP=y
 CONFIG_FIT=y
 CONFIG_FIT_VERBOSE=y
@@ -52,6 +53,7 @@
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_NET_RANDOM_ETHADDR=y
 CONFIG_DM=y
+CONFIG_SATA=y
 CONFIG_SATA_CEVA=y
 CONFIG_FSL_CAAM=y
 CONFIG_DYNAMIC_DDR_CLK_FREQ=y
diff --git a/configs/ls2080aqds_qspi_defconfig b/configs/ls2080aqds_qspi_defconfig
index acb527b..fc0afef 100644
--- a/configs/ls2080aqds_qspi_defconfig
+++ b/configs/ls2080aqds_qspi_defconfig
@@ -10,6 +10,7 @@
 CONFIG_DEFAULT_DEVICE_TREE="fsl-ls2080a-qds"
 CONFIG_FSL_USE_PCA9547_MUX=y
 CONFIG_AHCI=y
+CONFIG_REMAKE_ELF=y
 CONFIG_MP=y
 CONFIG_FIT=y
 CONFIG_FIT_VERBOSE=y
@@ -42,6 +43,7 @@
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_NET_RANDOM_ETHADDR=y
 CONFIG_DM=y
+CONFIG_SATA=y
 CONFIG_SATA_CEVA=y
 CONFIG_FSL_CAAM=y
 CONFIG_DYNAMIC_DDR_CLK_FREQ=y
diff --git a/configs/ls2080aqds_sdcard_defconfig b/configs/ls2080aqds_sdcard_defconfig
index f6a4595..f24f003 100644
--- a/configs/ls2080aqds_sdcard_defconfig
+++ b/configs/ls2080aqds_sdcard_defconfig
@@ -17,6 +17,7 @@
 CONFIG_SPL_DRIVERS_MISC=y
 CONFIG_SPL=y
 CONFIG_AHCI=y
+CONFIG_REMAKE_ELF=y
 CONFIG_MP=y
 CONFIG_FIT_VERBOSE=y
 CONFIG_OF_BOARD_SETUP=y
@@ -49,6 +50,7 @@
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_NET_RANDOM_ETHADDR=y
 CONFIG_DM=y
+CONFIG_SATA=y
 CONFIG_SATA_CEVA=y
 CONFIG_DYNAMIC_DDR_CLK_FREQ=y
 CONFIG_DDR_ECC=y
diff --git a/configs/ls2080ardb_SECURE_BOOT_defconfig b/configs/ls2080ardb_SECURE_BOOT_defconfig
index 305272b..0e84f89 100644
--- a/configs/ls2080ardb_SECURE_BOOT_defconfig
+++ b/configs/ls2080ardb_SECURE_BOOT_defconfig
@@ -15,6 +15,7 @@
 CONFIG_FSL_LS_PPA=y
 CONFIG_AHCI=y
 # CONFIG_SYS_MALLOC_F is not set
+CONFIG_REMAKE_ELF=y
 CONFIG_MP=y
 CONFIG_FIT_VERBOSE=y
 CONFIG_OF_BOARD_SETUP=y
@@ -43,6 +44,7 @@
 CONFIG_ENV_OVERWRITE=y
 CONFIG_NET_RANDOM_ETHADDR=y
 CONFIG_DM=y
+CONFIG_SATA=y
 CONFIG_SATA_CEVA=y
 CONFIG_DDR_CLK_FREQ=133333333
 CONFIG_DDR_ECC=y
diff --git a/configs/ls2080ardb_defconfig b/configs/ls2080ardb_defconfig
index 0890b58..d350a31 100644
--- a/configs/ls2080ardb_defconfig
+++ b/configs/ls2080ardb_defconfig
@@ -15,6 +15,7 @@
 CONFIG_FSL_LS_PPA=y
 CONFIG_AHCI=y
 # CONFIG_SYS_MALLOC_F is not set
+CONFIG_REMAKE_ELF=y
 CONFIG_MP=y
 CONFIG_FIT_VERBOSE=y
 CONFIG_OF_BOARD_SETUP=y
@@ -45,6 +46,7 @@
 CONFIG_ENV_ADDR=0x80300000
 CONFIG_NET_RANDOM_ETHADDR=y
 CONFIG_DM=y
+CONFIG_SATA=y
 CONFIG_SATA_CEVA=y
 CONFIG_FSL_CAAM=y
 CONFIG_DDR_CLK_FREQ=133333333
diff --git a/configs/ls2080ardb_nand_defconfig b/configs/ls2080ardb_nand_defconfig
index 37c1d6a..41b6684 100644
--- a/configs/ls2080ardb_nand_defconfig
+++ b/configs/ls2080ardb_nand_defconfig
@@ -19,6 +19,7 @@
 CONFIG_SPL_DRIVERS_MISC=y
 CONFIG_SPL=y
 CONFIG_AHCI=y
+CONFIG_REMAKE_ELF=y
 CONFIG_MP=y
 CONFIG_FIT=y
 CONFIG_FIT_VERBOSE=y
@@ -55,6 +56,7 @@
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_NET_RANDOM_ETHADDR=y
 CONFIG_DM=y
+CONFIG_SATA=y
 CONFIG_SATA_CEVA=y
 CONFIG_FSL_CAAM=y
 CONFIG_DDR_CLK_FREQ=133333333
diff --git a/configs/ls2081ardb_defconfig b/configs/ls2081ardb_defconfig
index f0d5613..2a8a562 100644
--- a/configs/ls2081ardb_defconfig
+++ b/configs/ls2081ardb_defconfig
@@ -17,6 +17,7 @@
 CONFIG_QSPI_AHB_INIT=y
 CONFIG_AHCI=y
 # CONFIG_SYS_MALLOC_F is not set
+CONFIG_REMAKE_ELF=y
 CONFIG_MP=y
 CONFIG_FIT_VERBOSE=y
 CONFIG_OF_BOARD_SETUP=y
@@ -43,6 +44,7 @@
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_NET_RANDOM_ETHADDR=y
 CONFIG_DM=y
+CONFIG_SATA=y
 CONFIG_SCSI_AHCI=y
 CONFIG_SATA_CEVA=y
 CONFIG_FSL_CAAM=y
diff --git a/configs/ls2088aqds_tfa_defconfig b/configs/ls2088aqds_tfa_defconfig
index ee62dd1..e247f49 100644
--- a/configs/ls2088aqds_tfa_defconfig
+++ b/configs/ls2088aqds_tfa_defconfig
@@ -15,6 +15,7 @@
 CONFIG_SEC_FIRMWARE_ARMV8_PSCI=y
 CONFIG_AHCI=y
 # CONFIG_SYS_MALLOC_F is not set
+CONFIG_REMAKE_ELF=y
 CONFIG_MP=y
 CONFIG_FIT_VERBOSE=y
 CONFIG_OF_BOARD_SETUP=y
@@ -50,6 +51,7 @@
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_NET_RANDOM_ETHADDR=y
 CONFIG_DM=y
+CONFIG_SATA=y
 CONFIG_SATA_CEVA=y
 CONFIG_FSL_CAAM=y
 CONFIG_DYNAMIC_DDR_CLK_FREQ=y
diff --git a/configs/ls2088ardb_qspi_SECURE_BOOT_defconfig b/configs/ls2088ardb_qspi_SECURE_BOOT_defconfig
index 2e32d97..e75fa0e 100644
--- a/configs/ls2088ardb_qspi_SECURE_BOOT_defconfig
+++ b/configs/ls2088ardb_qspi_SECURE_BOOT_defconfig
@@ -17,6 +17,7 @@
 CONFIG_QSPI_AHB_INIT=y
 CONFIG_AHCI=y
 # CONFIG_SYS_MALLOC_F is not set
+CONFIG_REMAKE_ELF=y
 CONFIG_MP=y
 CONFIG_FIT_VERBOSE=y
 CONFIG_OF_BOARD_SETUP=y
@@ -41,6 +42,7 @@
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_NET_RANDOM_ETHADDR=y
 CONFIG_DM=y
+CONFIG_SATA=y
 CONFIG_SATA_CEVA=y
 CONFIG_DDR_CLK_FREQ=133333333
 CONFIG_DDR_ECC=y
diff --git a/configs/ls2088ardb_qspi_defconfig b/configs/ls2088ardb_qspi_defconfig
index f5c7028f..7889300 100644
--- a/configs/ls2088ardb_qspi_defconfig
+++ b/configs/ls2088ardb_qspi_defconfig
@@ -18,6 +18,7 @@
 CONFIG_QSPI_AHB_INIT=y
 CONFIG_AHCI=y
 # CONFIG_SYS_MALLOC_F is not set
+CONFIG_REMAKE_ELF=y
 CONFIG_MP=y
 CONFIG_FIT_VERBOSE=y
 CONFIG_OF_BOARD_SETUP=y
@@ -47,6 +48,7 @@
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_NET_RANDOM_ETHADDR=y
 CONFIG_DM=y
+CONFIG_SATA=y
 CONFIG_SATA_CEVA=y
 CONFIG_FSL_CAAM=y
 CONFIG_DDR_CLK_FREQ=133333333
diff --git a/configs/ls2088ardb_tfa_SECURE_BOOT_defconfig b/configs/ls2088ardb_tfa_SECURE_BOOT_defconfig
index 97a8faf..032b133 100644
--- a/configs/ls2088ardb_tfa_SECURE_BOOT_defconfig
+++ b/configs/ls2088ardb_tfa_SECURE_BOOT_defconfig
@@ -19,6 +19,7 @@
 CONFIG_ARMV8_SEC_FIRMWARE_SUPPORT=y
 CONFIG_SEC_FIRMWARE_ARMV8_PSCI=y
 CONFIG_AHCI=y
+CONFIG_REMAKE_ELF=y
 CONFIG_MP=y
 CONFIG_FIT_VERBOSE=y
 CONFIG_OF_BOARD_SETUP=y
@@ -46,6 +47,7 @@
 CONFIG_ENV_OVERWRITE=y
 CONFIG_NET_RANDOM_ETHADDR=y
 CONFIG_DM=y
+CONFIG_SATA=y
 CONFIG_SATA_CEVA=y
 CONFIG_DDR_CLK_FREQ=133333333
 CONFIG_DDR_ECC=y
diff --git a/configs/ls2088ardb_tfa_defconfig b/configs/ls2088ardb_tfa_defconfig
index 8567400..ffc3a7b 100644
--- a/configs/ls2088ardb_tfa_defconfig
+++ b/configs/ls2088ardb_tfa_defconfig
@@ -20,6 +20,7 @@
 CONFIG_ARMV8_SEC_FIRMWARE_SUPPORT=y
 CONFIG_SEC_FIRMWARE_ARMV8_PSCI=y
 CONFIG_AHCI=y
+CONFIG_REMAKE_ELF=y
 CONFIG_MP=y
 CONFIG_FIT_VERBOSE=y
 CONFIG_OF_BOARD_SETUP=y
@@ -52,6 +53,7 @@
 CONFIG_ENV_ADDR=0x580500000
 CONFIG_NET_RANDOM_ETHADDR=y
 CONFIG_DM=y
+CONFIG_SATA=y
 CONFIG_SATA_CEVA=y
 CONFIG_FSL_CAAM=y
 CONFIG_DDR_CLK_FREQ=133333333
diff --git a/configs/lschlv2_defconfig b/configs/lschlv2_defconfig
index 497da09..df214b3 100644
--- a/configs/lschlv2_defconfig
+++ b/configs/lschlv2_defconfig
@@ -39,6 +39,7 @@
 CONFIG_NETCONSOLE=y
 CONFIG_DM=y
 CONFIG_SATA_MV=y
+CONFIG_SYS_SATA_MAX_DEVICE=1
 CONFIG_KIRKWOOD_GPIO=y
 # CONFIG_MMC is not set
 CONFIG_MTD=y
diff --git a/configs/lsxhl_defconfig b/configs/lsxhl_defconfig
index cadeb9a..6ccc0e7 100644
--- a/configs/lsxhl_defconfig
+++ b/configs/lsxhl_defconfig
@@ -39,6 +39,7 @@
 CONFIG_NETCONSOLE=y
 CONFIG_DM=y
 CONFIG_SATA_MV=y
+CONFIG_SYS_SATA_MAX_DEVICE=1
 CONFIG_KIRKWOOD_GPIO=y
 # CONFIG_MMC is not set
 CONFIG_MTD=y
diff --git a/configs/lx2160aqds_tfa_SECURE_BOOT_defconfig b/configs/lx2160aqds_tfa_SECURE_BOOT_defconfig
index 685ca1d..d5b8168 100644
--- a/configs/lx2160aqds_tfa_SECURE_BOOT_defconfig
+++ b/configs/lx2160aqds_tfa_SECURE_BOOT_defconfig
@@ -22,6 +22,7 @@
 CONFIG_SEC_FIRMWARE_ARMV8_PSCI=y
 CONFIG_AHCI=y
 CONFIG_OF_BOARD_FIXUP=y
+CONFIG_REMAKE_ELF=y
 CONFIG_MP=y
 CONFIG_FIT_VERBOSE=y
 CONFIG_OF_BOARD_SETUP=y
@@ -49,6 +50,7 @@
 CONFIG_ENV_OVERWRITE=y
 CONFIG_NET_RANDOM_ETHADDR=y
 CONFIG_DM=y
+CONFIG_SATA=y
 CONFIG_SATA_CEVA=y
 CONFIG_DYNAMIC_DDR_CLK_FREQ=y
 CONFIG_DDR_ECC=y
diff --git a/configs/lx2160aqds_tfa_defconfig b/configs/lx2160aqds_tfa_defconfig
index 7561a71..b8addd5 100644
--- a/configs/lx2160aqds_tfa_defconfig
+++ b/configs/lx2160aqds_tfa_defconfig
@@ -23,6 +23,7 @@
 CONFIG_SEC_FIRMWARE_ARMV8_PSCI=y
 CONFIG_AHCI=y
 CONFIG_OF_BOARD_FIXUP=y
+CONFIG_REMAKE_ELF=y
 CONFIG_MP=y
 CONFIG_FIT_VERBOSE=y
 CONFIG_OF_BOARD_SETUP=y
@@ -55,6 +56,7 @@
 CONFIG_ENV_ADDR=0x20500000
 CONFIG_NET_RANDOM_ETHADDR=y
 CONFIG_DM=y
+CONFIG_SATA=y
 CONFIG_SATA_CEVA=y
 CONFIG_FSL_CAAM=y
 CONFIG_DYNAMIC_DDR_CLK_FREQ=y
diff --git a/configs/lx2160ardb_tfa_SECURE_BOOT_defconfig b/configs/lx2160ardb_tfa_SECURE_BOOT_defconfig
index 98a0f47..f53480c 100644
--- a/configs/lx2160ardb_tfa_SECURE_BOOT_defconfig
+++ b/configs/lx2160ardb_tfa_SECURE_BOOT_defconfig
@@ -23,6 +23,7 @@
 CONFIG_SEC_FIRMWARE_ARMV8_PSCI=y
 CONFIG_AHCI=y
 CONFIG_OF_BOARD_FIXUP=y
+CONFIG_REMAKE_ELF=y
 CONFIG_MP=y
 CONFIG_FIT_VERBOSE=y
 CONFIG_OF_BOARD_SETUP=y
@@ -47,6 +48,7 @@
 CONFIG_ENV_OVERWRITE=y
 CONFIG_NET_RANDOM_ETHADDR=y
 CONFIG_DM=y
+CONFIG_SATA=y
 CONFIG_SATA_CEVA=y
 CONFIG_DYNAMIC_DDR_CLK_FREQ=y
 CONFIG_DDR_ECC=y
diff --git a/configs/lx2160ardb_tfa_defconfig b/configs/lx2160ardb_tfa_defconfig
index 087e685..8798f3e 100644
--- a/configs/lx2160ardb_tfa_defconfig
+++ b/configs/lx2160ardb_tfa_defconfig
@@ -24,6 +24,7 @@
 CONFIG_SEC_FIRMWARE_ARMV8_PSCI=y
 CONFIG_AHCI=y
 CONFIG_OF_BOARD_FIXUP=y
+CONFIG_REMAKE_ELF=y
 CONFIG_MP=y
 CONFIG_FIT_VERBOSE=y
 CONFIG_OF_BOARD_SETUP=y
@@ -54,6 +55,7 @@
 CONFIG_ENV_ADDR=0x20500000
 CONFIG_NET_RANDOM_ETHADDR=y
 CONFIG_DM=y
+CONFIG_SATA=y
 CONFIG_SATA_CEVA=y
 CONFIG_FSL_CAAM=y
 CONFIG_DYNAMIC_DDR_CLK_FREQ=y
diff --git a/configs/lx2160ardb_tfa_stmm_defconfig b/configs/lx2160ardb_tfa_stmm_defconfig
index e08c7ab..a46d44d 100644
--- a/configs/lx2160ardb_tfa_stmm_defconfig
+++ b/configs/lx2160ardb_tfa_stmm_defconfig
@@ -24,6 +24,7 @@
 CONFIG_SEC_FIRMWARE_ARMV8_PSCI=y
 CONFIG_AHCI=y
 CONFIG_OF_BOARD_FIXUP=y
+CONFIG_REMAKE_ELF=y
 CONFIG_MP=y
 CONFIG_FIT_VERBOSE=y
 CONFIG_OF_BOARD_SETUP=y
@@ -54,6 +55,7 @@
 CONFIG_ENV_ADDR=0x20500000
 CONFIG_NET_RANDOM_ETHADDR=y
 CONFIG_DM=y
+CONFIG_SATA=y
 CONFIG_SATA_CEVA=y
 CONFIG_FSL_CAAM=y
 CONFIG_DYNAMIC_DDR_CLK_FREQ=y
diff --git a/configs/lx2162aqds_tfa_SECURE_BOOT_defconfig b/configs/lx2162aqds_tfa_SECURE_BOOT_defconfig
index da310b7..3158147 100644
--- a/configs/lx2162aqds_tfa_SECURE_BOOT_defconfig
+++ b/configs/lx2162aqds_tfa_SECURE_BOOT_defconfig
@@ -22,6 +22,7 @@
 CONFIG_SEC_FIRMWARE_ARMV8_PSCI=y
 CONFIG_AHCI=y
 CONFIG_OF_BOARD_FIXUP=y
+CONFIG_REMAKE_ELF=y
 CONFIG_MP=y
 CONFIG_FIT_VERBOSE=y
 CONFIG_OF_BOARD_SETUP=y
@@ -51,6 +52,7 @@
 CONFIG_ENV_OVERWRITE=y
 CONFIG_NET_RANDOM_ETHADDR=y
 CONFIG_DM=y
+CONFIG_SATA=y
 CONFIG_SATA_CEVA=y
 CONFIG_DYNAMIC_DDR_CLK_FREQ=y
 CONFIG_DDR_ECC=y
diff --git a/configs/lx2162aqds_tfa_defconfig b/configs/lx2162aqds_tfa_defconfig
index 0817396..183769a 100644
--- a/configs/lx2162aqds_tfa_defconfig
+++ b/configs/lx2162aqds_tfa_defconfig
@@ -23,6 +23,7 @@
 CONFIG_SEC_FIRMWARE_ARMV8_PSCI=y
 CONFIG_AHCI=y
 CONFIG_OF_BOARD_FIXUP=y
+CONFIG_REMAKE_ELF=y
 CONFIG_MP=y
 CONFIG_FIT_VERBOSE=y
 CONFIG_OF_BOARD_SETUP=y
@@ -57,6 +58,7 @@
 CONFIG_ENV_ADDR=0x20500000
 CONFIG_NET_RANDOM_ETHADDR=y
 CONFIG_DM=y
+CONFIG_SATA=y
 CONFIG_SATA_CEVA=y
 CONFIG_FSL_CAAM=y
 CONFIG_DYNAMIC_DDR_CLK_FREQ=y
diff --git a/configs/lx2162aqds_tfa_verified_boot_defconfig b/configs/lx2162aqds_tfa_verified_boot_defconfig
index 425c8e6..5d14e31 100644
--- a/configs/lx2162aqds_tfa_verified_boot_defconfig
+++ b/configs/lx2162aqds_tfa_verified_boot_defconfig
@@ -23,6 +23,7 @@
 CONFIG_SEC_FIRMWARE_ARMV8_PSCI=y
 CONFIG_AHCI=y
 CONFIG_OF_BOARD_FIXUP=y
+CONFIG_REMAKE_ELF=y
 CONFIG_MP=y
 CONFIG_FIT_SIGNATURE=y
 CONFIG_FIT_VERBOSE=y
@@ -58,6 +59,7 @@
 CONFIG_ENV_ADDR=0x20500000
 CONFIG_NET_RANDOM_ETHADDR=y
 CONFIG_DM=y
+CONFIG_SATA=y
 CONFIG_SATA_CEVA=y
 CONFIG_FSL_CAAM=y
 CONFIG_DYNAMIC_DDR_CLK_FREQ=y
diff --git a/configs/malta64_defconfig b/configs/malta64_defconfig
index 9e6d8c0..1c1bc4e 100644
--- a/configs/malta64_defconfig
+++ b/configs/malta64_defconfig
@@ -25,6 +25,10 @@
 # CONFIG_ISO_PARTITION is not set
 CONFIG_ENV_IS_IN_FLASH=y
 CONFIG_ENV_ADDR=0xFFFFFFFFBE3E0000
+CONFIG_SYS_IDE_MAXBUS=1
+CONFIG_SYS_ATA_DATA_OFFSET=0
+CONFIG_SYS_ATA_REG_OFFSET=0
+CONFIG_SYS_ATA_IDE0_OFFSET=0x01f0
 CONFIG_MTD_NOR_FLASH=y
 CONFIG_FLASH_CFI_DRIVER=y
 CONFIG_SYS_FLASH_USE_BUFFER_WRITE=y
diff --git a/configs/malta64el_defconfig b/configs/malta64el_defconfig
index c44aa7e..756138d 100644
--- a/configs/malta64el_defconfig
+++ b/configs/malta64el_defconfig
@@ -27,6 +27,10 @@
 # CONFIG_ISO_PARTITION is not set
 CONFIG_ENV_IS_IN_FLASH=y
 CONFIG_ENV_ADDR=0xFFFFFFFFBE3E0000
+CONFIG_SYS_IDE_MAXBUS=1
+CONFIG_SYS_ATA_DATA_OFFSET=0
+CONFIG_SYS_ATA_REG_OFFSET=0
+CONFIG_SYS_ATA_IDE0_OFFSET=0x01f0
 CONFIG_MTD_NOR_FLASH=y
 CONFIG_FLASH_CFI_DRIVER=y
 CONFIG_SYS_FLASH_USE_BUFFER_WRITE=y
diff --git a/configs/malta_defconfig b/configs/malta_defconfig
index 852e5c0..802cc37 100644
--- a/configs/malta_defconfig
+++ b/configs/malta_defconfig
@@ -24,6 +24,10 @@
 # CONFIG_ISO_PARTITION is not set
 CONFIG_ENV_IS_IN_FLASH=y
 CONFIG_ENV_ADDR=0xBE3E0000
+CONFIG_SYS_IDE_MAXBUS=1
+CONFIG_SYS_ATA_DATA_OFFSET=0
+CONFIG_SYS_ATA_REG_OFFSET=0
+CONFIG_SYS_ATA_IDE0_OFFSET=0x01f0
 CONFIG_MTD_NOR_FLASH=y
 CONFIG_FLASH_CFI_DRIVER=y
 CONFIG_SYS_FLASH_USE_BUFFER_WRITE=y
diff --git a/configs/maltael_defconfig b/configs/maltael_defconfig
index b81ab6e..f929fc8 100644
--- a/configs/maltael_defconfig
+++ b/configs/maltael_defconfig
@@ -26,6 +26,10 @@
 # CONFIG_ISO_PARTITION is not set
 CONFIG_ENV_IS_IN_FLASH=y
 CONFIG_ENV_ADDR=0xBE3E0000
+CONFIG_SYS_IDE_MAXBUS=1
+CONFIG_SYS_ATA_DATA_OFFSET=0
+CONFIG_SYS_ATA_REG_OFFSET=0
+CONFIG_SYS_ATA_IDE0_OFFSET=0x01f0
 CONFIG_MTD_NOR_FLASH=y
 CONFIG_FLASH_CFI_DRIVER=y
 CONFIG_SYS_FLASH_USE_BUFFER_WRITE=y
diff --git a/configs/nanopi-k2_defconfig b/configs/nanopi-k2_defconfig
index 7452caa..6b2ea3f 100644
--- a/configs/nanopi-k2_defconfig
+++ b/configs/nanopi-k2_defconfig
@@ -9,6 +9,7 @@
 CONFIG_DEBUG_UART_CLOCK=24000000
 CONFIG_IDENT_STRING=" nanopi-k2"
 CONFIG_DEBUG_UART=y
+CONFIG_REMAKE_ELF=y
 CONFIG_SYS_LOAD_ADDR=0x1000000
 CONFIG_OF_BOARD_SETUP=y
 # CONFIG_DISPLAY_CPUINFO is not set
diff --git a/configs/nas220_defconfig b/configs/nas220_defconfig
index 7e4e19a..f6a1dcb 100644
--- a/configs/nas220_defconfig
+++ b/configs/nas220_defconfig
@@ -42,6 +42,10 @@
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_NETCONSOLE=y
 CONFIG_DM=y
+CONFIG_SYS_ATA_STRIDE=4
+CONFIG_SYS_ATA_DATA_OFFSET=0x100
+CONFIG_SYS_ATA_REG_OFFSET=0x100
+CONFIG_SYS_ATA_ALT_OFFSET=0x100
 CONFIG_KIRKWOOD_GPIO=y
 # CONFIG_MMC is not set
 CONFIG_MTD=y
diff --git a/configs/net2big_v2_defconfig b/configs/net2big_v2_defconfig
index 985f530..f55ca67 100644
--- a/configs/net2big_v2_defconfig
+++ b/configs/net2big_v2_defconfig
@@ -48,6 +48,7 @@
 CONFIG_NETCONSOLE=y
 CONFIG_DM=y
 CONFIG_SATA_MV=y
+CONFIG_SYS_SATA_MAX_DEVICE=2
 CONFIG_KIRKWOOD_GPIO=y
 CONFIG_SYS_I2C_LEGACY=y
 CONFIG_SYS_I2C_MVTWSI=y
diff --git a/configs/netgear_dgnd3700v2_ram_defconfig b/configs/netgear_dgnd3700v2_ram_defconfig
index 89638d3..1a5492e 100644
--- a/configs/netgear_dgnd3700v2_ram_defconfig
+++ b/configs/netgear_dgnd3700v2_ram_defconfig
@@ -13,6 +13,7 @@
 # CONFIG_MIPS_BOOT_ENV_LEGACY is not set
 CONFIG_MIPS_BOOT_FDT=y
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
+CONFIG_REMAKE_ELF=y
 CONFIG_SYS_LOAD_ADDR=0x80100000
 CONFIG_OF_STDOUT_VIA_ALIAS=y
 CONFIG_DISPLAY_CPUINFO=y
diff --git a/configs/netspace_lite_v2_defconfig b/configs/netspace_lite_v2_defconfig
index 668f4ea..53ff4e2 100644
--- a/configs/netspace_lite_v2_defconfig
+++ b/configs/netspace_lite_v2_defconfig
@@ -48,6 +48,7 @@
 CONFIG_NETCONSOLE=y
 CONFIG_DM=y
 CONFIG_SATA_MV=y
+CONFIG_SYS_SATA_MAX_DEVICE=1
 CONFIG_KIRKWOOD_GPIO=y
 CONFIG_SYS_I2C_LEGACY=y
 CONFIG_SYS_I2C_MVTWSI=y
diff --git a/configs/netspace_max_v2_defconfig b/configs/netspace_max_v2_defconfig
index 25ce3c6..1195cc7 100644
--- a/configs/netspace_max_v2_defconfig
+++ b/configs/netspace_max_v2_defconfig
@@ -48,6 +48,7 @@
 CONFIG_NETCONSOLE=y
 CONFIG_DM=y
 CONFIG_SATA_MV=y
+CONFIG_SYS_SATA_MAX_DEVICE=2
 CONFIG_KIRKWOOD_GPIO=y
 CONFIG_SYS_I2C_LEGACY=y
 CONFIG_SYS_I2C_MVTWSI=y
diff --git a/configs/netspace_mini_v2_defconfig b/configs/netspace_mini_v2_defconfig
index 0c9a303..47ca1bd 100644
--- a/configs/netspace_mini_v2_defconfig
+++ b/configs/netspace_mini_v2_defconfig
@@ -46,6 +46,7 @@
 CONFIG_NETCONSOLE=y
 CONFIG_DM=y
 CONFIG_SATA_MV=y
+CONFIG_SYS_SATA_MAX_DEVICE=1
 CONFIG_BLK=y
 CONFIG_KIRKWOOD_GPIO=y
 CONFIG_SYS_I2C_LEGACY=y
diff --git a/configs/netspace_v2_defconfig b/configs/netspace_v2_defconfig
index 8f662ed..2d920ab 100644
--- a/configs/netspace_v2_defconfig
+++ b/configs/netspace_v2_defconfig
@@ -48,6 +48,7 @@
 CONFIG_NETCONSOLE=y
 CONFIG_DM=y
 CONFIG_SATA_MV=y
+CONFIG_SYS_SATA_MAX_DEVICE=1
 CONFIG_KIRKWOOD_GPIO=y
 CONFIG_SYS_I2C_LEGACY=y
 CONFIG_SYS_I2C_MVTWSI=y
diff --git a/configs/nsa310s_defconfig b/configs/nsa310s_defconfig
index 46ca3ba..05a6761 100644
--- a/configs/nsa310s_defconfig
+++ b/configs/nsa310s_defconfig
@@ -43,6 +43,7 @@
 CONFIG_NETCONSOLE=y
 CONFIG_DM=y
 CONFIG_SATA_MV=y
+CONFIG_SYS_SATA_MAX_DEVICE=1
 # CONFIG_MMC is not set
 CONFIG_MTD=y
 CONFIG_MTD_RAW_NAND=y
diff --git a/configs/odroid-c2_defconfig b/configs/odroid-c2_defconfig
index 6f93df2..4347871 100644
--- a/configs/odroid-c2_defconfig
+++ b/configs/odroid-c2_defconfig
@@ -9,6 +9,7 @@
 CONFIG_DEBUG_UART_CLOCK=24000000
 CONFIG_IDENT_STRING=" odroid-c2"
 CONFIG_DEBUG_UART=y
+CONFIG_REMAKE_ELF=y
 CONFIG_SYS_LOAD_ADDR=0x1000000
 CONFIG_OF_BOARD_SETUP=y
 # CONFIG_DISPLAY_CPUINFO is not set
diff --git a/configs/odroid-c4_defconfig b/configs/odroid-c4_defconfig
index 1ea003f..0003756 100644
--- a/configs/odroid-c4_defconfig
+++ b/configs/odroid-c4_defconfig
@@ -11,6 +11,7 @@
 CONFIG_DEBUG_UART_CLOCK=24000000
 CONFIG_IDENT_STRING=" odroid-c4/hc4"
 CONFIG_DEBUG_UART=y
+CONFIG_REMAKE_ELF=y
 CONFIG_SYS_LOAD_ADDR=0x1000000
 CONFIG_OF_BOARD_SETUP=y
 # CONFIG_DISPLAY_CPUINFO is not set
diff --git a/configs/odroid-hc4_defconfig b/configs/odroid-hc4_defconfig
index d632670..c325b24 100644
--- a/configs/odroid-hc4_defconfig
+++ b/configs/odroid-hc4_defconfig
@@ -12,6 +12,7 @@
 CONFIG_IDENT_STRING=" odroid-hc4"
 CONFIG_DEBUG_UART=y
 CONFIG_AHCI=y
+CONFIG_REMAKE_ELF=y
 CONFIG_SYS_LOAD_ADDR=0x1000000
 CONFIG_OF_BOARD_SETUP=y
 # CONFIG_DISPLAY_CPUINFO is not set
diff --git a/configs/odroid-n2_defconfig b/configs/odroid-n2_defconfig
index a950d93..964b785 100644
--- a/configs/odroid-n2_defconfig
+++ b/configs/odroid-n2_defconfig
@@ -11,6 +11,7 @@
 CONFIG_DEBUG_UART_CLOCK=24000000
 CONFIG_IDENT_STRING=" odroid-n2/n2-plus"
 CONFIG_DEBUG_UART=y
+CONFIG_REMAKE_ELF=y
 CONFIG_SYS_LOAD_ADDR=0x1000000
 CONFIG_OF_BOARD_SETUP=y
 # CONFIG_DISPLAY_CPUINFO is not set
diff --git a/configs/omap5_uevm_defconfig b/configs/omap5_uevm_defconfig
index c43418a..52f3784 100644
--- a/configs/omap5_uevm_defconfig
+++ b/configs/omap5_uevm_defconfig
@@ -47,6 +47,7 @@
 CONFIG_MMC_OMAP_HS=y
 CONFIG_DM_ETH=y
 CONFIG_SCSI=y
+CONFIG_SCSI_AHCI_PLAT=y
 CONFIG_CONS_INDEX=3
 CONFIG_SYS_NS16550=y
 CONFIG_USB=y
diff --git a/configs/openrd_base_defconfig b/configs/openrd_base_defconfig
index 2c5a29c..a2fdafd 100644
--- a/configs/openrd_base_defconfig
+++ b/configs/openrd_base_defconfig
@@ -43,6 +43,12 @@
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_NETCONSOLE=y
 CONFIG_DM=y
+CONFIG_SYS_ATA_STRIDE=4
+CONFIG_SYS_ATA_DATA_OFFSET=0x100
+CONFIG_SYS_ATA_REG_OFFSET=0x100
+CONFIG_SYS_ATA_ALT_OFFSET=0x100
+CONFIG_SYS_ATA_IDE0_OFFSET=0x2000
+CONFIG_SYS_ATA_IDE1_OFFSET=0x4000
 # CONFIG_MMC_HW_PARTITIONING is not set
 CONFIG_MTD=y
 CONFIG_MTD_RAW_NAND=y
diff --git a/configs/openrd_client_defconfig b/configs/openrd_client_defconfig
index b21d41b..208deb4 100644
--- a/configs/openrd_client_defconfig
+++ b/configs/openrd_client_defconfig
@@ -44,6 +44,12 @@
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_NETCONSOLE=y
 CONFIG_DM=y
+CONFIG_SYS_ATA_STRIDE=4
+CONFIG_SYS_ATA_DATA_OFFSET=0x100
+CONFIG_SYS_ATA_REG_OFFSET=0x100
+CONFIG_SYS_ATA_ALT_OFFSET=0x100
+CONFIG_SYS_ATA_IDE0_OFFSET=0x2000
+CONFIG_SYS_ATA_IDE1_OFFSET=0x4000
 # CONFIG_MMC_HW_PARTITIONING is not set
 CONFIG_MTD=y
 CONFIG_MTD_RAW_NAND=y
diff --git a/configs/openrd_ultimate_defconfig b/configs/openrd_ultimate_defconfig
index ceeb621..d7269c4 100644
--- a/configs/openrd_ultimate_defconfig
+++ b/configs/openrd_ultimate_defconfig
@@ -44,6 +44,12 @@
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_NETCONSOLE=y
 CONFIG_DM=y
+CONFIG_SYS_ATA_STRIDE=4
+CONFIG_SYS_ATA_DATA_OFFSET=0x100
+CONFIG_SYS_ATA_REG_OFFSET=0x100
+CONFIG_SYS_ATA_ALT_OFFSET=0x100
+CONFIG_SYS_ATA_IDE0_OFFSET=0x2000
+CONFIG_SYS_ATA_IDE1_OFFSET=0x4000
 # CONFIG_MMC_HW_PARTITIONING is not set
 CONFIG_MTD=y
 CONFIG_MTD_RAW_NAND=y
diff --git a/configs/p200_defconfig b/configs/p200_defconfig
index 9f75552..b59dbb8 100644
--- a/configs/p200_defconfig
+++ b/configs/p200_defconfig
@@ -9,6 +9,7 @@
 CONFIG_DEBUG_UART_CLOCK=24000000
 CONFIG_IDENT_STRING=" p200"
 CONFIG_DEBUG_UART=y
+CONFIG_REMAKE_ELF=y
 CONFIG_SYS_LOAD_ADDR=0x1000000
 CONFIG_OF_BOARD_SETUP=y
 # CONFIG_DISPLAY_CPUINFO is not set
diff --git a/configs/p201_defconfig b/configs/p201_defconfig
index 1e07794..39bf996 100644
--- a/configs/p201_defconfig
+++ b/configs/p201_defconfig
@@ -10,6 +10,7 @@
 CONFIG_DEBUG_UART_CLOCK=24000000
 CONFIG_IDENT_STRING=" p201"
 CONFIG_DEBUG_UART=y
+CONFIG_REMAKE_ELF=y
 CONFIG_SYS_LOAD_ADDR=0x1000000
 CONFIG_OF_BOARD_SETUP=y
 # CONFIG_DISPLAY_CPUINFO is not set
diff --git a/configs/p212_defconfig b/configs/p212_defconfig
index bca0fa8..e321cd0 100644
--- a/configs/p212_defconfig
+++ b/configs/p212_defconfig
@@ -10,6 +10,7 @@
 CONFIG_DEBUG_UART_CLOCK=24000000
 CONFIG_IDENT_STRING=" p212"
 CONFIG_DEBUG_UART=y
+CONFIG_REMAKE_ELF=y
 CONFIG_SYS_LOAD_ADDR=0x1000000
 CONFIG_OF_BOARD_SETUP=y
 CONFIG_CONSOLE_MUX=y
diff --git a/configs/pg_wcom_expu1_defconfig b/configs/pg_wcom_expu1_defconfig
index 8238ca8..f92532f 100644
--- a/configs/pg_wcom_expu1_defconfig
+++ b/configs/pg_wcom_expu1_defconfig
@@ -1,15 +1,15 @@
 CONFIG_ARM=y
 CONFIG_SKIP_LOWLEVEL_INIT=y
 CONFIG_TARGET_PG_WCOM_EXPU1=y
-CONFIG_PG_WCOM_UBOOT_UPDATE_SUPPORTED=y
-CONFIG_PG_WCOM_UBOOT_BOOTPACKAGE=y
 CONFIG_SYS_TEXT_BASE=0x60100000
-CONFIG_PG_WCOM_UBOOT_UPDATE_TEXT_BASE=0x60240000
 CONFIG_SYS_MALLOC_LEN=0x1004000
 CONFIG_NR_DRAM_BANKS=1
 CONFIG_KM_DEF_NETDEV="eth2"
 CONFIG_KM_COMMON_ETH_INIT=y
 CONFIG_PIGGY_MAC_ADDRESS_OFFSET=3
+CONFIG_PG_WCOM_UBOOT_UPDATE_SUPPORTED=y
+CONFIG_PG_WCOM_UBOOT_BOOTPACKAGE=y
+CONFIG_PG_WCOM_UBOOT_UPDATE_TEXT_BASE=0x60240000
 CONFIG_SYS_MEMTEST_START=0x80000000
 CONFIG_SYS_MEMTEST_END=0x9fffffff
 CONFIG_ENV_SIZE=0x4000
@@ -30,8 +30,8 @@
 CONFIG_OF_STDOUT_VIA_ALIAS=y
 CONFIG_BOOTDELAY=3
 CONFIG_AUTOBOOT_KEYED=y
-CONFIG_AUTOBOOT_STOP_STR=" "
 CONFIG_AUTOBOOT_PROMPT="Hit <SPACE> key to stop autoboot in %2ds\n"
+CONFIG_AUTOBOOT_STOP_STR=" "
 CONFIG_USE_BOOTARGS=y
 CONFIG_BOOTARGS="console=ttyS0,115200 root=/dev/ram0"
 CONFIG_SILENT_CONSOLE=y
@@ -56,6 +56,7 @@
 CONFIG_SYS_REDUNDAND_ENVIRONMENT=y
 CONFIG_ENV_ADDR=0x60060000
 CONFIG_ENV_ADDR_REDUND=0x60040000
+CONFIG_VERSION_VARIABLE=y
 CONFIG_DM=y
 CONFIG_BOOTCOUNT_LIMIT=y
 CONFIG_DDR_CLK_FREQ=50000000
@@ -79,7 +80,7 @@
 CONFIG_MII=y
 CONFIG_TSEC_ENET=y
 CONFIG_SYS_QE_FW_ADDR=0x60020000
+CONFIG_SCSI_AHCI_PLAT=y
 CONFIG_SPECIFY_CONSOLE_INDEX=y
 CONFIG_DM_SERIAL=y
 CONFIG_SYS_NS16550=y
-CONFIG_VERSION_VARIABLE=y
diff --git a/configs/pg_wcom_expu1_update_defconfig b/configs/pg_wcom_expu1_update_defconfig
index 0fd5ebc..1020b68 100644
--- a/configs/pg_wcom_expu1_update_defconfig
+++ b/configs/pg_wcom_expu1_update_defconfig
@@ -1,14 +1,14 @@
 CONFIG_ARM=y
 CONFIG_SKIP_LOWLEVEL_INIT=y
 CONFIG_TARGET_PG_WCOM_EXPU1=y
-CONFIG_PG_WCOM_UBOOT_UPDATE_SUPPORTED=y
-CONFIG_PG_WCOM_UBOOT_UPDATE=y
 CONFIG_SYS_TEXT_BASE=0x60240000
 CONFIG_SYS_MALLOC_LEN=0x1004000
 CONFIG_NR_DRAM_BANKS=1
 CONFIG_KM_DEF_NETDEV="eth2"
 CONFIG_KM_COMMON_ETH_INIT=y
 CONFIG_PIGGY_MAC_ADDRESS_OFFSET=3
+CONFIG_PG_WCOM_UBOOT_UPDATE_SUPPORTED=y
+CONFIG_PG_WCOM_UBOOT_UPDATE=y
 CONFIG_SYS_MEMTEST_START=0x80000000
 CONFIG_SYS_MEMTEST_END=0x9fffffff
 CONFIG_ENV_SIZE=0x4000
@@ -28,8 +28,8 @@
 CONFIG_OF_STDOUT_VIA_ALIAS=y
 CONFIG_BOOTDELAY=3
 CONFIG_AUTOBOOT_KEYED=y
-CONFIG_AUTOBOOT_STOP_STR=" "
 CONFIG_AUTOBOOT_PROMPT="Hit <SPACE> key to stop autoboot in %2ds\n"
+CONFIG_AUTOBOOT_STOP_STR=" "
 CONFIG_USE_BOOTARGS=y
 CONFIG_BOOTARGS="console=ttyS0,115200 root=/dev/ram0"
 CONFIG_SILENT_CONSOLE=y
@@ -54,6 +54,7 @@
 CONFIG_SYS_REDUNDAND_ENVIRONMENT=y
 CONFIG_ENV_ADDR=0x60220000
 CONFIG_ENV_ADDR_REDUND=0x60200000
+CONFIG_VERSION_VARIABLE=y
 CONFIG_DM=y
 CONFIG_BOOTCOUNT_LIMIT=y
 CONFIG_DDR_CLK_FREQ=50000000
@@ -77,7 +78,7 @@
 CONFIG_MII=y
 CONFIG_TSEC_ENET=y
 CONFIG_SYS_QE_FW_ADDR=0x60020000
+CONFIG_SCSI_AHCI_PLAT=y
 CONFIG_SPECIFY_CONSOLE_INDEX=y
 CONFIG_DM_SERIAL=y
 CONFIG_SYS_NS16550=y
-CONFIG_VERSION_VARIABLE=y
diff --git a/configs/pg_wcom_seli8_defconfig b/configs/pg_wcom_seli8_defconfig
index 229535c..1a2ba8c 100644
--- a/configs/pg_wcom_seli8_defconfig
+++ b/configs/pg_wcom_seli8_defconfig
@@ -1,15 +1,15 @@
 CONFIG_ARM=y
 CONFIG_SKIP_LOWLEVEL_INIT=y
 CONFIG_TARGET_PG_WCOM_SELI8=y
-CONFIG_PG_WCOM_UBOOT_UPDATE_SUPPORTED=y
-CONFIG_PG_WCOM_UBOOT_BOOTPACKAGE=y
 CONFIG_SYS_TEXT_BASE=0x60100000
-CONFIG_PG_WCOM_UBOOT_UPDATE_TEXT_BASE=0x60240000
 CONFIG_SYS_MALLOC_LEN=0x1004000
 CONFIG_NR_DRAM_BANKS=1
 CONFIG_KM_DEF_NETDEV="eth2"
 CONFIG_KM_COMMON_ETH_INIT=y
 CONFIG_PIGGY_MAC_ADDRESS_OFFSET=3
+CONFIG_PG_WCOM_UBOOT_UPDATE_SUPPORTED=y
+CONFIG_PG_WCOM_UBOOT_BOOTPACKAGE=y
+CONFIG_PG_WCOM_UBOOT_UPDATE_TEXT_BASE=0x60240000
 CONFIG_SYS_MEMTEST_START=0x80000000
 CONFIG_SYS_MEMTEST_END=0x9fffffff
 CONFIG_ENV_SIZE=0x4000
@@ -30,8 +30,8 @@
 CONFIG_OF_STDOUT_VIA_ALIAS=y
 CONFIG_BOOTDELAY=3
 CONFIG_AUTOBOOT_KEYED=y
-CONFIG_AUTOBOOT_STOP_STR=" "
 CONFIG_AUTOBOOT_PROMPT="Hit <SPACE> key to stop autoboot in %2ds\n"
+CONFIG_AUTOBOOT_STOP_STR=" "
 CONFIG_USE_BOOTARGS=y
 CONFIG_BOOTARGS="console=ttyS0,115200 root=/dev/ram0"
 CONFIG_SILENT_CONSOLE=y
@@ -56,6 +56,7 @@
 CONFIG_SYS_REDUNDAND_ENVIRONMENT=y
 CONFIG_ENV_ADDR=0x60060000
 CONFIG_ENV_ADDR_REDUND=0x60040000
+CONFIG_VERSION_VARIABLE=y
 CONFIG_DM=y
 CONFIG_BOOTCOUNT_LIMIT=y
 CONFIG_DDR_CLK_FREQ=50000000
@@ -79,7 +80,7 @@
 CONFIG_MII=y
 CONFIG_TSEC_ENET=y
 CONFIG_SYS_QE_FW_ADDR=0x60020000
+CONFIG_SCSI_AHCI_PLAT=y
 CONFIG_SPECIFY_CONSOLE_INDEX=y
 CONFIG_DM_SERIAL=y
 CONFIG_SYS_NS16550=y
-CONFIG_VERSION_VARIABLE=y
diff --git a/configs/pg_wcom_seli8_update_defconfig b/configs/pg_wcom_seli8_update_defconfig
index fb5b715..3a51d4e 100644
--- a/configs/pg_wcom_seli8_update_defconfig
+++ b/configs/pg_wcom_seli8_update_defconfig
@@ -1,14 +1,14 @@
 CONFIG_ARM=y
 CONFIG_SKIP_LOWLEVEL_INIT=y
 CONFIG_TARGET_PG_WCOM_SELI8=y
-CONFIG_PG_WCOM_UBOOT_UPDATE_SUPPORTED=y
-CONFIG_PG_WCOM_UBOOT_UPDATE=y
 CONFIG_SYS_TEXT_BASE=0x60240000
 CONFIG_SYS_MALLOC_LEN=0x1004000
 CONFIG_NR_DRAM_BANKS=1
 CONFIG_KM_DEF_NETDEV="eth2"
 CONFIG_KM_COMMON_ETH_INIT=y
 CONFIG_PIGGY_MAC_ADDRESS_OFFSET=3
+CONFIG_PG_WCOM_UBOOT_UPDATE_SUPPORTED=y
+CONFIG_PG_WCOM_UBOOT_UPDATE=y
 CONFIG_SYS_MEMTEST_START=0x80000000
 CONFIG_SYS_MEMTEST_END=0x9fffffff
 CONFIG_ENV_SIZE=0x4000
@@ -28,8 +28,8 @@
 CONFIG_OF_STDOUT_VIA_ALIAS=y
 CONFIG_BOOTDELAY=3
 CONFIG_AUTOBOOT_KEYED=y
-CONFIG_AUTOBOOT_STOP_STR=" "
 CONFIG_AUTOBOOT_PROMPT="Hit <SPACE> key to stop autoboot in %2ds\n"
+CONFIG_AUTOBOOT_STOP_STR=" "
 CONFIG_USE_BOOTARGS=y
 CONFIG_BOOTARGS="console=ttyS0,115200 root=/dev/ram0"
 CONFIG_SILENT_CONSOLE=y
@@ -54,6 +54,7 @@
 CONFIG_SYS_REDUNDAND_ENVIRONMENT=y
 CONFIG_ENV_ADDR=0x60220000
 CONFIG_ENV_ADDR_REDUND=0x60200000
+CONFIG_VERSION_VARIABLE=y
 CONFIG_DM=y
 CONFIG_BOOTCOUNT_LIMIT=y
 CONFIG_DDR_CLK_FREQ=50000000
@@ -77,7 +78,7 @@
 CONFIG_MII=y
 CONFIG_TSEC_ENET=y
 CONFIG_SYS_QE_FW_ADDR=0x60020000
+CONFIG_SCSI_AHCI_PLAT=y
 CONFIG_SPECIFY_CONSOLE_INDEX=y
 CONFIG_DM_SERIAL=y
 CONFIG_SYS_NS16550=y
-CONFIG_VERSION_VARIABLE=y
diff --git a/configs/pico-imx8mq_defconfig b/configs/pico-imx8mq_defconfig
index fae9dfd..6f25fd7 100644
--- a/configs/pico-imx8mq_defconfig
+++ b/configs/pico-imx8mq_defconfig
@@ -19,6 +19,7 @@
 CONFIG_SPL_DRIVERS_MISC=y
 CONFIG_SPL=y
 CONFIG_IMX_BOOTAUX=y
+CONFIG_REMAKE_ELF=y
 CONFIG_SYS_LOAD_ADDR=0x40480000
 CONFIG_FIT=y
 CONFIG_FIT_EXTERNAL_OFFSET=0x3000
diff --git a/configs/pogo_e02_defconfig b/configs/pogo_e02_defconfig
index 10f08a5..7853cc7 100644
--- a/configs/pogo_e02_defconfig
+++ b/configs/pogo_e02_defconfig
@@ -2,13 +2,14 @@
 CONFIG_SKIP_LOWLEVEL_INIT=y
 CONFIG_SYS_DCACHE_OFF=y
 CONFIG_ARCH_CPU_INIT=y
+CONFIG_SYS_THUMB_BUILD=y
 CONFIG_ARCH_KIRKWOOD=y
 CONFIG_SYS_KWD_CONFIG="board/cloudengines/pogo_e02/kwbimage.cfg"
 CONFIG_SYS_TEXT_BASE=0x600000
 CONFIG_NR_DRAM_BANKS=2
 CONFIG_TARGET_POGO_E02=y
 CONFIG_ENV_SIZE=0x20000
-CONFIG_ENV_OFFSET=0x60000
+CONFIG_ENV_OFFSET=0xC0000
 CONFIG_DEFAULT_DEVICE_TREE="kirkwood-pogo_e02"
 CONFIG_IDENT_STRING="\nPogo E02"
 # CONFIG_SYS_MALLOC_F is not set
@@ -36,11 +37,14 @@
 CONFIG_ENV_OVERWRITE=y
 CONFIG_ENV_IS_IN_NAND=y
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
+CONFIG_NET_RANDOM_ETHADDR=y
 CONFIG_NETCONSOLE=y
 CONFIG_DM=y
 # CONFIG_MMC is not set
 CONFIG_MTD=y
 CONFIG_MTD_RAW_NAND=y
+CONFIG_PHY_MARVELL=y
+CONFIG_DM_ETH=y
 CONFIG_MVGBE=y
 CONFIG_MII=y
 CONFIG_SYS_NS16550=y
diff --git a/configs/pogo_v4_defconfig b/configs/pogo_v4_defconfig
index 1cf409c..d05db80 100644
--- a/configs/pogo_v4_defconfig
+++ b/configs/pogo_v4_defconfig
@@ -57,6 +57,7 @@
 CONFIG_NETCONSOLE=y
 CONFIG_DM=y
 CONFIG_SATA_MV=y
+CONFIG_SYS_SATA_MAX_DEVICE=1
 CONFIG_KIRKWOOD_GPIO=y
 # CONFIG_MMC_HW_PARTITIONING is not set
 CONFIG_MVEBU_MMC=y
diff --git a/configs/qemu-x86_64_defconfig b/configs/qemu-x86_64_defconfig
index 74beffc..6d1a6ba 100644
--- a/configs/qemu-x86_64_defconfig
+++ b/configs/qemu-x86_64_defconfig
@@ -54,6 +54,11 @@
 CONFIG_TFTP_TSIZE=y
 CONFIG_REGMAP=y
 CONFIG_SYSCON=y
+CONFIG_SYS_IDE_MAXDEVICE=4
+CONFIG_SYS_ATA_DATA_OFFSET=0
+CONFIG_SYS_ATA_REG_OFFSET=0
+CONFIG_SYS_ATA_ALT_OFFSET=0
+CONFIG_ATAPI=y
 CONFIG_CPU=y
 CONFIG_NVME=y
 CONFIG_SPL_DM_RTC=y
diff --git a/configs/qemu-x86_defconfig b/configs/qemu-x86_defconfig
index 9181019..b0cf701 100644
--- a/configs/qemu-x86_defconfig
+++ b/configs/qemu-x86_defconfig
@@ -37,6 +37,11 @@
 CONFIG_TFTP_TSIZE=y
 CONFIG_REGMAP=y
 CONFIG_SYSCON=y
+CONFIG_SYS_IDE_MAXDEVICE=4
+CONFIG_SYS_ATA_DATA_OFFSET=0
+CONFIG_SYS_ATA_REG_OFFSET=0
+CONFIG_SYS_ATA_ALT_OFFSET=0
+CONFIG_ATAPI=y
 CONFIG_CPU=y
 CONFIG_NVME=y
 CONFIG_SPI=y
diff --git a/configs/r2dplus_defconfig b/configs/r2dplus_defconfig
index 9e2036a..8b5c8ff 100644
--- a/configs/r2dplus_defconfig
+++ b/configs/r2dplus_defconfig
@@ -29,6 +29,14 @@
 CONFIG_ENV_IS_IN_FLASH=y
 CONFIG_ENV_ADDR=0xA0040000
 CONFIG_DM=y
+CONFIG_SYS_IDE_MAXBUS=1
+CONFIG_SYS_IDE_MAXDEVICE=1
+CONFIG_SYS_ATA_BASE_ADDR=0xb4000000
+CONFIG_SYS_ATA_STRIDE=2
+CONFIG_SYS_ATA_DATA_OFFSET=0x1000
+CONFIG_SYS_ATA_REG_OFFSET=0x1000
+CONFIG_SYS_ATA_ALT_OFFSET=0x800
+CONFIG_IDE_RESET=y
 CONFIG_CLK=y
 CONFIG_MTD_NOR_FLASH=y
 CONFIG_FLASH_CFI_DRIVER=y
diff --git a/configs/r8a77970_eagle_defconfig b/configs/r8a77970_eagle_defconfig
index 07a0b09..70b23da 100644
--- a/configs/r8a77970_eagle_defconfig
+++ b/configs/r8a77970_eagle_defconfig
@@ -12,6 +12,7 @@
 CONFIG_SPL_TEXT_BASE=0xe6318000
 CONFIG_RCAR_GEN3=y
 CONFIG_TARGET_EAGLE=y
+CONFIG_REMAKE_ELF=y
 CONFIG_SYS_LOAD_ADDR=0x58000000
 CONFIG_FIT=y
 CONFIG_SUPPORT_RAW_INITRD=y
diff --git a/configs/r8a77980_condor_defconfig b/configs/r8a77980_condor_defconfig
index 582d717..194fdde 100644
--- a/configs/r8a77980_condor_defconfig
+++ b/configs/r8a77980_condor_defconfig
@@ -12,6 +12,7 @@
 CONFIG_SPL_TEXT_BASE=0xe6318000
 CONFIG_RCAR_GEN3=y
 CONFIG_TARGET_CONDOR=y
+CONFIG_REMAKE_ELF=y
 CONFIG_SYS_LOAD_ADDR=0x58000000
 CONFIG_FIT=y
 CONFIG_SUPPORT_RAW_INITRD=y
diff --git a/configs/r8a77990_ebisu_defconfig b/configs/r8a77990_ebisu_defconfig
index 24042da..9470bee 100644
--- a/configs/r8a77990_ebisu_defconfig
+++ b/configs/r8a77990_ebisu_defconfig
@@ -11,6 +11,7 @@
 CONFIG_SPL_TEXT_BASE=0xe6318000
 CONFIG_RCAR_GEN3=y
 CONFIG_TARGET_EBISU=y
+CONFIG_REMAKE_ELF=y
 CONFIG_SYS_LOAD_ADDR=0x58000000
 CONFIG_FIT=y
 CONFIG_SUPPORT_RAW_INITRD=y
diff --git a/configs/r8a77995_draak_defconfig b/configs/r8a77995_draak_defconfig
index d5b1b31..ea94d5c 100644
--- a/configs/r8a77995_draak_defconfig
+++ b/configs/r8a77995_draak_defconfig
@@ -11,6 +11,7 @@
 CONFIG_SPL_TEXT_BASE=0xe6318000
 CONFIG_RCAR_GEN3=y
 CONFIG_TARGET_DRAAK=y
+CONFIG_REMAKE_ELF=y
 CONFIG_SYS_LOAD_ADDR=0x58000000
 CONFIG_FIT=y
 CONFIG_SUPPORT_RAW_INITRD=y
diff --git a/configs/r8a779a0_falcon_defconfig b/configs/r8a779a0_falcon_defconfig
index e857da9..32e218b 100644
--- a/configs/r8a779a0_falcon_defconfig
+++ b/configs/r8a779a0_falcon_defconfig
@@ -14,6 +14,7 @@
 CONFIG_SYS_CLK_FREQ=16666666
 # CONFIG_PSCI_RESET is not set
 CONFIG_ARMV8_PSCI=y
+CONFIG_REMAKE_ELF=y
 CONFIG_SYS_LOAD_ADDR=0x58000000
 CONFIG_FIT=y
 CONFIG_SUPPORT_RAW_INITRD=y
diff --git a/configs/radxa-zero_defconfig b/configs/radxa-zero_defconfig
index a9afb64..6851101 100644
--- a/configs/radxa-zero_defconfig
+++ b/configs/radxa-zero_defconfig
@@ -10,6 +10,7 @@
 CONFIG_DEBUG_UART_CLOCK=24000000
 CONFIG_IDENT_STRING=" radxa-zero"
 CONFIG_DEBUG_UART=y
+CONFIG_REMAKE_ELF=y
 CONFIG_SYS_LOAD_ADDR=0x1000000
 CONFIG_OF_BOARD_SETUP=y
 # CONFIG_DISPLAY_CPUINFO is not set
diff --git a/configs/rcar3_salvator-x_defconfig b/configs/rcar3_salvator-x_defconfig
index 499e56e..f60ddf0 100644
--- a/configs/rcar3_salvator-x_defconfig
+++ b/configs/rcar3_salvator-x_defconfig
@@ -9,6 +9,7 @@
 CONFIG_SPL_TEXT_BASE=0xe6338000
 CONFIG_RCAR_GEN3=y
 CONFIG_TARGET_SALVATOR_X=y
+CONFIG_REMAKE_ELF=y
 CONFIG_SYS_LOAD_ADDR=0x58000000
 CONFIG_FIT=y
 CONFIG_SUPPORT_RAW_INITRD=y
diff --git a/configs/rcar3_ulcb_defconfig b/configs/rcar3_ulcb_defconfig
index dfe0d84..3a5e433 100644
--- a/configs/rcar3_ulcb_defconfig
+++ b/configs/rcar3_ulcb_defconfig
@@ -11,6 +11,7 @@
 CONFIG_SPL_TEXT_BASE=0xe6338000
 CONFIG_RCAR_GEN3=y
 CONFIG_TARGET_ULCB=y
+CONFIG_REMAKE_ELF=y
 CONFIG_SYS_LOAD_ADDR=0x58000000
 CONFIG_FIT=y
 CONFIG_SUPPORT_RAW_INITRD=y
diff --git a/configs/rzg2_beacon_defconfig b/configs/rzg2_beacon_defconfig
index 1ae12b1..e6a0d68 100644
--- a/configs/rzg2_beacon_defconfig
+++ b/configs/rzg2_beacon_defconfig
@@ -10,6 +10,7 @@
 CONFIG_TARGET_BEACON_RZG2M=y
 # CONFIG_SPL is not set
 CONFIG_LTO=y
+CONFIG_REMAKE_ELF=y
 CONFIG_SYS_LOAD_ADDR=0x58000000
 CONFIG_FIT=y
 CONFIG_SUPPORT_RAW_INITRD=y
diff --git a/configs/s400_defconfig b/configs/s400_defconfig
index 8483694..56caf01 100644
--- a/configs/s400_defconfig
+++ b/configs/s400_defconfig
@@ -10,6 +10,7 @@
 CONFIG_DEBUG_UART_CLOCK=24000000
 CONFIG_IDENT_STRING=" s400"
 CONFIG_DEBUG_UART=y
+CONFIG_REMAKE_ELF=y
 CONFIG_SYS_LOAD_ADDR=0x1000000
 CONFIG_OF_BOARD_SETUP=y
 # CONFIG_DISPLAY_CPUINFO is not set
diff --git a/configs/sandbox64_defconfig b/configs/sandbox64_defconfig
index c9afe4c..d82c180 100644
--- a/configs/sandbox64_defconfig
+++ b/configs/sandbox64_defconfig
@@ -104,8 +104,16 @@
 CONFIG_DEBUG_DEVRES=y
 CONFIG_ADC=y
 CONFIG_ADC_SANDBOX=y
+CONFIG_SYS_SATA_MAX_DEVICE=2
 CONFIG_AXI=y
 CONFIG_AXI_SANDBOX=y
+CONFIG_SYS_IDE_MAXBUS=1
+CONFIG_SYS_ATA_BASE_ADDR=0x100
+CONFIG_SYS_ATA_STRIDE=4
+CONFIG_SYS_ATA_DATA_OFFSET=0
+CONFIG_SYS_ATA_REG_OFFSET=1
+CONFIG_SYS_ATA_ALT_OFFSET=2
+CONFIG_SYS_ATA_IDE0_OFFSET=0
 CONFIG_BUTTON=y
 CONFIG_BUTTON_GPIO=y
 CONFIG_CLK=y
diff --git a/configs/sandbox_defconfig b/configs/sandbox_defconfig
index f852743..68e9582 100644
--- a/configs/sandbox_defconfig
+++ b/configs/sandbox_defconfig
@@ -128,8 +128,16 @@
 CONFIG_SIMPLE_PM_BUS=y
 CONFIG_ADC=y
 CONFIG_ADC_SANDBOX=y
+CONFIG_SYS_SATA_MAX_DEVICE=2
 CONFIG_AXI=y
 CONFIG_AXI_SANDBOX=y
+CONFIG_SYS_IDE_MAXBUS=1
+CONFIG_SYS_ATA_BASE_ADDR=0x100
+CONFIG_SYS_ATA_STRIDE=4
+CONFIG_SYS_ATA_DATA_OFFSET=0
+CONFIG_SYS_ATA_REG_OFFSET=1
+CONFIG_SYS_ATA_ALT_OFFSET=2
+CONFIG_SYS_ATA_IDE0_OFFSET=0
 CONFIG_BOOTCOUNT_LIMIT=y
 CONFIG_DM_BOOTCOUNT=y
 CONFIG_DM_BOOTCOUNT_RTC=y
@@ -249,6 +257,10 @@
 CONFIG_DM_RNG=y
 CONFIG_DM_RTC=y
 CONFIG_RTC_RV8803=y
+CONFIG_SCSI=y
+CONFIG_SCSI_AHCI_PLAT=y
+CONFIG_SYS_SCSI_MAX_SCSI_ID=8
+CONFIG_SYS_SCSI_MAX_LUN=4
 CONFIG_SANDBOX_SERIAL=y
 CONFIG_SMEM=y
 CONFIG_SANDBOX_SMEM=y
diff --git a/configs/sandbox_flattree_defconfig b/configs/sandbox_flattree_defconfig
index 7bd5d01..d809712 100644
--- a/configs/sandbox_flattree_defconfig
+++ b/configs/sandbox_flattree_defconfig
@@ -84,6 +84,7 @@
 CONFIG_DEBUG_DEVRES=y
 CONFIG_ADC=y
 CONFIG_ADC_SANDBOX=y
+CONFIG_SYS_SATA_MAX_DEVICE=2
 CONFIG_AXI=y
 CONFIG_AXI_SANDBOX=y
 CONFIG_CLK=y
diff --git a/configs/sandbox_noinst_defconfig b/configs/sandbox_noinst_defconfig
index 7d872ad..b288ac2 100644
--- a/configs/sandbox_noinst_defconfig
+++ b/configs/sandbox_noinst_defconfig
@@ -108,8 +108,16 @@
 # CONFIG_SPL_SIMPLE_BUS is not set
 CONFIG_ADC=y
 CONFIG_ADC_SANDBOX=y
+CONFIG_SYS_SATA_MAX_DEVICE=2
 CONFIG_AXI=y
 CONFIG_AXI_SANDBOX=y
+CONFIG_SYS_IDE_MAXBUS=1
+CONFIG_SYS_ATA_BASE_ADDR=0x100
+CONFIG_SYS_ATA_STRIDE=4
+CONFIG_SYS_ATA_DATA_OFFSET=0
+CONFIG_SYS_ATA_REG_OFFSET=1
+CONFIG_SYS_ATA_ALT_OFFSET=2
+CONFIG_SYS_ATA_IDE0_OFFSET=0
 CONFIG_CLK=y
 CONFIG_SPL_CLK=y
 CONFIG_CPU=y
diff --git a/configs/sandbox_spl_defconfig b/configs/sandbox_spl_defconfig
index 29a8917..cd1ad38 100644
--- a/configs/sandbox_spl_defconfig
+++ b/configs/sandbox_spl_defconfig
@@ -110,8 +110,16 @@
 # CONFIG_SPL_SIMPLE_BUS is not set
 CONFIG_ADC=y
 CONFIG_ADC_SANDBOX=y
+CONFIG_SYS_SATA_MAX_DEVICE=2
 CONFIG_AXI=y
 CONFIG_AXI_SANDBOX=y
+CONFIG_SYS_IDE_MAXBUS=1
+CONFIG_SYS_ATA_BASE_ADDR=0x100
+CONFIG_SYS_ATA_STRIDE=4
+CONFIG_SYS_ATA_DATA_OFFSET=0
+CONFIG_SYS_ATA_REG_OFFSET=1
+CONFIG_SYS_ATA_ALT_OFFSET=2
+CONFIG_SYS_ATA_IDE0_OFFSET=0
 CONFIG_CLK=y
 CONFIG_SPL_CLK=y
 CONFIG_CPU=y
diff --git a/configs/sei510_defconfig b/configs/sei510_defconfig
index 5e2496e..df02fca 100644
--- a/configs/sei510_defconfig
+++ b/configs/sei510_defconfig
@@ -15,6 +15,7 @@
 CONFIG_IDENT_STRING=" sei510"
 # CONFIG_PSCI_RESET is not set
 CONFIG_DEBUG_UART=y
+CONFIG_REMAKE_ELF=y
 CONFIG_SYS_LOAD_ADDR=0x1000000
 CONFIG_OF_BOARD_SETUP=y
 CONFIG_USE_PREBOOT=y
diff --git a/configs/sei610_defconfig b/configs/sei610_defconfig
index df53c91..ca40240 100644
--- a/configs/sei610_defconfig
+++ b/configs/sei610_defconfig
@@ -15,6 +15,7 @@
 CONFIG_IDENT_STRING=" sei610"
 # CONFIG_PSCI_RESET is not set
 CONFIG_DEBUG_UART=y
+CONFIG_REMAKE_ELF=y
 CONFIG_SYS_LOAD_ADDR=0x1000000
 CONFIG_OF_BOARD_SETUP=y
 CONFIG_USE_PREBOOT=y
diff --git a/configs/sfr_nb4-ser_ram_defconfig b/configs/sfr_nb4-ser_ram_defconfig
index 4c5bc11..c9c50bd 100644
--- a/configs/sfr_nb4-ser_ram_defconfig
+++ b/configs/sfr_nb4-ser_ram_defconfig
@@ -14,6 +14,7 @@
 # CONFIG_MIPS_BOOT_ENV_LEGACY is not set
 CONFIG_MIPS_BOOT_FDT=y
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
+CONFIG_REMAKE_ELF=y
 CONFIG_SYS_LOAD_ADDR=0x80100000
 CONFIG_OF_STDOUT_VIA_ALIAS=y
 CONFIG_DISPLAY_CPUINFO=y
diff --git a/configs/sheevaplug_defconfig b/configs/sheevaplug_defconfig
index 6e39aa1..0c5031b 100644
--- a/configs/sheevaplug_defconfig
+++ b/configs/sheevaplug_defconfig
@@ -46,6 +46,7 @@
 CONFIG_NETCONSOLE=y
 CONFIG_DM=y
 CONFIG_SATA_MV=y
+CONFIG_SYS_SATA_MAX_DEVICE=2
 CONFIG_MVEBU_MMC=y
 CONFIG_MTD=y
 CONFIG_MTD_RAW_NAND=y
diff --git a/configs/silinux_ek874_defconfig b/configs/silinux_ek874_defconfig
index 894a996..5b01f1e 100644
--- a/configs/silinux_ek874_defconfig
+++ b/configs/silinux_ek874_defconfig
@@ -12,6 +12,7 @@
 CONFIG_SPL_TEXT_BASE=0xe6318000
 CONFIG_RCAR_GEN3=y
 CONFIG_TARGET_SILINUX_EK874=y
+CONFIG_REMAKE_ELF=y
 CONFIG_SYS_LOAD_ADDR=0x58000000
 CONFIG_FIT=y
 CONFIG_SUPPORT_RAW_INITRD=y
diff --git a/configs/socfpga_agilex_atf_defconfig b/configs/socfpga_agilex_atf_defconfig
index 2d342c9..f85953f 100644
--- a/configs/socfpga_agilex_atf_defconfig
+++ b/configs/socfpga_agilex_atf_defconfig
@@ -13,6 +13,7 @@
 CONFIG_TARGET_SOCFPGA_AGILEX_SOCDK=y
 CONFIG_IDENT_STRING="socfpga_agilex"
 CONFIG_SPL_FS_FAT=y
+CONFIG_REMAKE_ELF=y
 CONFIG_SYS_LOAD_ADDR=0x02000000
 CONFIG_FIT=y
 CONFIG_SPL_FIT_SIGNATURE=y
diff --git a/configs/socfpga_agilex_defconfig b/configs/socfpga_agilex_defconfig
index 3559633..2e116fb 100644
--- a/configs/socfpga_agilex_defconfig
+++ b/configs/socfpga_agilex_defconfig
@@ -15,6 +15,7 @@
 CONFIG_IDENT_STRING="socfpga_agilex"
 CONFIG_SPL_FS_FAT=y
 # CONFIG_PSCI_RESET is not set
+CONFIG_REMAKE_ELF=y
 CONFIG_SYS_LOAD_ADDR=0x02000000
 CONFIG_BOOTDELAY=5
 CONFIG_USE_BOOTARGS=y
diff --git a/configs/socfpga_agilex_vab_defconfig b/configs/socfpga_agilex_vab_defconfig
index 602272b..b62f509 100644
--- a/configs/socfpga_agilex_vab_defconfig
+++ b/configs/socfpga_agilex_vab_defconfig
@@ -14,6 +14,7 @@
 CONFIG_TARGET_SOCFPGA_AGILEX_SOCDK=y
 CONFIG_IDENT_STRING="socfpga_agilex"
 CONFIG_SPL_FS_FAT=y
+CONFIG_REMAKE_ELF=y
 CONFIG_SYS_LOAD_ADDR=0x02000000
 CONFIG_FIT=y
 CONFIG_SPL_FIT_SIGNATURE=y
diff --git a/configs/socfpga_n5x_atf_defconfig b/configs/socfpga_n5x_atf_defconfig
index fe41fb0..31346fc 100644
--- a/configs/socfpga_n5x_atf_defconfig
+++ b/configs/socfpga_n5x_atf_defconfig
@@ -13,6 +13,7 @@
 CONFIG_TARGET_SOCFPGA_N5X_SOCDK=y
 CONFIG_IDENT_STRING="socfpga_n5x"
 CONFIG_SPL_FS_FAT=y
+CONFIG_REMAKE_ELF=y
 CONFIG_FIT=y
 CONFIG_SPL_FIT_SIGNATURE=y
 CONFIG_SPL_LOAD_FIT=y
diff --git a/configs/socfpga_n5x_defconfig b/configs/socfpga_n5x_defconfig
index 6bef8c5..7e7d1cc 100644
--- a/configs/socfpga_n5x_defconfig
+++ b/configs/socfpga_n5x_defconfig
@@ -13,6 +13,7 @@
 CONFIG_IDENT_STRING="socfpga_n5x"
 CONFIG_SPL_FS_FAT=y
 # CONFIG_PSCI_RESET is not set
+CONFIG_REMAKE_ELF=y
 CONFIG_BOOTDELAY=5
 CONFIG_USE_BOOTARGS=y
 CONFIG_BOOTARGS="earlycon panic=-1 earlyprintk=ttyS0,115200"
diff --git a/configs/socfpga_n5x_vab_defconfig b/configs/socfpga_n5x_vab_defconfig
index da7057d..cf7bf23 100644
--- a/configs/socfpga_n5x_vab_defconfig
+++ b/configs/socfpga_n5x_vab_defconfig
@@ -14,6 +14,7 @@
 CONFIG_TARGET_SOCFPGA_N5X_SOCDK=y
 CONFIG_IDENT_STRING="socfpga_n5x"
 CONFIG_SPL_FS_FAT=y
+CONFIG_REMAKE_ELF=y
 CONFIG_FIT=y
 CONFIG_SPL_FIT_SIGNATURE=y
 CONFIG_SPL_LOAD_FIT=y
diff --git a/configs/socfpga_stratix10_atf_defconfig b/configs/socfpga_stratix10_atf_defconfig
index 7b522ca..60e7750 100644
--- a/configs/socfpga_stratix10_atf_defconfig
+++ b/configs/socfpga_stratix10_atf_defconfig
@@ -13,6 +13,7 @@
 CONFIG_TARGET_SOCFPGA_STRATIX10_SOCDK=y
 CONFIG_IDENT_STRING="socfpga_stratix10"
 CONFIG_SPL_FS_FAT=y
+CONFIG_REMAKE_ELF=y
 CONFIG_SYS_LOAD_ADDR=0x02000000
 CONFIG_FIT=y
 CONFIG_SPL_FIT_SIGNATURE=y
diff --git a/configs/socfpga_stratix10_defconfig b/configs/socfpga_stratix10_defconfig
index 0ae73d4..8249a12 100644
--- a/configs/socfpga_stratix10_defconfig
+++ b/configs/socfpga_stratix10_defconfig
@@ -17,6 +17,7 @@
 # CONFIG_PSCI_RESET is not set
 CONFIG_OPTIMIZE_INLINING=y
 CONFIG_SPL_OPTIMIZE_INLINING=y
+CONFIG_REMAKE_ELF=y
 CONFIG_SYS_LOAD_ADDR=0x02000000
 CONFIG_BOOTDELAY=5
 CONFIG_USE_BOOTARGS=y
diff --git a/configs/syzygy_hub_defconfig b/configs/syzygy_hub_defconfig
index 26256c9..6dbf8c2 100644
--- a/configs/syzygy_hub_defconfig
+++ b/configs/syzygy_hub_defconfig
@@ -15,6 +15,7 @@
 CONFIG_ZYNQ_GEM_I2C_MAC_OFFSET=0xFA
 CONFIG_DEBUG_UART=y
 CONFIG_DISTRO_DEFAULTS=y
+CONFIG_REMAKE_ELF=y
 CONFIG_SYS_CUSTOM_LDSCRIPT=y
 CONFIG_SYS_LDSCRIPT="arch/arm/mach-zynq/u-boot.lds"
 CONFIG_SYS_LOAD_ADDR=0x0
diff --git a/configs/ten64_tfa_defconfig b/configs/ten64_tfa_defconfig
index 8d45b13..dbd9b04 100644
--- a/configs/ten64_tfa_defconfig
+++ b/configs/ten64_tfa_defconfig
@@ -1,119 +1,99 @@
 CONFIG_ARM=y
 CONFIG_TARGET_TEN64=y
-CONFIG_SYS_TEXT_BASE=0x82000000
-CONFIG_QSPI_AHB_INIT=y
 CONFIG_TFABOOT=y
+CONFIG_SYS_TEXT_BASE=0x82000000
+CONFIG_SYS_MALLOC_F_LEN=0x2000
+CONFIG_NR_DRAM_BANKS=2
+CONFIG_ENV_SIZE=0x80000
+CONFIG_ENV_OFFSET=0x500000
+CONFIG_ENV_SECT_SIZE=0x80000
+CONFIG_DM_GPIO=y
+CONFIG_DEFAULT_DEVICE_TREE="fsl-ls1088a-ten64"
+CONFIG_QSPI_AHB_INIT=y
 CONFIG_ARMV8_SEC_FIRMWARE_SUPPORT=y
 CONFIG_SEC_FIRMWARE_ARMV8_PSCI=y
+CONFIG_TEN64_CONTROLLER=y
+CONFIG_AHCI=y
 CONFIG_DISTRO_DEFAULTS=y
-CONFIG_NR_DRAM_BANKS=2
-# CONFIG_SYS_MALLOC_F is not set
+CONFIG_MP=y
 CONFIG_FIT_VERBOSE=y
 CONFIG_OF_BOARD_SETUP=y
-CONFIG_OF_FDT_OVERLAY=y
 CONFIG_OF_STDOUT_VIA_ALIAS=y
 CONFIG_SYS_EXTRA_OPTIONS="SYS_FSL_DDR4"
 CONFIG_USE_BOOTARGS=y
 CONFIG_BOOTARGS="console=ttyS0,115200 root=/dev/ram0 earlycon=uart8250,mmio,0x21c0500 ramdisk_size=0x3000000 default_hugepagesz=2m hugepagesz=2m hugepages=256"
 # CONFIG_USE_BOOTCOMMAND is not set
+CONFIG_LOGLEVEL=7
 # CONFIG_DISPLAY_BOARDINFO is not set
 CONFIG_DISPLAY_BOARDINFO_LATE=y
-CONFIG_CMD_BOOTEFI_HELLO=y
+# CONFIG_ID_EEPROM is not set
+CONFIG_PCI_INIT_R=y
 CONFIG_CMD_BOOTEFI_SELFTEST=y
 CONFIG_CMD_BOOTMENU=y
-CONFIG_CMD_GPT=y
-CONFIG_RANDOM_UUID=y
-CONFIG_CMD_DM=y
 CONFIG_CMD_GREPENV=y
+CONFIG_CMD_NVEDIT_EFI=y
 CONFIG_CMD_MEMTEST=y
-CONFIG_CMD_I2C=y
+CONFIG_CMD_DM=y
 CONFIG_CMD_GPIO=y
+CONFIG_CMD_GPT=y
+CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
-CONFIG_CMD_SF=y
-CONFIG_CMD_UBI=y
-CONFIG_CMD_UBIFS=y
+CONFIG_CMD_MTD=y
+CONFIG_CMD_PCI=y
 CONFIG_CMD_USB=y
-CONFIG_CMD_TIME=y
-CONFIG_CMD_POWEROFF=y
 CONFIG_CMD_WDT=y
 # CONFIG_CMD_SETEXPR is not set
-CONFIG_FS_FAT=y
-CONFIG_FAT_WRITE=y
-CONFIG_MP=y
+CONFIG_CMD_EFIDEBUG=y
+CONFIG_CMD_TIME=y
+CONFIG_CMD_TPM=y
+CONFIG_MTDPARTS_DEFAULT="mtdparts=spi-nand0:8m(reserved),32m(recovery),108m(ubia),108m(ubib);nor1:1m(bl2),2m(bl3),2m(mcfirmware),512k(ubootenv),256k(dpl),256k(dpc),256k(devicetree)"
+CONFIG_CMD_UBI=y
 CONFIG_OF_CONTROL=y
-CONFIG_DEFAULT_DEVICE_TREE="fsl-ls1088a-ten64"
-CONFIG_EMC230X=y
 CONFIG_ENV_IS_IN_MMC=y
 CONFIG_ENV_IS_IN_SPI_FLASH=y
-CONFIG_ENV_OFFSET=0x500000
-CONFIG_ENV_SIZE=0x80000
-CONFIG_ENV_SECT_SIZE=0x80000
 CONFIG_NET_RANDOM_ETHADDR=y
 CONFIG_DM=y
 CONFIG_SCSI_AHCI=y
-CONFIG_DM_MMC=y
+CONFIG_AHCI_PCI=y
+CONFIG_GPIO_HOG=y
+CONFIG_DM_PCA953X=y
+CONFIG_MPC8XXX_GPIO=y
+CONFIG_DM_I2C=y
+CONFIG_MISC=y
 CONFIG_FSL_ESDHC=y
-CONFIG_CMD_FAN=y
-CONFIG_FANCONTROL=y
+CONFIG_MTD=y
 CONFIG_DM_MTD=y
+CONFIG_MTD_SPI_NAND=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_EON=y
 # CONFIG_SPI_FLASH_USE_4K_SECTORS is not set
 CONFIG_SPI_FLASH_MTD=y
+CONFIG_PHYLIB=y
+CONFIG_PHY_VITESSE=y
+CONFIG_DM_ETH=y
+CONFIG_DM_MDIO=y
 CONFIG_E1000=y
-# CONFIG_ID_EEPROM is not set
 CONFIG_MII=y
+CONFIG_FSL_LS_MDIO=y
 CONFIG_NVME=y
-CONFIG_CMD_PCI=y
 CONFIG_PCI=y
-CONFIG_DM_PCA953X=y
-CONFIG_DM_PCI=y
 CONFIG_DM_PCI_COMPAT=y
 CONFIG_PCIE_LAYERSCAPE_RC=y
+CONFIG_DM_RTC=y
+CONFIG_RTC_RX8025=y
+CONFIG_DM_SCSI=y
 CONFIG_SYS_NS16550=y
 CONFIG_SPI=y
 CONFIG_DM_SPI=y
 CONFIG_FSL_DSPI=y
 CONFIG_FSL_QSPI=y
-CONFIG_UBI=y
+CONFIG_TPM_ATMEL_TWI=y
 CONFIG_USB=y
-CONFIG_DM_USB=y
 CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
 CONFIG_USB_DWC3=y
 CONFIG_USB_GADGET=y
-CONFIG_EFI_LOADER_BOUNCE_BUFFER=y
-CONFIG_DM_I2C=y
-CONFIG_DM_GPIO=y
-CONFIG_ARM_SMCCC=y
-CONFIG_MTD=y
-CONFIG_MTD_SPI_NAND=y
-CONFIG_CMD_MTD=y
-CONFIG_LOGLEVEL=7
-CONFIG_MTDPARTS_DEFAULT="mtdparts=spi-nand0:8m(reserved),32m(recovery),108m(ubia),108m(ubib);nor1:1m(bl2),2m(bl3),2m(mcfirmware),512k(ubootenv),256k(dpl),256k(dpc),256k(devicetree)"
-CONFIG_MPC8XXX_GPIO=y
-CONFIG_GPIO_HOG=y
-CONFIG_DM_RTC=y
-CONFIG_RTC_RX8025=y
-CONFIG_CMD_NVEDIT_EFI=y
-CONFIG_CMD_EFIDEBUG=y
-CONFIG_DM_ETH=y
-CONFIG_PCI_INIT_R=y
-CONFIG_PHYLIB=y
-CONFIG_PHY_VITESSE=y
-CONFIG_DM_MDIO=y
-CONFIG_FSL_LS_MDIO=y
-CONFIG_SYS_MALLOC_F=y
-CONFIG_SYS_MALLOC_F_LEN=0x2000
-CONFIG_TPM=y
-CONFIG_CMD_TPM=y
-CONFIG_TPM_ATMEL_TWI=y
-CONFIG_MISC=y
-CONFIG_USB5744=y
-CONFIG_TEN64_CONTROLLER=y
-CONFIG_DM_SCSI=y
-CONFIG_AHCI=y
-CONFIG_AHCI_PCI=y
 CONFIG_WDT=y
 CONFIG_WDT_SP805=y
+CONFIG_TPM=y
+CONFIG_EFI_LOADER_BOUNCE_BUFFER=y
diff --git a/configs/theadorable_debug_defconfig b/configs/theadorable_debug_defconfig
index a781f15..1c3dbe4 100644
--- a/configs/theadorable_debug_defconfig
+++ b/configs/theadorable_debug_defconfig
@@ -54,6 +54,7 @@
 CONFIG_NET_RANDOM_ETHADDR=y
 CONFIG_SPL_OF_TRANSLATE=y
 CONFIG_SATA_MV=y
+CONFIG_SYS_SATA_MAX_DEVICE=1
 CONFIG_BOOTCOUNT_LIMIT=y
 CONFIG_BOOTCOUNT_RAM=y
 CONFIG_FPGA_ALTERA=y
diff --git a/configs/thunderx_88xx_defconfig b/configs/thunderx_88xx_defconfig
index 7c6187d..9a23701 100644
--- a/configs/thunderx_88xx_defconfig
+++ b/configs/thunderx_88xx_defconfig
@@ -9,6 +9,7 @@
 CONFIG_DEBUG_UART_CLOCK=24000000
 CONFIG_IDENT_STRING=" for Cavium Thunder CN88XX ARM v8 Multi-Core"
 CONFIG_DEBUG_UART=y
+CONFIG_REMAKE_ELF=y
 CONFIG_SYS_LOAD_ADDR=0x500000
 CONFIG_BOOTDELAY=5
 CONFIG_USE_BOOTARGS=y
diff --git a/configs/tools-only_defconfig b/configs/tools-only_defconfig
index 1f8e90a6..054e008 100644
--- a/configs/tools-only_defconfig
+++ b/configs/tools-only_defconfig
@@ -19,6 +19,7 @@
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 # CONFIG_NET is not set
 # CONFIG_ACPIGEN is not set
+CONFIG_SYS_SATA_MAX_DEVICE=2
 CONFIG_AXI=y
 CONFIG_AXI_SANDBOX=y
 CONFIG_SANDBOX_GPIO=y
diff --git a/configs/topic_miami_defconfig b/configs/topic_miami_defconfig
index dfd465c..117a545 100644
--- a/configs/topic_miami_defconfig
+++ b/configs/topic_miami_defconfig
@@ -17,6 +17,7 @@
 CONFIG_BOOT_INIT_FILE="board/topic/zynq/zynq-topic-miami/ps7_regs.txt"
 CONFIG_DEBUG_UART=y
 CONFIG_DISTRO_DEFAULTS=y
+CONFIG_REMAKE_ELF=y
 CONFIG_SYS_CUSTOM_LDSCRIPT=y
 CONFIG_SYS_LDSCRIPT="arch/arm/mach-zynq/u-boot.lds"
 CONFIG_SYS_LOAD_ADDR=0x0
diff --git a/configs/topic_miamilite_defconfig b/configs/topic_miamilite_defconfig
index bf336c7b..ecdbbcb 100644
--- a/configs/topic_miamilite_defconfig
+++ b/configs/topic_miamilite_defconfig
@@ -17,6 +17,7 @@
 CONFIG_BOOT_INIT_FILE="board/topic/zynq/zynq-topic-miamilite/ps7_regs.txt"
 CONFIG_DEBUG_UART=y
 CONFIG_DISTRO_DEFAULTS=y
+CONFIG_REMAKE_ELF=y
 CONFIG_SYS_CUSTOM_LDSCRIPT=y
 CONFIG_SYS_LDSCRIPT="arch/arm/mach-zynq/u-boot.lds"
 CONFIG_SYS_LOAD_ADDR=0x0
diff --git a/configs/topic_miamiplus_defconfig b/configs/topic_miamiplus_defconfig
index c700ea4..ce6e1e2 100644
--- a/configs/topic_miamiplus_defconfig
+++ b/configs/topic_miamiplus_defconfig
@@ -17,6 +17,7 @@
 CONFIG_BOOT_INIT_FILE="board/topic/zynq/zynq-topic-miamiplus/ps7_regs.txt"
 CONFIG_DEBUG_UART=y
 CONFIG_DISTRO_DEFAULTS=y
+CONFIG_REMAKE_ELF=y
 CONFIG_SYS_CUSTOM_LDSCRIPT=y
 CONFIG_SYS_LDSCRIPT="arch/arm/mach-zynq/u-boot.lds"
 CONFIG_SYS_LOAD_ADDR=0x0
diff --git a/configs/total_compute_defconfig b/configs/total_compute_defconfig
index 8fafee0..6a37554 100644
--- a/configs/total_compute_defconfig
+++ b/configs/total_compute_defconfig
@@ -9,6 +9,7 @@
 CONFIG_ENV_SIZE=0x2a00000
 CONFIG_DEFAULT_DEVICE_TREE="total_compute"
 CONFIG_DISTRO_DEFAULTS=y
+CONFIG_REMAKE_ELF=y
 CONFIG_SYS_LOAD_ADDR=0x90000000
 CONFIG_ANDROID_BOOT_IMAGE=y
 CONFIG_FIT=y
diff --git a/configs/u200_defconfig b/configs/u200_defconfig
index 7f46dcf..75265eb 100644
--- a/configs/u200_defconfig
+++ b/configs/u200_defconfig
@@ -10,6 +10,7 @@
 CONFIG_DEBUG_UART_CLOCK=24000000
 CONFIG_IDENT_STRING=" u200"
 CONFIG_DEBUG_UART=y
+CONFIG_REMAKE_ELF=y
 CONFIG_SYS_LOAD_ADDR=0x1000000
 CONFIG_OF_BOARD_SETUP=y
 # CONFIG_DISPLAY_CPUINFO is not set
diff --git a/configs/vexpress_aemv8a_juno_defconfig b/configs/vexpress_aemv8a_juno_defconfig
index ffadfc0..e02124c 100644
--- a/configs/vexpress_aemv8a_juno_defconfig
+++ b/configs/vexpress_aemv8a_juno_defconfig
@@ -11,6 +11,7 @@
 CONFIG_DEFAULT_DEVICE_TREE="juno-r2"
 CONFIG_IDENT_STRING=" vexpress_aemv8a"
 CONFIG_DISTRO_DEFAULTS=y
+CONFIG_REMAKE_ELF=y
 CONFIG_SYS_LOAD_ADDR=0x90000000
 CONFIG_BOOTDELAY=1
 CONFIG_USE_BOOTARGS=y
diff --git a/configs/vexpress_aemv8a_semi_defconfig b/configs/vexpress_aemv8a_semi_defconfig
index 902eb8f..82a5b52 100644
--- a/configs/vexpress_aemv8a_semi_defconfig
+++ b/configs/vexpress_aemv8a_semi_defconfig
@@ -11,6 +11,7 @@
 CONFIG_ENV_SECT_SIZE=0x40000
 CONFIG_IDENT_STRING=" vexpress_aemv8a"
 CONFIG_DISTRO_DEFAULTS=y
+CONFIG_REMAKE_ELF=y
 CONFIG_SYS_LOAD_ADDR=0x90000000
 CONFIG_ANDROID_BOOT_IMAGE=y
 CONFIG_BOOTDELAY=1
diff --git a/configs/wetek-core2_defconfig b/configs/wetek-core2_defconfig
index 006cebc..bb1d481 100644
--- a/configs/wetek-core2_defconfig
+++ b/configs/wetek-core2_defconfig
@@ -10,6 +10,7 @@
 CONFIG_DEBUG_UART_CLOCK=24000000
 CONFIG_IDENT_STRING=" wetek-core2"
 CONFIG_DEBUG_UART=y
+CONFIG_REMAKE_ELF=y
 CONFIG_SYS_LOAD_ADDR=0x1000000
 CONFIG_OF_BOARD_SETUP=y
 # CONFIG_DISPLAY_CPUINFO is not set
diff --git a/configs/xilinx_versal_mini_defconfig b/configs/xilinx_versal_mini_defconfig
index c90899b..79bcbf8 100644
--- a/configs/xilinx_versal_mini_defconfig
+++ b/configs/xilinx_versal_mini_defconfig
@@ -13,6 +13,7 @@
 CONFIG_COUNTER_FREQUENCY=100000000
 # CONFIG_PSCI_RESET is not set
 # CONFIG_EXPERT is not set
+CONFIG_REMAKE_ELF=y
 CONFIG_SYS_LOAD_ADDR=0x8000000
 # CONFIG_LEGACY_IMAGE_FORMAT is not set
 # CONFIG_AUTOBOOT is not set
diff --git a/configs/xilinx_versal_mini_emmc0_defconfig b/configs/xilinx_versal_mini_emmc0_defconfig
index c897339..b1a90bb 100644
--- a/configs/xilinx_versal_mini_emmc0_defconfig
+++ b/configs/xilinx_versal_mini_emmc0_defconfig
@@ -10,6 +10,7 @@
 CONFIG_COUNTER_FREQUENCY=100000000
 # CONFIG_PSCI_RESET is not set
 # CONFIG_EXPERT is not set
+CONFIG_REMAKE_ELF=y
 CONFIG_SYS_LOAD_ADDR=0x8000000
 # CONFIG_AUTOBOOT is not set
 CONFIG_USE_BOOTCOMMAND=y
diff --git a/configs/xilinx_versal_mini_emmc1_defconfig b/configs/xilinx_versal_mini_emmc1_defconfig
index 90bfca7..8f90db4 100644
--- a/configs/xilinx_versal_mini_emmc1_defconfig
+++ b/configs/xilinx_versal_mini_emmc1_defconfig
@@ -10,6 +10,7 @@
 CONFIG_COUNTER_FREQUENCY=100000000
 # CONFIG_PSCI_RESET is not set
 # CONFIG_EXPERT is not set
+CONFIG_REMAKE_ELF=y
 CONFIG_SYS_LOAD_ADDR=0x8000000
 # CONFIG_AUTOBOOT is not set
 CONFIG_USE_BOOTCOMMAND=y
diff --git a/configs/xilinx_versal_virt_defconfig b/configs/xilinx_versal_virt_defconfig
index 28de780..adc30a7 100644
--- a/configs/xilinx_versal_virt_defconfig
+++ b/configs/xilinx_versal_virt_defconfig
@@ -12,6 +12,7 @@
 CONFIG_DEFINE_TCM_OCM_MMAP=y
 CONFIG_COUNTER_FREQUENCY=100000000
 CONFIG_DISTRO_DEFAULTS=y
+CONFIG_REMAKE_ELF=y
 CONFIG_SYS_LOAD_ADDR=0x8000000
 CONFIG_FIT=y
 CONFIG_FIT_VERBOSE=y
diff --git a/configs/xilinx_zynq_virt_defconfig b/configs/xilinx_zynq_virt_defconfig
index b19a788..6aa4ec4 100644
--- a/configs/xilinx_zynq_virt_defconfig
+++ b/configs/xilinx_zynq_virt_defconfig
@@ -13,6 +13,7 @@
 CONFIG_CMD_FRU=y
 CONFIG_CMD_ZYNQ_AES=y
 CONFIG_DISTRO_DEFAULTS=y
+CONFIG_REMAKE_ELF=y
 CONFIG_SYS_CUSTOM_LDSCRIPT=y
 CONFIG_SYS_LDSCRIPT="arch/arm/mach-zynq/u-boot.lds"
 CONFIG_SYS_LOAD_ADDR=0x0
diff --git a/configs/xilinx_zynqmp_mini_defconfig b/configs/xilinx_zynqmp_mini_defconfig
index 73f6eee..32a948b 100644
--- a/configs/xilinx_zynqmp_mini_defconfig
+++ b/configs/xilinx_zynqmp_mini_defconfig
@@ -11,6 +11,7 @@
 CONFIG_SYS_MEM_RSVD_FOR_MMU=y
 CONFIG_ZYNQMP_PSU_INIT_ENABLED=y
 # CONFIG_CMD_ZYNQMP is not set
+CONFIG_REMAKE_ELF=y
 CONFIG_SYS_LOAD_ADDR=0x8000000
 # CONFIG_LEGACY_IMAGE_FORMAT is not set
 # CONFIG_AUTOBOOT is not set
diff --git a/configs/xilinx_zynqmp_mini_emmc0_defconfig b/configs/xilinx_zynqmp_mini_emmc0_defconfig
index ac28eb1..add7ea7 100644
--- a/configs/xilinx_zynqmp_mini_emmc0_defconfig
+++ b/configs/xilinx_zynqmp_mini_emmc0_defconfig
@@ -12,6 +12,7 @@
 CONFIG_SPL=y
 CONFIG_ZYNQMP_PSU_INIT_ENABLED=y
 # CONFIG_CMD_ZYNQMP is not set
+CONFIG_REMAKE_ELF=y
 CONFIG_SYS_LOAD_ADDR=0x8000000
 # CONFIG_MP is not set
 CONFIG_FIT=y
diff --git a/configs/xilinx_zynqmp_mini_emmc1_defconfig b/configs/xilinx_zynqmp_mini_emmc1_defconfig
index e586790..c807af1 100644
--- a/configs/xilinx_zynqmp_mini_emmc1_defconfig
+++ b/configs/xilinx_zynqmp_mini_emmc1_defconfig
@@ -12,6 +12,7 @@
 CONFIG_SPL=y
 CONFIG_ZYNQMP_PSU_INIT_ENABLED=y
 # CONFIG_CMD_ZYNQMP is not set
+CONFIG_REMAKE_ELF=y
 CONFIG_SYS_LOAD_ADDR=0x8000000
 # CONFIG_MP is not set
 CONFIG_FIT=y
diff --git a/configs/xilinx_zynqmp_mini_nand_defconfig b/configs/xilinx_zynqmp_mini_nand_defconfig
index ea66035..400cd75 100644
--- a/configs/xilinx_zynqmp_mini_nand_defconfig
+++ b/configs/xilinx_zynqmp_mini_nand_defconfig
@@ -9,6 +9,7 @@
 CONFIG_DEFAULT_DEVICE_TREE="zynqmp-mini-nand"
 CONFIG_ZYNQMP_PSU_INIT_ENABLED=y
 # CONFIG_CMD_ZYNQMP is not set
+CONFIG_REMAKE_ELF=y
 CONFIG_SYS_LOAD_ADDR=0x8000000
 # CONFIG_MP is not set
 CONFIG_FIT=y
diff --git a/configs/xilinx_zynqmp_mini_nand_single_defconfig b/configs/xilinx_zynqmp_mini_nand_single_defconfig
index 745863b..81d77c2 100644
--- a/configs/xilinx_zynqmp_mini_nand_single_defconfig
+++ b/configs/xilinx_zynqmp_mini_nand_single_defconfig
@@ -9,6 +9,7 @@
 CONFIG_DEFAULT_DEVICE_TREE="zynqmp-mini-nand"
 CONFIG_ZYNQMP_PSU_INIT_ENABLED=y
 # CONFIG_CMD_ZYNQMP is not set
+CONFIG_REMAKE_ELF=y
 CONFIG_SYS_LOAD_ADDR=0x8000000
 # CONFIG_MP is not set
 CONFIG_FIT=y
diff --git a/configs/xilinx_zynqmp_mini_qspi_defconfig b/configs/xilinx_zynqmp_mini_qspi_defconfig
index 78c9d29..f9b7d24 100644
--- a/configs/xilinx_zynqmp_mini_qspi_defconfig
+++ b/configs/xilinx_zynqmp_mini_qspi_defconfig
@@ -14,6 +14,7 @@
 # CONFIG_CMD_ZYNQMP is not set
 # CONFIG_PSCI_RESET is not set
 # CONFIG_EXPERT is not set
+CONFIG_REMAKE_ELF=y
 CONFIG_SYS_LOAD_ADDR=0x8000000
 # CONFIG_LEGACY_IMAGE_FORMAT is not set
 # CONFIG_AUTOBOOT is not set
diff --git a/configs/xilinx_zynqmp_virt_defconfig b/configs/xilinx_zynqmp_virt_defconfig
index 10fee3f..6ea1575 100644
--- a/configs/xilinx_zynqmp_virt_defconfig
+++ b/configs/xilinx_zynqmp_virt_defconfig
@@ -21,6 +21,7 @@
 CONFIG_ZYNQMP_PSU_INIT_ENABLED=y
 CONFIG_AHCI=y
 CONFIG_DISTRO_DEFAULTS=y
+CONFIG_REMAKE_ELF=y
 CONFIG_SYS_LOAD_ADDR=0x8000000
 CONFIG_FIT=y
 CONFIG_FIT_VERBOSE=y
@@ -94,6 +95,7 @@
 CONFIG_NET_RANDOM_ETHADDR=y
 CONFIG_NETCONSOLE=y
 CONFIG_SPL_DM_SEQ_ALIAS=y
+CONFIG_SATA=y
 CONFIG_SCSI_AHCI=y
 CONFIG_SATA_CEVA=y
 CONFIG_BUTTON=y
diff --git a/configs/zynq_cse_nand_defconfig b/configs/zynq_cse_nand_defconfig
index 82f3ae6..88e8019 100644
--- a/configs/zynq_cse_nand_defconfig
+++ b/configs/zynq_cse_nand_defconfig
@@ -12,6 +12,7 @@
 CONFIG_DEFAULT_DEVICE_TREE="zynq-cse-nand"
 CONFIG_SPL_STACK_R_ADDR=0x200000
 CONFIG_SPL=y
+CONFIG_REMAKE_ELF=y
 CONFIG_SYS_CUSTOM_LDSCRIPT=y
 CONFIG_SYS_LDSCRIPT="arch/arm/mach-zynq/u-boot.lds"
 CONFIG_SYS_LOAD_ADDR=0x0
diff --git a/configs/zynq_cse_nor_defconfig b/configs/zynq_cse_nor_defconfig
index b3d1202..4e8661b 100644
--- a/configs/zynq_cse_nor_defconfig
+++ b/configs/zynq_cse_nor_defconfig
@@ -12,6 +12,7 @@
 CONFIG_DEFAULT_DEVICE_TREE="zynq-cse-nor"
 CONFIG_SPL_STACK_R_ADDR=0x200000
 CONFIG_SPL=y
+CONFIG_REMAKE_ELF=y
 CONFIG_SYS_CUSTOM_LDSCRIPT=y
 CONFIG_SYS_LDSCRIPT="arch/arm/mach-zynq/u-boot.lds"
 CONFIG_SYS_LOAD_ADDR=0x0
diff --git a/configs/zynq_cse_qspi_defconfig b/configs/zynq_cse_qspi_defconfig
index 831382f..924d4b1 100644
--- a/configs/zynq_cse_qspi_defconfig
+++ b/configs/zynq_cse_qspi_defconfig
@@ -17,6 +17,7 @@
 # CONFIG_ZYNQ_DDRC_INIT is not set
 # CONFIG_CMD_ZYNQ is not set
 CONFIG_DEBUG_UART=y
+CONFIG_REMAKE_ELF=y
 CONFIG_SYS_CUSTOM_LDSCRIPT=y
 CONFIG_SYS_LDSCRIPT="arch/arm/mach-zynq/u-boot.lds"
 CONFIG_SYS_LOAD_ADDR=0x0
diff --git a/drivers/ata/Kconfig b/drivers/ata/Kconfig
index 5639536..ce6907e 100644
--- a/drivers/ata/Kconfig
+++ b/drivers/ata/Kconfig
@@ -9,6 +9,7 @@
 
 config SATA
 	bool "Support SATA controllers"
+	depends on BLK
 	select HAVE_BLOCK_DEVICE
 	help
 	  This enables support for SATA (Serial Advanced Technology
@@ -41,22 +42,14 @@
 	help
 	  Enables support for the PCI-based AHCI controller.
 
+if AHCI
+
 config SPL_AHCI_PCI
 	bool "Support for PCI-based AHCI controller for SPL"
 	depends on SPL
 	depends on SPL_PCI
 	depends on SPL_SATA_SUPPORT && DM_SCSI
 
-config SATA_CEVA
-	bool "Ceva Sata controller"
-	depends on AHCI
-	depends on DM_SCSI
-	help
-	  This option enables Ceva Sata controller hard IP available on Xilinx
-	  ZynqMP. Support up to 2 external devices. Complient with SATA 3.1 and
-	  AHCI 1.3 specifications with hot-plug detect feature.
-
-
 config DWC_AHCI
 	bool "Enable Synopsys DWC AHCI driver support"
 	select SCSI_AHCI
@@ -77,56 +70,19 @@
 config DWC_AHSATA_AHCI
 	bool "Enable DWC AHSATA AHCI driver support"
 	depends on DWC_AHSATA
-	depends on AHCI
 	default y
 	help
 	  Enable this option unless you need your private ahci implementation
 
-config FSL_SATA
-	bool "Enable Freescale SATA controller driver support"
-	select AHCI
-	select LIBATA
-	depends on BLK
+config MTK_AHCI
+	bool "Enable Mediatek AHCI driver support"
 	help
-	  Enable this driver to support the SATA controller found in
-	  some Freescale PowerPC SoCs.
-
-config SATA_MV
-	bool "Enable Marvell SATA controller driver support"
-	select AHCI
-	select LIBATA
-	depends on BLK
-	help
-	  Enable this driver to support the SATA controller found in
-	  some Marvell SoCs.
-
-config SATA_SIL
-	bool "Enable Silicon Image SIL3131 / SIL3132 / SIL3124 SATA driver support"
-	select AHCI
-	select LIBATA
-	depends on BLK
-	help
-	  Enable this driver to support the SIL3131, SIL3132 and SIL3124
-	  SATA controllers.
-
-config SATA_SIL3114
-	bool "Enable Silicon Image SIL3114 SATA driver support"
-	select LIBATA
-	help
-	  Enable this driver to support the SIL3114 SATA controllers.
-
-config SUNXI_AHCI
-	bool "Enable Allwinner SATA driver support"
-	depends on AHCI
-	default y if ARCH_SUNXI
-	help
-	  Enable this driver to support the SATA controllers found in the
-	  Allwinner A10, A20 and R40 SoCs.
+	  Enable this driver to support Sata devices through
+	  Mediatek AHCI controller (e.g. MT7622).
 
 config AHCI_MVEBU
 	bool "Marvell EBU AHCI SATA support"
 	depends on ARCH_MVEBU || ARCH_OCTEON
-	depends on AHCI
 	select SCSI_AHCI
 	select DM_SCSI
 	help
@@ -135,11 +91,60 @@
 
 	  If unsure, say N.
 
-config MTK_AHCI
-	bool "Enable Mediatek AHCI driver support"
-	depends on AHCI
+config SUNXI_AHCI
+	bool "Enable Allwinner SATA driver support"
+	default y if ARCH_SUNXI
 	help
-	  Enable this driver to support Sata devices through
-	  Mediatek AHCI controller (e.g. MT7622).
+	  Enable this driver to support the SATA controllers found in the
+	  Allwinner A10, A20 and R40 SoCs.
+
+endif # AHCI
+
+if SATA
+
+config SATA_CEVA
+	bool "Ceva Sata controller"
+	depends on AHCI
+	depends on DM_SCSI
+	help
+	  This option enables Ceva Sata controller hard IP available on Xilinx
+	  ZynqMP. Support up to 2 external devices. Compliant with SATA 3.1 and
+	  AHCI 1.3 specifications with hot-plug detect feature.
+
+config FSL_SATA
+	bool "Enable Freescale SATA controller driver support"
+	select AHCI
+	select LIBATA
+	help
+	  Enable this driver to support the SATA controller found in
+	  some Freescale PowerPC SoCs.
+
+config SATA_MV
+	bool "Enable Marvell SATA controller driver support"
+	select AHCI
+	select LIBATA
+	help
+	  Enable this driver to support the SATA controller found in
+	  some Marvell SoCs.
+
+config SATA_SIL
+	bool "Enable Silicon Image SIL3131 / SIL3132 / SIL3124 SATA driver support"
+	select AHCI
+	select LIBATA
+	help
+	  Enable this driver to support the SIL3131, SIL3132 and SIL3124
+	  SATA controllers.
+
+config SYS_SATA_MAX_DEVICE
+	int "Maximum number of SATA devices"
+	depends on !AHCI || FSL_SATA || SATA_MV
+	help
+	  Sets the maximum number of SATA devices which can be supported
+	  by U-Boot.
+
+	  This is only partially converted to driver model. See sata_bread()
+	  for example, which shows where the conversion needs to be completed.
+
+endif # SATA
 
 endmenu
diff --git a/drivers/ata/Makefile b/drivers/ata/Makefile
index cd88131..6e30180 100644
--- a/drivers/ata/Makefile
+++ b/drivers/ata/Makefile
@@ -13,7 +13,6 @@
 obj-$(CONFIG_SATA) += sata.o
 obj-$(CONFIG_SATA_CEVA) += sata_ceva.o
 obj-$(CONFIG_SATA_MV) += sata_mv.o
-obj-$(CONFIG_SATA_SIL3114) += sata_sil3114.o
 obj-$(CONFIG_SATA_SIL) += sata_sil.o
 obj-$(CONFIG_SANDBOX) += sata_sandbox.o
 obj-$(CONFIG_AHCI_MVEBU) += ahci_mvebu.o
diff --git a/drivers/ata/sata.c b/drivers/ata/sata.c
index 6a38d50..0e6c8cd 100644
--- a/drivers/ata/sata.c
+++ b/drivers/ata/sata.c
@@ -59,7 +59,6 @@
 #endif
 #endif
 
-#ifdef CONFIG_BLK
 static unsigned long sata_bread(struct udevice *dev, lbaint_t start,
 				lbaint_t blkcnt, void *dst)
 {
@@ -71,19 +70,6 @@
 {
 	return -ENOSYS;
 }
-#else
-static unsigned long sata_bread(struct blk_desc *block_dev, lbaint_t start,
-				lbaint_t blkcnt, void *dst)
-{
-	return sata_read(block_dev->devnum, start, blkcnt, dst);
-}
-
-static unsigned long sata_bwrite(struct blk_desc *block_dev, lbaint_t start,
-				 lbaint_t blkcnt, const void *buffer)
-{
-	return sata_write(block_dev->devnum, start, blkcnt, buffer);
-}
-#endif
 
 #ifndef CONFIG_AHCI
 int __sata_initialize(void)
@@ -100,10 +86,6 @@
 		sata_dev_desc[i].lba = 0;
 		sata_dev_desc[i].blksz = 512;
 		sata_dev_desc[i].log2blksz = LOG2(sata_dev_desc[i].blksz);
-#ifndef CONFIG_BLK
-		sata_dev_desc[i].block_read = sata_bread;
-		sata_dev_desc[i].block_write = sata_bwrite;
-#endif
 		rc = init_sata(i);
 		if (!rc) {
 			rc = scan_sata(i);
@@ -134,7 +116,6 @@
 int sata_stop(void) __attribute__((weak, alias("__sata_stop")));
 #endif
 
-#ifdef CONFIG_BLK
 static const struct blk_ops sata_blk_ops = {
 	.read	= sata_bread,
 	.write	= sata_bwrite,
@@ -145,11 +126,3 @@
 	.id		= UCLASS_BLK,
 	.ops		= &sata_blk_ops,
 };
-#else
-U_BOOT_LEGACY_BLK(sata) = {
-	.if_typename	= "sata",
-	.if_type	= IF_TYPE_SATA,
-	.max_devs	= CONFIG_SYS_SATA_MAX_DEVICE,
-	.desc		= sata_dev_desc,
-};
-#endif
diff --git a/drivers/ata/sata_sil.c b/drivers/ata/sata_sil.c
index dda712f..a4f0dae 100644
--- a/drivers/ata/sata_sil.c
+++ b/drivers/ata/sata_sil.c
@@ -6,7 +6,9 @@
  */
 
 #include <common.h>
+#include <blk.h>
 #include <cpu_func.h>
+#include <dm.h>
 #include <log.h>
 #include <pci.h>
 #include <command.h>
@@ -17,13 +19,8 @@
 #include <sata.h>
 #include <libata.h>
 #include <sata.h>
-#include <linux/delay.h>
-
-#if CONFIG_IS_ENABLED(BLK)
-#include <dm.h>
-#include <blk.h>
 #include <dm/device-internal.h>
-#endif
+#include <linux/delay.h>
 
 #include "sata_sil.h"
 
@@ -480,18 +477,12 @@
 /*
  * SATA interface between low level driver and command layer
  */
-#if !CONFIG_IS_ENABLED(BLK)
-ulong sata_read(int dev, ulong blknr, lbaint_t blkcnt, void *buffer)
-{
-	struct sil_sata *sata = (struct sil_sata *)sata_dev_desc[dev].priv;
-#else
 static ulong sata_read(struct udevice *dev, lbaint_t blknr, lbaint_t blkcnt,
 		       void *buffer)
 {
 	struct sil_sata_priv *priv = dev_get_plat(dev);
 	int port_number = priv->port_num;
 	struct sil_sata *sata = priv->sil_sata_desc[port_number];
-#endif
 	ulong rc;
 
 	if (sata->lba48)
@@ -505,18 +496,12 @@
 /*
  * SATA interface between low level driver and command layer
  */
-#if !CONFIG_IS_ENABLED(BLK)
-ulong sata_write(int dev, ulong blknr, lbaint_t blkcnt, const void *buffer)
-{
-	struct sil_sata *sata = (struct sil_sata *)sata_dev_desc[dev].priv;
-#else
 ulong sata_write(struct udevice *dev, lbaint_t blknr, lbaint_t blkcnt,
 		 const void *buffer)
 {
 	struct sil_sata_priv *priv = dev_get_plat(dev);
 	int port_number = priv->port_num;
 	struct sil_sata *sata = priv->sil_sata_desc[port_number];
-#endif
 	ulong rc;
 
 	if (sata->lba48) {
@@ -532,14 +517,9 @@
 	return rc;
 }
 
-#if !CONFIG_IS_ENABLED(BLK)
-static int sil_init_sata(int dev)
-{
-#else
 static int sil_init_sata(struct udevice *uc_dev, int dev)
 {
 	struct sil_sata_priv *priv = dev_get_plat(uc_dev);
-#endif
 	struct sil_sata *sata;
 	void *port;
 	u32 tmp;
@@ -606,14 +586,9 @@
 	memset((void *)sata, 0, sizeof(struct sil_sata));
 
 	/* Save the private struct to block device struct */
-#if !CONFIG_IS_ENABLED(BLK)
-	sata_dev_desc[dev].priv = (void *)sata;
-	sata->devno = sata_info.devno;
-#else
 	priv->sil_sata_desc[dev] = sata;
 	priv->port_num = dev;
 	sata->devno = uc_dev->parent;
-#endif
 	sata->id = dev;
 	sata->port = port;
 	sprintf(sata->name, "SATA#%d", dev);
@@ -625,85 +600,11 @@
 	return 0;
 }
 
-#if !CONFIG_IS_ENABLED(BLK)
-/*
- * SATA interface between low level driver and command layer
- */
-int init_sata(int dev)
-{
-	static int init_done, idx;
-	pci_dev_t devno;
-	u16 word;
-
-	if (init_done == 1 && dev < sata_info.maxport)
-		goto init_start;
-
-	init_done = 1;
-
-	/* Find PCI device(s) */
-	devno = pci_find_devices(supported, idx++);
-	if (devno == -1)
-		return 1;
-
-	pci_read_config_word(devno, PCI_DEVICE_ID, &word);
-
-	/* get the port count */
-	word &= 0xf;
-
-	sata_info.portbase = 0;
-	sata_info.maxport = sata_info.portbase + word;
-	sata_info.devno = devno;
-
-	/* Read out all BARs */
-	sata_info.iobase[0] = (ulong)pci_map_bar(devno,
-			PCI_BASE_ADDRESS_0, PCI_REGION_MEM);
-	sata_info.iobase[1] = (ulong)pci_map_bar(devno,
-			PCI_BASE_ADDRESS_2, PCI_REGION_MEM);
-
-	/* mask out the unused bits */
-	sata_info.iobase[0] &= 0xffffff80;
-	sata_info.iobase[1] &= 0xfffffc00;
-
-	/* Enable Bus Mastering and memory region */
-	pci_write_config_word(devno, PCI_COMMAND,
-			      PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER);
-
-	/* Check if mem accesses and Bus Mastering are enabled. */
-	pci_read_config_word(devno, PCI_COMMAND, &word);
-	if (!(word & PCI_COMMAND_MEMORY) ||
-	    (!(word & PCI_COMMAND_MASTER))) {
-		printf("Error: Can not enable MEM access or Bus Mastering.\n");
-		debug("PCI command: %04x\n", word);
-		return 1;
-	}
-
-	/* GPIO off */
-	writel(0, (void *)(sata_info.iobase[0] + HOST_FLASH_CMD));
-	/* clear global reset & mask interrupts during initialization */
-	writel(0, (void *)(sata_info.iobase[0] + HOST_CTRL));
-
-init_start:
-	return sil_init_sata(dev);
-}
-
-int reset_sata(int dev)
-{
-	return 0;
-}
-
-/*
- * SATA interface between low level driver and command layer
- */
-int scan_sata(int dev)
-{
-	struct sil_sata *sata = (struct sil_sata *)sata_dev_desc[dev].priv;
-#else
 static int scan_sata(struct udevice *blk_dev, int dev)
 {
 	struct blk_desc *desc = dev_get_uclass_plat(blk_dev);
 	struct sil_sata_priv *priv = dev_get_plat(blk_dev);
 	struct sil_sata *sata = priv->sil_sata_desc[dev];
-#endif
 	unsigned char serial[ATA_ID_SERNO_LEN + 1];
 	unsigned char firmware[ATA_ID_FW_REV_LEN + 1];
 	unsigned char product[ATA_ID_PROD_LEN + 1];
@@ -727,16 +628,6 @@
 	/* Product model */
 	ata_id_c_string(id, product, ATA_ID_PROD, sizeof(product));
 
-#if !CONFIG_IS_ENABLED(BLK)
-	memcpy(sata_dev_desc[dev].product, serial, sizeof(serial));
-	memcpy(sata_dev_desc[dev].revision, firmware, sizeof(firmware));
-	memcpy(sata_dev_desc[dev].vendor, product, sizeof(product));
-	/* Totoal sectors */
-	sata_dev_desc[dev].lba = ata_id_n_sectors(id);
-#ifdef CONFIG_LBA48
-	sata_dev_desc[dev].lba48 = sata->lba48;
-#endif
-#else
 	memcpy(desc->product, serial, sizeof(serial));
 	memcpy(desc->revision, firmware, sizeof(firmware));
 	memcpy(desc->vendor, product, sizeof(product));
@@ -744,7 +635,6 @@
 #ifdef CONFIG_LBA48
 	desc->lba48 = sata->lba48;
 #endif
-#endif
 
 #ifdef DEBUG
 	ata_dump_id(id);
@@ -754,7 +644,6 @@
 	return 0;
 }
 
-#if CONFIG_IS_ENABLED(BLK)
 static const struct blk_ops sata_sil_blk_ops = {
 	.read	= sata_read,
 	.write	= sata_write,
@@ -916,4 +805,3 @@
 };
 
 U_BOOT_PCI_DEVICE(sil_ahci_pci, supported);
-#endif
diff --git a/drivers/ata/sata_sil3114.c b/drivers/ata/sata_sil3114.c
deleted file mode 100644
index 4d3a680..0000000
--- a/drivers/ata/sata_sil3114.c
+++ /dev/null
@@ -1,838 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0+
-/*
- * Copyright (C) Excito Elektronik i Skåne AB, All rights reserved.
- * Author: Tor Krill <tor@excito.com>
- *
- * This is a driver for Silicon Image sil3114 sata chip modelled on
- * the ata_piix driver
- */
-
-#include <common.h>
-#include <blk.h>
-#include <log.h>
-#include <part.h>
-#include <pci.h>
-#include <command.h>
-#include <config.h>
-#include <asm/byteorder.h>
-#include <asm/io.h>
-#include <ide.h>
-#include <sata.h>
-#include <libata.h>
-#include <linux/delay.h>
-#include "sata_sil3114.h"
-
-/* Convert sectorsize to wordsize */
-#define ATA_SECTOR_WORDS (ATA_SECT_SIZE/2)
-
-/* Forwards */
-u8 sil3114_spin_up (int num);
-u8 sil3114_spin_down (int num);
-static int sata_bus_softreset (int num);
-static void sata_identify (int num, int dev);
-static u8 check_power_mode (int num);
-static void sata_port (struct sata_ioports *ioport);
-static void set_Feature_cmd (int num, int dev);
-static u8 sata_busy_wait (struct sata_ioports *ioaddr, int bits,
-			  unsigned int max, u8 usealtstatus);
-static u8 sata_chk_status (struct sata_ioports *ioaddr, u8 usealtstatus);
-static void msleep (int count);
-
-static u32 iobase[6] = { 0, 0, 0, 0, 0, 0};	/* PCI BAR registers for device */
-
-static struct sata_port port[CONFIG_SYS_SATA_MAX_DEVICE];
-
-static void output_data (struct sata_ioports *ioaddr, u16 * sect_buf, int words)
-{
-	while (words--) {
-		__raw_writew (*sect_buf++, (void *)ioaddr->data_addr);
-	}
-}
-
-static int input_data (struct sata_ioports *ioaddr, u16 * sect_buf, int words)
-{
-	while (words--) {
-		*sect_buf++ = __raw_readw ((void *)ioaddr->data_addr);
-	}
-	return 0;
-}
-
-static int sata_bus_softreset (int num)
-{
-	u8 status = 0;
-
-	port[num].dev_mask = 1;
-
-	port[num].ctl_reg = 0x08;	/*Default value of control reg */
-	writeb (port[num].ctl_reg, port[num].ioaddr.ctl_addr);
-	udelay(10);
-	writeb (port[num].ctl_reg | ATA_SRST, port[num].ioaddr.ctl_addr);
-	udelay(10);
-	writeb (port[num].ctl_reg, port[num].ioaddr.ctl_addr);
-
-	/* spec mandates ">= 2ms" before checking status.
-	 * We wait 150ms, because that was the magic delay used for
-	 * ATAPI devices in Hale Landis's ATADRVR, for the period of time
-	 * between when the ATA command register is written, and then
-	 * status is checked.  Because waiting for "a while" before
-	 * checking status is fine, post SRST, we perform this magic
-	 * delay here as well.
-	 */
-	msleep (150);
-	status = sata_busy_wait (&port[num].ioaddr, ATA_BUSY, 300, 0);
-	while ((status & ATA_BUSY)) {
-		msleep (100);
-		status = sata_busy_wait (&port[num].ioaddr, ATA_BUSY, 3, 0);
-	}
-
-	if (status & ATA_BUSY) {
-		printf ("ata%u is slow to respond,plz be patient\n", num);
-	}
-
-	while ((status & ATA_BUSY)) {
-		msleep (100);
-		status = sata_chk_status (&port[num].ioaddr, 0);
-	}
-
-	if (status & ATA_BUSY) {
-		printf ("ata%u failed to respond : ", num);
-		printf ("bus reset failed\n");
-		port[num].dev_mask = 0;
-		return 1;
-	}
-	return 0;
-}
-
-static void sata_identify (int num, int dev)
-{
-	u8 cmd = 0, status = 0, devno = num;
-	u16 iobuf[ATA_SECTOR_WORDS];
-	u64 n_sectors = 0;
-
-	memset (iobuf, 0, sizeof (iobuf));
-
-	if (!(port[num].dev_mask & 0x01)) {
-		printf ("dev%d is not present on port#%d\n", dev, num);
-		return;
-	}
-
-	debug ("port=%d dev=%d\n", num, dev);
-
-	status = 0;
-	cmd = ATA_CMD_ID_ATA;	/*Device Identify Command */
-	writeb (cmd, port[num].ioaddr.command_addr);
-	readb (port[num].ioaddr.altstatus_addr);
-	udelay(10);
-
-	status = sata_busy_wait (&port[num].ioaddr, ATA_BUSY, 1000, 0);
-	if (status & ATA_ERR) {
-		printf ("\ndevice not responding\n");
-		port[num].dev_mask &= ~0x01;
-		return;
-	}
-
-	input_data (&port[num].ioaddr, iobuf, ATA_SECTOR_WORDS);
-
-	ata_swap_buf_le16 (iobuf, ATA_SECTOR_WORDS);
-
-	debug ("Specific config: %x\n", iobuf[2]);
-
-	/* we require LBA and DMA support (bits 8 & 9 of word 49) */
-	if (!ata_id_has_dma (iobuf) || !ata_id_has_lba (iobuf)) {
-		debug ("ata%u: no dma/lba\n", num);
-	}
-#ifdef DEBUG
-	ata_dump_id (iobuf);
-#endif
-	n_sectors = ata_id_n_sectors (iobuf);
-
-	if (n_sectors == 0) {
-		port[num].dev_mask &= ~0x01;
-		return;
-	}
-	ata_id_c_string (iobuf, (unsigned char *)sata_dev_desc[devno].revision,
-			 ATA_ID_FW_REV, sizeof (sata_dev_desc[devno].revision));
-	ata_id_c_string (iobuf, (unsigned char *)sata_dev_desc[devno].vendor,
-			 ATA_ID_PROD, sizeof (sata_dev_desc[devno].vendor));
-	ata_id_c_string (iobuf, (unsigned char *)sata_dev_desc[devno].product,
-			 ATA_ID_SERNO, sizeof (sata_dev_desc[devno].product));
-
-	/* TODO - atm we asume harddisk ie not removable */
-	sata_dev_desc[devno].removable = 0;
-
-	sata_dev_desc[devno].lba = (u32) n_sectors;
-	debug("lba=0x%lx\n", sata_dev_desc[devno].lba);
-
-#ifdef CONFIG_LBA48
-	if (iobuf[83] & (1 << 10)) {
-		sata_dev_desc[devno].lba48 = 1;
-	} else {
-		sata_dev_desc[devno].lba48 = 0;
-	}
-#endif
-
-	/* assuming HD */
-	sata_dev_desc[devno].type = DEV_TYPE_HARDDISK;
-	sata_dev_desc[devno].blksz = ATA_SECT_SIZE;
-	sata_dev_desc[devno].lun = 0;	/* just to fill something in... */
-}
-
-static void set_Feature_cmd (int num, int dev)
-{
-	u8 status = 0;
-
-	if (!(port[num].dev_mask & 0x01)) {
-		debug ("dev%d is not present on port#%d\n", dev, num);
-		return;
-	}
-
-	writeb (SETFEATURES_XFER, port[num].ioaddr.feature_addr);
-	writeb (XFER_PIO_4, port[num].ioaddr.nsect_addr);
-	writeb (0, port[num].ioaddr.lbal_addr);
-	writeb (0, port[num].ioaddr.lbam_addr);
-	writeb (0, port[num].ioaddr.lbah_addr);
-
-	writeb (ATA_DEVICE_OBS, port[num].ioaddr.device_addr);
-	writeb (ATA_CMD_SET_FEATURES, port[num].ioaddr.command_addr);
-
-	udelay(50);
-	msleep (150);
-
-	status = sata_busy_wait (&port[num].ioaddr, ATA_BUSY, 5000, 0);
-	if ((status & (ATA_BUSY | ATA_ERR))) {
-		printf ("Error  : status 0x%02x\n", status);
-		port[num].dev_mask &= ~0x01;
-	}
-}
-
-u8 sil3114_spin_down (int num)
-{
-	u8 status = 0;
-
-	debug ("Spin down disk\n");
-
-	if (!(port[num].dev_mask & 0x01)) {
-		debug ("Device ata%d is not present\n", num);
-		return 1;
-	}
-
-	if ((status = check_power_mode (num)) == 0x00) {
-		debug ("Already in standby\n");
-		return 0;
-	}
-
-	if (status == 0x01) {
-		printf ("Failed to check power mode on ata%d\n", num);
-		return 1;
-	}
-
-	if (!((status = sata_chk_status (&port[num].ioaddr, 0)) & ATA_DRDY)) {
-		printf ("Device ata%d not ready\n", num);
-		return 1;
-	}
-
-	writeb (0x00, port[num].ioaddr.feature_addr);
-
-	writeb (0x00, port[num].ioaddr.nsect_addr);
-	writeb (0x00, port[num].ioaddr.lbal_addr);
-	writeb (0x00, port[num].ioaddr.lbam_addr);
-	writeb (0x00, port[num].ioaddr.lbah_addr);
-
-	writeb (ATA_DEVICE_OBS, port[num].ioaddr.device_addr);
-	writeb (ATA_CMD_STANDBY, port[num].ioaddr.command_addr);
-
-	status = sata_busy_wait (&port[num].ioaddr, ATA_BUSY, 30000, 0);
-	if ((status & (ATA_BUSY | ATA_ERR))) {
-		printf ("Error waiting for disk spin down: status 0x%02x\n",
-			status);
-		port[num].dev_mask &= ~0x01;
-		return 1;
-	}
-	return 0;
-}
-
-u8 sil3114_spin_up (int num)
-{
-	u8 status = 0;
-
-	debug ("Spin up disk\n");
-
-	if (!(port[num].dev_mask & 0x01)) {
-		debug ("Device ata%d is not present\n", num);
-		return 1;
-	}
-
-	if ((status = check_power_mode (num)) != 0x00) {
-		if (status == 0x01) {
-			printf ("Failed to check power mode on ata%d\n", num);
-			return 1;
-		} else {
-			/* should be up and running already */
-			return 0;
-		}
-	}
-
-	if (!((status = sata_chk_status (&port[num].ioaddr, 0)) & ATA_DRDY)) {
-		printf ("Device ata%d not ready\n", num);
-		return 1;
-	}
-
-	debug ("Stautus of device check: %d\n", status);
-
-	writeb (0x00, port[num].ioaddr.feature_addr);
-
-	writeb (0x00, port[num].ioaddr.nsect_addr);
-	writeb (0x00, port[num].ioaddr.lbal_addr);
-	writeb (0x00, port[num].ioaddr.lbam_addr);
-	writeb (0x00, port[num].ioaddr.lbah_addr);
-
-	writeb (ATA_DEVICE_OBS, port[num].ioaddr.device_addr);
-	writeb (ATA_CMD_IDLE, port[num].ioaddr.command_addr);
-
-	status = sata_busy_wait (&port[num].ioaddr, ATA_BUSY, 30000, 0);
-	if ((status & (ATA_BUSY | ATA_ERR))) {
-		printf ("Error waiting for disk spin up: status 0x%02x\n",
-			status);
-		port[num].dev_mask &= ~0x01;
-		return 1;
-	}
-
-	/* Wait for disk to enter Active state */
-	do {
-		msleep (10);
-		status = check_power_mode (num);
-	} while ((status == 0x00) || (status == 0x80));
-
-	if (status == 0x01) {
-		printf ("Falied waiting for disk to spin up\n");
-		return 1;
-	}
-
-	return 0;
-}
-
-/* Return value is not the usual here
- * 0x00 - Device stand by
- * 0x01 - Operation failed
- * 0x80 - Device idle
- * 0xff - Device active
-*/
-static u8 check_power_mode (int num)
-{
-	u8 status = 0;
-	u8 res = 0;
-	if (!(port[num].dev_mask & 0x01)) {
-		debug ("Device ata%d is not present\n", num);
-		return 1;
-	}
-
-	if (!(sata_chk_status (&port[num].ioaddr, 0) & ATA_DRDY)) {
-		printf ("Device ata%d not ready\n", num);
-		return 1;
-	}
-
-	writeb (0, port[num].ioaddr.feature_addr);
-	writeb (0, port[num].ioaddr.nsect_addr);
-	writeb (0, port[num].ioaddr.lbal_addr);
-	writeb (0, port[num].ioaddr.lbam_addr);
-	writeb (0, port[num].ioaddr.lbah_addr);
-
-	writeb (ATA_DEVICE_OBS, port[num].ioaddr.device_addr);
-	writeb (ATA_CMD_CHK_POWER, port[num].ioaddr.command_addr);
-
-	status = sata_busy_wait (&port[num].ioaddr, ATA_BUSY, 5000, 0);
-	if ((status & (ATA_BUSY | ATA_ERR))) {
-		printf
-		    ("Error waiting for check power mode complete  : status 0x%02x\n",
-		     status);
-		port[num].dev_mask &= ~0x01;
-		return 1;
-	}
-	res = readb (port[num].ioaddr.nsect_addr);
-	debug ("Check powermode: %d\n", res);
-	return res;
-
-}
-
-static void sata_port (struct sata_ioports *ioport)
-{
-	ioport->data_addr = ioport->cmd_addr + ATA_REG_DATA;
-	ioport->error_addr = ioport->cmd_addr + ATA_REG_ERR;
-	ioport->feature_addr = ioport->cmd_addr + ATA_REG_FEATURE;
-	ioport->nsect_addr = ioport->cmd_addr + ATA_REG_NSECT;
-	ioport->lbal_addr = ioport->cmd_addr + ATA_REG_LBAL;
-	ioport->lbam_addr = ioport->cmd_addr + ATA_REG_LBAM;
-	ioport->lbah_addr = ioport->cmd_addr + ATA_REG_LBAH;
-	ioport->device_addr = ioport->cmd_addr + ATA_REG_DEVICE;
-	ioport->status_addr = ioport->cmd_addr + ATA_REG_STATUS;
-	ioport->command_addr = ioport->cmd_addr + ATA_REG_CMD;
-}
-
-static u8 wait_for_irq (int num, unsigned int max)
-{
-
-	u32 port = iobase[5];
-	switch (num) {
-	case 0:
-		port += VND_TF_CNST_CH0;
-		break;
-	case 1:
-		port += VND_TF_CNST_CH1;
-		break;
-	case 2:
-		port += VND_TF_CNST_CH2;
-		break;
-	case 3:
-		port += VND_TF_CNST_CH3;
-		break;
-	default:
-		return 1;
-	}
-
-	do {
-		if (readl (port) & VND_TF_CNST_INTST) {
-			break;
-		}
-		udelay(1000);
-		max--;
-	} while ((max > 0));
-
-	return (max == 0);
-}
-
-static u8 sata_busy_wait (struct sata_ioports *ioaddr, int bits,
-			  unsigned int max, u8 usealtstatus)
-{
-	u8 status;
-
-	do {
-		if (!((status = sata_chk_status (ioaddr, usealtstatus)) & bits)) {
-			break;
-		}
-		udelay(1000);
-		max--;
-	} while ((status & bits) && (max > 0));
-
-	return status;
-}
-
-static u8 sata_chk_status (struct sata_ioports *ioaddr, u8 usealtstatus)
-{
-	if (!usealtstatus) {
-		return readb (ioaddr->status_addr);
-	} else {
-		return readb (ioaddr->altstatus_addr);
-	}
-}
-
-static void msleep (int count)
-{
-	int i;
-
-	for (i = 0; i < count; i++)
-		udelay(1000);
-}
-
-/* Read up to 255 sectors
- *
- * Returns sectors read
-*/
-static u8 do_one_read (int device, ulong block, u8 blkcnt, u16 * buff,
-		       uchar lba48)
-{
-
-	u8 sr = 0;
-	u8 status;
-	u64 blknr = (u64) block;
-
-	if (!(sata_chk_status (&port[device].ioaddr, 0) & ATA_DRDY)) {
-		printf ("Device ata%d not ready\n", device);
-		return 0;
-	}
-
-	/* Set up transfer */
-#ifdef CONFIG_LBA48
-	if (lba48) {
-		/* write high bits */
-		writeb (0, port[device].ioaddr.nsect_addr);
-		writeb ((blknr >> 24) & 0xFF, port[device].ioaddr.lbal_addr);
-		writeb ((blknr >> 32) & 0xFF, port[device].ioaddr.lbam_addr);
-		writeb ((blknr >> 40) & 0xFF, port[device].ioaddr.lbah_addr);
-	}
-#endif
-	writeb (blkcnt, port[device].ioaddr.nsect_addr);
-	writeb (((blknr) >> 0) & 0xFF, port[device].ioaddr.lbal_addr);
-	writeb ((blknr >> 8) & 0xFF, port[device].ioaddr.lbam_addr);
-	writeb ((blknr >> 16) & 0xFF, port[device].ioaddr.lbah_addr);
-
-#ifdef CONFIG_LBA48
-	if (lba48) {
-		writeb (ATA_LBA, port[device].ioaddr.device_addr);
-		writeb (ATA_CMD_PIO_READ_EXT, port[device].ioaddr.command_addr);
-	} else
-#endif
-	{
-		writeb (ATA_LBA | ((blknr >> 24) & 0xF),
-			port[device].ioaddr.device_addr);
-		writeb (ATA_CMD_PIO_READ, port[device].ioaddr.command_addr);
-	}
-
-	status = sata_busy_wait (&port[device].ioaddr, ATA_BUSY, 10000, 1);
-
-	if (status & ATA_BUSY) {
-		u8 err = 0;
-
-		printf ("Device %d not responding status %d\n", device, status);
-		err = readb (port[device].ioaddr.error_addr);
-		printf ("Error reg = 0x%x\n", err);
-
-		return (sr);
-	}
-	while (blkcnt--) {
-
-		if (wait_for_irq (device, 500)) {
-			printf ("ata%u irq failed\n", device);
-			return sr;
-		}
-
-		status = sata_chk_status (&port[device].ioaddr, 0);
-		if (status & ATA_ERR) {
-			printf ("ata%u error %d\n", device,
-				readb (port[device].ioaddr.error_addr));
-			return sr;
-		}
-		/* Read one sector */
-		input_data (&port[device].ioaddr, buff, ATA_SECTOR_WORDS);
-		buff += ATA_SECTOR_WORDS;
-		sr++;
-
-	}
-	return sr;
-}
-
-ulong sata_read (int device, ulong block, lbaint_t blkcnt, void *buff)
-{
-	ulong n = 0, sread;
-	u16 *buffer = (u16 *) buff;
-	u8 status = 0;
-	u64 blknr = (u64) block;
-	unsigned char lba48 = 0;
-
-#ifdef CONFIG_LBA48
-	if (blknr > 0xfffffff) {
-		if (!sata_dev_desc[device].lba48) {
-			printf ("Drive doesn't support 48-bit addressing\n");
-			return 0;
-		}
-		/* more than 28 bits used, use 48bit mode */
-		lba48 = 1;
-	}
-#endif
-
-	while (blkcnt > 0) {
-
-		if (blkcnt > 255) {
-			sread = 255;
-		} else {
-			sread = blkcnt;
-		}
-
-		status = do_one_read (device, blknr, sread, buffer, lba48);
-		if (status != sread) {
-			printf ("Read failed\n");
-			return n;
-		}
-
-		blkcnt -= sread;
-		blknr += sread;
-		n += sread;
-		buffer += sread * ATA_SECTOR_WORDS;
-	}
-	return n;
-}
-
-ulong sata_write (int device, ulong block, lbaint_t blkcnt, const void *buff)
-{
-	ulong n = 0;
-	u16 *buffer = (u16 *) buff;
-	unsigned char status = 0, num = 0;
-	u64 blknr = (u64) block;
-#ifdef CONFIG_LBA48
-	unsigned char lba48 = 0;
-
-	if (blknr > 0xfffffff) {
-		if (!sata_dev_desc[device].lba48) {
-			printf ("Drive doesn't support 48-bit addressing\n");
-			return 0;
-		}
-		/* more than 28 bits used, use 48bit mode */
-		lba48 = 1;
-	}
-#endif
-	/*Port Number */
-	num = device;
-
-	while (blkcnt-- > 0) {
-		status = sata_busy_wait (&port[num].ioaddr, ATA_BUSY, 500, 0);
-		if (status & ATA_BUSY) {
-			printf ("ata%u failed to respond\n", port[num].port_no);
-			return n;
-		}
-#ifdef CONFIG_LBA48
-		if (lba48) {
-			/* write high bits */
-			writeb (0, port[num].ioaddr.nsect_addr);
-			writeb ((blknr >> 24) & 0xFF,
-				port[num].ioaddr.lbal_addr);
-			writeb ((blknr >> 32) & 0xFF,
-				port[num].ioaddr.lbam_addr);
-			writeb ((blknr >> 40) & 0xFF,
-				port[num].ioaddr.lbah_addr);
-		}
-#endif
-		writeb (1, port[num].ioaddr.nsect_addr);
-		writeb ((blknr >> 0) & 0xFF, port[num].ioaddr.lbal_addr);
-		writeb ((blknr >> 8) & 0xFF, port[num].ioaddr.lbam_addr);
-		writeb ((blknr >> 16) & 0xFF, port[num].ioaddr.lbah_addr);
-#ifdef CONFIG_LBA48
-		if (lba48) {
-			writeb (ATA_LBA, port[num].ioaddr.device_addr);
-			writeb (ATA_CMD_PIO_WRITE_EXT, port[num].ioaddr.command_addr);
-		} else
-#endif
-		{
-			writeb (ATA_LBA | ((blknr >> 24) & 0xF),
-				port[num].ioaddr.device_addr);
-			writeb (ATA_CMD_PIO_WRITE, port[num].ioaddr.command_addr);
-		}
-
-		msleep (50);
-		/*may take up to 4 sec */
-		status = sata_busy_wait (&port[num].ioaddr, ATA_BUSY, 4000, 0);
-		if ((status & (ATA_DRQ | ATA_BUSY | ATA_ERR)) != ATA_DRQ) {
-			printf ("Error no DRQ dev %d blk %ld: sts 0x%02x\n",
-				device, (ulong) blknr, status);
-			return (n);
-		}
-
-		output_data (&port[num].ioaddr, buffer, ATA_SECTOR_WORDS);
-		readb (port[num].ioaddr.altstatus_addr);
-		udelay(50);
-
-		++n;
-		++blknr;
-		buffer += ATA_SECTOR_WORDS;
-	}
-	return n;
-}
-
-/* Driver implementation */
-static u8 sil_get_device_cache_line (pci_dev_t pdev)
-{
-	u8 cache_line = 0;
-	pci_read_config_byte (pdev, PCI_CACHE_LINE_SIZE, &cache_line);
-	return cache_line;
-}
-
-int init_sata (int dev)
-{
-	static u8 init_done = 0;
-	static int res = 1;
-	pci_dev_t devno;
-	u8 cls = 0;
-	u16 cmd = 0;
-	u32 sconf = 0;
-
-	if (init_done) {
-		return res;
-	}
-
-	init_done = 1;
-
-	if ((devno = pci_find_device (SIL_VEND_ID, SIL3114_DEVICE_ID, 0)) == -1) {
-		res = 1;
-		return res;
-	}
-
-	/* Read out all BARs, even though we only use MMIO from BAR5 */
-	pci_read_config_dword (devno, PCI_BASE_ADDRESS_0, &iobase[0]);
-	pci_read_config_dword (devno, PCI_BASE_ADDRESS_1, &iobase[1]);
-	pci_read_config_dword (devno, PCI_BASE_ADDRESS_2, &iobase[2]);
-	pci_read_config_dword (devno, PCI_BASE_ADDRESS_3, &iobase[3]);
-	pci_read_config_dword (devno, PCI_BASE_ADDRESS_4, &iobase[4]);
-	pci_read_config_dword (devno, PCI_BASE_ADDRESS_5, &iobase[5]);
-
-	if ((iobase[0] == 0xFFFFFFFF) || (iobase[1] == 0xFFFFFFFF) ||
-	    (iobase[2] == 0xFFFFFFFF) || (iobase[3] == 0xFFFFFFFF) ||
-	    (iobase[4] == 0xFFFFFFFF) || (iobase[5] == 0xFFFFFFFF)) {
-		printf ("Error no base addr for SATA controller\n");
-		res = 1;
-		return res;
-	}
-
-	/* mask off unused bits */
-	iobase[0] &= 0xfffffffc;
-	iobase[1] &= 0xfffffff8;
-	iobase[2] &= 0xfffffffc;
-	iobase[3] &= 0xfffffff8;
-	iobase[4] &= 0xfffffff0;
-	iobase[5] &= 0xfffffc00;
-
-	/* from sata_sil in Linux kernel */
-	cls = sil_get_device_cache_line (devno);
-	if (cls) {
-		cls >>= 3;
-		cls++;		/* cls = (line_size/8)+1 */
-		writel (cls << 8 | cls, iobase[5] + VND_FIFOCFG_CH0);
-		writel (cls << 8 | cls, iobase[5] + VND_FIFOCFG_CH1);
-		writel (cls << 8 | cls, iobase[5] + VND_FIFOCFG_CH2);
-		writel (cls << 8 | cls, iobase[5] + VND_FIFOCFG_CH3);
-	} else {
-		printf ("Cache line not set. Driver may not function\n");
-	}
-
-	/* Enable operation */
-	pci_read_config_word (devno, PCI_COMMAND, &cmd);
-	cmd |= PCI_COMMAND_MASTER | PCI_COMMAND_IO | PCI_COMMAND_MEMORY;
-	pci_write_config_word (devno, PCI_COMMAND, cmd);
-
-	/* Disable interrupt usage */
-	pci_read_config_dword (devno, VND_SYSCONFSTAT, &sconf);
-	sconf |= (VND_SYSCONFSTAT_CHN_0_INTBLOCK | VND_SYSCONFSTAT_CHN_1_INTBLOCK);
-	pci_write_config_dword (devno, VND_SYSCONFSTAT, sconf);
-
-	res = 0;
-	return res;
-}
-
-int reset_sata(int dev)
-{
-	return 0;
-}
-
-/* Check if device is connected to port */
-int sata_bus_probe (int portno)
-{
-	u32 port = iobase[5];
-	u32 val;
-	switch (portno) {
-	case 0:
-		port += VND_SSTATUS_CH0;
-		break;
-	case 1:
-		port += VND_SSTATUS_CH1;
-		break;
-	case 2:
-		port += VND_SSTATUS_CH2;
-		break;
-	case 3:
-		port += VND_SSTATUS_CH3;
-		break;
-	default:
-		return 0;
-	}
-	val = readl (port);
-	if ((val & SATA_DET_PRES) == SATA_DET_PRES) {
-		return 1;
-	} else {
-		return 0;
-	}
-}
-
-int sata_phy_reset (int portno)
-{
-	u32 port = iobase[5];
-	u32 val;
-	switch (portno) {
-	case 0:
-		port += VND_SCONTROL_CH0;
-		break;
-	case 1:
-		port += VND_SCONTROL_CH1;
-		break;
-	case 2:
-		port += VND_SCONTROL_CH2;
-		break;
-	case 3:
-		port += VND_SCONTROL_CH3;
-		break;
-	default:
-		return 0;
-	}
-	val = readl (port);
-	writel (val | SATA_SC_DET_RST, port);
-	msleep (150);
-	writel (val & ~SATA_SC_DET_RST, port);
-	return 0;
-}
-
-int scan_sata (int dev)
-{
-	/* A bit brain dead, but the code has a legacy */
-	switch (dev) {
-	case 0:
-		port[0].port_no = 0;
-		port[0].ioaddr.cmd_addr = iobase[5] + VND_TF0_CH0;
-		port[0].ioaddr.altstatus_addr = port[0].ioaddr.ctl_addr =
-		    (iobase[5] + VND_TF2_CH0) | ATA_PCI_CTL_OFS;
-		port[0].ioaddr.bmdma_addr = iobase[5] + VND_BMDMA_CH0;
-		break;
-#if (CONFIG_SYS_SATA_MAX_DEVICE >= 1)
-	case 1:
-		port[1].port_no = 0;
-		port[1].ioaddr.cmd_addr = iobase[5] + VND_TF0_CH1;
-		port[1].ioaddr.altstatus_addr = port[1].ioaddr.ctl_addr =
-		    (iobase[5] + VND_TF2_CH1) | ATA_PCI_CTL_OFS;
-		port[1].ioaddr.bmdma_addr = iobase[5] + VND_BMDMA_CH1;
-		break;
-#elif (CONFIG_SYS_SATA_MAX_DEVICE >= 2)
-	case 2:
-		port[2].port_no = 0;
-		port[2].ioaddr.cmd_addr = iobase[5] + VND_TF0_CH2;
-		port[2].ioaddr.altstatus_addr = port[2].ioaddr.ctl_addr =
-		    (iobase[5] + VND_TF2_CH2) | ATA_PCI_CTL_OFS;
-		port[2].ioaddr.bmdma_addr = iobase[5] + VND_BMDMA_CH2;
-		break;
-#elif (CONFIG_SYS_SATA_MAX_DEVICE >= 3)
-	case 3:
-		port[3].port_no = 0;
-		port[3].ioaddr.cmd_addr = iobase[5] + VND_TF0_CH3;
-		port[3].ioaddr.altstatus_addr = port[3].ioaddr.ctl_addr =
-		    (iobase[5] + VND_TF2_CH3) | ATA_PCI_CTL_OFS;
-		port[3].ioaddr.bmdma_addr = iobase[5] + VND_BMDMA_CH3;
-		break;
-#endif
-	default:
-		printf ("Tried to scan unknown port: ata%d\n", dev);
-		return 1;
-	}
-
-	/* Initialize other registers */
-	sata_port (&port[dev].ioaddr);
-
-	/* Check for attached device */
-	if (!sata_bus_probe (dev)) {
-		port[dev].port_state = 0;
-		debug ("SATA#%d port is not present\n", dev);
-	} else {
-		debug ("SATA#%d port is present\n", dev);
-		if (sata_bus_softreset (dev)) {
-			/* soft reset failed, try a hard one */
-			sata_phy_reset (dev);
-			if (sata_bus_softreset (dev)) {
-				port[dev].port_state = 0;
-			} else {
-				port[dev].port_state = 1;
-			}
-		} else {
-			port[dev].port_state = 1;
-		}
-	}
-	if (port[dev].port_state == 1) {
-		/* Probe device and set xfer mode */
-		sata_identify (dev, 0);
-		set_Feature_cmd (dev, 0);
-	}
-
-	return 0;
-}
diff --git a/drivers/ata/sata_sil3114.h b/drivers/ata/sata_sil3114.h
deleted file mode 100644
index a336eb5..0000000
--- a/drivers/ata/sata_sil3114.h
+++ /dev/null
@@ -1,133 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0+ */
-/*
- * Copyright (C) Excito Elektronik i Skåne AB, All rights reserved.
- * Author: Tor Krill <tor@excito.com>
- */
-
-#ifndef SATA_SIL3114_H
-#define SATA_SIL3114_H
-
-struct sata_ioports {
-	unsigned long cmd_addr;
-	unsigned long data_addr;
-	unsigned long error_addr;
-	unsigned long feature_addr;
-	unsigned long nsect_addr;
-	unsigned long lbal_addr;
-	unsigned long lbam_addr;
-	unsigned long lbah_addr;
-	unsigned long device_addr;
-	unsigned long status_addr;
-	unsigned long command_addr;
-	unsigned long altstatus_addr;
-	unsigned long ctl_addr;
-	unsigned long bmdma_addr;
-	unsigned long scr_addr;
-};
-
-struct sata_port {
-	unsigned char port_no;	/* primary=0, secondary=1       */
-	struct sata_ioports ioaddr;	/* ATA cmd/ctl/dma reg blks     */
-	unsigned char ctl_reg;
-	unsigned char last_ctl;
-	unsigned char port_state;	/* 1-port is available and      */
-	/* 0-port is not available      */
-	unsigned char dev_mask;
-};
-
-/* Missing ata defines */
-#define ATA_CMD_STANDBY			0xE2
-#define ATA_CMD_STANDBYNOW1		0xE0
-#define ATA_CMD_IDLE			0xE3
-#define ATA_CMD_IDLEIMMEDIATE	0xE1
-
-/* Defines for SIL3114 chip */
-
-/* PCI defines */
-#define SIL_VEND_ID		0x1095
-#define SIL3114_DEVICE_ID	0x3114
-
-/* some vendor specific registers */
-#define	VND_SYSCONFSTAT	0x88	/* System Configuration Status and Command */
-#define VND_SYSCONFSTAT_CHN_0_INTBLOCK (1<<22)
-#define VND_SYSCONFSTAT_CHN_1_INTBLOCK (1<<23)
-#define VND_SYSCONFSTAT_CHN_2_INTBLOCK (1<<24)
-#define VND_SYSCONFSTAT_CHN_3_INTBLOCK (1<<25)
-
-/* internal registers mapped by BAR5 */
-/* SATA Control*/
-#define VND_SCONTROL_CH0	0x100
-#define VND_SCONTROL_CH1	0x180
-#define VND_SCONTROL_CH2	0x300
-#define VND_SCONTROL_CH3	0x380
-
-#define SATA_SC_IPM_T2P		(1<<16)
-#define SATA_SC_IPM_T2S		(2<<16)
-#define SATA_SC_SPD_1_5		(1<<4)
-#define SATA_SC_SPD_3_0		(2<<4)
-#define SATA_SC_DET_RST		(1)	/* ATA Reset sequence */
-#define SATA_SC_DET_PDIS	(4)	/* PHY Disable */
-
-/* SATA Status */
-#define VND_SSTATUS_CH0		0x104
-#define VND_SSTATUS_CH1		0x184
-#define VND_SSTATUS_CH2		0x304
-#define VND_SSTATUS_CH3		0x384
-
-#define SATA_SS_IPM_ACTIVE	(1<<8)
-#define SATA_SS_IPM_PARTIAL	(2<<8)
-#define SATA_SS_IPM_SLUMBER	(6<<8)
-#define SATA_SS_SPD_1_5		(1<<4)
-#define SATA_SS_SPD_3_0		(2<<4)
-#define SATA_DET_P_NOPHY	(1)	/* Device presence but no PHY connection established */
-#define SATA_DET_PRES		(3)	/* Device presence and active PHY */
-#define SATA_DET_OFFLINE	(4)	/* Device offline or in loopback mode */
-
-/* Task file registers in BAR5 mapping */
-#define VND_TF0_CH0			0x80
-#define VND_TF0_CH1			0xc0
-#define VND_TF0_CH2			0x280
-#define VND_TF0_CH3			0x2c0
-#define VND_TF1_CH0			0x88
-#define VND_TF1_CH1			0xc8
-#define VND_TF1_CH2			0x288
-#define VND_TF1_CH3			0x2c8
-#define VND_TF2_CH0			0x88
-#define VND_TF2_CH1			0xc8
-#define VND_TF2_CH2			0x288
-#define VND_TF2_CH3			0x2c8
-
-#define VND_BMDMA_CH0		0x00
-#define VND_BMDMA_CH1		0x08
-#define VND_BMDMA_CH2		0x200
-#define VND_BMDMA_CH3		0x208
-#define VND_BMDMA2_CH0		0x10
-#define VND_BMDMA2_CH1		0x18
-#define VND_BMDMA2_CH2		0x210
-#define VND_BMDMA2_CH3		0x218
-
-/* FIFO control */
-#define	VND_FIFOCFG_CH0		0x40
-#define	VND_FIFOCFG_CH1		0x44
-#define	VND_FIFOCFG_CH2		0x240
-#define	VND_FIFOCFG_CH3		0x244
-
-/* Task File configuration and status */
-#define VND_TF_CNST_CH0		0xa0
-#define VND_TF_CNST_CH1		0xe0
-#define VND_TF_CNST_CH2		0x2a0
-#define VND_TF_CNST_CH3		0x2e0
-
-#define VND_TF_CNST_BFCMD	(1<<1)
-#define VND_TF_CNST_CHNRST	(1<<2)
-#define VND_TF_CNST_VDMA	(1<<10)
-#define VND_TF_CNST_INTST	(1<<11)
-#define VND_TF_CNST_WDTO	(1<<12)
-#define VND_TF_CNST_WDEN	(1<<13)
-#define VND_TF_CNST_WDIEN	(1<<14)
-
-/* for testing */
-#define VND_SSDR			0x04c	/* System Software Data Register */
-#define VND_FMACS			0x050	/* Flash Memory Address control and status */
-
-#endif
diff --git a/drivers/block/Kconfig b/drivers/block/Kconfig
index 8235430..c54b581 100644
--- a/drivers/block/Kconfig
+++ b/drivers/block/Kconfig
@@ -102,3 +102,107 @@
 	  This allows access to raw blocks and filesystems on an IDE drive
 	  from U-Boot. See also CMD_IDE which provides an 'ide' command for
 	  performing various IDE operations.
+
+if IDE
+
+config SYS_IDE_MAXBUS
+	hex "Maximumm number of IDE buses"
+	default 2
+	help
+	  This is the number of IDE buses provided by the board. Each one
+	  can have one or two devices. One is designated the master and the
+	  other one the slave. It is not required to have one or both on any
+	  controller.
+
+config SYS_IDE_MAXDEVICE
+	hex "Maximum number of IDE devices"
+	default 2
+	help
+	  This is the number of IDE devices which can be connected to the
+	  board. Normally this is 2 * CONFIG_SYS_IDE_MAXBUS since up to two
+	  devices can be connected to each bus. The number of devices actually
+	  connected is determined by probing.
+
+config SYS_ATA_BASE_ADDR
+	hex "Base address of IDE controller"
+	default 0
+	help
+	  This is the address of the IDE controller, from which other addresses
+	  are calculated. Each bus is at a fixed offset from this address,
+	  so it assumed that they are in the same area of the I/O space or
+	  memory.
+
+config SYS_ATA_STRIDE
+	hex "IDE port stride"
+	default 0x1
+	help
+	  This is the distance between each IDE register, in bytes. For an
+	  8-bit controller this is typically 1, meaning that the registers
+	  appear at consecutive bytes. If the value 2 two, that might indicate
+	  a 16-bit register space.
+
+config SYS_ATA_DATA_OFFSET
+	hex "Offset of the data register"
+	default 0x0
+	help
+	  This is the offset of the controller's data register from the base
+	  address of the controller. This is typically 0, but may be something
+	  else if there are some other registers at the start of the
+	  controller space.
+
+config SYS_ATA_REG_OFFSET
+	hex "Offset of the register space"
+	default 0x0
+	help
+	  This is the offset of the controller's 'register' space from the base
+	  address of the controller. The data register (which is typically at
+	  offset 0) has its own CONFIG, to deal with controllers where it is
+	  somewhere else. Register 1 will be at this offset + 1, register 2 at
+	  CONFIG_SYS_ATA_REG_OFFSET + 2, etc.
+
+config SYS_ATA_ALT_OFFSET
+	hex "Offset of the alternative registers"
+	default 0x0
+	help
+	  This is the offset of the controller's 'alternative' space from the
+	  base address of the controller. This allows these registers to be
+	  located separately from the data and register space.
+
+config SYS_ATA_IDE0_OFFSET
+	hex "Offset of bus 0"
+	default 0x1f0
+	help
+	  This is the start offset of bus 0 from the start of the
+	  controller registers. All the other registers are calculated from
+	  this address. using the above options. For x86 hardware this is often
+	  0x1f0.
+
+config SYS_ATA_IDE1_OFFSET
+	hex "Offset of bus 1"
+	default 0x170
+	help
+	  This is the start offset of bus 1 from the start of the
+	  controller registers. All the other registers are calculated from
+	  this address. using the above options. For x86 hardware this is often
+	  0x170.
+
+config ATAPI
+	bool "Enable ATAPI support"
+	help
+	  This enabled Advanced Technology Attachment Packet Interface (ATAPI),
+	  a protocol that allows a greater variety of devices to be connected
+	  to the IDE port than with plain ATA. It allows SCSI commands to be
+	  sent across the bus, e.g. to support optical drives.
+
+config IDE_RESET
+	bool "Support board-specific reset"
+	help
+	  If this is defined, IDE Reset will be performed by calling the
+	  function:
+
+	     ide_set_reset(int reset)
+
+	  where reset is 1 to assert reset and 0 to de-assert it. This function
+	  must be defined in a board-specific file.
+
+endif  # IDE
diff --git a/drivers/block/ide.c b/drivers/block/ide.c
index 085aa35..63c4cfd 100644
--- a/drivers/block/ide.c
+++ b/drivers/block/ide.c
@@ -676,28 +676,14 @@
 	debug("ide_outb (dev= %d, port= 0x%x, val= 0x%02x) : @ 0x%08lx\n",
 	      dev, port, val, ATA_CURR_BASE(dev) + port);
 
-#if defined(CONFIG_IDE_AHB)
-	if (port) {
-		/* write command */
-		ide_write_register(dev, port, val);
-	} else {
-		/* write data */
-		outb(val, (ATA_CURR_BASE(dev)));
-	}
-#else
 	outb(val, ATA_CURR_BASE(dev) + port);
-#endif
 }
 
 __weak unsigned char ide_inb(int dev, int port)
 {
 	uchar val;
 
-#if defined(CONFIG_IDE_AHB)
-	val = ide_read_register(dev, port);
-#else
 	val = inb(ATA_CURR_BASE(dev) + port);
-#endif
 
 	debug("ide_inb (dev= %d, port= 0x%x) : @ 0x%08lx -> 0x%02x\n",
 	      dev, port, ATA_CURR_BASE(dev) + port, val);
@@ -824,9 +810,6 @@
 
 __weak void ide_output_data(int dev, const ulong *sect_buf, int words)
 {
-#if defined(CONFIG_IDE_AHB)
-	ide_write_data(dev, sect_buf, words);
-#else
 	uintptr_t paddr = (ATA_CURR_BASE(dev) + ATA_DATA_REG);
 	ushort *dbuf;
 
@@ -837,14 +820,10 @@
 		EIEIO;
 		outw(cpu_to_le16(*dbuf++), paddr);
 	}
-#endif /* CONFIG_IDE_AHB */
 }
 
 __weak void ide_input_data(int dev, ulong *sect_buf, int words)
 {
-#if defined(CONFIG_IDE_AHB)
-	ide_read_data(dev, sect_buf, words);
-#else
 	uintptr_t paddr = (ATA_CURR_BASE(dev) + ATA_DATA_REG);
 	ushort *dbuf;
 
@@ -858,7 +837,6 @@
 		EIEIO;
 		*dbuf++ = le16_to_cpu(inw(paddr));
 	}
-#endif /* CONFIG_IDE_AHB */
 }
 
 #ifdef CONFIG_BLK
diff --git a/drivers/mmc/fsl_esdhc_imx.c b/drivers/mmc/fsl_esdhc_imx.c
index 9299635..32b42c3 100644
--- a/drivers/mmc/fsl_esdhc_imx.c
+++ b/drivers/mmc/fsl_esdhc_imx.c
@@ -336,9 +336,8 @@
 		}
 	}
 
-	if (IS_ENABLED(CONFIG_SYS_FSL_ESDHC_USE_PIO))
-		esdhc_setup_watermark_level(priv, data);
-	else
+	esdhc_setup_watermark_level(priv, data);
+	if (!IS_ENABLED(CONFIG_SYS_FSL_ESDHC_USE_PIO))
 		esdhc_setup_dma(priv, data);
 
 	/* Calculate the timeout period for data transactions */
@@ -453,7 +452,7 @@
 
 	/* Send the command */
 	esdhc_write32(&regs->cmdarg, cmd->cmdarg);
-	if IS_ENABLED(CONFIG_FSL_USDHC) {
+	if (IS_ENABLED(CONFIG_FSL_USDHC)) {
 		u32 mixctrl = esdhc_read32(&regs->mixctrl);
 
 		esdhc_write32(&regs->mixctrl,
diff --git a/drivers/scsi/Kconfig b/drivers/scsi/Kconfig
index 3c826c9..c400e2d 100644
--- a/drivers/scsi/Kconfig
+++ b/drivers/scsi/Kconfig
@@ -16,3 +16,33 @@
 	  which supports SCSI and SATA HDDs. For every device configuration
 	  (IDs/LUNs) a block device is created with RAW read/write and
 	  filesystem support.
+
+if SCSI && !DM_SCSI
+
+config SCSI_AHCI_PLAT
+	bool "Platform-specific init of AHCI"
+	help
+	  This enables a way for boards to set up an AHCI device manually, by
+	  called ahci_init() and providing an ahci_reset() mechanism.
+
+	  This is deprecated. An AHCI driver should be provided instead.
+
+config SYS_SCSI_MAX_SCSI_ID
+	int "Maximum supporedt SCSI ID"
+	default 1
+	help
+	  Sets the maximum number of SCSI IDs to scan when looking for devices.
+	  IDs from 0 to (this value - 1) are scanned.
+
+	  This is deprecated and is not needed when BLK is enabled.
+
+config SYS_SCSI_MAX_LUN
+	int "Maximum support SCSI LUN"
+	default 1
+	help
+	  Sets the maximum number of SCSI Logical Unit Numbers (LUNs) to scan on
+	  devices. LUNs from 0 to (this value - 1) are scanned.
+
+	  This is deprecated and is not needed when CONFIG_DM_SCSI is enabled.
+
+endif
diff --git a/drivers/scsi/Makefile b/drivers/scsi/Makefile
index e9f8486..25194ee 100644
--- a/drivers/scsi/Makefile
+++ b/drivers/scsi/Makefile
@@ -15,4 +15,6 @@
 endif
 endif
 
+ifdef CONFIG_SCSI
 obj-$(CONFIG_SANDBOX) += sandbox_scsi.o
+endif
diff --git a/drivers/scsi/scsi.c b/drivers/scsi/scsi.c
index d93d241..d7b3301 100644
--- a/drivers/scsi/scsi.c
+++ b/drivers/scsi/scsi.c
@@ -46,7 +46,7 @@
 
 static int scsi_curr_dev; /* current device */
 
-static struct blk_desc scsi_dev_desc[CONFIG_SYS_SCSI_MAX_DEVICE];
+static struct blk_desc scsi_dev_desc[SCSI_MAX_DEVICE];
 #endif
 
 /* almost the maximum amount of the scsi_ext command.. */
@@ -655,7 +655,7 @@
 
 	if (verbose)
 		printf("scanning bus for devices...\n");
-	for (i = 0; i < CONFIG_SYS_SCSI_MAX_DEVICE; i++)
+	for (i = 0; i < SCSI_MAX_DEVICE; i++)
 		scsi_init_dev_desc(&scsi_dev_desc[i], i);
 
 	scsi_max_devs = 0;
@@ -703,7 +703,7 @@
 U_BOOT_LEGACY_BLK(scsi) = {
 	.if_typename	= "scsi",
 	.if_type	= IF_TYPE_SCSI,
-	.max_devs	= CONFIG_SYS_SCSI_MAX_DEVICE,
+	.max_devs	= SCSI_MAX_DEVICE,
 	.desc		= scsi_dev_desc,
 };
 #endif
diff --git a/drivers/serial/serial-uclass.c b/drivers/serial/serial-uclass.c
index 96a1cb6..362cedd 100644
--- a/drivers/serial/serial-uclass.c
+++ b/drivers/serial/serial-uclass.c
@@ -357,7 +357,6 @@
 {
 	_serial_putc(sdev->priv, ch);
 }
-#endif
 
 static void serial_stub_puts(struct stdio_dev *sdev, const char *str)
 {
@@ -374,6 +373,7 @@
 	return _serial_tstc(sdev->priv);
 }
 #endif
+#endif
 
 /**
  * on_baudrate() - Update the actual baudrate when the env var changes
diff --git a/drivers/serial/serial_nulldev.c b/drivers/serial/serial_nulldev.c
index efae14d..f3ca7f5 100644
--- a/drivers/serial/serial_nulldev.c
+++ b/drivers/serial/serial_nulldev.c
@@ -22,11 +22,6 @@
 	return 0;
 }
 
-static int nulldev_serial_input(struct udevice *dev)
-{
-	return 0;
-}
-
 static int nulldev_serial_putc(struct udevice *dev, const char ch)
 {
 	return 0;
diff --git a/dts/Kconfig b/dts/Kconfig
index 4de1a70..b19912d 100644
--- a/dts/Kconfig
+++ b/dts/Kconfig
@@ -157,8 +157,8 @@
 	  .dtsi files that will also be used.
 
 config OF_LIST
-	string "List of device tree files to include for DT control"
-	depends on SPL_LOAD_FIT || MULTI_DTB_FIT
+	string "List of device tree files to include for DT control" if SPL_LOAD_FIT || MULTI_DTB_FIT
+	depends on OF_CONTROL
 	default DEFAULT_DEVICE_TREE
 	help
 	  This option specifies a list of device tree files to use for DT
@@ -264,8 +264,8 @@
 	  capabilities, pad configurations).
 
 config SPL_OF_LIST
-	string "List of device tree files to include for DT control in SPL"
-	depends on SPL_MULTI_DTB_FIT
+	string "List of device tree files to include for DT control in SPL" if SPL_MULTI_DTB_FIT
+	depends on SPL_OF_CONTROL
 	default OF_LIST
 	help
 	  This option specifies a list of device tree files to use for DT
diff --git a/include/ata.h b/include/ata.h
index 32ad5f6..a7bcee6 100644
--- a/include/ata.h
+++ b/include/ata.h
@@ -19,9 +19,6 @@
  * 8-bit (register) and 16-bit (data) accesses might use different
  * address spaces. This is implemented by the following definitions.
  */
-#ifndef CONFIG_SYS_ATA_STRIDE
-#define CONFIG_SYS_ATA_STRIDE	1
-#endif
 
 #define ATA_IO_DATA(x)	(CONFIG_SYS_ATA_DATA_OFFSET+((x) * CONFIG_SYS_ATA_STRIDE))
 #define ATA_IO_REG(x)	(CONFIG_SYS_ATA_REG_OFFSET +((x) * CONFIG_SYS_ATA_STRIDE))
diff --git a/include/bloblist.h b/include/bloblist.h
index 173129b..d0e128a 100644
--- a/include/bloblist.h
+++ b/include/bloblist.h
@@ -147,16 +147,6 @@
 	u32 spare;
 };
 
-/* access CONFIG_BLOBLIST_ADDR, dealing with it possibly not being defined */
-static inline ulong bloblist_addr(void)
-{
-#ifdef CONFIG_BLOBLIST_FIXED
-	return CONFIG_BLOBLIST_ADDR;
-#else
-	return 0;
-#endif
-}
-
 /**
  * bloblist_check_magic() - return a bloblist if the magic matches
  *
diff --git a/include/configs/M5253DEMO.h b/include/configs/M5253DEMO.h
index 6ba5c52..c27f0a5 100644
--- a/include/configs/M5253DEMO.h
+++ b/include/configs/M5253DEMO.h
@@ -23,21 +23,8 @@
 
 #ifdef CONFIG_IDE
 /* ATA */
-#	define CONFIG_IDE_RESET		1
 #	define CONFIG_IDE_PREINIT	1
-#	define CONFIG_ATAPI
 #	undef CONFIG_LBA48
-
-#	define CONFIG_SYS_IDE_MAXBUS		1
-#	define CONFIG_SYS_IDE_MAXDEVICE	2
-
-#	define CONFIG_SYS_ATA_BASE_ADDR	(CONFIG_SYS_MBAR2 + 0x800)
-#	define CONFIG_SYS_ATA_IDE0_OFFSET	0
-
-#	define CONFIG_SYS_ATA_DATA_OFFSET	0xA0	/* Offset for data I/O */
-#	define CONFIG_SYS_ATA_REG_OFFSET	0xA0	/* Offset for normal register accesses */
-#	define CONFIG_SYS_ATA_ALT_OFFSET	0xC0	/* Offset for alternate registers */
-#	define CONFIG_SYS_ATA_STRIDE		4	/* Interval between registers */
 #endif
 
 #define CONFIG_DRIVER_DM9000
diff --git a/include/configs/MPC837XERDB.h b/include/configs/MPC837XERDB.h
index 977d96a..538d9c2 100644
--- a/include/configs/MPC837XERDB.h
+++ b/include/configs/MPC837XERDB.h
@@ -275,7 +275,6 @@
 /*
  * SATA
  */
-#define CONFIG_SYS_SATA_MAX_DEVICE	2
 #define CONFIG_SATA1
 #define CONFIG_SYS_SATA1_OFFSET	0x18000
 #define CONFIG_SYS_SATA1	(CONFIG_SYS_IMMR + CONFIG_SYS_SATA1_OFFSET)
diff --git a/include/configs/P1010RDB.h b/include/configs/P1010RDB.h
index 23b9969..106d1e6 100644
--- a/include/configs/P1010RDB.h
+++ b/include/configs/P1010RDB.h
@@ -544,7 +544,6 @@
 #define CONFIG_FSL_SATA_V2
 
 #ifdef CONFIG_FSL_SATA
-#define CONFIG_SYS_SATA_MAX_DEVICE	2
 #define CONFIG_SATA1
 #define CONFIG_SYS_SATA1		CONFIG_SYS_MPC85xx_SATA1_ADDR
 #define CONFIG_SYS_SATA1_FLAGS		FLAGS_DMA
diff --git a/include/configs/P2041RDB.h b/include/configs/P2041RDB.h
index ceaed46..e6d5321 100644
--- a/include/configs/P2041RDB.h
+++ b/include/configs/P2041RDB.h
@@ -349,7 +349,6 @@
 #define CONFIG_FSL_SATA_V2
 
 #ifdef CONFIG_FSL_SATA_V2
-#define CONFIG_SYS_SATA_MAX_DEVICE	2
 #define CONFIG_SATA1
 #define CONFIG_SYS_SATA1		CONFIG_SYS_MPC85xx_SATA1_ADDR
 #define CONFIG_SYS_SATA1_FLAGS		FLAGS_DMA
diff --git a/include/configs/P4080DS.h b/include/configs/P4080DS.h
index ed88b41..8a0c703 100644
--- a/include/configs/P4080DS.h
+++ b/include/configs/P4080DS.h
@@ -11,7 +11,6 @@
 
 #define CONFIG_PCIE3
 
-#define CONFIG_SYS_SATA_MAX_DEVICE  2
 #define CONFIG_LBA48
 
 #define CONFIG_SYS_SRIO
diff --git a/include/configs/T104xRDB.h b/include/configs/T104xRDB.h
index f60010f..9433f14 100644
--- a/include/configs/T104xRDB.h
+++ b/include/configs/T104xRDB.h
@@ -438,7 +438,6 @@
 /* SATA */
 #define CONFIG_FSL_SATA_V2
 #ifdef CONFIG_FSL_SATA_V2
-#define CONFIG_SYS_SATA_MAX_DEVICE	1
 #define CONFIG_SATA1
 #define CONFIG_SYS_SATA1		CONFIG_SYS_MPC85xx_SATA1_ADDR
 #define CONFIG_SYS_SATA1_FLAGS		FLAGS_DMA
diff --git a/include/configs/T208xQDS.h b/include/configs/T208xQDS.h
index f0bdcba..a41f9f0 100644
--- a/include/configs/T208xQDS.h
+++ b/include/configs/T208xQDS.h
@@ -488,7 +488,6 @@
  * SATA
  */
 #ifdef CONFIG_FSL_SATA_V2
-#define CONFIG_SYS_SATA_MAX_DEVICE	2
 #define CONFIG_SATA1
 #define CONFIG_SYS_SATA1		CONFIG_SYS_MPC85xx_SATA1_ADDR
 #define CONFIG_SYS_SATA1_FLAGS		FLAGS_DMA
diff --git a/include/configs/T208xRDB.h b/include/configs/T208xRDB.h
index 86dc5bf..7165ba0 100644
--- a/include/configs/T208xRDB.h
+++ b/include/configs/T208xRDB.h
@@ -443,7 +443,6 @@
  * SATA
  */
 #ifdef CONFIG_FSL_SATA_V2
-#define CONFIG_SYS_SATA_MAX_DEVICE	2
 #define CONFIG_SATA1
 #define CONFIG_SYS_SATA1		CONFIG_SYS_MPC85xx_SATA1_ADDR
 #define CONFIG_SYS_SATA1_FLAGS		FLAGS_DMA
diff --git a/include/configs/T4240RDB.h b/include/configs/T4240RDB.h
index 6923774..daccd81 100644
--- a/include/configs/T4240RDB.h
+++ b/include/configs/T4240RDB.h
@@ -180,7 +180,6 @@
 
 /* SATA */
 #ifdef CONFIG_FSL_SATA_V2
-#define CONFIG_SYS_SATA_MAX_DEVICE	2
 #define CONFIG_SATA1
 #define CONFIG_SYS_SATA1		CONFIG_SYS_MPC85xx_SATA1_ADDR
 #define CONFIG_SYS_SATA1_FLAGS		FLAGS_DMA
@@ -466,7 +465,6 @@
 
 /* SATA */
 #ifdef CONFIG_FSL_SATA_V2
-#define CONFIG_SYS_SATA_MAX_DEVICE	2
 #define CONFIG_SATA1
 #define CONFIG_SYS_SATA1		CONFIG_SYS_MPC85xx_SATA1_ADDR
 #define CONFIG_SYS_SATA1_FLAGS		FLAGS_DMA
diff --git a/include/configs/am57xx_evm.h b/include/configs/am57xx_evm.h
index 9568444..ff0498a 100644
--- a/include/configs/am57xx_evm.h
+++ b/include/configs/am57xx_evm.h
@@ -48,13 +48,6 @@
 #define CONFIG_NET_RETRY_COUNT		10
 #define PHY_ANEG_TIMEOUT	8000	/* PHY needs longer aneg time at 1G */
 
-/* SATA */
-#define CONFIG_SCSI_AHCI_PLAT
-#define CONFIG_SYS_SCSI_MAX_SCSI_ID	1
-#define CONFIG_SYS_SCSI_MAX_LUN		1
-#define CONFIG_SYS_SCSI_MAX_DEVICE	(CONFIG_SYS_SCSI_MAX_SCSI_ID * \
-						CONFIG_SYS_SCSI_MAX_LUN)
-
 /*
  * Default to using SPI for environment, etc.
  * 0x000000 - 0x040000 : QSPI.SPL (256KiB)
diff --git a/include/configs/apalis-imx8.h b/include/configs/apalis-imx8.h
index c2b0d6f..c87bcd4 100644
--- a/include/configs/apalis-imx8.h
+++ b/include/configs/apalis-imx8.h
@@ -9,8 +9,6 @@
 #include <asm/arch/imx-regs.h>
 #include <linux/sizes.h>
 
-#define CONFIG_REMAKE_ELF
-
 #define CONFIG_SYS_FSL_ESDHC_ADDR	0
 #define USDHC1_BASE_ADDR		0x5b010000
 #define USDHC2_BASE_ADDR		0x5b020000
diff --git a/include/configs/apalis-imx8x.h b/include/configs/apalis-imx8x.h
index 402fed1..8a6f294 100644
--- a/include/configs/apalis-imx8x.h
+++ b/include/configs/apalis-imx8x.h
@@ -10,8 +10,6 @@
 #include <linux/sizes.h>
 #include <linux/stringify.h>
 
-#define CONFIG_REMAKE_ELF
-
 #define CONFIG_SYS_FSL_ESDHC_ADDR	0
 #define USDHC1_BASE_ADDR		0x5b010000
 #define USDHC2_BASE_ADDR		0x5b020000
diff --git a/include/configs/capricorn-common.h b/include/configs/capricorn-common.h
index 1cde5f7..70689a6 100644
--- a/include/configs/capricorn-common.h
+++ b/include/configs/capricorn-common.h
@@ -32,8 +32,6 @@
 
 #define CONFIG_FACTORYSET
 
-#define CONFIG_REMAKE_ELF
-
 /* ENET Config */
 #define CONFIG_FEC_XCV_TYPE		RMII
 
diff --git a/include/configs/cgtqmx8.h b/include/configs/cgtqmx8.h
index d5549f6..ce36b2e 100644
--- a/include/configs/cgtqmx8.h
+++ b/include/configs/cgtqmx8.h
@@ -28,8 +28,6 @@
 #define CONFIG_SPL_ABORT_ON_RAW_IMAGE
 #endif
 
-#define CONFIG_REMAKE_ELF
-
 /* Flat Device Tree Definitions */
 
 #define CONFIG_SYS_BOOTMAPSZ		(256 << 20)
diff --git a/include/configs/clearfog.h b/include/configs/clearfog.h
index c9af5a4..871e87c 100644
--- a/include/configs/clearfog.h
+++ b/include/configs/clearfog.h
@@ -35,15 +35,6 @@
 #define CONFIG_PCI_SCAN_SHOW
 #endif
 
-/* SATA support */
-#ifdef CONFIG_SCSI
-#define CONFIG_SCSI_AHCI_PLAT
-#define CONFIG_SYS_SCSI_MAX_SCSI_ID	1
-#define CONFIG_SYS_SCSI_MAX_LUN		1
-#define CONFIG_SYS_SCSI_MAX_DEVICE	(CONFIG_SYS_SCSI_MAX_SCSI_ID * \
-					CONFIG_SYS_SCSI_MAX_LUN)
-#endif
-
 /* Keep device tree and initrd in lower memory so the kernel can access them */
 #define RELOCATION_LIMITS_ENV_SETTINGS	\
 	"fdt_high=0x10000000\0"		\
diff --git a/include/configs/cm_fx6.h b/include/configs/cm_fx6.h
index 40bc821..c19aaac 100644
--- a/include/configs/cm_fx6.h
+++ b/include/configs/cm_fx6.h
@@ -160,7 +160,6 @@
 #define CONFIG_EHCI_HCD_INIT_AFTER_RESET	/* For OTG port */
 
 /* SATA */
-#define CONFIG_SYS_SATA_MAX_DEVICE	1
 #define CONFIG_LBA48
 #define CONFIG_DWC_AHSATA_PORT_ID	0
 #define CONFIG_DWC_AHSATA_BASE_ADDR	SATA_ARB_BASE_ADDR
diff --git a/include/configs/colibri-imx8x.h b/include/configs/colibri-imx8x.h
index 0118250..008fa6e 100644
--- a/include/configs/colibri-imx8x.h
+++ b/include/configs/colibri-imx8x.h
@@ -10,8 +10,6 @@
 #include <linux/sizes.h>
 #include <linux/stringify.h>
 
-#define CONFIG_REMAKE_ELF
-
 #define CONFIG_SYS_FSL_ESDHC_ADDR	0
 #define USDHC1_BASE_ADDR		0x5b010000
 #define USDHC2_BASE_ADDR		0x5b020000
diff --git a/include/configs/comtrend_ar5315u.h b/include/configs/comtrend_ar5315u.h
index 9f4b4e2..7bfc8bb 100644
--- a/include/configs/comtrend_ar5315u.h
+++ b/include/configs/comtrend_ar5315u.h
@@ -6,4 +6,3 @@
 #include <configs/bmips_common.h>
 #include <configs/bmips_bcm6318.h>
 
-#define CONFIG_REMAKE_ELF
diff --git a/include/configs/comtrend_ar5387un.h b/include/configs/comtrend_ar5387un.h
index 888a6d8..36d6a7f 100644
--- a/include/configs/comtrend_ar5387un.h
+++ b/include/configs/comtrend_ar5387un.h
@@ -6,4 +6,3 @@
 #include <configs/bmips_common.h>
 #include <configs/bmips_bcm6328.h>
 
-#define CONFIG_REMAKE_ELF
diff --git a/include/configs/comtrend_ct5361.h b/include/configs/comtrend_ct5361.h
index 10e2969..1ac1075 100644
--- a/include/configs/comtrend_ct5361.h
+++ b/include/configs/comtrend_ct5361.h
@@ -6,4 +6,3 @@
 #include <configs/bmips_common.h>
 #include <configs/bmips_bcm6348.h>
 
-#define CONFIG_REMAKE_ELF
diff --git a/include/configs/comtrend_vr3032u.h b/include/configs/comtrend_vr3032u.h
index ee29f70..a46b394 100644
--- a/include/configs/comtrend_vr3032u.h
+++ b/include/configs/comtrend_vr3032u.h
@@ -6,8 +6,6 @@
 #include <configs/bmips_common.h>
 #include <configs/bmips_bcm63268.h>
 
-#define CONFIG_REMAKE_ELF
-
 #ifdef CONFIG_MTD_RAW_NAND
 #define CONFIG_SYS_MAX_NAND_DEVICE	1
 #endif /* CONFIG_MTD_RAW_NAND */
diff --git a/include/configs/comtrend_wap5813n.h b/include/configs/comtrend_wap5813n.h
index f786c46..d9d3128 100644
--- a/include/configs/comtrend_wap5813n.h
+++ b/include/configs/comtrend_wap5813n.h
@@ -6,4 +6,3 @@
 #include <configs/bmips_common.h>
 #include <configs/bmips_bcm6368.h>
 
-#define CONFIG_REMAKE_ELF
diff --git a/include/configs/controlcenterdc.h b/include/configs/controlcenterdc.h
index ff385d9..7fb96e8 100644
--- a/include/configs/controlcenterdc.h
+++ b/include/configs/controlcenterdc.h
@@ -18,15 +18,6 @@
  * U-Boot into it.
  */
 
-/*
- * SATA/SCSI/AHCI configuration
- */
-#define CONFIG_SCSI_AHCI_PLAT
-#define CONFIG_SYS_SCSI_MAX_SCSI_ID	2
-#define CONFIG_SYS_SCSI_MAX_LUN		1
-#define CONFIG_SYS_SCSI_MAX_DEVICE	(CONFIG_SYS_SCSI_MAX_SCSI_ID * \
-					 CONFIG_SYS_SCSI_MAX_LUN)
-
 /* Environment in SPI NOR flash */
 
 #define PHY_ANEG_TIMEOUT	8000	/* PHY needs a longer aneg time */
diff --git a/include/configs/coreboot.h b/include/configs/coreboot.h
index d6d679f..23c493b 100644
--- a/include/configs/coreboot.h
+++ b/include/configs/coreboot.h
@@ -22,14 +22,5 @@
 					"stderr=serial,vidconsole\0"
 
 /* ATA/IDE support */
-#define CONFIG_SYS_IDE_MAXBUS		2
-#define CONFIG_SYS_IDE_MAXDEVICE	4
-#define CONFIG_SYS_ATA_BASE_ADDR	0
-#define CONFIG_SYS_ATA_DATA_OFFSET	0
-#define CONFIG_SYS_ATA_REG_OFFSET	0
-#define CONFIG_SYS_ATA_ALT_OFFSET	0
-#define CONFIG_SYS_ATA_IDE0_OFFSET	0x1f0
-#define CONFIG_SYS_ATA_IDE1_OFFSET	0x170
-#define CONFIG_ATAPI
 
 #endif	/* __CONFIG_H */
diff --git a/include/configs/corenet_ds.h b/include/configs/corenet_ds.h
index 6d272c6..bd26412 100644
--- a/include/configs/corenet_ds.h
+++ b/include/configs/corenet_ds.h
@@ -347,7 +347,6 @@
 
 /* SATA */
 #ifdef CONFIG_FSL_SATA_V2
-#define CONFIG_SYS_SATA_MAX_DEVICE	2
 #define CONFIG_SATA1
 #define CONFIG_SYS_SATA1		CONFIG_SYS_MPC85xx_SATA1_ADDR
 #define CONFIG_SYS_SATA1_FLAGS		FLAGS_DMA
diff --git a/include/configs/db-88f6820-gp.h b/include/configs/db-88f6820-gp.h
index 5f26119..8dc73e8 100644
--- a/include/configs/db-88f6820-gp.h
+++ b/include/configs/db-88f6820-gp.h
@@ -13,15 +13,6 @@
 /* I2C */
 #define CONFIG_I2C_MVTWSI_BASE0		MVEBU_TWSI_BASE
 
-/*
- * SATA/SCSI/AHCI configuration
- */
-#define CONFIG_SCSI_AHCI_PLAT
-#define CONFIG_SYS_SCSI_MAX_SCSI_ID	2
-#define CONFIG_SYS_SCSI_MAX_LUN		1
-#define CONFIG_SYS_SCSI_MAX_DEVICE	(CONFIG_SYS_SCSI_MAX_SCSI_ID * \
-					 CONFIG_SYS_SCSI_MAX_LUN)
-
 /* Environment in SPI NOR flash */
 
 #define PHY_ANEG_TIMEOUT	8000	/* PHY needs a longer aneg time */
diff --git a/include/configs/db-mv784mp-gp.h b/include/configs/db-mv784mp-gp.h
index 449a567..7baae3b 100644
--- a/include/configs/db-mv784mp-gp.h
+++ b/include/configs/db-mv784mp-gp.h
@@ -28,7 +28,6 @@
 #define PHY_ANEG_TIMEOUT	8000	/* PHY needs a longer aneg time */
 
 /* SATA support */
-#define CONFIG_SYS_SATA_MAX_DEVICE	2
 #define CONFIG_LBA48
 
 /* PCIe support */
diff --git a/include/configs/dockstar.h b/include/configs/dockstar.h
index 0ad04ee..736c724 100644
--- a/include/configs/dockstar.h
+++ b/include/configs/dockstar.h
@@ -1,5 +1,6 @@
 /* SPDX-License-Identifier: GPL-2.0+ */
 /*
+ * Copyright (C) 2022  Tony Dinh <mibodhi@gmail.com>
  * Copyright (C) 2010  Eric C. Cooper <ecc@cmu.edu>
  *
  * Based on sheevaplug.h originally written by
@@ -18,21 +19,13 @@
 #include "mv-common.h"
 
 /*
- *  Environment variables configurations
- */
-/*
- * max 4k env size is enough, but in case of nand
- * it has to be rounded to sector size
- */
-
-/*
  * Default environment variables
  */
 
 #define CONFIG_EXTRA_ENV_SETTINGS \
 	"console=console=ttyS0,115200\0" \
 	"mtdids=nand0=orion_nand\0" \
-	"mtdparts="CONFIG_MTDPARTS_DEFAULT \
+	"mtdparts=" CONFIG_MTDPARTS_DEFAULT \
 	"kernel=/boot/uImage\0" \
 	"initrd=/boot/uInitrd\0" \
 	"bootargs_root=ubi.mtd=1 root=ubi0:root rootfstype=ubifs ro\0"
@@ -40,13 +33,10 @@
 /*
  * Ethernet Driver configuration
  */
-#ifdef CONFIG_CMD_NET
 #define CONFIG_MVGBE_PORTS	{1, 0}	/* enable port 0 only */
 #define CONFIG_PHY_BASE_ADR	0
-#endif /* CONFIG_CMD_NET */
-
-/*
- * File system
- */
+#ifdef CONFIG_RESET_PHY_R
+#undef CONFIG_RESET_PHY_R	/* remove legacy reset_phy() */
+#endif
 
 #endif /* _CONFIG_DOCKSTAR_H */
diff --git a/include/configs/dra7xx_evm.h b/include/configs/dra7xx_evm.h
index aec30c4..711e37c 100644
--- a/include/configs/dra7xx_evm.h
+++ b/include/configs/dra7xx_evm.h
@@ -74,9 +74,6 @@
 
 /* SPI SPL */
 
-/* SATA */
-#define CONFIG_SCSI_AHCI_PLAT
-
 /* NAND support */
 #ifdef CONFIG_MTD_RAW_NAND
 /* NAND: device related configs */
diff --git a/include/configs/dragonboard410c.h b/include/configs/dragonboard410c.h
index 624f611..9f765fa 100644
--- a/include/configs/dragonboard410c.h
+++ b/include/configs/dragonboard410c.h
@@ -12,7 +12,6 @@
 #include <asm/arch/sysmap-apq8016.h>
 
 /* Build new ELF image from u-boot.bin (U-Boot + appended DTB) */
-#define CONFIG_REMAKE_ELF
 
 /* Physical Memory Map */
 #define PHYS_SDRAM_1			0x80000000
diff --git a/include/configs/dreamplug.h b/include/configs/dreamplug.h
index beea234..fd12a39 100644
--- a/include/configs/dreamplug.h
+++ b/include/configs/dreamplug.h
@@ -1,7 +1,7 @@
 /* SPDX-License-Identifier: GPL-2.0+ */
 /*
- * (C) Copyright 2011
- * Jason Cooper <u-boot@lakedaemon.net>
+ * (C) Copyright 2022 Tony Dinh <mibodhi@gmail.com>
+ * (C) Copyright 2011 Jason Cooper <u-boot@lakedaemon.net>
  *
  * Based on work by:
  * Marvell Semiconductor <www.marvell.com>
@@ -14,15 +14,6 @@
 #include "mv-common.h"
 
 /*
- *  Environment variables configurations
- */
-
-/*
- * max 4k env size is enough, but in case of nand
- * it has to be rounded to sector size
- */
-
-/*
  * Default environment variables
  */
 
@@ -36,17 +27,15 @@
 /*
  * Ethernet Driver configuration
  */
-#ifdef CONFIG_CMD_NET
 #define CONFIG_MVGBE_PORTS	{1, 1}	/* enable both ports */
 #define CONFIG_PHY_BASE_ADR	0
-#endif /* CONFIG_CMD_NET */
+#ifdef CONFIG_RESET_PHY_R
+#undef CONFIG_RESET_PHY_R	/* remove legacy reset_phy() */
+#endif
 
 /*
  * SATA Driver configuration
  */
-#ifdef CONFIG_SATA
-#define CONFIG_SYS_SATA_MAX_DEVICE	1
 #define CONFIG_LBA48
-#endif /* CONFIG_SATA */
 
 #endif /* _CONFIG_DREAMPLUG_H */
diff --git a/include/configs/durian.h b/include/configs/durian.h
index c0ea42e..f0789d5 100644
--- a/include/configs/durian.h
+++ b/include/configs/durian.h
@@ -18,13 +18,6 @@
 /* PCI CONFIG */
 #define CONFIG_PCI_SCAN_SHOW
 
-/* SCSI */
-#define CONFIG_SYS_SCSI_MAX_SCSI_ID 4
-#define CONFIG_SYS_SCSI_MAX_LUN 1
-#define CONFIG_SYS_SCSI_MAX_DEVICE 128
-#define CONFIG_SCSI_AHCI_PLAT
-#define CONFIG_SYS_SATA_MAX_DEVICE 4
-
 /* BOOT */
 #define CONFIG_SYS_BOOTM_LEN	(60 * 1024 * 1024)
 
diff --git a/include/configs/edminiv2.h b/include/configs/edminiv2.h
index 90e387e..a599722 100644
--- a/include/configs/edminiv2.h
+++ b/include/configs/edminiv2.h
@@ -110,20 +110,12 @@
 #ifdef CONFIG_IDE
 #define __io
 /* Data, registers and alternate blocks are at the same offset */
-#define CONFIG_SYS_ATA_DATA_OFFSET	(0x0100)
-#define CONFIG_SYS_ATA_REG_OFFSET	(0x0100)
-#define CONFIG_SYS_ATA_ALT_OFFSET	(0x0100)
 /* Each 8-bit ATA register is aligned to a 4-bytes address */
-#define CONFIG_SYS_ATA_STRIDE		4
 /* Controller supports 48-bits LBA addressing */
 #define CONFIG_LBA48
 /* A single bus, a single device */
-#define CONFIG_SYS_IDE_MAXBUS		1
-#define CONFIG_SYS_IDE_MAXDEVICE	1
 /* ATA registers base is at SATA controller base */
-#define CONFIG_SYS_ATA_BASE_ADDR	ORION5X_SATA_BASE
 /* ATA bus 0 is orion5x port 1 on ED Mini V2 */
-#define CONFIG_SYS_ATA_IDE0_OFFSET	ORION5X_SATA_PORT1_OFFSET
 /* end of IDE defines */
 #endif /* CMD_IDE */
 
diff --git a/include/configs/efi-x86_payload.h b/include/configs/efi-x86_payload.h
index 1cf5c03..59fad4c 100644
--- a/include/configs/efi-x86_payload.h
+++ b/include/configs/efi-x86_payload.h
@@ -19,14 +19,5 @@
 					"stderr=serial,vidconsole\0"
 
 /* ATA/IDE support */
-#define CONFIG_SYS_IDE_MAXBUS		2
-#define CONFIG_SYS_IDE_MAXDEVICE	4
-#define CONFIG_SYS_ATA_BASE_ADDR	0
-#define CONFIG_SYS_ATA_DATA_OFFSET	0
-#define CONFIG_SYS_ATA_REG_OFFSET	0
-#define CONFIG_SYS_ATA_ALT_OFFSET	0
-#define CONFIG_SYS_ATA_IDE0_OFFSET	0x1f0
-#define CONFIG_SYS_ATA_IDE1_OFFSET	0x170
-#define CONFIG_ATAPI
 
 #endif	/* __CONFIG_H */
diff --git a/include/configs/ge_bx50v3.h b/include/configs/ge_bx50v3.h
index bde14a7..402c5bf 100644
--- a/include/configs/ge_bx50v3.h
+++ b/include/configs/ge_bx50v3.h
@@ -21,7 +21,6 @@
 
 /* SATA Configs */
 #ifdef CONFIG_CMD_SATA
-#define CONFIG_SYS_SATA_MAX_DEVICE	1
 #define CONFIG_DWC_AHSATA_PORT_ID	0
 #define CONFIG_DWC_AHSATA_BASE_ADDR	SATA_ARB_BASE_ADDR
 #define CONFIG_LBA48
diff --git a/include/configs/goflexhome.h b/include/configs/goflexhome.h
index c279579..51e671a 100644
--- a/include/configs/goflexhome.h
+++ b/include/configs/goflexhome.h
@@ -48,7 +48,6 @@
 #endif
 
 /* SATA driver configuration */
-#define CONFIG_SYS_SATA_MAX_DEVICE	1
 #define CONFIG_LBA48
 
 #endif /* _CONFIG_GOFLEXHOME_H */
diff --git a/include/configs/gw_ventana.h b/include/configs/gw_ventana.h
index 8f73c3b..668d00c 100644
--- a/include/configs/gw_ventana.h
+++ b/include/configs/gw_ventana.h
@@ -41,7 +41,6 @@
  * SATA Configs
  */
 #ifdef CONFIG_CMD_SATA
-  #define CONFIG_SYS_SATA_MAX_DEVICE	1
   #define CONFIG_DWC_AHSATA_PORT_ID	0
   #define CONFIG_DWC_AHSATA_BASE_ADDR	SATA_ARB_BASE_ADDR
   #define CONFIG_LBA48
diff --git a/include/configs/helios4.h b/include/configs/helios4.h
index de1ebbf..151ab66 100644
--- a/include/configs/helios4.h
+++ b/include/configs/helios4.h
@@ -35,15 +35,6 @@
 #define CONFIG_PCI_SCAN_SHOW
 #endif
 
-/* SATA support */
-#ifdef CONFIG_SCSI
-#define CONFIG_SCSI_AHCI_PLAT
-#define CONFIG_SYS_SCSI_MAX_SCSI_ID	1
-#define CONFIG_SYS_SCSI_MAX_LUN		1
-#define CONFIG_SYS_SCSI_MAX_DEVICE	(CONFIG_SYS_SCSI_MAX_SCSI_ID * \
-					CONFIG_SYS_SCSI_MAX_LUN)
-#endif
-
 /* Keep device tree and initrd in lower memory so the kernel can access them */
 #define RELOCATION_LIMITS_ENV_SETTINGS	\
 	"fdt_high=0x10000000\0"		\
diff --git a/include/configs/highbank.h b/include/configs/highbank.h
index 4ef3a46..55c874b 100644
--- a/include/configs/highbank.h
+++ b/include/configs/highbank.h
@@ -16,12 +16,6 @@
 
 #define CONFIG_SYS_BOOTCOUNT_LE		/* Use little-endian accessors */
 
-#define CONFIG_SCSI_AHCI_PLAT
-#define CONFIG_SYS_SCSI_MAX_SCSI_ID	5
-#define CONFIG_SYS_SCSI_MAX_LUN		1
-#define CONFIG_SYS_SCSI_MAX_DEVICE	(CONFIG_SYS_SCSI_MAX_SCSI_ID * \
-					CONFIG_SYS_SCSI_MAX_LUN)
-
 #define CONFIG_BOOT_RETRY_TIME		-1
 #define CONFIG_RESET_TO_RETRY
 
diff --git a/include/configs/hikey.h b/include/configs/hikey.h
index 387971c..c5f9bce 100644
--- a/include/configs/hikey.h
+++ b/include/configs/hikey.h
@@ -15,8 +15,6 @@
 
 #define CONFIG_POWER_HI6553
 
-#define CONFIG_REMAKE_ELF
-
 #define CONFIG_SYS_BOOTM_LEN		SZ_64M
 
 /* Physical Memory Map */
diff --git a/include/configs/huawei_hg556a.h b/include/configs/huawei_hg556a.h
index 7c88af0..5400d12 100644
--- a/include/configs/huawei_hg556a.h
+++ b/include/configs/huawei_hg556a.h
@@ -6,4 +6,3 @@
 #include <configs/bmips_common.h>
 #include <configs/bmips_bcm6358.h>
 
-#define CONFIG_REMAKE_ELF
diff --git a/include/configs/ib62x0.h b/include/configs/ib62x0.h
index 9783fd8..2598dea 100644
--- a/include/configs/ib62x0.h
+++ b/include/configs/ib62x0.h
@@ -40,8 +40,6 @@
  */
 #ifdef CONFIG_IDE
 #define __io
-#define CONFIG_SYS_ATA_IDE0_OFFSET	MV_SATA_PORT0_OFFSET
-#define CONFIG_SYS_ATA_IDE1_OFFSET	MV_SATA_PORT1_OFFSET
 #endif /* CONFIG_IDE */
 
 #endif /* _CONFIG_IB62x0_H */
diff --git a/include/configs/iconnect.h b/include/configs/iconnect.h
index f1aad1e..44a4b44 100644
--- a/include/configs/iconnect.h
+++ b/include/configs/iconnect.h
@@ -1,5 +1,6 @@
 /* SPDX-License-Identifier: GPL-2.0+ */
 /*
+ * Copyright (C) 2022 Tony Dinh <mibodhi@gmail.com>
  * (C) Copyright 2009-2012
  * Wojciech Dubowik <wojciech.dubowik@neratec.com>
  * Luka Perkov <luka@openwrt.org>
@@ -10,32 +11,24 @@
 
 #include "mv-common.h"
 
-/*
- * Environment variables configuration
- */
-
-/*
- * Default environment variables
- */
-
 #define CONFIG_EXTRA_ENV_SETTINGS \
 	"console=console=ttyS0,115200\0"	\
 	"mtdids=nand0=orion_nand\0"		\
-	"mtdparts="CONFIG_MTDPARTS_DEFAULT	\
+	"mtdparts=" CONFIG_MTDPARTS_DEFAULT	\
 	"kernel=/boot/uImage\0"			\
 	"bootargs_root=noinitrd ubi.mtd=2 root=ubi0:rootfs rootfstype=ubifs\0"
 
 /*
  * Ethernet driver configuration
+ *
+ * This board has PCIe Wifi card, so allow Ethernet to be disabled
  */
 #ifdef CONFIG_CMD_NET
 #define CONFIG_MVGBE_PORTS	{1, 0}	/* enable port 0 only */
 #define CONFIG_PHY_BASE_ADR	11
-#undef CONFIG_RESET_PHY_R
+#ifdef CONFIG_RESET_PHY_R
+#undef CONFIG_RESET_PHY_R	/* remove legacy reset_phy() */
+#endif
 #endif /* CONFIG_CMD_NET */
 
-/*
- * File system
- */
-
 #endif /* _CONFIG_ICONNECT_H */
diff --git a/include/configs/imx8mn_beacon.h b/include/configs/imx8mn_beacon.h
index 2843535..e2e322b 100644
--- a/include/configs/imx8mn_beacon.h
+++ b/include/configs/imx8mn_beacon.h
@@ -29,8 +29,6 @@
 
 #endif /* CONFIG_SPL_BUILD */
 
-#define CONFIG_REMAKE_ELF
-
 /* Initial environment variables */
 #define CONFIG_EXTRA_ENV_SETTINGS		\
 	"script=boot.scr\0" \
diff --git a/include/configs/imx8mq_cm.h b/include/configs/imx8mq_cm.h
index b099004..d3cf7ab 100644
--- a/include/configs/imx8mq_cm.h
+++ b/include/configs/imx8mq_cm.h
@@ -30,8 +30,6 @@
 
 #endif
 
-#define CONFIG_REMAKE_ELF
-
 /* ENET Config */
 /* ENET1 */
 #if defined(CONFIG_CMD_NET)
diff --git a/include/configs/imx8mq_evk.h b/include/configs/imx8mq_evk.h
index 5f587f7..4aaed3a 100644
--- a/include/configs/imx8mq_evk.h
+++ b/include/configs/imx8mq_evk.h
@@ -35,8 +35,6 @@
 #define CONFIG_POWER_PFUZE100_I2C_ADDR 0x08
 #endif
 
-#define CONFIG_REMAKE_ELF
-
 /* ENET Config */
 /* ENET1 */
 #if defined(CONFIG_CMD_NET)
diff --git a/include/configs/imx8mq_phanbell.h b/include/configs/imx8mq_phanbell.h
index 1668ca8..16a2c2c 100644
--- a/include/configs/imx8mq_phanbell.h
+++ b/include/configs/imx8mq_phanbell.h
@@ -29,8 +29,6 @@
 #undef CONFIG_DM_MMC
 #endif
 
-#define CONFIG_REMAKE_ELF
-
 /* ENET Config */
 /* ENET1 */
 #if defined(CONFIG_CMD_NET)
diff --git a/include/configs/imx8qm_mek.h b/include/configs/imx8qm_mek.h
index 884d741..c12f383 100644
--- a/include/configs/imx8qm_mek.h
+++ b/include/configs/imx8qm_mek.h
@@ -29,8 +29,6 @@
 #define CONFIG_SPL_ABORT_ON_RAW_IMAGE
 #endif
 
-#define CONFIG_REMAKE_ELF
-
 #define CONFIG_SYS_FSL_ESDHC_ADDR       0
 #define USDHC1_BASE_ADDR                0x5B010000
 #define USDHC2_BASE_ADDR                0x5B020000
diff --git a/include/configs/imx8qm_rom7720.h b/include/configs/imx8qm_rom7720.h
index 973793f..5fcc963 100644
--- a/include/configs/imx8qm_rom7720.h
+++ b/include/configs/imx8qm_rom7720.h
@@ -9,7 +9,6 @@
 #include <linux/sizes.h>
 #include <linux/stringify.h>
 #include <asm/arch/imx-regs.h>
-#define CONFIG_REMAKE_ELF
 
 #define CONFIG_SPL_MAX_SIZE		(124 * 1024)
 #define CONFIG_SPL_BSS_START_ADDR	0x00128000
diff --git a/include/configs/imx8qxp_mek.h b/include/configs/imx8qxp_mek.h
index 3900ef1..b1c51e7 100644
--- a/include/configs/imx8qxp_mek.h
+++ b/include/configs/imx8qxp_mek.h
@@ -27,8 +27,6 @@
 #define CONFIG_SPL_ABORT_ON_RAW_IMAGE
 #endif
 
-#define CONFIG_REMAKE_ELF
-
 #define CONFIG_SYS_FSL_ESDHC_ADDR       0
 #define USDHC1_BASE_ADDR                0x5B010000
 #define USDHC2_BASE_ADDR                0x5B020000
diff --git a/include/configs/imx8ulp_evk.h b/include/configs/imx8ulp_evk.h
index 6b25b48..7da6802 100644
--- a/include/configs/imx8ulp_evk.h
+++ b/include/configs/imx8ulp_evk.h
@@ -27,8 +27,6 @@
 
 #endif
 
-#define CONFIG_REMAKE_ELF
-
 /* ENET Config */
 #if defined(CONFIG_FEC_MXC)
 #define CONFIG_ETHPRIME                 "FEC"
diff --git a/include/configs/lacie_kw.h b/include/configs/lacie_kw.h
index 046f188..0a988e2 100644
--- a/include/configs/lacie_kw.h
+++ b/include/configs/lacie_kw.h
@@ -9,8 +9,6 @@
 #include "mv-common.h"
 
 /* Remove or override few declarations from mv-common.h */
-#undef CONFIG_SYS_IDE_MAXBUS
-#undef CONFIG_SYS_IDE_MAXDEVICE
 
 /*
  * Enable platform initialisation via misc_init_r() function
@@ -32,9 +30,6 @@
 #define CONFIG_LBA48
 #if defined(CONFIG_NETSPACE_MAX_V2) || defined(CONFIG_D2NET_V2) || \
 	defined(CONFIG_NET2BIG_V2)
-#define CONFIG_SYS_SATA_MAX_DEVICE	2
-#else
-#define CONFIG_SYS_SATA_MAX_DEVICE	1
 #endif
 #endif /* CONFIG_SATA */
 
diff --git a/include/configs/ls1012a2g5rdb.h b/include/configs/ls1012a2g5rdb.h
index bda4283..0263bb8 100644
--- a/include/configs/ls1012a2g5rdb.h
+++ b/include/configs/ls1012a2g5rdb.h
@@ -14,15 +14,9 @@
 #define CONFIG_SYS_SDRAM_SIZE		0x40000000
 
 /* SATA */
-#define CONFIG_SCSI_AHCI_PLAT
 
 #define CONFIG_SYS_SATA				AHCI_BASE_ADDR
 
-#define CONFIG_SYS_SCSI_MAX_SCSI_ID		1
-#define CONFIG_SYS_SCSI_MAX_LUN			1
-#define CONFIG_SYS_SCSI_MAX_DEVICE		(CONFIG_SYS_SCSI_MAX_SCSI_ID * \
-						CONFIG_SYS_SCSI_MAX_LUN)
-
 #undef CONFIG_EXTRA_ENV_SETTINGS
 #define CONFIG_EXTRA_ENV_SETTINGS		\
 	"verify=no\0"				\
diff --git a/include/configs/ls1012a_common.h b/include/configs/ls1012a_common.h
index 5d56100..f92ff17 100644
--- a/include/configs/ls1012a_common.h
+++ b/include/configs/ls1012a_common.h
@@ -31,15 +31,9 @@
 #define CONFIG_SYS_FSL_QSPI_BASE	0x40000000
 
 /* SATA */
-#define CONFIG_SCSI_AHCI_PLAT
 
 #define CONFIG_SYS_SATA				AHCI_BASE_ADDR
 
-#define CONFIG_SYS_SCSI_MAX_SCSI_ID		1
-#define CONFIG_SYS_SCSI_MAX_LUN			1
-#define CONFIG_SYS_SCSI_MAX_DEVICE		(CONFIG_SYS_SCSI_MAX_SCSI_ID * \
-						CONFIG_SYS_SCSI_MAX_LUN)
-
 /* I2C */
 
 /* GPIO */
diff --git a/include/configs/ls1021aiot.h b/include/configs/ls1021aiot.h
index 7b4044f..2e5b804 100644
--- a/include/configs/ls1021aiot.h
+++ b/include/configs/ls1021aiot.h
@@ -81,18 +81,12 @@
  */
 
 /* SATA */
-#define CONFIG_SCSI_AHCI_PLAT
 #ifndef PCI_DEVICE_ID_FREESCALE_AHCI
 #define PCI_DEVICE_ID_FREESCALE_AHCI	0x0440
 #endif
 #define CONFIG_SCSI_DEV_LIST		{PCI_VENDOR_ID_FREESCALE, \
 	PCI_DEVICE_ID_FREESCALE_AHCI}
 
-#define CONFIG_SYS_SCSI_MAX_SCSI_ID	1
-#define CONFIG_SYS_SCSI_MAX_LUN		1
-#define CONFIG_SYS_SCSI_MAX_DEVICE	(CONFIG_SYS_SCSI_MAX_SCSI_ID * \
-		CONFIG_SYS_SCSI_MAX_LUN)
-
 /* SPI */
 
 /*
diff --git a/include/configs/ls1028a_common.h b/include/configs/ls1028a_common.h
index f47bc73..a517346 100644
--- a/include/configs/ls1028a_common.h
+++ b/include/configs/ls1028a_common.h
@@ -6,8 +6,6 @@
 #ifndef __L1028A_COMMON_H
 #define __L1028A_COMMON_H
 
-#define CONFIG_REMAKE_ELF
-
 #include <asm/arch/stream_id_lsch3.h>
 #include <asm/arch/config.h>
 #include <asm/arch/soc.h>
diff --git a/include/configs/ls1028aqds.h b/include/configs/ls1028aqds.h
index 8e3bd77..1b4d181 100644
--- a/include/configs/ls1028aqds.h
+++ b/include/configs/ls1028aqds.h
@@ -72,13 +72,8 @@
 #endif
 
 /* SATA */
-#define CONFIG_SCSI_AHCI_PLAT
 
 #define CONFIG_SYS_SATA1			AHCI_BASE_ADDR1
-#define CONFIG_SYS_SCSI_MAX_SCSI_ID		1
-#define CONFIG_SYS_SCSI_MAX_LUN			1
-#define CONFIG_SYS_SCSI_MAX_DEVICE		(CONFIG_SYS_SCSI_MAX_SCSI_ID * \
-						CONFIG_SYS_SCSI_MAX_LUN)
 #ifndef SPL_NO_ENV
 #undef CONFIG_EXTRA_ENV_SETTINGS
 #define CONFIG_EXTRA_ENV_SETTINGS \
diff --git a/include/configs/ls1028ardb.h b/include/configs/ls1028ardb.h
index 5ce9ebb..0770f4e 100644
--- a/include/configs/ls1028ardb.h
+++ b/include/configs/ls1028ardb.h
@@ -57,14 +57,9 @@
 #endif
 
 /* SATA */
-#define CONFIG_SYS_SCSI_MAX_SCSI_ID		1
-#define CONFIG_SYS_SCSI_MAX_LUN			1
-#define CONFIG_SYS_SCSI_MAX_DEVICE		(CONFIG_SYS_SCSI_MAX_SCSI_ID * \
-						CONFIG_SYS_SCSI_MAX_LUN)
 #define SCSI_VEND_ID 0x1b4b
 #define SCSI_DEV_ID  0x9170
 #define CONFIG_SCSI_DEV_LIST {SCSI_VEND_ID, SCSI_DEV_ID}
-#define CONFIG_SCSI_AHCI_PLAT
 #define CONFIG_SYS_SATA1                        AHCI_BASE_ADDR1
 
 /* Initial environment variables */
diff --git a/include/configs/ls1043a_common.h b/include/configs/ls1043a_common.h
index 3b4f822..83b95c2 100644
--- a/include/configs/ls1043a_common.h
+++ b/include/configs/ls1043a_common.h
@@ -26,8 +26,6 @@
 #define SPL_NO_IFC
 #endif
 
-#define CONFIG_REMAKE_ELF
-
 #include <asm/arch/stream_id_lsch2.h>
 #include <asm/arch/config.h>
 
diff --git a/include/configs/ls1043aqds.h b/include/configs/ls1043aqds.h
index 5f9cb97..ea6831b 100644
--- a/include/configs/ls1043aqds.h
+++ b/include/configs/ls1043aqds.h
@@ -46,7 +46,6 @@
 #endif
 
 /* SATA */
-#define CONFIG_SCSI_AHCI_PLAT
 
 /* EEPROM */
 #define CONFIG_SYS_I2C_EEPROM_NXID
@@ -54,11 +53,6 @@
 
 #define CONFIG_SYS_SATA				AHCI_BASE_ADDR
 
-#define CONFIG_SYS_SCSI_MAX_SCSI_ID		1
-#define CONFIG_SYS_SCSI_MAX_LUN			1
-#define CONFIG_SYS_SCSI_MAX_DEVICE		(CONFIG_SYS_SCSI_MAX_SCSI_ID * \
-						CONFIG_SYS_SCSI_MAX_LUN)
-
 /*
  * IFC Definitions
  */
diff --git a/include/configs/ls1043ardb.h b/include/configs/ls1043ardb.h
index 6d9cbc8..31b578a 100644
--- a/include/configs/ls1043ardb.h
+++ b/include/configs/ls1043ardb.h
@@ -234,10 +234,6 @@
 
 /* SATA */
 #ifndef SPL_NO_SATA
-#define CONFIG_SYS_SCSI_MAX_SCSI_ID		2
-#define CONFIG_SYS_SCSI_MAX_LUN			2
-#define CONFIG_SYS_SCSI_MAX_DEVICE		(CONFIG_SYS_SCSI_MAX_SCSI_ID * \
-						CONFIG_SYS_SCSI_MAX_LUN)
 #define SCSI_VEND_ID 0x1b4b
 #define SCSI_DEV_ID  0x9170
 #define CONFIG_SCSI_DEV_LIST {SCSI_VEND_ID, SCSI_DEV_ID}
diff --git a/include/configs/ls1046a_common.h b/include/configs/ls1046a_common.h
index d07d27d..7552610 100644
--- a/include/configs/ls1046a_common.h
+++ b/include/configs/ls1046a_common.h
@@ -26,8 +26,6 @@
 #define SPL_NO_IFC
 #endif
 
-#define CONFIG_REMAKE_ELF
-
 #include <asm/arch/config.h>
 #include <asm/arch/stream_id_lsch2.h>
 
@@ -124,14 +122,7 @@
 
 /* SATA */
 #ifndef SPL_NO_SATA
-#define CONFIG_SCSI_AHCI_PLAT
-
 #define CONFIG_SYS_SATA				AHCI_BASE_ADDR
-
-#define CONFIG_SYS_SCSI_MAX_SCSI_ID		1
-#define CONFIG_SYS_SCSI_MAX_LUN			1
-#define CONFIG_SYS_SCSI_MAX_DEVICE		(CONFIG_SYS_SCSI_MAX_SCSI_ID * \
-						CONFIG_SYS_SCSI_MAX_LUN)
 #endif
 
 /* FMan ucode */
diff --git a/include/configs/ls1088a_common.h b/include/configs/ls1088a_common.h
index 2e52108..33b70c8 100644
--- a/include/configs/ls1088a_common.h
+++ b/include/configs/ls1088a_common.h
@@ -20,8 +20,6 @@
 #undef CONFIG_DISPLAY_CPUINFO
 #endif
 
-#define CONFIG_REMAKE_ELF
-
 #include <asm/arch/stream_id_lsch3.h>
 #include <asm/arch/config.h>
 #include <asm/arch/soc.h>
@@ -130,13 +128,7 @@
 
 /* SATA */
 #ifdef CONFIG_SCSI
-#define CONFIG_SCSI_AHCI_PLAT
 #define CONFIG_SYS_SATA1		AHCI_BASE_ADDR1
-
-#define CONFIG_SYS_SCSI_MAX_SCSI_ID	1
-#define CONFIG_SYS_SCSI_MAX_LUN		1
-#define CONFIG_SYS_SCSI_MAX_DEVICE	(CONFIG_SYS_SCSI_MAX_SCSI_ID * \
-					CONFIG_SYS_SCSI_MAX_LUN)
 #endif
 
 /* Physical Memory Map */
diff --git a/include/configs/ls2080a_common.h b/include/configs/ls2080a_common.h
index eea6ce5..f2725af 100644
--- a/include/configs/ls2080a_common.h
+++ b/include/configs/ls2080a_common.h
@@ -7,8 +7,6 @@
 #ifndef __LS2_COMMON_H
 #define __LS2_COMMON_H
 
-#define CONFIG_REMAKE_ELF
-
 #include <asm/arch/stream_id_lsch3.h>
 #include <asm/arch/config.h>
 
diff --git a/include/configs/ls2080aqds.h b/include/configs/ls2080aqds.h
index 07cf59f..7554de1 100644
--- a/include/configs/ls2080aqds.h
+++ b/include/configs/ls2080aqds.h
@@ -33,16 +33,10 @@
 #endif
 
 /* SATA */
-#define CONFIG_SCSI_AHCI_PLAT
 
 #define CONFIG_SYS_SATA1			AHCI_BASE_ADDR1
 #define CONFIG_SYS_SATA2			AHCI_BASE_ADDR2
 
-#define CONFIG_SYS_SCSI_MAX_SCSI_ID		1
-#define CONFIG_SYS_SCSI_MAX_LUN			1
-#define CONFIG_SYS_SCSI_MAX_DEVICE		(CONFIG_SYS_SCSI_MAX_SCSI_ID * \
-						CONFIG_SYS_SCSI_MAX_LUN)
-
 #define CONFIG_SYS_NOR0_CSPR_EXT	(0x0)
 #define CONFIG_SYS_NOR_AMASK		IFC_AMASK(128*1024*1024)
 #define CONFIG_SYS_NOR_AMASK_EARLY	IFC_AMASK(64*1024*1024)
diff --git a/include/configs/ls2080ardb.h b/include/configs/ls2080ardb.h
index 6d8effe..1c05b08 100644
--- a/include/configs/ls2080ardb.h
+++ b/include/configs/ls2080ardb.h
@@ -43,16 +43,10 @@
 #endif
 
 /* SATA */
-#define CONFIG_SCSI_AHCI_PLAT
 
 #define CONFIG_SYS_SATA1			AHCI_BASE_ADDR1
 #define CONFIG_SYS_SATA2			AHCI_BASE_ADDR2
 
-#define CONFIG_SYS_SCSI_MAX_SCSI_ID		1
-#define CONFIG_SYS_SCSI_MAX_LUN			1
-#define CONFIG_SYS_SCSI_MAX_DEVICE		(CONFIG_SYS_SCSI_MAX_SCSI_ID * \
-						CONFIG_SYS_SCSI_MAX_LUN)
-
 #if !defined(CONFIG_FSL_QSPI) || defined(CONFIG_TFABOOT)
 
 #define CONFIG_SYS_NOR0_CSPR_EXT	(0x0)
diff --git a/include/configs/lsxl.h b/include/configs/lsxl.h
index e8e02e7..7fa4f00 100644
--- a/include/configs/lsxl.h
+++ b/include/configs/lsxl.h
@@ -96,7 +96,6 @@
 #endif /* CONFIG_CMD_NET */
 
 #ifdef CONFIG_SATA
-#define CONFIG_SYS_SATA_MAX_DEVICE 1
 #define CONFIG_SYS_64BIT_LBA
 #define CONFIG_LBA48
 #endif
diff --git a/include/configs/lx2160a_common.h b/include/configs/lx2160a_common.h
index e285109..e31f8d0 100644
--- a/include/configs/lx2160a_common.h
+++ b/include/configs/lx2160a_common.h
@@ -10,7 +10,6 @@
 #include <asm/arch/config.h>
 #include <asm/arch/soc.h>
 
-#define CONFIG_REMAKE_ELF
 #define CONFIG_FSL_MEMAC
 
 #define CONFIG_SYS_INIT_SP_ADDR		CONFIG_SYS_TEXT_BASE
@@ -110,13 +109,8 @@
 /* SATA */
 
 #ifdef CONFIG_SCSI
-#define CONFIG_SCSI_AHCI_PLAT
 #define CONFIG_SYS_SATA1		AHCI_BASE_ADDR1
 #define CONFIG_SYS_SATA2		AHCI_BASE_ADDR2
-#define CONFIG_SYS_SCSI_MAX_SCSI_ID	1
-#define CONFIG_SYS_SCSI_MAX_LUN		1
-#define CONFIG_SYS_SCSI_MAX_DEVICE	(CONFIG_SYS_SCSI_MAX_SCSI_ID * \
-					CONFIG_SYS_SCSI_MAX_LUN)
 #endif
 
 /* USB */
diff --git a/include/configs/m53menlo.h b/include/configs/m53menlo.h
index 4a1d959..8486cf8 100644
--- a/include/configs/m53menlo.h
+++ b/include/configs/m53menlo.h
@@ -99,7 +99,6 @@
  * SATA
  */
 #ifdef CONFIG_CMD_SATA
-#define CONFIG_SYS_SATA_MAX_DEVICE	1
 #define CONFIG_DWC_AHSATA_PORT_ID	0
 #define CONFIG_DWC_AHSATA_BASE_ADDR	SATA_BASE_ADDR
 #define CONFIG_LBA48
diff --git a/include/configs/malta.h b/include/configs/malta.h
index 61860ee..6d150fd 100644
--- a/include/configs/malta.h
+++ b/include/configs/malta.h
@@ -63,12 +63,6 @@
 /*
  * IDE/ATA
  */
-#define CONFIG_SYS_IDE_MAXBUS		1
-#define CONFIG_SYS_IDE_MAXDEVICE	2
-#define CONFIG_SYS_ATA_BASE_ADDR	CONFIG_SYS_ISA_IO_BASE_ADDRESS
-#define CONFIG_SYS_ATA_IDE0_OFFSET	0x01f0
-#define CONFIG_SYS_ATA_DATA_OFFSET	0
-#define CONFIG_SYS_ATA_REG_OFFSET	0
 
 /*
  * Commands
diff --git a/include/configs/meson64.h b/include/configs/meson64.h
index 44f2967..196e58e 100644
--- a/include/configs/meson64.h
+++ b/include/configs/meson64.h
@@ -29,7 +29,6 @@
 #define STDIN_CFG "serial"
 #endif
 
-#define CONFIG_REMAKE_ELF
 #define CONFIG_SYS_MAXARGS		32
 #define CONFIG_SYS_CBSIZE		1024
 
diff --git a/include/configs/mvebu_armada-37xx.h b/include/configs/mvebu_armada-37xx.h
index e7f7e77..fd9ce34 100644
--- a/include/configs/mvebu_armada-37xx.h
+++ b/include/configs/mvebu_armada-37xx.h
@@ -51,15 +51,9 @@
 /*
  * SATA/SCSI/AHCI configuration
  */
-#define CONFIG_SCSI_AHCI_PLAT
 #define CONFIG_LBA48
 #define CONFIG_SYS_64BIT_LBA
 
-#define CONFIG_SYS_SCSI_MAX_SCSI_ID	2
-#define CONFIG_SYS_SCSI_MAX_LUN		1
-#define CONFIG_SYS_SCSI_MAX_DEVICE	(CONFIG_SYS_SCSI_MAX_SCSI_ID * \
-					 CONFIG_SYS_SCSI_MAX_LUN)
-
 #define BOOT_TARGET_DEVICES(func) \
 	func(MMC, mmc, 1) \
 	func(MMC, mmc, 0) \
diff --git a/include/configs/mvebu_armada-8k.h b/include/configs/mvebu_armada-8k.h
index ac0fddd..44bba65 100644
--- a/include/configs/mvebu_armada-8k.h
+++ b/include/configs/mvebu_armada-8k.h
@@ -46,15 +46,9 @@
 /*
  * SATA/SCSI/AHCI configuration
  */
-#define CONFIG_SCSI_AHCI_PLAT
 #define CONFIG_LBA48
 #define CONFIG_SYS_64BIT_LBA
 
-#define CONFIG_SYS_SCSI_MAX_SCSI_ID	2
-#define CONFIG_SYS_SCSI_MAX_LUN		1
-#define CONFIG_SYS_SCSI_MAX_DEVICE	(CONFIG_SYS_SCSI_MAX_SCSI_ID * \
-					 CONFIG_SYS_SCSI_MAX_LUN)
-
 /*
  * PCI configuration
  */
diff --git a/include/configs/mx53loco.h b/include/configs/mx53loco.h
index 92140df..01ed221 100644
--- a/include/configs/mx53loco.h
+++ b/include/configs/mx53loco.h
@@ -125,7 +125,6 @@
 #define CONFIG_BOARD_SIZE_LIMIT		785408
 
 #ifdef CONFIG_CMD_SATA
-	#define CONFIG_SYS_SATA_MAX_DEVICE      1
 	#define CONFIG_DWC_AHSATA_PORT_ID       0
 	#define CONFIG_DWC_AHSATA_BASE_ADDR     SATA_BASE_ADDR
 	#define CONFIG_LBA48
diff --git a/include/configs/mx6cuboxi.h b/include/configs/mx6cuboxi.h
index 7d3e651..1c25857 100644
--- a/include/configs/mx6cuboxi.h
+++ b/include/configs/mx6cuboxi.h
@@ -18,7 +18,6 @@
 
 /* SATA Configuration */
 #ifdef CONFIG_CMD_SATA
-#define CONFIG_SYS_SATA_MAX_DEVICE      1
 #define CONFIG_DWC_AHSATA_PORT_ID       0
 #define CONFIG_DWC_AHSATA_BASE_ADDR     SATA_ARB_BASE_ADDR
 #define CONFIG_LBA48
diff --git a/include/configs/netgear_dgnd3700v2.h b/include/configs/netgear_dgnd3700v2.h
index f14316c..c150805 100644
--- a/include/configs/netgear_dgnd3700v2.h
+++ b/include/configs/netgear_dgnd3700v2.h
@@ -6,4 +6,3 @@
 #include <configs/bmips_common.h>
 #include <configs/bmips_bcm6362.h>
 
-#define CONFIG_REMAKE_ELF
diff --git a/include/configs/nitrogen6x.h b/include/configs/nitrogen6x.h
index 1a1c08b..678b433 100644
--- a/include/configs/nitrogen6x.h
+++ b/include/configs/nitrogen6x.h
@@ -23,7 +23,6 @@
  * SATA Configs
  */
 #ifdef CONFIG_CMD_SATA
-#define CONFIG_SYS_SATA_MAX_DEVICE	1
 #define CONFIG_DWC_AHSATA_PORT_ID	0
 #define CONFIG_DWC_AHSATA_BASE_ADDR	SATA_ARB_BASE_ADDR
 #define CONFIG_LBA48
diff --git a/include/configs/nsa310s.h b/include/configs/nsa310s.h
index 8cc9ca6..ccf4519 100644
--- a/include/configs/nsa310s.h
+++ b/include/configs/nsa310s.h
@@ -32,7 +32,6 @@
 
 /* SATA driver configuration */
 #ifdef CONFIG_SATA
-#define CONFIG_SYS_SATA_MAX_DEVICE	1
 #define CONFIG_LBA48
 #endif /* CONFIG_SATA */
 
diff --git a/include/configs/omap5_uevm.h b/include/configs/omap5_uevm.h
index 188ab0b..75e84c3 100644
--- a/include/configs/omap5_uevm.h
+++ b/include/configs/omap5_uevm.h
@@ -49,10 +49,4 @@
 
 #define CONSOLEDEV		"ttyS2"
 
-#define CONFIG_SCSI_AHCI_PLAT
-#define CONFIG_SYS_SCSI_MAX_SCSI_ID	1
-#define CONFIG_SYS_SCSI_MAX_LUN		1
-#define CONFIG_SYS_SCSI_MAX_DEVICE	(CONFIG_SYS_SCSI_MAX_SCSI_ID * \
-						CONFIG_SYS_SCSI_MAX_LUN)
-
 #endif /* __CONFIG_OMAP5_EVM_H */
diff --git a/include/configs/openrd.h b/include/configs/openrd.h
index 43d0896..7dad002 100644
--- a/include/configs/openrd.h
+++ b/include/configs/openrd.h
@@ -59,9 +59,5 @@
 /*
  * SATA Driver configuration
  */
-#ifdef CONFIG_MVSATA_IDE
-#define CONFIG_SYS_ATA_IDE0_OFFSET	MV_SATA_PORT0_OFFSET
-#define CONFIG_SYS_ATA_IDE1_OFFSET	MV_SATA_PORT1_OFFSET
-#endif /*CONFIG_MVSATA_IDE*/
 
 #endif /* _CONFIG_OPENRD_BASE_H */
diff --git a/include/configs/p1_p2_rdb_pc.h b/include/configs/p1_p2_rdb_pc.h
index b993ec8..92008cd 100644
--- a/include/configs/p1_p2_rdb_pc.h
+++ b/include/configs/p1_p2_rdb_pc.h
@@ -138,7 +138,6 @@
 #define CONFIG_PCIE1	/* PCIE controller 1 (slot 1) */
 #define CONFIG_PCIE2	/* PCIE controller 2 (slot 2) */
 
-#define CONFIG_SYS_SATA_MAX_DEVICE	2
 #define CONFIG_LBA48
 
 #define CONFIG_HWCONFIG
diff --git a/include/configs/pico-imx8mq.h b/include/configs/pico-imx8mq.h
index 2293a29..7bfa790 100644
--- a/include/configs/pico-imx8mq.h
+++ b/include/configs/pico-imx8mq.h
@@ -29,8 +29,6 @@
 #undef CONFIG_DM_MMC
 #endif
 
-#define CONFIG_REMAKE_ELF
-
 /* ENET Config */
 /* ENET1 */
 #if defined(CONFIG_CMD_NET)
diff --git a/include/configs/pogo_e02.h b/include/configs/pogo_e02.h
index 3e94125..51c802f 100644
--- a/include/configs/pogo_e02.h
+++ b/include/configs/pogo_e02.h
@@ -15,10 +15,6 @@
 #include "mv-common.h"
 
 /*
- *  Environment variables configurations
- */
-
-/*
  * Default environment variables
  */
 
@@ -33,13 +29,10 @@
 /*
  * Ethernet Driver configuration
  */
-#ifdef CONFIG_CMD_NET
 #define CONFIG_MVGBE_PORTS	{1, 0}	/* enable port 0 only */
 #define CONFIG_PHY_BASE_ADR	0
-#endif /* CONFIG_CMD_NET */
-
-/*
- * File system
- */
+#ifdef CONFIG_RESET_PHY_R
+#undef CONFIG_RESET_PHY_R	/* remove legacy reset_phy() */
+#endif
 
 #endif /* _CONFIG_POGO_E02_H */
diff --git a/include/configs/pogo_v4.h b/include/configs/pogo_v4.h
index 568a936..f8555f6 100644
--- a/include/configs/pogo_v4.h
+++ b/include/configs/pogo_v4.h
@@ -43,11 +43,6 @@
 #endif
 
 /*
- *  SATA Driver configuration
- */
-#define CONFIG_SYS_SATA_MAX_DEVICE	1
-
-/*
  * Support large disk for SATA and USB
  */
 #define CONFIG_SYS_64BIT_LBA
diff --git a/include/configs/presidio_asic.h b/include/configs/presidio_asic.h
index 928ccb1..30185b1 100644
--- a/include/configs/presidio_asic.h
+++ b/include/configs/presidio_asic.h
@@ -8,8 +8,6 @@
 #ifndef __PRESIDIO_ASIC_H
 #define __PRESIDIO_ASIC_H
 
-#define CONFIG_REMAKE_ELF
-
 #define CONFIG_SYS_INIT_SP_ADDR		0x00100000
 #define CONFIG_SYS_BOOTM_LEN		0x00c00000
 
diff --git a/include/configs/qemu-x86.h b/include/configs/qemu-x86.h
index 52c3360..e9dbd54 100644
--- a/include/configs/qemu-x86.h
+++ b/include/configs/qemu-x86.h
@@ -33,15 +33,6 @@
  *   - Only legacy IDE controller is supported for QEMU '-M pc' target
  *   - AHCI controller is supported for QEMU '-M q35' target
  */
-#define CONFIG_SYS_IDE_MAXBUS		2
-#define CONFIG_SYS_IDE_MAXDEVICE	4
-#define CONFIG_SYS_ATA_BASE_ADDR	0
-#define CONFIG_SYS_ATA_DATA_OFFSET	0
-#define CONFIG_SYS_ATA_REG_OFFSET	0
-#define CONFIG_SYS_ATA_ALT_OFFSET	0
-#define CONFIG_SYS_ATA_IDE0_OFFSET	0x1f0
-#define CONFIG_SYS_ATA_IDE1_OFFSET	0x170
-#define CONFIG_ATAPI
 
 #define CONFIG_SPL_BOARD_LOAD_IMAGE
 
diff --git a/include/configs/r2dplus.h b/include/configs/r2dplus.h
index e3105fe..04b3481 100644
--- a/include/configs/r2dplus.h
+++ b/include/configs/r2dplus.h
@@ -30,19 +30,6 @@
 #define	CONFIG_SYS_PLL_SETTLING_TIME	100/* in us */
 
 /*
- * IDE support
- */
-#define CONFIG_IDE_RESET	1
-#define CONFIG_SYS_PIO_MODE		1
-#define CONFIG_SYS_IDE_MAXBUS		1 /* IDE bus */
-#define CONFIG_SYS_IDE_MAXDEVICE	1
-#define CONFIG_SYS_ATA_BASE_ADDR	0xb4000000
-#define CONFIG_SYS_ATA_STRIDE		2 /* 1bit shift */
-#define CONFIG_SYS_ATA_DATA_OFFSET	0x1000	/* data reg offset */
-#define CONFIG_SYS_ATA_REG_OFFSET	0x1000	/* reg offset */
-#define CONFIG_SYS_ATA_ALT_OFFSET	0x800	/* alternate register offset */
-
-/*
  * SuperH PCI Bridge Configration
  */
 #define CONFIG_SH7751_PCI
diff --git a/include/configs/rcar-gen3-common.h b/include/configs/rcar-gen3-common.h
index eed2125..07a30d0 100644
--- a/include/configs/rcar-gen3-common.h
+++ b/include/configs/rcar-gen3-common.h
@@ -11,8 +11,6 @@
 
 #include <asm/arch/rmobile.h>
 
-#define CONFIG_REMAKE_ELF
-
 #ifdef CONFIG_SPL
 #define CONFIG_SPL_TARGET	"spl/u-boot-spl.scif"
 #endif
diff --git a/include/configs/sandbox.h b/include/configs/sandbox.h
index 9e0e8c7..75efbf3 100644
--- a/include/configs/sandbox.h
+++ b/include/configs/sandbox.h
@@ -29,22 +29,4 @@
 #define CONFIG_SANDBOX_SDL
 #endif
 
-#ifndef CONFIG_SPL_BUILD
-#define CONFIG_SYS_IDE_MAXBUS		1
-#define CONFIG_SYS_ATA_IDE0_OFFSET	0
-#define CONFIG_SYS_IDE_MAXDEVICE	2
-#define CONFIG_SYS_ATA_BASE_ADDR	0x100
-#define CONFIG_SYS_ATA_DATA_OFFSET	0
-#define CONFIG_SYS_ATA_REG_OFFSET	1
-#define CONFIG_SYS_ATA_ALT_OFFSET	2
-#define CONFIG_SYS_ATA_STRIDE		4
-#endif
-
-#define CONFIG_SCSI_AHCI_PLAT
-#define CONFIG_SYS_SCSI_MAX_DEVICE	2
-#define CONFIG_SYS_SCSI_MAX_SCSI_ID	8
-#define CONFIG_SYS_SCSI_MAX_LUN		4
-
-#define CONFIG_SYS_SATA_MAX_DEVICE	2
-
 #endif
diff --git a/include/configs/sfr_nb4_ser.h b/include/configs/sfr_nb4_ser.h
index 7c88af0..5400d12 100644
--- a/include/configs/sfr_nb4_ser.h
+++ b/include/configs/sfr_nb4_ser.h
@@ -6,4 +6,3 @@
 #include <configs/bmips_common.h>
 #include <configs/bmips_bcm6358.h>
 
-#define CONFIG_REMAKE_ELF
diff --git a/include/configs/sheevaplug.h b/include/configs/sheevaplug.h
index 8dba4fc..4499a63 100644
--- a/include/configs/sheevaplug.h
+++ b/include/configs/sheevaplug.h
@@ -46,7 +46,6 @@
  * SATA driver configuration
  */
 #ifdef CONFIG_SATA
-#define CONFIG_SYS_SATA_MAX_DEVICE	2
 #define CONFIG_LBA48
 #endif /* CONFIG_SATA */
 
diff --git a/include/configs/sifive-unmatched.h b/include/configs/sifive-unmatched.h
index 30adfe9..0877646 100644
--- a/include/configs/sifive-unmatched.h
+++ b/include/configs/sifive-unmatched.h
@@ -32,8 +32,6 @@
 
 #define CONFIG_STANDALONE_LOAD_ADDR	0x80200000
 
-#define CONFIG_SYS_SCSI_MAX_SCSI_ID	4
-
 /* Environment options */
 
 #ifndef CONFIG_SPL_BUILD
diff --git a/include/configs/socfpga_soc64_common.h b/include/configs/socfpga_soc64_common.h
index 8646dc2..51dc2e4 100644
--- a/include/configs/socfpga_soc64_common.h
+++ b/include/configs/socfpga_soc64_common.h
@@ -15,7 +15,6 @@
  * U-Boot general configurations
  */
 #define CONFIG_SYS_MONITOR_BASE		CONFIG_SYS_TEXT_BASE
-#define CONFIG_REMAKE_ELF
 /* sysmgr.boot_scratch_cold4 & 5 (64bit) will be used for PSCI_CPU_ON call */
 #define CPU_RELEASE_ADDR		0xFFD12210
 
diff --git a/include/configs/tbs2910.h b/include/configs/tbs2910.h
index 58ccafc..065b406 100644
--- a/include/configs/tbs2910.h
+++ b/include/configs/tbs2910.h
@@ -40,7 +40,6 @@
 
 /* SATA */
 #ifdef CONFIG_CMD_SATA
-#define CONFIG_SYS_SATA_MAX_DEVICE	1
 #define CONFIG_DWC_AHSATA_PORT_ID	0
 #define CONFIG_DWC_AHSATA_BASE_ADDR	SATA_ARB_BASE_ADDR
 #define CONFIG_LBA48
diff --git a/include/configs/theadorable.h b/include/configs/theadorable.h
index 3c942cc..14817b1 100644
--- a/include/configs/theadorable.h
+++ b/include/configs/theadorable.h
@@ -41,7 +41,6 @@
 	"initrd_high=0x10000000\0"
 
 /* SATA support */
-#define CONFIG_SYS_SATA_MAX_DEVICE	1
 #define CONFIG_LBA48
 
 /* Enable LCD and reserve 512KB from top of memory*/
diff --git a/include/configs/thunderx_88xx.h b/include/configs/thunderx_88xx.h
index 6006898..3d770f8 100644
--- a/include/configs/thunderx_88xx.h
+++ b/include/configs/thunderx_88xx.h
@@ -6,8 +6,6 @@
 #ifndef __THUNDERX_88XX_H__
 #define __THUNDERX_88XX_H__
 
-#define CONFIG_REMAKE_ELF
-
 #define CONFIG_THUNDERX
 
 #define CONFIG_SYS_64BIT
diff --git a/include/configs/total_compute.h b/include/configs/total_compute.h
index 9638ab2..0324b1e 100644
--- a/include/configs/total_compute.h
+++ b/include/configs/total_compute.h
@@ -9,8 +9,6 @@
 #ifndef __TOTAL_COMPUTE_H
 #define __TOTAL_COMPUTE_H
 
-#define CONFIG_REMAKE_ELF
-
 /* Link Definitions */
 #define CONFIG_SYS_INIT_SP_ADDR	(CONFIG_SYS_SDRAM_BASE + 0x7fff0)
 
diff --git a/include/configs/vexpress_aemv8.h b/include/configs/vexpress_aemv8.h
index 9bf5774..f0c5ceb 100644
--- a/include/configs/vexpress_aemv8.h
+++ b/include/configs/vexpress_aemv8.h
@@ -9,8 +9,6 @@
 
 #include <linux/stringify.h>
 
-#define CONFIG_REMAKE_ELF
-
 /* Link Definitions */
 #ifdef CONFIG_TARGET_VEXPRESS64_JUNO
 #define CONFIG_SYS_INIT_SP_ADDR         (CONFIG_SYS_SDRAM_BASE + 0x7fff0)
diff --git a/include/configs/wandboard.h b/include/configs/wandboard.h
index 051c18c..80e8fe1 100644
--- a/include/configs/wandboard.h
+++ b/include/configs/wandboard.h
@@ -17,7 +17,6 @@
 /* SATA Configs */
 
 #ifdef CONFIG_CMD_SATA
-#define CONFIG_SYS_SATA_MAX_DEVICE	1
 #define CONFIG_DWC_AHSATA_PORT_ID	0
 #define CONFIG_DWC_AHSATA_BASE_ADDR	SATA_ARB_BASE_ADDR
 #define CONFIG_LBA48
diff --git a/include/configs/xilinx_versal.h b/include/configs/xilinx_versal.h
index 03539a4..bc72f5f 100644
--- a/include/configs/xilinx_versal.h
+++ b/include/configs/xilinx_versal.h
@@ -10,8 +10,6 @@
 #ifndef __XILINX_VERSAL_H
 #define __XILINX_VERSAL_H
 
-#define CONFIG_REMAKE_ELF
-
 /* #define CONFIG_ARMV8_SWITCH_TO_EL1 */
 
 /* Generic Interrupt Controller Definitions */
diff --git a/include/configs/xilinx_zynqmp.h b/include/configs/xilinx_zynqmp.h
index f791ab7..e51d92f 100644
--- a/include/configs/xilinx_zynqmp.h
+++ b/include/configs/xilinx_zynqmp.h
@@ -10,8 +10,6 @@
 #ifndef __XILINX_ZYNQMP_H
 #define __XILINX_ZYNQMP_H
 
-#define CONFIG_REMAKE_ELF
-
 /* #define CONFIG_ARMV8_SWITCH_TO_EL1 */
 
 /* Generic Interrupt Controller Definitions */
diff --git a/include/configs/zynq-common.h b/include/configs/zynq-common.h
index 1bda0a6..780952c 100644
--- a/include/configs/zynq-common.h
+++ b/include/configs/zynq-common.h
@@ -9,8 +9,6 @@
 #ifndef __CONFIG_ZYNQ_COMMON_H
 #define __CONFIG_ZYNQ_COMMON_H
 
-#define CONFIG_REMAKE_ELF
-
 /* Cache options */
 #ifndef CONFIG_SYS_L2CACHE_OFF
 # define CONFIG_SYS_L2_PL310
diff --git a/include/dm/device.h b/include/dm/device.h
index 435a111..cb52a09 100644
--- a/include/dm/device.h
+++ b/include/dm/device.h
@@ -212,7 +212,7 @@
 #define DM_MAX_SEQ_STR	3
 
 /* Returns the operations for a device */
-#define device_get_ops(dev)	(dev->driver->ops)
+#define device_get_ops(dev)	((dev)->driver->ops)
 
 #if CONFIG_IS_ENABLED(OF_PLATDATA_RT)
 u32 dev_get_flags(const struct udevice *dev);
diff --git a/include/ide.h b/include/ide.h
index 6073943..2994b7a 100644
--- a/include/ide.h
+++ b/include/ide.h
@@ -41,13 +41,6 @@
 int ide_device_present(int dev);
 #endif
 
-#if defined(CONFIG_IDE_AHB)
-unsigned char ide_read_register(int dev, unsigned int port);
-void ide_write_register(int dev, unsigned int port, unsigned char val);
-void ide_read_data(int dev, ulong *sect_buf, int words);
-void ide_write_data(int dev, const ulong *sect_buf, int words);
-#endif
-
 /*
  * I/O function overrides
  */
diff --git a/include/linux/kconfig.h b/include/linux/kconfig.h
index a1d1a29..d20da61 100644
--- a/include/linux/kconfig.h
+++ b/include/linux/kconfig.h
@@ -17,18 +17,16 @@
  * the last step cherry picks the 2nd arg, we get a zero.
  */
 #define __ARG_PLACEHOLDER_1 0,
-#define config_enabled(cfg) _config_enabled(cfg)
-#define _config_enabled(value) __config_enabled(__ARG_PLACEHOLDER_##value)
-#define __config_enabled(arg1_or_junk) ___config_enabled(arg1_or_junk 1, 0)
+#define config_enabled(cfg, def_val) _config_enabled(cfg, def_val)
+#define _config_enabled(value, def_val) __config_enabled(__ARG_PLACEHOLDER_##value, def_val)
+#define __config_enabled(arg1_or_junk, def_val) ___config_enabled(arg1_or_junk 1, def_val)
 #define ___config_enabled(__ignored, val, ...) val
 
 /*
  * IS_ENABLED(CONFIG_FOO) evaluates to 1 if CONFIG_FOO is set to 'y',
  * 0 otherwise.
- *
  */
-#define IS_ENABLED(option) \
-	(config_enabled(option))
+#define IS_ENABLED(option)	config_enabled(option, 0)
 
 /*
  * U-Boot add-on: Helper macros to reference to different macros (prefixed by
@@ -60,6 +58,30 @@
 #define CONFIG_VAL(option)  config_val(option)
 
 /*
+ * This uses a similar mechanism to config_enabled() above. If cfg is enabled,
+ * it resolves to the value of opt_cfg, otherwise it resolves to def_val
+ */
+#define config_opt_enabled(cfg, opt_cfg, def_val) _config_opt_enabled(cfg, opt_cfg, def_val)
+#define _config_opt_enabled(cfg_val, opt_value, def_val) \
+	__config_opt_enabled(__ARG_PLACEHOLDER_##cfg_val, opt_value, def_val)
+#define __config_opt_enabled(arg1_or_junk, arg2, def_val) \
+	___config_opt_enabled(arg1_or_junk arg2, def_val)
+#define ___config_opt_enabled(__ignored, val, ...) val
+
+#ifndef __ASSEMBLY__
+/*
+ * Detect usage of a the value when the conditional is not enabled. When used
+ * in assembly context, this likely produces a assembly error, or hopefully at
+ * least something recognisable.
+ */
+long invalid_use_of_IF_ENABLED_INT(void);
+#endif
+
+/* Evaluates to int_option if option is defined, otherwise a build error */
+#define IF_ENABLED_INT(option, int_option) \
+	config_opt_enabled(option, int_option, invalid_use_of_IF_ENABLED_INT())
+
+/*
  * Count number of arguments to a variadic macro. Currently only need
  * it for 1, 2 or 3 arguments.
  */
@@ -76,7 +98,7 @@
 #define __CONFIG_IS_ENABLED_1(option)        __CONFIG_IS_ENABLED_3(option, (1), (0))
 #define __CONFIG_IS_ENABLED_2(option, case1) __CONFIG_IS_ENABLED_3(option, case1, ())
 #define __CONFIG_IS_ENABLED_3(option, case1, case0) \
-	__concat(__unwrap, config_enabled(CONFIG_VAL(option))) (case1, case0)
+	__concat(__unwrap, config_enabled(CONFIG_VAL(option), 0)) (case1, case0)
 
 /*
  * CONFIG_IS_ENABLED(FOO) expands to
@@ -113,5 +135,21 @@
 #define CONFIG_IS_ENABLED(option, ...)					\
 	__concat(__CONFIG_IS_ENABLED_, __count_args(option, ##__VA_ARGS__)) (option, ##__VA_ARGS__)
 
+#ifndef __ASSEMBLY__
+/*
+ * Detect usage of a the value when the conditional is not enabled. When used
+ * in assembly context, this likely produces a assembly error, or hopefully at
+ * least something recognisable.
+ */
+long invalid_use_of_CONFIG_IF_ENABLED_INT(void);
+#endif
+
+/*
+ * Evaluates to SPL_/TPL_int_option if SPL_/TPL_/option is not defined,
+ * otherwise build error
+ */
+#define CONFIG_IF_ENABLED_INT(option, int_option) \
+	CONFIG_IS_ENABLED(option, (CONFIG_VAL(int_option)), \
+		(invalid_use_of_CONFIG_IF_ENABLED_INT()))
 
 #endif /* __LINUX_KCONFIG_H */
diff --git a/include/scsi.h b/include/scsi.h
index 66a2caa..b47c746 100644
--- a/include/scsi.h
+++ b/include/scsi.h
@@ -9,6 +9,10 @@
 #include <asm/cache.h>
 #include <linux/dma-direction.h>
 
+/* Fix this to the maximum */
+#define SCSI_MAX_DEVICE \
+	(CONFIG_SYS_SCSI_MAX_SCSI_ID * CONFIG_SYS_SCSI_MAX_LUN)
+
 struct udevice;
 
 struct scsi_cmd {
diff --git a/lib/acpi/Makefile b/lib/acpi/Makefile
index f9b5049..956b5a0 100644
--- a/lib/acpi/Makefile
+++ b/lib/acpi/Makefile
@@ -11,6 +11,7 @@
 ifndef CONFIG_QEMU
 obj-y += base.o
 obj-y += csrt.o
+obj-y += mcfg.o
 
 # Sandbox does not build a .asl file
 ifndef CONFIG_SANDBOX
diff --git a/lib/acpi/mcfg.c b/lib/acpi/mcfg.c
new file mode 100644
index 0000000..7404ae58
--- /dev/null
+++ b/lib/acpi/mcfg.c
@@ -0,0 +1,64 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Write an ACPI MCFG table
+ *
+ * Copyright 2022 Google LLC
+ */
+
+#define LOG_CATEGORY LOGC_ACPI
+
+#include <common.h>
+#include <mapmem.h>
+#include <tables_csum.h>
+#include <acpi/acpi_table.h>
+#include <dm/acpi.h>
+
+int acpi_create_mcfg_mmconfig(struct acpi_mcfg_mmconfig *mmconfig, u32 base,
+			      u16 seg_nr, u8 start, u8 end)
+{
+	memset(mmconfig, 0, sizeof(*mmconfig));
+	mmconfig->base_address_l = base;
+	mmconfig->base_address_h = 0;
+	mmconfig->pci_segment_group_number = seg_nr;
+	mmconfig->start_bus_number = start;
+	mmconfig->end_bus_number = end;
+
+	return sizeof(struct acpi_mcfg_mmconfig);
+}
+
+__weak int acpi_fill_mcfg(struct acpi_ctx *ctx)
+{
+	return -ENOENT;
+}
+
+/* MCFG is defined in the PCI Firmware Specification 3.0 */
+int acpi_write_mcfg(struct acpi_ctx *ctx, const struct acpi_writer *entry)
+{
+	struct acpi_table_header *header;
+	struct acpi_mcfg *mcfg;
+	int ret;
+
+	mcfg = ctx->current;
+	header = &mcfg->header;
+
+	memset(mcfg, '\0', sizeof(struct acpi_mcfg));
+
+	/* Fill out header fields */
+	acpi_fill_header(header, "MCFG");
+	header->length = sizeof(struct acpi_mcfg);
+	header->revision = 1;
+	acpi_inc(ctx, sizeof(*mcfg));
+
+	ret = acpi_fill_mcfg(ctx);
+	if (ret)
+		return log_msg_ret("fill", ret);
+
+	/* (Re)calculate length and checksum */
+	header->length = (ulong)ctx->current - (ulong)mcfg;
+	header->checksum = table_compute_checksum(mcfg, header->length);
+
+	acpi_add_table(ctx, mcfg);
+
+	return 0;
+}
+ACPI_WRITER(5mcfg, "MCFG", acpi_write_mcfg, 0);
diff --git a/scripts/Makefile.autoconf b/scripts/Makefile.autoconf
index 5ed9abc..0b3ffa0 100644
--- a/scripts/Makefile.autoconf
+++ b/scripts/Makefile.autoconf
@@ -68,7 +68,7 @@
       cmd_u_boot_cfg = \
 	$(CPP) $(c_flags) $2 -DDO_DEPS_ONLY -dM $(srctree)/include/common.h > $@.tmp && { \
 		grep 'define CONFIG_' $@.tmp | \
-			sed '/define CONFIG_IS_ENABLED(/d;/define CONFIG_VAL(/d;' > $@; \
+			sed '/define CONFIG_IS_ENABLED(/d;/define CONFIG_IF_ENABLED_INT(/d;/define CONFIG_VAL(/d;' > $@; \
 		rm $@.tmp;						\
 	} || {								\
 		rm $@.tmp; false;					\
diff --git a/scripts/Makefile.dts b/scripts/Makefile.dts
new file mode 100644
index 0000000..2561025
--- /dev/null
+++ b/scripts/Makefile.dts
@@ -0,0 +1,3 @@
+# SPDX-License-Identifier: GPL-2.0+
+
+dtb-y += $(patsubst %,%.dtb,$(subst ",,$(CONFIG_$(SPL_)OF_LIST)))
diff --git a/scripts/config_whitelist.txt b/scripts/config_whitelist.txt
index 7b45d57..6b21e39 100644
--- a/scripts/config_whitelist.txt
+++ b/scripts/config_whitelist.txt
@@ -21,7 +21,6 @@
 CONFIG_AT91_GPIO_PULLUP
 CONFIG_AT91_LED
 CONFIG_AT91_WANTS_COMMON_PHY
-CONFIG_ATAPI
 CONFIG_ATMEL_LCD
 CONFIG_ATMEL_LCD_BGR555
 CONFIG_ATMEL_LCD_RGB565
@@ -440,7 +439,6 @@
 CONFIG_ICACHE
 CONFIG_ICS307_REFCLK_HZ
 CONFIG_IDE_PREINIT
-CONFIG_IDE_RESET
 CONFIG_IMX
 CONFIG_IMX6_PWM_PER_CLK
 CONFIG_IMX_HDMI
@@ -683,7 +681,6 @@
 CONFIG_RAMDISK_BOOT
 CONFIG_RD_LVL
 CONFIG_RED_LED
-CONFIG_REMAKE_ELF
 CONFIG_RESERVED_01_BASE
 CONFIG_RESERVED_02_BASE
 CONFIG_RESERVED_03_BASE
@@ -725,7 +722,6 @@
 CONFIG_SATA1
 CONFIG_SATA2
 CONFIG_SCIF_A
-CONFIG_SCSI_AHCI_PLAT
 CONFIG_SCSI_DEV_LIST
 CONFIG_SC_TIMER_CLK
 CONFIG_SDCARD
@@ -844,13 +840,6 @@
 CONFIG_SYS_AT91_PLLA
 CONFIG_SYS_AT91_PLLB
 CONFIG_SYS_AT91_SLOW_CLOCK
-CONFIG_SYS_ATA_ALT_OFFSET
-CONFIG_SYS_ATA_BASE_ADDR
-CONFIG_SYS_ATA_DATA_OFFSET
-CONFIG_SYS_ATA_IDE0_OFFSET
-CONFIG_SYS_ATA_IDE1_OFFSET
-CONFIG_SYS_ATA_REG_OFFSET
-CONFIG_SYS_ATA_STRIDE
 CONFIG_SYS_AUTOLOAD
 CONFIG_SYS_AUTOMATIC_SDRAM_DETECTION
 CONFIG_SYS_AUXCORE_BOOTDATA
@@ -1416,8 +1405,6 @@
 CONFIG_SYS_I2C_TCA642X_ADDR
 CONFIG_SYS_I2C_TCA642X_BUS_NUM
 CONFIG_SYS_ICACHE_INV
-CONFIG_SYS_IDE_MAXBUS
-CONFIG_SYS_IDE_MAXDEVICE
 CONFIG_SYS_IFC_ADDR
 CONFIG_SYS_IFC_CCR
 CONFIG_SYS_INIT_DBCR
@@ -1800,7 +1787,6 @@
 CONFIG_SYS_PIOC_PPUDR_VAL
 CONFIG_SYS_PIOD_PDR_VAL1
 CONFIG_SYS_PIOD_PPUDR_VAL
-CONFIG_SYS_PIO_MODE
 CONFIG_SYS_PJPAR
 CONFIG_SYS_PL310_BASE
 CONFIG_SYS_PLLAR_VAL
@@ -1859,7 +1845,6 @@
 CONFIG_SYS_SATA2_FLAGS
 CONFIG_SYS_SATA2_OFFSET
 CONFIG_SYS_SATA_FAT_BOOT_PARTITION
-CONFIG_SYS_SATA_MAX_DEVICE
 CONFIG_SYS_SBFHDR_DATA_OFFSET
 CONFIG_SYS_SBFHDR_SIZE
 CONFIG_SYS_SCCR_SATACM
@@ -1867,9 +1852,6 @@
 CONFIG_SYS_SCCR_TSEC2CM
 CONFIG_SYS_SCCR_USBDRCM
 CONFIG_SYS_SCR
-CONFIG_SYS_SCSI_MAX_DEVICE
-CONFIG_SYS_SCSI_MAX_LUN
-CONFIG_SYS_SCSI_MAX_SCSI_ID
 CONFIG_SYS_SDRAM
 CONFIG_SYS_SDRAM_BASE
 CONFIG_SYS_SDRAM_BASE0
diff --git a/scripts/pylint.base b/scripts/pylint.base
index 8c650f2..7e25108 100644
--- a/scripts/pylint.base
+++ b/scripts/pylint.base
@@ -1,5 +1,5 @@
-test_conftest.py 6.43
-test_multiplexed_log.py 7.20
+test_conftest.py 6.56
+test_multiplexed_log.py 7.49
 test_test.py 8.18
 test_tests_test_000_version.py 7.50
 test_tests_test_android_test_ab.py 6.50
@@ -10,35 +10,35 @@
 test_tests_test_dfu.py 5.45
 test_tests_test_dm.py 9.52
 test_tests_test_efi_capsule_capsule_defs.py 5.00
-test_tests_test_efi_capsule_conftest.py 1.25
+test_tests_test_efi_capsule_conftest.py 1.88
 test_tests_test_efi_capsule_test_capsule_firmware.py 3.89
-test_tests_test_efi_fit.py 7.59
+test_tests_test_efi_fit.py 8.16
 test_tests_test_efi_loader.py 7.38
-test_tests_test_efi_secboot_conftest.py -3.84
+test_tests_test_efi_secboot_conftest.py -3.29
 test_tests_test_efi_secboot_defs.py 6.67
 test_tests_test_efi_secboot_test_authvar.py 8.93
 test_tests_test_efi_secboot_test_signed.py 8.38
 test_tests_test_efi_secboot_test_signed_intca.py 8.10
 test_tests_test_efi_secboot_test_unsigned.py 8.00
 test_tests_test_efi_selftest.py 6.36
-test_tests_test_env.py 7.08
+test_tests_test_env.py 7.15
 test_tests_test_extension.py 2.14
-test_tests_test_fit.py 6.20
-test_tests_test_fit_ecdsa.py 7.50
+test_tests_test_fit.py 6.83
+test_tests_test_fit_ecdsa.py 7.94
 test_tests_test_fit_hashes.py 7.70
 test_tests_test_fpga.py 1.81
-test_tests_test_fs_conftest.py 4.62
+test_tests_test_fs_conftest.py 5.13
 test_tests_test_fs_fstest_defs.py 8.33
 test_tests_test_fs_fstest_helpers.py 4.29
-test_tests_test_fs_test_basic.py 0.40
-test_tests_test_fs_test_ext.py -0.25
+test_tests_test_fs_test_basic.py 0.60
+test_tests_test_fs_test_ext.py 0.00
 test_tests_test_fs_test_fs_cmd.py 8.00
 test_tests_test_fs_test_mkdir.py 1.96
-test_tests_test_fs_test_squashfs_sqfs_common.py 8.12
-test_tests_test_fs_test_squashfs_test_sqfs_load.py 7.12
+test_tests_test_fs_test_squashfs_sqfs_common.py 8.41
+test_tests_test_fs_test_squashfs_test_sqfs_load.py 7.46
 test_tests_test_fs_test_squashfs_test_sqfs_ls.py 8.00
-test_tests_test_fs_test_symlink.py 0.82
-test_tests_test_fs_test_unlink.py 2.22
+test_tests_test_fs_test_symlink.py 1.22
+test_tests_test_fs_test_unlink.py 2.78
 test_tests_test_gpio.py 6.09
 test_tests_test_gpt.py 7.67
 test_tests_test_handoff.py 5.00
@@ -57,7 +57,7 @@
 test_tests_test_qfw.py 8.75
 test_tests_test_sandbox_exit.py 6.50
 test_tests_test_scp03.py 3.33
-test_tests_test_sf.py 7.02
+test_tests_test_sf.py 7.13
 test_tests_test_shell_basics.py 9.58
 test_tests_test_sleep.py 7.78
 test_tests_test_spl.py 2.22
@@ -66,32 +66,32 @@
 test_tests_test_ums.py 6.32
 test_tests_test_unknown_cmd.py 5.00
 test_tests_test_ut.py 7.06
-test_tests_test_vboot.py 6.00
+test_tests_test_vboot.py 6.08
 test_tests_vboot_evil.py 8.95
 test_tests_vboot_forge.py 9.22
-test_u_boot_console_base.py 6.80
-test_u_boot_console_exec_attach.py 8.85
-test_u_boot_console_sandbox.py 7.22
-test_u_boot_spawn.py 7.39
-test_u_boot_utils.py 6.25
+test_u_boot_console_base.py 7.08
+test_u_boot_console_exec_attach.py 9.23
+test_u_boot_console_sandbox.py 8.06
+test_u_boot_spawn.py 7.65
+test_u_boot_utils.py 6.94
 tools_binman_bintool 8.59
 tools_binman_bintool_test 9.87
 tools_binman_btool__testing 6.09
-tools_binman_btool_cbfstool 7.39
+tools_binman_btool_cbfstool 7.83
 tools_binman_btool_fiptool 7.62
-tools_binman_btool_futility 6.96
-tools_binman_btool_ifwitool 3.33
-tools_binman_btool_lz4 5.93
-tools_binman_btool_lzma_alone 6.67
-tools_binman_btool_mkimage 6.79
-tools_binman_cbfs_util 7.77
-tools_binman_cbfs_util_test 9.27
+tools_binman_btool_futility 7.39
+tools_binman_btool_ifwitool 3.81
+tools_binman_btool_lz4 6.30
+tools_binman_btool_lzma_alone 6.97
+tools_binman_btool_mkimage 7.86
+tools_binman_cbfs_util 8.46
+tools_binman_cbfs_util_test 9.38
 tools_binman_cmdline 9.03
-tools_binman_comp_util 6.25
-tools_binman_control 4.60
-tools_binman_elf 6.42
+tools_binman_comp_util 6.88
+tools_binman_control 5.01
+tools_binman_elf 6.73
 tools_binman_elf_test 5.41
-tools_binman_entry 2.48
+tools_binman_entry 3.36
 tools_binman_entry_test 5.34
 tools_binman_etype__testing 0.83
 tools_binman_etype_atf_bl31 -6.00
@@ -103,15 +103,15 @@
 tools_binman_etype_blob_named_by_arg -7.78
 tools_binman_etype_blob_phase -5.00
 tools_binman_etype_cbfs -1.44
-tools_binman_etype_collection 2.33
+tools_binman_etype_collection 2.67
 tools_binman_etype_cros_ec_rw -6.00
-tools_binman_etype_fdtmap -3.61
+tools_binman_etype_fdtmap -3.28
 tools_binman_etype_files -7.43
 tools_binman_etype_fill -6.43
-tools_binman_etype_fit 5.18
-tools_binman_etype_fmap -0.59
+tools_binman_etype_fit 4.64
+tools_binman_etype_fmap -0.29
 tools_binman_etype_gbb 0.83
-tools_binman_etype_image_header 5.58
+tools_binman_etype_image_header 5.77
 tools_binman_etype_intel_cmc -12.50
 tools_binman_etype_intel_descriptor 4.62
 tools_binman_etype_intel_fit 0.00
@@ -130,7 +130,7 @@
 tools_binman_etype_opensbi -6.00
 tools_binman_etype_powerpc_mpc85xx_bootpg_resetvec -10.00
 tools_binman_etype_scp -6.00
-tools_binman_etype_section 4.12
+tools_binman_etype_section 4.57
 tools_binman_etype_text -0.48
 tools_binman_etype_u_boot -15.71
 tools_binman_etype_u_boot_dtb -12.22
@@ -157,7 +157,7 @@
 tools_binman_etype_u_boot_tpl_with_ucode_ptr -20.83
 tools_binman_etype_u_boot_ucode 1.52
 tools_binman_etype_u_boot_with_ucode_ptr -0.71
-tools_binman_etype_vblock 0.00
+tools_binman_etype_vblock 0.27
 tools_binman_etype_x86_reset16 -15.71
 tools_binman_etype_x86_reset16_spl -15.71
 tools_binman_etype_x86_reset16_tpl -15.71
@@ -167,60 +167,61 @@
 tools_binman_fdt_test 3.23
 tools_binman_fip_util 9.85
 tools_binman_fip_util_test 10.00
-tools_binman_fmap_util 6.67
-tools_binman_ftest 7.39
-tools_binman_image 6.48
+tools_binman_fmap_util 6.88
+tools_binman_ftest 7.45
+tools_binman_image 7.12
 tools_binman_image_test 4.48
-tools_binman_main 4.29
+tools_binman_main 4.86
 tools_binman_setup 5.00
-tools_binman_state 3.43
-tools_buildman_board 7.11
-tools_buildman_bsettings 0.98
-tools_buildman_builder 6.55
-tools_buildman_builderthread 7.35
-tools_buildman_cmdline 8.85
-tools_buildman_control 7.04
-tools_buildman_func_test 6.38
-tools_buildman_kconfiglib 7.48
-tools_buildman_main 1.43
-tools_buildman_test 6.10
-tools_buildman_toolchain 5.62
-tools_concurrencytest_concurrencytest 6.77
-tools_dtoc_dtb_platdata 7.82
-tools_dtoc_fdt 3.47
-tools_dtoc_fdt_util 5.00
-tools_dtoc_main 7.33
+tools_binman_state 4.15
+tools_buildman_board 7.82
+tools_buildman_bsettings 1.71
+tools_buildman_builder 6.92
+tools_buildman_builderthread 7.48
+tools_buildman_cfgutil 7.83
+tools_buildman_cmdline 8.89
+tools_buildman_control 8.12
+tools_buildman_func_test 7.18
+tools_buildman_kconfiglib 7.49
+tools_buildman_main -1.11
+tools_buildman_test 6.56
+tools_buildman_toolchain 6.44
+tools_concurrencytest_concurrencytest 7.26
+tools_dtoc_dtb_platdata 7.90
+tools_dtoc_fdt 4.50
+tools_dtoc_fdt_util 6.70
+tools_dtoc_main 7.78
 tools_dtoc_setup 5.00
-tools_dtoc_src_scan 8.75
-tools_dtoc_test_dtoc 8.54
-tools_dtoc_test_fdt 6.92
+tools_dtoc_src_scan 8.91
+tools_dtoc_test_dtoc 8.56
+tools_dtoc_test_fdt 6.96
 tools_dtoc_test_src_scan 9.43
 tools_efivar 6.71
-tools_endian-swap 8.93
-tools_genboardscfg 7.27
-tools_microcode-tool 7.19
-tools_moveconfig 8.11
+tools_endian-swap 9.29
+tools_genboardscfg 7.95
+tools_microcode-tool 7.25
+tools_moveconfig 8.32
 tools_patman___init__ 0.00
-tools_patman_checkpatch 7.61
-tools_patman_command 4.23
-tools_patman_commit 2.75
+tools_patman_checkpatch 8.48
+tools_patman_command 5.51
+tools_patman_commit 4.50
 tools_patman_control 8.14
-tools_patman_cros_subprocess 7.41
-tools_patman_func_test 7.87
-tools_patman_get_maintainer 4.71
-tools_patman_gitutil 4.58
-tools_patman_main 8.23
-tools_patman_patchstream 9.04
-tools_patman_project 3.33
-tools_patman_series 5.95
-tools_patman_settings 5.63
+tools_patman_cros_subprocess 7.76
+tools_patman_func_test 8.51
+tools_patman_get_maintainer 7.06
+tools_patman_gitutil 6.65
+tools_patman_main 7.90
+tools_patman_patchstream 9.11
+tools_patman_project 7.78
+tools_patman_series 6.16
+tools_patman_settings 5.89
 tools_patman_setup 5.00
-tools_patman_status 8.43
-tools_patman_terminal 6.29
-tools_patman_test_checkpatch 6.81
-tools_patman_test_util 6.51
-tools_patman_tools 3.98
-tools_patman_tout 2.97
-tools_rkmux 6.76
+tools_patman_status 8.62
+tools_patman_terminal 8.00
+tools_patman_test_checkpatch 7.75
+tools_patman_test_util 7.64
+tools_patman_tools 5.68
+tools_patman_tout 5.31
+tools_rkmux 6.90
 tools_rmboard 7.76
 tools_zynqmp_pm_cfg_obj_convert 6.67
diff --git a/tools/binman/bintool.py b/tools/binman/bintool.py
index e2e5660..8435b29 100644
--- a/tools/binman/bintool.py
+++ b/tools/binman/bintool.py
@@ -174,7 +174,7 @@
                 res = self.fetch(meth)
             except urllib.error.URLError as uerr:
                 message = uerr.reason
-                print(col.Color(col.RED, f'- {message}'))
+                print(col.build(col.RED, f'- {message}'))
 
             except ValueError as exc:
                 print(f'Exception: {exc}')
@@ -182,7 +182,7 @@
 
         if skip_present and self.is_present():
             return PRESENT
-        print(col.Color(col.YELLOW, 'Fetch: %s' % self.name))
+        print(col.build(col.YELLOW, 'Fetch: %s' % self.name))
         if method == FETCH_ANY:
             for try_method in range(1, FETCH_COUNT):
                 print(f'- trying method: {FETCH_NAMES[try_method]}')
@@ -216,7 +216,7 @@
             True on success, False on failure
         """
         def show_status(color, prompt, names):
-            print(col.Color(
+            print(col.build(
                 color, f'{prompt}:%s{len(names):2}: %s' %
                 (' ' * (16 - len(prompt)), ' '.join(names))))
 
@@ -227,7 +227,7 @@
             name_list = Bintool.get_tool_list()
             if names_to_fetch[0] == 'missing':
                 skip_present = True
-            print(col.Color(col.YELLOW,
+            print(col.build(col.YELLOW,
                             'Fetching tools:      %s' % ' '.join(name_list)))
         status = collections.defaultdict(list)
         for name in name_list:
@@ -267,8 +267,8 @@
         name = os.path.expanduser(self.name)  # Expand paths containing ~
         all_args = (name,) + args
         env = tools.get_env_with_path()
-        tout.Detail(f"bintool: {' '.join(all_args)}")
-        result = command.RunPipe(
+        tout.detail(f"bintool: {' '.join(all_args)}")
+        result = command.run_pipe(
             [all_args], capture=True, capture_stderr=True, env=env,
             raise_on_error=False, binary=binary)
 
@@ -278,17 +278,17 @@
             # try to run it (as above) since RunPipe() allows faking the tool's
             # output
             if not any([result.stdout, result.stderr, tools.tool_find(name)]):
-                tout.Info(f"bintool '{name}' not found")
+                tout.info(f"bintool '{name}' not found")
                 return None
             if raise_on_error:
-                tout.Info(f"bintool '{name}' failed")
+                tout.info(f"bintool '{name}' failed")
                 raise ValueError("Error %d running '%s': %s" %
                                 (result.return_code, ' '.join(all_args),
                                 result.stderr or result.stdout))
         if result.stdout:
-            tout.Debug(result.stdout)
+            tout.debug(result.stdout)
         if result.stderr:
-            tout.Debug(result.stderr)
+            tout.debug(result.stderr)
         return result
 
     def run_cmd(self, *args, binary=False):
@@ -327,9 +327,9 @@
         """
         tmpdir = tempfile.mkdtemp(prefix='binmanf.')
         print(f"- clone git repo '{git_repo}' to '{tmpdir}'")
-        tools.Run('git', 'clone', '--depth', '1', git_repo, tmpdir)
+        tools.run('git', 'clone', '--depth', '1', git_repo, tmpdir)
         print(f"- build target '{make_target}'")
-        tools.Run('make', '-C', tmpdir, '-j', f'{multiprocessing.cpu_count()}',
+        tools.run('make', '-C', tmpdir, '-j', f'{multiprocessing.cpu_count()}',
                   make_target)
         fname = os.path.join(tmpdir, bintool_path)
         if not os.path.exists(fname):
@@ -349,8 +349,8 @@
                 str: Filename of fetched file to copy to a suitable directory
                 str: Name of temp directory to remove, or None
         """
-        fname, tmpdir = tools.Download(url)
-        tools.Run('chmod', 'a+x', fname)
+        fname, tmpdir = tools.download(url)
+        tools.run('chmod', 'a+x', fname)
         return fname, tmpdir
 
     @classmethod
@@ -384,7 +384,7 @@
         """
         args = ['sudo', 'apt', 'install', '-y', package]
         print('- %s' % ' '.join(args))
-        tools.Run(*args)
+        tools.run(*args)
         return True
 
     @staticmethod
diff --git a/tools/binman/bintool_test.py b/tools/binman/bintool_test.py
index 3d6bcda..7efb839 100644
--- a/tools/binman/bintool_test.py
+++ b/tools/binman/bintool_test.py
@@ -80,7 +80,7 @@
 
         Args:
             fake_download (function): Function to call instead of
-                tools.Download()
+                tools.download()
             method (bintool.FETCH_...: Fetch method to use
 
         Returns:
@@ -88,7 +88,7 @@
         """
         btest = Bintool.create('_testing')
         col = terminal.Color()
-        with unittest.mock.patch.object(tools, 'Download',
+        with unittest.mock.patch.object(tools, 'download',
                                         side_effect=fake_download):
             with test_util.capture_sys_output() as (stdout, _):
                 btest.fetch_tool(method, col, False)
@@ -97,7 +97,7 @@
     def test_fetch_url_err(self):
         """Test an error while fetching a tool from a URL"""
         def fail_download(url):
-            """Take the tools.Download() function by raising an exception"""
+            """Take the tools.download() function by raising an exception"""
             raise urllib.error.URLError('my error')
 
         stdout = self.check_fetch_url(fail_download, bintool.FETCH_ANY)
@@ -114,7 +114,7 @@
     def test_fetch_method(self):
         """Test fetching using a particular method"""
         def fail_download(url):
-            """Take the tools.Download() function by raising an exception"""
+            """Take the tools.download() function by raising an exception"""
             raise urllib.error.URLError('my error')
 
         stdout = self.check_fetch_url(fail_download, bintool.FETCH_BIN)
@@ -123,11 +123,11 @@
     def test_fetch_pass_fail(self):
         """Test fetching multiple tools with some passing and some failing"""
         def handle_download(_):
-            """Take the tools.Download() function by writing a file"""
+            """Take the tools.download() function by writing a file"""
             if self.seq:
                 raise urllib.error.URLError('not found')
             self.seq += 1
-            tools.WriteFile(fname, expected)
+            tools.write_file(fname, expected)
             return fname, dirname
 
         expected = b'this is a test'
@@ -140,12 +140,12 @@
         self.seq = 0
 
         with unittest.mock.patch.object(bintool, 'DOWNLOAD_DESTDIR', destdir):
-            with unittest.mock.patch.object(tools, 'Download',
+            with unittest.mock.patch.object(tools, 'download',
                                             side_effect=handle_download):
                 with test_util.capture_sys_output() as (stdout, _):
                     Bintool.fetch_tools(bintool.FETCH_ANY, ['_testing'] * 2)
         self.assertTrue(os.path.exists(dest_fname))
-        data = tools.ReadFile(dest_fname)
+        data = tools.read_file(dest_fname)
         self.assertEqual(expected, data)
 
         lines = stdout.getvalue().splitlines()
@@ -245,14 +245,14 @@
                 tmpdir = cmd[2]
                 self.fname = os.path.join(tmpdir, 'pathname')
                 if write_file:
-                    tools.WriteFile(self.fname, b'hello')
+                    tools.write_file(self.fname, b'hello')
 
         btest = Bintool.create('_testing')
         col = terminal.Color()
         self.fname = None
         with unittest.mock.patch.object(bintool, 'DOWNLOAD_DESTDIR',
                                         self._indir):
-            with unittest.mock.patch.object(tools, 'Run', side_effect=fake_run):
+            with unittest.mock.patch.object(tools, 'run', side_effect=fake_run):
                 with test_util.capture_sys_output() as (stdout, _):
                     btest.fetch_tool(bintool.FETCH_BUILD, col, False)
         fname = os.path.join(self._indir, '_testing')
@@ -275,7 +275,7 @@
         btest = Bintool.create('_testing')
         btest.install = True
         col = terminal.Color()
-        with unittest.mock.patch.object(tools, 'Run', return_value=None):
+        with unittest.mock.patch.object(tools, 'run', return_value=None):
             with test_util.capture_sys_output() as _:
                 result = btest.fetch_tool(bintool.FETCH_BIN, col, False)
         self.assertEqual(bintool.FETCHED, result)
@@ -292,8 +292,8 @@
     def test_all_bintools(self):
         """Test that all bintools can handle all available fetch types"""
         def handle_download(_):
-            """Take the tools.Download() function by writing a file"""
-            tools.WriteFile(fname, expected)
+            """Take the tools.download() function by writing a file"""
+            tools.write_file(fname, expected)
             return fname, dirname
 
         def fake_run(*cmd):
@@ -301,15 +301,15 @@
                 # See Bintool.build_from_git()
                 tmpdir = cmd[2]
                 self.fname = os.path.join(tmpdir, 'pathname')
-                tools.WriteFile(self.fname, b'hello')
+                tools.write_file(self.fname, b'hello')
 
         expected = b'this is a test'
         dirname = os.path.join(self._indir, 'download_dir')
         os.mkdir(dirname)
         fname = os.path.join(dirname, 'downloaded')
 
-        with unittest.mock.patch.object(tools, 'Run', side_effect=fake_run):
-            with unittest.mock.patch.object(tools, 'Download',
+        with unittest.mock.patch.object(tools, 'run', side_effect=fake_run):
+            with unittest.mock.patch.object(tools, 'download',
                                             side_effect=handle_download):
                 with test_util.capture_sys_output() as _:
                     for name in Bintool.get_tool_list():
@@ -320,7 +320,7 @@
                             if result is not True and result is not None:
                                 result_fname, _ = result
                                 self.assertTrue(os.path.exists(result_fname))
-                                data = tools.ReadFile(result_fname)
+                                data = tools.read_file(result_fname)
                                 self.assertEqual(expected, data)
                                 os.remove(result_fname)
 
diff --git a/tools/binman/btool/lz4.py b/tools/binman/btool/lz4.py
index d165f52..f09c5c8 100644
--- a/tools/binman/btool/lz4.py
+++ b/tools/binman/btool/lz4.py
@@ -88,8 +88,8 @@
             bytes: Compressed data
         """
         with tempfile.NamedTemporaryFile(prefix='comp.tmp',
-                                         dir=tools.GetOutputDir()) as tmp:
-            tools.WriteFile(tmp.name, indata)
+                                         dir=tools.get_output_dir()) as tmp:
+            tools.write_file(tmp.name, indata)
             args = ['--no-frame-crc', '-B4', '-5', '-c', tmp.name]
             return self.run_cmd(*args, binary=True)
 
@@ -103,8 +103,8 @@
             bytes: Decompressed data
         """
         with tempfile.NamedTemporaryFile(prefix='decomp.tmp',
-                                         dir=tools.GetOutputDir()) as inf:
-            tools.WriteFile(inf.name, indata)
+                                         dir=tools.get_output_dir()) as inf:
+            tools.write_file(inf.name, indata)
             args = ['-cd', inf.name]
             return self.run_cmd(*args, binary=True)
 
diff --git a/tools/binman/btool/lzma_alone.py b/tools/binman/btool/lzma_alone.py
index d7c62df..52a960f 100644
--- a/tools/binman/btool/lzma_alone.py
+++ b/tools/binman/btool/lzma_alone.py
@@ -65,13 +65,13 @@
             bytes: Compressed data
         """
         with tempfile.NamedTemporaryFile(prefix='comp.tmp',
-                                         dir=tools.GetOutputDir()) as inf:
-            tools.WriteFile(inf.name, indata)
+                                         dir=tools.get_output_dir()) as inf:
+            tools.write_file(inf.name, indata)
             with tempfile.NamedTemporaryFile(prefix='compo.otmp',
-                                             dir=tools.GetOutputDir()) as outf:
+                                             dir=tools.get_output_dir()) as outf:
                 args = ['e', inf.name, outf.name, '-lc1', '-lp0', '-pb0', '-d8']
                 self.run_cmd(*args, binary=True)
-                return tools.ReadFile(outf.name)
+                return tools.read_file(outf.name)
 
     def decompress(self, indata):
         """Decompress data with lzma_alone
@@ -83,13 +83,13 @@
             bytes: Decompressed data
         """
         with tempfile.NamedTemporaryFile(prefix='decomp.tmp',
-                                         dir=tools.GetOutputDir()) as inf:
-            tools.WriteFile(inf.name, indata)
+                                         dir=tools.get_output_dir()) as inf:
+            tools.write_file(inf.name, indata)
             with tempfile.NamedTemporaryFile(prefix='compo.otmp',
-                                             dir=tools.GetOutputDir()) as outf:
+                                             dir=tools.get_output_dir()) as outf:
                 args = ['d', inf.name, outf.name]
                 self.run_cmd(*args, binary=True)
-                return tools.ReadFile(outf.name, binary=True)
+                return tools.read_file(outf.name, binary=True)
 
     def fetch(self, method):
         """Fetch handler for lzma_alone
diff --git a/tools/binman/cbfs_util.py b/tools/binman/cbfs_util.py
index eea7868..9cad038 100644
--- a/tools/binman/cbfs_util.py
+++ b/tools/binman/cbfs_util.py
@@ -189,9 +189,9 @@
     Returns:
         String with required padding (at least one 0x00 byte) at the end
     """
-    val = tools.ToBytes(instr)
+    val = tools.to_bytes(instr)
     pad_len = align_int(len(val) + 1, FILENAME_ALIGN)
-    return val + tools.GetBytes(0, pad_len - len(val))
+    return val + tools.get_bytes(0, pad_len - len(val))
 
 
 class CbfsFile(object):
@@ -371,7 +371,7 @@
                                FILE_ATTR_TAG_COMPRESSION, ATTR_COMPRESSION_LEN,
                                self.compress, self.memlen)
         elif self.ftype == TYPE_EMPTY:
-            data = tools.GetBytes(self.erase_byte, self.size)
+            data = tools.get_bytes(self.erase_byte, self.size)
         else:
             raise ValueError('Unknown type %#x when writing\n' % self.ftype)
         if attr:
@@ -388,7 +388,7 @@
                 # possible.
                 raise ValueError("Internal error: CBFS file '%s': Requested offset %#x but current output position is %#x" %
                                  (self.name, self.cbfs_offset, offset))
-            pad = tools.GetBytes(pad_byte, pad_len)
+            pad = tools.get_bytes(pad_byte, pad_len)
             hdr_len += pad_len
 
         # This is the offset of the start of the file's data,
@@ -414,7 +414,7 @@
     Usage is something like:
 
         cbw = CbfsWriter(size)
-        cbw.add_file_raw('u-boot', tools.ReadFile('u-boot.bin'))
+        cbw.add_file_raw('u-boot', tools.read_file('u-boot.bin'))
         ...
         data, cbfs_offset = cbw.get_data_and_offset()
 
@@ -482,7 +482,7 @@
         if fd.tell() > offset:
             raise ValueError('No space for data before offset %#x (current offset %#x)' %
                              (offset, fd.tell()))
-        fd.write(tools.GetBytes(self._erase_byte, offset - fd.tell()))
+        fd.write(tools.get_bytes(self._erase_byte, offset - fd.tell()))
 
     def _pad_to(self, fd, offset):
         """Write out pad bytes and/or an empty file until a given offset
diff --git a/tools/binman/cbfs_util_test.py b/tools/binman/cbfs_util_test.py
index 494f614..f86b295 100755
--- a/tools/binman/cbfs_util_test.py
+++ b/tools/binman/cbfs_util_test.py
@@ -36,7 +36,7 @@
     def setUpClass(cls):
         # Create a temporary directory for test files
         cls._indir = tempfile.mkdtemp(prefix='cbfs_util.')
-        tools.SetInputDirs([cls._indir])
+        tools.set_input_dirs([cls._indir])
 
         # Set up some useful data files
         TestCbfs._make_input_file('u-boot.bin', U_BOOT_DATA)
@@ -45,7 +45,7 @@
 
         # Set up a temporary output directory, used by the tools library when
         # compressing files
-        tools.PrepareOutputDir(None)
+        tools.prepare_output_dir(None)
 
         cls.cbfstool = bintool.Bintool.create('cbfstool')
         cls.have_cbfstool = cls.cbfstool.is_present()
@@ -58,7 +58,7 @@
         if cls._indir:
             shutil.rmtree(cls._indir)
         cls._indir = None
-        tools.FinaliseOutputDir()
+        tools.finalise_output_dir()
 
     @classmethod
     def _make_input_file(cls, fname, contents):
@@ -71,7 +71,7 @@
             Full pathname of file created
         """
         pathname = os.path.join(cls._indir, fname)
-        tools.WriteFile(pathname, contents)
+        tools.write_file(pathname, contents)
         return pathname
 
     def _check_hdr(self, data, size, offset=0, arch=cbfs_util.ARCHITECTURE_X86):
@@ -176,12 +176,12 @@
             base = [(1 << 32) - size + b for b in base]
         self.cbfstool.add_raw(
             cbfs_fname, 'u-boot',
-            tools.GetInputFilename(compress and 'compress' or 'u-boot.bin'),
+            tools.get_input_filename(compress and 'compress' or 'u-boot.bin'),
             compress[0] if compress else None,
             base[0] if base else None)
         self.cbfstool.add_raw(
             cbfs_fname, 'u-boot-dtb',
-            tools.GetInputFilename(compress and 'compress' or 'u-boot.dtb'),
+            tools.get_input_filename(compress and 'compress' or 'u-boot.dtb'),
             compress[1] if compress else None,
             base[1] if base else None)
         return cbfs_fname
@@ -198,10 +198,10 @@
         """
         if not self.have_cbfstool or not self.have_lz4:
             return
-        expect = tools.ReadFile(cbfstool_fname)
+        expect = tools.read_file(cbfstool_fname)
         if expect != data:
-            tools.WriteFile('/tmp/expect', expect)
-            tools.WriteFile('/tmp/actual', data)
+            tools.write_file('/tmp/expect', expect)
+            tools.write_file('/tmp/actual', data)
             print('diff -y <(xxd -g1 /tmp/expect) <(xxd -g1 /tmp/actual) | colordiff')
             self.fail('cbfstool produced a different result')
 
@@ -482,7 +482,7 @@
 
         size = 0xb0
         cbw = CbfsWriter(size)
-        cbw.add_file_stage('u-boot', tools.ReadFile(elf_fname))
+        cbw.add_file_stage('u-boot', tools.read_file(elf_fname))
 
         data = cbw.get_data()
         cbfs = self._check_hdr(data, size)
diff --git a/tools/binman/control.py b/tools/binman/control.py
index 2daad05..a179f78 100644
--- a/tools/binman/control.py
+++ b/tools/binman/control.py
@@ -99,9 +99,9 @@
     return result
 
 def _ShowBlobHelp(path, text):
-    tout.Warning('\n%s:' % path)
+    tout.warning('\n%s:' % path)
     for line in text.splitlines():
-        tout.Warning('   %s' % line)
+        tout.warning('   %s' % line)
 
 def _ShowHelpForMissingBlobs(missing_list):
     """Show help for each missing blob to help the user take action
@@ -258,15 +258,15 @@
             raise ValueError('Must specify exactly one entry path to write with -f')
         entry = image.FindEntryPath(entry_paths[0])
         data = entry.ReadData(decomp, alt_format)
-        tools.WriteFile(output_fname, data)
-        tout.Notice("Wrote %#x bytes to file '%s'" % (len(data), output_fname))
+        tools.write_file(output_fname, data)
+        tout.notice("Wrote %#x bytes to file '%s'" % (len(data), output_fname))
         return
 
     # Otherwise we will output to a path given by the entry path of each entry.
     # This means that entries will appear in subdirectories if they are part of
     # a sub-section.
     einfos = image.GetListEntries(entry_paths)[0]
-    tout.Notice('%d entries match and will be written' % len(einfos))
+    tout.notice('%d entries match and will be written' % len(einfos))
     for einfo in einfos:
         entry = einfo.entry
         data = entry.ReadData(decomp, alt_format)
@@ -279,9 +279,9 @@
             if fname and not os.path.exists(fname):
                 os.makedirs(fname)
             fname = os.path.join(fname, 'root')
-        tout.Notice("Write entry '%s' size %x to '%s'" %
+        tout.notice("Write entry '%s' size %x to '%s'" %
                     (entry.GetPath(), len(data), fname))
-        tools.WriteFile(fname, data)
+        tools.write_file(fname, data)
     return einfos
 
 
@@ -328,7 +328,7 @@
             of the entries), False to raise an exception
         write_map: True to write a map file
     """
-    tout.Info('Processing image')
+    tout.info('Processing image')
     ProcessImage(image, update_fdt=True, write_map=write_map,
                  get_contents=False, allow_resize=allow_resize)
 
@@ -336,7 +336,7 @@
 def WriteEntryToImage(image, entry, data, do_compress=True, allow_resize=True,
                       write_map=False):
     BeforeReplace(image, allow_resize)
-    tout.Info('Writing data to %s' % entry.GetPath())
+    tout.info('Writing data to %s' % entry.GetPath())
     ReplaceOneEntry(image, entry, data, do_compress, allow_resize)
     AfterReplace(image, allow_resize=allow_resize, write_map=write_map)
 
@@ -361,7 +361,7 @@
     Returns:
         Image object that was updated
     """
-    tout.Info("Write entry '%s', file '%s'" % (entry_path, image_fname))
+    tout.info("Write entry '%s', file '%s'" % (entry_path, image_fname))
     image = Image.FromFile(image_fname)
     entry = image.FindEntryPath(entry_path)
     WriteEntryToImage(image, entry, data, do_compress=do_compress,
@@ -398,8 +398,8 @@
         if len(entry_paths) != 1:
             raise ValueError('Must specify exactly one entry path to write with -f')
         entry = image.FindEntryPath(entry_paths[0])
-        data = tools.ReadFile(input_fname)
-        tout.Notice("Read %#x bytes from file '%s'" % (len(data), input_fname))
+        data = tools.read_file(input_fname)
+        tout.notice("Read %#x bytes from file '%s'" % (len(data), input_fname))
         WriteEntryToImage(image, entry, data, do_compress=do_compress,
                           allow_resize=allow_resize, write_map=write_map)
         return
@@ -408,7 +408,7 @@
     # This means that files must appear in subdirectories if they are part of
     # a sub-section.
     einfos = image.GetListEntries(entry_paths)[0]
-    tout.Notice("Replacing %d matching entries in image '%s'" %
+    tout.notice("Replacing %d matching entries in image '%s'" %
                 (len(einfos), image_fname))
 
     BeforeReplace(image, allow_resize)
@@ -416,19 +416,19 @@
     for einfo in einfos:
         entry = einfo.entry
         if entry.GetEntries():
-            tout.Info("Skipping section entry '%s'" % entry.GetPath())
+            tout.info("Skipping section entry '%s'" % entry.GetPath())
             continue
 
         path = entry.GetPath()[1:]
         fname = os.path.join(indir, path)
 
         if os.path.exists(fname):
-            tout.Notice("Write entry '%s' from file '%s'" %
+            tout.notice("Write entry '%s' from file '%s'" %
                         (entry.GetPath(), fname))
-            data = tools.ReadFile(fname)
+            data = tools.read_file(fname)
             ReplaceOneEntry(image, entry, data, do_compress, allow_resize)
         else:
-            tout.Warning("Skipping entry '%s' from missing file '%s'" %
+            tout.warning("Skipping entry '%s' from missing file '%s'" %
                          (entry.GetPath(), fname))
 
     AfterReplace(image, allow_resize=allow_resize, write_map=write_map)
@@ -468,8 +468,8 @@
     # output into a file in our output directly. Then scan it for use
     # in binman.
     dtb_fname = fdt_util.EnsureCompiled(dtb_fname)
-    fname = tools.GetOutputFilename('u-boot.dtb.out')
-    tools.WriteFile(fname, tools.ReadFile(dtb_fname))
+    fname = tools.get_output_filename('u-boot.dtb.out')
+    tools.write_file(fname, tools.read_file(dtb_fname))
     dtb = fdt.FdtScan(fname)
 
     node = _FindBinmanNode(dtb)
@@ -488,7 +488,7 @@
             else:
                 skip.append(name)
         images = new_images
-        tout.Notice('Skipping images: %s' % ', '.join(skip))
+        tout.notice('Skipping images: %s' % ', '.join(skip))
 
     state.Prepare(images, dtb)
 
@@ -574,7 +574,7 @@
         if sizes_ok:
             break
         image.ResetForPack()
-    tout.Info('Pack completed after %d pass(es)' % (pack_pass + 1))
+    tout.info('Pack completed after %d pass(es)' % (pack_pass + 1))
     if not sizes_ok:
         image.Raise('Entries changed size after packing (tried %s passes)' %
                     passes)
@@ -585,20 +585,20 @@
     missing_list = []
     image.CheckMissing(missing_list)
     if missing_list:
-        tout.Warning("Image '%s' is missing external blobs and is non-functional: %s" %
+        tout.warning("Image '%s' is missing external blobs and is non-functional: %s" %
                      (image.name, ' '.join([e.name for e in missing_list])))
         _ShowHelpForMissingBlobs(missing_list)
     faked_list = []
     image.CheckFakedBlobs(faked_list)
     if faked_list:
-        tout.Warning(
+        tout.warning(
             "Image '%s' has faked external blobs and is non-functional: %s" %
             (image.name, ' '.join([os.path.basename(e.GetDefaultFilename())
                                    for e in faked_list])))
     missing_bintool_list = []
     image.check_missing_bintools(missing_bintool_list)
     if missing_bintool_list:
-        tout.Warning(
+        tout.warning(
             "Image '%s' has missing bintools and is non-functional: %s" %
             (image.name, ' '.join([os.path.basename(bintool.name)
                                    for bintool in missing_bintool_list])))
@@ -618,7 +618,7 @@
     global state
 
     if args.full_help:
-        tools.PrintFullHelp(
+        tools.print_full_help(
             os.path.join(os.path.dirname(os.path.realpath(sys.argv[0])), 'README.rst')
         )
         return 0
@@ -629,8 +629,8 @@
 
     if args.cmd in ['ls', 'extract', 'replace', 'tool']:
         try:
-            tout.Init(args.verbosity)
-            tools.PrepareOutputDir(None)
+            tout.init(args.verbosity)
+            tools.prepare_output_dir(None)
             if args.cmd == 'ls':
                 ListEntries(args.image, args.paths)
 
@@ -644,7 +644,7 @@
                                allow_resize=not args.fix_size, write_map=args.map)
 
             if args.cmd == 'tool':
-                tools.SetToolPaths(args.toolpath)
+                tools.set_tool_paths(args.toolpath)
                 if args.list:
                     bintool.Bintool.list_all()
                 elif args.fetch:
@@ -658,7 +658,7 @@
         except:
             raise
         finally:
-            tools.FinaliseOutputDir()
+            tools.finalise_output_dir()
         return 0
 
     elf_params = None
@@ -682,7 +682,7 @@
         args.indir.append(board_pathname)
 
     try:
-        tout.Init(args.verbosity)
+        tout.init(args.verbosity)
         elf.debug = args.debug
         cbfs_util.VERBOSE = args.verbosity > 2
         state.use_fake_dtb = args.fake_dtb
@@ -694,9 +694,9 @@
         # runtime.
         use_expanded = not args.no_expanded
         try:
-            tools.SetInputDirs(args.indir)
-            tools.PrepareOutputDir(args.outdir, args.preserve)
-            tools.SetToolPaths(args.toolpath)
+            tools.set_input_dirs(args.indir)
+            tools.prepare_output_dir(args.outdir, args.preserve)
+            tools.set_tool_paths(args.toolpath)
             state.SetEntryArgs(args.entry_arg)
             state.SetThreads(args.threads)
 
@@ -717,20 +717,20 @@
 
             # Write the updated FDTs to our output files
             for dtb_item in state.GetAllFdts():
-                tools.WriteFile(dtb_item._fname, dtb_item.GetContents())
+                tools.write_file(dtb_item._fname, dtb_item.GetContents())
 
             if elf_params:
                 data = state.GetFdtForEtype('u-boot-dtb').GetContents()
                 elf.UpdateFile(*elf_params, data)
 
             if invalid:
-                tout.Warning("\nSome images are invalid")
+                tout.warning("\nSome images are invalid")
 
             # Use this to debug the time take to pack the image
             #state.TimingShow()
         finally:
-            tools.FinaliseOutputDir()
+            tools.finalise_output_dir()
     finally:
-        tout.Uninit()
+        tout.uninit()
 
     return 0
diff --git a/tools/binman/elf.py b/tools/binman/elf.py
index de2bb46..bc4966e 100644
--- a/tools/binman/elf.py
+++ b/tools/binman/elf.py
@@ -54,7 +54,7 @@
           key: Name of symbol
           value: Hex value of symbol
     """
-    stdout = tools.Run('objdump', '-t', fname)
+    stdout = tools.run('objdump', '-t', fname)
     lines = stdout.splitlines()
     if patterns:
         re_syms = re.compile('|'.join(patterns))
@@ -154,7 +154,7 @@
         entry: Entry to process
         section: Section which can be used to lookup symbol values
     """
-    fname = tools.GetInputFilename(elf_fname)
+    fname = tools.get_input_filename(elf_fname)
     syms = GetSymbols(fname, ['image', 'binman'])
     if not syms:
         return
@@ -185,7 +185,7 @@
                 value = -1
                 pack_string = pack_string.lower()
             value_bytes = struct.pack(pack_string, value)
-            tout.Debug('%s:\n   insert %s, offset %x, value %x, length %d' %
+            tout.debug('%s:\n   insert %s, offset %x, value %x, length %d' %
                        (msg, name, offset, value, len(value_bytes)))
             entry.data = (entry.data[:offset] + value_bytes +
                         entry.data[offset + sym.size:])
@@ -282,10 +282,10 @@
     #   text section at the start
     # -m32: Build for 32-bit x86
     # -T...: Specifies the link script, which sets the start address
-    cc, args = tools.GetTargetCompileTool('cc')
+    cc, args = tools.get_target_compile_tool('cc')
     args += ['-static', '-nostdlib', '-Wl,--build-id=none', '-m32', '-T',
             lds_file, '-o', elf_fname, s_file]
-    stdout = command.Output(cc, *args)
+    stdout = command.output(cc, *args)
     shutil.rmtree(outdir)
 
 def DecodeElf(data, location):
@@ -350,7 +350,7 @@
                    mem_end - data_start)
 
 def UpdateFile(infile, outfile, start_sym, end_sym, insert):
-    tout.Notice("Creating file '%s' with data length %#x (%d) between symbols '%s' and '%s'" %
+    tout.notice("Creating file '%s' with data length %#x (%d) between symbols '%s' and '%s'" %
                 (outfile, len(insert), len(insert), start_sym, end_sym))
     syms = GetSymbolFileOffset(infile, [start_sym, end_sym])
     if len(syms) != 2:
@@ -363,9 +363,9 @@
         raise ValueError("Not enough space in '%s' for data length %#x (%d); size is %#x (%d)" %
                          (infile, len(insert), len(insert), size, size))
 
-    data = tools.ReadFile(infile)
+    data = tools.read_file(infile)
     newdata = data[:syms[start_sym].offset]
-    newdata += insert + tools.GetBytes(0, size - len(insert))
+    newdata += insert + tools.get_bytes(0, size - len(insert))
     newdata += data[syms[end_sym].offset:]
-    tools.WriteFile(outfile, newdata)
-    tout.Info('Written to offset %#x' % syms[start_sym].offset)
+    tools.write_file(outfile, newdata)
+    tout.info('Written to offset %#x' % syms[start_sym].offset)
diff --git a/tools/binman/elf_test.py b/tools/binman/elf_test.py
index f727258..47ebfba 100644
--- a/tools/binman/elf_test.py
+++ b/tools/binman/elf_test.py
@@ -27,7 +27,7 @@
     """
     def __init__(self, contents_size):
         self.contents_size = contents_size
-        self.data = tools.GetBytes(ord('a'), contents_size)
+        self.data = tools.get_bytes(ord('a'), contents_size)
 
     def GetPath(self):
         return 'entry_path'
@@ -72,7 +72,7 @@
     if 'MAKEFLAGS' in os.environ:
         del os.environ['MAKEFLAGS']
     try:
-        tools.Run('make', '-C', target_dir, '-f',
+        tools.run('make', '-C', target_dir, '-f',
                   os.path.join(testdir, 'Makefile'), 'SRC=%s/' % testdir)
     except ValueError as e:
         # The test system seems to suppress this in a strange way
@@ -83,7 +83,7 @@
     @classmethod
     def setUpClass(cls):
         cls._indir = tempfile.mkdtemp(prefix='elf.')
-        tools.SetInputDirs(['.'])
+        tools.set_input_dirs(['.'])
         BuildElfTestFiles(cls._indir)
 
     @classmethod
@@ -166,13 +166,13 @@
         section = FakeSection(sym_value=None)
         elf_fname = self.ElfTestFile('u_boot_binman_syms')
         syms = elf.LookupAndWriteSymbols(elf_fname, entry, section)
-        self.assertEqual(tools.GetBytes(255, 20) + tools.GetBytes(ord('a'), 4),
+        self.assertEqual(tools.get_bytes(255, 20) + tools.get_bytes(ord('a'), 4),
                                                                   entry.data)
 
     def testDebug(self):
         """Check that enabling debug in the elf module produced debug output"""
         try:
-            tout.Init(tout.DEBUG)
+            tout.init(tout.DEBUG)
             entry = FakeEntry(20)
             section = FakeSection()
             elf_fname = self.ElfTestFile('u_boot_binman_syms')
@@ -180,7 +180,7 @@
                 syms = elf.LookupAndWriteSymbols(elf_fname, entry, section)
             self.assertTrue(len(stdout.getvalue()) > 0)
         finally:
-            tout.Init(tout.WARNING)
+            tout.init(tout.WARNING)
 
     def testMakeElf(self):
         """Test for the MakeElf function"""
@@ -193,9 +193,9 @@
         # Make an Elf file and then convert it to a fkat binary file. This
         # should produce the original data.
         elf.MakeElf(elf_fname, expected_text, expected_data)
-        objcopy, args = tools.GetTargetCompileTool('objcopy')
+        objcopy, args = tools.get_target_compile_tool('objcopy')
         args += ['-O', 'binary', elf_fname, bin_fname]
-        stdout = command.Output(objcopy, *args)
+        stdout = command.output(objcopy, *args)
         with open(bin_fname, 'rb') as fd:
             data = fd.read()
         self.assertEqual(expected_text + expected_data, data)
@@ -210,7 +210,7 @@
         expected_data = b'wxyz'
         elf_fname = os.path.join(outdir, 'elf')
         elf.MakeElf(elf_fname, expected_text, expected_data)
-        data = tools.ReadFile(elf_fname)
+        data = tools.read_file(elf_fname)
 
         load = 0xfef20000
         entry = load + 2
@@ -231,7 +231,7 @@
         offset = elf.GetSymbolFileOffset(fname, ['embed_start', 'embed_end'])
         start = offset['embed_start'].offset
         end = offset['embed_end'].offset
-        data = tools.ReadFile(fname)
+        data = tools.read_file(fname)
         embed_data = data[start:end]
         expect = struct.pack('<III', 0x1234, 0x5678, 0)
         self.assertEqual(expect, embed_data)
diff --git a/tools/binman/entry.py b/tools/binman/entry.py
index 08770ec..dc26f8f 100644
--- a/tools/binman/entry.py
+++ b/tools/binman/entry.py
@@ -14,7 +14,7 @@
 from binman import comp_util
 from dtoc import fdt_util
 from patman import tools
-from patman.tools import ToHex, ToHexSize
+from patman.tools import to_hex, to_hex_size
 from patman import tout
 
 modules = {}
@@ -244,7 +244,7 @@
         self.uncomp_size = fdt_util.GetInt(self._node, 'uncomp-size')
 
         self.align = fdt_util.GetInt(self._node, 'align')
-        if tools.NotPowerOfTwo(self.align):
+        if tools.not_power_of_two(self.align):
             raise ValueError("Node '%s': Alignment %s must be a power of two" %
                              (self._node.path, self.align))
         if self.section and self.align is None:
@@ -252,7 +252,7 @@
         self.pad_before = fdt_util.GetInt(self._node, 'pad-before', 0)
         self.pad_after = fdt_util.GetInt(self._node, 'pad-after', 0)
         self.align_size = fdt_util.GetInt(self._node, 'align-size')
-        if tools.NotPowerOfTwo(self.align_size):
+        if tools.not_power_of_two(self.align_size):
             self.Raise("Alignment size %s must be a power of two" %
                        self.align_size)
         self.align_end = fdt_util.GetInt(self._node, 'align-end')
@@ -397,12 +397,12 @@
 
             # Don't let the data shrink. Pad it if necessary
             if size_ok and new_size < self.contents_size:
-                data += tools.GetBytes(0, self.contents_size - new_size)
+                data += tools.get_bytes(0, self.contents_size - new_size)
 
         if not size_ok:
-            tout.Debug("Entry '%s' size change from %s to %s" % (
-                self._node.path, ToHex(self.contents_size),
-                ToHex(new_size)))
+            tout.debug("Entry '%s' size change from %s to %s" % (
+                self._node.path, to_hex(self.contents_size),
+                to_hex(new_size)))
         self.SetContents(data)
         return size_ok
 
@@ -419,8 +419,8 @@
     def ResetForPack(self):
         """Reset offset/size fields so that packing can be done again"""
         self.Detail('ResetForPack: offset %s->%s, size %s->%s' %
-                    (ToHex(self.offset), ToHex(self.orig_offset),
-                     ToHex(self.size), ToHex(self.orig_size)))
+                    (to_hex(self.offset), to_hex(self.orig_offset),
+                     to_hex(self.size), to_hex(self.orig_size)))
         self.pre_reset_size = self.size
         self.offset = self.orig_offset
         self.size = self.orig_size
@@ -444,20 +444,20 @@
             New section offset pointer (after this entry)
         """
         self.Detail('Packing: offset=%s, size=%s, content_size=%x' %
-                    (ToHex(self.offset), ToHex(self.size),
+                    (to_hex(self.offset), to_hex(self.size),
                      self.contents_size))
         if self.offset is None:
             if self.offset_unset:
                 self.Raise('No offset set with offset-unset: should another '
                            'entry provide this correct offset?')
-            self.offset = tools.Align(offset, self.align)
+            self.offset = tools.align(offset, self.align)
         needed = self.pad_before + self.contents_size + self.pad_after
-        needed = tools.Align(needed, self.align_size)
+        needed = tools.align(needed, self.align_size)
         size = self.size
         if not size:
             size = needed
         new_offset = self.offset + size
-        aligned_offset = tools.Align(new_offset, self.align_end)
+        aligned_offset = tools.align(new_offset, self.align_end)
         if aligned_offset != new_offset:
             size = aligned_offset - self.offset
             new_offset = aligned_offset
@@ -471,10 +471,10 @@
         # Check that the alignment is correct. It could be wrong if the
         # and offset or size values were provided (i.e. not calculated), but
         # conflict with the provided alignment values
-        if self.size != tools.Align(self.size, self.align_size):
+        if self.size != tools.align(self.size, self.align_size):
             self.Raise("Size %#x (%d) does not match align-size %#x (%d)" %
                   (self.size, self.size, self.align_size, self.align_size))
-        if self.offset != tools.Align(self.offset, self.align):
+        if self.offset != tools.align(self.offset, self.align):
             self.Raise("Offset %#x (%d) does not match align %#x (%d)" %
                   (self.offset, self.offset, self.align, self.align))
         self.Detail('   - packed: offset=%#x, size=%#x, content_size=%#x, next_offset=%x' %
@@ -489,12 +489,12 @@
     def Info(self, msg):
         """Convenience function to log info referencing a node"""
         tag = "Info '%s'" % self._node.path
-        tout.Detail('%30s: %s' % (tag, msg))
+        tout.detail('%30s: %s' % (tag, msg))
 
     def Detail(self, msg):
         """Convenience function to log detail referencing a node"""
         tag = "Node '%s'" % self._node.path
-        tout.Detail('%30s: %s' % (tag, msg))
+        tout.detail('%30s: %s' % (tag, msg))
 
     def GetEntryArgsOrProps(self, props, required=False):
         """Return the values of a set of properties
@@ -541,7 +541,7 @@
             bytes content of the entry, excluding any padding. If the entry is
                 compressed, the compressed data is returned
         """
-        self.Detail('GetData: size %s' % ToHexSize(self.data))
+        self.Detail('GetData: size %s' % to_hex_size(self.data))
         return self.data
 
     def GetPaddedData(self, data=None):
@@ -841,7 +841,7 @@
         """
         # Use True here so that we get an uncompressed section to work from,
         # although compressed sections are currently not supported
-        tout.Debug("ReadChildData section '%s', entry '%s'" %
+        tout.debug("ReadChildData section '%s', entry '%s'" %
                    (self.section.GetPath(), self.GetPath()))
         data = self.section.ReadChildData(self, decomp, alt_format)
         return data
@@ -991,7 +991,7 @@
             fname (str): Filename of faked file
         """
         if self.allow_fake and not pathlib.Path(fname).is_file():
-            outfname = tools.GetOutputFilename(os.path.basename(fname))
+            outfname = tools.get_output_filename(os.path.basename(fname))
             with open(outfname, "wb") as out:
                 out.truncate(1024)
             self.faked = True
@@ -1076,7 +1076,7 @@
         Returns:
             True to use this entry type, False to use the original one
         """
-        tout.Info("Node '%s': etype '%s': %s selected" %
+        tout.info("Node '%s': etype '%s': %s selected" %
                   (node.path, etype, new_etype))
         return True
 
diff --git a/tools/binman/entry_test.py b/tools/binman/entry_test.py
index 1b59c90..7ed9b26 100644
--- a/tools/binman/entry_test.py
+++ b/tools/binman/entry_test.py
@@ -17,10 +17,10 @@
 
 class TestEntry(unittest.TestCase):
     def setUp(self):
-        tools.PrepareOutputDir(None)
+        tools.prepare_output_dir(None)
 
     def tearDown(self):
-        tools.FinaliseOutputDir()
+        tools.finalise_output_dir()
 
     def GetNode(self):
         binman_dir = os.path.dirname(os.path.realpath(sys.argv[0]))
diff --git a/tools/binman/etype/atf_fip.py b/tools/binman/etype/atf_fip.py
index 07e6c64..6ecd95b 100644
--- a/tools/binman/etype/atf_fip.py
+++ b/tools/binman/etype/atf_fip.py
@@ -181,7 +181,7 @@
         self._pad_byte = fdt_util.GetInt(self._node, 'pad-byte', 0)
         self._fip_flags = fdt_util.GetInt64(self._node, 'fip-hdr-flags', 0)
         self._fip_align = fdt_util.GetInt(self._node, 'fip-align', 1)
-        if tools.NotPowerOfTwo(self._fip_align):
+        if tools.not_power_of_two(self._fip_align):
             raise ValueError("Node '%s': FIP alignment %s must be a power of two" %
                              (self._node.path, self._fip_align))
         self.ReadEntries()
diff --git a/tools/binman/etype/blob.py b/tools/binman/etype/blob.py
index 59728f3..25ec5d2 100644
--- a/tools/binman/etype/blob.py
+++ b/tools/binman/etype/blob.py
@@ -37,7 +37,7 @@
 
     def ObtainContents(self):
         self._filename = self.GetDefaultFilename()
-        self._pathname = tools.GetInputFilename(self._filename,
+        self._pathname = tools.get_input_filename(self._filename,
             self.external and self.section.GetAllowMissing())
         # Allow the file to be missing
         if not self._pathname:
@@ -68,7 +68,7 @@
             bytes: Data read
         """
         state.TimingStart('read')
-        indata = tools.ReadFile(pathname)
+        indata = tools.read_file(pathname)
         state.TimingAccum('read')
         state.TimingStart('compress')
         data = self.CompressData(indata)
diff --git a/tools/binman/etype/blob_ext_list.py b/tools/binman/etype/blob_ext_list.py
index 29c9092..76ad32a 100644
--- a/tools/binman/etype/blob_ext_list.py
+++ b/tools/binman/etype/blob_ext_list.py
@@ -38,7 +38,7 @@
         pathnames = []
         for fname in self._filenames:
             fname = self.check_fake_fname(fname)
-            pathname = tools.GetInputFilename(
+            pathname = tools.get_input_filename(
                 fname, self.external and self.section.GetAllowMissing())
             # Allow the file to be missing
             if not pathname:
diff --git a/tools/binman/etype/fdtmap.py b/tools/binman/etype/fdtmap.py
index aaaf2de..76e8dbe 100644
--- a/tools/binman/etype/fdtmap.py
+++ b/tools/binman/etype/fdtmap.py
@@ -140,7 +140,7 @@
             fdt.pack()
             outfdt = Fdt.FromData(fdt.as_bytearray())
             data = outfdt.GetContents()
-        data = FDTMAP_MAGIC + tools.GetBytes(0, 8) + data
+        data = FDTMAP_MAGIC + tools.get_bytes(0, 8) + data
         return data
 
     def ObtainContents(self):
diff --git a/tools/binman/etype/files.py b/tools/binman/etype/files.py
index 927d0f0..0650a69 100644
--- a/tools/binman/etype/files.py
+++ b/tools/binman/etype/files.py
@@ -47,7 +47,7 @@
                                                 'require-matches')
 
     def ExpandEntries(self):
-        files = tools.GetInputFilenameGlob(self._pattern)
+        files = tools.get_input_filename_glob(self._pattern)
         if self._require_matches and not files:
             self.Raise("Pattern '%s' matched no files" % self._pattern)
         for fname in files:
diff --git a/tools/binman/etype/fill.py b/tools/binman/etype/fill.py
index efb2d13..cd38279 100644
--- a/tools/binman/etype/fill.py
+++ b/tools/binman/etype/fill.py
@@ -31,5 +31,5 @@
         self.fill_value = fdt_util.GetByte(self._node, 'fill-byte', 0)
 
     def ObtainContents(self):
-        self.SetContents(tools.GetBytes(self.fill_value, self.size))
+        self.SetContents(tools.get_bytes(self.fill_value, self.size))
         return True
diff --git a/tools/binman/etype/fit.py b/tools/binman/etype/fit.py
index 6ad4a68..a56b056 100644
--- a/tools/binman/etype/fit.py
+++ b/tools/binman/etype/fit.py
@@ -9,11 +9,12 @@
 import libfdt
 
 from binman.entry import Entry, EntryArg
+from binman.etype.section import Entry_section
 from dtoc import fdt_util
 from dtoc.fdt import Fdt
 from patman import tools
 
-class Entry_fit(Entry):
+class Entry_fit(Entry_section):
     """Flat Image Tree (FIT)
 
     This calls mkimage to create a FIT (U-Boot Flat Image Tree) based on the
@@ -112,15 +113,15 @@
         """
         Members:
             _fit: FIT file being built
-            _fit_sections: dict:
+            _entries: dict from Entry_section:
                 key: relative path to entry Node (from the base of the FIT)
                 value: Entry_section object comprising the contents of this
                     node
         """
         super().__init__(section, etype, node)
         self._fit = None
-        self._fit_sections = {}
         self._fit_props = {}
+
         for pname, prop in self._node.props.items():
             if pname.startswith('fit,'):
                 self._fit_props[pname] = prop
@@ -185,7 +186,7 @@
                 # 'data' property later.
                 entry = Entry.Create(self.section, node, etype='section')
                 entry.ReadNode()
-                self._fit_sections[rel_path] = entry
+                self._entries[rel_path] = entry
 
             for subnode in node.subnodes:
                 if has_images and not (subnode.name.startswith('hash') or
@@ -200,19 +201,19 @@
                         for seq, fdt_fname in enumerate(self._fdts):
                             node_name = subnode.name[1:].replace('SEQ',
                                                                  str(seq + 1))
-                            fname = tools.GetInputFilename(fdt_fname + '.dtb')
+                            fname = tools.get_input_filename(fdt_fname + '.dtb')
                             with fsw.add_node(node_name):
                                 for pname, prop in subnode.props.items():
                                     val = prop.bytes.replace(
-                                        b'NAME', tools.ToBytes(fdt_fname))
+                                        b'NAME', tools.to_bytes(fdt_fname))
                                     val = val.replace(
-                                        b'SEQ', tools.ToBytes(str(seq + 1)))
+                                        b'SEQ', tools.to_bytes(str(seq + 1)))
                                     fsw.property(pname, val)
 
                                 # Add data for 'fdt' nodes (but not 'config')
                                 if depth == 1 and in_images:
                                     fsw.property('data',
-                                                 tools.ReadFile(fname))
+                                                 tools.read_file(fname))
                     else:
                         if self._fdts is None:
                             if self._fit_list_prop:
@@ -237,19 +238,25 @@
         self._fdt = Fdt.FromData(fdt.as_bytearray())
         self._fdt.Scan()
 
-    def ObtainContents(self):
-        """Obtain the contents of the FIT
+    def BuildSectionData(self, required):
+        """Build FIT entry contents
 
         This adds the 'data' properties to the input ITB (Image-tree Binary)
         then runs mkimage to process it.
+
+        Args:
+            required: True if the data must be present, False if it is OK to
+                return None
+
+        Returns:
+            Contents of the section (bytes)
         """
-        # self._BuildInput() either returns bytes or raises an exception.
         data = self._BuildInput(self._fdt)
         uniq = self.GetUniqueName()
-        input_fname = tools.GetOutputFilename('%s.itb' % uniq)
-        output_fname = tools.GetOutputFilename('%s.fit' % uniq)
-        tools.WriteFile(input_fname, data)
-        tools.WriteFile(output_fname, data)
+        input_fname = tools.get_output_filename('%s.itb' % uniq)
+        output_fname = tools.get_output_filename('%s.fit' % uniq)
+        tools.write_file(input_fname, data)
+        tools.write_file(output_fname, data)
 
         args = {}
         ext_offset = self._fit_props.get('fit,external-offset')
@@ -259,14 +266,12 @@
                 'pad': fdt_util.fdt32_to_cpu(ext_offset.value)
                 }
         if self.mkimage.run(reset_timestamp=True, output_fname=output_fname,
-                            **args) is not None:
-            self.SetContents(tools.ReadFile(output_fname))
-        else:
+                            **args) is None:
             # Bintool is missing; just use empty data as the output
             self.record_missing_bintool(self.mkimage)
-            self.SetContents(tools.GetBytes(0, 1024))
+            return tools.get_bytes(0, 1024)
 
-        return True
+        return tools.read_file(output_fname)
 
     def _BuildInput(self, fdt):
         """Finish the FIT by adding the 'data' properties to it
@@ -277,12 +282,8 @@
         Returns:
             New fdt contents (bytes)
         """
-        for path, section in self._fit_sections.items():
+        for path, section in self._entries.items():
             node = fdt.GetNode(path)
-            # Entry_section.ObtainContents() either returns True or
-            # raises an exception.
-            section.ObtainContents()
-            section.Pack(0)
             data = section.GetData()
             node.AddData('data', data)
 
@@ -290,20 +291,16 @@
         data = fdt.GetContents()
         return data
 
-    def CheckMissing(self, missing_list):
-        """Check if any entries in this FIT have missing external blobs
-
-        If there are missing blobs, the entries are added to the list
-
-        Args:
-            missing_list: List of Entry objects to be added to
-        """
-        for path, section in self._fit_sections.items():
-            section.CheckMissing(missing_list)
-
-    def SetAllowMissing(self, allow_missing):
-        for section in self._fit_sections.values():
-            section.SetAllowMissing(allow_missing)
-
     def AddBintools(self, tools):
+        super().AddBintools(tools)
         self.mkimage = self.AddBintool(tools, 'mkimage')
+
+    def AddMissingProperties(self, have_image_pos):
+        # We don't want to interfere with any hash properties in the FIT, so
+        # disable this for now.
+        pass
+
+    def SetCalculatedProperties(self):
+        # We don't want to interfere with any hash properties in the FIT, so
+        # disable this for now.
+        pass
diff --git a/tools/binman/etype/fmap.py b/tools/binman/etype/fmap.py
index cac99b6..0c57620 100644
--- a/tools/binman/etype/fmap.py
+++ b/tools/binman/etype/fmap.py
@@ -8,7 +8,7 @@
 from binman.entry import Entry
 from binman import fmap_util
 from patman import tools
-from patman.tools import ToHexSize
+from patman.tools import to_hex_size
 from patman import tout
 
 
@@ -46,8 +46,8 @@
         """
         def _AddEntries(areas, entry):
             entries = entry.GetEntries()
-            tout.Debug("fmap: Add entry '%s' type '%s' (%s subentries)" %
-                       (entry.GetPath(), entry.etype, ToHexSize(entries)))
+            tout.debug("fmap: Add entry '%s' type '%s' (%s subentries)" %
+                       (entry.GetPath(), entry.etype, to_hex_size(entries)))
             if entries and entry.etype != 'cbfs':
                 # Create an area for the section, which encompasses all entries
                 # within it
diff --git a/tools/binman/etype/gbb.py b/tools/binman/etype/gbb.py
index ca8af1b..e32fae2 100644
--- a/tools/binman/etype/gbb.py
+++ b/tools/binman/etype/gbb.py
@@ -70,14 +70,14 @@
 
     def ObtainContents(self):
         gbb = 'gbb.bin'
-        fname = tools.GetOutputFilename(gbb)
+        fname = tools.get_output_filename(gbb)
         if not self.size:
             self.Raise('GBB must have a fixed size')
         gbb_size = self.size
         bmpfv_size = gbb_size - 0x2180
         if bmpfv_size < 0:
             self.Raise('GBB is too small (minimum 0x2180 bytes)')
-        keydir = tools.GetInputFilename(self.keydir)
+        keydir = tools.get_input_filename(self.keydir)
 
         stdout = self.futility.gbb_create(
             fname, [0x100, 0x1000, bmpfv_size, 0x1000])
@@ -88,14 +88,14 @@
                 rootkey='%s/root_key.vbpubk' % keydir,
                 recoverykey='%s/recovery_key.vbpubk' % keydir,
                 flags=self.gbb_flags,
-                bmpfv=tools.GetInputFilename(self.bmpblk))
+                bmpfv=tools.get_input_filename(self.bmpblk))
 
         if stdout is not None:
-            self.SetContents(tools.ReadFile(fname))
+            self.SetContents(tools.read_file(fname))
         else:
             # Bintool is missing; just use the required amount of zero data
             self.record_missing_bintool(self.futility)
-            self.SetContents(tools.GetBytes(0, gbb_size))
+            self.SetContents(tools.get_bytes(0, gbb_size))
 
         return True
 
diff --git a/tools/binman/etype/intel_ifwi.py b/tools/binman/etype/intel_ifwi.py
index ed14046..46bdf11 100644
--- a/tools/binman/etype/intel_ifwi.py
+++ b/tools/binman/etype/intel_ifwi.py
@@ -58,11 +58,11 @@
         # Create the IFWI file if needed
         if self._convert_fit:
             inname = self._pathname
-            outname = tools.GetOutputFilename('ifwi.bin')
+            outname = tools.get_output_filename('ifwi.bin')
             if self.ifwitool.create_ifwi(inname, outname) is None:
                 # Bintool is missing; just create a zeroed ifwi.bin
                 self.record_missing_bintool(self.ifwitool)
-                self.SetContents(tools.GetBytes(0, 1024))
+                self.SetContents(tools.get_bytes(0, 1024))
 
             self._filename = 'ifwi.bin'
             self._pathname = outname
@@ -74,15 +74,15 @@
         if self.ifwitool.delete_subpart(outname, 'OBBP') is None:
             # Bintool is missing; just use zero data
             self.record_missing_bintool(self.ifwitool)
-            self.SetContents(tools.GetBytes(0, 1024))
+            self.SetContents(tools.get_bytes(0, 1024))
             return True
 
         for entry in self._ifwi_entries.values():
             # First get the input data and put it in a file
             data = entry.GetPaddedData()
             uniq = self.GetUniqueName()
-            input_fname = tools.GetOutputFilename('input.%s' % uniq)
-            tools.WriteFile(input_fname, data)
+            input_fname = tools.get_output_filename('input.%s' % uniq)
+            tools.write_file(input_fname, data)
 
             # At this point we know that ifwitool is present, so we don't need
             # to check for None here
@@ -107,7 +107,7 @@
         After that we delete the OBBP sub-partition and add each of the files
         that we want in the IFWI file, one for each sub-entry of the IWFI node.
         """
-        self._pathname = tools.GetInputFilename(self._filename,
+        self._pathname = tools.get_input_filename(self._filename,
                                                 self.section.GetAllowMissing())
         # Allow the file to be missing
         if not self._pathname:
diff --git a/tools/binman/etype/mkimage.py b/tools/binman/etype/mkimage.py
index 201ee4b..baa16f3 100644
--- a/tools/binman/etype/mkimage.py
+++ b/tools/binman/etype/mkimage.py
@@ -48,12 +48,12 @@
                 return False
             data += entry.GetData()
         uniq = self.GetUniqueName()
-        input_fname = tools.GetOutputFilename('mkimage.%s' % uniq)
-        tools.WriteFile(input_fname, data)
-        output_fname = tools.GetOutputFilename('mkimage-out.%s' % uniq)
+        input_fname = tools.get_output_filename('mkimage.%s' % uniq)
+        tools.write_file(input_fname, data)
+        output_fname = tools.get_output_filename('mkimage-out.%s' % uniq)
         if self.mkimage.run_cmd('-d', input_fname, *self._args,
                                 output_fname) is not None:
-            self.SetContents(tools.ReadFile(output_fname))
+            self.SetContents(tools.read_file(output_fname))
         else:
             # Bintool is missing; just use the input data as the output
             self.record_missing_bintool(self.mkimage)
diff --git a/tools/binman/etype/section.py b/tools/binman/etype/section.py
index bb375e9..2515907 100644
--- a/tools/binman/etype/section.py
+++ b/tools/binman/etype/section.py
@@ -19,7 +19,7 @@
 from dtoc import fdt_util
 from patman import tools
 from patman import tout
-from patman.tools import ToHexSize
+from patman.tools import to_hex_size
 
 
 class Entry_section(Entry):
@@ -269,19 +269,19 @@
         data = bytearray()
         # Handle padding before the entry
         if entry.pad_before:
-            data += tools.GetBytes(self._pad_byte, entry.pad_before)
+            data += tools.get_bytes(self._pad_byte, entry.pad_before)
 
         # Add in the actual entry data
         data += entry_data
 
         # Handle padding after the entry
         if entry.pad_after:
-            data += tools.GetBytes(self._pad_byte, entry.pad_after)
+            data += tools.get_bytes(self._pad_byte, entry.pad_after)
 
         if entry.size:
-            data += tools.GetBytes(pad_byte, entry.size - len(data))
+            data += tools.get_bytes(pad_byte, entry.size - len(data))
 
-        self.Detail('GetPaddedDataForEntry: size %s' % ToHexSize(self.data))
+        self.Detail('GetPaddedDataForEntry: size %s' % to_hex_size(self.data))
 
         return data
 
@@ -316,7 +316,7 @@
             # Handle empty space before the entry
             pad = (entry.offset or 0) - self._skip_at_start - len(section_data)
             if pad > 0:
-                section_data += tools.GetBytes(self._pad_byte, pad)
+                section_data += tools.get_bytes(self._pad_byte, pad)
 
             # Add in the actual entry data
             section_data += data
@@ -709,14 +709,14 @@
         if not size:
             data = self.GetPaddedData(self.data)
             size = len(data)
-            size = tools.Align(size, self.align_size)
+            size = tools.align(size, self.align_size)
 
         if self.size and contents_size > self.size:
             self._Raise("contents size %#x (%d) exceeds section size %#x (%d)" %
                         (contents_size, contents_size, self.size, self.size))
         if not self.size:
             self.size = size
-        if self.size != tools.Align(self.size, self.align_size):
+        if self.size != tools.align(self.size, self.align_size):
             self._Raise("Size %#x (%d) does not match align-size %#x (%d)" %
                         (self.size, self.size, self.align_size,
                          self.align_size))
@@ -757,28 +757,28 @@
         return self._sort
 
     def ReadData(self, decomp=True, alt_format=None):
-        tout.Info("ReadData path='%s'" % self.GetPath())
+        tout.info("ReadData path='%s'" % self.GetPath())
         parent_data = self.section.ReadData(True, alt_format)
         offset = self.offset - self.section._skip_at_start
         data = parent_data[offset:offset + self.size]
-        tout.Info(
+        tout.info(
             '%s: Reading data from offset %#x-%#x (real %#x), size %#x, got %#x' %
                   (self.GetPath(), self.offset, self.offset + self.size, offset,
                    self.size, len(data)))
         return data
 
     def ReadChildData(self, child, decomp=True, alt_format=None):
-        tout.Debug(f"ReadChildData for child '{child.GetPath()}'")
+        tout.debug(f"ReadChildData for child '{child.GetPath()}'")
         parent_data = self.ReadData(True, alt_format)
         offset = child.offset - self._skip_at_start
-        tout.Debug("Extract for child '%s': offset %#x, skip_at_start %#x, result %#x" %
+        tout.debug("Extract for child '%s': offset %#x, skip_at_start %#x, result %#x" %
                    (child.GetPath(), child.offset, self._skip_at_start, offset))
         data = parent_data[offset:offset + child.size]
         if decomp:
             indata = data
             data = comp_util.decompress(indata, child.compress)
             if child.uncomp_size:
-                tout.Info("%s: Decompressing data size %#x with algo '%s' to data size %#x" %
+                tout.info("%s: Decompressing data size %#x with algo '%s' to data size %#x" %
                             (child.GetPath(), len(indata), child.compress,
                             len(data)))
         if alt_format:
@@ -840,6 +840,7 @@
         Args:
             missing_list: List of Bintool objects to be added to
         """
+        super().check_missing_bintools(missing_list)
         for entry in self._entries.values():
             entry.check_missing_bintools(missing_list)
 
diff --git a/tools/binman/etype/text.py b/tools/binman/etype/text.py
index 45dfcc4..c55e023 100644
--- a/tools/binman/etype/text.py
+++ b/tools/binman/etype/text.py
@@ -60,14 +60,14 @@
         super().__init__(section, etype, node)
         value = fdt_util.GetString(self._node, 'text')
         if value:
-            value = tools.ToBytes(value)
+            value = tools.to_bytes(value)
         else:
             label, = self.GetEntryArgsOrProps([EntryArg('text-label', str)])
             self.text_label = label
             if self.text_label:
                 value, = self.GetEntryArgsOrProps([EntryArg(self.text_label,
                                                             str)])
-                value = tools.ToBytes(value) if value is not None else value
+                value = tools.to_bytes(value) if value is not None else value
         self.value = value
 
     def ObtainContents(self):
diff --git a/tools/binman/etype/u_boot_elf.py b/tools/binman/etype/u_boot_elf.py
index 6614a75..3ec774f 100644
--- a/tools/binman/etype/u_boot_elf.py
+++ b/tools/binman/etype/u_boot_elf.py
@@ -27,9 +27,9 @@
     def ReadBlobContents(self):
         if self._strip:
             uniq = self.GetUniqueName()
-            out_fname = tools.GetOutputFilename('%s.stripped' % uniq)
-            tools.WriteFile(out_fname, tools.ReadFile(self._pathname))
-            tools.Run('strip', out_fname)
+            out_fname = tools.get_output_filename('%s.stripped' % uniq)
+            tools.write_file(out_fname, tools.read_file(self._pathname))
+            tools.run('strip', out_fname)
             self._pathname = out_fname
         super().ReadBlobContents()
         return True
diff --git a/tools/binman/etype/u_boot_env.py b/tools/binman/etype/u_boot_env.py
index 1694c2a..c38340b 100644
--- a/tools/binman/etype/u_boot_env.py
+++ b/tools/binman/etype/u_boot_env.py
@@ -27,7 +27,7 @@
         self.fill_value = fdt_util.GetByte(self._node, 'fill-byte', 0)
 
     def ReadBlobContents(self):
-        indata = tools.ReadFile(self._pathname)
+        indata = tools.read_file(self._pathname)
         data = b''
         for line in indata.splitlines():
             data += line + b'\0'
@@ -35,7 +35,7 @@
         pad = self.size - len(data) - 5
         if pad < 0:
             self.Raise("'u-boot-env' entry too small to hold data (need %#x more bytes)" % -pad)
-        data += tools.GetBytes(self.fill_value, pad)
+        data += tools.get_bytes(self.fill_value, pad)
         crc = zlib.crc32(data)
         buf = struct.pack('<I', crc) + b'\x01' + data
         self.SetContents(buf)
diff --git a/tools/binman/etype/u_boot_spl_bss_pad.py b/tools/binman/etype/u_boot_spl_bss_pad.py
index 18c5596..680d198 100644
--- a/tools/binman/etype/u_boot_spl_bss_pad.py
+++ b/tools/binman/etype/u_boot_spl_bss_pad.py
@@ -36,9 +36,9 @@
         super().__init__(section, etype, node)
 
     def ObtainContents(self):
-        fname = tools.GetInputFilename('spl/u-boot-spl')
+        fname = tools.get_input_filename('spl/u-boot-spl')
         bss_size = elf.GetSymbolAddress(fname, '__bss_size')
         if not bss_size:
             self.Raise('Expected __bss_size symbol in spl/u-boot-spl')
-        self.SetContents(tools.GetBytes(0, bss_size))
+        self.SetContents(tools.get_bytes(0, bss_size))
         return True
diff --git a/tools/binman/etype/u_boot_spl_expanded.py b/tools/binman/etype/u_boot_spl_expanded.py
index 8e138e6..319f670 100644
--- a/tools/binman/etype/u_boot_spl_expanded.py
+++ b/tools/binman/etype/u_boot_spl_expanded.py
@@ -39,7 +39,7 @@
     @classmethod
     def UseExpanded(cls, node, etype, new_etype):
         val = state.GetEntryArgBool('spl-dtb')
-        tout.DoOutput(tout.INFO if val else tout.DETAIL,
+        tout.do_output(tout.INFO if val else tout.DETAIL,
                       "Node '%s': etype '%s': %s %sselected" %
                       (node.path, etype, new_etype, '' if val else 'not '))
         return val
diff --git a/tools/binman/etype/u_boot_tpl_bss_pad.py b/tools/binman/etype/u_boot_tpl_bss_pad.py
index 521b24a..47f4b23 100644
--- a/tools/binman/etype/u_boot_tpl_bss_pad.py
+++ b/tools/binman/etype/u_boot_tpl_bss_pad.py
@@ -36,9 +36,9 @@
         super().__init__(section, etype, node)
 
     def ObtainContents(self):
-        fname = tools.GetInputFilename('tpl/u-boot-tpl')
+        fname = tools.get_input_filename('tpl/u-boot-tpl')
         bss_size = elf.GetSymbolAddress(fname, '__bss_size')
         if not bss_size:
             self.Raise('Expected __bss_size symbol in tpl/u-boot-tpl')
-        self.SetContents(tools.GetBytes(0, bss_size))
+        self.SetContents(tools.get_bytes(0, bss_size))
         return True
diff --git a/tools/binman/etype/u_boot_tpl_expanded.py b/tools/binman/etype/u_boot_tpl_expanded.py
index 15cdac4..55fde3c 100644
--- a/tools/binman/etype/u_boot_tpl_expanded.py
+++ b/tools/binman/etype/u_boot_tpl_expanded.py
@@ -39,7 +39,7 @@
     @classmethod
     def UseExpanded(cls, node, etype, new_etype):
         val = state.GetEntryArgBool('tpl-dtb')
-        tout.DoOutput(tout.INFO if val else tout.DETAIL,
+        tout.do_output(tout.INFO if val else tout.DETAIL,
                       "Node '%s': etype '%s': %s %sselected" %
                       (node.path, etype, new_etype, '' if val else 'not '))
         return val
diff --git a/tools/binman/etype/u_boot_ucode.py b/tools/binman/etype/u_boot_ucode.py
index b4cb8cd..6945411 100644
--- a/tools/binman/etype/u_boot_ucode.py
+++ b/tools/binman/etype/u_boot_ucode.py
@@ -92,8 +92,8 @@
             return True
 
         # Write it out to a file
-        self._pathname = tools.GetOutputFilename('u-boot-ucode.bin')
-        tools.WriteFile(self._pathname, fdt_entry.ucode_data)
+        self._pathname = tools.get_output_filename('u-boot-ucode.bin')
+        tools.write_file(self._pathname, fdt_entry.ucode_data)
 
         self.ReadBlobContents()
 
diff --git a/tools/binman/etype/u_boot_with_ucode_ptr.py b/tools/binman/etype/u_boot_with_ucode_ptr.py
index 20be22a..a5fd2d1 100644
--- a/tools/binman/etype/u_boot_with_ucode_ptr.py
+++ b/tools/binman/etype/u_boot_with_ucode_ptr.py
@@ -38,7 +38,7 @@
 
     def ProcessFdt(self, fdt):
         # Figure out where to put the microcode pointer
-        fname = tools.GetInputFilename(self.elf_fname)
+        fname = tools.get_input_filename(self.elf_fname)
         sym = elf.GetSymbolAddress(fname, '_dt_ucode_base_size')
         if sym:
            self.target_offset = sym
diff --git a/tools/binman/etype/vblock.py b/tools/binman/etype/vblock.py
index 8bbba27..a1de982 100644
--- a/tools/binman/etype/vblock.py
+++ b/tools/binman/etype/vblock.py
@@ -65,9 +65,9 @@
             return None
 
         uniq = self.GetUniqueName()
-        output_fname = tools.GetOutputFilename('vblock.%s' % uniq)
-        input_fname = tools.GetOutputFilename('input.%s' % uniq)
-        tools.WriteFile(input_fname, input_data)
+        output_fname = tools.get_output_filename('vblock.%s' % uniq)
+        input_fname = tools.get_output_filename('input.%s' % uniq)
+        tools.write_file(input_fname, input_data)
         prefix = self.keydir + '/'
         stdout = self.futility.sign_firmware(
             vblock=output_fname,
@@ -78,11 +78,11 @@
             kernelkey=prefix + self.kernelkey,
             flags=f'{self.preamble_flags}')
         if stdout is not None:
-            data = tools.ReadFile(output_fname)
+            data = tools.read_file(output_fname)
         else:
             # Bintool is missing; just use 4KB of zero data
             self.record_missing_bintool(self.futility)
-            data = tools.GetBytes(0, 4096)
+            data = tools.get_bytes(0, 4096)
         return data
 
     def ObtainContents(self):
diff --git a/tools/binman/fdt_test.py b/tools/binman/fdt_test.py
index 3e12540..94347b1 100644
--- a/tools/binman/fdt_test.py
+++ b/tools/binman/fdt_test.py
@@ -19,11 +19,11 @@
     def setUpClass(self):
         self._binman_dir = os.path.dirname(os.path.realpath(sys.argv[0]))
         self._indir = tempfile.mkdtemp(prefix='binmant.')
-        tools.PrepareOutputDir(self._indir, True)
+        tools.prepare_output_dir(self._indir, True)
 
     @classmethod
     def tearDownClass(self):
-        tools._FinaliseForTest()
+        tools._finalise_for_test()
 
     def TestFile(self, fname):
         return os.path.join(self._binman_dir, 'test', fname)
diff --git a/tools/binman/fip_util.py b/tools/binman/fip_util.py
index 868d0b6..95eee32 100755
--- a/tools/binman/fip_util.py
+++ b/tools/binman/fip_util.py
@@ -248,7 +248,7 @@
         self.flags = flags
         self.fip_type = None
         self.data = None
-        self.valid = uuid != tools.GetBytes(0, UUID_LEN)
+        self.valid = uuid != tools.get_bytes(0, UUID_LEN)
         if self.valid:
             # Look up the friendly name
             matches = {val for (key, val) in FIP_TYPES.items()
@@ -309,7 +309,7 @@
     Usage is something like:
 
         fip = FipWriter(size)
-        fip.add_entry('scp-fwu-cfg', tools.ReadFile('something.bin'))
+        fip.add_entry('scp-fwu-cfg', tools.read_file('something.bin'))
         ...
         data = cbw.get_data()
 
@@ -354,7 +354,7 @@
         offset += ENTRY_SIZE   # terminating entry
 
         for fent in self._fip_entries:
-            offset = tools.Align(offset, self._align)
+            offset = tools.align(offset, self._align)
             fent.offset = offset
             offset += fent.size
 
@@ -443,7 +443,7 @@
     re_uuid = re.compile('0x[0-9a-fA-F]{2}')
     re_comment = re.compile(r'^/\* (.*) \*/$')
     fname = os.path.join(srcdir, 'include/tools_share/firmware_image_package.h')
-    data = tools.ReadFile(fname, binary=False)
+    data = tools.read_file(fname, binary=False)
     macros = collections.OrderedDict()
     comment = None
     for linenum, line in enumerate(data.splitlines()):
@@ -489,7 +489,7 @@
     re_data = re.compile(r'\.name = "([^"]*)",\s*\.uuid = (UUID_\w*),\s*\.cmdline_name = "([^"]+)"',
                          re.S)
     fname = os.path.join(srcdir, 'tools/fiptool/tbbr_config.c')
-    data = tools.ReadFile(fname, binary=False)
+    data = tools.read_file(fname, binary=False)
 
     # Example entry:
     #   {
@@ -574,21 +574,21 @@
         raise ValueError(
             f"Expected file '{readme_fname}' - try using -s to specify the "
             'arm-trusted-firmware directory')
-    readme = tools.ReadFile(readme_fname, binary=False)
+    readme = tools.read_file(readme_fname, binary=False)
     first_line = 'Trusted Firmware-A'
     if readme.splitlines()[0] != first_line:
         raise ValueError(f"'{readme_fname}' does not start with '{first_line}'")
     macros = parse_macros(srcdir)
     names = parse_names(srcdir)
     output = create_code_output(macros, names)
-    orig = tools.ReadFile(oldfile, binary=False)
+    orig = tools.read_file(oldfile, binary=False)
     re_fip_list = re.compile(r'(.*FIP_TYPE_LIST = \[).*?(    ] # end.*)', re.S)
     mat = re_fip_list.match(orig)
     new_code = mat.group(1) + '\n' + output + mat.group(2) if mat else output
     if new_code == orig:
         print(f"Existing code in '{oldfile}' is up-to-date")
     else:
-        tools.WriteFile(dstfile, new_code, binary=False)
+        tools.write_file(dstfile, new_code, binary=False)
         print(f'Needs update, try:\n\tmeld {dstfile} {oldfile}')
 
 
diff --git a/tools/binman/fip_util_test.py b/tools/binman/fip_util_test.py
index 4d2093b..cf6d000 100755
--- a/tools/binman/fip_util_test.py
+++ b/tools/binman/fip_util_test.py
@@ -35,14 +35,14 @@
     def setUp(self):
         # Create a temporary directory for test files
         self._indir = tempfile.mkdtemp(prefix='fip_util.')
-        tools.SetInputDirs([self._indir])
+        tools.set_input_dirs([self._indir])
 
         # Set up a temporary output directory, used by the tools library when
         # compressing files
-        tools.PrepareOutputDir(None)
+        tools.prepare_output_dir(None)
 
         self.src_file = os.path.join(self._indir, 'orig.py')
-        self.outname = tools.GetOutputFilename('out.py')
+        self.outname = tools.get_output_filename('out.py')
         self.args = ['-D', '-s', self._indir, '-o', self.outname]
         self.readme = os.path.join(self._indir, 'readme.rst')
         self.macro_dir = os.path.join(self._indir, 'include/tools_share')
@@ -78,25 +78,25 @@
 
     def setup_readme(self):
         """Set up the readme.txt file"""
-        tools.WriteFile(self.readme, 'Trusted Firmware-A\n==================',
+        tools.write_file(self.readme, 'Trusted Firmware-A\n==================',
                         binary=False)
 
     def setup_macro(self, data=macro_contents):
         """Set up the tbbr_config.c file"""
         os.makedirs(self.macro_dir)
-        tools.WriteFile(self.macro_fname, data, binary=False)
+        tools.write_file(self.macro_fname, data, binary=False)
 
     def setup_name(self, data=name_contents):
         """Set up the firmware_image_package.h file"""
         os.makedirs(self.name_dir)
-        tools.WriteFile(self.name_fname, data, binary=False)
+        tools.write_file(self.name_fname, data, binary=False)
 
     def tearDown(self):
         """Remove the temporary input directory and its contents"""
         if self._indir:
             shutil.rmtree(self._indir)
         self._indir = None
-        tools.FinaliseOutputDir()
+        tools.finalise_output_dir()
 
     def test_no_readme(self):
         """Test handling of a missing readme.rst"""
@@ -106,7 +106,7 @@
 
     def test_invalid_readme(self):
         """Test that an invalid readme.rst is detected"""
-        tools.WriteFile(self.readme, 'blah', binary=False)
+        tools.write_file(self.readme, 'blah', binary=False)
         with self.assertRaises(Exception) as err:
             fip_util.main(self.args, self.src_file)
         self.assertIn('does not start with', str(err.exception))
@@ -228,7 +228,7 @@
         self.setup_name()
 
         # Check generating the file when changes are needed
-        tools.WriteFile(self.src_file, '''
+        tools.write_file(self.src_file, '''
 
 # This is taken from tbbr_config.c in ARM Trusted Firmware
 FIP_TYPE_LIST = [
@@ -244,7 +244,7 @@
         self.assertIn('Needs update', stdout.getvalue())
 
         # Check generating the file when no changes are needed
-        tools.WriteFile(self.src_file, '''
+        tools.write_file(self.src_file, '''
 # This is taken from tbbr_config.c in ARM Trusted Firmware
 FIP_TYPE_LIST = [
     # ToC Entry UUIDs
@@ -268,7 +268,7 @@
 
         args = self.args.copy()
         args.remove('-D')
-        tools.WriteFile(self.src_file, '', binary=False)
+        tools.write_file(self.src_file, '', binary=False)
         with test_util.capture_sys_output():
             fip_util.main(args, self.src_file)
 
@@ -282,8 +282,8 @@
         fip.add_entry('tb-fw', tb_fw, 0)
         fip.add_entry(bytes(range(16)), tb_fw, 0)
         data = fip.get_data()
-        fname = tools.GetOutputFilename('data.fip')
-        tools.WriteFile(fname, data)
+        fname = tools.get_output_filename('data.fip')
+        tools.write_file(fname, data)
         result = FIPTOOL.info(fname)
         self.assertEqual(
             '''Firmware Updater NS_BL2U: offset=0xB0, size=0x7, cmdline="--fwu"
@@ -303,19 +303,19 @@
             FipReader: reader for the image
         """
         fwu = os.path.join(self._indir, 'fwu')
-        tools.WriteFile(fwu, self.fwu_data)
+        tools.write_file(fwu, self.fwu_data)
 
         tb_fw = os.path.join(self._indir, 'tb_fw')
-        tools.WriteFile(tb_fw, self.tb_fw_data)
+        tools.write_file(tb_fw, self.tb_fw_data)
 
         other_fw = os.path.join(self._indir, 'other_fw')
-        tools.WriteFile(other_fw, self.other_fw_data)
+        tools.write_file(other_fw, self.other_fw_data)
 
-        fname = tools.GetOutputFilename('data.fip')
+        fname = tools.get_output_filename('data.fip')
         uuid = 'e3b78d9e-4a64-11ec-b45c-fba2b9b49788'
         FIPTOOL.create_new(fname, 8, 0x123, fwu, tb_fw, uuid, other_fw)
 
-        return fip_util.FipReader(tools.ReadFile(fname))
+        return fip_util.FipReader(tools.read_file(fname))
 
     @unittest.skipIf(not HAVE_FIPTOOL, 'No fiptool available')
     def test_fiptool_create(self):
diff --git a/tools/binman/fmap_util.py b/tools/binman/fmap_util.py
index 8277619..1ce63d1 100644
--- a/tools/binman/fmap_util.py
+++ b/tools/binman/fmap_util.py
@@ -70,7 +70,7 @@
             value: value of that field (string for the ones we support)
     """
     name_index = field_names.index('name')
-    fields[name_index] = tools.ToBytes(NameToFmap(fields[name_index]))
+    fields[name_index] = tools.to_bytes(NameToFmap(fields[name_index]))
 
 def DecodeFmap(data):
     """Decode a flashmap into a header and list of areas
diff --git a/tools/binman/ftest.py b/tools/binman/ftest.py
index 5400f76..59b6d52 100644
--- a/tools/binman/ftest.py
+++ b/tools/binman/ftest.py
@@ -61,6 +61,9 @@
 U_BOOT_NODTB_DATA     = b'nodtb with microcode pointer somewhere in here'
 U_BOOT_SPL_NODTB_DATA = b'splnodtb with microcode pointer somewhere in here'
 U_BOOT_TPL_NODTB_DATA = b'tplnodtb with microcode pointer somewhere in here'
+U_BOOT_EXP_DATA       = U_BOOT_NODTB_DATA + U_BOOT_DTB_DATA
+U_BOOT_SPL_EXP_DATA   = U_BOOT_SPL_NODTB_DATA + U_BOOT_SPL_DTB_DATA
+U_BOOT_TPL_EXP_DATA   = U_BOOT_TPL_NODTB_DATA + U_BOOT_TPL_DTB_DATA
 FSP_DATA              = b'fsp'
 CMC_DATA              = b'cmc'
 VBT_DATA              = b'vbt'
@@ -174,7 +177,7 @@
 
         # ELF file with a '_dt_ucode_base_size' symbol
         TestFunctional._MakeInputFile('u-boot',
-            tools.ReadFile(cls.ElfTestFile('u_boot_ucode_ptr')))
+            tools.read_file(cls.ElfTestFile('u_boot_ucode_ptr')))
 
         # Intel flash descriptor file
         cls._SetupDescriptor()
@@ -236,11 +239,11 @@
         if self.preserve_outdirs:
             print('Preserving output dir: %s' % tools.outdir)
         else:
-            tools._FinaliseForTest()
+            tools._finalise_for_test()
 
     def setUp(self):
         # Enable this to turn on debugging output
-        # tout.Init(tout.DEBUG)
+        # tout.init(tout.DEBUG)
         command.test_result = None
 
     def tearDown(self):
@@ -262,10 +265,10 @@
                 Temporary directory to use
                 New image filename
         """
-        image_fname = tools.GetOutputFilename('image.bin')
+        image_fname = tools.get_output_filename('image.bin')
         tmpdir = tempfile.mkdtemp(prefix='binman.')
         updated_fname = os.path.join(tmpdir, 'image-updated.bin')
-        tools.WriteFile(updated_fname, tools.ReadFile(image_fname))
+        tools.write_file(updated_fname, tools.read_file(image_fname))
         self._CleanupOutputDir()
         return tmpdir, updated_fname
 
@@ -282,7 +285,7 @@
             Arguments to pass, as a list of strings
             kwargs: Arguments to pass to Command.RunPipe()
         """
-        result = command.RunPipe([[self._binman_pathname] + list(args)],
+        result = command.run_pipe([[self._binman_pathname] + list(args)],
                 capture=True, capture_stderr=True, raise_on_error=False)
         if result.return_code and kwargs.get('raise_on_error', True):
             raise Exception("Error running '%s': %s" % (' '.join(args),
@@ -492,14 +495,14 @@
                     use_expanded=use_expanded, extra_indirs=extra_indirs,
                     threads=threads)
             self.assertEqual(0, retcode)
-            out_dtb_fname = tools.GetOutputFilename('u-boot.dtb.out')
+            out_dtb_fname = tools.get_output_filename('u-boot.dtb.out')
 
             # Find the (only) image, read it and return its contents
             image = control.images['image']
-            image_fname = tools.GetOutputFilename('image.bin')
+            image_fname = tools.get_output_filename('image.bin')
             self.assertTrue(os.path.exists(image_fname))
             if map:
-                map_fname = tools.GetOutputFilename('image.map')
+                map_fname = tools.get_output_filename('image.map')
                 with open(map_fname) as fd:
                     map_data = fd.read()
             else:
@@ -578,7 +581,7 @@
             Filename of ELF file to use as SPL
         """
         TestFunctional._MakeInputFile('spl/u-boot-spl',
-            tools.ReadFile(cls.ElfTestFile(src_fname)))
+            tools.read_file(cls.ElfTestFile(src_fname)))
 
     @classmethod
     def _SetupTplElf(cls, src_fname='bss_data'):
@@ -588,7 +591,7 @@
             Filename of ELF file to use as TPL
         """
         TestFunctional._MakeInputFile('tpl/u-boot-tpl',
-            tools.ReadFile(cls.ElfTestFile(src_fname)))
+            tools.read_file(cls.ElfTestFile(src_fname)))
 
     @classmethod
     def _SetupDescriptor(cls):
@@ -756,7 +759,7 @@
 
         image = control.images['image1']
         self.assertEqual(len(U_BOOT_DATA), image.size)
-        fname = tools.GetOutputFilename('image1.bin')
+        fname = tools.get_output_filename('image1.bin')
         self.assertTrue(os.path.exists(fname))
         with open(fname, 'rb') as fd:
             data = fd.read()
@@ -764,13 +767,13 @@
 
         image = control.images['image2']
         self.assertEqual(3 + len(U_BOOT_DATA) + 5, image.size)
-        fname = tools.GetOutputFilename('image2.bin')
+        fname = tools.get_output_filename('image2.bin')
         self.assertTrue(os.path.exists(fname))
         with open(fname, 'rb') as fd:
             data = fd.read()
             self.assertEqual(U_BOOT_DATA, data[3:7])
-            self.assertEqual(tools.GetBytes(0, 3), data[:3])
-            self.assertEqual(tools.GetBytes(0, 5), data[7:])
+            self.assertEqual(tools.get_bytes(0, 3), data[:3])
+            self.assertEqual(tools.get_bytes(0, 5), data[7:])
 
     def testBadAlign(self):
         """Test that an invalid alignment value is detected"""
@@ -838,8 +841,8 @@
         self.assertEqual(3, entry.pad_before)
         self.assertEqual(3 + 5 + len(U_BOOT_DATA), entry.size)
         self.assertEqual(U_BOOT_DATA, entry.data)
-        self.assertEqual(tools.GetBytes(0, 3) + U_BOOT_DATA +
-                         tools.GetBytes(0, 5), data[:entry.size])
+        self.assertEqual(tools.get_bytes(0, 3) + U_BOOT_DATA +
+                         tools.get_bytes(0, 5), data[:entry.size])
         pos = entry.size
 
         # Second u-boot has an aligned size, but it has no effect
@@ -857,7 +860,7 @@
         self.assertEqual(pos, entry.offset)
         self.assertEqual(32, entry.size)
         self.assertEqual(U_BOOT_DATA, entry.data)
-        self.assertEqual(U_BOOT_DATA + tools.GetBytes(0, 32 - len(U_BOOT_DATA)),
+        self.assertEqual(U_BOOT_DATA + tools.get_bytes(0, 32 - len(U_BOOT_DATA)),
                          data[pos:pos + entry.size])
         pos += entry.size
 
@@ -867,7 +870,7 @@
         self.assertEqual(48, entry.offset)
         self.assertEqual(16, entry.size)
         self.assertEqual(U_BOOT_DATA, entry.data[:len(U_BOOT_DATA)])
-        self.assertEqual(U_BOOT_DATA + tools.GetBytes(0, 16 - len(U_BOOT_DATA)),
+        self.assertEqual(U_BOOT_DATA + tools.get_bytes(0, 16 - len(U_BOOT_DATA)),
                          data[pos:pos + entry.size])
         pos += entry.size
 
@@ -877,7 +880,7 @@
         self.assertEqual(64, entry.offset)
         self.assertEqual(64, entry.size)
         self.assertEqual(U_BOOT_DATA, entry.data[:len(U_BOOT_DATA)])
-        self.assertEqual(U_BOOT_DATA + tools.GetBytes(0, 64 - len(U_BOOT_DATA)),
+        self.assertEqual(U_BOOT_DATA + tools.get_bytes(0, 64 - len(U_BOOT_DATA)),
                          data[pos:pos + entry.size])
 
         self.CheckNoGaps(entries)
@@ -997,7 +1000,7 @@
         """Test that the image pad byte can be specified"""
         self._SetupSplElf()
         data = self._DoReadFile('021_image_pad.dts')
-        self.assertEqual(U_BOOT_SPL_DATA + tools.GetBytes(0xff, 1) +
+        self.assertEqual(U_BOOT_SPL_DATA + tools.get_bytes(0xff, 1) +
                          U_BOOT_DATA, data)
 
     def testImageName(self):
@@ -1005,11 +1008,11 @@
         retcode = self._DoTestFile('022_image_name.dts')
         self.assertEqual(0, retcode)
         image = control.images['image1']
-        fname = tools.GetOutputFilename('test-name')
+        fname = tools.get_output_filename('test-name')
         self.assertTrue(os.path.exists(fname))
 
         image = control.images['image2']
-        fname = tools.GetOutputFilename('test-name.xx')
+        fname = tools.get_output_filename('test-name.xx')
         self.assertTrue(os.path.exists(fname))
 
     def testBlobFilename(self):
@@ -1021,8 +1024,8 @@
         """Test that entries can be sorted"""
         self._SetupSplElf()
         data = self._DoReadFile('024_sorted.dts')
-        self.assertEqual(tools.GetBytes(0, 1) + U_BOOT_SPL_DATA +
-                         tools.GetBytes(0, 2) + U_BOOT_DATA, data)
+        self.assertEqual(tools.get_bytes(0, 1) + U_BOOT_SPL_DATA +
+                         tools.get_bytes(0, 2) + U_BOOT_DATA, data)
 
     def testPackZeroOffset(self):
         """Test that an entry at offset 0 is not given a new offset"""
@@ -1065,8 +1068,8 @@
         """Test that a basic x86 ROM can be created"""
         self._SetupSplElf()
         data = self._DoReadFile('029_x86_rom.dts')
-        self.assertEqual(U_BOOT_DATA + tools.GetBytes(0, 3) + U_BOOT_SPL_DATA +
-                         tools.GetBytes(0, 2), data)
+        self.assertEqual(U_BOOT_DATA + tools.get_bytes(0, 3) + U_BOOT_SPL_DATA +
+                         tools.get_bytes(0, 2), data)
 
     def testPackX86RomMeNoDesc(self):
         """Test that an invalid Intel descriptor entry is detected"""
@@ -1090,7 +1093,7 @@
     def testPackX86RomMe(self):
         """Test that an x86 ROM with an ME region can be created"""
         data = self._DoReadFile('031_x86_rom_me.dts')
-        expected_desc = tools.ReadFile(self.TestFile('descriptor.bin'))
+        expected_desc = tools.read_file(self.TestFile('descriptor.bin'))
         if data[:0x1000] != expected_desc:
             self.fail('Expected descriptor binary at start of image')
         self.assertEqual(ME_DATA, data[0x1000:0x1000 + len(ME_DATA)])
@@ -1139,7 +1142,7 @@
             fdt_len = self.GetFdtLen(dtb_with_ucode)
             ucode_content = dtb_with_ucode[fdt_len:]
             ucode_pos = len(nodtb_data) + fdt_len
-        fname = tools.GetOutputFilename('test.dtb')
+        fname = tools.get_output_filename('test.dtb')
         with open(fname, 'wb') as fd:
             fd.write(dtb_with_ucode)
         dtb = fdt.FdtScan(fname)
@@ -1244,7 +1247,7 @@
         # ELF file without a '_dt_ucode_base_size' symbol
         try:
             TestFunctional._MakeInputFile('u-boot',
-                tools.ReadFile(self.ElfTestFile('u_boot_no_ucode_ptr')))
+                tools.read_file(self.ElfTestFile('u_boot_no_ucode_ptr')))
 
             with self.assertRaises(ValueError) as e:
                 self._RunPackUbootSingleMicrocode()
@@ -1254,7 +1257,7 @@
         finally:
             # Put the original file back
             TestFunctional._MakeInputFile('u-boot',
-                tools.ReadFile(self.ElfTestFile('u_boot_ucode_ptr')))
+                tools.read_file(self.ElfTestFile('u_boot_ucode_ptr')))
 
     def testMicrocodeNotInImage(self):
         """Test that microcode must be placed within the image"""
@@ -1267,7 +1270,7 @@
     def testWithoutMicrocode(self):
         """Test that we can cope with an image without microcode (e.g. qemu)"""
         TestFunctional._MakeInputFile('u-boot',
-            tools.ReadFile(self.ElfTestFile('u_boot_no_ucode_ptr')))
+            tools.read_file(self.ElfTestFile('u_boot_no_ucode_ptr')))
         data, dtb, _, _ = self._DoReadFileDtb('044_x86_optional_ucode.dts', True)
 
         # Now check the device tree has no microcode
@@ -1279,7 +1282,7 @@
 
         used_len = len(U_BOOT_NODTB_DATA) + fdt_len
         third = data[used_len:]
-        self.assertEqual(tools.GetBytes(0, 0x200 - used_len), third)
+        self.assertEqual(tools.get_bytes(0, 0x200 - used_len), third)
 
     def testUnknownPosSize(self):
         """Test that microcode must be placed within the image"""
@@ -1308,7 +1311,7 @@
         # ELF file with a '__bss_size' symbol
         self._SetupSplElf()
         data = self._DoReadFile('047_spl_bss_pad.dts')
-        self.assertEqual(U_BOOT_SPL_DATA + tools.GetBytes(0, 10) + U_BOOT_DATA,
+        self.assertEqual(U_BOOT_SPL_DATA + tools.get_bytes(0, 10) + U_BOOT_DATA,
                          data)
 
     def testSplBssPadMissing(self):
@@ -1404,7 +1407,7 @@
                                  u_boot_offset + len(U_BOOT_DATA),
                                  0x10 + u_boot_offset, 0x04)
         expected = (sym_values + base_data[20:] +
-                    tools.GetBytes(0xff, 1) + U_BOOT_DATA + sym_values +
+                    tools.get_bytes(0xff, 1) + U_BOOT_DATA + sym_values +
                     base_data[20:])
         self.assertEqual(expected, data)
 
@@ -1426,9 +1429,9 @@
     def testSections(self):
         """Basic test of sections"""
         data = self._DoReadFile('055_sections.dts')
-        expected = (U_BOOT_DATA + tools.GetBytes(ord('!'), 12) +
-                    U_BOOT_DATA + tools.GetBytes(ord('a'), 12) +
-                    U_BOOT_DATA + tools.GetBytes(ord('&'), 4))
+        expected = (U_BOOT_DATA + tools.get_bytes(ord('!'), 12) +
+                    U_BOOT_DATA + tools.get_bytes(ord('a'), 12) +
+                    U_BOOT_DATA + tools.get_bytes(ord('&'), 4))
         self.assertEqual(expected, data)
 
     def testMap(self):
@@ -1593,9 +1596,9 @@
         }
         data, _, _, _ = self._DoReadFileDtb('066_text.dts',
                                             entry_args=entry_args)
-        expected = (tools.ToBytes(TEXT_DATA) +
-                    tools.GetBytes(0, 8 - len(TEXT_DATA)) +
-                    tools.ToBytes(TEXT_DATA2) + tools.ToBytes(TEXT_DATA3) +
+        expected = (tools.to_bytes(TEXT_DATA) +
+                    tools.get_bytes(0, 8 - len(TEXT_DATA)) +
+                    tools.to_bytes(TEXT_DATA2) + tools.to_bytes(TEXT_DATA3) +
                     b'some text' + b'more text')
         self.assertEqual(expected, data)
 
@@ -1617,8 +1620,8 @@
         """Basic test of generation of a flashrom fmap"""
         data = self._DoReadFile('067_fmap.dts')
         fhdr, fentries = fmap_util.DecodeFmap(data[32:])
-        expected = (U_BOOT_DATA + tools.GetBytes(ord('!'), 12) +
-                    U_BOOT_DATA + tools.GetBytes(ord('a'), 12))
+        expected = (U_BOOT_DATA + tools.get_bytes(ord('!'), 12) +
+                    U_BOOT_DATA + tools.get_bytes(ord('a'), 12))
         self.assertEqual(expected, data[:32])
         self.assertEqual(b'__FMAP__', fhdr.signature)
         self.assertEqual(1, fhdr.ver_major)
@@ -1670,7 +1673,7 @@
     def testFill(self):
         """Test for an fill entry type"""
         data = self._DoReadFile('069_fill.dts')
-        expected = tools.GetBytes(0xff, 8) + tools.GetBytes(0, 8)
+        expected = tools.get_bytes(0xff, 8) + tools.get_bytes(0, 8)
         self.assertEqual(expected, data)
 
     def testFillNoSize(self):
@@ -1700,8 +1703,8 @@
         data, _, _, _ = self._DoReadFileDtb('071_gbb.dts', entry_args=entry_args)
 
         # Since futility
-        expected = (GBB_DATA + GBB_DATA + tools.GetBytes(0, 8) +
-                    tools.GetBytes(0, 0x2180 - 16))
+        expected = (GBB_DATA + GBB_DATA + tools.get_bytes(0, 8) +
+                    tools.get_bytes(0, 0x2180 - 16))
         self.assertEqual(expected, data)
 
     def testGbbTooSmall(self):
@@ -1751,7 +1754,7 @@
                 if self._hash_data:
                     infile = pipe_list[0][11]
                     m = hashlib.sha256()
-                    data = tools.ReadFile(infile)
+                    data = tools.read_file(infile)
                     m.update(data)
                     fd.write(m.digest())
                 else:
@@ -1845,7 +1848,7 @@
     def testFillZero(self):
         """Test for an fill entry type with a size of 0"""
         data = self._DoReadFile('080_fill_empty.dts')
-        self.assertEqual(tools.GetBytes(0, 16), data)
+        self.assertEqual(tools.get_bytes(0, 16), data)
 
     def testTextMissing(self):
         """Test for a text entry type where there is no text"""
@@ -1875,8 +1878,8 @@
             else:
                 self.assertNotIn(expected, stdout.getvalue())
 
-            self.assertFalse(os.path.exists(tools.GetOutputFilename('image1.bin')))
-            self.assertTrue(os.path.exists(tools.GetOutputFilename('image2.bin')))
+            self.assertFalse(os.path.exists(tools.get_output_filename('image1.bin')))
+            self.assertTrue(os.path.exists(tools.get_output_filename('image2.bin')))
             self._CleanupOutputDir()
 
     def testUpdateFdtAll(self):
@@ -1933,8 +1936,8 @@
                           'tpl/u-boot-tpl.dtb.out']:
                 dtb = fdt.Fdt.FromData(data[start:])
                 size = dtb._fdt_obj.totalsize()
-                pathname = tools.GetOutputFilename(os.path.split(fname)[1])
-                outdata = tools.ReadFile(pathname)
+                pathname = tools.get_output_filename(os.path.split(fname)[1])
+                outdata = tools.read_file(pathname)
                 name = os.path.split(fname)[0]
 
                 if name:
@@ -2027,10 +2030,10 @@
         """Test an expanding entry"""
         data, _, map_data, _ = self._DoReadFileDtb('088_expand_size.dts',
                                                    map=True)
-        expect = (tools.GetBytes(ord('a'), 8) + U_BOOT_DATA +
-                  MRC_DATA + tools.GetBytes(ord('b'), 1) + U_BOOT_DATA +
-                  tools.GetBytes(ord('c'), 8) + U_BOOT_DATA +
-                  tools.GetBytes(ord('d'), 8))
+        expect = (tools.get_bytes(ord('a'), 8) + U_BOOT_DATA +
+                  MRC_DATA + tools.get_bytes(ord('b'), 1) + U_BOOT_DATA +
+                  tools.get_bytes(ord('c'), 8) + U_BOOT_DATA +
+                  tools.get_bytes(ord('d'), 8))
         self.assertEqual(expect, data)
         self.assertEqual('''ImagePos    Offset      Size  Name
 00000000  00000000  00000028  main-section
@@ -2085,7 +2088,7 @@
         hash_node = dtb.GetNode('/binman/section/hash').props['value']
         m = hashlib.sha256()
         m.update(U_BOOT_DATA)
-        m.update(tools.GetBytes(ord('a'), 16))
+        m.update(tools.get_bytes(ord('a'), 16))
         self.assertEqual(m.digest(), b''.join(hash_node.value))
 
     def testPackUBootTplMicrocode(self):
@@ -2107,7 +2110,7 @@
         """Basic test of generation of a flashrom fmap"""
         data = self._DoReadFile('094_fmap_x86.dts')
         fhdr, fentries = fmap_util.DecodeFmap(data[32:])
-        expected = U_BOOT_DATA + MRC_DATA + tools.GetBytes(ord('a'), 32 - 7)
+        expected = U_BOOT_DATA + MRC_DATA + tools.get_bytes(ord('a'), 32 - 7)
         self.assertEqual(expected, data[:32])
         fhdr, fentries = fmap_util.DecodeFmap(data[32:])
 
@@ -2129,7 +2132,7 @@
     def testFmapX86Section(self):
         """Basic test of generation of a flashrom fmap"""
         data = self._DoReadFile('095_fmap_x86_section.dts')
-        expected = U_BOOT_DATA + MRC_DATA + tools.GetBytes(ord('b'), 32 - 7)
+        expected = U_BOOT_DATA + MRC_DATA + tools.get_bytes(ord('b'), 32 - 7)
         self.assertEqual(expected, data[:32])
         fhdr, fentries = fmap_util.DecodeFmap(data[36:])
 
@@ -2177,14 +2180,14 @@
         with test_util.capture_sys_output() as (stdout, stderr):
             with self.assertRaises(ValueError) as e:
                 self._DoTestFile('014_pack_overlap.dts', map=True)
-        map_fname = tools.GetOutputFilename('image.map')
+        map_fname = tools.get_output_filename('image.map')
         self.assertEqual("Wrote map file '%s' to show errors\n" % map_fname,
                          stdout.getvalue())
 
         # We should not get an inmage, but there should be a map file
-        self.assertFalse(os.path.exists(tools.GetOutputFilename('image.bin')))
+        self.assertFalse(os.path.exists(tools.get_output_filename('image.bin')))
         self.assertTrue(os.path.exists(map_fname))
-        map_data = tools.ReadFile(map_fname, binary=False)
+        map_data = tools.read_file(map_fname, binary=False)
         self.assertEqual('''ImagePos    Offset      Size  Name
 <none>    00000000  00000008  main-section
 <none>     00000000  00000004  u-boot
@@ -2210,12 +2213,12 @@
 0000002c    00000000  00000004  u-boot
 ''', map_data)
         self.assertEqual(data,
-                         tools.GetBytes(0x26, 4) + U_BOOT_DATA +
-                             tools.GetBytes(0x21, 12) +
-                         tools.GetBytes(0x26, 4) + U_BOOT_DATA +
-                             tools.GetBytes(0x61, 12) +
-                         tools.GetBytes(0x26, 4) + U_BOOT_DATA +
-                             tools.GetBytes(0x26, 8))
+                         tools.get_bytes(0x26, 4) + U_BOOT_DATA +
+                             tools.get_bytes(0x21, 12) +
+                         tools.get_bytes(0x26, 4) + U_BOOT_DATA +
+                             tools.get_bytes(0x61, 12) +
+                         tools.get_bytes(0x26, 4) + U_BOOT_DATA +
+                             tools.get_bytes(0x26, 8))
 
     def testCbfsRaw(self):
         """Test base handling of a Coreboot Filesystem (CBFS)
@@ -2332,17 +2335,17 @@
         Args:
             data: Conents of output file
         """
-        expected_desc = tools.ReadFile(self.TestFile('descriptor.bin'))
+        expected_desc = tools.read_file(self.TestFile('descriptor.bin'))
         if data[:0x1000] != expected_desc:
             self.fail('Expected descriptor binary at start of image')
 
         # We expect to find the TPL wil in subpart IBBP entry IBBL
-        image_fname = tools.GetOutputFilename('image.bin')
-        tpl_fname = tools.GetOutputFilename('tpl.out')
+        image_fname = tools.get_output_filename('image.bin')
+        tpl_fname = tools.get_output_filename('tpl.out')
         ifwitool = bintool.Bintool.create('ifwitool')
         ifwitool.extract(image_fname, 'IBBP', 'IBBL', tpl_fname)
 
-        tpl_data = tools.ReadFile(tpl_fname)
+        tpl_data = tools.read_file(tpl_fname)
         self.assertEqual(U_BOOT_TPL_DATA, tpl_data[:len(U_BOOT_TPL_DATA)])
 
     def testPackX86RomIfwi(self):
@@ -2403,7 +2406,7 @@
         fdtmap_data = data[len(U_BOOT_DATA):]
         magic = fdtmap_data[:8]
         self.assertEqual(b'_FDTMAP_', magic)
-        self.assertEqual(tools.GetBytes(0, 8), fdtmap_data[8:16])
+        self.assertEqual(tools.get_bytes(0, 8), fdtmap_data[8:16])
 
         fdt_data = fdtmap_data[16:]
         dtb = fdt.Fdt.FromData(fdt_data)
@@ -2668,7 +2671,7 @@
         """Test reading an image and accessing its FDT map"""
         self._CheckLz4()
         data = self.data = self._DoReadFileRealDtb('128_decode_image.dts')
-        image_fname = tools.GetOutputFilename('image.bin')
+        image_fname = tools.get_output_filename('image.bin')
         orig_image = control.images['image']
         image = Image.FromFile(image_fname)
         self.assertEqual(orig_image.GetEntries().keys(),
@@ -2684,7 +2687,7 @@
         """Test accessing an image's FDT map without an image header"""
         self._CheckLz4()
         data = self._DoReadFileRealDtb('129_decode_image_nohdr.dts')
-        image_fname = tools.GetOutputFilename('image.bin')
+        image_fname = tools.get_output_filename('image.bin')
         image = Image.FromFile(image_fname)
         self.assertTrue(isinstance(image, Image))
         self.assertEqual('image', image.image_name[-5:])
@@ -2692,7 +2695,7 @@
     def testReadImageFail(self):
         """Test failing to read an image image's FDT map"""
         self._DoReadFile('005_simple.dts')
-        image_fname = tools.GetOutputFilename('image.bin')
+        image_fname = tools.get_output_filename('image.bin')
         with self.assertRaises(ValueError) as e:
             image = Image.FromFile(image_fname)
         self.assertIn("Cannot find FDT map in image", str(e.exception))
@@ -2752,7 +2755,7 @@
         """
         self._CheckLz4()
         self._DoReadFileRealDtb('130_list_fdtmap.dts')
-        image_fname = tools.GetOutputFilename('image.bin')
+        image_fname = tools.get_output_filename('image.bin')
         image = Image.FromFile(image_fname)
         lines = image.GetListEntries(paths)[1]
         files = [line[0].strip() for line in lines[1:]]
@@ -2798,7 +2801,7 @@
         """
         self._CheckLz4()
         self._DoReadFileRealDtb('130_list_fdtmap.dts')
-        image_fname = tools.GetOutputFilename('image.bin')
+        image_fname = tools.get_output_filename('image.bin')
         return control.ReadEntry(image_fname, entry_name, decomp)
 
     def testExtractSimple(self):
@@ -2858,7 +2861,7 @@
     def testExtractBadFile(self):
         """Test extracting an invalid file"""
         fname = os.path.join(self._indir, 'badfile')
-        tools.WriteFile(fname, b'')
+        tools.write_file(fname, b'')
         with self.assertRaises(ValueError) as e:
             control.ReadEntry(fname, 'name')
 
@@ -2874,17 +2877,17 @@
                                '-f', fname)
         finally:
             shutil.rmtree(tmpdir)
-        data = tools.ReadFile(fname)
+        data = tools.read_file(fname)
         self.assertEqual(U_BOOT_DATA, data)
 
     def testExtractOneEntry(self):
         """Test extracting a single entry fron an image """
         self._CheckLz4()
         self._DoReadFileRealDtb('130_list_fdtmap.dts')
-        image_fname = tools.GetOutputFilename('image.bin')
+        image_fname = tools.get_output_filename('image.bin')
         fname = os.path.join(self._indir, 'output.extact')
         control.ExtractEntries(image_fname, fname, None, ['u-boot'])
-        data = tools.ReadFile(fname)
+        data = tools.read_file(fname)
         self.assertEqual(U_BOOT_DATA, data)
 
     def _CheckExtractOutput(self, decomp):
@@ -2906,7 +2909,7 @@
                 expect_size: Size of data to expect in file, or None to skip
             """
             path = os.path.join(outdir, entry_path)
-            data = tools.ReadFile(path)
+            data = tools.read_file(path)
             os.remove(path)
             if expect_data:
                 self.assertEqual(expect_data, data)
@@ -2926,7 +2929,7 @@
             os.rmdir(path)
 
         self._DoReadFileRealDtb('130_list_fdtmap.dts')
-        image_fname = tools.GetOutputFilename('image.bin')
+        image_fname = tools.get_output_filename('image.bin')
         outdir = os.path.join(self._indir, 'extract')
         einfos = control.ExtractEntries(image_fname, None, outdir, [], decomp)
 
@@ -2962,7 +2965,7 @@
         _CheckPresent('section/root', section.data)
         cbfs = section_entries['cbfs']
         _CheckPresent('section/cbfs/root', cbfs.data)
-        data = tools.ReadFile(image_fname)
+        data = tools.read_file(image_fname)
         _CheckPresent('root', data)
 
         # There should be no files left. Remove all the directories to check.
@@ -2987,7 +2990,7 @@
         """Test extracting some entries"""
         self._CheckLz4()
         self._DoReadFileRealDtb('130_list_fdtmap.dts')
-        image_fname = tools.GetOutputFilename('image.bin')
+        image_fname = tools.get_output_filename('image.bin')
         outdir = os.path.join(self._indir, 'extract')
         einfos = control.ExtractEntries(image_fname, None, outdir,
                                         ['*cb*', '*head*'])
@@ -3002,7 +3005,7 @@
         """Test extracting some entries"""
         self._CheckLz4()
         self._DoReadFileRealDtb('130_list_fdtmap.dts')
-        image_fname = tools.GetOutputFilename('image.bin')
+        image_fname = tools.get_output_filename('image.bin')
         with self.assertRaises(ValueError) as e:
             control.ExtractEntries(image_fname, 'fname', None, [])
         self.assertIn('Must specify an entry path to write with -f',
@@ -3012,7 +3015,7 @@
         """Test extracting some entries"""
         self._CheckLz4()
         self._DoReadFileRealDtb('130_list_fdtmap.dts')
-        image_fname = tools.GetOutputFilename('image.bin')
+        image_fname = tools.get_output_filename('image.bin')
         with self.assertRaises(ValueError) as e:
             control.ExtractEntries(image_fname, 'fname', None, ['a', 'b'])
         self.assertIn('Must specify exactly one entry path to write with -f',
@@ -3113,9 +3116,9 @@
         orig_dtb_data = entries['u-boot-dtb'].data
         orig_fdtmap_data = entries['fdtmap'].data
 
-        image_fname = tools.GetOutputFilename('image.bin')
-        updated_fname = tools.GetOutputFilename('image-updated.bin')
-        tools.WriteFile(updated_fname, tools.ReadFile(image_fname))
+        image_fname = tools.get_output_filename('image.bin')
+        updated_fname = tools.get_output_filename('image-updated.bin')
+        tools.write_file(updated_fname, tools.read_file(image_fname))
         image = control.WriteEntry(updated_fname, entry_name, data, decomp,
                                    allow_resize)
         data = control.ReadEntry(updated_fname, entry_name, decomp)
@@ -3170,8 +3173,8 @@
         data = self._DoReadFileDtb('133_replace_multi.dts', use_real_dtb=True,
                                    update_dtb=True)[0]
         expected = b'x' * len(U_BOOT_DATA)
-        updated_fname = tools.GetOutputFilename('image-updated.bin')
-        tools.WriteFile(updated_fname, data)
+        updated_fname = tools.get_output_filename('image-updated.bin')
+        tools.write_file(updated_fname, data)
         entry_name = 'u-boot'
         control.WriteEntry(updated_fname, entry_name, expected,
                            allow_resize=False)
@@ -3182,9 +3185,9 @@
         self.assertEqual('/binman/image', state.fdt_path_prefix)
 
         # Now check we can write the first image
-        image_fname = tools.GetOutputFilename('first-image.bin')
-        updated_fname = tools.GetOutputFilename('first-updated.bin')
-        tools.WriteFile(updated_fname, tools.ReadFile(image_fname))
+        image_fname = tools.get_output_filename('first-image.bin')
+        updated_fname = tools.get_output_filename('first-updated.bin')
+        tools.write_file(updated_fname, tools.read_file(image_fname))
         entry_name = 'u-boot'
         control.WriteEntry(updated_fname, entry_name, expected,
                            allow_resize=False)
@@ -3348,8 +3351,8 @@
         self._CheckLz4()
         expected = b'x' * len(U_BOOT_DATA)
         data = self._DoReadFileRealDtb('142_replace_cbfs.dts')
-        updated_fname = tools.GetOutputFilename('image-updated.bin')
-        tools.WriteFile(updated_fname, data)
+        updated_fname = tools.get_output_filename('image-updated.bin')
+        tools.write_file(updated_fname, data)
         entry_name = 'section/cbfs/u-boot'
         control.WriteEntry(updated_fname, entry_name, expected,
                            allow_resize=True)
@@ -3361,8 +3364,8 @@
         self._CheckLz4()
         expected = U_BOOT_DATA + b'x'
         data = self._DoReadFileRealDtb('142_replace_cbfs.dts')
-        updated_fname = tools.GetOutputFilename('image-updated.bin')
-        tools.WriteFile(updated_fname, data)
+        updated_fname = tools.get_output_filename('image-updated.bin')
+        tools.write_file(updated_fname, data)
         entry_name = 'section/cbfs/u-boot'
         control.WriteEntry(updated_fname, entry_name, expected,
                            allow_resize=True)
@@ -3383,23 +3386,23 @@
         """
         data = self._DoReadFileRealDtb('143_replace_all.dts')
 
-        updated_fname = tools.GetOutputFilename('image-updated.bin')
-        tools.WriteFile(updated_fname, data)
+        updated_fname = tools.get_output_filename('image-updated.bin')
+        tools.write_file(updated_fname, data)
 
         outdir = os.path.join(self._indir, 'extract')
         einfos = control.ExtractEntries(updated_fname, None, outdir, [])
 
         expected1 = b'x' + U_BOOT_DATA + b'y'
         u_boot_fname1 = os.path.join(outdir, 'u-boot')
-        tools.WriteFile(u_boot_fname1, expected1)
+        tools.write_file(u_boot_fname1, expected1)
 
         expected2 = b'a' + U_BOOT_DATA + b'b'
         u_boot_fname2 = os.path.join(outdir, 'u-boot2')
-        tools.WriteFile(u_boot_fname2, expected2)
+        tools.write_file(u_boot_fname2, expected2)
 
         expected_text = b'not the same text'
         text_fname = os.path.join(outdir, 'text')
-        tools.WriteFile(text_fname, expected_text)
+        tools.write_file(text_fname, expected_text)
 
         dtb_fname = os.path.join(outdir, 'u-boot-dtb')
         dtb = fdt.FdtScan(dtb_fname)
@@ -3475,10 +3478,10 @@
 
             fname = os.path.join(tmpdir, 'update-u-boot.bin')
             expected = b'x' * len(U_BOOT_DATA)
-            tools.WriteFile(fname, expected)
+            tools.write_file(fname, expected)
 
             self._DoBinman('replace', '-i', updated_fname, 'u-boot', '-f', fname)
-            data = tools.ReadFile(updated_fname)
+            data = tools.read_file(updated_fname)
             self.assertEqual(expected, data[:len(expected)])
             map_fname = os.path.join(tmpdir, 'image-updated.map')
             self.assertFalse(os.path.exists(map_fname))
@@ -3493,7 +3496,7 @@
         self._DoBinman('replace', '-i', updated_fname, '-I', outdir,
                        'u-boot2', 'text')
 
-        tools.PrepareOutputDir(None)
+        tools.prepare_output_dir(None)
         image = Image.FromFile(updated_fname)
         image.LoadData()
         entries = image.GetEntries()
@@ -3531,7 +3534,7 @@
 
             fname = os.path.join(self._indir, 'update-u-boot.bin')
             expected = b'x' * len(U_BOOT_DATA)
-            tools.WriteFile(fname, expected)
+            tools.write_file(fname, expected)
 
             self._DoBinman('replace', '-i', updated_fname, 'u-boot',
                            '-f', fname, '-m')
@@ -3543,7 +3546,7 @@
     def testReplaceNoEntryPaths(self):
         """Test replacing an entry without an entry path"""
         self._DoReadFileRealDtb('143_replace_all.dts')
-        image_fname = tools.GetOutputFilename('image.bin')
+        image_fname = tools.get_output_filename('image.bin')
         with self.assertRaises(ValueError) as e:
             control.ReplaceEntries(image_fname, 'fname', None, [])
         self.assertIn('Must specify an entry path to read with -f',
@@ -3552,7 +3555,7 @@
     def testReplaceTooManyEntryPaths(self):
         """Test extracting some entries"""
         self._DoReadFileRealDtb('143_replace_all.dts')
-        image_fname = tools.GetOutputFilename('image.bin')
+        image_fname = tools.get_output_filename('image.bin')
         with self.assertRaises(ValueError) as e:
             control.ReplaceEntries(image_fname, 'fname', None, ['a', 'b'])
         self.assertIn('Must specify exactly one entry path to write with -f',
@@ -3597,15 +3600,15 @@
         data = self._DoReadFile(dts)
         sym_values = struct.pack('<LQLL', *expected_vals)
         upto1 = 4 + len(U_BOOT_SPL_DATA)
-        expected1 = tools.GetBytes(0xff, 4) + sym_values + U_BOOT_SPL_DATA[20:]
+        expected1 = tools.get_bytes(0xff, 4) + sym_values + U_BOOT_SPL_DATA[20:]
         self.assertEqual(expected1, data[:upto1])
 
         upto2 = upto1 + 1 + len(U_BOOT_SPL_DATA)
-        expected2 = tools.GetBytes(0xff, 1) + sym_values + U_BOOT_SPL_DATA[20:]
+        expected2 = tools.get_bytes(0xff, 1) + sym_values + U_BOOT_SPL_DATA[20:]
         self.assertEqual(expected2, data[upto1:upto2])
 
         upto3 = 0x34 + len(U_BOOT_DATA)
-        expected3 = tools.GetBytes(0xff, 1) + U_BOOT_DATA
+        expected3 = tools.get_bytes(0xff, 1) + U_BOOT_DATA
         self.assertEqual(expected3, data[upto2:upto3])
 
         expected4 = sym_values + U_BOOT_TPL_DATA[20:]
@@ -3713,13 +3716,7 @@
         """Test that zero-size overlapping regions are ignored"""
         self._DoTestFile('160_pack_overlap_zero.dts')
 
-    def testSimpleFit(self):
-        """Test an image with a FIT inside"""
-        data = self._DoReadFile('161_fit.dts')
-        self.assertEqual(U_BOOT_DATA, data[:len(U_BOOT_DATA)])
-        self.assertEqual(U_BOOT_NODTB_DATA, data[-len(U_BOOT_NODTB_DATA):])
-        fit_data = data[len(U_BOOT_DATA):-len(U_BOOT_NODTB_DATA)]
-
+    def _CheckSimpleFitData(self, fit_data, kernel_data, fdt1_data):
         # The data should be inside the FIT
         dtb = fdt.Fdt.FromData(fit_data)
         dtb.Scan()
@@ -3727,8 +3724,8 @@
         self.assertIn('data', fnode.props)
 
         fname = os.path.join(self._indir, 'fit_data.fit')
-        tools.WriteFile(fname, fit_data)
-        out = tools.Run('dumpimage', '-l', fname)
+        tools.write_file(fname, fit_data)
+        out = tools.run('dumpimage', '-l', fname)
 
         # Check a few features to make sure the plumbing works. We don't need
         # to test the operation of mkimage or dumpimage here. First convert the
@@ -3752,8 +3749,26 @@
         self.assertIsNotNone(data_sizes)
         self.assertEqual(2, len(data_sizes))
         # Format is "4 Bytes = 0.00 KiB = 0.00 MiB" so take the first word
-        self.assertEqual(len(U_BOOT_DATA), int(data_sizes[0].split()[0]))
-        self.assertEqual(len(U_BOOT_SPL_DTB_DATA), int(data_sizes[1].split()[0]))
+        self.assertEqual(len(kernel_data), int(data_sizes[0].split()[0]))
+        self.assertEqual(len(fdt1_data), int(data_sizes[1].split()[0]))
+
+    def testSimpleFit(self):
+        """Test an image with a FIT inside"""
+        data = self._DoReadFile('161_fit.dts')
+        self.assertEqual(U_BOOT_DATA, data[:len(U_BOOT_DATA)])
+        self.assertEqual(U_BOOT_NODTB_DATA, data[-len(U_BOOT_NODTB_DATA):])
+        fit_data = data[len(U_BOOT_DATA):-len(U_BOOT_NODTB_DATA)]
+
+        self._CheckSimpleFitData(fit_data, U_BOOT_DATA, U_BOOT_SPL_DTB_DATA)
+
+    def testSimpleFitExpandsSubentries(self):
+        """Test that FIT images expand their subentries"""
+        data = self._DoReadFileDtb('161_fit.dts', use_expanded=True)[0]
+        self.assertEqual(U_BOOT_EXP_DATA, data[:len(U_BOOT_EXP_DATA)])
+        self.assertEqual(U_BOOT_NODTB_DATA, data[-len(U_BOOT_NODTB_DATA):])
+        fit_data = data[len(U_BOOT_EXP_DATA):-len(U_BOOT_NODTB_DATA)]
+
+        self._CheckSimpleFitData(fit_data, U_BOOT_EXP_DATA, U_BOOT_SPL_DTB_DATA)
 
     def testFitExternal(self):
         """Test an image with an FIT with external images"""
@@ -3763,7 +3778,7 @@
         # Size of the external-data region as set up by mkimage
         external_data_size = len(U_BOOT_DATA) + 2
         expected_size = (len(U_BOOT_DATA) + 0x400 +
-                         tools.Align(external_data_size, 4) +
+                         tools.align(external_data_size, 4) +
                          len(U_BOOT_NODTB_DATA))
 
         # The data should be outside the FIT
@@ -3802,8 +3817,8 @@
         """Test pad-before, pad-after for entries in sections"""
         data, _, _, out_dtb_fname = self._DoReadFileDtb(
             '166_pad_in_sections.dts', update_dtb=True)
-        expected = (U_BOOT_DATA + tools.GetBytes(ord('!'), 12) +
-                    U_BOOT_DATA + tools.GetBytes(ord('!'), 6) +
+        expected = (U_BOOT_DATA + tools.get_bytes(ord('!'), 12) +
+                    U_BOOT_DATA + tools.get_bytes(ord('!'), 6) +
                     U_BOOT_DATA)
         self.assertEqual(expected, data)
 
@@ -3835,6 +3850,7 @@
 
     def testFitImageSubentryAlignment(self):
         """Test relative alignability of FIT image subentries"""
+        self._SetupSplElf()
         entry_args = {
             'test-id': TEXT_DATA,
         }
@@ -3846,14 +3862,14 @@
         node = dtb.GetNode('/images/kernel')
         data = dtb.GetProps(node)["data"].bytes
         align_pad = 0x10 - (len(U_BOOT_SPL_DATA) % 0x10)
-        expected = (tools.GetBytes(0, 0x20) + U_BOOT_SPL_DATA +
-                    tools.GetBytes(0, align_pad) + U_BOOT_DATA)
+        expected = (tools.get_bytes(0, 0x20) + U_BOOT_SPL_DATA +
+                    tools.get_bytes(0, align_pad) + U_BOOT_DATA)
         self.assertEqual(expected, data)
 
         node = dtb.GetNode('/images/fdt-1')
         data = dtb.GetProps(node)["data"].bytes
-        expected = (U_BOOT_SPL_DTB_DATA + tools.GetBytes(0, 20) +
-                    tools.ToBytes(TEXT_DATA) + tools.GetBytes(0, 30) +
+        expected = (U_BOOT_SPL_DTB_DATA + tools.get_bytes(0, 20) +
+                    tools.to_bytes(TEXT_DATA) + tools.get_bytes(0, 30) +
                     U_BOOT_DTB_DATA)
         self.assertEqual(expected, data)
 
@@ -4069,8 +4085,8 @@
     def testSkipAtStartPad(self):
         """Test handling of skip-at-start section with padded entry"""
         data = self._DoReadFile('178_skip_at_start_pad.dts')
-        before = tools.GetBytes(0, 8)
-        after = tools.GetBytes(0, 4)
+        before = tools.get_bytes(0, 8)
+        after = tools.get_bytes(0, 4)
         all = before + U_BOOT_DATA + after
         self.assertEqual(all, data)
 
@@ -4089,8 +4105,8 @@
     def testSkipAtStartSectionPad(self):
         """Test handling of skip-at-start section with padding"""
         data = self._DoReadFile('179_skip_at_start_section_pad.dts')
-        before = tools.GetBytes(0, 8)
-        after = tools.GetBytes(0, 4)
+        before = tools.get_bytes(0, 8)
+        after = tools.get_bytes(0, 4)
         all = before + U_BOOT_DATA + after
         self.assertEqual(all, data)
 
@@ -4110,23 +4126,23 @@
     def testSectionPad(self):
         """Testing padding with sections"""
         data = self._DoReadFile('180_section_pad.dts')
-        expected = (tools.GetBytes(ord('&'), 3) +
-                    tools.GetBytes(ord('!'), 5) +
+        expected = (tools.get_bytes(ord('&'), 3) +
+                    tools.get_bytes(ord('!'), 5) +
                     U_BOOT_DATA +
-                    tools.GetBytes(ord('!'), 1) +
-                    tools.GetBytes(ord('&'), 2))
+                    tools.get_bytes(ord('!'), 1) +
+                    tools.get_bytes(ord('&'), 2))
         self.assertEqual(expected, data)
 
     def testSectionAlign(self):
         """Testing alignment with sections"""
         data = self._DoReadFileDtb('181_section_align.dts', map=True)[0]
         expected = (b'\0' +                         # fill section
-                    tools.GetBytes(ord('&'), 1) +   # padding to section align
+                    tools.get_bytes(ord('&'), 1) +   # padding to section align
                     b'\0' +                         # fill section
-                    tools.GetBytes(ord('!'), 3) +   # padding to u-boot align
+                    tools.get_bytes(ord('!'), 3) +   # padding to u-boot align
                     U_BOOT_DATA +
-                    tools.GetBytes(ord('!'), 4) +   # padding to u-boot size
-                    tools.GetBytes(ord('!'), 4))    # padding to section size
+                    tools.get_bytes(ord('!'), 4) +   # padding to u-boot size
+                    tools.get_bytes(ord('!'), 4))    # padding to section size
         self.assertEqual(expected, data)
 
     def testCompressImage(self):
@@ -4357,7 +4373,7 @@
             '188_image_entryarg.dts',use_real_dtb=True, update_dtb=True,
             entry_args=entry_args)
 
-        image_fname = tools.GetOutputFilename('image.bin')
+        image_fname = tools.get_output_filename('image.bin')
         orig_image = control.images['image']
 
         # This should not generate an error about the missing 'cros-ec-rw-path'
@@ -4378,7 +4394,7 @@
     def testReadImageSkip(self):
         """Test reading an image and accessing its FDT map"""
         data = self.data = self._DoReadFileRealDtb('191_read_image_skip.dts')
-        image_fname = tools.GetOutputFilename('image.bin')
+        image_fname = tools.get_output_filename('image.bin')
         orig_image = control.images['image']
         image = Image.FromFile(image_fname)
         self.assertEqual(orig_image.GetEntries().keys(),
@@ -4406,7 +4422,7 @@
         # ELF file with a '__bss_size' symbol
         self._SetupTplElf()
         data = self._DoReadFile('193_tpl_bss_pad.dts')
-        self.assertEqual(U_BOOT_TPL_DATA + tools.GetBytes(0, 10) + U_BOOT_DATA,
+        self.assertEqual(U_BOOT_TPL_DATA + tools.get_bytes(0, 10) + U_BOOT_DATA,
                          data)
 
     def testTplBssPadMissing(self):
@@ -4605,8 +4621,8 @@
         """Test a collection"""
         data = self._DoReadFile('198_collection.dts')
         self.assertEqual(U_BOOT_NODTB_DATA + U_BOOT_DTB_DATA +
-                         tools.GetBytes(0xff, 2) + U_BOOT_NODTB_DATA +
-                         tools.GetBytes(0xfe, 3) + U_BOOT_DTB_DATA,
+                         tools.get_bytes(0xff, 2) + U_BOOT_NODTB_DATA +
+                         tools.get_bytes(0xfe, 3) + U_BOOT_DTB_DATA,
                          data)
 
     def testCollectionSection(self):
@@ -4617,21 +4633,21 @@
         # missing.
         data = self._DoReadFile('199_collection_section.dts')
         section = U_BOOT_NODTB_DATA + U_BOOT_DTB_DATA
-        self.assertEqual(section + U_BOOT_DATA + tools.GetBytes(0xff, 2) +
-                         section + tools.GetBytes(0xfe, 3) + U_BOOT_DATA,
+        self.assertEqual(section + U_BOOT_DATA + tools.get_bytes(0xff, 2) +
+                         section + tools.get_bytes(0xfe, 3) + U_BOOT_DATA,
                          data)
 
     def testAlignDefault(self):
         """Test that default alignment works on sections"""
         data = self._DoReadFile('200_align_default.dts')
-        expected = (U_BOOT_DATA + tools.GetBytes(0, 8 - len(U_BOOT_DATA)) +
+        expected = (U_BOOT_DATA + tools.get_bytes(0, 8 - len(U_BOOT_DATA)) +
                     U_BOOT_DATA)
         # Special alignment for section
-        expected += tools.GetBytes(0, 32 - len(expected))
+        expected += tools.get_bytes(0, 32 - len(expected))
         # No alignment within the nested section
         expected += U_BOOT_DATA + U_BOOT_NODTB_DATA;
         # Now the final piece, which should be default-aligned
-        expected += tools.GetBytes(0, 88 - len(expected)) + U_BOOT_NODTB_DATA
+        expected += tools.get_bytes(0, 88 - len(expected)) + U_BOOT_NODTB_DATA
         self.assertEqual(expected, data)
 
     def testPackOpenSBI(self):
@@ -4642,9 +4658,9 @@
     def testSectionsSingleThread(self):
         """Test sections without multithreading"""
         data = self._DoReadFileDtb('055_sections.dts', threads=0)[0]
-        expected = (U_BOOT_DATA + tools.GetBytes(ord('!'), 12) +
-                    U_BOOT_DATA + tools.GetBytes(ord('a'), 12) +
-                    U_BOOT_DATA + tools.GetBytes(ord('&'), 4))
+        expected = (U_BOOT_DATA + tools.get_bytes(ord('!'), 12) +
+                    U_BOOT_DATA + tools.get_bytes(ord('a'), 12) +
+                    U_BOOT_DATA + tools.get_bytes(ord('&'), 4))
         self.assertEqual(expected, data)
 
     def testThreadTimeout(self):
@@ -4677,7 +4693,7 @@
         # definition in the correct place
         syms = elf.GetSymbolFileOffset(infile,
                                        ['dtb_embed_begin', 'dtb_embed_end'])
-        data = tools.ReadFile(outfile)
+        data = tools.read_file(outfile)
         dtb_data = data[syms['dtb_embed_begin'].offset:
                         syms['dtb_embed_end'].offset]
 
@@ -4756,7 +4772,7 @@
 
         # Set up a version file to make sure that works
         version = 'v2025.01-rc2'
-        tools.WriteFile(os.path.join(self._indir, 'version'), version,
+        tools.write_file(os.path.join(self._indir, 'version'), version,
                         binary=False)
         self.assertEqual(version, state.GetVersion(self._indir))
 
@@ -4780,7 +4796,7 @@
 
             # Check that we can read it and it can be scanning, meaning it does
             # not have a 16-byte fdtmap header
-            data = tools.ReadFile(dtb)
+            data = tools.read_file(dtb)
             dtb = fdt.Fdt.FromData(data)
             dtb.Scan()
 
@@ -4788,7 +4804,7 @@
             fname = os.path.join(tmpdir, 'fdt.dtb')
             self._DoBinman('extract', '-i', updated_fname, '-F', 'dummy',
                            '-f', fname, 'u-boot')
-            data = tools.ReadFile(fname)
+            data = tools.read_file(fname)
             self.assertEqual(U_BOOT_DATA, data)
 
         finally:
@@ -4917,7 +4933,7 @@
         fdtmap_data = data[fdtmap.image_pos:fdtmap.image_pos + fdtmap.size]
         magic = fdtmap_data[:8]
         self.assertEqual(b'_FDTMAP_', magic)
-        self.assertEqual(tools.GetBytes(0, 8), fdtmap_data[8:16])
+        self.assertEqual(tools.get_bytes(0, 8), fdtmap_data[8:16])
 
         fdt_data = fdtmap_data[16:]
         dtb = fdt.Fdt.FromData(fdt_data)
@@ -4944,25 +4960,25 @@
     def testFipExtractOneEntry(self):
         """Test extracting a single entry fron an FIP"""
         self._DoReadFileRealDtb('207_fip_ls.dts')
-        image_fname = tools.GetOutputFilename('image.bin')
+        image_fname = tools.get_output_filename('image.bin')
         fname = os.path.join(self._indir, 'output.extact')
         control.ExtractEntries(image_fname, fname, None, ['atf-fip/u-boot'])
-        data = tools.ReadFile(fname)
+        data = tools.read_file(fname)
         self.assertEqual(U_BOOT_DATA, data)
 
     def testFipReplace(self):
         """Test replacing a single file in a FIP"""
-        expected = U_BOOT_DATA + tools.GetBytes(0x78, 50)
+        expected = U_BOOT_DATA + tools.get_bytes(0x78, 50)
         data = self._DoReadFileRealDtb('208_fip_replace.dts')
-        updated_fname = tools.GetOutputFilename('image-updated.bin')
-        tools.WriteFile(updated_fname, data)
+        updated_fname = tools.get_output_filename('image-updated.bin')
+        tools.write_file(updated_fname, data)
         entry_name = 'atf-fip/u-boot'
         control.WriteEntry(updated_fname, entry_name, expected,
                            allow_resize=True)
         actual = control.ReadEntry(updated_fname, entry_name)
         self.assertEqual(expected, actual)
 
-        new_data = tools.ReadFile(updated_fname)
+        new_data = tools.read_file(updated_fname)
         hdr, fents = fip_util.decode_fip(new_data)
 
         self.assertEqual(2, len(fents))
@@ -4999,7 +5015,7 @@
         self.assertEqual(True, fent.valid)
 
         rest = data[0x60 + len(ATF_BL31_DATA):0x100]
-        self.assertEqual(tools.GetBytes(0xff, len(rest)), rest)
+        self.assertEqual(tools.get_bytes(0xff, len(rest)), rest)
 
     def testFipBadAlign(self):
         """Test that an invalid alignment value in a FIP is detected"""
@@ -5055,7 +5071,7 @@
 
     def testFetchBintools(self):
         def fail_download(url):
-            """Take the tools.Download() function by raising an exception"""
+            """Take the tools.download() function by raising an exception"""
             raise urllib.error.URLError('my error')
 
         args = ['tool']
@@ -5070,7 +5086,7 @@
         self.assertIn('Please specify bintools to fetch', str(e.exception))
 
         args = ['tool', '--fetch', '_testing']
-        with unittest.mock.patch.object(tools, 'Download',
+        with unittest.mock.patch.object(tools, 'download',
                                         side_effect=fail_download):
             with test_util.capture_sys_output() as (stdout, _):
                 self._DoBinman(*args)
@@ -5118,6 +5134,31 @@
         finally:
             shutil.rmtree(tmpdir)
 
+    def testFitSubentryUsesBintool(self):
+        """Test that binman FIT subentries can use bintools"""
+        command.test_result = self._HandleGbbCommand
+        entry_args = {
+            'keydir': 'devkeys',
+            'bmpblk': 'bmpblk.bin',
+        }
+        data, _, _, _ = self._DoReadFileDtb('220_fit_subentry_bintool.dts',
+                entry_args=entry_args)
+
+        expected = (GBB_DATA + GBB_DATA + tools.get_bytes(0, 8) +
+                    tools.get_bytes(0, 0x2180 - 16))
+        self.assertIn(expected, data)
+
+    def testFitSubentryMissingBintool(self):
+        """Test that binman reports missing bintools for FIT subentries"""
+        entry_args = {
+            'keydir': 'devkeys',
+        }
+        with test_util.capture_sys_output() as (_, stderr):
+            self._DoTestFile('220_fit_subentry_bintool.dts',
+                    force_missing_bintools='futility', entry_args=entry_args)
+        err = stderr.getvalue()
+        self.assertRegex(err,
+                         "Image 'main-section'.*missing bintools.*: futility")
 
 if __name__ == "__main__":
     unittest.main()
diff --git a/tools/binman/image.py b/tools/binman/image.py
index cb5279c..afc4b4d 100644
--- a/tools/binman/image.py
+++ b/tools/binman/image.py
@@ -111,7 +111,7 @@
         Raises:
             ValueError if something goes wrong
         """
-        data = tools.ReadFile(fname)
+        data = tools.read_file(fname)
         size = len(data)
 
         # First look for an image header
@@ -128,8 +128,8 @@
         dtb_size = probe_dtb.GetFdtObj().totalsize()
         fdtmap_data = data[pos:pos + dtb_size + fdtmap.FDTMAP_HDR_LEN]
         fdt_data = fdtmap_data[fdtmap.FDTMAP_HDR_LEN:]
-        out_fname = tools.GetOutputFilename('fdtmap.in.dtb')
-        tools.WriteFile(out_fname, fdt_data)
+        out_fname = tools.get_output_filename('fdtmap.in.dtb')
+        tools.write_file(out_fname, fdt_data)
         dtb = fdt.Fdt(out_fname)
         dtb.Scan()
 
@@ -174,12 +174,12 @@
 
     def BuildImage(self):
         """Write the image to a file"""
-        fname = tools.GetOutputFilename(self._filename)
-        tout.Info("Writing image to '%s'" % fname)
+        fname = tools.get_output_filename(self._filename)
+        tout.info("Writing image to '%s'" % fname)
         with open(fname, 'wb') as fd:
             data = self.GetPaddedData()
             fd.write(data)
-        tout.Info("Wrote %#x bytes" % len(data))
+        tout.info("Wrote %#x bytes" % len(data))
 
     def WriteMap(self):
         """Write a map of the image to a .map file
@@ -188,7 +188,7 @@
             Filename of map file written
         """
         filename = '%s.map' % self.image_name
-        fname = tools.GetOutputFilename(filename)
+        fname = tools.get_output_filename(filename)
         with open(fname, 'w') as fd:
             print('%8s  %8s  %8s  %s' % ('ImagePos', 'Offset', 'Size', 'Name'),
                   file=fd)
@@ -230,7 +230,7 @@
         return entry
 
     def ReadData(self, decomp=True, alt_format=None):
-        tout.Debug("Image '%s' ReadData(), size=%#x" %
+        tout.debug("Image '%s' ReadData(), size=%#x" %
                    (self.GetPath(), len(self._data)))
         return self._data
 
diff --git a/tools/binman/main.py b/tools/binman/main.py
index 03462e7..ab25b48 100755
--- a/tools/binman/main.py
+++ b/tools/binman/main.py
@@ -84,14 +84,14 @@
 
     # Run the entry tests first ,since these need to be the first to import the
     # 'entry' module.
-    test_util.RunTestSuites(
+    test_util.run_test_suites(
         result, debug, verbosity, test_preserve_dirs, processes, test_name,
         toolpath,
         [bintool_test.TestBintool, entry_test.TestEntry, ftest.TestFunctional,
          fdt_test.TestFdt, elf_test.TestElf, image_test.TestImage,
          cbfs_util_test.TestCbfs, fip_util_test.TestFip])
 
-    return test_util.ReportResult('binman', test_name, result)
+    return test_util.report_result('binman', test_name, result)
 
 def RunTestCoverage(toolpath):
     """Run the tests and check that we get 100% coverage"""
@@ -102,7 +102,7 @@
     if toolpath:
         for path in toolpath:
             extra_args += ' --toolpath %s' % path
-    test_util.RunTestCoverage('tools/binman/binman', None,
+    test_util.run_test_coverage('tools/binman/binman', None,
             ['*test*', '*main.py', 'tools/patman/*', 'tools/dtoc/*'],
             args.build_dir, all_set, extra_args or None)
 
diff --git a/tools/binman/state.py b/tools/binman/state.py
index af0a65e..8cd8a48 100644
--- a/tools/binman/state.py
+++ b/tools/binman/state.py
@@ -138,8 +138,8 @@
         data = GetFdtForEtype(etype).GetContents()
     else:
         fname = output_fdt_info[etype][1]
-        pathname = tools.GetInputFilename(fname)
-        data = tools.ReadFile(pathname)
+        pathname = tools.get_input_filename(fname)
+        data = tools.read_file(pathname)
     return pathname, data
 
 def UpdateFdtContents(etype, data):
@@ -154,7 +154,7 @@
     """
     dtb, fname = output_fdt_info[etype]
     dtb_fname = dtb.GetFilename()
-    tools.WriteFile(dtb_fname, data)
+    tools.write_file(dtb_fname, data)
     dtb = fdt.FdtScan(dtb_fname)
     output_fdt_info[etype] = [dtb, fname]
 
@@ -170,16 +170,16 @@
     global entry_args
 
     entry_args = {}
-    tout.Debug('Processing entry args:')
+    tout.debug('Processing entry args:')
     if args:
         for arg in args:
             m = re.match('([^=]*)=(.*)', arg)
             if not m:
                 raise ValueError("Invalid entry arguemnt '%s'" % arg)
             name, value = m.groups()
-            tout.Debug('   %20s = %s' % (name, value))
+            tout.debug('   %20s = %s' % (name, value))
             entry_args[name] = value
-    tout.Debug('Processing entry args done')
+    tout.debug('Processing entry args done')
 
 def GetEntryArg(name):
     """Get the value of an entry argument
@@ -235,12 +235,12 @@
     else:
         fdt_set = {}
         for etype, fname in DTB_TYPE_FNAME.items():
-            infile = tools.GetInputFilename(fname, allow_missing=True)
+            infile = tools.get_input_filename(fname, allow_missing=True)
             if infile and os.path.exists(infile):
                 fname_dtb = fdt_util.EnsureCompiled(infile)
-                out_fname = tools.GetOutputFilename('%s.out' %
+                out_fname = tools.get_output_filename('%s.out' %
                         os.path.split(fname)[1])
-                tools.WriteFile(out_fname, tools.ReadFile(fname_dtb))
+                tools.write_file(out_fname, tools.read_file(fname_dtb))
                 other_dtb = fdt.FdtScan(out_fname)
                 output_fdt_info[etype] = [other_dtb, out_fname]
 
@@ -263,21 +263,21 @@
     """
     global output_fdt_info, main_dtb, fdt_path_prefix
 
-    tout.Info('Preparing device trees')
+    tout.info('Preparing device trees')
     output_fdt_info.clear()
     fdt_path_prefix = ''
     output_fdt_info['fdtmap'] = [image.fdtmap_dtb, 'u-boot.dtb']
     main_dtb = None
-    tout.Info("   Found device tree type 'fdtmap' '%s'" % image.fdtmap_dtb.name)
+    tout.info("   Found device tree type 'fdtmap' '%s'" % image.fdtmap_dtb.name)
     for etype, value in image.GetFdts().items():
         entry, fname = value
-        out_fname = tools.GetOutputFilename('%s.dtb' % entry.etype)
-        tout.Info("   Found device tree type '%s' at '%s' path '%s'" %
+        out_fname = tools.get_output_filename('%s.dtb' % entry.etype)
+        tout.info("   Found device tree type '%s' at '%s' path '%s'" %
                   (etype, out_fname, entry.GetPath()))
         entry._filename = entry.GetDefaultFilename()
         data = entry.ReadData()
 
-        tools.WriteFile(out_fname, data)
+        tools.write_file(out_fname, data)
         dtb = fdt.Fdt(out_fname)
         dtb.Scan()
         image_node = dtb.GetNode('/binman')
@@ -285,7 +285,7 @@
             image_node = dtb.GetNode('/binman/%s' % image.image_node)
         fdt_path_prefix = image_node.path
         output_fdt_info[etype] = [dtb, None]
-    tout.Info("   FDT path prefix '%s'" % fdt_path_prefix)
+    tout.info("   FDT path prefix '%s'" % fdt_path_prefix)
 
 
 def GetAllFdts():
@@ -384,7 +384,7 @@
         for_repack: True is this property is only needed for repacking
     """
     for n in GetUpdateNodes(node, for_repack):
-        tout.Detail("File %s: Update node '%s' prop '%s' to %#x" %
+        tout.detail("File %s: Update node '%s' prop '%s' to %#x" %
                     (n.GetFdt().name, n.path, prop, value))
         n.SetInt(prop, value)
 
@@ -529,7 +529,7 @@
     """
     version_fname = os.path.join(path, 'version')
     if os.path.exists(version_fname):
-        version = tools.ReadFile(version_fname, binary=False)
+        version = tools.read_file(version_fname, binary=False)
     else:
         version = '(unreleased)'
     return version
diff --git a/tools/binman/test/220_fit_subentry_bintool.dts b/tools/binman/test/220_fit_subentry_bintool.dts
new file mode 100644
index 0000000..6e29d41
--- /dev/null
+++ b/tools/binman/test/220_fit_subentry_bintool.dts
@@ -0,0 +1,39 @@
+// SPDX-License-Identifier: GPL-2.0+
+
+/dts-v1/;
+
+/ {
+	#address-cells = <1>;
+	#size-cells = <1>;
+
+	binman {
+		fit {
+			description = "test-desc";
+			#address-cells = <1>;
+
+			images {
+				test {
+					description = "Something using a bintool";
+					type = "kernel";
+					arch = "arm";
+					os = "linux";
+					compression = "gzip";
+					load = <00000000>;
+					entry = <00000000>;
+
+					gbb {
+						size = <0x2180>;
+					};
+				};
+			};
+
+			configurations {
+				default = "conf-1";
+				conf-1 {
+					description = "Boot bintool output";
+					kernel = "kernel";
+				};
+			};
+		};
+	};
+};
diff --git a/tools/buildman/README b/tools/buildman/README
index ce27788..bafb3b0 100644
--- a/tools/buildman/README
+++ b/tools/buildman/README
@@ -1095,6 +1095,55 @@
 specify the output directory with -o when using -w.
 
 
+Changing the configuration
+==========================
+
+Sometimes it is useful to change the CONFIG options for a build on the fly. This
+can be used to build a board (or multiple) with a few changes to see the impact.
+The -a option supports this:
+
+   -a <cfg>
+
+where <cfg> is a CONFIG option (with or without the CONFIG_ prefix) to enable.
+For example:
+
+    buildman -a CMD_SETEXPR_FMT
+
+will build with CONFIG_CMD_SETEXPR_FMT enabled.
+
+You can disable options by preceding them with tilde (~). You can specify the
+-a option multiple times:
+
+    buildman -a CMD_SETEXPR_FMT -a ~CMDLINE
+
+Some options have values, in which case you can change them:
+
+    buildman -a 'BOOTCOMMAND="echo hello"' CONFIG_SYS_LOAD_ADDR=0x1000
+
+Note that you must put quotes around string options and the whole thing must be
+in single quotes, to make sure the shell leave it alone.
+
+If you try to set an option that does not exist, or that cannot be changed for
+some other reason (e.g. it is 'selected' by another option), then buildman
+shows an error:
+
+   buildman --board sandbox -a FRED
+   Building current source for 1 boards (1 thread, 32 jobs per thread)
+       0    0    0 /1       -1      (starting)errs
+   Some CONFIG adjustments did not take effect. This may be because
+   the request CONFIGs do not exist or conflict with others.
+
+   Failed adjustments:
+
+   FRED                  Missing expected line: CONFIG_FRED=y
+
+
+One major caveat with this feature with branches (-b) is that buildman does not
+name the output directories differently when you change the configuration, so
+doing the same build again with different configuration will not trigger a
+rebuild. You can use -f to work around that.
+
+
 Other options
 =============
 
diff --git a/tools/buildman/builder.py b/tools/buildman/builder.py
index 122f0d1..754642d 100644
--- a/tools/buildman/builder.py
+++ b/tools/buildman/builder.py
@@ -22,7 +22,7 @@
 from patman import command
 from patman import gitutil
 from patman import terminal
-from patman.terminal import Print
+from patman.terminal import tprint
 
 # This indicates an new int or hex Kconfig property with no default
 # It hangs the build since the 'conf' tool cannot proceed without valid input.
@@ -250,7 +250,7 @@
                  mrproper=False, per_board_out_dir=False,
                  config_only=False, squash_config_y=False,
                  warnings_as_errors=False, work_in_output=False,
-                 test_thread_exceptions=False):
+                 test_thread_exceptions=False, adjust_cfg=None):
         """Create a new Builder object
 
         Args:
@@ -280,6 +280,15 @@
             test_thread_exceptions: Uses for tests only, True to make the
                 threads raise an exception instead of reporting their result.
                 This simulates a failure in the code somewhere
+            adjust_cfg_list (list of str): List of changes to make to .config
+                file before building. Each is one of (where C is the config
+                option with or without the CONFIG_ prefix)
+
+                    C to enable C
+                    ~C to disable C
+                    C=val to set the value of C (val must have quotes if C is
+                        a string Kconfig
+
         """
         self.toolchains = toolchains
         self.base_dir = base_dir
@@ -315,6 +324,8 @@
         self.squash_config_y = squash_config_y
         self.config_filenames = BASE_CONFIG_FILENAMES
         self.work_in_output = work_in_output
+        self.adjust_cfg = adjust_cfg
+
         if not self.squash_config_y:
             self.config_filenames += EXTRA_CONFIG_FILENAMES
         self._terminated = False
@@ -431,7 +442,7 @@
         """
         self.commit = commit
         if checkout and self.checkout:
-            gitutil.Checkout(commit.hash)
+            gitutil.checkout(commit.hash)
 
     def Make(self, commit, brd, stage, cwd, *args, **kwargs):
         """Run make
@@ -442,7 +453,7 @@
             stage: Stage that we are at (mrproper, config, build)
             cwd: Directory where make should be run
             args: Arguments to pass to make
-            kwargs: Arguments to pass to command.RunPipe()
+            kwargs: Arguments to pass to command.run_pipe()
         """
 
         def check_output(stream, data):
@@ -465,7 +476,7 @@
         self._restarting_config = False
         self._terminated  = False
         cmd = [self.gnu_make] + list(args)
-        result = command.RunPipe([cmd], capture=True, capture_stderr=True,
+        result = command.run_pipe([cmd], capture=True, capture_stderr=True,
                 cwd=cwd, raise_on_error=False, infile='/dev/null',
                 output_func=check_output, **kwargs)
 
@@ -497,7 +508,7 @@
             if result.already_done:
                 self.already_done += 1
             if self._verbose:
-                terminal.PrintClear()
+                terminal.print_clear()
                 boards_selected = {target : result.brd}
                 self.ResetResultSummary(boards_selected)
                 self.ProduceResultSummary(result.commit_upto, self.commits,
@@ -507,14 +518,14 @@
 
         # Display separate counts for ok, warned and fail
         ok = self.upto - self.warned - self.fail
-        line = '\r' + self.col.Color(self.col.GREEN, '%5d' % ok)
-        line += self.col.Color(self.col.YELLOW, '%5d' % self.warned)
-        line += self.col.Color(self.col.RED, '%5d' % self.fail)
+        line = '\r' + self.col.build(self.col.GREEN, '%5d' % ok)
+        line += self.col.build(self.col.YELLOW, '%5d' % self.warned)
+        line += self.col.build(self.col.RED, '%5d' % self.fail)
 
         line += ' /%-5d  ' % self.count
         remaining = self.count - self.upto
         if remaining:
-            line += self.col.Color(self.col.MAGENTA, ' -%-5d  ' % remaining)
+            line += self.col.build(self.col.MAGENTA, ' -%-5d  ' % remaining)
         else:
             line += ' ' * 8
 
@@ -524,8 +535,8 @@
             line += '%s  : ' % self._complete_delay
 
         line += target
-        terminal.PrintClear()
-        Print(line, newline=False, limit_to_line=True)
+        terminal.print_clear()
+        tprint(line, newline=False, limit_to_line=True)
 
     def _GetOutputDir(self, commit_upto):
         """Get the name of the output directory for a commit number
@@ -655,7 +666,7 @@
                 if line.strip():
                     size, type, name = line[:-1].split()
             except:
-                Print("Invalid line in file '%s': '%s'" % (fname, line[:-1]))
+                tprint("Invalid line in file '%s': '%s'" % (fname, line[:-1]))
                 continue
             if type in 'tTdDbB':
                 # function names begin with '.' on 64-bit powerpc
@@ -922,9 +933,9 @@
                 arch = board_dict[target].arch
             else:
                 arch = 'unknown'
-            str = self.col.Color(color, ' ' + target)
+            str = self.col.build(color, ' ' + target)
             if not arch in done_arch:
-                str = ' %s  %s' % (self.col.Color(color, char), str)
+                str = ' %s  %s' % (self.col.build(color, char), str)
                 done_arch[arch] = True
             if not arch in arch_list:
                 arch_list[arch] = str
@@ -936,7 +947,7 @@
         color = self.col.RED if num > 0 else self.col.GREEN
         if num == 0:
             return '0'
-        return self.col.Color(color, str(num))
+        return self.col.build(color, str(num))
 
     def ResetResultSummary(self, board_selected):
         """Reset the results summary ready for use.
@@ -998,16 +1009,16 @@
             return
         args = [self.ColourNum(x) for x in args]
         indent = ' ' * 15
-        Print('%s%s: add: %s/%s, grow: %s/%s bytes: %s/%s (%s)' %
-              tuple([indent, self.col.Color(self.col.YELLOW, fname)] + args))
-        Print('%s  %-38s %7s %7s %+7s' % (indent, 'function', 'old', 'new',
+        tprint('%s%s: add: %s/%s, grow: %s/%s bytes: %s/%s (%s)' %
+              tuple([indent, self.col.build(self.col.YELLOW, fname)] + args))
+        tprint('%s  %-38s %7s %7s %+7s' % (indent, 'function', 'old', 'new',
                                          'delta'))
         for diff, name in delta:
             if diff:
                 color = self.col.RED if diff > 0 else self.col.GREEN
                 msg = '%s  %-38s %7s %7s %+7d' % (indent, name,
                         old.get(name, '-'), new.get(name,'-'), diff)
-                Print(msg, colour=color)
+                tprint(msg, colour=color)
 
 
     def PrintSizeDetail(self, target_list, show_bloat):
@@ -1032,12 +1043,12 @@
                     color = self.col.RED if diff > 0 else self.col.GREEN
                 msg = ' %s %+d' % (name, diff)
                 if not printed_target:
-                    Print('%10s  %-15s:' % ('', result['_target']),
+                    tprint('%10s  %-15s:' % ('', result['_target']),
                           newline=False)
                     printed_target = True
-                Print(msg, colour=color, newline=False)
+                tprint(msg, colour=color, newline=False)
             if printed_target:
-                Print()
+                tprint()
                 if show_bloat:
                     target = result['_target']
                     outcome = result['_outcome']
@@ -1142,13 +1153,13 @@
                     color = self.col.RED if avg_diff > 0 else self.col.GREEN
                     msg = ' %s %+1.1f' % (name, avg_diff)
                     if not printed_arch:
-                        Print('%10s: (for %d/%d boards)' % (arch, count,
+                        tprint('%10s: (for %d/%d boards)' % (arch, count,
                               arch_count[arch]), newline=False)
                         printed_arch = True
-                    Print(msg, colour=color, newline=False)
+                    tprint(msg, colour=color, newline=False)
 
             if printed_arch:
-                Print()
+                tprint()
                 if show_detail:
                     self.PrintSizeDetail(target_list, show_bloat)
 
@@ -1293,7 +1304,7 @@
                     col = self.col.RED
                 elif line[0] == 'c':
                     col = self.col.YELLOW
-                Print('   ' + line, newline=True, colour=col)
+                tprint('   ' + line, newline=True, colour=col)
 
         def _OutputErrLines(err_lines, colour):
             """Output the line of error/warning lines, if not empty
@@ -1313,14 +1324,14 @@
                     names = [board.target for board in line.boards]
                     board_str = ' '.join(names) if names else ''
                     if board_str:
-                        out = self.col.Color(colour, line.char + '(')
-                        out += self.col.Color(self.col.MAGENTA, board_str,
+                        out = self.col.build(colour, line.char + '(')
+                        out += self.col.build(self.col.MAGENTA, board_str,
                                               bright=False)
-                        out += self.col.Color(colour, ') %s' % line.errline)
+                        out += self.col.build(colour, ') %s' % line.errline)
                     else:
-                        out = self.col.Color(colour, line.char + line.errline)
+                        out = self.col.build(colour, line.char + line.errline)
                     out_list.append(out)
-                Print('\n'.join(out_list))
+                tprint('\n'.join(out_list))
                 self._error_lines += 1
 
 
@@ -1374,7 +1385,7 @@
                 self.AddOutcome(board_selected, arch_list, unknown_boards, '?',
                         self.col.MAGENTA)
             for arch, target_list in arch_list.items():
-                Print('%10s: %s' % (arch, target_list))
+                tprint('%10s: %s' % (arch, target_list))
                 self._error_lines += 1
             _OutputErrLines(better_err, colour=self.col.GREEN)
             _OutputErrLines(worse_err, colour=self.col.RED)
@@ -1504,13 +1515,13 @@
                 _AddConfig(lines, 'all', all_plus, all_minus, all_change)
                 #arch_summary[target] = '\n'.join(lines)
                 if lines:
-                    Print('%s:' % arch)
+                    tprint('%s:' % arch)
                     _OutputConfigInfo(lines)
 
             for lines, targets in lines_by_target.items():
                 if not lines:
                     continue
-                Print('%s :' % ' '.join(sorted(targets)))
+                tprint('%s :' % ' '.join(sorted(targets)))
                 _OutputConfigInfo(lines.split('\n'))
 
 
@@ -1529,7 +1540,7 @@
             if not board in board_dict:
                 not_built.append(board)
         if not_built:
-            Print("Boards not built (%d): %s" % (len(not_built),
+            tprint("Boards not built (%d): %s" % (len(not_built),
                   ', '.join(not_built)))
 
     def ProduceResultSummary(self, commit_upto, commits, board_selected):
@@ -1542,7 +1553,7 @@
             if commits:
                 msg = '%02d: %s' % (commit_upto + 1,
                         commits[commit_upto].subject)
-                Print(msg, colour=self.col.BLUE)
+                tprint(msg, colour=self.col.BLUE)
             self.PrintResultSummary(board_selected, board_dict,
                     err_lines if self._show_errors else [], err_line_boards,
                     warn_lines if self._show_errors else [], warn_line_boards,
@@ -1567,7 +1578,7 @@
         for commit_upto in range(0, self.commit_count, self._step):
             self.ProduceResultSummary(commit_upto, commits, board_selected)
         if not self._error_lines:
-            Print('(no errors to report)', colour=self.col.GREEN)
+            tprint('(no errors to report)', colour=self.col.GREEN)
 
 
     def SetupBuild(self, board_selected, commits):
@@ -1618,10 +1629,10 @@
             if os.path.isdir(git_dir):
                 # This is a clone of the src_dir repo, we can keep using
                 # it but need to fetch from src_dir.
-                Print('\rFetching repo for thread %d' % thread_num,
+                tprint('\rFetching repo for thread %d' % thread_num,
                       newline=False)
-                gitutil.Fetch(git_dir, thread_dir)
-                terminal.PrintClear()
+                gitutil.fetch(git_dir, thread_dir)
+                terminal.print_clear()
             elif os.path.isfile(git_dir):
                 # This is a worktree of the src_dir repo, we don't need to
                 # create it again or update it in any way.
@@ -1632,15 +1643,15 @@
                 raise ValueError('Git dir %s exists, but is not a file '
                                  'or a directory.' % git_dir)
             elif setup_git == 'worktree':
-                Print('\rChecking out worktree for thread %d' % thread_num,
+                tprint('\rChecking out worktree for thread %d' % thread_num,
                       newline=False)
-                gitutil.AddWorktree(src_dir, thread_dir)
-                terminal.PrintClear()
+                gitutil.add_worktree(src_dir, thread_dir)
+                terminal.print_clear()
             elif setup_git == 'clone' or setup_git == True:
-                Print('\rCloning repo for thread %d' % thread_num,
+                tprint('\rCloning repo for thread %d' % thread_num,
                       newline=False)
-                gitutil.Clone(src_dir, thread_dir)
-                terminal.PrintClear()
+                gitutil.clone(src_dir, thread_dir)
+                terminal.print_clear()
             else:
                 raise ValueError("Can't setup git repo with %s." % setup_git)
 
@@ -1659,12 +1670,12 @@
         builderthread.Mkdir(self._working_dir)
         if setup_git and self.git_dir:
             src_dir = os.path.abspath(self.git_dir)
-            if gitutil.CheckWorktreeIsAvailable(src_dir):
+            if gitutil.check_worktree_is_available(src_dir):
                 setup_git = 'worktree'
                 # If we previously added a worktree but the directory for it
                 # got deleted, we need to prune its files from the repo so
                 # that we can check out another in its place.
-                gitutil.PruneWorktrees(src_dir)
+                gitutil.prune_worktrees(src_dir)
             else:
                 setup_git = 'clone'
 
@@ -1706,11 +1717,11 @@
         """
         to_remove = self._GetOutputSpaceRemovals()
         if to_remove:
-            Print('Removing %d old build directories...' % len(to_remove),
+            tprint('Removing %d old build directories...' % len(to_remove),
                   newline=False)
             for dirname in to_remove:
                 shutil.rmtree(dirname)
-            terminal.PrintClear()
+            terminal.print_clear()
 
     def BuildBoards(self, commits, board_selected, keep_outputs, verbose):
         """Build all commits for a list of boards
@@ -1736,7 +1747,7 @@
         self._PrepareWorkingSpace(min(self.num_threads, len(board_selected)),
                 commits is not None)
         self._PrepareOutputSpace()
-        Print('\rStarting build...', newline=False)
+        tprint('\rStarting build...', newline=False)
         self.SetupBuild(board_selected, commits)
         self.ProcessResult(None)
         self.thread_exceptions = []
@@ -1747,6 +1758,7 @@
             job.commits = commits
             job.keep_outputs = keep_outputs
             job.work_in_output = self.work_in_output
+            job.adjust_cfg = self.adjust_cfg
             job.step = self._step
             if self.num_threads:
                 self.queue.put(job)
@@ -1762,7 +1774,7 @@
 
             # Wait until we have processed all output
             self.out_queue.join()
-        Print()
+        tprint()
 
         msg = 'Completed: %d total built' % self.count
         if self.already_done:
@@ -1777,9 +1789,9 @@
             duration = duration - timedelta(microseconds=duration.microseconds)
             rate = float(self.count) / duration.total_seconds()
             msg += ', duration %s, rate %1.2f' % (duration, rate)
-        Print(msg)
+        tprint(msg)
         if self.thread_exceptions:
-            Print('Failed: %d thread exceptions' % len(self.thread_exceptions),
+            tprint('Failed: %d thread exceptions' % len(self.thread_exceptions),
                   colour=self.col.RED)
 
         return (self.fail, self.warned, self.thread_exceptions)
diff --git a/tools/buildman/builderthread.py b/tools/buildman/builderthread.py
index 3e450e4..7522ff6 100644
--- a/tools/buildman/builderthread.py
+++ b/tools/buildman/builderthread.py
@@ -9,6 +9,7 @@
 import sys
 import threading
 
+from buildman import cfgutil
 from patman import command
 from patman import gitutil
 
@@ -121,7 +122,7 @@
                         config - called to configure for a board
                         build - the main make invocation - it does the build
             args: A list of arguments to pass to 'make'
-            kwargs: A list of keyword arguments to pass to command.RunPipe()
+            kwargs: A list of keyword arguments to pass to command.run_pipe()
 
         Returns:
             CommandResult object
@@ -130,7 +131,8 @@
                 **kwargs)
 
     def RunCommit(self, commit_upto, brd, work_dir, do_config, config_only,
-                  force_build, force_build_failures, work_in_output):
+                  force_build, force_build_failures, work_in_output,
+                  adjust_cfg):
         """Build a particular commit.
 
         If the build is already done, and we are not forcing a build, we skip
@@ -147,6 +149,13 @@
                 failure
             work_in_output: Use the output directory as the work directory and
                 don't write to a separate output directory.
+            adjust_cfg (list of str): List of changes to make to .config file
+                before building. Each is one of (where C is either CONFIG_xxx
+                or just xxx):
+                     C to enable C
+                     ~C to disable C
+                     C=val to set the value of C (val must have quotes if C is
+                         a string Kconfig
 
         Returns:
             tuple containing:
@@ -210,7 +219,7 @@
                     commit = self.builder.commits[commit_upto]
                     if self.builder.checkout:
                         git_dir = os.path.join(work_dir, '.git')
-                        gitutil.Checkout(commit.hash, git_dir, work_dir,
+                        gitutil.checkout(commit.hash, git_dir, work_dir,
                                          force=True)
                 else:
                     commit = 'current'
@@ -261,7 +270,8 @@
                         os.remove(fname)
 
                 # If we need to reconfigure, do that now
-                if do_config:
+                cfg_file = os.path.join(out_dir, '.config')
+                if do_config or adjust_cfg:
                     config_out = ''
                     if self.mrproper:
                         result = self.Make(commit, brd, 'mrproper', cwd,
@@ -271,11 +281,19 @@
                             *(args + config_args), env=env)
                     config_out += result.combined
                     do_config = False   # No need to configure next time
+                    if adjust_cfg:
+                        cfgutil.adjust_cfg_file(cfg_file, adjust_cfg)
                 if result.return_code == 0:
                     if config_only:
                         args.append('cfg')
                     result = self.Make(commit, brd, 'build', cwd, *args,
                             env=env)
+                    if adjust_cfg:
+                        errs = cfgutil.check_cfg_file(cfg_file, adjust_cfg)
+                        if errs:
+                            print('errs', errs)
+                            result.stderr += errs
+                            result.return_code = 1
                 result.stderr = result.stderr.replace(src_dir + '/', '')
                 if self.builder.verbose_build:
                     result.stdout = config_out + result.stdout
@@ -357,7 +375,7 @@
             lines = []
             for fname in BASE_ELF_FILENAMES:
                 cmd = ['%snm' % self.toolchain.cross, '--size-sort', fname]
-                nm_result = command.RunPipe([cmd], capture=True,
+                nm_result = command.run_pipe([cmd], capture=True,
                         capture_stderr=True, cwd=result.out_dir,
                         raise_on_error=False, env=env)
                 if nm_result.stdout:
@@ -367,7 +385,7 @@
                         print(nm_result.stdout, end=' ', file=fd)
 
                 cmd = ['%sobjdump' % self.toolchain.cross, '-h', fname]
-                dump_result = command.RunPipe([cmd], capture=True,
+                dump_result = command.run_pipe([cmd], capture=True,
                         capture_stderr=True, cwd=result.out_dir,
                         raise_on_error=False, env=env)
                 rodata_size = ''
@@ -382,7 +400,7 @@
                             rodata_size = fields[2]
 
                 cmd = ['%ssize' % self.toolchain.cross, fname]
-                size_result = command.RunPipe([cmd], capture=True,
+                size_result = command.run_pipe([cmd], capture=True,
                         capture_stderr=True, cwd=result.out_dir,
                         raise_on_error=False, env=env)
                 if size_result.stdout:
@@ -393,7 +411,7 @@
             cmd = ['%sobjcopy' % self.toolchain.cross, '-O', 'binary',
                    '-j', '.rodata.default_environment',
                    'env/built-in.o', 'uboot.env']
-            command.RunPipe([cmd], capture=True,
+            command.run_pipe([cmd], capture=True,
                             capture_stderr=True, cwd=result.out_dir,
                             raise_on_error=False, env=env)
             ubootenv = os.path.join(result.out_dir, 'uboot.env')
@@ -486,7 +504,7 @@
                         work_dir, do_config, self.builder.config_only,
                         force_build or self.builder.force_build,
                         self.builder.force_build_failures,
-                        work_in_output=job.work_in_output)
+                        job.work_in_output, job.adjust_cfg)
                 failed = result.return_code or result.stderr
                 did_config = do_config
                 if failed and not do_config:
@@ -495,7 +513,7 @@
                     if self.builder.force_config_on_failure:
                         result, request_config = self.RunCommit(commit_upto,
                             brd, work_dir, True, False, True, False,
-                            work_in_output=job.work_in_output)
+                            job.work_in_output, job.adjust_cfg)
                         did_config = True
                 if not self.builder.force_reconfig:
                     do_config = request_config
@@ -540,8 +558,8 @@
             # Just build the currently checked-out build
             result, request_config = self.RunCommit(None, brd, work_dir, True,
                         self.builder.config_only, True,
-                        self.builder.force_build_failures,
-                        work_in_output=job.work_in_output)
+                        self.builder.force_build_failures, job.work_in_output,
+                        job.adjust_cfg)
             result.commit_upto = 0
             self._WriteResult(result, job.keep_outputs, job.work_in_output)
             self._SendResult(result)
@@ -557,6 +575,6 @@
             try:
                 self.RunJob(job)
             except Exception as e:
-                print('Thread exception:', e)
+                print('Thread exception (use -T0 to run without threads):', e)
                 self.builder.thread_exceptions.append(e)
             self.builder.queue.task_done()
diff --git a/tools/buildman/cfgutil.py b/tools/buildman/cfgutil.py
new file mode 100644
index 0000000..4eba508
--- /dev/null
+++ b/tools/buildman/cfgutil.py
@@ -0,0 +1,235 @@
+# SPDX-License-Identifier: GPL-2.0+
+# Copyright 2022 Google LLC
+# Written by Simon Glass <sjg@chromium.org>
+#
+
+"""Utility functions for dealing with Kconfig .confing files"""
+
+import re
+
+from patman import tools
+
+RE_LINE = re.compile(r'(# )?CONFIG_([A-Z0-9_]+)(=(.*)| is not set)')
+RE_CFG = re.compile(r'(~?)(CONFIG_)?([A-Z0-9_]+)(=.*)?')
+
+def make_cfg_line(opt, adj):
+    """Make a new config line for an option
+
+    Args:
+        opt (str): Option to process, without CONFIG_ prefix
+        adj (str): Adjustment to make (C is config option without prefix):
+             C to enable C
+             ~C to disable C
+             C=val to set the value of C (val must have quotes if C is
+                 a string Kconfig)
+
+    Returns:
+        str: New line to use, one of:
+            CONFIG_opt=y               - option is enabled
+            # CONFIG_opt is not set    - option is disabled
+            CONFIG_opt=val             - option is getting a new value (val is
+                in quotes if this is a string)
+    """
+    if adj[0] == '~':
+        return f'# CONFIG_{opt} is not set'
+    if '=' in adj:
+        return f'CONFIG_{adj}'
+    return f'CONFIG_{opt}=y'
+
+def adjust_cfg_line(line, adjust_cfg, done=None):
+    """Make an adjustment to a single of line from a .config file
+
+    This processes a .config line, producing a new line if a change for this
+    CONFIG is requested in adjust_cfg
+
+    Args:
+        line (str): line to process, e.g. '# CONFIG_FRED is not set' or
+            'CONFIG_FRED=y' or 'CONFIG_FRED=0x123' or 'CONFIG_FRED="fred"'
+        adjust_cfg (dict of str): Changes to make to .config file before
+                building:
+             key: str config to change, without the CONFIG_ prefix, e.g.
+                 FRED
+             value: str change to make (C is config option without prefix):
+                 C to enable C
+                 ~C to disable C
+                 C=val to set the value of C (val must have quotes if C is
+                     a string Kconfig)
+        done (set of set): Adds the config option to this set if it is changed
+            in some way. This is used to track which ones have been processed.
+            None to skip.
+
+    Returns:
+        tuple:
+            str: New string for this line (maybe unchanged)
+            str: Adjustment string that was used
+    """
+    out_line = line
+    m_line = RE_LINE.match(line)
+    adj = None
+    if m_line:
+        _, opt, _, _ = m_line.groups()
+        adj = adjust_cfg.get(opt)
+        if adj:
+            out_line = make_cfg_line(opt, adj)
+            if done is not None:
+                done.add(opt)
+
+    return out_line, adj
+
+def adjust_cfg_lines(lines, adjust_cfg):
+    """Make adjustments to a list of lines from a .config file
+
+    Args:
+        lines (list of str): List of lines to process
+        adjust_cfg (dict of str): Changes to make to .config file before
+                building:
+             key: str config to change, without the CONFIG_ prefix, e.g.
+                 FRED
+             value: str change to make (C is config option without prefix):
+                 C to enable C
+                 ~C to disable C
+                 C=val to set the value of C (val must have quotes if C is
+                     a string Kconfig)
+
+    Returns:
+        list of str: New list of lines resulting from the processing
+    """
+    out_lines = []
+    done = set()
+    for line in lines:
+        out_line, _ = adjust_cfg_line(line, adjust_cfg, done)
+        out_lines.append(out_line)
+
+    for opt in adjust_cfg:
+        if opt not in done:
+            adj = adjust_cfg.get(opt)
+            out_line = make_cfg_line(opt, adj)
+            out_lines.append(out_line)
+
+    return out_lines
+
+def adjust_cfg_file(fname, adjust_cfg):
+    """Make adjustments to a .config file
+
+    Args:
+        fname (str): Filename of .config file to change
+        adjust_cfg (dict of str): Changes to make to .config file before
+                building:
+             key: str config to change, without the CONFIG_ prefix, e.g.
+                 FRED
+             value: str change to make (C is config option without prefix):
+                 C to enable C
+                 ~C to disable C
+                 C=val to set the value of C (val must have quotes if C is
+                     a string Kconfig)
+    """
+    lines = tools.ReadFile(fname, binary=False).splitlines()
+    out_lines = adjust_cfg_lines(lines, adjust_cfg)
+    out = '\n'.join(out_lines) + '\n'
+    tools.WriteFile(fname, out, binary=False)
+
+def convert_list_to_dict(adjust_cfg_list):
+    """Convert a list of config changes into the dict used by adjust_cfg_file()
+
+    Args:
+        adjust_cfg_list (list of str): List of changes to make to .config file
+            before building. Each is one of (where C is the config option with
+            or without the CONFIG_ prefix)
+
+                C to enable C
+                ~C to disable C
+                C=val to set the value of C (val must have quotes if C is
+                    a string Kconfig
+
+    Returns:
+        dict of str: Changes to make to .config file before building:
+             key: str config to change, without the CONFIG_ prefix, e.g. FRED
+             value: str change to make (C is config option without prefix):
+                 C to enable C
+                 ~C to disable C
+                 C=val to set the value of C (val must have quotes if C is
+                     a string Kconfig)
+
+    Raises:
+        ValueError: if an item in adjust_cfg_list has invalid syntax
+    """
+    result = {}
+    for cfg in adjust_cfg_list or []:
+        m_cfg = RE_CFG.match(cfg)
+        if not m_cfg:
+            raise ValueError(f"Invalid CONFIG adjustment '{cfg}'")
+        negate, _, opt, val = m_cfg.groups()
+        result[opt] = f'%s{opt}%s' % (negate or '', val or '')
+
+    return result
+
+def check_cfg_lines(lines, adjust_cfg):
+    """Check that lines do not conflict with the requested changes
+
+    If a line enables a CONFIG which was requested to be disabled, etc., then
+    this is an error. This function finds such errors.
+
+    Args:
+        lines (list of str): List of lines to process
+        adjust_cfg (dict of str): Changes to make to .config file before
+                building:
+             key: str config to change, without the CONFIG_ prefix, e.g.
+                 FRED
+             value: str change to make (C is config option without prefix):
+                 C to enable C
+                 ~C to disable C
+                 C=val to set the value of C (val must have quotes if C is
+                     a string Kconfig)
+
+    Returns:
+        list of tuple: list of errors, each a tuple:
+            str: cfg adjustment requested
+            str: line of the config that conflicts
+    """
+    bad = []
+    done = set()
+    for line in lines:
+        out_line, adj = adjust_cfg_line(line, adjust_cfg, done)
+        if out_line != line:
+            bad.append([adj, line])
+
+    for opt in adjust_cfg:
+        if opt not in done:
+            adj = adjust_cfg.get(opt)
+            out_line = make_cfg_line(opt, adj)
+            bad.append([adj, f'Missing expected line: {out_line}'])
+
+    return bad
+
+def check_cfg_file(fname, adjust_cfg):
+    """Check that a config file has been adjusted according to adjust_cfg
+
+    Args:
+        fname (str): Filename of .config file to change
+        adjust_cfg (dict of str): Changes to make to .config file before
+                building:
+             key: str config to change, without the CONFIG_ prefix, e.g.
+                 FRED
+             value: str change to make (C is config option without prefix):
+                 C to enable C
+                 ~C to disable C
+                 C=val to set the value of C (val must have quotes if C is
+                     a string Kconfig)
+
+    Returns:
+        str: None if OK, else an error string listing the problems
+    """
+    lines = tools.ReadFile(fname, binary=False).splitlines()
+    bad_cfgs = check_cfg_lines(lines, adjust_cfg)
+    if bad_cfgs:
+        out = [f'{cfg:20}  {line}' for cfg, line in bad_cfgs]
+        content = '\\n'.join(out)
+        return f'''
+Some CONFIG adjustments did not take effect. This may be because
+the request CONFIGs do not exist or conflict with others.
+
+Failed adjustments:
+
+{content}
+'''
+    return None
diff --git a/tools/buildman/cmdline.py b/tools/buildman/cmdline.py
index 274b5ac..8586bdf 100644
--- a/tools/buildman/cmdline.py
+++ b/tools/buildman/cmdline.py
@@ -13,6 +13,8 @@
             args: command lin arguments
     """
     parser = OptionParser()
+    parser.add_option('-a', '--adjust-cfg', type=str, action='append',
+          help='Adjust the Kconfig settings in .config before building')
     parser.add_option('-A', '--print-prefix', action='store_true',
           help='Print the tool-chain prefix for a board (CROSS_COMPILE=)')
     parser.add_option('-b', '--branch', type='string',
@@ -32,6 +34,8 @@
           help='Show detailed size delta for each board in the -S summary')
     parser.add_option('-D', '--config-only', action='store_true', default=False,
           help="Don't build, just configure each commit")
+    parser.add_option('--debug', action='store_true',
+        help='Enabling debugging (provides a full traceback on error)')
     parser.add_option('-e', '--show_errors', action='store_true',
           default=False, help='Show errors and warnings')
     parser.add_option('-E', '--warnings-as-errors', action='store_true',
diff --git a/tools/buildman/control.py b/tools/buildman/control.py
index fd9664c..8f4810b 100644
--- a/tools/buildman/control.py
+++ b/tools/buildman/control.py
@@ -10,6 +10,7 @@
 
 from buildman import board
 from buildman import bsettings
+from buildman import cfgutil
 from buildman import toolchain
 from buildman.builder import Builder
 from patman import command
@@ -17,7 +18,7 @@
 from patman import patchstream
 from patman import terminal
 from patman import tools
-from patman.terminal import Print
+from patman.terminal import tprint
 
 def GetPlural(count):
     """Returns a plural 's' if count is not 1"""
@@ -72,7 +73,7 @@
     if commits:
         for upto in range(0, len(series.commits), options.step):
             commit = series.commits[upto]
-            print('   ', col.Color(col.YELLOW, commit.hash[:8], bright=False), end=' ')
+            print('   ', col.build(col.YELLOW, commit.hash[:8], bright=False), end=' ')
             print(commit.subject)
     print()
     for arg in why_selected:
@@ -84,7 +85,7 @@
             len(why_selected['all'])))
     if board_warnings:
         for warning in board_warnings:
-            print(col.Color(col.YELLOW, warning))
+            print(col.build(col.YELLOW, warning))
 
 def ShowToolchainPrefix(boards, toolchains):
     """Show information about a the tool chain used by one or more boards
@@ -134,12 +135,12 @@
     global builder
 
     if options.full_help:
-        tools.PrintFullHelp(
+        tools.print_full_help(
             os.path.join(os.path.dirname(os.path.realpath(sys.argv[0])), 'README')
         )
         return 0
 
-    gitutil.Setup()
+    gitutil.setup()
     col = terminal.Color()
 
     options.git_dir = os.path.join(options.git, '.git')
@@ -151,14 +152,14 @@
     if options.fetch_arch:
         if options.fetch_arch == 'list':
             sorted_list = toolchains.ListArchs()
-            print(col.Color(col.BLUE, 'Available architectures: %s\n' %
+            print(col.build(col.BLUE, 'Available architectures: %s\n' %
                             ' '.join(sorted_list)))
             return 0
         else:
             fetch_arch = options.fetch_arch
             if fetch_arch == 'all':
                 fetch_arch = ','.join(toolchains.ListArchs())
-                print(col.Color(col.CYAN, '\nDownloading toolchains: %s' %
+                print(col.build(col.CYAN, '\nDownloading toolchains: %s' %
                                 fetch_arch))
             for arch in fetch_arch.split(','):
                 print()
@@ -176,11 +177,11 @@
         return 0
 
     if options.incremental:
-        print(col.Color(col.RED,
+        print(col.build(col.RED,
                         'Warning: -I has been removed. See documentation'))
     if not options.output_dir:
         if options.work_in_output:
-            sys.exit(col.Color(col.RED, '-w requires that you specify -o'))
+            sys.exit(col.build(col.RED, '-w requires that you specify -o'))
         options.output_dir = '..'
 
     # Work out what subset of the boards we are building
@@ -217,12 +218,12 @@
                                                        requested_boards)
     selected = boards.GetSelected()
     if not len(selected):
-        sys.exit(col.Color(col.RED, 'No matching boards found'))
+        sys.exit(col.build(col.RED, 'No matching boards found'))
 
     if options.print_prefix:
         err = ShowToolchainPrefix(boards, toolchains)
         if err:
-            sys.exit(col.Color(col.RED, err))
+            sys.exit(col.build(col.RED, err))
         return 0
 
     # Work out how many commits to build. We want to build everything on the
@@ -235,30 +236,30 @@
             count = 1
         else:
             if has_range:
-                count, msg = gitutil.CountCommitsInRange(options.git_dir,
+                count, msg = gitutil.count_commits_in_range(options.git_dir,
                                                          options.branch)
             else:
-                count, msg = gitutil.CountCommitsInBranch(options.git_dir,
+                count, msg = gitutil.count_commits_in_branch(options.git_dir,
                                                           options.branch)
             if count is None:
-                sys.exit(col.Color(col.RED, msg))
+                sys.exit(col.build(col.RED, msg))
             elif count == 0:
-                sys.exit(col.Color(col.RED, "Range '%s' has no commits" %
+                sys.exit(col.build(col.RED, "Range '%s' has no commits" %
                                    options.branch))
             if msg:
-                print(col.Color(col.YELLOW, msg))
+                print(col.build(col.YELLOW, msg))
             count += 1   # Build upstream commit also
 
     if not count:
         str = ("No commits found to process in branch '%s': "
                "set branch's upstream or use -c flag" % options.branch)
-        sys.exit(col.Color(col.RED, str))
+        sys.exit(col.build(col.RED, str))
     if options.work_in_output:
         if len(selected) != 1:
-            sys.exit(col.Color(col.RED,
+            sys.exit(col.build(col.RED,
                                '-w can only be used with a single board'))
         if count != 1:
-            sys.exit(col.Color(col.RED,
+            sys.exit(col.build(col.RED,
                                '-w can only be used with a single commit'))
 
     # Read the metadata from the commits. First look at the upstream commit,
@@ -275,9 +276,9 @@
             if has_range:
                 range_expr = options.branch
             else:
-                range_expr = gitutil.GetRangeInBranch(options.git_dir,
+                range_expr = gitutil.get_range_in_branch(options.git_dir,
                                                       options.branch)
-            upstream_commit = gitutil.GetUpstream(options.git_dir,
+            upstream_commit = gitutil.get_upstream(options.git_dir,
                                                   options.branch)
             series = patchstream.get_metadata_for_list(upstream_commit,
                 options.git_dir, 1, series=None, allow_overwrite=True)
@@ -306,7 +307,7 @@
     if not options.step:
         options.step = len(series.commits) - 1
 
-    gnu_make = command.Output(os.path.join(options.git,
+    gnu_make = command.output(os.path.join(options.git,
             'scripts/show-gnu-make'), raise_on_error=False).rstrip()
     if not gnu_make:
         sys.exit('GNU Make not found')
@@ -321,6 +322,8 @@
             output_dir = os.path.join(options.output_dir, dirname)
         if clean_dir and os.path.exists(output_dir):
             shutil.rmtree(output_dir)
+    adjust_cfg = cfgutil.convert_list_to_dict(options.adjust_cfg)
+
     builder = Builder(toolchains, output_dir, options.git_dir,
             options.threads, options.jobs, gnu_make=gnu_make, checkout=True,
             show_unknown=options.show_unknown, step=options.step,
@@ -332,7 +335,8 @@
             squash_config_y=not options.preserve_config_y,
             warnings_as_errors=options.warnings_as_errors,
             work_in_output=options.work_in_output,
-            test_thread_exceptions=test_thread_exceptions)
+            test_thread_exceptions=test_thread_exceptions,
+            adjust_cfg=adjust_cfg)
     builder.force_config_on_failure = not options.quick
     if make_func:
         builder.do_make = make_func
@@ -358,7 +362,7 @@
         else:
             commits = None
 
-        Print(GetActionSummary(options.summary, commits, board_selected,
+        tprint(GetActionSummary(options.summary, commits, board_selected,
                                options))
 
         # We can't show function sizes without board details at present
diff --git a/tools/buildman/func_test.py b/tools/buildman/func_test.py
index 7edbee0..6fcceb0 100644
--- a/tools/buildman/func_test.py
+++ b/tools/buildman/func_test.py
@@ -182,11 +182,11 @@
         self._buildman_pathname = sys.argv[0]
         self._buildman_dir = os.path.dirname(os.path.realpath(sys.argv[0]))
         command.test_result = self._HandleCommand
+        bsettings.Setup(None)
+        bsettings.AddFile(settings_data)
         self.setupToolchains()
         self._toolchains.Add('arm-gcc', test=False)
         self._toolchains.Add('powerpc-gcc', test=False)
-        bsettings.Setup(None)
-        bsettings.AddFile(settings_data)
         self._boards = board.Boards()
         for brd in boards:
             self._boards.AddBoard(board.Board(*brd))
@@ -205,8 +205,8 @@
         self._test_branch = TEST_BRANCH
 
         # Avoid sending any output and clear all terminal output
-        terminal.SetPrintTestMode()
-        terminal.GetPrintTestLines()
+        terminal.set_print_test_mode()
+        terminal.get_print_test_lines()
 
     def tearDown(self):
         shutil.rmtree(self._base_dir)
@@ -217,7 +217,7 @@
         self._toolchains.Add('gcc', test=False)
 
     def _RunBuildman(self, *args):
-        return command.RunPipe([[self._buildman_pathname] + list(args)],
+        return command.run_pipe([[self._buildman_pathname] + list(args)],
                 capture=True, capture_stderr=True)
 
     def _RunControl(self, *args, boards=None, clean_dir=False,
@@ -267,11 +267,11 @@
     def testGitSetup(self):
         """Test gitutils.Setup(), from outside the module itself"""
         command.test_result = command.CommandResult(return_code=1)
-        gitutil.Setup()
+        gitutil.setup()
         self.assertEqual(gitutil.use_no_decorate, False)
 
         command.test_result = command.CommandResult(return_code=0)
-        gitutil.Setup()
+        gitutil.setup()
         self.assertEqual(gitutil.use_no_decorate, True)
 
     def _HandleCommandGitLog(self, args):
@@ -407,7 +407,7 @@
             stage: Stage that we are at (mrproper, config, build)
             cwd: Directory where make should be run
             args: Arguments to pass to make
-            kwargs: Arguments to pass to command.RunPipe()
+            kwargs: Arguments to pass to command.run_pipe()
         """
         self._make_calls += 1
         if stage == 'mrproper':
@@ -422,7 +422,7 @@
                 if arg.startswith('O='):
                     out_dir = arg[2:]
             fname = os.path.join(cwd or '', out_dir, 'u-boot')
-            tools.WriteFile(fname, b'U-Boot')
+            tools.write_file(fname, b'U-Boot')
             if type(commit) is not str:
                 stderr = self._error.get((brd.target, commit.sequence))
             if stderr:
@@ -438,7 +438,7 @@
         print(len(lines))
         for line in lines:
             print(line)
-        #self.print_lines(terminal.GetPrintTestLines())
+        #self.print_lines(terminal.get_print_test_lines())
 
     def testNoBoards(self):
         """Test that buildman aborts when there are no boards"""
@@ -450,7 +450,7 @@
         """Very simple test to invoke buildman on the current source"""
         self.setupToolchains();
         self._RunControl('-o', self._output_dir)
-        lines = terminal.GetPrintTestLines()
+        lines = terminal.get_print_test_lines()
         self.assertIn('Building current source for %d boards' % len(boards),
                       lines[0].text)
 
@@ -463,7 +463,7 @@
         """Test that missing toolchains are detected"""
         self.setupToolchains();
         ret_code = self._RunControl('-b', TEST_BRANCH, '-o', self._output_dir)
-        lines = terminal.GetPrintTestLines()
+        lines = terminal.get_print_test_lines()
 
         # Buildman always builds the upstream commit as well
         self.assertIn('Building %d commits for %d boards' %
@@ -623,4 +623,6 @@
         with test_util.capture_sys_output() as (stdout, stderr):
             self.assertEqual(102, self._RunControl('-o', self._output_dir,
                                                    test_thread_exceptions=True))
-        self.assertIn('Thread exception: test exception', stdout.getvalue())
+        self.assertIn(
+            'Thread exception (use -T0 to run without threads): test exception',
+            stdout.getvalue())
diff --git a/tools/buildman/main.py b/tools/buildman/main.py
index 2b71473..0127106 100755
--- a/tools/buildman/main.py
+++ b/tools/buildman/main.py
@@ -27,36 +27,35 @@
 from patman import patchstream
 from patman import gitutil
 from patman import terminal
+from patman import test_util
 
-def RunTests(skip_net_tests):
+def RunTests(skip_net_tests, verboose, args):
     import func_test
     import test
     import doctest
 
     result = unittest.TestResult()
-    for module in ['buildman.toolchain', 'patman.gitutil']:
-        suite = doctest.DocTestSuite(module)
-        suite.run(result)
-
-    sys.argv = [sys.argv[0]]
+    test_name = args and args[0] or None
     if skip_net_tests:
         test.use_network = False
-    for module in (test.TestBuild, func_test.TestFunctional):
-        suite = unittest.TestLoader().loadTestsFromTestCase(module)
-        suite.run(result)
 
-    print(result)
-    for test, err in result.errors:
-        print(err)
-    for test, err in result.failures:
-        print(err)
+    # Run the entry tests first ,since these need to be the first to import the
+    # 'entry' module.
+    test_util.run_test_suites(
+        result, False, verboose, False, None, test_name, [],
+        [test.TestBuild, func_test.TestFunctional,
+         'buildman.toolchain', 'patman.gitutil'])
 
+    return test_util.report_result('buildman', test_name, result)
 
 options, args = cmdline.ParseArgs()
 
+if not options.debug:
+    sys.tracebacklimit = 0
+
 # Run our meagre tests
 if options.test:
-    RunTests(options.skip_net_tests)
+    RunTests(options.skip_net_tests, options.verbose, args)
 
 # Build selected commits for selected boards
 else:
diff --git a/tools/buildman/test.py b/tools/buildman/test.py
index b9c65c0..714bb3e 100644
--- a/tools/buildman/test.py
+++ b/tools/buildman/test.py
@@ -12,6 +12,7 @@
 from buildman import board
 from buildman import bsettings
 from buildman import builder
+from buildman import cfgutil
 from buildman import control
 from buildman import toolchain
 from patman import commit
@@ -147,7 +148,7 @@
         self.toolchains.Add('gcc', test=False)
 
         # Avoid sending any output
-        terminal.SetPrintTestMode()
+        terminal.set_print_test_mode()
         self._col = terminal.Color()
 
         self.base_dir = tempfile.mkdtemp()
@@ -181,10 +182,10 @@
                            col.YELLOW if outcome == OUTCOME_WARN else col.RED)
         expect = '%10s: ' % arch
         # TODO(sjg@chromium.org): If plus is '', we shouldn't need this
-        expect += ' ' + col.Color(expected_colour, plus)
+        expect += ' ' + col.build(expected_colour, plus)
         expect += '  '
         for board in boards:
-            expect += col.Color(expected_colour, ' %s' % board)
+            expect += col.build(expected_colour, ' %s' % board)
         self.assertEqual(text, expect)
 
     def _SetupTest(self, echo_lines=False, threads=1, **kwdisplay_args):
@@ -208,7 +209,7 @@
         # associated with each. This calls our Make() to inject the fake output.
         build.BuildBoards(self.commits, board_selected, keep_outputs=False,
                           verbose=False)
-        lines = terminal.GetPrintTestLines()
+        lines = terminal.get_print_test_lines()
         count = 0
         for line in lines:
             if line.text.strip():
@@ -220,8 +221,8 @@
         build.SetDisplayOptions(**kwdisplay_args);
         build.ShowSummary(self.commits, board_selected)
         if echo_lines:
-            terminal.EchoPrintTestLines()
-        return iter(terminal.GetPrintTestLines())
+            terminal.echo_print_test_lines()
+        return iter(terminal.get_print_test_lines())
 
     def _CheckOutput(self, lines, list_error_boards=False,
                      filter_dtb_warnings=False,
@@ -253,12 +254,12 @@
             new_lines = []
             for line in lines:
                 if boards:
-                    expect = self._col.Color(colour, prefix + '(')
-                    expect += self._col.Color(self._col.MAGENTA, boards,
+                    expect = self._col.build(colour, prefix + '(')
+                    expect += self._col.build(self._col.MAGENTA, boards,
                                               bright=False)
-                    expect += self._col.Color(colour, ') %s' % line)
+                    expect += self._col.build(colour, ') %s' % line)
                 else:
-                    expect = self._col.Color(colour, prefix + line)
+                    expect = self._col.build(colour, prefix + line)
                 new_lines.append(expect)
             return '\n'.join(new_lines)
 
@@ -316,12 +317,12 @@
         self.assertEqual(next(lines).text, '04: %s' % commits[3][1])
         if filter_migration_warnings:
             expect = '%10s: ' % 'powerpc'
-            expect += ' ' + col.Color(col.GREEN, '')
+            expect += ' ' + col.build(col.GREEN, '')
             expect += '  '
-            expect += col.Color(col.GREEN, ' %s' % 'board2')
-            expect += ' ' + col.Color(col.YELLOW, 'w+')
+            expect += col.build(col.GREEN, ' %s' % 'board2')
+            expect += ' ' + col.build(col.YELLOW, 'w+')
             expect += '  '
-            expect += col.Color(col.YELLOW, ' %s' % 'board3')
+            expect += col.build(col.YELLOW, ' %s' % 'board3')
             self.assertEqual(next(lines).text, expect)
         else:
             self.assertSummary(next(lines).text, 'powerpc', 'w+',
@@ -606,7 +607,7 @@
 
     def testPrepareOutputSpace(self):
         def _Touch(fname):
-            tools.WriteFile(os.path.join(base_dir, fname), b'')
+            tools.write_file(os.path.join(base_dir, fname), b'')
 
         base_dir = tempfile.mkdtemp()
 
@@ -624,5 +625,127 @@
         expected = set([os.path.join(base_dir, f) for f in to_remove])
         self.assertEqual(expected, result)
 
+    def test_adjust_cfg_nop(self):
+        """check various adjustments of config that are nops"""
+        # enable an enabled CONFIG
+        self.assertEqual(
+            'CONFIG_FRED=y',
+            cfgutil.adjust_cfg_line('CONFIG_FRED=y', {'FRED':'FRED'})[0])
+
+        # disable a disabled CONFIG
+        self.assertEqual(
+            '# CONFIG_FRED is not set',
+            cfgutil.adjust_cfg_line(
+                '# CONFIG_FRED is not set', {'FRED':'~FRED'})[0])
+
+        # use the adjust_cfg_lines() function
+        self.assertEqual(
+            ['CONFIG_FRED=y'],
+            cfgutil.adjust_cfg_lines(['CONFIG_FRED=y'], {'FRED':'FRED'}))
+        self.assertEqual(
+            ['# CONFIG_FRED is not set'],
+            cfgutil.adjust_cfg_lines(['CONFIG_FRED=y'], {'FRED':'~FRED'}))
+
+        # handling an empty line
+        self.assertEqual('#', cfgutil.adjust_cfg_line('#', {'FRED':'~FRED'})[0])
+
+    def test_adjust_cfg(self):
+        """check various adjustments of config"""
+        # disable a CONFIG
+        self.assertEqual(
+            '# CONFIG_FRED is not set',
+            cfgutil.adjust_cfg_line('CONFIG_FRED=1' , {'FRED':'~FRED'})[0])
+
+        # enable a disabled CONFIG
+        self.assertEqual(
+            'CONFIG_FRED=y',
+            cfgutil.adjust_cfg_line(
+                '# CONFIG_FRED is not set', {'FRED':'FRED'})[0])
+
+        # enable a CONFIG that doesn't exist
+        self.assertEqual(
+            ['CONFIG_FRED=y'],
+            cfgutil.adjust_cfg_lines([], {'FRED':'FRED'}))
+
+        # disable a CONFIG that doesn't exist
+        self.assertEqual(
+            ['# CONFIG_FRED is not set'],
+            cfgutil.adjust_cfg_lines([], {'FRED':'~FRED'}))
+
+        # disable a value CONFIG
+        self.assertEqual(
+            '# CONFIG_FRED is not set',
+            cfgutil.adjust_cfg_line('CONFIG_FRED="fred"' , {'FRED':'~FRED'})[0])
+
+        # setting a value CONFIG
+        self.assertEqual(
+            'CONFIG_FRED="fred"',
+            cfgutil.adjust_cfg_line('# CONFIG_FRED is not set' ,
+                                    {'FRED':'FRED="fred"'})[0])
+
+        # changing a value CONFIG
+        self.assertEqual(
+            'CONFIG_FRED="fred"',
+            cfgutil.adjust_cfg_line('CONFIG_FRED="ernie"' ,
+                                    {'FRED':'FRED="fred"'})[0])
+
+        # setting a value for a CONFIG that doesn't exist
+        self.assertEqual(
+            ['CONFIG_FRED="fred"'],
+            cfgutil.adjust_cfg_lines([], {'FRED':'FRED="fred"'}))
+
+    def test_convert_adjust_cfg_list(self):
+        """Check conversion of the list of changes into a dict"""
+        self.assertEqual({}, cfgutil.convert_list_to_dict(None))
+
+        expect = {
+            'FRED':'FRED',
+            'MARY':'~MARY',
+            'JOHN':'JOHN=0x123',
+            'ALICE':'ALICE="alice"',
+            'AMY':'AMY',
+            'ABE':'~ABE',
+            'MARK':'MARK=0x456',
+            'ANNA':'ANNA="anna"',
+            }
+        actual = cfgutil.convert_list_to_dict(
+            ['FRED', '~MARY', 'JOHN=0x123', 'ALICE="alice"',
+             'CONFIG_AMY', '~CONFIG_ABE', 'CONFIG_MARK=0x456',
+             'CONFIG_ANNA="anna"'])
+        self.assertEqual(expect, actual)
+
+    def test_check_cfg_file(self):
+        """Test check_cfg_file detects conflicts as expected"""
+        # Check failure to disable CONFIG
+        result = cfgutil.check_cfg_lines(['CONFIG_FRED=1'], {'FRED':'~FRED'})
+        self.assertEqual([['~FRED', 'CONFIG_FRED=1']], result)
+
+        result = cfgutil.check_cfg_lines(
+            ['CONFIG_FRED=1', 'CONFIG_MARY="mary"'], {'FRED':'~FRED'})
+        self.assertEqual([['~FRED', 'CONFIG_FRED=1']], result)
+
+        result = cfgutil.check_cfg_lines(
+            ['CONFIG_FRED=1', 'CONFIG_MARY="mary"'], {'MARY':'~MARY'})
+        self.assertEqual([['~MARY', 'CONFIG_MARY="mary"']], result)
+
+        # Check failure to enable CONFIG
+        result = cfgutil.check_cfg_lines(
+            ['# CONFIG_FRED is not set'], {'FRED':'FRED'})
+        self.assertEqual([['FRED', '# CONFIG_FRED is not set']], result)
+
+        # Check failure to set CONFIG value
+        result = cfgutil.check_cfg_lines(
+            ['# CONFIG_FRED is not set', 'CONFIG_MARY="not"'],
+            {'MARY':'MARY="mary"', 'FRED':'FRED'})
+        self.assertEqual([
+            ['FRED', '# CONFIG_FRED is not set'],
+            ['MARY="mary"', 'CONFIG_MARY="not"']], result)
+
+        # Check failure to add CONFIG value
+        result = cfgutil.check_cfg_lines([], {'MARY':'MARY="mary"'})
+        self.assertEqual([
+            ['MARY="mary"', 'Missing expected line: CONFIG_MARY="mary"']], result)
+
+
 if __name__ == "__main__":
     unittest.main()
diff --git a/tools/buildman/toolchain.py b/tools/buildman/toolchain.py
index adc75a7..46a4e5e 100644
--- a/tools/buildman/toolchain.py
+++ b/tools/buildman/toolchain.py
@@ -99,7 +99,7 @@
         else:
             self.priority = priority
         if test:
-            result = command.RunPipe([cmd], capture=True, env=env,
+            result = command.run_pipe([cmd], capture=True, env=env,
                                      raise_on_error=False)
             self.ok = result.return_code == 0
             if verbose:
@@ -201,11 +201,11 @@
             # We'll use MakeArgs() to provide this
             pass
         elif full_path:
-            env[b'CROSS_COMPILE'] = tools.ToBytes(
+            env[b'CROSS_COMPILE'] = tools.to_bytes(
                 wrapper + os.path.join(self.path, self.cross))
         else:
-            env[b'CROSS_COMPILE'] = tools.ToBytes(wrapper + self.cross)
-            env[b'PATH'] = tools.ToBytes(self.path) + b':' + env[b'PATH']
+            env[b'CROSS_COMPILE'] = tools.to_bytes(wrapper + self.cross)
+            env[b'PATH'] = tools.to_bytes(self.path) + b':' + env[b'PATH']
 
         env[b'LC_ALL'] = b'C'
 
@@ -381,7 +381,7 @@
     def List(self):
         """List out the selected toolchains for each architecture"""
         col = terminal.Color()
-        print(col.Color(col.BLUE, 'List of available toolchains (%d):' %
+        print(col.build(col.BLUE, 'List of available toolchains (%d):' %
                         len(self.toolchains)))
         if len(self.toolchains):
             for key, value in sorted(self.toolchains.items()):
@@ -494,7 +494,7 @@
             else
                 URL containing this toolchain, if avaialble, else None
         """
-        arch = command.OutputOneLine('uname', '-m')
+        arch = command.output_one_line('uname', '-m')
         if arch == 'aarch64':
             arch = 'arm64'
         base = 'https://www.kernel.org/pub/tools/crosstool/files/bin'
@@ -504,7 +504,7 @@
             url = '%s/%s/%s/' % (base, arch, version)
             print('Checking: %s' % url)
             response = urllib.request.urlopen(url)
-            html = tools.ToString(response.read())
+            html = tools.to_string(response.read())
             parser = MyHTMLParser(fetch_arch)
             parser.feed(html)
             if fetch_arch == 'list':
@@ -525,7 +525,7 @@
             Directory name of the first entry in the archive, without the
             trailing /
         """
-        stdout = command.Output('tar', 'xvfJ', fname, '-C', dest)
+        stdout = command.output('tar', 'xvfJ', fname, '-C', dest)
         dirs = stdout.splitlines()[1].split('/')[:2]
         return '/'.join(dirs)
 
@@ -559,7 +559,7 @@
         """
         # Fist get the URL for this architecture
         col = terminal.Color()
-        print(col.Color(col.BLUE, "Downloading toolchain for arch '%s'" % arch))
+        print(col.build(col.BLUE, "Downloading toolchain for arch '%s'" % arch))
         url = self.LocateArchUrl(arch)
         if not url:
             print(("Cannot find toolchain for arch '%s' - use 'list' to list" %
@@ -571,10 +571,10 @@
             os.mkdir(dest)
 
         # Download the tar file for this toolchain and unpack it
-        tarfile, tmpdir = tools.Download(url, '.buildman')
+        tarfile, tmpdir = tools.download(url, '.buildman')
         if not tarfile:
             return 1
-        print(col.Color(col.GREEN, 'Unpacking to: %s' % dest), end=' ')
+        print(col.build(col.GREEN, 'Unpacking to: %s' % dest), end=' ')
         sys.stdout.flush()
         path = self.Unpack(tarfile, dest)
         os.remove(tarfile)
@@ -582,14 +582,14 @@
         print()
 
         # Check that the toolchain works
-        print(col.Color(col.GREEN, 'Testing'))
+        print(col.build(col.GREEN, 'Testing'))
         dirpath = os.path.join(dest, path)
         compiler_fname_list = self.ScanPath(dirpath, True)
         if not compiler_fname_list:
             print('Could not locate C compiler - fetch failed.')
             return 1
         if len(compiler_fname_list) != 1:
-            print(col.Color(col.RED, 'Warning, ambiguous toolchains: %s' %
+            print(col.build(col.RED, 'Warning, ambiguous toolchains: %s' %
                             ', '.join(compiler_fname_list)))
         toolchain = Toolchain(compiler_fname_list[0], True, True)
 
diff --git a/tools/dtoc/fdt.py b/tools/dtoc/fdt.py
index 32a7aa9..7e13757 100644
--- a/tools/dtoc/fdt.py
+++ b/tools/dtoc/fdt.py
@@ -396,7 +396,7 @@
             prop_name: Name of property
         """
         self.props[prop_name] = Prop(self, None, prop_name,
-                                     tools.GetBytes(0, 4))
+                                     tools.get_bytes(0, 4))
 
     def AddEmptyProp(self, prop_name, len):
         """Add a property with a fixed data size, for filling in later
@@ -408,7 +408,7 @@
             prop_name: Name of property
             len: Length of data in property
         """
-        value = tools.GetBytes(0, len)
+        value = tools.get_bytes(0, len)
         self.props[prop_name] = Prop(self, None, prop_name, value)
 
     def _CheckProp(self, prop_name):
diff --git a/tools/dtoc/fdt_util.py b/tools/dtoc/fdt_util.py
index 19eb13a..d59ea2f 100644
--- a/tools/dtoc/fdt_util.py
+++ b/tools/dtoc/fdt_util.py
@@ -75,29 +75,29 @@
         dts_input = os.path.join(tmpdir, 'source.dts')
         dtb_output = os.path.join(tmpdir, 'source.dtb')
     else:
-        dts_input = tools.GetOutputFilename('source.dts')
-        dtb_output = tools.GetOutputFilename('source.dtb')
+        dts_input = tools.get_output_filename('source.dts')
+        dtb_output = tools.get_output_filename('source.dtb')
 
     search_paths = [os.path.join(os.getcwd(), 'include')]
     root, _ = os.path.splitext(fname)
-    cc, args = tools.GetTargetCompileTool('cc')
+    cc, args = tools.get_target_compile_tool('cc')
     args += ['-E', '-P', '-x', 'assembler-with-cpp', '-D__ASSEMBLY__']
     args += ['-Ulinux']
     for path in search_paths:
         args.extend(['-I', path])
     args += ['-o', dts_input, fname]
-    command.Run(cc, *args)
+    command.run(cc, *args)
 
     # If we don't have a directory, put it in the tools tempdir
     search_list = []
     for path in search_paths:
         search_list.extend(['-i', path])
-    dtc, args = tools.GetTargetCompileTool('dtc')
+    dtc, args = tools.get_target_compile_tool('dtc')
     args += ['-I', 'dts', '-o', dtb_output, '-O', 'dtb',
             '-W', 'no-unit_address_vs_reg']
     args.extend(search_list)
     args.append(dts_input)
-    command.Run(dtc, *args, capture_stderr=capture_stderr)
+    command.run(dtc, *args, capture_stderr=capture_stderr)
     return dtb_output
 
 def GetInt(node, propname, default=None):
diff --git a/tools/dtoc/main.py b/tools/dtoc/main.py
index 6f9b526..fac9db9 100755
--- a/tools/dtoc/main.py
+++ b/tools/dtoc/main.py
@@ -55,17 +55,17 @@
 
     test_dtoc.setup()
 
-    test_util.RunTestSuites(
+    test_util.run_test_suites(
         result, debug=True, verbosity=1, test_preserve_dirs=False,
         processes=processes, test_name=test_name, toolpath=[],
-        test_class_list=[test_dtoc.TestDtoc,test_src_scan.TestSrcScan])
+        class_and_module_list=[test_dtoc.TestDtoc,test_src_scan.TestSrcScan])
 
-    return test_util.ReportResult('binman', test_name, result)
+    return test_util.report_result('binman', test_name, result)
 
 def RunTestCoverage():
     """Run the tests and check that we get 100% coverage"""
     sys.argv = [sys.argv[0]]
-    test_util.RunTestCoverage('tools/dtoc/dtoc', '/main.py',
+    test_util.run_test_coverage('tools/dtoc/dtoc', '/main.py',
             ['tools/patman/*.py', '*/fdt*', '*test*'], args.build_dir)
 
 
diff --git a/tools/dtoc/test_dtoc.py b/tools/dtoc/test_dtoc.py
index ee17b8d..ea88954 100755
--- a/tools/dtoc/test_dtoc.py
+++ b/tools/dtoc/test_dtoc.py
@@ -112,12 +112,12 @@
     """Tests for dtoc"""
     @classmethod
     def setUpClass(cls):
-        tools.PrepareOutputDir(None)
+        tools.prepare_output_dir(None)
         cls.maxDiff = None
 
     @classmethod
     def tearDownClass(cls):
-        tools.FinaliseOutputDir()
+        tools.finalise_output_dir()
 
     @staticmethod
     def _write_python_string(fname, data):
@@ -218,7 +218,7 @@
     def test_empty_file(self):
         """Test output from a device tree file with no nodes"""
         dtb_file = get_dtb_file('dtoc_test_empty.dts')
-        output = tools.GetOutputFilename('output')
+        output = tools.get_output_filename('output')
 
         # Run this one without saved_scan to complete test coverage
         dtb_platdata.run_steps(['struct'], dtb_file, False, output, [], None,
@@ -801,7 +801,7 @@
     def test_simple(self):
         """Test output from some simple nodes with various types of data"""
         dtb_file = get_dtb_file('dtoc_test_simple.dts')
-        output = tools.GetOutputFilename('output')
+        output = tools.get_output_filename('output')
         self.run_test(['struct'], dtb_file, output)
         with open(output) as infile:
             data = infile.read()
@@ -822,14 +822,14 @@
 
         # Try the 'all' command
         self.run_test(['all'], dtb_file, output)
-        data = tools.ReadFile(output, binary=False)
+        data = tools.read_file(output, binary=False)
         self._check_strings(
             self.decl_text + self.platdata_text + self.struct_text, data)
 
     def test_driver_alias(self):
         """Test output from a device tree file with a driver alias"""
         dtb_file = get_dtb_file('dtoc_test_driver_alias.dts')
-        output = tools.GetOutputFilename('output')
+        output = tools.get_output_filename('output')
         self.run_test(['struct'], dtb_file, output)
         with open(output) as infile:
             data = infile.read()
@@ -875,7 +875,7 @@
     def test_invalid_driver(self):
         """Test output from a device tree file with an invalid driver"""
         dtb_file = get_dtb_file('dtoc_test_invalid_driver.dts')
-        output = tools.GetOutputFilename('output')
+        output = tools.get_output_filename('output')
         with test_util.capture_sys_output() as _:
             dtb_platdata.run_steps(
                 ['struct'], dtb_file, False, output, [], None, False,
@@ -918,7 +918,7 @@
     def test_phandle(self):
         """Test output from a node containing a phandle reference"""
         dtb_file = get_dtb_file('dtoc_test_phandle.dts')
-        output = tools.GetOutputFilename('output')
+        output = tools.get_output_filename('output')
         self.run_test(['struct'], dtb_file, output)
         with open(output) as infile:
             data = infile.read()
@@ -1013,7 +1013,7 @@
     def test_phandle_single(self):
         """Test output from a node containing a phandle reference"""
         dtb_file = get_dtb_file('dtoc_test_phandle_single.dts')
-        output = tools.GetOutputFilename('output')
+        output = tools.get_output_filename('output')
         self.run_test(['struct'], dtb_file, output)
         with open(output) as infile:
             data = infile.read()
@@ -1029,7 +1029,7 @@
     def test_phandle_reorder(self):
         """Test that phandle targets are generated before their references"""
         dtb_file = get_dtb_file('dtoc_test_phandle_reorder.dts')
-        output = tools.GetOutputFilename('output')
+        output = tools.get_output_filename('output')
         self.run_test(['platdata'], dtb_file, output)
         with open(output) as infile:
             data = infile.read()
@@ -1071,7 +1071,7 @@
     def test_phandle_cd_gpio(self):
         """Test that phandle targets are generated when unsing cd-gpios"""
         dtb_file = get_dtb_file('dtoc_test_phandle_cd_gpios.dts')
-        output = tools.GetOutputFilename('output')
+        output = tools.get_output_filename('output')
         dtb_platdata.run_steps(
             ['platdata'], dtb_file, False, output, [], None, False,
             warning_disabled=True, scan=copy_scan())
@@ -1157,7 +1157,7 @@
         """Test a node containing an invalid phandle fails"""
         dtb_file = get_dtb_file('dtoc_test_phandle_bad.dts',
                                 capture_stderr=True)
-        output = tools.GetOutputFilename('output')
+        output = tools.get_output_filename('output')
         with self.assertRaises(ValueError) as exc:
             self.run_test(['struct'], dtb_file, output)
         self.assertIn("Cannot parse 'clocks' in node 'phandle-source'",
@@ -1167,7 +1167,7 @@
         """Test a phandle target missing its #*-cells property"""
         dtb_file = get_dtb_file('dtoc_test_phandle_bad2.dts',
                                 capture_stderr=True)
-        output = tools.GetOutputFilename('output')
+        output = tools.get_output_filename('output')
         with self.assertRaises(ValueError) as exc:
             self.run_test(['struct'], dtb_file, output)
         self.assertIn("Node 'phandle-target' has no cells property",
@@ -1176,7 +1176,7 @@
     def test_addresses64(self):
         """Test output from a node with a 'reg' property with na=2, ns=2"""
         dtb_file = get_dtb_file('dtoc_test_addr64.dts')
-        output = tools.GetOutputFilename('output')
+        output = tools.get_output_filename('output')
         self.run_test(['struct'], dtb_file, output)
         with open(output) as infile:
             data = infile.read()
@@ -1245,7 +1245,7 @@
     def test_addresses32(self):
         """Test output from a node with a 'reg' property with na=1, ns=1"""
         dtb_file = get_dtb_file('dtoc_test_addr32.dts')
-        output = tools.GetOutputFilename('output')
+        output = tools.get_output_filename('output')
         self.run_test(['struct'], dtb_file, output)
         with open(output) as infile:
             data = infile.read()
@@ -1299,7 +1299,7 @@
     def test_addresses64_32(self):
         """Test output from a node with a 'reg' property with na=2, ns=1"""
         dtb_file = get_dtb_file('dtoc_test_addr64_32.dts')
-        output = tools.GetOutputFilename('output')
+        output = tools.get_output_filename('output')
         self.run_test(['struct'], dtb_file, output)
         with open(output) as infile:
             data = infile.read()
@@ -1368,7 +1368,7 @@
     def test_addresses32_64(self):
         """Test output from a node with a 'reg' property with na=1, ns=2"""
         dtb_file = get_dtb_file('dtoc_test_addr32_64.dts')
-        output = tools.GetOutputFilename('output')
+        output = tools.get_output_filename('output')
         self.run_test(['struct'], dtb_file, output)
         with open(output) as infile:
             data = infile.read()
@@ -1438,7 +1438,7 @@
         """Test that a reg property with an invalid type generates an error"""
         # Capture stderr since dtc will emit warnings for this file
         dtb_file = get_dtb_file('dtoc_test_bad_reg.dts', capture_stderr=True)
-        output = tools.GetOutputFilename('output')
+        output = tools.get_output_filename('output')
         with self.assertRaises(ValueError) as exc:
             self.run_test(['struct'], dtb_file, output)
         self.assertIn("Node 'spl-test' reg property is not an int",
@@ -1448,7 +1448,7 @@
         """Test that a reg property with an invalid cell count is detected"""
         # Capture stderr since dtc will emit warnings for this file
         dtb_file = get_dtb_file('dtoc_test_bad_reg2.dts', capture_stderr=True)
-        output = tools.GetOutputFilename('output')
+        output = tools.get_output_filename('output')
         with self.assertRaises(ValueError) as exc:
             self.run_test(['struct'], dtb_file, output)
         self.assertIn(
@@ -1458,7 +1458,7 @@
     def test_add_prop(self):
         """Test that a subequent node can add a new property to a struct"""
         dtb_file = get_dtb_file('dtoc_test_add_prop.dts')
-        output = tools.GetOutputFilename('output')
+        output = tools.get_output_filename('output')
         self.run_test(['struct'], dtb_file, output)
         with open(output) as infile:
             data = infile.read()
@@ -1523,9 +1523,9 @@
     def test_multi_to_file(self):
         """Test output of multiple pieces to a single file"""
         dtb_file = get_dtb_file('dtoc_test_simple.dts')
-        output = tools.GetOutputFilename('output')
+        output = tools.get_output_filename('output')
         self.run_test(['all'], dtb_file, output)
-        data = tools.ReadFile(output, binary=False)
+        data = tools.read_file(output, binary=False)
         self._check_strings(
             self.decl_text + self.platdata_text + self.struct_text, data)
 
@@ -1539,7 +1539,7 @@
     def test_bad_command(self):
         """Test running dtoc with an invalid command"""
         dtb_file = get_dtb_file('dtoc_test_simple.dts')
-        output = tools.GetOutputFilename('output')
+        output = tools.get_output_filename('output')
         with self.assertRaises(ValueError) as exc:
             self.run_test(['invalid-cmd'], dtb_file, output)
         self.assertIn(
@@ -1557,12 +1557,12 @@
 
     def check_output_dirs(self, instantiate):
         # Remove the directory so that files from other tests are not there
-        tools._RemoveOutputDir()
-        tools.PrepareOutputDir(None)
+        tools._remove_output_dir()
+        tools.prepare_output_dir(None)
 
         # This should create the .dts and .dtb in the output directory
         dtb_file = get_dtb_file('dtoc_test_simple.dts')
-        outdir = tools.GetOutputDir()
+        outdir = tools.get_output_dir()
         fnames = glob.glob(outdir + '/*')
         self.assertEqual(2, len(fnames))
 
@@ -1606,7 +1606,7 @@
                 Scanner: scanner to use
         """
         dtb_file = get_dtb_file('dtoc_test_simple.dts')
-        output = tools.GetOutputFilename('output')
+        output = tools.get_output_filename('output')
 
         # Take a copy before messing with it
         scan = copy_scan()
@@ -1694,7 +1694,7 @@
     def test_alias_read(self):
         """Test obtaining aliases"""
         dtb_file = get_dtb_file('dtoc_test_inst.dts')
-        output = tools.GetOutputFilename('output')
+        output = tools.get_output_filename('output')
         plat = self.run_test(['struct'], dtb_file, output)
 
         scan = plat._scan
@@ -1716,7 +1716,7 @@
     def test_alias_read_bad(self):
         """Test invalid alias property name"""
         dtb_file = get_dtb_file('dtoc_test_alias_bad.dts')
-        output = tools.GetOutputFilename('output')
+        output = tools.get_output_filename('output')
         with self.assertRaises(ValueError) as exc:
             plat = self.run_test(['struct'], dtb_file, output)
         self.assertIn("Cannot decode alias 'i2c4-'", str(exc.exception))
@@ -1728,7 +1728,7 @@
         #    node (/does/not/exist)
         dtb_file = get_dtb_file('dtoc_test_alias_bad_path.dts', True)
 
-        output = tools.GetOutputFilename('output')
+        output = tools.get_output_filename('output')
         with self.assertRaises(ValueError) as exc:
             plat = self.run_test(['struct'], dtb_file, output)
         self.assertIn("Alias 'i2c4' path '/does/not/exist' not found",
@@ -1737,7 +1737,7 @@
     def test_alias_read_bad_uclass(self):
         """Test alias for a uclass that doesn't exist"""
         dtb_file = get_dtb_file('dtoc_test_alias_bad_uc.dts')
-        output = tools.GetOutputFilename('output')
+        output = tools.get_output_filename('output')
         with test_util.capture_sys_output() as (stdout, _):
             plat = self.run_test(['struct'], dtb_file, output)
         self.assertEqual("Could not find uclass for alias 'other1'",
@@ -1746,7 +1746,7 @@
     def test_sequence(self):
         """Test assignment of sequence numnbers"""
         dtb_file = get_dtb_file('dtoc_test_inst.dts')
-        output = tools.GetOutputFilename('output')
+        output = tools.get_output_filename('output')
         plat = self.run_test(['struct'], dtb_file, output)
 
         scan = plat._scan
@@ -1762,7 +1762,7 @@
     def test_process_root(self):
         """Test assignment of sequence numnbers"""
         dtb_file = get_dtb_file('dtoc_test_simple.dts')
-        output = tools.GetOutputFilename('output')
+        output = tools.get_output_filename('output')
 
         # Take a copy before messing with it
         scan = copy_scan()
@@ -1781,7 +1781,7 @@
     def test_simple_inst(self):
         """Test output from some simple nodes with instantiate enabled"""
         dtb_file = get_dtb_file('dtoc_test_inst.dts')
-        output = tools.GetOutputFilename('output')
+        output = tools.get_output_filename('output')
 
         self.run_test(['decl'], dtb_file, output, True)
         with open(output) as infile:
@@ -1804,7 +1804,7 @@
     def test_inst_no_hdr(self):
         """Test dealing with a struct tsssshat has no header"""
         dtb_file = get_dtb_file('dtoc_test_inst.dts')
-        output = tools.GetOutputFilename('output')
+        output = tools.get_output_filename('output')
 
         # Run it once to set everything up
         plat = self.run_test(['decl'], dtb_file, output, True)
@@ -1824,7 +1824,7 @@
     def test_missing_props(self):
         """Test detection of a parent node with no properties"""
         dtb_file = get_dtb_file('dtoc_test_noprops.dts', capture_stderr=True)
-        output = tools.GetOutputFilename('output')
+        output = tools.get_output_filename('output')
         with self.assertRaises(ValueError) as exc:
             self.run_test(['struct'], dtb_file, output)
         self.assertIn("Parent node '/i2c@0' has no properties - do you need",
@@ -1833,13 +1833,13 @@
     def test_single_reg(self):
         """Test detection of a parent node with no properties"""
         dtb_file = get_dtb_file('dtoc_test_single_reg.dts')
-        output = tools.GetOutputFilename('output')
+        output = tools.get_output_filename('output')
         self.run_test(['struct'], dtb_file, output)
 
     def test_missing_parent(self):
         """Test detection of a parent node with no properties"""
         dtb_file = get_dtb_file('dtoc_test_noparent.dts', capture_stderr=True)
-        output = tools.GetOutputFilename('output')
+        output = tools.get_output_filename('output')
         with self.assertRaises(ValueError) as exc:
             self.run_test(['device'], dtb_file, output, instantiate=True)
         self.assertIn("Node '/i2c@0/spl-test/pmic@9' requires parent node "
diff --git a/tools/dtoc/test_fdt.py b/tools/dtoc/test_fdt.py
index 55b70e9..c789822 100755
--- a/tools/dtoc/test_fdt.py
+++ b/tools/dtoc/test_fdt.py
@@ -74,11 +74,11 @@
     """
     @classmethod
     def setUpClass(cls):
-        tools.PrepareOutputDir(None)
+        tools.prepare_output_dir(None)
 
     @classmethod
     def tearDownClass(cls):
-        tools.FinaliseOutputDir()
+        tools.finalise_output_dir()
 
     def setUp(self):
         self.dtb = fdt.FdtScan(find_dtb_file('dtoc_test_simple.dts'))
@@ -152,11 +152,11 @@
 
     @classmethod
     def setUpClass(cls):
-        tools.PrepareOutputDir(None)
+        tools.prepare_output_dir(None)
 
     @classmethod
     def tearDownClass(cls):
-        tools.FinaliseOutputDir()
+        tools.finalise_output_dir()
 
     def setUp(self):
         self.dtb = fdt.FdtScan(find_dtb_file('dtoc_test_simple.dts'))
@@ -294,11 +294,11 @@
 
     @classmethod
     def setUpClass(cls):
-        tools.PrepareOutputDir(None)
+        tools.prepare_output_dir(None)
 
     @classmethod
     def tearDownClass(cls):
-        tools.FinaliseOutputDir()
+        tools.finalise_output_dir()
 
     def setUp(self):
         self.dtb = fdt.FdtScan(find_dtb_file('dtoc_test_simple.dts'))
@@ -370,7 +370,7 @@
         """Tests the GetEmpty() function for the various supported types"""
         self.assertEqual(True, fdt.Prop.GetEmpty(Type.BOOL))
         self.assertEqual(chr(0), fdt.Prop.GetEmpty(Type.BYTE))
-        self.assertEqual(tools.GetBytes(0, 4), fdt.Prop.GetEmpty(Type.INT))
+        self.assertEqual(tools.get_bytes(0, 4), fdt.Prop.GetEmpty(Type.INT))
         self.assertEqual('', fdt.Prop.GetEmpty(Type.STRING))
 
     def testGetOffset(self):
@@ -501,7 +501,7 @@
         self.node.AddString('string', val)
         self.dtb.Sync(auto_resize=True)
         data = self.fdt.getprop(self.node.Offset(), 'string')
-        self.assertEqual(tools.ToBytes(val) + b'\0', data)
+        self.assertEqual(tools.to_bytes(val) + b'\0', data)
 
         self.fdt.pack()
         self.node.SetString('string', val + 'x')
@@ -511,24 +511,24 @@
         self.node.SetString('string', val[:-1])
 
         prop = self.node.props['string']
-        prop.SetData(tools.ToBytes(val))
+        prop.SetData(tools.to_bytes(val))
         self.dtb.Sync(auto_resize=False)
         data = self.fdt.getprop(self.node.Offset(), 'string')
-        self.assertEqual(tools.ToBytes(val), data)
+        self.assertEqual(tools.to_bytes(val), data)
 
         self.node.AddEmptyProp('empty', 5)
         self.dtb.Sync(auto_resize=True)
         prop = self.node.props['empty']
-        prop.SetData(tools.ToBytes(val))
+        prop.SetData(tools.to_bytes(val))
         self.dtb.Sync(auto_resize=False)
         data = self.fdt.getprop(self.node.Offset(), 'empty')
-        self.assertEqual(tools.ToBytes(val), data)
+        self.assertEqual(tools.to_bytes(val), data)
 
         self.node.SetData('empty', b'123')
         self.assertEqual(b'123', prop.bytes)
 
         # Trying adding a lot of data at once
-        self.node.AddData('data', tools.GetBytes(65, 20000))
+        self.node.AddData('data', tools.get_bytes(65, 20000))
         self.dtb.Sync(auto_resize=True)
 
     def testFromData(self):
@@ -562,7 +562,7 @@
 
     def testGetFilename(self):
         """Test the dtb filename can be provided"""
-        self.assertEqual(tools.GetOutputFilename('source.dtb'),
+        self.assertEqual(tools.get_output_filename('source.dtb'),
                          self.dtb.GetFilename())
 
 
@@ -575,11 +575,11 @@
     """
     @classmethod
     def setUpClass(cls):
-        tools.PrepareOutputDir(None)
+        tools.prepare_output_dir(None)
 
     @classmethod
     def tearDownClass(cls):
-        tools.FinaliseOutputDir()
+        tools.finalise_output_dir()
 
     def setUp(self):
         self.dtb = fdt.FdtScan(find_dtb_file('dtoc_test_simple.dts'))
@@ -715,7 +715,7 @@
 
 def RunTestCoverage():
     """Run the tests and check that we get 100% coverage"""
-    test_util.RunTestCoverage('tools/dtoc/test_fdt.py', None,
+    test_util.run_test_coverage('tools/dtoc/test_fdt.py', None,
             ['tools/patman/*.py', '*test_fdt.py'], options.build_dir)
 
 
diff --git a/tools/dtoc/test_src_scan.py b/tools/dtoc/test_src_scan.py
index f03cf8e..bdfa669 100644
--- a/tools/dtoc/test_src_scan.py
+++ b/tools/dtoc/test_src_scan.py
@@ -43,11 +43,11 @@
     """Tests for src_scan"""
     @classmethod
     def setUpClass(cls):
-        tools.PrepareOutputDir(None)
+        tools.prepare_output_dir(None)
 
     @classmethod
     def tearDownClass(cls):
-        tools.FinaliseOutputDir()
+        tools.finalise_output_dir()
 
     def test_simple(self):
         """Simple test of scanning drivers"""
@@ -113,7 +113,7 @@
             pathname = os.path.join(indir, fname)
             dirname = os.path.dirname(pathname)
             os.makedirs(dirname, exist_ok=True)
-            tools.WriteFile(pathname, '', binary=False)
+            tools.write_file(pathname, '', binary=False)
             fname_list.append(pathname)
 
         try:
@@ -142,7 +142,7 @@
     def test_scan(self):
         """Test scanning of a driver"""
         fname = os.path.join(OUR_PATH, '..', '..', 'drivers/i2c/tegra_i2c.c')
-        buff = tools.ReadFile(fname, False)
+        buff = tools.read_file(fname, False)
         scan = src_scan.Scanner(None, None)
         scan._parse_driver(fname, buff)
         self.assertIn('i2c_tegra', scan._drivers)
@@ -374,8 +374,8 @@
 
     def test_struct_scan_errors(self):
         """Test scanning a header file with an invalid unicode file"""
-        output = tools.GetOutputFilename('output.h')
-        tools.WriteFile(output, b'struct this is a test \x81 of bad unicode')
+        output = tools.get_output_filename('output.h')
+        tools.write_file(output, b'struct this is a test \x81 of bad unicode')
 
         scan = src_scan.Scanner(None, None)
         with test_util.capture_sys_output() as (stdout, _):
diff --git a/tools/kwboot.c b/tools/kwboot.c
index 2684f0e..68c0ef1 100644
--- a/tools/kwboot.c
+++ b/tools/kwboot.c
@@ -1183,10 +1183,10 @@
 static int
 kwboot_term_pipe(int in, int out, const char *quit, int *s)
 {
+	char buf[128];
 	ssize_t nin;
-	char _buf[128], *buf = _buf;
 
-	nin = read(in, buf, sizeof(_buf));
+	nin = read(in, buf, sizeof(buf));
 	if (nin <= 0)
 		return -1;
 
@@ -1194,18 +1194,21 @@
 		int i;
 
 		for (i = 0; i < nin; i++) {
-			if (*buf == quit[*s]) {
+			if (buf[i] == quit[*s]) {
 				(*s)++;
-				if (!quit[*s])
-					return 0;
-				buf++;
-				nin--;
+				if (!quit[*s]) {
+					nin = i - *s;
+					break;
+				}
 			} else {
-				if (kwboot_write(out, quit, *s) < 0)
+				if (*s > i && kwboot_write(out, quit, *s - i) < 0)
 					return -1;
 				*s = 0;
 			}
 		}
+
+		if (i == nin)
+			nin -= *s;
 	}
 
 	if (kwboot_write(out, buf, nin) < 0)
@@ -1767,7 +1770,7 @@
 			bootmsg = kwboot_msg_boot;
 			if (prev_optind == optind)
 				goto usage;
-			if (argv[optind] && argv[optind][0] != '-')
+			if (optind < argc - 1 && argv[optind] && argv[optind][0] != '-')
 				imgpath = argv[optind++];
 			break;
 
diff --git a/tools/patman/checkpatch.py b/tools/patman/checkpatch.py
index 8978df2..dd792ef 100644
--- a/tools/patman/checkpatch.py
+++ b/tools/patman/checkpatch.py
@@ -20,8 +20,8 @@
 RE_NOTE = re.compile(r'NOTE: (.*)')
 
 
-def FindCheckPatch():
-    top_level = gitutil.GetTopLevel()
+def find_check_patch():
+    top_level = gitutil.get_top_level()
     try_list = [
         os.getcwd(),
         os.path.join(os.getcwd(), '..', '..'),
@@ -47,7 +47,7 @@
              '~/bin directory or use --no-check')
 
 
-def CheckPatchParseOneMessage(message):
+def check_patch_parse_one_message(message):
     """Parse one checkpatch message
 
     Args:
@@ -114,7 +114,7 @@
     return item
 
 
-def CheckPatchParse(checkpatch_output, verbose=False):
+def check_patch_parse(checkpatch_output, verbose=False):
     """Parse checkpatch.pl output
 
     Args:
@@ -179,14 +179,14 @@
         elif re_bad.match(message):
             result.ok = False
         else:
-            problem = CheckPatchParseOneMessage(message)
+            problem = check_patch_parse_one_message(message)
             if problem:
                 result.problems.append(problem)
 
     return result
 
 
-def CheckPatch(fname, verbose=False, show_types=False):
+def check_patch(fname, verbose=False, show_types=False):
     """Run checkpatch.pl on a file and parse the results.
 
     Args:
@@ -209,16 +209,16 @@
             lines: Number of lines
             stdout: Full output of checkpatch
     """
-    chk = FindCheckPatch()
+    chk = find_check_patch()
     args = [chk, '--no-tree']
     if show_types:
         args.append('--show-types')
-    output = command.Output(*args, fname, raise_on_error=False)
+    output = command.output(*args, fname, raise_on_error=False)
 
-    return CheckPatchParse(output, verbose)
+    return check_patch_parse(output, verbose)
 
 
-def GetWarningMsg(col, msg_type, fname, line, msg):
+def get_warning_msg(col, msg_type, fname, line, msg):
     '''Create a message for a given file/line
 
     Args:
@@ -228,33 +228,33 @@
         msg: Message to report
     '''
     if msg_type == 'warning':
-        msg_type = col.Color(col.YELLOW, msg_type)
+        msg_type = col.build(col.YELLOW, msg_type)
     elif msg_type == 'error':
-        msg_type = col.Color(col.RED, msg_type)
+        msg_type = col.build(col.RED, msg_type)
     elif msg_type == 'check':
-        msg_type = col.Color(col.MAGENTA, msg_type)
+        msg_type = col.build(col.MAGENTA, msg_type)
     line_str = '' if line is None else '%d' % line
     return '%s:%s: %s: %s\n' % (fname, line_str, msg_type, msg)
 
-def CheckPatches(verbose, args):
+def check_patches(verbose, args):
     '''Run the checkpatch.pl script on each patch'''
     error_count, warning_count, check_count = 0, 0, 0
     col = terminal.Color()
 
     for fname in args:
-        result = CheckPatch(fname, verbose)
+        result = check_patch(fname, verbose)
         if not result.ok:
             error_count += result.errors
             warning_count += result.warnings
             check_count += result.checks
             print('%d errors, %d warnings, %d checks for %s:' % (result.errors,
-                    result.warnings, result.checks, col.Color(col.BLUE, fname)))
+                    result.warnings, result.checks, col.build(col.BLUE, fname)))
             if (len(result.problems) != result.errors + result.warnings +
                     result.checks):
                 print("Internal error: some problems lost")
             for item in result.problems:
                 sys.stderr.write(
-                    GetWarningMsg(col, item.get('type', '<unknown>'),
+                    get_warning_msg(col, item.get('type', '<unknown>'),
                         item.get('file', '<unknown>'),
                         item.get('line', 0), item.get('msg', 'message')))
             print
@@ -266,6 +266,6 @@
             color = col.YELLOW
         if error_count:
             color = col.RED
-        print(col.Color(color, str % (error_count, warning_count, check_count)))
+        print(col.build(color, str % (error_count, warning_count, check_count)))
         return False
     return True
diff --git a/tools/patman/command.py b/tools/patman/command.py
index d54b1e0..2435878 100644
--- a/tools/patman/command.py
+++ b/tools/patman/command.py
@@ -32,7 +32,7 @@
         self.return_code = return_code
         self.exception = exception
 
-    def ToOutput(self, binary):
+    def to_output(self, binary):
         if not binary:
             self.stdout = self.stdout.decode('utf-8')
             self.stderr = self.stderr.decode('utf-8')
@@ -43,11 +43,11 @@
 # This permits interception of RunPipe for test purposes. If it is set to
 # a function, then that function is called with the pipe list being
 # executed. Otherwise, it is assumed to be a CommandResult object, and is
-# returned as the result for every RunPipe() call.
+# returned as the result for every run_pipe() call.
 # When this value is None, commands are executed as normal.
 test_result = None
 
-def RunPipe(pipe_list, infile=None, outfile=None,
+def run_pipe(pipe_list, infile=None, outfile=None,
             capture=False, capture_stderr=False, oneline=False,
             raise_on_error=True, cwd=None, binary=False,
             output_func=None, **kwargs):
@@ -104,11 +104,11 @@
             if raise_on_error:
                 raise Exception("Error running '%s': %s" % (user_pipestr, str))
             result.return_code = 255
-            return result.ToOutput(binary)
+            return result.to_output(binary)
 
     if capture:
         result.stdout, result.stderr, result.combined = (
-                last_pipe.CommunicateFilter(output_func))
+                last_pipe.communicate_filter(output_func))
         if result.stdout and oneline:
             result.output = result.stdout.rstrip(b'\r\n')
         result.return_code = last_pipe.wait()
@@ -116,13 +116,13 @@
         result.return_code = os.waitpid(last_pipe.pid, 0)[1]
     if raise_on_error and result.return_code:
         raise Exception("Error running '%s'" % user_pipestr)
-    return result.ToOutput(binary)
+    return result.to_output(binary)
 
-def Output(*cmd, **kwargs):
+def output(*cmd, **kwargs):
     kwargs['raise_on_error'] = kwargs.get('raise_on_error', True)
-    return RunPipe([cmd], capture=True, **kwargs).stdout
+    return run_pipe([cmd], capture=True, **kwargs).stdout
 
-def OutputOneLine(*cmd, **kwargs):
+def output_one_line(*cmd, **kwargs):
     """Run a command and output it as a single-line string
 
     The command us expected to produce a single line of output
@@ -131,15 +131,15 @@
         String containing output of command
     """
     raise_on_error = kwargs.pop('raise_on_error', True)
-    result = RunPipe([cmd], capture=True, oneline=True,
+    result = run_pipe([cmd], capture=True, oneline=True,
                      raise_on_error=raise_on_error, **kwargs).stdout.strip()
     return result
 
-def Run(*cmd, **kwargs):
-    return RunPipe([cmd], **kwargs).stdout
+def run(*cmd, **kwargs):
+    return run_pipe([cmd], **kwargs).stdout
 
-def RunList(cmd):
-    return RunPipe([cmd], capture=True).stdout
+def run_list(cmd):
+    return run_pipe([cmd], capture=True).stdout
 
-def StopAll():
+def stop_all():
     cros_subprocess.stay_alive = False
diff --git a/tools/patman/commit.py b/tools/patman/commit.py
index 5bf2b94..c331a3b 100644
--- a/tools/patman/commit.py
+++ b/tools/patman/commit.py
@@ -44,7 +44,7 @@
     def __str__(self):
         return self.subject
 
-    def AddChange(self, version, info):
+    def add_change(self, version, info):
         """Add a new change line to the change list for a version.
 
         Args:
@@ -55,7 +55,7 @@
             self.changes[version] = []
         self.changes[version].append(info)
 
-    def CheckTags(self):
+    def check_tags(self):
         """Create a list of subject tags in the commit
 
         Subject tags look like this:
@@ -78,7 +78,7 @@
                 str = m.group(2)
         return None
 
-    def AddCc(self, cc_list):
+    def add_cc(self, cc_list):
         """Add a list of people to Cc when we send this patch.
 
         Args:
@@ -86,7 +86,7 @@
         """
         self.cc_list += cc_list
 
-    def CheckDuplicateSignoff(self, signoff):
+    def check_duplicate_signoff(self, signoff):
         """Check a list of signoffs we have send for this patch
 
         Args:
@@ -99,7 +99,7 @@
         self.signoff_set.add(signoff)
         return True
 
-    def AddRtag(self, rtag_type, who):
+    def add_rtag(self, rtag_type, who):
         """Add a response tag to a commit
 
         Args:
diff --git a/tools/patman/control.py b/tools/patman/control.py
index ee9717c..b403823 100644
--- a/tools/patman/control.py
+++ b/tools/patman/control.py
@@ -18,7 +18,7 @@
 
 def setup():
     """Do required setup before doing anything"""
-    gitutil.Setup()
+    gitutil.setup()
 
 def prepare_patches(col, branch, count, start, end, ignore_binary, signoff):
     """Figure out what patches to generate, then generate them
@@ -45,17 +45,17 @@
     """
     if count == -1:
         # Work out how many patches to send if we can
-        count = (gitutil.CountCommitsToBranch(branch) - start)
+        count = (gitutil.count_commits_to_branch(branch) - start)
 
     if not count:
         str = 'No commits found to process - please use -c flag, or run:\n' \
               '  git branch --set-upstream-to remote/branch'
-        sys.exit(col.Color(col.RED, str))
+        sys.exit(col.build(col.RED, str))
 
     # Read the metadata from the commits
     to_do = count - end
     series = patchstream.get_metadata(branch, start, to_do)
-    cover_fname, patch_files = gitutil.CreatePatches(
+    cover_fname, patch_files = gitutil.create_patches(
         branch, start, to_do, ignore_binary, series, signoff)
 
     # Fix up the patch files to our liking, and insert the cover letter
@@ -86,7 +86,7 @@
 
     # Check the patches, and run them through 'git am' just to be sure
     if run_checkpatch:
-        ok = checkpatch.CheckPatches(verbose, patch_files)
+        ok = checkpatch.check_patches(verbose, patch_files)
     else:
         ok = True
     return ok
@@ -138,18 +138,18 @@
     # Email the patches out (giving the user time to check / cancel)
     cmd = ''
     if its_a_go:
-        cmd = gitutil.EmailPatches(
+        cmd = gitutil.email_patches(
             series, cover_fname, patch_files, dry_run, not ignore_bad_tags,
             cc_file, in_reply_to=in_reply_to, thread=thread,
             smtp_server=smtp_server)
     else:
-        print(col.Color(col.RED, "Not sending emails due to errors/warnings"))
+        print(col.build(col.RED, "Not sending emails due to errors/warnings"))
 
     # For a dry run, just show our actions as a sanity check
     if dry_run:
         series.ShowActions(patch_files, cmd, process_tags)
         if not its_a_go:
-            print(col.Color(col.RED, "Email would not be sent"))
+            print(col.build(col.RED, "Email would not be sent"))
 
     os.remove(cc_file)
 
@@ -167,7 +167,7 @@
     ok = check_patches(series, patch_files, args.check_patch,
                        args.verbose)
 
-    ok = ok and gitutil.CheckSuppressCCConfig()
+    ok = ok and gitutil.check_suppress_cc_config()
 
     its_a_go = ok or args.ignore_errors
     email_patches(
@@ -204,7 +204,7 @@
     """
     if count == -1:
         # Work out how many patches to send if we can
-        count = (gitutil.CountCommitsToBranch(branch) - start)
+        count = (gitutil.count_commits_to_branch(branch) - start)
 
     series = patchstream.get_metadata(branch, start, count - end)
     warnings = 0
diff --git a/tools/patman/cros_subprocess.py b/tools/patman/cros_subprocess.py
index 88a4693..f1b2608 100644
--- a/tools/patman/cros_subprocess.py
+++ b/tools/patman/cros_subprocess.py
@@ -49,7 +49,7 @@
          to us as soon as it is produced, rather than waiting for the end of a
          line.
 
-    Use CommunicateFilter() to handle output from the subprocess.
+    Use communicate_filter() to handle output from the subprocess.
 
     """
 
@@ -100,7 +100,7 @@
         if kwargs:
             raise ValueError("Unit tests do not test extra args - please add tests")
 
-    def ConvertData(self, data):
+    def convert_data(self, data):
         """Convert stdout/stderr data to the correct format for output
 
         Args:
@@ -113,7 +113,7 @@
             return b''
         return data
 
-    def CommunicateFilter(self, output):
+    def communicate_filter(self, output):
         """Interact with process: Read data from stdout and stderr.
 
         This method runs until end-of-file is reached, then waits for the
@@ -122,7 +122,7 @@
         The output function is sent all output from the subprocess and must be
         defined like this:
 
-            def Output([self,] stream, data)
+            def output([self,] stream, data)
             Args:
                 stream: the stream the output was received on, which will be
                         sys.stdout or sys.stderr.
@@ -236,9 +236,9 @@
                 self.terminate()
 
         # All data exchanged.    Translate lists into strings.
-        stdout = self.ConvertData(stdout)
-        stderr = self.ConvertData(stderr)
-        combined = self.ConvertData(combined)
+        stdout = self.convert_data(stdout)
+        stderr = self.convert_data(stderr)
+        combined = self.convert_data(combined)
 
         # Translate newlines, if requested.    We cannot let the file
         # object do the translation: It is based on stdio, which is
@@ -281,7 +281,7 @@
                 self.stdin_read_pipe = pipe[0]
                 self._stdin_write_pipe = os.fdopen(pipe[1], 'w')
 
-        def Output(self, stream, data):
+        def output(self, stream, data):
             """Output handler for Popen. Stores the data for later comparison"""
             if stream == sys.stdout:
                 self.stdout_data += data
@@ -294,7 +294,7 @@
                 self._stdin_write_pipe.write(self._input_to_send + '\r\n')
                 self._stdin_write_pipe.flush()
 
-    def _BasicCheck(self, plist, oper):
+    def _basic_check(self, plist, oper):
         """Basic checks that the output looks sane."""
         self.assertEqual(plist[0], oper.stdout_data)
         self.assertEqual(plist[1], oper.stderr_data)
@@ -306,15 +306,15 @@
     def test_simple(self):
         """Simple redirection: Get process list"""
         oper = TestSubprocess.MyOperation()
-        plist = Popen(['ps']).CommunicateFilter(oper.Output)
-        self._BasicCheck(plist, oper)
+        plist = Popen(['ps']).communicate_filter(oper.output)
+        self._basic_check(plist, oper)
 
     def test_stderr(self):
         """Check stdout and stderr"""
         oper = TestSubprocess.MyOperation()
         cmd = 'echo fred >/dev/stderr && false || echo bad'
-        plist = Popen([cmd], shell=True).CommunicateFilter(oper.Output)
-        self._BasicCheck(plist, oper)
+        plist = Popen([cmd], shell=True).communicate_filter(oper.output)
+        self._basic_check(plist, oper)
         self.assertEqual(plist [0], 'bad\r\n')
         self.assertEqual(plist [1], 'fred\r\n')
 
@@ -323,8 +323,8 @@
         oper = TestSubprocess.MyOperation()
         cmd = 'echo test >/dev/stderr'
         self.assertRaises(OSError, Popen, [cmd], shell=False)
-        plist = Popen([cmd], shell=True).CommunicateFilter(oper.Output)
-        self._BasicCheck(plist, oper)
+        plist = Popen([cmd], shell=True).communicate_filter(oper.output)
+        self._basic_check(plist, oper)
         self.assertEqual(len(plist [0]), 0)
         self.assertEqual(plist [1], 'test\r\n')
 
@@ -332,8 +332,8 @@
         """Check with and without shell works using list arguments"""
         oper = TestSubprocess.MyOperation()
         cmd = ['echo', 'test', '>/dev/stderr']
-        plist = Popen(cmd, shell=False).CommunicateFilter(oper.Output)
-        self._BasicCheck(plist, oper)
+        plist = Popen(cmd, shell=False).communicate_filter(oper.output)
+        self._basic_check(plist, oper)
         self.assertEqual(plist [0], ' '.join(cmd[1:]) + '\r\n')
         self.assertEqual(len(plist [1]), 0)
 
@@ -341,16 +341,17 @@
 
         # this should be interpreted as 'echo' with the other args dropped
         cmd = ['echo', 'test', '>/dev/stderr']
-        plist = Popen(cmd, shell=True).CommunicateFilter(oper.Output)
-        self._BasicCheck(plist, oper)
+        plist = Popen(cmd, shell=True).communicate_filter(oper.output)
+        self._basic_check(plist, oper)
         self.assertEqual(plist [0], '\r\n')
 
     def test_cwd(self):
         """Check we can change directory"""
         for shell in (False, True):
             oper = TestSubprocess.MyOperation()
-            plist = Popen('pwd', shell=shell, cwd='/tmp').CommunicateFilter(oper.Output)
-            self._BasicCheck(plist, oper)
+            plist = Popen('pwd', shell=shell, cwd='/tmp').communicate_filter(
+                oper.output)
+            self._basic_check(plist, oper)
             self.assertEqual(plist [0], '/tmp\r\n')
 
     def test_env(self):
@@ -361,8 +362,8 @@
             if add:
                 env ['FRED'] = 'fred'
             cmd = 'echo $FRED'
-            plist = Popen(cmd, shell=True, env=env).CommunicateFilter(oper.Output)
-            self._BasicCheck(plist, oper)
+            plist = Popen(cmd, shell=True, env=env).communicate_filter(oper.output)
+            self._basic_check(plist, oper)
             self.assertEqual(plist [0], add and 'fred\r\n' or '\r\n')
 
     def test_extra_args(self):
@@ -380,8 +381,8 @@
         prompt = 'What is your name?: '
         cmd = 'echo -n "%s"; read name; echo Hello $name' % prompt
         plist = Popen([cmd], stdin=oper.stdin_read_pipe,
-                shell=True).CommunicateFilter(oper.Output)
-        self._BasicCheck(plist, oper)
+                shell=True).communicate_filter(oper.output)
+        self._basic_check(plist, oper)
         self.assertEqual(len(plist [1]), 0)
         self.assertEqual(plist [0], prompt + 'Hello Flash\r\r\n')
 
@@ -393,16 +394,16 @@
         both_cmds = ''
         for fd in (1, 2):
             both_cmds += cmd % (fd, fd, fd, fd, fd)
-        plist = Popen(both_cmds, shell=True).CommunicateFilter(oper.Output)
-        self._BasicCheck(plist, oper)
+        plist = Popen(both_cmds, shell=True).communicate_filter(oper.output)
+        self._basic_check(plist, oper)
         self.assertEqual(plist [0], 'terminal 1\r\n')
         self.assertEqual(plist [1], 'terminal 2\r\n')
 
         # Now try with PIPE and make sure it is not a terminal
         oper = TestSubprocess.MyOperation()
         plist = Popen(both_cmds, stdout=subprocess.PIPE, stderr=subprocess.PIPE,
-                shell=True).CommunicateFilter(oper.Output)
-        self._BasicCheck(plist, oper)
+                shell=True).communicate_filter(oper.output)
+        self._basic_check(plist, oper)
         self.assertEqual(plist [0], 'not 1\n')
         self.assertEqual(plist [1], 'not 2\n')
 
diff --git a/tools/patman/func_test.py b/tools/patman/func_test.py
index 9f4e03e..59ee90c 100644
--- a/tools/patman/func_test.py
+++ b/tools/patman/func_test.py
@@ -45,7 +45,7 @@
 
     def tearDown(self):
         shutil.rmtree(self.tmpdir)
-        terminal.SetPrintTestMode(False)
+        terminal.set_print_test_mode(False)
 
     @staticmethod
     def _get_path(fname):
@@ -114,7 +114,7 @@
 
         return cover_fname, fname_list
 
-    def testBasic(self):
+    def test_basic(self):
         """Tests the basic flow of patman
 
         This creates a series from some hard-coded patches build from a simple
@@ -208,7 +208,7 @@
             cc_file = series.MakeCcFile(process_tags, cover_fname,
                                         not ignore_bad_tags, add_maintainers,
                                         None)
-            cmd = gitutil.EmailPatches(
+            cmd = gitutil.email_patches(
                 series, cover_fname, args, dry_run, not ignore_bad_tags,
                 cc_file, in_reply_to=in_reply_to, thread=None)
             series.ShowActions(args, cmd, process_tags)
@@ -338,7 +338,7 @@
             text (str): Text to put into the file
         """
         path = os.path.join(self.gitdir, fname)
-        tools.WriteFile(path, text, binary=False)
+        tools.write_file(path, text, binary=False)
         index = self.repo.index
         index.add(fname)
         author = pygit2.Signature('Test user', 'test@email.com')
@@ -455,7 +455,7 @@
         repo.branches.local.create('base', base_target)
         return repo
 
-    def testBranch(self):
+    def test_branch(self):
         """Test creating patches from a branch"""
         repo = self.make_git_tree()
         target = repo.lookup_reference('refs/heads/first')
@@ -466,7 +466,7 @@
             os.chdir(self.gitdir)
 
             # Check that it can detect the current branch
-            self.assertEqual(2, gitutil.CountCommitsToBranch(None))
+            self.assertEqual(2, gitutil.count_commits_to_branch(None))
             col = terminal.Color()
             with capture_sys_output() as _:
                 _, cover_fname, patch_files = control.prepare_patches(
@@ -476,7 +476,7 @@
             self.assertEqual(2, len(patch_files))
 
             # Check that it can detect a different branch
-            self.assertEqual(3, gitutil.CountCommitsToBranch('second'))
+            self.assertEqual(3, gitutil.count_commits_to_branch('second'))
             with capture_sys_output() as _:
                 _, cover_fname, patch_files = control.prepare_patches(
                     col, branch='second', count=-1, start=0, end=0,
@@ -494,7 +494,7 @@
         finally:
             os.chdir(orig_dir)
 
-    def testTags(self):
+    def test_tags(self):
         """Test collection of tags in a patchstream"""
         text = '''This is a patch
 
@@ -508,7 +508,7 @@
             'Reviewed-by': {self.joe, self.mary},
             'Tested-by': {self.leb}})
 
-    def testInvalidTag(self):
+    def test_invalid_tag(self):
         """Test invalid tag in a patchstream"""
         text = '''This is a patch
 
@@ -519,7 +519,7 @@
         self.assertEqual("Line 3: Invalid tag = 'Serie-version: 2'",
                          str(exc.exception))
 
-    def testMissingEnd(self):
+    def test_missing_end(self):
         """Test a missing END tag"""
         text = '''This is a patch
 
@@ -532,7 +532,7 @@
         self.assertEqual(["Missing 'END' in section 'cover'"],
                          pstrm.commit.warn)
 
-    def testMissingBlankLine(self):
+    def test_missing_blank_line(self):
         """Test a missing blank line after a tag"""
         text = '''This is a patch
 
@@ -545,7 +545,7 @@
         self.assertEqual(["Missing 'blank line' in section 'Series-changes'"],
                          pstrm.commit.warn)
 
-    def testInvalidCommitTag(self):
+    def test_invalid_commit_tag(self):
         """Test an invalid Commit-xxx tag"""
         text = '''This is a patch
 
@@ -554,7 +554,7 @@
         pstrm = PatchStream.process_text(text)
         self.assertEqual(["Line 3: Ignoring Commit-fred"], pstrm.commit.warn)
 
-    def testSelfTest(self):
+    def test_self_test(self):
         """Test a tested by tag by this user"""
         test_line = 'Tested-by: %s@napier.com' % os.getenv('USER')
         text = '''This is a patch
@@ -564,7 +564,7 @@
         pstrm = PatchStream.process_text(text)
         self.assertEqual(["Ignoring '%s'" % test_line], pstrm.commit.warn)
 
-    def testSpaceBeforeTab(self):
+    def test_space_before_tab(self):
         """Test a space before a tab"""
         text = '''This is a patch
 
@@ -573,7 +573,7 @@
         pstrm = PatchStream.process_text(text)
         self.assertEqual(["Line 3/0 has space before tab"], pstrm.commit.warn)
 
-    def testLinesAfterTest(self):
+    def test_lines_after_test(self):
         """Test detecting lines after TEST= line"""
         text = '''This is a patch
 
@@ -584,7 +584,7 @@
         pstrm = PatchStream.process_text(text)
         self.assertEqual(["Found 2 lines after TEST="], pstrm.commit.warn)
 
-    def testBlankLineAtEnd(self):
+    def test_blank_line_at_end(self):
         """Test detecting a blank line at the end of a file"""
         text = '''This is a patch
 
@@ -611,7 +611,7 @@
             ["Found possible blank line(s) at end of file 'lib/fdtdec.c'"],
             pstrm.commit.warn)
 
-    def testNoUpstream(self):
+    def test_no_upstream(self):
         """Test CountCommitsToBranch when there is no upstream"""
         repo = self.make_git_tree()
         target = repo.lookup_reference('refs/heads/base')
@@ -622,7 +622,7 @@
             orig_dir = os.getcwd()
             os.chdir(self.gitdir)
             with self.assertRaises(ValueError) as exc:
-                gitutil.CountCommitsToBranch(None)
+                gitutil.count_commits_to_branch(None)
             self.assertIn(
                 "Failed to determine upstream: fatal: no upstream configured for branch 'base'",
                 str(exc.exception))
@@ -648,7 +648,7 @@
                     {'id': '1', 'name': 'Some patch'}]}
         raise ValueError('Fake Patchwork does not understand: %s' % subpath)
 
-    def testStatusMismatch(self):
+    def test_status_mismatch(self):
         """Test Patchwork patches not matching the series"""
         series = Series()
 
@@ -657,7 +657,7 @@
         self.assertIn('Warning: Patchwork reports 1 patches, series has 0',
                       err.getvalue())
 
-    def testStatusReadPatch(self):
+    def test_status_read_patch(self):
         """Test handling a single patch in Patchwork"""
         series = Series()
         series.commits = [Commit('abcd')]
@@ -669,7 +669,7 @@
         self.assertEqual('1', patch.id)
         self.assertEqual('Some patch', patch.raw_subject)
 
-    def testParseSubject(self):
+    def test_parse_subject(self):
         """Test parsing of the patch subject"""
         patch = status.Patch('1')
 
@@ -731,7 +731,7 @@
         self.assertEqual('RESEND', patch.prefix)
         self.assertEqual(None, patch.version)
 
-    def testCompareSeries(self):
+    def test_compare_series(self):
         """Test operation of compare_with_series()"""
         commit1 = Commit('abcd')
         commit1.subject = 'Subject 1'
@@ -833,7 +833,7 @@
             return patch.comments
         raise ValueError('Fake Patchwork does not understand: %s' % subpath)
 
-    def testFindNewResponses(self):
+    def test_find_new_responses(self):
         """Test operation of find_new_responses()"""
         commit1 = Commit('abcd')
         commit1.subject = 'Subject 1'
@@ -907,10 +907,10 @@
 
         series = Series()
         series.commits = [commit1, commit2]
-        terminal.SetPrintTestMode()
+        terminal.set_print_test_mode()
         status.check_patchwork_status(series, '1234', None, None, False, False,
                                       None, self._fake_patchwork2)
-        lines = iter(terminal.GetPrintTestLines())
+        lines = iter(terminal.get_print_test_lines())
         col = terminal.Color()
         self.assertEqual(terminal.PrintLine('  1 Subject 1', col.BLUE),
                          next(lines))
@@ -971,7 +971,7 @@
             return patch.comments
         raise ValueError('Fake Patchwork does not understand: %s' % subpath)
 
-    def testCreateBranch(self):
+    def test_create_branch(self):
         """Test operation of create_branch()"""
         repo = self.make_git_tree()
         branch = 'first'
@@ -1021,11 +1021,11 @@
         # 4 responses added from patchwork into new branch 'first2'
         # <unittest.result.TestResult run=8 errors=0 failures=0>
 
-        terminal.SetPrintTestMode()
+        terminal.set_print_test_mode()
         status.check_patchwork_status(series, '1234', branch, dest_branch,
                                       False, False, None, self._fake_patchwork3,
                                       repo)
-        lines = terminal.GetPrintTestLines()
+        lines = terminal.get_print_test_lines()
         self.assertEqual(12, len(lines))
         self.assertEqual(
             "4 responses added from patchwork into new branch 'first2'",
@@ -1058,7 +1058,7 @@
         self.assertEqual('Reviewed-by: %s' % self.mary, next(lines))
         self.assertEqual('Tested-by: %s' % self.leb, next(lines))
 
-    def testParseSnippets(self):
+    def test_parse_snippets(self):
         """Test parsing of review snippets"""
         text = '''Hi Fred,
 
@@ -1088,7 +1088,7 @@
 
 And another comment
 
-> @@ -153,8 +143,13 @@ def CheckPatch(fname, show_types=False):
+> @@ -153,8 +143,13 @@ def check_patch(fname, show_types=False):
 >  further down on the file
 >  and more code
 > +Addition here
@@ -1131,7 +1131,7 @@
               '> Code line 7', '> Code line 8', '> Code line 9',
               'And another comment'],
              ['> File: file.c',
-              '> Line: 153 / 143: def CheckPatch(fname, show_types=False):',
+              '> Line: 153 / 143: def check_patch(fname, show_types=False):',
               '>  and more code', '> +Addition here', '> +Another addition here',
               '>  codey', '>  more codey', 'and another thing in same file'],
              ['> File: file.c', '> Line: 253 / 243',
@@ -1141,7 +1141,7 @@
               'line2', 'line3', 'line4', 'line5', 'line6', 'line7', 'line8']],
             pstrm.snippets)
 
-    def testReviewSnippets(self):
+    def test_review_snippets(self):
         """Test showing of review snippets"""
         def _to_submitter(who):
             m_who = re.match('(.*) <(.*)>', who)
@@ -1196,7 +1196,7 @@
 > +    def __str__(self):
 > +        return self.subject
 > +
->      def AddChange(self, version, info):
+>      def add_change(self, version, info):
 >          """Add a new change line to the change list for a version.
 >
 A comment
@@ -1223,10 +1223,10 @@
 
         series = Series()
         series.commits = [commit1, commit2]
-        terminal.SetPrintTestMode()
+        terminal.set_print_test_mode()
         status.check_patchwork_status(series, '1234', None, None, False, True,
                                       None, self._fake_patchwork2)
-        lines = iter(terminal.GetPrintTestLines())
+        lines = iter(terminal.get_print_test_lines())
         col = terminal.Color()
         self.assertEqual(terminal.PrintLine('  1 Subject 1', col.BLUE),
                          next(lines))
@@ -1280,7 +1280,7 @@
         self.assertEqual(terminal.PrintLine(
             '    > +', col.MAGENTA), next(lines))
         self.assertEqual(
-            terminal.PrintLine('    >      def AddChange(self, version, info):',
+            terminal.PrintLine('    >      def add_change(self, version, info):',
                                col.MAGENTA),
             next(lines))
         self.assertEqual(terminal.PrintLine(
@@ -1296,7 +1296,7 @@
             '4 new responses available in patchwork (use -d to write them to a new branch)',
             None), next(lines))
 
-    def testInsertTags(self):
+    def test_insert_tags(self):
         """Test inserting of review tags"""
         msg = '''first line
 second line.'''
diff --git a/tools/patman/get_maintainer.py b/tools/patman/get_maintainer.py
index af4ba15..e1d15ff 100644
--- a/tools/patman/get_maintainer.py
+++ b/tools/patman/get_maintainer.py
@@ -6,7 +6,7 @@
 
 from patman import command
 
-def FindGetMaintainer(try_list):
+def find_get_maintainer(try_list):
     """Look for the get_maintainer.pl script.
 
     Args:
@@ -23,7 +23,7 @@
 
     return None
 
-def GetMaintainer(dir_list, fname, verbose=False):
+def get_maintainer(dir_list, fname, verbose=False):
     """Run get_maintainer.pl on a file if we find it.
 
     We look for get_maintainer.pl in the 'scripts' directory at the top of
@@ -37,12 +37,12 @@
     Returns:
         A list of email addresses to CC to.
     """
-    get_maintainer = FindGetMaintainer(dir_list)
+    get_maintainer = find_get_maintainer(dir_list)
     if not get_maintainer:
         if verbose:
             print("WARNING: Couldn't find get_maintainer.pl")
         return []
 
-    stdout = command.Output(get_maintainer, '--norolestats', fname)
+    stdout = command.output(get_maintainer, '--norolestats', fname)
     lines = stdout.splitlines()
     return [ x.replace('"', '') for x in lines ]
diff --git a/tools/patman/gitutil.py b/tools/patman/gitutil.py
index e1ef96d..ceaf2ce 100644
--- a/tools/patman/gitutil.py
+++ b/tools/patman/gitutil.py
@@ -12,10 +12,10 @@
 from patman import terminal
 from patman import tools
 
-# True to use --no-decorate - we check this in Setup()
+# True to use --no-decorate - we check this in setup()
 use_no_decorate = True
 
-def LogCmd(commit_range, git_dir=None, oneline=False, reverse=False,
+def log_cmd(commit_range, git_dir=None, oneline=False, reverse=False,
            count=None):
     """Create a command to perform a 'git log'
 
@@ -49,7 +49,7 @@
     cmd.append('--')
     return cmd
 
-def CountCommitsToBranch(branch):
+def count_commits_to_branch(branch):
     """Returns number of commits between HEAD and the tracking branch.
 
     This looks back to the tracking branch and works out the number of commits
@@ -62,12 +62,12 @@
         Number of patches that exist on top of the branch
     """
     if branch:
-        us, msg = GetUpstream('.git', branch)
+        us, msg = get_upstream('.git', branch)
         rev_range = '%s..%s' % (us, branch)
     else:
         rev_range = '@{upstream}..'
-    pipe = [LogCmd(rev_range, oneline=True)]
-    result = command.RunPipe(pipe, capture=True, capture_stderr=True,
+    pipe = [log_cmd(rev_range, oneline=True)]
+    result = command.run_pipe(pipe, capture=True, capture_stderr=True,
                              oneline=True, raise_on_error=False)
     if result.return_code:
         raise ValueError('Failed to determine upstream: %s' %
@@ -75,7 +75,7 @@
     patch_count = len(result.stdout.splitlines())
     return patch_count
 
-def NameRevision(commit_hash):
+def name_revision(commit_hash):
     """Gets the revision name for a commit
 
     Args:
@@ -85,13 +85,13 @@
         Name of revision, if any, else None
     """
     pipe = ['git', 'name-rev', commit_hash]
-    stdout = command.RunPipe([pipe], capture=True, oneline=True).stdout
+    stdout = command.run_pipe([pipe], capture=True, oneline=True).stdout
 
     # We expect a commit, a space, then a revision name
     name = stdout.split(' ')[1].strip()
     return name
 
-def GuessUpstream(git_dir, branch):
+def guess_upstream(git_dir, branch):
     """Tries to guess the upstream for a branch
 
     This lists out top commits on a branch and tries to find a suitable
@@ -107,21 +107,21 @@
             Name of upstream branch (e.g. 'upstream/master') or None if none
             Warning/error message, or None if none
     """
-    pipe = [LogCmd(branch, git_dir=git_dir, oneline=True, count=100)]
-    result = command.RunPipe(pipe, capture=True, capture_stderr=True,
+    pipe = [log_cmd(branch, git_dir=git_dir, oneline=True, count=100)]
+    result = command.run_pipe(pipe, capture=True, capture_stderr=True,
                              raise_on_error=False)
     if result.return_code:
         return None, "Branch '%s' not found" % branch
     for line in result.stdout.splitlines()[1:]:
         commit_hash = line.split(' ')[0]
-        name = NameRevision(commit_hash)
+        name = name_revision(commit_hash)
         if '~' not in name and '^' not in name:
             if name.startswith('remotes/'):
                 name = name[8:]
             return name, "Guessing upstream as '%s'" % name
     return None, "Cannot find a suitable upstream for branch '%s'" % branch
 
-def GetUpstream(git_dir, branch):
+def get_upstream(git_dir, branch):
     """Returns the name of the upstream for a branch
 
     Args:
@@ -134,12 +134,12 @@
             Warning/error message, or None if none
     """
     try:
-        remote = command.OutputOneLine('git', '--git-dir', git_dir, 'config',
+        remote = command.output_one_line('git', '--git-dir', git_dir, 'config',
                                        'branch.%s.remote' % branch)
-        merge = command.OutputOneLine('git', '--git-dir', git_dir, 'config',
+        merge = command.output_one_line('git', '--git-dir', git_dir, 'config',
                                       'branch.%s.merge' % branch)
     except:
-        upstream, msg = GuessUpstream(git_dir, branch)
+        upstream, msg = guess_upstream(git_dir, branch)
         return upstream, msg
 
     if remote == '.':
@@ -152,7 +152,7 @@
                 "'%s' remote='%s', merge='%s'" % (branch, remote, merge))
 
 
-def GetRangeInBranch(git_dir, branch, include_upstream=False):
+def get_range_in_branch(git_dir, branch, include_upstream=False):
     """Returns an expression for the commits in the given branch.
 
     Args:
@@ -162,13 +162,13 @@
         Expression in the form 'upstream..branch' which can be used to
         access the commits. If the branch does not exist, returns None.
     """
-    upstream, msg = GetUpstream(git_dir, branch)
+    upstream, msg = get_upstream(git_dir, branch)
     if not upstream:
         return None, msg
     rstr = '%s%s..%s' % (upstream, '~' if include_upstream else '', branch)
     return rstr, msg
 
-def CountCommitsInRange(git_dir, range_expr):
+def count_commits_in_range(git_dir, range_expr):
     """Returns the number of commits in the given range.
 
     Args:
@@ -178,15 +178,15 @@
         Number of patches that exist in the supplied range or None if none
         were found
     """
-    pipe = [LogCmd(range_expr, git_dir=git_dir, oneline=True)]
-    result = command.RunPipe(pipe, capture=True, capture_stderr=True,
+    pipe = [log_cmd(range_expr, git_dir=git_dir, oneline=True)]
+    result = command.run_pipe(pipe, capture=True, capture_stderr=True,
                              raise_on_error=False)
     if result.return_code:
         return None, "Range '%s' not found or is invalid" % range_expr
     patch_count = len(result.stdout.splitlines())
     return patch_count, None
 
-def CountCommitsInBranch(git_dir, branch, include_upstream=False):
+def count_commits_in_branch(git_dir, branch, include_upstream=False):
     """Returns the number of commits in the given branch.
 
     Args:
@@ -196,12 +196,12 @@
         Number of patches that exist on top of the branch, or None if the
         branch does not exist.
     """
-    range_expr, msg = GetRangeInBranch(git_dir, branch, include_upstream)
+    range_expr, msg = get_range_in_branch(git_dir, branch, include_upstream)
     if not range_expr:
         return None, msg
-    return CountCommitsInRange(git_dir, range_expr)
+    return count_commits_in_range(git_dir, range_expr)
 
-def CountCommits(commit_range):
+def count_commits(commit_range):
     """Returns the number of commits in the given range.
 
     Args:
@@ -209,13 +209,13 @@
     Return:
         Number of patches that exist on top of the branch
     """
-    pipe = [LogCmd(commit_range, oneline=True),
+    pipe = [log_cmd(commit_range, oneline=True),
             ['wc', '-l']]
-    stdout = command.RunPipe(pipe, capture=True, oneline=True).stdout
+    stdout = command.run_pipe(pipe, capture=True, oneline=True).stdout
     patch_count = int(stdout)
     return patch_count
 
-def Checkout(commit_hash, git_dir=None, work_tree=None, force=False):
+def checkout(commit_hash, git_dir=None, work_tree=None, force=False):
     """Checkout the selected commit for this build
 
     Args:
@@ -230,24 +230,24 @@
     if force:
         pipe.append('-f')
     pipe.append(commit_hash)
-    result = command.RunPipe([pipe], capture=True, raise_on_error=False,
+    result = command.run_pipe([pipe], capture=True, raise_on_error=False,
                              capture_stderr=True)
     if result.return_code != 0:
         raise OSError('git checkout (%s): %s' % (pipe, result.stderr))
 
-def Clone(git_dir, output_dir):
+def clone(git_dir, output_dir):
     """Checkout the selected commit for this build
 
     Args:
         commit_hash: Commit hash to check out
     """
     pipe = ['git', 'clone', git_dir, '.']
-    result = command.RunPipe([pipe], capture=True, cwd=output_dir,
+    result = command.run_pipe([pipe], capture=True, cwd=output_dir,
                              capture_stderr=True)
     if result.return_code != 0:
         raise OSError('git clone: %s' % result.stderr)
 
-def Fetch(git_dir=None, work_tree=None):
+def fetch(git_dir=None, work_tree=None):
     """Fetch from the origin repo
 
     Args:
@@ -259,11 +259,11 @@
     if work_tree:
         pipe.extend(['--work-tree', work_tree])
     pipe.append('fetch')
-    result = command.RunPipe([pipe], capture=True, capture_stderr=True)
+    result = command.run_pipe([pipe], capture=True, capture_stderr=True)
     if result.return_code != 0:
         raise OSError('git fetch: %s' % result.stderr)
 
-def CheckWorktreeIsAvailable(git_dir):
+def check_worktree_is_available(git_dir):
     """Check if git-worktree functionality is available
 
     Args:
@@ -273,11 +273,11 @@
         True if git-worktree commands will work, False otherwise.
     """
     pipe = ['git', '--git-dir', git_dir, 'worktree', 'list']
-    result = command.RunPipe([pipe], capture=True, capture_stderr=True,
+    result = command.run_pipe([pipe], capture=True, capture_stderr=True,
                              raise_on_error=False)
     return result.return_code == 0
 
-def AddWorktree(git_dir, output_dir, commit_hash=None):
+def add_worktree(git_dir, output_dir, commit_hash=None):
     """Create and checkout a new git worktree for this build
 
     Args:
@@ -289,23 +289,23 @@
     pipe = ['git', '--git-dir', git_dir, 'worktree', 'add', '.', '--detach']
     if commit_hash:
         pipe.append(commit_hash)
-    result = command.RunPipe([pipe], capture=True, cwd=output_dir,
+    result = command.run_pipe([pipe], capture=True, cwd=output_dir,
                              capture_stderr=True)
     if result.return_code != 0:
         raise OSError('git worktree add: %s' % result.stderr)
 
-def PruneWorktrees(git_dir):
+def prune_worktrees(git_dir):
     """Remove administrative files for deleted worktrees
 
     Args:
         git_dir: The repository whose deleted worktrees should be pruned
     """
     pipe = ['git', '--git-dir', git_dir, 'worktree', 'prune']
-    result = command.RunPipe([pipe], capture=True, capture_stderr=True)
+    result = command.run_pipe([pipe], capture=True, capture_stderr=True)
     if result.return_code != 0:
         raise OSError('git worktree prune: %s' % result.stderr)
 
-def CreatePatches(branch, start, count, ignore_binary, series, signoff = True):
+def create_patches(branch, start, count, ignore_binary, series, signoff = True):
     """Create a series of patches from the top of the current branch.
 
     The patch files are written to the current directory using
@@ -336,7 +336,7 @@
     brname = branch or 'HEAD'
     cmd += ['%s~%d..%s~%d' % (brname, start + count, brname, start)]
 
-    stdout = command.RunList(cmd)
+    stdout = command.run_list(cmd)
     files = stdout.splitlines()
 
     # We have an extra file if there is a cover letter
@@ -345,7 +345,7 @@
     else:
        return None, files
 
-def BuildEmailList(in_list, tag=None, alias=None, warn_on_error=True):
+def build_email_list(in_list, tag=None, alias=None, warn_on_error=True):
     """Build a list of email addresses based on an input list.
 
     Takes a list of email addresses and aliases, and turns this into a list
@@ -371,18 +371,18 @@
     >>> alias['mary'] = ['Mary Poppins <m.poppins@cloud.net>']
     >>> alias['boys'] = ['fred', ' john']
     >>> alias['all'] = ['fred ', 'john', '   mary   ']
-    >>> BuildEmailList(['john', 'mary'], None, alias)
+    >>> build_email_list(['john', 'mary'], None, alias)
     ['j.bloggs@napier.co.nz', 'Mary Poppins <m.poppins@cloud.net>']
-    >>> BuildEmailList(['john', 'mary'], '--to', alias)
+    >>> build_email_list(['john', 'mary'], '--to', alias)
     ['--to "j.bloggs@napier.co.nz"', \
 '--to "Mary Poppins <m.poppins@cloud.net>"']
-    >>> BuildEmailList(['john', 'mary'], 'Cc', alias)
+    >>> build_email_list(['john', 'mary'], 'Cc', alias)
     ['Cc j.bloggs@napier.co.nz', 'Cc Mary Poppins <m.poppins@cloud.net>']
     """
     quote = '"' if tag and tag[0] == '-' else ''
     raw = []
     for item in in_list:
-        raw += LookupEmail(item, alias, warn_on_error=warn_on_error)
+        raw += lookup_email(item, alias, warn_on_error=warn_on_error)
     result = []
     for item in raw:
         if not item in result:
@@ -391,20 +391,20 @@
         return ['%s %s%s%s' % (tag, quote, email, quote) for email in result]
     return result
 
-def CheckSuppressCCConfig():
+def check_suppress_cc_config():
     """Check if sendemail.suppresscc is configured correctly.
 
     Returns:
         True if the option is configured correctly, False otherwise.
     """
-    suppresscc = command.OutputOneLine('git', 'config', 'sendemail.suppresscc',
+    suppresscc = command.output_one_line('git', 'config', 'sendemail.suppresscc',
                                        raise_on_error=False)
 
     # Other settings should be fine.
     if suppresscc == 'all' or suppresscc == 'cccmd':
         col = terminal.Color()
 
-        print((col.Color(col.RED, "error") +
+        print((col.build(col.RED, "error") +
             ": git config sendemail.suppresscc set to %s\n"  % (suppresscc)) +
             "  patman needs --cc-cmd to be run to set the cc list.\n" +
             "  Please run:\n" +
@@ -416,7 +416,7 @@
 
     return True
 
-def EmailPatches(series, cover_fname, args, dry_run, warn_on_error, cc_fname,
+def email_patches(series, cover_fname, args, dry_run, warn_on_error, cc_fname,
         self_only=False, alias=None, in_reply_to=None, thread=False,
         smtp_server=None):
     """Email a patch series.
@@ -453,20 +453,20 @@
     >>> series = {}
     >>> series['to'] = ['fred']
     >>> series['cc'] = ['mary']
-    >>> EmailPatches(series, 'cover', ['p1', 'p2'], True, True, 'cc-fname', \
+    >>> email_patches(series, 'cover', ['p1', 'p2'], True, True, 'cc-fname', \
             False, alias)
     'git send-email --annotate --to "f.bloggs@napier.co.nz" --cc \
 "m.poppins@cloud.net" --cc-cmd "./patman send --cc-cmd cc-fname" cover p1 p2'
-    >>> EmailPatches(series, None, ['p1'], True, True, 'cc-fname', False, \
+    >>> email_patches(series, None, ['p1'], True, True, 'cc-fname', False, \
             alias)
     'git send-email --annotate --to "f.bloggs@napier.co.nz" --cc \
 "m.poppins@cloud.net" --cc-cmd "./patman send --cc-cmd cc-fname" p1'
     >>> series['cc'] = ['all']
-    >>> EmailPatches(series, 'cover', ['p1', 'p2'], True, True, 'cc-fname', \
+    >>> email_patches(series, 'cover', ['p1', 'p2'], True, True, 'cc-fname', \
             True, alias)
     'git send-email --annotate --to "this-is-me@me.com" --cc-cmd "./patman \
 send --cc-cmd cc-fname" cover p1 p2'
-    >>> EmailPatches(series, 'cover', ['p1', 'p2'], True, True, 'cc-fname', \
+    >>> email_patches(series, 'cover', ['p1', 'p2'], True, True, 'cc-fname', \
             False, alias)
     'git send-email --annotate --to "f.bloggs@napier.co.nz" --cc \
 "f.bloggs@napier.co.nz" --cc "j.bloggs@napier.co.nz" --cc \
@@ -475,9 +475,9 @@
     # Restore argv[0] since we clobbered it.
     >>> sys.argv[0] = _old_argv0
     """
-    to = BuildEmailList(series.get('to'), '--to', alias, warn_on_error)
+    to = build_email_list(series.get('to'), '--to', alias, warn_on_error)
     if not to:
-        git_config_to = command.Output('git', 'config', 'sendemail.to',
+        git_config_to = command.output('git', 'config', 'sendemail.to',
                                        raise_on_error=False)
         if not git_config_to:
             print("No recipient.\n"
@@ -486,10 +486,10 @@
                   "Or do something like this\n"
                   "git config sendemail.to u-boot@lists.denx.de")
             return
-    cc = BuildEmailList(list(set(series.get('cc')) - set(series.get('to'))),
+    cc = build_email_list(list(set(series.get('cc')) - set(series.get('to'))),
                         '--cc', alias, warn_on_error)
     if self_only:
-        to = BuildEmailList([os.getenv('USER')], '--to', alias, warn_on_error)
+        to = build_email_list([os.getenv('USER')], '--to', alias, warn_on_error)
         cc = []
     cmd = ['git', 'send-email', '--annotate']
     if smtp_server:
@@ -511,7 +511,7 @@
     return cmdstr
 
 
-def LookupEmail(lookup_name, alias=None, warn_on_error=True, level=0):
+def lookup_email(lookup_name, alias=None, warn_on_error=True, level=0):
     """If an email address is an alias, look it up and return the full name
 
     TODO: Why not just use git's own alias feature?
@@ -538,25 +538,25 @@
     >>> alias['all'] = ['fred ', 'john', '   mary   ']
     >>> alias['loop'] = ['other', 'john', '   mary   ']
     >>> alias['other'] = ['loop', 'john', '   mary   ']
-    >>> LookupEmail('mary', alias)
+    >>> lookup_email('mary', alias)
     ['m.poppins@cloud.net']
-    >>> LookupEmail('arthur.wellesley@howe.ro.uk', alias)
+    >>> lookup_email('arthur.wellesley@howe.ro.uk', alias)
     ['arthur.wellesley@howe.ro.uk']
-    >>> LookupEmail('boys', alias)
+    >>> lookup_email('boys', alias)
     ['f.bloggs@napier.co.nz', 'j.bloggs@napier.co.nz']
-    >>> LookupEmail('all', alias)
+    >>> lookup_email('all', alias)
     ['f.bloggs@napier.co.nz', 'j.bloggs@napier.co.nz', 'm.poppins@cloud.net']
-    >>> LookupEmail('odd', alias)
+    >>> lookup_email('odd', alias)
     Alias 'odd' not found
     []
-    >>> LookupEmail('loop', alias)
+    >>> lookup_email('loop', alias)
     Traceback (most recent call last):
     ...
     OSError: Recursive email alias at 'other'
-    >>> LookupEmail('odd', alias, warn_on_error=False)
+    >>> lookup_email('odd', alias, warn_on_error=False)
     []
     >>> # In this case the loop part will effectively be ignored.
-    >>> LookupEmail('loop', alias, warn_on_error=False)
+    >>> lookup_email('loop', alias, warn_on_error=False)
     Recursive email alias at 'other'
     Recursive email alias at 'john'
     Recursive email alias at 'mary'
@@ -577,24 +577,24 @@
         if warn_on_error:
             raise OSError(msg)
         else:
-            print(col.Color(col.RED, msg))
+            print(col.build(col.RED, msg))
             return out_list
 
     if lookup_name:
         if not lookup_name in alias:
             msg = "Alias '%s' not found" % lookup_name
             if warn_on_error:
-                print(col.Color(col.RED, msg))
+                print(col.build(col.RED, msg))
             return out_list
         for item in alias[lookup_name]:
-            todo = LookupEmail(item, alias, warn_on_error, level + 1)
+            todo = lookup_email(item, alias, warn_on_error, level + 1)
             for new_item in todo:
                 if not new_item in out_list:
                     out_list.append(new_item)
 
     return out_list
 
-def GetTopLevel():
+def get_top_level():
     """Return name of top-level directory for this git repo.
 
     Returns:
@@ -603,18 +603,18 @@
     This test makes sure that we are running tests in the right subdir
 
     >>> os.path.realpath(os.path.dirname(__file__)) == \
-            os.path.join(GetTopLevel(), 'tools', 'patman')
+            os.path.join(get_top_level(), 'tools', 'patman')
     True
     """
-    return command.OutputOneLine('git', 'rev-parse', '--show-toplevel')
+    return command.output_one_line('git', 'rev-parse', '--show-toplevel')
 
-def GetAliasFile():
+def get_alias_file():
     """Gets the name of the git alias file.
 
     Returns:
         Filename of git alias file, or None if none
     """
-    fname = command.OutputOneLine('git', 'config', 'sendemail.aliasesfile',
+    fname = command.output_one_line('git', 'config', 'sendemail.aliasesfile',
             raise_on_error=False)
     if not fname:
         return None
@@ -623,56 +623,56 @@
     if os.path.isabs(fname):
         return fname
 
-    return os.path.join(GetTopLevel(), fname)
+    return os.path.join(get_top_level(), fname)
 
-def GetDefaultUserName():
+def get_default_user_name():
     """Gets the user.name from .gitconfig file.
 
     Returns:
         User name found in .gitconfig file, or None if none
     """
-    uname = command.OutputOneLine('git', 'config', '--global', 'user.name')
+    uname = command.output_one_line('git', 'config', '--global', 'user.name')
     return uname
 
-def GetDefaultUserEmail():
+def get_default_user_email():
     """Gets the user.email from the global .gitconfig file.
 
     Returns:
         User's email found in .gitconfig file, or None if none
     """
-    uemail = command.OutputOneLine('git', 'config', '--global', 'user.email')
+    uemail = command.output_one_line('git', 'config', '--global', 'user.email')
     return uemail
 
-def GetDefaultSubjectPrefix():
+def get_default_subject_prefix():
     """Gets the format.subjectprefix from local .git/config file.
 
     Returns:
         Subject prefix found in local .git/config file, or None if none
     """
-    sub_prefix = command.OutputOneLine('git', 'config', 'format.subjectprefix',
+    sub_prefix = command.output_one_line('git', 'config', 'format.subjectprefix',
                  raise_on_error=False)
 
     return sub_prefix
 
-def Setup():
+def setup():
     """Set up git utils, by reading the alias files."""
     # Check for a git alias file also
     global use_no_decorate
 
-    alias_fname = GetAliasFile()
+    alias_fname = get_alias_file()
     if alias_fname:
         settings.ReadGitAliases(alias_fname)
-    cmd = LogCmd(None, count=0)
-    use_no_decorate = (command.RunPipe([cmd], raise_on_error=False)
+    cmd = log_cmd(None, count=0)
+    use_no_decorate = (command.run_pipe([cmd], raise_on_error=False)
                        .return_code == 0)
 
-def GetHead():
+def get_head():
     """Get the hash of the current HEAD
 
     Returns:
         Hash of HEAD
     """
-    return command.OutputOneLine('git', 'show', '-s', '--pretty=format:%H')
+    return command.output_one_line('git', 'show', '-s', '--pretty=format:%H')
 
 if __name__ == "__main__":
     import doctest
diff --git a/tools/patman/main.py b/tools/patman/main.py
index e5be28e..2a2ac45 100755
--- a/tools/patman/main.py
+++ b/tools/patman/main.py
@@ -42,7 +42,7 @@
     help='Commits to skip at end of patch list')
 parser.add_argument('-D', '--debug', action='store_true',
     help='Enabling debugging (provides a full traceback on error)')
-parser.add_argument('-p', '--project', default=project.DetectProject(),
+parser.add_argument('-p', '--project', default=project.detect_project(),
                     help="Project name; affects default option values and "
                     "aliases [default: %(default)s]")
 parser.add_argument('-P', '--patchwork-url',
@@ -134,25 +134,13 @@
     import doctest
     from patman import func_test
 
-    sys.argv = [sys.argv[0]]
     result = unittest.TestResult()
-    suite = unittest.TestSuite()
-    loader = unittest.TestLoader()
-    for module in (test_checkpatch.TestPatch, func_test.TestFunctional):
-        if args.testname:
-            try:
-                suite.addTests(loader.loadTestsFromName(args.testname, module))
-            except AttributeError:
-                continue
-        else:
-            suite.addTests(loader.loadTestsFromTestCase(module))
-    suite.run(result)
+    test_util.run_test_suites(
+        result, False, False, False, None, None, None,
+        [test_checkpatch.TestPatch, func_test.TestFunctional,
+         'gitutil', 'settings', 'terminal'])
 
-    for module in ['gitutil', 'settings', 'terminal']:
-        suite = doctest.DocTestSuite(module)
-        suite.run(result)
-
-    sys.exit(test_util.ReportResult('patman', args.testname, result))
+    sys.exit(test_util.report_result('patman', args.testname, result))
 
 # Process commits, produce patches files, check them, email them
 elif args.cmd == 'send':
@@ -171,7 +159,7 @@
         fd.close()
 
     elif args.full_help:
-        tools.PrintFullHelp(
+        tools.print_full_help(
             os.path.join(os.path.dirname(os.path.realpath(sys.argv[0])), 'README')
         )
 
@@ -189,7 +177,7 @@
                                  args.dest_branch, args.force,
                                  args.show_comments, args.patchwork_url)
     except Exception as e:
-        terminal.Print('patman: %s: %s' % (type(e).__name__, e),
+        terminal.tprint('patman: %s: %s' % (type(e).__name__, e),
                        colour=terminal.Color.RED)
         if args.debug:
             print()
diff --git a/tools/patman/patchstream.py b/tools/patman/patchstream.py
index 1da9d53..9b32fd4 100644
--- a/tools/patman/patchstream.py
+++ b/tools/patman/patchstream.py
@@ -180,7 +180,7 @@
             who (str): Person who gave that rtag, e.g.
                  'Fred Bloggs <fred@bloggs.org>'
         """
-        self.commit.AddRtag(rtag_type, who)
+        self.commit.add_rtag(rtag_type, who)
 
     def _close_commit(self):
         """Save the current commit into our commit list, and reset our state"""
@@ -230,7 +230,7 @@
         elif self.in_change == 'Cover':
             self.series.AddChange(self.change_version, None, change)
         elif self.in_change == 'Commit':
-            self.commit.AddChange(self.change_version, change)
+            self.commit.add_change(self.change_version, change)
         self.change_lines = []
 
     def _finalise_snippet(self):
@@ -494,14 +494,14 @@
                     who.find(os.getenv('USER') + '@') != -1):
                 self._add_warn("Ignoring '%s'" % line)
             elif rtag_type == 'Patch-cc':
-                self.commit.AddCc(who.split(','))
+                self.commit.add_cc(who.split(','))
             else:
                 out = [line]
 
         # Suppress duplicate signoffs
         elif signoff_match:
             if (self.is_log or not self.commit or
-                    self.commit.CheckDuplicateSignoff(signoff_match.group(1))):
+                    self.commit.check_duplicate_signoff(signoff_match.group(1))):
                 out = [line]
 
         # Well that means this is an ordinary line
@@ -698,9 +698,9 @@
     Returns
         str: String containing the contents of the git log
     """
-    params = gitutil.LogCmd(commit_range, reverse=True, count=count,
+    params = gitutil.log_cmd(commit_range, reverse=True, count=count,
                             git_dir=git_dir)
-    return command.RunPipe([params], capture=True).stdout
+    return command.run_pipe([params], capture=True).stdout
 
 def get_metadata_for_list(commit_range, git_dir=None, count=None,
                           series=None, allow_overwrite=False):
diff --git a/tools/patman/project.py b/tools/patman/project.py
index 2dfc303..4459042 100644
--- a/tools/patman/project.py
+++ b/tools/patman/project.py
@@ -6,7 +6,7 @@
 
 from patman import gitutil
 
-def DetectProject():
+def detect_project():
     """Autodetect the name of the current project.
 
     This looks for signature files/directories that are unlikely to exist except
@@ -16,7 +16,7 @@
         The name of the project, like "linux" or "u-boot".  Returns "unknown"
         if we can't detect the project.
     """
-    top_level = gitutil.GetTopLevel()
+    top_level = gitutil.get_top_level()
 
     if os.path.exists(os.path.join(top_level, "include", "u-boot")):
         return "u-boot"
diff --git a/tools/patman/series.py b/tools/patman/series.py
index da734d9..891f278 100644
--- a/tools/patman/series.py
+++ b/tools/patman/series.py
@@ -94,7 +94,7 @@
         Args:
             commit: Commit object to add
         """
-        commit.CheckTags()
+        commit.check_tags()
         self.commits.append(commit)
 
     def ShowActions(self, args, cmd, process_tags):
@@ -105,8 +105,8 @@
             cmd: The git command we would have run
             process_tags: Process tags as if they were aliases
         """
-        to_set = set(gitutil.BuildEmailList(self.to));
-        cc_set = set(gitutil.BuildEmailList(self.cc));
+        to_set = set(gitutil.build_email_list(self.to));
+        cc_set = set(gitutil.build_email_list(self.cc));
 
         col = terminal.Color()
         print('Dry run, so not doing much. But I would do this:')
@@ -118,11 +118,11 @@
         # TODO: Colour the patches according to whether they passed checks
         for upto in range(len(args)):
             commit = self.commits[upto]
-            print(col.Color(col.GREEN, '   %s' % args[upto]))
+            print(col.build(col.GREEN, '   %s' % args[upto]))
             cc_list = list(self._generated_cc[commit.patch])
             for email in sorted(set(cc_list) - to_set - cc_set):
                 if email == None:
-                    email = col.Color(col.YELLOW, "<alias '%s' not found>"
+                    email = col.build(col.YELLOW, "<alias '%s' not found>"
                             % tag)
                 if email:
                     print('      Cc: ', email)
@@ -136,7 +136,7 @@
         print('Postfix:\t ', self.get('postfix'))
         if self.cover:
             print('Cover: %d lines' % len(self.cover))
-            cover_cc = gitutil.BuildEmailList(self.get('cover_cc', ''))
+            cover_cc = gitutil.build_email_list(self.get('cover_cc', ''))
             all_ccs = itertools.chain(cover_cc, *self._generated_cc.values())
             for email in sorted(set(all_ccs) - to_set - cc_set):
                     print('      Cc: ', email)
@@ -227,13 +227,13 @@
                 else:
                     if version > 1:
                         str = 'Change log missing for v%d' % version
-                        print(col.Color(col.RED, str))
+                        print(col.build(col.RED, str))
             for version in changes_copy:
                 str = 'Change log for unknown version v%d' % version
-                print(col.Color(col.RED, str))
+                print(col.build(col.RED, str))
         elif self.changes:
             str = 'Change log exists, but no version is set'
-            print(col.Color(col.RED, str))
+            print(col.build(col.RED, str))
 
     def MakeCcFile(self, process_tags, cover_fname, warn_on_error,
                    add_maintainers, limit):
@@ -261,17 +261,17 @@
         for commit in self.commits:
             cc = []
             if process_tags:
-                cc += gitutil.BuildEmailList(commit.tags,
+                cc += gitutil.build_email_list(commit.tags,
                                                warn_on_error=warn_on_error)
-            cc += gitutil.BuildEmailList(commit.cc_list,
+            cc += gitutil.build_email_list(commit.cc_list,
                                            warn_on_error=warn_on_error)
             if type(add_maintainers) == type(cc):
                 cc += add_maintainers
             elif add_maintainers:
-                dir_list = [os.path.join(gitutil.GetTopLevel(), 'scripts')]
-                cc += get_maintainer.GetMaintainer(dir_list, commit.patch)
+                dir_list = [os.path.join(gitutil.get_top_level(), 'scripts')]
+                cc += get_maintainer.get_maintainer(dir_list, commit.patch)
             for x in set(cc) & set(settings.bounces):
-                print(col.Color(col.YELLOW, 'Skipping "%s"' % x))
+                print(col.build(col.YELLOW, 'Skipping "%s"' % x))
             cc = list(set(cc) - set(settings.bounces))
             if limit is not None:
                 cc = cc[:limit]
@@ -280,7 +280,7 @@
             self._generated_cc[commit.patch] = cc
 
         if cover_fname:
-            cover_cc = gitutil.BuildEmailList(self.get('cover_cc', ''))
+            cover_cc = gitutil.build_email_list(self.get('cover_cc', ''))
             cover_cc = list(set(cover_cc + all_ccs))
             if limit is not None:
                 cover_cc = cover_cc[:limit]
@@ -309,7 +309,7 @@
         Return:
             Patch string, like 'RFC PATCH v5' or just 'PATCH'
         """
-        git_prefix = gitutil.GetDefaultSubjectPrefix()
+        git_prefix = gitutil.get_default_subject_prefix()
         if git_prefix:
             git_prefix = '%s][' % git_prefix
         else:
diff --git a/tools/patman/settings.py b/tools/patman/settings.py
index 13c1ee4..014bb37 100644
--- a/tools/patman/settings.py
+++ b/tools/patman/settings.py
@@ -198,11 +198,11 @@
     Returns:
         None
     """
-    name = gitutil.GetDefaultUserName()
+    name = gitutil.get_default_user_name()
     if name == None:
         name = raw_input("Enter name: ")
 
-    email = gitutil.GetDefaultUserEmail()
+    email = gitutil.get_default_user_email()
 
     if email == None:
         email = raw_input("Enter email: ")
diff --git a/tools/patman/status.py b/tools/patman/status.py
index f3fbc66..47ed6d6 100644
--- a/tools/patman/status.py
+++ b/tools/patman/status.py
@@ -245,7 +245,7 @@
     count = len(patch_dict)
     num_commits = len(series.commits)
     if count != num_commits:
-        tout.Warning('Warning: Patchwork reports %d patches, series has %d' %
+        tout.warning('Warning: Patchwork reports %d patches, series has %d' %
                      (count, num_commits))
 
     patches = []
@@ -257,7 +257,7 @@
         patch.parse_subject(pw_patch['name'])
         patches.append(patch)
     if warn_count > 1:
-        tout.Warning('   (total of %d warnings)' % warn_count)
+        tout.warning('   (total of %d warnings)' % warn_count)
 
     # Sort patches by patch number
     patches = sorted(patches, key=lambda x: x.seq)
@@ -338,9 +338,9 @@
     for tag in sorted(rtags.keys()):
         people = rtags[tag]
         for who in sorted(people):
-            terminal.Print(indent + '%s %s: ' % ('+' if is_new else ' ', tag),
+            terminal.tprint(indent + '%s %s: ' % ('+' if is_new else ' ', tag),
                            newline=False, colour=col.GREEN, bright=is_new)
-            terminal.Print(who, colour=col.WHITE, bright=is_new)
+            terminal.tprint(who, colour=col.WHITE, bright=is_new)
             count += 1
     return count
 
@@ -437,7 +437,7 @@
 
     patch_for_commit, _, warnings = compare_with_series(series, patches)
     for warn in warnings:
-        tout.Warning(warn)
+        tout.warning(warn)
 
     patch_list = [patch_for_commit.get(c) for c in range(len(series.commits))]
 
@@ -455,7 +455,7 @@
         patch = patch_for_commit.get(seq)
         if not patch:
             continue
-        terminal.Print('%3d %s' % (patch.seq, patch.subject[:50]),
+        terminal.tprint('%3d %s' % (patch.seq, patch.subject[:50]),
                        colour=col.BLUE)
         cmt = series.commits[seq]
         base_rtags = cmt.rtags
@@ -466,15 +466,15 @@
         num_to_add += show_responses(new_rtags, indent, True)
         if show_comments:
             for review in review_list[seq]:
-                terminal.Print('Review: %s' % review.meta, colour=col.RED)
+                terminal.tprint('Review: %s' % review.meta, colour=col.RED)
                 for snippet in review.snippets:
                     for line in snippet:
                         quoted = line.startswith('>')
-                        terminal.Print('    %s' % line,
+                        terminal.tprint('    %s' % line,
                                        colour=col.MAGENTA if quoted else None)
-                    terminal.Print()
+                    terminal.tprint()
 
-    terminal.Print("%d new response%s available in patchwork%s" %
+    terminal.tprint("%d new response%s available in patchwork%s" %
                    (num_to_add, 's' if num_to_add != 1 else '',
                     '' if dest_branch
                     else ' (use -d to write them to a new branch)'))
@@ -482,6 +482,6 @@
     if dest_branch:
         num_added = create_branch(series, new_rtag_list, branch,
                                   dest_branch, force, test_repo)
-        terminal.Print(
+        terminal.tprint(
             "%d response%s added from patchwork into new branch '%s'" %
             (num_added, 's' if num_added != 1 else '', dest_branch))
diff --git a/tools/patman/terminal.py b/tools/patman/terminal.py
index 9be03b3..40d79f8 100644
--- a/tools/patman/terminal.py
+++ b/tools/patman/terminal.py
@@ -51,7 +51,7 @@
                 (self.newline, self.colour, self.bright, self.text))
 
 
-def CalcAsciiLen(text):
+def calc_ascii_len(text):
     """Calculate the length of a string, ignoring any ANSI sequences
 
     When displayed on a terminal, ANSI sequences don't take any space, so we
@@ -64,44 +64,44 @@
         Length of text, after skipping ANSI sequences
 
     >>> col = Color(COLOR_ALWAYS)
-    >>> text = col.Color(Color.RED, 'abc')
+    >>> text = col.build(Color.RED, 'abc')
     >>> len(text)
     14
-    >>> CalcAsciiLen(text)
+    >>> calc_ascii_len(text)
     3
     >>>
     >>> text += 'def'
-    >>> CalcAsciiLen(text)
+    >>> calc_ascii_len(text)
     6
-    >>> text += col.Color(Color.RED, 'abc')
-    >>> CalcAsciiLen(text)
+    >>> text += col.build(Color.RED, 'abc')
+    >>> calc_ascii_len(text)
     9
     """
     result = ansi_escape.sub('', text)
     return len(result)
 
-def TrimAsciiLen(text, size):
+def trim_ascii_len(text, size):
     """Trim a string containing ANSI sequences to the given ASCII length
 
     The string is trimmed with ANSI sequences being ignored for the length
     calculation.
 
     >>> col = Color(COLOR_ALWAYS)
-    >>> text = col.Color(Color.RED, 'abc')
+    >>> text = col.build(Color.RED, 'abc')
     >>> len(text)
     14
-    >>> CalcAsciiLen(TrimAsciiLen(text, 4))
+    >>> calc_ascii_len(trim_ascii_len(text, 4))
     3
-    >>> CalcAsciiLen(TrimAsciiLen(text, 2))
+    >>> calc_ascii_len(trim_ascii_len(text, 2))
     2
     >>> text += 'def'
-    >>> CalcAsciiLen(TrimAsciiLen(text, 4))
+    >>> calc_ascii_len(trim_ascii_len(text, 4))
     4
-    >>> text += col.Color(Color.RED, 'ghi')
-    >>> CalcAsciiLen(TrimAsciiLen(text, 7))
+    >>> text += col.build(Color.RED, 'ghi')
+    >>> calc_ascii_len(trim_ascii_len(text, 7))
     7
     """
-    if CalcAsciiLen(text) < size:
+    if calc_ascii_len(text) < size:
         return text
     pos = 0
     out = ''
@@ -130,7 +130,7 @@
     return out
 
 
-def Print(text='', newline=True, colour=None, limit_to_line=False, bright=True):
+def tprint(text='', newline=True, colour=None, limit_to_line=False, bright=True):
     """Handle a line of output to the terminal.
 
     In test mode this is recorded in a list. Otherwise it is output to the
@@ -148,18 +148,18 @@
     else:
         if colour:
             col = Color()
-            text = col.Color(colour, text, bright=bright)
+            text = col.build(colour, text, bright=bright)
         if newline:
             print(text)
             last_print_len = None
         else:
             if limit_to_line:
                 cols = shutil.get_terminal_size().columns
-                text = TrimAsciiLen(text, cols)
+                text = trim_ascii_len(text, cols)
             print(text, end='', flush=True)
-            last_print_len = CalcAsciiLen(text)
+            last_print_len = calc_ascii_len(text)
 
-def PrintClear():
+def print_clear():
     """Clear a previously line that was printed with no newline"""
     global last_print_len
 
@@ -167,15 +167,15 @@
         print('\r%s\r' % (' '* last_print_len), end='', flush=True)
         last_print_len = None
 
-def SetPrintTestMode(enable=True):
+def set_print_test_mode(enable=True):
     """Go into test mode, where all printing is recorded"""
     global print_test_mode
 
     print_test_mode = enable
-    GetPrintTestLines()
+    get_print_test_lines()
 
-def GetPrintTestLines():
-    """Get a list of all lines output through Print()
+def get_print_test_lines():
+    """Get a list of all lines output through tprint()
 
     Returns:
         A list of PrintLine objects
@@ -186,12 +186,12 @@
     print_test_list = []
     return ret
 
-def EchoPrintTestLines():
+def echo_print_test_lines():
     """Print out the text lines collected"""
     for line in print_test_list:
         if line.colour:
             col = Color()
-            print(col.Color(line.colour, line.text), end='')
+            print(col.build(line.colour, line.text), end='')
         else:
             print(line.text, end='')
         if line.newline:
@@ -221,7 +221,7 @@
         except:
             self._enabled = False
 
-    def Start(self, color, bright=True):
+    def start(self, color, bright=True):
         """Returns a start color code.
 
         Args:
@@ -236,7 +236,7 @@
             return base % (color + 30)
         return ''
 
-    def Stop(self):
+    def stop(self):
         """Returns a stop color code.
 
         Returns:
@@ -247,7 +247,7 @@
             return self.RESET
         return ''
 
-    def Color(self, color, text, bright=True):
+    def build(self, color, text, bright=True):
         """Returns text with conditionally added color escape sequences.
 
         Keyword arguments:
diff --git a/tools/patman/test_checkpatch.py b/tools/patman/test_checkpatch.py
index 56af5265..8960cd5 100644
--- a/tools/patman/test_checkpatch.py
+++ b/tools/patman/test_checkpatch.py
@@ -82,13 +82,13 @@
         return inname
 
     def run_checkpatch(self):
-        return checkpatch.CheckPatch(self.get_patch(), show_types=True)
+        return checkpatch.check_patch(self.get_patch(), show_types=True)
 
 
 class TestPatch(unittest.TestCase):
     """Test the u_boot_line() function in checkpatch.pl"""
 
-    def testBasic(self):
+    def test_basic(self):
         """Test basic filter operation"""
         data='''
 
@@ -164,7 +164,7 @@
         os.remove(inname)
         os.remove(expname)
 
-    def GetData(self, data_type):
+    def get_data(self, data_type):
         data='''From 4924887af52713cabea78420eff03badea8f0035 Mon Sep 17 00:00:00 2001
 From: Simon Glass <sjg@chromium.org>
 Date: Thu, 7 Apr 2011 10:14:41 -0700
@@ -284,18 +284,18 @@
             print('not implemented')
         return data % (signoff, license, tab, indent, tab)
 
-    def SetupData(self, data_type):
+    def setup_data(self, data_type):
         inhandle, inname = tempfile.mkstemp()
         infd = os.fdopen(inhandle, 'w')
-        data = self.GetData(data_type)
+        data = self.get_data(data_type)
         infd.write(data)
         infd.close()
         return inname
 
-    def testGood(self):
+    def test_good(self):
         """Test checkpatch operation"""
-        inf = self.SetupData('good')
-        result = checkpatch.CheckPatch(inf)
+        inf = self.setup_data('good')
+        result = checkpatch.check_patch(inf)
         self.assertEqual(result.ok, True)
         self.assertEqual(result.problems, [])
         self.assertEqual(result.errors, 0)
@@ -304,9 +304,9 @@
         self.assertEqual(result.lines, 62)
         os.remove(inf)
 
-    def testNoSignoff(self):
-        inf = self.SetupData('no-signoff')
-        result = checkpatch.CheckPatch(inf)
+    def test_no_signoff(self):
+        inf = self.setup_data('no-signoff')
+        result = checkpatch.check_patch(inf)
         self.assertEqual(result.ok, False)
         self.assertEqual(len(result.problems), 1)
         self.assertEqual(result.errors, 1)
@@ -315,9 +315,9 @@
         self.assertEqual(result.lines, 62)
         os.remove(inf)
 
-    def testNoLicense(self):
-        inf = self.SetupData('no-license')
-        result = checkpatch.CheckPatch(inf)
+    def test_no_license(self):
+        inf = self.setup_data('no-license')
+        result = checkpatch.check_patch(inf)
         self.assertEqual(result.ok, False)
         self.assertEqual(len(result.problems), 1)
         self.assertEqual(result.errors, 0)
@@ -326,9 +326,9 @@
         self.assertEqual(result.lines, 62)
         os.remove(inf)
 
-    def testSpaces(self):
-        inf = self.SetupData('spaces')
-        result = checkpatch.CheckPatch(inf)
+    def test_spaces(self):
+        inf = self.setup_data('spaces')
+        result = checkpatch.check_patch(inf)
         self.assertEqual(result.ok, False)
         self.assertEqual(len(result.problems), 3)
         self.assertEqual(result.errors, 0)
@@ -337,9 +337,9 @@
         self.assertEqual(result.lines, 62)
         os.remove(inf)
 
-    def testIndent(self):
-        inf = self.SetupData('indent')
-        result = checkpatch.CheckPatch(inf)
+    def test_indent(self):
+        inf = self.setup_data('indent')
+        result = checkpatch.check_patch(inf)
         self.assertEqual(result.ok, False)
         self.assertEqual(len(result.problems), 1)
         self.assertEqual(result.errors, 0)
@@ -348,7 +348,7 @@
         self.assertEqual(result.lines, 62)
         os.remove(inf)
 
-    def checkSingleMessage(self, pm, msg, pmtype = 'warning'):
+    def check_single_message(self, pm, msg, pmtype = 'warning'):
         """Helper function to run checkpatch and check the result
 
         Args:
@@ -366,50 +366,50 @@
         self.assertEqual(len(result.problems), 1)
         self.assertIn(msg, result.problems[0]['cptype'])
 
-    def testUclass(self):
+    def test_uclass(self):
         """Test for possible new uclass"""
         pm = PatchMaker()
         pm.add_line('include/dm/uclass-id.h', 'UCLASS_WIBBLE,')
-        self.checkSingleMessage(pm, 'NEW_UCLASS')
+        self.check_single_message(pm, 'NEW_UCLASS')
 
-    def testLivetree(self):
+    def test_livetree(self):
         """Test for using the livetree API"""
         pm = PatchMaker()
         pm.add_line('common/main.c', 'fdtdec_do_something()')
-        self.checkSingleMessage(pm, 'LIVETREE')
+        self.check_single_message(pm, 'LIVETREE')
 
-    def testNewCommand(self):
+    def test_new_command(self):
         """Test for adding a new command"""
         pm = PatchMaker()
         pm.add_line('common/main.c', 'do_wibble(struct cmd_tbl *cmd_tbl)')
-        self.checkSingleMessage(pm, 'CMD_TEST')
+        self.check_single_message(pm, 'CMD_TEST')
 
-    def testPreferIf(self):
+    def test_prefer_if(self):
         """Test for using #ifdef"""
         pm = PatchMaker()
         pm.add_line('common/main.c', '#ifdef CONFIG_YELLOW')
         pm.add_line('common/init.h', '#ifdef CONFIG_YELLOW')
         pm.add_line('fred.dtsi', '#ifdef CONFIG_YELLOW')
-        self.checkSingleMessage(pm, "PREFER_IF")
+        self.check_single_message(pm, "PREFER_IF")
 
-    def testCommandUseDefconfig(self):
+    def test_command_use_defconfig(self):
         """Test for enabling/disabling commands using preprocesor"""
         pm = PatchMaker()
         pm.add_line('common/main.c', '#undef CONFIG_CMD_WHICH')
-        self.checkSingleMessage(pm, 'DEFINE_CONFIG_CMD', 'error')
+        self.check_single_message(pm, 'DEFINE_CONFIG_CMD', 'error')
 
-    def testBarredIncludeInHdr(self):
+    def test_barred_include_in_hdr(self):
         """Test for using a barred include in a header file"""
         pm = PatchMaker()
         #pm.add_line('include/myfile.h', '#include <common.h>')
         pm.add_line('include/myfile.h', '#include <dm.h>')
-        self.checkSingleMessage(pm, 'BARRED_INCLUDE_IN_HDR', 'error')
+        self.check_single_message(pm, 'BARRED_INCLUDE_IN_HDR', 'error')
 
-    def testConfigIsEnabledConfig(self):
+    def test_config_is_enabled_config(self):
         """Test for accidental CONFIG_IS_ENABLED(CONFIG_*) calls"""
         pm = PatchMaker()
         pm.add_line('common/main.c', 'if (CONFIG_IS_ENABLED(CONFIG_CLK))')
-        self.checkSingleMessage(pm, 'CONFIG_IS_ENABLED_CONFIG', 'error')
+        self.check_single_message(pm, 'CONFIG_IS_ENABLED_CONFIG', 'error')
 
     def check_struct(self, auto, suffix, warning):
         """Check one of the warnings for struct naming
@@ -423,17 +423,17 @@
         pm.add_line('common/main.c', '.%s = sizeof(struct(fred)),' % auto)
         pm.add_line('common/main.c', '.%s = sizeof(struct(mary%s)),' %
                     (auto, suffix))
-        self.checkSingleMessage(
+        self.check_single_message(
             pm, warning, "struct 'fred' should have a %s suffix" % suffix)
 
-    def testDmDriverAuto(self):
+    def test_dm_driver_auto(self):
         """Check for the correct suffix on 'struct driver' auto members"""
         self.check_struct('priv_auto', '_priv', 'PRIV_AUTO')
         self.check_struct('plat_auto', '_plat', 'PLAT_AUTO')
         self.check_struct('per_child_auto', '_priv', 'CHILD_PRIV_AUTO')
         self.check_struct('per_child_plat_auto', '_plat', 'CHILD_PLAT_AUTO')
 
-    def testDmUclassAuto(self):
+    def test_dm_uclass_auto(self):
         """Check for the correct suffix on 'struct uclass' auto members"""
         # Some of these are omitted since they match those from struct driver
         self.check_struct('per_device_auto', '_priv', 'DEVICE_PRIV_AUTO')
@@ -443,11 +443,11 @@
         """Check one of the checks for strn(cpy|cat)"""
         pm = PatchMaker()
         pm.add_line('common/main.c', "strn%s(foo, bar, sizeof(foo));" % func)
-        self.checkSingleMessage(pm, "STRL",
+        self.check_single_message(pm, "STRL",
             "strl%s is preferred over strn%s because it always produces a nul-terminated string\n"
             % (func, func))
 
-    def testStrl(self):
+    def test_strl(self):
         """Check for uses of strn(cat|cpy)"""
         self.check_strl("cat");
         self.check_strl("cpy");
diff --git a/tools/patman/test_util.py b/tools/patman/test_util.py
index 4e26175..c60eb36 100644
--- a/tools/patman/test_util.py
+++ b/tools/patman/test_util.py
@@ -4,6 +4,7 @@
 #
 
 from contextlib import contextmanager
+import doctest
 import glob
 import multiprocessing
 import os
@@ -22,7 +23,7 @@
     use_concurrent = False
 
 
-def RunTestCoverage(prog, filter_fname, exclude_list, build_dir, required=None,
+def run_test_coverage(prog, filter_fname, exclude_list, build_dir, required=None,
                     extra_args=None):
     """Run tests and check that we get 100% coverage
 
@@ -60,7 +61,7 @@
            '--omit "%s" %s %s %s -P1' % (prefix, ','.join(glob_list),
                                          prog, extra_args or '', test_cmd))
     os.system(cmd)
-    stdout = command.Output('python3-coverage', 'report')
+    stdout = command.output('python3-coverage', 'report')
     lines = stdout.splitlines()
     if required:
         # Convert '/path/to/name.py' just the module name 'name'
@@ -101,7 +102,7 @@
         sys.stdout, sys.stderr = old_out, old_err
 
 
-def ReportResult(toolname:str, test_name: str, result: unittest.TestResult):
+def report_result(toolname:str, test_name: str, result: unittest.TestResult):
     """Report the results from a suite of tests
 
     Args:
@@ -138,8 +139,8 @@
     return 0
 
 
-def RunTestSuites(result, debug, verbosity, test_preserve_dirs, processes,
-                  test_name, toolpath, test_class_list):
+def run_test_suites(result, debug, verbosity, test_preserve_dirs, processes,
+                    test_name, toolpath, class_and_module_list):
     """Run a series of test suites and collect the results
 
     Args:
@@ -154,11 +155,13 @@
         processes: Number of processes to use to run tests (None=same as #CPUs)
         test_name: Name of test to run, or None for all
         toolpath: List of paths to use for tools
-        test_class_list: List of test classes to run
+        class_and_module_list: List of test classes (type class) and module
+           names (type str) to run
     """
-    for module in []:
-        suite = doctest.DocTestSuite(module)
-        suite.run(result)
+    for module in class_and_module_list:
+        if isinstance(module, str) and (not test_name or test_name == module):
+            suite = doctest.DocTestSuite(module)
+            suite.run(result)
 
     sys.argv = [sys.argv[0]]
     if debug:
@@ -171,7 +174,9 @@
 
     suite = unittest.TestSuite()
     loader = unittest.TestLoader()
-    for module in test_class_list:
+    for module in class_and_module_list:
+        if isinstance(module, str):
+            continue
         # Test the test module about our arguments, if it is interested
         if hasattr(module, 'setup_test_args'):
             setup_test_args = getattr(module, 'setup_test_args')
diff --git a/tools/patman/tools.py b/tools/patman/tools.py
index 5dfecaf..5e4d4ac 100644
--- a/tools/patman/tools.py
+++ b/tools/patman/tools.py
@@ -23,7 +23,7 @@
 # Path to the Chrome OS chroot, if we know it
 chroot_path = None
 
-# Search paths to use for Filename(), used to find files
+# Search paths to use for filename(), used to find files
 search_paths = []
 
 tool_search_paths = []
@@ -36,7 +36,7 @@
 # List of paths to use when looking for an input file
 indir = []
 
-def PrepareOutputDir(dirname, preserve=False):
+def prepare_output_dir(dirname, preserve=False):
     """Select an output directory, ensuring it exists.
 
     This either creates a temporary directory or checks that the one supplied
@@ -64,27 +64,27 @@
             except OSError as err:
                 raise CmdError("Cannot make output directory '%s': '%s'" %
                                 (outdir, err.strerror))
-        tout.Debug("Using output directory '%s'" % outdir)
+        tout.debug("Using output directory '%s'" % outdir)
     else:
         outdir = tempfile.mkdtemp(prefix='binman.')
-        tout.Debug("Using temporary directory '%s'" % outdir)
+        tout.debug("Using temporary directory '%s'" % outdir)
 
-def _RemoveOutputDir():
+def _remove_output_dir():
     global outdir
 
     shutil.rmtree(outdir)
-    tout.Debug("Deleted temporary directory '%s'" % outdir)
+    tout.debug("Deleted temporary directory '%s'" % outdir)
     outdir = None
 
-def FinaliseOutputDir():
+def finalise_output_dir():
     global outdir, preserve_outdir
 
     """Tidy up: delete output directory if temporary and not preserved."""
     if outdir and not preserve_outdir:
-        _RemoveOutputDir()
+        _remove_output_dir()
         outdir = None
 
-def GetOutputFilename(fname):
+def get_output_filename(fname):
     """Return a filename within the output directory.
 
     Args:
@@ -95,7 +95,7 @@
     """
     return os.path.join(outdir, fname)
 
-def GetOutputDir():
+def get_output_dir():
     """Return the current output directory
 
     Returns:
@@ -103,15 +103,15 @@
     """
     return outdir
 
-def _FinaliseForTest():
+def _finalise_for_test():
     """Remove the output directory (for use by tests)"""
     global outdir
 
     if outdir:
-        _RemoveOutputDir()
+        _remove_output_dir()
         outdir = None
 
-def SetInputDirs(dirname):
+def set_input_dirs(dirname):
     """Add a list of input directories, where input files are kept.
 
     Args:
@@ -121,9 +121,9 @@
     global indir
 
     indir = dirname
-    tout.Debug("Using input directories %s" % indir)
+    tout.debug("Using input directories %s" % indir)
 
-def GetInputFilename(fname, allow_missing=False):
+def get_input_filename(fname, allow_missing=False):
     """Return a filename for use as input.
 
     Args:
@@ -150,7 +150,7 @@
     raise ValueError("Filename '%s' not found in input path (%s) (cwd='%s')" %
                      (fname, ','.join(indir), os.getcwd()))
 
-def GetInputFilenameGlob(pattern):
+def get_input_filename_glob(pattern):
     """Return a list of filenames for use as input.
 
     Args:
@@ -167,26 +167,26 @@
         files += glob.glob(pathname)
     return sorted(files)
 
-def Align(pos, align):
+def align(pos, align):
     if align:
         mask = align - 1
         pos = (pos + mask) & ~mask
     return pos
 
-def NotPowerOfTwo(num):
+def not_power_of_two(num):
     return num and (num & (num - 1))
 
-def SetToolPaths(toolpaths):
+def set_tool_paths(toolpaths):
     """Set the path to search for tools
 
     Args:
-        toolpaths: List of paths to search for tools executed by Run()
+        toolpaths: List of paths to search for tools executed by run()
     """
     global tool_search_paths
 
     tool_search_paths = toolpaths
 
-def PathHasFile(path_spec, fname):
+def path_has_file(path_spec, fname):
     """Check if a given filename is in the PATH
 
     Args:
@@ -201,7 +201,7 @@
             return True
     return False
 
-def GetHostCompileTool(name):
+def get_host_compile_tool(name):
     """Get the host-specific version for a compile tool
 
     This checks the environment variables that specify which version of
@@ -244,7 +244,7 @@
         return host_name, extra_args
     return name, []
 
-def GetTargetCompileTool(name, cross_compile=None):
+def get_target_compile_tool(name, cross_compile=None):
     """Get the target-specific version for a compile tool
 
     This first checks the environment variables that specify which
@@ -298,7 +298,7 @@
         target_name = cross_compile + name
     elif name == 'ld':
         try:
-            if Run(cross_compile + 'ld.bfd', '-v'):
+            if run(cross_compile + 'ld.bfd', '-v'):
                 target_name = cross_compile + 'ld.bfd'
         except:
             target_name = cross_compile + 'ld'
@@ -353,14 +353,14 @@
         raise_on_error = kwargs.get('raise_on_error', True)
         env = get_env_with_path()
         if for_target:
-            name, extra_args = GetTargetCompileTool(name)
+            name, extra_args = get_target_compile_tool(name)
             args = tuple(extra_args) + args
         elif for_host:
-            name, extra_args = GetHostCompileTool(name)
+            name, extra_args = get_host_compile_tool(name)
             args = tuple(extra_args) + args
         name = os.path.expanduser(name)  # Expand paths containing ~
         all_args = (name,) + args
-        result = command.RunPipe([all_args], capture=True, capture_stderr=True,
+        result = command.run_pipe([all_args], capture=True, capture_stderr=True,
                                  env=env, raise_on_error=False, binary=binary)
         if result.return_code:
             if raise_on_error:
@@ -369,7 +369,7 @@
                                   result.stderr or result.stdout))
         return result
     except ValueError:
-        if env and not PathHasFile(env['PATH'], name):
+        if env and not path_has_file(env['PATH'], name):
             msg = "Please install tool '%s'" % name
             package = packages.get(name)
             if package:
@@ -380,7 +380,7 @@
 def tool_find(name):
     """Search the current path for a tool
 
-    This uses both PATH and any value from SetToolPaths() to search for a tool
+    This uses both PATH and any value from set_tool_paths() to search for a tool
 
     Args:
         name (str): Name of tool to locate
@@ -400,7 +400,7 @@
         if os.path.isfile(fname) and os.access(fname, os.X_OK):
             return fname
 
-def Run(name, *args, **kwargs):
+def run(name, *args, **kwargs):
     """Run a tool with some arguments
 
     This runs a 'tool', which is a program used by binman to process files and
@@ -421,7 +421,7 @@
     if result is not None:
         return result.stdout
 
-def Filename(fname):
+def filename(fname):
     """Resolve a file path to an absolute path.
 
     If fname starts with ##/ and chroot is available, ##/ gets replaced with
@@ -455,7 +455,7 @@
     # If not found, just return the standard, unchanged path
     return fname
 
-def ReadFile(fname, binary=True):
+def read_file(fname, binary=True):
     """Read and return the contents of a file.
 
     Args:
@@ -464,13 +464,13 @@
     Returns:
       data read from file, as a string.
     """
-    with open(Filename(fname), binary and 'rb' or 'r') as fd:
+    with open(filename(fname), binary and 'rb' or 'r') as fd:
         data = fd.read()
     #self._out.Info("Read file '%s' size %d (%#0x)" %
                    #(fname, len(data), len(data)))
     return data
 
-def WriteFile(fname, data, binary=True):
+def write_file(fname, data, binary=True):
     """Write data into a file.
 
     Args:
@@ -479,10 +479,10 @@
     """
     #self._out.Info("Write file '%s' size %d (%#0x)" %
                    #(fname, len(data), len(data)))
-    with open(Filename(fname), binary and 'wb' or 'w') as fd:
+    with open(filename(fname), binary and 'wb' or 'w') as fd:
         fd.write(data)
 
-def GetBytes(byte, size):
+def get_bytes(byte, size):
     """Get a string of bytes of a given size
 
     Args:
@@ -494,7 +494,7 @@
     """
     return bytes([byte]) * size
 
-def ToBytes(string):
+def to_bytes(string):
     """Convert a str type into a bytes type
 
     Args:
@@ -505,7 +505,7 @@
     """
     return string.encode('utf-8')
 
-def ToString(bval):
+def to_string(bval):
     """Convert a bytes type into a str type
 
     Args:
@@ -517,7 +517,7 @@
     """
     return bval.decode('utf-8')
 
-def ToHex(val):
+def to_hex(val):
     """Convert an integer value (or None) to a string
 
     Returns:
@@ -525,7 +525,7 @@
     """
     return 'None' if val is None else '%#x' % val
 
-def ToHexSize(val):
+def to_hex_size(val):
     """Return the size of an object in hex
 
     Returns:
@@ -533,7 +533,7 @@
     """
     return 'None' if val is None else '%#x' % len(val)
 
-def PrintFullHelp(fname):
+def print_full_help(fname):
     """Print the full help message for a tool using an appropriate pager.
 
     Args:
@@ -545,9 +545,9 @@
         pager = [lesspath] if lesspath else None
     if not pager:
         pager = ['more']
-    command.Run(*pager, fname)
+    command.run(*pager, fname)
 
-def Download(url, tmpdir_pattern='.patman'):
+def download(url, tmpdir_pattern='.patman'):
     """Download a file to a temporary directory
 
     Args:
diff --git a/tools/patman/tout.py b/tools/patman/tout.py
index 3330526..ff0fd92 100644
--- a/tools/patman/tout.py
+++ b/tools/patman/tout.py
@@ -30,10 +30,10 @@
 
 def __exit__(unused1, unused2, unused3):
     """Clean up and remove any progress message."""
-    ClearProgress()
+    clear_progress()
     return False
 
-def UserIsPresent():
+def user_is_present():
     """This returns True if it is likely that a user is present.
 
     Sometimes we want to prompt the user, but if no one is there then this
@@ -44,7 +44,7 @@
     """
     return stdout_is_tty and verbose > 0
 
-def ClearProgress():
+def clear_progress():
     """Clear any active progress message on the terminal."""
     global in_progress
     if verbose > 0 and stdout_is_tty and in_progress:
@@ -52,25 +52,25 @@
         _stdout.flush()
         in_progress = False
 
-def Progress(msg, warning=False, trailer='...'):
+def progress(msg, warning=False, trailer='...'):
     """Display progress information.
 
     Args:
         msg: Message to display.
         warning: True if this is a warning."""
     global in_progress
-    ClearProgress()
+    clear_progress()
     if verbose > 0:
         _progress = msg + trailer
         if stdout_is_tty:
             col = _color.YELLOW if warning else _color.GREEN
-            _stdout.write('\r' + _color.Color(col, _progress))
+            _stdout.write('\r' + _color.build(col, _progress))
             _stdout.flush()
             in_progress = True
         else:
             _stdout.write(_progress + '\n')
 
-def _Output(level, msg, color=None):
+def _output(level, msg, color=None):
     """Output a message to the terminal.
 
     Args:
@@ -80,15 +80,15 @@
         error: True if this is an error message, else False.
     """
     if verbose >= level:
-        ClearProgress()
+        clear_progress()
         if color:
-            msg = _color.Color(color, msg)
+            msg = _color.build(color, msg)
         if level < NOTICE:
             print(msg, file=sys.stderr)
         else:
             print(msg)
 
-def DoOutput(level, msg):
+def do_output(level, msg):
     """Output a message to the terminal.
 
     Args:
@@ -96,66 +96,66 @@
                 this as high as the currently selected level.
         msg; Message to display.
     """
-    _Output(level, msg)
+    _output(level, msg)
 
-def Error(msg):
+def error(msg):
     """Display an error message
 
     Args:
         msg; Message to display.
     """
-    _Output(ERROR, msg, _color.RED)
+    _output(ERROR, msg, _color.RED)
 
-def Warning(msg):
+def warning(msg):
     """Display a warning message
 
     Args:
         msg; Message to display.
     """
-    _Output(WARNING, msg, _color.YELLOW)
+    _output(WARNING, msg, _color.YELLOW)
 
-def Notice(msg):
+def notice(msg):
     """Display an important infomation message
 
     Args:
         msg; Message to display.
     """
-    _Output(NOTICE, msg)
+    _output(NOTICE, msg)
 
-def Info(msg):
+def info(msg):
     """Display an infomation message
 
     Args:
         msg; Message to display.
     """
-    _Output(INFO, msg)
+    _output(INFO, msg)
 
-def Detail(msg):
+def detail(msg):
     """Display a detailed message
 
     Args:
         msg; Message to display.
     """
-    _Output(DETAIL, msg)
+    _output(DETAIL, msg)
 
-def Debug(msg):
+def debug(msg):
     """Display a debug message
 
     Args:
         msg; Message to display.
     """
-    _Output(DEBUG, msg)
+    _output(DEBUG, msg)
 
-def UserOutput(msg):
+def user_output(msg):
     """Display a message regardless of the current output level.
 
     This is used when the output was specifically requested by the user.
     Args:
         msg; Message to display.
     """
-    _Output(0, msg)
+    _output(0, msg)
 
-def Init(_verbose=WARNING, stdout=sys.stdout):
+def init(_verbose=WARNING, stdout=sys.stdout):
     """Initialize a new output object.
 
     Args:
@@ -173,7 +173,7 @@
     stdout_is_tty = hasattr(sys.stdout, 'isatty') and sys.stdout.isatty()
     stderr_is_tty = hasattr(sys.stderr, 'isatty') and sys.stderr.isatty()
 
-def Uninit():
-    ClearProgress()
+def uninit():
+    clear_progress()
 
-Init()
+init()
diff --git a/tools/rmboard.py b/tools/rmboard.py
index de68563..ae25632 100755
--- a/tools/rmboard.py
+++ b/tools/rmboard.py
@@ -44,17 +44,17 @@
         path: Path to search for and remove
     """
     cmd = ['git', 'grep', path]
-    stdout = command.RunPipe([cmd], capture=True, raise_on_error=False).stdout
+    stdout = command.run_pipe([cmd], capture=True, raise_on_error=False).stdout
     if not stdout:
         return
     fname = stdout.split(':')[0]
 
     print("Fixing up '%s' to remove reference to '%s'" % (fname, path))
     cmd = ['sed', '-i', '\|%s|d' % path, fname]
-    stdout = command.RunPipe([cmd], capture=True).stdout
+    stdout = command.run_pipe([cmd], capture=True).stdout
 
     cmd = ['git', 'add', fname]
-    stdout = command.RunPipe([cmd], capture=True).stdout
+    stdout = command.run_pipe([cmd], capture=True).stdout
 
 def rm_board(board):
     """Create a commit which removes a single board
@@ -69,7 +69,7 @@
 
     # Find all MAINTAINERS and Kconfig files which mention the board
     cmd = ['git', 'grep', '-l', board]
-    stdout = command.RunPipe([cmd], capture=True).stdout
+    stdout = command.run_pipe([cmd], capture=True).stdout
     maintain = []
     kconfig = []
     for line in stdout.splitlines():
@@ -110,7 +110,7 @@
     # which reference Kconfig files we want to remove
     for path in real:
         cmd = ['find', path]
-        stdout = (command.RunPipe([cmd], capture=True, raise_on_error=False).
+        stdout = (command.run_pipe([cmd], capture=True, raise_on_error=False).
                   stdout)
         for fname in stdout.splitlines():
             if fname.endswith('Kconfig'):
@@ -118,7 +118,7 @@
 
     # Remove unwanted files
     cmd = ['git', 'rm', '-r'] + real
-    stdout = command.RunPipe([cmd], capture=True).stdout
+    stdout = command.run_pipe([cmd], capture=True).stdout
 
     ## Change the messages as needed
     msg = '''arm: Remove %s board
@@ -132,12 +132,12 @@
 
     # Create the commit
     cmd = ['git', 'commit', '-s', '-m', msg]
-    stdout = command.RunPipe([cmd], capture=True).stdout
+    stdout = command.run_pipe([cmd], capture=True).stdout
 
     # Check if the board is mentioned anywhere else. The user will need to deal
     # with this
     cmd = ['git', 'grep', '-il', board]
-    print(command.RunPipe([cmd], capture=True, raise_on_error=False).stdout)
+    print(command.run_pipe([cmd], capture=True, raise_on_error=False).stdout)
     print(' '.join(cmd))
 
 for board in sys.argv[1:]: