blk: Rework guard around part_init call
authorTom Rini <trini@konsulko.com>
Wed, 5 Dec 2018 13:23:38 +0000 (08:23 -0500)
committerTom Rini <trini@konsulko.com>
Wed, 12 Dec 2018 17:14:22 +0000 (12:14 -0500)
The function part_init() will only be built when we have both
CONFIG_PARTITIONS and CONFIG_HAVE_BLOCK_DEVICE set.  Protect the call to
this function with both of these tests now.

Cc: Simon Glass <sjg@chromium.org>
Cc: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Cc: Michal Simek <michal.simek@xilinx.com>
Cc: York Sun <york.sun@nxp.com>
Cc: Prabhakar Kushwaha <prabhakar.kushwaha@nxp.com>
Cc: Mingkai Hu <mingkai.hu@nxp.com>
Cc: Stefan Roese <sr@denx.de>
Cc: Marek BehĂșn <marek.behun@nic.cz>
Cc: Vanessa Maegima <vanessa.maegima@nxp.com>
Cc: Eugen Hristev <eugen.hristev@microchip.com>
Cc: Adam Ford <aford173@gmail.com>
Cc: Jagan Teki <jagan@amarulasolutions.com>
Cc: Tom Warren <twarren@nvidia.com>
Cc: Stephen Warren <swarren@nvidia.com>
Cc: Vitaly Andrianov <vitalya@ti.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
common/spl/Kconfig
configs/evb-rk3036_defconfig
configs/kylin-rk3036_defconfig
doc/driver-model/MIGRATION.txt
drivers/Makefile
drivers/block/Makefile
drivers/block/blk-uclass.c
scripts/Makefile.spl

index 0ddbffc7d1c6a2d8cec87d7b63e8913c6dacf8ac..cab7220c9ace9991d9db9bb0ee79069f14c96488 100644 (file)
@@ -449,6 +449,7 @@ config SPL_LIBCOMMON_SUPPORT
 
 config SPL_LIBDISK_SUPPORT
        bool "Support disk partitions"
+       select PARTITIONS
        help
          Enable support for disk partitions within SPL. 'Disk' is something
          of a misnomer as it includes non-spinning media such as flash (as
@@ -480,6 +481,7 @@ config SPL_DM_MAILBOX
 config SPL_MMC_SUPPORT
        bool "Support MMC"
        depends on MMC
+       select HAVE_BLOCK_DEVICE
        help
          Enable support for MMC (Multimedia Card) within SPL. This enables
          the MMC protocol implementation and allows any enabled drivers to
@@ -754,6 +756,7 @@ config SPL_THERMAL
 
 config SPL_USB_HOST_SUPPORT
        bool "Support USB host drivers"
+       select HAVE_BLOCK_DEVICE
        help
          Enable access to USB (Universal Serial Bus) host devices so that
          SPL can load U-Boot from a connected USB peripheral, such as a USB
index 787d6f95c1bbe63b843884944b1b9ebe6eec8ca0..439e69138636013f7ff025aed1d7b45aa34de073 100644 (file)
@@ -32,6 +32,7 @@ CONFIG_SPL_PARTITION_UUIDS=y
 CONFIG_DEFAULT_DEVICE_TREE="rk3036-sdk"
 CONFIG_REGMAP=y
 CONFIG_SYSCON=y
+# CONFIG_SPL_BLK is not set
 CONFIG_CLK=y
 CONFIG_FASTBOOT_FLASH=y
 CONFIG_FASTBOOT_FLASH_MMC_DEV=0
index eb305e02aaa528b52ff67fb0d991c9abaa8200f6..765003095ca17a6e97883ddda5a03f02e0d921e3 100644 (file)
@@ -30,6 +30,7 @@ CONFIG_DEFAULT_DEVICE_TREE="rk3036-sdk"
 CONFIG_ENV_IS_IN_MMC=y
 CONFIG_REGMAP=y
 CONFIG_SYSCON=y
+# CONFIG_SPL_BLK is not set
 CONFIG_CLK=y
 CONFIG_FASTBOOT_FLASH=y
 CONFIG_FASTBOOT_FLASH_MMC_DEV=0
index 6b691338b4e7f271061e7be691d28b44f89c3e65..dce4aa3e1dc99e5ad4fdac6391ee47b9f6276c5c 100644 (file)
@@ -44,7 +44,9 @@ Deadline: 2019.07
 In concert with maintainers migrating their block device usage to the
 appropriate DM driver, CONFIG_BLK needs to be set as well.  The final deadline
 here coincides with the final deadline for migration of the various block
-subsystems.
+subsystems.  At this point we will be able to audit and correct the logic in
+Kconfig around using CONFIG_PARTITIONS and CONFIG_HAVE_BLOCK_DEVICE and make
+use of CONFIG_BLK / CONFIG_SPL_BLK as needed.
 
 CONFIG_DM_SPI
 CONFIG_DM_SPI_FLASH
index c425831b584f67b0de80e24f9e53b4b0d4d8ccbf..0538b50d01ca6d50ffbb3a3e5a156d38ba6d0582 100644 (file)
@@ -53,8 +53,7 @@ obj-$(CONFIG_SPL_WATCHDOG_SUPPORT) += watchdog/
 obj-$(CONFIG_SPL_USB_HOST_SUPPORT) += usb/host/
 obj-$(CONFIG_OMAP_USB_PHY) += usb/phy/
 obj-$(CONFIG_SPL_SATA_SUPPORT) += ata/ scsi/
-obj-$(CONFIG_SPL_USB_HOST_SUPPORT) += block/
-obj-$(CONFIG_SPL_MMC_SUPPORT) += block/
+obj-$(CONFIG_HAVE_BLOCK_DEVICE) += block/
 obj-$(CONFIG_SPL_FPGA_SUPPORT) += fpga/
 obj-$(CONFIG_SPL_THERMAL) += thermal/
 
index 055d42f7d4af263b5e7c476ef7e889e56618812c..3feb0aa997df57a36dc76c4317dc88b86a021501 100644 (file)
@@ -9,6 +9,8 @@ ifndef CONFIG_$(SPL_)BLK
 obj-y += blk_legacy.o
 endif
 
+ifndef CONFIG_SPL_BUILD
 obj-$(CONFIG_IDE) += ide.o
+endif
 obj-$(CONFIG_SANDBOX) += sandbox.o
 obj-$(CONFIG_$(SPL_TPL_)BLOCK_CACHE) += blkcache.o
index 65a766e586d610d78fd6bad56757fb32dab0823d..baaf431e5e0c3ce64af9b934fa140af496e0b2b5 100644 (file)
@@ -639,7 +639,7 @@ int blk_unbind_all(int if_type)
 
 static int blk_post_probe(struct udevice *dev)
 {
-#if !defined(CONFIG_SPL_BUILD) || defined(CONFIG_SPL_LIBDISK_SUPPORT)
+#if defined(CONFIG_PARTITIONS) && defined(CONFIG_HAVE_BLOCK_DEVICE)
        struct blk_desc *desc = dev_get_uclass_platdata(dev);
 
        part_init(desc);
index 22bd8f7c279ed6f1da6ed9c8404164c541adc2f5..2ef19bf005c99be2f846f48a6d831b8fce98962f 100644 (file)
@@ -81,9 +81,11 @@ libs-$(CONFIG_TPL_LIBGENERIC_SUPPORT) += lib/
 else
 libs-$(CONFIG_SPL_LIBCOMMON_SUPPORT) += common/ cmd/ env/
 libs-$(CONFIG_SPL_LIBGENERIC_SUPPORT) += lib/
+ifdef CONFIG_SPL_FRAMEWORK
+libs-$(CONFIG_PARTITIONS) += disk/
+endif
 endif
 
-libs-$(CONFIG_SPL_LIBDISK_SUPPORT) += disk/
 libs-y += drivers/
 libs-$(CONFIG_SPL_USB_GADGET_SUPPORT) += drivers/usb/dwc3/
 libs-y += dts/