New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
lantiq: add basic support for AVM FRITZ!Box 7490 #2738
Conversation
Support for LAN and Switch confirmed, xDSL untested. - usb3: WIP requires firmware loader for the Renesas-µPD720202 https://patchwork.kernel.org/patch/11329775/ - wlan: WIP see here: openwrt#2662 - dect: NOT supported - ISDN/POTS: NOT supported
Please note depends on this one: |
target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_avm_fritz7490.dts
Outdated
Show resolved
Hide resolved
poll-interval = <100>; | ||
|
||
// key "DECT" | ||
key_dect { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just "dect"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
linux,code = <KEY_PHONE>; | ||
}; | ||
// key "WLAN/WPS" | ||
key_wlan { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just "wlan". Please remove the comments, this should become clear from the labels. Instead, you should have one empty line between nodes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
|
||
leds { | ||
compatible = "gpio-leds"; | ||
// led 5 "Power/DSL" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here, no comments, empty line between nodes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
gpios = <&gpio 47 GPIO_ACTIVE_LOW>; | ||
}; | ||
// led 3 "FixedLine" | ||
led_fixedline: fixedline { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The node label (led_fixedline) is only needed when you reference it. Please remove labels where not necessary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed the labels
gpios = <&gpio 35 GPIO_ACTIVE_LOW>; | ||
}; | ||
// led 1 "Info" | ||
led_info: info { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would be "led_info_green: info_green {" then.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_avm_fritz7490.dts
Show resolved
Hide resolved
flash@4 { | ||
compatible = "jedec,spi-nor"; | ||
reg = <4>; | ||
spi-max-frequency = <10000000>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Faster possible?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will check the datasheet...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nand is Micron MT29F4G08ABADAWP
Available in 100-166 MT/s
Maybe 80000000 Hz to be on the safe side?
Not sure for reference:
amazonse_netgear_dgn1000b.dts:` spi-max-frequency = <5000000>; ar9_netgear_dgn3500.dtsi: spi-max-frequency = <20000000>; falcon_lantiq_easy98000.dtsi: spi-max-frequency = <1000000>; falcon_sflash-16m.dtsi: spi-max-frequency = <80000000>; vr9_avm_fritz3370-rev2.dtsi: spi-max-frequency = <1000000>; vr9_avm_fritz7362sl.dts: spi-max-frequency = <1000000>; vr9_buffalo_wbmr-300hpd.dts: spi-max-frequency = <20000000>; vr9_lantiq_easy80920.dtsi: spi-max-frequency = <1000000>; vr9_netgear_dm200.dts: spi-max-frequency = <10000000>; vr9_tplink_tdw89x0.dtsi: spi-max-frequency = <33250000>;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
80MHz is to fast.. getting timeouts. 40 Mhz is doing fine.
Cannot find anything in the original sources...
Going for 33.25 Mhz
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I went down to 10Mhz on the 3390 to be on the safe side. I experienced the same timeouts as you did, but I don't remember at which setting.
IMHO it's not very critical on devices with NAND, since SPI transfers only happen during reading of EEPROM data and MAC addresses.
read-only; | ||
}; | ||
|
||
partition@20000 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
read-only; | ||
}; | ||
|
||
partition@30000 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_avm_fritz7490.dts
Show resolved
Hide resolved
target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_avm_fritz7490.dts
Show resolved
Hide resolved
Thank you for the review! Done... |
Fixes and cleanup for pull request: openwrt#2738
Signed-off-by: Andreas Böhler <dev@aboehler.at>
reg = <5>; | ||
phy-mode = "rgmii"; | ||
|
||
fixed-link { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The xrx200 driver does not support fixed links unless you add a patch.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, do you mean this one?:
andyboeh@9eeecc7#diff-53548cba5fb20e52886933f9e46e869e
Then the question needs tobe resolved how do we register this port in the userspace domain, I can imagine we need to label it as "wan" but I am not sure of the implications...
ucidef_add_switch "switch0"
"0:lan:3" "1:lan:4" "2:lan:2" "4:lan:1" "5:wan:5" "6t@eth0"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmmm and.. possibly they hooked up the Xilinx to port 3 maybe.
If this is true this could open up some interesting possibilities... an onboard programmable FPGA on the network ... :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I meant this commit. Without it, the lines regarding fixed-link
are useless.
There is an ongoing discussion on the labeling of this port in the 3390 PR. My point of view is that it should bear a "lan" label, because the WiFi Access Point is connected to it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would agree. (I was under the wrong impression that fixed link meant the DSL soc...)
ucidef_add_switch "switch0"
"0:lan:3" "1:lan:4" "2:lan:2" "4:lan:1" "5:lan:5" "6t@eth0"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, it means that the kernel fakes a PHY and an MDIO bus at the given port with the given speed / settings.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please remove this till it is really supported.
And regarding USB3: does it work with the firmware loader or are you experiencing the same, probably PCIe-related, problems as on the 3490? |
I tested briefly by using the extracted avm firmware file on the device:
After some unloading and reloading managed to register the two root hubs.. It did not register plugging in an usb, and I suspect maybe due to missing port power... So no extensive tests.. |
You set the output low, so yes, probably there is no power on the USB bus. |
Yes I was assuming (again wrong) that the xhci-[pci|renesas] driver would activate the GPIO... |
No, that's the case in the AVM drivers, because they patched the necessary GPIO support into the xhci driver. I'm using a gpio-hog to set it to default-on; you could also expose the GPIO to userspace with gpio-export and toggle it on your own (I did that for testing purposes). |
- reduced spi-max-frequency to 33250000 80 Mhz gave timeouts.. - Nand is Micron MT29F4G08ABADAWP and has 8 bits io setting bank-width to 1.. ` Signed-off-by: Henk Vergonet <henk.vergonet@gmail.com>
We already have led-dsl... remove the led-internet.
What is now the best way forward? is:pr is:open label:target/lantiq Shows some pending changes, i think at least the 3490 and the 7490 models can be tested and working with basic lan and switch functionality by me and @andyboeh . Push basics for 3390 from @andyboeh and after that i will adjust and push basics for 7490? have this as a baseline and continue... |
Yes DSL works, but for more than ~20MBit downstream with annex B I need to extract the avm firmware vr9-B-dsl.bin from current avm firmware image.
|
I gave it a try to port the work from @andyboeh for 3490 to 7490 Kernel patches to lantiq_xrx200.c in 4.x kernel need to be applied to lantiq_xrx200_legacy.c in 5.x kernel. wasp_uploader_stage1 is running well, but I had to change wasp_reset in upload-wasp.sh, to set /sys/class/gpio/fritz7490:wasp:reset/value to be 0. But wasp_uploader_stage2 is not yet succceeding. It hangs without any reply. |
While it's quite hard to find a reviewer for lantiq stuff these days, please be aware that properly squashing your commits regarding 7490 into a single proper one might help with review. |
@@ -0,0 +1,284 @@ | |||
/dts-v1/; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add Missing SPDX License identifier
@@ -0,0 +1,284 @@ | |||
/dts-v1/; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
compatible = "gpio-leds"; | ||
|
||
led_power: power { | ||
label = "fritz7490:green:power"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Drop model name from LED label
Ref: c331932
ethernet@0 { | ||
compatible = "lantiq,xrx200-pdi-port"; | ||
reg = <0>; | ||
phy-mode = "sgmii"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wiki Page says it have AR8035 and this PHY support RGMII
ethernet@1 { | ||
compatible = "lantiq,xrx200-pdi-port"; | ||
reg = <1>; | ||
phy-mode = "sgmii"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above
I have a 7490 connected via a media converter (sfp to ethernet). If you need a tester, I'm here. |
Some of the stuff in this patch is incomplete, misses things or does not work anymore based on current trunk (or better with kernel 5.4). If one looks for something working (except USB), there is a fork, find it here. |
@kestrel1974 maybe you would be interested in going over #3656 as a reviewer? It could help to prepare that PR for merging. That might again help to put support the 7490 in place too. |
@jschwartzenberg Actually most of the work was done by andyboeh, I just packaged it together, tested a lot and found some bugs. In some cases I just looked at the firmware, calculated offsets new and tested it and it worked (like extracting the caldata for 7490). I can neither write a driver nor understand most of the things that kernel components do. So I am not the right person to do reviews. When looking at the pull request, I don't even know the conventions (e.g. for device tree) and have "violated" them too based on the discussions there getting my own fork to work. Furthermore the 3656 pull request removes most of the stuff to support wifi on 7490 at all, since on 7490 both wifis are on the separate SoC connected with fixed link LAN5, so actually this pull request does not help at all for 7490. |
Hi dear openwrt developer community, is it foreseeable that OpenWRT will soon run on the Fritzbox 7490? Or are there still too many things open / todo /fix? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please rebase this on top of current OpenWrt master.
Please squash the fixes into the original commit.
gpio-export { | ||
compatible = "gpio-export"; | ||
|
||
gpio_wasp_reset { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove this as long as wsap is not working.
reg = <5>; | ||
phy-mode = "rgmii"; | ||
|
||
fixed-link { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please remove this till it is really supported.
OpenWRT runs on the Fritzbox 7490 since about two years or longer, its just not supported. There were only single people working on it. The biggest difficulty is finding a solution to make wifi work. |
@hauke Do you have any ideas how to find out if the PCIe endianess flag that is needed in 7490 and 3490 for the renesas usb driver will cause trouble for other devices (there is a chance that the devices with PCIe wireless are affected, because I have read that they had endianess issues when making it work):
Its in function pcie_rc_initialize(int pcie_port), I had added the flag in 0151-lantiq-ifxmips_pcie-use-of.patch. I tried to make the compile dependent on hardware model, but those CONFIG_TARGET_lantiq_xrx200_DEVICE_avm_fritz7490 define values (or without the CONFIG_ prefix) are not propagated into the C compiler, so I have used CONFIG_USB_PCI, but that might be not enough, since the dwc2 driver could be using PCI as well. |
This flag will probably swap all 32 bit accesses on this bus to the PCIe controller, so I assume all other devices will not work any more. |
Somehow I forgot about this PR. I installed @kestrel1974's fork on my 5490, but I cannot get wired ethernet to work, only wireless. Might it be possible that this PR would give working ethernet or is @kestrel1974's fork newer? What about the fixes from #3085? Thanks in advance! |
based on https://boxmatrix.info/wiki/FRITZ!Box_5490 and
So without some actual device-tree (and possibly other changes) specifically for the 5490 neither the code from this pull request, nor @kestrel1974's fork for the 7490 nor the changes from #3085 will make Ethernet (or the fiber port) work on that device. |
@jschwartzenberg I think you really should open a thread in the developer forum similar to the one for 7490. And as xdarklight mentioned, you need to transform the avm config I have pointed out into a dtb. The mdio addresses etc. for 7490 and 5490 differ a lot. I think you have to use a link and there are samples for dtbs with two switch configurations connected with the link statement. You will have to do a lot of trial and error or reading sources to figure it out with no existing samples, however, with the correct settings, you should at least be able to get 2 of the ports working as a starter. Have a look here. Try to replace the network part from my 7490 dts and start testing. No guarantees. The rgmii-id for the fiber port could be wrong. The gpios should be correct for the 5490, except I have not checked the leds. There could be syntax errors in the dts excerpt. I do not know how to integrate the second switch, there are samples how to do that with dsa and you need to add the driver for the qca8334 (NET_DSA_QCA8K). The sample config is derrived from here. |
Wow, cool thanks so much for all the info! @xdarklight, @kestrel1974 I really appreciate it! I indeed saw the previous remarks, but I had no idea that the switch configuration was that different that the pors wouldn't work at all with a 7490 config. It seems the work on the 7490 WiFi was really critical as otherwise I would not have been able to reach my box at all. I actually did a sysupgrade of @kestrel1974's branch to the box after a successful ramboot and it boots fine. I just connect over WiFi using the key at the bottom. At least the ethernet between the SoCs is working. Regarding the LEDs, there are the following: Power, Fiber, WLAN, Fon and Info. the Power LED is on and the second LED that turns on at some point is the Fiber LED. The others stay off. I'll see what happens when I change the DTS for the ports and indeed I'll open a forum topic or another PR when I come up with something as it seems the 5490 and 7490 are more different than I expected and this is thus getting off-topic again. Thanks again all!! |
@hvegh Can you provide me with an image? I've got a bunch of 7430s here which also identify as 223 from what I remember... They are VDSL versions I guess... |
@hvegh By the way it would be nice if you could add support for this box in FritzFlash (EVA ftp recovery flash tool): |
@CodeFetch you might want to look at https://github.com/kestrel1974/openwrt/tree/fritzbox7490 which has support for the 3490, 5490, 5491 and 7490. As it introduces multiple models, it may be easier to add the 7430 to that branch. Building an image should be easy, are you running into issues? |
@jschwartzenberg No, I would just have given hvegh's image a try as this is an easily recoverable device. Don't have the time now, to dig deeper into it. There are some other devices which are at my focus atm. Edit: Oh sorry, just have seen, that the 7430 is already supported: |
@hvegh Please rebase and have a look at https://github.com/openwrt/openwrt/blob/master/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_avm_fritz7430.dts and see https://github.com/openwrt/openwrt/pull/2738/files#r518020868... I think it would make sense to create a common dtsi for these devices. Edit: Sorry, I was wrong... The 7430 has a different hardware revision (218). Still the hardware looks very similar. |
@hvegh Are you sure this is such a complicated WLAN device? Isn't it a normal ath9k one like that of the 7430? Even with the method described in the forum post it didn't work as the calibration data at that offset is wrong (it shows up as a 5 GHz device)... I don't have a clue about FritzBoxes. So sorry if I'm talking BS here... |
This needs to be updated and squashed/reorganized properly ... |
Yes. One needs to bring up the second SoC for WLAN. Newer vendor firmware also uses two Linux kernels the WLAN one is the "scrpn" one: |
Support for LAN and Switch tested and confirmed, xDSL untested.
https://patchwork.kernel.org/patch/11329775/