aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBin Meng2018-10-24 08:36:36 -0500
committerSimon Glass2018-11-14 11:16:28 -0600
commit4687919684e0e4390b9fc20d1809ecaa9dc3cb81 (patch)
treee0cb2adcd74a9fe071035c2406d109e083129f50 /drivers
parentd7a184d4a7d2706f091a3b708060f48a325234ef (diff)
downloadu-boot-4687919684e0e4390b9fc20d1809ecaa9dc3cb81.tar.gz
u-boot-4687919684e0e4390b9fc20d1809ecaa9dc3cb81.tar.xz
u-boot-4687919684e0e4390b9fc20d1809ecaa9dc3cb81.zip
serial: Remove DM_FLAG_PRE_RELOC flag in various drivers
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 Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/serial/altera_jtag_uart.c1
-rw-r--r--drivers/serial/altera_uart.c1
-rw-r--r--drivers/serial/arm_dcc.c1
-rw-r--r--drivers/serial/atmel_usart.c2
-rw-r--r--drivers/serial/ns16550.c2
-rw-r--r--drivers/serial/serial_ar933x.c1
-rw-r--r--drivers/serial/serial_arc.c1
-rw-r--r--drivers/serial/serial_bcm283x_mu.c2
-rw-r--r--drivers/serial/serial_bcm283x_pl011.c2
-rw-r--r--drivers/serial/serial_bcm6345.c1
-rw-r--r--drivers/serial/serial_efi.c1
-rw-r--r--drivers/serial/serial_intel_mid.c1
-rw-r--r--drivers/serial/serial_lpuart.c1
-rw-r--r--drivers/serial/serial_meson.c1
-rw-r--r--drivers/serial/serial_mvebu_a3700.c1
-rw-r--r--drivers/serial/serial_mxc.c2
-rw-r--r--drivers/serial/serial_omap.c2
-rw-r--r--drivers/serial/serial_owl.c1
-rw-r--r--drivers/serial/serial_pic32.c1
-rw-r--r--drivers/serial/serial_pl01x.c2
-rw-r--r--drivers/serial/serial_s5p.c1
-rw-r--r--drivers/serial/serial_sh.c2
-rw-r--r--drivers/serial/serial_sti_asc.c1
-rw-r--r--drivers/serial/serial_stm32.c2
-rw-r--r--drivers/serial/serial_xuartlite.c1
-rw-r--r--drivers/serial/serial_zynq.c1
26 files changed, 18 insertions, 17 deletions
diff --git a/drivers/serial/altera_jtag_uart.c b/drivers/serial/altera_jtag_uart.c
index 61052a92d6..86c3de4e45 100644
--- a/drivers/serial/altera_jtag_uart.c
+++ b/drivers/serial/altera_jtag_uart.c
@@ -121,7 +121,6 @@ U_BOOT_DRIVER(altera_jtaguart) = {
121 .platdata_auto_alloc_size = sizeof(struct altera_jtaguart_platdata), 121 .platdata_auto_alloc_size = sizeof(struct altera_jtaguart_platdata),
122 .probe = altera_jtaguart_probe, 122 .probe = altera_jtaguart_probe,
123 .ops = &altera_jtaguart_ops, 123 .ops = &altera_jtaguart_ops,
124 .flags = DM_FLAG_PRE_RELOC,
125}; 124};
126 125
127#ifdef CONFIG_DEBUG_UART_ALTERA_JTAGUART 126#ifdef CONFIG_DEBUG_UART_ALTERA_JTAGUART
diff --git a/drivers/serial/altera_uart.c b/drivers/serial/altera_uart.c
index b7b0a13ca1..67d47199aa 100644
--- a/drivers/serial/altera_uart.c
+++ b/drivers/serial/altera_uart.c
@@ -117,7 +117,6 @@ U_BOOT_DRIVER(altera_uart) = {
117 .platdata_auto_alloc_size = sizeof(struct altera_uart_platdata), 117 .platdata_auto_alloc_size = sizeof(struct altera_uart_platdata),
118 .probe = altera_uart_probe, 118 .probe = altera_uart_probe,
119 .ops = &altera_uart_ops, 119 .ops = &altera_uart_ops,
120 .flags = DM_FLAG_PRE_RELOC,
121}; 120};
122 121
123#ifdef CONFIG_DEBUG_UART_ALTERA_UART 122#ifdef CONFIG_DEBUG_UART_ALTERA_UART
diff --git a/drivers/serial/arm_dcc.c b/drivers/serial/arm_dcc.c
index 43e8691a93..dfcb6fd698 100644
--- a/drivers/serial/arm_dcc.c
+++ b/drivers/serial/arm_dcc.c
@@ -155,7 +155,6 @@ U_BOOT_DRIVER(serial_dcc) = {
155 .id = UCLASS_SERIAL, 155 .id = UCLASS_SERIAL,
156 .of_match = arm_dcc_ids, 156 .of_match = arm_dcc_ids,
157 .ops = &arm_dcc_ops, 157 .ops = &arm_dcc_ops,
158 .flags = DM_FLAG_PRE_RELOC,
159}; 158};
160 159
161#ifdef CONFIG_DEBUG_UART_ARM_DCC 160#ifdef CONFIG_DEBUG_UART_ARM_DCC
diff --git a/drivers/serial/atmel_usart.c b/drivers/serial/atmel_usart.c
index 9414f5f692..aa8cdff840 100644
--- a/drivers/serial/atmel_usart.c
+++ b/drivers/serial/atmel_usart.c
@@ -294,7 +294,9 @@ U_BOOT_DRIVER(serial_atmel) = {
294#endif 294#endif
295 .probe = atmel_serial_probe, 295 .probe = atmel_serial_probe,
296 .ops = &atmel_serial_ops, 296 .ops = &atmel_serial_ops,
297#if !CONFIG_IS_ENABLED(OF_CONTROL)
297 .flags = DM_FLAG_PRE_RELOC, 298 .flags = DM_FLAG_PRE_RELOC,
299#endif
298 .priv_auto_alloc_size = sizeof(struct atmel_serial_priv), 300 .priv_auto_alloc_size = sizeof(struct atmel_serial_priv),
299}; 301};
300#endif 302#endif
diff --git a/drivers/serial/ns16550.c b/drivers/serial/ns16550.c
index 04b604fa2c..1e6fc6c668 100644
--- a/drivers/serial/ns16550.c
+++ b/drivers/serial/ns16550.c
@@ -487,7 +487,9 @@ U_BOOT_DRIVER(ns16550_serial) = {
487 .priv_auto_alloc_size = sizeof(struct NS16550), 487 .priv_auto_alloc_size = sizeof(struct NS16550),
488 .probe = ns16550_serial_probe, 488 .probe = ns16550_serial_probe,
489 .ops = &ns16550_serial_ops, 489 .ops = &ns16550_serial_ops,
490#if !CONFIG_IS_ENABLED(OF_CONTROL)
490 .flags = DM_FLAG_PRE_RELOC, 491 .flags = DM_FLAG_PRE_RELOC,
492#endif
491}; 493};
492#endif 494#endif
493#endif /* SERIAL_PRESENT */ 495#endif /* SERIAL_PRESENT */
diff --git a/drivers/serial/serial_ar933x.c b/drivers/serial/serial_ar933x.c
index e91a5f7b24..5249c55398 100644
--- a/drivers/serial/serial_ar933x.c
+++ b/drivers/serial/serial_ar933x.c
@@ -189,7 +189,6 @@ U_BOOT_DRIVER(serial_ar933x) = {
189 .priv_auto_alloc_size = sizeof(struct ar933x_serial_priv), 189 .priv_auto_alloc_size = sizeof(struct ar933x_serial_priv),
190 .probe = ar933x_serial_probe, 190 .probe = ar933x_serial_probe,
191 .ops = &ar933x_serial_ops, 191 .ops = &ar933x_serial_ops,
192 .flags = DM_FLAG_PRE_RELOC,
193}; 192};
194 193
195#ifdef CONFIG_DEBUG_UART_AR933X 194#ifdef CONFIG_DEBUG_UART_AR933X
diff --git a/drivers/serial/serial_arc.c b/drivers/serial/serial_arc.c
index 925f0c2555..980b38d2a1 100644
--- a/drivers/serial/serial_arc.c
+++ b/drivers/serial/serial_arc.c
@@ -128,7 +128,6 @@ U_BOOT_DRIVER(serial_arc) = {
128 .ofdata_to_platdata = arc_serial_ofdata_to_platdata, 128 .ofdata_to_platdata = arc_serial_ofdata_to_platdata,
129 .probe = arc_serial_probe, 129 .probe = arc_serial_probe,
130 .ops = &arc_serial_ops, 130 .ops = &arc_serial_ops,
131 .flags = DM_FLAG_PRE_RELOC,
132}; 131};
133 132
134#ifdef CONFIG_DEBUG_ARC_SERIAL 133#ifdef CONFIG_DEBUG_ARC_SERIAL
diff --git a/drivers/serial/serial_bcm283x_mu.c b/drivers/serial/serial_bcm283x_mu.c
index 1f87f0cb28..bd1d89ec83 100644
--- a/drivers/serial/serial_bcm283x_mu.c
+++ b/drivers/serial/serial_bcm283x_mu.c
@@ -199,6 +199,8 @@ U_BOOT_DRIVER(serial_bcm283x_mu) = {
199 .platdata_auto_alloc_size = sizeof(struct bcm283x_mu_serial_platdata), 199 .platdata_auto_alloc_size = sizeof(struct bcm283x_mu_serial_platdata),
200 .probe = bcm283x_mu_serial_probe, 200 .probe = bcm283x_mu_serial_probe,
201 .ops = &bcm283x_mu_serial_ops, 201 .ops = &bcm283x_mu_serial_ops,
202#if !CONFIG_IS_ENABLED(OF_CONTROL)
202 .flags = DM_FLAG_PRE_RELOC, 203 .flags = DM_FLAG_PRE_RELOC,
204#endif
203 .priv_auto_alloc_size = sizeof(struct bcm283x_mu_priv), 205 .priv_auto_alloc_size = sizeof(struct bcm283x_mu_priv),
204}; 206};
diff --git a/drivers/serial/serial_bcm283x_pl011.c b/drivers/serial/serial_bcm283x_pl011.c
index 54fc9b5b39..2527bb8b1c 100644
--- a/drivers/serial/serial_bcm283x_pl011.c
+++ b/drivers/serial/serial_bcm283x_pl011.c
@@ -90,6 +90,8 @@ U_BOOT_DRIVER(bcm283x_pl011_uart) = {
90 .platdata_auto_alloc_size = sizeof(struct pl01x_serial_platdata), 90 .platdata_auto_alloc_size = sizeof(struct pl01x_serial_platdata),
91 .probe = pl01x_serial_probe, 91 .probe = pl01x_serial_probe,
92 .ops = &bcm283x_pl011_serial_ops, 92 .ops = &bcm283x_pl011_serial_ops,
93#if !CONFIG_IS_ENABLED(OF_CONTROL)
93 .flags = DM_FLAG_PRE_RELOC, 94 .flags = DM_FLAG_PRE_RELOC,
95#endif
94 .priv_auto_alloc_size = sizeof(struct pl01x_priv), 96 .priv_auto_alloc_size = sizeof(struct pl01x_priv),
95}; 97};
diff --git a/drivers/serial/serial_bcm6345.c b/drivers/serial/serial_bcm6345.c
index ee5d561bfd..a0e709a11e 100644
--- a/drivers/serial/serial_bcm6345.c
+++ b/drivers/serial/serial_bcm6345.c
@@ -264,7 +264,6 @@ U_BOOT_DRIVER(bcm6345_serial) = {
264 .probe = bcm6345_serial_probe, 264 .probe = bcm6345_serial_probe,
265 .priv_auto_alloc_size = sizeof(struct bcm6345_serial_priv), 265 .priv_auto_alloc_size = sizeof(struct bcm6345_serial_priv),
266 .ops = &bcm6345_serial_ops, 266 .ops = &bcm6345_serial_ops,
267 .flags = DM_FLAG_PRE_RELOC,
268}; 267};
269 268
270#ifdef CONFIG_DEBUG_UART_BCM6345 269#ifdef CONFIG_DEBUG_UART_BCM6345
diff --git a/drivers/serial/serial_efi.c b/drivers/serial/serial_efi.c
index 1b54d1880f..dd3e511fc9 100644
--- a/drivers/serial/serial_efi.c
+++ b/drivers/serial/serial_efi.c
@@ -152,5 +152,4 @@ U_BOOT_DRIVER(serial_efi) = {
152 .priv_auto_alloc_size = sizeof(struct serial_efi_priv), 152 .priv_auto_alloc_size = sizeof(struct serial_efi_priv),
153 .probe = serial_efi_probe, 153 .probe = serial_efi_probe,
154 .ops = &serial_efi_ops, 154 .ops = &serial_efi_ops,
155 .flags = DM_FLAG_PRE_RELOC,
156}; 155};
diff --git a/drivers/serial/serial_intel_mid.c b/drivers/serial/serial_intel_mid.c
index bdb5adb2a4..39bd40e68b 100644
--- a/drivers/serial/serial_intel_mid.c
+++ b/drivers/serial/serial_intel_mid.c
@@ -64,5 +64,4 @@ U_BOOT_DRIVER(serial_intel_mid) = {
64 .priv_auto_alloc_size = sizeof(struct NS16550), 64 .priv_auto_alloc_size = sizeof(struct NS16550),
65 .probe = mid_serial_probe, 65 .probe = mid_serial_probe,
66 .ops = &ns16550_serial_ops, 66 .ops = &ns16550_serial_ops,
67 .flags = DM_FLAG_PRE_RELOC,
68}; 67};
diff --git a/drivers/serial/serial_lpuart.c b/drivers/serial/serial_lpuart.c
index 6106c1f9ec..a357b00d28 100644
--- a/drivers/serial/serial_lpuart.c
+++ b/drivers/serial/serial_lpuart.c
@@ -540,5 +540,4 @@ U_BOOT_DRIVER(serial_lpuart) = {
540 .platdata_auto_alloc_size = sizeof(struct lpuart_serial_platdata), 540 .platdata_auto_alloc_size = sizeof(struct lpuart_serial_platdata),
541 .probe = lpuart_serial_probe, 541 .probe = lpuart_serial_probe,
542 .ops = &lpuart_serial_ops, 542 .ops = &lpuart_serial_ops,
543 .flags = DM_FLAG_PRE_RELOC,
544}; 543};
diff --git a/drivers/serial/serial_meson.c b/drivers/serial/serial_meson.c
index dbb853735f..b3dad77aa2 100644
--- a/drivers/serial/serial_meson.c
+++ b/drivers/serial/serial_meson.c
@@ -132,7 +132,6 @@ U_BOOT_DRIVER(serial_meson) = {
132 .of_match = meson_serial_ids, 132 .of_match = meson_serial_ids,
133 .probe = meson_serial_probe, 133 .probe = meson_serial_probe,
134 .ops = &meson_serial_ops, 134 .ops = &meson_serial_ops,
135 .flags = DM_FLAG_PRE_RELOC,
136 .ofdata_to_platdata = meson_serial_ofdata_to_platdata, 135 .ofdata_to_platdata = meson_serial_ofdata_to_platdata,
137 .platdata_auto_alloc_size = sizeof(struct meson_serial_platdata), 136 .platdata_auto_alloc_size = sizeof(struct meson_serial_platdata),
138}; 137};
diff --git a/drivers/serial/serial_mvebu_a3700.c b/drivers/serial/serial_mvebu_a3700.c
index ce26d2bd15..7e4cd6c4b4 100644
--- a/drivers/serial/serial_mvebu_a3700.c
+++ b/drivers/serial/serial_mvebu_a3700.c
@@ -129,7 +129,6 @@ U_BOOT_DRIVER(serial_mvebu) = {
129 .platdata_auto_alloc_size = sizeof(struct mvebu_platdata), 129 .platdata_auto_alloc_size = sizeof(struct mvebu_platdata),
130 .probe = mvebu_serial_probe, 130 .probe = mvebu_serial_probe,
131 .ops = &mvebu_serial_ops, 131 .ops = &mvebu_serial_ops,
132 .flags = DM_FLAG_PRE_RELOC,
133}; 132};
134 133
135#ifdef CONFIG_DEBUG_MVEBU_A3700_UART 134#ifdef CONFIG_DEBUG_MVEBU_A3700_UART
diff --git a/drivers/serial/serial_mxc.c b/drivers/serial/serial_mxc.c
index e586c18cf0..7e4e6d36b8 100644
--- a/drivers/serial/serial_mxc.c
+++ b/drivers/serial/serial_mxc.c
@@ -354,7 +354,9 @@ U_BOOT_DRIVER(serial_mxc) = {
354#endif 354#endif
355 .probe = mxc_serial_probe, 355 .probe = mxc_serial_probe,
356 .ops = &mxc_serial_ops, 356 .ops = &mxc_serial_ops,
357#if !CONFIG_IS_ENABLED(OF_CONTROL)
357 .flags = DM_FLAG_PRE_RELOC, 358 .flags = DM_FLAG_PRE_RELOC,
359#endif
358}; 360};
359#endif 361#endif
360 362
diff --git a/drivers/serial/serial_omap.c b/drivers/serial/serial_omap.c
index af3c755f96..ee6ad9c9e5 100644
--- a/drivers/serial/serial_omap.c
+++ b/drivers/serial/serial_omap.c
@@ -121,7 +121,9 @@ U_BOOT_DRIVER(omap_serial) = {
121 .priv_auto_alloc_size = sizeof(struct NS16550), 121 .priv_auto_alloc_size = sizeof(struct NS16550),
122 .probe = ns16550_serial_probe, 122 .probe = ns16550_serial_probe,
123 .ops = &ns16550_serial_ops, 123 .ops = &ns16550_serial_ops,
124#if !CONFIG_IS_ENABLED(OF_CONTROL)
124 .flags = DM_FLAG_PRE_RELOC, 125 .flags = DM_FLAG_PRE_RELOC,
126#endif
125}; 127};
126#endif 128#endif
127#endif /* DM_SERIAL */ 129#endif /* DM_SERIAL */
diff --git a/drivers/serial/serial_owl.c b/drivers/serial/serial_owl.c
index 6fd97e2502..7ead73e6b7 100644
--- a/drivers/serial/serial_owl.c
+++ b/drivers/serial/serial_owl.c
@@ -132,5 +132,4 @@ U_BOOT_DRIVER(serial_owl) = {
132 .priv_auto_alloc_size = sizeof(struct owl_serial_priv), 132 .priv_auto_alloc_size = sizeof(struct owl_serial_priv),
133 .probe = owl_serial_probe, 133 .probe = owl_serial_probe,
134 .ops = &owl_serial_ops, 134 .ops = &owl_serial_ops,
135 .flags = DM_FLAG_PRE_RELOC,
136}; 135};
diff --git a/drivers/serial/serial_pic32.c b/drivers/serial/serial_pic32.c
index ba73978e25..84600b1201 100644
--- a/drivers/serial/serial_pic32.c
+++ b/drivers/serial/serial_pic32.c
@@ -176,7 +176,6 @@ U_BOOT_DRIVER(pic32_serial) = {
176 .of_match = pic32_uart_ids, 176 .of_match = pic32_uart_ids,
177 .probe = pic32_uart_probe, 177 .probe = pic32_uart_probe,
178 .ops = &pic32_uart_ops, 178 .ops = &pic32_uart_ops,
179 .flags = DM_FLAG_PRE_RELOC,
180 .priv_auto_alloc_size = sizeof(struct pic32_uart_priv), 179 .priv_auto_alloc_size = sizeof(struct pic32_uart_priv),
181}; 180};
182 181
diff --git a/drivers/serial/serial_pl01x.c b/drivers/serial/serial_pl01x.c
index 2a5f256184..12512f6578 100644
--- a/drivers/serial/serial_pl01x.c
+++ b/drivers/serial/serial_pl01x.c
@@ -363,7 +363,9 @@ U_BOOT_DRIVER(serial_pl01x) = {
363 .platdata_auto_alloc_size = sizeof(struct pl01x_serial_platdata), 363 .platdata_auto_alloc_size = sizeof(struct pl01x_serial_platdata),
364 .probe = pl01x_serial_probe, 364 .probe = pl01x_serial_probe,
365 .ops = &pl01x_serial_ops, 365 .ops = &pl01x_serial_ops,
366#if !CONFIG_IS_ENABLED(OF_CONTROL)
366 .flags = DM_FLAG_PRE_RELOC, 367 .flags = DM_FLAG_PRE_RELOC,
368#endif
367 .priv_auto_alloc_size = sizeof(struct pl01x_priv), 369 .priv_auto_alloc_size = sizeof(struct pl01x_priv),
368}; 370};
369 371
diff --git a/drivers/serial/serial_s5p.c b/drivers/serial/serial_s5p.c
index faea6d4c99..e3160cf1bd 100644
--- a/drivers/serial/serial_s5p.c
+++ b/drivers/serial/serial_s5p.c
@@ -211,7 +211,6 @@ U_BOOT_DRIVER(serial_s5p) = {
211 .platdata_auto_alloc_size = sizeof(struct s5p_serial_platdata), 211 .platdata_auto_alloc_size = sizeof(struct s5p_serial_platdata),
212 .probe = s5p_serial_probe, 212 .probe = s5p_serial_probe,
213 .ops = &s5p_serial_ops, 213 .ops = &s5p_serial_ops,
214 .flags = DM_FLAG_PRE_RELOC,
215}; 214};
216#endif 215#endif
217 216
diff --git a/drivers/serial/serial_sh.c b/drivers/serial/serial_sh.c
index b1534981f8..c934d5f25a 100644
--- a/drivers/serial/serial_sh.c
+++ b/drivers/serial/serial_sh.c
@@ -247,7 +247,9 @@ U_BOOT_DRIVER(serial_sh) = {
247 .platdata_auto_alloc_size = sizeof(struct sh_serial_platdata), 247 .platdata_auto_alloc_size = sizeof(struct sh_serial_platdata),
248 .probe = sh_serial_probe, 248 .probe = sh_serial_probe,
249 .ops = &sh_serial_ops, 249 .ops = &sh_serial_ops,
250#if !CONFIG_IS_ENABLED(OF_CONTROL)
250 .flags = DM_FLAG_PRE_RELOC, 251 .flags = DM_FLAG_PRE_RELOC,
252#endif
251 .priv_auto_alloc_size = sizeof(struct uart_port), 253 .priv_auto_alloc_size = sizeof(struct uart_port),
252}; 254};
253 255
diff --git a/drivers/serial/serial_sti_asc.c b/drivers/serial/serial_sti_asc.c
index 5dfc6171eb..c972f1e9af 100644
--- a/drivers/serial/serial_sti_asc.c
+++ b/drivers/serial/serial_sti_asc.c
@@ -205,6 +205,5 @@ U_BOOT_DRIVER(serial_sti_asc) = {
205 .ops = &sti_asc_serial_ops, 205 .ops = &sti_asc_serial_ops,
206 .probe = sti_asc_serial_probe, 206 .probe = sti_asc_serial_probe,
207 .priv_auto_alloc_size = sizeof(struct sti_asc_serial), 207 .priv_auto_alloc_size = sizeof(struct sti_asc_serial),
208 .flags = DM_FLAG_PRE_RELOC,
209}; 208};
210 209
diff --git a/drivers/serial/serial_stm32.c b/drivers/serial/serial_stm32.c
index 66e02d5689..31b43ee88d 100644
--- a/drivers/serial/serial_stm32.c
+++ b/drivers/serial/serial_stm32.c
@@ -230,7 +230,9 @@ U_BOOT_DRIVER(serial_stm32) = {
230 .platdata_auto_alloc_size = sizeof(struct stm32x7_serial_platdata), 230 .platdata_auto_alloc_size = sizeof(struct stm32x7_serial_platdata),
231 .ops = &stm32_serial_ops, 231 .ops = &stm32_serial_ops,
232 .probe = stm32_serial_probe, 232 .probe = stm32_serial_probe,
233#if !CONFIG_IS_ENABLED(OF_CONTROL)
233 .flags = DM_FLAG_PRE_RELOC, 234 .flags = DM_FLAG_PRE_RELOC,
235#endif
234}; 236};
235 237
236#ifdef CONFIG_DEBUG_UART_STM32 238#ifdef CONFIG_DEBUG_UART_STM32
diff --git a/drivers/serial/serial_xuartlite.c b/drivers/serial/serial_xuartlite.c
index cead3c62f5..1be777bd3b 100644
--- a/drivers/serial/serial_xuartlite.c
+++ b/drivers/serial/serial_xuartlite.c
@@ -109,7 +109,6 @@ U_BOOT_DRIVER(serial_uartlite) = {
109 .platdata_auto_alloc_size = sizeof(struct uartlite_platdata), 109 .platdata_auto_alloc_size = sizeof(struct uartlite_platdata),
110 .probe = uartlite_serial_probe, 110 .probe = uartlite_serial_probe,
111 .ops = &uartlite_serial_ops, 111 .ops = &uartlite_serial_ops,
112 .flags = DM_FLAG_PRE_RELOC,
113}; 112};
114 113
115#ifdef CONFIG_DEBUG_UART_UARTLITE 114#ifdef CONFIG_DEBUG_UART_UARTLITE
diff --git a/drivers/serial/serial_zynq.c b/drivers/serial/serial_zynq.c
index f689015b4a..7e486a68ff 100644
--- a/drivers/serial/serial_zynq.c
+++ b/drivers/serial/serial_zynq.c
@@ -210,7 +210,6 @@ U_BOOT_DRIVER(serial_zynq) = {
210 .platdata_auto_alloc_size = sizeof(struct zynq_uart_platdata), 210 .platdata_auto_alloc_size = sizeof(struct zynq_uart_platdata),
211 .probe = zynq_serial_probe, 211 .probe = zynq_serial_probe,
212 .ops = &zynq_serial_ops, 212 .ops = &zynq_serial_ops,
213 .flags = DM_FLAG_PRE_RELOC,
214}; 213};
215 214
216#ifdef CONFIG_DEBUG_UART_ZYNQ 215#ifdef CONFIG_DEBUG_UART_ZYNQ