public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] imx: Use a convenient default value for SYS_MALLOC_F_LEN
@ 2019-05-03 12:25 Fabio Estevam
  2019-05-03 12:30 ` Joris Offouga
  2019-05-03 12:51 ` Auer, Lukas
  0 siblings, 2 replies; 4+ messages in thread
From: Fabio Estevam @ 2019-05-03 12:25 UTC (permalink / raw)
  To: u-boot

Commit 3a7c45f6a772 ("simple-bus: add DM_FLAG_PRE_RELOC flag to
simple-bus driver") causes some i.MX boards that were converted
to DM, such as warp7, to fail to boot.

As explained by Lukas Auer:

"With the patch, U-Boot probes the drivers for devices under simple-bus
device tree nodes in the pre-relocation device model. The default value
of CONFIG_SYS_MALLOC_F_LEN (0x400) leaves U-Boot with not enough memory to
do this, causing it to hang."

Fix this problem by providing a convenient default value for
CONFIG_SYS_MALLOC_F_LEN.

Reported-by: Pierre-Jean Texier <pjtexier@koncepto.io>
Suggested-by: Lukas Auer <lukas.auer@aisec.fraunhofer.de>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
---
 arch/arm/mach-imx/Kconfig | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/arch/arm/mach-imx/Kconfig b/arch/arm/mach-imx/Kconfig
index ec09ef240f..a7a7d84b7a 100644
--- a/arch/arm/mach-imx/Kconfig
+++ b/arch/arm/mach-imx/Kconfig
@@ -90,3 +90,6 @@ config DDRMC_VF610_CALIBRATION
 	  NXP does NOT recommend to perform this calibration at each boot. One
 	  shall perform it on a new PCB and then use those values to program
 	  the ddrmc_cr_setting on relevant board file.
+
+config SYS_MALLOC_F_LEN
+	default 0x2000
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [U-Boot] [PATCH] imx: Use a convenient default value for SYS_MALLOC_F_LEN
  2019-05-03 12:25 [U-Boot] [PATCH] imx: Use a convenient default value for SYS_MALLOC_F_LEN Fabio Estevam
@ 2019-05-03 12:30 ` Joris Offouga
  2019-05-03 12:51 ` Auer, Lukas
  1 sibling, 0 replies; 4+ messages in thread
From: Joris Offouga @ 2019-05-03 12:30 UTC (permalink / raw)
  To: u-boot

Tested-by: Joris Offouga <offougajoris@gmail.com>

Le 03/05/2019 à 14:25, Fabio Estevam a écrit :
> Commit 3a7c45f6a772 ("simple-bus: add DM_FLAG_PRE_RELOC flag to
> simple-bus driver") causes some i.MX boards that were converted
> to DM, such as warp7, to fail to boot.
>
> As explained by Lukas Auer:
>
> "With the patch, U-Boot probes the drivers for devices under simple-bus
> device tree nodes in the pre-relocation device model. The default value
> of CONFIG_SYS_MALLOC_F_LEN (0x400) leaves U-Boot with not enough memory to
> do this, causing it to hang."
>
> Fix this problem by providing a convenient default value for
> CONFIG_SYS_MALLOC_F_LEN.
>
> Reported-by: Pierre-Jean Texier <pjtexier@koncepto.io>
> Suggested-by: Lukas Auer <lukas.auer@aisec.fraunhofer.de>
> Signed-off-by: Fabio Estevam <festevam@gmail.com>
> ---
>   arch/arm/mach-imx/Kconfig | 3 +++
>   1 file changed, 3 insertions(+)
>
> diff --git a/arch/arm/mach-imx/Kconfig b/arch/arm/mach-imx/Kconfig
> index ec09ef240f..a7a7d84b7a 100644
> --- a/arch/arm/mach-imx/Kconfig
> +++ b/arch/arm/mach-imx/Kconfig
> @@ -90,3 +90,6 @@ config DDRMC_VF610_CALIBRATION
>   	  NXP does NOT recommend to perform this calibration at each boot. One
>   	  shall perform it on a new PCB and then use those values to program
>   	  the ddrmc_cr_setting on relevant board file.
> +
> +config SYS_MALLOC_F_LEN
> +	default 0x2000

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [U-Boot] [PATCH] imx: Use a convenient default value for SYS_MALLOC_F_LEN
  2019-05-03 12:25 [U-Boot] [PATCH] imx: Use a convenient default value for SYS_MALLOC_F_LEN Fabio Estevam
  2019-05-03 12:30 ` Joris Offouga
@ 2019-05-03 12:51 ` Auer, Lukas
  2019-05-03 13:59   ` Tom Rini
  1 sibling, 1 reply; 4+ messages in thread
From: Auer, Lukas @ 2019-05-03 12:51 UTC (permalink / raw)
  To: u-boot

On Fri, 2019-05-03 at 09:25 -0300, Fabio Estevam wrote:
> Commit 3a7c45f6a772 ("simple-bus: add DM_FLAG_PRE_RELOC flag to
> simple-bus driver") causes some i.MX boards that were converted
> to DM, such as warp7, to fail to boot.
> 
> As explained by Lukas Auer:
> 
> "With the patch, U-Boot probes the drivers for devices under simple-bus
> device tree nodes in the pre-relocation device model. The default value
> of CONFIG_SYS_MALLOC_F_LEN (0x400) leaves U-Boot with not enough memory to
> do this, causing it to hang."
> 
> Fix this problem by providing a convenient default value for
> CONFIG_SYS_MALLOC_F_LEN.
> 
> Reported-by: Pierre-Jean Texier <pjtexier@koncepto.io>
> Suggested-by: Lukas Auer <lukas.auer@aisec.fraunhofer.de>
> Signed-off-by: Fabio Estevam <festevam@gmail.com>
> ---
>  arch/arm/mach-imx/Kconfig | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/arch/arm/mach-imx/Kconfig b/arch/arm/mach-imx/Kconfig
> index ec09ef240f..a7a7d84b7a 100644
> --- a/arch/arm/mach-imx/Kconfig
> +++ b/arch/arm/mach-imx/Kconfig
> @@ -90,3 +90,6 @@ config DDRMC_VF610_CALIBRATION
>  	  NXP does NOT recommend to perform this calibration at each boot. One
>  	  shall perform it on a new PCB and then use those values to program
>  	  the ddrmc_cr_setting on relevant board file.
> +
> +config SYS_MALLOC_F_LEN
> +	default 0x2000

The file arch/arm/mach-imx/Kconfig is unconditionally include, so this
will set SYS_MALLOC_F_LEN for other boards as well. What I have done
locally is to include a depends on with all sub-families with DM
support. If you want you can just use it or I can also submit it as
well.

config SYS_MALLOC_F_LEN
	default 0x2000
	depends on ARCH_IMX8 || ARCH_IMX8M || ARCH_MX7 || ARCH_MX7ULP || \
		   ARCH_MX6 || ARCH_MX5

Thanks,
Lukas

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [U-Boot] [PATCH] imx: Use a convenient default value for SYS_MALLOC_F_LEN
  2019-05-03 12:51 ` Auer, Lukas
@ 2019-05-03 13:59   ` Tom Rini
  0 siblings, 0 replies; 4+ messages in thread
From: Tom Rini @ 2019-05-03 13:59 UTC (permalink / raw)
  To: u-boot

On Fri, May 03, 2019 at 12:51:24PM +0000, Auer, Lukas wrote:
> On Fri, 2019-05-03 at 09:25 -0300, Fabio Estevam wrote:
> > Commit 3a7c45f6a772 ("simple-bus: add DM_FLAG_PRE_RELOC flag to
> > simple-bus driver") causes some i.MX boards that were converted
> > to DM, such as warp7, to fail to boot.
> > 
> > As explained by Lukas Auer:
> > 
> > "With the patch, U-Boot probes the drivers for devices under simple-bus
> > device tree nodes in the pre-relocation device model. The default value
> > of CONFIG_SYS_MALLOC_F_LEN (0x400) leaves U-Boot with not enough memory to
> > do this, causing it to hang."
> > 
> > Fix this problem by providing a convenient default value for
> > CONFIG_SYS_MALLOC_F_LEN.
> > 
> > Reported-by: Pierre-Jean Texier <pjtexier@koncepto.io>
> > Suggested-by: Lukas Auer <lukas.auer@aisec.fraunhofer.de>
> > Signed-off-by: Fabio Estevam <festevam@gmail.com>
> > ---
> >  arch/arm/mach-imx/Kconfig | 3 +++
> >  1 file changed, 3 insertions(+)
> > 
> > diff --git a/arch/arm/mach-imx/Kconfig b/arch/arm/mach-imx/Kconfig
> > index ec09ef240f..a7a7d84b7a 100644
> > --- a/arch/arm/mach-imx/Kconfig
> > +++ b/arch/arm/mach-imx/Kconfig
> > @@ -90,3 +90,6 @@ config DDRMC_VF610_CALIBRATION
> >  	  NXP does NOT recommend to perform this calibration at each boot. One
> >  	  shall perform it on a new PCB and then use those values to program
> >  	  the ddrmc_cr_setting on relevant board file.
> > +
> > +config SYS_MALLOC_F_LEN
> > +	default 0x2000
> 
> The file arch/arm/mach-imx/Kconfig is unconditionally include, so this
> will set SYS_MALLOC_F_LEN for other boards as well. What I have done
> locally is to include a depends on with all sub-families with DM
> support. If you want you can just use it or I can also submit it as
> well.
> 
> config SYS_MALLOC_F_LEN
> 	default 0x2000
> 	depends on ARCH_IMX8 || ARCH_IMX8M || ARCH_MX7 || ARCH_MX7ULP || \
> 		   ARCH_MX6 || ARCH_MX5

But really we should do that in ./Kconfig with the other places that
have a default value for SYS_MALLOC_F_LEN.  And then once we've gotten
everyone converted we can try and figure out a perhaps cleaner way to
handle these kind of "default per SoC" values.

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20190503/68c53be6/attachment.sig>

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-05-03 13:59 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-05-03 12:25 [U-Boot] [PATCH] imx: Use a convenient default value for SYS_MALLOC_F_LEN Fabio Estevam
2019-05-03 12:30 ` Joris Offouga
2019-05-03 12:51 ` Auer, Lukas
2019-05-03 13:59   ` Tom Rini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox