From 0fd3d91152df5bb6c5f7b9ee68f01a9a1c9a875d Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Tue, 22 Dec 2020 19:30:28 -0700 Subject: dm: Use access methods for dev/uclass private data Most drivers use these access methods but a few do not. Update them. In some cases the access is not permitted, so mark those with a FIXME tag for the maintainer to check. Signed-off-by: Simon Glass Acked-by: Andy Shevchenko Acked-by: Pratyush Yadav --- drivers/timer/ag101p_timer.c | 4 ++-- drivers/timer/altera_timer.c | 4 ++-- drivers/timer/andes_plmt_timer.c | 7 ++++--- drivers/timer/mpc83xx_timer.c | 2 +- drivers/timer/sifive_clint_timer.c | 7 ++++--- drivers/timer/timer-uclass.c | 2 +- 6 files changed, 14 insertions(+), 12 deletions(-) (limited to 'drivers/timer') diff --git a/drivers/timer/ag101p_timer.c b/drivers/timer/ag101p_timer.c index 17174345e3..27cf9b0247 100644 --- a/drivers/timer/ag101p_timer.c +++ b/drivers/timer/ag101p_timer.c @@ -64,7 +64,7 @@ struct atftmr_timer_plat { static u64 atftmr_timer_get_count(struct udevice *dev) { - struct atftmr_timer_plat *plat = dev->plat; + struct atftmr_timer_plat *plat = dev_get_plat(dev); struct atftmr_timer_regs *const regs = plat->regs; u32 val; val = readl(®s->t3_counter); @@ -73,7 +73,7 @@ static u64 atftmr_timer_get_count(struct udevice *dev) static int atftmr_timer_probe(struct udevice *dev) { - struct atftmr_timer_plat *plat = dev->plat; + struct atftmr_timer_plat *plat = dev_get_plat(dev); struct atftmr_timer_regs *const regs = plat->regs; u32 cr; writel(0, ®s->t3_load); diff --git a/drivers/timer/altera_timer.c b/drivers/timer/altera_timer.c index 7e9abee0ef..040dc65f48 100644 --- a/drivers/timer/altera_timer.c +++ b/drivers/timer/altera_timer.c @@ -34,7 +34,7 @@ struct altera_timer_plat { static u64 altera_timer_get_count(struct udevice *dev) { - struct altera_timer_plat *plat = dev->plat; + struct altera_timer_plat *plat = dev_get_plat(dev); struct altera_timer_regs *const regs = plat->regs; u32 val; @@ -49,7 +49,7 @@ static u64 altera_timer_get_count(struct udevice *dev) static int altera_timer_probe(struct udevice *dev) { - struct altera_timer_plat *plat = dev->plat; + struct altera_timer_plat *plat = dev_get_plat(dev); struct altera_timer_regs *const regs = plat->regs; writel(0, ®s->status); diff --git a/drivers/timer/andes_plmt_timer.c b/drivers/timer/andes_plmt_timer.c index cec86718c7..db2cf86f63 100644 --- a/drivers/timer/andes_plmt_timer.c +++ b/drivers/timer/andes_plmt_timer.c @@ -12,6 +12,7 @@ #include #include #include +#include #include /* mtime register */ @@ -19,7 +20,7 @@ static u64 andes_plmt_get_count(struct udevice *dev) { - return readq((void __iomem *)MTIME_REG(dev->priv)); + return readq((void __iomem *)MTIME_REG(dev_get_priv(dev))); } static const struct timer_ops andes_plmt_ops = { @@ -28,8 +29,8 @@ static const struct timer_ops andes_plmt_ops = { static int andes_plmt_probe(struct udevice *dev) { - dev->priv = dev_read_addr_ptr(dev); - if (!dev->priv) + dev_set_priv(dev, dev_read_addr_ptr(dev)); + if (!dev_get_priv(dev)) return -EINVAL; return timer_timebase_fallback(dev); diff --git a/drivers/timer/mpc83xx_timer.c b/drivers/timer/mpc83xx_timer.c index 9b1daaadeb..2f2b8be3dc 100644 --- a/drivers/timer/mpc83xx_timer.c +++ b/drivers/timer/mpc83xx_timer.c @@ -206,7 +206,7 @@ static u64 mpc83xx_timer_get_count(struct udevice *dev) static int mpc83xx_timer_probe(struct udevice *dev) { - struct timer_dev_priv *uc_priv = dev->uclass_priv; + struct timer_dev_priv *uc_priv = dev_get_uclass_priv(dev); struct clk clock; int ret; diff --git a/drivers/timer/sifive_clint_timer.c b/drivers/timer/sifive_clint_timer.c index 00ce0f08d6..de23b85404 100644 --- a/drivers/timer/sifive_clint_timer.c +++ b/drivers/timer/sifive_clint_timer.c @@ -9,6 +9,7 @@ #include #include #include +#include #include /* mtime register */ @@ -16,7 +17,7 @@ static u64 sifive_clint_get_count(struct udevice *dev) { - return readq((void __iomem *)MTIME_REG(dev->priv)); + return readq((void __iomem *)MTIME_REG(dev_get_priv(dev))); } static const struct timer_ops sifive_clint_ops = { @@ -25,8 +26,8 @@ static const struct timer_ops sifive_clint_ops = { static int sifive_clint_probe(struct udevice *dev) { - dev->priv = dev_read_addr_ptr(dev); - if (!dev->priv) + dev_set_priv(dev, dev_read_addr_ptr(dev)); + if (!dev_get_priv(dev)) return -EINVAL; return timer_timebase_fallback(dev); diff --git a/drivers/timer/timer-uclass.c b/drivers/timer/timer-uclass.c index ab53555327..8e63c17e9f 100644 --- a/drivers/timer/timer-uclass.c +++ b/drivers/timer/timer-uclass.c @@ -40,7 +40,7 @@ int notrace timer_get_count(struct udevice *dev, u64 *count) unsigned long notrace timer_get_rate(struct udevice *dev) { - struct timer_dev_priv *uc_priv = dev->uclass_priv; + struct timer_dev_priv *uc_priv = dev_get_uclass_priv(dev); return uc_priv->clock_rate; } -- cgit v1.2.3 From 8b842be10c2d40437b1f24a8dce8718c33045376 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Wed, 23 Dec 2020 08:11:30 -0700 Subject: x86: apl: Reduce size for TPL Update various drivers to use of_match_ptr() and to avoid including debug strings in TPL. Omit the WiFi driver entirely, since it is not used in TPL. This reduces the TPL binary size by about 608 bytes. Signed-off-by: Simon Glass --- arch/x86/cpu/apollolake/lpc.c | 13 ++++++++----- arch/x86/cpu/apollolake/pch.c | 4 +++- arch/x86/cpu/apollolake/pmc.c | 4 +++- arch/x86/cpu/apollolake/uart.c | 4 +++- arch/x86/cpu/intel_common/Makefile | 2 +- arch/x86/cpu/intel_common/itss.c | 4 +++- arch/x86/cpu/intel_common/p2sb.c | 4 +++- arch/x86/cpu/turbo.c | 5 +++++ board/google/chromebook_coral/coral.c | 4 +++- drivers/gpio/intel_gpio.c | 4 +++- drivers/pinctrl/intel/pinctrl_apl.c | 4 +++- drivers/power/acpi_pmc/acpi-pmc-uclass.c | 4 +++- drivers/timer/tsc_timer.c | 4 +++- 13 files changed, 44 insertions(+), 16 deletions(-) (limited to 'drivers/timer') diff --git a/arch/x86/cpu/apollolake/lpc.c b/arch/x86/cpu/apollolake/lpc.c index d8e05f6a8f..e085890d63 100644 --- a/arch/x86/cpu/apollolake/lpc.c +++ b/arch/x86/cpu/apollolake/lpc.c @@ -81,10 +81,11 @@ int lpc_open_pmio_window(uint base, uint size) lgir_reg_num = find_unused_pmio_window(); if (lgir_reg_num < 0) { - log_err("LPC: Cannot open IO window: %lx size %lx\n", - bridge_base, size - bridged_size); - log_err("No more IO windows\n"); - + if (spl_phase() > PHASE_TPL) { + log_err("LPC: Cannot open IO window: %lx size %lx\n", + bridge_base, size - bridged_size); + log_err("No more IO windows\n"); + } return -ENOSPC; } lgir_reg_offset = LPC_GENERIC_IO_RANGE(lgir_reg_num); @@ -127,15 +128,17 @@ struct acpi_ops apl_lpc_acpi_ops = { .inject_dsdt = southbridge_inject_dsdt, }; +#if !CONFIG_IS_ENABLED(OF_PLATDATA) static const struct udevice_id apl_lpc_ids[] = { { .compatible = "intel,apl-lpc" }, { } }; +#endif /* All pads are LPC already configured by the hostbridge, so no probing here */ U_BOOT_DRIVER(intel_apl_lpc) = { .name = "intel_apl_lpc", .id = UCLASS_LPC, - .of_match = apl_lpc_ids, + .of_match = of_match_ptr(apl_lpc_ids), ACPI_OPS_PTR(&apl_lpc_acpi_ops) }; diff --git a/arch/x86/cpu/apollolake/pch.c b/arch/x86/cpu/apollolake/pch.c index d9832ff249..39d6ad5ed4 100644 --- a/arch/x86/cpu/apollolake/pch.c +++ b/arch/x86/cpu/apollolake/pch.c @@ -23,14 +23,16 @@ static const struct pch_ops apl_pch_ops = { .set_spi_protect = apl_set_spi_protect, }; +#if !CONFIG_IS_ENABLED(OF_PLATDATA) static const struct udevice_id apl_pch_ids[] = { { .compatible = "intel,apl-pch" }, { } }; +#endif U_BOOT_DRIVER(intel_apl_pch) = { .name = "intel_apl_pch", .id = UCLASS_PCH, - .of_match = apl_pch_ids, + .of_match = of_match_ptr(apl_pch_ids), .ops = &apl_pch_ops, }; diff --git a/arch/x86/cpu/apollolake/pmc.c b/arch/x86/cpu/apollolake/pmc.c index c40065ab8c..e033baf120 100644 --- a/arch/x86/cpu/apollolake/pmc.c +++ b/arch/x86/cpu/apollolake/pmc.c @@ -212,15 +212,17 @@ static const struct acpi_pmc_ops apl_pmc_ops = { .global_reset_set_enable = apl_global_reset_set_enable, }; +#if !CONFIG_IS_ENABLED(OF_PLATDATA) static const struct udevice_id apl_pmc_ids[] = { { .compatible = "intel,apl-pmc" }, { } }; +#endif U_BOOT_DRIVER(intel_apl_pmc) = { .name = "intel_apl_pmc", .id = UCLASS_ACPI_PMC, - .of_match = apl_pmc_ids, + .of_match = of_match_ptr(apl_pmc_ids), .of_to_plat = apl_pmc_ofdata_to_uc_plat, .probe = apl_pmc_probe, .ops = &apl_pmc_ops, diff --git a/arch/x86/cpu/apollolake/uart.c b/arch/x86/cpu/apollolake/uart.c index e523d85b1b..69e5899235 100644 --- a/arch/x86/cpu/apollolake/uart.c +++ b/arch/x86/cpu/apollolake/uart.c @@ -118,15 +118,17 @@ static int apl_ns16550_of_to_plat(struct udevice *dev) return 0; } +#if !CONFIG_IS_ENABLED(OF_PLATDATA) static const struct udevice_id apl_ns16550_serial_ids[] = { { .compatible = "intel,apl-ns16550" }, { }, }; +#endif U_BOOT_DRIVER(intel_apl_ns16550) = { .name = "intel_apl_ns16550", .id = UCLASS_SERIAL, - .of_match = apl_ns16550_serial_ids, + .of_match = of_match_ptr(apl_ns16550_serial_ids), .plat_auto = sizeof(struct ns16550_plat), .priv_auto = sizeof(struct ns16550), .ops = &ns16550_serial_ops, diff --git a/arch/x86/cpu/intel_common/Makefile b/arch/x86/cpu/intel_common/Makefile index 4a5cf17e41..8b9a810f66 100644 --- a/arch/x86/cpu/intel_common/Makefile +++ b/arch/x86/cpu/intel_common/Makefile @@ -26,7 +26,7 @@ obj-y += cpu.o obj-y += fast_spi.o obj-y += lpc.o obj-y += lpss.o -obj-$(CONFIG_INTEL_GENERIC_WIFI) += generic_wifi.o +obj-$(CONFIG_$(SPL_)INTEL_GENERIC_WIFI) += generic_wifi.o ifndef CONFIG_TARGET_EFI_APP obj-$(CONFIG_$(SPL_TPL_)X86_32BIT_INIT) += microcode.o ifndef CONFIG_$(SPL_)X86_64 diff --git a/arch/x86/cpu/intel_common/itss.c b/arch/x86/cpu/intel_common/itss.c index e71ea029e5..6515d1f471 100644 --- a/arch/x86/cpu/intel_common/itss.c +++ b/arch/x86/cpu/intel_common/itss.c @@ -230,15 +230,17 @@ static const struct irq_ops itss_ops = { #endif }; +#if !CONFIG_IS_ENABLED(OF_PLATDATA) static const struct udevice_id itss_ids[] = { { .compatible = "intel,itss", .data = X86_IRQT_ITSS }, { } }; +#endif U_BOOT_DRIVER(intel_itss) = { .name = "intel_itss", .id = UCLASS_IRQ, - .of_match = itss_ids, + .of_match = of_match_ptr(itss_ids), .ops = &itss_ops, .bind = itss_bind, .of_to_plat = itss_of_to_plat, diff --git a/arch/x86/cpu/intel_common/p2sb.c b/arch/x86/cpu/intel_common/p2sb.c index 3765eeeab0..cb901f265e 100644 --- a/arch/x86/cpu/intel_common/p2sb.c +++ b/arch/x86/cpu/intel_common/p2sb.c @@ -184,15 +184,17 @@ static const struct p2sb_ops p2sb_ops = { .set_hide = intel_p2sb_set_hide, }; +#if !CONFIG_IS_ENABLED(OF_PLATDATA) static const struct udevice_id p2sb_ids[] = { { .compatible = "intel,p2sb" }, { } }; +#endif U_BOOT_DRIVER(intel_p2sb) = { .name = "intel_p2sb", .id = UCLASS_P2SB, - .of_match = p2sb_ids, + .of_match = of_match_ptr(p2sb_ids), .probe = p2sb_probe, .remove = p2sb_remove, .ops = &p2sb_ops, diff --git a/arch/x86/cpu/turbo.c b/arch/x86/cpu/turbo.c index f8d85d5a33..4a73cb240d 100644 --- a/arch/x86/cpu/turbo.c +++ b/arch/x86/cpu/turbo.c @@ -35,12 +35,15 @@ static inline void set_global_turbo_state(int state) } #endif +/* gcc 7.3 does not wwant to drop strings, so use #ifdef */ +#ifndef CONFIG_TPL_BUILD static const char *const turbo_state_desc[] = { [TURBO_UNKNOWN] = "unknown", [TURBO_UNAVAILABLE] = "unavailable", [TURBO_DISABLED] = "available but hidden", [TURBO_ENABLED] = "available and visible" }; +#endif /* * Determine the current state of Turbo and cache it for later. @@ -76,7 +79,9 @@ int turbo_get_state(void) } set_global_turbo_state(turbo_state); +#ifndef CONFIG_TPL_BUILD debug("Turbo is %s\n", turbo_state_desc[turbo_state]); +#endif return turbo_state; } diff --git a/board/google/chromebook_coral/coral.c b/board/google/chromebook_coral/coral.c index b8b923c139..34b2c2ac5d 100644 --- a/board/google/chromebook_coral/coral.c +++ b/board/google/chromebook_coral/coral.c @@ -143,14 +143,16 @@ struct acpi_ops coral_acpi_ops = { .inject_dsdt = chromeos_acpi_gpio_generate, }; +#if !CONFIG_IS_ENABLED(OF_PLATDATA) static const struct udevice_id coral_ids[] = { { .compatible = "google,coral" }, { } }; +#endif U_BOOT_DRIVER(coral_drv) = { .name = "coral", .id = UCLASS_SYSINFO, - .of_match = coral_ids, + .of_match = of_match_ptr(coral_ids), ACPI_OPS_PTR(&coral_acpi_ops) }; diff --git a/drivers/gpio/intel_gpio.c b/drivers/gpio/intel_gpio.c index 41540d8ebc..eda95485c9 100644 --- a/drivers/gpio/intel_gpio.c +++ b/drivers/gpio/intel_gpio.c @@ -188,15 +188,17 @@ static const struct dm_gpio_ops gpio_intel_ops = { #endif }; +#if !CONFIG_IS_ENABLED(OF_PLATDATA) static const struct udevice_id intel_intel_gpio_ids[] = { { .compatible = "intel,gpio" }, { } }; +#endif U_BOOT_DRIVER(intel_gpio) = { .name = "intel_gpio", .id = UCLASS_GPIO, - .of_match = intel_intel_gpio_ids, + .of_match = of_match_ptr(intel_intel_gpio_ids), .ops = &gpio_intel_ops, .of_to_plat = intel_gpio_of_to_plat, .probe = intel_gpio_probe, diff --git a/drivers/pinctrl/intel/pinctrl_apl.c b/drivers/pinctrl/intel/pinctrl_apl.c index 2bb654c8a1..b512a85f3e 100644 --- a/drivers/pinctrl/intel/pinctrl_apl.c +++ b/drivers/pinctrl/intel/pinctrl_apl.c @@ -167,15 +167,17 @@ static int apl_pinctrl_of_to_plat(struct udevice *dev) return intel_pinctrl_of_to_plat(dev, comm, 2); } +#if !CONFIG_IS_ENABLED(OF_PLATDATA) static const struct udevice_id apl_gpio_ids[] = { { .compatible = "intel,apl-pinctrl"}, { } }; +#endif U_BOOT_DRIVER(intel_apl_pinctrl) = { .name = "intel_apl_pinctrl", .id = UCLASS_PINCTRL, - .of_match = apl_gpio_ids, + .of_match = of_match_ptr(apl_gpio_ids), .probe = intel_pinctrl_probe, .ops = &intel_pinctrl_ops, #if !CONFIG_IS_ENABLED(OF_PLATDATA) diff --git a/drivers/power/acpi_pmc/acpi-pmc-uclass.c b/drivers/power/acpi_pmc/acpi-pmc-uclass.c index 32a2836f0b..34446a34e6 100644 --- a/drivers/power/acpi_pmc/acpi-pmc-uclass.c +++ b/drivers/power/acpi_pmc/acpi-pmc-uclass.c @@ -8,6 +8,7 @@ #include #include #include +#include #include #ifdef CONFIG_X86 #include @@ -60,7 +61,8 @@ int pmc_gpe_init(struct udevice *dev) * are different and if they aren't, use the reset values. */ if (dw[0] == dw[1] || dw[1] == dw[2]) { - log_info("PMC: Using default GPE route"); + if (spl_phase() > PHASE_TPL) + log_info("PMC: Using default GPE route"); gpio_cfg = readl(upriv->gpe_cfg); for (i = 0; i < upriv->gpe0_count; i++) dw[i] = gpio_cfg >> gpe0_shift(upriv, i); diff --git a/drivers/timer/tsc_timer.c b/drivers/timer/tsc_timer.c index e3677704b3..706d52b830 100644 --- a/drivers/timer/tsc_timer.c +++ b/drivers/timer/tsc_timer.c @@ -477,15 +477,17 @@ static const struct timer_ops tsc_timer_ops = { .get_count = tsc_timer_get_count, }; +#if !CONFIG_IS_ENABLED(OF_PLATDATA) static const struct udevice_id tsc_timer_ids[] = { { .compatible = "x86,tsc-timer", }, { } }; +#endif U_BOOT_DRIVER(x86_tsc_timer) = { .name = "x86_tsc_timer", .id = UCLASS_TIMER, - .of_match = tsc_timer_ids, + .of_match = of_match_ptr(tsc_timer_ids), .probe = tsc_timer_probe, .ops = &tsc_timer_ops, }; -- cgit v1.2.3 From 7d14ee443ca674314e0fe5c3e25f48e52a8fd5ee Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Sat, 19 Dec 2020 10:40:13 -0700 Subject: dm: core: Use dev_has_ofnode() instead of dev_of_valid() We have two functions which do the same thing. Standardise on dev_has_ofnode() since there is no such thing as an 'invalid' ofnode in normal operation: it is either null or missing. Also move the functions into one place. Signed-off-by: Simon Glass Reviewed-by: Andy Shevchenko --- drivers/clk/clk-uclass.c | 2 +- drivers/core/device.c | 2 +- drivers/gpio/sandbox.c | 2 +- drivers/i2c/designware_i2c_pci.c | 4 ++-- drivers/i2c/i2c-uclass.c | 2 +- drivers/mmc/pci_mmc.c | 2 +- drivers/pci/pci-uclass.c | 6 +++--- drivers/pinctrl/pinctrl-uclass.c | 2 +- drivers/spi/spi-uclass.c | 2 +- drivers/sysreset/sysreset_sandbox.c | 2 +- drivers/timer/timer-uclass.c | 2 +- drivers/usb/host/usb-uclass.c | 2 +- include/dm/device.h | 13 ++++++++++++- include/dm/read.h | 16 ---------------- test/dm/pci.c | 6 +++--- 15 files changed, 30 insertions(+), 35 deletions(-) (limited to 'drivers/timer') diff --git a/drivers/clk/clk-uclass.c b/drivers/clk/clk-uclass.c index ac954a34d2..5cfd00ce77 100644 --- a/drivers/clk/clk-uclass.c +++ b/drivers/clk/clk-uclass.c @@ -345,7 +345,7 @@ int clk_set_defaults(struct udevice *dev, int stage) { int ret; - if (!dev_of_valid(dev)) + if (!dev_has_ofnode(dev)) return 0; /* If this not in SPL and pre-reloc state, don't take any action. */ diff --git a/drivers/core/device.c b/drivers/core/device.c index 8c7ce220f8..bd4ecc9e24 100644 --- a/drivers/core/device.c +++ b/drivers/core/device.c @@ -485,7 +485,7 @@ int device_probe(struct udevice *dev) } /* Only handle devices that have a valid ofnode */ - if (dev_of_valid(dev)) { + if (dev_has_ofnode(dev)) { /* * Process 'assigned-{clocks/clock-parents/clock-rates}' * properties diff --git a/drivers/gpio/sandbox.c b/drivers/gpio/sandbox.c index 489271b560..f8fa4baa2c 100644 --- a/drivers/gpio/sandbox.c +++ b/drivers/gpio/sandbox.c @@ -294,7 +294,7 @@ static int gpio_sandbox_probe(struct udevice *dev) { struct gpio_dev_priv *uc_priv = dev_get_uclass_priv(dev); - if (!dev_of_valid(dev)) + if (!dev_has_ofnode(dev)) /* Tell the uclass how many GPIOs we have */ uc_priv->gpio_count = CONFIG_SANDBOX_GPIO_COUNT; diff --git a/drivers/i2c/designware_i2c_pci.c b/drivers/i2c/designware_i2c_pci.c index 18eef625f0..ec0cdf6220 100644 --- a/drivers/i2c/designware_i2c_pci.c +++ b/drivers/i2c/designware_i2c_pci.c @@ -92,7 +92,7 @@ static int designware_i2c_pci_bind(struct udevice *dev) { char name[20]; - if (dev_of_valid(dev)) + if (dev_has_ofnode(dev)) return 0; sprintf(name, "i2c_designware#%u", dev_seq(dev)); @@ -152,7 +152,7 @@ static int dw_i2c_acpi_fill_ssdt(const struct udevice *dev, int ret; /* If no device-tree node, ignore this since we assume it isn't used */ - if (!dev_of_valid(dev)) + if (!dev_has_ofnode(dev)) return 0; ret = acpi_device_path(dev, path, sizeof(path)); diff --git a/drivers/i2c/i2c-uclass.c b/drivers/i2c/i2c-uclass.c index 456cf3b85f..be56785217 100644 --- a/drivers/i2c/i2c-uclass.c +++ b/drivers/i2c/i2c-uclass.c @@ -678,7 +678,7 @@ static int i2c_child_post_bind(struct udevice *dev) #if CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA) struct dm_i2c_chip *plat = dev_get_parent_plat(dev); - if (!dev_of_valid(dev)) + if (!dev_has_ofnode(dev)) return 0; return i2c_chip_of_to_plat(dev, plat); #else diff --git a/drivers/mmc/pci_mmc.c b/drivers/mmc/pci_mmc.c index fc09ad99e5..c71c495d58 100644 --- a/drivers/mmc/pci_mmc.c +++ b/drivers/mmc/pci_mmc.c @@ -75,7 +75,7 @@ static int pci_mmc_acpi_fill_ssdt(const struct udevice *dev, struct acpi_dp *dp; int ret; - if (!dev_of_valid(dev)) + if (!dev_has_ofnode(dev)) return 0; ret = gpio_get_acpi(&priv->cd_gpio, &gpio); diff --git a/drivers/pci/pci-uclass.c b/drivers/pci/pci-uclass.c index 1f6c51f1e8..4cdd06b125 100644 --- a/drivers/pci/pci-uclass.c +++ b/drivers/pci/pci-uclass.c @@ -540,7 +540,7 @@ int pci_auto_config_devices(struct udevice *bus) int ret; debug("%s: device %s\n", __func__, dev->name); - if (dev_of_valid(dev) && + if (dev_has_ofnode(dev) && dev_read_bool(dev, "pci,no-autoconfig")) continue; ret = dm_pciauto_config_device(dev); @@ -1036,7 +1036,7 @@ static int pci_uclass_pre_probe(struct udevice *bus) hose->bus = bus; hose->first_busno = dev_seq(bus); hose->last_busno = dev_seq(bus); - if (dev_of_valid(bus)) { + if (dev_has_ofnode(bus)) { hose->skip_auto_config_until_reloc = dev_read_bool(bus, "u-boot,skip-auto-config-until-reloc"); @@ -1091,7 +1091,7 @@ static int pci_uclass_child_post_bind(struct udevice *dev) { struct pci_child_plat *pplat; - if (!dev_of_valid(dev)) + if (!dev_has_ofnode(dev)) return 0; pplat = dev_get_parent_plat(dev); diff --git a/drivers/pinctrl/pinctrl-uclass.c b/drivers/pinctrl/pinctrl-uclass.c index 4653e86ba4..7919e54e8d 100644 --- a/drivers/pinctrl/pinctrl-uclass.c +++ b/drivers/pinctrl/pinctrl-uclass.c @@ -112,7 +112,7 @@ static int pinconfig_post_bind(struct udevice *dev) ofnode node; int ret; - if (!dev_of_valid(dev)) + if (!dev_has_ofnode(dev)) return 0; dev_for_each_subnode(node, dev) { diff --git a/drivers/spi/spi-uclass.c b/drivers/spi/spi-uclass.c index a392a93aa1..ba325cf4e0 100644 --- a/drivers/spi/spi-uclass.c +++ b/drivers/spi/spi-uclass.c @@ -160,7 +160,7 @@ static int spi_child_post_bind(struct udevice *dev) { struct dm_spi_slave_plat *plat = dev_get_parent_plat(dev); - if (!dev_of_valid(dev)) + if (!dev_has_ofnode(dev)) return 0; return spi_slave_of_to_plat(dev, plat); diff --git a/drivers/sysreset/sysreset_sandbox.c b/drivers/sysreset/sysreset_sandbox.c index 7026a48c4b..8eca7d8bfd 100644 --- a/drivers/sysreset/sysreset_sandbox.c +++ b/drivers/sysreset/sysreset_sandbox.c @@ -50,7 +50,7 @@ static int sandbox_sysreset_request(struct udevice *dev, enum sysreset_t type) * (see the U_BOOT_DEVICE() declaration below) should not do anything. * If we are that device, return an error. */ - if (state->fdt_fname && !dev_of_valid(dev)) + if (state->fdt_fname && !dev_has_ofnode(dev)) return -ENODEV; switch (type) { diff --git a/drivers/timer/timer-uclass.c b/drivers/timer/timer-uclass.c index 8e63c17e9f..da1a72f025 100644 --- a/drivers/timer/timer-uclass.c +++ b/drivers/timer/timer-uclass.c @@ -54,7 +54,7 @@ static int timer_pre_probe(struct udevice *dev) ulong ret; /* It is possible that a timer device has a null ofnode */ - if (!dev_of_valid(dev)) + if (!dev_has_ofnode(dev)) return 0; err = clk_get_by_index(dev, 0, &timer_clk); diff --git a/drivers/usb/host/usb-uclass.c b/drivers/usb/host/usb-uclass.c index ae6b1450d3..e3b616c326 100644 --- a/drivers/usb/host/usb-uclass.c +++ b/drivers/usb/host/usb-uclass.c @@ -773,7 +773,7 @@ static int usb_child_post_bind(struct udevice *dev) struct usb_dev_plat *plat = dev_get_parent_plat(dev); int val; - if (!dev_of_valid(dev)) + if (!dev_has_ofnode(dev)) return 0; /* We only support matching a few things */ diff --git a/include/dm/device.h b/include/dm/device.h index b15a14ec33..4a1224bcc2 100644 --- a/include/dm/device.h +++ b/include/dm/device.h @@ -192,6 +192,17 @@ static inline void dev_bic_flags(struct udevice *dev, u32 bic) dev->flags_ &= ~bic; } +/** + * dev_ofnode() - get the DT node reference associated with a udevice + * + * @dev: device to check + * @return reference of the the device's DT node + */ +static inline ofnode dev_ofnode(const struct udevice *dev) +{ + return dev->node; +} + /* Returns non-zero if the device is active (probed and not removed) */ #define device_active(dev) (dev_get_flags(dev) & DM_FLAG_ACTIVATED) @@ -200,7 +211,7 @@ static inline int dev_of_offset(const struct udevice *dev) return ofnode_to_offset(dev->node); } -static inline bool dev_has_ofnode(struct udevice *dev) +static inline bool dev_has_ofnode(const struct udevice *dev) { return ofnode_valid(dev->node); } diff --git a/include/dm/read.h b/include/dm/read.h index 0585eb1228..d5cdd87911 100644 --- a/include/dm/read.h +++ b/include/dm/read.h @@ -30,22 +30,6 @@ static inline const struct device_node *dev_np(const struct udevice *dev) } #endif -/** - * dev_ofnode() - get the DT node reference associated with a udevice - * - * @dev: device to check - * @return reference of the the device's DT node - */ -static inline ofnode dev_ofnode(const struct udevice *dev) -{ - return dev->node; -} - -static inline bool dev_of_valid(const struct udevice *dev) -{ - return ofnode_valid(dev_ofnode(dev)); -} - #ifndef CONFIG_DM_DEV_READ_INLINE /** diff --git a/test/dm/pci.c b/test/dm/pci.c index 76490befdf..fa2e4a8559 100644 --- a/test/dm/pci.c +++ b/test/dm/pci.c @@ -120,13 +120,13 @@ static int dm_test_pci_drvdata(struct unit_test_state *uts) ut_assertok(dm_pci_bus_find_bdf(PCI_BDF(1, 0x08, 0), &swap)); ut_asserteq(SWAP_CASE_DRV_DATA, swap->driver_data); - ut_assertok(dev_of_valid(swap)); + ut_assertok(dev_has_ofnode(swap)); ut_assertok(dm_pci_bus_find_bdf(PCI_BDF(1, 0x0c, 0), &swap)); ut_asserteq(SWAP_CASE_DRV_DATA, swap->driver_data); - ut_assertok(dev_of_valid(swap)); + ut_assertok(dev_has_ofnode(swap)); ut_assertok(dm_pci_bus_find_bdf(PCI_BDF(1, 0x10, 0), &swap)); ut_asserteq(SWAP_CASE_DRV_DATA, swap->driver_data); - ut_assertok(!dev_of_valid(swap)); + ut_assertok(!dev_has_ofnode(swap)); return 0; } -- cgit v1.2.3 From 20e442ab2df355450006574fff178c746d254a18 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Mon, 28 Dec 2020 20:34:54 -0700 Subject: dm: Rename U_BOOT_DEVICE() to U_BOOT_DRVINFO() The current macro is a misnomer since it does not declare a device directly. Instead, it declares driver_info record which U-Boot uses at runtime to create a device. The distinction seems somewhat minor most of the time, but is becomes quite confusing when we actually want to declare a device, with of-platdata. We are left trying to distinguish between a device which isn't actually device, and a device that is (perhaps an 'instance'?) It seems better to rename this macro to describe what it actually is. The macros is not widely used, since boards should use devicetree to declare devices. Rename it to U_BOOT_DRVINFO(), which indicates clearly that this is declaring a new driver_info record, not a device. Signed-off-by: Simon Glass --- arch/arm/mach-at91/arm926ejs/at91sam9260_devices.c | 2 +- .../mach-at91/arm926ejs/at91sam9m10g45_devices.c | 2 +- arch/arm/mach-imx/mx6/soc.c | 2 +- arch/arm/mach-imx/mx7/soc.c | 2 +- arch/arm/mach-lpc32xx/devices.c | 4 +- arch/arm/mach-omap2/am33xx/board.c | 10 ++-- arch/arm/mach-omap2/omap3/board.c | 2 +- arch/arm/mach-tegra/board.c | 2 +- arch/arm/mach-tegra/board2.c | 2 +- board/armltd/integrator/integrator.c | 2 +- board/armltd/total_compute/total_compute.c | 2 +- board/armltd/vexpress64/vexpress64.c | 2 +- board/bluewater/gurnard/gurnard.c | 2 +- board/bluewater/snapper9260/snapper9260.c | 2 +- board/cadence/xtfpga/xtfpga.c | 4 +- board/cavium/thunderx/thunderx.c | 4 +- board/compulab/cm_fx6/cm_fx6.c | 2 +- board/davinci/da8xxevm/omapl138_lcdk.c | 4 +- board/freescale/ls1012afrdm/eth.c | 4 +- board/freescale/ls1012aqds/eth.c | 4 +- board/freescale/ls1012ardb/eth.c | 4 +- board/freescale/lx2160a/lx2160a.c | 4 +- board/gateworks/gw_ventana/gw_ventana.c | 2 +- board/hisilicon/hikey/hikey.c | 4 +- board/hisilicon/hikey960/hikey960.c | 2 +- board/hisilicon/poplar/poplar.c | 2 +- board/isee/igep00x0/igep00x0.c | 2 +- board/lg/sniper/sniper.c | 2 +- board/nokia/rx51/rx51.c | 2 +- board/sandbox/sandbox.c | 2 +- board/siemens/corvus/board.c | 2 +- board/st/stv0991/stv0991.c | 2 +- board/sysam/amcore/amcore.c | 2 +- board/ti/am335x/board.c | 6 +- board/timll/devkit8000/devkit8000.c | 2 +- board/toradex/apalis_imx6/apalis_imx6.c | 2 +- board/toradex/colibri-imx6ull/colibri-imx6ull.c | 2 +- board/toradex/colibri_imx6/colibri_imx6.c | 2 +- board/toradex/colibri_pxa270/colibri_pxa270.c | 4 +- doc/driver-model/design.rst | 18 +++--- doc/driver-model/of-plat.rst | 12 ++-- doc/driver-model/remoteproc-framework.rst | 2 +- doc/driver-model/spi-howto.rst | 4 +- drivers/crypto/fsl/fsl_rsa.c | 2 +- drivers/crypto/rsa_mod_exp/mod_exp_sw.c | 2 +- drivers/demo/demo-pdata.c | 10 ++-- drivers/gpio/imx_rgpio2p.c | 4 +- drivers/gpio/mxc_gpio.c | 2 +- drivers/remoteproc/sandbox_testproc.c | 2 +- drivers/rtc/emul_rtc.c | 2 +- drivers/serial/sandbox.c | 2 +- drivers/sysreset/sysreset_sandbox.c | 4 +- drivers/timer/sandbox_timer.c | 2 +- drivers/video/sunxi/sunxi_de2.c | 2 +- drivers/video/sunxi/sunxi_dw_hdmi.c | 2 +- drivers/video/sunxi/sunxi_lcd.c | 2 +- dts/Kconfig | 8 +-- include/dm/device.h | 4 +- include/dm/lists.h | 2 +- include/dm/platdata.h | 16 +++--- include/dm/platform_data/spi_pl022.h | 2 +- test/dm/core.c | 6 +- tools/dtoc/dtb_platdata.py | 8 +-- tools/dtoc/test_dtoc.py | 66 +++++++++++----------- 64 files changed, 148 insertions(+), 148 deletions(-) (limited to 'drivers/timer') diff --git a/arch/arm/mach-at91/arm926ejs/at91sam9260_devices.c b/arch/arm/mach-at91/arm926ejs/at91sam9260_devices.c index 9d787197f3..c10571fa28 100644 --- a/arch/arm/mach-at91/arm926ejs/at91sam9260_devices.c +++ b/arch/arm/mach-at91/arm926ejs/at91sam9260_devices.c @@ -219,7 +219,7 @@ static const struct at91_port_plat at91sam9260_plat[] = { { ATMEL_BASE_PIOC, "PC" }, }; -U_BOOT_DEVICES(at91sam9260_gpios) = { +U_BOOT_DRVINFOS(at91sam9260_gpios) = { { "atmel_at91rm9200_gpio", &at91sam9260_plat[0] }, { "atmel_at91rm9200_gpio", &at91sam9260_plat[1] }, { "atmel_at91rm9200_gpio", &at91sam9260_plat[2] }, diff --git a/arch/arm/mach-at91/arm926ejs/at91sam9m10g45_devices.c b/arch/arm/mach-at91/arm926ejs/at91sam9m10g45_devices.c index f503553b92..d517810c99 100644 --- a/arch/arm/mach-at91/arm926ejs/at91sam9m10g45_devices.c +++ b/arch/arm/mach-at91/arm926ejs/at91sam9m10g45_devices.c @@ -175,7 +175,7 @@ static const struct at91_port_plat at91sam9260_plat[] = { { ATMEL_BASE_PIOE, "PE" }, }; -U_BOOT_DEVICES(at91sam9260_gpios) = { +U_BOOT_DRVINFOS(at91sam9260_gpios) = { { "atmel_at91rm9200_gpio", &at91sam9260_plat[0] }, { "atmel_at91rm9200_gpio", &at91sam9260_plat[1] }, { "atmel_at91rm9200_gpio", &at91sam9260_plat[2] }, diff --git a/arch/arm/mach-imx/mx6/soc.c b/arch/arm/mach-imx/mx6/soc.c index 1649f6d948..bf6dddfdc9 100644 --- a/arch/arm/mach-imx/mx6/soc.c +++ b/arch/arm/mach-imx/mx6/soc.c @@ -44,7 +44,7 @@ static const struct imx_thermal_plat imx6_thermal_plat = { .fuse_word = 6, }; -U_BOOT_DEVICE(imx6_thermal) = { +U_BOOT_DRVINFO(imx6_thermal) = { .name = "imx_thermal", .plat = &imx6_thermal_plat, }; diff --git a/arch/arm/mach-imx/mx7/soc.c b/arch/arm/mach-imx/mx7/soc.c index 13593994f1..fda25ba66a 100644 --- a/arch/arm/mach-imx/mx7/soc.c +++ b/arch/arm/mach-imx/mx7/soc.c @@ -60,7 +60,7 @@ static const struct imx_thermal_plat imx7_thermal_plat = { .fuse_word = 3, }; -U_BOOT_DEVICE(imx7_thermal) = { +U_BOOT_DRVINFO(imx7_thermal) = { .name = "imx_thermal", .plat = &imx7_thermal_plat, }; diff --git a/arch/arm/mach-lpc32xx/devices.c b/arch/arm/mach-lpc32xx/devices.c index 04e026a8b7..e1e2e0d094 100644 --- a/arch/arm/mach-lpc32xx/devices.c +++ b/arch/arm/mach-lpc32xx/devices.c @@ -62,7 +62,7 @@ static const struct lpc32xx_hsuart_plat lpc32xx_hsuart[] = { }; #endif -U_BOOT_DEVICES(lpc32xx_uarts) = { +U_BOOT_DRVINFOS(lpc32xx_uarts) = { #if defined(CONFIG_LPC32XX_HSUART) { "lpc32xx_hsuart", &lpc32xx_hsuart[0], }, { "lpc32xx_hsuart", &lpc32xx_hsuart[1], }, @@ -124,7 +124,7 @@ void lpc32xx_i2c_init(unsigned int devnum) writel(ctrl, &clk->i2cclk_ctrl); } -U_BOOT_DEVICE(lpc32xx_gpios) = { +U_BOOT_DRVINFO(lpc32xx_gpios) = { .name = "gpio_lpc32xx" }; diff --git a/arch/arm/mach-omap2/am33xx/board.c b/arch/arm/mach-omap2/am33xx/board.c index b5f2b75e24..e17898d8fb 100644 --- a/arch/arm/mach-omap2/am33xx/board.c +++ b/arch/arm/mach-omap2/am33xx/board.c @@ -99,7 +99,7 @@ static const struct ns16550_plat am33xx_serial[] = { # endif }; -U_BOOT_DEVICES(am33xx_uarts) = { +U_BOOT_DRVINFOS(am33xx_uarts) = { { "ns16550_serial", &am33xx_serial[0] }, # ifdef CONFIG_SYS_NS16550_COM2 { "ns16550_serial", &am33xx_serial[1] }, @@ -119,7 +119,7 @@ static const struct omap_i2c_plat am33xx_i2c[] = { { I2C_BASE3, 100000, OMAP_I2C_REV_V2}, }; -U_BOOT_DEVICES(am33xx_i2c) = { +U_BOOT_DRVINFOS(am33xx_i2c) = { { "i2c_omap", &am33xx_i2c[0] }, { "i2c_omap", &am33xx_i2c[1] }, { "i2c_omap", &am33xx_i2c[2] }, @@ -138,7 +138,7 @@ static const struct omap_gpio_plat am33xx_gpio[] = { #endif }; -U_BOOT_DEVICES(am33xx_gpios) = { +U_BOOT_DRVINFOS(am33xx_gpios) = { { "gpio_omap", &am33xx_gpio[0] }, { "gpio_omap", &am33xx_gpio[1] }, { "gpio_omap", &am33xx_gpio[2] }, @@ -155,7 +155,7 @@ static const struct omap3_spi_plat omap3_spi_pdata = { .pin_dir = MCSPI_PINDIR_D0_IN_D1_OUT, }; -U_BOOT_DEVICE(am33xx_spi) = { +U_BOOT_DRVINFO(am33xx_spi) = { .name = "omap3_spi", .plat = &omap3_spi_pdata, }; @@ -234,7 +234,7 @@ static struct ti_musb_plat usb1 = { }, }; -U_BOOT_DEVICES(am33xx_usbs) = { +U_BOOT_DRVINFOS(am33xx_usbs) = { #if CONFIG_AM335X_USB0_MODE == MUSB_PERIPHERAL { "ti-musb-peripheral", &usb0 }, #elif CONFIG_AM335X_USB0_MODE == MUSB_HOST diff --git a/arch/arm/mach-omap2/omap3/board.c b/arch/arm/mach-omap2/omap3/board.c index 6ffedd1769..4da8df47cc 100644 --- a/arch/arm/mach-omap2/omap3/board.c +++ b/arch/arm/mach-omap2/omap3/board.c @@ -47,7 +47,7 @@ static const struct omap_gpio_plat omap34xx_gpio[] = { { 5, OMAP34XX_GPIO6_BASE }, }; -U_BOOT_DEVICES(omap34xx_gpios) = { +U_BOOT_DRVINFOS(omap34xx_gpios) = { { "gpio_omap", &omap34xx_gpio[0] }, { "gpio_omap", &omap34xx_gpio[1] }, { "gpio_omap", &omap34xx_gpio[2] }, diff --git a/arch/arm/mach-tegra/board.c b/arch/arm/mach-tegra/board.c index bf01aa5ee8..9de9836c8d 100644 --- a/arch/arm/mach-tegra/board.c +++ b/arch/arm/mach-tegra/board.c @@ -264,7 +264,7 @@ static struct ns16550_plat ns16550_com1_pdata = { .fcr = UART_FCR_DEFVAL, }; -U_BOOT_DEVICE(ns16550_com1) = { +U_BOOT_DRVINFO(ns16550_com1) = { "ns16550_serial", &ns16550_com1_pdata }; #endif diff --git a/arch/arm/mach-tegra/board2.c b/arch/arm/mach-tegra/board2.c index 48c4f32d6f..8569ad7c6f 100644 --- a/arch/arm/mach-tegra/board2.c +++ b/arch/arm/mach-tegra/board2.c @@ -42,7 +42,7 @@ DECLARE_GLOBAL_DATA_PTR; #ifdef CONFIG_SPL_BUILD /* TODO(sjg@chromium.org): Remove once SPL supports device tree */ -U_BOOT_DEVICE(tegra_gpios) = { +U_BOOT_DRVINFO(tegra_gpios) = { "gpio_tegra" }; #endif diff --git a/board/armltd/integrator/integrator.c b/board/armltd/integrator/integrator.c index 21bea62e9b..3c56fa1c01 100644 --- a/board/armltd/integrator/integrator.c +++ b/board/armltd/integrator/integrator.c @@ -43,7 +43,7 @@ static const struct pl01x_serial_plat serial_plat = { #endif }; -U_BOOT_DEVICE(integrator_serials) = { +U_BOOT_DRVINFO(integrator_serials) = { .name = "serial_pl01x", .plat = &serial_plat, }; diff --git a/board/armltd/total_compute/total_compute.c b/board/armltd/total_compute/total_compute.c index 6263d0c361..da24b32333 100644 --- a/board/armltd/total_compute/total_compute.c +++ b/board/armltd/total_compute/total_compute.c @@ -15,7 +15,7 @@ static const struct pl01x_serial_plat serial_plat = { .clock = CONFIG_PL011_CLOCK, }; -U_BOOT_DEVICE(total_compute_serials) = { +U_BOOT_DRVINFO(total_compute_serials) = { .name = "serial_pl01x", .plat = &serial_plat, }; diff --git a/board/armltd/vexpress64/vexpress64.c b/board/armltd/vexpress64/vexpress64.c index 6df6bcd3cf..bd66d52cb7 100644 --- a/board/armltd/vexpress64/vexpress64.c +++ b/board/armltd/vexpress64/vexpress64.c @@ -26,7 +26,7 @@ static const struct pl01x_serial_plat serial_plat = { .clock = CONFIG_PL011_CLOCK, }; -U_BOOT_DEVICE(vexpress_serials) = { +U_BOOT_DRVINFO(vexpress_serials) = { .name = "serial_pl01x", .plat = &serial_plat, }; diff --git a/board/bluewater/gurnard/gurnard.c b/board/bluewater/gurnard/gurnard.c index a71b4eb733..17ecdb679e 100644 --- a/board/bluewater/gurnard/gurnard.c +++ b/board/bluewater/gurnard/gurnard.c @@ -420,7 +420,7 @@ static struct atmel_serial_plat at91sam9260_serial_plat = { .base_addr = ATMEL_BASE_DBGU, }; -U_BOOT_DEVICE(at91sam9260_serial) = { +U_BOOT_DRVINFO(at91sam9260_serial) = { .name = "serial_atmel", .plat = &at91sam9260_serial_plat, }; diff --git a/board/bluewater/snapper9260/snapper9260.c b/board/bluewater/snapper9260/snapper9260.c index 9e41a42263..58fab15c11 100644 --- a/board/bluewater/snapper9260/snapper9260.c +++ b/board/bluewater/snapper9260/snapper9260.c @@ -147,7 +147,7 @@ static struct atmel_serial_plat at91sam9260_serial_plat = { .base_addr = ATMEL_BASE_DBGU, }; -U_BOOT_DEVICE(at91sam9260_serial) = { +U_BOOT_DRVINFO(at91sam9260_serial) = { .name = "serial_atmel", .plat = &at91sam9260_serial_plat, }; diff --git a/board/cadence/xtfpga/xtfpga.c b/board/cadence/xtfpga/xtfpga.c index 29db51b026..c26793d76c 100644 --- a/board/cadence/xtfpga/xtfpga.c +++ b/board/cadence/xtfpga/xtfpga.c @@ -93,7 +93,7 @@ int misc_init_r(void) return 0; } -U_BOOT_DEVICE(sysreset) = { +U_BOOT_DRVINFO(sysreset) = { .name = "xtfpga_sysreset", }; @@ -104,7 +104,7 @@ static struct ethoc_eth_pdata ethoc_pdata = { .packet_base = CONFIG_SYS_ETHOC_BUFFER_ADDR, }; -U_BOOT_DEVICE(ethoc) = { +U_BOOT_DRVINFO(ethoc) = { .name = "ethoc", .plat = ðoc_pdata, }; diff --git a/board/cavium/thunderx/thunderx.c b/board/cavium/thunderx/thunderx.c index 22c4c72361..fd23472898 100644 --- a/board/cavium/thunderx/thunderx.c +++ b/board/cavium/thunderx/thunderx.c @@ -25,7 +25,7 @@ static const struct pl01x_serial_plat serial0 = { .skip_init = true, }; -U_BOOT_DEVICE(thunderx_serial0) = { +U_BOOT_DRVINFO(thunderx_serial0) = { .name = "serial_pl01x", .plat = &serial0, }; @@ -37,7 +37,7 @@ static const struct pl01x_serial_plat serial1 = { .skip_init = true, }; -U_BOOT_DEVICE(thunderx_serial1) = { +U_BOOT_DRVINFO(thunderx_serial1) = { .name = "serial_pl01x", .plat = &serial1, }; diff --git a/board/compulab/cm_fx6/cm_fx6.c b/board/compulab/cm_fx6/cm_fx6.c index bc3ce4d16c..7520e96e07 100644 --- a/board/compulab/cm_fx6/cm_fx6.c +++ b/board/compulab/cm_fx6/cm_fx6.c @@ -728,7 +728,7 @@ static struct mxc_serial_plat cm_fx6_mxc_serial_plat = { .reg = (struct mxc_uart *)UART4_BASE, }; -U_BOOT_DEVICE(cm_fx6_serial) = { +U_BOOT_DRVINFO(cm_fx6_serial) = { .name = "serial_mxc", .plat = &cm_fx6_mxc_serial_plat, }; diff --git a/board/davinci/da8xxevm/omapl138_lcdk.c b/board/davinci/da8xxevm/omapl138_lcdk.c index a8ece170ce..a08858550d 100644 --- a/board/davinci/da8xxevm/omapl138_lcdk.c +++ b/board/davinci/da8xxevm/omapl138_lcdk.c @@ -363,7 +363,7 @@ static const struct ns16550_plat serial_pdata = { .fcr = UART_FCR_DEFVAL, }; -U_BOOT_DEVICE(omapl138_uart) = { +U_BOOT_DRVINFO(omapl138_uart) = { .name = "ns16550_serial", .plat = &serial_pdata, }; @@ -379,7 +379,7 @@ static const struct davinci_mmc_plat mmc_plat = { .name = "da830-mmc", }, }; -U_BOOT_DEVICE(omapl138_mmc) = { +U_BOOT_DRVINFO(omapl138_mmc) = { .name = "ti_da830_mmc", .plat = &mmc_plat, }; diff --git a/board/freescale/ls1012afrdm/eth.c b/board/freescale/ls1012afrdm/eth.c index 85104ab22c..d2df9351ea 100644 --- a/board/freescale/ls1012afrdm/eth.c +++ b/board/freescale/ls1012afrdm/eth.c @@ -114,12 +114,12 @@ static struct pfe_eth_pdata pfe_pdata1 = { }, }; -U_BOOT_DEVICE(ls1012a_pfe0) = { +U_BOOT_DRVINFO(ls1012a_pfe0) = { .name = "pfe_eth", .plat = &pfe_pdata0, }; -U_BOOT_DEVICE(ls1012a_pfe1) = { +U_BOOT_DRVINFO(ls1012a_pfe1) = { .name = "pfe_eth", .plat = &pfe_pdata1, }; diff --git a/board/freescale/ls1012aqds/eth.c b/board/freescale/ls1012aqds/eth.c index f6f43d2b13..8189f41bec 100644 --- a/board/freescale/ls1012aqds/eth.c +++ b/board/freescale/ls1012aqds/eth.c @@ -298,12 +298,12 @@ static struct pfe_eth_pdata pfe_pdata1 = { }, }; -U_BOOT_DEVICE(ls1012a_pfe0) = { +U_BOOT_DRVINFO(ls1012a_pfe0) = { .name = "pfe_eth", .plat = &pfe_pdata0, }; -U_BOOT_DEVICE(ls1012a_pfe1) = { +U_BOOT_DRVINFO(ls1012a_pfe1) = { .name = "pfe_eth", .plat = &pfe_pdata1, }; diff --git a/board/freescale/ls1012ardb/eth.c b/board/freescale/ls1012ardb/eth.c index 5e923e5252..2241d061dd 100644 --- a/board/freescale/ls1012ardb/eth.c +++ b/board/freescale/ls1012ardb/eth.c @@ -160,12 +160,12 @@ static struct pfe_eth_pdata pfe_pdata1 = { }, }; -U_BOOT_DEVICE(ls1012a_pfe0) = { +U_BOOT_DRVINFO(ls1012a_pfe0) = { .name = "pfe_eth", .plat = &pfe_pdata0, }; -U_BOOT_DEVICE(ls1012a_pfe1) = { +U_BOOT_DRVINFO(ls1012a_pfe1) = { .name = "pfe_eth", .plat = &pfe_pdata1, }; diff --git a/board/freescale/lx2160a/lx2160a.c b/board/freescale/lx2160a/lx2160a.c index 8d0115eace..70dd34e7ce 100644 --- a/board/freescale/lx2160a/lx2160a.c +++ b/board/freescale/lx2160a/lx2160a.c @@ -62,7 +62,7 @@ static struct pl01x_serial_plat serial0 = { .type = TYPE_PL011, }; -U_BOOT_DEVICE(nxp_serial0) = { +U_BOOT_DRVINFO(nxp_serial0) = { .name = "serial_pl01x", .plat = &serial0, }; @@ -72,7 +72,7 @@ static struct pl01x_serial_plat serial1 = { .type = TYPE_PL011, }; -U_BOOT_DEVICE(nxp_serial1) = { +U_BOOT_DRVINFO(nxp_serial1) = { .name = "serial_pl01x", .plat = &serial1, }; diff --git a/board/gateworks/gw_ventana/gw_ventana.c b/board/gateworks/gw_ventana/gw_ventana.c index c7224d1efe..048f624c35 100644 --- a/board/gateworks/gw_ventana/gw_ventana.c +++ b/board/gateworks/gw_ventana/gw_ventana.c @@ -1375,7 +1375,7 @@ static struct mxc_serial_plat ventana_mxc_serial_plat = { .reg = (struct mxc_uart *)UART2_BASE, }; -U_BOOT_DEVICE(ventana_serial) = { +U_BOOT_DRVINFO(ventana_serial) = { .name = "serial_mxc", .plat = &ventana_mxc_serial_plat, }; diff --git a/board/hisilicon/hikey/hikey.c b/board/hisilicon/hikey/hikey.c index 0ac88306d0..65a8179adb 100644 --- a/board/hisilicon/hikey/hikey.c +++ b/board/hisilicon/hikey/hikey.c @@ -50,7 +50,7 @@ static const struct hikey_gpio_plat hi6220_gpio[] = { }; -U_BOOT_DEVICES(hi6220_gpios) = { +U_BOOT_DRVINFOS(hi6220_gpios) = { { "gpio_hi6220", &hi6220_gpio[0] }, { "gpio_hi6220", &hi6220_gpio[1] }, { "gpio_hi6220", &hi6220_gpio[2] }, @@ -89,7 +89,7 @@ static const struct pl01x_serial_plat serial_plat = { .clock = 19200000 }; -U_BOOT_DEVICE(hikey_seriala) = { +U_BOOT_DRVINFO(hikey_seriala) = { .name = "serial_pl01x", .plat = &serial_plat, }; diff --git a/board/hisilicon/hikey960/hikey960.c b/board/hisilicon/hikey960/hikey960.c index 04b8cde136..3fe4c60d02 100644 --- a/board/hisilicon/hikey960/hikey960.c +++ b/board/hisilicon/hikey960/hikey960.c @@ -32,7 +32,7 @@ static const struct pl01x_serial_plat serial_plat = { .clock = 19200000 }; -U_BOOT_DEVICE(hikey960_serial0) = { +U_BOOT_DRVINFO(hikey960_serial0) = { .name = "serial_pl01x", .plat = &serial_plat, }; diff --git a/board/hisilicon/poplar/poplar.c b/board/hisilicon/poplar/poplar.c index b8be4ce45a..bfb2c66a17 100644 --- a/board/hisilicon/poplar/poplar.c +++ b/board/hisilicon/poplar/poplar.c @@ -46,7 +46,7 @@ static const struct pl01x_serial_plat serial_plat = { .clock = 75000000, }; -U_BOOT_DEVICE(poplar_serial) = { +U_BOOT_DRVINFO(poplar_serial) = { .name = "serial_pl01x", .plat = &serial_plat, }; diff --git a/board/isee/igep00x0/igep00x0.c b/board/isee/igep00x0/igep00x0.c index 6a7da502dd..0932f62b9b 100644 --- a/board/isee/igep00x0/igep00x0.c +++ b/board/isee/igep00x0/igep00x0.c @@ -36,7 +36,7 @@ static const struct ns16550_plat igep_serial = { .fcr = UART_FCR_DEFVAL, }; -U_BOOT_DEVICE(igep_uart) = { +U_BOOT_DRVINFO(igep_uart) = { "ns16550_serial", &igep_serial }; diff --git a/board/lg/sniper/sniper.c b/board/lg/sniper/sniper.c index d11630b954..118ab269d6 100644 --- a/board/lg/sniper/sniper.c +++ b/board/lg/sniper/sniper.c @@ -37,7 +37,7 @@ static const struct ns16550_plat serial_omap_plat = { .fcr = UART_FCR_DEFVAL, }; -U_BOOT_DEVICE(sniper_serial) = { +U_BOOT_DRVINFO(sniper_serial) = { .name = "ns16550_serial", .plat = &serial_omap_plat }; diff --git a/board/nokia/rx51/rx51.c b/board/nokia/rx51/rx51.c index bafb6205bd..253ee3c7b2 100644 --- a/board/nokia/rx51/rx51.c +++ b/board/nokia/rx51/rx51.c @@ -709,7 +709,7 @@ static const struct omap_i2c_plat rx51_i2c[] = { { I2C_BASE3, 400000, OMAP_I2C_REV_V1 }, }; -U_BOOT_DEVICES(rx51_i2c) = { +U_BOOT_DRVINFOS(rx51_i2c) = { { "i2c_omap", &rx51_i2c[0] }, { "i2c_omap", &rx51_i2c[1] }, { "i2c_omap", &rx51_i2c[2] }, diff --git a/board/sandbox/sandbox.c b/board/sandbox/sandbox.c index 3235541a7d..d152703b15 100644 --- a/board/sandbox/sandbox.c +++ b/board/sandbox/sandbox.c @@ -23,7 +23,7 @@ gd_t *gd; #if !CONFIG_IS_ENABLED(OF_PLATDATA) /* Add a simple GPIO device */ -U_BOOT_DEVICE(gpio_sandbox) = { +U_BOOT_DRVINFO(gpio_sandbox) = { .name = "sandbox_gpio", }; #endif diff --git a/board/siemens/corvus/board.c b/board/siemens/corvus/board.c index 1613c44929..25d85a8f17 100644 --- a/board/siemens/corvus/board.c +++ b/board/siemens/corvus/board.c @@ -318,7 +318,7 @@ static struct atmel_serial_plat at91sam9260_serial_plat = { .base_addr = ATMEL_BASE_DBGU, }; -U_BOOT_DEVICE(at91sam9260_serial) = { +U_BOOT_DRVINFO(at91sam9260_serial) = { .name = "serial_atmel", .plat = &at91sam9260_serial_plat, }; diff --git a/board/st/stv0991/stv0991.c b/board/st/stv0991/stv0991.c index 3371973600..95e203ff0e 100644 --- a/board/st/stv0991/stv0991.c +++ b/board/st/stv0991/stv0991.c @@ -30,7 +30,7 @@ static const struct pl01x_serial_plat serial_plat = { .clock = 2700 * 1000, }; -U_BOOT_DEVICE(stv09911_serials) = { +U_BOOT_DRVINFO(stv09911_serials) = { .name = "serial_pl01x", .plat = &serial_plat, }; diff --git a/board/sysam/amcore/amcore.c b/board/sysam/amcore/amcore.c index 42e1a80ec5..65fc60e2b4 100644 --- a/board/sysam/amcore/amcore.c +++ b/board/sysam/amcore/amcore.c @@ -113,7 +113,7 @@ static struct coldfire_serial_plat mcf5307_serial_plat = { .baudrate = CONFIG_BAUDRATE, }; -U_BOOT_DEVICE(coldfire_serial) = { +U_BOOT_DRVINFO(coldfire_serial) = { .name = "serial_coldfire", .plat = &mcf5307_serial_plat, }; diff --git a/board/ti/am335x/board.c b/board/ti/am335x/board.c index 2aa385a937..40d2e0238f 100644 --- a/board/ti/am335x/board.c +++ b/board/ti/am335x/board.c @@ -927,7 +927,7 @@ struct eth_pdata cpsw_pdata = { .priv_pdata = &am335_eth_data, }; -U_BOOT_DEVICE(am335x_eth) = { +U_BOOT_DRVINFO(am335x_eth) = { .name = "eth_cpsw", .plat = &cpsw_pdata, }; @@ -972,7 +972,7 @@ static const struct omap_hsmmc_plat am335x_mmc0_plat = { .cfg.b_max = CONFIG_SYS_MMC_MAX_BLK_COUNT, }; -U_BOOT_DEVICE(am335x_mmc0) = { +U_BOOT_DRVINFO(am335x_mmc0) = { .name = "omap_hsmmc", .plat = &am335x_mmc0_plat, }; @@ -986,7 +986,7 @@ static const struct omap_hsmmc_plat am335x_mmc1_plat = { .cfg.b_max = CONFIG_SYS_MMC_MAX_BLK_COUNT, }; -U_BOOT_DEVICE(am335x_mmc1) = { +U_BOOT_DRVINFO(am335x_mmc1) = { .name = "omap_hsmmc", .plat = &am335x_mmc1_plat, }; diff --git a/board/timll/devkit8000/devkit8000.c b/board/timll/devkit8000/devkit8000.c index 875383625d..0731fb7645 100644 --- a/board/timll/devkit8000/devkit8000.c +++ b/board/timll/devkit8000/devkit8000.c @@ -54,7 +54,7 @@ static const struct ns16550_plat devkit8000_serial = { .fcr = UART_FCR_DEFVAL, }; -U_BOOT_DEVICE(devkit8000_uart) = { +U_BOOT_DRVINFO(devkit8000_uart) = { "ns16550_serial", &devkit8000_serial }; diff --git a/board/toradex/apalis_imx6/apalis_imx6.c b/board/toradex/apalis_imx6/apalis_imx6.c index 362a750b19..5ae5274584 100644 --- a/board/toradex/apalis_imx6/apalis_imx6.c +++ b/board/toradex/apalis_imx6/apalis_imx6.c @@ -1149,7 +1149,7 @@ static struct mxc_serial_plat mxc_serial_plat = { .use_dte = true, }; -U_BOOT_DEVICE(mxc_serial) = { +U_BOOT_DRVINFO(mxc_serial) = { .name = "serial_mxc", .plat = &mxc_serial_plat, }; diff --git a/board/toradex/colibri-imx6ull/colibri-imx6ull.c b/board/toradex/colibri-imx6ull/colibri-imx6ull.c index 056064f6b9..6ff55ce57b 100644 --- a/board/toradex/colibri-imx6ull/colibri-imx6ull.c +++ b/board/toradex/colibri-imx6ull/colibri-imx6ull.c @@ -208,7 +208,7 @@ static struct mxc_serial_plat mxc_serial_plat = { .use_dte = 1, }; -U_BOOT_DEVICE(mxc_serial) = { +U_BOOT_DRVINFO(mxc_serial) = { .name = "serial_mxc", .plat = &mxc_serial_plat, }; diff --git a/board/toradex/colibri_imx6/colibri_imx6.c b/board/toradex/colibri_imx6/colibri_imx6.c index a82daad739..57d3e526b4 100644 --- a/board/toradex/colibri_imx6/colibri_imx6.c +++ b/board/toradex/colibri_imx6/colibri_imx6.c @@ -1091,7 +1091,7 @@ static struct mxc_serial_plat mxc_serial_plat = { .use_dte = true, }; -U_BOOT_DEVICE(mxc_serial) = { +U_BOOT_DRVINFO(mxc_serial) = { .name = "serial_mxc", .plat = &mxc_serial_plat, }; diff --git a/board/toradex/colibri_pxa270/colibri_pxa270.c b/board/toradex/colibri_pxa270/colibri_pxa270.c index b9d0fb98af..645751a37e 100644 --- a/board/toradex/colibri_pxa270/colibri_pxa270.c +++ b/board/toradex/colibri_pxa270/colibri_pxa270.c @@ -133,7 +133,7 @@ static const struct pxa_mmc_plat mmc_plat = { .base = (struct pxa_mmc_regs *)MMC0_BASE, }; -U_BOOT_DEVICE(pxa_mmcs) = { +U_BOOT_DRVINFO(pxa_mmcs) = { .name = "pxa_mmc", .plat = &mmc_plat, }; @@ -146,7 +146,7 @@ static const struct pxa_serial_plat serial_plat = { .baudrate = CONFIG_BAUDRATE, }; -U_BOOT_DEVICE(pxa_serials) = { +U_BOOT_DRVINFO(pxa_serials) = { .name = "serial_pxa", .plat = &serial_plat, }; diff --git a/doc/driver-model/design.rst b/doc/driver-model/design.rst index f26e4f14df..ffed7d5f79 100644 --- a/doc/driver-model/design.rst +++ b/doc/driver-model/design.rst @@ -422,7 +422,7 @@ Device Tree While plat is useful, a more flexible way of providing device data is by using device tree. In U-Boot you should use this where possible. Avoid -sending patches which make use of the U_BOOT_DEVICE() macro unless strictly +sending patches which make use of the U_BOOT_DRVINFO() macro unless strictly necessary. With device tree we replace the above code with the following device tree @@ -436,7 +436,7 @@ fragment: sides = <4>; }; -This means that instead of having lots of U_BOOT_DEVICE() declarations in +This means that instead of having lots of U_BOOT_DRVINFO() declarations in the board file, we put these in the device tree. This approach allows a lot more generality, since the same board file can support many types of boards (e,g. with the same SoC) just by using different device trees. An added @@ -665,9 +665,9 @@ Bind stage U-Boot discovers devices using one of these two methods: -- Scan the U_BOOT_DEVICE() definitions. U-Boot looks up the name specified +- Scan the U_BOOT_DRVINFO() definitions. U-Boot looks up the name specified by each, to find the appropriate U_BOOT_DRIVER() definition. In this case, - there is no path by which driver_data may be provided, but the U_BOOT_DEVICE() + there is no path by which driver_data may be provided, but the U_BOOT_DRVINFO() may provide plat. - Scan through the device tree definitions. U-Boot looks at top-level @@ -685,7 +685,7 @@ driver's bind() method if one is defined. At this point all the devices are known, and bound to their drivers. There is a 'struct udevice' allocated for all devices. However, nothing has been activated (except for the root device). Each bound device that was created -from a U_BOOT_DEVICE() declaration will hold the plat pointer specified +from a U_BOOT_DRVINFO() declaration will hold the plat pointer specified in that declaration. For a bound device created from the device tree, plat will be NULL, but of_offset will be the offset of the device tree node that caused the device to be created. The uclass is set correctly for @@ -726,7 +726,7 @@ The steps are: 2. If plat_auto is non-zero, then the platform data space is allocated. This is only useful for device tree operation, since otherwise you would have to specific the platform data in the - U_BOOT_DEVICE() declaration. The space is allocated for the device and + U_BOOT_DRVINFO() declaration. The space is allocated for the device and zeroed. It will be accessible as dev->plat. 3. If the device's uclass specifies a non-zero per_device_auto, @@ -746,7 +746,7 @@ The steps are: do various calls like dev_read_u32(dev, ...) to access the node and store the resulting information into dev->plat. After this point, the device works the same way whether it was bound using a device tree node or - U_BOOT_DEVICE() structure. In either case, the platform data is now stored + U_BOOT_DRVINFO() structure. In either case, the platform data is now stored in the plat structure. Typically you will use the plat_auto feature to specify the size of the platform data structure, and U-Boot will automatically allocate and zero it for you before @@ -855,7 +855,7 @@ remove it. This performs the probe steps in reverse: 4. The device memory is freed (platform data, private data, uclass data, parent data). - Note: Because the platform data for a U_BOOT_DEVICE() is defined with a + Note: Because the platform data for a U_BOOT_DRVINFO() is defined with a static pointer, it is not de-allocated during the remove() method. For a device instantiated using the device tree data, the platform data will be dynamically allocated, and thus needs to be deallocated during the @@ -931,7 +931,7 @@ property can provide better control granularity on which device is bound before relocation. While with DM_FLAG_PRE_RELOC flag of the driver all devices with the same driver are bound, which requires allocation a large amount of memory. When device tree is not used, DM_FLAG_PRE_RELOC is the -only way for statically declared devices via U_BOOT_DEVICE() to be bound +only way for statically declared devices via U_BOOT_DRVINFO() to be bound prior to relocation. It is possible to limit this to specific relocation steps, by using diff --git a/doc/driver-model/of-plat.rst b/doc/driver-model/of-plat.rst index afa27c211c..39e6295aa0 100644 --- a/doc/driver-model/of-plat.rst +++ b/doc/driver-model/of-plat.rst @@ -21,7 +21,7 @@ SoCs require a 16KB SPL image which must include a full MMC stack. In this case the overhead of device tree access may be too great. It is possible to create platform data manually by defining C structures -for it, and reference that data in a U_BOOT_DEVICE() declaration. This +for it, and reference that data in a U_BOOT_DRVINFO() declaration. This bypasses the use of device tree completely, effectively creating a parallel configuration mechanism. But it is an available option for SPL. @@ -79,7 +79,7 @@ SPL/TPL and should be tested with: A new tool called 'dtoc' converts a device tree file either into a set of struct declarations, one for each compatible node, and a set of -U_BOOT_DEVICE() declarations along with the actual platform data for each +U_BOOT_DRVINFO() declarations along with the actual platform data for each device. As an example, consider this MMC node: .. code-block:: none @@ -155,7 +155,7 @@ and the following device declarations: .card_detect_delay = 0xc8, }; - U_BOOT_DEVICE(dwmmc_at_ff0c0000) = { + U_BOOT_DRVINFO(dwmmc_at_ff0c0000) = { .name = "rockchip_rk3288_dw_mshc", .plat = &dtv_dwmmc_at_ff0c0000, .plat_size = sizeof(dtv_dwmmc_at_ff0c0000), @@ -178,7 +178,7 @@ platform data in the driver. The of_to_plat() method should therefore do nothing in such a driver. Note that for the platform data to be matched with a driver, the 'name' -property of the U_BOOT_DEVICE() declaration has to match a driver declared +property of the U_BOOT_DRVINFO() declaration has to match a driver declared via U_BOOT_DRIVER(). This effectively means that a U_BOOT_DRIVER() with a 'name' corresponding to the devicetree 'compatible' string (after converting it to a valid name for C) is needed, so a dedicated driver is required for @@ -189,7 +189,7 @@ used to declare an alias for a driver name, typically a 'compatible' string. This macro produces no code, but it is by dtoc tool. The parent_idx is the index of the parent driver_info structure within its -linker list (instantiated by the U_BOOT_DEVICE() macro). This is used to support +linker list (instantiated by the U_BOOT_DRVINFO() macro). This is used to support dev_get_parent(). The dm_populate_phandle_data() is included to allow for fix-ups required by dtoc. It is not currently used. The values in 'clocks' are the index of the driver_info for the target device followed by any phandle @@ -339,7 +339,7 @@ prevents them being used inadvertently. All usage must be bracketed with The dt-plat.c file contains the device declarations and is is built in spl/dt-plat.c. It additionally contains the definition of dm_populate_phandle_data() which is responsible of filling the phandle -information by adding references to U_BOOT_DEVICE by using DM_GET_DEVICE +information by adding references to U_BOOT_DRVINFO by using DM_GET_DEVICE The pylibfdt Python module is used to access the devicetree. diff --git a/doc/driver-model/remoteproc-framework.rst b/doc/driver-model/remoteproc-framework.rst index edb09cc105..566495a21c 100644 --- a/doc/driver-model/remoteproc-framework.rst +++ b/doc/driver-model/remoteproc-framework.rst @@ -125,7 +125,7 @@ a simplified definition of a device is as follows: .driver_plat_data = &mydriver_data; }; - U_BOOT_DEVICE(proc_3_demo) = { + U_BOOT_DRVINFO(proc_3_demo) = { .name = "sandbox_test_proc", .plat = &proc_3_test, }; diff --git a/doc/driver-model/spi-howto.rst b/doc/driver-model/spi-howto.rst index f1c4167139..97fbf750cb 100644 --- a/doc/driver-model/spi-howto.rst +++ b/doc/driver-model/spi-howto.rst @@ -270,7 +270,7 @@ fills in the fields from device tree. Add the platform data [non-device-tree only] -------------------------------------------- -Specify this data in a U_BOOT_DEVICE() declaration in your board file: +Specify this data in a U_BOOT_DRVINFO() declaration in your board file: .. code-block:: c @@ -281,7 +281,7 @@ Specify this data in a U_BOOT_DEVICE() declaration in your board file: .deactivate_delay_us = ... }; - U_BOOT_DEVICE(board_spi0) = { + U_BOOT_DRVINFO(board_spi0) = { .name = "exynos_spi", .plat = &platdata_spi0, }; diff --git a/drivers/crypto/fsl/fsl_rsa.c b/drivers/crypto/fsl/fsl_rsa.c index ed2a54f6ec..897ee855ea 100644 --- a/drivers/crypto/fsl/fsl_rsa.c +++ b/drivers/crypto/fsl/fsl_rsa.c @@ -55,6 +55,6 @@ U_BOOT_DRIVER(fsl_rsa_mod_exp) = { .ops = &fsl_mod_exp_ops, }; -U_BOOT_DEVICE(fsl_rsa) = { +U_BOOT_DRVINFO(fsl_rsa) = { .name = "fsl_rsa_mod_exp", }; diff --git a/drivers/crypto/rsa_mod_exp/mod_exp_sw.c b/drivers/crypto/rsa_mod_exp/mod_exp_sw.c index 4ce85b3224..7bed444c3f 100644 --- a/drivers/crypto/rsa_mod_exp/mod_exp_sw.c +++ b/drivers/crypto/rsa_mod_exp/mod_exp_sw.c @@ -35,6 +35,6 @@ U_BOOT_DRIVER(mod_exp_sw) = { .flags = DM_FLAG_PRE_RELOC, }; -U_BOOT_DEVICE(mod_exp_sw) = { +U_BOOT_DRVINFO(mod_exp_sw) = { .name = "mod_exp_sw", }; diff --git a/drivers/demo/demo-pdata.c b/drivers/demo/demo-pdata.c index b504c31373..818f77503a 100644 --- a/drivers/demo/demo-pdata.c +++ b/drivers/demo/demo-pdata.c @@ -20,27 +20,27 @@ static const struct dm_demo_pdata yellow_hexagon = { .sides = 6. }; -U_BOOT_DEVICE(demo0) = { +U_BOOT_DRVINFO(demo0) = { .name = "demo_shape_drv", .plat = &red_square, }; -U_BOOT_DEVICE(demo1) = { +U_BOOT_DRVINFO(demo1) = { .name = "demo_simple_drv", .plat = &red_square, }; -U_BOOT_DEVICE(demo2) = { +U_BOOT_DRVINFO(demo2) = { .name = "demo_shape_drv", .plat = &green_triangle, }; -U_BOOT_DEVICE(demo3) = { +U_BOOT_DRVINFO(demo3) = { .name = "demo_simple_drv", .plat = &yellow_hexagon, }; -U_BOOT_DEVICE(demo4) = { +U_BOOT_DRVINFO(demo4) = { .name = "demo_shape_drv", .plat = &yellow_hexagon, }; diff --git a/drivers/gpio/imx_rgpio2p.c b/drivers/gpio/imx_rgpio2p.c index a5a290a00c..0e2874ca95 100644 --- a/drivers/gpio/imx_rgpio2p.c +++ b/drivers/gpio/imx_rgpio2p.c @@ -158,7 +158,7 @@ static int imx_rgpio2p_bind(struct udevice *dev) /* * If plat already exsits, directly return. * Actually only when DT is not supported, plat - * is statically initialized in U_BOOT_DEVICES.Here + * is statically initialized in U_BOOT_DRVINFOS.Here * will return. */ if (plat) @@ -216,7 +216,7 @@ static const struct imx_rgpio2p_plat imx_plat[] = { { 5, (struct gpio_regs *)RGPIO2P_GPIO6_BASE_ADDR }, }; -U_BOOT_DEVICES(imx_rgpio2ps) = { +U_BOOT_DRVINFOS(imx_rgpio2ps) = { { "imx_rgpio2p", &imx_plat[0] }, { "imx_rgpio2p", &imx_plat[1] }, { "imx_rgpio2p", &imx_plat[2] }, diff --git a/drivers/gpio/mxc_gpio.c b/drivers/gpio/mxc_gpio.c index 9fc217ae6a..6280fb5984 100644 --- a/drivers/gpio/mxc_gpio.c +++ b/drivers/gpio/mxc_gpio.c @@ -372,7 +372,7 @@ static const struct mxc_gpio_plat mxc_plat[] = { #endif }; -U_BOOT_DEVICES(mxc_gpios) = { +U_BOOT_DRVINFOS(mxc_gpios) = { { "gpio_mxc", &mxc_plat[0] }, { "gpio_mxc", &mxc_plat[1] }, { "gpio_mxc", &mxc_plat[2] }, diff --git a/drivers/remoteproc/sandbox_testproc.c b/drivers/remoteproc/sandbox_testproc.c index ee2ee73071..6836eca4c5 100644 --- a/drivers/remoteproc/sandbox_testproc.c +++ b/drivers/remoteproc/sandbox_testproc.c @@ -352,7 +352,7 @@ static struct dm_rproc_uclass_pdata proc_3_test = { .mem_type = RPROC_INTERNAL_MEMORY_MAPPED, }; -U_BOOT_DEVICE(proc_3_demo) = { +U_BOOT_DRVINFO(proc_3_demo) = { .name = "sandbox_test_proc", .plat = &proc_3_test, }; diff --git a/drivers/rtc/emul_rtc.c b/drivers/rtc/emul_rtc.c index 1dc80ca127..8f0e1ab5ac 100644 --- a/drivers/rtc/emul_rtc.c +++ b/drivers/rtc/emul_rtc.c @@ -91,6 +91,6 @@ U_BOOT_DRIVER(rtc_emul) = { .priv_auto = sizeof(struct emul_rtc), }; -U_BOOT_DEVICE(rtc_emul) = { +U_BOOT_DRVINFO(rtc_emul) = { .name = "rtc_emul", }; diff --git a/drivers/serial/sandbox.c b/drivers/serial/sandbox.c index 19368ba256..756738c2d2 100644 --- a/drivers/serial/sandbox.c +++ b/drivers/serial/sandbox.c @@ -241,7 +241,7 @@ static const struct sandbox_serial_plat platdata_non_fdt = { .colour = -1, }; -U_BOOT_DEVICE(serial_sandbox_non_fdt) = { +U_BOOT_DRVINFO(serial_sandbox_non_fdt) = { .name = "sandbox_serial", .plat = &platdata_non_fdt, }; diff --git a/drivers/sysreset/sysreset_sandbox.c b/drivers/sysreset/sysreset_sandbox.c index 8eca7d8bfd..08685823e9 100644 --- a/drivers/sysreset/sysreset_sandbox.c +++ b/drivers/sysreset/sysreset_sandbox.c @@ -47,7 +47,7 @@ static int sandbox_sysreset_request(struct udevice *dev, enum sysreset_t type) /* * If we have a device tree, the device we created from platform data - * (see the U_BOOT_DEVICE() declaration below) should not do anything. + * (see the U_BOOT_DRVINFO() declaration below) should not do anything. * If we are that device, return an error. */ if (state->fdt_fname && !dev_has_ofnode(dev)) @@ -135,7 +135,7 @@ U_BOOT_DRIVER(warm_sysreset_sandbox) = { #if !CONFIG_IS_ENABLED(OF_PLATDATA) /* This is here in case we don't have a device tree */ -U_BOOT_DEVICE(sysreset_sandbox_non_fdt) = { +U_BOOT_DRVINFO(sysreset_sandbox_non_fdt) = { .name = "sysreset_sandbox", }; #endif diff --git a/drivers/timer/sandbox_timer.c b/drivers/timer/sandbox_timer.c index 135c0f38a4..2075cd4edd 100644 --- a/drivers/timer/sandbox_timer.c +++ b/drivers/timer/sandbox_timer.c @@ -65,6 +65,6 @@ U_BOOT_DRIVER(sandbox_timer) = { }; /* This is here in case we don't have a device tree */ -U_BOOT_DEVICE(sandbox_timer_non_fdt) = { +U_BOOT_DRVINFO(sandbox_timer_non_fdt) = { .name = "sandbox_timer", }; diff --git a/drivers/video/sunxi/sunxi_de2.c b/drivers/video/sunxi/sunxi_de2.c index 50657a77d3..a3e21aa5f1 100644 --- a/drivers/video/sunxi/sunxi_de2.c +++ b/drivers/video/sunxi/sunxi_de2.c @@ -319,7 +319,7 @@ U_BOOT_DRIVER(sunxi_de2) = { .flags = DM_FLAG_PRE_RELOC, }; -U_BOOT_DEVICE(sunxi_de2) = { +U_BOOT_DRVINFO(sunxi_de2) = { .name = "sunxi_de2" }; diff --git a/drivers/video/sunxi/sunxi_dw_hdmi.c b/drivers/video/sunxi/sunxi_dw_hdmi.c index 3e8d71538f..0b8cefc311 100644 --- a/drivers/video/sunxi/sunxi_dw_hdmi.c +++ b/drivers/video/sunxi/sunxi_dw_hdmi.c @@ -398,6 +398,6 @@ U_BOOT_DRIVER(sunxi_dw_hdmi) = { .priv_auto = sizeof(struct sunxi_dw_hdmi_priv), }; -U_BOOT_DEVICE(sunxi_dw_hdmi) = { +U_BOOT_DRVINFO(sunxi_dw_hdmi) = { .name = "sunxi_dw_hdmi" }; diff --git a/drivers/video/sunxi/sunxi_lcd.c b/drivers/video/sunxi/sunxi_lcd.c index dd2bb1f5fc..635edf6dd3 100644 --- a/drivers/video/sunxi/sunxi_lcd.c +++ b/drivers/video/sunxi/sunxi_lcd.c @@ -146,7 +146,7 @@ U_BOOT_DRIVER(sunxi_lcd) = { }; #ifdef CONFIG_MACH_SUN50I -U_BOOT_DEVICE(sunxi_lcd) = { +U_BOOT_DRVINFO(sunxi_lcd) = { .name = "sunxi_lcd" }; #endif diff --git a/dts/Kconfig b/dts/Kconfig index aeda542f98..71f50552e4 100644 --- a/dts/Kconfig +++ b/dts/Kconfig @@ -346,13 +346,13 @@ config SPL_OF_PLATDATA former can add 3KB or more to a Thumb 2 Image. This option enables generation of platform data from the device - tree as C code. This code creates devices using U_BOOT_DEVICE() + tree as C code. This code creates devices using U_BOOT_DRVINFO() declarations. The benefit is that it allows driver code to access the platform data directly in C structures, avoidin the libfdt overhead. This option works by generating C structure declarations for each - compatible string, then adding platform data and U_BOOT_DEVICE + compatible string, then adding platform data and U_BOOT_DRVINFO declarations for each node. See of-plat.txt for more information. config SPL_OF_PLATDATA_PARENT @@ -376,13 +376,13 @@ config TPL_OF_PLATDATA former can add 3KB or more to a Thumb 2 Image. This option enables generation of platform data from the device - tree as C code. This code creates devices using U_BOOT_DEVICE() + tree as C code. This code creates devices using U_BOOT_DRVINFO() declarations. The benefit is that it allows driver code to access the platform data directly in C structures, avoidin the libfdt overhead. This option works by generating C structure declarations for each - compatible string, then adding platform data and U_BOOT_DEVICE + compatible string, then adding platform data and U_BOOT_DRVINFO declarations for each node. See of-plat.txt for more information. config TPL_OF_PLATDATA_PARENT diff --git a/include/dm/device.h b/include/dm/device.h index 4469804a00..e16ba2405f 100644 --- a/include/dm/device.h +++ b/include/dm/device.h @@ -104,7 +104,7 @@ enum { * particular port or peripheral (essentially a driver instance). * * A device will come into existence through a 'bind' call, either due to - * a U_BOOT_DEVICE() macro (in which case plat is non-NULL) or a node + * a U_BOOT_DRVINFO() macro (in which case plat is non-NULL) or a node * in the device tree (in which case of_offset is >= 0). In the latter case * we translate the device tree information into plat in a function * implemented by the driver of_to_plat method (called just before the @@ -293,7 +293,7 @@ struct udevice_id { * platform data to be allocated in the device's ->plat pointer. * This is typically only useful for device-tree-aware drivers (those with * an of_match), since drivers which use plat will have the data - * provided in the U_BOOT_DEVICE() instantiation. + * provided in the U_BOOT_DRVINFO() instantiation. * @per_child_auto: Each device can hold private data owned by * its parent. If required this will be automatically allocated if this * value is non-zero. diff --git a/include/dm/lists.h b/include/dm/lists.h index 070bc9c19f..1a86552546 100644 --- a/include/dm/lists.h +++ b/include/dm/lists.h @@ -35,7 +35,7 @@ struct uclass_driver *lists_uclass_lookup(enum uclass_id id); /** * lists_bind_drivers() - search for and bind all drivers to parent * - * This searches the U_BOOT_DEVICE() structures and creates new devices for + * This searches the U_BOOT_DRVINFO() structures and creates new devices for * each one. The devices will have @parent as their parent. * * @parent: parent device (root) diff --git a/include/dm/platdata.h b/include/dm/platdata.h index d650fb3919..e2b16ce6e4 100644 --- a/include/dm/platdata.h +++ b/include/dm/platdata.h @@ -56,31 +56,31 @@ struct driver_rt { * is not feasible (e.g. serial driver in SPL where <8KB of SRAM is * available). U-Boot's driver model uses device tree for configuration. * - * When of-platdata is in use, U_BOOT_DEVICE() cannot be used outside of the + * When of-platdata is in use, U_BOOT_DRVINFO() cannot be used outside of the * dt-plat.c file created by dtoc */ #if CONFIG_IS_ENABLED(OF_PLATDATA) && !defined(DT_PLATDATA_C) -#define U_BOOT_DEVICE(__name) _Static_assert(false, \ - "Cannot use U_BOOT_DEVICE with of-platdata. Please use devicetree instead") +#define U_BOOT_DRVINFO(__name) _Static_assert(false, \ + "Cannot use U_BOOT_DRVINFO with of-platdata. Please use devicetree instead") #else -#define U_BOOT_DEVICE(__name) \ +#define U_BOOT_DRVINFO(__name) \ ll_entry_declare(struct driver_info, __name, driver_info) #endif /* Declare a list of devices. The argument is a driver_info[] array */ -#define U_BOOT_DEVICES(__name) \ +#define U_BOOT_DRVINFOS(__name) \ ll_entry_declare_list(struct driver_info, __name, driver_info) /** * Get a pointer to a given device info given its name * - * With the declaration U_BOOT_DEVICE(name), DM_GET_DEVICE(name) will return a + * With the declaration U_BOOT_DRVINFO(name), DM_GET_DEVICE(name) will return a * pointer to the struct driver_info created by that declaration. * * if OF_PLATDATA is enabled, from this it is possible to use the @dev member of * struct driver_info to find the device pointer itself. * - * TODO(sjg@chromium.org): U_BOOT_DEVICE() tells U-Boot to create a device, so + * TODO(sjg@chromium.org): U_BOOT_DRVINFO() tells U-Boot to create a device, so * the naming seems sensible, but DM_GET_DEVICE() is a bit of misnomer, since it * finds the driver_info record, not the device. * @@ -93,7 +93,7 @@ struct driver_rt { /** * dm_populate_phandle_data() - Populates phandle data in platda * - * This populates phandle data with an U_BOOT_DEVICE entry get by + * This populates phandle data with an U_BOOT_DRVINFO entry get by * DM_GET_DEVICE. The implementation of this function will be done * by dtoc when parsing dtb. */ diff --git a/include/dm/platform_data/spi_pl022.h b/include/dm/platform_data/spi_pl022.h index c5aa321291..7f74b3cbc5 100644 --- a/include/dm/platform_data/spi_pl022.h +++ b/include/dm/platform_data/spi_pl022.h @@ -3,7 +3,7 @@ * (C) Copyright 2018 * Quentin Schulz, Bootlin, quentin.schulz@bootlin.com * - * Structure for use with U_BOOT_DEVICE for pl022 SPI devices or to use + * Structure for use with U_BOOT_DRVINFO for pl022 SPI devices or to use * in of_to_plat. */ diff --git a/test/dm/core.c b/test/dm/core.c index 580d171e30..82b7a668dd 100644 --- a/test/dm/core.c +++ b/test/dm/core.c @@ -43,17 +43,17 @@ static const struct dm_test_pdata test_pdata_pre_reloc = { .ping_add = TEST_INTVAL_PRE_RELOC, }; -U_BOOT_DEVICE(dm_test_info1) = { +U_BOOT_DRVINFO(dm_test_info1) = { .name = "test_drv", .plat = &test_pdata[0], }; -U_BOOT_DEVICE(dm_test_info2) = { +U_BOOT_DRVINFO(dm_test_info2) = { .name = "test_drv", .plat = &test_pdata[1], }; -U_BOOT_DEVICE(dm_test_info3) = { +U_BOOT_DRVINFO(dm_test_info3) = { .name = "test_drv", .plat = &test_pdata[2], }; diff --git a/tools/dtoc/dtb_platdata.py b/tools/dtoc/dtb_platdata.py index 7bd1989113..ebe5132e14 100644 --- a/tools/dtoc/dtb_platdata.py +++ b/tools/dtoc/dtb_platdata.py @@ -713,14 +713,14 @@ class DtbPlatdata(): def _declare_device(self, var_name, struct_name, node_parent): """Add a device declaration to the output - This declares a U_BOOT_DEVICE() for the device being processed + This declares a U_BOOT_DRVINFO() for the device being processed Args: var_name (str): C name for the node struct_name (str): Name for the dt struct associated with the node node_parent (Node): Parent of the node (or None if none) """ - self.buf('U_BOOT_DEVICE(%s) = {\n' % var_name) + self.buf('U_BOOT_DRVINFO(%s) = {\n' % var_name) self.buf('\t.name\t\t= "%s",\n' % struct_name) self.buf('\t.plat\t= &%s%s,\n' % (VAL_PREFIX, var_name)) self.buf('\t.plat_size\t= sizeof(%s%s),\n' % (VAL_PREFIX, var_name)) @@ -783,14 +783,14 @@ class DtbPlatdata(): """Generate device defintions for the platform data This writes out C platform data initialisation data and - U_BOOT_DEVICE() declarations for each valid node. Where a node has + U_BOOT_DRVINFO() declarations for each valid node. Where a node has multiple compatible strings, a #define is used to make them equivalent. See the documentation in doc/driver-model/of-plat.rst for more information. """ self.out_header() - self.out('/* Allow use of U_BOOT_DEVICE() in this file */\n') + self.out('/* Allow use of U_BOOT_DRVINFO() in this file */\n') self.out('#define DT_PLATDATA_C\n') self.out('\n') self.out('#include \n') diff --git a/tools/dtoc/test_dtoc.py b/tools/dtoc/test_dtoc.py index fb65f284ce..dbd4e3bf1d 100755 --- a/tools/dtoc/test_dtoc.py +++ b/tools/dtoc/test_dtoc.py @@ -44,7 +44,7 @@ C_HEADER = '''/* * This file was generated by dtoc from a .dtb (device tree binary) file. */ -/* Allow use of U_BOOT_DEVICE() in this file */ +/* Allow use of U_BOOT_DRVINFO() in this file */ #define DT_PLATDATA_C #include @@ -214,7 +214,7 @@ struct dtd_sandbox_spl_test { /* Node /i2c@0 index 0 */ static struct dtd_sandbox_i2c_test dtv_i2c_at_0 = { }; -U_BOOT_DEVICE(i2c_at_0) = { +U_BOOT_DRVINFO(i2c_at_0) = { \t.name\t\t= "sandbox_i2c_test", \t.plat\t= &dtv_i2c_at_0, \t.plat_size\t= sizeof(dtv_i2c_at_0), @@ -226,7 +226,7 @@ static struct dtd_sandbox_pmic_test dtv_pmic_at_9 = { \t.low_power\t\t= true, \t.reg\t\t\t= {0x9, 0x0}, }; -U_BOOT_DEVICE(pmic_at_9) = { +U_BOOT_DRVINFO(pmic_at_9) = { \t.name\t\t= "sandbox_pmic_test", \t.plat\t= &dtv_pmic_at_9, \t.plat_size\t= sizeof(dtv_pmic_at_9), @@ -246,7 +246,7 @@ static struct dtd_sandbox_spl_test dtv_spl_test = { \t.stringarray\t\t= {"multi-word", "message", ""}, \t.stringval\t\t= "message", }; -U_BOOT_DEVICE(spl_test) = { +U_BOOT_DRVINFO(spl_test) = { \t.name\t\t= "sandbox_spl_test", \t.plat\t= &dtv_spl_test, \t.plat_size\t= sizeof(dtv_spl_test), @@ -265,7 +265,7 @@ static struct dtd_sandbox_spl_test dtv_spl_test2 = { \t.stringarray\t\t= {"another", "multi-word", "message"}, \t.stringval\t\t= "message2", }; -U_BOOT_DEVICE(spl_test2) = { +U_BOOT_DRVINFO(spl_test2) = { \t.name\t\t= "sandbox_spl_test", \t.plat\t= &dtv_spl_test2, \t.plat_size\t= sizeof(dtv_spl_test2), @@ -278,7 +278,7 @@ static struct dtd_sandbox_spl_test dtv_spl_test3 = { \t\t0x0}, \t.stringarray\t\t= {"one", "", ""}, }; -U_BOOT_DEVICE(spl_test3) = { +U_BOOT_DRVINFO(spl_test3) = { \t.name\t\t= "sandbox_spl_test", \t.plat\t= &dtv_spl_test3, \t.plat_size\t= sizeof(dtv_spl_test3), @@ -333,7 +333,7 @@ static struct dtd_sandbox_gpio dtv_gpios_at_0 = { \t.gpio_controller\t= true, \t.sandbox_gpio_count\t= 0x14, }; -U_BOOT_DEVICE(gpios_at_0) = { +U_BOOT_DRVINFO(gpios_at_0) = { \t.name\t\t= "sandbox_gpio", \t.plat\t= &dtv_gpios_at_0, \t.plat_size\t= sizeof(dtv_gpios_at_0), @@ -365,7 +365,7 @@ struct dtd_invalid { /* Node /spl-test index 0 */ static struct dtd_invalid dtv_spl_test = { }; -U_BOOT_DEVICE(spl_test) = { +U_BOOT_DRVINFO(spl_test) = { \t.name\t\t= "invalid", \t.plat\t= &dtv_spl_test, \t.plat_size\t= sizeof(dtv_spl_test), @@ -400,7 +400,7 @@ struct dtd_target { static struct dtd_target dtv_phandle2_target = { \t.intval\t\t\t= 0x1, }; -U_BOOT_DEVICE(phandle2_target) = { +U_BOOT_DRVINFO(phandle2_target) = { \t.name\t\t= "target", \t.plat\t= &dtv_phandle2_target, \t.plat_size\t= sizeof(dtv_phandle2_target), @@ -411,7 +411,7 @@ U_BOOT_DEVICE(phandle2_target) = { static struct dtd_target dtv_phandle3_target = { \t.intval\t\t\t= 0x2, }; -U_BOOT_DEVICE(phandle3_target) = { +U_BOOT_DRVINFO(phandle3_target) = { \t.name\t\t= "target", \t.plat\t= &dtv_phandle3_target, \t.plat_size\t= sizeof(dtv_phandle3_target), @@ -422,7 +422,7 @@ U_BOOT_DEVICE(phandle3_target) = { static struct dtd_target dtv_phandle_target = { \t.intval\t\t\t= 0x0, }; -U_BOOT_DEVICE(phandle_target) = { +U_BOOT_DRVINFO(phandle_target) = { \t.name\t\t= "target", \t.plat\t= &dtv_phandle_target, \t.plat_size\t= sizeof(dtv_phandle_target), @@ -437,7 +437,7 @@ static struct dtd_source dtv_phandle_source = { \t\t\t{1, {12, 13}}, \t\t\t{4, {}},}, }; -U_BOOT_DEVICE(phandle_source) = { +U_BOOT_DRVINFO(phandle_source) = { \t.name\t\t= "source", \t.plat\t= &dtv_phandle_source, \t.plat_size\t= sizeof(dtv_phandle_source), @@ -449,7 +449,7 @@ static struct dtd_source dtv_phandle_source2 = { \t.clocks\t\t\t= { \t\t\t{4, {}},}, }; -U_BOOT_DEVICE(phandle_source2) = { +U_BOOT_DRVINFO(phandle_source2) = { \t.name\t\t= "source", \t.plat\t= &dtv_phandle_source2, \t.plat_size\t= sizeof(dtv_phandle_source2), @@ -487,7 +487,7 @@ struct dtd_target { /* Node /phandle-target index 1 */ static struct dtd_target dtv_phandle_target = { }; -U_BOOT_DEVICE(phandle_target) = { +U_BOOT_DRVINFO(phandle_target) = { \t.name\t\t= "target", \t.plat\t= &dtv_phandle_target, \t.plat_size\t= sizeof(dtv_phandle_target), @@ -499,7 +499,7 @@ static struct dtd_source dtv_phandle_source2 = { \t.clocks\t\t\t= { \t\t\t{1, {}},}, }; -U_BOOT_DEVICE(phandle_source2) = { +U_BOOT_DRVINFO(phandle_source2) = { \t.name\t\t= "source", \t.plat\t= &dtv_phandle_source2, \t.plat_size\t= sizeof(dtv_phandle_source2), @@ -522,7 +522,7 @@ void dm_populate_phandle_data(void) { static struct dtd_target dtv_phandle2_target = { \t.intval\t\t\t= 0x1, }; -U_BOOT_DEVICE(phandle2_target) = { +U_BOOT_DRVINFO(phandle2_target) = { \t.name\t\t= "target", \t.plat\t= &dtv_phandle2_target, \t.plat_size\t= sizeof(dtv_phandle2_target), @@ -533,7 +533,7 @@ U_BOOT_DEVICE(phandle2_target) = { static struct dtd_target dtv_phandle3_target = { \t.intval\t\t\t= 0x2, }; -U_BOOT_DEVICE(phandle3_target) = { +U_BOOT_DRVINFO(phandle3_target) = { \t.name\t\t= "target", \t.plat\t= &dtv_phandle3_target, \t.plat_size\t= sizeof(dtv_phandle3_target), @@ -544,7 +544,7 @@ U_BOOT_DEVICE(phandle3_target) = { static struct dtd_target dtv_phandle_target = { \t.intval\t\t\t= 0x0, }; -U_BOOT_DEVICE(phandle_target) = { +U_BOOT_DRVINFO(phandle_target) = { \t.name\t\t= "target", \t.plat\t= &dtv_phandle_target, \t.plat_size\t= sizeof(dtv_phandle_target), @@ -559,7 +559,7 @@ static struct dtd_source dtv_phandle_source = { \t\t\t{1, {12, 13}}, \t\t\t{4, {}},}, }; -U_BOOT_DEVICE(phandle_source) = { +U_BOOT_DRVINFO(phandle_source) = { \t.name\t\t= "source", \t.plat\t= &dtv_phandle_source, \t.plat_size\t= sizeof(dtv_phandle_source), @@ -571,7 +571,7 @@ static struct dtd_source dtv_phandle_source2 = { \t.cd_gpios\t\t= { \t\t\t{4, {}},}, }; -U_BOOT_DEVICE(phandle_source2) = { +U_BOOT_DRVINFO(phandle_source2) = { \t.name\t\t= "source", \t.plat\t= &dtv_phandle_source2, \t.plat_size\t= sizeof(dtv_phandle_source2), @@ -629,7 +629,7 @@ struct dtd_test3 { static struct dtd_test1 dtv_test1 = { \t.reg\t\t\t= {0x1234, 0x5678}, }; -U_BOOT_DEVICE(test1) = { +U_BOOT_DRVINFO(test1) = { \t.name\t\t= "test1", \t.plat\t= &dtv_test1, \t.plat_size\t= sizeof(dtv_test1), @@ -640,7 +640,7 @@ U_BOOT_DEVICE(test1) = { static struct dtd_test2 dtv_test2 = { \t.reg\t\t\t= {0x1234567890123456, 0x9876543210987654}, }; -U_BOOT_DEVICE(test2) = { +U_BOOT_DRVINFO(test2) = { \t.name\t\t= "test2", \t.plat\t= &dtv_test2, \t.plat_size\t= sizeof(dtv_test2), @@ -651,7 +651,7 @@ U_BOOT_DEVICE(test2) = { static struct dtd_test3 dtv_test3 = { \t.reg\t\t\t= {0x1234567890123456, 0x9876543210987654, 0x2, 0x3}, }; -U_BOOT_DEVICE(test3) = { +U_BOOT_DRVINFO(test3) = { \t.name\t\t= "test3", \t.plat\t= &dtv_test3, \t.plat_size\t= sizeof(dtv_test3), @@ -684,7 +684,7 @@ struct dtd_test2 { static struct dtd_test1 dtv_test1 = { \t.reg\t\t\t= {0x1234, 0x5678}, }; -U_BOOT_DEVICE(test1) = { +U_BOOT_DRVINFO(test1) = { \t.name\t\t= "test1", \t.plat\t= &dtv_test1, \t.plat_size\t= sizeof(dtv_test1), @@ -695,7 +695,7 @@ U_BOOT_DEVICE(test1) = { static struct dtd_test2 dtv_test2 = { \t.reg\t\t\t= {0x12345678, 0x98765432, 0x2, 0x3}, }; -U_BOOT_DEVICE(test2) = { +U_BOOT_DRVINFO(test2) = { \t.name\t\t= "test2", \t.plat\t= &dtv_test2, \t.plat_size\t= sizeof(dtv_test2), @@ -731,7 +731,7 @@ struct dtd_test3 { static struct dtd_test1 dtv_test1 = { \t.reg\t\t\t= {0x123400000000, 0x5678}, }; -U_BOOT_DEVICE(test1) = { +U_BOOT_DRVINFO(test1) = { \t.name\t\t= "test1", \t.plat\t= &dtv_test1, \t.plat_size\t= sizeof(dtv_test1), @@ -742,7 +742,7 @@ U_BOOT_DEVICE(test1) = { static struct dtd_test2 dtv_test2 = { \t.reg\t\t\t= {0x1234567890123456, 0x98765432}, }; -U_BOOT_DEVICE(test2) = { +U_BOOT_DRVINFO(test2) = { \t.name\t\t= "test2", \t.plat\t= &dtv_test2, \t.plat_size\t= sizeof(dtv_test2), @@ -753,7 +753,7 @@ U_BOOT_DEVICE(test2) = { static struct dtd_test3 dtv_test3 = { \t.reg\t\t\t= {0x1234567890123456, 0x98765432, 0x2, 0x3}, }; -U_BOOT_DEVICE(test3) = { +U_BOOT_DRVINFO(test3) = { \t.name\t\t= "test3", \t.plat\t= &dtv_test3, \t.plat_size\t= sizeof(dtv_test3), @@ -789,7 +789,7 @@ struct dtd_test3 { static struct dtd_test1 dtv_test1 = { \t.reg\t\t\t= {0x1234, 0x567800000000}, }; -U_BOOT_DEVICE(test1) = { +U_BOOT_DRVINFO(test1) = { \t.name\t\t= "test1", \t.plat\t= &dtv_test1, \t.plat_size\t= sizeof(dtv_test1), @@ -800,7 +800,7 @@ U_BOOT_DEVICE(test1) = { static struct dtd_test2 dtv_test2 = { \t.reg\t\t\t= {0x12345678, 0x9876543210987654}, }; -U_BOOT_DEVICE(test2) = { +U_BOOT_DRVINFO(test2) = { \t.name\t\t= "test2", \t.plat\t= &dtv_test2, \t.plat_size\t= sizeof(dtv_test2), @@ -811,7 +811,7 @@ U_BOOT_DEVICE(test2) = { static struct dtd_test3 dtv_test3 = { \t.reg\t\t\t= {0x12345678, 0x9876543210987654, 0x2, 0x3}, }; -U_BOOT_DEVICE(test3) = { +U_BOOT_DRVINFO(test3) = { \t.name\t\t= "test3", \t.plat\t= &dtv_test3, \t.plat_size\t= sizeof(dtv_test3), @@ -863,7 +863,7 @@ struct dtd_sandbox_spl_test { static struct dtd_sandbox_spl_test dtv_spl_test = { \t.intval\t\t\t= 0x1, }; -U_BOOT_DEVICE(spl_test) = { +U_BOOT_DRVINFO(spl_test) = { \t.name\t\t= "sandbox_spl_test", \t.plat\t= &dtv_spl_test, \t.plat_size\t= sizeof(dtv_spl_test), @@ -874,7 +874,7 @@ U_BOOT_DEVICE(spl_test) = { static struct dtd_sandbox_spl_test dtv_spl_test2 = { \t.intarray\t\t= 0x5, }; -U_BOOT_DEVICE(spl_test2) = { +U_BOOT_DRVINFO(spl_test2) = { \t.name\t\t= "sandbox_spl_test", \t.plat\t= &dtv_spl_test2, \t.plat_size\t= sizeof(dtv_spl_test2), -- cgit v1.2.3