{ 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] },
{ 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] },
.fuse_word = 6,
};
-U_BOOT_DEVICE(imx6_thermal) = {
+U_BOOT_DRVINFO(imx6_thermal) = {
.name = "imx_thermal",
.plat = &imx6_thermal_plat,
};
.fuse_word = 3,
};
-U_BOOT_DEVICE(imx7_thermal) = {
+U_BOOT_DRVINFO(imx7_thermal) = {
.name = "imx_thermal",
.plat = &imx7_thermal_plat,
};
};
#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], },
writel(ctrl, &clk->i2cclk_ctrl);
}
-U_BOOT_DEVICE(lpc32xx_gpios) = {
+U_BOOT_DRVINFO(lpc32xx_gpios) = {
.name = "gpio_lpc32xx"
};
# 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] },
{ 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] },
#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] },
.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,
};
},
};
-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
{ 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] },
.fcr = UART_FCR_DEFVAL,
};
-U_BOOT_DEVICE(ns16550_com1) = {
+U_BOOT_DRVINFO(ns16550_com1) = {
"ns16550_serial", &ns16550_com1_pdata
};
#endif
#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
#endif
};
-U_BOOT_DEVICE(integrator_serials) = {
+U_BOOT_DRVINFO(integrator_serials) = {
.name = "serial_pl01x",
.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,
};
.clock = CONFIG_PL011_CLOCK,
};
-U_BOOT_DEVICE(vexpress_serials) = {
+U_BOOT_DRVINFO(vexpress_serials) = {
.name = "serial_pl01x",
.plat = &serial_plat,
};
.base_addr = ATMEL_BASE_DBGU,
};
-U_BOOT_DEVICE(at91sam9260_serial) = {
+U_BOOT_DRVINFO(at91sam9260_serial) = {
.name = "serial_atmel",
.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,
};
return 0;
}
-U_BOOT_DEVICE(sysreset) = {
+U_BOOT_DRVINFO(sysreset) = {
.name = "xtfpga_sysreset",
};
.packet_base = CONFIG_SYS_ETHOC_BUFFER_ADDR,
};
-U_BOOT_DEVICE(ethoc) = {
+U_BOOT_DRVINFO(ethoc) = {
.name = "ethoc",
.plat = ðoc_pdata,
};
.skip_init = true,
};
-U_BOOT_DEVICE(thunderx_serial0) = {
+U_BOOT_DRVINFO(thunderx_serial0) = {
.name = "serial_pl01x",
.plat = &serial0,
};
.skip_init = true,
};
-U_BOOT_DEVICE(thunderx_serial1) = {
+U_BOOT_DRVINFO(thunderx_serial1) = {
.name = "serial_pl01x",
.plat = &serial1,
};
.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,
};
.fcr = UART_FCR_DEFVAL,
};
-U_BOOT_DEVICE(omapl138_uart) = {
+U_BOOT_DRVINFO(omapl138_uart) = {
.name = "ns16550_serial",
.plat = &serial_pdata,
};
.name = "da830-mmc",
},
};
-U_BOOT_DEVICE(omapl138_mmc) = {
+U_BOOT_DRVINFO(omapl138_mmc) = {
.name = "ti_da830_mmc",
.plat = &mmc_plat,
};
},
};
-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,
};
},
};
-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,
};
},
};
-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,
};
.type = TYPE_PL011,
};
-U_BOOT_DEVICE(nxp_serial0) = {
+U_BOOT_DRVINFO(nxp_serial0) = {
.name = "serial_pl01x",
.plat = &serial0,
};
.type = TYPE_PL011,
};
-U_BOOT_DEVICE(nxp_serial1) = {
+U_BOOT_DRVINFO(nxp_serial1) = {
.name = "serial_pl01x",
.plat = &serial1,
};
.reg = (struct mxc_uart *)UART2_BASE,
};
-U_BOOT_DEVICE(ventana_serial) = {
+U_BOOT_DRVINFO(ventana_serial) = {
.name = "serial_mxc",
.plat = &ventana_mxc_serial_plat,
};
};
-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] },
.clock = 19200000
};
-U_BOOT_DEVICE(hikey_seriala) = {
+U_BOOT_DRVINFO(hikey_seriala) = {
.name = "serial_pl01x",
.plat = &serial_plat,
};
.clock = 19200000
};
-U_BOOT_DEVICE(hikey960_serial0) = {
+U_BOOT_DRVINFO(hikey960_serial0) = {
.name = "serial_pl01x",
.plat = &serial_plat,
};
.clock = 75000000,
};
-U_BOOT_DEVICE(poplar_serial) = {
+U_BOOT_DRVINFO(poplar_serial) = {
.name = "serial_pl01x",
.plat = &serial_plat,
};
.fcr = UART_FCR_DEFVAL,
};
-U_BOOT_DEVICE(igep_uart) = {
+U_BOOT_DRVINFO(igep_uart) = {
"ns16550_serial",
&igep_serial
};
.fcr = UART_FCR_DEFVAL,
};
-U_BOOT_DEVICE(sniper_serial) = {
+U_BOOT_DRVINFO(sniper_serial) = {
.name = "ns16550_serial",
.plat = &serial_omap_plat
};
{ 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] },
#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
.base_addr = ATMEL_BASE_DBGU,
};
-U_BOOT_DEVICE(at91sam9260_serial) = {
+U_BOOT_DRVINFO(at91sam9260_serial) = {
.name = "serial_atmel",
.plat = &at91sam9260_serial_plat,
};
.clock = 2700 * 1000,
};
-U_BOOT_DEVICE(stv09911_serials) = {
+U_BOOT_DRVINFO(stv09911_serials) = {
.name = "serial_pl01x",
.plat = &serial_plat,
};
.baudrate = CONFIG_BAUDRATE,
};
-U_BOOT_DEVICE(coldfire_serial) = {
+U_BOOT_DRVINFO(coldfire_serial) = {
.name = "serial_coldfire",
.plat = &mcf5307_serial_plat,
};
.priv_pdata = &am335_eth_data,
};
-U_BOOT_DEVICE(am335x_eth) = {
+U_BOOT_DRVINFO(am335x_eth) = {
.name = "eth_cpsw",
.plat = &cpsw_pdata,
};
.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,
};
.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,
};
.fcr = UART_FCR_DEFVAL,
};
-U_BOOT_DEVICE(devkit8000_uart) = {
+U_BOOT_DRVINFO(devkit8000_uart) = {
"ns16550_serial",
&devkit8000_serial
};
.use_dte = true,
};
-U_BOOT_DEVICE(mxc_serial) = {
+U_BOOT_DRVINFO(mxc_serial) = {
.name = "serial_mxc",
.plat = &mxc_serial_plat,
};
.use_dte = 1,
};
-U_BOOT_DEVICE(mxc_serial) = {
+U_BOOT_DRVINFO(mxc_serial) = {
.name = "serial_mxc",
.plat = &mxc_serial_plat,
};
.use_dte = true,
};
-U_BOOT_DEVICE(mxc_serial) = {
+U_BOOT_DRVINFO(mxc_serial) = {
.name = "serial_mxc",
.plat = &mxc_serial_plat,
};
.base = (struct pxa_mmc_regs *)MMC0_BASE,
};
-U_BOOT_DEVICE(pxa_mmcs) = {
+U_BOOT_DRVINFO(pxa_mmcs) = {
.name = "pxa_mmc",
.plat = &mmc_plat,
};
.baudrate = CONFIG_BAUDRATE,
};
-U_BOOT_DEVICE(pxa_serials) = {
+U_BOOT_DRVINFO(pxa_serials) = {
.name = "serial_pxa",
.plat = &serial_plat,
};
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
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
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
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
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,
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
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
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
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.
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
.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),
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
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
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.
.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,
};
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
.deactivate_delay_us = ...
};
- U_BOOT_DEVICE(board_spi0) = {
+ U_BOOT_DRVINFO(board_spi0) = {
.name = "exynos_spi",
.plat = &platdata_spi0,
};
.ops = &fsl_mod_exp_ops,
};
-U_BOOT_DEVICE(fsl_rsa) = {
+U_BOOT_DRVINFO(fsl_rsa) = {
.name = "fsl_rsa_mod_exp",
};
.flags = DM_FLAG_PRE_RELOC,
};
-U_BOOT_DEVICE(mod_exp_sw) = {
+U_BOOT_DRVINFO(mod_exp_sw) = {
.name = "mod_exp_sw",
};
.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,
};
/*
* 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)
{ 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] },
#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] },
.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,
};
.priv_auto = sizeof(struct emul_rtc),
};
-U_BOOT_DEVICE(rtc_emul) = {
+U_BOOT_DRVINFO(rtc_emul) = {
.name = "rtc_emul",
};
.colour = -1,
};
-U_BOOT_DEVICE(serial_sandbox_non_fdt) = {
+U_BOOT_DRVINFO(serial_sandbox_non_fdt) = {
.name = "sandbox_serial",
.plat = &platdata_non_fdt,
};
/*
* 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))
#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
};
/* 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",
};
.flags = DM_FLAG_PRE_RELOC,
};
-U_BOOT_DEVICE(sunxi_de2) = {
+U_BOOT_DRVINFO(sunxi_de2) = {
.name = "sunxi_de2"
};
.priv_auto = sizeof(struct sunxi_dw_hdmi_priv),
};
-U_BOOT_DEVICE(sunxi_dw_hdmi) = {
+U_BOOT_DRVINFO(sunxi_dw_hdmi) = {
.name = "sunxi_dw_hdmi"
};
};
#ifdef CONFIG_MACH_SUN50I
-U_BOOT_DEVICE(sunxi_lcd) = {
+U_BOOT_DRVINFO(sunxi_lcd) = {
.name = "sunxi_lcd"
};
#endif
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
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
* 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
* 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.
/**
* 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)
* 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.
*
/**
* 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.
*/
* (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.
*/
.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],
};
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))
"""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 <common.h>\n')
* 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 <common.h>
/* 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),
\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),
\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),
\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),
\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),
\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),
/* 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),
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),
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),
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),
\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),
\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),
/* 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),
\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),
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),
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),
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),
\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),
\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),
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),
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),
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),
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),
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),
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),
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),
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),
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),
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),
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),
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),
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),