* [U-Boot] [PATCH v2] pinctrl: imx: Define imx6_pinctrl_soc_info in .data section
@ 2019-04-23 14:44 Lukasz Majewski
2019-04-24 1:39 ` Peng Fan
2019-06-11 8:44 ` sbabic at denx.de
0 siblings, 2 replies; 3+ messages in thread
From: Lukasz Majewski @ 2019-04-23 14:44 UTC (permalink / raw)
To: u-boot
This commit is necessary to be able to re-use the pinctrl code in early
SPL to properly configure pins.
The problem is that those "static" structures (without explicit
initialization) are placed in the SDRAM area, which corresponds to
u-boot proper (not even SPL).
Hence, when one wants to configure pins before relocation via DTS/DM,
the board hangs (imx6q SoC powered one) as only OCRAM area is available
(0x009xxxxx).
This commit prevents from this issue by moving the imx6_pinctrl_soc_info
structure to data section (from BSS).
Signed-off-by: Lukasz Majewski <lukma@denx.de>
---
Changes in v2:
- Use __section(".data") instead of rewritting the code to use calloc()
(less intrusive commit)
drivers/pinctrl/nxp/pinctrl-imx6.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/pinctrl/nxp/pinctrl-imx6.c b/drivers/pinctrl/nxp/pinctrl-imx6.c
index d7c95bb738..0c1e7a9c05 100644
--- a/drivers/pinctrl/nxp/pinctrl-imx6.c
+++ b/drivers/pinctrl/nxp/pinctrl-imx6.c
@@ -10,7 +10,7 @@
#include "pinctrl-imx.h"
-static struct imx_pinctrl_soc_info imx6_pinctrl_soc_info;
+static struct imx_pinctrl_soc_info imx6_pinctrl_soc_info __section(".data");
/* FIXME Before reloaction, BSS is overlapped with DT area */
static struct imx_pinctrl_soc_info imx6ul_pinctrl_soc_info = {
--
2.11.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [U-Boot] [PATCH v2] pinctrl: imx: Define imx6_pinctrl_soc_info in .data section
2019-04-23 14:44 [U-Boot] [PATCH v2] pinctrl: imx: Define imx6_pinctrl_soc_info in .data section Lukasz Majewski
@ 2019-04-24 1:39 ` Peng Fan
2019-06-11 8:44 ` sbabic at denx.de
1 sibling, 0 replies; 3+ messages in thread
From: Peng Fan @ 2019-04-24 1:39 UTC (permalink / raw)
To: u-boot
> -----Original Message-----
> From: Lukasz Majewski [mailto:lukma at denx.de]
> Sent: 2019年4月23日 22:45
> To: Stefano Babic <sbabic@denx.de>; u-boot at lists.denx.de; Fabio Estevam
> <festevam@gmail.com>; Fabio Estevam <fabio.estevam@nxp.com>;
> dl-uboot-imx <uboot-imx@nxp.com>; Jagan Teki
> <jagan@amarulasolutions.com>; Adam Ford <aford173@gmail.com>
> Cc: Lukasz Majewski <lukma@denx.de>; Bin Meng <bmeng.cn@gmail.com>;
> Simon Glass <sjg@chromium.org>
> Subject: [PATCH v2] pinctrl: imx: Define imx6_pinctrl_soc_info in .data section
>
> This commit is necessary to be able to re-use the pinctrl code in early SPL to
> properly configure pins.
>
> The problem is that those "static" structures (without explicit
> initialization) are placed in the SDRAM area, which corresponds to u-boot
> proper (not even SPL).
> Hence, when one wants to configure pins before relocation via DTS/DM, the
> board hangs (imx6q SoC powered one) as only OCRAM area is available
> (0x009xxxxx).
>
> This commit prevents from this issue by moving the imx6_pinctrl_soc_info
> structure to data section (from BSS).
>
> Signed-off-by: Lukasz Majewski <lukma@denx.de>
>
> ---
>
> Changes in v2:
> - Use __section(".data") instead of rewritting the code to use calloc()
> (less intrusive commit)
>
> drivers/pinctrl/nxp/pinctrl-imx6.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/pinctrl/nxp/pinctrl-imx6.c
> b/drivers/pinctrl/nxp/pinctrl-imx6.c
> index d7c95bb738..0c1e7a9c05 100644
> --- a/drivers/pinctrl/nxp/pinctrl-imx6.c
> +++ b/drivers/pinctrl/nxp/pinctrl-imx6.c
> @@ -10,7 +10,7 @@
>
> #include "pinctrl-imx.h"
>
> -static struct imx_pinctrl_soc_info imx6_pinctrl_soc_info;
> +static struct imx_pinctrl_soc_info imx6_pinctrl_soc_info
> +__section(".data");
>
> /* FIXME Before reloaction, BSS is overlapped with DT area */ static struct
> imx_pinctrl_soc_info imx6ul_pinctrl_soc_info = {
Reviewed-by: Peng Fan <peng.fan@nxp.com>
> --
> 2.11.0
^ permalink raw reply [flat|nested] 3+ messages in thread
* [U-Boot] [PATCH v2] pinctrl: imx: Define imx6_pinctrl_soc_info in .data section
2019-04-23 14:44 [U-Boot] [PATCH v2] pinctrl: imx: Define imx6_pinctrl_soc_info in .data section Lukasz Majewski
2019-04-24 1:39 ` Peng Fan
@ 2019-06-11 8:44 ` sbabic at denx.de
1 sibling, 0 replies; 3+ messages in thread
From: sbabic at denx.de @ 2019-06-11 8:44 UTC (permalink / raw)
To: u-boot
> This commit is necessary to be able to re-use the pinctrl code in early
> SPL to properly configure pins.
> The problem is that those "static" structures (without explicit
> initialization) are placed in the SDRAM area, which corresponds to
> u-boot proper (not even SPL).
> Hence, when one wants to configure pins before relocation via DTS/DM,
> the board hangs (imx6q SoC powered one) as only OCRAM area is available
> (0x009xxxxx).
> This commit prevents from this issue by moving the imx6_pinctrl_soc_info
> structure to data section (from BSS).
> Signed-off-by: Lukasz Majewski <lukma@denx.de>
> Reviewed-by: Peng Fan <peng.fan@nxp.com>
Applied to u-boot-imx, master, thanks !
Best regards,
Stefano Babic
--
=====================================================================
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-06-11 8:44 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-23 14:44 [U-Boot] [PATCH v2] pinctrl: imx: Define imx6_pinctrl_soc_info in .data section Lukasz Majewski
2019-04-24 1:39 ` Peng Fan
2019-06-11 8:44 ` sbabic at denx.de
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.