diff --git a/drivers/core/Kconfig b/drivers/core/Kconfig index 788f8b739bf40f8aca95f98466f9a3f77f03639e..41f4e695e8af8a8035f605049771b96dc4462203 100644 --- a/drivers/core/Kconfig +++ b/drivers/core/Kconfig @@ -105,4 +105,19 @@ config DEBUG_DEVRES If you are unsure about this, Say N here. +config SIMPLE_BUS + bool "Support simple-bus driver" + depends on DM && OF_CONTROL + default y + help + Supports the 'simple-bus' driver, which is used on some systems. + +config SPL_SIMPLE_BUS + bool "Support simple-bus driver in SPL" + depends on SPL_DM && SPL_OF_CONTROL + default n + help + Supports the 'simple-bus' driver, which is used on some systems + in SPL. + endmenu diff --git a/drivers/core/Makefile b/drivers/core/Makefile index 11e0276e56b289114a28cfe13a321079dbef8541..f19f67d30f76b17571a362c9fd360a7312800a90 100644 --- a/drivers/core/Makefile +++ b/drivers/core/Makefile @@ -6,10 +6,8 @@ obj-y += device.o lists.o root.o uclass.o util.o obj-$(CONFIG_DEVRES) += devres.o -ifndef CONFIG_SPL_BUILD -obj-$(CONFIG_$(SPL_)OF_CONTROL) += simple-bus.o -endif obj-$(CONFIG_$(SPL_)DM_DEVICE_REMOVE) += device-remove.o +obj-$(CONFIG_$(SPL_)SIMPLE_BUS) += simple-bus.o obj-$(CONFIG_DM) += dump.o obj-$(CONFIG_REGMAP) += regmap.o obj-$(CONFIG_SYSCON) += syscon-uclass.o diff --git a/drivers/core/device.c b/drivers/core/device.c index 826d82c61743c120f11d8ebfe0ed1f2d4da05098..01f664796d82e5df72ff993d0de78204e6e6eded 100644 --- a/drivers/core/device.c +++ b/drivers/core/device.c @@ -574,11 +574,9 @@ fdt_addr_t dev_get_addr(struct udevice *dev) fdt_addr_t addr; addr = fdtdec_get_addr(gd->fdt_blob, dev->of_offset, "reg"); - if (addr != FDT_ADDR_T_NONE) { -#ifndef CONFIG_SPL_BUILD + if (CONFIG_IS_ENABLED(SIMPLE_BUS) && addr != FDT_ADDR_T_NONE) { if (device_get_uclass_id(dev->parent) == UCLASS_SIMPLE_BUS) addr = simple_bus_translate(dev->parent, addr); -#endif } return addr;