diff options
Diffstat (limited to 'drivers/core')
-rw-r--r-- | drivers/core/Kconfig | 4 | ||||
-rw-r--r-- | drivers/core/device.c | 4 | ||||
-rw-r--r-- | drivers/core/fdtaddr.c | 2 | ||||
-rw-r--r-- | drivers/core/lists.c | 2 | ||||
-rw-r--r-- | drivers/core/ofnode.c | 33 | ||||
-rw-r--r-- | drivers/core/root.c | 4 | ||||
-rw-r--r-- | drivers/core/simple-bus.c | 2 | ||||
-rw-r--r-- | drivers/core/syscon-uclass.c | 2 | ||||
-rw-r--r-- | drivers/core/uclass.c | 2 | ||||
-rw-r--r-- | drivers/core/util.c | 2 |
10 files changed, 43 insertions, 14 deletions
diff --git a/drivers/core/Kconfig b/drivers/core/Kconfig index 9ae188c1df..8f7703c8b5 100644 --- a/drivers/core/Kconfig +++ b/drivers/core/Kconfig @@ -80,7 +80,6 @@ config DM_DEVICE_REMOVE config SPL_DM_DEVICE_REMOVE bool "Support device removal in SPL" depends on SPL_DM - default n help We can save some code space by dropping support for removing a device. This is not normally required in SPL, so by default this @@ -107,7 +106,6 @@ config DM_SEQ_ALIAS config SPL_DM_SEQ_ALIAS bool "Support numbered aliases in device tree in SPL" depends on SPL_DM - default n help Most boards will have a '/aliases' node containing the path to numbered devices (e.g. serial0 = &serial0). This feature can be @@ -132,7 +130,6 @@ config TPL_DM_INLINE_OFNODE config DM_DMA bool "Support per-device DMA constraints" depends on DM - default n help Enable this to extract per-device DMA constraints, only supported on device-tree systems for now. This is needed in order translate @@ -274,7 +271,6 @@ config OF_TRANSLATE config SPL_OF_TRANSLATE bool "Translate addresses using fdt_translate_address in SPL" depends on SPL_DM && SPL_OF_CONTROL - default n help If this option is enabled, the reg property will be translated using the fdt_translate_address() function. This is necessary diff --git a/drivers/core/device.c b/drivers/core/device.c index 29668f6fb3..42ba2dce46 100644 --- a/drivers/core/device.c +++ b/drivers/core/device.c @@ -670,7 +670,7 @@ static int device_get_device_tail(struct udevice *dev, int ret, return 0; } -#if CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA) +#if CONFIG_IS_ENABLED(OF_REAL) /** * device_find_by_ofnode() - Return device associated with given ofnode * @@ -1074,7 +1074,7 @@ void dev_set_uclass_plat(struct udevice *dev, void *uclass_plat) dev->uclass_plat_ = uclass_plat; } -#if CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA) +#if CONFIG_IS_ENABLED(OF_REAL) bool device_is_compatible(const struct udevice *dev, const char *compat) { return ofnode_device_is_compatible(dev_ofnode(dev), compat); diff --git a/drivers/core/fdtaddr.c b/drivers/core/fdtaddr.c index 4ffbd6b2eb..6dfda20772 100644 --- a/drivers/core/fdtaddr.c +++ b/drivers/core/fdtaddr.c @@ -20,7 +20,7 @@ DECLARE_GLOBAL_DATA_PTR; fdt_addr_t devfdt_get_addr_index(const struct udevice *dev, int index) { -#if CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA) +#if CONFIG_IS_ENABLED(OF_REAL) fdt_addr_t addr; if (CONFIG_IS_ENABLED(OF_TRANSLATE)) { diff --git a/drivers/core/lists.c b/drivers/core/lists.c index e214306b90..350b9d3268 100644 --- a/drivers/core/lists.c +++ b/drivers/core/lists.c @@ -154,7 +154,7 @@ int device_bind_driver_to_node(struct udevice *parent, const char *drv_name, return ret; } -#if CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA) +#if CONFIG_IS_ENABLED(OF_REAL) /** * driver_check_compatible() - Check if a driver matches a compatible string * diff --git a/drivers/core/ofnode.c b/drivers/core/ofnode.c index 701b23e2c9..08705ef8d9 100644 --- a/drivers/core/ofnode.c +++ b/drivers/core/ofnode.c @@ -1103,3 +1103,36 @@ int ofnode_set_enabled(ofnode node, bool value) else return ofnode_write_string(node, "status", "disabled"); } + +bool ofnode_conf_read_bool(const char *prop_name) +{ + ofnode node; + + node = ofnode_path("/config"); + if (!ofnode_valid(node)) + return false; + + return ofnode_read_bool(node, prop_name); +} + +int ofnode_conf_read_int(const char *prop_name, int default_val) +{ + ofnode node; + + node = ofnode_path("/config"); + if (!ofnode_valid(node)) + return default_val; + + return ofnode_read_u32_default(node, prop_name, default_val); +} + +const char *ofnode_conf_read_str(const char *prop_name) +{ + ofnode node; + + node = ofnode_path("/config"); + if (!ofnode_valid(node)) + return NULL; + + return ofnode_read_string(node, prop_name); +} diff --git a/drivers/core/root.c b/drivers/core/root.c index 78eee082c9..fecdcb5b30 100644 --- a/drivers/core/root.c +++ b/drivers/core/root.c @@ -245,7 +245,7 @@ int dm_scan_plat(bool pre_reloc_only) return ret; } -#if CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA) +#if CONFIG_IS_ENABLED(OF_REAL) /** * dm_scan_fdt_node() - Scan the device tree and bind drivers for a node * @@ -372,7 +372,7 @@ static int dm_scan(bool pre_reloc_only) return ret; } - if (CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA)) { + if (CONFIG_IS_ENABLED(OF_REAL)) { ret = dm_extended_scan(pre_reloc_only); if (ret) { debug("dm_extended_scan() failed: %d\n", ret); diff --git a/drivers/core/simple-bus.c b/drivers/core/simple-bus.c index abc55c2171..6022e7514e 100644 --- a/drivers/core/simple-bus.c +++ b/drivers/core/simple-bus.c @@ -65,7 +65,7 @@ UCLASS_DRIVER(simple_bus) = { .per_device_plat_auto = sizeof(struct simple_bus_plat), }; -#if !CONFIG_IS_ENABLED(OF_PLATDATA) +#if CONFIG_IS_ENABLED(OF_REAL) static const struct udevice_id generic_simple_bus_ids[] = { { .compatible = "simple-bus" }, { .compatible = "simple-mfd" }, diff --git a/drivers/core/syscon-uclass.c b/drivers/core/syscon-uclass.c index cb33facc71..25fdb66eaa 100644 --- a/drivers/core/syscon-uclass.c +++ b/drivers/core/syscon-uclass.c @@ -186,7 +186,7 @@ static const struct udevice_id generic_syscon_ids[] = { U_BOOT_DRIVER(generic_syscon) = { .name = "syscon", .id = UCLASS_SYSCON, -#if !CONFIG_IS_ENABLED(OF_PLATDATA) +#if CONFIG_IS_ENABLED(OF_REAL) .bind = dm_scan_fdt_dev, #endif .of_match = generic_syscon_ids, diff --git a/drivers/core/uclass.c b/drivers/core/uclass.c index 3146dfd032..c5a50952fd 100644 --- a/drivers/core/uclass.c +++ b/drivers/core/uclass.c @@ -397,7 +397,7 @@ done: return ret; } -#if CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA) +#if CONFIG_IS_ENABLED(OF_REAL) int uclass_find_device_by_phandle(enum uclass_id id, struct udevice *parent, const char *name, struct udevice **devp) { diff --git a/drivers/core/util.c b/drivers/core/util.c index 5be4ee79de..aa60fdd15b 100644 --- a/drivers/core/util.c +++ b/drivers/core/util.c @@ -22,7 +22,7 @@ int list_count_items(struct list_head *head) return count; } -#if !CONFIG_IS_ENABLED(OF_PLATDATA) +#if CONFIG_IS_ENABLED(OF_REAL) int pci_get_devfn(struct udevice *dev) { struct fdt_pci_addr addr; |