OpenWrt Forum Archive

Topic: Realtek SoC support in OpenWrt

The content of this topic has been archived between 22 Sep 2016 and 30 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Hi,

I have a router which contains RTL8197D . The board does not have any JTAG Header. Although i have figured out the oins and somehow managed to attach a header for JTAG. I am using the wiggler cable as mentioned in this link

http://wiki.openwrt.org/doc/hardware/po … e.buffered

Signal i am using are :

1. TMS
2. TCK
3. TDI
4. TDO
5. TRST_IN

The board support EJTAG.

As RTL8179D contains Lexra RLX5281 cpu cores, Urjtag and tjtag doesnot support such SOC. Although i have added support in tjtag v3.0.1 and urjtag by adding device id in the code. The utility now identifies the the SOC but it doesnot reconizes the SPI flash. SPI Flash used in the board is MX25L12805D.

i have used both switches /dma and /nodma in tjtag but no result.

Following is the result with /dma swtich

###############################################################################

# ./tjtag -probeonly /wiggler /dma /flash_debug

==============================================
EJTAG Debrick Utility v3.0.1 Tornado-MOD
==============================================

Probing bus ... Done

Instruction Length set to 5

CPU Chip ID: 00010101001010000001000000001101 (1528100D)
*** Found a LX5281 chip ***

    - EJTAG IMPCODE ....... : 00000010110000010000000010000000 (02C10080)
    - EJTAG Version ....... : 1 or 2.0
    - EJTAG DMA Support ... : Yes
    - EJTAG Implementation flags: R4k ASID_8 MIPS16 MIPS32
    *** DMA Mode Forced On ***

Issuing Processor / Peripheral Reset ... Done
Enabling Memory Writes ... Done
Halting Processor ... <Processor Entered Debug Mode!> ... Done
Clearing Watchdog ... Done
spi_flash_read 0x1fc00000
spi_flash_mmr  0x11300000
spi_flash_mmr_size 0x0000000c
spi_flash_ctl  0x00000000
spi_flash_opcode 0x00000004
spi_flash_data 0x00000008
spi_ctl_start 0x00000100
spi_ctl_busy 0x00010000

Probing Flash at (Flash Window: 0x1fc00000) ...

Debug AMD Vendid :    00000000000000000000000000000000 (00000000)
Debug AMD Devdid :    00000000000000000000000000000000 (00000000)

Debug SST Vendid :    00000000000000000000000000000000 (00000000)
Debug SST Devdid :    00000000000000000000000000000000 (00000000)

Debug BSC-SCS Vendid :00000000000000000000000000000000 (00000000)
Debug BCS-SCS Devdid :00000000000000000000000000000000 (00000000)
REGREAD32 data 0x00000000 spi_flash_mmr 0x11300000 reg 0x00000000
REG 0x00000004 REGWRITE32 0x0000009f
SPI_FLASH_OPCODE 0x00000004 PTR_OPCODE 0x0000009f
REG 0x00000000 REGWRITE32 0x00000131
SPI_FLASH_CTL SEND -> 0x00000000 reg 0x00000131
REGREAD32 data 0x00000000 spi_flash_mmr 0x11300000 reg 0x00000000
REGREAD32 data 0x00000000 spi_flash_mmr 0x11300000 reg 0x00000008

Debug SPI id :    00000000000000000000000000000000 (00000000)

Debug SPI Vendid :    00000000000000000000000000000000 (00000000)
Debug SPI Devdid :    00000000000000000000000000000000 (00000000)
Done

*** Unknown or NO Flash Chip Detected ***

*** REQUESTED OPERATION IS COMPLETE ***

##############################################################################

Following is the result with /nodma switch

##############################################################################

# ./tjtag -probeonly /wiggler /flash_debug /nodma

==============================================
EJTAG Debrick Utility v3.0.1 Tornado-MOD
==============================================

Probing bus ... Done

Instruction Length set to 5

CPU Chip ID: 00010101001010000001000000001101 (1528100D)
*** Found a LX5281 chip ***

    - EJTAG IMPCODE ....... : 00000010110000010000000010000000 (02C10080)
    - EJTAG Version ....... : 1 or 2.0
    - EJTAG DMA Support ... : Yes
    - EJTAG Implementation flags: R4k ASID_8 MIPS16 MIPS32
    *** DMA Mode Forced Off ***

Issuing Processor / Peripheral Reset ... Done
Enabling Memory Writes ... Done
Halting Processor ... <Processor Entered Debug Mode!> ... Done
Clearing Watchdog ... Done
spi_flash_read 0x1fc00000
spi_flash_mmr  0x11300000
spi_flash_mmr_size 0x0000000c
spi_flash_ctl  0x00000000
spi_flash_opcode 0x00000004
spi_flash_data 0x00000008
spi_ctl_start 0x00000100
spi_ctl_busy 0x00010000

Probing Flash at (Flash Window: 0x1fc00000) ...

Debug AMD Vendid :    00000000000000000000101111110000 (00000BF0)
Debug AMD Devdid :    00000000000000000000000000000100 (00000004)

Debug SST Vendid :    00000000000000000000101111110000 (00000BF0)
Debug SST Devdid :    00000000000000000000000000000100 (00000004)

Debug BSC-SCS Vendid :00001011111100000000000000000100 (0BF00004)
Debug BCS-SCS Devdid :00001011111100000000000000000100 (0BF00004)
REGREAD32 data 0x00000000 spi_flash_mmr 0x11300000 reg 0x00000000
REG 0x00000004 REGWRITE32 0x0000009f
SPI_FLASH_OPCODE 0x00000004 PTR_OPCODE 0x0000009f
REG 0x00000000 REGWRITE32 0x00000131
SPI_FLASH_CTL SEND -> 0x00000000 reg 0x00000131
REGREAD32 data 0x00000000 spi_flash_mmr 0x11300000 reg 0x00000000
REGREAD32 data 0x00000000 spi_flash_mmr 0x11300000 reg 0x00000008

Debug SPI id :    00000000000000000000000000000000 (00000000)

Debug SPI Vendid :    00000000000000000000000000000000 (00000000)
Debug SPI Devdid :    00000000000000000000000000000000 (00000000)
Done

*** Unknown or NO Flash Chip Detected ***

*** REQUESTED OPERATION IS COMPLETE ***
##############################################################################

Please Help

Dear razools, I can help you install openwrt on your router. We have a working image for it. First thing you need to do is hook up the ttl so we can make upgrading the bootloader easier.

hey guys so i have a Loopcomm LC-8696
specs are:
RTK 8196C + 8192CE
Winbond W25Q16BV - 16M-bit/2MB Flash
zentel A3V28S40ETP-G6 - 16MB Ram

i would like to put openWRT anyone got time to give me a hand?

Dear ps2chiper,

My Bootloader is corrupted. The only output i receive through serial header is :

Booting ....

I think i need to replace the bootloader. But i was unsuccessful in uploading the bootloader through tjtag and urjtag.
I read your post that you have successfully added support in urjtag.


Thanks for you quick reply

zacwhite15 wrote:

hey guys so i have a Loopcomm LC-8696
specs are:
RTK 8196C + 8192CE
Winbond W25Q16BV - 16M-bit/2MB Flash
zentel A3V28S40ETP-G6 - 16MB Ram

i would like to put openWRT anyone got time to give me a hand?

Sorry, you do not have enough flash and ram to make it happen.

hello, members

how could you flash the  firmware?   i have made an unbuffered cable following the guide
http://wiki.openwrt.org/doc/hardware/po … unbuffered
and
use TJTAG EJTAG Debrick Utility from  SourceForge. but it does not support rtl8196c + rtl8188re .

and i test TDI TDO TMS TCK voltage. it is

TDI : about 3.3 v
TDO : it asend from 0 to 3.3 and desend to 0. it waves
TMS : about 0.2 v
TCK : about 3.3 v

is it right? thanks for any reply smile


roman wrote:

Hello the community!

I've been postponing this post since about 2 month, hoping we will get to
some stable quiet bay. But we are still not there so I decided not to wait
any longer smile

We are working on Realtek SoC family support in OpenWrt. Particulatrly rtl8196c,
rtl8196e, rtl8196d and rtl8198. Most of you probably know that Realtek SoCs are
actually Lexra cores (4xxx and 5xxx series) which are modified mips cpus with
few absend instrustions (compared to mips).

There was some interest in rtl8196c based routers seen here, like [1][2][3] and
even rtl8198 [4]. There is also DSL SoC from Realtek [5] but we don't have any
plans to work on that currently.

For now we have rtl8196c + rtl8188re as wifi working pretty stable but several
hacks to OpenWrt build system are needed to compile it. Also we have it
working only with binutils 2.21.1 and gcc 4.5-linaro (4.6-linaro breaks
usb support somehow). Current toolchain patches are based on earlier work of
other OpenWrt members (Florian? Felix?). But we got some support from Realtek
itself and now, looking at their changes and what we had before, we are going
to make gcc 4.8 + binutils 2.22 toolchain.
As for the other chips, rtl8196e boots and seems to be working but without
ethernet and usb and rtl8196d only kernel boot is working (userspace explodes).

Regarding the kernel and drivers we are still at 2.6.30/2.6.32
as this is what can be found in Realtek SDK but major kernel bump is planned.
Wifi driver (rtl8192cd) is already made to be compiled from compat-wireless.
Realtek's code is mostly GPLd or doesn't contain any copyrights so there should
be no legal problems with code porting. Sometimes there are also fake copyrights
(original copyright changed to Realtek).

For those who are interested right now our tree is based on trunk@36713 and all
changes are in realtek-unstable branch here [6]. There are also few snapshot
images here [7]. There is also #nprove@freenode where we are free to talk or
discuss any questions regarding this port. Some also blog a little [8].
Sure we will be glad to get any help and suggestions.
Feedback is also welcomed smile

Our current TODO list looks approximately like this (priorities could be mixed):
- toolchain (gcc 4.8 + binutils 2.22)
- rtl8196e ethernet and usb (newer ethernet driver? toolchain?)
- rtl8196d userspace (toolchain problem?)
- merge arch/rlx/ with arch/mips/, cleanup
- kernel version bump (to 3.10?), this may trigger major driver rewrites
- ethernet switch driver based on swconfig


1. https://forum.openwrt.org/viewtopic.php?id=31551
2. https://forum.openwrt.org/viewtopic.php?id=44406
3. https://forum.openwrt.org/viewtopic.php?id=45484
4. https://forum.openwrt.org/viewtopic.php?id=31547
5. https://forum.openwrt.org/viewtopic.php?id=40958
6. https://git.nprove.in/rtl819xx/
7. https://downloads.nprove.in/
8. http://main.lv/writeup/rtl8196c_support … enwrt.html

use ttl we can go to the <realtek> command line. but , i could not upload through tftp.  the client can connect to 192.168.1.6 but when transfering , the connection always reports timeout. so i could not send any bin to it.



ps2chiper wrote:

Dear razools, I can help you install openwrt on your router. We have a working image for it. First thing you need to do is hook up the ttl so we can make upgrading the bootloader easier.

livechan wrote:

use ttl we can go to the <realtek> command line. but , i could not upload through tftp.  the client can connect to 192.168.1.6 but when transfering , the connection always reports timeout. so i could not send any bin to it.



ps2chiper wrote:

Dear razools, I can help you install openwrt on your router. We have a working image for it. First thing you need to do is hook up the ttl so we can make upgrading the bootloader easier.

Which router do you own? Also how did you set up your network connection?

TOPOLINK N100R MADE IN CHINA.

I connect the ttl port with a ttl-to-usb adapter and connect pc with the router's lan port, then start the router,
in secureCRT, i can see it goes into <realtek> command line. then i use tftp -i to transfer file in win xp .
the secureCRT can see a message about file name uploading.  but the tftp process ends timeout. i don't know the reason.


my adapter


ps2chiper wrote:
livechan wrote:

use ttl we can go to the <realtek> command line. but , i could not upload through tftp.  the client can connect to 192.168.1.6 but when transfering , the connection always reports timeout. so i could not send any bin to it.



ps2chiper wrote:

Dear razools, I can help you install openwrt on your router. We have a working image for it. First thing you need to do is hook up the ttl so we can make upgrading the bootloader easier.

Which router do you own? Also how did you set up your network connection?

(Last edited by livechan on 15 Apr 2014, 13:41)

livechan wrote:

TOPOLINK N100R MADE IN CHINA.

I connect the ttl port with a ttl-to-usb adapter and connect pc with the router's lan port, then start the router,
in secureCRT, i can see it goes into <realtek> command line. then i use tftp -i to transfer file in win xp .
the secureCRT can see a message about file name uploading.  but the tftp process ends timeout. i don't know the reason.


my adapter

How much memory and flash does that router contain? and where do you live?

i think the reason  is not about the flash size,  the bin file i transfer is  about 1 M, the ram size is 16M.

btw, i am in guangzhou. china:)

ps2chiper wrote:
livechan wrote:

TOPOLINK N100R MADE IN CHINA.

I connect the ttl port with a ttl-to-usb adapter and connect pc with the router's lan port, then start the router,
in secureCRT, i can see it goes into <realtek> command line. then i use tftp -i to transfer file in win xp .
the secureCRT can see a message about file name uploading.  but the tftp process ends timeout. i don't know the reason.


my adapter

How much memory and flash does that router contain? and where do you live?

livechan wrote:

i think the reason  is not about the flash size,  the bin file i transfer is  about 1 M, the ram size is 16M.

btw, i am in guangzhou. china:)

If you come down to shenzhen, I will upgrade it for you.

ok , i am on business trip for about one month. i will contact you when i am back.

ps2chiper wrote:
livechan wrote:

i think the reason  is not about the flash size,  the bin file i transfer is  about 1 M, the ram size is 16M.

btw, i am in guangzhou. china:)

If you come down to shenzhen, I will upgrade it for you.

Hi livecan,

You can't just measure the jtag signals using a voltmeter because they are ttl signals which varies from 3.3V (in case of your router) and zero. These signals can be "sniffed" during the talk with your PC using an osciloscope ar better yet, using a logic analyzer like the ones produced by Saleae ( www.saleae.com ).

Have caution with the unbuffered parallel cable. From my experince, only an old PC parallel port managed to talk with my router (a TP-Link TL-R402) via jtag. Probably it has stronger signals; I don't know. The buffered one did a superior job. Also in my case, only real parallel ports managed to communicate via jtag. My usb to parallel adaptor didn't succeed ...

My TP-Link router appears it denies any DMA read/write via jtag (even a read from 0xFF30000 returns 0x0). Do you think the TP-Link guys would answer to a support call about such a jtag related issue?

livechan wrote:

hello, members

how could you flash the  firmware?   i have made an unbuffered cable following the guide
http://wiki.openwrt.org/doc/hardware/po … unbuffered
and
use TJTAG EJTAG Debrick Utility from  SourceForge. but it does not support rtl8196c + rtl8188re .

and i test TDI TDO TMS TCK voltage. it is

TDI : about 3.3 v
TDO : it asend from 0 to 3.3 and desend to 0. it waves
TMS : about 0.2 v
TCK : about 3.3 v

is it right? thanks for any reply smile

i just try to find some way to talk to my hardware, but  TTL not work, and Jtag not work, frustrated. smile .

mne wrote:

Hi livecan,

You can't just measure the jtag signals using a voltmeter because they are ttl signals which varies from 3.3V (in case of your router) and zero. These signals can be "sniffed" during the talk with your PC using an osciloscope ar better yet, using a logic analyzer like the ones produced by Saleae ( www.saleae.com ).

Have caution with the unbuffered parallel cable. From my experince, only an old PC parallel port managed to talk with my router (a TP-Link TL-R402) via jtag. Probably it has stronger signals; I don't know. The buffered one did a superior job. Also in my case, only real parallel ports managed to communicate via jtag. My usb to parallel adaptor didn't succeed ...

My TP-Link router appears it denies any DMA read/write via jtag (even a read from 0xFF30000 returns 0x0). Do you think the TP-Link guys would answer to a support call about such a jtag related issue?

livechan wrote:

hello, members

how could you flash the  firmware?   i have made an unbuffered cable following the guide
http://wiki.openwrt.org/doc/hardware/po … unbuffered
and
use TJTAG EJTAG Debrick Utility from  SourceForge. but it does not support rtl8196c + rtl8188re .

and i test TDI TDO TMS TCK voltage. it is

TDI : about 3.3 v
TDO : it asend from 0 to 3.3 and desend to 0. it waves
TMS : about 0.2 v
TCK : about 3.3 v

is it right? thanks for any reply smile

Hi, everyone. I would like to compile the image for d-link dir 300 c1. I have an experience compiling openwrt. But I have some troubles. I don't now where is a stable version of git or svn for rtl 8196c. Can you give me the links, please. An also I have a trouble with the numbers I must set in menuconfig for d-link dir 300 c1, to my mind it has 4 Mb flash. I have tried to take ready images from snapshots but I have always gotten a brick an restored it from emergency state. Sorry for my stupidity.

(Last edited by sanyaz on 21 May 2014, 23:46)

Hi, i have a huawei b153 wireless gateway (the one you plug in the wall), it has a 3g module locked on one operator.
btw, in the inside i have identified :
RTL8196c
flash:4mb (fl032)
ram samsung 16mb
wifi chip: rtl8188
is there any chance to flash it?
i still have to work on it to find the serial line, but i think that lot of the test pads may be also a ethernet port

Hello, guys!

I'm newbie of OpenWrt.
Sorry for replying to old topic:

mne wrote:

There were some problems with finding and downloading linux.2.6.30 kernel and compiling uci firewall3 package (it wasn't finding ip_set.h file) but in the end it build successfuly; a patch can be provided if someone is interested. Also odhcp6 failed to compile in my case but it wasn't needed and it was removed for good.There were some problems with finding and downloading linux.2.6.30 kernel and compiling uci firewall3 package (it wasn't finding ip_set.h file) but in the end it build successfuly; a patch can be provided if someone is interested. Also odhcp6 failed to compile in my case but it wasn't needed and it was removed for good.

mne,
I'm now compiling OpenWrt for Realtek and met same problem.
Would you please give me some patches to overcome this problem

i change flash and ram , but still time out

http://s3.postimg.org/4pqmbw9ld/timeout.png

livechan wrote:

i think the reason  is not about the flash size,  the bin file i transfer is  about 1 M, the ram size is 16M.

btw, i am in guangzhou. china:)

ps2chiper wrote:
livechan wrote:

TOPOLINK N100R MADE IN CHINA.

I connect the ttl port with a ttl-to-usb adapter and connect pc with the router's lan port, then start the router,
in secureCRT, i can see it goes into <realtek> command line. then i use tftp -i to transfer file in win xp .
the secureCRT can see a message about file name uploading.  but the tftp process ends timeout. i don't know the reason.


my adapter

How much memory and flash does that router contain? and where do you live?

After several days' attempt, i upload the firmware successfully.
the reason for tftp time out is due to  OS .

I found a link in DD-WRT .
http://www.dd-wrt.com/wiki/index.php/TF … d_Win_2008

Now i face the same problem as kwongwo .boot get error " jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found ".

i changed SPI flash / RAM from 2MB/16MB to 8MB/32MB.


livechan wrote:

i change flash and ram , but still time out

http://s3.postimg.org/4pqmbw9ld/timeout.png

livechan wrote:

i think the reason  is not about the flash size,  the bin file i transfer is  about 1 M, the ram size is 16M.

btw, i am in guangzhou. china:)

ps2chiper wrote:

How much memory and flash does that router contain? and where do you live?

(Last edited by livechan on 5 Jun 2014, 03:08)