Hi, I'm trying to add support for a device that you're very unlikely to ever see this device in the wild because it's not for retail but I'm adding OpenWRT support for it, here are some specs about this device:
Model name: Nokia Airscale WI4A-AC440i
WiFi: 2 x PCIe QCA9984
NAND: 128MB containing UBI for rootfs and rootfs_data
NOR: 4MB for bootloader, calibration stuffs...
Eth: 2x1Gbps integrated GMAC, PoE
1x USB 2.0
1x microSD slot (not working in stock rom)
The stock ROM is QSDK which based on Kernel 3.14.77 and OpenWrt Chaos Calmer 15.05.1 but the vendor never gave us the source code for it.
Here are some pictures inside the device:
Stuff inside stock ROM:
DTS that I've decompiled from stock firmware:
Stuff from OpenWRT which I've ported and mostly working:
Now I'm having the issue with the ethernet ports, 1 port never worked with OpenWRT no matter how hard I try to tune in the device-tree, the others does work but cannot detect link up/down, I could make it detect link up/down but then it will fail to receive any data from the ethernet ports.
My attempt at porting OpenWRT:
If anyone could help me take a look at this, I'll be greatly appreciated.
I've tried to put in poll_required, rgmii_delay, phy_mdio_addr but nothing help at all.
The strange thing is that in order to have gmac* working then I have to plug an ethernet link to it before the kernel booted, otherwise it will be resulted in initialization failed and will be in a down state permanently.
Mon Jun 14 20:30:01 2021 kern.err kernel: [ 21.212448] ipq806x-gmac-dwmac 37000000.ethernet: Failed to reset the dma
Mon Jun 14 20:30:01 2021 kern.err kernel: [ 21.212484] ipq806x-gmac-dwmac 37000000.ethernet eth0: stmmac_hw_setup: DMA engine initialization failed
Mon Jun 14 20:30:01 2021 kern.err kernel: [ 21.218222] ipq806x-gmac-dwmac 37000000.ethernet eth0: stmmac_open: Hw setup failed
Mon Jun 14 20:30:01 2021 kern.err kernel: [ 21.362494] ipq806x-gmac-dwmac 37200000.ethernet: Failed to reset the dma
Mon Jun 14 20:30:01 2021 kern.err kernel: [ 21.362530] ipq806x-gmac-dwmac 37200000.ethernet eth1: stmmac_hw_setup: DMA engine initialization failed
Mon Jun 14 20:30:01 2021 kern.err kernel: [ 21.368267] ipq806x-gmac-dwmac 37200000.ethernet eth1: stmmac_open: Hw setup failed
also only the gmac1 is working, the gmac0 somehow still can receive my PC's DHCPDISCOVER but my PC doesn't receive the DHCPOFFER that it has sent, I've checked it with Wireshark and there's nothing comes from the AP
Yeah, probably it have something to do with the bootloader also.... only gmac1 is working in bootloader when I tried to ping or tftpboot from it, gmac0 does seem to be able to detect link but it's doesn't respond
Is there an u-boot source code for this SoC with the gmac0 working? I do have an SPI programmer and can test the bootloader to see if it's really the case
I'll test it tomorrow... how do I know which mode they're in? I'm not even sure about those MII stuffs and this is the first time I ported for ipq806x stuff so I'm not really sure what I'm doing, just copy and paste something that I think is correct and hope it will work, heh
considering it's just a device for wifi use... could really be that they just screw up the ethernet implementation... we will test both... we can use the unify device that also use the gmac port with no switch
Yeah... but that gmac0 port is PoE enabled so I really want it working, these device are made per order for an ISP and comes with a fancy cloud controller and stuff... and Nokia probably don't want us to install a custom firmware on it so there might be a chance that they really has screwed up with that port.
I do have the datasheet for ipq806x if you want it
That device have a very good WiFi coverage, it's even much much better than the unifi AP HD
You are correct, it looks like they somehow screwed the gmac0->PHY1 implementation, if I set the fixed-link speed to 100mbps then it's working fine, looks like it would need the rgmii-txid mode for it to work but this is unimplemented in the ipq806x_gmac_set_speed, guess I'll have to wait...
I didn't noticed the 2 PHY chips on my last teardown... but it's having 2x AR8035, they're connected to the same MDIO bus, both running as rgmii on gmac0 and gmac1...
I've tweaked some stuffs but the gmac0 only working if I set the link speed to 100mbps in the device tree, also the link speed of my PC which connected to its gmac0
I've read some pages talking about rgmii and how mismatched clock and results in either TX or RX not working so I tried the slower 100mbps and it's worked, I suppose the 1000mbps will work if the "rgmii-txid" is implemented
Anyway... it's only kinda half-working... both gmac needs a link that's connected to it before kernel boot up, otherwise it will fail initialization and never come up again