Port to AVM FRITZ!Box 3490

After working on the FRITZ!Box 3390, I started porting OpenWrt to the FRITZ!Box 3490. So far, it seems very similar to the 3390 and most tools work with no or just a few modifications.

It follows a design very similar to the 3390, but is more powerful:

  • Lantiq target with 256MB RAM and 512MiB NAND
  • ath79 target with 128MB RAM and WiFi modules (2.4GHz and 5GHz are most likely both connected to the ath79)

The communication between the two SoC is similar (i.e. stage 1 loader via MDIO, stage 2 firmware via raw ethernet frames), but I need to figure out a few more commands for the MDIO upload - so far, the stage 1 loader is transferred, but does not start.

The good news is that I finally figured out the checksumming algorithm and can now upload any loader via MDIO.
The bad news is that the Lantiq target requires a few more patches to work properly:

  • The NAND is only supported in 4.20, luckily, I found a backport-patch
  • The xhci controller requires a firmware upload, luckily, I found a patch in the apm821xx target

Once I've figured the remaining parts out, I'll try to get it officially supported - at least, the Lantiq target.

8 Likes

I've just got the ath79 target to boot my Kernel :slight_smile:

Both upload tools needed a few adaptations, but they now support the 3390 and the 3490. So far, only one of the WiFi devices is detected on the ath79, this is WiP.

1 Like

Looking forward to the release. I have the Fritx Box 3490 sitting in a box waiting to be used a spare modem, Should work well with OpenWrt specs wise.

1 Like

Hi, thanks for you work on the 3490! Just signed up to say thanks :slight_smile:

I'd have one available that i currently don't use as well, so If ever need be i can use it to test things.

Thanks for the heads up! Today, I got the Ethernet on the ath79 working as well as the 5GHz WiFi.

Missing:

  • 2.4GHz WiFi - firmware extraction is still WiP
  • USB - the firmware is there, but the device does not seem to respond at all?
2 Likes

So, big improvements, but not yet there: Both WiFi chips work, the only thing missing is USB. It's WiP, with a newer kernel patch, the device is initialized, but fails to enumerate USB devices.

1 Like

I am willing to help, I have a 7490

Is there any news on jtag pinouts?

Found it...

Closest to the RS232 there is a 14-pin header on the bottom of the board, the ground and VCC pins seem to match perfectly...

Very well possible, but why do you need JTAG?

Keep up the great work!

Well, if the GPIOs are the same, then the Lantiq image for the 3490 might at least boot on the 7490.

1 Like

BTW This is what I can find on GPIO, device 7490:

[    0.620000] Lantiq GPIO driver, version 1.3.2, (c) 2001-2013 Lantiq Deutschland GmbH
[    8.830000] [LED] use GPIO 45 for 'gpio_avm_led_power'
[    8.830000] [LED] use GPIO 47 for 'gpio_avm_led_internet'
[    8.840000] [LED] use GPIO 36 for 'gpio_avm_led_festnetz'
[    8.840000] [LED] use GPIO 35 for 'gpio_avm_led_wlan'
[    8.850000] [LED] use GPIO 33 for 'gpio_avm_led_info'
[    8.850000] [LED] use GPIO 46 for 'gpio_avm_led_info_red'
[    8.860000] [BUTTON] use GPIO 29 for 'gpio_avm_button_wlan'
[    8.860000] [BUTTON] use GPIO 1 for 'gpio_avm_button_dect'
[    9.770000] [piglet]use settings for 185(7 gpios from hw_config)
root@fritz:/# find /proc | grep gpio
/proc/gpio
/proc/irq/160/gpio pushbuttons
/proc/irq/129/gpio pushbuttons
/proc/driver/ifx_gpio
/proc/driver/ifx_gpio/slewrate
/proc/driver/ifx_gpio/slewrate/gpio8
/proc/driver/ifx_gpio/slewrate/gpio18
/proc/driver/ifx_gpio/slewrate/gpio19
/proc/driver/ifx_gpio/slewrate/mii0_tx
/proc/driver/ifx_gpio/slewrate/mii0_rx
/proc/driver/ifx_gpio/slewrate/mii1_tx
/proc/driver/ifx_gpio/slewrate/mii1_rx
/proc/driver/ifx_gpio/slewrate/mii2_tx
/proc/driver/ifx_gpio/slewrate/mii2_rx
/proc/driver/ifx_gpio/slewrate/pciclk
/proc/driver/ifx_gpio/board
/proc/driver/ifx_gpio/module
/proc/driver/ifx_gpio/setup
/proc/driver/ifx_gpio/dbg
/proc/driver/ifx_gpio/version

And this.. Not sure waht it means :slight_smile:

root@fritz:/# cat /proc/driver/ifx_gpio/setup

IFX GPIO Pin Settings
OUT    : FEDCBA9876543210
-------------------------
     P0: XXX   X         
     P1:  X X     XXX    
     P2: XX X       X XXX
     P3:                 

~~~~~~~~~~~~~~~~~~~~~~~~~

IN     : FEDCBA9876543210
-------------------------
     P0: XX XXX  XX  XXX 
     P1:  XXXXXX XXXXX XX
     P2: XX X XX XX X XXX
     P3:               XX

~~~~~~~~~~~~~~~~~~~~~~~~~

DIR    : FEDCBA9876543210
-------------------------
     P0: XXXX X  X X     
     P1: XX X  XXXXXX XX 
     P2: XXXXX     XXXXXX
     P3:               X 

~~~~~~~~~~~~~~~~~~~~~~~~~

ALTSEL0: FEDCBA9876543210
-------------------------
     P0:   XXX X X   X XX
     P1:   X  XXXX    XXX
     P2:     XX          
     P3:               XX

~~~~~~~~~~~~~~~~~~~~~~~~~

ALTSEL1: FEDCBA9876543210
-------------------------
     P0:      XX        X
     P1:   X             
     P2:       XX        
     P3:                 

~~~~~~~~~~~~~~~~~~~~~~~~~

OD     : FEDCBA9876543210
-------------------------
     P0: XXXX XX X X X   
     P1: XX X  XXXXXX XXX
     P2: XXXXXX    XXXXXX
     P3:               X 

~~~~~~~~~~~~~~~~~~~~~~~~~

STOFF  : FEDCBA9876543210
-------------------------
     P0:                 
     P1:                 
     P2:                 
     P3:                 

~~~~~~~~~~~~~~~~~~~~~~~~~

PUDSEL : FEDCBA9876543210
-------------------------
     P0:           XX   X
     P1: X    X X X     X
     P2:    X XXX     X X
     P3:                 

~~~~~~~~~~~~~~~~~~~~~~~~~

PUDEN  : FEDCBA9876543210
-------------------------
     P0:            X   X
     P1: X    X XX X X  X
     P2:    X XXX       X
     P3:

If I can help port this device (7490) let me know what I can do..
I will help..

Please post your efforts in the 7490 porting thread (Support Fritzbox 7490). You are likely to get more response there, since this is the 3490 porting thread (although the two devices seem very similar).

3 Likes

I have tested the USB patch on an 7490 with USB power on..

I tested a few times with USB stick.:

[  586.296119] ifx_pcie_bios_map_irq port 0 dev 0000:01:00.0 slot 0 pin 1 
[  586.301462] ifx_pcie_bios_map_irq dev 0000:01:00.0 irq 144 assigned
[  586.307914] xhci_hcd 0000:01:00.0: xHCI Host Controller
[  586.313052] xhci_hcd 0000:01:00.0: new USB bus registered, assigned bus number 1
[  586.325917] xhci_hcd 0000:01:00.0: hcc params 0x014051cf hci version 0x100 quirks 0x0000000100000090
[  586.336049] hub 1-0:1.0: USB hub found
[  586.338823] hub 1-0:1.0: 2 ports detected
[  586.343984] xhci_hcd 0000:01:00.0: xHCI Host Controller
[  586.348032] xhci_hcd 0000:01:00.0: new USB bus registered, assigned bus number 2
[  586.355360] xhci_hcd 0000:01:00.0: Host supports USB 3.0 SuperSpeed
[  586.362085] usb usb2: We don't know the algorithms for LPM for this host, disabling LPM.
[  586.371567] hub 2-0:1.0: USB hub found
[  586.374613] hub 2-0:1.0: 2 ports detected
[  586.677664] usb 1-1: new high-speed USB device number 2 using xhci_hcd
[  586.814141] usb 1-1: device descriptor read/64, error 18
[  587.054126] usb 1-1: device descriptor read/64, error 18
[  587.293608] usb 1-1: new high-speed USB device number 3 using xhci_hcd
[  587.426124] usb 1-1: device descriptor read/64, error 18
[  587.666106] usb 1-1: device descriptor read/64, error 18
[  587.777839] usb usb1-port1: attempt power cycle
[  588.429563] usb 1-1: new high-speed USB device number 4 using xhci_hcd
[  588.456225] usb 1-1: device descriptor read/all, error -61
[  588.589557] usb 1-1: new high-speed USB device number 5 using xhci_hcd
[  588.616213] usb 1-1: device descriptor read/all, error -61
[  588.620628] usb usb1-port1: unable to enumerate USB device
[  715.441287] usb 1-2: new high-speed USB device number 6 using xhci_hcd
[  715.577804] usb 1-2: device descriptor read/64, error 18
[  715.817805] usb 1-2: device descriptor read/64, error 18
[  716.057302] usb 1-2: new high-speed USB device number 7 using xhci_hcd
[  716.193782] usb 1-2: device descriptor read/64, error 18
[  716.433767] usb 1-2: device descriptor read/64, error 18
[  716.545520] usb usb1-port2: attempt power cycle
[  717.197281] usb 1-2: new high-speed USB device number 8 using xhci_hcd
[  717.224006] usb 1-2: device descriptor read/all, error -61
[  717.357254] usb 1-2: new high-speed USB device number 9 using xhci_hcd
[  717.383743] usb 1-2: device descriptor read/all, error -61
[  717.388163] usb usb1-port2: unable to enumerate USB device

See here: Fix xhci errors on Renesas uPD70202 (FRITZ!Box 3490)

Hi, I also have a FRITZ!Box 3490 to play around. I'm happy to help, although I'm not experienced in openwrt development.

1 Like

can you tell me if i can safely buy a fb 3490? is it fully supported?

Did you actually read this thread? It is not supported at all. The only way you can get OpenWrt on this device is by building my experimental OpenWrt tree yourself.

1 Like

Yes i read. I'm willing to compile your git tree. But i can't read out if it is fully working. (2.4ghz and 5ghz chip at same time). My first try to compile origin/avm_fritz3490 branch ends with error:

[root@t420]: /opt/sources/openwrt-fb3490># make menuconfig
fatal: Invalid revision range ee53a240ac902dc83209008a2671e7fdcf55957a..HEAD
fatal: Invalid revision range ee53a240ac902dc83209008a2671e7fdcf55957a..41126ccba6bb7929fcc46e81f3b12d0cb55cd35e
fatal: Invalid revision range ee53a240ac902dc83209008a2671e7fdcf55957a..HEAD
fatal: Invalid revision range ee53a240ac902dc83209008a2671e7fdcf55957a..41126ccba6bb7929fcc46e81f3b12d0cb55cd35e
WARNING: Makefile 'package/utils/busybox/Makefile' has a dependency on 'libpam', which does not exist
WARNING: Makefile 'package/utils/busybox/Makefile' has a build dependency on 'libpam', which does not exist
WARNING: Makefile 'package/network/utils/curl/Makefile' has a dependency on 'libgnutls', which does not exist
WARNING: Makefile 'package/network/utils/curl/Makefile' has a dependency on 'libopenldap', which does not exist
WARNING: Makefile 'package/network/utils/curl/Makefile' has a dependency on 'libidn2', which does not exist
WARNING: Makefile 'package/network/utils/curl/Makefile' has a dependency on 'libssh2', which does not exist
WARNING: Makefile 'package/network/services/hostapd/Makefile' has a dependency on 'PACKAGE_wpad-mesh-openssl', which does not exist
WARNING: Makefile 'package/network/services/hostapd/Makefile' has a dependency on 'PACKAGE_wpad-mesh-wolfssl', which does not exist
WARNING: Makefile 'package/network/services/hostapd/Makefile' has a dependency on 'PACKAGE_wpad-basic', which does not exist
WARNING: Makefile 'package/network/services/hostapd/Makefile' has a dependency on 'PACKAGE_wpad-mini', which does not exist
WARNING: Makefile 'package/network/services/hostapd/Makefile' has a dependency on 'PACKAGE_wpad-openssl', which does not exist
WARNING: Makefile 'package/network/services/hostapd/Makefile' has a dependency on 'PACKAGE_wpad-wolfssl', which does not exist
WARNING: Makefile 'package/network/services/hostapd/Makefile' has a dependency on 'PACKAGE_wpa-supplicant', which does not exist
WARNING: Makefile 'package/network/services/hostapd/Makefile' has a dependency on 'PACKAGE_wpa-supplicant-mesh-openssl', which does not exist
WARNING: Makefile 'package/network/services/hostapd/Makefile' has a dependency on 'PACKAGE_wpa-supplicant-mesh-wolfssl', which does not exist
WARNING: Makefile 'package/network/services/hostapd/Makefile' has a dependency on 'PACKAGE_wpa-supplicant-basic', which does not exist
WARNING: Makefile 'package/network/services/hostapd/Makefile' has a dependency on 'PACKAGE_wpa-supplicant-mini', which does not exist
WARNING: Makefile 'package/network/services/hostapd/Makefile' has a dependency on 'PACKAGE_wpa-supplicant-p2p', which does not exist
WARNING: Makefile 'package/network/services/hostapd/Makefile' has a dependency on 'PACKAGE_wpa-supplicant-openssl', which does not exist
WARNING: Makefile 'package/network/services/hostapd/Makefile' has a dependency on 'PACKAGE_wpa-supplicant-wolfssl||', which does not exist
WARNING: Makefile 'package/network/services/hostapd/Makefile' has a dependency on 'PACKAGE_hostapd-basic', which does not exist
WARNING: Makefile 'package/network/services/hostapd/Makefile' has a dependency on 'PACKAGE_hostapd-mini', which does not exist
WARNING: Makefile 'package/network/services/hostapd/Makefile' has a dependency on 'PACKAGE_hostapd-openssl', which does not exist
WARNING: Makefile 'package/network/services/hostapd/Makefile' has a dependency on 'PACKAGE_hostapd-wolfssl', which does not exist
WARNING: Makefile 'package/network/services/hostapd/Makefile' has a dependency on 'PACKAGE_wpad', which does not exist
WARNING: Makefile 'package/network/services/hostapd/Makefile' has a dependency on 'PACKAGE_wpad-mesh-openssl', which does not exist
WARNING: Makefile 'package/network/services/hostapd/Makefile' has a dependency on 'PACKAGE_wpad-mesh-wolfssl', which does not exist
WARNING: Makefile 'package/network/services/hostapd/Makefile' has a dependency on 'PACKAGE_wpad-basic', which does not exist
WARNING: Makefile 'package/network/services/hostapd/Makefile' has a dependency on 'PACKAGE_wpad-mini', which does not exist
WARNING: Makefile 'package/network/services/hostapd/Makefile' has a dependency on 'PACKAGE_wpad-openssl', which does not exist
WARNING: Makefile 'package/network/services/hostapd/Makefile' has a dependency on 'PACKAGE_wpad-wolfssl||', which does not exist
WARNING: Makefile 'package/network/utils/iproute2/Makefile' has a dependency on 'libcap', which does not exist
WARNING: Makefile 'package/network/utils/iproute2/Makefile' has a dependency on 'libcap', which does not exist
WARNING: Makefile 'package/network/utils/iproute2/Makefile' has a dependency on 'libcap', which does not exist
WARNING: Makefile 'package/network/utils/iproute2/Makefile' has a dependency on 'libcap', which does not exist
WARNING: Makefile 'package/network/utils/iproute2/Makefile' has a dependency on 'libcap', which does not exist
WARNING: Makefile 'package/network/utils/iproute2/Makefile' has a dependency on 'libcap', which does not exist
WARNING: Makefile 'package/network/utils/iproute2/Makefile' has a dependency on 'libcap', which does not exist
WARNING: Makefile 'package/network/utils/iproute2/Makefile' has a dependency on 'libcap', which does not exist
WARNING: Makefile 'package/boot/kexec-tools/Makefile' has a dependency on 'liblzma', which does not exist
WARNING: Makefile 'package/network/services/lldpd/Makefile' has a dependency on 'libnetsnmp', which does not exist
WARNING: Makefile 'package/network/utils/nftables/Makefile' has a dependency on 'jansson', which does not exist
tmp/.config-package.in:21668: syntax error
tmp/.config-package.in:21667: invalid option
tmp/.config-package.in:22516: syntax error
tmp/.config-package.in:22515: invalid option
make: *** [/opt/sources/openwrt-fb3490/include/toplevel.mk:142: menuconfig] Fehler 1
[root@t420]: /opt/sources/openwrt-fb3490># git status
Auf Branch avm_fritz3490
Ihr Branch ist auf demselben Stand wie 'origin/avm_fritz3490'.

nichts zu committen, Arbeitsverzeichnis unverändert