MikroTik rb450gx4 support

It works, thank you!

Is there any progress on when rb450Gx4 will be officially supported?

Thanks

1 Like

Hopefully soon, I should have some time in February to respin the whole patch series.
I got the SD card support stuff along with LDO driver for it merged in upstream Linux, so its awaiting merge in another of my PR-s in OpenWrt.

Hi, I have recently received a few new RB450Gx4 boards and installed OpenWRT via sysupgrade (after doing ubidetach and ubiformat).
Unfortunately I am not able to boot some of them from NAND (others are working fine).
An error like this occurs:

OpenWrt kernel loader for Qualcomm IPQ-4XXX/IPQ-806X
Copyright (C) 2019  Sergey Sergeev <adron@mstnt.com>

Extracting LZMA kernel...LzmaDecode error 1 at 84802191, osize:8504384 ip:0 op:0
00 0f 06 bc 8e b0 02 73 92 d1 62 7f 6e 73 d1 33 
failed, data error!

After further investigation I found that the boards are equipped with different NAND chips (same size like on working boards, but different erase size, page size and OOB size).

On the boards not booting from NAND i have found a Winbond W29N04GV91AA chip:

nand: device found, Manufacturer ID: 0xef, Chip ID: 0xdc
nand: Winbond W29N04GV
nand: 512 MiB, SLC, erase size: 128 KiB, page size: 2048, OOB size: 64

Partitions reported via /proc/mtd are:

dev:    size   erasesize  name
mtd0: 01000000 00020000 "kernel"
mtd1: 1f000000 00020000 "ubi"
mtd2: 00023000 00001000 "Qualcomm-boot1"
mtd3: 0005d000 00001000 "Qualcomm-boot2"
mtd4: 0000e000 00001000 "RouterBoot"
mtd5: 00001000 00001000 "hard_config"
mtd6: 00010000 00001000 "dts_config"
mtd7: 00001000 00001000 "soft_config"

On boards working well, the erase size for kernel and ubi partition is twice, everything else is the same.

I see the same problem with pre-built binary image from google drive as well as image compiled from RB450Gx4-rebase-sdhci branch - slighly different error message but basically the same problem.

Also I noted the RouterBOOT version is slightly newer on the boards not booting from NAND (6.42 vs. 6.41.3).

Is there anybody, who managed to get OpenWRT to boot from NAND with this type
of NAND chip?

Could the problem be related to the different erase size on the NAND chip or different RooterBOOT version?

Any hint how to get OpenWRT booting via these NAND chips would be very welcome - thank you!

I am currently sick, and unable to test anything but its most likely becase this Winbond uses 128k blocks and 2048 pages instead of double that of Toshiba that is on mine.

So those parameters need to be changed in OpenWrt and the aux loader

I just meet with the same problem. Could you give more hints about this? Thank you!

Hi, it seems thart I meet the same problem with bm42.
I search sourcecodes with keywords BLOCKSIZE and PAGESIZE, and find two places.
the first is target/linux/ipq40xx/image/ipq-aux-loader/src/Makefile:

#ubi image vars
BLOCKSIZE := 256k
PAGESIZE  := 4096
.........
$(ldr-ubifs): $(ldr-elf)
	rm -Rf ubi/ubifs-rootdir
	mkdir ubi/ubifs-rootdir
	cp bin/loader.elf ubi/ubifs-rootdir/kernel
	$(STAGING_DIR_HOST)/bin/mkfs.ubifs \
		-m $(PAGESIZE) -e 126976 -c 120 --compr=none \
		-r ubi/ubifs-rootdir $(ldr-ubifs)
	rm -Rf ubi/ubifs-rootdir

the second is /target/linux/ipq40xx/image/Makefile, line 310 define Device/MikrotikNAND
I try to change BLOCKSIZE,PAGESIZE to 128k,2048, and change mkfs.ubifs parameters -e to 126976, -c to 120
I compiled it succesfully, but it still didn't work. My router cannot startup and restart repeatedly.
I really know little about how to correct these NAND parameters, hope you could help me ,thank you!

Aux loader has a hardcoded UBI parameters in one of the files.
That needs to be changed as well

I am rebasing the original PR to current master and then I will reopen the PR.

Guys, I am preparing a new image.
Whole SD card/LDO situation was upstream to Linux and then backported into OpenWrt recently for another board by me.
So, I should have a new image today/tommorow.

I am gonna need testers with W29N04GV NAND instead of Toshiba one

Thank you for your efforts! I would be happy to test with W29N04GV NAND.

Can someone with the Winbond NAND make a dump of the kernel partition so I can take a look at UBIFS parameters they used?

Thanks

I have uploaded a dump of the kernel partition to Google Drive:
https://drive.google.com/drive/folders/10G51s4FMimYu1AbIAvT8pyvacT4QoUpZ?usp=sharing
Image was built with changed BLOCKSIZE to 128k and PAGESIZE to 2048 for Device/MikrotikNAND in target/linux/ipq40xx/image/Makefile and also changed the hardcoded parameters for mkfs.ubifs in target/linux/ipq40xx/image/ipq-aux-loader/src/Makefile to -e 126976 -c 120

1 Like

Thanks, I just cant catch some free time to dive deeper.
@bm42 I was hoping for a kernel partition with ROS kernel still on it, but if it boots with those parameters then OK.

Basically the issue now is, in order to avoid manually making UBIFS for the kernel through the aux-loader I need to somehow create it from OpenWrt directly.
Image recipes are not my strong suit, so I am yet unable to do it that way.
Aux loader is fine for only one combo, but should really not be used in this way.

No problem - I have also added a dump with the ROS kernel (uploaded to same Google Drive share as mentioned above).

The OpenWRT kernel is also booting from Winbond NAND with the changed BLOCKSIZE, PAGESIZE and hardcoded mkfs.ubifs parameters, but only after I did a mtd erase kernel before installing it to NAND - in fact I am not so familiar to the NAND details to understand why it needs to be erased first, but found it working on a few boards with the Winbond NAND.

It needs to be either erased or ubiformat-ted, because its size is different and UBI overlay hash will not match.
Its a common thing.

Just gotta figure out how to generate a UBIFS will kernel only from OpenWrt and its ready for a PR.

Hi, robinarko, Is there planned release date? I bought rb450gx4 almost 1year, and waiting for a release.
If any work I can help, please let me know. I 'd like to give a hand.

Well there is none, I have been rebasing it couple of time but lack of time always gets me.
I was stuck on getting the UBIFS kernel image generated in OpenWrt instead of the aux loader as all of the parameters there are fixed.

I quickly got the WLAN up.
Here is the branch:

Dont expect the ROS level WLAN performance as BDF used is the generic QCA one

Is. RB450Gx4-rebase-sdhci not available??????

Is RB450Gx4-PR-release usable??????

thank you.