diff mbox series

imx8mp_evk: Make SPL binary size smaller

Message ID DB6PR0402MB2760020AB1E89AE1613F55F288A00@DB6PR0402MB2760.eurprd04.prod.outlook.com
State New
Headers show
Series imx8mp_evk: Make SPL binary size smaller | expand

Commit Message

Peng Fan May 10, 2020, 2:32 p.m. UTC
> Subject: Re: [PATCH] imx8mp_evk: Make SPL binary size smaller
> 
> On Thu, May 7, 2020 at 8:59 AM Fabio Estevam <festevam at gmail.com>
> wrote:
> >
> > Commit f24dea4e1b52 ("ARM: imx8m: Fix reset in SPL on NXP iMX8MP
> EVK")
> > caused the u-boot-spl.bin binary size to grow by around 2000 bytes,
> > which makes the board to fail to boot.
> 
> The new SPL size is 97kB, which is below the limit define in imx8mp_evk.h:
> #define CONFIG_SPL_MAX_SIZE (152 * 1024)
> 
> It seems the problem is not related to SPL size.
> 
> Peng, do you have any ideas?

The following patch will make it boot again, not perfect, I need think
more out an elegant fix. Disable DM SPL? Or recalculate the address.
Enable DM consumes too much
on chip ocram malloc area. Need to think about it how we could
use less ocram for SPL malloc area.

Regards,
Peng.

> 
> Thanks

Comments

Marek Vasut May 10, 2020, 2:34 p.m. UTC | #1
On 5/10/20 4:32 PM, Peng Fan wrote:
>> Subject: Re: [PATCH] imx8mp_evk: Make SPL binary size smaller
>>
>> On Thu, May 7, 2020 at 8:59 AM Fabio Estevam <festevam at gmail.com>
>> wrote:
>>>
>>> Commit f24dea4e1b52 ("ARM: imx8m: Fix reset in SPL on NXP iMX8MP
>> EVK")
>>> caused the u-boot-spl.bin binary size to grow by around 2000 bytes,
>>> which makes the board to fail to boot.
>>
>> The new SPL size is 97kB, which is below the limit define in imx8mp_evk.h:
>> #define CONFIG_SPL_MAX_SIZE (152 * 1024)
>>
>> It seems the problem is not related to SPL size.
>>
>> Peng, do you have any ideas?
> 
> The following patch will make it boot again, not perfect, I need think
> more out an elegant fix. Disable DM SPL? Or recalculate the address.
> Enable DM consumes too much
> on chip ocram malloc area. Need to think about it how we could
> use less ocram for SPL malloc area.

Can't you put the malloc area and stack into DRAM ?
Look at SPL_STACK_R and MALLOC_SIMPLE
diff mbox series

Patch

diff --git a/include/configs/imx8mp_evk.h b/include/configs/imx8mp_evk.h
index 80e5738961..b90a4f6932 100644
--- a/include/configs/imx8mp_evk.h
+++ b/include/configs/imx8mp_evk.h
@@ -23,15 +23,15 @@ 
 #ifdef CONFIG_SPL_BUILD
 /*#define CONFIG_ENABLE_DDR_TRAINING_DEBUG*/
 #define CONFIG_SPL_LDSCRIPT            "arch/arm/cpu/armv8/u-boot-spl.lds"
-#define CONFIG_SPL_STACK               0x990000
-#define CONFIG_SPL_BSS_START_ADDR      0x0095e000
-#define CONFIG_SPL_BSS_MAX_SIZE        0x2000  /* 8 KB */
+#define CONFIG_SPL_STACK               0x98fc00
+#define CONFIG_SPL_BSS_START_ADDR      0x0098fc00
+#define CONFIG_SPL_BSS_MAX_SIZE        0x400   /* 1 KB */
 #define CONFIG_SYS_SPL_MALLOC_START    0x42200000
 #define CONFIG_SYS_SPL_MALLOC_SIZE     SZ_512K /* 512 KB */
 #define CONFIG_SYS_ICACHE_OFF
 #define CONFIG_SYS_DCACHE_OFF

-#define CONFIG_MALLOC_F_ADDR           0x940000
+#define CONFIG_MALLOC_F_ADDR           0x950000

 #define CONFIG_SPL_ABORT_ON_RAW_IMAGE