# Ipq40xx kernel size and U-Boot: v5.10 is too big for 4 MB

**URL:** <https://forum.gl-inet.com/t/ipq40xx-kernel-size-and-u-boot-v5-10-is-too-big-for-4-mb/17619>\
**Category:** Router\
**Created:** [October 2, 2021, 7:14pm UTC](https://forum.gl-inet.com/t/ipq40xx-kernel-size-and-u-boot-v5-10-is-too-big-for-4-mb/17619 "2021-10-02T19:14:05Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![szab](https://forum-assets.gl-inet.com/letter_avatar_proxy/v4/letter/s/9d8465/32.png) [@szab](https://forum.gl-inet.com/u/szab)\
**Post date:** [October 2, 2021, 7:14pm UTC](https://forum.gl-inet.com/t/ipq40xx-kernel-size-and-u-boot-v5-10-is-too-big-for-4-mb/17619/1 "2021-10-02T19:14:05Z")

</div>

[Kernel v5.10 support for `ipq40xx`](https://github.com/openwrt/openwrt/commit/7b1fa276f5a220782f702b099fc68a079c2a0fd5) was landed in OpenWrt for testing purposes.

As can be seen in the commit message, two GL.iNet devices failed to build with buildbot settings and all  
feeds installed, for example:

```auto
FIT description: ARM OpenWrt FIT (Flattened Image Tree)
Created: Thu Sep 30 21:07:31 2021
 Image 0 (kernel-1)
  Description: ARM OpenWrt Linux-5.10.64
  Created: Thu Sep 30 21:07:31 2021
  Type: Kernel Image
  Compression: gzip compressed
  Data Size: 4212548 Bytes = 4113.82 KiB = 4.02 MiB
  Architecture: ARM
  OS: Linux
  Load Address: 0x80208000
  Entry Point: 0x80208000
  Hash algo: crc32
  Hash value: 54fc4207
  Hash algo: sha1
  Hash value: 7461cdf544e7d56310807c36e394dacbc58d2acc
 Image 1 (fdt-1)
  Description: ARM OpenWrt glinet_gl-b1300 device tree blob
  Created: Thu Sep 30 21:07:31 2021
  Type: Flat Device Tree
  Compression: uncompressed
  Data Size: 16326 Bytes = 15.94 KiB = 0.02 MiB
  Architecture: ARM
  Hash algo: crc32
  Hash value: 303d4ba2
  Hash algo: sha1
  Hash value: 0dbf495a0c42dfbc3ff5a3ebe4dc3f456ad91aed
 Default Configuration: 'config@1'
 Configuration 0 (config@1)
  Description: OpenWrt glinet_gl-b1300
  Kernel: kernel-1
  FDT: fdt-1
WARNING: Image file /openwrt/build_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/linux-ipq40xx_generic/glinet_gl-b1300-fit-uImage.itb is too big: 4230764 > 4194304

```

So I had to repeat @jeffsf, but for `ipq40xx`, especially GL-B1300 and GL-S1300:

> [@NAND Kernel Size and U-Boot -- Ensuring Smooth, Future Upgrades](https://forum.gl-inet.com/t/nand-kernel-size-and-u-boot-ensuring-smooth-future-upgrades/8730/1):
>
> @alzhao @luochongjun or others at GL.iNet, as appropriate
> 
> Would you be able to make a definitive statement on if the U-Boot for the ~~GL-AR750S~~ GL-B1300 and that for the ~~GL-AR300M~~ GL-S1300 can reliably load and boot a 4 MB kernel?

Thanks!

---

<div class="post-metadata">

**Author:** ![szab](https://forum-assets.gl-inet.com/letter_avatar_proxy/v4/letter/s/9d8465/32.png) [@szab](https://forum.gl-inet.com/u/szab)\
**Post date:** [October 9, 2021, 10:52pm UTC](https://forum.gl-inet.com/t/ipq40xx-kernel-size-and-u-boot-v5-10-is-too-big-for-4-mb/17619/3 "2021-10-09T22:52:19Z")

</div>

Looks like switching to zImage (from gzip compression) will be ~~the solution~~ a good workaround:

- all the U-Boot releases support, even the initial release `U-Boot 2012.07 [Chaos Calmer 15.05.1,r35193] (Apr 13 2018 - 13:54:46)`
- shrinks the kernel by ~1200k

---

<div class="post-metadata">

**Author:** ![hansome](https://forum-assets.gl-inet.com/letter_avatar_proxy/v4/letter/h/b5ac83/32.png) [@hansome](https://forum.gl-inet.com/u/hansome)\
**Post date:** [October 10, 2021, 2:20pm UTC](https://forum.gl-inet.com/t/ipq40xx-kernel-size-and-u-boot-v5-10-is-too-big-for-4-mb/17619/4 "2021-10-10T14:20:43Z")

</div>

Thanks for that solution. It’s possible to load \>4MB kernel after patching [uboot](https://github.com/gl-inet/uboot-ipq40xx). I’ll do some test.

---

<div class="post-metadata">

**Author:** ![szab](https://forum-assets.gl-inet.com/letter_avatar_proxy/v4/letter/s/9d8465/32.png) [@szab](https://forum.gl-inet.com/u/szab)\
**Post date:** [October 10, 2021, 2:51pm UTC](https://forum.gl-inet.com/t/ipq40xx-kernel-size-and-u-boot-v5-10-is-too-big-for-4-mb/17619/5 "2021-10-10T14:51:33Z")

</div>

That would be far better solution, thanks!

While testing other solutions, I was able to start oversized kernels up to `0x00450000`.  
After upgrading to newer versions, and rolling back to a backup of my original U-Boot (`U-Boot 2012.07 [Chaos Calmer 15.05.1,r35193] (Apr 13 2018 - 13:54:46)`), I wasn’t able to boot any oversized kernel. 🤷‍♀️

I happily test new binary releases and commits from that `uboot-ipq40xx`.

---

<div class="post-metadata">

**Author:** ![hansome](https://forum-assets.gl-inet.com/letter_avatar_proxy/v4/letter/h/b5ac83/32.png) [@hansome](https://forum.gl-inet.com/u/hansome)\
**Post date:** [October 21, 2021, 1:20pm UTC](https://forum.gl-inet.com/t/ipq40xx-kernel-size-and-u-boot-v5-10-is-too-big-for-4-mb/17619/7 "2021-10-21T13:20:12Z")

</div>

Hi Szabolcs,

I’v patch uboot to load maxium 8MB kernel. I think that’s extensible enough. you can check [commit](https://github.com/gl-inet/uboot-ipq40xx/commit/25ffdacad000826c81307b2517a658593f32a51f).  
This patch load larger kernel than the pre-defined partition table on nor flash, partiton table can be checked by uboot command

```auto
smeminfo

```

---

<div class="post-metadata">

**Author:** ![szab](https://forum-assets.gl-inet.com/letter_avatar_proxy/v4/letter/s/9d8465/32.png) [@szab](https://forum.gl-inet.com/u/szab)\
**Post date:** [October 24, 2021, 12:05pm UTC](https://forum.gl-inet.com/t/ipq40xx-kernel-size-and-u-boot-v5-10-is-too-big-for-4-mb/17619/8 "2021-10-24T12:05:49Z")

</div>

Hi!

Thank you very much for the fix!

Sadly I’m unable to verify `smeminfo` because my serial connection doesn’t send anything to the device! 🙃

I tested the newest U-Boot release (`U-Boot 2012.07 [local,local] (Oct 21 2021 - 18:08:35)`) with an oversized, ~10 MB kernel, and it doesn’t boot: ✔

```auto
FIT description: ARM OpenWrt FIT (Flattened Image Tree)
Created: Sat Oct 23 11:31:22 2021
 Image 0 (kernel-1)
  Description: ARM OpenWrt Linux-5.4.155
  Created: Sat Oct 23 11:31:22 2021
  Type: Kernel Image
  Compression: uncompressed
  Data Size: 10642944 Bytes = 10393.50 KiB = 10.15 MiB
  Architecture: ARM
  OS: Linux
  Load Address: 0x80208000
  Entry Point: 0x80208000
  Hash algo: crc32
  Hash value: 7da27167
  Hash algo: sha1
  Hash value: d4b09f29fe908dd33f2962933c3bdc9f2243e279
 Image 1 (fdt-1)
  Description: ARM OpenWrt glinet_gl-b1300 device tree blob
  Created: Sat Oct 23 11:31:22 2021
  Type: Flat Device Tree
  Compression: uncompressed
  Data Size: 16326 Bytes = 15.94 KiB = 0.02 MiB
  Architecture: ARM
  Hash algo: crc32
  Hash value: 303d4ba2
  Hash algo: sha1
  Hash value: 0dbf495a0c42dfbc3ff5a3ebe4dc3f456ad91aed
 Default Configuration: 'config@1'
 Configuration 0 (config@1)
  Description: OpenWrt glinet_gl-b1300
  Kernel: kernel-1
  FDT: fdt-1

```

After that, I checked a 4+ MB kernel: boots nicely! ✔

```auto
SF: Detected MX25L25635E with page size 4 KiB, total 32 MiB
## Booting kernel from FIT Image at 84000000 ...
   Using 'config@1' configuration
   Trying 'kernel-1' kernel subimage
     Description: ARM OpenWrt Linux-5.10.75
     Type: Kernel Image
     Compression: gzip compressed
     Data Start: 0x840000e4
     Data Size: 4561994 Bytes = 4.4 MiB
     Architecture: ARM
     OS: Linux
     Load Address: 0x80208000
     Entry Point: 0x80208000
     Hash algo: crc32
     Hash value: 2242d08b
     Hash algo: sha1
     Hash value: 83becb3c9130f7054e2cd880dd442fecb073890b
   Verifying Hash Integrity ... crc32+ sha1+ OK
## Flattened Device Tree from FIT Image at 84000000
   Using 'config@1' configuration
   Trying 'fdt-1' FDT blob subimage
     Description: ARM OpenWrt glinet_gl-b1300 device tree blob
     Type: Flat Device Tree
     Compression: uncompressed
     Data Start: 0x84459e6c
     Data Size: 16326 Bytes = 15.9 KiB
     Architecture: ARM
     Hash algo: crc32
     Hash value: 303d4ba2
     Hash algo: sha1
     Hash value: 0dbf495a0c42dfbc3ff5a3ebe4dc3f456ad91aed
   Verifying Hash Integrity ... crc32+ sha1+ OK
   Booting using the fdt blob at 0x84459e6c
   Uncompressing Kernel Image ... OK
   Loading Device Tree to 86ff9000, end 86ffffc5 ... OK
ipq: fdt fixup unable to find compatible node
Using machid 0x8010000 from environment

Starting kernel ...

[0.000000] Booting Linux on physical CPU 0x0
[0.000000] Linux version 5.10.75 (xabolcs@ut2004) (arm-openwrt-linux-muslgnueabi-gcc (OpenWrt GCC 11.2.0 r17816-94c41ef2ef) 11.2.0, GNU ld (GNU Binutils) 2.37) #0 SMP Sat Oct 23 11:31:22 2021
[0.000000] CPU: ARMv7 Processor [410fc075] revision 5 (ARMv7), cr=10c5387d
[0.000000] CPU: div instructions available: patching division code
[0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
[0.000000] OF: fdt: Machine model: GL.iNet GL-B1300

```

* * *

Your commit message is:

```auto
 fix boot kernel lager than 4MB, maximum 8MB 

```

Is this true for all the `ipq-40xx` devices: GL-AP1300, GL-B1300, GL-S1300 and GL-B2200?

I’m asking this, because I’d like to create an OpenWrt commit where all these devices get an `KERNEL_SIZE := 8192k` limit, to prevent the devices from unnecessary boot loop.

Another question: all these devices support booting an uncompressed image? I know GL-B1300 and GL-B2200 work for sure.  
I’m asking this, because I’d like to switch the remaining devices to use zImage.

---

<div class="post-metadata">

**Author:** ![hansome](https://forum-assets.gl-inet.com/letter_avatar_proxy/v4/letter/h/b5ac83/32.png) [@hansome](https://forum.gl-inet.com/u/hansome)\
**Post date:** [October 25, 2021, 2:24am UTC](https://forum.gl-inet.com/t/ipq40xx-kernel-size-and-u-boot-v5-10-is-too-big-for-4-mb/17619/9 "2021-10-25T02:24:18Z")

</div>

> [@szab](#):
>
> Is this true for all the `ipq-40xx` devices: GL-AP1300, GL-B1300, GL-S1300 and GL-B2200?

Sorry that I make that commit message too simple. 8MB limitation is for kernel on nor flash, only GL-B1300 and GL-S1300. AP1300’s kernel is on nand and it has volumn name of “kernel”, B2200’s kernel is  
on eMMC partition that has limitation of 32MB.  
Although S1300 and B2200 both has eMMC, S1300 support is upstream early when eMMC kernel patch is needed with older kernel.

> [@szab](#):
>
> Another question: all these devices support booting an uncompressed image?

Yes.

---

<div class="post-metadata">

**Author:** ![szab](https://forum-assets.gl-inet.com/letter_avatar_proxy/v4/letter/s/9d8465/32.png) [@szab](https://forum.gl-inet.com/u/szab)\
**Post date:** [October 25, 2021, 5:50am UTC](https://forum.gl-inet.com/t/ipq40xx-kernel-size-and-u-boot-v5-10-is-too-big-for-4-mb/17619/10 "2021-10-25T05:50:25Z")

</div>

Thank you for clarifying!

---

<div class="post-metadata">

**Author:** ![bruce](https://forum-assets.gl-inet.com/user_avatar/forum.gl-inet.com/bruce/32/35649_2.png) [@bruce](https://forum.gl-inet.com/u/bruce)\
**Post date:** [October 29, 2025, 4:15am UTC](https://forum.gl-inet.com/t/ipq40xx-kernel-size-and-u-boot-v5-10-is-too-big-for-4-mb/17619/11 "2025-10-29T04:15:13Z")

</div>


