All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] Increase default of CONFIG_SYS_MALLOC_F_LEN for SPL_OF_CONTROL
@ 2016-08-30  9:50 Masahiro Yamada
  2016-08-30  9:56 ` Stefan Roese
  2016-09-07 17:59 ` [U-Boot] " Tom Rini
  0 siblings, 2 replies; 11+ messages in thread
From: Masahiro Yamada @ 2016-08-30  9:50 UTC (permalink / raw)
  To: u-boot

If both SPL_DM and SPL_OF_CONTROL are enabled, SPL needs to bind
several devices, but CONFIG_SYS_MALLOC_F_LEN=0x400 is apparently
not enough.  Increase the default to 0x2000 for the case.  This
will be helpful for shorter defconfigs.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---

 Kconfig                                | 1 +
 configs/clearfog_defconfig             | 1 -
 configs/db-88f6720_defconfig           | 1 -
 configs/db-88f6820-gp_defconfig        | 1 -
 configs/db-mv784mp-gp_defconfig        | 1 -
 configs/ds414_defconfig                | 1 -
 configs/maxbcm_defconfig               | 1 -
 configs/sandbox_spl_defconfig          | 1 -
 configs/socfpga_arria5_defconfig       | 1 -
 configs/socfpga_cyclone5_defconfig     | 1 -
 configs/socfpga_de0_nano_soc_defconfig | 1 -
 configs/socfpga_is1_defconfig          | 1 -
 configs/socfpga_mcvevk_defconfig       | 1 -
 configs/socfpga_sockit_defconfig       | 1 -
 configs/socfpga_socrates_defconfig     | 1 -
 configs/socfpga_sr1500_defconfig       | 1 -
 configs/socfpga_vining_fpga_defconfig  | 1 -
 configs/theadorable_debug_defconfig    | 1 -
 configs/theadorable_defconfig          | 1 -
 configs/uniphier_ld11_defconfig        | 1 -
 configs/uniphier_ld20_defconfig        | 1 -
 configs/uniphier_ld4_sld8_defconfig    | 1 -
 configs/uniphier_pro4_defconfig        | 1 -
 configs/uniphier_pxs2_ld6b_defconfig   | 1 -
 configs/uniphier_sld3_defconfig        | 1 -
 25 files changed, 1 insertion(+), 24 deletions(-)

diff --git a/Kconfig b/Kconfig
index 45a0669..fdea71e 100644
--- a/Kconfig
+++ b/Kconfig
@@ -83,6 +83,7 @@ config SYS_MALLOC_F
 config SYS_MALLOC_F_LEN
 	hex "Size of malloc() pool before relocation"
 	depends on SYS_MALLOC_F
+	default 0x2000 if SPL_DM && SPL_OF_CONTROL
 	default 0x400
 	help
 	  Before relocation, memory is very limited on many platforms. Still,
diff --git a/configs/clearfog_defconfig b/configs/clearfog_defconfig
index 3bf5388..778cf06 100644
--- a/configs/clearfog_defconfig
+++ b/configs/clearfog_defconfig
@@ -1,6 +1,5 @@
 CONFIG_ARM=y
 CONFIG_ARCH_MVEBU=y
-CONFIG_SYS_MALLOC_F_LEN=0x2000
 CONFIG_TARGET_CLEARFOG=y
 CONFIG_DEFAULT_DEVICE_TREE="armada-388-clearfog"
 CONFIG_SPL=y
diff --git a/configs/db-88f6720_defconfig b/configs/db-88f6720_defconfig
index f06f27f..b6df961 100644
--- a/configs/db-88f6720_defconfig
+++ b/configs/db-88f6720_defconfig
@@ -1,6 +1,5 @@
 CONFIG_ARM=y
 CONFIG_ARCH_MVEBU=y
-CONFIG_SYS_MALLOC_F_LEN=0x2000
 CONFIG_TARGET_DB_88F6720=y
 CONFIG_DEFAULT_DEVICE_TREE="armada-375-db"
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
diff --git a/configs/db-88f6820-gp_defconfig b/configs/db-88f6820-gp_defconfig
index 123e7fc..7ac7457 100644
--- a/configs/db-88f6820-gp_defconfig
+++ b/configs/db-88f6820-gp_defconfig
@@ -1,6 +1,5 @@
 CONFIG_ARM=y
 CONFIG_ARCH_MVEBU=y
-CONFIG_SYS_MALLOC_F_LEN=0x2000
 CONFIG_TARGET_DB_88F6820_GP=y
 CONFIG_DEFAULT_DEVICE_TREE="armada-388-gp"
 CONFIG_SPL=y
diff --git a/configs/db-mv784mp-gp_defconfig b/configs/db-mv784mp-gp_defconfig
index f2c4a9e..510554e 100644
--- a/configs/db-mv784mp-gp_defconfig
+++ b/configs/db-mv784mp-gp_defconfig
@@ -1,6 +1,5 @@
 CONFIG_ARM=y
 CONFIG_ARCH_MVEBU=y
-CONFIG_SYS_MALLOC_F_LEN=0x2000
 CONFIG_TARGET_DB_MV784MP_GP=y
 CONFIG_DEFAULT_DEVICE_TREE="armada-xp-gp"
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
diff --git a/configs/ds414_defconfig b/configs/ds414_defconfig
index a214732..ec23c77 100644
--- a/configs/ds414_defconfig
+++ b/configs/ds414_defconfig
@@ -1,6 +1,5 @@
 CONFIG_ARM=y
 CONFIG_ARCH_MVEBU=y
-CONFIG_SYS_MALLOC_F_LEN=0x2000
 CONFIG_TARGET_DS414=y
 CONFIG_DEFAULT_DEVICE_TREE="armada-xp-synology-ds414"
 CONFIG_SPL=y
diff --git a/configs/maxbcm_defconfig b/configs/maxbcm_defconfig
index b67bc51..22186c3 100644
--- a/configs/maxbcm_defconfig
+++ b/configs/maxbcm_defconfig
@@ -1,6 +1,5 @@
 CONFIG_ARM=y
 CONFIG_ARCH_MVEBU=y
-CONFIG_SYS_MALLOC_F_LEN=0x2000
 CONFIG_TARGET_MAXBCM=y
 CONFIG_DEFAULT_DEVICE_TREE="armada-xp-maxbcm"
 CONFIG_SPL=y
diff --git a/configs/sandbox_spl_defconfig b/configs/sandbox_spl_defconfig
index 0f6dda8..ccb31e3 100644
--- a/configs/sandbox_spl_defconfig
+++ b/configs/sandbox_spl_defconfig
@@ -1,4 +1,3 @@
-CONFIG_SYS_MALLOC_F_LEN=0x2000
 CONFIG_MMC=y
 CONFIG_SANDBOX_SPL=y
 CONFIG_PCI=y
diff --git a/configs/socfpga_arria5_defconfig b/configs/socfpga_arria5_defconfig
index 1bec969..a3797af 100644
--- a/configs/socfpga_arria5_defconfig
+++ b/configs/socfpga_arria5_defconfig
@@ -1,6 +1,5 @@
 CONFIG_ARM=y
 CONFIG_ARCH_SOCFPGA=y
-CONFIG_SYS_MALLOC_F_LEN=0x2000
 CONFIG_SPL_SYS_MALLOC_SIMPLE=y
 CONFIG_SPL_DM=y
 CONFIG_DM_GPIO=y
diff --git a/configs/socfpga_cyclone5_defconfig b/configs/socfpga_cyclone5_defconfig
index 0437cbe..5798662 100644
--- a/configs/socfpga_cyclone5_defconfig
+++ b/configs/socfpga_cyclone5_defconfig
@@ -1,6 +1,5 @@
 CONFIG_ARM=y
 CONFIG_ARCH_SOCFPGA=y
-CONFIG_SYS_MALLOC_F_LEN=0x2000
 CONFIG_SPL_SYS_MALLOC_SIMPLE=y
 CONFIG_SPL_DM=y
 CONFIG_DM_GPIO=y
diff --git a/configs/socfpga_de0_nano_soc_defconfig b/configs/socfpga_de0_nano_soc_defconfig
index 7c05e6a..9bba2de 100644
--- a/configs/socfpga_de0_nano_soc_defconfig
+++ b/configs/socfpga_de0_nano_soc_defconfig
@@ -1,6 +1,5 @@
 CONFIG_ARM=y
 CONFIG_ARCH_SOCFPGA=y
-CONFIG_SYS_MALLOC_F_LEN=0x2000
 CONFIG_SPL_SYS_MALLOC_SIMPLE=y
 CONFIG_SPL_DM=y
 CONFIG_DM_GPIO=y
diff --git a/configs/socfpga_is1_defconfig b/configs/socfpga_is1_defconfig
index 58661c0..b1d7fff 100644
--- a/configs/socfpga_is1_defconfig
+++ b/configs/socfpga_is1_defconfig
@@ -1,6 +1,5 @@
 CONFIG_ARM=y
 CONFIG_ARCH_SOCFPGA=y
-CONFIG_SYS_MALLOC_F_LEN=0x2000
 CONFIG_SPL_DM=y
 CONFIG_DM_GPIO=y
 CONFIG_TARGET_SOCFPGA_IS1=y
diff --git a/configs/socfpga_mcvevk_defconfig b/configs/socfpga_mcvevk_defconfig
index 517a6de..f60b4d8 100644
--- a/configs/socfpga_mcvevk_defconfig
+++ b/configs/socfpga_mcvevk_defconfig
@@ -1,6 +1,5 @@
 CONFIG_ARM=y
 CONFIG_ARCH_SOCFPGA=y
-CONFIG_SYS_MALLOC_F_LEN=0x2000
 CONFIG_SPL_SYS_MALLOC_SIMPLE=y
 CONFIG_SPL_DM=y
 CONFIG_DM_GPIO=y
diff --git a/configs/socfpga_sockit_defconfig b/configs/socfpga_sockit_defconfig
index 9bd3331..3913984 100644
--- a/configs/socfpga_sockit_defconfig
+++ b/configs/socfpga_sockit_defconfig
@@ -1,6 +1,5 @@
 CONFIG_ARM=y
 CONFIG_ARCH_SOCFPGA=y
-CONFIG_SYS_MALLOC_F_LEN=0x2000
 CONFIG_SPL_SYS_MALLOC_SIMPLE=y
 CONFIG_SPL_DM=y
 CONFIG_DM_GPIO=y
diff --git a/configs/socfpga_socrates_defconfig b/configs/socfpga_socrates_defconfig
index 5347032..bc9e894 100644
--- a/configs/socfpga_socrates_defconfig
+++ b/configs/socfpga_socrates_defconfig
@@ -1,6 +1,5 @@
 CONFIG_ARM=y
 CONFIG_ARCH_SOCFPGA=y
-CONFIG_SYS_MALLOC_F_LEN=0x2000
 CONFIG_SPL_SYS_MALLOC_SIMPLE=y
 CONFIG_SPL_DM=y
 CONFIG_DM_GPIO=y
diff --git a/configs/socfpga_sr1500_defconfig b/configs/socfpga_sr1500_defconfig
index 81a3fc1..8d4791d 100644
--- a/configs/socfpga_sr1500_defconfig
+++ b/configs/socfpga_sr1500_defconfig
@@ -1,6 +1,5 @@
 CONFIG_ARM=y
 CONFIG_ARCH_SOCFPGA=y
-CONFIG_SYS_MALLOC_F_LEN=0x2000
 CONFIG_SPL_SYS_MALLOC_SIMPLE=y
 CONFIG_SPL_DM=y
 CONFIG_DM_GPIO=y
diff --git a/configs/socfpga_vining_fpga_defconfig b/configs/socfpga_vining_fpga_defconfig
index 80552a5..901721f 100644
--- a/configs/socfpga_vining_fpga_defconfig
+++ b/configs/socfpga_vining_fpga_defconfig
@@ -1,6 +1,5 @@
 CONFIG_ARM=y
 CONFIG_ARCH_SOCFPGA=y
-CONFIG_SYS_MALLOC_F_LEN=0x2000
 CONFIG_SPL_SYS_MALLOC_SIMPLE=y
 CONFIG_SPL_DM=y
 CONFIG_DM_GPIO=y
diff --git a/configs/theadorable_debug_defconfig b/configs/theadorable_debug_defconfig
index 05368bd..25ca2b0 100644
--- a/configs/theadorable_debug_defconfig
+++ b/configs/theadorable_debug_defconfig
@@ -1,6 +1,5 @@
 CONFIG_ARM=y
 CONFIG_ARCH_MVEBU=y
-CONFIG_SYS_MALLOC_F_LEN=0x2000
 CONFIG_TARGET_THEADORABLE=y
 CONFIG_DM_GPIO=y
 CONFIG_DEFAULT_DEVICE_TREE="armada-xp-theadorable"
diff --git a/configs/theadorable_defconfig b/configs/theadorable_defconfig
index 17bf8cd..89b00f2 100644
--- a/configs/theadorable_defconfig
+++ b/configs/theadorable_defconfig
@@ -1,6 +1,5 @@
 CONFIG_ARM=y
 CONFIG_ARCH_MVEBU=y
-CONFIG_SYS_MALLOC_F_LEN=0x2000
 CONFIG_TARGET_THEADORABLE=y
 CONFIG_DM_GPIO=y
 CONFIG_DEFAULT_DEVICE_TREE="armada-xp-theadorable"
diff --git a/configs/uniphier_ld11_defconfig b/configs/uniphier_ld11_defconfig
index d593f1b..703d871 100644
--- a/configs/uniphier_ld11_defconfig
+++ b/configs/uniphier_ld11_defconfig
@@ -1,6 +1,5 @@
 CONFIG_ARM=y
 CONFIG_ARCH_UNIPHIER=y
-CONFIG_SYS_MALLOC_F_LEN=0x2000
 CONFIG_ARCH_UNIPHIER_LD11=y
 CONFIG_MICRO_SUPPORT_CARD=y
 CONFIG_SYS_TEXT_BASE=0x84000000
diff --git a/configs/uniphier_ld20_defconfig b/configs/uniphier_ld20_defconfig
index d6443fd..c4a8547 100644
--- a/configs/uniphier_ld20_defconfig
+++ b/configs/uniphier_ld20_defconfig
@@ -1,6 +1,5 @@
 CONFIG_ARM=y
 CONFIG_ARCH_UNIPHIER=y
-CONFIG_SYS_MALLOC_F_LEN=0x2000
 CONFIG_ARCH_UNIPHIER_LD20=y
 CONFIG_MICRO_SUPPORT_CARD=y
 CONFIG_SYS_TEXT_BASE=0x84000000
diff --git a/configs/uniphier_ld4_sld8_defconfig b/configs/uniphier_ld4_sld8_defconfig
index 6c9f0f4..e3ad160 100644
--- a/configs/uniphier_ld4_sld8_defconfig
+++ b/configs/uniphier_ld4_sld8_defconfig
@@ -1,6 +1,5 @@
 CONFIG_ARM=y
 CONFIG_ARCH_UNIPHIER=y
-CONFIG_SYS_MALLOC_F_LEN=0x2000
 CONFIG_ARCH_UNIPHIER_LD4_SLD8=y
 CONFIG_MICRO_SUPPORT_CARD=y
 CONFIG_SYS_TEXT_BASE=0x84000000
diff --git a/configs/uniphier_pro4_defconfig b/configs/uniphier_pro4_defconfig
index d65da62..a7dcc56 100644
--- a/configs/uniphier_pro4_defconfig
+++ b/configs/uniphier_pro4_defconfig
@@ -1,6 +1,5 @@
 CONFIG_ARM=y
 CONFIG_ARCH_UNIPHIER=y
-CONFIG_SYS_MALLOC_F_LEN=0x2000
 CONFIG_MICRO_SUPPORT_CARD=y
 CONFIG_SYS_TEXT_BASE=0x84000000
 CONFIG_DEFAULT_DEVICE_TREE="uniphier-ph1-pro4-ref"
diff --git a/configs/uniphier_pxs2_ld6b_defconfig b/configs/uniphier_pxs2_ld6b_defconfig
index e07a9ba..131c416 100644
--- a/configs/uniphier_pxs2_ld6b_defconfig
+++ b/configs/uniphier_pxs2_ld6b_defconfig
@@ -1,6 +1,5 @@
 CONFIG_ARM=y
 CONFIG_ARCH_UNIPHIER=y
-CONFIG_SYS_MALLOC_F_LEN=0x2000
 CONFIG_ARCH_UNIPHIER_PRO5_PXS2_LD6B=y
 CONFIG_MICRO_SUPPORT_CARD=y
 CONFIG_SYS_TEXT_BASE=0x84000000
diff --git a/configs/uniphier_sld3_defconfig b/configs/uniphier_sld3_defconfig
index 6ce26bf..1c5cece 100644
--- a/configs/uniphier_sld3_defconfig
+++ b/configs/uniphier_sld3_defconfig
@@ -1,6 +1,5 @@
 CONFIG_ARM=y
 CONFIG_ARCH_UNIPHIER=y
-CONFIG_SYS_MALLOC_F_LEN=0x2000
 CONFIG_ARCH_UNIPHIER_SLD3=y
 CONFIG_MICRO_SUPPORT_CARD=y
 CONFIG_SYS_TEXT_BASE=0x84000000
-- 
1.9.1

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

* [U-Boot] [PATCH] Increase default of CONFIG_SYS_MALLOC_F_LEN for SPL_OF_CONTROL
  2016-08-30  9:50 [U-Boot] [PATCH] Increase default of CONFIG_SYS_MALLOC_F_LEN for SPL_OF_CONTROL Masahiro Yamada
@ 2016-08-30  9:56 ` Stefan Roese
  2016-09-06  1:04   ` Simon Glass
  2016-09-07 17:59 ` [U-Boot] " Tom Rini
  1 sibling, 1 reply; 11+ messages in thread
From: Stefan Roese @ 2016-08-30  9:56 UTC (permalink / raw)
  To: u-boot

On 30.08.2016 11:50, Masahiro Yamada wrote:
> If both SPL_DM and SPL_OF_CONTROL are enabled, SPL needs to bind
> several devices, but CONFIG_SYS_MALLOC_F_LEN=0x400 is apparently
> not enough.  Increase the default to 0x2000 for the case.  This
> will be helpful for shorter defconfigs.
>
> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

Reviewed-by: Stefan Roese <sr@denx.de>

Thanks,
Stefan

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

* [U-Boot] [PATCH] Increase default of CONFIG_SYS_MALLOC_F_LEN for SPL_OF_CONTROL
  2016-08-30  9:56 ` Stefan Roese
@ 2016-09-06  1:04   ` Simon Glass
  2016-09-06 12:24     ` Masahiro Yamada
  0 siblings, 1 reply; 11+ messages in thread
From: Simon Glass @ 2016-09-06  1:04 UTC (permalink / raw)
  To: u-boot

On 30 August 2016 at 03:56, Stefan Roese <sr@denx.de> wrote:
> On 30.08.2016 11:50, Masahiro Yamada wrote:
>>
>> If both SPL_DM and SPL_OF_CONTROL are enabled, SPL needs to bind
>> several devices, but CONFIG_SYS_MALLOC_F_LEN=0x400 is apparently
>> not enough.  Increase the default to 0x2000 for the case.  This
>> will be helpful for shorter defconfigs.
>>
>> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
>
>
> Reviewed-by: Stefan Roese <sr@denx.de>

Reviewed-by: Simon Glass <sjg@chromium.org>

It would be worth checking why. I fixed a bug where simple-bus would
bring in all devices regardless of the u-boot,dm-pre-reloc flag.
Perhaps that was it?

- Simon

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

* [U-Boot] [PATCH] Increase default of CONFIG_SYS_MALLOC_F_LEN for SPL_OF_CONTROL
  2016-09-06  1:04   ` Simon Glass
@ 2016-09-06 12:24     ` Masahiro Yamada
  2016-09-06 12:27       ` Marek Vasut
  2016-09-06 12:46       ` Simon Glass
  0 siblings, 2 replies; 11+ messages in thread
From: Masahiro Yamada @ 2016-09-06 12:24 UTC (permalink / raw)
  To: u-boot

2016-09-06 10:04 GMT+09:00 Simon Glass <sjg@chromium.org>:
> On 30 August 2016 at 03:56, Stefan Roese <sr@denx.de> wrote:
>> On 30.08.2016 11:50, Masahiro Yamada wrote:
>>>
>>> If both SPL_DM and SPL_OF_CONTROL are enabled, SPL needs to bind
>>> several devices, but CONFIG_SYS_MALLOC_F_LEN=0x400 is apparently
>>> not enough.  Increase the default to 0x2000 for the case.  This
>>> will be helpful for shorter defconfigs.
>>>
>>> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
>>
>>
>> Reviewed-by: Stefan Roese <sr@denx.de>
>
> Reviewed-by: Simon Glass <sjg@chromium.org>
>
> It would be worth checking why. I fixed a bug where simple-bus would
> bring in all devices regardless of the u-boot,dm-pre-reloc flag.
> Perhaps that was it?

I do not think so.

Recently I tested this.  In spite of "u-boot,dm-pre-reloc"
in the SPL device tree, my board failed in SPL.

I guess CONFIG_SYS_MALLOC_F_LEN=0x400 is not enough
for binding/probing UART, pinctrl, MMC in SPL.

I increased the malloc size and it worked fine.




-- 
Best Regards
Masahiro Yamada

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

* [U-Boot] [PATCH] Increase default of CONFIG_SYS_MALLOC_F_LEN for SPL_OF_CONTROL
  2016-09-06 12:24     ` Masahiro Yamada
@ 2016-09-06 12:27       ` Marek Vasut
  2016-09-06 12:46       ` Simon Glass
  1 sibling, 0 replies; 11+ messages in thread
From: Marek Vasut @ 2016-09-06 12:27 UTC (permalink / raw)
  To: u-boot

On 09/06/2016 02:24 PM, Masahiro Yamada wrote:
> 2016-09-06 10:04 GMT+09:00 Simon Glass <sjg@chromium.org>:
>> On 30 August 2016 at 03:56, Stefan Roese <sr@denx.de> wrote:
>>> On 30.08.2016 11:50, Masahiro Yamada wrote:
>>>>
>>>> If both SPL_DM and SPL_OF_CONTROL are enabled, SPL needs to bind
>>>> several devices, but CONFIG_SYS_MALLOC_F_LEN=0x400 is apparently
>>>> not enough.  Increase the default to 0x2000 for the case.  This
>>>> will be helpful for shorter defconfigs.
>>>>
>>>> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
>>>
>>>
>>> Reviewed-by: Stefan Roese <sr@denx.de>
>>
>> Reviewed-by: Simon Glass <sjg@chromium.org>
>>
>> It would be worth checking why. I fixed a bug where simple-bus would
>> bring in all devices regardless of the u-boot,dm-pre-reloc flag.
>> Perhaps that was it?
> 
> I do not think so.
> 
> Recently I tested this.  In spite of "u-boot,dm-pre-reloc"
> in the SPL device tree, my board failed in SPL.
> 
> I guess CONFIG_SYS_MALLOC_F_LEN=0x400 is not enough
> for binding/probing UART, pinctrl, MMC in SPL.
> 
> I increased the malloc size and it worked fine.

You can check this by tracking the allocations and the utilization of
the malloc space.

-- 
Best regards,
Marek Vasut

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

* [U-Boot] [PATCH] Increase default of CONFIG_SYS_MALLOC_F_LEN for SPL_OF_CONTROL
  2016-09-06 12:24     ` Masahiro Yamada
  2016-09-06 12:27       ` Marek Vasut
@ 2016-09-06 12:46       ` Simon Glass
  2016-09-11 12:50         ` Masahiro Yamada
  1 sibling, 1 reply; 11+ messages in thread
From: Simon Glass @ 2016-09-06 12:46 UTC (permalink / raw)
  To: u-boot

Hi Masahiro,

On 6 September 2016 at 06:24, Masahiro Yamada
<yamada.masahiro@socionext.com> wrote:
>
> 2016-09-06 10:04 GMT+09:00 Simon Glass <sjg@chromium.org>:
> > On 30 August 2016 at 03:56, Stefan Roese <sr@denx.de> wrote:
> >> On 30.08.2016 11:50, Masahiro Yamada wrote:
> >>>
> >>> If both SPL_DM and SPL_OF_CONTROL are enabled, SPL needs to bind
> >>> several devices, but CONFIG_SYS_MALLOC_F_LEN=0x400 is apparently
> >>> not enough.  Increase the default to 0x2000 for the case.  This
> >>> will be helpful for shorter defconfigs.
> >>>
> >>> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
> >>
> >>
> >> Reviewed-by: Stefan Roese <sr@denx.de>
> >
> > Reviewed-by: Simon Glass <sjg@chromium.org>
> >
> > It would be worth checking why. I fixed a bug where simple-bus would
> > bring in all devices regardless of the u-boot,dm-pre-reloc flag.
> > Perhaps that was it?
>
> I do not think so.
>
> Recently I tested this.  In spite of "u-boot,dm-pre-reloc"
> in the SPL device tree, my board failed in SPL.
>
> I guess CONFIG_SYS_MALLOC_F_LEN=0x400 is not enough
> for binding/probing UART, pinctrl, MMC in SPL.
>
> I increased the malloc size and it worked fine.

You could turn on DEBUG in common/spl/spl.c and it will print out how
much memory is used. But by making it the default you are affecting a
lot of boards which don't use pinctrl, etc. 8KB is a lot for some
boards.

On the other hand we should make sure that it gives a sensible error
when running out of memory, perhaps something like this:

http://patchwork.ozlabs.org/patch/561551/

Regards,
Simon

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

* [U-Boot] Increase default of CONFIG_SYS_MALLOC_F_LEN for SPL_OF_CONTROL
  2016-08-30  9:50 [U-Boot] [PATCH] Increase default of CONFIG_SYS_MALLOC_F_LEN for SPL_OF_CONTROL Masahiro Yamada
  2016-08-30  9:56 ` Stefan Roese
@ 2016-09-07 17:59 ` Tom Rini
  1 sibling, 0 replies; 11+ messages in thread
From: Tom Rini @ 2016-09-07 17:59 UTC (permalink / raw)
  To: u-boot

On Tue, Aug 30, 2016 at 06:50:36PM +0900, Masahiro Yamada wrote:

> If both SPL_DM and SPL_OF_CONTROL are enabled, SPL needs to bind
> several devices, but CONFIG_SYS_MALLOC_F_LEN=0x400 is apparently
> not enough.  Increase the default to 0x2000 for the case.  This
> will be helpful for shorter defconfigs.
> 
> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
> Reviewed-by: Stefan Roese <sr@denx.de>
> Reviewed-by: Simon Glass <sjg@chromium.org>

Applied to u-boot/master, thanks!

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

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

* [U-Boot] [PATCH] Increase default of CONFIG_SYS_MALLOC_F_LEN for SPL_OF_CONTROL
  2016-09-06 12:46       ` Simon Glass
@ 2016-09-11 12:50         ` Masahiro Yamada
  2016-09-12  4:21           ` Simon Glass
  0 siblings, 1 reply; 11+ messages in thread
From: Masahiro Yamada @ 2016-09-11 12:50 UTC (permalink / raw)
  To: u-boot

Hi Simon,


2016-09-06 21:46 GMT+09:00 Simon Glass <sjg@chromium.org>:
> Hi Masahiro,
>
> On 6 September 2016 at 06:24, Masahiro Yamada
> <yamada.masahiro@socionext.com> wrote:
>>
>> 2016-09-06 10:04 GMT+09:00 Simon Glass <sjg@chromium.org>:
>> > On 30 August 2016 at 03:56, Stefan Roese <sr@denx.de> wrote:
>> >> On 30.08.2016 11:50, Masahiro Yamada wrote:
>> >>>
>> >>> If both SPL_DM and SPL_OF_CONTROL are enabled, SPL needs to bind
>> >>> several devices, but CONFIG_SYS_MALLOC_F_LEN=0x400 is apparently
>> >>> not enough.  Increase the default to 0x2000 for the case.  This
>> >>> will be helpful for shorter defconfigs.
>> >>>
>> >>> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
>> >>
>> >>
>> >> Reviewed-by: Stefan Roese <sr@denx.de>
>> >
>> > Reviewed-by: Simon Glass <sjg@chromium.org>
>> >
>> > It would be worth checking why. I fixed a bug where simple-bus would
>> > bring in all devices regardless of the u-boot,dm-pre-reloc flag.
>> > Perhaps that was it?
>>
>> I do not think so.
>>
>> Recently I tested this.  In spite of "u-boot,dm-pre-reloc"
>> in the SPL device tree, my board failed in SPL.
>>
>> I guess CONFIG_SYS_MALLOC_F_LEN=0x400 is not enough
>> for binding/probing UART, pinctrl, MMC in SPL.
>>
>> I increased the malloc size and it worked fine.
>
> You could turn on DEBUG in common/spl/spl.c and it will print out how
> much memory is used. But by making it the default you are affecting a
> lot of boards which don't use pinctrl, etc. 8KB is a lot for some
> boards.

I tried this, and found I was a bit exaggerating.

0x400 was too small for my boards, but 0x800 worked.
Given SYS_MALLOC_F_LEN specifies the sum of malloc and stack,
so perhaps 0x800 is on the border.
However, 0x2000 is too much.

This patch is in the mainline, so revert it?

--
Best Regards
Masahiro Yamada

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

* [U-Boot] [PATCH] Increase default of CONFIG_SYS_MALLOC_F_LEN for SPL_OF_CONTROL
  2016-09-11 12:50         ` Masahiro Yamada
@ 2016-09-12  4:21           ` Simon Glass
  2016-09-12  4:42             ` Masahiro Yamada
  0 siblings, 1 reply; 11+ messages in thread
From: Simon Glass @ 2016-09-12  4:21 UTC (permalink / raw)
  To: u-boot

Hi Masahiro,

On 11 September 2016 at 06:50, Masahiro Yamada
<yamada.masahiro@socionext.com> wrote:
> Hi Simon,
>
>
> 2016-09-06 21:46 GMT+09:00 Simon Glass <sjg@chromium.org>:
>> Hi Masahiro,
>>
>> On 6 September 2016 at 06:24, Masahiro Yamada
>> <yamada.masahiro@socionext.com> wrote:
>>>
>>> 2016-09-06 10:04 GMT+09:00 Simon Glass <sjg@chromium.org>:
>>> > On 30 August 2016 at 03:56, Stefan Roese <sr@denx.de> wrote:
>>> >> On 30.08.2016 11:50, Masahiro Yamada wrote:
>>> >>>
>>> >>> If both SPL_DM and SPL_OF_CONTROL are enabled, SPL needs to bind
>>> >>> several devices, but CONFIG_SYS_MALLOC_F_LEN=0x400 is apparently
>>> >>> not enough.  Increase the default to 0x2000 for the case.  This
>>> >>> will be helpful for shorter defconfigs.
>>> >>>
>>> >>> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
>>> >>
>>> >>
>>> >> Reviewed-by: Stefan Roese <sr@denx.de>
>>> >
>>> > Reviewed-by: Simon Glass <sjg@chromium.org>
>>> >
>>> > It would be worth checking why. I fixed a bug where simple-bus would
>>> > bring in all devices regardless of the u-boot,dm-pre-reloc flag.
>>> > Perhaps that was it?
>>>
>>> I do not think so.
>>>
>>> Recently I tested this.  In spite of "u-boot,dm-pre-reloc"
>>> in the SPL device tree, my board failed in SPL.
>>>
>>> I guess CONFIG_SYS_MALLOC_F_LEN=0x400 is not enough
>>> for binding/probing UART, pinctrl, MMC in SPL.
>>>
>>> I increased the malloc size and it worked fine.
>>
>> You could turn on DEBUG in common/spl/spl.c and it will print out how
>> much memory is used. But by making it the default you are affecting a
>> lot of boards which don't use pinctrl, etc. 8KB is a lot for some
>> boards.
>
> I tried this, and found I was a bit exaggerating.
>
> 0x400 was too small for my boards, but 0x800 worked.
> Given SYS_MALLOC_F_LEN specifies the sum of malloc and stack,
> so perhaps 0x800 is on the border.
> However, 0x2000 is too much.
>
> This patch is in the mainline, so revert it?

Well how about adjusting to 0x800? That's 2KB which is a lot better than 8KB.

Regards,
Simon

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

* [U-Boot] [PATCH] Increase default of CONFIG_SYS_MALLOC_F_LEN for SPL_OF_CONTROL
  2016-09-12  4:21           ` Simon Glass
@ 2016-09-12  4:42             ` Masahiro Yamada
  2016-09-12 13:50               ` Simon Glass
  0 siblings, 1 reply; 11+ messages in thread
From: Masahiro Yamada @ 2016-09-12  4:42 UTC (permalink / raw)
  To: u-boot

Hi Simon,


2016-09-12 13:21 GMT+09:00 Simon Glass <sjg@chromium.org>:
> Hi Masahiro,
>
> On 11 September 2016 at 06:50, Masahiro Yamada
> <yamada.masahiro@socionext.com> wrote:
>> Hi Simon,
>>
>>
>> 2016-09-06 21:46 GMT+09:00 Simon Glass <sjg@chromium.org>:
>>> Hi Masahiro,
>>>
>>> On 6 September 2016 at 06:24, Masahiro Yamada
>>> <yamada.masahiro@socionext.com> wrote:
>>>>
>>>> 2016-09-06 10:04 GMT+09:00 Simon Glass <sjg@chromium.org>:
>>>> > On 30 August 2016 at 03:56, Stefan Roese <sr@denx.de> wrote:
>>>> >> On 30.08.2016 11:50, Masahiro Yamada wrote:
>>>> >>>
>>>> >>> If both SPL_DM and SPL_OF_CONTROL are enabled, SPL needs to bind
>>>> >>> several devices, but CONFIG_SYS_MALLOC_F_LEN=0x400 is apparently
>>>> >>> not enough.  Increase the default to 0x2000 for the case.  This
>>>> >>> will be helpful for shorter defconfigs.
>>>> >>>
>>>> >>> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
>>>> >>
>>>> >>
>>>> >> Reviewed-by: Stefan Roese <sr@denx.de>
>>>> >
>>>> > Reviewed-by: Simon Glass <sjg@chromium.org>
>>>> >
>>>> > It would be worth checking why. I fixed a bug where simple-bus would
>>>> > bring in all devices regardless of the u-boot,dm-pre-reloc flag.
>>>> > Perhaps that was it?
>>>>
>>>> I do not think so.
>>>>
>>>> Recently I tested this.  In spite of "u-boot,dm-pre-reloc"
>>>> in the SPL device tree, my board failed in SPL.
>>>>
>>>> I guess CONFIG_SYS_MALLOC_F_LEN=0x400 is not enough
>>>> for binding/probing UART, pinctrl, MMC in SPL.
>>>>
>>>> I increased the malloc size and it worked fine.
>>>
>>> You could turn on DEBUG in common/spl/spl.c and it will print out how
>>> much memory is used. But by making it the default you are affecting a
>>> lot of boards which don't use pinctrl, etc. 8KB is a lot for some
>>> boards.
>>
>> I tried this, and found I was a bit exaggerating.
>>
>> 0x400 was too small for my boards, but 0x800 worked.
>> Given SYS_MALLOC_F_LEN specifies the sum of malloc and stack,
>> so perhaps 0x800 is on the border.
>> However, 0x2000 is too much.
>>
>> This patch is in the mainline, so revert it?
>
> Well how about adjusting to 0x800? That's 2KB which is a lot better than 8KB.


I am OK with it, but it will not help reducing the defcongis very much
at this point.


I can test all the UniPhier boards,
so probably OK with switching to 0x800.

Zynq boards now use 0x600, but I guess it is OK to increase it to 0x800
(if Michal gives us Ack).


I am not sure if SoCFPGA really needs 0x2000.  Marek can answer the question.


-- 
Best Regards
Masahiro Yamada

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

* [U-Boot] [PATCH] Increase default of CONFIG_SYS_MALLOC_F_LEN for SPL_OF_CONTROL
  2016-09-12  4:42             ` Masahiro Yamada
@ 2016-09-12 13:50               ` Simon Glass
  0 siblings, 0 replies; 11+ messages in thread
From: Simon Glass @ 2016-09-12 13:50 UTC (permalink / raw)
  To: u-boot

Hi Masahiro,

On 11 September 2016 at 22:42, Masahiro Yamada
<yamada.masahiro@socionext.com> wrote:
> Hi Simon,
>
>
> 2016-09-12 13:21 GMT+09:00 Simon Glass <sjg@chromium.org>:
>> Hi Masahiro,
>>
>> On 11 September 2016 at 06:50, Masahiro Yamada
>> <yamada.masahiro@socionext.com> wrote:
>>> Hi Simon,
>>>
>>>
>>> 2016-09-06 21:46 GMT+09:00 Simon Glass <sjg@chromium.org>:
>>>> Hi Masahiro,
>>>>
>>>> On 6 September 2016 at 06:24, Masahiro Yamada
>>>> <yamada.masahiro@socionext.com> wrote:
>>>>>
>>>>> 2016-09-06 10:04 GMT+09:00 Simon Glass <sjg@chromium.org>:
>>>>> > On 30 August 2016 at 03:56, Stefan Roese <sr@denx.de> wrote:
>>>>> >> On 30.08.2016 11:50, Masahiro Yamada wrote:
>>>>> >>>
>>>>> >>> If both SPL_DM and SPL_OF_CONTROL are enabled, SPL needs to bind
>>>>> >>> several devices, but CONFIG_SYS_MALLOC_F_LEN=0x400 is apparently
>>>>> >>> not enough.  Increase the default to 0x2000 for the case.  This
>>>>> >>> will be helpful for shorter defconfigs.
>>>>> >>>
>>>>> >>> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
>>>>> >>
>>>>> >>
>>>>> >> Reviewed-by: Stefan Roese <sr@denx.de>
>>>>> >
>>>>> > Reviewed-by: Simon Glass <sjg@chromium.org>
>>>>> >
>>>>> > It would be worth checking why. I fixed a bug where simple-bus would
>>>>> > bring in all devices regardless of the u-boot,dm-pre-reloc flag.
>>>>> > Perhaps that was it?
>>>>>
>>>>> I do not think so.
>>>>>
>>>>> Recently I tested this.  In spite of "u-boot,dm-pre-reloc"
>>>>> in the SPL device tree, my board failed in SPL.
>>>>>
>>>>> I guess CONFIG_SYS_MALLOC_F_LEN=0x400 is not enough
>>>>> for binding/probing UART, pinctrl, MMC in SPL.
>>>>>
>>>>> I increased the malloc size and it worked fine.
>>>>
>>>> You could turn on DEBUG in common/spl/spl.c and it will print out how
>>>> much memory is used. But by making it the default you are affecting a
>>>> lot of boards which don't use pinctrl, etc. 8KB is a lot for some
>>>> boards.
>>>
>>> I tried this, and found I was a bit exaggerating.
>>>
>>> 0x400 was too small for my boards, but 0x800 worked.
>>> Given SYS_MALLOC_F_LEN specifies the sum of malloc and stack,
>>> so perhaps 0x800 is on the border.
>>> However, 0x2000 is too much.
>>>
>>> This patch is in the mainline, so revert it?
>>
>> Well how about adjusting to 0x800? That's 2KB which is a lot better than 8KB.
>
>
> I am OK with it, but it will not help reducing the defcongis very much
> at this point.
>
>
> I can test all the UniPhier boards,
> so probably OK with switching to 0x800.
>
> Zynq boards now use 0x600, but I guess it is OK to increase it to 0x800
> (if Michal gives us Ack).

OK.

>
>
> I am not sure if SoCFPGA really needs 0x2000.  Marek can answer the question.

Can you also look at printing a warning when we run out of memory?

>
>
> --
> Best Regards
> Masahiro Yamada

Regards,
Simon

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

end of thread, other threads:[~2016-09-12 13:50 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-30  9:50 [U-Boot] [PATCH] Increase default of CONFIG_SYS_MALLOC_F_LEN for SPL_OF_CONTROL Masahiro Yamada
2016-08-30  9:56 ` Stefan Roese
2016-09-06  1:04   ` Simon Glass
2016-09-06 12:24     ` Masahiro Yamada
2016-09-06 12:27       ` Marek Vasut
2016-09-06 12:46       ` Simon Glass
2016-09-11 12:50         ` Masahiro Yamada
2016-09-12  4:21           ` Simon Glass
2016-09-12  4:42             ` Masahiro Yamada
2016-09-12 13:50               ` Simon Glass
2016-09-07 17:59 ` [U-Boot] " Tom Rini

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.