MikroTik rb450gx4 support

trying build RB450Gx4-PR-rebase, build succeed, but cannot boot.

///////////////////////////------------------------

[ 1.718440] Segment Routing with IPv6
[ 1.718749] NET: Registered protocol family 17
[ 1.722685] 8021q: 802.1Q VLAN Support v1.8
[ 1.726729] Registering SWP/SWPB emulation handler
[ 1.7400 1.742620] List of all partitions:
[ 1.742665] 1f00 16384 mtdblock0
[ 1.742669] (driver?)
[ 1.749083] 1f01 507904 mtdblock1
[ 1.749086] (driver?)
[ 1.755594] 1f02 140 mtdblock2
[ 1.755598] (driver?)
[ 1.762121] 1f03 372 mtdblock3
[ 1.762125] (driver?)
[ 1.768613] 1f04 56 mtdblock4
[ 1.768616] (driver?)
[ 1.775139] 1f05 4 mtdblock5
[ 1.775142] (driver?)
[ 1.781646] 1f06 64 mtdblock6
[ 1.781649] (driver?)
[ 1.788146] 1f07 4 mtdblock7
[ 1.788148] (driver?)
[ 1.794661] No filesystem could mount root, tried:
[ 1.794664] squashfs
[ 1.797082]
[ 1.804291] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(31,1)
[ 1.805869] CPU1: stopping
[ 1.813929] CPU: 1 PID: 0 Comm: swapper/1 Not tainted 4.19.108 #0
[ 1.816706] Hardware name: Generic DT based system
[ 1.822890] [] (unwind_backtrace) from [] (show_stack+0x10/0x14)
[ 1.827570] [] (show_stack) from [] (dump_stack+0x94/0xa8)
[ 1.835466] [] (dump_stack) from [] (handle_IPI+0xf0/0x19c)
[ 1.842501] [] (handle_IPI) from [] (gic_handle_irq+0x8c/0x90)
[ 1.849704] [] (gic_handle_irq) from [] (__irq_svc+0x6c/0x90)
[ 1.857334] Exception stack(0xef095f68 to 0xef095fb0)
[ 1.864889] 5f60: 00000000 000001f8 ef6c42c4 c0313b40 ffffe000 c0b04c6c
[ 1.869929] 5f80: 00000002 c0b04cac c0a3cda8 00000000 00000000 00000000 c0b0e840 ef095fb8
[ 1.878082] 5fa0: c03082d4 c03082d8 60000013 ffffffff
[ 1.886246] [] (__irq_svc) from [] (arch_cpu_idle+0x34/0x38)
[ 1.891285] [] (arch_cpu_idle) from [] (do_idle+0xf0/0x200)
[ 1.898747] [] (do_idle) from [] (cpu_startup_entry+0x18/0x1c)
[ 1.905778] [] (cpu_startup_entry) from [<803023ec>] (0x803023ec)
[ 1.913412] CPU3: stopping
[ 1.920261] CPU: 3 PID: 0 Comm: swapper/3 Not tainted 4.19.108 #0

...........

////////////////////////////---------------------------------------

Sorry for the insistence, but is there news of when it will be officially supported?
Thanks

Not untill I can figure out how to make a UBIFS packed kernel from OpenWrt.

Also, @cliffffliu Did you ubiformat the rootfs partition before sysupgrading?

hi, robimarko,

tried to build on branch rb450gx4-PR-rebase again. but failed.

stage1flex-main.o: In function `check_options':
main.c:(.text+0x44b): undefined reference to `log10'
main.c:(.text+0x450): undefined reference to `ceil'
stage1flex-buf.o: In function `buf_linedir':
buf.c:(.text+0x270): undefined reference to `log10'
buf.c:(.text+0x275): undefined reference to `ceil'
collect2: error: ld returned 1 exit status
make[6]: *** [stage1flex] Error 1
make[6]: Leaving directory `/home/cliff/OpenWrt/openwrt/build_dir/host/flex-2.6.4/src'
make[5]: *** [all] Error 2
make[5]: Leaving directory `/home/cliff/OpenWrt/openwrt/build_dir/host/flex-2.6.4/src'
make[4]: *** [all-recursive] Error 1
make[4]: Leaving directory `/home/cliff/OpenWrt/openwrt/build_dir/host/flex-2.6.4'
make[3]: *** [/home/cliff/OpenWrt/openwrt/build_dir/host/flex-2.6.4/.built] Error 2
make[3]: Leaving directory `/home/cliff/OpenWrt/openwrt/tools/flex'
time: tools/flex/compile#17.95#6.94#145.45
make[2]: *** [tools/flex/compile] Error 2
make[2]: Leaving directory `/home/cliff/OpenWrt/openwrt'
make[1]: *** [/home/cliff/OpenWrt/openwrt/staging_dir/host/stamp/.tools_compile_yynyynnyyynyyyyynyynnyyyynyyyyyyyyyyyyyyynynynnyyynnyyy] Error 2
make[1]: Leaving directory `/home/cliff/OpenWrt/openwrt'
make: *** [world] Error 2

Is there other usable branch using newer kernel ???

Hm, thats a tool issue.
I dont know whats the latest branch.

But they are all out of date and need to be rebased onto master to build cleanly

I mean the "up to date"........ branch.

understand, When will there have a rebase branch?

Probably not anytime soon as I dont have time and the intermediate loader is prevent the merge of other IPQ40xx devices

hi, robimarko,

any progress in RB450gX4 ? I can't build successfully using any newer version.

Hope you can make a usable rebase .

Hi, I guess I'm joining the club...

Is there an update on how to get this working from NAND or maybe SD?

[    0.786920] nand: device found, Manufacturer ID: 0xef, Chip ID: 0xdc
[    0.787767] nand: Winbond W29N04GV
[    0.794425] nand: 512 MiB, SLC, erase size: 128 KiB, page size: 2048, OOB size: 64
[    0.797625] 2 fixed-partitions partitions found on MTD device qcom_nand.0
[    0.805157] Creating 2 MTD partitions on "qcom_nand.0":
[    0.812008] 0x000000000000-0x000001000000 : "kernel"
[    0.841077] random: fast init done
[    0.842254] 0x000001000000-0x000020000000 : "ubi"
[    1.602791] spi_qup 78b5000.spi: IN:block:16, fifo:64, OUT:block:16, fifo:64
[    1.612537] m25p80 spi0.0: w25q16jv (2048 Kbytes)
[    1.612600] 6 fixed-partitions partitions found on MTD device spi0.0
[    1.616219] Creating 6 MTD partitions on "spi0.0":
[    1.622675] 0x000000000000-0x000000023000 : "Qualcomm-boot1"
[    1.627974] 0x000000023000-0x000000080000 : "Qualcomm-boot2"
[    1.633741] 0x000000080000-0x00000008e000 : "RouterBoot"
[    1.639322] 0x00000008e000-0x00000008f000 : "hard_config"
[    1.644646] 0x000000090000-0x0000000a0000 : "dts_config"
[    1.649924] 0x0000000bd000-0x0000000be000 : "soft_config"

Ok, I found out how to compile the branch, but I'm getting a vague error.

make[3]: Entering directory '/home/teun/workspace/openwrt_rb450/tools/mkimage'
make -C /home/teun/workspace/openwrt_rb450/build_dir/host/u-boot-2018.03 HOSTCFLAGS="-O2 -I/home/teun/workspace/openwrt_rb450/staging_dir/host/include " HOSTLDFLAGS="-L/home/teun/workspace/openwrt_rb450/staging_dir/host/lib " no-dot-config-targets=tools-only CONFIG_MKIMAGE_DTC_PATH=dtc CONFIG_FIT_SIGNATURE=y tools-only
make[4]: Entering directory '/home/teun/workspace/openwrt_rb450/build_dir/host/u-boot-2018.03'
  HOSTCC  scripts/basic/fixdep
  CHK     include/config/uboot.release
  CHK     include/generated/version_autogenerated.h
  CHK     include/generated/timestamp_autogenerated.h
  HOSTCC  tools/mkenvimage.o
In file included from /usr/include/asm-generic/types.h:7,
                 from /usr/include/asm/types.h:1,
                 from /usr/include/linux/types.h:5,
                 from /usr/include/linux/stat.h:5,
                 from /usr/include/bits/statx.h:31,
                 from /usr/include/sys/stat.h:446,
                 from tools/mkenvimage.c:21:
/usr/include/asm-generic/int-ll64.h:31:42: error: conflicting types for '__u64'
   31 | __extension__ typedef unsigned long long __u64;
      |                                          ^~~~~
In file included from <command-line>:
././include/compiler.h:69:18: note: previous declaration of '__u64' was here
   69 | typedef uint64_t __u64;
      |                  ^~~~~
make[5]: *** [scripts/Makefile.host:116: tools/mkenvimage.o] Error 1
make[4]: *** [Makefile:1509: tools-only] Error 2
make[4]: Leaving directory '/home/teun/workspace/openwrt_rb450/build_dir/host/u-boot-2018.03'
make[3]: *** [Makefile:47: /home/teun/workspace/openwrt_rb450/build_dir/host/u-boot-2018.03/.built] Error 2
make[3]: Leaving directory '/home/teun/workspace/openwrt_rb450/tools/mkimage'
time: tools/mkimage/compile#0.48#0.19#0.68
make[2]: *** [tools/Makefile:159: tools/mkimage/compile] Error 2
make[2]: Leaving directory '/home/teun/workspace/openwrt_rb450'
make[1]: *** [tools/Makefile:155: /home/teun/workspace/openwrt_rb450/staging_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/stamp/.tools_compile_yynyynnyyynyyyyynyynnyyyynyyyyyyyyyyyyyyynyynynnyyynnyyy] Error 2
make[1]: Leaving directory '/home/teun/workspace/openwrt_rb450'
make: *** [/home/teun/workspace/openwrt_rb450/include/toplevel.mk:218: world] Error 2
~/workspace/openwrt_rb450 >>>                                                            ±[●][RB450Gx4-rebase-sdhci]

Not sure whether this is because of something in the menuconfig file...

PS.
I had to change include/prereq-build.mk for gcc version 10

$(eval $(call SetupHostCommand,gcc, \
        Please install the GNU C Compiler (gcc) 4.8 or later, \
        $(CC) -dumpversion | grep -E '^(4\.[8-9]|[5-9]\.?|10\.?)', \
        gcc -dumpversion | grep -E '^(4\.[8-9]|[5-9]\.?|10\.?)', \
        gcc --version | grep -E 'Apple.(LLVM|clang)' ))

$(eval $(call TestHostCommand,working-gcc, \
        \nPlease reinstall the GNU C Compiler (4.8 or later) - \
        it appears to be broken, \
        echo 'int main(int argc, char **argv) { return 0; }' | \
                gcc -x c -o $(TMP_DIR)/a.out -))

$(eval $(call SetupHostCommand,g++, \
        Please install the GNU C++ Compiler (g++) 4.8 or later, \
        $(CXX) -dumpversion | grep -E '^(4\.[8-9]|[5-9]\.?|10\.?)', \
        g++ -dumpversion | grep -E '^(4\.[8-9]|[5-9]\.?|10\.?)', \
        g++ --version | grep -E 'Apple.(LLVM|clang)' ))

$(eval $(call TestHostCommand,working-g++, \
        \nPlease reinstall the GNU C++ Compiler (4.8 or later) - \
        it appears to be broken, \
        echo 'int main(int argc, char **argv) { return 0; }' | \
                g++ -x c++ -o $(TMP_DIR)/a.out - -lstdc++ && \
                $(TMP_DIR)/a.out))

Do you have any plans for when you will be continue with this router to get it supported?
Thanks

Not really, It depends on when hAP ac2 will get merged so all of the prerequisites are there.

1 Like

Hello. What about DSA driver support for this device? Are there any developments?

@robimarko @bm42 Do You have working image with Winbond NAND?

@robimarko Thanks for everything. Works great with the exception of the latest generation of the RB450Gx4 with RouterBoot 6.45.9 and AMD Flash. The RAM image will still work, but the device will not start after sysupgrading the standard image you provided.

KR

RouterBOOT booter 6.45.9

RB450Gx4

CPU frequency: 716 MHz
  Memory size: 1024 MiB
    NAND size: 512 MiB

Press any key within 2 seconds to enter setup..

loading kernel... OK
setting up elf image... OK
jumping to kernel code

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


Op ret = -97
Auto reboot in 5 sec
[    0.786943] nand: device found, Manufacturer ID: 0x01, Chip ID: 0xdc
[    0.787783] nand: AMD/Spansion S34ML04G2
[    0.794437] nand: 512 MiB, SLC, erase size: 128 KiB, page size: 2048, OOB size: 128

Its because of block and page sizes

Thanks for the quick reply. Would a donated device help fix the problem? If so, then I need a postal address from you.

KR

I have an RB450Gx4 with the older NAND, I know the issue with the never, and it simply requires different block/page sizes.

RB450Gx4 support is on hold until hAP ac2 is merged as it introduces all of the stuff needed for any other Mikrotik board.

Any chance of opening up the device and providing the exact details on the nand chip?

I ran into a similar issue on a rb2011 and had to patch the full chip description in the kernel as described in thread marked below.
It looks like it gets detected, but the it's probably badly detected.

See this thread

Its detected properly, but MikroTik has 2 revisions of the board.
One NAND uses 128k blocks while other one uses 256k blocks.