ZyXEL P2812HNU-F1 with deviating wifi

After have problems with dying chips, I bought two new (to me) P2812HNU-F1's. I installed 22.03.0.rc6 on the first one, and that one is running fine.
The 2nd one looks a bit different. Normally the SoC is in a shielded area, on this one the shield is omitted. The SoC is revision 1.2, while the other one is 1.1.
More interesting (and problematic) is the wifi chip. On a 'normal' device the kernel log says:

[   36.553171] pci 0000:00:0e.0: [1814:3062] type 00 class 0x028000
[   36.557791] pci 0000:00:0e.0: reg 0x10: [mem 0xffff0000-0xffffffff]
[   36.567626] pci 0000:00:0e.0: BAR 0: assigned [mem 0x18000000-0x1800ffff]
[   36.573432] rt2800pci 0000:00:0e.0: enabling device (0000 -> 0002)
[   36.579443] ieee80211 phy0: rt2x00lib_request_eeprom_file: Info - Loading EEPROM data from 'RT3062.eeprom'.
[   36.815274] ieee80211 phy0: rt2x00_set_rt: Info - RT chipset 3572, rev 0221 detected
[   36.821745] ieee80211 phy0: rt2x00_set_rf: Info - RF chipset 0008 detected
[   36.828713] ieee80211 phy0: Selected rate control algorithm 'minstrel_ht'

On this device it says:

[   66.441335] pci 0000:00:0e.0: [1814:3592] type 00 class 0x028000
[   66.445941] pci 0000:00:0e.0: reg 0x10: [mem 0xffff0000-0xffffffff]
[   66.452385] pci 0000:00:0e.0: PME# supported from D0
[   66.460548] pci 0000:00:0e.0: BAR 0: assigned [mem 0x18000000-0x1800ffff]
[   66.466291] rt2800pci 0000:00:0e.0: enabling device (0000 -> 0002)
[   66.472556] ieee80211 phy0: rt2x00lib_request_eeprom_file: Info - Loading EEPROM data from 'RT3062.eeprom'.

and then it stalls. After about 10 seconds it reboots (watchdog?), but it's not a clean reboot.
U-boot fails in loading the kernel:

NAND read: device 0 offset 0x60000, size 0x300000
NAND read from offset 60000 failed -74
 0 bytes read: ERROR
Wrong Image Format for bootm command
ERROR: can't get kernel image!
P-2812HNU-Fx #

When I remove the eeprom file, it just fails, without stalling, and iw list then shows no devices. So I suppose the eeprom file for the [1814:3062] is not suitable for the [1814:3592]. But it needs something. According to this list [1814:3592] uses the same driver as [1814:3062]. The dmesg dump here doesn't show any file from user space loaded.
The filename RT3062.eeprom is defined in the dts file. How should I continue now? Build a firmware with an alternate dts file without eeprom file? Or somehow get a file suitable for an [1814:3592]? How?

I edited the dts file to not specify the eeprom file. Unfortunately that didn't solve the problem:

# echo 1 >/sys/bus/pci/rescan 
[   97.542963] pci 0000:00:0e.0: [1814:3592] type 00 class 0x028000
[   97.547582] pci 0000:00:0e.0: reg 0x10: [mem 0xffff0000-0xffffffff]
[   97.554102] pci 0000:00:0e.0: PME# supported from D0
[   97.561982] pci 0000:00:0e.0: BAR 0: assigned [mem 0x18000000-0x1800ffff]
[   97.567607] rt2800pci 0000:00:0e.0: enabling device (0000 -> 0002)
<stall and reboot>

So maybe the eeprom file isn't the problem after all, but some result of enabling the device.
I saw in the kernel config that in module rt2800pci the support for RT35XX has to be enabled separately. In 'make menuconfig' kmod-rt2800-pci doesn't give me that choice. Can I find somewhere how the kernel .config looks which was used to build the firmware blob?

Mijzelf,

I had this issue before: http://dolfgeerdink.nl/phpbb/viewtopic.php?p=262#p262
Solved it by doing the following:
Try ´rmmod rt2800pci´ copy/check the (original) RT3062.eeprom file to /lib/firmware/ folder.
Next run ´modprobe rt2800pci´ and voila, wlan working! (wlan3, but anyway, it works).
Maybe also wait with the (new) 'echo 1 > /sys/bus/pci/rescan' command.

Btw, v1.1 and v1.2 run both the same firmware.

DG.

Hmm. I tried to reproduce this. On OpenWrt 19 and newer the PCI bus is not scanned on boot, and therefore you need that rescan command. So to mimic your sequence I did:

mv /lib/firmware/RT3062.eeprom /lib/firmware/RT3062.eeprom.old
echo 1 > /sys/bus/pci/rescan  # rt2800pci fails with error -2
rmmod rt2800pci
mv /lib/firmware/RT3062.eeprom.old /lib/firmware/RT3062.eeprom
modprobe rt2800pci

System stall. I also tried to rmmod all rt2x00 modules, but that gave no joy either. Do you still have the RT3062.eeprom file you used then?

Mijzelf,

I don't think the RT3062.eeprom file is the issue. All of them are the same, except byte 4 till 9 (for internal mac address). I could sent you my original file, but I doubt it will help you more.

You need lspci -vv command to see if on 3592 there is a 'Subsystem: Ralink corp. Device 3062'. As seen in my logs. Then my rmmod and modprobe commands did worked (5 years ago).

Also I see that I tried the defective Wifi device by full power cycle (not only the on/off button :wink: ) but pull tha plug. It seems that sometimes this resets the Wifi better/other way then by on/off button.

I think about it today. Even a bad power supply could have been causing this problem? Although I always use the same original DVE switching adapter: 12V, 2A.

DG.

I ran lspci on that box, and it gave

lspci -vv
00:0e.0 Network controller: Ralink corp. RT3592 Wireless 802.11abgn 2T/2R PCIe
	Subsystem: Ralink corp. RT3592 Wireless 802.11abgn 2T/2R PCIe
	Device tree node: /sys/firmware/devicetree/base/fpi@10000000/pci@e105400/wifi@1814,3062
	Control: I/O- Mem+ BusMaster- SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
	Status: Cap+ 66MHz+ UDF- FastB2B- ParErr- DEVSEL=slow >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
	Interrupt: pin A routed to IRQ 30
	Region 0: Memory at 18000000 (32-bit, non-prefetchable) [size=64K]
	Capabilities: [40] Power Management version 3
		Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA PME(D0+,D1-,D2-,D3hot-,D3cold-)
		Status: D0 NoSoftRst- PME-Enable- DSel=0 DScale=0 PME-
lspci: Unable to load libkmod resources: error -12

(BTW, I had to apply an 'echo 1 > /sys/bus/pci/rescan' first, else it didn't see anything). I also tried 21.02.3 and 19.07.9, which gave the same output. In both cases the system rebooted as soon as the RT3062.eeprom file was available.
The 19.07 image didn't need a pci rescan, which revealed an interesting quirk. The firstboot in failsafe doesn't erase the overlay directly, it does so after reboot. And in that case RT3062.eeprom is loaded before the overlay is erased, and so it reboots. The remedy is to mount the overlay from failsafe, delete the eeprom file and reboot.
Now I wanted to go further back to 17.01, as you were using that, but that isn't easy. I can't sysupgrade to <19.07 as the kernel partition size is changed. So I have to tftp an initramfs image of 17.01 or 18.06. But OpenWrt doesn't provide them. The initramfs from ScApi, where the wiki points to, has an eeprom file build in, and so the box reboots. How did you get 17.01 on your RT3592 box?

Mijzelf,

I didn't got the RT3592 to work, I reverted it back to RT3062.
And back in that day (nov 2017) indeed the kernel page was smaller.

If on command line you see the following -second- line after command lspci -vv:
Subsystem: Ralink corp. Device 3062
Then it is (maybe) possible to do the trick I mentioned earlier. I doubt you get it working with any other message.
You log shows:
Subsystem: Ralink corp. RT3592 Wireless 802.11abgn 2T/2R PCIe
Actually this looks like other hardware, but I've seen it before, it's weird.

Seen over 10 of these F1's, had 2 with this issue. One fixable, one not.
Don't remember how long it stayed fixed, so maybe the Wifi is just broken.

The only thing what I could suggest is running the echo 1 > /sys/bus/pci/rescan command, without the right RT3062.eeprom. (Does it start/scan any device?)
Then try the rmmod rt2800pci and modprobe rt2800pci commands.
And then with the right RT3062.eeprom the 'echo 1 > /sys/bus/pci/rescan' again?

Nowadays trying to switch the NAND chip's on some F1's with hot-air-solder station, without success yet. I should try switching the RT3062 chip on the defect one ? ...

DG.

Mijzelf,

Some more info. I'm still using the F1's here to test mesh, and as main router.
Nowadays the wlan-mac can be set in Luci: Network / Wireless / Edit / Interface Configuration / Advanced Settings (not the Device Configuration, but lower).
So the RT3062.eeprom file is just for the hardware, should/could all be the same. Although you can set your mac in there.
If you think your RT3062.eeprom file is corrupt, you can take it from another working F1, or use: https://github.com/ScApi/P2812HNUFx-Pre-Build/blob/OpenWrt-Chaos-Calmer-r45578/F1%20OpenWRT/calibration%20data/RT3062.eeprom

Just started my Wifi-AP on a F1 running OpenWrt 22.03.0 r19685 after 16 days on power and starts fine. Here my findings on good working F1, after the AP started:
(lspci, iwinfo, /etc/config/wireless)

# lspci -vv
00:0e.0 Network controller: Ralink corp. RT3062 Wireless 802.11n 2T/2R
        Subsystem: Ralink corp. RT3062 Wireless 802.11n 2T/2R
        Device tree node: /sys/firmware/devicetree/base/fpi@10000000/pci@e105400/wifi@1814,3062
        Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV+ VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
        Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=slow >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
        Latency: 64 (500ns min, 1000ns max), Cache Line Size: 32 bytes
        Interrupt: pin A routed to IRQ 30
        Region 0: Memory at 18000000 (32-bit, non-prefetchable) [size=64K]
        Capabilities: [40] Power Management version 3
                Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA PME(D0-,D1-,D2-,D3hot-,D3cold-)
                Status: D0 NoSoftRst- PME-Enable- DSel=0 DScale=0 PME-
        Kernel driver in use: rt2800pci
lspci: Unable to load libkmod resources: error -12

# iwinfo phy0 info
phy0      ESSID: unknown
          Access Point: EC:43:F6:29:12:14
          Mode: Master  Channel: 8 (2.447 GHz)
          Center Channel 1: 8 2: unknown
          Tx-Power: 20 dBm  Link Quality: unknown/70
          Signal: unknown  Noise: unknown
          Bit Rate: unknown
          Encryption: unknown
          Type: nl80211  HW Mode(s): 802.11bgn
          Hardware: 1814:3062 1814:3062 [Generic MAC80211]
          TX power offset: unknown
          Frequency offset: unknown
          Supports VAPs: yes  PHY name: phy0

# cat /etc/config/wireless
config wifi-device 'radio0'
        option type 'mac80211'
        option path 'pci0000:00/0000:00:0e.0'
        option channel 'auto'
        option htmode 'HT20'
        option band '2g'
        option cell_density '0'

config wifi-iface 'default_radio0'
        option device 'radio0'
        option mode 'ap'
        option ssid 'OpenWrt'
        option macaddr 'EC:43:F6:29:12:14'
        option encryption 'sae-mixed'
        option key 'OpenWrt1234'
        option network 'lan'
        option ifname 'wlan0-0'

Hopefully you get your answers with the info.

DG.