diff mbox series

[3/3] imx8qm_mek: Increase CONFIG_SYS_BOOTM_LEN to 64MB

Message ID 20210829193913.124217-3-oleksandr.suvorov@foundries.io
State Accepted
Commit 32139c25e4402aa7be12b5b6ab928a62734f4781
Delegated to: Stefano Babic
Headers show
Series [1/3] imx8mm_evk: Increase CONFIG_SYS_BOOTM_LEN to 64MB | expand

Commit Message

Oleksandr Suvorov Aug. 29, 2021, 7:39 p.m. UTC
The BSP platform LmP supports the board NXP iMX8QM MEK. The
kernel size in LmP exceeds 32Mb. Increase the maximum size
of an uncompressed kernel to fix the following error:
    Uncompressing Kernel Image
    Error: inflate() returned -5
    Image too large: increase CONFIG_SYS_BOOTM_LEN
    Must RESET board to recover

Signed-off-by: Oleksandr Suvorov <oleksandr.suvorov@foundries.io>
---

 include/configs/imx8qm_mek.h | 2 ++
 1 file changed, 2 insertions(+)

Comments

Marek Vasut Aug. 29, 2021, 7:55 p.m. UTC | #1
On 8/29/21 9:39 PM, Oleksandr Suvorov wrote:
> The BSP platform LmP supports the board NXP iMX8QM MEK. The
> kernel size in LmP exceeds 32Mb. Increase the maximum size
> of an uncompressed kernel to fix the following error:
>      Uncompressing Kernel Image
>      Error: inflate() returned -5
>      Image too large: increase CONFIG_SYS_BOOTM_LEN
>      Must RESET board to recover
> 

Maybe we should increase the default for arm64 instead ? 8 MiB is too small.
Tom Rini Aug. 29, 2021, 8:53 p.m. UTC | #2
On Sun, Aug 29, 2021 at 09:55:16PM +0200, Marek Vasut wrote:
> On 8/29/21 9:39 PM, Oleksandr Suvorov wrote:
> > The BSP platform LmP supports the board NXP iMX8QM MEK. The
> > kernel size in LmP exceeds 32Mb. Increase the maximum size
> > of an uncompressed kernel to fix the following error:
> >      Uncompressing Kernel Image
> >      Error: inflate() returned -5
> >      Image too large: increase CONFIG_SYS_BOOTM_LEN
> >      Must RESET board to recover
> > 
> 
> Maybe we should increase the default for arm64 instead ? 8 MiB is too small.

Once moved to Kconfig, yes, that would be a good idea and fairly easy.
Oleksandr Suvorov Aug. 30, 2021, 11:11 a.m. UTC | #3
On Sun, Aug 29, 2021 at 10:55 PM Marek Vasut <marex@denx.de> wrote:
>
> On 8/29/21 9:39 PM, Oleksandr Suvorov wrote:
> > The BSP platform LmP supports the board NXP iMX8QM MEK. The
> > kernel size in LmP exceeds 32Mb. Increase the maximum size
> > of an uncompressed kernel to fix the following error:
> >      Uncompressing Kernel Image
> >      Error: inflate() returned -5
> >      Image too large: increase CONFIG_SYS_BOOTM_LEN
> >      Must RESET board to recover
> >
>
> Maybe we should increase the default for arm64 instead ? 8 MiB is too small.

I completely agree if NXP doesn't have objections.
@Peng Fan Do you mind?
Marek Vasut Aug. 30, 2021, 12:18 p.m. UTC | #4
On 8/30/21 1:11 PM, Oleksandr Suvorov wrote:
> On Sun, Aug 29, 2021 at 10:55 PM Marek Vasut <marex@denx.de> wrote:
>>
>> On 8/29/21 9:39 PM, Oleksandr Suvorov wrote:
>>> The BSP platform LmP supports the board NXP iMX8QM MEK. The
>>> kernel size in LmP exceeds 32Mb. Increase the maximum size
>>> of an uncompressed kernel to fix the following error:
>>>       Uncompressing Kernel Image
>>>       Error: inflate() returned -5
>>>       Image too large: increase CONFIG_SYS_BOOTM_LEN
>>>       Must RESET board to recover
>>>
>>
>> Maybe we should increase the default for arm64 instead ? 8 MiB is too small.
> 
> I completely agree if NXP doesn't have objections.
> @Peng Fan Do you mind?

Increase it for all of arm64 , or all of U-Boot even. This has nothing 
to do with NXP.
Marcel Ziswiler Aug. 30, 2021, 3:05 p.m. UTC | #5
On Mon, 2021-08-30 at 14:18 +0200, Marek Vasut wrote:
> On 8/30/21 1:11 PM, Oleksandr Suvorov wrote:
> > On Sun, Aug 29, 2021 at 10:55 PM Marek Vasut <marex@denx.de> wrote:
> > > 
> > > On 8/29/21 9:39 PM, Oleksandr Suvorov wrote:
> > > > The BSP platform LmP supports the board NXP iMX8QM MEK. The
> > > > kernel size in LmP exceeds 32Mb. Increase the maximum size
> > > > of an uncompressed kernel to fix the following error:
> > > >       Uncompressing Kernel Image
> > > >       Error: inflate() returned -5
> > > >       Image too large: increase CONFIG_SYS_BOOTM_LEN
> > > >       Must RESET board to recover
> > > > 
> > > 
> > > Maybe we should increase the default for arm64 instead ? 8 MiB is too small.
> > 
> > I completely agree if NXP doesn't have objections.
> > @Peng Fan Do you mind?
> 
> Increase it for all of arm64 , or all of U-Boot even. This has nothing 
> to do with NXP.

In general, I agree. However, in practice this can have devastating effects on stuff as discussed here:

https://marc.info/?l=u-boot&m=162999598824381
Marek Vasut Aug. 30, 2021, 3:10 p.m. UTC | #6
On 8/30/21 5:05 PM, Marcel Ziswiler wrote:
> On Mon, 2021-08-30 at 14:18 +0200, Marek Vasut wrote:
>> On 8/30/21 1:11 PM, Oleksandr Suvorov wrote:
>>> On Sun, Aug 29, 2021 at 10:55 PM Marek Vasut <marex@denx.de> wrote:
>>>>
>>>> On 8/29/21 9:39 PM, Oleksandr Suvorov wrote:
>>>>> The BSP platform LmP supports the board NXP iMX8QM MEK. The
>>>>> kernel size in LmP exceeds 32Mb. Increase the maximum size
>>>>> of an uncompressed kernel to fix the following error:
>>>>>        Uncompressing Kernel Image
>>>>>        Error: inflate() returned -5
>>>>>        Image too large: increase CONFIG_SYS_BOOTM_LEN
>>>>>        Must RESET board to recover
>>>>>
>>>>
>>>> Maybe we should increase the default for arm64 instead ? 8 MiB is too small.
>>>
>>> I completely agree if NXP doesn't have objections.
>>> @Peng Fan Do you mind?
>>
>> Increase it for all of arm64 , or all of U-Boot even. This has nothing
>> to do with NXP.
> 
> In general, I agree. However, in practice this can have devastating effects on stuff as discussed here:
> 
> https://marc.info/?l=u-boot&m=162999598824381

I suspect the correct solution for that is to use bootm_size and let 
U-Boot figure out where to place the kernel / DT / etc.
Marcel Ziswiler Aug. 30, 2021, 4:34 p.m. UTC | #7
On Mon, 2021-08-30 at 17:10 +0200, Marek Vasut wrote:
> On 8/30/21 5:05 PM, Marcel Ziswiler wrote:
> > On Mon, 2021-08-30 at 14:18 +0200, Marek Vasut wrote:
> > > On 8/30/21 1:11 PM, Oleksandr Suvorov wrote:
> > > > On Sun, Aug 29, 2021 at 10:55 PM Marek Vasut <marex@denx.de> wrote:
> > > > > 
> > > > > On 8/29/21 9:39 PM, Oleksandr Suvorov wrote:
> > > > > > The BSP platform LmP supports the board NXP iMX8QM MEK. The
> > > > > > kernel size in LmP exceeds 32Mb. Increase the maximum size
> > > > > > of an uncompressed kernel to fix the following error:
> > > > > >        Uncompressing Kernel Image
> > > > > >        Error: inflate() returned -5
> > > > > >        Image too large: increase CONFIG_SYS_BOOTM_LEN
> > > > > >        Must RESET board to recover
> > > > > > 
> > > > > 
> > > > > Maybe we should increase the default for arm64 instead ? 8 MiB is too small.
> > > > 
> > > > I completely agree if NXP doesn't have objections.
> > > > @Peng Fan Do you mind?
> > > 
> > > Increase it for all of arm64 , or all of U-Boot even. This has nothing
> > > to do with NXP.
> > 
> > In general, I agree. However, in practice this can have devastating effects on stuff as discussed here:
> > 
> > https://marc.info/?l=u-boot&m=162999598824381
> 
> I suspect the correct solution for that is to use bootm_size and let 
> U-Boot figure out where to place the kernel / DT / etc.

Sure, but how would that work with FIT images e.g. containing kernel binary, device tree(s) and an initrd?
Marek Vasut Aug. 30, 2021, 4:49 p.m. UTC | #8
On 8/30/21 6:34 PM, Marcel Ziswiler wrote:
> On Mon, 2021-08-30 at 17:10 +0200, Marek Vasut wrote:
>> On 8/30/21 5:05 PM, Marcel Ziswiler wrote:
>>> On Mon, 2021-08-30 at 14:18 +0200, Marek Vasut wrote:
>>>> On 8/30/21 1:11 PM, Oleksandr Suvorov wrote:
>>>>> On Sun, Aug 29, 2021 at 10:55 PM Marek Vasut <marex@denx.de> wrote:
>>>>>>
>>>>>> On 8/29/21 9:39 PM, Oleksandr Suvorov wrote:
>>>>>>> The BSP platform LmP supports the board NXP iMX8QM MEK. The
>>>>>>> kernel size in LmP exceeds 32Mb. Increase the maximum size
>>>>>>> of an uncompressed kernel to fix the following error:
>>>>>>>         Uncompressing Kernel Image
>>>>>>>         Error: inflate() returned -5
>>>>>>>         Image too large: increase CONFIG_SYS_BOOTM_LEN
>>>>>>>         Must RESET board to recover
>>>>>>>
>>>>>>
>>>>>> Maybe we should increase the default for arm64 instead ? 8 MiB is too small.
>>>>>
>>>>> I completely agree if NXP doesn't have objections.
>>>>> @Peng Fan Do you mind?
>>>>
>>>> Increase it for all of arm64 , or all of U-Boot even. This has nothing
>>>> to do with NXP.
>>>
>>> In general, I agree. However, in practice this can have devastating effects on stuff as discussed here:
>>>
>>> https://marc.info/?l=u-boot&m=162999598824381
>>
>> I suspect the correct solution for that is to use bootm_size and let
>> U-Boot figure out where to place the kernel / DT / etc.
> 
> Sure, but how would that work with FIT images e.g. containing kernel binary, device tree(s) and an initrd?

I think I must really be missing something from the discussion you 
linked, sorry. Can you briefly summarize it, so we are on the same page?

I would say, increase BOOTM_LEN for everyone, or at least arm64, because 
right now it is too small. You say it can cause issues. I clearly do not 
see the issues it can cause, so, please help clarify it.
Tom Rini Aug. 30, 2021, 5:46 p.m. UTC | #9
On Mon, Aug 30, 2021 at 03:05:32PM +0000, Marcel Ziswiler wrote:
> On Mon, 2021-08-30 at 14:18 +0200, Marek Vasut wrote:
> > On 8/30/21 1:11 PM, Oleksandr Suvorov wrote:
> > > On Sun, Aug 29, 2021 at 10:55 PM Marek Vasut <marex@denx.de> wrote:
> > > > 
> > > > On 8/29/21 9:39 PM, Oleksandr Suvorov wrote:
> > > > > The BSP platform LmP supports the board NXP iMX8QM MEK. The
> > > > > kernel size in LmP exceeds 32Mb. Increase the maximum size
> > > > > of an uncompressed kernel to fix the following error:
> > > > >       Uncompressing Kernel Image
> > > > >       Error: inflate() returned -5
> > > > >       Image too large: increase CONFIG_SYS_BOOTM_LEN
> > > > >       Must RESET board to recover
> > > > > 
> > > > 
> > > > Maybe we should increase the default for arm64 instead ? 8 MiB is too small.
> > > 
> > > I completely agree if NXP doesn't have objections.
> > > @Peng Fan Do you mind?
> > 
> > Increase it for all of arm64 , or all of U-Boot even. This has nothing 
> > to do with NXP.
> 
> In general, I agree. However, in practice this can have devastating effects on stuff as discussed here:
> 
> https://marc.info/?l=u-boot&m=162999598824381

In that yes, if we allow for larger kernels to be loaded, we also need
to ensure platforms use sane relocation values, it also needs to be
considered.  But even if we have CONFIG_SYS_BOOTM_LEN set large, unless
we then also disable device tree / initrd relocation, we don't have a
silent problem?
Marcel Ziswiler Aug. 30, 2021, 7:42 p.m. UTC | #10
On Mon, 2021-08-30 at 13:46 -0400, Tom Rini wrote:
> On Mon, Aug 30, 2021 at 03:05:32PM +0000, Marcel Ziswiler wrote:
> > On Mon, 2021-08-30 at 14:18 +0200, Marek Vasut wrote:
> > > On 8/30/21 1:11 PM, Oleksandr Suvorov wrote:
> > > > On Sun, Aug 29, 2021 at 10:55 PM Marek Vasut <marex@denx.de> wrote:
> > > > > 
> > > > > On 8/29/21 9:39 PM, Oleksandr Suvorov wrote:
> > > > > > The BSP platform LmP supports the board NXP iMX8QM MEK. The
> > > > > > kernel size in LmP exceeds 32Mb. Increase the maximum size
> > > > > > of an uncompressed kernel to fix the following error:
> > > > > >       Uncompressing Kernel Image
> > > > > >       Error: inflate() returned -5
> > > > > >       Image too large: increase CONFIG_SYS_BOOTM_LEN
> > > > > >       Must RESET board to recover
> > > > > > 
> > > > > 
> > > > > Maybe we should increase the default for arm64 instead ? 8 MiB is too small.
> > > > 
> > > > I completely agree if NXP doesn't have objections.
> > > > @Peng Fan Do you mind?
> > > 
> > > Increase it for all of arm64 , or all of U-Boot even. This has nothing 
> > > to do with NXP.
> > 
> > In general, I agree. However, in practice this can have devastating effects on stuff as discussed here:
> > 
> > https://marc.info/?l=u-boot&m=162999598824381
> 
> In that yes, if we allow for larger kernels to be loaded, we also need
> to ensure platforms use sane relocation values, it also needs to be
> considered.

Exactly.

> But even if we have CONFIG_SYS_BOOTM_LEN set large, unless
> we then also disable device tree / initrd relocation, we don't have a
> silent problem?

Well, I am not saying we should NOT increase CONFIG_SYS_BOOTM_LEN. I am just cautioning that this may cause
further issue resp. might require further adjustments down the road.
Peng Fan (OSS) Sept. 15, 2021, 3:06 a.m. UTC | #11
On 2021/8/30 19:11, Oleksandr Suvorov wrote:
> On Sun, Aug 29, 2021 at 10:55 PM Marek Vasut <marex@denx.de> wrote:
>>
>> On 8/29/21 9:39 PM, Oleksandr Suvorov wrote:
>>> The BSP platform LmP supports the board NXP iMX8QM MEK. The
>>> kernel size in LmP exceeds 32Mb. Increase the maximum size
>>> of an uncompressed kernel to fix the following error:
>>>       Uncompressing Kernel Image
>>>       Error: inflate() returned -5
>>>       Image too large: increase CONFIG_SYS_BOOTM_LEN
>>>       Must RESET board to recover
>>>
>>
>> Maybe we should increase the default for arm64 instead ? 8 MiB is too small.
> 
> I completely agree if NXP doesn't have objections.
> @Peng Fan Do you mind?
> 

I am ok with increase ARM64 default bootm len.

Regards,
Peng.
Stefano Babic Oct. 7, 2021, 2:13 p.m. UTC | #12
> The BSP platform LmP supports the board NXP iMX8QM MEK. The
> kernel size in LmP exceeds 32Mb. Increase the maximum size
> of an uncompressed kernel to fix the following error:
>     Uncompressing Kernel Image
>     Error: inflate() returned -5
>     Image too large: increase CONFIG_SYS_BOOTM_LEN
>     Must RESET board to recover
> Signed-off-by: Oleksandr Suvorov <oleksandr.suvorov@foundries.io>
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic
diff mbox series

Patch

diff --git a/include/configs/imx8qm_mek.h b/include/configs/imx8qm_mek.h
index 99e73a9446..03fa51168a 100644
--- a/include/configs/imx8qm_mek.h
+++ b/include/configs/imx8qm_mek.h
@@ -10,6 +10,8 @@ 
 #include <linux/stringify.h>
 #include <asm/arch/imx-regs.h>
 
+#define CONFIG_SYS_BOOTM_LEN		(64 * SZ_1M)
+
 #ifdef CONFIG_SPL_BUILD
 #define CONFIG_SPL_MAX_SIZE				(124 * 1024)
 #define CONFIG_SYS_MONITOR_LEN				(1024 * 1024)