Any plans for Realtek SOC support?

Hi All!

I would use the original and newer OpenWrt.
If they exist, but not. Nothing.

The Barrier Breaker is more secured like brand routerOS.
I think: All brand (blackbox/closed) routerOS have factory backdoor:)))))

The RTL819x for LEDE from hackpascal compiled already.
I didn' try load mainline kernel wifi modules yet.
The finished "rootfs" is still too big.
I must configure required/needed modules, and packages.
When done, i will try upload to the router, and try load mainline wifi modules.

Best Regards

2 Likes

The Realtek SOC's (rtl8881a, rtl8196e, rtl819xd) DOESN'T CRIPLED MIPS!!!!!!!!!!!

Hi All!

I checked the code of realtek SDK 2.5 and I found something very important.
The forums and openwrt informations contains:
"Realtek inherited a reduced mips ISA via Lexra"
Realtek SOC's have lexra core with reduced (crippled) mips funcionality.
The lexra core doesn't support four unaligned instructions:


" It was founded in 1997 and began developing and licensing semiconductor intellectual property cores that implemented the MIPS I architecture, except for the four unaligned load and store (lwl, lwr, swl, swr) instructions. "

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

                          BUT 

The Realtek SOC's (rtl8881a, rtl8196e, rtl819xd) support these four unaligned load and store opcodes (lwl, lwr, swl, swr) !

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

target/linux/realtek/rtl8881a/config-3.10
ONFIG_CPU_HAS_ULS=y

target/linux/realtek/rtl819xd/config-3.10
CONFIG_CPU_HAS_ULS=y

target/linux/realtek/rtl8196e/config-3.10
CONFIG_CPU_HAS_ULS=y



target/linux/realtek/files/arch/rlx/kernel/unaligned.c
#ifdef CONFIG_CPU_HAS_ULS
#define     LoadW(addr, value, res)   \
                __asm__ __volatile__ (                      \
                        "1:\tlwl\t%0, (%2)\n"               \
                        "2:\tlwr\t%0, 3(%2)\n\t"            \
                        "li\t%1, 0\n"                       \
                        "3:\n\t"                            \
                        ".insn\n\t"                         \
                        ".section\t.fixup,\"ax\"\n\t"       \
                        "4:\tli\t%1, %3\n\t"                \
                        "j\t3b\n\t"                         \
                        ".previous\n\t"                     \
                        ".section\t__ex_table,\"a\"\n\t"    \
                        STR(PTR)"\t1b, 4b\n\t"              \
                        STR(PTR)"\t2b, 4b\n\t"              \
                        ".previous"                         \
                        : "=&r" (value), "=r" (res)         \
                        : "r" (addr), "i" (-EFAULT));
#else
#define     LoadW(addr, value, res)   \
                __asm__ __volatile__ (                      \
                        "1:\tlbu\t%0, 0(%2)\n\t"            \
                        "lbu\t%1, 1(%2)\n\t"                \
                        "sll\t%0, 8\n\t"                    \
                        "or\t%0, %1\n\t"                    \
                        "lbu\t%1, 2(%2)\n\t"                \
                        "sll\t%0, 8\n\t"                    \
                        "or\t%0, %1\n\t"                    \
                        "lbu\t%1, 3(%2)\n\t"                \
                        "sll\t%0, 8\n\t"                    \
                        "or\t%0, %1\n\t"                    \
                        "li\t%1, 0\n"                       \
                        "3:\n\t"                            \
                        ".insn\n\t"                         \
                        ".section\t.fixup,\"ax\"\n\t"       \
                        "4:\tli\t%1, %3\n\t"                \
                        "j\t3b\n\t"                         \
                        ".previous\n\t"                     \
                        ".section\t__ex_table,\"a\"\n\t"    \
                        STR(PTR)"\t1b, 4b\n\t"              \
                        STR(PTR)"\t2b, 4b\n\t"              \
                        ".previous"                         \
                        : "=&r" (value), "=&r" (res)        \
                        : "r" (addr), "i" (-EFAULT));
#endif


target/linux/realtek/files/arch/rlx/lib/csum_partial.S
#ifdef CONFIG_CPU_HAS_ULS
        ulw     t1, (src)
#else
  #ifdef __MIPSEB__
        lbu     t1, 0(src)
        lbu     t5, 1(src)
        sll     t1, 8
        or      t1, t5
        lbu     t5, 2(src)
        sll     t1, 8
        or      t1, t5
        lbu     t5, 3(src)
        sll     t1, 8
        or      t1, t5
  #else /* __MIPSEL__ */
        lbu     t1, 3(src)
        lbu     t5, 2(src)
        sll     t1, 8
        or      t1, t5
        lbu     t5, 1(src)
        sll     t1, 8
        or      t1, t5
        lbu     t5, 0(src)
        sll     t1, 8
        or      t1, t5
  #endif
#endif /* CONFIG_CPU_HAS_ULS */


target/linux/realtek/files/arch/rlx/lib/memset.S
#ifdef CONFIG_CPU_HAS_ULS
  #ifdef __MIPSEB__
        EX(LONG_S_L, a1, (a0), .Lfirst_fixup)   /* make word aligned */
  #endif
  #ifdef __MIPSEL__
        EX(LONG_S_R, a1, (a0), .Lfirst_fixup)   /* make word aligned */
  #endif

        PTR_SUBU        a0, t0                  /* long align ptr */
        PTR_ADDU        a2, t0                  /* correct size */
#else
4:      EX(sb, a1, 0(a0), .Lfirst_fixup)
        PTR_ADDIU       a0, 1
        PTR_SUBU        a2, 1
        andi            t0, a0, LONGMASK
        bnez            t0, 4b
         nop
#endif

Conclusion:
The Realtek SOC's (rtl8881a, rtl8196e, rtl819xd)are full MIPS. The instruction set is the same as the mips r3000 and not the r6000.

The MIPS R6000 doesn't support unaligned instruction opcodes.

Best Regards

1 Like

There is a guy who ported RTL8186 in linux kernel and successfully able to boot it https://github.com/yashac3/linux-rtl8186 . RTL8186 doesn't support unaligned load and store opcodes (lwl, lwr, swl, swr). But RTL8196E does as u say and I have a RTL8196E device. I followed his steps like 1 year ago and try to do a port for my 8196E but it didn't worked, back then I didn't know that 8196E is a full MIPS. Do u want to check his port and continue ?

I have ported the RTL8196E RTL8197D and RTL8197F SoC from Realtek to the last master of Openwrt (as of today).

The port have the necessary code for those SoCs. I used the @hackpascal initial port as a start and have ported RLX4181 and RLX5281 Lexra processors. Those are easier to port, as they have the unaligned instructions. Musl is working in lexra now...
RTL8197F uses a full 24k mips processor, so, no modification is needed in the toolchain...

For the SoCs:
All the SoC drivers are implemented and tested (gpio, pci, irq, timers, etc), for the three SoCs. One can port a router to openwrt just creating a DTS file for it (and changing the Makefiles, as any normal port for openwrt).

The problem is with network and wireless. RTL8196E based routers can use the RTL8192EE open source wifi driver from mac80211 package. Most routers that use RTL8197D SoC also use RTL8192EE for 2.4 and RTL8812 for 5... Both drivers are open source on linux kernel...

TODO:

  • Network and switch driver: hackpascal has started the port for RE865X driver. Need rework for new SoCs....
  • RTL8197F 2.4Ghz wireless driver: This SoC uses an internal wifi, but can be ported to the new RTW88 driver, as they use the same structs (8192EE uses this structs too, but is implemented in the old driver... May a port of 8192EE to the new driver can help too :slight_smile: )
  • Performace: The main focus right now is compatibility... We need to improve for performace....

Use the ramdisk for now... As we dont have the network driver right now, we must use the serial port to bootup... The cvimg boot can be used, but is now of much use right now...

Any help and feedback are welcome :slight_smile:

4 Likes

Forgot the bootlog :slight_smile:
This is a RTL8196E router

[    0.000000] Linux version 4.14.187 (gaspare@gaspare-MacBookAir) (gcc version 8.4.0 (OpenWrt GCC 8.4.0 r14023-1deaf695ec)) #0 T0
[    0.000000] bootconsole [early0] enabled
[    0.000000] CPU0 revision is: 0000cd01 (Lexra LX4380 / RLX4181)
[    0.000000] MIPS: machine is Multilaser RE172 V1
[    0.000000] Determined physical RAM map:
[    0.000000]  memory: 02000000 @ 00000000 (usable)
[    0.000000] Initrd not found or empty - disabling initrd
[    0.000000] BOOTSTRAP = 8196e001 2 100218 b08
[    0.000000] Primary instruction cache 16kB, linesize 16 bytes.
[    0.000000] Primary write-back data cache 8kB, linesize 16 bytes.
[    0.000000] Zone ranges:
[    0.000000]   Normal   [mem 0x0000000000000000-0x0000000001ffffff]
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x0000000000000000-0x0000000001ffffff]
[    0.000000] Initmem setup node 0 [mem 0x0000000000000000-0x0000000001ffffff]
[    0.000000] random: get_random_bytes called from start_kernel+0x9c/0x4e0 with crng_init=0
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 8120
[    0.000000] Kernel command line: console=ttyS0,38400
[    0.000000] PID hash table entries: 128 (order: -3, 512 bytes)
[    0.000000] Dentry cache hash table entries: 4096 (order: 2, 16384 bytes)
[    0.000000] Inode-cache hash table entries: 2048 (order: 1, 8192 bytes)
[    0.000000] Memory: 19248K/32768K available (4442K kernel code, 159K rwdata, 832K rodata, 7488K init, 204K bss, 13520K reserve)
[    0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] NR_IRQS: 128
[    0.000000] clocksource: RTL819X counter: mask: 0xfffffff max_cycles: 0xfffffff, max_idle_ns: 4778151100 ns
[    0.000034] sched_clock: 28 bits at 25MHz, resolution 40ns, wraps every 5368709100ns
[    0.025522] timer-controller: running - mult: 107374182, shift: 32, IRQ: 7, CLK: 25.000MHz
[    0.052958] Calibrating delay loop... 397.82 BogoMIPS (lpj=795648)
[    0.105601] pid_max: default: 32768 minimum: 301
[    0.121964] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.143697] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.184820] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645041785100000 ns
[    0.216906] futex hash table entries: 256 (order: -1, 3072 bytes)
[    0.239084] NET: Registered protocol family 16
[    1.001167] PCI host bridge to bus 0000:00
[    1.014647] pci_bus 0000:00: root bus resource [mem 0x19000000-0x19ffffff]
[    1.037216] pci_bus 0000:00: root bus resource [io  0x18c00000-0x18dfffff]
[    1.059810] pci_bus 0000:00: root bus resource [??? 0x00000000 flags 0x0]
[    1.082111] pci_bus 0000:00: No busn resource found for root bus, will use [bus 00-ff]
[    1.109647] pci 0000:00:00.0: bridge configuration invalid ([bus 00-00]), reconfiguring
[    1.138528] pci 0000:00:00.0: BAR 8: assigned [mem 0x19000000-0x190fffff]
[    1.160894] pci 0000:00:00.0: BAR 7: assigned [io  0x18c00000-0x18c00fff]
[    1.183247] pci 0000:01:00.0: BAR 2: assigned [mem 0x19000000-0x19003fff 64bit]
[    1.207328] pci 0000:01:00.0: BAR 0: assigned [io  0x18c00000-0x18c000ff]
[    1.229645] pci 0000:00:00.0: PCI bridge to [bus 01]
[    1.245948] pci 0000:00:00.0:   bridge window [io  0x18c00000-0x18c00fff]
[    1.268256] pci 0000:00:00.0:   bridge window [mem 0x19000000-0x190fffff]
[    1.293361] clocksource: Switched to clocksource RTL819X counter
[    1.319464] NET: Registered protocol family 2
[    1.336443] TCP established hash table entries: 1024 (order: 0, 4096 bytes)
[    1.359429] TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
[    1.380334] TCP: Hash tables configured (established 1024 bind 1024)
[    1.401946] UDP hash table entries: 256 (order: 0, 4096 bytes)
[    1.421214] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[    1.443012] NET: Registered protocol family 1
[    1.573510] random: fast init done
[    2.296471] Crashlog allocated RAM at address 0x1f00000
[    2.323211] workingset: timestamp_bits=14 max_order=13 bucket_order=0
[    2.381620] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    2.400799] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[    2.568508] io scheduler noop registered
[    2.581500] io scheduler deadline registered (default)
[    2.600128] Serial: 8250/16550 driver, 1 ports, IRQ sharing enabled
[    2.623840] console [ttyS0] disabled
[    2.635794] 18002000.serial: ttyS0 at MMIO 0x18002000 (irq = 28, base_baud = 12500000) is a 16550A
[    2.665498] console [ttyS0] enabled
[    2.665498] console [ttyS0] enabled
[    2.688503] bootconsole [early0] disabled
[    2.688503] bootconsole [early0] disabled
[    2.743549] m25p80 spi0.0: gd25q32 (4096 Kbytes)
[    2.824635] 2 fixed-partitions partitions found on MTD device spi0.0
[    2.845952] Creating 2 MTD partitions on "spi0.0":
[    2.862089] 0x000000000000-0x000000010000 : "boot"
[    2.882633] 0x000000010000-0x000000400000 : "firmware"
[    2.909620] NET: Registered protocol family 10
[    2.947927] Segment Routing with IPv6
[    2.960656] NET: Registered protocol family 17
[    2.975928] 8021q: 802.1Q VLAN Support v1.8
[    3.035923] Freeing unused kernel memory: 7488K
[    3.051177] This architecture does not have kernel memory protection.
[    3.131238] init: Console is alive
[    3.211875] kmodloader: loading kernel modules from /etc/modules-boot.d/*
[    3.246387] kmodloader: done loading kernel modules from /etc/modules-boot.d/*
[    3.282665] init: - preinit -

[    4.734676] random: jshn: uninitialized urandom read (4 bytes read)
[    5.069736] random: jshn: uninitialized urandom read (4 bytes read)
[    5.998420] random: jshn: uninitialized urandom read (4 bytes read)
[    6.217717] random: jshn: uninitialized urandom read (4 bytes read)
[    6.755500] random: jshn: uninitialized urandom read (4 bytes read)
Press the [f] key and hit [enter] to enter failsafe mode
Press the [1], [2], [3] or [4] key and hit [enter] to select the debug level
[   10.816134] procd: - early -
[   11.505577] procd: - ubus -
[   11.542893] random: ubusd: uninitialized urandom read (4 bytes read)
[   11.569277] random: ubusd: uninitialized urandom read (4 bytes read)
[   11.592857] random: ubusd: uninitialized urandom read (4 bytes read)
[   11.623301] procd: - init -
Please press Enter to activate this console.
[   13.865007] kmodloader: loading kernel modules from /etc/modules.d/*
[   13.951095] ip6_tables: (C) 2000-2006 Netfilter Core Team
[   14.056952] Loading modules backported from Linux version v5.8-rc2-0-g48778464bb7d
[   14.082325] Backport generated by backports.git v5.8-rc2-1-0-g7a69429b
[   14.145792] urngd: v1.0.2 started.
[   14.171293] ip_tables: (C) 2000-2006 Netfilter Core Team
[   14.255706] nf_conntrack version 0.5.0 (1024 buckets, 4096 max)
[   14.688222] xt_time: kernel timezone is -0000
[   14.872751] random: crng init done
[   14.884328] random: 2 urandom warning(s) missed due to ratelimiting
[   15.077787] PPP generic driver version 2.4.2
[   15.128741] NET: Registered protocol family 24
[   15.308137] PCI: Enabling device 0000:00:00.0 (0000 -> 0003)
[   15.361707] rtl8192ee: Using firmware rtlwifi/rtl8192eefw.bin
[   15.396009] rtlwifi: rtlwifi: wireless switch is on
[   15.542723] kmodloader: done loading kernel modules from /etc/modules.d/*



BusyBox v1.31.1 () built-in shell (ash)

  _______                     ________        __
 |       |.-----.-----.-----.|  |  |  |.----.|  |_
 |   -   ||  _  |  -__|     ||  |  |  ||   _||   _|
 |_______||   __|_____|__|__||________||__|  |____|
          |__| W I R E L E S S   F R E E D O M
 -----------------------------------------------------
 OpenWrt SNAPSHOT, r14023+1-1deaf695ec
 -----------------------------------------------------
=== WARNING! =====================================
There is no root password defined on this device!
Use the "passwd" command to set up a new password
in order to prevent unauthorized SSH logins.
--------------------------------------------------
root@(none):/# 

2 Likes

Devices are only merged through the master branch, for that kernel 5.4 support would be a hard requirement.

Realtek SOCs haven't seen a lot of love so far, because of the lexra issue (in all but the latest SOCs) and because they're usually very low-spec and with a "challenging" wireless support state. If those issues can be solved (musl support can also be considered a hard requirement), there wouldn't be much of a reason not to merge support for these devices (obviously there needs to be sufficient development manpower behind it, to suggest longer term attention).

1 Like

I'm working on porting to kernel 5.4 ... Actually, its better than the 4.14 :slight_smile:
I use a DLink Dir 815 board to test the RTL8197D (RLX 5281 SoC)... This board is 8/64 .. But the best realtek routers are based on the RTL8197F... I have one that has 128M ram....
The major problem is an open ethernet/switch driver... @hackpascal had a good start on RE865X... And the wireless driver for RTL8197F in 2.4Ghz ... Those can take some time ....

2 Likes

I am very interested in this project and wanted to ask how the current situation is. Have you already had further success or are there major difficulties. I am using the 8devices Komikan module based on a RTL8197FS. but it stucks on kernel version 3.18.

8devices Github

You can use the wifi driver (rtl8192cd) and network driver (rtl819x) from the 8device in the new kernel. Just need a few modifications...
I'm currently working on the network driver for a DSA version...
The rtw88 from openwrt already have the 8822B 5GHz driver that can work with this project...

Thank you for this appraisal.

This is very interesting. I wish you great success

Sorry for having to ask that, but i'm not very deep into such hardware-related things.

Would it be possible to add the 8devices Komikan to these sources as Dimazhan did for the TOTOLINK A3002RU v1.

It would be a great help to hear the opinion on it

Yes... Its a 97f full mips... The 5Ghz 8822B from the Komikan already have an open driver...
I dont have a board to test, but I can add the config and someone with the board can follow...

I would appreciate that very much. I could provide any informations needed. I think it is also a good chance for me to learn :slightly_smiling_face: Building and testing an image should not be the problem.

awk 'BEGIN{FS="[ \t]+:[ \t]"} /machine/ {print $2}' /proc/cpuinfo
Output:
8devices Komikan devboard

Partitions:

MTD

0x000000000000 - 0x000000020000 : "boot"
0x000000020000 - 0x000000040000 : "hwpart"
0x000000040000 - 0x000000080000 : "config"
0x000000080000 - 0x000002000000 : "firmware"

cvimc-fw

0x000000080000 - 0x000000280000 : "kernel"
0x000000280000 - 0x000002000000 : "rootfs"

squashfs-split
0x000000080000 - 0x000002000000 : "roofs_data"

Great... 8devices are openwrt already... their github is in 18.06.

Hello all,

I am new to openwrt and the 819x family.
I have a board based on the 8197FS. The SDK from Realtek is terrible and I'd be happy to switch to a much cleaner base. I'm very happy to find that you worked on this.

Any tip on how to start ? I'm having trouble compiling the ggbruno/master (probably a newbie's mistake somewhere)

Hello gaspare,

FYI I had trouble building from your repository because cvimg was not present. This has been fixed in the repo of dimazhan:

commit 3673300937a729242e0c6775d9022e34410f4e19
Author: Dimazhan <dimazhan@list.ru>
Date:   Thu Nov 26 01:11:12 2020 +0700

    Added missing cvimg tool
2 Likes

Hi,

One question how to make this new image with the kernel vesion 4.14 to run on komikan board

thank you.

Regards

I don't have this board. I upload the image using tftp from boot loader, but the board must have support for tftp (cvimg header)... The image must be adapted in the dts for the board too...

Thanks for your reply, I am now able to use your image, in the komikan board.

I just modified the device tree like this.
&spi0 {
status = "okay";

m25p80@0 {
	#address-cells = <1>;
	#size-cells = <1>;
	#compatible = "jedec,spi-nor";
	compatible = "spansion,m25p80", "jedec,spi-nor";
	reg = <0>;
	spi-max-frequency = <40000000>;

	all@0 {
		label = "ALL";
		reg = <0x0 0x2000000>;
	};
	
	partition@0 {
		label = "boot";
		reg = <0x0 0x20000>;
		read-only;
	};
	
	partition@20000 {
		label = "hwpart";
		reg = <0x20000 0x20000>;
	};
	
	partition@40000 {
		label = "config";
		reg = <0x40000 0x40000>;
	};

	firmware@80000 {
		label = "kernel";
		reg = <0x80000 0x240000>;
	};

	partition@240000 {
		label = "rootfs";
		reg = <0x240000 0x2000000>;
	};
};

};

still my kernel is crashing.

 0.000000] Linux version 4.14.187 (user@ubuntu) (gcc version 8.4.0 (OpenWrt GCC 8.4.0 r14026-8a0ccb93f3)) #0 Tue Aug 4 17:42:33 2020
[    0.000000] bootconsole [early0] enabled
[    0.000000] CPU0 revision is: 00019385 (MIPS 24Kc)
[    0.000000] MIPS: machine is Multilaser RE708 V1
[    0.000000] Determined physical RAM map:
[    0.000000]  memory: 04000000 @ 00000000 (usable)
[    0.000000] Initrd not found or empty - disabling initrd
[    0.000000] BOOTSTRAP = 8197f001 0 412582e0 80000000
[    0.000000] Primary instruction cache 64kB, VIPT, 4-way, linesize 32 bytes.
[    0.000000] Primary data cache 32kB, 4-way, PIPT, no aliases, linesize 32 bytes
[    0.000000] Zone ranges:
[    0.000000]   Normal   [mem 0x0000000000000000-0x0000000003ffffff]
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x0000000000000000-0x0000000003ffffff]
[    0.000000] Initmem setup node 0 [mem 0x0000000000000000-0x0000000003ffffff]
[    0.000000] random: get_random_bytes called from start_kernel+0x98/0x4a4 with crng_init=0
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 16240
[    0.000000] Kernel command line: console=ttyS0,38400
[    0.000000] PID hash table entries: 256 (order: -2, 1024 bytes)
[    0.000000] Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
[    0.000000] Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
[    0.000000] Writing ErrCtl register=0000e0a0
[    0.000000] Readback ErrCtl register=0000e0a0
[    0.000000] Memory: 58492K/65536K available (3952K kernel code, 159K rwdata, 816K rodata, 1208K init, 200K bss, 7044K reserved, 0K cma-reserved)
[    0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] NR_IRQS: 128
[    0.000000] timer_probe: no matching timers found
[    0.000000] clocksource: MIPS: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 3822520893 ns
[    0.000008] sched_clock: 32 bits at 500MHz, resolution 2ns, wraps every 4294967295ns
[    0.008539] Calibrating delay loop... 663.55 BogoMIPS (lpj=1327104)
[    0.047280] pid_max: default: 32768 minimum: 301
[    0.052508] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.059666] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.070307] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645041785100000 ns
[    0.080959] futex hash table entries: 256 (order: -1, 3072 bytes)
[    0.088059] NET: Registered protocol family 16
[    0.109642] INFO: sheipa spi driver register
[    0.115127] clocksource: Switched to clocksource MIPS
[    0.121584] NET: Registered protocol family 2
[    0.126966] TCP established hash table entries: 1024 (order: 0, 4096 bytes)
[    0.134578] TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
[    0.141458] TCP: Hash tables configured (established 1024 bind 1024)
[    0.148551] UDP hash table entries: 256 (order: 0, 4096 bytes)
[    0.154912] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[    0.162002] NET: Registered protocol family 1
[    0.171044] 1800351c.gpio-controller: Realtek GPIO controller driver
[    0.178637] Crashlog allocated RAM at address 0x3f00000
[    0.186409] workingset: timestamp_bits=14 max_order=14 bucket_order=0
[    0.197824] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    0.204180] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[    0.226297] io scheduler noop registered
[    0.230575] io scheduler deadline registered (default)
[    0.236466] Serial: 8250/16550 driver, 1 ports, IRQ sharing enabled
[    0.243822] console [ttyS0] disabled
[    0.247765] 18147000.serial: ttyS0 at MMIO 0x18147000 (irq = 17, base_baud = 6250000) is a 16550A
£[    0.257438] console [ttyS0] enabled
[    0.257438] console [ttyS0] enabled
[    0.264395] bootconsole [early0] disabled
[    0.264395] bootconsole [early0] disabled
[    0.273329] libphy: Fixed MDIO Bus: probed
[    0.278362] NET: Registered protocol family 10
[    0.288509] Segment Routing with IPv6
[    0.292321] NET: Registered protocol family 17
[    0.296835] 8021q: 802.1Q VLAN Support v1.8
£[    0.304542] VFS: Cannot open root device "(null)" or unknown-block(0,0): error -6
[    0.312072] Please append a correct "root=" boot option; here are the available partitions:
[    0.320400] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
[    0.328992] Rebooting in 1 seconds..

Please suggest what I am doing wrong

Thank you

I don't see spi-controller driver message in your logs. Did you configure spi driver?