Any plans for Realtek SOC support?

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:

5 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?

Thanks a lot for your message, by mistake I think I uchecked that, Now I enabled the same, Now I am getting the following message,

OpenWrt kernel loader for Realtek RTL819X
Copyright (C) 2011 Gabor Juhos juhosg@openwrt.org
Copyright (C) 2017 Weijie Gao hackpascal@gmail.com
Copyright (C) 2019 Gaspare Bruno gaspare@anlix.io
Decompressing kernel... done!
Starting kernel at 80000000...

[ 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/0x4ac 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=0000eab6
[ 0.000000] Readback ErrCtl register=0000eab6
[ 0.000000] Memory: 58232K/65536K available (4172K kernel code, 159K rwdata, 888K rodata, 1172K init, 205K bss, 7304K 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... 666.41 BogoMIPS (lpj=3332096)
[ 0.075259] pid_max: default: 32768 minimum: 301
[ 0.080498] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.087637] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.098338] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[ 0.109083] futex hash table entries: 256 (order: -1, 3072 bytes)
[ 0.116173] NET: Registered protocol family 16
[ 0.141182] clocksource: Switched to clocksource MIPS
[ 0.147593] NET: Registered protocol family 2
[ 0.152994] TCP established hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.160535] TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.167535] TCP: Hash tables configured (established 1024 bind 1024)
[ 0.174580] UDP hash table entries: 256 (order: 0, 4096 bytes)
[ 0.180882] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[ 0.188051] NET: Registered protocol family 1
[ 0.197364] 1800351c.gpio-controller: Realtek GPIO controller driver
[ 0.204942] Crashlog allocated RAM at address 0x3f00000
[ 0.212773] workingset: timestamp_bits=14 max_order=14 bucket_order=0
[ 0.224175] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[ 0.230462] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[ 0.253039] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 253)
[ 0.261040] io scheduler noop registered
[ 0.265386] io scheduler deadline registered (default)
[ 0.271465] Serial: 8250/16550 driver, 1 ports, IRQ sharing enabled
[ 0.278745] console [ttyS0] disabled
£[ 0.292332] console [ttyS0] enabledt MMIO 0x18147000 (irq = 17, base_baud = 6250000) is a 16550A
[ 0.292332] console [ttyS0] enabled
[ 0.299290] bootconsole [early0] disabled
[ 0.299290] bootconsole [early0] disabled
[ 0.308081] m25p80 spi0.0: change speed to 40000000Hz, div 3
[ 0.317606] m25p80 spi0.0: found w25q256, expected m25p80
[ 0.323070] INFO: flash mode error, cmd 0x5A, flash_mode 0
[ 0.337372] m25p80 spi0.0: w25q256 (32768 Kbytes)
[ 0.342493] 6 fixed-partitions partitions found on MTD device spi0.0
[ 0.348829] Creating 6 MTD partitions on "spi0.0":
[ 0.353658] 0x000000000000-0x000002000000 : "ALL"
[ 0.359114] 0x000000000000-0x000000020000 : "boot"
[ 0.364667] 0x000000020000-0x000000040000 : "hwpart"
[ 0.370264] 0x000000040000-0x000000080000 : "config"
[ 0.375940] 0x000000080000-0x0000002c0000 : "kernel"
[ 0.381603] 0x000000240000-0x000002240000 : "rootfs"
[ 0.386551] mtd: partition "rootfs" extends beyond the end of device "spi0.0" -- size truncated to 0x1dc0000
[ 0.397012] mtd: device 5 (rootfs) set to be root filesystem
[ 0.406797] mtdsplit: no squashfs found in "rootfs"
[ 0.412320] libphy: Fixed MDIO Bus: probed
[ 0.417179] NET: Registered protocol family 10
[ 0.425122] Segment Routing with IPv6
[ 0.428849] NET: Registered protocol family 17
[ 0.433431] 8021q: 802.1Q VLAN Support v1.8
£[ 0.442018] List of all partitions:
[ 0.445518] 1f00 32768 mtdblock0
[ 0.445522] (driver?)
[ 0.452077] 1f01 128 mtdblock1
[ 0.452081] (driver?)
[ 0.458566] 1f02 128 mtdblock2
[ 0.458568] (driver?)
[ 0.465065] 1f03 256 mtdblock3
[ 0.465068] (driver?)
[ 0.471559] 1f04 2304 mtdblock4
[ 0.471562] (driver?)
[ 0.478050] 1f05 30464 mtdblock5
[ 0.478052] (driver?)
[ 0.484544] No filesystem could mount root, tried:
[ 0.484547] squashfs
[ 0.489390]
[ 0.493120] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(31,5)
[ 0.501928] Rebooting in 1 seconds..

Please suggest what I am missign here.

You are tftp-booting an initramfs, isn't it? Question is whether or not your kernel has the relevant configuration for that and whether or not the image is built as such.

Hello. Can someone explain me, how to compile from source? I have a Rtl8197FN and in the menuconfig I can select "Realtek MIPS" but not the specific SoC.

Flash layout in kernel (dts-file) don't correspond to flash layout in firmware image file.