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/23 08:30] – Text plappermaultoh:f-secure:sense [2022/11/01 20:48] – [PCIe infos] plappermaul
Line 2: Line 2:
  
 ===== Supported Versions ===== ===== Supported Versions =====
-The device is not yet supported.+The device is not yet supported. Available code includes
  
 +  * [[https://github.com/plappermaul/rtl8198c-loader| Bootlader 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 =====
 +
 +==== Hardware Highlights ====
 +
 +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 15: Line 54:
   * Afterwards you can open the top cover with the holes in the same way. This will be a lot easier.   * Afterwards you can open the top cover with the holes in the same way. This will be a lot easier.
   * Remove some screws and slide out the mainboard to the top.   * Remove some screws and slide out the mainboard to the top.
 +
 +
 +===== OpenWRT Image =====
 +
 +==== Building ====
 +
 +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 nfjrom. This is essential because the filename triggers the kernel jump/initialization sequence. 
 +
 +<code>
 +cp build_dir/target_mips_24kec_uClibc-0.9.33.2/linux-rtkmips_rtl8198c/loader-rtl8198c-AP-initramfs.bin nfjrom
 +</code>
 +
 +In Sense bootloader enable TFTP and disable auto flashing
 +
 +<code>
 +---Ethernet init Okay!
 +<RealTek>autoburn 0
 +AutoBurning=0
 +<RealTek>enable_tftp 1
 +Changing status of the tftpd to 1
 +<RealTek>loadaddr 84000000
 +Set TFTP Load Addr 0x84000000
 +</code>
 +
 +On PC site upload image with filename "**nfjrom**" 
 +
 +<code>
 +tftp -i 192.168.1.6 put nfjrom
 +</code>
 +
 +After upload finishes system will automatically jump to the start address of the image, execute the lzma loader and fire up the kernel.
 +
 +<code>
 +<RealTek>
 +TFTP Client Upload, File Name: nfjrom
 +-
 +TFTP Client Upload File Size = 002EF850 Bytes at 84000000
 +
 +Success!
 +<RealTek>Jump to 0x84000000
 +</code>
 +
 ==== Serial Console ==== ==== Serial Console ====
  
-The serial console uses 3.3V with 38400 Baud and 8N1 coding. The signals are inverted. So either you have use an external inverter or must remove and shortcut the inverting transistors as shown on the second picture.+The serial console uses 3.3V with 38400 Baud and 8N1 coding. The signals are inverted. So either you have to use an external inverter or must remove and shortcut the inverting transistors as shown on the second picture. 
 + 
 +<code> 
 +UART pinout 
 +----------- 
 +[o]ooo 
 + ^ ||`------ GND 
 + | |`------- TX 
 + | `-------- GND 
 + `---------- RX 
 +</code>
  
 {{:media:fsecure-sense-serial.png?800|}} {{:media:fsecure-sense-serial.png?800|}}
 {{:media:fsecure-sense-shortcut.jpg?400|}} {{:media:fsecure-sense-shortcut.jpg?400|}}
 ===== Bootlogs ===== ===== Bootlogs =====
 +
 +
 +==== OEM bootloader ====
 +
 +Press ESC during bootup to get into the [[:docs:techref:bootloader:realtek|Realtek bootloader]]. 
 +
 +<code>
 +NNaanndd  bb
 +DRAM init done
 +Nand booting..
 +initHeap
 +
 +initInterrupt
 +
 +
 +Scanning NAND registered database ...
 +=> Found registed NAND Flash, info as below:
 +1.Chip_name= MT29F8G08AB
 +2.ID= 0x2c380026
 +3.Chip_size= 1073741824 MB
 +4.Block_cnt= 2048
 +5.Block_size= 512 KB
 +6.Page_size= 4096 Bytes
 +7.OobSize= 128 KB
 +
 +initFlash
 +DDR3:512 MB
 +
 +---Realtek RTL8198C boot code at 2017.08.30-14:06+0300 v1.5g (1000MHz) [C0 running][C1 sleep]
 +
 +showBoardInfo()
 +
 +RTL_W32(RTL_GPIO_MUX5(...)
 +
 +RTL_W32(RTL_GPIO_MUX5(RESET_PIN_IOBASE, RESET_PIN_DIRBASE)
 +sorftled init!
 +
 +BOOTInfo: Status: BootBank:0 BootCnt:1 BootMode:1 BootMaxCnt:3 UpgradeMode:0
 +
 +        *** BOOTInfo: Check PASSED ***
 +
 +... Booting from BANK-0 ...
 +---Escape booting by user
 +
 +---Ethernet init Okay!
 +<RealTek>?
 +----------------- COMMAND MODE HELP ------------------
 +HELP (?)                                    : Print this help message
 +DB <Address> <Len>
 +DW <Address> <Len>
 +EB <Address> <Value1> <Value2>...
 +EW <Address> <Value1> <Value2>...
 +CMP: CMP <dst><src><length>
 +IPCONFIG:<TargetAddress>
 +AUTOBURN: 0/1
 +LOADADDR: <Load Address>
 +J: Jump to <TargetAddress>
 +reboot
 +NANDID: Read NAND Flash ID
 +NANDBE:<Block start cnt><Block end cnt>
 +NANDPIOR:<flash_Paddress><enable_page_content><report_bad_block>
 +NANDPIOW:<flash_Paddress><image_addr><image_size>
 +NANDR:<flash_Paddress><image_addr><image_size><ECC_Enable>
 +NANDW:<flash_Paddress><image_addr><image_size>
 +NANDBBD:<block_test_start_cnt><block_test_end_cnt>
 +MDIOR:  MDIOR phyid reg
 +MDIOW:  MDIOW phyid reg data
 +PHYR: PHYR <PHYID><reg>
 +PHYW: PHYW <PHYID><reg><data>
 +PHYPR: PHYPR <PHYID><page><reg>
 +PHYPW: PHYPW <PHYID><page><reg><data>
 +XMOD <addr>  [jump]
 +TI : timer init
 +T : test
 +HRST: Host Pcie Reset <portnum> <mdio_rst>:
 +HINIT: Host init bar <portnum>
 +HLOOP: Test Pci-E data loopback <portnum> <cnt>
 +EPDN: PCIE Power Down test <portnum><mode>
 +EMDIOR: Reg Read <portnum>
 +EMDIOW <portnum> <reg> <val>:
 +ELOOP <portnum> <start/stop>:
 +EINT <portnum> <loops>:
 +PHY_BEGIN:
 +ETH : startup Ethernet
 +CPUClk:
 +C1Wake : Core 1 wake Up
 +GBIST: GPHY BIST
 +GDRF: GPHY DRF BIST
 +BISTALL:
 +Factory-Firmware: FFW
 +ENABLE_TFTP: 0/1, eg. 'ENABLE_TFTP 1'
 +</code>
 ==== OEM bootlog ==== ==== OEM bootlog ====
 +
 +The vendor firmware is based on OpenWrt Chaos Calmer.
  
 <WRAP bootlog> <WRAP bootlog>
Line 358: Line 562:
  
 ==== OpenWrt bootlog ==== ==== OpenWrt bootlog ====
 +
 +Current master build with https://github.com/openwrt/openwrt/pull/11094 
 +
 +<WRAP bootlog>
 +<nowiki>
 +<RealTek>Jump to 0x84000000
 +
 +
 +OpenWrt kernel loader for MIPS based SoC
 +Copyright (C) 2011 Gabor Juhos
 +Decompressing kernel... done!
 +Starting kernel at 80000000...
 +
 +[    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 Binutils) 2.37) #0 SMP Mon Oct 3 11:23:41 2022
 +[    0.000000] RTL838X model is 0
 +[    0.000000] RTL839X model is 0
 +[    0.000000] RTL93XX model is 0
 +[    0.000000] RTL819X model is 8198c001
 +[    0.000000] SoC Type: RTL8198C
 +[    0.000000] default cpc 1bde0001
 +[    0.000000] Kernel command line:
 +[    0.000000] CPU0 revision is: 00019a24 (MIPS 1074Kc)
 +[    0.000000] MIPS: machine is F-Secure Sense
 +[    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]   Normal   [mem 0x0000000000000000-0x0000000007ffffff]
 +[    0.000000] Movable zone start for each node
 +[    0.000000] Early memory node ranges
 +[    0.000000]   node   0: [mem 0x0000000000000000-0x0000000007ffffff]
 +[    0.000000] Initmem setup node 0 [mem 0x0000000000000000-0x0000000007ffffff]
 +[    0.000000] percpu: Embedded 14 pages/cpu s27792 r8192 d21360 u57344
 +[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 32480
 +[    0.000000] Kernel command line: console=ttyS0,38400
 +[    0.000000] Dentry cache hash table entries: 16384 (order: 4, 65536 bytes, linear)
 +[    0.000000] Inode-cache hash table entries: 8192 (order: 3, 32768 bytes, linear)
 +[    0.000000] Writing ErrCtl register=00000000
 +[    0.000000] Readback ErrCtl register=00000000
 +[    0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
 +[    0.000000] Memory: 100224K/131072K available (6043K kernel code, 249K rwdata, 1220K rodata, 21856K init, 94K bss, 30848K reserved, 0K cma-reserved)
 +[    0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=2, Nodes=1
 +[    0.000000] rcu: Hierarchical RCU implementation.
 +[    0.000000]  Tracing variant of Tasks RCU enabled.
 +[    0.000000] rcu: RCU calculated value of scheduler-enlistment delay is 10 jiffies.
 +[    0.000000] NR_IRQS: 256
 +[    0.000000] Failed to get CPU clock: -2
 +[    0.000000] CPU frequency from device tree: 1000MHz
 +[    0.000000] clocksource: GIC: mask: 0xffffffffffffffff max_cycles: 0x1cd42e4dffb, max_idle_ns: 881590591483 ns
 +[    0.000010] sched_clock: 64 bits at 1000MHz, resolution 1ns, wraps every 4398046511103ns
 +[    0.000041] clocksource: MIPS: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 3822520893 ns
 +[    0.000184] Calibrating delay loop... 498.89 BogoMIPS (lpj=2494464)
 +[    0.060029] pid_max: default: 32768 minimum: 301
 +[    0.060160] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
 +[    0.060174] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
 +[    0.061454] Using only one core due to dcache aliasing
 +[    0.062220] Performance counters: mips/1074K PMU enabled, 4 32-bit counters available to each CPU, irq 7
 +[    0.062373] rcu: Hierarchical SRCU implementation.
 +[    0.062580] dyndbg: Ignore empty _ddebug table in a CONFIG_DYNAMIC_DEBUG_CORE build
 +[    0.062764] smp: Bringing up secondary CPUs ...
 +[    0.064132] Primary instruction cache 64kB, VIPT, 4-way, linesize 32 bytes.
 +[    0.064139] Primary data cache 32kB, 4-way, VIPT, cache aliases, linesize 32 bytes
 +[    0.064147] MIPS secondary cache 512kB, 8-way, linesize 32 bytes.
 +[    0.064216] CPU1 revision is: 00019a24 (MIPS 1074Kc)
 +[    0.123414] Synchronize counters for CPU 1: done.
 +[    0.123545] smp: Brought up 1 node, 2 CPUs
 +[    0.124666] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
 +[    0.124691] futex hash table entries: 512 (order: 2, 16384 bytes, linear)
 +[    0.124829] pinctrl core: initialized pinctrl subsystem
 +[    0.125511] NET: Registered protocol family 16
 +[    0.150175] SCSI subsystem initialized
 +[    0.150418] usbcore: registered new interface driver usbfs
 +[    0.150472] usbcore: registered new interface driver hub
 +[    0.150517] usbcore: registered new device driver usb
 +[    0.152860] clocksource: Switched to clocksource GIC
 +[    0.153959] NET: Registered protocol family 2
 +[    0.154182] IP idents hash table entries: 2048 (order: 2, 16384 bytes, linear)
 +[    0.154821] tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 6144 bytes, linear)
 +[    0.154889] TCP established hash table entries: 1024 (order: 0, 4096 bytes, linear)
 +[    0.154921] TCP bind hash table entries: 1024 (order: 1, 8192 bytes, linear)
 +[    0.154962] TCP: Hash tables configured (established 1024 bind 1024)
 +[    0.155074] UDP hash table entries: 256 (order: 1, 8192 bytes, linear)
 +[    0.155134] UDP-Lite hash table entries: 256 (order: 1, 8192 bytes, linear)
 +[    0.155355] NET: Registered protocol family 1
 +[    0.364219] workingset: timestamp_bits=14 max_order=15 bucket_order=1
 +[    0.367170] squashfs: version 4.0 (2009/01/31) Phillip Lougher
 +[    0.367270] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
 +[    0.368782] Serial: 8250/16550 driver, 2 ports, IRQ sharing disabled
 +[    0.369545] printk: console [ttyS0] disabled
 +[    0.369639] 18002000.uart: ttyS0 at MMIO 0x18002000 (irq = 13, base_baud = 12500000) is a 16550A
 +[    1.952015] printk: console [ttyS0] enabled
 +[    1.967468] usbcore: registered new interface driver usb-storage
 +[    1.988125] NET: Registered protocol family 10
 +[    2.003933] Segment Routing with IPv6
 +[    2.016142] NET: Registered protocol family 17
 +[    2.030869] 8021q: 802.1Q VLAN Support v1.8
 +[    2.144174] Freeing unused kernel memory: 21856K
 +[    2.159503] This architecture does not have kernel memory protection.
 +[    2.180855] Run /init as init process
 +[    2.570058] init: Console is alive
 +[    2.592950] kmodloader: loading kernel modules from /etc/modules-boot.d/*
 +[    2.618692] kmodloader: done loading kernel modules from /etc/modules-boot.d/*
 +[    2.652938] init: - preinit -
 +[    2.814185] random: jshn: uninitialized urandom read (4 bytes read)
 +[    2.901180] 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
 +[    5.143909] procd: - early -
 +[    5.665332] procd: - ubus -
 +[    5.679638] random: ubusd: uninitialized urandom read (4 bytes read)
 +[    5.725020] random: ubusd: uninitialized urandom read (4 bytes read)
 +[    5.746277] random: ubusd: uninitialized urandom read (4 bytes read)
 +[    5.768441] procd: - init -
 +Please press Enter to activate this console.
 +[    6.093303] kmodloader: loading kernel modules from /etc/modules.d/*
 +[    6.119854] NET: Registered protocol family 38
 +[    6.139330] urngd: v1.0.2 started.
 +[    6.154609] cryptodev: driver 1.12 loaded.
 +[    6.170604] GACT probability on
 +[    6.182269] Mirror/redirect action on
 +[    6.202201] u32 classifier
 +[    6.211179]     input device check on
 +[    6.223295]     Actions configured
 +[    6.297292] kmodloader: done loading kernel modules from /etc/modules.d/*
 +[    6.297648] random: crng init done
 +[    6.331122] random: 19 urandom warning(s) missed due to ratelimiting
 +
 +BusyBox v1.35.0 (2022-10-26 07:59:38 UTC) built-in shell (ash)
 +
 +  _______                     ________        __
 +       |.-----.-----.-----.|  |  |  |.----.|  |_
 +     ||  _  |  -__|     ||  |  |  ||   _||   _|
 + |_______||   __|_____|__|__||________||__|  |____|
 +          |__| W I R E L E S S   F R E E D O M
 + -----------------------------------------------------
 + OpenWrt SNAPSHOT, r21112-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>
 +
  • Last modified: 2022/11/02 07:25
  • by plappermaul