dm: DM_FLAG_PRE_RELOC flag clean up
Subsystems (25)
cover dm: DM_FLAG_PRE_RELOC flag clean up
When a driver declares DM_FLAG_PRE_RELOC flag, it wishes to be bound before relocation. However due to a bug in the DM core, the flag only takes effect when devices are statically declared via U_BOOT_DEVICE(). This bug has been fixed recently by commit "dm: core: Respect drivers with the DM_FLAG_PRE_RELOC flag in lists_bind_fdt()", but with the fix, it has a side effect that all existing drivers that declared DM_FLAG_PRE_RELOC flag will be bound before relocation now. This may expose potential boot failure on some boards due to insufficient memory during the pre-relocation stage.
To mitigate this potential impact, the following changes are implemented:
- Remove DM_FLAG_PRE_RELOC flag in the driver, if the driver only supports configuration from device tree (OF_CONTROL)
- Keep DM_FLAG_PRE_RELOC flag in the driver only if the device is statically declared via U_BOOT_DEVICE()
- Surround DM_FLAG_PRE_RELOC flag with OF_CONTROL check, for drivers that support both statically declared devices and configuration from device tree
This series should be applied on top of u-boot-dm/master, for v2018.11 release.
Bin Meng (13):
arm: stm32mp: Remove DM_FLAG_PRE_RELOC flag
clk: Remove DM_FLAG_PRE_RELOC flag in various drivers
gpio: Remove DM_FLAG_PRE_RELOC flag in various drivers
i2c: omap24xx: Surround DM_FLAG_PRE_RELOC flag with OF_CONTROL check
mmc: omap: Surround DM_FLAG_PRE_RELOC flag with OF_CONTROL check
pinctrl: Remove DM_FLAG_PRE_RELOC flag in various drivers
ram: bmips: Remove DM_FLAG_PRE_RELOC flag
timer: Remove DM_FLAG_PRE_RELOC flag in various drivers
serial: Remove DM_FLAG_PRE_RELOC flag in various drivers
sysreset: Remove DM_FLAG_PRE_RELOC flag in various drivers
video: simplefb: Remove DM_FLAG_PRE_RELOC flag
watchdog: Remove DM_FLAG_PRE_RELOC flag in various drivers
dm: doc: Update description of pre-relocation support
arch/arm/mach-stm32mp/bsec.c | 1 - arch/x86/cpu/tangier/sysreset.c | 1 - doc/driver-model/README.txt | 16 ++++++++++++---- drivers/clk/altera/clk-arria10.c | 1 - drivers/clk/clk_pic32.c | 1 - drivers/clk/clk_zynq.c | 1 - drivers/clk/exynos/clk-exynos7420.c | 3 --- drivers/clk/owl/clk_s900.c | 1 - drivers/gpio/omap_gpio.c | 2 ++ drivers/gpio/stm32f7_gpio.c | 2 +- drivers/gpio/tegra186_gpio.c | 1 - drivers/gpio/tegra_gpio.c | 1 - drivers/i2c/omap24xx_i2c.c | 2 ++ drivers/mmc/omap_hsmmc.c | 2 ++ drivers/pinctrl/broadcom/pinctrl-bcm283x.c | 2 ++ drivers/pinctrl/exynos/pinctrl-exynos7420.c | 1 - drivers/pinctrl/nxp/pinctrl-imx5.c | 2 ++ drivers/pinctrl/nxp/pinctrl-imx6.c | 2 ++ drivers/pinctrl/nxp/pinctrl-imx7.c | 2 ++ drivers/pinctrl/nxp/pinctrl-imx7ulp.c | 2 ++ drivers/pinctrl/pinctrl-single.c | 1 - drivers/pinctrl/uniphier/pinctrl-uniphier-pro4.c | 2 ++ drivers/pinctrl/uniphier/pinctrl-uniphier-pro5.c | 2 ++ drivers/ram/bmips_ram.c | 1 - drivers/serial/altera_jtag_uart.c | 1 - drivers/serial/altera_uart.c | 1 - drivers/serial/arm_dcc.c | 1 - drivers/serial/atmel_usart.c | 2 ++ drivers/serial/ns16550.c | 2 ++ drivers/serial/serial_ar933x.c | 1 - drivers/serial/serial_arc.c | 1 - drivers/serial/serial_bcm283x_mu.c | 2 ++ drivers/serial/serial_bcm283x_pl011.c | 2 ++ drivers/serial/serial_bcm6345.c | 1 - drivers/serial/serial_efi.c | 1 - drivers/serial/serial_intel_mid.c | 1 - drivers/serial/serial_lpuart.c | 1 - drivers/serial/serial_meson.c | 1 - drivers/serial/serial_mvebu_a3700.c | 1 - drivers/serial/serial_mxc.c | 2 ++ drivers/serial/serial_omap.c | 2 ++ drivers/serial/serial_owl.c | 1 - drivers/serial/serial_pic32.c | 1 - drivers/serial/serial_pl01x.c | 2 ++ drivers/serial/serial_s5p.c | 1 - drivers/serial/serial_sh.c | 2 ++ drivers/serial/serial_sti_asc.c | 1 - drivers/serial/serial_stm32.c | 2 ++ drivers/serial/serial_xuartlite.c | 1 - drivers/serial/serial_zynq.c | 1 - drivers/sysreset/sysreset_x86.c | 1 - drivers/timer/ag101p_timer.c | 1 - drivers/timer/altera_timer.c | 1 - drivers/timer/arc_timer.c | 1 - drivers/timer/ast_timer.c | 1 - drivers/timer/atcpit100_timer.c | 1 - drivers/timer/atmel_pit_timer.c | 1 - drivers/timer/cadence-ttc.c | 1 - drivers/timer/dw-apb-timer.c | 1 - drivers/timer/mpc83xx_timer.c | 1 - drivers/timer/omap-timer.c | 1 - drivers/timer/rockchip_timer.c | 1 - drivers/timer/sti-timer.c | 1 - drivers/timer/stm32_timer.c | 1 - drivers/timer/tsc_timer.c | 1 - drivers/video/simplefb.c | 1 - drivers/watchdog/ast_wdt.c | 1 - lib/efi/efi_app.c | 1 - 68 files changed, 51 insertions(+), 54 deletions(-)
Signature · 1 line
2.7.4
PATCH 1/13 arm: stm32mp: Remove DM_FLAG_PRE_RELOC flag
When a driver declares DM_FLAG_PRE_RELOC flag, it wishes to be bound before relocation. However due to a bug in the DM core, the flag only takes effect when devices are statically declared via U_BOOT_DEVICE(). This bug has been fixed recently by commit "dm: core: Respect drivers with the DM_FLAG_PRE_RELOC flag in lists_bind_fdt()", but with the fix, it has a side effect that all existing drivers that declared DM_FLAG_PRE_RELOC flag will be bound before relocation now. This may expose potential boot failure on some boards due to insufficient memory during the pre-relocation stage.
To mitigate this potential impact, the following changes are implemented:
- Remove DM_FLAG_PRE_RELOC flag in the driver, if the driver only supports configuration from device tree (OF_CONTROL)
- Keep DM_FLAG_PRE_RELOC flag in the driver only if the device is statically declared via U_BOOT_DEVICE()
- Surround DM_FLAG_PRE_RELOC flag with OF_CONTROL check, for drivers that support both statically declared devices and configuration from device tree
---
arch/arm/mach-stm32mp/bsec.c | 1 - 1 file changed, 1 deletion(-)
arch/arm/mach-stm32mp/bsec.c +0 -1
@@ -417,7 +417,6 @@ U_BOOT_DRIVER(stm32mp_bsec) = { .ofdata_to_platdata = stm32mp_bsec_ofdata_to_platdata, .platdata_auto_alloc_size = sizeof(struct stm32mp_bsec_platdata), .ops = &stm32mp_bsec_ops, - .flags = DM_FLAG_PRE_RELOC, };/* bsec IP is not present in device tee, manage IP address by platdata */
Signature · 1 line
2.7.4
PATCH 1/13 arm: stm32mp: Remove DM_FLAG_PRE_RELOC flag
Quoted 22 lines · Bin Meng
When a driver declares
DM_FLAG_PRE_RELOCflag, it wishes to be bound before relocation. However due to a bug in the DM core, the flag only takes effect when devices are statically declared viaU_BOOT_DEVICE(). This bug has been fixed recently by commit "dm: core: Respect drivers with theDM_FLAG_PRE_RELOCflag inlists_bind_fdt()", but with the fix, it has a side effect that all existing drivers that declaredDM_FLAG_PRE_RELOCflag will be bound before relocation now. This may expose potential boot failure on some boards due to insufficient memory during the pre-relocation stage.To mitigate this potential impact, the following changes are implemented:
- Remove
DM_FLAG_PRE_RELOCflag in the driver, if the driver only supports configuration from device tree (OF_CONTROL)
- KeepDM_FLAG_PRE_RELOCflag in the driver only if the device is statically declared viaU_BOOT_DEVICE()
- SurroundDM_FLAG_PRE_RELOCflag withOF_CONTROLcheck, for drivers that support both statically declared devices and configuration from device tree
Quoted 5 lines
Signed-off-by Bin Meng <[email protected]>---
arch/arm/mach-stm32mp/bsec.c | 1 - 1 file changed, 1 deletion(-)
PATCH 1/13 arm: stm32mp: Remove DM_FLAG_PRE_RELOC flag
In reply to Bin MengQuoted 45 lines
From: U-Boot <[email protected]> On Behalf Of Bin Meng
Sent: mercredi 24 octobre 2018 15:36When a driver declares
DM_FLAG_PRE_RELOCflag, it wishes to be bound before relocation. However due to a bug in the DM core, the flag only takes effect when devices are statically declared viaU_BOOT_DEVICE(). This bug has been fixed recently by commit
"dm: core: Respect drivers with theDM_FLAG_PRE_RELOCflag inlists_bind_fdt()", but with the fix, it has a side effect that all existing drivers that declaredDM_FLAG_PRE_RELOCflag will be bound before relocation now. This may expose potential boot failure on some boards due to insufficient memory during the pre-relocation stage.To mitigate this potential impact, the following changes are implemented:
- Remove
DM_FLAG_PRE_RELOCflag in the driver, if the driver only supports configuration from device tree (OF_CONTROL)
- KeepDM_FLAG_PRE_RELOCflag in the driver only if the device is statically declared viaU_BOOT_DEVICE()
- SurroundDM_FLAG_PRE_RELOCflag withOF_CONTROLcheck, for drivers that support both statically declared devices and configuration from device treeSigned-off-by Bin Meng <[email protected]>---
arch/arm/mach-stm32mp/bsec.c | 1 - 1 file changed, 1 deletion(-)arch/arm/mach-stm32mp/bsec.c +0
-2@@ -417,7 +417,6 @@ U_BOOT_DRIVER(stm32mp_bsec) = { .ofdata_to_platdata = stm32mp_bsec_ofdata_to_platdata, .platdata_auto_alloc_size = sizeof(struct stm32mp_bsec_platdata), .ops = &stm32mp_bsec_ops, - .flags = DM_FLAG_PRE_RELOC, };/* bsec IP is not present in device tee, manage IP address by platdata */ --2.7.4
Quoted 4 lines
_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
https://lists.denx.de/listinfo/u-boot
PATCH 1/13 arm: stm32mp: Remove DM_FLAG_PRE_RELOC flag
Quoted 24 lines
From: U-Boot <[email protected]> On Behalf Of Bin Meng
Sent: mercredi 24 octobre 2018 15:36When a driver declares
DM_FLAG_PRE_RELOCflag, it wishes to be bound before relocation. However due to a bug in the DM core, the flag only takes effect when devices are statically declared viaU_BOOT_DEVICE(). This bug has been fixed recently by commit
"dm: core: Respect drivers with theDM_FLAG_PRE_RELOCflag inlists_bind_fdt()", but with the fix, it has a side effect that all existing drivers that declaredDM_FLAG_PRE_RELOCflag will be bound before relocation now. This may expose potential boot failure on some boards due to insufficient memory during the pre-relocation stage.To mitigate this potential impact, the following changes are implemented:
- Remove
DM_FLAG_PRE_RELOCflag in the driver, if the driver only supports configuration from device tree (OF_CONTROL)
- KeepDM_FLAG_PRE_RELOCflag in the driver only if the device is statically declared viaU_BOOT_DEVICE()
- SurroundDM_FLAG_PRE_RELOCflag withOF_CONTROLcheck, for drivers that support both statically declared devices and configuration from device tree
Quoted 6 lines
Signed-off-by Bin Meng <[email protected]>---
arch/arm/mach-stm32mp/bsec.c | 1 - 1 file changed, 1 deletion(-)
Applied to u-boot-dm/master, thanks!
PATCH 2/13 clk: Remove DM_FLAG_PRE_RELOC flag in various drivers
In reply to Bin MengWhen a driver declares DM_FLAG_PRE_RELOC flag, it wishes to be bound before relocation. However due to a bug in the DM core, the flag only takes effect when devices are statically declared via U_BOOT_DEVICE(). This bug has been fixed recently by commit "dm: core: Respect drivers with the DM_FLAG_PRE_RELOC flag in lists_bind_fdt()", but with the fix, it has a side effect that all existing drivers that declared DM_FLAG_PRE_RELOC flag will be bound before relocation now. This may expose potential boot failure on some boards due to insufficient memory during the pre-relocation stage.
To mitigate this potential impact, the following changes are implemented:
- Remove DM_FLAG_PRE_RELOC flag in the driver, if the driver only supports configuration from device tree (OF_CONTROL)
- Keep DM_FLAG_PRE_RELOC flag in the driver only if the device is statically declared via U_BOOT_DEVICE()
- Surround DM_FLAG_PRE_RELOC flag with OF_CONTROL check, for drivers that support both statically declared devices and configuration from device tree
---
drivers/clk/altera/clk-arria10.c | 1 - drivers/clk/clk_pic32.c | 1 - drivers/clk/clk_zynq.c | 1 - drivers/clk/exynos/clk-exynos7420.c | 3 --- drivers/clk/owl/clk_s900.c | 1 - 5 files changed, 7 deletions(-)
drivers/clk/altera/clk-arria10.c +0 -1
@@ -352,7 +352,6 @@ static const struct udevice_id socfpga_a10_clk_match[] = {U_BOOT_DRIVER (socfpga_a10_clk) = { .name ="clk-a10" , .id =UCLASS_CLK , - .flags =DM_FLAG_PRE_RELOC , .of_match = socfpga_a10_clk_match, .ops = &socfpga_a10_clk_ops, .bind = socfpga_a10_clk_bind,
drivers/clk/clk_pic32.c +0 -1
@@ -418,7 +418,6 @@ U_BOOT_DRIVER(pic32_clk) = { .name = "pic32_clk", .id = UCLASS_CLK, .of_match = pic32_clk_ids, - .flags = DM_FLAG_PRE_RELOC, .ops = &pic32_pic32_clk_ops, .probe = pic32_clk_probe, .priv_auto_alloc_size = sizeof(struct pic32_clk_priv),
drivers/clk/clk_zynq.c +0 -1
@@ -480,7 +480,6 @@ U_BOOT_DRIVER(zynq_clk) = { .name = "zynq_clk", .id = UCLASS_CLK, .of_match = zynq_clk_ids, - .flags = DM_FLAG_PRE_RELOC, .ops = &zynq_clk_ops, .priv_auto_alloc_size = sizeof(struct zynq_clk_priv), .probe = zynq_clk_probe,
drivers/clk/exynos/clk-exynos7420.c +0 -3
@@ -201,7 +201,6 @@ U_BOOT_DRIVER(exynos7420_clk_topc) = { .probe = exynos7420_clk_topc_probe, .priv_auto_alloc_size = sizeof(struct exynos7420_clk_topc_priv), .ops = &exynos7420_clk_topc_ops, - .flags = DM_FLAG_PRE_RELOC, };static const struct udevice_id exynos7420_clk_top0_compat[] = {
@@ -216,7 +215,6 @@ U_BOOT_DRIVER(exynos7420_clk_top0) = { .probe = exynos7420_clk_top0_probe, .priv_auto_alloc_size = sizeof(struct exynos7420_clk_top0_priv), .ops = &exynos7420_clk_top0_ops, - .flags = DM_FLAG_PRE_RELOC, };static const struct udevice_id exynos7420_clk_peric1_compat[] = {
@@ -229,5 +227,4 @@ U_BOOT_DRIVER(exynos7420_clk_peric1) = { .id = UCLASS_CLK, .of_match = exynos7420_clk_peric1_compat, .ops = &exynos7420_clk_peric1_ops, - .flags = DM_FLAG_PRE_RELOC, };
drivers/clk/owl/clk_s900.c +0 -1
@@ -134,5 +134,4 @@ U_BOOT_DRIVER(clk_owl) = { .ops = &owl_clk_ops, .priv_auto_alloc_size = sizeof(struct owl_clk_priv), .probe = owl_clk_probe, - .flags = DM_FLAG_PRE_RELOC, };
Signature · 1 line
2.7.4
PATCH 2/13 clk: Remove DM_FLAG_PRE_RELOC flag in various drivers
Quoted 23 lines · Bin Meng
When a driver declares
DM_FLAG_PRE_RELOCflag, it wishes to be bound before relocation. However due to a bug in the DM core, the flag only takes effect when devices are statically declared viaU_BOOT_DEVICE(). This bug has been fixed recently by commit "dm: core: Respect drivers with theDM_FLAG_PRE_RELOCflag inlists_bind_fdt()", but with the fix, it has a side effect that all existing drivers that declaredDM_FLAG_PRE_RELOCflag will be bound before relocation now. This may expose potential boot failure on some boards due to insufficient memory during the pre-relocation stage.To mitigate this potential impact, the following changes are implemented:
- Remove
DM_FLAG_PRE_RELOCflag in the driver, if the driver only supports configuration from device tree (OF_CONTROL)
- KeepDM_FLAG_PRE_RELOCflag in the driver only if the device is statically declared viaU_BOOT_DEVICE()
- SurroundDM_FLAG_PRE_RELOCflag withOF_CONTROLcheck, for drivers that support both statically declared devices and configuration from device treeSigned-off-by Bin Meng <[email protected]>
Quoted 8 lines
---
drivers/clk/altera/clk-arria10.c | 1 - drivers/clk/clk_pic32.c | 1 - drivers/clk/clk_zynq.c | 1 - drivers/clk/exynos/clk-exynos7420.c | 3 --- drivers/clk/owl/clk_s900.c | 1 - 5 files changed, 7 deletions(-)
PATCH 2/13 clk: Remove DM_FLAG_PRE_RELOC flag in various drivers
Quoted 23 lines · Bin Meng
When a driver declares
DM_FLAG_PRE_RELOCflag, it wishes to be bound before relocation. However due to a bug in the DM core, the flag only takes effect when devices are statically declared viaU_BOOT_DEVICE(). This bug has been fixed recently by commit "dm: core: Respect drivers with theDM_FLAG_PRE_RELOCflag inlists_bind_fdt()", but with the fix, it has a side effect that all existing drivers that declaredDM_FLAG_PRE_RELOCflag will be bound before relocation now. This may expose potential boot failure on some boards due to insufficient memory during the pre-relocation stage.To mitigate this potential impact, the following changes are implemented:
- Remove
DM_FLAG_PRE_RELOCflag in the driver, if the driver only supports configuration from device tree (OF_CONTROL)
- KeepDM_FLAG_PRE_RELOCflag in the driver only if the device is statically declared viaU_BOOT_DEVICE()
- SurroundDM_FLAG_PRE_RELOCflag withOF_CONTROLcheck, for drivers that support both statically declared devices and configuration from device treeSigned-off-by Bin Meng <[email protected]>
Quoted 8 lines
---
drivers/clk/altera/clk-arria10.c | 1 - drivers/clk/clk_pic32.c | 1 - drivers/clk/clk_zynq.c | 1 - drivers/clk/exynos/clk-exynos7420.c | 3 --- drivers/clk/owl/clk_s900.c | 1 - 5 files changed, 7 deletions(-)
Applied to u-boot-dm/master, thanks!
PATCH 3/13 gpio: Remove DM_FLAG_PRE_RELOC flag in various drivers
In reply to Bin MengWhen a driver declares DM_FLAG_PRE_RELOC flag, it wishes to be bound before relocation. However due to a bug in the DM core, the flag only takes effect when devices are statically declared via U_BOOT_DEVICE(). This bug has been fixed recently by commit "dm: core: Respect drivers with the DM_FLAG_PRE_RELOC flag in lists_bind_fdt()", but with the fix, it has a side effect that all existing drivers that declared DM_FLAG_PRE_RELOC flag will be bound before relocation now. This may expose potential boot failure on some boards due to insufficient memory during the pre-relocation stage.
To mitigate this potential impact, the following changes are implemented:
- Remove DM_FLAG_PRE_RELOC flag in the driver, if the driver only supports configuration from device tree (OF_CONTROL)
- Keep DM_FLAG_PRE_RELOC flag in the driver only if the device is statically declared via U_BOOT_DEVICE()
- Surround DM_FLAG_PRE_RELOC flag with OF_CONTROL check, for drivers that support both statically declared devices and configuration from device tree
---
drivers/gpio/omap_gpio.c | 2 ++ drivers/gpio/stm32f7_gpio.c | 2 +- drivers/gpio/tegra186_gpio.c | 1 - drivers/gpio/tegra_gpio.c | 1 - 4 files changed, 3 insertions(+), 3 deletions(-)
drivers/gpio/omap_gpio.c +2 -0
@@ -372,7 +372,9 @@ U_BOOT_DRIVER(gpio_omap) = { .ops = &gpio_omap_ops, .probe = omap_gpio_probe, .priv_auto_alloc_size = sizeof(struct gpio_bank), +#if !CONFIG_IS_ENABLED (OF_CONTROL ) .flags = DM_FLAG_PRE_RELOC, +#endif };#endif /* CONFIG_DM_GPIO */
drivers/gpio/stm32f7_gpio.c +1 -1
@@ -123,6 +123,6 @@ U_BOOT_DRIVER(gpio_stm32) = { .of_match = stm32_gpio_ids, .probe = gpio_stm32_probe, .ops = &gpio_stm32_ops, - .flags = DM_FLAG_PRE_RELOC | DM_UC_FLAG_SEQ_ALIAS, + .flags = DM_UC_FLAG_SEQ_ALIAS, .priv_auto_alloc_size = sizeof(struct stm32_gpio_priv), };
drivers/gpio/tegra186_gpio.c +0 -1
@@ -281,5 +281,4 @@ U_BOOT_DRIVER(tegra186_gpio) = { .bind = tegra186_gpio_bind, .probe = tegra186_gpio_probe, .ops = &tegra186_gpio_ops, - .flags = DM_FLAG_PRE_RELOC, };
drivers/gpio/tegra_gpio.c +0 -1
@@ -378,5 +378,4 @@ U_BOOT_DRIVER(gpio_tegra) = { .probe = gpio_tegra_probe, .priv_auto_alloc_size = sizeof(struct tegra_port_info), .ops = &gpio_tegra_ops, - .flags = DM_FLAG_PRE_RELOC, };
Signature · 1 line
2.7.4
PATCH 3/13 gpio: Remove DM_FLAG_PRE_RELOC flag in various drivers
Quoted 22 lines · Bin Meng
When a driver declares
DM_FLAG_PRE_RELOCflag, it wishes to be bound before relocation. However due to a bug in the DM core, the flag only takes effect when devices are statically declared viaU_BOOT_DEVICE(). This bug has been fixed recently by commit "dm: core: Respect drivers with theDM_FLAG_PRE_RELOCflag inlists_bind_fdt()", but with the fix, it has a side effect that all existing drivers that declaredDM_FLAG_PRE_RELOCflag will be bound before relocation now. This may expose potential boot failure on some boards due to insufficient memory during the pre-relocation stage.To mitigate this potential impact, the following changes are implemented:
- Remove
DM_FLAG_PRE_RELOCflag in the driver, if the driver only supports configuration from device tree (OF_CONTROL)
- KeepDM_FLAG_PRE_RELOCflag in the driver only if the device is statically declared viaU_BOOT_DEVICE()
- SurroundDM_FLAG_PRE_RELOCflag withOF_CONTROLcheck, for drivers that support both statically declared devices and configuration from device tree
Quoted 8 lines
Signed-off-by Bin Meng <[email protected]>---
drivers/gpio/omap_gpio.c | 2 ++ drivers/gpio/stm32f7_gpio.c | 2 +- drivers/gpio/tegra186_gpio.c | 1 - drivers/gpio/tegra_gpio.c | 1 - 4 files changed, 3 insertions(+), 3 deletions(-)
PATCH 3/13 gpio: Remove DM_FLAG_PRE_RELOC flag in various drivers
In reply to Bin MengQuoted 83 lines
From: U-Boot <[email protected]> On Behalf Of Bin Meng
Sent: mercredi 24 octobre 2018 15:37Subject: [U-Boot] [PATCH 03/13] gpio: Remove
DM_FLAG_PRE_RELOCflag in various driversWhen a driver declares
DM_FLAG_PRE_RELOCflag, it wishes to be bound before relocation. However due to a bug in the DM core, the flag only takes effect when devices are statically declared viaU_BOOT_DEVICE(). This bug has been fixed recently by commit
"dm: core: Respect drivers with theDM_FLAG_PRE_RELOCflag inlists_bind_fdt()", but with the fix, it has a side effect that all existing drivers that declaredDM_FLAG_PRE_RELOCflag will be bound before relocation now. This may expose potential boot failure on some boards due to insufficient memory during the pre-relocation stage.To mitigate this potential impact, the following changes are implemented:
- Remove
DM_FLAG_PRE_RELOCflag in the driver, if the driver only supports configuration from device tree (OF_CONTROL)
- KeepDM_FLAG_PRE_RELOCflag in the driver only if the device is statically declared viaU_BOOT_DEVICE()
- SurroundDM_FLAG_PRE_RELOCflag withOF_CONTROLcheck, for drivers that support both statically declared devices and configuration from device treeSigned-off-by Bin Meng <[email protected]>---
drivers/gpio/omap_gpio.c | 2 ++ drivers/gpio/stm32f7_gpio.c | 2 +- drivers/gpio/tegra186_gpio.c | 1 - drivers/gpio/tegra_gpio.c | 1 - 4 files changed, 3 insertions(+), 3 deletions(-)drivers/gpio/omap_gpio.c index renamed from drivers/gpio/omap_gpio.c +0
-0555eba2..0031415 100644
drivers/gpio/omap_gpio.c +2
-0@@ -372,7 +372,9 @@ U_BOOT_DRIVER(gpio_omap) = { .ops = &gpio_omap_ops, .probe = omap_gpio_probe, .priv_auto_alloc_size = sizeof(struct gpio_bank), +#if !CONFIG_IS_ENABLED (OF_CONTROL ) .flags = DM_FLAG_PRE_RELOC, +#endif };#endif /* CONFIG_DM_GPIO */ drivers/gpio/stm32f7_gpio.c index renamed from drivers/gpio/stm32f7_gpio.c +0
-04c0786f..b903dc4 100644
drivers/gpio/stm32f7_gpio.c +1
-1@@ -123,6 +123,6 @@ U_BOOT_DRIVER(gpio_stm32) = { .of_match = stm32_gpio_ids, .probe = gpio_stm32_probe, .ops = &gpio_stm32_ops, - .flags = DM_FLAG_PRE_RELOC | DM_UC_FLAG_SEQ_ALIAS, + .flags = DM_UC_FLAG_SEQ_ALIAS, .priv_auto_alloc_size = sizeof(struct stm32_gpio_priv), };drivers/gpio/tegra186_gpio.c index renamed from drivers/gpio/tegra186_gpio.c +0
-01f0e8d5..6626b54 100644
drivers/gpio/tegra186_gpio.c +0
-1@@ -281,5 +281,4 @@ U_BOOT_DRIVER(tegra186_gpio) = { .bind = tegra186_gpio_bind, .probe = tegra186_gpio_probe, .ops = &tegra186_gpio_ops, - .flags = DM_FLAG_PRE_RELOC, };drivers/gpio/tegra_gpio.c index renamed from drivers/gpio/tegra_gpio.c +0
-0302efdd..a730f5c 100644
drivers/gpio/tegra_gpio.c +0
-2@@ -378,5 +378,4 @@ U_BOOT_DRIVER(gpio_tegra) = { .probe = gpio_tegra_probe, .priv_auto_alloc_size = sizeof(struct tegra_port_info), .ops = &gpio_tegra_ops, - .flags = DM_FLAG_PRE_RELOC, }; --
Quoted 2 lines
2.7.4
PATCH 3/13 gpio: Remove DM_FLAG_PRE_RELOC flag in various drivers
Quoted 27 lines
From: U-Boot <[email protected]> On Behalf Of Bin Meng
Sent: mercredi 24 octobre 2018 15:37Subject: [U-Boot] [PATCH 03/13] gpio: Remove
DM_FLAG_PRE_RELOCflag in various driversWhen a driver declares
DM_FLAG_PRE_RELOCflag, it wishes to be bound before relocation. However due to a bug in the DM core, the flag only takes effect when devices are statically declared viaU_BOOT_DEVICE(). This bug has been fixed recently by commit
"dm: core: Respect drivers with theDM_FLAG_PRE_RELOCflag inlists_bind_fdt()", but with the fix, it has a side effect that all existing drivers that declaredDM_FLAG_PRE_RELOCflag will be bound before relocation now. This may expose potential boot failure on some boards due to insufficient memory during the pre-relocation stage.To mitigate this potential impact, the following changes are implemented:
- Remove
DM_FLAG_PRE_RELOCflag in the driver, if the driver only supports configuration from device tree (OF_CONTROL)
- KeepDM_FLAG_PRE_RELOCflag in the driver only if the device is statically declared viaU_BOOT_DEVICE()
- SurroundDM_FLAG_PRE_RELOCflag withOF_CONTROLcheck, for drivers that support both statically declared devices and configuration from device tree
Quoted 9 lines
Signed-off-by Bin Meng <[email protected]>---
drivers/gpio/omap_gpio.c | 2 ++ drivers/gpio/stm32f7_gpio.c | 2 +- drivers/gpio/tegra186_gpio.c | 1 - drivers/gpio/tegra_gpio.c | 1 - 4 files changed, 3 insertions(+), 3 deletions(-)
Applied to u-boot-dm/master, thanks!
PATCH 4/13 i2c: omap24xx: Surround DM_FLAG_PRE_RELOC flag with OF_CONTROL check
In reply to Bin MengWhen a driver declares DM_FLAG_PRE_RELOC flag, it wishes to be bound before relocation. However due to a bug in the DM core, the flag only takes effect when devices are statically declared via U_BOOT_DEVICE(). This bug has been fixed recently by commit "dm: core: Respect drivers with the DM_FLAG_PRE_RELOC flag in lists_bind_fdt()", but with the fix, it has a side effect that all existing drivers that declared DM_FLAG_PRE_RELOC flag will be bound before relocation now. This may expose potential boot failure on some boards due to insufficient memory during the pre-relocation stage.
To mitigate this potential impact, the following changes are implemented:
- Remove DM_FLAG_PRE_RELOC flag in the driver, if the driver only supports configuration from device tree (OF_CONTROL)
- Keep DM_FLAG_PRE_RELOC flag in the driver only if the device is statically declared via U_BOOT_DEVICE()
- Surround DM_FLAG_PRE_RELOC flag with OF_CONTROL check, for drivers that support both statically declared devices and configuration from device tree
---
drivers/i2c/omap24xx_i2c.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/i2c/omap24xx_i2c.c +2 -0
@@ -925,7 +925,9 @@ U_BOOT_DRIVER(i2c_omap) = { .probe = omap_i2c_probe, .priv_auto_alloc_size = sizeof(struct omap_i2c), .ops = &omap_i2c_ops, +#if !CONFIG_IS_ENABLED (OF_CONTROL ) .flags = DM_FLAG_PRE_RELOC, +#endif };#endif /* CONFIG_DM_I2C */
Signature · 1 line
2.7.4
PATCH 4/13 i2c: omap24xx: Surround DM_FLAG_PRE_RELOC flag with OF_CONTROL check
Quoted 22 lines · Bin Meng
When a driver declares
DM_FLAG_PRE_RELOCflag, it wishes to be bound before relocation. However due to a bug in the DM core, the flag only takes effect when devices are statically declared viaU_BOOT_DEVICE(). This bug has been fixed recently by commit "dm: core: Respect drivers with theDM_FLAG_PRE_RELOCflag inlists_bind_fdt()", but with the fix, it has a side effect that all existing drivers that declaredDM_FLAG_PRE_RELOCflag will be bound before relocation now. This may expose potential boot failure on some boards due to insufficient memory during the pre-relocation stage.To mitigate this potential impact, the following changes are implemented:
- Remove
DM_FLAG_PRE_RELOCflag in the driver, if the driver only supports configuration from device tree (OF_CONTROL)
- KeepDM_FLAG_PRE_RELOCflag in the driver only if the device is statically declared viaU_BOOT_DEVICE()
- SurroundDM_FLAG_PRE_RELOCflag withOF_CONTROLcheck, for drivers that support both statically declared devices and configuration from device tree
Quoted 6 lines
Signed-off-by Bin Meng <[email protected]>---
drivers/i2c/omap24xx_i2c.c | 2 ++ 1 file changed, 2 insertions(+)
PATCH 4/13 i2c: omap24xx: Surround DM_FLAG_PRE_RELOC flag with OF_CONTROL check
Quoted 22 lines · Bin Meng
When a driver declares
DM_FLAG_PRE_RELOCflag, it wishes to be bound before relocation. However due to a bug in the DM core, the flag only takes effect when devices are statically declared viaU_BOOT_DEVICE(). This bug has been fixed recently by commit "dm: core: Respect drivers with theDM_FLAG_PRE_RELOCflag inlists_bind_fdt()", but with the fix, it has a side effect that all existing drivers that declaredDM_FLAG_PRE_RELOCflag will be bound before relocation now. This may expose potential boot failure on some boards due to insufficient memory during the pre-relocation stage.To mitigate this potential impact, the following changes are implemented:
- Remove
DM_FLAG_PRE_RELOCflag in the driver, if the driver only supports configuration from device tree (OF_CONTROL)
- KeepDM_FLAG_PRE_RELOCflag in the driver only if the device is statically declared viaU_BOOT_DEVICE()
- SurroundDM_FLAG_PRE_RELOCflag withOF_CONTROLcheck, for drivers that support both statically declared devices and configuration from device tree
Quoted 6 lines
Signed-off-by Bin Meng <[email protected]>---
drivers/i2c/omap24xx_i2c.c | 2 ++ 1 file changed, 2 insertions(+)
Applied to u-boot-dm/master, thanks!
PATCH 5/13 mmc: omap: Surround DM_FLAG_PRE_RELOC flag with OF_CONTROL check
In reply to Bin MengWhen a driver declares DM_FLAG_PRE_RELOC flag, it wishes to be bound before relocation. However due to a bug in the DM core, the flag only takes effect when devices are statically declared via U_BOOT_DEVICE(). This bug has been fixed recently by commit "dm: core: Respect drivers with the DM_FLAG_PRE_RELOC flag in lists_bind_fdt()", but with the fix, it has a side effect that all existing drivers that declared DM_FLAG_PRE_RELOC flag will be bound before relocation now. This may expose potential boot failure on some boards due to insufficient memory during the pre-relocation stage.
To mitigate this potential impact, the following changes are implemented:
- Remove DM_FLAG_PRE_RELOC flag in the driver, if the driver only supports configuration from device tree (OF_CONTROL)
- Keep DM_FLAG_PRE_RELOC flag in the driver only if the device is statically declared via U_BOOT_DEVICE()
- Surround DM_FLAG_PRE_RELOC flag with OF_CONTROL check, for drivers that support both statically declared devices and configuration from device tree
---
drivers/mmc/omap_hsmmc.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/mmc/omap_hsmmc.c +2 -0
@@ -1953,6 +1953,8 @@ U_BOOT_DRIVER(omap_hsmmc) = { .ops = &omap_hsmmc_ops, .probe = omap_hsmmc_probe, .priv_auto_alloc_size = sizeof(struct omap_hsmmc_data), +#if !CONFIG_IS_ENABLED (OF_CONTROL ) .flags = DM_FLAG_PRE_RELOC, +#endif };#endif
Signature · 1 line
2.7.4
PATCH 5/13 mmc: omap: Surround DM_FLAG_PRE_RELOC flag with OF_CONTROL check
Quoted 22 lines · Bin Meng
When a driver declares
DM_FLAG_PRE_RELOCflag, it wishes to be bound before relocation. However due to a bug in the DM core, the flag only takes effect when devices are statically declared viaU_BOOT_DEVICE(). This bug has been fixed recently by commit "dm: core: Respect drivers with theDM_FLAG_PRE_RELOCflag inlists_bind_fdt()", but with the fix, it has a side effect that all existing drivers that declaredDM_FLAG_PRE_RELOCflag will be bound before relocation now. This may expose potential boot failure on some boards due to insufficient memory during the pre-relocation stage.To mitigate this potential impact, the following changes are implemented:
- Remove
DM_FLAG_PRE_RELOCflag in the driver, if the driver only supports configuration from device tree (OF_CONTROL)
- KeepDM_FLAG_PRE_RELOCflag in the driver only if the device is statically declared viaU_BOOT_DEVICE()
- SurroundDM_FLAG_PRE_RELOCflag withOF_CONTROLcheck, for drivers that support both statically declared devices and configuration from device tree
Quoted 5 lines
Signed-off-by Bin Meng <[email protected]>---
drivers/mmc/omap_hsmmc.c | 2 ++ 1 file changed, 2 insertions(+)
PATCH 5/13 mmc: omap: Surround DM_FLAG_PRE_RELOC flag with OF_CONTROL check
Quoted 22 lines · Bin Meng
When a driver declares
DM_FLAG_PRE_RELOCflag, it wishes to be bound before relocation. However due to a bug in the DM core, the flag only takes effect when devices are statically declared viaU_BOOT_DEVICE(). This bug has been fixed recently by commit "dm: core: Respect drivers with theDM_FLAG_PRE_RELOCflag inlists_bind_fdt()", but with the fix, it has a side effect that all existing drivers that declaredDM_FLAG_PRE_RELOCflag will be bound before relocation now. This may expose potential boot failure on some boards due to insufficient memory during the pre-relocation stage.To mitigate this potential impact, the following changes are implemented:
- Remove
DM_FLAG_PRE_RELOCflag in the driver, if the driver only supports configuration from device tree (OF_CONTROL)
- KeepDM_FLAG_PRE_RELOCflag in the driver only if the device is statically declared viaU_BOOT_DEVICE()
- SurroundDM_FLAG_PRE_RELOCflag withOF_CONTROLcheck, for drivers that support both statically declared devices and configuration from device tree
Quoted 5 lines
Signed-off-by Bin Meng <[email protected]>---
drivers/mmc/omap_hsmmc.c | 2 ++ 1 file changed, 2 insertions(+)
Applied to u-boot-dm/master, thanks!
PATCH 6/13 pinctrl: Remove DM_FLAG_PRE_RELOC flag in various drivers
In reply to Bin MengWhen a driver declares DM_FLAG_PRE_RELOC flag, it wishes to be bound before relocation. However due to a bug in the DM core, the flag only takes effect when devices are statically declared via U_BOOT_DEVICE(). This bug has been fixed recently by commit "dm: core: Respect drivers with the DM_FLAG_PRE_RELOC flag in lists_bind_fdt()", but with the fix, it has a side effect that all existing drivers that declared DM_FLAG_PRE_RELOC flag will be bound before relocation now. This may expose potential boot failure on some boards due to insufficient memory during the pre-relocation stage.
To mitigate this potential impact, the following changes are implemented:
- Remove DM_FLAG_PRE_RELOC flag in the driver, if the driver only supports configuration from device tree (OF_CONTROL)
- Keep DM_FLAG_PRE_RELOC flag in the driver only if the device is statically declared via U_BOOT_DEVICE()
- Surround DM_FLAG_PRE_RELOC flag with OF_CONTROL check, for drivers that support both statically declared devices and configuration from device tree
---
drivers/pinctrl/broadcom/pinctrl-bcm283x.c | 2 ++ drivers/pinctrl/exynos/pinctrl-exynos7420.c | 1 - drivers/pinctrl/nxp/pinctrl-imx5.c | 2 ++ drivers/pinctrl/nxp/pinctrl-imx6.c | 2 ++ drivers/pinctrl/nxp/pinctrl-imx7.c | 2 ++ drivers/pinctrl/nxp/pinctrl-imx7ulp.c | 2 ++ drivers/pinctrl/pinctrl-single.c | 1 - drivers/pinctrl/uniphier/pinctrl-uniphier-pro4.c | 2 ++ drivers/pinctrl/uniphier/pinctrl-uniphier-pro5.c | 2 ++ 9 files changed, 14 insertions(+), 2 deletions(-)
drivers/pinctrl/broadcom/pinctrl-bcm283x.c +2 -0
@@ -148,5 +148,7 @@ U_BOOT_DRIVER(pinctrl_bcm283x) = { .priv_auto_alloc_size = sizeof(struct bcm283x_pinctrl_priv), .ops = &bcm283x_pinctrl_ops, .probe = bcm283x_pinctl_probe, +#if !CONFIG_IS_ENABLED (OF_CONTROL ) .flags = DM_FLAG_PRE_RELOC, +#endif };
drivers/pinctrl/exynos/pinctrl-exynos7420.c +0 -1
@@ -113,5 +113,4 @@ U_BOOT_DRIVER(pinctrl_exynos7420) = { .priv_auto_alloc_size = sizeof(struct exynos_pinctrl_priv), .ops = &exynos7420_pinctrl_ops, .probe = exynos_pinctrl_probe, - .flags = DM_FLAG_PRE_RELOC };
drivers/pinctrl/nxp/pinctrl-imx5.c +2 -0
@@ -40,5 +40,7 @@ U_BOOT_DRIVER(imx5_pinctrl) = { .remove = imx_pinctrl_remove, .priv_auto_alloc_size = sizeof(struct imx_pinctrl_priv), .ops = &imx_pinctrl_ops, +#if !CONFIG_IS_ENABLED (OF_CONTROL ) .flags = DM_FLAG_PRE_RELOC, +#endif };
drivers/pinctrl/nxp/pinctrl-imx6.c +2 -0
@@ -49,5 +49,7 @@ U_BOOT_DRIVER(imx6_pinctrl) = { .remove = imx_pinctrl_remove, .priv_auto_alloc_size = sizeof(struct imx_pinctrl_priv), .ops = &imx_pinctrl_ops, +#if !CONFIG_IS_ENABLED (OF_CONTROL ) .flags = DM_FLAG_PRE_RELOC, +#endif };
drivers/pinctrl/nxp/pinctrl-imx7.c +2 -0
@@ -37,5 +37,7 @@ U_BOOT_DRIVER(imx7_pinctrl) = { .remove = imx_pinctrl_remove, .priv_auto_alloc_size = sizeof(struct imx_pinctrl_priv), .ops = &imx_pinctrl_ops, +#if !CONFIG_IS_ENABLED (OF_CONTROL ) .flags = DM_FLAG_PRE_RELOC, +#endif };
drivers/pinctrl/nxp/pinctrl-imx7ulp.c +2 -0
@@ -41,5 +41,7 @@ U_BOOT_DRIVER(imx7ulp_pinctrl) = { .remove = imx_pinctrl_remove, .priv_auto_alloc_size = sizeof(struct imx_pinctrl_priv), .ops = &imx_pinctrl_ops, +#if !CONFIG_IS_ENABLED (OF_CONTROL ) .flags = DM_FLAG_PRE_RELOC, +#endif };
drivers/pinctrl/pinctrl-single.c +0 -1
@@ -136,7 +136,6 @@ U_BOOT_DRIVER(single_pinctrl) = { .id = UCLASS_PINCTRL, .of_match = single_pinctrl_match, .ops = &single_pinctrl_ops, - .flags = DM_FLAG_PRE_RELOC, .platdata_auto_alloc_size = sizeof(struct single_pdata), .ofdata_to_platdata = single_ofdata_to_platdata, };
drivers/pinctrl/uniphier/pinctrl-uniphier-pro4.c +2 -0
@@ -171,5 +171,7 @@ U_BOOT_DRIVER(uniphier_pro4_pinctrl) = { .probe = uniphier_pro4_pinctrl_probe, .priv_auto_alloc_size = sizeof(struct uniphier_pinctrl_priv), .ops = &uniphier_pinctrl_ops, +#if !CONFIG_IS_ENABLED (OF_CONTROL ) .flags = DM_FLAG_PRE_RELOC, +#endif };
drivers/pinctrl/uniphier/pinctrl-uniphier-pro5.c +2 -0
@@ -153,5 +153,7 @@ U_BOOT_DRIVER(uniphier_pro5_pinctrl) = { .probe = uniphier_pro5_pinctrl_probe, .priv_auto_alloc_size = sizeof(struct uniphier_pinctrl_priv), .ops = &uniphier_pinctrl_ops, +#if !CONFIG_IS_ENABLED (OF_CONTROL ) .flags = DM_FLAG_PRE_RELOC, +#endif };
Signature · 1 line
2.7.4
PATCH 6/13 pinctrl: Remove DM_FLAG_PRE_RELOC flag in various drivers
Quoted 25 lines · Bin Meng
When a driver declares
DM_FLAG_PRE_RELOCflag, it wishes to be bound before relocation. However due to a bug in the DM core, the flag only takes effect when devices are statically declared viaU_BOOT_DEVICE(). This bug has been fixed recently by commit "dm: core: Respect drivers with theDM_FLAG_PRE_RELOCflag inlists_bind_fdt()", but with the fix, it has a side effect that all existing drivers that declaredDM_FLAG_PRE_RELOCflag will be bound before relocation now. This may expose potential boot failure on some boards due to insufficient memory during the pre-relocation stage.To mitigate this potential impact, the following changes are implemented:
- Remove
DM_FLAG_PRE_RELOCflag in the driver, if the driver only supports configuration from device tree (OF_CONTROL)
- KeepDM_FLAG_PRE_RELOCflag in the driver only if the device is statically declared viaU_BOOT_DEVICE()
- SurroundDM_FLAG_PRE_RELOCflag withOF_CONTROLcheck, for drivers that support both statically declared devices and configuration from device treeSigned-off-by Bin Meng <[email protected]>---
Quoted 10 lines
drivers/pinctrl/broadcom/pinctrl-bcm283x.c | 2 ++ drivers/pinctrl/exynos/pinctrl-exynos7420.c | 1 - drivers/pinctrl/nxp/pinctrl-imx5.c | 2 ++ drivers/pinctrl/nxp/pinctrl-imx6.c | 2 ++ drivers/pinctrl/nxp/pinctrl-imx7.c | 2 ++ drivers/pinctrl/nxp/pinctrl-imx7ulp.c | 2 ++ drivers/pinctrl/pinctrl-single.c | 1 - drivers/pinctrl/uniphier/pinctrl-uniphier-pro4.c | 2 ++ drivers/pinctrl/uniphier/pinctrl-uniphier-pro5.c | 2 ++ 9 files changed, 14 insertions(+), 2 deletions(-)
PATCH 6/13 pinctrl: Remove DM_FLAG_PRE_RELOC flag in various drivers
Quoted 25 lines · Bin Meng
When a driver declares
DM_FLAG_PRE_RELOCflag, it wishes to be bound before relocation. However due to a bug in the DM core, the flag only takes effect when devices are statically declared viaU_BOOT_DEVICE(). This bug has been fixed recently by commit "dm: core: Respect drivers with theDM_FLAG_PRE_RELOCflag inlists_bind_fdt()", but with the fix, it has a side effect that all existing drivers that declaredDM_FLAG_PRE_RELOCflag will be bound before relocation now. This may expose potential boot failure on some boards due to insufficient memory during the pre-relocation stage.To mitigate this potential impact, the following changes are implemented:
- Remove
DM_FLAG_PRE_RELOCflag in the driver, if the driver only supports configuration from device tree (OF_CONTROL)
- KeepDM_FLAG_PRE_RELOCflag in the driver only if the device is statically declared viaU_BOOT_DEVICE()
- SurroundDM_FLAG_PRE_RELOCflag withOF_CONTROLcheck, for drivers that support both statically declared devices and configuration from device treeSigned-off-by Bin Meng <[email protected]>---
Quoted 10 lines
drivers/pinctrl/broadcom/pinctrl-bcm283x.c | 2 ++ drivers/pinctrl/exynos/pinctrl-exynos7420.c | 1 - drivers/pinctrl/nxp/pinctrl-imx5.c | 2 ++ drivers/pinctrl/nxp/pinctrl-imx6.c | 2 ++ drivers/pinctrl/nxp/pinctrl-imx7.c | 2 ++ drivers/pinctrl/nxp/pinctrl-imx7ulp.c | 2 ++ drivers/pinctrl/pinctrl-single.c | 1 - drivers/pinctrl/uniphier/pinctrl-uniphier-pro4.c | 2 ++ drivers/pinctrl/uniphier/pinctrl-uniphier-pro5.c | 2 ++ 9 files changed, 14 insertions(+), 2 deletions(-)
Applied to u-boot-dm/master, thanks!
PATCH 7/13 ram: bmips: Remove DM_FLAG_PRE_RELOC flag
In reply to Bin MengWhen a driver declares DM_FLAG_PRE_RELOC flag, it wishes to be bound before relocation. However due to a bug in the DM core, the flag only takes effect when devices are statically declared via U_BOOT_DEVICE(). This bug has been fixed recently by commit "dm: core: Respect drivers with the DM_FLAG_PRE_RELOC flag in lists_bind_fdt()", but with the fix, it has a side effect that all existing drivers that declared DM_FLAG_PRE_RELOC flag will be bound before relocation now. This may expose potential boot failure on some boards due to insufficient memory during the pre-relocation stage.
To mitigate this potential impact, the following changes are implemented:
- Remove DM_FLAG_PRE_RELOC flag in the driver, if the driver only supports configuration from device tree (OF_CONTROL)
- Keep DM_FLAG_PRE_RELOC flag in the driver only if the device is statically declared via U_BOOT_DEVICE()
- Surround DM_FLAG_PRE_RELOC flag with OF_CONTROL check, for drivers that support both statically declared devices and configuration from device tree
---
drivers/ram/bmips_ram.c | 1 - 1 file changed, 1 deletion(-)
drivers/ram/bmips_ram.c +0 -1
@@ -173,5 +173,4 @@ U_BOOT_DRIVER(bmips_ram) = { .probe = bmips_ram_probe, .priv_auto_alloc_size = sizeof(struct bmips_ram_priv), .ops = &bmips_ram_ops, - .flags = DM_FLAG_PRE_RELOC, };
Signature · 1 line
2.7.4
PATCH 7/13 ram: bmips: Remove DM_FLAG_PRE_RELOC flag
Quoted 22 lines · Bin Meng
When a driver declares
DM_FLAG_PRE_RELOCflag, it wishes to be bound before relocation. However due to a bug in the DM core, the flag only takes effect when devices are statically declared viaU_BOOT_DEVICE(). This bug has been fixed recently by commit "dm: core: Respect drivers with theDM_FLAG_PRE_RELOCflag inlists_bind_fdt()", but with the fix, it has a side effect that all existing drivers that declaredDM_FLAG_PRE_RELOCflag will be bound before relocation now. This may expose potential boot failure on some boards due to insufficient memory during the pre-relocation stage.To mitigate this potential impact, the following changes are implemented:
- Remove
DM_FLAG_PRE_RELOCflag in the driver, if the driver only supports configuration from device tree (OF_CONTROL)
- KeepDM_FLAG_PRE_RELOCflag in the driver only if the device is statically declared viaU_BOOT_DEVICE()
- SurroundDM_FLAG_PRE_RELOCflag withOF_CONTROLcheck, for drivers that support both statically declared devices and configuration from device tree
Quoted 5 lines
Signed-off-by Bin Meng <[email protected]>---
drivers/ram/bmips_ram.c | 1 - 1 file changed, 1 deletion(-)
PATCH 7/13 ram: bmips: Remove DM_FLAG_PRE_RELOC flag
Quoted 22 lines · Bin Meng
When a driver declares
DM_FLAG_PRE_RELOCflag, it wishes to be bound before relocation. However due to a bug in the DM core, the flag only takes effect when devices are statically declared viaU_BOOT_DEVICE(). This bug has been fixed recently by commit "dm: core: Respect drivers with theDM_FLAG_PRE_RELOCflag inlists_bind_fdt()", but with the fix, it has a side effect that all existing drivers that declaredDM_FLAG_PRE_RELOCflag will be bound before relocation now. This may expose potential boot failure on some boards due to insufficient memory during the pre-relocation stage.To mitigate this potential impact, the following changes are implemented:
- Remove
DM_FLAG_PRE_RELOCflag in the driver, if the driver only supports configuration from device tree (OF_CONTROL)
- KeepDM_FLAG_PRE_RELOCflag in the driver only if the device is statically declared viaU_BOOT_DEVICE()
- SurroundDM_FLAG_PRE_RELOCflag withOF_CONTROLcheck, for drivers that support both statically declared devices and configuration from device tree
Quoted 5 lines
Signed-off-by Bin Meng <[email protected]>---
drivers/ram/bmips_ram.c | 1 - 1 file changed, 1 deletion(-)
Applied to u-boot-dm/master, thanks!
PATCH 8/13 timer: Remove DM_FLAG_PRE_RELOC flag in various drivers
In reply to Bin MengWhen a driver declares DM_FLAG_PRE_RELOC flag, it wishes to be bound before relocation. However due to a bug in the DM core, the flag only takes effect when devices are statically declared via U_BOOT_DEVICE(). This bug has been fixed recently by commit "dm: core: Respect drivers with the DM_FLAG_PRE_RELOC flag in lists_bind_fdt()", but with the fix, it has a side effect that all existing drivers that declared DM_FLAG_PRE_RELOC flag will be bound before relocation now. This may expose potential boot failure on some boards due to insufficient memory during the pre-relocation stage.
To mitigate this potential impact, the following changes are implemented:
- Remove DM_FLAG_PRE_RELOC flag in the driver, if the driver only supports configuration from device tree (OF_CONTROL)
- Keep DM_FLAG_PRE_RELOC flag in the driver only if the device is statically declared via U_BOOT_DEVICE()
- Surround DM_FLAG_PRE_RELOC flag with OF_CONTROL check, for drivers that support both statically declared devices and configuration from device tree
---
drivers/timer/ag101p_timer.c | 1 - drivers/timer/altera_timer.c | 1 - drivers/timer/arc_timer.c | 1 - drivers/timer/ast_timer.c | 1 - drivers/timer/atcpit100_timer.c | 1 - drivers/timer/atmel_pit_timer.c | 1 - drivers/timer/cadence-ttc.c | 1 - drivers/timer/dw-apb-timer.c | 1 - drivers/timer/mpc83xx_timer.c | 1 - drivers/timer/omap-timer.c | 1 - drivers/timer/rockchip_timer.c | 1 - drivers/timer/sti-timer.c | 1 - drivers/timer/stm32_timer.c | 1 - drivers/timer/tsc_timer.c | 1 - 14 files changed, 14 deletions(-)
drivers/timer/ag101p_timer.c +0 -1
@@ -115,5 +115,4 @@ U_BOOT_DRIVER(altera_timer) = { .platdata_auto_alloc_size = sizeof(struct atftmr_timer_platdata), .probe = atftmr_timer_probe, .ops = &ag101p_timer_ops, - .flags = DM_FLAG_PRE_RELOC, };
drivers/timer/altera_timer.c +0 -1
@@ -92,5 +92,4 @@ U_BOOT_DRIVER(altera_timer) = { .platdata_auto_alloc_size = sizeof(struct altera_timer_platdata), .probe = altera_timer_probe, .ops = &altera_timer_ops, - .flags = DM_FLAG_PRE_RELOC, };
drivers/timer/arc_timer.c +0 -1
@@ -107,6 +107,5 @@ U_BOOT_DRIVER(arc_timer) = { .of_match = arc_timer_ids, .probe = arc_timer_probe, .ops = &arc_timer_ops, - .flags = DM_FLAG_PRE_RELOC, .priv_auto_alloc_size = sizeof(struct arc_timer_priv), };
drivers/timer/ast_timer.c +0 -1
@@ -90,5 +90,4 @@ U_BOOT_DRIVER(ast_timer) = { .priv_auto_alloc_size = sizeof(struct ast_timer_priv), .ofdata_to_platdata = ast_timer_ofdata_to_platdata, .ops = &ast_timer_ops, - .flags = DM_FLAG_PRE_RELOC, };
drivers/timer/atcpit100_timer.c +0 -1
@@ -110,5 +110,4 @@ U_BOOT_DRIVER(atcpit100_timer) = { .platdata_auto_alloc_size = sizeof(struct atcpit_timer_platdata), .probe = atcpit_timer_probe, .ops = &atcpit_timer_ops, - .flags = DM_FLAG_PRE_RELOC, };
drivers/timer/atmel_pit_timer.c +0 -1
@@ -85,5 +85,4 @@ U_BOOT_DRIVER(atmel_pit) = { .platdata_auto_alloc_size = sizeof(struct atmel_pit_platdata), .probe = atmel_pit_probe, .ops = &atmel_pit_ops, - .flags = DM_FLAG_PRE_RELOC, };
drivers/timer/cadence-ttc.c +0 -1
@@ -111,5 +111,4 @@ U_BOOT_DRIVER(cadence_ttc) = { .priv_auto_alloc_size = sizeof(struct cadence_ttc_priv), .probe = cadence_ttc_probe, .ops = &cadence_ttc_ops, - .flags = DM_FLAG_PRE_RELOC, };
drivers/timer/dw-apb-timer.c +0 -1
@@ -83,7 +83,6 @@ U_BOOT_DRIVER(dw_apb_timer) = { .id = UCLASS_TIMER, .ops = &dw_apb_timer_ops, .probe = dw_apb_timer_probe, - .flags = DM_FLAG_PRE_RELOC, .of_match = dw_apb_timer_ids, .ofdata_to_platdata = dw_apb_timer_ofdata_to_platdata, .priv_auto_alloc_size = sizeof(struct dw_apb_timer_priv),
drivers/timer/mpc83xx_timer.c +0 -1
@@ -244,6 +244,5 @@ U_BOOT_DRIVER(mpc83xx_timer) = { .of_match = mpc83xx_timer_ids, .probe = mpc83xx_timer_probe, .ops = &mpc83xx_timer_ops, - .flags = DM_FLAG_PRE_RELOC, .priv_auto_alloc_size = sizeof(struct mpc83xx_timer_priv), };
drivers/timer/omap-timer.c +0 -1
@@ -104,5 +104,4 @@ U_BOOT_DRIVER(omap_timer) = { .priv_auto_alloc_size = sizeof(struct omap_timer_priv), .probe = omap_timer_probe, .ops = &omap_timer_ops, - .flags = DM_FLAG_PRE_RELOC, };
drivers/timer/rockchip_timer.c +0 -1
@@ -163,7 +163,6 @@ U_BOOT_DRIVER(rockchip_rk3368_timer) = { .of_match = rockchip_timer_ids, .probe = rockchip_timer_probe, .ops = &rockchip_timer_ops, - .flags = DM_FLAG_PRE_RELOC, .priv_auto_alloc_size =sizeof (struct rockchip_timer_priv ), #if CONFIG_IS_ENABLED(OF_PLATDATA) .platdata_auto_alloc_size = sizeof(struct rockchip_timer_plat),
drivers/timer/sti-timer.c +0 -1
@@ -74,5 +74,4 @@ U_BOOT_DRIVER(sti_timer) = { .priv_auto_alloc_size = sizeof(struct sti_timer_priv), .probe = sti_timer_probe, .ops = &sti_timer_ops, - .flags = DM_FLAG_PRE_RELOC, };
drivers/timer/stm32_timer.c +0 -1
@@ -132,6 +132,5 @@ U_BOOT_DRIVER(stm32_timer) = { .priv_auto_alloc_size = sizeof(struct stm32_timer_priv), .probe = stm32_timer_probe, .ops = &stm32_timer_ops, - .flags = DM_FLAG_PRE_RELOC, };
drivers/timer/tsc_timer.c +0 -1
@@ -424,5 +424,4 @@ U_BOOT_DRIVER(tsc_timer) = { .of_match = tsc_timer_ids, .probe = tsc_timer_probe, .ops = &tsc_timer_ops, - .flags = DM_FLAG_PRE_RELOC, };
Signature · 1 line
2.7.4
PATCH 8/13 timer: Remove DM_FLAG_PRE_RELOC flag in various drivers
Quoted 25 lines · Bin Meng
When a driver declares
DM_FLAG_PRE_RELOCflag, it wishes to be bound before relocation. However due to a bug in the DM core, the flag only takes effect when devices are statically declared viaU_BOOT_DEVICE(). This bug has been fixed recently by commit "dm: core: Respect drivers with theDM_FLAG_PRE_RELOCflag inlists_bind_fdt()", but with the fix, it has a side effect that all existing drivers that declaredDM_FLAG_PRE_RELOCflag will be bound before relocation now. This may expose potential boot failure on some boards due to insufficient memory during the pre-relocation stage.To mitigate this potential impact, the following changes are implemented:
- Remove
DM_FLAG_PRE_RELOCflag in the driver, if the driver only supports configuration from device tree (OF_CONTROL)
- KeepDM_FLAG_PRE_RELOCflag in the driver only if the device is statically declared viaU_BOOT_DEVICE()
- SurroundDM_FLAG_PRE_RELOCflag withOF_CONTROLcheck, for drivers that support both statically declared devices and configuration from device treeSigned-off-by Bin Meng <[email protected]>---
Quoted 16 lines
drivers/timer/ag101p_timer.c | 1 - drivers/timer/altera_timer.c | 1 - drivers/timer/arc_timer.c | 1 - drivers/timer/ast_timer.c | 1 - drivers/timer/atcpit100_timer.c | 1 - drivers/timer/atmel_pit_timer.c | 1 - drivers/timer/cadence-ttc.c | 1 - drivers/timer/dw-apb-timer.c | 1 - drivers/timer/mpc83xx_timer.c | 1 - drivers/timer/omap-timer.c | 1 - drivers/timer/rockchip_timer.c | 1 - drivers/timer/sti-timer.c | 1 - drivers/timer/stm32_timer.c | 1 - drivers/timer/tsc_timer.c | 1 - 14 files changed, 14 deletions(-)
PATCH 8/13 timer: Remove DM_FLAG_PRE_RELOC flag in various drivers
Quoted 25 lines · Bin Meng
When a driver declares
DM_FLAG_PRE_RELOCflag, it wishes to be bound before relocation. However due to a bug in the DM core, the flag only takes effect when devices are statically declared viaU_BOOT_DEVICE(). This bug has been fixed recently by commit "dm: core: Respect drivers with theDM_FLAG_PRE_RELOCflag inlists_bind_fdt()", but with the fix, it has a side effect that all existing drivers that declaredDM_FLAG_PRE_RELOCflag will be bound before relocation now. This may expose potential boot failure on some boards due to insufficient memory during the pre-relocation stage.To mitigate this potential impact, the following changes are implemented:
- Remove
DM_FLAG_PRE_RELOCflag in the driver, if the driver only supports configuration from device tree (OF_CONTROL)
- KeepDM_FLAG_PRE_RELOCflag in the driver only if the device is statically declared viaU_BOOT_DEVICE()
- SurroundDM_FLAG_PRE_RELOCflag withOF_CONTROLcheck, for drivers that support both statically declared devices and configuration from device treeSigned-off-by Bin Meng <[email protected]>---
Quoted 16 lines
drivers/timer/ag101p_timer.c | 1 - drivers/timer/altera_timer.c | 1 - drivers/timer/arc_timer.c | 1 - drivers/timer/ast_timer.c | 1 - drivers/timer/atcpit100_timer.c | 1 - drivers/timer/atmel_pit_timer.c | 1 - drivers/timer/cadence-ttc.c | 1 - drivers/timer/dw-apb-timer.c | 1 - drivers/timer/mpc83xx_timer.c | 1 - drivers/timer/omap-timer.c | 1 - drivers/timer/rockchip_timer.c | 1 - drivers/timer/sti-timer.c | 1 - drivers/timer/stm32_timer.c | 1 - drivers/timer/tsc_timer.c | 1 - 14 files changed, 14 deletions(-)
Applied to u-boot-dm/master, thanks!
PATCH 9/13 serial: Remove DM_FLAG_PRE_RELOC flag in various drivers
In reply to Bin MengWhen a driver declares DM_FLAG_PRE_RELOC flag, it wishes to be bound before relocation. However due to a bug in the DM core, the flag only takes effect when devices are statically declared via U_BOOT_DEVICE(). This bug has been fixed recently by commit "dm: core: Respect drivers with the DM_FLAG_PRE_RELOC flag in lists_bind_fdt()", but with the fix, it has a side effect that all existing drivers that declared DM_FLAG_PRE_RELOC flag will be bound before relocation now. This may expose potential boot failure on some boards due to insufficient memory during the pre-relocation stage.
To mitigate this potential impact, the following changes are implemented:
- Remove DM_FLAG_PRE_RELOC flag in the driver, if the driver only supports configuration from device tree (OF_CONTROL)
- Keep DM_FLAG_PRE_RELOC flag in the driver only if the device is statically declared via U_BOOT_DEVICE()
- Surround DM_FLAG_PRE_RELOC flag with OF_CONTROL check, for drivers that support both statically declared devices and configuration from device tree
---
drivers/serial/altera_jtag_uart.c | 1 - drivers/serial/altera_uart.c | 1 - drivers/serial/arm_dcc.c | 1 - drivers/serial/atmel_usart.c | 2 ++ drivers/serial/ns16550.c | 2 ++ drivers/serial/serial_ar933x.c | 1 - drivers/serial/serial_arc.c | 1 - drivers/serial/serial_bcm283x_mu.c | 2 ++ drivers/serial/serial_bcm283x_pl011.c | 2 ++ drivers/serial/serial_bcm6345.c | 1 - drivers/serial/serial_efi.c | 1 - drivers/serial/serial_intel_mid.c | 1 - drivers/serial/serial_lpuart.c | 1 - drivers/serial/serial_meson.c | 1 - drivers/serial/serial_mvebu_a3700.c | 1 - drivers/serial/serial_mxc.c | 2 ++ drivers/serial/serial_omap.c | 2 ++ drivers/serial/serial_owl.c | 1 - drivers/serial/serial_pic32.c | 1 - drivers/serial/serial_pl01x.c | 2 ++ drivers/serial/serial_s5p.c | 1 - drivers/serial/serial_sh.c | 2 ++ drivers/serial/serial_sti_asc.c | 1 - drivers/serial/serial_stm32.c | 2 ++ drivers/serial/serial_xuartlite.c | 1 - drivers/serial/serial_zynq.c | 1 - 26 files changed, 18 insertions(+), 17 deletions(-)
drivers/serial/altera_jtag_uart.c +0 -1
@@ -121,7 +121,6 @@ U_BOOT_DRIVER(altera_jtaguart) = { .platdata_auto_alloc_size = sizeof(struct altera_jtaguart_platdata), .probe = altera_jtaguart_probe, .ops = &altera_jtaguart_ops, - .flags = DM_FLAG_PRE_RELOC, };#ifdef CONFIG_DEBUG_UART_ALTERA_JTAGUART
drivers/serial/altera_uart.c +0 -1
@@ -117,7 +117,6 @@ U_BOOT_DRIVER(altera_uart) = { .platdata_auto_alloc_size = sizeof(struct altera_uart_platdata), .probe = altera_uart_probe, .ops = &altera_uart_ops, - .flags = DM_FLAG_PRE_RELOC, };#ifdef CONFIG_DEBUG_UART_ALTERA_UART
drivers/serial/arm_dcc.c +0 -1
@@ -155,7 +155,6 @@ U_BOOT_DRIVER(serial_dcc) = { .id = UCLASS_SERIAL, .of_match = arm_dcc_ids, .ops = &arm_dcc_ops, - .flags = DM_FLAG_PRE_RELOC, };#ifdef CONFIG_DEBUG_UART_ARM_DCC
drivers/serial/atmel_usart.c +2 -0
@@ -294,7 +294,9 @@ U_BOOT_DRIVER(serial_atmel) = {#endif .probe = atmel_serial_probe, .ops = &atmel_serial_ops, +#if !CONFIG_IS_ENABLED (OF_CONTROL ) .flags = DM_FLAG_PRE_RELOC, +#endif .priv_auto_alloc_size = sizeof(struct atmel_serial_priv), };#endif
drivers/serial/ns16550.c +2 -0
@@ -473,7 +473,9 @@ U_BOOT_DRIVER(ns16550_serial) = { .priv_auto_alloc_size = sizeof(struct NS16550), .probe = ns16550_serial_probe, .ops = &ns16550_serial_ops, +#if !CONFIG_IS_ENABLED (OF_CONTROL ) .flags = DM_FLAG_PRE_RELOC, +#endif };#endif #endif /* SERIAL_PRESENT */
drivers/serial/serial_ar933x.c +0 -1
@@ -189,7 +189,6 @@ U_BOOT_DRIVER(serial_ar933x) = { .priv_auto_alloc_size = sizeof(struct ar933x_serial_priv), .probe = ar933x_serial_probe, .ops = &ar933x_serial_ops, - .flags = DM_FLAG_PRE_RELOC, };#ifdef CONFIG_DEBUG_UART_AR933X
drivers/serial/serial_arc.c +0 -1
@@ -128,7 +128,6 @@ U_BOOT_DRIVER(serial_arc) = { .ofdata_to_platdata = arc_serial_ofdata_to_platdata, .probe = arc_serial_probe, .ops = &arc_serial_ops, - .flags = DM_FLAG_PRE_RELOC, };#ifdef CONFIG_DEBUG_ARC_SERIAL
drivers/serial/serial_bcm283x_mu.c +2 -0
@@ -199,6 +199,8 @@ U_BOOT_DRIVER(serial_bcm283x_mu) = { .platdata_auto_alloc_size = sizeof(struct bcm283x_mu_serial_platdata), .probe = bcm283x_mu_serial_probe, .ops = &bcm283x_mu_serial_ops, +#if !CONFIG_IS_ENABLED(OF_CONTROL) .flags = DM_FLAG_PRE_RELOC, +#endif .priv_auto_alloc_size = sizeof(struct bcm283x_mu_priv), };
drivers/serial/serial_bcm283x_pl011.c +2 -0
@@ -90,6 +90,8 @@ U_BOOT_DRIVER(bcm283x_pl011_uart) = { .platdata_auto_alloc_size = sizeof(struct pl01x_serial_platdata), .probe = pl01x_serial_probe, .ops = &bcm283x_pl011_serial_ops, +#if !CONFIG_IS_ENABLED(OF_CONTROL) .flags = DM_FLAG_PRE_RELOC, +#endif .priv_auto_alloc_size = sizeof(struct pl01x_priv), };
drivers/serial/serial_bcm6345.c +0 -1
@@ -264,7 +264,6 @@ U_BOOT_DRIVER(bcm6345_serial) = { .probe = bcm6345_serial_probe, .priv_auto_alloc_size = sizeof(struct bcm6345_serial_priv), .ops = &bcm6345_serial_ops, - .flags = DM_FLAG_PRE_RELOC, };#ifdef CONFIG_DEBUG_UART_BCM6345
drivers/serial/serial_efi.c +0 -1
@@ -152,5 +152,4 @@ U_BOOT_DRIVER(serial_efi) = { .priv_auto_alloc_size = sizeof(struct serial_efi_priv), .probe = serial_efi_probe, .ops = &serial_efi_ops, - .flags = DM_FLAG_PRE_RELOC, };
drivers/serial/serial_intel_mid.c +0 -1
@@ -64,5 +64,4 @@ U_BOOT_DRIVER(serial_intel_mid) = { .priv_auto_alloc_size = sizeof(struct NS16550), .probe = mid_serial_probe, .ops = &ns16550_serial_ops, - .flags = DM_FLAG_PRE_RELOC, };
drivers/serial/serial_lpuart.c +0 -1
@@ -455,5 +455,4 @@ U_BOOT_DRIVER(serial_lpuart) = { .platdata_auto_alloc_size = sizeof(struct lpuart_serial_platdata), .probe = lpuart_serial_probe, .ops = &lpuart_serial_ops, - .flags = DM_FLAG_PRE_RELOC, };
drivers/serial/serial_meson.c +0 -1
@@ -132,7 +132,6 @@ U_BOOT_DRIVER(serial_meson) = { .of_match = meson_serial_ids, .probe = meson_serial_probe, .ops = &meson_serial_ops, - .flags = DM_FLAG_PRE_RELOC, .ofdata_to_platdata = meson_serial_ofdata_to_platdata, .platdata_auto_alloc_size = sizeof(struct meson_serial_platdata), };
drivers/serial/serial_mvebu_a3700.c +0 -1
@@ -129,7 +129,6 @@ U_BOOT_DRIVER(serial_mvebu) = { .platdata_auto_alloc_size = sizeof(struct mvebu_platdata), .probe = mvebu_serial_probe, .ops = &mvebu_serial_ops, - .flags = DM_FLAG_PRE_RELOC, };#ifdef CONFIG_DEBUG_MVEBU_A3700_UART
drivers/serial/serial_mxc.c +2 -0
@@ -353,7 +353,9 @@ U_BOOT_DRIVER(serial_mxc) = {#endif .probe = mxc_serial_probe, .ops = &mxc_serial_ops, +#if !CONFIG_IS_ENABLED (OF_CONTROL ) .flags = DM_FLAG_PRE_RELOC, +#endif };#endif
drivers/serial/serial_omap.c +2 -0
@@ -121,7 +121,9 @@ U_BOOT_DRIVER(omap_serial) = { .priv_auto_alloc_size = sizeof(struct NS16550), .probe = ns16550_serial_probe, .ops = &ns16550_serial_ops, +#if !CONFIG_IS_ENABLED (OF_CONTROL ) .flags = DM_FLAG_PRE_RELOC, +#endif };#endif #endif /* DM_SERIAL */
drivers/serial/serial_owl.c +0 -1
@@ -132,5 +132,4 @@ U_BOOT_DRIVER(serial_owl) = { .priv_auto_alloc_size = sizeof(struct owl_serial_priv), .probe = owl_serial_probe, .ops = &owl_serial_ops, - .flags = DM_FLAG_PRE_RELOC, };
drivers/serial/serial_pic32.c +0 -1
@@ -176,7 +176,6 @@ U_BOOT_DRIVER(pic32_serial) = { .of_match = pic32_uart_ids, .probe = pic32_uart_probe, .ops = &pic32_uart_ops, - .flags = DM_FLAG_PRE_RELOC, .priv_auto_alloc_size = sizeof(struct pic32_uart_priv), };
drivers/serial/serial_pl01x.c +2 -0
@@ -363,7 +363,9 @@ U_BOOT_DRIVER(serial_pl01x) = { .platdata_auto_alloc_size = sizeof(struct pl01x_serial_platdata), .probe = pl01x_serial_probe, .ops = &pl01x_serial_ops, +#if !CONFIG_IS_ENABLED(OF_CONTROL) .flags = DM_FLAG_PRE_RELOC, +#endif .priv_auto_alloc_size = sizeof(struct pl01x_priv), };
drivers/serial/serial_s5p.c +0 -1
@@ -211,7 +211,6 @@ U_BOOT_DRIVER(serial_s5p) = { .platdata_auto_alloc_size = sizeof(struct s5p_serial_platdata), .probe = s5p_serial_probe, .ops = &s5p_serial_ops, - .flags = DM_FLAG_PRE_RELOC, };#endif
drivers/serial/serial_sh.c +2 -0
@@ -247,7 +247,9 @@ U_BOOT_DRIVER(serial_sh) = { .platdata_auto_alloc_size = sizeof(struct sh_serial_platdata), .probe = sh_serial_probe, .ops = &sh_serial_ops, +#if !CONFIG_IS_ENABLED(OF_CONTROL) .flags = DM_FLAG_PRE_RELOC, +#endif .priv_auto_alloc_size = sizeof(struct uart_port), };
drivers/serial/serial_sti_asc.c +0 -1
@@ -205,6 +205,5 @@ U_BOOT_DRIVER(serial_sti_asc) = { .ops = &sti_asc_serial_ops, .probe = sti_asc_serial_probe, .priv_auto_alloc_size = sizeof(struct sti_asc_serial), - .flags = DM_FLAG_PRE_RELOC, };
drivers/serial/serial_stm32.c +2 -0
@@ -230,7 +230,9 @@ U_BOOT_DRIVER(serial_stm32) = { .platdata_auto_alloc_size = sizeof(struct stm32x7_serial_platdata), .ops = &stm32_serial_ops, .probe = stm32_serial_probe, +#if !CONFIG_IS_ENABLED (OF_CONTROL ) .flags = DM_FLAG_PRE_RELOC, +#endif };#ifdef CONFIG_DEBUG_UART_STM32
drivers/serial/serial_xuartlite.c +0 -1
@@ -109,7 +109,6 @@ U_BOOT_DRIVER(serial_uartlite) = { .platdata_auto_alloc_size = sizeof(struct uartlite_platdata), .probe = uartlite_serial_probe, .ops = &uartlite_serial_ops, - .flags = DM_FLAG_PRE_RELOC, };#ifdef CONFIG_DEBUG_UART_UARTLITE
drivers/serial/serial_zynq.c +0 -1
@@ -210,7 +210,6 @@ U_BOOT_DRIVER(serial_zynq) = { .platdata_auto_alloc_size = sizeof(struct zynq_uart_platdata), .probe = zynq_serial_probe, .ops = &zynq_serial_ops, - .flags = DM_FLAG_PRE_RELOC, };#ifdef CONFIG_DEBUG_UART_ZYNQ
Signature · 1 line
2.7.4
PATCH 9/13 serial: Remove DM_FLAG_PRE_RELOC flag in various drivers
Quoted 44 lines · Bin Meng
When a driver declares
DM_FLAG_PRE_RELOCflag, it wishes to be bound before relocation. However due to a bug in the DM core, the flag only takes effect when devices are statically declared viaU_BOOT_DEVICE(). This bug has been fixed recently by commit "dm: core: Respect drivers with theDM_FLAG_PRE_RELOCflag inlists_bind_fdt()", but with the fix, it has a side effect that all existing drivers that declaredDM_FLAG_PRE_RELOCflag will be bound before relocation now. This may expose potential boot failure on some boards due to insufficient memory during the pre-relocation stage.To mitigate this potential impact, the following changes are implemented:
- Remove
DM_FLAG_PRE_RELOCflag in the driver, if the driver only supports configuration from device tree (OF_CONTROL)
- KeepDM_FLAG_PRE_RELOCflag in the driver only if the device is statically declared viaU_BOOT_DEVICE()
- SurroundDM_FLAG_PRE_RELOCflag withOF_CONTROLcheck, for drivers that support both statically declared devices and configuration from device treeSigned-off-by Bin Meng <[email protected]>---
drivers/serial/altera_jtag_uart.c | 1 - drivers/serial/altera_uart.c | 1 - drivers/serial/arm_dcc.c | 1 - drivers/serial/atmel_usart.c | 2 ++ drivers/serial/ns16550.c | 2 ++ drivers/serial/serial_ar933x.c | 1 - drivers/serial/serial_arc.c | 1 - drivers/serial/serial_bcm283x_mu.c | 2 ++ drivers/serial/serial_bcm283x_pl011.c | 2 ++ drivers/serial/serial_bcm6345.c | 1 - drivers/serial/serial_efi.c | 1 - drivers/serial/serial_intel_mid.c | 1 - drivers/serial/serial_lpuart.c | 1 - drivers/serial/serial_meson.c | 1 - drivers/serial/serial_mvebu_a3700.c | 1 - drivers/serial/serial_mxc.c | 2 ++ drivers/serial/serial_omap.c | 2 ++ drivers/serial/serial_owl.c | 1 - drivers/serial/serial_pic32.c | 1 -
Quoted 9 lines
drivers/serial/serial_pl01x.c | 2 ++ drivers/serial/serial_s5p.c | 1 - drivers/serial/serial_sh.c | 2 ++ drivers/serial/serial_sti_asc.c | 1 - drivers/serial/serial_stm32.c | 2 ++ drivers/serial/serial_xuartlite.c | 1 - drivers/serial/serial_zynq.c | 1 - 26 files changed, 18 insertions(+), 17 deletions(-)
PATCH 9/13 serial: Remove DM_FLAG_PRE_RELOC flag in various drivers
Quoted 44 lines · Bin Meng
When a driver declares
DM_FLAG_PRE_RELOCflag, it wishes to be bound before relocation. However due to a bug in the DM core, the flag only takes effect when devices are statically declared viaU_BOOT_DEVICE(). This bug has been fixed recently by commit "dm: core: Respect drivers with theDM_FLAG_PRE_RELOCflag inlists_bind_fdt()", but with the fix, it has a side effect that all existing drivers that declaredDM_FLAG_PRE_RELOCflag will be bound before relocation now. This may expose potential boot failure on some boards due to insufficient memory during the pre-relocation stage.To mitigate this potential impact, the following changes are implemented:
- Remove
DM_FLAG_PRE_RELOCflag in the driver, if the driver only supports configuration from device tree (OF_CONTROL)
- KeepDM_FLAG_PRE_RELOCflag in the driver only if the device is statically declared viaU_BOOT_DEVICE()
- SurroundDM_FLAG_PRE_RELOCflag withOF_CONTROLcheck, for drivers that support both statically declared devices and configuration from device treeSigned-off-by Bin Meng <[email protected]>---
drivers/serial/altera_jtag_uart.c | 1 - drivers/serial/altera_uart.c | 1 - drivers/serial/arm_dcc.c | 1 - drivers/serial/atmel_usart.c | 2 ++ drivers/serial/ns16550.c | 2 ++ drivers/serial/serial_ar933x.c | 1 - drivers/serial/serial_arc.c | 1 - drivers/serial/serial_bcm283x_mu.c | 2 ++ drivers/serial/serial_bcm283x_pl011.c | 2 ++ drivers/serial/serial_bcm6345.c | 1 - drivers/serial/serial_efi.c | 1 - drivers/serial/serial_intel_mid.c | 1 - drivers/serial/serial_lpuart.c | 1 - drivers/serial/serial_meson.c | 1 - drivers/serial/serial_mvebu_a3700.c | 1 - drivers/serial/serial_mxc.c | 2 ++ drivers/serial/serial_omap.c | 2 ++ drivers/serial/serial_owl.c | 1 - drivers/serial/serial_pic32.c | 1 -
Quoted 9 lines
drivers/serial/serial_pl01x.c | 2 ++ drivers/serial/serial_s5p.c | 1 - drivers/serial/serial_sh.c | 2 ++ drivers/serial/serial_sti_asc.c | 1 - drivers/serial/serial_stm32.c | 2 ++ drivers/serial/serial_xuartlite.c | 1 - drivers/serial/serial_zynq.c | 1 - 26 files changed, 18 insertions(+), 17 deletions(-)
Applied to u-boot-dm/master, thanks!
PATCH 9/13 serial: Remove DM_FLAG_PRE_RELOC flag in various drivers
In reply to Bin MengHi Bin,
This particular commit leads to a constant Poplar board restart (git bisect pointed to it).
U-boot is built with the default poplar_config from the latest master (btw, is uses r), and U-boot is used as default BL33 image (setup:
vanilla ATF + vanilla OP-TEE(BL32, S-EL1 payload) + U-boot).
When BL32 (OP-TEE) tries to make a switch to non-secure bootloader, it leads to restart (I'll compile ATF with verbose output and send you more details if there are any):
=====================================
I/TC: OP-TEE version: 3.3.0-110-g7309438-dev #1 понеділок, 10 грудня 2018 12:53:15 +0000 aarch64
D/TC:0 0 check_ta_store:529 TA store: "early TA"
D/TC:0 0 check_ta_store:529 TA store: "Secure Storage TA"
D/TC:0 0 check_ta_store:529 TA store: "REE"
D/TC:0 0 early_ta_init:225 Early TA 023f8f1a-292a-432b-8fc4-de8471358067 size 21735 (compressed, uncompressed 99680)
D/TC:0 0 mobj_mapped_shm_init:709 Shared memory address range: 4000000, 6000000 I/TC: Initialized
D/TC:0 0 init_primary_helper:1033 Primary CPU switching to normal world boot
Bootrom start
Boot Media: eMMC
Entry usb bootstrap
USB: Recv CC:4
Usb disk(1):
====================================
btw, for Poplar board serial_pl01x driver is used.
Could you please provide (I just started digging into your patch series) your ideas why it can happen?
Thanks
Quoted 380 lines · Bin Meng
When a driver declares
DM_FLAG_PRE_RELOCflag, it wishes to be bound before relocation. However due to a bug in the DM core, the flag only takes effect when devices are statically declared viaU_BOOT_DEVICE(). This bug has been fixed recently by commit "dm: core: Respect drivers with theDM_FLAG_PRE_RELOCflag inlists_bind_fdt()", but with the fix, it has a side effect that all existing drivers that declaredDM_FLAG_PRE_RELOCflag will be bound before relocation now. This may expose potential boot failure on some boards due to insufficient memory during the pre-relocation stage.To mitigate this potential impact, the following changes are implemented:
- Remove
DM_FLAG_PRE_RELOCflag in the driver, if the driver only supports configuration from device tree (OF_CONTROL)
- KeepDM_FLAG_PRE_RELOCflag in the driver only if the device is statically declared viaU_BOOT_DEVICE()
- SurroundDM_FLAG_PRE_RELOCflag withOF_CONTROLcheck, for drivers that support both statically declared devices and configuration from device treeSigned-off-by Bin Meng <[email protected]>---
drivers/serial/altera_jtag_uart.c | 1 - drivers/serial/altera_uart.c | 1 - drivers/serial/arm_dcc.c | 1 - drivers/serial/atmel_usart.c | 2 ++ drivers/serial/ns16550.c | 2 ++ drivers/serial/serial_ar933x.c | 1 - drivers/serial/serial_arc.c | 1 - drivers/serial/serial_bcm283x_mu.c | 2 ++ drivers/serial/serial_bcm283x_pl011.c | 2 ++ drivers/serial/serial_bcm6345.c | 1 - drivers/serial/serial_efi.c | 1 - drivers/serial/serial_intel_mid.c | 1 - drivers/serial/serial_lpuart.c | 1 - drivers/serial/serial_meson.c | 1 - drivers/serial/serial_mvebu_a3700.c | 1 - drivers/serial/serial_mxc.c | 2 ++ drivers/serial/serial_omap.c | 2 ++ drivers/serial/serial_owl.c | 1 - drivers/serial/serial_pic32.c | 1 - drivers/serial/serial_pl01x.c | 2 ++ drivers/serial/serial_s5p.c | 1 - drivers/serial/serial_sh.c | 2 ++ drivers/serial/serial_sti_asc.c | 1 - drivers/serial/serial_stm32.c | 2 ++ drivers/serial/serial_xuartlite.c | 1 - drivers/serial/serial_zynq.c | 1 - 26 files changed, 18 insertions(+), 17 deletions(-)drivers/serial/altera_jtag_uart.c +0
-1@@ -121,7 +121,6 @@ U_BOOT_DRIVER(altera_jtaguart) = { .platdata_auto_alloc_size = sizeof(struct altera_jtaguart_platdata), .probe = altera_jtaguart_probe, .ops = &altera_jtaguart_ops, - .flags = DM_FLAG_PRE_RELOC, };#ifdef CONFIG_DEBUG_UART_ALTERA_JTAGUART drivers/serial/altera_uart.c +0
-1@@ -117,7 +117,6 @@ U_BOOT_DRIVER(altera_uart) = { .platdata_auto_alloc_size = sizeof(struct altera_uart_platdata), .probe = altera_uart_probe, .ops = &altera_uart_ops, - .flags = DM_FLAG_PRE_RELOC, };#ifdef CONFIG_DEBUG_UART_ALTERA_UART drivers/serial/arm_dcc.c +0
-1@@ -155,7 +155,6 @@ U_BOOT_DRIVER(serial_dcc) = { .id = UCLASS_SERIAL, .of_match = arm_dcc_ids, .ops = &arm_dcc_ops, - .flags = DM_FLAG_PRE_RELOC, };#ifdef CONFIG_DEBUG_UART_ARM_DCC drivers/serial/atmel_usart.c +2
-0@@ -294,7 +294,9 @@ U_BOOT_DRIVER(serial_atmel) = {#endif .probe = atmel_serial_probe, .ops = &atmel_serial_ops, +#if !CONFIG_IS_ENABLED (OF_CONTROL ) .flags = DM_FLAG_PRE_RELOC, +#endif .priv_auto_alloc_size = sizeof(struct atmel_serial_priv), };#endif drivers/serial/ns16550.c +2
-0@@ -473,7 +473,9 @@ U_BOOT_DRIVER(ns16550_serial) = { .priv_auto_alloc_size = sizeof(struct NS16550), .probe = ns16550_serial_probe, .ops = &ns16550_serial_ops, +#if !CONFIG_IS_ENABLED (OF_CONTROL ) .flags = DM_FLAG_PRE_RELOC, +#endif };#endif #endif /* SERIAL_PRESENT */ drivers/serial/serial_ar933x.c +0
-1@@ -189,7 +189,6 @@ U_BOOT_DRIVER(serial_ar933x) = { .priv_auto_alloc_size = sizeof(struct ar933x_serial_priv), .probe = ar933x_serial_probe, .ops = &ar933x_serial_ops, - .flags = DM_FLAG_PRE_RELOC, };#ifdef CONFIG_DEBUG_UART_AR933X drivers/serial/serial_arc.c +0
-1@@ -128,7 +128,6 @@ U_BOOT_DRIVER(serial_arc) = { .ofdata_to_platdata = arc_serial_ofdata_to_platdata, .probe = arc_serial_probe, .ops = &arc_serial_ops, - .flags = DM_FLAG_PRE_RELOC, };#ifdef CONFIG_DEBUG_ARC_SERIAL drivers/serial/serial_bcm283x_mu.c +2
-0@@ -199,6 +199,8 @@ U_BOOT_DRIVER(serial_bcm283x_mu) = { .platdata_auto_alloc_size = sizeof(struct bcm283x_mu_serial_platdata), .probe = bcm283x_mu_serial_probe, .ops = &bcm283x_mu_serial_ops, +#if !CONFIG_IS_ENABLED(OF_CONTROL) .flags = DM_FLAG_PRE_RELOC, +#endif .priv_auto_alloc_size = sizeof(struct bcm283x_mu_priv), };drivers/serial/serial_bcm283x_pl011.c +2
-0@@ -90,6 +90,8 @@ U_BOOT_DRIVER(bcm283x_pl011_uart) = { .platdata_auto_alloc_size = sizeof(struct pl01x_serial_platdata), .probe = pl01x_serial_probe, .ops = &bcm283x_pl011_serial_ops, +#if !CONFIG_IS_ENABLED(OF_CONTROL) .flags = DM_FLAG_PRE_RELOC, +#endif .priv_auto_alloc_size = sizeof(struct pl01x_priv), };drivers/serial/serial_bcm6345.c +0
-1@@ -264,7 +264,6 @@ U_BOOT_DRIVER(bcm6345_serial) = { .probe = bcm6345_serial_probe, .priv_auto_alloc_size = sizeof(struct bcm6345_serial_priv), .ops = &bcm6345_serial_ops, - .flags = DM_FLAG_PRE_RELOC, };#ifdef CONFIG_DEBUG_UART_BCM6345 drivers/serial/serial_efi.c +0
-1@@ -152,5 +152,4 @@ U_BOOT_DRIVER(serial_efi) = { .priv_auto_alloc_size = sizeof(struct serial_efi_priv), .probe = serial_efi_probe, .ops = &serial_efi_ops, - .flags = DM_FLAG_PRE_RELOC, };drivers/serial/serial_intel_mid.c +0
-1@@ -64,5 +64,4 @@ U_BOOT_DRIVER(serial_intel_mid) = { .priv_auto_alloc_size = sizeof(struct NS16550), .probe = mid_serial_probe, .ops = &ns16550_serial_ops, - .flags = DM_FLAG_PRE_RELOC, };drivers/serial/serial_lpuart.c +0
-1@@ -455,5 +455,4 @@ U_BOOT_DRIVER(serial_lpuart) = { .platdata_auto_alloc_size = sizeof(struct lpuart_serial_platdata), .probe = lpuart_serial_probe, .ops = &lpuart_serial_ops, - .flags = DM_FLAG_PRE_RELOC, };drivers/serial/serial_meson.c +0
-1@@ -132,7 +132,6 @@ U_BOOT_DRIVER(serial_meson) = { .of_match = meson_serial_ids, .probe = meson_serial_probe, .ops = &meson_serial_ops, - .flags = DM_FLAG_PRE_RELOC, .ofdata_to_platdata = meson_serial_ofdata_to_platdata, .platdata_auto_alloc_size = sizeof(struct meson_serial_platdata), };drivers/serial/serial_mvebu_a3700.c +0
-1@@ -129,7 +129,6 @@ U_BOOT_DRIVER(serial_mvebu) = { .platdata_auto_alloc_size = sizeof(struct mvebu_platdata), .probe = mvebu_serial_probe, .ops = &mvebu_serial_ops, - .flags = DM_FLAG_PRE_RELOC, };#ifdef CONFIG_DEBUG_MVEBU_A3700_UART drivers/serial/serial_mxc.c +2
-0@@ -353,7 +353,9 @@ U_BOOT_DRIVER(serial_mxc) = {#endif .probe = mxc_serial_probe, .ops = &mxc_serial_ops, +#if !CONFIG_IS_ENABLED (OF_CONTROL ) .flags = DM_FLAG_PRE_RELOC, +#endif };#endif drivers/serial/serial_omap.c +2
-0@@ -121,7 +121,9 @@ U_BOOT_DRIVER(omap_serial) = { .priv_auto_alloc_size = sizeof(struct NS16550), .probe = ns16550_serial_probe, .ops = &ns16550_serial_ops, +#if !CONFIG_IS_ENABLED (OF_CONTROL ) .flags = DM_FLAG_PRE_RELOC, +#endif };#endif #endif /* DM_SERIAL */ drivers/serial/serial_owl.c +0
-1@@ -132,5 +132,4 @@ U_BOOT_DRIVER(serial_owl) = { .priv_auto_alloc_size = sizeof(struct owl_serial_priv), .probe = owl_serial_probe, .ops = &owl_serial_ops, - .flags = DM_FLAG_PRE_RELOC, };drivers/serial/serial_pic32.c +0
-1@@ -176,7 +176,6 @@ U_BOOT_DRIVER(pic32_serial) = { .of_match = pic32_uart_ids, .probe = pic32_uart_probe, .ops = &pic32_uart_ops, - .flags = DM_FLAG_PRE_RELOC, .priv_auto_alloc_size = sizeof(struct pic32_uart_priv), };drivers/serial/serial_pl01x.c +2
-0@@ -363,7 +363,9 @@ U_BOOT_DRIVER(serial_pl01x) = { .platdata_auto_alloc_size = sizeof(struct pl01x_serial_platdata), .probe = pl01x_serial_probe, .ops = &pl01x_serial_ops, +#if !CONFIG_IS_ENABLED(OF_CONTROL) .flags = DM_FLAG_PRE_RELOC, +#endif .priv_auto_alloc_size = sizeof(struct pl01x_priv), };drivers/serial/serial_s5p.c +0
-1@@ -211,7 +211,6 @@ U_BOOT_DRIVER(serial_s5p) = { .platdata_auto_alloc_size = sizeof(struct s5p_serial_platdata), .probe = s5p_serial_probe, .ops = &s5p_serial_ops, - .flags = DM_FLAG_PRE_RELOC, };#endif drivers/serial/serial_sh.c +2
-0@@ -247,7 +247,9 @@ U_BOOT_DRIVER(serial_sh) = { .platdata_auto_alloc_size = sizeof(struct sh_serial_platdata), .probe = sh_serial_probe, .ops = &sh_serial_ops, +#if !CONFIG_IS_ENABLED(OF_CONTROL) .flags = DM_FLAG_PRE_RELOC, +#endif .priv_auto_alloc_size = sizeof(struct uart_port), };drivers/serial/serial_sti_asc.c +0
-1@@ -205,6 +205,5 @@ U_BOOT_DRIVER(serial_sti_asc) = { .ops = &sti_asc_serial_ops, .probe = sti_asc_serial_probe, .priv_auto_alloc_size = sizeof(struct sti_asc_serial), - .flags = DM_FLAG_PRE_RELOC, };drivers/serial/serial_stm32.c +2
-0@@ -230,7 +230,9 @@ U_BOOT_DRIVER(serial_stm32) = { .platdata_auto_alloc_size = sizeof(struct stm32x7_serial_platdata), .ops = &stm32_serial_ops, .probe = stm32_serial_probe, +#if !CONFIG_IS_ENABLED (OF_CONTROL ) .flags = DM_FLAG_PRE_RELOC, +#endif };#ifdef CONFIG_DEBUG_UART_STM32 drivers/serial/serial_xuartlite.c +0
-1@@ -109,7 +109,6 @@ U_BOOT_DRIVER(serial_uartlite) = { .platdata_auto_alloc_size = sizeof(struct uartlite_platdata), .probe = uartlite_serial_probe, .ops = &uartlite_serial_ops, - .flags = DM_FLAG_PRE_RELOC, };#ifdef CONFIG_DEBUG_UART_UARTLITE drivers/serial/serial_zynq.c +0
-2@@ -210,7 +210,6 @@ U_BOOT_DRIVER(serial_zynq) = { .platdata_auto_alloc_size = sizeof(struct zynq_uart_platdata), .probe = zynq_serial_probe, .ops = &zynq_serial_ops, - .flags = DM_FLAG_PRE_RELOC, };#ifdef CONFIG_DEBUG_UART_ZYNQ --2.7.4
_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
https://lists.denx.de/listinfo/u-boot
Signature · 2 lines
Regards, Igor Opaniuk
PATCH 9/13 serial: Remove DM_FLAG_PRE_RELOC flag in various drivers
Hi Igor,
Quoted 7 lines · Igor Opaniuk
Hi Bin,
This particular commit leads to a constant Poplar board restart (git bisect pointed to it).
U-boot is built with the defaultpoplar_configfrom the latest master (btw, is uses r), and U-boot is used as default BL33 image (setup:
vanilla ATF + vanilla OP-TEE(BL32, S-EL1 payload) + U-boot).
Thanks for reporting the issue. I looked into it and came up with a fix for review [1]. Would you give it a try to see if it fixes the problem?
Shawn
[1] https://lists.denx.de/pipermail/u-boot/2018-December/351741.html
PATCH 10/13 sysreset: Remove DM_FLAG_PRE_RELOC flag in various drivers
In reply to Bin MengWhen a driver declares DM_FLAG_PRE_RELOC flag, it wishes to be bound before relocation. However due to a bug in the DM core, the flag only takes effect when devices are statically declared via U_BOOT_DEVICE(). This bug has been fixed recently by commit "dm: core: Respect drivers with the DM_FLAG_PRE_RELOC flag in lists_bind_fdt()", but with the fix, it has a side effect that all existing drivers that declared DM_FLAG_PRE_RELOC flag will be bound before relocation now. This may expose potential boot failure on some boards due to insufficient memory during the pre-relocation stage.
To mitigate this potential impact, the following changes are implemented:
- Remove DM_FLAG_PRE_RELOC flag in the driver, if the driver only supports configuration from device tree (OF_CONTROL)
- Keep DM_FLAG_PRE_RELOC flag in the driver only if the device is statically declared via U_BOOT_DEVICE()
- Surround DM_FLAG_PRE_RELOC flag with OF_CONTROL check, for drivers that support both statically declared devices and configuration from device tree
---
arch/x86/cpu/tangier/sysreset.c | 1 - drivers/sysreset/sysreset_x86.c | 1 - lib/efi/efi_app.c | 1 - 3 files changed, 3 deletions(-)
arch/x86/cpu/tangier/sysreset.c +0 -1
@@ -44,5 +44,4 @@ U_BOOT_DRIVER(tangier_sysreset) = { .id = UCLASS_SYSRESET, .of_match = tangier_sysreset_ids, .ops = &tangier_sysreset_ops, - .flags = DM_FLAG_PRE_RELOC, };
drivers/sysreset/sysreset_x86.c +0 -1
@@ -45,5 +45,4 @@ U_BOOT_DRIVER(x86_sysreset) = { .id = UCLASS_SYSRESET, .of_match = x86_sysreset_ids, .ops = &x86_sysreset_ops, - .flags = DM_FLAG_PRE_RELOC, };
lib/efi/efi_app.c +0 -1
@@ -161,5 +161,4 @@ U_BOOT_DRIVER(efi_sysreset) = { .id = UCLASS_SYSRESET, .of_match = efi_sysreset_ids, .ops = &efi_sysreset_ops, - .flags = DM_FLAG_PRE_RELOC, };
Signature · 1 line
2.7.4
PATCH 10/13 sysreset: Remove DM_FLAG_PRE_RELOC flag in various drivers
Quoted 22 lines · Bin Meng
When a driver declares
DM_FLAG_PRE_RELOCflag, it wishes to be bound before relocation. However due to a bug in the DM core, the flag only takes effect when devices are statically declared viaU_BOOT_DEVICE(). This bug has been fixed recently by commit "dm: core: Respect drivers with theDM_FLAG_PRE_RELOCflag inlists_bind_fdt()", but with the fix, it has a side effect that all existing drivers that declaredDM_FLAG_PRE_RELOCflag will be bound before relocation now. This may expose potential boot failure on some boards due to insufficient memory during the pre-relocation stage.To mitigate this potential impact, the following changes are implemented:
- Remove
DM_FLAG_PRE_RELOCflag in the driver, if the driver only supports configuration from device tree (OF_CONTROL)
- KeepDM_FLAG_PRE_RELOCflag in the driver only if the device is statically declared viaU_BOOT_DEVICE()
- SurroundDM_FLAG_PRE_RELOCflag withOF_CONTROLcheck, for drivers that support both statically declared devices and configuration from device tree
Quoted 7 lines
Signed-off-by Bin Meng <[email protected]>---
arch/x86/cpu/tangier/sysreset.c | 1 - drivers/sysreset/sysreset_x86.c | 1 - lib/efi/efi_app.c | 1 - 3 files changed, 3 deletions(-)
PATCH 10/13 sysreset: Remove DM_FLAG_PRE_RELOC flag in various drivers
Quoted 22 lines · Bin Meng
When a driver declares
DM_FLAG_PRE_RELOCflag, it wishes to be bound before relocation. However due to a bug in the DM core, the flag only takes effect when devices are statically declared viaU_BOOT_DEVICE(). This bug has been fixed recently by commit "dm: core: Respect drivers with theDM_FLAG_PRE_RELOCflag inlists_bind_fdt()", but with the fix, it has a side effect that all existing drivers that declaredDM_FLAG_PRE_RELOCflag will be bound before relocation now. This may expose potential boot failure on some boards due to insufficient memory during the pre-relocation stage.To mitigate this potential impact, the following changes are implemented:
- Remove
DM_FLAG_PRE_RELOCflag in the driver, if the driver only supports configuration from device tree (OF_CONTROL)
- KeepDM_FLAG_PRE_RELOCflag in the driver only if the device is statically declared viaU_BOOT_DEVICE()
- SurroundDM_FLAG_PRE_RELOCflag withOF_CONTROLcheck, for drivers that support both statically declared devices and configuration from device tree
Quoted 7 lines
Signed-off-by Bin Meng <[email protected]>---
arch/x86/cpu/tangier/sysreset.c | 1 - drivers/sysreset/sysreset_x86.c | 1 - lib/efi/efi_app.c | 1 - 3 files changed, 3 deletions(-)
Applied to u-boot-dm/master, thanks!
PATCH 11/13 video: simplefb: Remove DM_FLAG_PRE_RELOC flag
In reply to Bin MengWhen a driver declares DM_FLAG_PRE_RELOC flag, it wishes to be bound before relocation. However due to a bug in the DM core, the flag only takes effect when devices are statically declared via U_BOOT_DEVICE(). This bug has been fixed recently by commit "dm: core: Respect drivers with the DM_FLAG_PRE_RELOC flag in lists_bind_fdt()", but with the fix, it has a side effect that all existing drivers that declared DM_FLAG_PRE_RELOC flag will be bound before relocation now. This may expose potential boot failure on some boards due to insufficient memory during the pre-relocation stage.
To mitigate this potential impact, the following changes are implemented:
- Remove DM_FLAG_PRE_RELOC flag in the driver, if the driver only supports configuration from device tree (OF_CONTROL)
- Keep DM_FLAG_PRE_RELOC flag in the driver only if the device is statically declared via U_BOOT_DEVICE()
- Surround DM_FLAG_PRE_RELOC flag with OF_CONTROL check, for drivers that support both statically declared devices and configuration from device tree
---
drivers/video/simplefb.c | 1 - 1 file changed, 1 deletion(-)
drivers/video/simplefb.c +0 -1
@@ -68,5 +68,4 @@ U_BOOT_DRIVER(simple_video) = { .id = UCLASS_VIDEO, .of_match = simple_video_ids, .probe = simple_video_probe, - .flags = DM_FLAG_PRE_RELOC, };
Signature · 1 line
2.7.4
PATCH 11/13 video: simplefb: Remove DM_FLAG_PRE_RELOC flag
Quoted 22 lines · Bin Meng
When a driver declares
DM_FLAG_PRE_RELOCflag, it wishes to be bound before relocation. However due to a bug in the DM core, the flag only takes effect when devices are statically declared viaU_BOOT_DEVICE(). This bug has been fixed recently by commit "dm: core: Respect drivers with theDM_FLAG_PRE_RELOCflag inlists_bind_fdt()", but with the fix, it has a side effect that all existing drivers that declaredDM_FLAG_PRE_RELOCflag will be bound before relocation now. This may expose potential boot failure on some boards due to insufficient memory during the pre-relocation stage.To mitigate this potential impact, the following changes are implemented:
- Remove
DM_FLAG_PRE_RELOCflag in the driver, if the driver only supports configuration from device tree (OF_CONTROL)
- KeepDM_FLAG_PRE_RELOCflag in the driver only if the device is statically declared viaU_BOOT_DEVICE()
- SurroundDM_FLAG_PRE_RELOCflag withOF_CONTROLcheck, for drivers that support both statically declared devices and configuration from device tree
Quoted 5 lines
Signed-off-by Bin Meng <[email protected]>---
drivers/video/simplefb.c | 1 - 1 file changed, 1 deletion(-)
PATCH 11/13 video: simplefb: Remove DM_FLAG_PRE_RELOC flag
Quoted 22 lines · Bin Meng
When a driver declares
DM_FLAG_PRE_RELOCflag, it wishes to be bound before relocation. However due to a bug in the DM core, the flag only takes effect when devices are statically declared viaU_BOOT_DEVICE(). This bug has been fixed recently by commit "dm: core: Respect drivers with theDM_FLAG_PRE_RELOCflag inlists_bind_fdt()", but with the fix, it has a side effect that all existing drivers that declaredDM_FLAG_PRE_RELOCflag will be bound before relocation now. This may expose potential boot failure on some boards due to insufficient memory during the pre-relocation stage.To mitigate this potential impact, the following changes are implemented:
- Remove
DM_FLAG_PRE_RELOCflag in the driver, if the driver only supports configuration from device tree (OF_CONTROL)
- KeepDM_FLAG_PRE_RELOCflag in the driver only if the device is statically declared viaU_BOOT_DEVICE()
- SurroundDM_FLAG_PRE_RELOCflag withOF_CONTROLcheck, for drivers that support both statically declared devices and configuration from device tree
Quoted 5 lines
Signed-off-by Bin Meng <[email protected]>---
drivers/video/simplefb.c | 1 - 1 file changed, 1 deletion(-)
Applied to u-boot-dm/master, thanks!
PATCH 12/13 watchdog: Remove DM_FLAG_PRE_RELOC flag in various drivers
In reply to Bin MengWhen a driver declares DM_FLAG_PRE_RELOC flag, it wishes to be bound before relocation. However due to a bug in the DM core, the flag only takes effect when devices are statically declared via U_BOOT_DEVICE(). This bug has been fixed recently by commit "dm: core: Respect drivers with the DM_FLAG_PRE_RELOC flag in lists_bind_fdt()", but with the fix, it has a side effect that all existing drivers that declared DM_FLAG_PRE_RELOC flag will be bound before relocation now. This may expose potential boot failure on some boards due to insufficient memory during the pre-relocation stage.
To mitigate this potential impact, the following changes are implemented:
- Remove DM_FLAG_PRE_RELOC flag in the driver, if the driver only supports configuration from device tree (OF_CONTROL)
- Keep DM_FLAG_PRE_RELOC flag in the driver only if the device is statically declared via U_BOOT_DEVICE()
- Surround DM_FLAG_PRE_RELOC flag with OF_CONTROL check, for drivers that support both statically declared devices and configuration from device tree
---
drivers/watchdog/ast_wdt.c | 1 - 1 file changed, 1 deletion(-)
drivers/watchdog/ast_wdt.c +0 -1
@@ -119,5 +119,4 @@ U_BOOT_DRIVER(ast_wdt) = { .priv_auto_alloc_size = sizeof(struct ast_wdt_priv), .ofdata_to_platdata = ast_wdt_ofdata_to_platdata, .ops = &ast_wdt_ops, - .flags = DM_FLAG_PRE_RELOC, };
Signature · 1 line
2.7.4
PATCH 12/13 watchdog: Remove DM_FLAG_PRE_RELOC flag in various drivers
Quoted 22 lines · Bin Meng
When a driver declares
DM_FLAG_PRE_RELOCflag, it wishes to be bound before relocation. However due to a bug in the DM core, the flag only takes effect when devices are statically declared viaU_BOOT_DEVICE(). This bug has been fixed recently by commit "dm: core: Respect drivers with theDM_FLAG_PRE_RELOCflag inlists_bind_fdt()", but with the fix, it has a side effect that all existing drivers that declaredDM_FLAG_PRE_RELOCflag will be bound before relocation now. This may expose potential boot failure on some boards due to insufficient memory during the pre-relocation stage.To mitigate this potential impact, the following changes are implemented:
- Remove
DM_FLAG_PRE_RELOCflag in the driver, if the driver only supports configuration from device tree (OF_CONTROL)
- KeepDM_FLAG_PRE_RELOCflag in the driver only if the device is statically declared viaU_BOOT_DEVICE()
- SurroundDM_FLAG_PRE_RELOCflag withOF_CONTROLcheck, for drivers that support both statically declared devices and configuration from device tree
Quoted 5 lines
Signed-off-by Bin Meng <[email protected]>---
drivers/watchdog/ast_wdt.c | 1 - 1 file changed, 1 deletion(-)
PATCH 12/13 watchdog: Remove DM_FLAG_PRE_RELOC flag in various drivers
Quoted 22 lines · Bin Meng
When a driver declares
DM_FLAG_PRE_RELOCflag, it wishes to be bound before relocation. However due to a bug in the DM core, the flag only takes effect when devices are statically declared viaU_BOOT_DEVICE(). This bug has been fixed recently by commit "dm: core: Respect drivers with theDM_FLAG_PRE_RELOCflag inlists_bind_fdt()", but with the fix, it has a side effect that all existing drivers that declaredDM_FLAG_PRE_RELOCflag will be bound before relocation now. This may expose potential boot failure on some boards due to insufficient memory during the pre-relocation stage.To mitigate this potential impact, the following changes are implemented:
- Remove
DM_FLAG_PRE_RELOCflag in the driver, if the driver only supports configuration from device tree (OF_CONTROL)
- KeepDM_FLAG_PRE_RELOCflag in the driver only if the device is statically declared viaU_BOOT_DEVICE()
- SurroundDM_FLAG_PRE_RELOCflag withOF_CONTROLcheck, for drivers that support both statically declared devices and configuration from device tree
Quoted 5 lines
Signed-off-by Bin Meng <[email protected]>---
drivers/watchdog/ast_wdt.c | 1 - 1 file changed, 1 deletion(-)
Applied to u-boot-dm/master, thanks!
PATCH 13/13 dm: doc: Update description of pre-relocation support
In reply to Bin MengAdd some description about pre-relocation driver binding, including usage of DM_FLAG_PRE_RELOC flag and caveats.
---
doc/driver-model/README.txt | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-)
doc/driver-model/README.txt +12 -4
@@ -830,10 +830,18 @@ Pre-Relocation Support ---------------------- For pre-relocation we simply call the driver model init function. Only -drivers marked with DM_FLAG_PRE_RELOC or the device tree -'u-boot,dm-pre-reloc' flag are initialised prior to relocation. This helps -to reduce the driver model overhead. This flag applies to SPL and TPL as -well, if device tree is enabled there. +drivers marked with DM_FLAG_PRE_RELOC or the device tree 'u-boot,dm-pre-reloc' +property are initialised prior to relocation. This helps to reduce the driver +model overhead. This flag applies to SPL and TPL as well, if device tree is +enabled (CONFIG_OF_CONTROL) there. + +Note when device tree is enabled, the device tree 'u-boot,dm-pre-reloc' +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 +prior to relocation. It is possible to limit this to specific relocation steps, by using the more specialized 'u-boot,dm-spl' and 'u-boot,dm-tpl' flags
Signature · 1 line
2.7.4
PATCH 13/13 dm: doc: Update description of pre-relocation support
Quoted 9 lines · Bin Meng
Add some description about pre-relocation driver binding, including usage of
DM_FLAG_PRE_RELOCflag and caveats.Signed-off-by Bin Meng <[email protected]>---
doc/driver-model/README.txt | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-)
PATCH 13/13 dm: doc: Update description of pre-relocation support
Quoted 9 lines · Bin Meng
Add some description about pre-relocation driver binding, including usage of
DM_FLAG_PRE_RELOCflag and caveats.Signed-off-by Bin Meng <[email protected]>---
doc/driver-model/README.txt | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-)
Applied to u-boot-dm/master, thanks!
cover dm: DM_FLAG_PRE_RELOC flag clean up
In reply to Bin MengQuoted 22 lines · Bin Meng
When a driver declares
DM_FLAG_PRE_RELOCflag, it wishes to be bound before relocation. However due to a bug in the DM core, the flag only takes effect when devices are statically declared viaU_BOOT_DEVICE(). This bug has been fixed recently by commit "dm: core: Respect drivers with theDM_FLAG_PRE_RELOCflag inlists_bind_fdt()", but with the fix, it has a side effect that all existing drivers that declaredDM_FLAG_PRE_RELOCflag will be bound before relocation now. This may expose potential boot failure on some boards due to insufficient memory during the pre-relocation stage.To mitigate this potential impact, the following changes are implemented:
- Remove
DM_FLAG_PRE_RELOCflag in the driver, if the driver only supports configuration from device tree (OF_CONTROL)
- KeepDM_FLAG_PRE_RELOCflag in the driver only if the device is statically declared viaU_BOOT_DEVICE()
- SurroundDM_FLAG_PRE_RELOCflag withOF_CONTROLcheck, for drivers that support both statically declared devices and configuration from device tree
Quoted 2 lines
This series should be applied on top of u-boot-dm/master, for v2018.11 release.
(I tested this on top of both u-boot/master and u-boot-dm/master just to be sure).
cover dm: DM_FLAG_PRE_RELOC flag clean up
In reply to Bin MengQuoted 27 lines · Bin Meng
When a driver declares
DM_FLAG_PRE_RELOCflag, it wishes to be bound before relocation. However due to a bug in the DM core, the flag only takes effect when devices are statically declared viaU_BOOT_DEVICE(). This bug has been fixed recently by commit "dm: core: Respect drivers with theDM_FLAG_PRE_RELOCflag inlists_bind_fdt()", but with the fix, it has a side effect that all existing drivers that declaredDM_FLAG_PRE_RELOCflag will be bound before relocation now. This may expose potential boot failure on some boards due to insufficient memory during the pre-relocation stage.To mitigate this potential impact, the following changes are implemented:
- Remove
DM_FLAG_PRE_RELOCflag in the driver, if the driver only supports configuration from device tree (OF_CONTROL)
- KeepDM_FLAG_PRE_RELOCflag in the driver only if the device is statically declared viaU_BOOT_DEVICE()
- SurroundDM_FLAG_PRE_RELOCflag withOF_CONTROLcheck, for drivers that support both statically declared devices and configuration from device treeThis series should be applied on top of u-boot-dm/master, for v2018.11 release.
Quoted 15 lines
Bin Meng (13):
arm: stm32mp: RemoveDM_FLAG_PRE_RELOCflag
clk: RemoveDM_FLAG_PRE_RELOCflag in various drivers
gpio: RemoveDM_FLAG_PRE_RELOCflag in various drivers
i2c: omap24xx: SurroundDM_FLAG_PRE_RELOCflag withOF_CONTROLcheck
mmc: omap: SurroundDM_FLAG_PRE_RELOCflag withOF_CONTROLcheck
pinctrl: RemoveDM_FLAG_PRE_RELOCflag in various drivers
ram: bmips: RemoveDM_FLAG_PRE_RELOCflag
timer: RemoveDM_FLAG_PRE_RELOCflag in various drivers
serial: RemoveDM_FLAG_PRE_RELOCflag in various drivers
sysreset: RemoveDM_FLAG_PRE_RELOCflag in various drivers
video: simplefb: RemoveDM_FLAG_PRE_RELOCflag
watchdog: RemoveDM_FLAG_PRE_RELOCflag in various drivers
dm: doc: Update description of pre-relocation support
This works just fine for me on the am3517_evm and the omap3_logic boards.
Tested-by Adam Ford <aford173@gmailcom>
adam
Quoted 77 lines
arch/arm/mach-stm32mp/bsec.c | 1 - arch/x86/cpu/tangier/sysreset.c | 1 - doc/driver-model/README.txt | 16 ++++++++++++---- drivers/clk/altera/clk-arria10.c | 1 - drivers/clk/clk_pic32.c | 1 - drivers/clk/clk_zynq.c | 1 - drivers/clk/exynos/clk-exynos7420.c | 3 --- drivers/clk/owl/clk_s900.c | 1 - drivers/gpio/omap_gpio.c | 2 ++ drivers/gpio/stm32f7_gpio.c | 2 +- drivers/gpio/tegra186_gpio.c | 1 - drivers/gpio/tegra_gpio.c | 1 - drivers/i2c/omap24xx_i2c.c | 2 ++ drivers/mmc/omap_hsmmc.c | 2 ++ drivers/pinctrl/broadcom/pinctrl-bcm283x.c | 2 ++ drivers/pinctrl/exynos/pinctrl-exynos7420.c | 1 - drivers/pinctrl/nxp/pinctrl-imx5.c | 2 ++ drivers/pinctrl/nxp/pinctrl-imx6.c | 2 ++ drivers/pinctrl/nxp/pinctrl-imx7.c | 2 ++ drivers/pinctrl/nxp/pinctrl-imx7ulp.c | 2 ++ drivers/pinctrl/pinctrl-single.c | 1 - drivers/pinctrl/uniphier/pinctrl-uniphier-pro4.c | 2 ++ drivers/pinctrl/uniphier/pinctrl-uniphier-pro5.c | 2 ++ drivers/ram/bmips_ram.c | 1 - drivers/serial/altera_jtag_uart.c | 1 - drivers/serial/altera_uart.c | 1 - drivers/serial/arm_dcc.c | 1 - drivers/serial/atmel_usart.c | 2 ++ drivers/serial/ns16550.c | 2 ++ drivers/serial/serial_ar933x.c | 1 - drivers/serial/serial_arc.c | 1 - drivers/serial/serial_bcm283x_mu.c | 2 ++ drivers/serial/serial_bcm283x_pl011.c | 2 ++ drivers/serial/serial_bcm6345.c | 1 - drivers/serial/serial_efi.c | 1 - drivers/serial/serial_intel_mid.c | 1 - drivers/serial/serial_lpuart.c | 1 - drivers/serial/serial_meson.c | 1 - drivers/serial/serial_mvebu_a3700.c | 1 - drivers/serial/serial_mxc.c | 2 ++ drivers/serial/serial_omap.c | 2 ++ drivers/serial/serial_owl.c | 1 - drivers/serial/serial_pic32.c | 1 - drivers/serial/serial_pl01x.c | 2 ++ drivers/serial/serial_s5p.c | 1 - drivers/serial/serial_sh.c | 2 ++ drivers/serial/serial_sti_asc.c | 1 - drivers/serial/serial_stm32.c | 2 ++ drivers/serial/serial_xuartlite.c | 1 - drivers/serial/serial_zynq.c | 1 - drivers/sysreset/sysreset_x86.c | 1 - drivers/timer/ag101p_timer.c | 1 - drivers/timer/altera_timer.c | 1 - drivers/timer/arc_timer.c | 1 - drivers/timer/ast_timer.c | 1 - drivers/timer/atcpit100_timer.c | 1 - drivers/timer/atmel_pit_timer.c | 1 - drivers/timer/cadence-ttc.c | 1 - drivers/timer/dw-apb-timer.c | 1 - drivers/timer/mpc83xx_timer.c | 1 - drivers/timer/omap-timer.c | 1 - drivers/timer/rockchip_timer.c | 1 - drivers/timer/sti-timer.c | 1 - drivers/timer/stm32_timer.c | 1 - drivers/timer/tsc_timer.c | 1 - drivers/video/simplefb.c | 1 - drivers/watchdog/ast_wdt.c | 1 - lib/efi/efi_app.c | 1 - 68 files changed, 51 insertions(+), 54 deletions(-)--
2.7.4_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
https://lists.denx.de/listinfo/u-boot
cover dm: DM_FLAG_PRE_RELOC flag clean up
Quoted 45 lines · Adam Ford
Quoted 27 lines · Bin Meng
When a driver declares
DM_FLAG_PRE_RELOCflag, it wishes to be bound before relocation. However due to a bug in the DM core, the flag only takes effect when devices are statically declared viaU_BOOT_DEVICE(). This bug has been fixed recently by commit "dm: core: Respect drivers with theDM_FLAG_PRE_RELOCflag inlists_bind_fdt()", but with the fix, it has a side effect that all existing drivers that declaredDM_FLAG_PRE_RELOCflag will be bound before relocation now. This may expose potential boot failure on some boards due to insufficient memory during the pre-relocation stage.To mitigate this potential impact, the following changes are implemented:
- Remove
DM_FLAG_PRE_RELOCflag in the driver, if the driver only supports configuration from device tree (OF_CONTROL)
- KeepDM_FLAG_PRE_RELOCflag in the driver only if the device is statically declared viaU_BOOT_DEVICE()
- SurroundDM_FLAG_PRE_RELOCflag withOF_CONTROLcheck, for drivers that support both statically declared devices and configuration from device treeThis series should be applied on top of u-boot-dm/master, for v2018.11 release.
Quoted 15 lines
Bin Meng (13):
arm: stm32mp: RemoveDM_FLAG_PRE_RELOCflag
clk: RemoveDM_FLAG_PRE_RELOCflag in various drivers
gpio: RemoveDM_FLAG_PRE_RELOCflag in various drivers
i2c: omap24xx: SurroundDM_FLAG_PRE_RELOCflag withOF_CONTROLcheck
mmc: omap: SurroundDM_FLAG_PRE_RELOCflag withOF_CONTROLcheck
pinctrl: RemoveDM_FLAG_PRE_RELOCflag in various drivers
ram: bmips: RemoveDM_FLAG_PRE_RELOCflag
timer: RemoveDM_FLAG_PRE_RELOCflag in various drivers
serial: RemoveDM_FLAG_PRE_RELOCflag in various drivers
sysreset: RemoveDM_FLAG_PRE_RELOCflag in various drivers
video: simplefb: RemoveDM_FLAG_PRE_RELOCflag
watchdog: RemoveDM_FLAG_PRE_RELOCflag in various drivers
dm: doc: Update description of pre-relocation support
Quoted 4 lines
This works just fine for me on the
am3517_evmand theomap3_logicboards.Tested-by Adam Ford <aford173@gmailcom>
Thanks Adam and Stephen's testing.
Simon,
Looks we don't have too much time before release, would you please test and send the PR?
Another series (http://patchwork.ozlabs.org/project/uboot/list/?series=70686)
needs to be pulled in to unblock x86 too.
Regards,
Bin
cover dm: DM_FLAG_PRE_RELOC flag clean up
Hi Bin,
Quoted 53 lines · Bin Meng
Quoted 45 lines · Adam Ford
Quoted 27 lines · Bin Meng
When a driver declares
DM_FLAG_PRE_RELOCflag, it wishes to be bound before relocation. However due to a bug in the DM core, the flag only takes effect when devices are statically declared viaU_BOOT_DEVICE(). This bug has been fixed recently by commit "dm: core: Respect drivers with theDM_FLAG_PRE_RELOCflag inlists_bind_fdt()", but with the fix, it has a side effect that all existing drivers that declaredDM_FLAG_PRE_RELOCflag will be bound before relocation now. This may expose potential boot failure on some boards due to insufficient memory during the pre-relocation stage.To mitigate this potential impact, the following changes are implemented:
- Remove
DM_FLAG_PRE_RELOCflag in the driver, if the driver only supports configuration from device tree (OF_CONTROL)
- KeepDM_FLAG_PRE_RELOCflag in the driver only if the device is statically declared viaU_BOOT_DEVICE()
- SurroundDM_FLAG_PRE_RELOCflag withOF_CONTROLcheck, for drivers that support both statically declared devices and configuration from device treeThis series should be applied on top of u-boot-dm/master, for v2018.11 release.
Quoted 15 lines
Bin Meng (13):
arm: stm32mp: RemoveDM_FLAG_PRE_RELOCflag
clk: RemoveDM_FLAG_PRE_RELOCflag in various drivers
gpio: RemoveDM_FLAG_PRE_RELOCflag in various drivers
i2c: omap24xx: SurroundDM_FLAG_PRE_RELOCflag withOF_CONTROLcheck
mmc: omap: SurroundDM_FLAG_PRE_RELOCflag withOF_CONTROLcheck
pinctrl: RemoveDM_FLAG_PRE_RELOCflag in various drivers
ram: bmips: RemoveDM_FLAG_PRE_RELOCflag
timer: RemoveDM_FLAG_PRE_RELOCflag in various drivers
serial: RemoveDM_FLAG_PRE_RELOCflag in various drivers
sysreset: RemoveDM_FLAG_PRE_RELOCflag in various drivers
video: simplefb: RemoveDM_FLAG_PRE_RELOCflag
watchdog: RemoveDM_FLAG_PRE_RELOCflag in various drivers
dm: doc: Update description of pre-relocation supportQuoted 4 lines
This works just fine for me on the
am3517_evmand theomap3_logicboards.Tested-by Adam Ford <aford173@gmailcom>
Thanks Adam and Stephen's testing.
Quoted 7 lines
Simon,
Looks we don't have too much time before release, would you please test and send the PR?
Another series (http://patchwork.ozlabs.org/project/uboot/list/?series=70686)
needs to be pulled in to unblock x86 too.
I had assumed we could wait to the next release.
Could you please explain what you are wanting me to do here?
Regards,
Simon
cover dm: DM_FLAG_PRE_RELOC flag clean up
Hi Simon,
Quoted 62 lines · Simon Glass
Hi Bin,
Quoted 58 lines · Bin Meng
Quoted 45 lines · Adam Ford
Quoted 27 lines · Bin Meng
When a driver declares
DM_FLAG_PRE_RELOCflag, it wishes to be bound before relocation. However due to a bug in the DM core, the flag only takes effect when devices are statically declared viaU_BOOT_DEVICE(). This bug has been fixed recently by commit "dm: core: Respect drivers with theDM_FLAG_PRE_RELOCflag inlists_bind_fdt()", but with the fix, it has a side effect that all existing drivers that declaredDM_FLAG_PRE_RELOCflag will be bound before relocation now. This may expose potential boot failure on some boards due to insufficient memory during the pre-relocation stage.To mitigate this potential impact, the following changes are implemented:
- Remove
DM_FLAG_PRE_RELOCflag in the driver, if the driver only supports configuration from device tree (OF_CONTROL)
- KeepDM_FLAG_PRE_RELOCflag in the driver only if the device is statically declared viaU_BOOT_DEVICE()
- SurroundDM_FLAG_PRE_RELOCflag withOF_CONTROLcheck, for drivers that support both statically declared devices and configuration from device treeThis series should be applied on top of u-boot-dm/master, for v2018.11 release.
Quoted 15 lines
Bin Meng (13):
arm: stm32mp: RemoveDM_FLAG_PRE_RELOCflag
clk: RemoveDM_FLAG_PRE_RELOCflag in various drivers
gpio: RemoveDM_FLAG_PRE_RELOCflag in various drivers
i2c: omap24xx: SurroundDM_FLAG_PRE_RELOCflag withOF_CONTROLcheck
mmc: omap: SurroundDM_FLAG_PRE_RELOCflag withOF_CONTROLcheck
pinctrl: RemoveDM_FLAG_PRE_RELOCflag in various drivers
ram: bmips: RemoveDM_FLAG_PRE_RELOCflag
timer: RemoveDM_FLAG_PRE_RELOCflag in various drivers
serial: RemoveDM_FLAG_PRE_RELOCflag in various drivers
sysreset: RemoveDM_FLAG_PRE_RELOCflag in various drivers
video: simplefb: RemoveDM_FLAG_PRE_RELOCflag
watchdog: RemoveDM_FLAG_PRE_RELOCflag in various drivers
dm: doc: Update description of pre-relocation supportQuoted 4 lines
This works just fine for me on the
am3517_evmand theomap3_logicboards.Tested-by Adam Ford <aford173@gmailcom>
Thanks Adam and Stephen's testing.
Simon,
Looks we don't have too much time before release, would you please test and send the PR?
Quoted 6 lines
Quoted 2 lines
Another series (http://patchwork.ozlabs.org/project/uboot/list/?series=70686)
needs to be pulled in to unblock x86 too.I had assumed we could wait to the next release.
Could you please explain what you are wanting me to do here?
Short version:
As I mentioned in this series' cover letter, "This series should be applied on top of u-boot-dm/master, for v2018.11 release.". The other x86 series should be applied for this release too.
The long story:
In [1] I said: "It looks that I have to send out a fix to correct Tegra in this release now, and leave other clean ups in next release.", was because I think the clean up changes are massive and only Stephen reported the Tegra was broken by previous series [2] which was applied in *u-boot-dm/master* so initially I only wanted to send out the Tegra fixes. However later Stefan reported in [3] that some x86 boards just don't boot with *u-boot/mater*. Then I had a look and suggested adding DM_FLAG_PRE_RELOC flag to x86 CPU drivers, which was the x86 fixes series [4] I mentioned above. However the issue is that without my fix in series [2], the x86 fix just doesn't work. Then I mentioned that in [5] I said "I spent some time to clean up all driver usage about DM_FLAG_PRE_RELOC flag" and it should fix Tegra (reported) as well as other potential (un-reported) broken.
[1] https://lists.denx.de/pipermail/u-boot/2018-October/345085.html
[2] http://patchwork.ozlabs.org/project/uboot/list/?series=70150&state=*&q=&archive=both
[3] https://lists.denx.de/pipermail/u-boot/2018-October/344266.html
[4] http://patchwork.ozlabs.org/project/uboot/list/?series=70686
[5] https://lists.denx.de/pipermail/u-boot/2018-October/345479.html
Note both my previous series [2] and x86 fix series [4] are attempting to fix the side effect brought up by c0434407b595 ("board_f: Use static print_cpuinfo if CONFIG_CPU is active") which was part of the MPC83xx CPU uclass driver support. So the root cause is the MPC83xx changes. But I am not sure if we can revert that patch easily now, as I suspect many later commits are dependent on that one, and we may break some more stuff if we revert that. Up to now, I see some 'Tested-by' tags were provided for this series, I think we are good to go.
Does this make sense?
Regards,
Bin
cover dm: DM_FLAG_PRE_RELOC flag clean up
Hi Bin,
Quoted 109 lines · Bin Meng
Hi Simon,
Quoted 62 lines · Simon Glass
Hi Bin,
Quoted 58 lines · Bin Meng
Quoted 45 lines · Adam Ford
Quoted 27 lines · Bin Meng
When a driver declares
DM_FLAG_PRE_RELOCflag, it wishes to be bound before relocation. However due to a bug in the DM core, the flag only takes effect when devices are statically declared viaU_BOOT_DEVICE(). This bug has been fixed recently by commit "dm: core: Respect drivers with theDM_FLAG_PRE_RELOCflag inlists_bind_fdt()", but with the fix, it has a side effect that all existing drivers that declaredDM_FLAG_PRE_RELOCflag will be bound before relocation now. This may expose potential boot failure on some boards due to insufficient memory during the pre-relocation stage.To mitigate this potential impact, the following changes are implemented:
- Remove
DM_FLAG_PRE_RELOCflag in the driver, if the driver only supports configuration from device tree (OF_CONTROL)
- KeepDM_FLAG_PRE_RELOCflag in the driver only if the device is statically declared viaU_BOOT_DEVICE()
- SurroundDM_FLAG_PRE_RELOCflag withOF_CONTROLcheck, for drivers that support both statically declared devices and configuration from device treeThis series should be applied on top of u-boot-dm/master, for v2018.11 release.
Quoted 15 lines
Bin Meng (13):
arm: stm32mp: RemoveDM_FLAG_PRE_RELOCflag
clk: RemoveDM_FLAG_PRE_RELOCflag in various drivers
gpio: RemoveDM_FLAG_PRE_RELOCflag in various drivers
i2c: omap24xx: SurroundDM_FLAG_PRE_RELOCflag withOF_CONTROLcheck
mmc: omap: SurroundDM_FLAG_PRE_RELOCflag withOF_CONTROLcheck
pinctrl: RemoveDM_FLAG_PRE_RELOCflag in various drivers
ram: bmips: RemoveDM_FLAG_PRE_RELOCflag
timer: RemoveDM_FLAG_PRE_RELOCflag in various drivers
serial: RemoveDM_FLAG_PRE_RELOCflag in various drivers
sysreset: RemoveDM_FLAG_PRE_RELOCflag in various drivers
video: simplefb: RemoveDM_FLAG_PRE_RELOCflag
watchdog: RemoveDM_FLAG_PRE_RELOCflag in various drivers
dm: doc: Update description of pre-relocation supportQuoted 4 lines
This works just fine for me on the
am3517_evmand theomap3_logicboards.Tested-by Adam Ford <aford173@gmailcom>
Thanks Adam and Stephen's testing.
Simon,
Looks we don't have too much time before release, would you please test and send the PR?
Quoted 6 lines
Quoted 2 lines
Another series (http://patchwork.ozlabs.org/project/uboot/list/?series=70686)
needs to be pulled in to unblock x86 too.I had assumed we could wait to the next release.
Could you please explain what you are wanting me to do here?
Short version:
As I mentioned in this series' cover letter, "This series should be applied on top of u-boot-dm/master, for v2018.11 release.". The other x86 series should be applied for this release too.The long story:
In [1] I said: "It looks that I have to send out a fix to correct Tegra in this release now, and leave other clean ups in next release.", was because I think the clean up changes are massive and only Stephen reported the Tegra was broken by previous series [2] which was applied in *u-boot-dm/master* so initially I only wanted to send out the Tegra fixes. However later Stefan reported in [3] that some x86 boards just don't boot with *u-boot/mater*. Then I had a look and suggested adding
DM_FLAG_PRE_RELOCflag to x86 CPU drivers, which was the x86 fixes series [4] I mentioned above. However the issue is that without my fix in series [2], the x86 fix just doesn't work. Then I mentioned that in [5] I said "I spent some time to clean up all driver usage aboutDM_FLAG_PRE_RELOCflag" and it should fix Tegra (reported) as well as other potential (un-reported) broken.[1] https://lists.denx.de/pipermail/u-boot/2018-October/345085.html
[2] http://patchwork.ozlabs.org/project/uboot/list/?series=70150&state=*&q=&archive=both
[3] https://lists.denx.de/pipermail/u-boot/2018-October/344266.html
[4] http://patchwork.ozlabs.org/project/uboot/list/?series=70686
[5] https://lists.denx.de/pipermail/u-boot/2018-October/345479.htmlNote both my previous series [2] and x86 fix series [4] are attempting to fix the side effect brought up by
c0434407b595("board_f: Use staticprint_cpuinfoifCONFIG_CPUis active") which was part of the MPC83xx CPU uclass driver support. So the root cause is the MPC83xx changes. But I am not sure if we can revert that patch easily now, as I suspect many later commits are dependent on that one, and we may break some more stuff if we revert that. Up to now, I see some 'Tested-by' tags were provided for this series, I think we are good to go.
Quoted 1 line
Does this make sense?
OK yes I get it. I've pulled these into dm/testing and will do a pull request tomorrow for Tom.
Regards,
Simon