From: Simon Glass Date: Tue, 29 Dec 2020 03:34:54 +0000 (-0700) Subject: dm: Rename U_BOOT_DEVICE() to U_BOOT_DRVINFO() X-Git-Url: http://git.dujemihanovic.xyz/?a=commitdiff_plain;h=20e442ab2df355450006574fff178c746d254a18;p=u-boot.git 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 --- 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),