[U-Boot] [PATCH 30/41] common: Move ARM cache operations out of common.h

Simon Glass sjg at chromium.org
Mon Sep 30 14:41:01 UTC 2019


These functions are CPU-related and do not use driver model. Move them to
cpu_legacy.h

Signed-off-by: Simon Glass <sjg at chromium.org>
---

 arch/arm/cpu/arm926ejs/lpc32xx/cpu.c       |  1 +
 arch/arm/cpu/armv7/cache_v7.c              |  1 +
 arch/arm/cpu/armv7/ls102xa/ls102xa_psci.c  |  1 +
 arch/arm/cpu/armv8/sec_firmware.c          |  1 +
 arch/arm/cpu/pxa/cache.c                   |  1 +
 arch/arm/lib/cache.c                       |  1 +
 arch/arm/mach-bcm283x/mbox.c               |  1 +
 arch/arm/mach-imx/mx7/psci-mx7.c           |  1 +
 arch/arm/mach-omap2/sec-common.c           |  1 +
 arch/arm/mach-tegra/ivc.c                  |  1 +
 arch/microblaze/lib/bootm.c                |  1 +
 arch/mips/lib/reloc.c                      |  1 +
 arch/mips/lib/traps.c                      |  1 +
 arch/mips/mach-jz47xx/jz4780/jz4780.c      |  1 +
 arch/mips/mach-mtmips/ddr_calibrate.c      |  1 +
 arch/nds32/cpu/n1213/ae3xx/cpu.c           |  1 +
 arch/nios2/cpu/cpu.c                       |  1 +
 arch/nios2/lib/bootm.c                     |  1 +
 arch/powerpc/lib/bootm.c                   |  1 +
 arch/powerpc/lib/cache.c                   |  1 +
 arch/riscv/cpu/ax25/cpu.c                  |  1 +
 arch/riscv/lib/smp.c                       |  1 +
 arch/riscv/lib/spl.c                       |  1 +
 arch/sandbox/cpu/cpu.c                     |  1 +
 arch/x86/cpu/quark/dram.c                  |  1 +
 arch/x86/cpu/quark/quark.c                 |  1 +
 arch/xtensa/lib/bootm.c                    |  1 +
 board/Arcturus/ucp1020/cmd_arc.c           |  1 +
 board/beckhoff/mx53cx9020/mx53cx9020.c     |  1 +
 board/broadcom/bcmstb/bcmstb.c             |  1 +
 board/cirrus/edb93xx/edb93xx.c             |  1 +
 board/phytec/pfla02/pfla02.c               |  1 +
 board/sandbox/sandbox.c                    |  1 +
 cmd/disk.c                                 |  1 +
 cmd/load.c                                 |  1 +
 cmd/ximg.c                                 |  1 +
 common/avb_verify.c                        |  1 +
 common/board_r.c                           |  1 +
 common/bootm.c                             |  1 +
 common/bouncebuf.c                         |  1 +
 common/image.c                             |  1 +
 common/lcd.c                               |  1 +
 common/spl/spl_opensbi.c                   |  1 +
 common/update.c                            |  1 +
 drivers/ata/ahci.c                         |  1 +
 drivers/ata/dwc_ahsata.c                   |  1 +
 drivers/ata/fsl_ahci.c                     |  1 +
 drivers/ata/fsl_sata.c                     |  1 +
 drivers/ata/sata_mv.c                      |  1 +
 drivers/ata/sata_sil.c                     |  1 +
 drivers/bootcount/bootcount.c              |  1 +
 drivers/bootcount/bootcount_ram.c          |  1 +
 drivers/core/device.c                      |  1 +
 drivers/crypto/fsl/fsl_blob.c              |  1 +
 drivers/crypto/fsl/fsl_hash.c              |  1 +
 drivers/crypto/fsl/jobdesc.c               |  1 +
 drivers/crypto/fsl/jr.c                    |  1 +
 drivers/dma/apbh_dma.c                     |  1 +
 drivers/dma/bcm6348-iudma.c                |  1 +
 drivers/dma/dma-uclass.c                   |  1 +
 drivers/dma/ti/k3-udma.c                   |  1 +
 drivers/fpga/zynqmppl.c                    |  1 +
 drivers/mmc/dw_mmc.c                       |  1 +
 drivers/mmc/fsl_esdhc.c                    |  1 +
 drivers/mmc/fsl_esdhc_imx.c                |  1 +
 drivers/mmc/fsl_esdhc_spl.c                |  1 +
 drivers/mmc/meson_gx_mmc.c                 |  1 +
 drivers/mmc/omap_hsmmc.c                   |  1 +
 drivers/mmc/sdhci.c                        |  1 +
 drivers/mmc/stm32_sdmmc2.c                 |  1 +
 drivers/mmc/tmio-common.c                  |  1 +
 drivers/mtd/nand/raw/denali.c              |  1 +
 drivers/mtd/nand/raw/fsl_elbc_spl.c        |  1 +
 drivers/mtd/nand/raw/fsl_ifc_spl.c         |  1 +
 drivers/mtd/nand/raw/mxs_nand.c            |  1 +
 drivers/mtd/pic32_flash.c                  |  1 +
 drivers/mtd/spi/fsl_espi_spl.c             |  1 +
 drivers/net/ag7xxx.c                       |  1 +
 drivers/net/altera_tse.c                   |  1 +
 drivers/net/bcm-sf2-eth-gmac.c             |  1 +
 drivers/net/designware.c                   |  1 +
 drivers/net/dwc_eth_qos.c                  |  1 +
 drivers/net/e1000.c                        |  1 +
 drivers/net/ethoc.c                        |  1 +
 drivers/net/fec_mxc.c                      |  1 +
 drivers/net/fsl-mc/mc.c                    |  1 +
 drivers/net/ftgmac100.c                    |  1 +
 drivers/net/ftmac100.c                     |  1 +
 drivers/net/higmacv300.c                   |  1 +
 drivers/net/ldpaa_eth/ldpaa_eth.c          |  1 +
 drivers/net/macb.c                         |  1 +
 drivers/net/mt7628-eth.c                   |  1 +
 drivers/net/mtk_eth.c                      |  1 +
 drivers/net/mvneta.c                       |  1 +
 drivers/net/mvpp2.c                        |  1 +
 drivers/net/pch_gbe.c                      |  1 +
 drivers/net/pcnet.c                        |  1 +
 drivers/net/pic32_eth.c                    |  1 +
 drivers/net/ravb.c                         |  1 +
 drivers/net/rtl8139.c                      |  1 +
 drivers/net/rtl8169.c                      |  1 +
 drivers/net/sh_eth.c                       |  1 +
 drivers/net/sni_ave.c                      |  1 +
 drivers/net/sun8i_emac.c                   |  1 +
 drivers/net/ti/cpsw.c                      |  1 +
 drivers/net/ti/davinci_emac.c              |  1 +
 drivers/net/xilinx_axi_emac.c              |  1 +
 drivers/net/zynq_gem.c                     |  1 +
 drivers/nvme/nvme.c                        |  1 +
 drivers/remoteproc/rproc-elf-loader.c      |  1 +
 drivers/spi/mxs_spi.c                      |  1 +
 drivers/spi/ti_qspi.c                      |  1 +
 drivers/spi/zynqmp_gqspi.c                 |  1 +
 drivers/usb/dwc3/core.c                    |  1 +
 drivers/usb/dwc3/dwc3-generic.c            |  1 +
 drivers/usb/dwc3/ep0.c                     |  1 +
 drivers/usb/dwc3/gadget.c                  |  1 +
 drivers/usb/dwc3/io.h                      |  1 +
 drivers/usb/gadget/ci_udc.c                |  1 +
 drivers/usb/gadget/dwc2_udc_otg_xfer_dma.c |  3 +++
 drivers/usb/gadget/fotg210.c               |  1 +
 drivers/usb/host/dwc2.c                    |  1 +
 drivers/usb/host/ehci-hcd.c                |  1 +
 drivers/usb/host/ohci-hcd.c                |  1 +
 drivers/usb/host/xhci-mem.c                |  1 +
 drivers/usb/host/xhci-ring.c               |  1 +
 drivers/usb/host/xhci.c                    |  1 +
 drivers/video/atmel_hlcdfb.c               |  1 +
 drivers/video/sunxi/sunxi_display.c        |  1 +
 drivers/video/video-uclass.c               |  1 +
 include/common.h                           | 24 ----------------------
 include/cpu_legacy.h                       | 24 ++++++++++++++++++++++
 lib/efi_loader/efi_image_loader.c          |  1 +
 lib/efi_loader/efi_runtime.c               |  1 +
 post/cpu/mpc83xx/ecc.c                     |  1 +
 135 files changed, 159 insertions(+), 24 deletions(-)

diff --git a/arch/arm/cpu/arm926ejs/lpc32xx/cpu.c b/arch/arm/cpu/arm926ejs/lpc32xx/cpu.c
index 51171774741..855d921aa95 100644
--- a/arch/arm/cpu/arm926ejs/lpc32xx/cpu.c
+++ b/arch/arm/cpu/arm926ejs/lpc32xx/cpu.c
@@ -4,6 +4,7 @@
  */
 
 #include <common.h>
+#include <cpu_legacy.h>
 #include <netdev.h>
 #include <asm/arch/cpu.h>
 #include <asm/arch/clk.h>
diff --git a/arch/arm/cpu/armv7/cache_v7.c b/arch/arm/cpu/armv7/cache_v7.c
index 0dc4ebf6943..c8ff9dcc56a 100644
--- a/arch/arm/cpu/armv7/cache_v7.c
+++ b/arch/arm/cpu/armv7/cache_v7.c
@@ -4,6 +4,7 @@
  * Texas Instruments, <www.ti.com>
  * Aneesh V <aneesh at ti.com>
  */
+#include <cpu_legacy.h>
 #include <linux/types.h>
 #include <common.h>
 #include <asm/armv7.h>
diff --git a/arch/arm/cpu/armv7/ls102xa/ls102xa_psci.c b/arch/arm/cpu/armv7/ls102xa/ls102xa_psci.c
index bb169aaaf4b..11a6b03105c 100644
--- a/arch/arm/cpu/armv7/ls102xa/ls102xa_psci.c
+++ b/arch/arm/cpu/armv7/ls102xa/ls102xa_psci.c
@@ -6,6 +6,7 @@
  */
 
 #include <config.h>
+#include <cpu_legacy.h>
 #include <asm/io.h>
 #include <asm/psci.h>
 #include <asm/arch/immap_ls102xa.h>
diff --git a/arch/arm/cpu/armv8/sec_firmware.c b/arch/arm/cpu/armv8/sec_firmware.c
index 8dc0ac92668..25a5b45c63c 100644
--- a/arch/arm/cpu/armv8/sec_firmware.c
+++ b/arch/arm/cpu/armv8/sec_firmware.c
@@ -4,6 +4,7 @@
  */
 
 #include <common.h>
+#include <cpu_legacy.h>
 #include <errno.h>
 #include <linux/kernel.h>
 #include <asm/io.h>
diff --git a/arch/arm/cpu/pxa/cache.c b/arch/arm/cpu/pxa/cache.c
index 5cd4a9524bc..8054ea57f45 100644
--- a/arch/arm/cpu/pxa/cache.c
+++ b/arch/arm/cpu/pxa/cache.c
@@ -3,6 +3,7 @@
  * (C) Copyright 2016 Vasily Khoruzhick <anarsoul at gmail.com>
  */
 
+#include <cpu_legacy.h>
 #include <linux/types.h>
 #include <common.h>
 
diff --git a/arch/arm/lib/cache.c b/arch/arm/lib/cache.c
index 463d283cb76..d5d748ff937 100644
--- a/arch/arm/lib/cache.c
+++ b/arch/arm/lib/cache.c
@@ -7,6 +7,7 @@
 /* for now: just dummy functions to satisfy the linker */
 
 #include <common.h>
+#include <cpu_legacy.h>
 #include <malloc.h>
 
 /*
diff --git a/arch/arm/mach-bcm283x/mbox.c b/arch/arm/mach-bcm283x/mbox.c
index 3c67f68c178..b9301a2ae08 100644
--- a/arch/arm/mach-bcm283x/mbox.c
+++ b/arch/arm/mach-bcm283x/mbox.c
@@ -4,6 +4,7 @@
  */
 
 #include <common.h>
+#include <cpu_legacy.h>
 #include <asm/io.h>
 #include <asm/arch/mbox.h>
 #include <phys2bus.h>
diff --git a/arch/arm/mach-imx/mx7/psci-mx7.c b/arch/arm/mach-imx/mx7/psci-mx7.c
index c98d2e96af5..c91d315a5c2 100644
--- a/arch/arm/mach-imx/mx7/psci-mx7.c
+++ b/arch/arm/mach-imx/mx7/psci-mx7.c
@@ -4,6 +4,7 @@
  * Copyright 2017 NXP
  */
 
+#include <cpu_legacy.h>
 #include <asm/io.h>
 #include <asm/psci.h>
 #include <asm/secure.h>
diff --git a/arch/arm/mach-omap2/sec-common.c b/arch/arm/mach-omap2/sec-common.c
index b45d3ee5449..31ebf41f687 100644
--- a/arch/arm/mach-omap2/sec-common.c
+++ b/arch/arm/mach-omap2/sec-common.c
@@ -13,6 +13,7 @@
  */
 
 #include <common.h>
+#include <cpu_legacy.h>
 #include <stdarg.h>
 
 #include <asm/arch/sys_proto.h>
diff --git a/arch/arm/mach-tegra/ivc.c b/arch/arm/mach-tegra/ivc.c
index 65b1cfc07d4..f5b52fe6bf2 100644
--- a/arch/arm/mach-tegra/ivc.c
+++ b/arch/arm/mach-tegra/ivc.c
@@ -4,6 +4,7 @@
  */
 
 #include <common.h>
+#include <cpu_legacy.h>
 #include <asm/io.h>
 #include <asm/arch-tegra/ivc.h>
 
diff --git a/arch/microblaze/lib/bootm.c b/arch/microblaze/lib/bootm.c
index ec332944d8e..ba633af5981 100644
--- a/arch/microblaze/lib/bootm.c
+++ b/arch/microblaze/lib/bootm.c
@@ -9,6 +9,7 @@
 
 #include <common.h>
 #include <command.h>
+#include <cpu_legacy.h>
 #include <env.h>
 #include <fdt_support.h>
 #include <image.h>
diff --git a/arch/mips/lib/reloc.c b/arch/mips/lib/reloc.c
index c6a517d66f8..c9c3a0aaed9 100644
--- a/arch/mips/lib/reloc.c
+++ b/arch/mips/lib/reloc.c
@@ -27,6 +27,7 @@
  */
 
 #include <common.h>
+#include <cpu_legacy.h>
 #include <asm/relocs.h>
 #include <asm/sections.h>
 
diff --git a/arch/mips/lib/traps.c b/arch/mips/lib/traps.c
index 976978c3e96..ff02d437a87 100644
--- a/arch/mips/lib/traps.c
+++ b/arch/mips/lib/traps.c
@@ -11,6 +11,7 @@
  */
 
 #include <common.h>
+#include <cpu_legacy.h>
 #include <asm/mipsregs.h>
 #include <asm/addrspace.h>
 #include <asm/system.h>
diff --git a/arch/mips/mach-jz47xx/jz4780/jz4780.c b/arch/mips/mach-jz47xx/jz4780/jz4780.c
index dbd328cb49f..0949cbc3d09 100644
--- a/arch/mips/mach-jz47xx/jz4780/jz4780.c
+++ b/arch/mips/mach-jz47xx/jz4780/jz4780.c
@@ -8,6 +8,7 @@
 
 #include <config.h>
 #include <common.h>
+#include <cpu_legacy.h>
 #include <asm/io.h>
 #include <asm/sections.h>
 #include <mach/jz4780.h>
diff --git a/arch/mips/mach-mtmips/ddr_calibrate.c b/arch/mips/mach-mtmips/ddr_calibrate.c
index 75763c45286..b0c64305869 100644
--- a/arch/mips/mach-mtmips/ddr_calibrate.c
+++ b/arch/mips/mach-mtmips/ddr_calibrate.c
@@ -17,6 +17,7 @@
  */
 
 #include <common.h>
+#include <cpu_legacy.h>
 #include <linux/io.h>
 #include <asm/cacheops.h>
 #include <asm/io.h>
diff --git a/arch/nds32/cpu/n1213/ae3xx/cpu.c b/arch/nds32/cpu/n1213/ae3xx/cpu.c
index ca8e6a140e7..d32d5be39f5 100644
--- a/arch/nds32/cpu/n1213/ae3xx/cpu.c
+++ b/arch/nds32/cpu/n1213/ae3xx/cpu.c
@@ -16,6 +16,7 @@
 #include <common.h>
 #include <command.h>
 #include <cpu_legacy.h>
+#include <irq_legacy.h>
 #include <watchdog.h>
 #include <asm/cache.h>
 
diff --git a/arch/nios2/cpu/cpu.c b/arch/nios2/cpu/cpu.c
index 1fc79213e20..54b6741d4e4 100644
--- a/arch/nios2/cpu/cpu.c
+++ b/arch/nios2/cpu/cpu.c
@@ -6,6 +6,7 @@
 
 #include <common.h>
 #include <cpu.h>
+#include <cpu_legacy.h>
 #include <dm.h>
 #include <errno.h>
 #include <asm/cache.h>
diff --git a/arch/nios2/lib/bootm.c b/arch/nios2/lib/bootm.c
index 485d5ae540c..c671e032148 100644
--- a/arch/nios2/lib/bootm.c
+++ b/arch/nios2/lib/bootm.c
@@ -5,6 +5,7 @@
  */
 
 #include <common.h>
+#include <cpu_legacy.h>
 
 #define NIOS_MAGIC 0x534f494e /* enable command line and initrd passing */
 
diff --git a/arch/powerpc/lib/bootm.c b/arch/powerpc/lib/bootm.c
index 84691b75546..a7d6f20d1c3 100644
--- a/arch/powerpc/lib/bootm.c
+++ b/arch/powerpc/lib/bootm.c
@@ -8,6 +8,7 @@
 
 
 #include <common.h>
+#include <cpu_legacy.h>
 #include <env.h>
 #include <watchdog.h>
 #include <command.h>
diff --git a/arch/powerpc/lib/cache.c b/arch/powerpc/lib/cache.c
index 2d36c3aa082..192a50c08d7 100644
--- a/arch/powerpc/lib/cache.c
+++ b/arch/powerpc/lib/cache.c
@@ -5,6 +5,7 @@
  */
 
 #include <common.h>
+#include <cpu_legacy.h>
 #include <asm/cache.h>
 #include <watchdog.h>
 
diff --git a/arch/riscv/cpu/ax25/cpu.c b/arch/riscv/cpu/ax25/cpu.c
index e7176757137..682ad22de21 100644
--- a/arch/riscv/cpu/ax25/cpu.c
+++ b/arch/riscv/cpu/ax25/cpu.c
@@ -7,6 +7,7 @@
 /* CPU specific code */
 #include <common.h>
 #include <cpu_legacy.h>
+#include <irq_legacy.h>
 #include <asm/cache.h>
 
 /*
diff --git a/arch/riscv/lib/smp.c b/arch/riscv/lib/smp.c
index cc66f15567a..44ea470b8ef 100644
--- a/arch/riscv/lib/smp.c
+++ b/arch/riscv/lib/smp.c
@@ -5,6 +5,7 @@
  */
 
 #include <common.h>
+#include <cpu_legacy.h>
 #include <dm.h>
 #include <asm/barrier.h>
 #include <asm/smp.h>
diff --git a/arch/riscv/lib/spl.c b/arch/riscv/lib/spl.c
index bea86959872..6a2b8f71629 100644
--- a/arch/riscv/lib/spl.c
+++ b/arch/riscv/lib/spl.c
@@ -4,6 +4,7 @@
  * Lukas Auer <lukas.auer at aisec.fraunhofer.de>
  */
 #include <common.h>
+#include <cpu_legacy.h>
 #include <spl.h>
 #include <asm/smp.h>
 
diff --git a/arch/sandbox/cpu/cpu.c b/arch/sandbox/cpu/cpu.c
index fdfb209f77d..6cb81f0dd43 100644
--- a/arch/sandbox/cpu/cpu.c
+++ b/arch/sandbox/cpu/cpu.c
@@ -4,6 +4,7 @@
  */
 
 #include <common.h>
+#include <cpu_legacy.h>
 #include <dm.h>
 #include <errno.h>
 #include <linux/libfdt.h>
diff --git a/arch/x86/cpu/quark/dram.c b/arch/x86/cpu/quark/dram.c
index 51f9659ab15..1c5d6a963c9 100644
--- a/arch/x86/cpu/quark/dram.c
+++ b/arch/x86/cpu/quark/dram.c
@@ -4,6 +4,7 @@
  */
 
 #include <common.h>
+#include <cpu_legacy.h>
 #include <errno.h>
 #include <fdtdec.h>
 #include <malloc.h>
diff --git a/arch/x86/cpu/quark/quark.c b/arch/x86/cpu/quark/quark.c
index f598666a6b0..91b68433d4d 100644
--- a/arch/x86/cpu/quark/quark.c
+++ b/arch/x86/cpu/quark/quark.c
@@ -5,6 +5,7 @@
 
 #include <common.h>
 #include <cpu.h>
+#include <cpu_legacy.h>
 #include <mmc.h>
 #include <asm/io.h>
 #include <asm/ioapic.h>
diff --git a/arch/xtensa/lib/bootm.c b/arch/xtensa/lib/bootm.c
index 93eea53c5f2..c62612709a5 100644
--- a/arch/xtensa/lib/bootm.c
+++ b/arch/xtensa/lib/bootm.c
@@ -6,6 +6,7 @@
 
 #include <common.h>
 #include <command.h>
+#include <cpu_legacy.h>
 #include <env.h>
 #include <u-boot/zlib.h>
 #include <asm/byteorder.h>
diff --git a/board/Arcturus/ucp1020/cmd_arc.c b/board/Arcturus/ucp1020/cmd_arc.c
index 2e8477ed3b7..e2b65052e82 100644
--- a/board/Arcturus/ucp1020/cmd_arc.c
+++ b/board/Arcturus/ucp1020/cmd_arc.c
@@ -9,6 +9,7 @@
  */
 
 #include <common.h>
+#include <cpu_legacy.h>
 #include <div64.h>
 #include <env.h>
 #include <malloc.h>
diff --git a/board/beckhoff/mx53cx9020/mx53cx9020.c b/board/beckhoff/mx53cx9020/mx53cx9020.c
index 9450d925f6f..73cf8b1194a 100644
--- a/board/beckhoff/mx53cx9020/mx53cx9020.c
+++ b/board/beckhoff/mx53cx9020/mx53cx9020.c
@@ -8,6 +8,7 @@
  */
 
 #include <common.h>
+#include <cpu_legacy.h>
 #include <asm/arch/sys_proto.h>
 #include <asm/arch/clock.h>
 #include <asm/arch/iomux-mx53.h>
diff --git a/board/broadcom/bcmstb/bcmstb.c b/board/broadcom/bcmstb/bcmstb.c
index 23500dfa698..6af49a368d9 100644
--- a/board/broadcom/bcmstb/bcmstb.c
+++ b/board/broadcom/bcmstb/bcmstb.c
@@ -6,6 +6,7 @@
  * Author: Thomas Fitzsimmons <fitzsim at fitzsim.org>
  */
 
+#include <cpu_legacy.h>
 #include <time.h>
 #include <linux/types.h>
 #include <common.h>
diff --git a/board/cirrus/edb93xx/edb93xx.c b/board/cirrus/edb93xx/edb93xx.c
index 64d8e4d9f76..35893bd0b03 100644
--- a/board/cirrus/edb93xx/edb93xx.c
+++ b/board/cirrus/edb93xx/edb93xx.c
@@ -16,6 +16,7 @@
 #include <config.h>
 #include <common.h>
 #include <cpu_legacy.h>
+#include <irq_legacy.h>
 #include <netdev.h>
 #include <status_led.h>
 #include <asm/io.h>
diff --git a/board/phytec/pfla02/pfla02.c b/board/phytec/pfla02/pfla02.c
index ae9ffe0390c..57de1f8e556 100644
--- a/board/phytec/pfla02/pfla02.c
+++ b/board/phytec/pfla02/pfla02.c
@@ -4,6 +4,7 @@
  */
 
 #include <common.h>
+#include <cpu_legacy.h>
 #include <asm/io.h>
 #include <asm/arch/clock.h>
 #include <asm/arch/imx-regs.h>
diff --git a/board/sandbox/sandbox.c b/board/sandbox/sandbox.c
index 9ca1eca027a..68e8071d262 100644
--- a/board/sandbox/sandbox.c
+++ b/board/sandbox/sandbox.c
@@ -4,6 +4,7 @@
  */
 
 #include <common.h>
+#include <cpu_legacy.h>
 #include <cros_ec.h>
 #include <dm.h>
 #include <led.h>
diff --git a/cmd/disk.c b/cmd/disk.c
index 9e635c1172d..afb633faa39 100644
--- a/cmd/disk.c
+++ b/cmd/disk.c
@@ -5,6 +5,7 @@
  */
 #include <common.h>
 #include <command.h>
+#include <cpu_legacy.h>
 #include <part.h>
 
 int common_diskboot(cmd_tbl_t *cmdtp, const char *intf, int argc,
diff --git a/cmd/load.c b/cmd/load.c
index 5811a99310a..c120231538c 100644
--- a/cmd/load.c
+++ b/cmd/load.c
@@ -10,6 +10,7 @@
 #include <common.h>
 #include <command.h>
 #include <console.h>
+#include <cpu_legacy.h>
 #include <env.h>
 #include <s_record.h>
 #include <net.h>
diff --git a/cmd/ximg.c b/cmd/ximg.c
index a9481004f03..3f67aa98f52 100644
--- a/cmd/ximg.c
+++ b/cmd/ximg.c
@@ -13,6 +13,7 @@
  */
 #include <common.h>
 #include <command.h>
+#include <cpu_legacy.h>
 #include <env.h>
 #include <gzip.h>
 #include <image.h>
diff --git a/common/avb_verify.c b/common/avb_verify.c
index 36898a610f8..2f5bd576ec3 100644
--- a/common/avb_verify.c
+++ b/common/avb_verify.c
@@ -6,6 +6,7 @@
 
 #include <avb_verify.h>
 #include <blk.h>
+#include <cpu_legacy.h>
 #include <fastboot.h>
 #include <image.h>
 #include <malloc.h>
diff --git a/common/board_r.c b/common/board_r.c
index 3b98fac4af4..1aee896e438 100644
--- a/common/board_r.c
+++ b/common/board_r.c
@@ -11,6 +11,7 @@
 
 #include <common.h>
 #include <api.h>
+#include <cpu_legacy.h>
 #include <u-boot/crc.h>
 /* TODO: can we just include all these headers whether needed or not? */
 #if defined(CONFIG_CMD_BEDBUG)
diff --git a/common/bootm.c b/common/bootm.c
index 02295daf79f..b031c5ce205 100644
--- a/common/bootm.c
+++ b/common/bootm.c
@@ -7,6 +7,7 @@
 #ifndef USE_HOSTCC
 #include <common.h>
 #include <bootstage.h>
+#include <cpu_legacy.h>
 #include <env.h>
 #include <errno.h>
 #include <fdt_support.h>
diff --git a/common/bouncebuf.c b/common/bouncebuf.c
index a7098e2caf4..8363613b007 100644
--- a/common/bouncebuf.c
+++ b/common/bouncebuf.c
@@ -6,6 +6,7 @@
  */
 
 #include <common.h>
+#include <cpu_legacy.h>
 #include <malloc.h>
 #include <errno.h>
 #include <bouncebuf.h>
diff --git a/common/image.c b/common/image.c
index 70be47e2518..c2978186cd2 100644
--- a/common/image.c
+++ b/common/image.c
@@ -8,6 +8,7 @@
 
 #ifndef USE_HOSTCC
 #include <common.h>
+#include <cpu_legacy.h>
 #include <env.h>
 #include <u-boot/crc.h>
 #include <watchdog.h>
diff --git a/common/lcd.c b/common/lcd.c
index b34754fe518..6e1f471231d 100644
--- a/common/lcd.c
+++ b/common/lcd.c
@@ -10,6 +10,7 @@
 #include <config.h>
 #include <common.h>
 #include <command.h>
+#include <cpu_legacy.h>
 #include <env_callback.h>
 #include <linux/types.h>
 #include <stdio_dev.h>
diff --git a/common/spl/spl_opensbi.c b/common/spl/spl_opensbi.c
index a6b4480ed22..7bb91c064dc 100644
--- a/common/spl/spl_opensbi.c
+++ b/common/spl/spl_opensbi.c
@@ -6,6 +6,7 @@
  * Based on common/spl/spl_atf.c
  */
 #include <common.h>
+#include <cpu_legacy.h>
 #include <errno.h>
 #include <spl.h>
 #include <asm/smp.h>
diff --git a/common/update.c b/common/update.c
index 457b29f42aa..fe116626798 100644
--- a/common/update.c
+++ b/common/update.c
@@ -7,6 +7,7 @@
  */
 
 #include <common.h>
+#include <cpu_legacy.h>
 
 #if !(defined(CONFIG_FIT) && defined(CONFIG_OF_LIBFDT))
 #error "CONFIG_FIT and CONFIG_OF_LIBFDT are required for auto-update feature"
diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c
index 9a08575053d..ebee137e241 100644
--- a/drivers/ata/ahci.c
+++ b/drivers/ata/ahci.c
@@ -9,6 +9,7 @@
  * This driver provides a SCSI interface to SATA.
  */
 #include <common.h>
+#include <cpu_legacy.h>
 
 #include <command.h>
 #include <dm.h>
diff --git a/drivers/ata/dwc_ahsata.c b/drivers/ata/dwc_ahsata.c
index afced8e7e3f..b17c3da9d6d 100644
--- a/drivers/ata/dwc_ahsata.c
+++ b/drivers/ata/dwc_ahsata.c
@@ -6,6 +6,7 @@
 
 #include <common.h>
 #include <ahci.h>
+#include <cpu_legacy.h>
 #include <dm.h>
 #include <dwc_ahsata.h>
 #include <fis.h>
diff --git a/drivers/ata/fsl_ahci.c b/drivers/ata/fsl_ahci.c
index d04cff3ee71..02bcb19dc86 100644
--- a/drivers/ata/fsl_ahci.c
+++ b/drivers/ata/fsl_ahci.c
@@ -6,6 +6,7 @@
  *
  */
 #include <common.h>
+#include <cpu_legacy.h>
 #include <asm/fsl_serdes.h>
 #include <dm/lists.h>
 #include <dm.h>
diff --git a/drivers/ata/fsl_sata.c b/drivers/ata/fsl_sata.c
index e70a515effd..1c97e932f67 100644
--- a/drivers/ata/fsl_sata.c
+++ b/drivers/ata/fsl_sata.c
@@ -7,6 +7,7 @@
 #include <common.h>
 #include <command.h>
 #include <console.h>
+#include <cpu_legacy.h>
 #include <asm/io.h>
 #include <asm/processor.h>
 #include <asm/fsl_serdes.h>
diff --git a/drivers/ata/sata_mv.c b/drivers/ata/sata_mv.c
index 2a630d46c14..435fdacce38 100644
--- a/drivers/ata/sata_mv.c
+++ b/drivers/ata/sata_mv.c
@@ -33,6 +33,7 @@
 
 #include <common.h>
 #include <ahci.h>
+#include <cpu_legacy.h>
 #include <dm.h>
 #include <dm/device-internal.h>
 #include <dm/lists.h>
diff --git a/drivers/ata/sata_sil.c b/drivers/ata/sata_sil.c
index a8598d9f21d..b42bd929dd5 100644
--- a/drivers/ata/sata_sil.c
+++ b/drivers/ata/sata_sil.c
@@ -5,6 +5,7 @@
  */
 
 #include <common.h>
+#include <cpu_legacy.h>
 #include <pci.h>
 #include <command.h>
 #include <asm/byteorder.h>
diff --git a/drivers/bootcount/bootcount.c b/drivers/bootcount/bootcount.c
index 66c1284c5bb..9c459b5b372 100644
--- a/drivers/bootcount/bootcount.c
+++ b/drivers/bootcount/bootcount.c
@@ -5,6 +5,7 @@
  */
 
 #include <bootcount.h>
+#include <cpu_legacy.h>
 #include <linux/compiler.h>
 
 /* Now implement the generic default functions */
diff --git a/drivers/bootcount/bootcount_ram.c b/drivers/bootcount/bootcount_ram.c
index edef36724b0..1895bc0f6a3 100644
--- a/drivers/bootcount/bootcount_ram.c
+++ b/drivers/bootcount/bootcount_ram.c
@@ -5,6 +5,7 @@
  */
 
 #include <common.h>
+#include <cpu_legacy.h>
 #include <asm/io.h>
 
 DECLARE_GLOBAL_DATA_PTR;
diff --git a/drivers/core/device.c b/drivers/core/device.c
index 05dadf98f95..983ec9840ef 100644
--- a/drivers/core/device.c
+++ b/drivers/core/device.c
@@ -9,6 +9,7 @@
  */
 
 #include <common.h>
+#include <cpu_legacy.h>
 #include <asm/io.h>
 #include <clk.h>
 #include <fdtdec.h>
diff --git a/drivers/crypto/fsl/fsl_blob.c b/drivers/crypto/fsl/fsl_blob.c
index ce6aa05fe7f..9726df17f54 100644
--- a/drivers/crypto/fsl/fsl_blob.c
+++ b/drivers/crypto/fsl/fsl_blob.c
@@ -5,6 +5,7 @@
  */
 
 #include <common.h>
+#include <cpu_legacy.h>
 #include <malloc.h>
 #include <memalign.h>
 #include <fsl_sec.h>
diff --git a/drivers/crypto/fsl/fsl_hash.c b/drivers/crypto/fsl/fsl_hash.c
index c2686df02f1..f0f8c3bd989 100644
--- a/drivers/crypto/fsl/fsl_hash.c
+++ b/drivers/crypto/fsl/fsl_hash.c
@@ -5,6 +5,7 @@
  */
 
 #include <common.h>
+#include <cpu_legacy.h>
 #include <malloc.h>
 #include <memalign.h>
 #include "jobdesc.h"
diff --git a/drivers/crypto/fsl/jobdesc.c b/drivers/crypto/fsl/jobdesc.c
index 317f73c42bd..8c4e313559e 100644
--- a/drivers/crypto/fsl/jobdesc.c
+++ b/drivers/crypto/fsl/jobdesc.c
@@ -8,6 +8,7 @@
  */
 
 #include <common.h>
+#include <cpu_legacy.h>
 #include <fsl_sec.h>
 #include "desc_constr.h"
 #include "jobdesc.h"
diff --git a/drivers/crypto/fsl/jr.c b/drivers/crypto/fsl/jr.c
index 1ea9db6850f..13336a25e1b 100644
--- a/drivers/crypto/fsl/jr.c
+++ b/drivers/crypto/fsl/jr.c
@@ -6,6 +6,7 @@
  */
 
 #include <common.h>
+#include <cpu_legacy.h>
 #include <malloc.h>
 #include "fsl_sec.h"
 #include "jr.h"
diff --git a/drivers/dma/apbh_dma.c b/drivers/dma/apbh_dma.c
index ac589feeb7d..5755965a9fe 100644
--- a/drivers/dma/apbh_dma.c
+++ b/drivers/dma/apbh_dma.c
@@ -9,6 +9,7 @@
  * Copyright (C) 2010 Freescale Semiconductor, Inc. All Rights Reserved.
  */
 
+#include <cpu_legacy.h>
 #include <linux/list.h>
 
 #include <common.h>
diff --git a/drivers/dma/bcm6348-iudma.c b/drivers/dma/bcm6348-iudma.c
index e7bd1b2350f..ea803493edb 100644
--- a/drivers/dma/bcm6348-iudma.c
+++ b/drivers/dma/bcm6348-iudma.c
@@ -17,6 +17,7 @@
 
 #include <common.h>
 #include <clk.h>
+#include <cpu_legacy.h>
 #include <dm.h>
 #include <dma-uclass.h>
 #include <memalign.h>
diff --git a/drivers/dma/dma-uclass.c b/drivers/dma/dma-uclass.c
index 9c961cf1e2c..8f81cc1eec9 100644
--- a/drivers/dma/dma-uclass.c
+++ b/drivers/dma/dma-uclass.c
@@ -10,6 +10,7 @@
  */
 
 #include <common.h>
+#include <cpu_legacy.h>
 #include <dm.h>
 #include <dm/read.h>
 #include <dma-uclass.h>
diff --git a/drivers/dma/ti/k3-udma.c b/drivers/dma/ti/k3-udma.c
index a5fc7809bc4..fe486d2cc10 100644
--- a/drivers/dma/ti/k3-udma.c
+++ b/drivers/dma/ti/k3-udma.c
@@ -6,6 +6,7 @@
 #define pr_fmt(fmt) "udma: " fmt
 
 #include <common.h>
+#include <cpu_legacy.h>
 #include <asm/io.h>
 #include <asm/bitops.h>
 #include <malloc.h>
diff --git a/drivers/fpga/zynqmppl.c b/drivers/fpga/zynqmppl.c
index 22bfdd8dce6..a957e1ce479 100644
--- a/drivers/fpga/zynqmppl.c
+++ b/drivers/fpga/zynqmppl.c
@@ -7,6 +7,7 @@
 
 #include <console.h>
 #include <common.h>
+#include <cpu_legacy.h>
 #include <zynqmppl.h>
 #include <linux/sizes.h>
 #include <asm/arch/sys_proto.h>
diff --git a/drivers/mmc/dw_mmc.c b/drivers/mmc/dw_mmc.c
index ebe7bcdd900..584e14f932f 100644
--- a/drivers/mmc/dw_mmc.c
+++ b/drivers/mmc/dw_mmc.c
@@ -7,6 +7,7 @@
 
 #include <bouncebuf.h>
 #include <common.h>
+#include <cpu_legacy.h>
 #include <errno.h>
 #include <malloc.h>
 #include <memalign.h>
diff --git a/drivers/mmc/fsl_esdhc.c b/drivers/mmc/fsl_esdhc.c
index 28d2312ef75..045dde319c6 100644
--- a/drivers/mmc/fsl_esdhc.c
+++ b/drivers/mmc/fsl_esdhc.c
@@ -13,6 +13,7 @@
 #include <common.h>
 #include <command.h>
 #include <clk.h>
+#include <cpu_legacy.h>
 #include <errno.h>
 #include <hwconfig.h>
 #include <mmc.h>
diff --git a/drivers/mmc/fsl_esdhc_imx.c b/drivers/mmc/fsl_esdhc_imx.c
index 43106dec756..91c19d7c8a7 100644
--- a/drivers/mmc/fsl_esdhc_imx.c
+++ b/drivers/mmc/fsl_esdhc_imx.c
@@ -14,6 +14,7 @@
 #include <common.h>
 #include <command.h>
 #include <clk.h>
+#include <cpu_legacy.h>
 #include <errno.h>
 #include <hwconfig.h>
 #include <mmc.h>
diff --git a/drivers/mmc/fsl_esdhc_spl.c b/drivers/mmc/fsl_esdhc_spl.c
index 4557cd3dd78..dc374b2eed8 100644
--- a/drivers/mmc/fsl_esdhc_spl.c
+++ b/drivers/mmc/fsl_esdhc_spl.c
@@ -4,6 +4,7 @@
  */
 
 #include <common.h>
+#include <cpu_legacy.h>
 #include <mmc.h>
 #include <malloc.h>
 
diff --git a/drivers/mmc/meson_gx_mmc.c b/drivers/mmc/meson_gx_mmc.c
index 767dfff8055..f1c3e6b894e 100644
--- a/drivers/mmc/meson_gx_mmc.c
+++ b/drivers/mmc/meson_gx_mmc.c
@@ -4,6 +4,7 @@
  */
 
 #include <common.h>
+#include <cpu_legacy.h>
 #include <dm.h>
 #include <fdtdec.h>
 #include <malloc.h>
diff --git a/drivers/mmc/omap_hsmmc.c b/drivers/mmc/omap_hsmmc.c
index bade129aea9..bdc92ecb9b7 100644
--- a/drivers/mmc/omap_hsmmc.c
+++ b/drivers/mmc/omap_hsmmc.c
@@ -24,6 +24,7 @@
 
 #include <config.h>
 #include <common.h>
+#include <cpu_legacy.h>
 #include <malloc.h>
 #include <memalign.h>
 #include <mmc.h>
diff --git a/drivers/mmc/sdhci.c b/drivers/mmc/sdhci.c
index fbc576fd726..8d93a3efa47 100644
--- a/drivers/mmc/sdhci.c
+++ b/drivers/mmc/sdhci.c
@@ -8,6 +8,7 @@
  */
 
 #include <common.h>
+#include <cpu_legacy.h>
 #include <dm.h>
 #include <errno.h>
 #include <malloc.h>
diff --git a/drivers/mmc/stm32_sdmmc2.c b/drivers/mmc/stm32_sdmmc2.c
index 32434a4762f..d1acc45f5a8 100644
--- a/drivers/mmc/stm32_sdmmc2.c
+++ b/drivers/mmc/stm32_sdmmc2.c
@@ -6,6 +6,7 @@
 
 #include <common.h>
 #include <clk.h>
+#include <cpu_legacy.h>
 #include <dm.h>
 #include <fdtdec.h>
 #include <linux/libfdt.h>
diff --git a/drivers/mmc/tmio-common.c b/drivers/mmc/tmio-common.c
index 812205a21f6..75967445cd5 100644
--- a/drivers/mmc/tmio-common.c
+++ b/drivers/mmc/tmio-common.c
@@ -6,6 +6,7 @@
 
 #include <common.h>
 #include <clk.h>
+#include <cpu_legacy.h>
 #include <fdtdec.h>
 #include <mmc.h>
 #include <dm.h>
diff --git a/drivers/mtd/nand/raw/denali.c b/drivers/mtd/nand/raw/denali.c
index e0eb1339ecd..eb1d50c8c60 100644
--- a/drivers/mtd/nand/raw/denali.c
+++ b/drivers/mtd/nand/raw/denali.c
@@ -5,6 +5,7 @@
  * Copyright (C) 2009-2010, Intel Corporation and its suppliers.
  */
 
+#include <cpu_legacy.h>
 #include <dm.h>
 #include <nand.h>
 #include <linux/bitfield.h>
diff --git a/drivers/mtd/nand/raw/fsl_elbc_spl.c b/drivers/mtd/nand/raw/fsl_elbc_spl.c
index 099d86427c5..523173174d6 100644
--- a/drivers/mtd/nand/raw/fsl_elbc_spl.c
+++ b/drivers/mtd/nand/raw/fsl_elbc_spl.c
@@ -10,6 +10,7 @@
  */
 
 #include <common.h>
+#include <cpu_legacy.h>
 #include <asm/io.h>
 #include <asm/fsl_lbc.h>
 #include <nand.h>
diff --git a/drivers/mtd/nand/raw/fsl_ifc_spl.c b/drivers/mtd/nand/raw/fsl_ifc_spl.c
index 7137eb4108c..c97beec581b 100644
--- a/drivers/mtd/nand/raw/fsl_ifc_spl.c
+++ b/drivers/mtd/nand/raw/fsl_ifc_spl.c
@@ -7,6 +7,7 @@
  */
 
 #include <common.h>
+#include <cpu_legacy.h>
 #include <asm/io.h>
 #include <fsl_ifc.h>
 #include <linux/mtd/rawnand.h>
diff --git a/drivers/mtd/nand/raw/mxs_nand.c b/drivers/mtd/nand/raw/mxs_nand.c
index a41b9620d0a..06f212452dc 100644
--- a/drivers/mtd/nand/raw/mxs_nand.c
+++ b/drivers/mtd/nand/raw/mxs_nand.c
@@ -13,6 +13,7 @@
  */
 
 #include <common.h>
+#include <cpu_legacy.h>
 #include <dm.h>
 #include <linux/mtd/rawnand.h>
 #include <linux/sizes.h>
diff --git a/drivers/mtd/pic32_flash.c b/drivers/mtd/pic32_flash.c
index 5c55f1557f5..910aa53a640 100644
--- a/drivers/mtd/pic32_flash.c
+++ b/drivers/mtd/pic32_flash.c
@@ -6,6 +6,7 @@
  */
 
 #include <common.h>
+#include <cpu_legacy.h>
 #include <dm.h>
 #include <fdt_support.h>
 #include <flash.h>
diff --git a/drivers/mtd/spi/fsl_espi_spl.c b/drivers/mtd/spi/fsl_espi_spl.c
index b90e6a5527a..6b31029776d 100644
--- a/drivers/mtd/spi/fsl_espi_spl.c
+++ b/drivers/mtd/spi/fsl_espi_spl.c
@@ -4,6 +4,7 @@
  */
 
 #include <common.h>
+#include <cpu_legacy.h>
 #include <spi_flash.h>
 #include <malloc.h>
 
diff --git a/drivers/net/ag7xxx.c b/drivers/net/ag7xxx.c
index 7f1dee4b3e4..c7c398f85b0 100644
--- a/drivers/net/ag7xxx.c
+++ b/drivers/net/ag7xxx.c
@@ -7,6 +7,7 @@
  */
 
 #include <common.h>
+#include <cpu_legacy.h>
 #include <dm.h>
 #include <errno.h>
 #include <miiphy.h>
diff --git a/drivers/net/altera_tse.c b/drivers/net/altera_tse.c
index fb878d4e636..d27b4873dea 100644
--- a/drivers/net/altera_tse.c
+++ b/drivers/net/altera_tse.c
@@ -9,6 +9,7 @@
  * published by the Free Software Foundation.
  */
 #include <common.h>
+#include <cpu_legacy.h>
 #include <dm.h>
 #include <errno.h>
 #include <fdt_support.h>
diff --git a/drivers/net/bcm-sf2-eth-gmac.c b/drivers/net/bcm-sf2-eth-gmac.c
index db3e79ade37..98034393ca4 100644
--- a/drivers/net/bcm-sf2-eth-gmac.c
+++ b/drivers/net/bcm-sf2-eth-gmac.c
@@ -11,6 +11,7 @@
 
 #include <config.h>
 #include <common.h>
+#include <cpu_legacy.h>
 #include <malloc.h>
 #include <net.h>
 #include <asm/io.h>
diff --git a/drivers/net/designware.c b/drivers/net/designware.c
index 145eeac45fd..6ef41d5ee06 100644
--- a/drivers/net/designware.c
+++ b/drivers/net/designware.c
@@ -10,6 +10,7 @@
 
 #include <common.h>
 #include <clk.h>
+#include <cpu_legacy.h>
 #include <dm.h>
 #include <errno.h>
 #include <miiphy.h>
diff --git a/drivers/net/dwc_eth_qos.c b/drivers/net/dwc_eth_qos.c
index 455709338ce..5289ce01e7e 100644
--- a/drivers/net/dwc_eth_qos.c
+++ b/drivers/net/dwc_eth_qos.c
@@ -28,6 +28,7 @@
  */
 #include <common.h>
 #include <clk.h>
+#include <cpu_legacy.h>
 #include <dm.h>
 #include <errno.h>
 #include <memalign.h>
diff --git a/drivers/net/e1000.c b/drivers/net/e1000.c
index a34f6974611..0cba942afc8 100644
--- a/drivers/net/e1000.c
+++ b/drivers/net/e1000.c
@@ -30,6 +30,7 @@ tested on both gig copper and gig fiber boards
  */
 
 #include <common.h>
+#include <cpu_legacy.h>
 #include <dm.h>
 #include <errno.h>
 #include <memalign.h>
diff --git a/drivers/net/ethoc.c b/drivers/net/ethoc.c
index 3d43a58d4af..bae481977be 100644
--- a/drivers/net/ethoc.c
+++ b/drivers/net/ethoc.c
@@ -10,6 +10,7 @@
  */
 
 #include <common.h>
+#include <cpu_legacy.h>
 #include <dm.h>
 #include <dm/platform_data/net_ethoc.h>
 #include <linux/io.h>
diff --git a/drivers/net/fec_mxc.c b/drivers/net/fec_mxc.c
index 080dbcf7db4..04020cfe80b 100644
--- a/drivers/net/fec_mxc.c
+++ b/drivers/net/fec_mxc.c
@@ -8,6 +8,7 @@
  */
 
 #include <common.h>
+#include <cpu_legacy.h>
 #include <dm.h>
 #include <env.h>
 #include <malloc.h>
diff --git a/drivers/net/fsl-mc/mc.c b/drivers/net/fsl-mc/mc.c
index c980ba4edb9..1a06fad8725 100644
--- a/drivers/net/fsl-mc/mc.c
+++ b/drivers/net/fsl-mc/mc.c
@@ -5,6 +5,7 @@
  * Copyright 2017-2018 NXP
  */
 #include <common.h>
+#include <cpu_legacy.h>
 #include <env.h>
 #include <errno.h>
 #include <linux/bug.h>
diff --git a/drivers/net/ftgmac100.c b/drivers/net/ftgmac100.c
index 92c38a81bd3..2dbc66e8774 100644
--- a/drivers/net/ftgmac100.c
+++ b/drivers/net/ftgmac100.c
@@ -12,6 +12,7 @@
  */
 
 #include <clk.h>
+#include <cpu_legacy.h>
 #include <dm.h>
 #include <miiphy.h>
 #include <net.h>
diff --git a/drivers/net/ftmac100.c b/drivers/net/ftmac100.c
index d8f1dde6579..58f4dc79ce1 100644
--- a/drivers/net/ftmac100.c
+++ b/drivers/net/ftmac100.c
@@ -8,6 +8,7 @@
 
 #include <config.h>
 #include <common.h>
+#include <cpu_legacy.h>
 #include <env.h>
 #include <malloc.h>
 #include <net.h>
diff --git a/drivers/net/higmacv300.c b/drivers/net/higmacv300.c
index 1be8359133d..d7de4db14ac 100644
--- a/drivers/net/higmacv300.c
+++ b/drivers/net/higmacv300.c
@@ -3,6 +3,7 @@
  * Copyright (c) 2019, Linaro Limited
  */
 
+#include <cpu_legacy.h>
 #include <asm/io.h>
 #include <common.h>
 #include <console.h>
diff --git a/drivers/net/ldpaa_eth/ldpaa_eth.c b/drivers/net/ldpaa_eth/ldpaa_eth.c
index 34253e39249..21d1bbe53ac 100644
--- a/drivers/net/ldpaa_eth/ldpaa_eth.c
+++ b/drivers/net/ldpaa_eth/ldpaa_eth.c
@@ -5,6 +5,7 @@
  */
 
 #include <common.h>
+#include <cpu_legacy.h>
 #include <asm/io.h>
 #include <asm/types.h>
 #include <malloc.h>
diff --git a/drivers/net/macb.c b/drivers/net/macb.c
index 377188e361c..c21f6ee583d 100644
--- a/drivers/net/macb.c
+++ b/drivers/net/macb.c
@@ -4,6 +4,7 @@
  */
 #include <common.h>
 #include <clk.h>
+#include <cpu_legacy.h>
 #include <dm.h>
 
 /*
diff --git a/drivers/net/mt7628-eth.c b/drivers/net/mt7628-eth.c
index 7833b2f47aa..11e187a869a 100644
--- a/drivers/net/mt7628-eth.c
+++ b/drivers/net/mt7628-eth.c
@@ -14,6 +14,7 @@
  */
 
 #include <common.h>
+#include <cpu_legacy.h>
 #include <dm.h>
 #include <malloc.h>
 #include <miiphy.h>
diff --git a/drivers/net/mtk_eth.c b/drivers/net/mtk_eth.c
index 0ef814c78b9..c9a10beefa9 100644
--- a/drivers/net/mtk_eth.c
+++ b/drivers/net/mtk_eth.c
@@ -7,6 +7,7 @@
  */
 
 #include <common.h>
+#include <cpu_legacy.h>
 #include <dm.h>
 #include <malloc.h>
 #include <miiphy.h>
diff --git a/drivers/net/mvneta.c b/drivers/net/mvneta.c
index 333be8ff28b..e906d0d62f9 100644
--- a/drivers/net/mvneta.c
+++ b/drivers/net/mvneta.c
@@ -13,6 +13,7 @@
  */
 
 #include <common.h>
+#include <cpu_legacy.h>
 #include <dm.h>
 #include <net.h>
 #include <netdev.h>
diff --git a/drivers/net/mvpp2.c b/drivers/net/mvpp2.c
index bd89725e777..5b23c11714d 100644
--- a/drivers/net/mvpp2.c
+++ b/drivers/net/mvpp2.c
@@ -14,6 +14,7 @@
  */
 
 #include <common.h>
+#include <cpu_legacy.h>
 #include <dm.h>
 #include <dm/device-internal.h>
 #include <dm/lists.h>
diff --git a/drivers/net/pch_gbe.c b/drivers/net/pch_gbe.c
index 2286dd07e93..55810787438 100644
--- a/drivers/net/pch_gbe.c
+++ b/drivers/net/pch_gbe.c
@@ -6,6 +6,7 @@
  */
 
 #include <common.h>
+#include <cpu_legacy.h>
 #include <dm.h>
 #include <errno.h>
 #include <asm/io.h>
diff --git a/drivers/net/pcnet.c b/drivers/net/pcnet.c
index eda6743ec35..aff15ca6496 100644
--- a/drivers/net/pcnet.c
+++ b/drivers/net/pcnet.c
@@ -7,6 +7,7 @@
  */
 
 #include <common.h>
+#include <cpu_legacy.h>
 #include <malloc.h>
 #include <net.h>
 #include <netdev.h>
diff --git a/drivers/net/pic32_eth.c b/drivers/net/pic32_eth.c
index 39c4b10ab83..9d6b9e0d650 100644
--- a/drivers/net/pic32_eth.c
+++ b/drivers/net/pic32_eth.c
@@ -4,6 +4,7 @@
  *
  */
 #include <common.h>
+#include <cpu_legacy.h>
 #include <errno.h>
 #include <dm.h>
 #include <net.h>
diff --git a/drivers/net/ravb.c b/drivers/net/ravb.c
index 11abe5e0c9e..51c975b1cf9 100644
--- a/drivers/net/ravb.c
+++ b/drivers/net/ravb.c
@@ -10,6 +10,7 @@
 
 #include <common.h>
 #include <clk.h>
+#include <cpu_legacy.h>
 #include <dm.h>
 #include <errno.h>
 #include <miiphy.h>
diff --git a/drivers/net/rtl8139.c b/drivers/net/rtl8139.c
index 13309970e2c..f1250199024 100644
--- a/drivers/net/rtl8139.c
+++ b/drivers/net/rtl8139.c
@@ -72,6 +72,7 @@
 */
 
 #include <common.h>
+#include <cpu_legacy.h>
 #include <malloc.h>
 #include <net.h>
 #include <netdev.h>
diff --git a/drivers/net/rtl8169.c b/drivers/net/rtl8169.c
index 521e5909a25..9d32ba13a6e 100644
--- a/drivers/net/rtl8169.c
+++ b/drivers/net/rtl8169.c
@@ -40,6 +40,7 @@
  * Modified to use le32_to_cpu and cpu_to_le32 properly
  */
 #include <common.h>
+#include <cpu_legacy.h>
 #include <dm.h>
 #include <errno.h>
 #include <malloc.h>
diff --git a/drivers/net/sh_eth.c b/drivers/net/sh_eth.c
index 749f6519208..93acb86082e 100644
--- a/drivers/net/sh_eth.c
+++ b/drivers/net/sh_eth.c
@@ -10,6 +10,7 @@
 
 #include <config.h>
 #include <common.h>
+#include <cpu_legacy.h>
 #include <env.h>
 #include <malloc.h>
 #include <net.h>
diff --git a/drivers/net/sni_ave.c b/drivers/net/sni_ave.c
index ba51ea5e386..a0c1bba6a6a 100644
--- a/drivers/net/sni_ave.c
+++ b/drivers/net/sni_ave.c
@@ -5,6 +5,7 @@
  */
 
 #include <clk.h>
+#include <cpu_legacy.h>
 #include <dm.h>
 #include <fdt_support.h>
 #include <linux/io.h>
diff --git a/drivers/net/sun8i_emac.c b/drivers/net/sun8i_emac.c
index 0629b16e57c..1dd8a5eca62 100644
--- a/drivers/net/sun8i_emac.c
+++ b/drivers/net/sun8i_emac.c
@@ -10,6 +10,7 @@
  *
 */
 
+#include <cpu_legacy.h>
 #include <asm/io.h>
 #include <asm/arch/clock.h>
 #include <asm/arch/gpio.h>
diff --git a/drivers/net/ti/cpsw.c b/drivers/net/ti/cpsw.c
index 20ddb44dd89..df5a8f4346a 100644
--- a/drivers/net/ti/cpsw.c
+++ b/drivers/net/ti/cpsw.c
@@ -7,6 +7,7 @@
 
 #include <common.h>
 #include <command.h>
+#include <cpu_legacy.h>
 #include <net.h>
 #include <miiphy.h>
 #include <malloc.h>
diff --git a/drivers/net/ti/davinci_emac.c b/drivers/net/ti/davinci_emac.c
index 2bd9c51079d..98628ced444 100644
--- a/drivers/net/ti/davinci_emac.c
+++ b/drivers/net/ti/davinci_emac.c
@@ -23,6 +23,7 @@
  */
 #include <common.h>
 #include <command.h>
+#include <cpu_legacy.h>
 #include <net.h>
 #include <miiphy.h>
 #include <malloc.h>
diff --git a/drivers/net/xilinx_axi_emac.c b/drivers/net/xilinx_axi_emac.c
index 26c21c6d70f..bc5aa24f00c 100644
--- a/drivers/net/xilinx_axi_emac.c
+++ b/drivers/net/xilinx_axi_emac.c
@@ -7,6 +7,7 @@
 
 #include <config.h>
 #include <common.h>
+#include <cpu_legacy.h>
 #include <dm.h>
 #include <net.h>
 #include <malloc.h>
diff --git a/drivers/net/zynq_gem.c b/drivers/net/zynq_gem.c
index 033efb81956..0d9985eedce 100644
--- a/drivers/net/zynq_gem.c
+++ b/drivers/net/zynq_gem.c
@@ -10,6 +10,7 @@
 
 #include <clk.h>
 #include <common.h>
+#include <cpu_legacy.h>
 #include <dm.h>
 #include <net.h>
 #include <netdev.h>
diff --git a/drivers/nvme/nvme.c b/drivers/nvme/nvme.c
index f279c758683..9296800c2b4 100644
--- a/drivers/nvme/nvme.c
+++ b/drivers/nvme/nvme.c
@@ -5,6 +5,7 @@
  */
 
 #include <common.h>
+#include <cpu_legacy.h>
 #include <dm.h>
 #include <errno.h>
 #include <memalign.h>
diff --git a/drivers/remoteproc/rproc-elf-loader.c b/drivers/remoteproc/rproc-elf-loader.c
index 67937a75957..e83de62c927 100644
--- a/drivers/remoteproc/rproc-elf-loader.c
+++ b/drivers/remoteproc/rproc-elf-loader.c
@@ -3,6 +3,7 @@
  * Copyright (C) 2019, STMicroelectronics - All Rights Reserved
  */
 #include <common.h>
+#include <cpu_legacy.h>
 #include <dm.h>
 #include <elf.h>
 #include <remoteproc.h>
diff --git a/drivers/spi/mxs_spi.c b/drivers/spi/mxs_spi.c
index 3a9756fbf1b..77c8fabeb72 100644
--- a/drivers/spi/mxs_spi.c
+++ b/drivers/spi/mxs_spi.c
@@ -13,6 +13,7 @@
  */
 
 #include <common.h>
+#include <cpu_legacy.h>
 #include <malloc.h>
 #include <memalign.h>
 #include <spi.h>
diff --git a/drivers/spi/ti_qspi.c b/drivers/spi/ti_qspi.c
index 77fa17ee8ab..fdaad40a8b4 100644
--- a/drivers/spi/ti_qspi.c
+++ b/drivers/spi/ti_qspi.c
@@ -6,6 +6,7 @@
  */
 
 #include <common.h>
+#include <cpu_legacy.h>
 #include <asm/io.h>
 #include <asm/arch/omap.h>
 #include <malloc.h>
diff --git a/drivers/spi/zynqmp_gqspi.c b/drivers/spi/zynqmp_gqspi.c
index 04ea42cbccc..c6e393139df 100644
--- a/drivers/spi/zynqmp_gqspi.c
+++ b/drivers/spi/zynqmp_gqspi.c
@@ -6,6 +6,7 @@
  */
 
 #include <common.h>
+#include <cpu_legacy.h>
 #include <asm/arch/clk.h>
 #include <asm/arch/hardware.h>
 #include <asm/arch/sys_proto.h>
diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c
index 56e2a046bf0..b5b9d6f75b5 100644
--- a/drivers/usb/dwc3/core.c
+++ b/drivers/usb/dwc3/core.c
@@ -14,6 +14,7 @@
  */
 
 #include <common.h>
+#include <cpu_legacy.h>
 #include <malloc.h>
 #include <dwc3-uboot.h>
 #include <asm/dma-mapping.h>
diff --git a/drivers/usb/dwc3/dwc3-generic.c b/drivers/usb/dwc3/dwc3-generic.c
index 406bf0b3628..ef431083a90 100644
--- a/drivers/usb/dwc3/dwc3-generic.c
+++ b/drivers/usb/dwc3/dwc3-generic.c
@@ -8,6 +8,7 @@
  */
 
 #include <common.h>
+#include <cpu_legacy.h>
 #include <asm-generic/io.h>
 #include <dm.h>
 #include <dm/device-internal.h>
diff --git a/drivers/usb/dwc3/ep0.c b/drivers/usb/dwc3/ep0.c
index 818efb3e8d7..cfc73f3992b 100644
--- a/drivers/usb/dwc3/ep0.c
+++ b/drivers/usb/dwc3/ep0.c
@@ -13,6 +13,7 @@
  * commit c00552ebaf : Merge 3.18-rc7 into usb-next
  */
 #include <common.h>
+#include <cpu_legacy.h>
 #include <linux/kernel.h>
 #include <linux/list.h>
 
diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
index 085f7b89688..742e114b55b 100644
--- a/drivers/usb/dwc3/gadget.c
+++ b/drivers/usb/dwc3/gadget.c
@@ -14,6 +14,7 @@
  */
 
 #include <common.h>
+#include <cpu_legacy.h>
 #include <malloc.h>
 #include <asm/dma-mapping.h>
 #include <linux/bug.h>
diff --git a/drivers/usb/dwc3/io.h b/drivers/usb/dwc3/io.h
index f660d53231b..7fbc886233c 100644
--- a/drivers/usb/dwc3/io.h
+++ b/drivers/usb/dwc3/io.h
@@ -17,6 +17,7 @@
 #ifndef __DRIVERS_USB_DWC3_IO_H
 #define __DRIVERS_USB_DWC3_IO_H
 
+#include <cpu_legacy.h>
 #include <asm/io.h>
 
 #define	CACHELINE_SIZE		CONFIG_SYS_CACHELINE_SIZE
diff --git a/drivers/usb/gadget/ci_udc.c b/drivers/usb/gadget/ci_udc.c
index bd596ce9773..e3bf6d5dec5 100644
--- a/drivers/usb/gadget/ci_udc.c
+++ b/drivers/usb/gadget/ci_udc.c
@@ -10,6 +10,7 @@
 #include <common.h>
 #include <command.h>
 #include <config.h>
+#include <cpu_legacy.h>
 #include <net.h>
 #include <malloc.h>
 #include <asm/byteorder.h>
diff --git a/drivers/usb/gadget/dwc2_udc_otg_xfer_dma.c b/drivers/usb/gadget/dwc2_udc_otg_xfer_dma.c
index 7eb632d3b14..7dddbfb5e3e 100644
--- a/drivers/usb/gadget/dwc2_udc_otg_xfer_dma.c
+++ b/drivers/usb/gadget/dwc2_udc_otg_xfer_dma.c
@@ -17,6 +17,9 @@
  * Lukasz Majewski <l.majewski at samsumg.com>
  */
 
+#include <common.h>
+#include <cpu_legacy.h>
+
 static u8 clear_feature_num;
 int clear_feature_flag;
 
diff --git a/drivers/usb/gadget/fotg210.c b/drivers/usb/gadget/fotg210.c
index 176068cbfb8..dfc057ca7ce 100644
--- a/drivers/usb/gadget/fotg210.c
+++ b/drivers/usb/gadget/fotg210.c
@@ -9,6 +9,7 @@
 #include <common.h>
 #include <command.h>
 #include <config.h>
+#include <cpu_legacy.h>
 #include <net.h>
 #include <malloc.h>
 #include <asm/io.h>
diff --git a/drivers/usb/host/dwc2.c b/drivers/usb/host/dwc2.c
index 350d820a6e5..bbf0273c0e5 100644
--- a/drivers/usb/host/dwc2.c
+++ b/drivers/usb/host/dwc2.c
@@ -5,6 +5,7 @@
  */
 
 #include <common.h>
+#include <cpu_legacy.h>
 #include <dm.h>
 #include <errno.h>
 #include <usb.h>
diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c
index 61a61abb211..65809c4f86f 100644
--- a/drivers/usb/host/ehci-hcd.c
+++ b/drivers/usb/host/ehci-hcd.c
@@ -7,6 +7,7 @@
  * All rights reserved.
  */
 #include <common.h>
+#include <cpu_legacy.h>
 #include <dm.h>
 #include <errno.h>
 #include <asm/byteorder.h>
diff --git a/drivers/usb/host/ohci-hcd.c b/drivers/usb/host/ohci-hcd.c
index 57e92a9c893..b9d9ba2b28a 100644
--- a/drivers/usb/host/ohci-hcd.c
+++ b/drivers/usb/host/ohci-hcd.c
@@ -28,6 +28,7 @@
  */
 
 #include <common.h>
+#include <cpu_legacy.h>
 #include <asm/byteorder.h>
 #include <dm.h>
 #include <errno.h>
diff --git a/drivers/usb/host/xhci-mem.c b/drivers/usb/host/xhci-mem.c
index 84c2c3344ad..821ec32484a 100644
--- a/drivers/usb/host/xhci-mem.c
+++ b/drivers/usb/host/xhci-mem.c
@@ -14,6 +14,7 @@
  */
 
 #include <common.h>
+#include <cpu_legacy.h>
 #include <dm.h>
 #include <asm/byteorder.h>
 #include <usb.h>
diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c
index b2cfd948f81..b9f0b2bfba9 100644
--- a/drivers/usb/host/xhci-ring.c
+++ b/drivers/usb/host/xhci-ring.c
@@ -14,6 +14,7 @@
  */
 
 #include <common.h>
+#include <cpu_legacy.h>
 #include <asm/byteorder.h>
 #include <usb.h>
 #include <asm/unaligned.h>
diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
index b3e4dcd66fa..26e7a8b37cc 100644
--- a/drivers/usb/host/xhci.c
+++ b/drivers/usb/host/xhci.c
@@ -20,6 +20,7 @@
  */
 
 #include <common.h>
+#include <cpu_legacy.h>
 #include <dm.h>
 #include <asm/byteorder.h>
 #include <usb.h>
diff --git a/drivers/video/atmel_hlcdfb.c b/drivers/video/atmel_hlcdfb.c
index 120d41f41f6..ebe2249e329 100644
--- a/drivers/video/atmel_hlcdfb.c
+++ b/drivers/video/atmel_hlcdfb.c
@@ -6,6 +6,7 @@
  */
 
 #include <common.h>
+#include <cpu_legacy.h>
 #include <asm/io.h>
 #include <asm/arch/gpio.h>
 #include <asm/arch/clk.h>
diff --git a/drivers/video/sunxi/sunxi_display.c b/drivers/video/sunxi/sunxi_display.c
index c45b3ebe6ea..9172a3b0113 100644
--- a/drivers/video/sunxi/sunxi_display.c
+++ b/drivers/video/sunxi/sunxi_display.c
@@ -7,6 +7,7 @@
  */
 
 #include <common.h>
+#include <cpu_legacy.h>
 #include <efi_loader.h>
 #include <time.h>
 
diff --git a/drivers/video/video-uclass.c b/drivers/video/video-uclass.c
index d4071c06615..8700aae2942 100644
--- a/drivers/video/video-uclass.c
+++ b/drivers/video/video-uclass.c
@@ -4,6 +4,7 @@
  */
 
 #include <common.h>
+#include <cpu_legacy.h>
 #include <dm.h>
 #include <mapmem.h>
 #include <stdio_dev.h>
diff --git a/include/common.h b/include/common.h
index 423f1023ad1..6dedb37a067 100644
--- a/include/common.h
+++ b/include/common.h
@@ -218,30 +218,6 @@ void	reset_timer	   (void);
 void	enable_interrupts  (void);
 int	disable_interrupts (void);
 
-/* arch/$(ARCH)/lib/cache.c */
-void	enable_caches(void);
-void	flush_cache   (unsigned long, unsigned long);
-void	flush_dcache_all(void);
-void	flush_dcache_range(unsigned long start, unsigned long stop);
-void	invalidate_dcache_range(unsigned long start, unsigned long stop);
-void	invalidate_dcache_all(void);
-void	invalidate_icache_all(void);
-
-enum {
-	/* Disable caches (else flush caches but leave them active) */
-	CBL_DISABLE_CACHES		= 1 << 0,
-	CBL_SHOW_BOOTSTAGE_REPORT	= 1 << 1,
-
-	CBL_ALL				= 3,
-};
-
-/**
- * Clean up ready for linux
- *
- * @param flags		Flags to control what is done
- */
-int cleanup_before_linux_select(int flags);
-
 /* lib/uuid.c */
 #include <uuid.h>
 
diff --git a/include/cpu_legacy.h b/include/cpu_legacy.h
index a14d23a36de..46f3d92459b 100644
--- a/include/cpu_legacy.h
+++ b/include/cpu_legacy.h
@@ -60,4 +60,28 @@ void dcache_enable(void);
 void dcache_disable(void);
 void mmu_disable(void);
 
+/* arch/$(ARCH)/lib/cache.c */
+void enable_caches(void);
+void flush_cache(unsigned long addr, unsigned long size);
+void flush_dcache_all(void);
+void flush_dcache_range(unsigned long start, unsigned long stop);
+void invalidate_dcache_range(unsigned long start, unsigned long stop);
+void invalidate_dcache_all(void);
+void invalidate_icache_all(void);
+
+enum {
+	/* Disable caches (else flush caches but leave them active) */
+	CBL_DISABLE_CACHES		= 1 << 0,
+	CBL_SHOW_BOOTSTAGE_REPORT	= 1 << 1,
+
+	CBL_ALL				= 3,
+};
+
+/**
+ * Clean up ready for linux
+ *
+ * @param flags		Flags to control what is done
+ */
+int cleanup_before_linux_select(int flags);
+;
 #endif
diff --git a/lib/efi_loader/efi_image_loader.c b/lib/efi_loader/efi_image_loader.c
index 13541cfa7a2..25023511c96 100644
--- a/lib/efi_loader/efi_image_loader.c
+++ b/lib/efi_loader/efi_image_loader.c
@@ -8,6 +8,7 @@
  */
 
 #include <common.h>
+#include <cpu_legacy.h>
 #include <efi_loader.h>
 #include <pe.h>
 
diff --git a/lib/efi_loader/efi_runtime.c b/lib/efi_loader/efi_runtime.c
index 72555f07fc1..334576b1f72 100644
--- a/lib/efi_loader/efi_runtime.c
+++ b/lib/efi_loader/efi_runtime.c
@@ -7,6 +7,7 @@
 
 #include <common.h>
 #include <command.h>
+#include <cpu_legacy.h>
 #include <dm.h>
 #include <elf.h>
 #include <efi_loader.h>
diff --git a/post/cpu/mpc83xx/ecc.c b/post/cpu/mpc83xx/ecc.c
index ce247057774..d3c5773f7b3 100644
--- a/post/cpu/mpc83xx/ecc.c
+++ b/post/cpu/mpc83xx/ecc.c
@@ -10,6 +10,7 @@
 
 #include <common.h>
 #include <cpu_legacy.h>
+#include <irq_legacy.h>
 #include <mpc83xx.h>
 #include <watchdog.h>
 #include <asm/io.h>
-- 
2.23.0.444.g18eeb5a265-goog



More information about the U-Boot mailing list