Skip to contentSkip to conversation

Kconfig: enlarge CONFIG_SYS_MALLOC_F_LEN

PATCH In review Peng Fan (OSS) 4 participants 5 messages Sep 15, 2022 – Sep 18, 2022

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 Kconfig: enlarge CONFIG_SYS_MALLOC_F_LEN

From: Peng Fan <[email protected]>

"alloc space exhausted" happens in very early stage, which could be seen with DEBUG_UART options enabled and leeds to an non-functional board.

kontron_pitx_imx8m:
CONFIG_DEBUG_UART_BASE=0x30880000 # for serial3
CONFIG_DEBUG_UART_CLOCK=24000000

imx8mqevk:
CONFIG_DEBUG_UART_BASE=0x30860000 # for uart1
CONFIG_DEBUG_UART_CLOCK=24000000

It is because CONFIG_SYS_MALLOC_F_LEN is too small and still leave CONFIG_SPL_SYS_MALLOC_F_LEN as 0x2000.

---

V2:
set for all i.MX8MQ

 Kconfig | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
Kconfig +2 -1
index 991b260182e..c8c22555a94 100644
@@ -299,7 +299,7 @@ config SYS_MALLOC_F_LEN
 	default 0x4000 if SANDBOX || RISCV || ARCH_APPLE || ROCKCHIP_RK3368 || \
 			  ROCKCHIP_RK3399
 	default 0x8000 if RCAR_GEN3
-	default 0x10000 if ARCH_IMX8 || (ARCH_IMX8M && !IMX8MQ)
+	default 0x10000 if ARCH_IMX8 || ARCH_IMX8M
 	default 0x2000
 	help
 	  Before relocation, memory is very limited on many platforms. Still,
@@ -325,6 +325,7 @@ config SPL_SYS_MALLOC_F_LEN
 	depends on SYS_MALLOC_F && SPL
 	default 0 if !SPL_FRAMEWORK
 	default 0x2800 if RCAR_GEN3
+	default 0x2000 if IMX8MQ
 	default SYS_MALLOC_F_LEN
 	help
 	  In SPL memory is very limited on many platforms. Still,
Signature · 1 line
2.36.0
Reviewed-by Tested-by on v2 1/1
#1 lore raw

Hi,

Am Do., 15. Sept. 2022 um 02:53 Uhr schrieb Peng Fan (OSS) <[email protected]>:

Quoted 14 lines

From: Peng Fan <[email protected]>

"alloc space exhausted" happens in very early stage, which could be seen with DEBUG_UART options enabled and leeds to an non-functional board.

kontron_pitx_imx8m:
CONFIG_DEBUG_UART_BASE=0x30880000 # for serial3
CONFIG_DEBUG_UART_CLOCK=24000000

imx8mqevk:
CONFIG_DEBUG_UART_BASE=0x30860000 # for uart1
CONFIG_DEBUG_UART_CLOCK=24000000

Quoted 5 lines

It is because CONFIG_SYS_MALLOC_F_LEN is too small and still leave CONFIG_SPL_SYS_MALLOC_F_LEN as 0x2000.

Tested on:
- kontron-pitx-imx8m
- imx8mq_evk

Quoted 32 lines

---

V2:
set for all i.MX8MQ

 Kconfig | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
Kconfig +2 -2
index 991b260182e..c8c22555a94 100644
@@ -299,7 +299,7 @@ config SYS_MALLOC_F_LEN
        default 0x4000 if SANDBOX || RISCV || ARCH_APPLE || ROCKCHIP_RK3368 || \
                          ROCKCHIP_RK3399
        default 0x8000 if RCAR_GEN3
-       default 0x10000 if ARCH_IMX8 || (ARCH_IMX8M && !IMX8MQ)
+       default 0x10000 if ARCH_IMX8 || ARCH_IMX8M
        default 0x2000
        help
          Before relocation, memory is very limited on many platforms. Still,
@@ -325,6 +325,7 @@ config SPL_SYS_MALLOC_F_LEN
        depends on SYS_MALLOC_F && SPL
        default 0 if !SPL_FRAMEWORK
        default 0x2800 if RCAR_GEN3
+       default 0x2000 if IMX8MQ
        default SYS_MALLOC_F_LEN
        help
          In SPL memory is very limited on many platforms. Still,
--

2.36.0

Reviewed-by on v2 1/1
#2 lore raw
In reply to Peng Fan (OSS)

Hi Peng,

Quoted 14 lines · Peng Fan (OSS)

From: Peng Fan <[email protected]>

"alloc space exhausted" happens in very early stage, which could be seen with DEBUG_UART options enabled and leeds to an non-functional board.

kontron_pitx_imx8m:
CONFIG_DEBUG_UART_BASE=0x30880000 # for serial3
CONFIG_DEBUG_UART_CLOCK=24000000

imx8mqevk:
CONFIG_DEBUG_UART_BASE=0x30860000 # for uart1
CONFIG_DEBUG_UART_CLOCK=24000000

Quoted 5 lines

It is because CONFIG_SYS_MALLOC_F_LEN is too small and still leave CONFIG_SPL_SYS_MALLOC_F_LEN as 0x2000.

Thanks for addressing this issue at an SoC level:

#3 lore raw
In reply to Peng Fan (OSS)

Hi Stefano, Hi Tom,

Am Do., 15. Sept. 2022 um 02:53 Uhr schrieb Peng Fan (OSS) <[email protected]>:

Quoted 49 lines

From: Peng Fan <[email protected]>

"alloc space exhausted" happens in very early stage, which could be seen with DEBUG_UART options enabled and leeds to an non-functional board.

kontron_pitx_imx8m:
CONFIG_DEBUG_UART_BASE=0x30880000 # for serial3
CONFIG_DEBUG_UART_CLOCK=24000000

imx8mqevk:
CONFIG_DEBUG_UART_BASE=0x30860000 # for uart1
CONFIG_DEBUG_UART_CLOCK=24000000

It is because CONFIG_SYS_MALLOC_F_LEN is too small and still leave CONFIG_SPL_SYS_MALLOC_F_LEN as 0x2000.

---

V2:
set for all i.MX8MQ

 Kconfig | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
Kconfig +2 -2
index 991b260182e..c8c22555a94 100644
@@ -299,7 +299,7 @@ config SYS_MALLOC_F_LEN
        default 0x4000 if SANDBOX || RISCV || ARCH_APPLE || ROCKCHIP_RK3368 || \
                          ROCKCHIP_RK3399
        default 0x8000 if RCAR_GEN3
-       default 0x10000 if ARCH_IMX8 || (ARCH_IMX8M && !IMX8MQ)
+       default 0x10000 if ARCH_IMX8 || ARCH_IMX8M
        default 0x2000
        help
          Before relocation, memory is very limited on many platforms. Still,
@@ -325,6 +325,7 @@ config SPL_SYS_MALLOC_F_LEN
        depends on SYS_MALLOC_F && SPL
        default 0 if !SPL_FRAMEWORK
        default 0x2800 if RCAR_GEN3
+       default 0x2000 if IMX8MQ
        default SYS_MALLOC_F_LEN
        help
          In SPL memory is very limited on many platforms. Still,
--
Quoted 2 lines

2.36.0

Any chance to get this in the next RC?

Thanks

Signature · 1 line
Heiko
#4 lore raw

PATCH v2 1/1 Kconfig: enlarge CONFIG_SYS_MALLOC_F_LEN

In reply to Peng Fan (OSS)
Quoted 11 lines

From: Peng Fan <[email protected]>
"alloc space exhausted" happens in very early stage, which could be seen with DEBUG_UART options enabled and leeds to an non-functional board. kontron_pitx_imx8m:
CONFIG_DEBUG_UART_BASE=0x30880000 # for serial3
CONFIG_DEBUG_UART_CLOCK=24000000
imx8mqevk:
CONFIG_DEBUG_UART_BASE=0x30860000 # for uart1
CONFIG_DEBUG_UART_CLOCK=24000000
It is because CONFIG_SYS_MALLOC_F_LEN is too small and still leave CONFIG_SPL_SYS_MALLOC_F_LEN as 0x2000.

Quoted 5 lines

Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

Signature · 5 lines
=====================================================================
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: [email protected]
=====================================================================