Proof of concept - Realtek 1295


Recommended Posts

Armbian is a community driven open source project. Do you like to contribute your code?

On 12/25/2019 at 10:54 PM, y52 said:

Does somebody know who to implement the following solution ?

https://lkml.org/lkml/2019/7/7/39

I can not answer your question, but in the last few weeks there has been a lot of activity on lkml.org regarding the realtek-platform.

Basically „the pro‘s have taken over“ and this is the best thing, that could have happened. I think it is a smart move from realtek to go the „mainline-route“, as it will make their and our lives much easier in the future.

But now we need some patience, because every effort outside of the kernel-development is (IMHO) wasted time.

Link to post
Share on other sites
1 hour ago, Staars said:

every effort outside of the kernel-development is (IMHO) wasted time

I can not but agree.

I've tried several kernel branches for now: mainline, next, legacy BPI-SINOVOIP. In the absence of Realtek's support, accessibility to the board features is very poor. Even basic ethernet NIC's are not operational, even with the legacy BPI-SINOVOIP, which is supposed meeting this basic task. I do not even mention the video Mali T820 support, which is probably far from being thought of. 

 

Link to post
Share on other sites
On 12/24/2019 at 10:40 AM, danman said:

Can you try to dump it from u-boot?

My UART cable hasn't arrived yet, it should has been lost on its way to complete the setback with the W2 itself. Meanwhile I have decided sending the BPI-W2 back to the supplier, as no achievement has been made with the broken ethernet and it looks, that nobody interested from the Sinovoip side. Thus I shall not be able dumping mtd.  The hardware components are good for different applications, but the absence of drivers and kernel support makes it a handicap. 

Link to post
Share on other sites
On 12/29/2019 at 11:30 PM, Staars said:

I can not answer your question, but in the last few weeks there has been a lot of activity on lkml.org regarding the realtek-platform.

Basically „the pro‘s have taken over“ and this is the best thing, that could have happened. I think it is a smart move from realtek to go the „mainline-route“, as it will make their and our lives much easier in the future.

But now we need some patience, because every effort outside of the kernel-development is (IMHO) wasted time.

good job!

 

hi Staars   I have rtd1295 tvbox  how install armbian on my tvbox?

 

UART cable info:

 

U-Boot 2012.07-g593d2f1-dirty (Sep 01 2016 - 15:39:48)

CPU  : Cortex-A7 dual core
Board: Realtek QA Board
DRAM:  1 GiB
Watchdog: Disabled
Cache: Enabled
Non-Cache Region: 1 MB@0x07900000
MMC:   rtk_emmc : Detect chip rev. >= B
RTD1195 eMMC: 0
rtk_emmc : Detect chip rev. >= B
mmc->version=0x00010000
version=0x00000004
SDR select (sample/push) : 0x00/0x00
[LY] cardtype=57, mmc->card_caps=0f
[LY] TBD : to support DDR50/HS200
[LY] SDR bus width=2
SDR select (sample/push) : 0x00/0x00
[LY] mmc->boot_caps = 203
[LY] sdr50 : 0
exit from mmc_startup(),err=0
Device: RTD1195 eMMC
Manufacturer ID: 11
OEM: 100
Name: 004GE 
Tran Speed: 3197500
Rd Block Len: 512
MMC version 4.0
High Capacity: No
Capacity: 3.7 GiB
Bus Width: 8-bit
Speed: SDR50
Net:   Realtek PCIe GBE Family Controller mcfg = 0024
dev->name=r8168#0
167,sw_boot_init
SECURE_BOOT enter!
Cache: Enabled
Non-Cache Region: 1 MB@0x07900000
hardware name = R140B
74,sw_ptable_init
Read Partition ptable,offset = 0,length = 2000,addr=6000000
130,sw_ptentry_read
Read Partition ptable,offset = 200000,length = 2000,addr=6000000
30,sw_mmc_read
offset:200000,lengh=2000,addr=6000000, blk:1000,cnt:10
56,sw_ptable_check
mtd_parts=mtdparts=emmc:2M(loader),2M(ptable),2M(devinfo),2M(misc),16M(logo),24M(recovery),24M(boot),48M(swdb),320M(backup),320M(cache),480M(system),2856M(data)
ptable->cksum=0x298b,count=12
ptn=0    name='loader'    flags=0x0    offset=0x0    size=0x2
ptn=1    name='ptable'    flags=0x0    offset=0x2    size=0x2
ptn=2    name='devinfo'    flags=0x0    offset=0x4    size=0x2
ptn=3    name='misc'    flags=0x0    offset=0x6    size=0x2
ptn=4    name='logo'    flags=0x0    offset=0x8    size=0x10
ptn=5    name='recovery'    flags=0x0    offset=0x18    size=0x18
ptn=6    name='boot'    flags=0x0    offset=0x30    size=0x18
ptn=7    name='swdb'    flags=0x40    offset=0x48    size=0x30
ptn=8    name='backup'    flags=0x40    offset=0x78    size=0x140
ptn=9    name='cache'    flags=0x40    offset=0x1b8    size=0x140
ptn=10    name='system'    flags=0x40    offset=0x2f8    size=0x1e0
ptn=11    name='data'    flags=0x80    offset=0x4d8    size=0xb28

Press 1b Key
Hit Esc or Tab key to enter console mode or rescue linux:  0 
Start Boot Setup ... 
[ERR] rtk_plat_prepare_fw_image_from_eMMC:Signature() error!
Enter console mode, disable watchdog ...

Realtek> 
 

Link to post
Share on other sites

Hi @Igor

 

I have a Banana Pi W3 board which now has kernel code for supporting the two Ethernet ports (actually three, one not wired).

 

    https://github.com/BPI-SINOVOIP/BPI-W2-bsp/tree/rtk1296_ow

 

I am wanting to know if there are any instructions or help available on how to go about :-

 

a) supporting the BPI W2 A53 CPU

b) integrating the Realtech 1296 Support and possibly all th Realtech chipsets, on the following links

 

https://github.com/BPI-SINOVOIP/BPI-W2-bsp/tree/rtk1296_ow/linux-rtk/drivers/soc/realtek

https://github.com/BPI-SINOVOIP/BPI-W2-bsp/tree/rtk1296_ow/linux-rtk/drivers/soc/realtek/rtd129x

 

I am a pretty confident programmer but have not looked at the Linux Kernel properly since v2.4 days and do not know the Armbian framework other than top level image building.

 

 

Link to post
Share on other sites
1 hour ago, AaronNGray said:

I am wanting to know if there are any instructions

 

If initial board support package (boot loader + kernel + toolchain) is on some decent level, check those examples:

https://github.com/armbian/build/pull/2126

https://github.com/armbian/build/pull/2032

 

1 hour ago, AaronNGray said:

integrating the Realtech 1296 Support and possibly all th Realtech chipsets, on the following links


HW integration and support is very expensive and we can't afford to sponsor maintenance and support more hardware without expanding team / hire people. Maintaining the code is not exactly something people would stay in the line to get that. Development, playing with toys, contributing here and there, existing, but not near enough to cover everything. Nevertheless, there are people that might be interested to join your efforts ... which is the purpose of this forum. Officially, basic conditions are still at least those:

 

1 hour ago, AaronNGray said:

I am a pretty confident programmer but have not looked at the Linux Kernel properly since v2.4 days and do not know the Armbian framework other than top level image building.


Kernel tinkering experiences are surely helpful but IHMO in this particular case not enough. (I am not dealing with this particular hardware so I could be wrong) Boot loaders are custom pcs of poorly maintained but very important part of the whole - for each board. Also kernel changed in the term how hardware is configured since the old days ...

 

Armbian is "just" a tool that helps you put all those things together. Like Yocto or Buildroot, just from a different perspective.

Link to post
Share on other sites

Okay I understand the background issues now so I have either got to wait till SINOVOIP's drivers get into mainline Linux source (which I dont know if that will ever happen judging on what I have seen), or go about integrating the drivers at my end into Armbian, then testing, possibly getting other BananaPi W2 users testing, and then do pull request to you and maybe to appropriate kernel driver maintainer(s).

 

Is there any documentation on the internals to the Armbian framework at all ?

 

Oh I had done an issue following your guidlines I was pointer at before the forum topics were merged :- https://github.com/armbian/build/issues/2152

 

Link to post
Share on other sites
7 hours ago, AaronNGray said:

Is there any documentation on the internals to the Armbian framework at all ?


Docs -> Building Armbian

https://docs.armbian.com/Developer-Guide_Build-Preparation/

 

  • Building Armbian
  • Building with Vagrant
  • Building with Docker
  • Build Options
  • User Configurations
  • FEL boot

 

is the best we got  + already exposed examples. You can find more under https://github.com/armbian/build/pulls?q=is%3Apr+is%3Aclosed

 

7 hours ago, AaronNGray said:

Okay I understand the background issues now so I have either got to wait till SINOVOIP's drivers get into mainline Linux source


Mainlining is a serious business and can easily takes years to complete (but almost no board gets complete support). There are a few companies that provide such services (with help of community) and vendors have to pay hard cash if they choose to go that path. More complicated and exotic device, more work ... Majority can't afford (or would not gamble) and if community around is too small, all you get is old private development kernel drop.

Link to post
Share on other sites

So there is no way to specify an external kernel like the one in the SINOVoIP BPi W2, rather we have to create patch(es) for the Armbian patch directory ?

 

I have checked the mainline kernel, kernel mailing list, and found this maining list http://lists.infradead.org/pipermail/linux-realtek-soc/ its only three months old and it looks like all there is now is boot, and probing support so far.

 

So ot goes down to how long its going to take to wait for support from RealTek or whether I can make up patches from the BPi BSP Kernel code for an Armbian build in the meantime.

Link to post
Share on other sites
43 minutes ago, AaronNGray said:

So there is no way to specify an external kernel like the one in the SINOVoIP BPi W2


Kernels that are not part of the mainline are usually heavily derived from and can contain many incompatible code. Probably it is possible to bring the kernel in and probably somebody already tried that. I would do a wide research before thinking about any coding / porting.
 

45 minutes ago, AaronNGray said:

and it looks like all there is now is boot


Probably something is, but is it useful?

 

49 minutes ago, AaronNGray said:

So it goes down to how long its going to take to wait for support from RealTek


You can see how much it was for past few years. It is probably just you. Like I said - there are other people in community that might want to help out when they see things moving.

Link to post
Share on other sites
3 hours ago, Igor said:


Kernels that are not part of the mainline are usually heavily derived from and can contain many incompatible code. Probably it is possible to bring the kernel in and probably somebody already tried that. I would do a wide research before thinking about any coding / porting.
 

OKay I think I will parallel researching further, with preparing patches and either doing a base level diff's without the prepatched code to see what elese there is in the SINOVoIP code, and searching back through the commits if necessary.

Quote


Probably something is, but is it useful?

I will check whats there against the SINOVoIP code. Not got down to that level yet.

Quote


You can see how much it was for past few years. It is probably just you. Like I said - there are other people in community that might want to help out when they see things moving.

Yeah, I am thinking if I can get the exising BSP Realtek Driver code there and working in Armbian, it will stand as a stop gap until Realtek get there drivers and kernel support there in the Linux Kernel proper.

Link to post
Share on other sites

 

Ladies and gentlemen, I managed to boot from SPI on my Zidoo X8:

        Banana Pi BPI-W2(SPI ROM:20180907)

C1:80000000
C2
?
C3h
SD card is not detected !!
BPI: try get_builtin_hwsetting !!

hwsetting size: 00000000
C4
BPI: try bootcode_from_emmc !! 
        BPI: support boot from emmc
switch frequency to 0x00000046
frequency divider is 0x00000080
switch frequency to 0x00000046
frequency divider is 0x00000004
switch to SDR 8 bit
switch bus width to 0x00000008 bits success
Time out 
Time out 
Time out 
End bit error 

BPI: sys_boot_type:1414141490A73F71C7
        Banana Pi BPI-W2(SPI ROM:20180907)

C1:80000000
C2
?uu3-1

 

All I needed was dump from BPI-W2 SPI flash (attached) which I was asking for serveral times here :)

 

In next days, I'll try to boot Linux kernel as described here:

http://forum.banana-pi.org/t/bananapi-w2-ubuntu-18-04-new-image-release-2018-09-17/6790

bpi-w2.bin.short

Link to post
Share on other sites

Until now, I thought that dvrboot.exe.bin is SPI image which is supposed to be directly written to SPI FLASH chip.

But today I discovered it is actually a binary which should be executed on the device to program the SPI chip "in system".

We have sources for this binary here:

https://github.com/BPI-SINOVOIP/BPI-W2-bsp/blob/master/u-boot-rtk/examples/flash_writer/dvrmain.c#L2101

so my next step for creating custom SPI with bootloader for my zidoo X8 is to dissect the locations and create a script to assemble SPI image from all the components which could be directly written to SPI FLASH chip.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...