Working Realtek SoC RTL8196E 97D 97F in last master

According to this site the 8198C should be a fully fledged MIPS dual core.

Or am I missing something?

You are right... The C version is a full mips...

@gaspare Loooking at that repo and enspecially the RTL8197F device I can see a lot in common with our RTL83XX/RTL93XX switch devices. E.g.

  • Lexra bus
  • Crypto engine
  • Interrupt controller
  • Timers
  • ...

All those that participate in that project can meet in a phone booth. That said my idea is to integrate the RTL8197F in the realtek subtree and you could join the party if you like. Of course a lot is to do but each part time developer more will be helpful.

@svanheule @olliver I hope you support the invitation too.

2 Likes

Of course I do. You've experienced first hand how strained our human resources are, so the more, the merrier. :slight_smile:

1 Like

@plappermaul ... Thats exactly what I'm working on right now :slight_smile: .... I'm adapting the code to kernel 5.15 in master and the new kernel already have a lot of the functions from the otto platform that 97F is also based on ... I will do an integration of the 97F in the realtek tree in my repository and send to you guys ...

Thanks for the invite... I'd love to help in any way I can....

2 Likes

Would be good timing to have alternate OS due to vulnerability in Realtek eCos firmware.

I have a Tenda AC5 v3.0 with serial connection. It has an RTL8197FHT and RTL8812FR according to online pics

Is there a test image I can try on that device?

I think this router have a 2M flash... It is too little for openwrt...

thanks for pointing that out. I confirmed it 2MB flash 64MB RAM

here is the boot log tenda ac5 v3.0

Booting...
init_ram

DDR init OK
init ddr ok

DRAM Type: DDR2
        DRAM frequency: 533MHz
        DRAM Size: 64MB
JEDEC id 684015, EXT id 0x6840
found BH25D16

>>>>>No Flash Vendor support (0x00684015)<<<<<

use MXIC as flash vendor instead
BH25D16, size=2MB, erasesize=4KB, max_speed_hz=55000000Hz
auto_mode=0 addr_width=3 erase_opcode=0x00000020
Write PLL1=80c00002
=>CPU Wake-up interrupt happen! GISR=89000080

RTL8197F-VG boot release version:589 (Jan  6 2020-14:32:36) (600MHz)
Mac addr:50-0f-f5-3c-be-ef
use Switch new descriptor
wait for upgrage
port link 0x000030e0 0x000030e0 0x000030e0 0x000030e0
irq:0x00008080
Jump to image start:0x80700000...
decompressing kernel:
Uncompressing... done, booting the kernel.
done decompressing kernel.
start address: 0xa0000600
[cyg_net_init] Init: mbinit(0x00000000)
[cyg_net_init] Init: cyg_net_init_devs(0x00000000)
Init device 'rltk819x_eth0'
Init device 'rltk819x_eth1'
Init device 'rltk819x_eth7'
Init device 'rltk819x_peth0'
[peth0] added, mapping to [eth1]...
Init device 'rltk819x_eth4'
Init device 'rltk819x_eth3'
Init device 'rltk819x_eth2'
Init device 'rltk819x_wlan1'
[MACFM_software_init 297]wifi hal support Mac function = 0x8008
RFE TYPE =0
[pwlan0] added...
Init device 'rltk819x_wlan1-vxd'
[MACFM_software_init 297]wifi hal support Mac function = 0x8008
RFE TYPE =0
Init device 'rltk819x_wlan1-va3'
[MACFM_software_init 297]wifi hal support Mac function = 0x8008
RFE TYPE =0
Init device 'rltk819x_wlan1-va2'
[MACFM_software_init 297]wifi hal support Mac function = 0x8008
RFE TYPE =0
Init device 'rltk819x_wlan1-va1'
[MACFM_software_init 297]wifi hal support Mac function = 0x8008
RFE TYPE =0
Init device 'rltk819x_wlan1-va0'
[MACFM_software_init 297]wifi hal support Mac function = 0x8008
RFE TYPE =0
Init device 'rltk819x_wlan0'
[MACFM_software_init 297]wifi hal support Mac function = 0x10ff
[pwlan0] added...
Init device 'rltk819x_wlan0-vxd'
[MACFM_software_init 297]wifi hal support Mac function = 0x10ff
Init device 'rltk819x_wlan0-va3'
[MACFM_software_init 297]wifi hal support Mac function = 0x10ff
Init device 'rltk819x_wlan0-va2'
[MACFM_software_init 297]wifi hal support Mac function = 0x10ff
Init device 'rltk819x_wlan0-va1'
[MACFM_software_init 297]wifi hal support Mac function = 0x10ff
Init device 'rltk819x_wlan0-va0'
[MACFM_software_init 297]wifi hal support Mac function = 0x10ff
Init device 'rltk819x_pwlan0'
[cyg_net_init] Init: loopattach(0x00000000)
[cyg_net_init] Init: ifinit(0x00000000)
[cyg_net_init] Init: domaininit(0x00000000)
[cyg_net_init] Init: cyg_net_add_domain(0x8052c810)
New domain internet6 at 0x00000000
[cyg_net_init] Init: cyg_net_add_domain(0x8052bf4c)
New domain internet at 0x00000000
IP packet filtering initialized, divert enabled, rule-based forwarding enabled, default to deny, logging disabled
Realtek FastPath:v1.03
[cyg_net_init] Init: cyg_net_add_domain(0x8052bdfc)
New domain route at 0x00000000
[cyg_net_init] Init: call_route_init(0x00000000)
[cyg_net_init] Init: ip6_init2(0x00000000)
[cyg_net_init] Init: sysctl_register_all(0x00000000)
[cyg_net_init] Done
Creating Init Thread...
cpuload_calibration_value=6644404
Envram is initing! base_addr=0x1c000 size=0x3000
md5:eeb4b8053fa2decc org:05b8b4eeccdea23f
Nvram is initing! base_addr=0x1f8000 size=0x7fff
Snvram is initing! base_addr=0x1f0000 size=0x7fff
md5:d1edade1d7e7bd09 org:e1adedd109bde7d7
md5:d1edade1d7e7bd09 org:e1adedd109bde7d7
NVRAM start form MAIN block data
spi_lock.........
System start
Realtek GPIO init
Init GPIO in GPIO_APIV2
init gpio_id:15
init gpio_id:15
init gpio_id:19
this thread can be checked ! if thread stack overflow or soiled
------------main
tenda_ifconfig error
: Invalid argument
set_enable_vlan : 1  set_enable_iptv:1 iptv_port_pvid:4
[MAIN->tapf_vlan_config->262]:vlan config ok!
bridge0: ifid: 02:e0:4c:ff:fe:f0:00:01
in6_ifattach_linklocal: failed to configure a link-local address on bridge0 (errno=22)
kbMrAiIdNg-e>1b:r _iifniidt:- >0827:8e]0::b4rc(:bfrfi:dfgee:0f)0 :i0n0i:t0 1o
n!i
 6_ifattach_linklocal: failed to configure a link-local address on bridge1 (errno=22)
ieMtAhI:N -i>fbird_:i n5i2t:-0>f8:7f85]::fbfr:(fber:i3dcg:ed12): 8i0n
 t ok!
[MAIN->init_before_module_init_services->76]:init_before_module_init_services ok!
[DEBUG] [MSG->msg_init->37]:rc_msg init ok!
[llm] br_interfaces(1065) eth0 up ...
eth0: promiscuous mode enabled
.eltlhm:]  ibfri_di:n t5e2r:f0afc:efs5(:1f0f6:5f)e :e3tch:0d 2u:p8 0.
 .
eth2: promiscuous mode enabled
.eltlhm:]  ibfri_di:n t5e2r:f0afc:efs5(:1f0f6:5f)e :e3tch:0d 2u:p8 0.
 .
CLI> eth3: promiscuous mode enabled
.eltlhm:]  ibfri_di:n t5e2r:f0afc:efs5(:1f0f6:5f)e :e3tch:0d 2u:p8 0.
 .
eth4: promiscuous mode enabled
.eltlhm:]  ibfri_di:n t5e2r:f0afc:efs5(:1f0f6:5f)e :e3tch:0d 2u:p8 0.
 .
eth7: promiscuous mode enabled
[MAIN->tapf_vlan_config->262]:vlan config ok!
[rc->rc_msg_2_tlv->108]:key = op,value = 3
[MSG->msg_send_msg_2_mbox->120]:center:00000106
[MSG->msg_send_msg_2_mbox->136]:send msg [op=3] success!
[TPI->tpi_lan_start->151]:start success!
re865x_ioctl:5069, set port 4 0M FULL
wlan: ifid: 52:0f:f5:ff:fe:3c:be:ef
chip_version=0x100f,WlanSupportAbility = 0x0
test 0x81d8fc00,0x30,0x1d8fe80,0x0,
test 0x81d8fc80,0x30,0x1d8fec0,0x0,
test 0x81d8fd00,0x30,0x1d8ff00,0x0,
test 0x81d8fd80,0x30,0x1d8ff40,0x0,
test 0x81d8fe00,0x30,0x1d8ff80,0x0,
[97G] RFE type 0 PHY paratemters: DEFAULT
clock 40MHz
InitMACTRX OK
InitMACProtocolHandler OK
InitMACSchedulerHandler OK
InitMACWMACHandler OK
InitMACSysyemCfgHandler OK
InitMACFunctionHandler OK
[Warning] is_fcs_mode_enable=NULL
--- STA STEERING INIT ---
LED2SV & LED1SV ctrl fem
steer_update_bss_info: isdown(0)
steer_update_bss_info: isdown(1)
chip_version=0x100f,WlanSupportAbility = 0x0
test 0x81d8fc00,0x30,0x1d8fe80,0x0,
test 0x81d8fc80,0x30,0x1d8fec0,0x0,
test 0x81d8fd00,0x30,0x1d8ff00,0x0,
test 0x81d8fd80,0x30,0x1d8ff40,0x0,
test 0x81d8fe00,0x30,0x1d8ff80,0x0,
[97G] RFE type 0 PHY paratemters: DEFAULT
clock 40MHz
InitMACTRX OK
InitMACProtocolHandler OK
InitMACSchedulerHandler OK
InitMACWMACHandler OK
InitMACSysyemCfgHandler OK
InitMACFunctionHandler OK
LED2SV & LED1SV ctrl fem
steer_update_bss_info: isdown(0)
wlan1: promiscuous mode enabled
[TPI->tpi_wwliafni:_ oipfeirda:t o5r2-:>01f5:4f85]::fsft:ofpe :s3ucc:cde2s:s8!5

chip_version=0x2001,WlanSupportAbility = 0x3
clock 40MHz
InitPON OK!!!
>>SetBeaconDownload88XX
[GetHwReg88XX][PHY_REG_PG_8812Fmp_Type0]
[Warning] is_fcs_mode_enable=NULL
[set_8812F_trx_regs] +++
steer_update_bss_info: isdown(0)


sta steer cmd:count = 1, 0


sta steer cmd:count = 17, 2,rssi_lmt_2g,-55


sta steer cmd:count = 17, 2,rssi_lmt_5g,-76


sta steer cmd:count = 17, 2,pri_rssi_5g,-64


sta steer cmd:count = 17, 2,pri_rssi_2g,-74


sta steer cmd:count = 18, 2,sta_lmt_flow,100


sta steer cmd:count = 18, 2,sta_balance_en,1


sta steer cmd:count = 19, 2,sta_lmt_num_5g,16
wlan0: promiscuous mode enabled
uTPI->tpiin_iwtiWfeib_so:p elraantiopr=-[>119524.81]6:8s.t0o.p1 ]s
-cce-s-s-!-
--w-l-a-n-0- i n i t Wcelbesa-r-_-a-c-l-_-t-a-b-l-e-:207 0 -
 -w-l-a-n-1- - - -
 clear_acl_table:0
wlan0     fflush_acl_list:0
wlan1     fflush_acl_list:0
func:ipnat_init i = 0
[TPI->tpi_firewall_start->239]:start success!
[TPI->tpi_http_start->145]:http start success!
[TPI->tpi_upnp_start->107]:start success!
osl_open_udp_socket: bind failed: Can't assign requested address
[TPI->tpi_dnsmasq_start->75]:start success!
[TPI->tpi_sntp_start->82]:start success!
[TPI->tpi_dhcp_server_start->330]:start success!
[TPI->tpi_wan_surf_check_start->588]:start success!
[TPI->tpi_wan_mode_check_update_info->75]:mode_need_switch is not yes!
[ERROR] [TPI->tpi_wifi_switch_sched_update_info->67]:schedule count[ 0 ] wrong
iw_i[ntipti,_1i0g9m4p,_iifnniatm]e[21G2:6w]l[alnu1m,iinfaniasm]e 5nGo:twhlianng0t
_ob rduot.e
 force_attack_mitigation ThresHold[10]

WiFi Simple Config v2.14-wps2.0 (2020.09.15-06:32+0000).

[TPI->tpi_create_wps_thread->276]:start success!
[TPI->tpi_wps_iw_start->320]:start success!
[ERROR] [TPI->tpi_ddns_start->105]:the mib is off, connot start!
.....ucloud.............do......option....
[TPI->tpi_ucloud_start->101]:start success!
[TPI->tpi_led_start->453]:start success!
[TPI->tpi_single_led_start->111]:start success!
[MAIN->init_after_module_init_services->87]:init_after_module_init_services ok!
[rc->rc_module_msg_handle->157]:start handle module[6,rc_firewall]'s msg,op=3.debug_id=0.wlan_ifname=.string_info=
[TPI->tpi_firewall_action->137]:op=3
ioctl(SIOCIPFFL): Invalid argument
[TPI->tpi_firewall_stop->263]:stop success!
wlan0     clear_acl_table:0
wlan1     clear_acl_table:0
wlan0     fflush_acl_list:0
wlan1     fflush_acl_list:0
func:ipnat_init i = 0
[TPI->tpi_firewall_start->239]:start success!
[tenda_autochannel_offset][10867] channel_offset=1
Tenda ACS selected channel: 48
[tenda_autochannel_offset][10867] channel_offset=2
Tenda ACS selected channel: 5

CLI>
1 Like

Big thanks for your work! Here is full datasheet for Realtek RTL8197D SoC on G-Drive.

1 Like

Absolutely!

I think it would be nice to start with identifying similarities, we can use https://svanheule.net/switches for example. Those earlier linked datasheets are golden. I had seen them, but forgotten about them. It looks like this WiFi SOC chip is quite likely the predecessor of our switch chips, and with these datasheets actually containing register information, hopefully we can learn from them.

I'll see if I can add the SDk to my sdk repo and see if it could be useful at all in that extend.

1 Like

If RAM is sufficient, (32+) you could try replacing the FLASH chip (back it up first!) or, if possible (editable U-Boot env), a USB based rootfs. But that's all really stretching it a bit :slight_smile:

Thanks for the suggestion. That would be more effort than I'm ready for on this device.

Is there any RTL8197F device that is supported by this repo out of the box?

Most of the routers are from Brazil reselers (Intelbras, Greatek, Multilaser ...). I'm adding Tenda AC10, which is a global one... The wireless drivers are working, but the DSA switch is still in development....
The combinations of chips (RTL8197FS, RTL8812BRH and RTL836X) is found in most of realtek wireless routers... I think I can get full suport for those combinations just implementing the MDIO interface to the RTL836X. The RTL836X giga switch is already in the kernel...

1 Like

Will rtl8812brh be supported? I can't find any linux driver for it. 8192cd driver is too messy to be used.

I can use the 8822B driver with the 8812B chip... Try to use the rtw88 driver.

Do you have a working repo in github?

Where can we get this repo from? We'd like to check it with D-LINK DIR-825

I'm currently trying to build an initial image for an RTL8198C device (F-Secure Sense). I build uncompressed images and get up to here:

<RealTek>enable_tftp 1
Changing status of the tftpd to 1
<RealTek>autoburn 0
AutoBurning=0
<RealTek>loadaddr 80500000
Set TFTP Load Addr 0x80500000
<RealTek>
**TFTP Client Upload, File Name: openwrt-realtek-rtl8198c-f-secure_sense-initramfs-kernel.bin
-
**TFTP Client Upload File Size = 01BAA02A Bytes at 80500000
Success!
<RealTek>
initHeap
initInterrupt
Scanning NAND registered database ...

After uploading the image the system hangs for 30 seconds and reboots immediately. If I use compressed images the system wil hang not so long and stays alive. But I somehow cannot force it to decompress the kernel.

Any tips of how to proceed from here?

Did some basic work for RTL8198C devices.

1 Like