aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBin Meng2018-10-24 08:36:33 -0500
committerSimon Glass2018-11-14 11:16:28 -0600
commitad0e8048437e776e687a977a84494852a64f4693 (patch)
tree011adec868e9135576025dbef3f6471f26ab3afa /drivers
parent223b10ca7a6b1d35db9c775033895969b132ad56 (diff)
downloadu-boot-ad0e8048437e776e687a977a84494852a64f4693.tar.gz
u-boot-ad0e8048437e776e687a977a84494852a64f4693.tar.xz
u-boot-ad0e8048437e776e687a977a84494852a64f4693.zip
pinctrl: 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/pinctrl/broadcom/pinctrl-bcm283x.c2
-rw-r--r--drivers/pinctrl/exynos/pinctrl-exynos7420.c1
-rw-r--r--drivers/pinctrl/nxp/pinctrl-imx5.c2
-rw-r--r--drivers/pinctrl/nxp/pinctrl-imx6.c2
-rw-r--r--drivers/pinctrl/nxp/pinctrl-imx7.c2
-rw-r--r--drivers/pinctrl/nxp/pinctrl-imx7ulp.c2
-rw-r--r--drivers/pinctrl/pinctrl-single.c1
-rw-r--r--drivers/pinctrl/uniphier/pinctrl-uniphier-pro4.c2
-rw-r--r--drivers/pinctrl/uniphier/pinctrl-uniphier-pro5.c2
9 files changed, 14 insertions, 2 deletions
diff --git a/drivers/pinctrl/broadcom/pinctrl-bcm283x.c b/drivers/pinctrl/broadcom/pinctrl-bcm283x.c
index 891b4c25fd..3be080d29e 100644
--- a/drivers/pinctrl/broadcom/pinctrl-bcm283x.c
+++ b/drivers/pinctrl/broadcom/pinctrl-bcm283x.c
@@ -148,5 +148,7 @@ U_BOOT_DRIVER(pinctrl_bcm283x) = {
148 .priv_auto_alloc_size = sizeof(struct bcm283x_pinctrl_priv), 148 .priv_auto_alloc_size = sizeof(struct bcm283x_pinctrl_priv),
149 .ops = &bcm283x_pinctrl_ops, 149 .ops = &bcm283x_pinctrl_ops,
150 .probe = bcm283x_pinctl_probe, 150 .probe = bcm283x_pinctl_probe,
151#if !CONFIG_IS_ENABLED(OF_CONTROL)
151 .flags = DM_FLAG_PRE_RELOC, 152 .flags = DM_FLAG_PRE_RELOC,
153#endif
152}; 154};
diff --git a/drivers/pinctrl/exynos/pinctrl-exynos7420.c b/drivers/pinctrl/exynos/pinctrl-exynos7420.c
index cb5975b252..ff6d6c4143 100644
--- a/drivers/pinctrl/exynos/pinctrl-exynos7420.c
+++ b/drivers/pinctrl/exynos/pinctrl-exynos7420.c
@@ -113,5 +113,4 @@ U_BOOT_DRIVER(pinctrl_exynos7420) = {
113 .priv_auto_alloc_size = sizeof(struct exynos_pinctrl_priv), 113 .priv_auto_alloc_size = sizeof(struct exynos_pinctrl_priv),
114 .ops = &exynos7420_pinctrl_ops, 114 .ops = &exynos7420_pinctrl_ops,
115 .probe = exynos_pinctrl_probe, 115 .probe = exynos_pinctrl_probe,
116 .flags = DM_FLAG_PRE_RELOC
117}; 116};
diff --git a/drivers/pinctrl/nxp/pinctrl-imx5.c b/drivers/pinctrl/nxp/pinctrl-imx5.c
index 5d17380919..4e831b6f39 100644
--- a/drivers/pinctrl/nxp/pinctrl-imx5.c
+++ b/drivers/pinctrl/nxp/pinctrl-imx5.c
@@ -40,5 +40,7 @@ U_BOOT_DRIVER(imx5_pinctrl) = {
40 .remove = imx_pinctrl_remove, 40 .remove = imx_pinctrl_remove,
41 .priv_auto_alloc_size = sizeof(struct imx_pinctrl_priv), 41 .priv_auto_alloc_size = sizeof(struct imx_pinctrl_priv),
42 .ops = &imx_pinctrl_ops, 42 .ops = &imx_pinctrl_ops,
43#if !CONFIG_IS_ENABLED(OF_CONTROL)
43 .flags = DM_FLAG_PRE_RELOC, 44 .flags = DM_FLAG_PRE_RELOC,
45#endif
44}; 46};
diff --git a/drivers/pinctrl/nxp/pinctrl-imx6.c b/drivers/pinctrl/nxp/pinctrl-imx6.c
index e63ecbdee6..d7c95bb738 100644
--- a/drivers/pinctrl/nxp/pinctrl-imx6.c
+++ b/drivers/pinctrl/nxp/pinctrl-imx6.c
@@ -49,5 +49,7 @@ U_BOOT_DRIVER(imx6_pinctrl) = {
49 .remove = imx_pinctrl_remove, 49 .remove = imx_pinctrl_remove,
50 .priv_auto_alloc_size = sizeof(struct imx_pinctrl_priv), 50 .priv_auto_alloc_size = sizeof(struct imx_pinctrl_priv),
51 .ops = &imx_pinctrl_ops, 51 .ops = &imx_pinctrl_ops,
52#if !CONFIG_IS_ENABLED(OF_CONTROL)
52 .flags = DM_FLAG_PRE_RELOC, 53 .flags = DM_FLAG_PRE_RELOC,
54#endif
53}; 55};
diff --git a/drivers/pinctrl/nxp/pinctrl-imx7.c b/drivers/pinctrl/nxp/pinctrl-imx7.c
index 769d428dda..8776fd9650 100644
--- a/drivers/pinctrl/nxp/pinctrl-imx7.c
+++ b/drivers/pinctrl/nxp/pinctrl-imx7.c
@@ -37,5 +37,7 @@ U_BOOT_DRIVER(imx7_pinctrl) = {
37 .remove = imx_pinctrl_remove, 37 .remove = imx_pinctrl_remove,
38 .priv_auto_alloc_size = sizeof(struct imx_pinctrl_priv), 38 .priv_auto_alloc_size = sizeof(struct imx_pinctrl_priv),
39 .ops = &imx_pinctrl_ops, 39 .ops = &imx_pinctrl_ops,
40#if !CONFIG_IS_ENABLED(OF_CONTROL)
40 .flags = DM_FLAG_PRE_RELOC, 41 .flags = DM_FLAG_PRE_RELOC,
42#endif
41}; 43};
diff --git a/drivers/pinctrl/nxp/pinctrl-imx7ulp.c b/drivers/pinctrl/nxp/pinctrl-imx7ulp.c
index 598bbfaf35..d778f82aac 100644
--- a/drivers/pinctrl/nxp/pinctrl-imx7ulp.c
+++ b/drivers/pinctrl/nxp/pinctrl-imx7ulp.c
@@ -41,5 +41,7 @@ U_BOOT_DRIVER(imx7ulp_pinctrl) = {
41 .remove = imx_pinctrl_remove, 41 .remove = imx_pinctrl_remove,
42 .priv_auto_alloc_size = sizeof(struct imx_pinctrl_priv), 42 .priv_auto_alloc_size = sizeof(struct imx_pinctrl_priv),
43 .ops = &imx_pinctrl_ops, 43 .ops = &imx_pinctrl_ops,
44#if !CONFIG_IS_ENABLED(OF_CONTROL)
44 .flags = DM_FLAG_PRE_RELOC, 45 .flags = DM_FLAG_PRE_RELOC,
46#endif
45}; 47};
diff --git a/drivers/pinctrl/pinctrl-single.c b/drivers/pinctrl/pinctrl-single.c
index d80c6eda70..9dec88c1aa 100644
--- a/drivers/pinctrl/pinctrl-single.c
+++ b/drivers/pinctrl/pinctrl-single.c
@@ -136,7 +136,6 @@ U_BOOT_DRIVER(single_pinctrl) = {
136 .id = UCLASS_PINCTRL, 136 .id = UCLASS_PINCTRL,
137 .of_match = single_pinctrl_match, 137 .of_match = single_pinctrl_match,
138 .ops = &single_pinctrl_ops, 138 .ops = &single_pinctrl_ops,
139 .flags = DM_FLAG_PRE_RELOC,
140 .platdata_auto_alloc_size = sizeof(struct single_pdata), 139 .platdata_auto_alloc_size = sizeof(struct single_pdata),
141 .ofdata_to_platdata = single_ofdata_to_platdata, 140 .ofdata_to_platdata = single_ofdata_to_platdata,
142}; 141};
diff --git a/drivers/pinctrl/uniphier/pinctrl-uniphier-pro4.c b/drivers/pinctrl/uniphier/pinctrl-uniphier-pro4.c
index a1da90baa4..eb5978a166 100644
--- a/drivers/pinctrl/uniphier/pinctrl-uniphier-pro4.c
+++ b/drivers/pinctrl/uniphier/pinctrl-uniphier-pro4.c
@@ -171,5 +171,7 @@ U_BOOT_DRIVER(uniphier_pro4_pinctrl) = {
171 .probe = uniphier_pro4_pinctrl_probe, 171 .probe = uniphier_pro4_pinctrl_probe,
172 .priv_auto_alloc_size = sizeof(struct uniphier_pinctrl_priv), 172 .priv_auto_alloc_size = sizeof(struct uniphier_pinctrl_priv),
173 .ops = &uniphier_pinctrl_ops, 173 .ops = &uniphier_pinctrl_ops,
174#if !CONFIG_IS_ENABLED(OF_CONTROL)
174 .flags = DM_FLAG_PRE_RELOC, 175 .flags = DM_FLAG_PRE_RELOC,
176#endif
175}; 177};
diff --git a/drivers/pinctrl/uniphier/pinctrl-uniphier-pro5.c b/drivers/pinctrl/uniphier/pinctrl-uniphier-pro5.c
index 0ba2052b29..685d8be80c 100644
--- a/drivers/pinctrl/uniphier/pinctrl-uniphier-pro5.c
+++ b/drivers/pinctrl/uniphier/pinctrl-uniphier-pro5.c
@@ -153,5 +153,7 @@ U_BOOT_DRIVER(uniphier_pro5_pinctrl) = {
153 .probe = uniphier_pro5_pinctrl_probe, 153 .probe = uniphier_pro5_pinctrl_probe,
154 .priv_auto_alloc_size = sizeof(struct uniphier_pinctrl_priv), 154 .priv_auto_alloc_size = sizeof(struct uniphier_pinctrl_priv),
155 .ops = &uniphier_pinctrl_ops, 155 .ops = &uniphier_pinctrl_ops,
156#if !CONFIG_IS_ENABLED(OF_CONTROL)
156 .flags = DM_FLAG_PRE_RELOC, 157 .flags = DM_FLAG_PRE_RELOC,
158#endif
157}; 159};