Alfa AP121/Hornet: "Changing flash layout" from 8MB to 16MB / kernel ignoring cmdline


I bought a device (Hornet) which has a 16 MB flash with just an 8 MB flash layout:

[    0.814567] m25p80 spi0.0: found mx25l12805d, expected m25p80
[    0.819214] m25p80 spi0.0: mx25l12805d (16384 Kbytes)
[    0.824024] 7 cmdlinepart partitions found on MTD device spi0.0
[    0.829801] Creating 7 MTD partitions on "spi0.0":
[    0.834616] 0x000000000000-0x000000040000 : "u-boot"
[    0.841525] 0x000000040000-0x000000050000 : "u-boot-env"
[    0.848337] 0x000000050000-0x000000650000 : "rootfs"
[    0.852946] mtd: device 2 (rootfs) set to be root filesystem
[    0.857647] 1 squashfs-split partitions found on MTD device rootfs
[    0.863702] 0x0000002c0000-0x000000650000 : "rootfs_data"
[    0.872186] 0x000000650000-0x0000007e0000 : "kernel"
[    0.877746] 0x0000007e0000-0x0000007f0000 : "nvram"
[    0.884050] 0x0000007f0000-0x000000800000 : "art"
[    0.889251] 0x000000050000-0x0000007e0000 : "firmware"

How can the layout be changed?
I searched in docs for "mtd" and "flash" but didn't found something which explains how the layout can be changed.


Meanwhile I detected that flash layout is correct!
But the kernel is ignoring the cmdline args from u-boot.

ar7240> printenv
bootargs=console=ttyS0,115200 root=31:02 rootfstype=squashfs init=/sbin/init mtdparts=ar7240-nor0:256k(u-boot),64k(u-boot-env),14336k(rootfs),1600k(uImage),64k(NVRAM),64k(ART) REVISIONID
root@OpenWrt:/# cat /proc/cmdline 
 board=HORNET-UB console=ttyATH0,115200 mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,6144k(rootfs),1600k(kernel),64k(nvram),64k(art)ro,7744k@0x50000(firmware) rootfstype=squashfs noinitrd

How can the kernel (coming from factory.bin) be instructed to use the cmdline args stored in u-boot env?

The flash layout is hardcoded in dts.

@slh: Thank you. I think this did change at some point in the past. :slight_smile:


The basic issue is that for current Hornet boards (Alfa AP121) there is no "factory" image.

Up to Chaos Calmer (15) there were images for the 8MB and the 16MB version provided.
In addition to that there's a big warning in AP121/Hornet articles about " NOT RECOMMENDED for future use" and also "OpenWrt support for this device will end after 2019." which is completely misleading!
First of all there is a 4/32 version mentioned which I actually never faced. And in pages from 2015 there is only the 8/32 mentioned - maybe 4/32 was just a prototype.
There are even more doc parts which are not uptodate and even images seem to have been "vanished" since migration from old wiki.

Currently only 16/64 boards are available and these are supported but there is no factory image provided anymore.
You'll need to upgrade manually to get the benefits from the 16MB like e.g. use openwrt-19.07.7-ar71xx-generic-hornet-ub-x2-squashfs-sysupgrade.bin as kernel image to flash and openwrt-19.07.7-ar71xx-generic-ap121-16M-squashfs-sysupgrade.bin as rootfs image.

If you have a device with different specifications, you can add submit a patch to get it supported officially (alongside the smaller variants).

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.