Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revisionBoth sides next revision
toh:f-secure:sense [2022/10/24 10:50] – [Building] plappermaultoh:f-secure:sense [2022/11/01 20:48] – [PCIe infos] plappermaul
Line 6: Line 6:
   * [[https://github.com/plappermaul/rtl8198c-loader| Bootlader for RTL8198C devices]]   * [[https://github.com/plappermaul/rtl8198c-loader| Bootlader for RTL8198C devices]]
   * [[https://github.com/plappermaul/rtl8198c-rtk|RTK for RTL8198C devices]]   * [[https://github.com/plappermaul/rtl8198c-rtk|RTK for RTL8198C devices]]
 +  * Initial PR https://github.com/openwrt/openwrt/pull/11094 
  
 +===== Current state =====
 +
 +  * add initial build option in realtek tree: done
 +  * GIC enabling: done
 +  * Serial console access: done
 +  * 2 Core SMP: done
 +  * USB support: done (new xHCI driver)
 +  * PCIE support: TODO
 +  * chip network driver: TODO
 +  * switch driver: TODO
 +  * SPI driver: TODO
 +  * MTD NAND driver: TODO
 +  * I2C driver [[https://github.com/iptime-gpl/userapps_extg/blob/587f2e4ce2289e10f3946f034d0ed42b83b3b22a/linux/linux-3.10/drivers/i2c/busses/i2c-rtl8198c.c|TODO]]
 ===== Hardware ===== ===== Hardware =====
  
Line 12: Line 26:
  
 Realtek RTL8198C dual core SoC with 512 MB RAM and 1024 MB Flash. Realtek RTL8198C dual core SoC with 512 MB RAM and 1024 MB Flash.
 +
 +==== USB infos ====
 +
 +<code>
 +root@OpenWrt:/# lsusb
 +Bus 001 Device 001: ID 1d6b:0002 - Linux Foundation 2.0 root hub
 +Bus 002 Device 001: ID 1d6b:0003 - Linux Foundation 3.0 root hub
 +</code>
 +
 +==== PCIe infos ====
 +
 +<code>
 +root@OpenWrt:/# lspci
 +00:00.0 Class 0604: 10ec:8198
 +03:00.0 Class 0280: 10ec:8813 - RTL8813AE 802.11ac PCIe Wireless Network Adapter
 +02:00.0 Class 0604: 10ec:8198
 +01:00.0 Class 0280: 10ec:8813 - RTL8813AE 802.11ac PCIe Wireless Network Adapter
 +</code>
 ==== Photos ==== ==== Photos ====
  
Line 28: Line 60:
 ==== Building ==== ==== Building ====
  
-Currently only compiling from above old repository is possibleBest way is to install an old Fedora 21 VMClone the repo and build OpenWrtAfterwards rename the LZMA Loader + Linux Image so that the bootlader can work with it.+Ensure that you use patches from https://github.com/openwrt/openwrt/pull/11094. Uncomment TARGET_DEVICES line from target/linux/realtek/image/rtl8198c.mk. Run make menuconfig and select target realtek plus subtarget rtl8198c with device F-Secure Sense. Afterwards run make to build the initramfs image. 
 + 
 +<code> 
 +[plappermaul@fedora rtl8198c]$ ls -al bin/targets/realtek/rtl8198c 
 +total 19752 
 +drwxr-xr-x. 3 plappermaul plappermaul     4096 21. Okt 13:07 . 
 +drwxr-xr-x. 5 plappermaul plappermaul     4096 21. Okt 11:14 .. 
 +-rw-r--r--. 1 plappermaul plappermaul     1311 27. Okt 08:59 config.buildinfo 
 +-rw-r--r--. 1 plappermaul plappermaul      288 27. Okt 08:59 feeds.buildinfo 
 +-rw-r--r--. 1 plappermaul plappermaul  9174526 27. Okt 09:00 openwrt-realtek-rtl8198c-f-secure_sense-initramfs-kernel.bin 
 +-rw-r--r--. 1 plappermaul plappermaul     2868 27. Okt 09:00 openwrt-realtek-rtl8198c-f-secure_sense.manifest 
 +-rw-r--r--. 1 plappermaul plappermaul 11010853 27. Okt 09:00 openwrt-realtek-rtl8198c-f-secure_sense-squashfs-sysupgrade.bin 
 +drwxr-xr-x. 2 plappermaul plappermaul     4096 27. Okt 08:43 packages 
 +-rw-r--r--. 1 plappermaul plappermaul     1298 27. Okt 09:01 profiles.json 
 +-rw-r--r--. 1 plappermaul plappermaul      701 27. Okt 09:01 sha256sums 
 +-rw-r--r--. 1 plappermaul plappermaul       18 27. Okt 08:59 version.buildinfo 
 +</code> 
 +==== Initramfs boot using serial console and TFTP ==== 
 + 
 +Rename initramfs image to nfjromThis is essential because the filename triggers the kernel jump/initialization sequence
  
 <code> <code>
 cp build_dir/target_mips_24kec_uClibc-0.9.33.2/linux-rtkmips_rtl8198c/loader-rtl8198c-AP-initramfs.bin nfjrom cp build_dir/target_mips_24kec_uClibc-0.9.33.2/linux-rtkmips_rtl8198c/loader-rtl8198c-AP-initramfs.bin nfjrom
 </code> </code>
-==== Installation using serial console and TFTP ==== 
  
 In Sense bootloader enable TFTP and disable auto flashing In Sense bootloader enable TFTP and disable auto flashing
Line 43: Line 93:
 <RealTek>enable_tftp 1 <RealTek>enable_tftp 1
 Changing status of the tftpd to 1 Changing status of the tftpd to 1
 +<RealTek>loadaddr 84000000
 +Set TFTP Load Addr 0x84000000
 </code> </code>
  
Line 51: Line 103:
 </code> </code>
  
-After upload system will automatically jump to start address of image+After upload finishes system will automatically jump to the start address of the image, execute the lzma loader and fire up the kernel.
  
 <code> <code>
 <RealTek> <RealTek>
-**TFTP Client Upload, File Name: nfjrom +TFTP Client Upload, File Name: nfjrom 
-....... +- 
-**TFTP Client Upload File Size = 007F1D8C Bytes at A0500000+TFTP Client Upload File Size = 002EF850 Bytes at 84000000
  
 Success! Success!
-<RealTek>Jump to 0x80500000+<RealTek>Jump to 0x84000000
 </code> </code>
  
Line 510: Line 562:
  
 ==== OpenWrt bootlog ==== ==== OpenWrt bootlog ====
 +
 +Current master build with https://github.com/openwrt/openwrt/pull/11094 
  
 <WRAP bootlog> <WRAP bootlog>
-<RealTek> +<nowiki
-TFTP Client Upload, File Name: nfjrom +<RealTek>Jump to 0x84000000
-+
-TFTP Client Upload File Size = 001CFA30 Bytes at A0500000 +
- +
-Success! +
-<RealTek>Jump to 0x80500000+
  
  
-OpenWrt kernel loader for Mips board+OpenWrt kernel loader for MIPS based SoC
 Copyright (C) 2011 Gabor Juhos Copyright (C) 2011 Gabor Juhos
 Decompressing kernel... done! Decompressing kernel... done!
 Starting kernel at 80000000... Starting kernel at 80000000...
  
-[    0.000000] Linux version 3.10.49 (plappermaul@localhost.localdomain) (gcc version 4.8.3 (OpenWrt/Linaro GCC 4.8-2014.04 unknown) ) #SMP Mon Oct 24 02:08:30 CEST 2022 +[    0.000000] Linux version 5.10.146 (plappermaul@fedora) (mips-openwrt-linux-musl-gcc (OpenWrt GCC 11.3.0 r20179+24-57cad53f4e) 11.3.0, GNU ld (GNU Binutils2.37) #SMP Mon Oct 3 11:23:41 2022 
-[    0.000000] CPU revision is: 00019a24 (MIPS 1074Kc) +[    0.000000] RTL838X model is 
-[    0.000000] Determined physical RAM map+[    0.000000] RTL839X model is 0 
-[    0.000000]  memory14000000 @ 00000000 (usable)+[    0.000000] RTL93XX model is 0 
 +[    0.000000] RTL819X model is 8198c001 
 +[    0.000000] SoC TypeRTL8198C 
 +[    0.000000] default cpc 1bde0001 
 +[    0.000000] Kernel command line
 +[    0.000000] CPU0 revision is00019a24 (MIPS 1074Kc) 
 +[    0.000000] MIPS: machine is F-Secure Sense
 [    0.000000] Initrd not found or empty - disabling initrd [    0.000000] Initrd not found or empty - disabling initrd
 +[    0.000000] Using appended Device Tree.
 +[    0.000000] VPE topology {1,1} total 2
 +[    0.000000] Primary instruction cache 64kB, VIPT, 4-way, linesize 32 bytes.
 +[    0.000000] Primary data cache 32kB, 4-way, VIPT, cache aliases, linesize 32 bytes
 +[    0.000000] MIPS secondary cache 512kB, 8-way, linesize 32 bytes.
 [    0.000000] Zone ranges: [    0.000000] Zone ranges:
-[    0.000000]   Normal   [mem 0x00000000-0x13ffffff]+[    0.000000]   Normal   [mem 0x0000000000000000-0x0000000007ffffff]
 [    0.000000] Movable zone start for each node [    0.000000] Movable zone start for each node
 [    0.000000] Early memory node ranges [    0.000000] Early memory node ranges
-[    0.000000]   node   0: [mem 0x00000000-0x13ffffff+[    0.000000]   node   0: [mem 0x0000000000000000-0x0000000007ffffff
-[    0.000000] Detected available secondary CPU(s) +[    0.000000] Initmem setup node 0 [mem 0x0000000000000000-0x0000000007ffffff
-   0.000000] Primary instruction cache 64kB, VIPT, 4-way, linesize 32 bytes. +[    0.000000] percpu: Embedded 14 pages/cpu s27792 r8192 d21360 u57344 
-[    0.000000Primary data cache 32kB, 4-way, PIPT, no aliases, linesize 32 bytes +[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 32480 
-[    0.000000] MIPS secondary cache 512kB, 8-way, linesize 32 bytes. +[    0.000000] Kernel command line: console=ttyS0,38400 
-[    0.000000] PERCPU: Embedded pages/cpu @81284000 s6656 r8192 d13824 u32768 +[    0.000000] Dentry cache hash table entries: 16384 (order: 465536 bytes, linear
-[    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 81280 +[    0.000000] Inode-cache hash table entries: 8192 (order: 332768 bytes, linear)
-[    0.000000] Kernel command line:  board=AP console=ttyS0,38400 linuxpart=0x60000 hwpart=0x20000 +
-[    0.000000] PID hash table entries: 2048 (order: 1, 8192 bytes) +
-[    0.000000] Dentry cache hash table entries: 65536 (order: 6262144 bytes) +
-[    0.000000] Inode-cache hash table entries: 32768 (order: 5131072 bytes)+
 [    0.000000] Writing ErrCtl register=00000000 [    0.000000] Writing ErrCtl register=00000000
 [    0.000000] Readback ErrCtl register=00000000 [    0.000000] Readback ErrCtl register=00000000
-[    0.000000] Memory: 320652k/327680k available (2996k kernel code, 7028k reserved706k data200k init, 0k highmem+[    0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off 
-[    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=1, Nodes=1 +[    0.000000] Memory: 100224K/131072K available (6043K kernel code, 249K rwdata1220K rodata21856K init, 94K bss, 30848K reserved, 0K cma-reserved
-[    0.000000] Hierarchical RCU implementation. +[    0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=2, Nodes=1 
-[    0.000000]  RCU restricting CPUs from NR_CPUS=2 to nr_cpu_ids=1+[    0.000000] rcu: Hierarchical RCU implementation. 
-[    0.000000] NR_IRQS:128 +[    0.000000]  Tracing variant of Tasks RCU enabled. 
-[    0.000000] CPU0status register was 10000400 +[    0.000000] rcu: RCU calculated value of scheduler-enlistment delay is 10 jiffies
-[    0.000000] CPU0status register now 10000400 +[    0.000000] NR_IRQS: 256 
-[    0.000000] console [ttyS0enabled +[    0.000000] Failed to get CPU clock-2 
-[    0.280000] Calibrating delay loop... 498.89 BogoMIPS (lpj=2494464) +[    0.000000] CPU frequency from device tree1000MHz 
-[    0.350000] pid_max: default: 32768 minimum: 301 +[    0.000000] clocksource: GIC: mask: 0xffffffffffffffff max_cycles: 0x1cd42e4dffb, max_idle_ns: 881590591483 ns 
-[    0.360000] Mount-cache hash table entries: 512 +   0.000010sched_clock: 64 bits at 1000MHz, resolution 1ns, wraps every 4398046511103ns 
-[    0.370000Brought up CPUs +[    0.000041] clocksource: MIPS: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 3822520893 ns 
-[    0.380000NETRegistered protocol family 16 +[    0.000184] Calibrating delay loop... 498.89 BogoMIPS (lpj=2494464) 
-[    0.390000INFOinitializing USB devices ... +[    0.060029] pid_max: default: 32768 minimum: 301 
-[    0.590000UPHY8198c ASIC u3 of u3 25M phy patch +[    0.060160] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes, linear) 
-[    4.960000biocreate slab <bio-0> at +[    0.060174Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes, linear) 
-[    4.970000] SCSI subsystem initialized +[    0.061454] Using only one core due to dcache aliasing 
-[    4.980000] usbcore: registered new interface driver usbfs +[    0.062220] Performance counters: mips/1074K PMU enabled, 4 32-bit counters available to each CPU, irq 7 
-[    4.990000] usbcore: registered new interface driver hub +[    0.062373] rcu: Hierarchical SRCU implementation. 
-[    5.000000] usbcore: registered new device driver usb +[    0.062580] dyndbg: Ignore empty _ddebug table in a CONFIG_DYNAMIC_DEBUG_CORE build 
-[    5.010000Switching to clocksource MIPS +[    0.062764] smp: Bringing up secondary CPUs ... 
-[    5.020000] NET: Registered protocol family 2 +[    0.064132Primary instruction cache 64kB, VIPT, 4-way, linesize 32 bytes. 
-[    5.030000] TCP established hash table entries: 4096 (order: 332768 bytes) +[    0.064139] Primary data cache 32kB, 4-way, VIPT, cache aliases, linesize 32 bytes 
-[    5.050000] TCP bind hash table entries: 4096 (order: 332768 bytes) +[    0.064147] MIPS secondary cache 512kB, 8-way, linesize 32 bytes. 
-[    5.080000] TCP: Hash tables configured (established 4096 bind 4096+[    0.064216] CPU1 revision is00019a24 (MIPS 1074Kc) 
-[    5.100000] TCP: reno registered +[    0.123414Synchronize counters for CPU 1done. 
-[    5.110000] UDP hash table entries: 256 (order: 1, 8192 bytes) +[    0.123545] smp: Brought up 1 node, 2 CPUs 
-[    5.130000] UDP-Lite hash table entries: 256 (order: 1, 8192 bytes) +[    0.124666] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns 
-[    5.150000] NET: Registered protocol family 1 +[    0.124691futex hash table entries512 (order: 2, 16384 bytes, linear) 
-[    5.170000] squashfs: version 4.0 (2009/01/31) Phillip Lougher +[    0.124829pinctrl coreinitialized pinctrl subsystem 
-[    5.190000] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc. +[    0.125511] NET: Registered protocol family 16 
-[    5.220000] msgmni has been set to 626 +[    0.150175] SCSI subsystem initialized 
-[    5.230000] io scheduler noop registered +[    0.150418] usbcore: registered new interface driver usbfs 
-[    5.250000] io scheduler deadline registered (default) +[    0.150472] usbcore: registered new interface driver hub 
-[    5.260000] Serial: 8250/16550 driver, ports, IRQ sharing disabled +[    0.150517] usbcore: registered new device driver usb 
-[    5.280000serial8250: ttyS0 at MMIO 0x18002000 (irq = 26) is a 16550A +[    0.152860clocksource: Switched to clocksource GIC 
-[    5.310000SPI INIT +[    0.153959] NET: Registered protocol family 2 
-[    5.310000 ------------------------- Force into Single IO Mode -----------------------+[    0.154182] IP idents hash table entries: 2048 (order: 2, 16384 bytes, linear) 
-[    5.340000|No chipID  Sft chipSize blkSize secSize pageSize sdCk opCk      chipName    | +[    0.154821] tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 6144 bytes, linear) 
-[    5.370000| 0      0h 16h 1000000h  10000h   1000h     100h   40    0           UNKNOWN| +[    0.154889] TCP established hash table entries: 1024 (order: 04096 bytes, linear
-[    5.400000 ---------------------------------------------------------------------------- +[    0.154921] TCP bind hash table entries: 1024 (order: 18192 bytes, linear
-[    5.420000SPI flash(UNKNOWN) was found at CS0, size 0x1000000 +[    0.154962] TCP: Hash tables configured (established 1024 bind 1024
-[    5.710000Creating 3 MTD partitions on "flash_bank_1"+[    0.155074] UDP hash table entries: 256 (order: 1, 8192 bytes, linear
-[    5.7300000x000000000000-0x000000060000 : "boot" +[    0.155134] UDP-Lite hash table entries: 256 (order: 1, 8192 bytes, linear
-[    5.7500000x000000030000-0x000000160000 : "linux" +[    0.155355] NET: Registered protocol family 1 
-[    5.7600000x000000130000-0x000000400000 "rootfs" +[    0.364219] workingset: timestamp_bits=14 max_order=15 bucket_order=1 
-[    5.780000mtddevice 2 (rootfs) set to be root filesystem +[    0.367170] squashfs: version 4.0 (2009/01/31) Phillip Lougher 
-[    5.800000mtdsplitno squashfs found in "flash_bank_1" +[    0.367270] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc. 
-[    5.820000+[    0.368782] Serial: 8250/16550 driver, ports, IRQ sharing disabled 
-[    5.820000Probing RTL819X NIC-kenel stack size order[1]... +[    0.369545printk: console [ttyS0] disabled 
-[    6.560000eth0 added. vid=9 Member port 0x10f... +[    0.369639] 18002000.uart: ttyS0 at MMIO 0x18002000 (irq = 13, base_baud = 12500000) is a 16550A 
-   6.570000eth1 added. vid=8 Member port 0x10... +[    1.952015printk: console [ttyS0] enabled 
-   6.590000] [peth0addedmapping to [eth1]... +[    1.967468usbcore: registered new interface driver usb-storage 
-   6.610000xhci-hcd xhci-hcd: xHCI Host Controller +[    1.988125NET: Registered protocol family 10 
-[    6.620000xhci-hcd xhci-hcd: new USB bus registered, assigned bus number 1 +[    2.003933Segment Routing with IPv6 
-[    6.650000xhci-hcd xhci-hcd: irq 42, io mem 0x18040000 +[    2.016142NET: Registered protocol family 17 
-[    6.660000hub 1-0:1.0USB hub found +[    2.0308698021q: 802.1Q VLAN Support v1.8 
-[    6.680000hub 1-0:1.01 port detected +[    2.144174Freeing unused kernel memory21856K 
-[    6.690000xhci-hcd xhci-hcdxHCI Host Controller +[    2.159503This architecture does not have kernel memory protection. 
-[    6.700000xhci-hcd xhci-hcd: new USB bus registered, assigned bus number 2 +[    2.180855Run /init as init process 
-[    6.730000] hub 2-0:1.0: USB hub found +[    2.570058initConsole is alive 
-[    6.740000hub 2-0:1.0: 1 port detected +[    2.592950kmodloaderloading kernel modules from /etc/modules-boot.d/* 
-[    6.750000usbcoreregistered new interface driver usb-storage +[    2.618692kmodloaderdone loading kernel modules from /etc/modules-boot.d/* 
-[    6.770000-------8196D OTG init +[    2.652938init: - preinit - 
-[    6.980000dwc_otgversion 2.60a 22-NOV-2006 +[    2.814185random: jshn: uninitialized urandom read (4 bytes read) 
-[    7.000000]  [S0] lmdev=93908b00 +[    2.901180random: jshn: uninitialized urandom read (4 bytes read) 
-[    7.010000device_register :register pass +Press the [fkey and hit [enter] to enter failsafe mode 
-[    7.020000  [S2]  otg_dev=93884400 +Press the [1][2], [3or [4key and hit [enter] to select the debug level 
-[    7.240000  [S3] hcd==93917200 +[    5.143909procd: early 
-[    7.250000DWC_otg: Using DMA mode +[    5.665332procd: ubus 
-[    7.260000dwc_otg logicmodule: DWC OTG Controller +[    5.679638randomubusduninitialized urandom read (4 bytes read) 
-[    7.270000dwc_otg logicmodulenew USB bus registered, assigned bus number 3 +[    5.725020randomubusduninitialized urandom read (4 bytes read) 
-[    7.300000] dwc_otg logicmodule: irq 41, io mem 0xb8030000 +[    5.746277randomubusd: uninitialized urandom read (4 bytes read) 
-[    7.320000set OTG host to high speed ! +[    5.768441procd: init 
-[    7.320000] DWC_otgInit: Port Power? op_state=1 +Please press Enter to activate this console
-[    7.320000DWC_otgInit: Power Port (0+[    6.093303kmodloaderloading kernel modules from /etc/modules.d/* 
-[    7.360000] hub 3-0:1.0: USB hub found +[    6.119854NETRegistered protocol family 38 
-[    7.370000] hub 3-0:1.01 port detected +[    6.139330urngd: v1.0.2 started. 
-[    7.380000]   [S1] dwc_otg_driver, lmdriver=8038d654 +[    6.154609cryptodevdriver 1.12 loaded
-[    7.400000] rtl819x-wdt rtl819x-wdt: Initialized +[    6.170604GACT probability on 
-[    7.420000] TCP: westwood registered +[    6.182269Mirror/redirect action on 
-[    7.430000] NET: Registered protocol family 17 +[    6.202201u32 classifier 
-[    7.440000] 8021q: 802.1Q VLAN Support v1.+[    6.211179    input device check on 
-[    7.460000] List of all partitions: +[    6.223295    Actions configured 
-[    7.470000] 1f00             384 mtdblock0  (driver?) +[    6.297292kmodloaderdone loading kernel modules from /etc/modules.d/* 
-[    7.490000] 1f01            1216 mtdblock1  (driver?) +[    6.297648randomcrng init done 
-[    7.510000] 1f02            2880 mtdblock2  (driver?) +[    6.331122random19 urandom warning(smissed due to ratelimiting 
-[    7.520000] No filesystem could mount roottried:  squashfs vfat msdos + 
-[    7.540000] Kernel panic not syncing: VFS: Unable to mount root fs on unknown-block(31,2) +BusyBox v1.35.0 (2022-10-26 07:59:38 UTC) built-in shell (ash) 
-[    7.540000] System halted.+ 
 +  _______                     ________        __ 
 +       |.-----.-----.-----.|  |  |  |.----. |_ 
 + |     ||  _  |  -__|     ||  |  |  ||   _||   _| 
 + |_______||   __|_____|__|__||________||__|  |____| 
 +          |__| W I R E L E S S   F R E E D O M 
 + ----------------------------------------------------- 
 + OpenWrt SNAPSHOTr21112-eb456aedfe 
 + ----------------------------------------------------- 
 +=== 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. 
 +-------------------------------------------------- 
 +</nowiki>
 </WRAP> </WRAP>
  
  • Last modified: 2022/11/02 07:25
  • by plappermaul