Support for Easybox 904 LTE

I can confirm that the NAND-flash does not correct works.

I use a Telefon support build with the addidional bootargs: mem=116M phym=128M vpe1_load_addr=0x87e00000 vpe1_mem=2M maxvpes=1 maxtcs=1 nosmp
The problem are:
If i want to change/modifie some bigger file that exist from beginning then the Router hangs without an end, but normaly the watchdog reboot the router after 30sek.
Examples:
chmod 0777 /lib/libc.so # 602000 KiB Router crashes
chmod 0777 /usr/sbin/pppd # 170528 KiB Router crashes
chmod 0755 /lib/firmware/xcpe_581816_580B11.bin # 898952 KiB Router crashes
chmod 0777 /usr/lib/libiptext.so # 60656 KiB Router crashes not

I found the reason:
It works well without the display-driver, when i install the kernelmodules again the fail happen again.

I was not know that exist a connection between display and flash, but later i read this: https://github.com/Quallenauge/lede-feeds-easybox904/commit/1fea28f8156344a6f7609f3e4becc0b969943d93
But i have not the know how to fix this Error. @Developers please help

Update:
OK the reason looks these commit: https://github.com/Quallenauge/lede-feeds-easybox904/commit/1fea28f8156344a6f7609f3e4becc0b969943d93
because i looks working witout it.
(I test only if /dev/fb0 exist and if i can change bigger files)

Update:
So i have mix the old and the new and it looks that i have fix the NAND-flash blocking on Telphon support use.
( write_reg_nolock(..) for SMP use and the old write_reg(..) for nosmp.
But without knowing what i am doing. The old developer had certainly thought something about it.
It will be cool if he can explain it.
I have put all driver together that missed in Openwrt for this device. (touchpat, wifi, and display)
https://github.com/Plonkbong/openwrt-feeds-easybox904-driver.git

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

Can somewhere explain why devmem needed at wlan driver and how can be removed.
Because when the device are upstream,
i think the images will be build by a the "default" xrx200 device which will build all images (is this correct)
And here no devmem are enable right ?
I thing it is not usefull to have an image that can not be used with the wifidriver.

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

@QAuge i have do an pulrequest for adding Easybox-904xDSL by using the single commits as you say.
I split them into main and uboot

1 Like

Any news ongoing with this situation?

My github account was short time flagged, but now it is public.
PR to openwrt are here: main and uboot
The pullrequests needs reviewer.
In my personal opinium and with my small know how in programming, it is OK.
the https://github.com/Plonkbong/create-openwrt-easybox904x-patches does not work correct / need work

General, all works without ISDN, but i have not test the stability longer 24h.
The default build at the moment is with SMP support, but without Telephon (VMMC) support.
But if the pullrequest will be accepted, it is nessasary to build your own image too, if you want all working drivers.

  • For the display the build must contain: Videosupport and the kmod-fb-tft module
    for this it is usefull to install this PR: https://github.com/openwrt/openwrt/pull/1885 because if not the build stops and need Kernelparameter.
  • For Wifi it need devmem support inside kernel and busybox
    ( can somewhere eplain why ? I guess that values inside the binary FW for the ralink-wifi will be changed in RAM ? )

For building you can use https://github.com/Quallenauge/Easybox-904-XDSL
or the both publish PR main and uboot

For the Wifi, touchpad and display the drivers are here: https://github.com/Plonkbong/openwrt-feeds-easybox904-driver
These Drivers are not in the PR because they need work, but they are working (read this thread about it).

For the more ore less required userspace packages specialy "lcd4linux" use this feed: https://github.com/Plonkbong/openwrt-feeds-easybox904-minpkgset

For telefon support change the bootargs manuelly before build or better use these patches:
main-split-in-SMP-VPE.patch and uboot-split-in-SMP-VPE.patch
These patches split into two images one with SMP and one with Telefon support, the good thing are if you do that, the Imagebuilder contain both variants and you can later after build use them to create an changed image with or witout SMP/Telefon support.

The code for xrx200 devices are not perfect in generell for more speed read here:


and here:

In the last threads you can find kernel patches for speed up, if you use them you must replace the default 4027-* patch by 4027-NET-MIPS-lantiq-support-fixed-link-incl-patch-904.patch
And if you want the 34kc arch instead the default 24kc Arch use this

I have used this diffconfig
note the the bootloader in this config make a higher CPU and RAM speed them normal (CONFIG_UBOOT_CONFIG_VR9_CPU_600M_RAM_300M=y) and it is untested.

for building i use this scripts:
in the first step i make an minimal build from source without extra packages:

#!/bin/sh

# prepare build look i these nessasary
git config --global user.email "you@example.com"; git config --global user.name "Your Name" # for merging into your local branch
cd /opt/build # your build directory
rm -r ./openwrt # delete openwrt directory if exist (not nessasary if not exist)



# clone openwrt source and create a new branch called: eb904x
git clone https://github.com/openwrt/openwrt.git
cd openwrt
git checkout -b eb904x


# install main pullrequest in branch eb904x 
git fetch origin pull/2060/head:pr001-eb904x
git rebase eb904x pr001-eb904x
git checkout eb904x
git merge pr001-eb904x


# install uboot pullrequest in branch eb904x 
git fetch origin pull/2061/head:pr002-eb904x_uboot
git rebase eb904x pr002-eb904x_uboot
git checkout eb904x
git merge pr002-eb904x_uboot


# add missed some extra kernelconfigparameter for videosupport
# without it the build stops and ask for the parameter
git fetch origin pull/1885/head:pullreq
git rebase eb904x pullreq
git checkout eb904x
git merge pullreq


# download and install split-into a SMP and VPE version patches
mkdir ./dl
rm -r ./dl; ln -sv /mnt/mapper/sda3/openwrt-source-dl dl # if you collect the whole openwrtsource like me inside /mnt/mapper/sda3/openwrt-source-dl use this line
cd ./dl
wget -O main-split-in-SMP-VPE.patch http://sprunge.us/vD2n7V
wget -O uboot-split-in-SMP-VPE.patch http://sprunge.us/ucLY0J
cd ..
git am < ./dl/main-split-in-SMP-VPE.patch
git am < ./dl/uboot-split-in-SMP-VPE.patch


# download and install patches for increase the ethernet speed
cd ./target/linux/lantiq/patches-4.14
wget -O 0901-add-icu-smp-support.patch 			https://pastebin.com/raw/pePncxSF
wget -O 0902-enable-external-irqs-for-second-vpe.patch 	https://pastebin.com/raw/ESKnmYbd
wget -O 0903-add-icu1-node-for-smp.patch 		https://pastebin.com/raw/0AvX3UF4

wget -O 0904-backport-vanilla-eth-driver.patch 		https://pastebin.com/raw/WYrJGw0e
wget -O 0905-increase-dma-descriptors.patch  		https://pastebin.com/raw/eNFjmidY
wget -O 0906-increase-dma-burst-size.patch 		https://pastebin.com/raw/M5Hei0FT

rm -v 4027-*
wget -O 4027-NET-MIPS-lantiq-support-fixed-link-incl-patch-904.patch http://sprunge.us/EQ5RWn
cd ../../../..


# this patch uses the 34Kc architecture for buildind instead of the defauld and older 24kc (not usefull because the packages are all 24kc)
#cd ./dl
#wget -O xrx200-use-34kc.patch http://sprunge.us/nINdvI
#cd ..
#patch -p1 < ./dl/xrx200-use-34kc.patch



# Change to your device: 
#	Target System = Lantiq / Suptarget = XRX200 / Target Profile = Easybox 904
# for later Display support: 
#	Global build settings  ---> / [*] Select all target specific packages by default
#	Global build settings  ---> / [*] Show packages that require graphics support (local or remote)
# for later Wifi support you need devmem support: 
# 	Global build settings  ---> / Kernel build options  ---> / [*] /dev/mem virtual device support
#	Base system  ---> / <*> busybox / [*] Customize busybox options / Miscellaneous Utilities  ---> / [*] devmem
# enable the easybox bootloader
# 	Boot Loaders  ---> / [*] u-boot-easybox904	
# eanable the SDK and the image builder
#	[*] Build the OpenWrt SDK (NEW)
# 	[*] Build the OpenWrt Image Builder
make menuconfig
make -j8 V=1 IGNORE_ERRORS=1 || make V=s IGNORE_ERRORS=1

I the next step i build the required packages that are not in openwrt for this device, with the SDK:

#!/bin/sh

cd /opt/build # my build directory change if needed

rm -rf ./owrtsdk
tar -xf $(find ./openwrt/bin/targets/lantiq/xrx200/openwrt-sdk-*.tar.xz)
mv -v $(find ./openwrt-sdk-* -type d -maxdepth 0) ./owrtsdk
cd ./owrtsdk
mkdir ./dl
rm -r ./dl; ln -sv /mnt/mapper/sda3/openwrt-source-dl dl # if you collect the whole openwrtsource like me inside /mnt/mapper/sda3/openwrt-source-dl use this line

cat ./feeds.conf.default |  grep -E -v "src-git[[:blank:]]*base.*" > ./feeds.conf

# If you do not have /opt/build/openwrt change it or use this line instead but note it is better to use same openwrt source that you have used for source build. 
#echo "src-git base https://github.com/openwrt/openwrt.git"
echo "src-git base file:///opt/build/openwrt" >> ./feeds.conf

echo "src-git eb904_driver https://github.com/Plonkbong/openwrt-feeds-easybox904-driver.git" >> ./feeds.conf
echo "src-git eb904_pkg    https://github.com/Plonkbong/openwrt-feeds-easybox904-minpkgset.git" >> ./feeds.conf

./scripts/feeds update -a

./scripts/feeds install -p eb904_driver fbtft
./scripts/feeds install -p eb904_driver touchpad
./scripts/feeds install -p eb904_driver ralink_bin
./scripts/feeds install -p eb904_driver ralink_inic

./scripts/feeds install -p eb904_pkg freetype
./scripts/feeds install -p eb904_pkg serdisplib
./scripts/feeds install -p eb904_pkg con2fbmap
./scripts/feeds install -p eb904_pkg lcd4linux-eb904
./scripts/feeds install -p eb904_pkg lcdcontroller

make -j2 IGNORE_ERRORS=1 V=1 || make -j1 IGNORE_ERRORS=1 V=s

The result are here:
eb904x-build_from_source-withspeeduppatch.tar.xz
shasum256 = 3001ac786e87f4fe4df1cd521756415a9569fbe73d4a34ac7b5aadef9f775d0e
eb904x-build_from_sdk.tar.xz
shasum256 = e6ecc24ced5b395e51ab5d39ca66047d4baec2563d4a9d043e325fe25e8f0878

2 Likes

I can explain. On weekend. Currently haven't time.

1 Like

@kovz It will be great to find a solution for the required devmem
If the pullrequest accept, it will not much help because the standart kernel are without devmem and it will be required to make a selfbuild too.

1 Like

@Plonk34 Sorry for this delay.
First of all I have to say, that all this devmem calls just a configuring for internal Ethernet switch MAC_5 port. Basing on previous investigation, there is a description of this setup https://github.com/Quallenauge/ralink_inic/blob/feature/lede_integration/Readme . It sets port 5 of internal switch to RGMII mode with clock 125MHz, 1G full duplex connected to external PHY wth addr 5 on mdio bus. Physically it connected to rt3883 with fake mdio address. Currently x200 ethernet driver support all this settings out of the box with fixed link phy specified as phy. Only one thing didn't exist in the driver - setting PCDU_5. We can find description for this register in original sources here https://github.com/uwehermann/easybox-904-xdsl-firmware/blob/master/linux/linux-2.6.32.32/include/switch_api/ifxmips_sw_reg.h
As we can see this register is responsible for Clock Delay settings. This means, that we have to add additional delay parameters to device tree and handle them in the driver.
May be this description is little bit muddied, please, do not hesitate and ask for more detailed description.

1 Like

Thanks @kovz for your reply,
I have less time too, for this reason i do a short look only,
but i understand that means devmem is not required if i implement the oldcode to the ifxmips_sw_reg.h
Or if it possible the oldcode into to the driver ?
But from where did you know the offset adresses for the values ?

Hallo everyone,
i'm very new to this. But try to setup a good openwrt for my easybox 904 xdsl.
I have 2 problems at the moment after ínstall openwrt / luci using binarys (e.g. https://app.box.com/s/hvqg535dnubt4r2ontpmtodpvt6ydf00/folder/62488052684):
1.) I can't find the "Advanced Settings" tab to setup my country code or something else, to get wifi work (at the moment '00' and signal power is 0)
2.) with the ssh access, i have no command flash_eraseall, just flash_erase. Is this normal? I can use this as well to flash the uboot?
Thank you in advanced,
Mark

On the EB904, Wifi is "external" to the system and a bit of a black box. One can send commands but it won't accept all (documented) commands, and if it does it returns hardly any confirmations or status information. That's probably why LuCI cannot really show its status.

I dabbled with the EB904's Wifi some time ago, so my memory is a bit hazy. But I seem to remember that it doesn't accept all of the commands it should, "country code" being one of them. Also, it seemed like it would accept certain commands only once and never after.

I'm almost sure one could make the LuCI interface show if not the current status then at least the current configuration and allow to modify it, but noone took the time or made the effort to do so yet.

And is there an alternative way, to configure wlan on the eb904?

Or what do you recommend?

I'm also still interested in future development on this device.

What can we do to solve the issues?

Actually I'm still confused how to come to a working Box with VVDSL support, working (fast) wifi and fast switching speed between wan, lan and wifi.

Thanks @Plonk34, @kovz and @QAuge for their investigation and hard work you already put into this devil device.

I would really love to understand these whole problems with so many different devices.

Unfortunately it seems actually an unrealistic dreaming to get one fully working device with OpenWRT.

  • Even my recommended BT Hub 5A has still problems with high throughput in wifi and it's a mess to update via serial always the box.

So I don't know if this whole openwrt world is not slowly dieing because we can't get through the important (performance) doors with any device.

I would love to give more to this community than complaining within the last month, but I unfortunately can't really debug and compile whole images. I can just use the chef online builder and put things together and try out. Also soldering is OK, but when it comes to hardware acceleration implementation things in source code I can't help and it's always a hustle to find any solution for such problems instead of using somehow the original source for it...

In the meantime usually people give up and buy a FritzBox and are happy...

The performance is roughly similar between all VRX2xx devices, aside from the decision of enabling FXS ports (and thereby sacrificing a mips core to them) or retaining SMP support. So if your BT Home Hub 5 Type A isn't fast enough, the Easybox 904 xDSL won't be either (given that it has FXS ports, it will be considerably slower (55-60 MBit/s at most) - and its WLAN isn't as good as on the BTHub5 either). With the advent of super vectoring (profile 35b), the days of VRX2xx devices are numbered anyways (GRX3xx/ GRX550/ GRX750, which would support super vectoring, aren't supported by OpenWrt yet).

Unfortunately there is a big problem with drivers. I have found inic driver absolutely spontaneous! There is no datasheet for lantiq IC and most important drivers is closed. Currently I'm trying to bring up LTE version. It looks more simple than xDSL version, but still has a lot of problems. And both versions is outdated due to luck of WiFi ac standard support.

Of course, you can edit the /etc/config/wireless config file directly through the shell.

Somebody would probably have a deeper look why LuCI doesn't pick up on the settings. I reckon it's a minor thing why it currently fails to do so. As for the fact that it doesn't display the current status, I'm afraid that will not happen unless someone reverse engineers what the original firmware uses to do it. I distinctly remember that with the current means I couldn't get any status information no matter what I tried.

I have never used luci no idea if it works.
Did you mean "at the moment '00' and signal power is 0" in luci

Modifie the /etc/config/wireless via SSH and reboot the wifi via: /etc/init.d/rt3883 boot
see the /etc/init.d/rt3883 for single commands.
Some values can be change with the old iwconfig and iwpriv commands.
@kovs should correct me, but he background are it based on a very old driver time before using the default nl80211 connection of the linuxkernel.

yes it is normal flash_eraseall do not exist anymore.
use:

flash_erase /dev/mtd0 0x0 0x2
nandwrite -p /dev/mtd0 u-boot.lq

instead

The combination of @pc2005 patches



and
software flow offloading
brings 88Mbit/s from 94Mbit/s VDSL speed. (no SMP support, i use the FXS ports)

At the moment it is the only solution for VVDSL (up to profile 30a) and Telefon support i can not see that there are somthing change in the next future.
An other thing are these devices second hand are really cheap in Germany.

I do it long time too but i more and more understand why openwrt official support only wifi and ethernet.
Every time when i make an build somthing else does not correct work

At the moment the biggest problem are SQM (using the tc command) in combination with the Wifi driver reboot the devices.
(see here: SQM reboot my Router (Easybox 904xDSL))

@Plonk34 thanks for your information about the rt3884 driver.

What I don't understand is on the device is an Openwrt Backfire previous version originally and it worked quite OK, why is it than so difficult with newer versions?

@ suppenkasper0815

No idea i have no investigate it, i thing @kovs have more know how.

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

@all
The kernelversion for the lantiq devices was changed from 4.14.x to 4.19.x
I modifie the pullrequest for it. (It was was simple the most kernelpatches can be leave)
I do only a short test and the Devices works in general.

The bad new is that the wifi driver does not work anymore.
First building is not possible because init_timer(..) function does not exist in 4.19
I replace by setup_timer(..)

my modified ./comm/raconfig.c
https://pastebin.com/tHbuBuNy
and the resulting patch
https://pastebin.com/JuKQksKx

Them building are possible but it reboot the device with:
On first try (the first try differ always from the rest)

root@OpenWrt:~# ./rt3883 boot
Insmod with MAC1=4c:09:d4:15:10:54 and MAC2=4c:09:d4:15:10:56
[  354.149085] Warnning!! syncmiimac is foreced to 0 in dual concurrent mode.
[  354.154665] RT3883iNIC: 802.11n WLAN MII driver v2.4.0.6 (Feb. 09, 2011)
[  354.161435] eth0.3: Master at 0x0, 00:11:22:33:44:55
[  354.166326] Use default profile path.
[  354.169907] -----> mii_hardware_reset
[  354.183638] -----> mii_hardware_reset
[  354.185921] Update MAC(0)=4c:09:d4:15:10:54
[  354.190080] ============= Init Thread ===================
[  354.198371] RacfgTaskThread pid = 2076
[  354.200942] RacfgBacklogThread pid = 2077
[  354.206381] wl000: Ralink iNIC at 0x0, 4c:09:d4:15:10:54
[  354.213840] Ignored command_type: 1, command_id: 1 
[  354.224184] Update MAC(0)=4c:09:d4:15:10:56
[  354.226971] ============= Init Thread ===================
[  354.269925] RacfgTaskThread pid = 2082
[  354.273989] RacfgBacklogThread pid = 2084
[  354.278184] wl010: Ralink iNIC at 0x0, 4c:09:d4:15:10:56
[  354.316261] iNIC Open wl000
[  354.317759] -----> mii_hardware_reset
[  355.349509] -----> mii_hardware_reset
[  355.351738] Op mode = 1
[  355.354252] ConcurrentObj.CardCount=0
[  355.357867] Read profile[0]
[  355.363549] BssidNum=2
[  355.366144] Read profile[1]
[  355.368938] BssidNum=2
[  355.371508] rlk_inic_mbss_init (pAd->RaCfgObj.BssidNum=2)
[  355.375549] rlk_inic_mbss_init --->
[  355.379053] Register MBSSID IF (wl001)
[  355.384233] register_netdev done
[  355.386112] rlk_inic_mbss_init <---
[  355.389548] ConcurrentObj.CardCount=0 init_flag=0
[  355.394237] Wait for boot done...
[  355.397545] Call RaCfgWaitSyncRsp
[  355.402357] RACFG_CMD_BOOT_NOTIFY
[  355.404306] Firmware path iNIC/RT3883/iNIC_ap.bin
[  355.409024] Profile[0] path iNIC/RT3883/iNIC_ap.dat, read path iNIC/RT3883/iNIC_ap.dat
[  355.416904] EEPROM[0] path iNIC/RT3883/iNIC_e2p.bin, read path iNIC/RT3883/iNIC_e2p.bin
[  355.424905] Profile[1] path iNIC/RT3883/iNIC_ap1.dat, read path iNIC/RT3883/iNIC_ap1.dat
[  355.432998] EEPROM[1] path iNIC/RT3883/iNIC_e2p1.bin, read path iNIC/RT3883/iNIC_e2p1.bin
[  355.441196] Request file: iNIC/RT3883/iNIC_ap.bin
[  355.710247] Request file: iNIC/RT3883/iNIC_ap.dat
[  355.713977] Request file: iNIC/RT3883/iNIC_e2p.bin
[  355.719698] Request file: iNIC/RT3883/iNIC_ap1.dat
[  355.723805] Request file: iNIC/RT3883/iNIC_e2p1.bin
[  355.729384] Upload Profile 1024 bytes from file, 0 from extra...

> here it have no reaction if after 30 seconds ( reboot by watchdog ? )

on the 2, 3 n times:

...
[  159.826860] Request file: iNIC/RT3883/iNIC_ap1.dat
[  159.831331] Request file: iNIC/RT3883/iNIC_e2p1.bin
[  159.836676] Upload Profile 1024 bytes from file, 0 from extra...
[  159.841624] Unhandled kernel unaligned access[#1]:
[  159.846198] CPU: 0 PID: 1939 Comm: RaCfg Task Tainted: G         C        4.19.56 #0
[  159.853933] $ 0   : 00000000 00000001 80736360 00000001
[  159.859154] $ 4   : 80d2c9c9 86779bd4 861204a0 00000000
[  159.864376] $ 8   : 00000001 50415053 0a575041 50534b33
[  159.869598] $12   : 3d0a5750 37800000 0000013d 4150534b
[  159.874821] $16   : 00000001 86120644 806dbfe4 80736360
[  159.880043] $20   : 00040000 86779bd4 80d2c9c9 00000001
[  159.885266] $24   : 00000000 00000000                  
[  159.890488] $28   : 86778000 86779b70 00000000 80096fc4
[  159.895711] Hi    : 00000053
[  159.898584] Lo    : a8f5c3de
[  159.901476] epc   : 8054fa80 _raw_spin_lock_irqsave+0x1c/0x64
[  159.907225] ra    : 80096fc4 lock_timer_base+0x6c/0xbc
[  159.912336] Status: 1100ff02	KERNEL EXL 
[  159.916254] Cause : 00800010 (ExcCode 04)
[  159.920257] BadVA : 80d2c9c9
[  159.923130] PrId  : 00019556 (MIPS 34Kc)
[  159.927045] Modules linked in: rt3883_iNIC iptable_nat ipt_MASQUERADE xt_state xt_nat xt_conntrack xt_REDIRECT xt_FLOWOFFLOAD xt_CT pppoe nf_nat_ipv4 nf_nat nf_flow_table_hw nf_flow_table nf_conntrack_rtcache nf_conntrack ipt_REJECT xt_time xt_tcpudp xt_multiport xt_mark xt_mac xt_limit xt_comment xt_TCPMSS xt_LOG pppox ppp_async nf_reject_ipv4 nf_log_ipv4 nf_defrag_ipv6 nf_defrag_ipv4 ltq_deu_vr9 iptable_mangle iptable_filter ip_tables drv_vmmc crc_ccitt drv_dsl_cpe_api drv_mei_cpe nf_log_ipv6 nf_log_common ip6table_mangle ip6table_filter ip6_tables ip6t_REJECT x_tables nf_reject_ipv6 pppoatm ppp_generic slhc br2684 atm drv_tapi drv_ifxos fb_ili9341_eb904 fbtft(C) fb_sys_fops backlight sysimgblt sysfillrect syscopyarea fb font dwc2 gpio_button_hotplug
[  159.993819] Process RaCfg Task (pid: 1939, threadinfo=bb2a0ea3, task=7c6cd506, tls=00000000)
[  160.002247] Stack : 00000000 00000001 00000000 8007ea18 00000000 ffffffe5 861204a0 80096fc4
[  160.010602]         86118ca0 86779bfc 8600f380 8600f100 86120644 8600f100 867c9bbc ffff780a
[  160.018958]         86102f84 80660000 80840000 800979c4 8600f380 8600f100 86118ca0 86779bfc
[  160.027314]         86102f84 8007f0d4 8600f380 8600f100 867c9bbc 861204a0 86102f84 80660000
[  160.035670]         80840000 86105f60 86042b94 00000400 00000000 00000000 00000000 00000001
[  160.044026]         ...
[  160.046464] Call Trace:
[  160.048911] [<8054fa80>] _raw_spin_lock_irqsave+0x1c/0x64
[  160.054314] [<80096fc4>] lock_timer_base+0x6c/0xbc
[  160.059095] [<800979c4>] mod_timer+0x94/0x1b4
[  160.063470] [<86105f60>] _append_extra_profile2+0xde4/0x1820 [rt3883_iNIC]
[  160.070325] Code: 32100001  000000c0  24030001 <c0850000> 14a00005  00000000  00600825  e0810000  1020fffa 
[  160.080060] 
[  160.081712] ---[ end trace 3ebc1fc412e9a498 ]---
[  160.089508] Kernel panic - not syncing: Fatal exception
[  160.095159] Rebooting in 3 seconds..

ROM VER: 1.1.4
CFG 06
...

without using of busybox memdev:

root@OpenWrt:~# ./rt3883 boot
Insmod with MAC1=4c:09:d4:15:10:54 and MAC2=4c:09:d4:15:10:56
[  113.371392] Warnning!! syncmiimac is foreced to 0 in dual concurrent mode.
[  113.376939] RT3883iNIC: 802.11n WLAN MII driver v2.4.0.6 (Feb. 09, 2011)
[  113.383726] eth0.3: Master at 0x0, 00:11:22:33:44:55
[  113.388620] Use default profile path.
[  113.392200] -----> mii_hardware_reset
[  113.405958] -----> mii_hardware_reset
[  113.408252] Update MAC(0)=4c:09:d4:15:10:54
[  113.412399] ============= Init Thread ===================
[  113.419825] RacfgTaskThread pid = 1888
[  113.422378] RacfgBacklogThread pid = 1889
[  113.427818] wl000: Ralink iNIC at 0x0, 4c:09:d4:15:10:54
[  113.442034] Update MAC(0)=4c:09:d4:15:10:56
[  113.444850] ============= Init Thread ===================
[  113.480983] RacfgTaskThread pid = 1893
[  113.487750] RacfgBacklogThread pid = 1896
[  113.491972] wl010: Ralink iNIC at 0x0, 4c:09:d4:15:10:56
[  113.524369] iNIC Open wl000
[  113.525729] -----> mii_hardware_reset
[  114.563312] -----> mii_hardware_reset
[  114.565595] Op mode = 1
[  114.568058] ConcurrentObj.CardCount=0
[  114.571674] Read profile[0]
[  114.577347] BssidNum=2
[  114.579935] Read profile[1]
[  114.582724] BssidNum=2
[  114.585286] rlk_inic_mbss_init (pAd->RaCfgObj.BssidNum=2)
[  114.589328] rlk_inic_mbss_init --->
[  114.592828] Register MBSSID IF (wl001)
[  114.597983] register_netdev done
[  114.599885] rlk_inic_mbss_init <---
[  114.603307] ConcurrentObj.CardCount=0 init_flag=0
[  114.607988] Wait for boot done...
[  114.611293] Call RaCfgWaitSyncRsp


[  154.657588] timeout(40 secs): cmd=0000 no response
[  154.660946] ERROR! can't get target's MAC address, boot fail.
> no response

Have someone any ideas ?
What is the meaning of:

[  159.907225] ra    : 80096fc4 lock_timer_base+0x6c/0xbc
[  159.912336] Status: 1100ff02	KERNEL EXL 
[  159.916254] Cause : 00800010 (ExcCode 04)

Hi.

I followed your patches (thanks =) ), but isn't the timer_setup() missing at
https://pastebin.com/tHbuBuNy Line: 1266
?

Ahh @QAuge great that you are here :smiley:

Hmm it should be inside.
raconfig.c = https://pastebin.com/g91LuYVL
change-raconfig.c-for-linux4.19.patch = https://pastebin.com/kiqY8xrL
I try again with an nealy eqal result.

root@OpenWrt:~# ./rt3883 boot
Insmod with MAC1=4c:09:d4:15:10:54 and MAC2=4c:09:d4:15:10:56
[  123.226683] Warnning!! syncmiimac is foreced to 0 in dual concurrent mode.
[  123.232262] RT3883iNIC: 802.11n WLAN MII driver v2.4.0.6 (Feb. 09, 2011)
[  123.239020] eth0.3: Master at 0x0, 00:11:22:33:44:55
[  123.243915] Use default profile path.
[  123.247526] -----> mii_hardware_reset
[  123.261251] -----> mii_hardware_reset
[  123.263480] Update MAC(0)=4c:09:d4:15:10:54
[  123.267697] ============= Init Thread ===================
[  123.275024] RacfgTaskThread pid = 1878
[  123.277918] RacfgBacklogThread pid = 1879
[  123.282906] wl000: Ralink iNIC at 0x0, 4c:09:d4:15:10:54
[  123.291403] Ignored command_type: 1, command_id: 1 
[  123.300785] Update MAC(0)=4c:09:d4:15:10:56
[  123.303521] ============= Init Thread ===================
[  123.344161] RacfgTaskThread pid = 1884
[  123.348401] RacfgBacklogThread pid = 1886
[  123.352608] wl010: Ralink iNIC at 0x0, 4c:09:d4:15:10:56
[  123.391126] iNIC Open wl000
[  123.392612] -----> mii_hardware_reset
[  124.424067] -----> mii_hardware_reset
[  124.426299] Op mode = 1
[  124.428817] ConcurrentObj.CardCount=0
[  124.432428] Read profile[0]
[  124.438096] BssidNum=2
[  124.440678] Read profile[1]
[  124.443469] BssidNum=2
[  124.446050] rlk_inic_mbss_init (pAd->RaCfgObj.BssidNum=2)
[  124.450091] rlk_inic_mbss_init --->
[  124.453589] Register MBSSID IF (wl001)
[  124.458783] register_netdev done
[  124.460662] rlk_inic_mbss_init <---
[  124.464098] ConcurrentObj.CardCount=0 init_flag=0
[  124.468790] Wait for boot done...
[  124.472096] Call RaCfgWaitSyncRsp
[  124.476165] RACFG_CMD_BOOT_NOTIFY
[  124.480886] Firmware path iNIC/RT3883/iNIC_ap.bin
[  124.484244] Profile[0] path iNIC/RT3883/iNIC_ap.dat, read path iNIC/RT3883/iNIC_ap.dat
[  124.492121] EEPROM[0] path iNIC/RT3883/iNIC_e2p.bin, read path iNIC/RT3883/iNIC_e2p.bin
[  124.500122] Profile[1] path iNIC/RT3883/iNIC_ap1.dat, read path iNIC/RT3883/iNIC_ap1.dat
[  124.508218] EEPROM[1] path iNIC/RT3883/iNIC_e2p1.bin, read path iNIC/RT3883/iNIC_e2p1.bin
[  124.516396] Request file: iNIC/RT3883/iNIC_ap.bin
[  124.781375] Request file: iNIC/RT3883/iNIC_ap.dat
[  124.785082] Request file: iNIC/RT3883/iNIC_e2p.bin
[  124.790914] Request file: iNIC/RT3883/iNIC_ap1.dat
[  124.795000] Request file: iNIC/RT3883/iNIC_e2p1.bin
[  124.800735] Upload Profile 1024 bytes from file, 0 from extra...
[  125.454754] RACFG_CMD_BOOT_NOTIFY
> no reaction

It happen somtimes so and so on loading the same module

...
[  693.656243] RACFG_CMD_BOOT_NOTIFY
[  693.660999] Firmware path iNIC/RT3883/iNIC_ap.bin
[  693.664359] Profile[0] path iNIC/RT3883/iNIC_ap.dat, read path iNIC/RT3883/iNIC_ap.dat
[  693.672245] EEPROM[0] path iNIC/RT3883/iNIC_e2p.bin, read path iNIC/RT3883/iNIC_e2p.bin
[  693.680237] Profile[1] path iNIC/RT3883/iNIC_ap1.dat, read path iNIC/RT3883/iNIC_ap1.dat
[  693.688333] EEPROM[1] path iNIC/RT3883/iNIC_e2p1.bin, read path iNIC/RT3883/iNIC_e2p1.bin
[  693.696512] Request file: iNIC/RT3883/iNIC_ap.bin
[  693.962679] Request file: iNIC/RT3883/iNIC_ap.dat
[  693.966381] Request file: iNIC/RT3883/iNIC_e2p.bin
[  693.972313] Request file: iNIC/RT3883/iNIC_ap1.dat
[  693.976380] Request file: iNIC/RT3883/iNIC_e2p1.bin
[  693.981699] Upload Profile 1024 bytes from file, 0 from extra...
[  693.986709] Unhandled kernel unaligned access[#1]:
[  693.991329] CPU: 0 PID: 2065 Comm: RaCfg Task Tainted: G         C        4.19.56 #0
[  693.999064] $ 0   : 00000000 00000001 80736360 00000001
[  694.004284] $ 4   : 074e4b69 8627fbd4 869284a0 00000000
[  694.009507] $ 8   : 00000001 50415053 0a575041 50534b33
[  694.014729] $12   : 3d0a5750 64000000 0000013f 4150534b
[  694.019952] $16   : 00000001 86928644 806dbfe4 80736360
[  694.025174] $20   : 00040000 8627fbd4 074e4b69 00000001
[  694.030396] $24   : 00000000 00000000                  
[  694.035619] $28   : 8627e000 8627fb70 00000000 80096fc4
[  694.040842] Hi    : 00000062
[  694.043715] Lo    : 28f5c418
[  694.046606] epc   : 8054fa80 _raw_spin_lock_irqsave+0x1c/0x64
[  694.052354] ra    : 80096fc4 lock_timer_base+0x6c/0xbc
[  694.057467] Status: 1100ff02	KERNEL EXL 
[  694.061385] Cause : 00800010 (ExcCode 04)
[  694.065387] BadVA : 074e4b69
[  694.068261] PrId  : 00019556 (MIPS 34Kc)
[  694.072175] Modules linked in: rt3883_iNIC iptable_nat ipt_MASQUERADE xt_state xt_nat xt_conntrack xt_REDIRECT xt_FLOWOFFLOAD xt_CT pppoe nf_nat_ipv4 nf_nat nf_flow_table_hw nf_flow_table nf_conntrack_rtcache nf_conntrack ipt_REJECT xt_time xt_tcpudp xt_multiport xt_mark xt_mac xt_limit xt_comment xt_TCPMSS xt_LOG pppox ppp_async nf_reject_ipv4 nf_log_ipv4 nf_defrag_ipv6 nf_defrag_ipv4 ltq_deu_vr9 iptable_mangle iptable_filter ip_tables drv_vmmc crc_ccitt drv_dsl_cpe_api drv_mei_cpe nf_log_ipv6 nf_log_common ip6table_mangle ip6table_filter ip6_tables ip6t_REJECT x_tables nf_reject_ipv6 pppoatm ppp_generic slhc br2684 atm drv_tapi drv_ifxos fb_ili9341_eb904 fbtft(C) fb_sys_fops backlight sysimgblt sysfillrect syscopyarea fb font dwc2 gpio_button_hotplug
[  694.138950] Process RaCfg Task (pid: 2065, threadinfo=0e2e251a, task=bb73c495, tls=00000000)
[  694.147378] Stack : 00000000 00000001 00000000 8007ea18 00000000 ffffffe5 869284a0 80096fc4
[  694.155733]         86278d00 8627fbfc 867ad380 86135d80 86928644 86135d80 867ddbbc 000181b1
[  694.164089]         86262fa4 80660000 80840000 800979c4 867ad380 86135d80 86278d00 8627fbfc
[  694.172445]         86262fa4 8007f0d4 867ad380 86135d80 867ddbbc 869284a0 86262fa4 80660000
[  694.180801]         80840000 86265fbc 867e3594 00000400 00000000 00000000 00000000 8086a634
[  694.189156]         ...
[  694.191595] Call Trace:
[  694.194042] [<8054fa80>] _raw_spin_lock_irqsave+0x1c/0x64
[  694.199444] [<80096fc4>] lock_timer_base+0x6c/0xbc
[  694.204226] [<800979c4>] mod_timer+0x94/0x1b4
[  694.208601] [<86265fbc>] _append_extra_profile2+0xde4/0x1820 [rt3883_iNIC]
[  694.215456] Code: 32100001  000000c0  24030001 <c0850000> 14a00005  00000000  00600825  e0810000  1020fffa 
[  694.225191] 
[  694.226862] ---[ end trace 2d0f26f69ecd14f7 ]---
[  694.234655] Kernel panic - not syncing: Fatal exception
[  694.240314] Rebooting in 3 seconds..

I littleit play with it (remove some timer stuff) and i thing the problems is somting with the linux timers.
I thing my code are wrong when i look in some other linux kernel code i found stuff that looks like:

timer_setup(&pAd->RaCfgObj.uploadTimer, upload_timeout, 0);

instead off:

timer_setup(&pAd->RaCfgObj.uploadTimer, (void *)&upload_timeout, (uintptr_t)pAd);

but when i write this i get this error:

  CC [M]  /opt/build/openwrt/build_dir/target-mips_24kc_musl/linux-lantiq_xrx200/ralink_inic-1.0.0/comm/raconfig.o
In file included from ./include/linux/workqueue.h:9:0,
                 from ./include/linux/srcu.h:34,
                 from ./include/linux/notifier.h:16,
                 from ./include/linux/memory_hotplug.h:7,
                 from ./include/linux/mmzone.h:748,
                 from ./include/linux/gfp.h:6,
                 from ./include/linux/umh.h:4,
                 from ./include/linux/kmod.h:22,
                 from ./include/linux/module.h:13,
                 from /opt/build/openwrt/build_dir/target-mips_24kc_musl/linux-lantiq_xrx200/ralink_inic-1.0.0/comm/rlk_inic.h:6,
                 from /opt/build/openwrt/build_dir/target-mips_24kc_musl/linux-lantiq_xrx200/ralink_inic-1.0.0/comm/raconfig.c:1:
/opt/build/openwrt/build_dir/target-mips_24kc_musl/linux-lantiq_xrx200/ralink_inic-1.0.0/comm/raconfig.c: In function '_upload_firmware':
./include/linux/timer.h:114:27: error: passing argument 2 of 'init_timer_key' from incompatible pointer type [-Werror=incompatible-pointer-types]
  init_timer_key((_timer), (_fn), (_flags), NULL, NULL)
                           ^
./include/linux/timer.h:130:2: note: in expansion of macro '__init_timer'
  __init_timer((timer), (callback), (flags))
  ^~~~~~~~~~~~
/opt/build/openwrt/build_dir/target-mips_24kc_musl/linux-lantiq_xrx200/ralink_inic-1.0.0/comm/raconfig.c:1274:3: note: in expansion of macro 'timer_setup'
   timer_setup(&pAd->RaCfgObj.uploadTimer, upload_timeout, 0);
   ^~~~~~~~~~~
./include/linux/timer.h:79:6: note: expected 'void (*)(struct timer_list *)' but argument is of type 'void (*)(uintptr_t) {aka void (*)(long unsigned int)}'
 void init_timer_key(struct timer_list *timer,
      ^~~~~~~~~~~~~~
cc1: some warnings being treated as errors
make[4]: *** [/opt/build/openwrt/build_dir/target-mips_24kc_musl/linux-lantiq_xrx200/ralink_inic-1.0.0/comm/raconfig.o] Error 1
make[3]: *** [_module_/opt/build/openwrt/build_dir/target-mips_24kc_musl/linux-lantiq_xrx200/ralink_inic-1.0.0] Error 2
make[3]: Leaving directory `/opt/build/openwrt/build_dir/target-mips_24kc_musl/linux-lantiq_xrx200/linux-4.19.56'
make[2]: *** [/opt/build/openwrt/build_dir/target-mips_24kc_musl/linux-lantiq_xrx200/ralink_inic-1.0.0/.built] Error 2
make[2]: Leaving directory `/opt/build/openwrt/feeds/eb904_driver/kernel/ralink_inic'
time: package/feeds/eb904_driver/ralink_inic/compile#3.37#1.23#13.51
make[1]: *** [package/feeds/eb904_driver/ralink_inic/compile] Error 2
make[1]: Leaving directory `/opt/build/openwrt'
make: *** [package/ralink_inic/compile] Error 2
 

############################################################
At removing memdev:

I read the post Support for Easybox 904 LTE
again and again but i do not really understand it.
Anyway i search in the linked source for MII_PCDU_5_REG but i found only the definition in the linked header file

#define MII_PCDU_5_REG (VR9_SWIP_TOP_BASE_ADDR + (0x41 * 4))

Is MII_PCDU_5_REG the Address 0x1e10b204 And where is it used ?
As i say i found not using in the linked source.

OK but i had have the naiv simple idea to put the devmem write part of the init script at the beginning of the Module.
Without understanding

unsigned int *iMemioaddr_MII_CFG_5 	= (void *)0x1e10b200;
writel(0x4024, iMemioaddr_MII_CFG_5);

But the kernel crash with:

[   25.284262] IPv6: ADDRCONF(NETDEV_CHANGE): br-lan: link becomes ready
[   33.773786] CPU 0 Unable to handle kernel paging request at virtual address 1e10b200, epc == 867d5eb8, ra == 867b402c
[   33.783054] Oops[#1]:
[   33.785216] CPU: 0 PID: 1497 Comm: insmod Not tainted 4.14.130 #0
[   33.791303] task: 872a72c0 task.stack: 86674000
[   33.795824] $ 0   : 00000000 00000001 1e10b200 24400000
[   33.801046] $ 4   : 00004024 1e10b200 00000001 86717380
[   33.806268] $ 8   : 00009911 00009910 00000001 00000001
[   33.811491] $12   : 00009910 86ae0400 86ae0400 00000114
[   33.816713] $16   : 80800000 00000000 867b4000 80810000
[   33.821935] $20   : 80810000 00000000 867db408 00000028
[   33.827158] $24   : 00000003 80028214                  
[   33.832380] $28   : 86674000 86675c78 80800000 867b402c
[   33.837603] Hi    : 00000000
[   33.840476] Lo    : 00000000
[   33.843465] epc   : 867d5eb8 crc32+0x568/0xf28 [rt3883_iNIC]
[   33.849085] ra    : 867b402c init_module+0x2c/0xa58 [rt3883_iNIC]
[   33.855098] Status: 1100ff03	KERNEL EXL IE 
[   33.859278] Cause : 0080000c (ExcCode 03)
[   33.863281] BadVA : 1e10b200
[   33.866154] PrId  : 00019556 (MIPS 34Kc)
[   33.870069] Modules linked in: rt3883_iNIC(+) pppoe nf_conntrack_ipv6 iptable_nat ipt_REJECT ipt_MASQUERADE xt_time xt_tcpudp xt_state xt_nat xt_multiport xt_mark xt_mac xt_limit xt_conntrack xt_comment xt_TCPMSS xt_REDIRECT xt_LOG xt_FLOWOFFLOAD xt_CT pppox ppp_async nf_reject_ipv4 nf_nat_redirect nf_nat_masquerade_ipv4 nf_conntrack_ipv4 nf_nat_ipv4 nf_nat nf_log_ipv4 nf_flow_table_hw nf_flow_table nf_defrag_ipv6 nf_defrag_ipv4 nf_conntrack_rtcache nf_conntrack ltq_deu_vr9 iptable_mangle iptable_filter ip_tables drv_vmmc crc_ccitt drv_dsl_cpe_api drv_mei_cpe nf_log_ipv6 nf_log_common ip6table_mangle ip6table_filter ip6_tables ip6t_REJECT x_tables nf_reject_ipv6 pppoatm ppp_generic slhc br2684 atm drv_tapi drv_ifxos gpio_button_hotplug
[   33.935356] Process insmod (pid: 1497, threadinfo=86674000, task=872a72c0, tls=77f1ceb8)
[   33.943443] Stack : 00000001 00000003 1e10b200 24400000 00004024 1e10b200 86514780 8007cc44
[   33.951798]         87010400 00000000 00000000 001f0041 00000001 86514780 80863220 00000000
[   33.960154]         00000000 00000000 86675cc0 001f0041 80830000 80970000 86717600 80807cc0
[   33.968510]         00000000 80830000 807ca3e8 924e750e 80800000 924e750e 867b4000 80002650
[   33.976866]         00000000 80807cc0 00000800 001f0041 00000001 867a7f00 00000800 867a7f00
[   33.985221]         ...
[   33.987662] Call Trace:
[   33.990179] [<867d5eb8>] crc32+0x568/0xf28 [rt3883_iNIC]
[   33.995569] [<867b402c>] init_module+0x2c/0xa58 [rt3883_iNIC]
[   34.001228] Code: afa2000c  8fa20008  8fa3000c <ac430000> 00000000  27bd0010  03e00008  00000000  00000000 
[   34.010899] 
[   34.012523] ---[ end trace 1c14d1d955584722 ]---
[   34.019871] Kernel panic - not syncing: Fatal exception
[   34.025156] Rebooting in 3 seconds..

ROM VER: 1.1.4

Can it happen that is not allowed what i want ?
Can it happen that a kernel module allowed to write in there own space ?

###################################################################
at SQM crashes:
And not to forget that SQM (tc) not working with the driver:

1 Like

We have to rework the timer thingy a little bit deeper. I'll have a look at it.
Completely untested, but maybe in this manner?

1 Like