diff mbox series

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

Message ID 20200510113946.v3.7.Ie9efa7c392b5a482adb565eacdefd0d695247df8@changeid
State Accepted
Commit e6f6f9e64882ddf242437c73fdd9ff06a8eb7c21
Headers show
Series common: Further reduce the size of common.h | expand

Commit Message

Simon Glass May 10, 2020, 5:39 p.m. UTC
Move this uncommon header out of the common header.

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

Changes in v3: None
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/fat.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                     | 3 +++
 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 +
 97 files changed, 142 insertions(+), 10 deletions(-)

Comments

Tom Rini May 19, 2020, 5:32 p.m. UTC | #1
On Sun, May 10, 2020 at 11:39:58AM -0600, Simon Glass wrote:

> Move this uncommon header out of the common header.
> 
> Signed-off-by: Simon Glass <sjg at chromium.org>

Applied to u-boot/master, thanks!
diff mbox series

Patch

diff --git a/api/api_storage.c b/api/api_storage.c
index 7ae03ac230..a0dacad1a5 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 6e519d8c91..6e6791fc65 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 79eb19992d..12c26a91c6 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 e9ac86b2da..4941e2d74f 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 511dfb78b8..7492c87c34 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 56d69cddac..1ed6b2aa92 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 d0d957d4f9..7a4e51571b 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 62f9a44e38..b944e62b6a 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/fat.c b/cmd/fat.c
index 854fe274bc..a063a623ce 100644
--- a/cmd/fat.c
+++ b/cmd/fat.c
@@ -11,6 +11,7 @@ 
 #include <mapmem.h>
 #include <fat.h>
 #include <fs.h>
+#include <part.h>
 #include <asm/cache.h>
 
 int do_fat_size(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
diff --git a/cmd/gpt.c b/cmd/gpt.c
index f2b1ad5489..c2964d8508 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 6142ec8e20..a29650b28e 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 5da903bd52..9ae91ce9cb 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 6bdb516cb5..c507e9dbd8 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 67de1a3bdc..e81194de0f 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 afd58e7cdb..725624627c 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 dd9ac0bc97..98fa300dfe 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 52ff637e2f..b603730248 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 b7082bc63a..f38cc56598 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 b5b8af1b27..72025bb552 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 954133ba84..3898041d10 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 fcdd3caeac..95d5a7271f 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 76af7cc6bd..aba9ccb7f5 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 68cba61c5a..bb0f6e2046 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 5a17d11b9b..7eea60b564 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 6e2a11090c..04f53106f7 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 6b206ddb4f..72bfb4b609 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 2ccb7867c9..822f2c4d9f 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 fbd0ad73e3..cda497e04a 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 4cd7420c3c..d54acc96ee 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 d2aa1a64d1..6a71f17684 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 c6680dc1c9..0ef70d0d59 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 e384b805b2..6a38d50024 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 a71a7edf88..cebb165a47 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 a28ac56ccd..e64cc4a5c1 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 41635742a8..4a7ffad6bd 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 7c39aa5f2f..4bda74bd06 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 0c343f7b64..e3ee778c29 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 ea40929e3e..6a8f789ff0 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 67cc4fbc02..868726c50c 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 cddca0c45f..8cd466f02e 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 467a8618fe..52da34b1e3 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 b165468145..eb8a36f292 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 0dbf304487..8fdaacd5e0 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 523c055967..ca62bb9891 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 b52ff9f3bc..6a4453ca02 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 2202158c88..4851198571 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 0983fbced3..b7e37416a4 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 5f1a023352..1d0c9988b1 100644
--- a/drivers/net/fm/eth.c
+++ b/drivers/net/fm/eth.c
@@ -5,6 +5,7 @@ 
  *	Dave Liu <daveliu at freescale.com>
  */
 #include <common.h>
+#include <part.h>
 #include <asm/io.h>
 #ifdef CONFIG_DM_ETH
 #include <dm.h>
diff --git a/drivers/nvme/nvme-uclass.c b/drivers/nvme/nvme-uclass.c
index 2d88efdb61..277e31e1f3 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 ef4382da1a..5e75152f42 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 69de6a53d5..849c42f0cd 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 8533abfd93..33f9a44d04 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 1cfeabcd31..da3d63c0f0 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 62acccedf3..0fd74fdec9 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 bd2e9c0c9b..8cc2eb1973 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 db8eb4ade8..f8ed0a9fea 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 aa8c0a962f..fbdec3af67 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 2907c53378..d5ed8d0096 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 8333ddc44c..ba34f1a107 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 1fa052e306..82ba5c4e7e 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 f08f117cf8..913beab4d4 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 e793e34e83..992118c607 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 6b5c4d855a..8e90bb71b7 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 f13b88b5f6..35a1955e63 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 e686abc5e3..1e5b83235a 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 b693a073fc..f80c148627 100644
--- a/fs/btrfs/super.c
+++ b/fs/btrfs/super.c
@@ -5,9 +5,11 @@ 
  * 2017 Marek Behun, CZ.NIC, marek.behun at nic.cz
  */
 
-#include "btrfs.h"
+#include <common.h>
 #include <memalign.h>
+#include <part.h>
 #include <linux/compat.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 5bf78b530a..9adef57476 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 0ceb73d9c9..2a8d397af4 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 67aeba1339..ce1fddc9a4 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 ad71f5ab6e..4c89152ce4 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 e3de25da5b..061917a984 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 1ff804d13b..115c010ef8 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 5851fe2434..4ae41d5b4d 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 742c2f47eb..bb35512380 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 3f4e69be9e..0941eb6b9c 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 f7f82ad7d1..a7605e1589 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 a900596c5f..85a211554a 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 0e924ad109..3e0c47b328 100644
--- a/include/efi_loader.h
+++ b/include/efi_loader.h
@@ -9,11 +9,14 @@ 
 #define _EFI_LOADER_H 1
 
 #include <common.h>
+#include <blk.h>
 #include <part_efi.h>
 #include <efi_api.h>
 #include <image.h>
 #include <pe.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 aafcd84140..cb5d9cc0a5 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 84573fd3fe..02742f92a5 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 0c58109e2f..76ed7cd6be 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 37e35c2120..9fdb4a3424 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 3edcc39f4e..fd915335b2 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 2e340673c3..783acbb60d 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 b5acdd01bd..c871767e20 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 a655d5ea9f..b61bb60067 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 49724d05c8..783dd5c88a 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 661a22e368..772879b1bd 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 16b757286e..b025779d59 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 33e66fcad2..e7d8745ad8 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 af1adbb71e..49bebb58cc 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 1fe7cf539e..9233767ee2 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 9e6ccd692a..bee3b9261f 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 df623adc58..3170c024f7 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 9c71adc69d..94b2855b8e 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 9ab0db1b66..49402b9c90 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 e396c2a0ea..a25c2c1482 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>