Skip to contentSkip to conversation

imx: Use a convenient default value for SYS_MALLOC_F_LEN

PATCH Superseded Fabio Estevam 4 participants 4 messages May 3, 2019

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Fabio Estevam

author reviewer
#0 lore raw

PATCH 1/1 imx: Use a convenient default value for SYS_MALLOC_F_LEN

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.

---
 arch/arm/mach-imx/Kconfig | 3 +++
 1 file changed, 3 insertions(+)
arch/arm/mach-imx/Kconfig +3 -0
index ec09ef240f..a7a7d84b7a 100644
@@ -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
Signature · 1 line
2.17.1
#1 lore raw

PATCH 1/1 imx: Use a convenient default value for SYS_MALLOC_F_LEN

Le 03/05/2019 à 14:25, Fabio Estevam a écrit :

Quoted 32 lines

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.

---
  arch/arm/mach-imx/Kconfig | 3 +++
  1 file changed, 3 insertions(+)
arch/arm/mach-imx/Kconfig +3 -0
index ec09ef240f..a7a7d84b7a 100644
@@ -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 lore raw

PATCH 1/1 imx: Use a convenient default value for SYS_MALLOC_F_LEN

In reply to Fabio Estevam
Quoted 26 lines · Fabio Estevam

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.

---
 arch/arm/mach-imx/Kconfig | 3 +++
 1 file changed, 3 insertions(+)
arch/arm/mach-imx/Kconfig +0 -0
index ec09ef240f..a7a7d84b7a 100644

arch/arm/mach-imx/Kconfig config DDRMC_VF610_CALIBRATION · line 95

Quoted 6 lines
arch/arm/mach-imx/Kconfig +3 -0
@@ -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

#3 lore raw

PATCH 1/1 imx: Use a convenient default value for SYS_MALLOC_F_LEN

Quoted 40 lines · Lukas
Quoted 26 lines · Fabio Estevam

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.

---
 arch/arm/mach-imx/Kconfig | 3 +++
 1 file changed, 3 insertions(+)
arch/arm/mach-imx/Kconfig +0 -0
index ec09ef240f..a7a7d84b7a 100644

arch/arm/mach-imx/Kconfig config DDRMC_VF610_CALIBRATION · line 95

Quoted 6 lines
arch/arm/mach-imx/Kconfig +3 -0
@@ -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.

Quoted 4 lines

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.

Signature · 8 lines
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>