diff mbox series

[v2,07/22] common: Drop part.h from common header

Message ID 20200409141439.v2.7.Ie9efa7c392b5a482adb565eacdefd0d695247df8@changeid
State New
Headers show
Series common: Further reduce the size of common.h | expand

Commit Message

Simon Glass April 9, 2020, 8:14 p.m. UTC
Move this uncommon header out of the common header.

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

Changes in v2: None

 api/api_storage.c                        | 1 +
 arch/arm/mach-omap2/utils.c              | 1 +
 arch/arm/mach-snapdragon/dram.c          | 1 +
 arch/x86/include/asm/fsp/fsp_api.h       | 2 ++
 arch/x86/include/asm/fsp/fsp_fv.h        | 2 ++
 board/xilinx/zynq/bootimg.c              | 1 +
 cmd/ab_select.c                          | 2 ++
 cmd/bcb.c                                | 1 +
 cmd/gpt.c                                | 2 ++
 cmd/mmc.c                                | 2 ++
 cmd/nvme.c                               | 1 +
 cmd/sata.c                               | 1 +
 cmd/scsi.c                               | 1 +
 cmd/unzip.c                              | 1 +
 cmd/usb.c                                | 1 +
 cmd/usb_mass_storage.c                   | 3 ++-
 cmd/virtio.c                             | 1 +
 common/android_ab.c                      | 4 +++-
 common/spl/spl_ext.c                     | 1 +
 common/spl/spl_mmc.c                     | 1 +
 common/usb_storage.c                     | 1 +
 disk/part.c                              | 1 +
 disk/part_amiga.c                        | 1 +
 disk/part_dos.c                          | 2 ++
 disk/part_efi.c                          | 4 +++-
 disk/part_iso.c                          | 2 ++
 disk/part_mac.c                          | 1 +
 drivers/ata/ahci.c                       | 1 +
 drivers/ata/dwc_ahsata.c                 | 2 ++
 drivers/ata/fsl_sata.c                   | 1 +
 drivers/ata/sata.c                       | 2 ++
 drivers/ata/sata_mv.c                    | 1 +
 drivers/ata/sata_sandbox.c               | 1 +
 drivers/ata/sata_sil3114.c               | 2 ++
 drivers/block/blk-uclass.c               | 1 +
 drivers/block/blk_legacy.c               | 2 ++
 drivers/block/blkcache.c                 | 2 +-
 drivers/block/ide.c                      | 2 ++
 drivers/dfu/dfu_mmc.c                    | 1 +
 drivers/fastboot/fb_getvar.c             | 1 +
 drivers/fastboot/fb_nand.c               | 1 +
 drivers/misc/fsl_ifc.c                   | 1 +
 drivers/mmc/mmc.c                        | 1 +
 drivers/mmc/mmc_write.c                  | 1 +
 drivers/mmc/sh_sdhi.c                    | 1 +
 drivers/mtd/nand/raw/fsl_ifc_spl.c       | 1 +
 drivers/net/fm/eth.c                     | 1 +
 drivers/nvme/nvme-uclass.c               | 1 +
 drivers/nvme/nvme.c                      | 1 +
 drivers/scsi/scsi.c                      | 2 ++
 drivers/usb/gadget/ether.c               | 1 +
 drivers/usb/gadget/f_rockusb.c           | 1 +
 drivers/video/atmel_hlcdfb.c             | 1 +
 drivers/video/atmel_lcdfb.c              | 1 +
 drivers/video/imx/mxc_ipuv3_fb.c         | 1 +
 drivers/video/meson/meson_vpu.c          | 1 +
 drivers/video/mvebu_lcd.c                | 1 +
 drivers/video/sunxi/sunxi_de2.c          | 1 +
 drivers/video/tegra.c                    | 1 +
 drivers/video/tegra124/display.c         | 1 +
 drivers/virtio/virtio_blk.c              | 1 +
 env/ext4.c                               | 1 +
 env/fat.c                                | 6 +++---
 fs/btrfs/dev.c                           | 1 +
 fs/btrfs/super.c                         | 4 +++-
 fs/ext4/ext4_common.c                    | 2 ++
 fs/ext4/ext4_journal.c                   | 1 +
 fs/ext4/ext4_write.c                     | 2 ++
 fs/ext4/ext4fs.c                         | 2 ++
 fs/fs.c                                  | 1 +
 fs/fs_internal.c                         | 1 +
 fs/sandbox/sandboxfs.c                   | 1 +
 fs/ubifs/ubifs.c                         | 1 +
 include/android_ab.h                     | 3 ++-
 include/btrfs.h                          | 3 +++
 include/common.h                         | 1 -
 include/efi_loader.h                     | 2 ++
 include/ext4fs.h                         | 2 ++
 include/fat.h                            | 2 ++
 include/fb_mmc.h                         | 3 +++
 include/fs.h                             | 2 ++
 include/fsl_ifc.h                        | 1 +
 include/gzip.h                           | 2 ++
 include/initcall.h                       | 4 ++++
 include/reiserfs.h                       | 3 +++
 include/sandboxfs.h                      | 3 +++
 include/spl.h                            | 1 +
 include/ubifs_uboot.h                    | 3 +++
 lib/efi_driver/efi_block_device.c        | 2 ++
 lib/efi_loader/efi_device_path_to_text.c | 1 +
 lib/efi_loader/efi_file.c                | 1 +
 lib/gunzip.c                             | 1 +
 lib/image-sparse.c                       | 1 +
 test/dm/blk.c                            | 1 +
 test/dm/mmc.c                            | 1 +
 test/dm/usb.c                            | 1 +
 96 files changed, 140 insertions(+), 10 deletions(-)
diff mbox series

Patch

diff --git a/api/api_storage.c b/api/api_storage.c
index 7ae03ac2306..a0dacad1a55 100644
--- a/api/api_storage.c
+++ b/api/api_storage.c
@@ -8,6 +8,7 @@ 
 #include <config.h>
 #include <common.h>
 #include <api_public.h>
+#include <part.h>
 
 #if defined(CONFIG_CMD_USB) && defined(CONFIG_USB_STORAGE)
 #include <usb.h>
diff --git a/arch/arm/mach-omap2/utils.c b/arch/arm/mach-omap2/utils.c
index 6e519d8c910..6e6791fc659 100644
--- a/arch/arm/mach-omap2/utils.c
+++ b/arch/arm/mach-omap2/utils.c
@@ -5,6 +5,7 @@ 
  */
 #include <common.h>
 #include <env.h>
+#include <part.h>
 #include <asm/setup.h>
 #include <asm/arch/sys_proto.h>
 #include <asm/omap_common.h>
diff --git a/arch/arm/mach-snapdragon/dram.c b/arch/arm/mach-snapdragon/dram.c
index 79eb19992d0..12c26a91c65 100644
--- a/arch/arm/mach-snapdragon/dram.c
+++ b/arch/arm/mach-snapdragon/dram.c
@@ -8,6 +8,7 @@ 
 
 #include <common.h>
 #include <dm.h>
+#include <part.h>
 #include <smem.h>
 #include <fdt_support.h>
 #include <asm/arch/dram.h>
diff --git a/arch/x86/include/asm/fsp/fsp_api.h b/arch/x86/include/asm/fsp/fsp_api.h
index e9ac86b2da6..4941e2d74f0 100644
--- a/arch/x86/include/asm/fsp/fsp_api.h
+++ b/arch/x86/include/asm/fsp/fsp_api.h
@@ -6,6 +6,8 @@ 
 #ifndef __ASM_FSP_API_H
 #define __ASM_FSP_API_H
 
+#include <linux/linkage.h>
+
 enum fsp_phase {
 	/* Notification code for post PCI enuermation */
 	INIT_PHASE_PCI	= 0x20,
diff --git a/arch/x86/include/asm/fsp/fsp_fv.h b/arch/x86/include/asm/fsp/fsp_fv.h
index 511dfb78b81..7492c87c34a 100644
--- a/arch/x86/include/asm/fsp/fsp_fv.h
+++ b/arch/x86/include/asm/fsp/fsp_fv.h
@@ -7,6 +7,8 @@ 
 #ifndef __FSP_FV___
 #define __FSP_FV___
 
+#include <efi.h>
+
 /* Value of EFI_FV_FILE_ATTRIBUTES */
 #define EFI_FV_FILE_ATTR_ALIGNMENT	0x0000001F
 #define EFI_FV_FILE_ATTR_FIXED		0x00000100
diff --git a/board/xilinx/zynq/bootimg.c b/board/xilinx/zynq/bootimg.c
index 56d69cddacf..1ed6b2aa929 100644
--- a/board/xilinx/zynq/bootimg.c
+++ b/board/xilinx/zynq/bootimg.c
@@ -4,6 +4,7 @@ 
  */
 
 #include <common.h>
+#include <part.h>
 #include <asm/io.h>
 #include <asm/arch/hardware.h>
 #include <asm/arch/sys_proto.h>
diff --git a/cmd/ab_select.c b/cmd/ab_select.c
index d0d957d4f9d..7a4e51571b6 100644
--- a/cmd/ab_select.c
+++ b/cmd/ab_select.c
@@ -3,8 +3,10 @@ 
  * Copyright (C) 2017 The Android Open Source Project
  */
 
+#include <common.h>
 #include <android_ab.h>
 #include <command.h>
+#include <part.h>
 
 static int do_ab_select(cmd_tbl_t *cmdtp, int flag, int argc,
 			char * const argv[])
diff --git a/cmd/bcb.c b/cmd/bcb.c
index 62f9a44e38a..b944e62b6a9 100644
--- a/cmd/bcb.c
+++ b/cmd/bcb.c
@@ -8,6 +8,7 @@ 
 #include <android_bootloader_message.h>
 #include <command.h>
 #include <common.h>
+#include <part.h>
 
 enum bcb_cmd {
 	BCB_CMD_LOAD,
diff --git a/cmd/gpt.c b/cmd/gpt.c
index f3731487627..fe49d533209 100644
--- a/cmd/gpt.c
+++ b/cmd/gpt.c
@@ -11,9 +11,11 @@ 
  */
 
 #include <common.h>
+#include <blk.h>
 #include <env.h>
 #include <malloc.h>
 #include <command.h>
+#include <part.h>
 #include <part_efi.h>
 #include <exports.h>
 #include <uuid.h>
diff --git a/cmd/mmc.c b/cmd/mmc.c
index 1860a3f2e5d..002c96becbd 100644
--- a/cmd/mmc.c
+++ b/cmd/mmc.c
@@ -5,9 +5,11 @@ 
  */
 
 #include <common.h>
+#include <blk.h>
 #include <command.h>
 #include <console.h>
 #include <mmc.h>
+#include <part.h>
 #include <sparse_format.h>
 #include <image-sparse.h>
 
diff --git a/cmd/nvme.c b/cmd/nvme.c
index 5da903bd524..9ae91ce9cb5 100644
--- a/cmd/nvme.c
+++ b/cmd/nvme.c
@@ -5,6 +5,7 @@ 
  */
 
 #include <common.h>
+#include <blk.h>
 #include <command.h>
 #include <dm.h>
 #include <nvme.h>
diff --git a/cmd/sata.c b/cmd/sata.c
index 6bdb516cb5d..c507e9dbd80 100644
--- a/cmd/sata.c
+++ b/cmd/sata.c
@@ -11,6 +11,7 @@ 
 
 #include <common.h>
 #include <ahci.h>
+#include <blk.h>
 #include <dm.h>
 #include <command.h>
 #include <part.h>
diff --git a/cmd/scsi.c b/cmd/scsi.c
index 67de1a3bdc2..e81194de0f4 100644
--- a/cmd/scsi.c
+++ b/cmd/scsi.c
@@ -8,6 +8,7 @@ 
  * SCSI support.
  */
 #include <common.h>
+#include <blk.h>
 #include <command.h>
 #include <scsi.h>
 
diff --git a/cmd/unzip.c b/cmd/unzip.c
index afd58e7cdb1..725624627c1 100644
--- a/cmd/unzip.c
+++ b/cmd/unzip.c
@@ -8,6 +8,7 @@ 
 #include <command.h>
 #include <env.h>
 #include <gzip.h>
+#include <part.h>
 
 static int do_unzip(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
diff --git a/cmd/usb.c b/cmd/usb.c
index dd9ac0bc976..98fa300dfe4 100644
--- a/cmd/usb.c
+++ b/cmd/usb.c
@@ -11,6 +11,7 @@ 
  */
 
 #include <common.h>
+#include <blk.h>
 #include <command.h>
 #include <console.h>
 #include <dm.h>
diff --git a/cmd/usb_mass_storage.c b/cmd/usb_mass_storage.c
index 52ff637e2fb..b6037302487 100644
--- a/cmd/usb_mass_storage.c
+++ b/cmd/usb_mass_storage.c
@@ -6,10 +6,11 @@ 
  * Copyright (c) 2015, NVIDIA CORPORATION. All rights reserved.
  */
 
-#include <errno.h>
 #include <common.h>
+#include <blk.h>
 #include <command.h>
 #include <console.h>
+#include <errno.h>
 #include <g_dnl.h>
 #include <malloc.h>
 #include <part.h>
diff --git a/cmd/virtio.c b/cmd/virtio.c
index b7082bc63ad..f38cc56598c 100644
--- a/cmd/virtio.c
+++ b/cmd/virtio.c
@@ -5,6 +5,7 @@ 
  */
 
 #include <common.h>
+#include <blk.h>
 #include <command.h>
 #include <dm.h>
 #include <virtio_types.h>
diff --git a/common/android_ab.c b/common/android_ab.c
index b5b8af1b278..72025bb552c 100644
--- a/common/android_ab.c
+++ b/common/android_ab.c
@@ -5,9 +5,11 @@ 
 #include <common.h>
 #include <android_ab.h>
 #include <android_bootloader_message.h>
+#include <blk.h>
 #include <malloc.h>
-#include <linux/err.h>
+#include <part.h>
 #include <memalign.h>
+#include <linux/err.h>
 #include <u-boot/crc.h>
 #include <u-boot/crc.h>
 
diff --git a/common/spl/spl_ext.c b/common/spl/spl_ext.c
index 954133ba84e..3898041d106 100644
--- a/common/spl/spl_ext.c
+++ b/common/spl/spl_ext.c
@@ -2,6 +2,7 @@ 
 
 #include <common.h>
 #include <env.h>
+#include <part.h>
 #include <spl.h>
 #include <asm/u-boot.h>
 #include <ext4fs.h>
diff --git a/common/spl/spl_mmc.c b/common/spl/spl_mmc.c
index e6af5b567bc..cd0c2b24efe 100644
--- a/common/spl/spl_mmc.c
+++ b/common/spl/spl_mmc.c
@@ -7,6 +7,7 @@ 
  */
 #include <common.h>
 #include <dm.h>
+#include <part.h>
 #include <spl.h>
 #include <linux/compiler.h>
 #include <errno.h>
diff --git a/common/usb_storage.c b/common/usb_storage.c
index 759fc48a60e..e4b48f4643f 100644
--- a/common/usb_storage.c
+++ b/common/usb_storage.c
@@ -33,6 +33,7 @@ 
 
 
 #include <common.h>
+#include <blk.h>
 #include <command.h>
 #include <dm.h>
 #include <errno.h>
diff --git a/disk/part.c b/disk/part.c
index 68cba61c5a0..bb0f6e20469 100644
--- a/disk/part.c
+++ b/disk/part.c
@@ -5,6 +5,7 @@ 
  */
 
 #include <common.h>
+#include <blk.h>
 #include <command.h>
 #include <env.h>
 #include <errno.h>
diff --git a/disk/part_amiga.c b/disk/part_amiga.c
index 5a17d11b9b7..7eea60b564d 100644
--- a/disk/part_amiga.c
+++ b/disk/part_amiga.c
@@ -9,6 +9,7 @@ 
 #include <env.h>
 #include <ide.h>
 #include "part_amiga.h"
+#include <part.h>
 
 #ifdef CONFIG_HAVE_BLOCK_DEVICE
 
diff --git a/disk/part_dos.c b/disk/part_dos.c
index a4e92ac991b..f2a6e6328d1 100644
--- a/disk/part_dos.c
+++ b/disk/part_dos.c
@@ -14,10 +14,12 @@ 
  */
 
 #include <common.h>
+#include <blk.h>
 #include <command.h>
 #include <ide.h>
 #include <memalign.h>
 #include "part_dos.h"
+#include <part.h>
 
 #ifdef CONFIG_HAVE_BLOCK_DEVICE
 
diff --git a/disk/part_efi.c b/disk/part_efi.c
index b85377b02ec..3ae733df431 100644
--- a/disk/part_efi.c
+++ b/disk/part_efi.c
@@ -9,10 +9,12 @@ 
  *   when CONFIG_SYS_64BIT_LBA is not defined, lbaint_t is 32 bits; this
  *   limits the maximum size of addressable storage to < 2 Terra Bytes
  */
+#include <common.h>
+#include <blk.h>
+#include <part.h>
 #include <uuid.h>
 #include <asm/cache.h>
 #include <asm/unaligned.h>
-#include <common.h>
 #include <command.h>
 #include <fdtdec.h>
 #include <ide.h>
diff --git a/disk/part_iso.c b/disk/part_iso.c
index 2ccb7867c9b..822f2c4d9f4 100644
--- a/disk/part_iso.c
+++ b/disk/part_iso.c
@@ -5,7 +5,9 @@ 
  */
 
 #include <common.h>
+#include <blk.h>
 #include <command.h>
+#include <part.h>
 #include <asm/cache.h>
 #include <asm/unaligned.h>
 #include "part_iso.h"
diff --git a/disk/part_mac.c b/disk/part_mac.c
index fbd0ad73e35..cda497e04a6 100644
--- a/disk/part_mac.c
+++ b/disk/part_mac.c
@@ -17,6 +17,7 @@ 
 #include <memalign.h>
 #include <ide.h>
 #include "part_mac.h"
+#include <part.h>
 
 #ifdef CONFIG_HAVE_BLOCK_DEVICE
 
diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c
index 4cd7420c3ca..d54acc96ee4 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 <blk.h>
 #include <cpu_func.h>
 
 #include <command.h>
diff --git a/drivers/ata/dwc_ahsata.c b/drivers/ata/dwc_ahsata.c
index 0f070b6bc93..df3f1efa397 100644
--- a/drivers/ata/dwc_ahsata.c
+++ b/drivers/ata/dwc_ahsata.c
@@ -6,6 +6,7 @@ 
 
 #include <common.h>
 #include <ahci.h>
+#include <blk.h>
 #include <cpu_func.h>
 #include <dm.h>
 #include <dwc_ahsata.h>
@@ -13,6 +14,7 @@ 
 #include <libata.h>
 #include <malloc.h>
 #include <memalign.h>
+#include <part.h>
 #include <sata.h>
 #include <asm/cache.h>
 #include <asm/io.h>
diff --git a/drivers/ata/fsl_sata.c b/drivers/ata/fsl_sata.c
index c6680dc1c98..0ef70d0d59a 100644
--- a/drivers/ata/fsl_sata.c
+++ b/drivers/ata/fsl_sata.c
@@ -6,6 +6,7 @@ 
  */
 
 #include <common.h>
+#include <blk.h>
 #include <command.h>
 #include <console.h>
 #include <cpu_func.h>
diff --git a/drivers/ata/sata.c b/drivers/ata/sata.c
index e384b805b21..6a38d500245 100644
--- a/drivers/ata/sata.c
+++ b/drivers/ata/sata.c
@@ -11,7 +11,9 @@ 
 
 #include <common.h>
 #include <ahci.h>
+#include <blk.h>
 #include <dm.h>
+#include <part.h>
 #include <sata.h>
 
 #ifndef CONFIG_AHCI
diff --git a/drivers/ata/sata_mv.c b/drivers/ata/sata_mv.c
index a71a7edf88a..cebb165a476 100644
--- a/drivers/ata/sata_mv.c
+++ b/drivers/ata/sata_mv.c
@@ -33,6 +33,7 @@ 
 
 #include <common.h>
 #include <ahci.h>
+#include <blk.h>
 #include <cpu_func.h>
 #include <dm.h>
 #include <asm/cache.h>
diff --git a/drivers/ata/sata_sandbox.c b/drivers/ata/sata_sandbox.c
index a28ac56ccd9..e64cc4a5c10 100644
--- a/drivers/ata/sata_sandbox.c
+++ b/drivers/ata/sata_sandbox.c
@@ -5,6 +5,7 @@ 
  */
 
 #include <common.h>
+#include <blk.h>
 
 int init_sata(int dev)
 {
diff --git a/drivers/ata/sata_sil3114.c b/drivers/ata/sata_sil3114.c
index 41635742a81..4a7ffad6bdf 100644
--- a/drivers/ata/sata_sil3114.c
+++ b/drivers/ata/sata_sil3114.c
@@ -8,6 +8,8 @@ 
  */
 
 #include <common.h>
+#include <blk.h>
+#include <part.h>
 #include <pci.h>
 #include <command.h>
 #include <config.h>
diff --git a/drivers/block/blk-uclass.c b/drivers/block/blk-uclass.c
index 7c39aa5f2f5..4bda74bd067 100644
--- a/drivers/block/blk-uclass.c
+++ b/drivers/block/blk-uclass.c
@@ -8,6 +8,7 @@ 
 #include <blk.h>
 #include <dm.h>
 #include <malloc.h>
+#include <part.h>
 #include <dm/device-internal.h>
 #include <dm/lists.h>
 #include <dm/uclass-internal.h>
diff --git a/drivers/block/blk_legacy.c b/drivers/block/blk_legacy.c
index 0c343f7b646..e3ee778c29d 100644
--- a/drivers/block/blk_legacy.c
+++ b/drivers/block/blk_legacy.c
@@ -5,6 +5,8 @@ 
  */
 
 #include <common.h>
+#include <blk.h>
+#include <part.h>
 #include <linux/err.h>
 
 struct blk_driver *blk_driver_lookup_type(int if_type)
diff --git a/drivers/block/blkcache.c b/drivers/block/blkcache.c
index ea40929e3e5..6a8f789ff08 100644
--- a/drivers/block/blkcache.c
+++ b/drivers/block/blkcache.c
@@ -4,8 +4,8 @@ 
  * Author: Eric Nelson<eric at nelint.com>
  *
  */
-#include <config.h>
 #include <common.h>
+#include <blk.h>
 #include <malloc.h>
 #include <part.h>
 #include <linux/ctype.h>
diff --git a/drivers/block/ide.c b/drivers/block/ide.c
index 4b8a4eac176..01b3b37a07c 100644
--- a/drivers/block/ide.c
+++ b/drivers/block/ide.c
@@ -6,8 +6,10 @@ 
 
 #include <common.h>
 #include <ata.h>
+#include <blk.h>
 #include <dm.h>
 #include <ide.h>
+#include <part.h>
 #include <watchdog.h>
 #include <asm/io.h>
 
diff --git a/drivers/dfu/dfu_mmc.c b/drivers/dfu/dfu_mmc.c
index cddca0c45fe..8cd466f02e5 100644
--- a/drivers/dfu/dfu_mmc.c
+++ b/drivers/dfu/dfu_mmc.c
@@ -14,6 +14,7 @@ 
 #include <ext4fs.h>
 #include <fat.h>
 #include <mmc.h>
+#include <part.h>
 
 static unsigned char *dfu_file_buf;
 static u64 dfu_file_buf_len;
diff --git a/drivers/fastboot/fb_getvar.c b/drivers/fastboot/fb_getvar.c
index 467a8618fe3..52da34b1e37 100644
--- a/drivers/fastboot/fb_getvar.c
+++ b/drivers/fastboot/fb_getvar.c
@@ -10,6 +10,7 @@ 
 #include <fb_mmc.h>
 #include <fb_nand.h>
 #include <fs.h>
+#include <part.h>
 #include <version.h>
 
 static void getvar_version(char *var_parameter, char *response);
diff --git a/drivers/fastboot/fb_nand.c b/drivers/fastboot/fb_nand.c
index b1654681450..eb8a36f2922 100644
--- a/drivers/fastboot/fb_nand.c
+++ b/drivers/fastboot/fb_nand.c
@@ -6,6 +6,7 @@ 
 
 #include <config.h>
 #include <common.h>
+#include <blk.h>
 #include <flash.h>
 
 #include <fastboot.h>
diff --git a/drivers/misc/fsl_ifc.c b/drivers/misc/fsl_ifc.c
index 0dbf304487f..8fdaacd5e04 100644
--- a/drivers/misc/fsl_ifc.c
+++ b/drivers/misc/fsl_ifc.c
@@ -6,6 +6,7 @@ 
 
 #include <common.h>
 #include <fsl_ifc.h>
+#include <part.h>
 
 #ifdef CONFIG_TFABOOT
 struct ifc_regs ifc_cfg_default_boot[CONFIG_SYS_FSL_IFC_BANK_COUNT] = {
diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c
index 3e365666934..af404c42484 100644
--- a/drivers/mmc/mmc.c
+++ b/drivers/mmc/mmc.c
@@ -8,6 +8,7 @@ 
 
 #include <config.h>
 #include <common.h>
+#include <blk.h>
 #include <command.h>
 #include <dm.h>
 #include <dm/device-internal.h>
diff --git a/drivers/mmc/mmc_write.c b/drivers/mmc/mmc_write.c
index b52ff9f3bc0..6a4453ca02e 100644
--- a/drivers/mmc/mmc_write.c
+++ b/drivers/mmc/mmc_write.c
@@ -8,6 +8,7 @@ 
 
 #include <config.h>
 #include <common.h>
+#include <blk.h>
 #include <dm.h>
 #include <part.h>
 #include <div64.h>
diff --git a/drivers/mmc/sh_sdhi.c b/drivers/mmc/sh_sdhi.c
index 2202158c88a..4851198571c 100644
--- a/drivers/mmc/sh_sdhi.c
+++ b/drivers/mmc/sh_sdhi.c
@@ -13,6 +13,7 @@ 
 #include <malloc.h>
 #include <mmc.h>
 #include <dm.h>
+#include <part.h>
 #include <dm/device_compat.h>
 #include <linux/errno.h>
 #include <linux/compat.h>
diff --git a/drivers/mtd/nand/raw/fsl_ifc_spl.c b/drivers/mtd/nand/raw/fsl_ifc_spl.c
index 0983fbced3f..b7e37416a49 100644
--- a/drivers/mtd/nand/raw/fsl_ifc_spl.c
+++ b/drivers/mtd/nand/raw/fsl_ifc_spl.c
@@ -10,6 +10,7 @@ 
 #include <cpu_func.h>
 #include <asm/io.h>
 #include <fsl_ifc.h>
+#include <part.h>
 #include <linux/mtd/rawnand.h>
 #ifdef CONFIG_CHAIN_OF_TRUST
 #include <fsl_validate.h>
diff --git a/drivers/net/fm/eth.c b/drivers/net/fm/eth.c
index 88019c9a88c..f70f29beb98 100644
--- a/drivers/net/fm/eth.c
+++ b/drivers/net/fm/eth.c
@@ -4,6 +4,7 @@ 
  *	Dave Liu <daveliu at freescale.com>
  */
 #include <common.h>
+#include <part.h>
 #include <asm/io.h>
 #include <malloc.h>
 #include <net.h>
diff --git a/drivers/nvme/nvme-uclass.c b/drivers/nvme/nvme-uclass.c
index 2d88efdb619..277e31e1f39 100644
--- a/drivers/nvme/nvme-uclass.c
+++ b/drivers/nvme/nvme-uclass.c
@@ -5,6 +5,7 @@ 
  */
 
 #include <common.h>
+#include <blk.h>
 #include <errno.h>
 #include <dm.h>
 #include <dm/device.h>
diff --git a/drivers/nvme/nvme.c b/drivers/nvme/nvme.c
index ef4382da1a1..5e75152f421 100644
--- a/drivers/nvme/nvme.c
+++ b/drivers/nvme/nvme.c
@@ -5,6 +5,7 @@ 
  */
 
 #include <common.h>
+#include <blk.h>
 #include <cpu_func.h>
 #include <dm.h>
 #include <errno.h>
diff --git a/drivers/scsi/scsi.c b/drivers/scsi/scsi.c
index 69de6a53d56..849c42f0cd2 100644
--- a/drivers/scsi/scsi.c
+++ b/drivers/scsi/scsi.c
@@ -5,8 +5,10 @@ 
  */
 
 #include <common.h>
+#include <blk.h>
 #include <dm.h>
 #include <env.h>
+#include <part.h>
 #include <pci.h>
 #include <scsi.h>
 #include <dm/device-internal.h>
diff --git a/drivers/usb/gadget/ether.c b/drivers/usb/gadget/ether.c
index a118283984c..43ee756c0ae 100644
--- a/drivers/usb/gadget/ether.c
+++ b/drivers/usb/gadget/ether.c
@@ -10,6 +10,7 @@ 
 #include <common.h>
 #include <console.h>
 #include <env.h>
+#include <part.h>
 #include <linux/errno.h>
 #include <linux/netdevice.h>
 #include <linux/usb/ch9.h>
diff --git a/drivers/usb/gadget/f_rockusb.c b/drivers/usb/gadget/f_rockusb.c
index 1cfeabcd31a..da3d63c0f0d 100644
--- a/drivers/usb/gadget/f_rockusb.c
+++ b/drivers/usb/gadget/f_rockusb.c
@@ -10,6 +10,7 @@ 
 #include <errno.h>
 #include <malloc.h>
 #include <memalign.h>
+#include <part.h>
 #include <linux/usb/ch9.h>
 #include <linux/usb/gadget.h>
 #include <linux/usb/composite.h>
diff --git a/drivers/video/atmel_hlcdfb.c b/drivers/video/atmel_hlcdfb.c
index 62acccedf37..0fd74fdec96 100644
--- a/drivers/video/atmel_hlcdfb.c
+++ b/drivers/video/atmel_hlcdfb.c
@@ -8,6 +8,7 @@ 
 #include <common.h>
 #include <cpu_func.h>
 #include <malloc.h>
+#include <part.h>
 #include <asm/io.h>
 #include <asm/arch/gpio.h>
 #include <asm/arch/clk.h>
diff --git a/drivers/video/atmel_lcdfb.c b/drivers/video/atmel_lcdfb.c
index bd2e9c0c9bf..8cc2eb1973e 100644
--- a/drivers/video/atmel_lcdfb.c
+++ b/drivers/video/atmel_lcdfb.c
@@ -9,6 +9,7 @@ 
 #include <atmel_lcd.h>
 #include <dm.h>
 #include <fdtdec.h>
+#include <part.h>
 #include <video.h>
 #include <asm/io.h>
 #include <asm/arch/gpio.h>
diff --git a/drivers/video/imx/mxc_ipuv3_fb.c b/drivers/video/imx/mxc_ipuv3_fb.c
index db8eb4ade88..f8ed0a9fea2 100644
--- a/drivers/video/imx/mxc_ipuv3_fb.c
+++ b/drivers/video/imx/mxc_ipuv3_fb.c
@@ -11,6 +11,7 @@ 
  */
 
 #include <common.h>
+#include <part.h>
 #include <asm/cache.h>
 #include <linux/errno.h>
 #include <asm/global_data.h>
diff --git a/drivers/video/meson/meson_vpu.c b/drivers/video/meson/meson_vpu.c
index aa8c0a962fa..fbdec3af67a 100644
--- a/drivers/video/meson/meson_vpu.c
+++ b/drivers/video/meson/meson_vpu.c
@@ -11,6 +11,7 @@ 
 #include <dm.h>
 #include <efi_loader.h>
 #include <fdt_support.h>
+#include <part.h>
 #include <linux/sizes.h>
 #include <asm/arch/mem.h>
 #include <dm/device-internal.h>
diff --git a/drivers/video/mvebu_lcd.c b/drivers/video/mvebu_lcd.c
index 2907c533783..d5ed8d00962 100644
--- a/drivers/video/mvebu_lcd.c
+++ b/drivers/video/mvebu_lcd.c
@@ -7,6 +7,7 @@ 
 
 #include <common.h>
 #include <dm.h>
+#include <part.h>
 #include <video.h>
 #include <asm/cache.h>
 #include <dm/device_compat.h>
diff --git a/drivers/video/sunxi/sunxi_de2.c b/drivers/video/sunxi/sunxi_de2.c
index 8333ddc44c0..ba34f1a107f 100644
--- a/drivers/video/sunxi/sunxi_de2.c
+++ b/drivers/video/sunxi/sunxi_de2.c
@@ -12,6 +12,7 @@ 
 #include <efi_loader.h>
 #include <fdtdec.h>
 #include <fdt_support.h>
+#include <part.h>
 #include <video.h>
 #include <asm/global_data.h>
 #include <asm/io.h>
diff --git a/drivers/video/tegra.c b/drivers/video/tegra.c
index 1fa052e306e..82ba5c4e7ec 100644
--- a/drivers/video/tegra.c
+++ b/drivers/video/tegra.c
@@ -7,6 +7,7 @@ 
 #include <dm.h>
 #include <fdtdec.h>
 #include <panel.h>
+#include <part.h>
 #include <pwm.h>
 #include <video.h>
 #include <asm/cache.h>
diff --git a/drivers/video/tegra124/display.c b/drivers/video/tegra124/display.c
index f08f117cf8d..913beab4d49 100644
--- a/drivers/video/tegra124/display.c
+++ b/drivers/video/tegra124/display.c
@@ -12,6 +12,7 @@ 
 #include <display.h>
 #include <edid.h>
 #include <lcd.h>
+#include <part.h>
 #include <video.h>
 #include <asm/gpio.h>
 #include <asm/io.h>
diff --git a/drivers/virtio/virtio_blk.c b/drivers/virtio/virtio_blk.c
index e793e34e836..992118c6075 100644
--- a/drivers/virtio/virtio_blk.c
+++ b/drivers/virtio/virtio_blk.c
@@ -7,6 +7,7 @@ 
 #include <common.h>
 #include <blk.h>
 #include <dm.h>
+#include <part.h>
 #include <virtio_types.h>
 #include <virtio.h>
 #include <virtio_ring.h>
diff --git a/env/ext4.c b/env/ext4.c
index c03909d91ab..4819ad510bb 100644
--- a/env/ext4.c
+++ b/env/ext4.c
@@ -19,6 +19,7 @@ 
  */
 
 #include <common.h>
+#include <part.h>
 
 #include <command.h>
 #include <env.h>
diff --git a/env/fat.c b/env/fat.c
index 0ecc337085e..733f2de6af1 100644
--- a/env/fat.c
+++ b/env/fat.c
@@ -7,18 +7,18 @@ 
  */
 
 #include <common.h>
-#include <asm/cache.h>
-
 #include <command.h>
 #include <env.h>
 #include <env_internal.h>
-#include <linux/stddef.h>
+#include <part.h>
 #include <malloc.h>
 #include <memalign.h>
 #include <search.h>
 #include <errno.h>
 #include <fat.h>
 #include <mmc.h>
+#include <asm/cache.h>
+#include <linux/stddef.h>
 
 #ifdef CONFIG_SPL_BUILD
 /* TODO(sjg at chromium.org): Figure out why this is needed */
diff --git a/fs/btrfs/dev.c b/fs/btrfs/dev.c
index e686abc5e3b..1e5b83235ad 100644
--- a/fs/btrfs/dev.c
+++ b/fs/btrfs/dev.c
@@ -6,6 +6,7 @@ 
  */
 
 #include <common.h>
+#include <blk.h>
 #include <compiler.h>
 #include <fs_internal.h>
 
diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
index 2dc4a6fcd7a..71eee36537a 100644
--- a/fs/btrfs/super.c
+++ b/fs/btrfs/super.c
@@ -5,8 +5,10 @@ 
  * 2017 Marek Behun, CZ.NIC, marek.behun at nic.cz
  */
 
-#include "btrfs.h"
+#include <common.h>
 #include <memalign.h>
+#include <part.h>
+#include "btrfs.h"
 
 #define BTRFS_SUPER_FLAG_SUPP	(BTRFS_HEADER_FLAG_WRITTEN	\
 				 | BTRFS_HEADER_FLAG_RELOC	\
diff --git a/fs/ext4/ext4_common.c b/fs/ext4/ext4_common.c
index 5bf78b530a9..9adef57476a 100644
--- a/fs/ext4/ext4_common.c
+++ b/fs/ext4/ext4_common.c
@@ -19,10 +19,12 @@ 
  */
 
 #include <common.h>
+#include <blk.h>
 #include <ext_common.h>
 #include <ext4fs.h>
 #include <malloc.h>
 #include <memalign.h>
+#include <part.h>
 #include <stddef.h>
 #include <linux/stat.h>
 #include <linux/time.h>
diff --git a/fs/ext4/ext4_journal.c b/fs/ext4/ext4_journal.c
index 3559daf11d2..ecae5768c9e 100644
--- a/fs/ext4/ext4_journal.c
+++ b/fs/ext4/ext4_journal.c
@@ -14,6 +14,7 @@ 
  */
 
 #include <common.h>
+#include <blk.h>
 #include <ext4fs.h>
 #include <malloc.h>
 #include <ext_common.h>
diff --git a/fs/ext4/ext4_write.c b/fs/ext4/ext4_write.c
index 67aeba1339d..ce1fddc9a47 100644
--- a/fs/ext4/ext4_write.c
+++ b/fs/ext4/ext4_write.c
@@ -22,8 +22,10 @@ 
 
 
 #include <common.h>
+#include <blk.h>
 #include <malloc.h>
 #include <memalign.h>
+#include <part.h>
 #include <linux/stat.h>
 #include <div64.h>
 #include "ext4_common.h"
diff --git a/fs/ext4/ext4fs.c b/fs/ext4/ext4fs.c
index ad71f5ab6e2..4c89152ce4a 100644
--- a/fs/ext4/ext4fs.c
+++ b/fs/ext4/ext4fs.c
@@ -21,11 +21,13 @@ 
  */
 
 #include <common.h>
+#include <blk.h>
 #include <ext_common.h>
 #include <ext4fs.h>
 #include "ext4_common.h"
 #include <div64.h>
 #include <malloc.h>
+#include <part.h>
 #include <uuid.h>
 
 int ext4fs_symlinknest;
diff --git a/fs/fs.c b/fs/fs.c
index e3de25da5b6..061917a9847 100644
--- a/fs/fs.c
+++ b/fs/fs.c
@@ -7,6 +7,7 @@ 
 #include <errno.h>
 #include <common.h>
 #include <env.h>
+#include <lmb.h>
 #include <mapmem.h>
 #include <part.h>
 #include <ext4fs.h>
diff --git a/fs/fs_internal.c b/fs/fs_internal.c
index 1ff804d13ba..115c010ef88 100644
--- a/fs/fs_internal.c
+++ b/fs/fs_internal.c
@@ -6,6 +6,7 @@ 
  */
 
 #include <common.h>
+#include <blk.h>
 #include <compiler.h>
 #include <part.h>
 #include <memalign.h>
diff --git a/fs/sandbox/sandboxfs.c b/fs/sandbox/sandboxfs.c
index 5851fe2434f..4ae41d5b4db 100644
--- a/fs/sandbox/sandboxfs.c
+++ b/fs/sandbox/sandboxfs.c
@@ -7,6 +7,7 @@ 
 #include <fs.h>
 #include <malloc.h>
 #include <os.h>
+#include <sandboxfs.h>
 
 int sandbox_fs_set_blk_dev(struct blk_desc *rbdd, struct disk_partition *info)
 {
diff --git a/fs/ubifs/ubifs.c b/fs/ubifs/ubifs.c
index 742c2f47ebf..bb355123803 100644
--- a/fs/ubifs/ubifs.c
+++ b/fs/ubifs/ubifs.c
@@ -17,6 +17,7 @@ 
 #include <malloc.h>
 #include <memalign.h>
 #include "ubifs.h"
+#include <part.h>
 #include <dm/devres.h>
 #include <u-boot/zlib.h>
 
diff --git a/include/android_ab.h b/include/android_ab.h
index 3f4e69be9ef..0941eb6b9cc 100644
--- a/include/android_ab.h
+++ b/include/android_ab.h
@@ -6,7 +6,8 @@ 
 #ifndef __ANDROID_AB_H
 #define __ANDROID_AB_H
 
-#include <common.h>
+struct blk_desc;
+struct disk_partition;
 
 /* Android standard boot slot names are 'a', 'b', 'c', ... */
 #define BOOT_SLOT_NAME(slot_num) ('a' + (slot_num))
diff --git a/include/btrfs.h b/include/btrfs.h
index f7f82ad7d10..a7605e15897 100644
--- a/include/btrfs.h
+++ b/include/btrfs.h
@@ -8,6 +8,9 @@ 
 #ifndef __U_BOOT_BTRFS_H__
 #define __U_BOOT_BTRFS_H__
 
+struct blk_desc;
+struct disk_partition;
+
 int btrfs_probe(struct blk_desc *fs_dev_desc,
 		struct disk_partition *fs_partition);
 int btrfs_ls(const char *);
diff --git a/include/common.h b/include/common.h
index a900596c5f9..85a211554a1 100644
--- a/include/common.h
+++ b/include/common.h
@@ -28,7 +28,6 @@ 
 #include <stdarg.h>
 #include <stdio.h>
 #include <linux/kernel.h>
-#include <part.h>
 #include <image.h>
 #include <log.h>
 #include <asm/u-boot.h> /* boot information for Linux kernel */
diff --git a/include/efi_loader.h b/include/efi_loader.h
index 3f2792892f3..2b262948d54 100644
--- a/include/efi_loader.h
+++ b/include/efi_loader.h
@@ -12,6 +12,8 @@ 
 #include <part_efi.h>
 #include <efi_api.h>
 
+struct blk_desc;
+
 static inline int guidcmp(const void *g1, const void *g2)
 {
 	return memcmp(g1, g2, sizeof(efi_guid_t));
diff --git a/include/ext4fs.h b/include/ext4fs.h
index aafcd841402..cb5d9cc0a5c 100644
--- a/include/ext4fs.h
+++ b/include/ext4fs.h
@@ -28,6 +28,8 @@ 
 #define __EXT4__
 #include <ext_common.h>
 
+struct disk_partition;
+
 #define EXT4_INDEX_FL		0x00001000 /* Inode uses hash tree index */
 #define EXT4_EXTENTS_FL		0x00080000 /* Inode uses extents */
 #define EXT4_EXT_MAGIC			0xf30a
diff --git a/include/fat.h b/include/fat.h
index 84573fd3fe9..02742f92a5c 100644
--- a/include/fat.h
+++ b/include/fat.h
@@ -12,6 +12,8 @@ 
 #include <asm/byteorder.h>
 #include <fs.h>
 
+struct disk_partition;
+
 /* Maximum Long File Name length supported here is 128 UTF-16 code units */
 #define VFAT_MAXLEN_BYTES	256 /* Maximum LFN buffer in bytes */
 #define VFAT_MAXSEQ		9   /* Up to 9 of 13 2-byte UTF-16 entries */
diff --git a/include/fb_mmc.h b/include/fb_mmc.h
index 0c58109e2f8..76ed7cd6be1 100644
--- a/include/fb_mmc.h
+++ b/include/fb_mmc.h
@@ -6,6 +6,9 @@ 
 #ifndef _FB_MMC_H_
 #define _FB_MMC_H_
 
+struct blk_desc;
+struct disk_partition;
+
 /**
  * fastboot_mmc_get_part_info() - Lookup eMMC partion by name
  *
diff --git a/include/fs.h b/include/fs.h
index 37e35c21206..9fdb4a34249 100644
--- a/include/fs.h
+++ b/include/fs.h
@@ -14,6 +14,8 @@ 
 #define FS_TYPE_UBIFS	4
 #define FS_TYPE_BTRFS	5
 
+struct blk_desc;
+
 /**
  * do_fat_fsload - Run the fatload command
  *
diff --git a/include/fsl_ifc.h b/include/fsl_ifc.h
index 3edcc39f4e2..fd915335b2c 100644
--- a/include/fsl_ifc.h
+++ b/include/fsl_ifc.h
@@ -10,6 +10,7 @@ 
 #ifdef CONFIG_FSL_IFC
 #include <config.h>
 #include <common.h>
+#include <part.h>
 #ifdef CONFIG_ARM
 #include <asm/arch/soc.h>
 #endif
diff --git a/include/gzip.h b/include/gzip.h
index 2e340673c38..783acbb60d2 100644
--- a/include/gzip.h
+++ b/include/gzip.h
@@ -7,6 +7,8 @@ 
 #ifndef __GZIP_H
 #define __GZIP_H
 
+struct blk_desc;
+
 /**
  * gzip_parse_header() - Parse a header from a gzip file
  *
diff --git a/include/initcall.h b/include/initcall.h
index b5acdd01bdb..c871767e20a 100644
--- a/include/initcall.h
+++ b/include/initcall.h
@@ -8,6 +8,10 @@ 
 
 typedef int (*init_fnc_t)(void);
 
+#ifdef CONFIG_EFI_APP
+#include <efi.h>
+#endif
+
 /*
  * To enable debugging. add #define DEBUG at the top of the including file.
  *
diff --git a/include/reiserfs.h b/include/reiserfs.h
index a655d5ea9fc..b61bb600679 100644
--- a/include/reiserfs.h
+++ b/include/reiserfs.h
@@ -18,6 +18,9 @@ 
 #define SECTOR_SIZE		0x200
 #define SECTOR_BITS		9
 
+struct blk_desc;
+struct disk_partition;
+
 /* Error codes */
 typedef enum
 {
diff --git a/include/sandboxfs.h b/include/sandboxfs.h
index 49724d05c89..783dd5c88a7 100644
--- a/include/sandboxfs.h
+++ b/include/sandboxfs.h
@@ -18,6 +18,9 @@ 
 #ifndef __SANDBOX_FS__
 #define __SANDBOX_FS__
 
+struct blk_desc;
+struct disk_partition;
+
 int sandbox_fs_set_blk_dev(struct blk_desc *rbdd, struct disk_partition *info);
 
 int sandbox_fs_read_at(const char *filename, loff_t pos, void *buffer,
diff --git a/include/spl.h b/include/spl.h
index ccacffd3e01..98896258ce5 100644
--- a/include/spl.h
+++ b/include/spl.h
@@ -26,6 +26,7 @@  struct image_header;
 #define MMCSD_MODE_FS		2
 #define MMCSD_MODE_EMMCBOOT	3
 
+struct blk_desc;
 struct image_header;
 
 /*
diff --git a/include/ubifs_uboot.h b/include/ubifs_uboot.h
index 16b757286e4..b025779d59f 100644
--- a/include/ubifs_uboot.h
+++ b/include/ubifs_uboot.h
@@ -14,6 +14,9 @@ 
 #ifndef __UBIFS_UBOOT_H__
 #define __UBIFS_UBOOT_H__
 
+struct blk_desc;
+struct disk_partition;
+
 int ubifs_init(void);
 int uboot_ubifs_mount(char *vol_name);
 void uboot_ubifs_umount(void);
diff --git a/lib/efi_driver/efi_block_device.c b/lib/efi_driver/efi_block_device.c
index 33e66fcad2e..e7d8745ad85 100644
--- a/lib/efi_driver/efi_block_device.c
+++ b/lib/efi_driver/efi_block_device.c
@@ -28,6 +28,8 @@ 
  * iPXE uses the simple file protocol to load Grub or the Linux Kernel.
  */
 
+#include <common.h>
+#include <blk.h>
 #include <efi_driver.h>
 #include <malloc.h>
 #include <dm/device-internal.h>
diff --git a/lib/efi_loader/efi_device_path_to_text.c b/lib/efi_loader/efi_device_path_to_text.c
index af1adbb71ef..49bebb58cc2 100644
--- a/lib/efi_loader/efi_device_path_to_text.c
+++ b/lib/efi_loader/efi_device_path_to_text.c
@@ -6,6 +6,7 @@ 
  */
 
 #include <common.h>
+#include <blk.h>
 #include <efi_loader.h>
 
 #define MAC_OUTPUT_LEN 22
diff --git a/lib/efi_loader/efi_file.c b/lib/efi_loader/efi_file.c
index 1fe7cf539e3..9233767ee26 100644
--- a/lib/efi_loader/efi_file.c
+++ b/lib/efi_loader/efi_file.c
@@ -11,6 +11,7 @@ 
 #include <malloc.h>
 #include <mapmem.h>
 #include <fs.h>
+#include <part.h>
 
 /* GUID for file system information */
 const efi_guid_t efi_file_system_info_guid = EFI_FILE_SYSTEM_INFO_GUID;
diff --git a/lib/gunzip.c b/lib/gunzip.c
index 9e6ccd692a3..bee3b9261f3 100644
--- a/lib/gunzip.c
+++ b/lib/gunzip.c
@@ -5,6 +5,7 @@ 
  */
 
 #include <common.h>
+#include <blk.h>
 #include <command.h>
 #include <console.h>
 #include <div64.h>
diff --git a/lib/image-sparse.c b/lib/image-sparse.c
index df623adc58e..3170c024f7b 100644
--- a/lib/image-sparse.c
+++ b/lib/image-sparse.c
@@ -36,6 +36,7 @@ 
 
 #include <config.h>
 #include <common.h>
+#include <blk.h>
 #include <image-sparse.h>
 #include <div64.h>
 #include <malloc.h>
diff --git a/test/dm/blk.c b/test/dm/blk.c
index 9c71adc69d9..94b2855b8e9 100644
--- a/test/dm/blk.c
+++ b/test/dm/blk.c
@@ -5,6 +5,7 @@ 
 
 #include <common.h>
 #include <dm.h>
+#include <part.h>
 #include <usb.h>
 #include <asm/state.h>
 #include <dm/test.h>
diff --git a/test/dm/mmc.c b/test/dm/mmc.c
index 9ab0db1b66f..49402b9c902 100644
--- a/test/dm/mmc.c
+++ b/test/dm/mmc.c
@@ -6,6 +6,7 @@ 
 #include <common.h>
 #include <dm.h>
 #include <mmc.h>
+#include <part.h>
 #include <dm/test.h>
 #include <test/ut.h>
 
diff --git a/test/dm/usb.c b/test/dm/usb.c
index e396c2a0ea1..a25c2c14820 100644
--- a/test/dm/usb.c
+++ b/test/dm/usb.c
@@ -6,6 +6,7 @@ 
 #include <common.h>
 #include <console.h>
 #include <dm.h>
+#include <part.h>
 #include <usb.h>
 #include <asm/io.h>
 #include <asm/state.h>