mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-28 07:31:15 +00:00
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 <sjg@chromium.org>
This commit is contained in:
parent
be3bd3bb17
commit
20e442ab2d
64 changed files with 148 additions and 148 deletions
|
@ -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] },
|
||||
|
|
|
@ -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] },
|
||||
|
|
|
@ -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,
|
||||
};
|
||||
|
|
|
@ -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,
|
||||
};
|
||||
|
|
|
@ -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"
|
||||
};
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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] },
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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,
|
||||
};
|
||||
|
|
|
@ -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,
|
||||
};
|
||||
|
|
|
@ -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,
|
||||
};
|
||||
|
|
|
@ -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,
|
||||
};
|
||||
|
|
|
@ -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,
|
||||
};
|
||||
|
|
|
@ -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,
|
||||
};
|
||||
|
|
|
@ -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,
|
||||
};
|
||||
|
|
|
@ -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,
|
||||
};
|
||||
|
|
|
@ -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,
|
||||
};
|
||||
|
|
|
@ -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,
|
||||
};
|
||||
|
|
|
@ -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,
|
||||
};
|
||||
|
|
|
@ -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,
|
||||
};
|
||||
|
|
|
@ -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,
|
||||
};
|
||||
|
|
|
@ -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,
|
||||
};
|
||||
|
|
|
@ -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,
|
||||
};
|
||||
|
|
|
@ -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,
|
||||
};
|
||||
|
|
|
@ -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,
|
||||
};
|
||||
|
|
|
@ -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
|
||||
};
|
||||
|
|
|
@ -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
|
||||
};
|
||||
|
|
|
@ -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] },
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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,
|
||||
};
|
||||
|
|
|
@ -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,
|
||||
};
|
||||
|
|
|
@ -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,
|
||||
};
|
||||
|
|
|
@ -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,
|
||||
};
|
||||
|
|
|
@ -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
|
||||
};
|
||||
|
|
|
@ -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,
|
||||
};
|
||||
|
|
|
@ -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,
|
||||
};
|
||||
|
|
|
@ -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,
|
||||
};
|
||||
|
|
|
@ -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,
|
||||
};
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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.
|
||||
|
||||
|
|
|
@ -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,
|
||||
};
|
||||
|
|
|
@ -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,
|
||||
};
|
||||
|
|
|
@ -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",
|
||||
};
|
||||
|
|
|
@ -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",
|
||||
};
|
||||
|
|
|
@ -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,
|
||||
};
|
||||
|
|
|
@ -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] },
|
||||
|
|
|
@ -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] },
|
||||
|
|
|
@ -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,
|
||||
};
|
||||
|
|
|
@ -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",
|
||||
};
|
||||
|
|
|
@ -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,
|
||||
};
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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",
|
||||
};
|
||||
|
|
|
@ -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"
|
||||
};
|
||||
|
||||
|
|
|
@ -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"
|
||||
};
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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.
|
||||
*/
|
||||
|
|
|
@ -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.
|
||||
*/
|
||||
|
||||
|
|
|
@ -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],
|
||||
};
|
||||
|
|
|
@ -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 <common.h>\n')
|
||||
|
|
|
@ -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 <common.h>
|
||||
|
@ -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),
|
||||
|
|
Loading…
Reference in a new issue