All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH] Kconfig: Fix SYS_MALLOC_F_LEN for i.MX8MQ
  2022-04-11  9:07 [PATCH] Kconfig: Fix SYS_MALLOC_F_LEN for i.MX8MQ Peng Fan (OSS)
@ 2022-04-11  8:28 ` Michael Nazzareno Trimarchi
  2022-04-11 10:32 ` Fabio Estevam
  2022-04-11 12:28 ` Tom Rini
  2 siblings, 0 replies; 10+ messages in thread
From: Michael Nazzareno Trimarchi @ 2022-04-11  8:28 UTC (permalink / raw)
  To: Peng Fan (OSS); +Cc: festevam, sbabic, u-boot, Peng Fan

Hi

On Mon, Apr 11, 2022 at 10:26 AM Peng Fan (OSS) <peng.fan@oss.nxp.com> wrote:
>
> From: Peng Fan <peng.fan@nxp.com>
>
> i.MX8MQ use SYS_MALLOC_F_LEN 0x2000, not 0x10000. The OCRAM_S only has
> 32KB memory, use 0x10000 will make SPL not bootable.
>
> Signed-off-by: Peng Fan <peng.fan@nxp.com>
> ---
>  Kconfig | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/Kconfig b/Kconfig
> index 6b1ddfc549e..3e95ec9d7b9 100644
> --- a/Kconfig
> +++ b/Kconfig
> @@ -251,8 +251,10 @@ config SYS_MALLOC_F_LEN
>         default 0x4000 if SANDBOX || RISCV
>         default 0x2000 if (ARCH_MX7 || ARCH_MX7ULP || ARCH_MX6 || ARCH_MX5 || \
>                            ARCH_QEMU || ARCH_SUNXI || ARCH_OWL)
> -       default 0x10000 if (ARCH_IMX8 || ARCH_IMX8M || ARCH_LS1012A || \
> -                           ARCH_LS1021A || ARCH_LS1043A || ARCH_LS1046A)
> +       default 0x10000 if (ARCH_IMX8 || (ARCH_IMX8M && !IMX8MQ) || \
> +                           ARCH_LS1012A || ARCH_LS1021A || ARCH_LS1043A || \
> +                           ARCH_LS1046A)
> +       default 0x2000 if IMX8MQ
>         default 0x400
>         help
>           Before relocation, memory is very limited on many platforms. Still,
> --
> 2.35.1
>

Reviewed-by: Michael Trimarchi <michael@amarulasolutions.com>

-- 
Michael Nazzareno Trimarchi
Co-Founder & Chief Executive Officer
M. +39 347 913 2170
michael@amarulasolutions.com
__________________________________

Amarula Solutions BV
Joop Geesinkweg 125, 1114 AB, Amsterdam, NL
T. +31 (0)85 111 9172
info@amarulasolutions.com
www.amarulasolutions.com

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

* [PATCH] Kconfig: Fix SYS_MALLOC_F_LEN for i.MX8MQ
@ 2022-04-11  9:07 Peng Fan (OSS)
  2022-04-11  8:28 ` Michael Nazzareno Trimarchi
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Peng Fan (OSS) @ 2022-04-11  9:07 UTC (permalink / raw)
  To: festevam, sbabic; +Cc: u-boot, Peng Fan

From: Peng Fan <peng.fan@nxp.com>

i.MX8MQ use SYS_MALLOC_F_LEN 0x2000, not 0x10000. The OCRAM_S only has
32KB memory, use 0x10000 will make SPL not bootable.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
 Kconfig | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/Kconfig b/Kconfig
index 6b1ddfc549e..3e95ec9d7b9 100644
--- a/Kconfig
+++ b/Kconfig
@@ -251,8 +251,10 @@ config SYS_MALLOC_F_LEN
 	default 0x4000 if SANDBOX || RISCV
 	default 0x2000 if (ARCH_MX7 || ARCH_MX7ULP || ARCH_MX6 || ARCH_MX5 || \
 			   ARCH_QEMU || ARCH_SUNXI || ARCH_OWL)
-	default 0x10000 if (ARCH_IMX8 || ARCH_IMX8M || ARCH_LS1012A || \
-			    ARCH_LS1021A || ARCH_LS1043A || ARCH_LS1046A)
+	default 0x10000 if (ARCH_IMX8 || (ARCH_IMX8M && !IMX8MQ) || \
+			    ARCH_LS1012A || ARCH_LS1021A || ARCH_LS1043A || \
+			    ARCH_LS1046A)
+	default 0x2000 if IMX8MQ
 	default 0x400
 	help
 	  Before relocation, memory is very limited on many platforms. Still,
-- 
2.35.1


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

* Re: [PATCH] Kconfig: Fix SYS_MALLOC_F_LEN for i.MX8MQ
  2022-04-11  9:07 [PATCH] Kconfig: Fix SYS_MALLOC_F_LEN for i.MX8MQ Peng Fan (OSS)
  2022-04-11  8:28 ` Michael Nazzareno Trimarchi
@ 2022-04-11 10:32 ` Fabio Estevam
  2022-04-11 12:28 ` Tom Rini
  2 siblings, 0 replies; 10+ messages in thread
From: Fabio Estevam @ 2022-04-11 10:32 UTC (permalink / raw)
  To: Peng Fan (OSS); +Cc: sbabic, u-boot, Peng Fan, trini

Hi Peng,

On 11/04/2022 06:07, Peng Fan (OSS) wrote:
> From: Peng Fan <peng.fan@nxp.com>
> 
> i.MX8MQ use SYS_MALLOC_F_LEN 0x2000, not 0x10000. The OCRAM_S only has
> 32KB memory, use 0x10000 will make SPL not bootable.
> 
> Signed-off-by: Peng Fan <peng.fan@nxp.com>
> ---
>  Kconfig | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/Kconfig b/Kconfig
> index 6b1ddfc549e..3e95ec9d7b9 100644
> --- a/Kconfig
> +++ b/Kconfig
> @@ -251,8 +251,10 @@ config SYS_MALLOC_F_LEN
>  	default 0x4000 if SANDBOX || RISCV
>  	default 0x2000 if (ARCH_MX7 || ARCH_MX7ULP || ARCH_MX6 || ARCH_MX5 || 
> \
>  			   ARCH_QEMU || ARCH_SUNXI || ARCH_OWL)
> -	default 0x10000 if (ARCH_IMX8 || ARCH_IMX8M || ARCH_LS1012A || \
> -			    ARCH_LS1021A || ARCH_LS1043A || ARCH_LS1046A)
> +	default 0x10000 if (ARCH_IMX8 || (ARCH_IMX8M && !IMX8MQ) || \
> +			    ARCH_LS1012A || ARCH_LS1021A || ARCH_LS1043A || \
> +			    ARCH_LS1046A)
> +	default 0x2000 if IMX8MQ

Thanks for the fix:

Reviewed-by: Fabio Estevam <festevam@denx.de>


-- 
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-60 Fax: (+49)-8142-66989-80 Email: 
festevam@denx.de

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

* Re: [PATCH] Kconfig: Fix SYS_MALLOC_F_LEN for i.MX8MQ
  2022-04-11  9:07 [PATCH] Kconfig: Fix SYS_MALLOC_F_LEN for i.MX8MQ Peng Fan (OSS)
  2022-04-11  8:28 ` Michael Nazzareno Trimarchi
  2022-04-11 10:32 ` Fabio Estevam
@ 2022-04-11 12:28 ` Tom Rini
  2022-07-05 10:19   ` Heiko Thiery
  2 siblings, 1 reply; 10+ messages in thread
From: Tom Rini @ 2022-04-11 12:28 UTC (permalink / raw)
  To: Peng Fan (OSS); +Cc: festevam, sbabic, u-boot, Peng Fan

[-- Attachment #1: Type: text/plain, Size: 1461 bytes --]

On Mon, Apr 11, 2022 at 05:07:04PM +0800, Peng Fan (OSS) wrote:

> From: Peng Fan <peng.fan@nxp.com>
> 
> i.MX8MQ use SYS_MALLOC_F_LEN 0x2000, not 0x10000. The OCRAM_S only has
> 32KB memory, use 0x10000 will make SPL not bootable.
> 
> Signed-off-by: Peng Fan <peng.fan@nxp.com>
> Reviewed-by: Michael Trimarchi <michael@amarulasolutions.com>
> Reviewed-by: Fabio Estevam <festevam@denx.de>
> ---
>  Kconfig | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/Kconfig b/Kconfig
> index 6b1ddfc549e..3e95ec9d7b9 100644
> --- a/Kconfig
> +++ b/Kconfig
> @@ -251,8 +251,10 @@ config SYS_MALLOC_F_LEN
>  	default 0x4000 if SANDBOX || RISCV
>  	default 0x2000 if (ARCH_MX7 || ARCH_MX7ULP || ARCH_MX6 || ARCH_MX5 || \
>  			   ARCH_QEMU || ARCH_SUNXI || ARCH_OWL)
> -	default 0x10000 if (ARCH_IMX8 || ARCH_IMX8M || ARCH_LS1012A || \
> -			    ARCH_LS1021A || ARCH_LS1043A || ARCH_LS1046A)
> +	default 0x10000 if (ARCH_IMX8 || (ARCH_IMX8M && !IMX8MQ) || \
> +			    ARCH_LS1012A || ARCH_LS1021A || ARCH_LS1043A || \
> +			    ARCH_LS1046A)
> +	default 0x2000 if IMX8MQ
>  	default 0x400
>  	help
>  	  Before relocation, memory is very limited on many platforms. Still,

Note that we can put this with the rest of the 0x2000 default instances.
And as an aside, imx8mq_phanbell_defconfig sets this to 0x4000.  That
said, I've applied this to master (with the location change I noted), thanks!

-- 
Tom

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]

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

* Re: [PATCH] Kconfig: Fix SYS_MALLOC_F_LEN for i.MX8MQ
  2022-04-11 12:28 ` Tom Rini
@ 2022-07-05 10:19   ` Heiko Thiery
  2022-07-05 13:35     ` Tom Rini
  0 siblings, 1 reply; 10+ messages in thread
From: Heiko Thiery @ 2022-07-05 10:19 UTC (permalink / raw)
  To: Tom Rini; +Cc: Peng Fan (OSS), festevam, sbabic, u-boot, Peng Fan

Hi all,

Am Mo., 11. Apr. 2022 um 14:29 Uhr schrieb Tom Rini <trini@konsulko.com>:
>
> On Mon, Apr 11, 2022 at 05:07:04PM +0800, Peng Fan (OSS) wrote:
>
> > From: Peng Fan <peng.fan@nxp.com>
> >
> > i.MX8MQ use SYS_MALLOC_F_LEN 0x2000, not 0x10000. The OCRAM_S only has
> > 32KB memory, use 0x10000 will make SPL not bootable.
> >
> > Signed-off-by: Peng Fan <peng.fan@nxp.com>
> > Reviewed-by: Michael Trimarchi <michael@amarulasolutions.com>
> > Reviewed-by: Fabio Estevam <festevam@denx.de>
> > ---
> >  Kconfig | 6 ++++--
> >  1 file changed, 4 insertions(+), 2 deletions(-)
> >
> > diff --git a/Kconfig b/Kconfig
> > index 6b1ddfc549e..3e95ec9d7b9 100644
> > --- a/Kconfig
> > +++ b/Kconfig
> > @@ -251,8 +251,10 @@ config SYS_MALLOC_F_LEN
> >       default 0x4000 if SANDBOX || RISCV
> >       default 0x2000 if (ARCH_MX7 || ARCH_MX7ULP || ARCH_MX6 || ARCH_MX5 || \
> >                          ARCH_QEMU || ARCH_SUNXI || ARCH_OWL)
> > -     default 0x10000 if (ARCH_IMX8 || ARCH_IMX8M || ARCH_LS1012A || \
> > -                         ARCH_LS1021A || ARCH_LS1043A || ARCH_LS1046A)
> > +     default 0x10000 if (ARCH_IMX8 || (ARCH_IMX8M && !IMX8MQ) || \
> > +                         ARCH_LS1012A || ARCH_LS1021A || ARCH_LS1043A || \
> > +                         ARCH_LS1046A)
> > +     default 0x2000 if IMX8MQ
> >       default 0x400
> >       help
> >         Before relocation, memory is very limited on many platforms. Still,
>
> Note that we can put this with the rest of the 0x2000 default instances.
> And as an aside, imx8mq_phanbell_defconfig sets this to 0x4000.  That
> said, I've applied this to master (with the location change I noted), thanks!
>
> --
> Tom

I just tested v2022.07-rc6 and noticed that by reducing the value the
kontron pitx-imx8m (imx8mq) board does not start anymore. I locally
increased the value to 0xc000 and the board works again.

So should I increase the value just for this board or should I
increase the default value for the IMX8MQ?

-- 
Heiko

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

* Re: [PATCH] Kconfig: Fix SYS_MALLOC_F_LEN for i.MX8MQ
  2022-07-05 10:19   ` Heiko Thiery
@ 2022-07-05 13:35     ` Tom Rini
  2022-07-05 15:20       ` Heiko Thiery
  0 siblings, 1 reply; 10+ messages in thread
From: Tom Rini @ 2022-07-05 13:35 UTC (permalink / raw)
  To: Heiko Thiery; +Cc: Peng Fan (OSS), festevam, sbabic, u-boot, Peng Fan

[-- Attachment #1: Type: text/plain, Size: 2699 bytes --]

On Tue, Jul 05, 2022 at 12:19:54PM +0200, Heiko Thiery wrote:
> Hi all,
> 
> Am Mo., 11. Apr. 2022 um 14:29 Uhr schrieb Tom Rini <trini@konsulko.com>:
> >
> > On Mon, Apr 11, 2022 at 05:07:04PM +0800, Peng Fan (OSS) wrote:
> >
> > > From: Peng Fan <peng.fan@nxp.com>
> > >
> > > i.MX8MQ use SYS_MALLOC_F_LEN 0x2000, not 0x10000. The OCRAM_S only has
> > > 32KB memory, use 0x10000 will make SPL not bootable.
> > >
> > > Signed-off-by: Peng Fan <peng.fan@nxp.com>
> > > Reviewed-by: Michael Trimarchi <michael@amarulasolutions.com>
> > > Reviewed-by: Fabio Estevam <festevam@denx.de>
> > > ---
> > >  Kconfig | 6 ++++--
> > >  1 file changed, 4 insertions(+), 2 deletions(-)
> > >
> > > diff --git a/Kconfig b/Kconfig
> > > index 6b1ddfc549e..3e95ec9d7b9 100644
> > > --- a/Kconfig
> > > +++ b/Kconfig
> > > @@ -251,8 +251,10 @@ config SYS_MALLOC_F_LEN
> > >       default 0x4000 if SANDBOX || RISCV
> > >       default 0x2000 if (ARCH_MX7 || ARCH_MX7ULP || ARCH_MX6 || ARCH_MX5 || \
> > >                          ARCH_QEMU || ARCH_SUNXI || ARCH_OWL)
> > > -     default 0x10000 if (ARCH_IMX8 || ARCH_IMX8M || ARCH_LS1012A || \
> > > -                         ARCH_LS1021A || ARCH_LS1043A || ARCH_LS1046A)
> > > +     default 0x10000 if (ARCH_IMX8 || (ARCH_IMX8M && !IMX8MQ) || \
> > > +                         ARCH_LS1012A || ARCH_LS1021A || ARCH_LS1043A || \
> > > +                         ARCH_LS1046A)
> > > +     default 0x2000 if IMX8MQ
> > >       default 0x400
> > >       help
> > >         Before relocation, memory is very limited on many platforms. Still,
> >
> > Note that we can put this with the rest of the 0x2000 default instances.
> > And as an aside, imx8mq_phanbell_defconfig sets this to 0x4000.  That
> > said, I've applied this to master (with the location change I noted), thanks!
> >
> > --
> > Tom
> 
> I just tested v2022.07-rc6 and noticed that by reducing the value the
> kontron pitx-imx8m (imx8mq) board does not start anymore. I locally
> increased the value to 0xc000 and the board works again.
> 
> So should I increase the value just for this board or should I
> increase the default value for the IMX8MQ?

I would _really_ like to see defaults per SoC.  Even if that means
saying "default 0xc000 if IMX8Q && SPL_FEAT_X" as I know with tight
constraints on memory AND the need to have some of the bigger feature
knobs enabled it can be tricky to get usable defaults.  But what I
really want to avoid are both the problem of everyone copy/pasting a
value that's too big or too small and also avoid the problem of N boards
needing the same fix because they all failed due to the same problem.

-- 
Tom

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]

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

* Re: [PATCH] Kconfig: Fix SYS_MALLOC_F_LEN for i.MX8MQ
  2022-07-05 13:35     ` Tom Rini
@ 2022-07-05 15:20       ` Heiko Thiery
  2022-07-05 16:04         ` Tom Rini
  0 siblings, 1 reply; 10+ messages in thread
From: Heiko Thiery @ 2022-07-05 15:20 UTC (permalink / raw)
  To: Tom Rini; +Cc: Peng Fan (OSS), festevam, sbabic, u-boot, Peng Fan

Hi Tom,

Am Di., 5. Juli 2022 um 15:35 Uhr schrieb Tom Rini <trini@konsulko.com>:
>
> On Tue, Jul 05, 2022 at 12:19:54PM +0200, Heiko Thiery wrote:
> > Hi all,
> >
> > Am Mo., 11. Apr. 2022 um 14:29 Uhr schrieb Tom Rini <trini@konsulko.com>:
> > >
> > > On Mon, Apr 11, 2022 at 05:07:04PM +0800, Peng Fan (OSS) wrote:
> > >
> > > > From: Peng Fan <peng.fan@nxp.com>
> > > >
> > > > i.MX8MQ use SYS_MALLOC_F_LEN 0x2000, not 0x10000. The OCRAM_S only has
> > > > 32KB memory, use 0x10000 will make SPL not bootable.
> > > >
> > > > Signed-off-by: Peng Fan <peng.fan@nxp.com>
> > > > Reviewed-by: Michael Trimarchi <michael@amarulasolutions.com>
> > > > Reviewed-by: Fabio Estevam <festevam@denx.de>
> > > > ---
> > > >  Kconfig | 6 ++++--
> > > >  1 file changed, 4 insertions(+), 2 deletions(-)
> > > >
> > > > diff --git a/Kconfig b/Kconfig
> > > > index 6b1ddfc549e..3e95ec9d7b9 100644
> > > > --- a/Kconfig
> > > > +++ b/Kconfig
> > > > @@ -251,8 +251,10 @@ config SYS_MALLOC_F_LEN
> > > >       default 0x4000 if SANDBOX || RISCV
> > > >       default 0x2000 if (ARCH_MX7 || ARCH_MX7ULP || ARCH_MX6 || ARCH_MX5 || \
> > > >                          ARCH_QEMU || ARCH_SUNXI || ARCH_OWL)
> > > > -     default 0x10000 if (ARCH_IMX8 || ARCH_IMX8M || ARCH_LS1012A || \
> > > > -                         ARCH_LS1021A || ARCH_LS1043A || ARCH_LS1046A)
> > > > +     default 0x10000 if (ARCH_IMX8 || (ARCH_IMX8M && !IMX8MQ) || \
> > > > +                         ARCH_LS1012A || ARCH_LS1021A || ARCH_LS1043A || \
> > > > +                         ARCH_LS1046A)
> > > > +     default 0x2000 if IMX8MQ
> > > >       default 0x400
> > > >       help
> > > >         Before relocation, memory is very limited on many platforms. Still,
> > >
> > > Note that we can put this with the rest of the 0x2000 default instances.
> > > And as an aside, imx8mq_phanbell_defconfig sets this to 0x4000.  That
> > > said, I've applied this to master (with the location change I noted), thanks!
> > >
> > > --
> > > Tom
> >
> > I just tested v2022.07-rc6 and noticed that by reducing the value the
> > kontron pitx-imx8m (imx8mq) board does not start anymore. I locally
> > increased the value to 0xc000 and the board works again.
> >
> > So should I increase the value just for this board or should I
> > increase the default value for the IMX8MQ?
>
> I would _really_ like to see defaults per SoC.  Even if that means
> saying "default 0xc000 if IMX8Q && SPL_FEAT_X" as I know with tight
> constraints on memory AND the need to have some of the bigger feature
> knobs enabled it can be tricky to get usable defaults.  But what I
> really want to avoid are both the problem of everyone copy/pasting a
> value that's too big or too small and also avoid the problem of N boards
> needing the same fix because they all failed due to the same problem.

I understand your concerns but the value that has to be adjusted is
not SPL_SYS_MALLOC_F_LEN. Therefore I'm not sure if the '&&
SPL_FEAT_X' would be correct here.

> --
> Tom

-- 
Heiko

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

* Re: [PATCH] Kconfig: Fix SYS_MALLOC_F_LEN for i.MX8MQ
  2022-07-05 15:20       ` Heiko Thiery
@ 2022-07-05 16:04         ` Tom Rini
  2022-07-06  9:01           ` Heiko Thiery
  0 siblings, 1 reply; 10+ messages in thread
From: Tom Rini @ 2022-07-05 16:04 UTC (permalink / raw)
  To: Heiko Thiery; +Cc: Peng Fan (OSS), festevam, sbabic, u-boot, Peng Fan

[-- Attachment #1: Type: text/plain, Size: 3376 bytes --]

On Tue, Jul 05, 2022 at 05:20:46PM +0200, Heiko Thiery wrote:
> Hi Tom,
> 
> Am Di., 5. Juli 2022 um 15:35 Uhr schrieb Tom Rini <trini@konsulko.com>:
> >
> > On Tue, Jul 05, 2022 at 12:19:54PM +0200, Heiko Thiery wrote:
> > > Hi all,
> > >
> > > Am Mo., 11. Apr. 2022 um 14:29 Uhr schrieb Tom Rini <trini@konsulko.com>:
> > > >
> > > > On Mon, Apr 11, 2022 at 05:07:04PM +0800, Peng Fan (OSS) wrote:
> > > >
> > > > > From: Peng Fan <peng.fan@nxp.com>
> > > > >
> > > > > i.MX8MQ use SYS_MALLOC_F_LEN 0x2000, not 0x10000. The OCRAM_S only has
> > > > > 32KB memory, use 0x10000 will make SPL not bootable.
> > > > >
> > > > > Signed-off-by: Peng Fan <peng.fan@nxp.com>
> > > > > Reviewed-by: Michael Trimarchi <michael@amarulasolutions.com>
> > > > > Reviewed-by: Fabio Estevam <festevam@denx.de>
> > > > > ---
> > > > >  Kconfig | 6 ++++--
> > > > >  1 file changed, 4 insertions(+), 2 deletions(-)
> > > > >
> > > > > diff --git a/Kconfig b/Kconfig
> > > > > index 6b1ddfc549e..3e95ec9d7b9 100644
> > > > > --- a/Kconfig
> > > > > +++ b/Kconfig
> > > > > @@ -251,8 +251,10 @@ config SYS_MALLOC_F_LEN
> > > > >       default 0x4000 if SANDBOX || RISCV
> > > > >       default 0x2000 if (ARCH_MX7 || ARCH_MX7ULP || ARCH_MX6 || ARCH_MX5 || \
> > > > >                          ARCH_QEMU || ARCH_SUNXI || ARCH_OWL)
> > > > > -     default 0x10000 if (ARCH_IMX8 || ARCH_IMX8M || ARCH_LS1012A || \
> > > > > -                         ARCH_LS1021A || ARCH_LS1043A || ARCH_LS1046A)
> > > > > +     default 0x10000 if (ARCH_IMX8 || (ARCH_IMX8M && !IMX8MQ) || \
> > > > > +                         ARCH_LS1012A || ARCH_LS1021A || ARCH_LS1043A || \
> > > > > +                         ARCH_LS1046A)
> > > > > +     default 0x2000 if IMX8MQ
> > > > >       default 0x400
> > > > >       help
> > > > >         Before relocation, memory is very limited on many platforms. Still,
> > > >
> > > > Note that we can put this with the rest of the 0x2000 default instances.
> > > > And as an aside, imx8mq_phanbell_defconfig sets this to 0x4000.  That
> > > > said, I've applied this to master (with the location change I noted), thanks!
> > > >
> > > > --
> > > > Tom
> > >
> > > I just tested v2022.07-rc6 and noticed that by reducing the value the
> > > kontron pitx-imx8m (imx8mq) board does not start anymore. I locally
> > > increased the value to 0xc000 and the board works again.
> > >
> > > So should I increase the value just for this board or should I
> > > increase the default value for the IMX8MQ?
> >
> > I would _really_ like to see defaults per SoC.  Even if that means
> > saying "default 0xc000 if IMX8Q && SPL_FEAT_X" as I know with tight
> > constraints on memory AND the need to have some of the bigger feature
> > knobs enabled it can be tricky to get usable defaults.  But what I
> > really want to avoid are both the problem of everyone copy/pasting a
> > value that's too big or too small and also avoid the problem of N boards
> > needing the same fix because they all failed due to the same problem.
> 
> I understand your concerns but the value that has to be adjusted is
> not SPL_SYS_MALLOC_F_LEN. Therefore I'm not sure if the '&&
> SPL_FEAT_X' would be correct here.

Ah right, sorry.  So yes, it's even more likely we should be able to
come up with one default for the family.

-- 
Tom

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]

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

* Re: [PATCH] Kconfig: Fix SYS_MALLOC_F_LEN for i.MX8MQ
  2022-07-05 16:04         ` Tom Rini
@ 2022-07-06  9:01           ` Heiko Thiery
  2022-07-06 22:51             ` Peng Fan
  0 siblings, 1 reply; 10+ messages in thread
From: Heiko Thiery @ 2022-07-06  9:01 UTC (permalink / raw)
  To: Peng Fan, Peng Fan (OSS); +Cc: festevam, sbabic, u-boot, Tom Rini

Hi Peng

Am Di., 5. Juli 2022 um 18:04 Uhr schrieb Tom Rini <trini@konsulko.com>:
>
> On Tue, Jul 05, 2022 at 05:20:46PM +0200, Heiko Thiery wrote:
> > Hi Tom,
> >
> > Am Di., 5. Juli 2022 um 15:35 Uhr schrieb Tom Rini <trini@konsulko.com>:
> > >
> > > On Tue, Jul 05, 2022 at 12:19:54PM +0200, Heiko Thiery wrote:
> > > > Hi all,
> > > >
> > > > Am Mo., 11. Apr. 2022 um 14:29 Uhr schrieb Tom Rini <trini@konsulko.com>:
> > > > >
> > > > > On Mon, Apr 11, 2022 at 05:07:04PM +0800, Peng Fan (OSS) wrote:
> > > > >
> > > > > > From: Peng Fan <peng.fan@nxp.com>
> > > > > >
> > > > > > i.MX8MQ use SYS_MALLOC_F_LEN 0x2000, not 0x10000. The OCRAM_S only has
> > > > > > 32KB memory, use 0x10000 will make SPL not bootable.

It is strange. You said the i.MX8MQ has 32KB OCRAM memory. That means
a value of 0x8000 should be the max usable value. But I see when
setting to this value my board does not start. Only when I set the
value to 0xc000 the board starts.

In the RM I see:
- On-Chip RAM - OCRAM (128 KB)
- On-Chip RAM for State Retention - OCRAM_S (32 KB)

> > > > > >
> > > > > > Signed-off-by: Peng Fan <peng.fan@nxp.com>
> > > > > > Reviewed-by: Michael Trimarchi <michael@amarulasolutions.com>
> > > > > > Reviewed-by: Fabio Estevam <festevam@denx.de>
> > > > > > ---
> > > > > >  Kconfig | 6 ++++--
> > > > > >  1 file changed, 4 insertions(+), 2 deletions(-)
> > > > > >
> > > > > > diff --git a/Kconfig b/Kconfig
> > > > > > index 6b1ddfc549e..3e95ec9d7b9 100644
> > > > > > --- a/Kconfig
> > > > > > +++ b/Kconfig
> > > > > > @@ -251,8 +251,10 @@ config SYS_MALLOC_F_LEN
> > > > > >       default 0x4000 if SANDBOX || RISCV
> > > > > >       default 0x2000 if (ARCH_MX7 || ARCH_MX7ULP || ARCH_MX6 || ARCH_MX5 || \
> > > > > >                          ARCH_QEMU || ARCH_SUNXI || ARCH_OWL)
> > > > > > -     default 0x10000 if (ARCH_IMX8 || ARCH_IMX8M || ARCH_LS1012A || \
> > > > > > -                         ARCH_LS1021A || ARCH_LS1043A || ARCH_LS1046A)
> > > > > > +     default 0x10000 if (ARCH_IMX8 || (ARCH_IMX8M && !IMX8MQ) || \
> > > > > > +                         ARCH_LS1012A || ARCH_LS1021A || ARCH_LS1043A || \
> > > > > > +                         ARCH_LS1046A)
> > > > > > +     default 0x2000 if IMX8MQ
> > > > > >       default 0x400
> > > > > >       help
> > > > > >         Before relocation, memory is very limited on many platforms. Still,
> > > > >
> > > > > Note that we can put this with the rest of the 0x2000 default instances.
> > > > > And as an aside, imx8mq_phanbell_defconfig sets this to 0x4000.  That
> > > > > said, I've applied this to master (with the location change I noted), thanks!
> > > > >
> > > > > --
> > > > > Tom
> > > >
> > > > I just tested v2022.07-rc6 and noticed that by reducing the value the
> > > > kontron pitx-imx8m (imx8mq) board does not start anymore. I locally
> > > > increased the value to 0xc000 and the board works again.
> > > >
> > > > So should I increase the value just for this board or should I
> > > > increase the default value for the IMX8MQ?
> > >
> > > I would _really_ like to see defaults per SoC.  Even if that means
> > > saying "default 0xc000 if IMX8Q && SPL_FEAT_X" as I know with tight
> > > constraints on memory AND the need to have some of the bigger feature
> > > knobs enabled it can be tricky to get usable defaults.  But what I
> > > really want to avoid are both the problem of everyone copy/pasting a
> > > value that's too big or too small and also avoid the problem of N boards
> > > needing the same fix because they all failed due to the same problem.
> >
> > I understand your concerns but the value that has to be adjusted is
> > not SPL_SYS_MALLOC_F_LEN. Therefore I'm not sure if the '&&
> > SPL_FEAT_X' would be correct here.
>
> Ah right, sorry.  So yes, it's even more likely we should be able to
> come up with one default for the family.
>
> --
> Tom

--
Heiko

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

* Re: [PATCH] Kconfig: Fix SYS_MALLOC_F_LEN for i.MX8MQ
  2022-07-06  9:01           ` Heiko Thiery
@ 2022-07-06 22:51             ` Peng Fan
  0 siblings, 0 replies; 10+ messages in thread
From: Peng Fan @ 2022-07-06 22:51 UTC (permalink / raw)
  To: Heiko Thiery, Peng Fan; +Cc: festevam, sbabic, u-boot, Tom Rini



On 7/6/2022 5:01 PM, Heiko Thiery wrote:
> Hi Peng
> 
> Am Di., 5. Juli 2022 um 18:04 Uhr schrieb Tom Rini <trini@konsulko.com>:
>>
>> On Tue, Jul 05, 2022 at 05:20:46PM +0200, Heiko Thiery wrote:
>>> Hi Tom,
>>>
>>> Am Di., 5. Juli 2022 um 15:35 Uhr schrieb Tom Rini <trini@konsulko.com>:
>>>>
>>>> On Tue, Jul 05, 2022 at 12:19:54PM +0200, Heiko Thiery wrote:
>>>>> Hi all,
>>>>>
>>>>> Am Mo., 11. Apr. 2022 um 14:29 Uhr schrieb Tom Rini <trini@konsulko.com>:
>>>>>>
>>>>>> On Mon, Apr 11, 2022 at 05:07:04PM +0800, Peng Fan (OSS) wrote:
>>>>>>
>>>>>>> From: Peng Fan <peng.fan@nxp.com>
>>>>>>>
>>>>>>> i.MX8MQ use SYS_MALLOC_F_LEN 0x2000, not 0x10000. The OCRAM_S only has
>>>>>>> 32KB memory, use 0x10000 will make SPL not bootable.
> 
> It is strange. You said the i.MX8MQ has 32KB OCRAM memory. That means
> a value of 0x8000 should be the max usable value. But I see when
> setting to this value my board does not start. Only when I set the
> value to 0xc000 the board starts.
> 
> In the RM I see:
> - On-Chip RAM - OCRAM (128 KB)
> - On-Chip RAM for State Retention - OCRAM_S (32 KB)

Yes. I said OCRAM_S only has 32KB. The MALLOC BASE is set in OCRAM_S.

If your board has other settings, you could change that for your
requirement. I think I have checked all boards, When I worked out
this patch, I may overlook your board.

Regards,
Peng.

> 
>>>>>>>
>>>>>>> Signed-off-by: Peng Fan <peng.fan@nxp.com>
>>>>>>> Reviewed-by: Michael Trimarchi <michael@amarulasolutions.com>
>>>>>>> Reviewed-by: Fabio Estevam <festevam@denx.de>
>>>>>>> ---
>>>>>>>   Kconfig | 6 ++++--
>>>>>>>   1 file changed, 4 insertions(+), 2 deletions(-)
>>>>>>>
>>>>>>> diff --git a/Kconfig b/Kconfig
>>>>>>> index 6b1ddfc549e..3e95ec9d7b9 100644
>>>>>>> --- a/Kconfig
>>>>>>> +++ b/Kconfig
>>>>>>> @@ -251,8 +251,10 @@ config SYS_MALLOC_F_LEN
>>>>>>>        default 0x4000 if SANDBOX || RISCV
>>>>>>>        default 0x2000 if (ARCH_MX7 || ARCH_MX7ULP || ARCH_MX6 || ARCH_MX5 || \
>>>>>>>                           ARCH_QEMU || ARCH_SUNXI || ARCH_OWL)
>>>>>>> -     default 0x10000 if (ARCH_IMX8 || ARCH_IMX8M || ARCH_LS1012A || \
>>>>>>> -                         ARCH_LS1021A || ARCH_LS1043A || ARCH_LS1046A)
>>>>>>> +     default 0x10000 if (ARCH_IMX8 || (ARCH_IMX8M && !IMX8MQ) || \
>>>>>>> +                         ARCH_LS1012A || ARCH_LS1021A || ARCH_LS1043A || \
>>>>>>> +                         ARCH_LS1046A)
>>>>>>> +     default 0x2000 if IMX8MQ
>>>>>>>        default 0x400
>>>>>>>        help
>>>>>>>          Before relocation, memory is very limited on many platforms. Still,
>>>>>>
>>>>>> Note that we can put this with the rest of the 0x2000 default instances.
>>>>>> And as an aside, imx8mq_phanbell_defconfig sets this to 0x4000.  That
>>>>>> said, I've applied this to master (with the location change I noted), thanks!
>>>>>>
>>>>>> --
>>>>>> Tom
>>>>>
>>>>> I just tested v2022.07-rc6 and noticed that by reducing the value the
>>>>> kontron pitx-imx8m (imx8mq) board does not start anymore. I locally
>>>>> increased the value to 0xc000 and the board works again.
>>>>>
>>>>> So should I increase the value just for this board or should I
>>>>> increase the default value for the IMX8MQ?
>>>>
>>>> I would _really_ like to see defaults per SoC.  Even if that means
>>>> saying "default 0xc000 if IMX8Q && SPL_FEAT_X" as I know with tight
>>>> constraints on memory AND the need to have some of the bigger feature
>>>> knobs enabled it can be tricky to get usable defaults.  But what I
>>>> really want to avoid are both the problem of everyone copy/pasting a
>>>> value that's too big or too small and also avoid the problem of N boards
>>>> needing the same fix because they all failed due to the same problem.
>>>
>>> I understand your concerns but the value that has to be adjusted is
>>> not SPL_SYS_MALLOC_F_LEN. Therefore I'm not sure if the '&&
>>> SPL_FEAT_X' would be correct here.
>>
>> Ah right, sorry.  So yes, it's even more likely we should be able to
>> come up with one default for the family.
>>
>> --
>> Tom
> 
> --
> Heiko

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

end of thread, other threads:[~2022-07-06 22:51 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-11  9:07 [PATCH] Kconfig: Fix SYS_MALLOC_F_LEN for i.MX8MQ Peng Fan (OSS)
2022-04-11  8:28 ` Michael Nazzareno Trimarchi
2022-04-11 10:32 ` Fabio Estevam
2022-04-11 12:28 ` Tom Rini
2022-07-05 10:19   ` Heiko Thiery
2022-07-05 13:35     ` Tom Rini
2022-07-05 15:20       ` Heiko Thiery
2022-07-05 16:04         ` Tom Rini
2022-07-06  9:01           ` Heiko Thiery
2022-07-06 22:51             ` Peng Fan

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.