26 (edytowany przez stich86 2022-08-01 17:26:32)

Odp: ZTE MF289F - Porting OpenWRT

looks like partition layout is a little bit differnet, on MF286D NAND is before ROM:

root@MF286D:~# cat /proc/mtd
dev:    size   erasesize  name
mtd0: 000a0000 00020000 "fota-flag"
mtd1: 00080000 00020000 "ART"
mtd2: 00080000 00020000 "mac"
mtd3: 000c0000 00020000 "reserved2"
mtd4: 00400000 00020000 "cfg-param"
mtd5: 00400000 00020000 "log"
mtd6: 000a0000 00020000 "oops"
mtd7: 00500000 00020000 "reserved3"
mtd8: 00800000 00020000 "web"
mtd9: 01d00000 00020000 "rootfs"
mtd10: 01900000 00020000 "data"
mtd11: 03200000 00020000 "fota"
mtd12: 00040000 00010000 "0:SBL1"
mtd13: 00020000 00010000 "0:MIBIB"
mtd14: 00060000 00010000 "0:QSEE"
mtd15: 00010000 00010000 "0:CDT"
mtd16: 00010000 00010000 "0:DDRPARAMS"
mtd17: 00010000 00010000 "0:APPSBLENV"
mtd18: 000c0000 00010000 "0:APPSBL"
mtd19: 00050000 00010000 "0:reserved1"

while on MF289F:

root@OpenWrt:/# cat /proc/mtd
dev:    size   erasesize  name
mtd0: 00040000 00010000 "0:SBL1"
mtd1: 00020000 00010000 "0:MIBIB"
mtd2: 00060000 00010000 "0:QSEE"
mtd3: 00010000 00010000 "0:CDT"
mtd4: 00010000 00010000 "0:DDRPARAMS"
mtd5: 00010000 00010000 "0:APPSBLENV"
mtd6: 000c0000 00010000 "0:APPSBL"
mtd7: 00050000 00010000 "0:reserved1"
mtd8: 000a0000 00020000 "fota-flag"
mtd9: 00080000 00020000 "ART"
mtd10: 00080000 00020000 "mac"
mtd11: 000c0000 00020000 "reserved2"
mtd12: 00400000 00020000 "cfg-param"
mtd13: 00400000 00020000 "log"
mtd14: 000a0000 00020000 "oops"
mtd15: 00500000 00020000 "reserved3"
mtd16: 00800000 00020000 "web"
mtd17: 01d00000 00020000 "rootfs"
mtd18: 01900000 00020000 "data"
mtd19: 03200000 00020000 "fota"

Can you help me with nand write for U-Boot? I don't think that I can use the same address of memory
Here is the output of "printenv" from U-Boot

lc=tftpboot 0x84000000 ${dir}cdt-AP.DK04.1-C1.bin&&sf probe&&sf erase 0xc0000 +$filesize&&sf write $fileaddr 0xc0000 $filesize
lp=tftpboot 0x84000000 ${dir}norplusnand-system-partition-ipq40xx.bin&&sf probe&&sf erase 0x40000 +$filesize&&sf write $fileaddr 0x40000 $filesize
lr=tftpboot 0x84000000 ${dir}root_uImage&&nand erase 0x1000000 0x800000 &&nand write_partition 0x84000000     0x1000000     0x800000 &&nand erase 0x1800000 0x1D00000 &&nand write_partition 0x84800000     0x1800000     0x1D00000
lrb=tftpboot 0x84000000 ${dir}delta.bin&&nand erase 0x3500000 0x1900000&&nand write $fileaddr 0x3500000 $filesize
lrs=tftpboot 0x84000000 ${dir}root_uImage_s&&nand erase 0x1800000 0x1D00000&&nand write $fileaddr 0x1800000 $filesize
lu=tftpboot 0x84000000 ${dir}uboot.bin&&sf probe&&sf erase 0xf0000 +$filesize&&sf write $fileaddr 0xf0000 $filesize
lw=tftpboot 0x84000000 ${dir}web.img&&nand erase 0x1000000 0x800000&&nand write $fileaddr 0x1000000 $filesize

27

Odp: ZTE MF289F - Porting OpenWRT

Don't use mf286d partition layout. Make your own, based on original software (NOT dts from MF286D).

Masz niepotrzebny router, uszkodzony czy nie - chętnie przygarnę go.

28 (edytowany przez stich86 2022-08-01 17:32:56)

Odp: ZTE MF289F - Porting OpenWRT

Cezary napisał/a:

Don't use mf286d partition layout. Make your own, based on original software (NOT dts from MF286D).

looking at the log, layout is the same of MF286D:

[    1.346707] 8 ofpart partitions found on MTD device spi0.0
[    1.352114] Creating 8 MTD partitions on "spi0.0":
[    1.356913] 0x000000000000-0x000000040000 : "0:SBL1"
[    1.363099] 0x000000040000-0x000000060000 : "0:MIBIB"
[    1.368245] 0x000000060000-0x0000000c0000 : "0:QSEE"
[    1.373363] 0x0000000c0000-0x0000000d0000 : "0:CDT"
[    1.378335] 0x0000000d0000-0x0000000e0000 : "0:DDRPARAMS"
[    1.383879] 0x0000000e0000-0x0000000f0000 : "0:APPSBLENV"
[    1.389145] 0x0000000f0000-0x0000001b0000 : "0:APPSBL"
[    1.394318] 0x0000001b0000-0x000000200000 : "0:reserved1"

[    2.650413] 12 ofpart partitions found on MTD device spi0.1
[    2.654978] Creating 12 MTD partitions on "spi0.1":
[    2.659819] 0x000000000000-0x0000000a0000 : "fota-flag"
[    2.666134] 0x0000000a0000-0x000000120000 : "0:ART"
[    2.670992] 0x000000120000-0x0000001a0000 : "mac"
[    2.675728] 0x0000001a0000-0x000000260000 : "reserved2"
[    2.680908] 0x000000260000-0x000000660000 : "cfg-param"
[    2.686089] 0x000000660000-0x000000a60000 : "log"
[    2.690738] 0x000000a60000-0x000000b00000 : "oops"
[    2.695586] 0x000000b00000-0x000001000000 : "reserved3"
[    2.700789] 0x000001000000-0x000001800000 : "web"
[    2.705530] 0x000001800000-0x000003500000 : "rootfs"
[    2.710527] mtd: device 17 (rootfs) set to be root filesystem
[    2.715279] 0x000003500000-0x000004e00000 : "data"
[    2.721091] 0x000004e00000-0x000008000000 : "fota"

only difference is the order number

29 (edytowany przez stich86 2022-08-01 18:48:16)

Odp: ZTE MF289F - Porting OpenWRT

backup doesn't seems to work..

U-Boot 2012.07 [Chaos Calmer 15.05.1,IPQ4019.ILQ.6.1.0.r2-00006-P-1] (Apr 20 2021 - 04:30:48)

smem ram ptable found: ver: 1 len: 3
DRAM:  256 MiB
machid : 0x8010001
NAND:  spi_nand: spi_nand_flash_probe SF NAND ID ff:ef:aa:21
SF: Detected W25N01GV with page size 2 KiB, total 128 MiB
SF: Detected GD25Q16 with page size 4 KiB, total 2 MiB
ipq_spi: page_size: 0x100, sector_size: 0x1000, size: 0x200000
130 MiB
PCI0 Link Intialized
In:    serial
Out:   serial
Err:   serial
machid: 8010001
flash_type: 0
Uaztemain: enter into !
ZTE_InitFotaFlashPara: nand_curr_device=1
zte_getHandOffState: read data=0x20 from 0x0
Press ESC to abort autoboot in 0 seconds
Creating 1 MTD partitions on "nand1":
0x000001800000-0x000003500000 : "mtd=0"
UBI: attaching mtd2 to ubi0
UBI: physical eraseblock size:   131072 bytes (128 KiB)
UBI: logical eraseblock size:    126976 bytes
UBI: smallest flash I/O unit:    2048
UBI: VID header offset:          2048 (aligned 2048)
UBI: data offset:                4096
UBI error: ubi_read_volume_table: the layout volume was not found
UBI error: ubi_init: cannot attach mtd2
UBI error: ubi_init: UBI error: cannot initialize UBI, error -22
UBI init error 22

i've restored mtd17 that should be the UBI container with rootfs and kernel :\

EDIT: ok i got i back again, it's needed to use this one:

lrs=tftpboot 0x84000000 ${dir}root_uImage_s&&nand erase 0x1800000 0x1D00000&&nand write $fileaddr 0x1800000 $filesize

EDIT2: it's necessary to restore also mtd16 (web.img)

so now backup are working smile

but sysupgrade doesn't:

Could not open mtd device: firmware
Can't open device for writing!
cat: write error: Broken pipe
sysupgrade aborted with return code: 256

any suggestion?

30

Odp: ZTE MF289F - Porting OpenWRT

Add zte,mf289f to /lib/upgrade/platform.sh

Masz niepotrzebny router, uszkodzony czy nie - chętnie przygarnę go.

31

Odp: ZTE MF289F - Porting OpenWRT

ok i've successfully flashed the OS

Now i need to extract the info for enable wifi 5Ghz.

How to proceed?

thx

32

Odp: ZTE MF289F - Porting OpenWRT

Read: https://forum.openwrt.org/t/ath10k-and- … es/11341/2 and http://lists.infradead.org/pipermail/at … 09529.html

Somewhere on forum was information about extracting data for radio calibration. I'll drop link when I find it.

Masz niepotrzebny router, uszkodzony czy nie - chętnie przygarnę go.

33

Odp: ZTE MF289F - Porting OpenWRT

Cezary napisał/a:

Read: https://forum.openwrt.org/t/ath10k-and- … es/11341/2 and http://lists.infradead.org/pipermail/at … 09529.html

Somewhere on forum was information about extracting data for radio calibration. I'll drop link when I find it.


ok let me know if you find it, it's the last thing to solve smile

34

Odp: ZTE MF289F - Porting OpenWRT

Cannot find... @Leo-PL, @Królik - do you have link?

Masz niepotrzebny router, uszkodzony czy nie - chętnie przygarnę go.

35

Odp: ZTE MF289F - Porting OpenWRT

Cezary napisał/a:

Cannot find... @Leo-PL, @Królik - do you have link?

Here you are:

https://eko.one.pl/forum/viewtopic.php? … 28#p266128

Mam i używam: Fujitsu Futro S720, Netgear R6220, Unielec U7621-06, TP-Linki 1043 V1, V2, Linksysy EA7500v2, AeroHive AP350, Linksys EA8500, ZTE MF286d.
Mam: D-Linki DWR-921, DWR-118, DWR-116, TP-Link WDR-4900 v1, Checkpoint L-50, Linksysy 1900ACS, LB-Link BL-W1200,

36

Odp: ZTE MF289F - Porting OpenWRT

Królik napisał/a:
Cezary napisał/a:

Cannot find... @Leo-PL, @Królik - do you have link?

Here you are:

https://eko.one.pl/forum/viewtopic.php? … 28#p266128

thanks,

so i've created the board-2.json in this way:

[
    {
        "data": "boardData_1_0_IPQ4019_DK04_2G.bin",
        "names": [
            "bus=ahb,bmi-chip-id=0,bmi-board-id=20,variant=zte,mf289f"
        ]
    },
    {
        "data": "boardData_1_0_IPQ4019_DK04_5G.bin",
        "names": [
            "bus=ahb,bmi-chip-id=0,bmi-board-id=31,variant=zte,mf289f"
        ]
    }
]

use this command to create board-2.bin

./ath10k-bdencoder -c board-2.json

Now 5Ghz radio is recognized, but if i'm trying to connect as client doesn't seems to work as expected (I see traffic, but no responde from the card, so also no DHCP request are going out). Here is the output of dmesg:

[   18.515490] ath10k_ahb a800000.wifi: qca4019 hw1.0 target 0x01000000 chip_id 0x003b00ff sub 0000:0000
[   18.515568] ath10k_ahb a800000.wifi: kconfig debug 0 debugfs 1 tracing 0 dfs 1 testmode 0
[   18.528852] ath10k_ahb a800000.wifi: firmware ver 10.4b-ct-4019-fW-13-5ae337bb1 api 5 features mfp,peer-flow-ctrl,txstatus-noack,wmi-10.x-CT,ratemask-CT,regdump-CT,txrate-CT,flush-all-CT,pingpong-CT,ch-regs-CT,nop-CT,set-special-CT,tx-rc-CT,cust-stats-CT,txrate2-CT,beacon-cb-CT,wmi-block-ack-CT,wmi-bcn-rc-CT crc32 6b2b5c5b
[   18.587231] ath10k_ahb a800000.wifi: Loading BDF type 0
[   18.587481] ath10k_ahb a800000.wifi: board_file api 2 bmi_id 0:31 crc32 dd3ba33f
[   19.887328] ath10k_ahb a800000.wifi: 10.4 wmi init: vdevs: 16  peers: 48  tid: 96
[   19.887389] ath10k_ahb a800000.wifi: msdu-desc: 2500  skid: 32
[   19.936595] ath10k_ahb a800000.wifi: wmi print 'P 48/48 V 16 K 144 PH 176 T 186  msdu-desc: 2500  sw-crypt: 0 ct-sta: 0'
[   19.940916] ath10k_ahb a800000.wifi: wmi print 'free: 53252 iram: 13432 sram: 35752'
[   20.077023] ath10k_ahb a800000.wifi: htt-ver 2.2 wmi-op 6 htt-op 4 cal pre-cal-nvmem max-sta 32 raw 0 hwcrypto 1
[   88.560050] ath10k_ahb a800000.wifi: 10.4 wmi init: vdevs: 16  peers: 48  tid: 96
[   88.560108] ath10k_ahb a800000.wifi: msdu-desc: 2500  skid: 32
[   88.609379] ath10k_ahb a800000.wifi: wmi print 'P 48/48 V 16 K 144 PH 176 T 186  msdu-desc: 2500  sw-crypt: 0 ct-sta: 0'
[   88.611178] ath10k_ahb a800000.wifi: wmi print 'free: 53252 iram: 13432 sram: 35752'
[   88.937842] ath10k_ahb a800000.wifi: rts threshold -1
[   88.946282] ath10k_ahb a800000.wifi: Firmware lacks feature flag indicating a retry limit of > 2 is OK, requested limit: 4
[   89.426119] ath10k_ahb a800000.wifi: NOTE:  Firmware DBGLOG output disabled in debug_mask: 0x10000000
[  273.129114] ath10k_ahb a800000.wifi: 10.4 wmi init: vdevs: 16  peers: 48  tid: 96
[  273.129166] ath10k_ahb a800000.wifi: msdu-desc: 2500  skid: 32
[  273.178193] ath10k_ahb a800000.wifi: wmi print 'P 48/48 V 16 K 144 PH 176 T 186  msdu-desc: 2500  sw-crypt: 0 ct-sta: 0'
[  273.179147] ath10k_ahb a800000.wifi: wmi print 'free: 53252 iram: 13432 sram: 35752'
[  273.505976] ath10k_ahb a800000.wifi: rts threshold -1
[  273.507127] ath10k_ahb a800000.wifi: Firmware lacks feature flag indicating a retry limit of > 2 is OK, requested limit: 4
[  277.615119] ath10k_ahb a800000.wifi: Invalid peer id 0 or peer stats buffer, peer: 00000000  sta: 00000000
[  277.636109] ath10k_ahb a800000.wifi: pdev param 0 not supported by firmware
[  277.642709] ath10k_ahb a800000.wifi: failed to enable peer stats info: -95
[  411.642405] ath10k_ahb a800000.wifi: mac flush vdev 0 drop 1 queues 0x1 ar->paused: 0x0  arvif->paused: 0x0
[  411.642732] ath10k_ahb a800000.wifi: mac flush vdev 0 drop 0 queues 0x1 ar->paused: 0x0  arvif->paused: 0x0
[  411.743125] ath10k_ahb a800000.wifi: peer-unmap-event: unknown peer id 1
[  411.743297] ath10k_ahb a800000.wifi: peer-unmap-event: unknown peer id 1
[  411.753327] ath10k_ahb a800000.wifi: mac flush null vif, drop 0 queues 0xffff
[  414.005600] ath10k_ahb a800000.wifi: 10.4 wmi init: vdevs: 16  peers: 48  tid: 96
[  414.005652] ath10k_ahb a800000.wifi: msdu-desc: 2500  skid: 32
[  414.054786] ath10k_ahb a800000.wifi: wmi print 'P 48/48 V 16 K 144 PH 176 T 186  msdu-desc: 2500  sw-crypt: 0 ct-sta: 0'
[  414.058528] ath10k_ahb a800000.wifi: wmi print 'free: 53252 iram: 13432 sram: 35752'
[  414.381316] ath10k_ahb a800000.wifi: rts threshold -1
[  414.383143] ath10k_ahb a800000.wifi: Firmware lacks feature flag indicating a retry limit of > 2 is OK, requested limit: 4
[  419.543437] ath10k_ahb a800000.wifi: pdev param 0 not supported by firmware
[  419.545477] ath10k_ahb a800000.wifi: failed to enable peer stats info: -95
[  480.021450] ath10k_ahb a800000.wifi: mac flush vdev 0 drop 1 queues 0x1 ar->paused: 0x0  arvif->paused: 0x0
[  480.021613] ath10k_ahb a800000.wifi: mac flush vdev 0 drop 0 queues 0x1 ar->paused: 0x0  arvif->paused: 0x0
[  480.112088] ath10k_ahb a800000.wifi: peer-unmap-event: unknown peer id 1
[  480.112200] ath10k_ahb a800000.wifi: peer-unmap-event: unknown peer id 1
[  480.121157] ath10k_ahb a800000.wifi: mac flush null vif, drop 0 queues 0xffff
[  482.304406] ath10k_ahb a800000.wifi: 10.4 wmi init: vdevs: 16  peers: 48  tid: 96
[  482.304464] ath10k_ahb a800000.wifi: msdu-desc: 2500  skid: 32
[  482.353720] ath10k_ahb a800000.wifi: wmi print 'P 48/48 V 16 K 144 PH 176 T 186  msdu-desc: 2500  sw-crypt: 0 ct-sta: 0'
[  482.357563] ath10k_ahb a800000.wifi: wmi print 'free: 53252 iram: 13432 sram: 35752'
[  482.685771] ath10k_ahb a800000.wifi: rts threshold -1
[  482.696997] ath10k_ahb a800000.wifi: Firmware lacks feature flag indicating a retry limit of > 2 is OK, requested limit: 4
[  488.564513] ath10k_ahb a800000.wifi: pdev param 0 not supported by firmware
[  488.564973] ath10k_ahb a800000.wifi: failed to enable peer stats info: -95
[  625.614093] ath10k_ahb a800000.wifi: mac flush vdev 0 drop 1 queues 0x1 ar->paused: 0x0  arvif->paused: 0x0
[  625.614563] ath10k_ahb a800000.wifi: mac flush vdev 0 drop 0 queues 0x1 ar->paused: 0x0  arvif->paused: 0x0
[  625.755239] ath10k_ahb a800000.wifi: peer-unmap-event: unknown peer id 1
[  625.809651] ath10k_ahb a800000.wifi: peer-unmap-event: unknown peer id 1
[  625.830607] ath10k_ahb a800000.wifi: mac flush null vif, drop 0 queues 0xffff
[  629.139461] ath10k_ahb a800000.wifi: 10.4 wmi init: vdevs: 16  peers: 48  tid: 96
[  629.139514] ath10k_ahb a800000.wifi: msdu-desc: 2500  skid: 32
[  629.188715] ath10k_ahb a800000.wifi: wmi print 'P 48/48 V 16 K 144 PH 176 T 186  msdu-desc: 2500  sw-crypt: 0 ct-sta: 0'
[  629.192753] ath10k_ahb a800000.wifi: wmi print 'free: 53252 iram: 13432 sram: 35752'
[  629.516539] ath10k_ahb a800000.wifi: rts threshold -1
[  629.521691] ath10k_ahb a800000.wifi: Firmware lacks feature flag indicating a retry limit of > 2 is OK, requested limit: 4
[  633.202549] ath10k_ahb a800000.wifi: pdev param 0 not supported by firmware
[  633.208543] ath10k_ahb a800000.wifi: failed to enable peer stats info: -95
[  634.899832] ath10k_ahb a800000.wifi: htt tx: fixing invalid VHT TX rate code 0xff

37

Odp: ZTE MF289F - Porting OpenWRT

i've test the 5G radio also as AP, but looks like that there is no broadcast of SSID.

Any suggestion?

38

Odp: ZTE MF289F - Porting OpenWRT

ok may be I've found the problem, looks like that on MF289F the 5Ghz radio is using QCA9984:

[   58.996203] ol_transfer_bin_file: Board Data File download to address=0xc0000 file name=QCA9984/hw.1/boardData_QCA9984_CUS239_5G_v1_001.bin
[   59.007733] ol_transfer_bin_file() zte_debug FW Filename: QCA9984/hw.1/boardData_QCA9984_CUS239_5G_v1_001.bin
[   59.017813] ath_ol_pci 0000:01:00.0: Firmware loaded from user helper succesfully
[   59.025099] ol_transfer_bin_file 3729: downloading file 3, Download data len 12064
[   59.057131] ol_ath_download_firmware: Using 0x1234 for the remainder of init
[   59.074153] ol_transfer_bin_file() zte_debug FW Filename: QCA9984/hw.1/otp.bin
[   59.080872] ath_ol_pci 0000:01:00.0: Firmware loaded from user helper succesfully
[   59.088674] ol_transfer_bin_file 3729: downloading file 0, Download data len 9236
[   61.355629] ol_ath_download_firmware : Second OTP download and Execute is good, param=0x0
[   61.643815] ath_ol_pci 0000:01:00.0: Firmware loaded from user helper succesfully
[   61.650962] ol_swap_seg_alloc: Successfully allocated memory for SWAP size=524288
[   61.659755] ath_ol_pci 0000:01:00.0: Firmware loaded from user helper succesfully
[   61.666946] ol_swap_wlan_memory_expansion: length:265300 size_left:265320 dma_size_left:524288 fw_temp:d70a2004 fw_entry_size:265324
[   61.678477] ol_swap_wlan_memory_expansion: dma_virt_addr :d7021000 fw_temp: d70a2008 length: 265300
[   61.693398] ol_swap_wlan_memory_expansion: length:0 size_left:12 dma_size_left:258988 fw_temp:d70e2c60 fw_entry_size:265324
[   61.707619] ol_swap_wlan_memory_expansion: Swap total_bytes copied: 265300 Target address 422230
[   61.723221] ol_transfer_swap_struct:Code swap structure successfully downloaded for bin type =2
[   61.744879] ol_transfer_bin_file: Downloading firmware file: QCA9984/hw.1/athwlan.bin
[   61.751875] ol_transfer_bin_file() zte_debug FW Filename: QCA9984/hw.1/athwlan.bin
[   62.637282] ath_ol_pci 0000:01:00.0: Firmware loaded from user helper succesfully

so i've to use different binary and firmware...

39

Odp: ZTE MF289F - Porting OpenWRT

Maybe this router have two 5GHz radios ?
(Like Netgear's , one for normal use , one for mesh backhul )

40 (edytowany przez stich86 2022-08-02 23:27:49)

Odp: ZTE MF289F - Porting OpenWRT

MiG25 napisał/a:

Maybe this router have two 5GHz radios ?
(Like Netgear's , one for normal use , one for mesh backhul )

it can be... the one into IPQ4019 receive only but doesn't trasmit

now i'm adding QCA9984 package, let's see if it will find the new radio...

41 (edytowany przez stich86 2022-08-02 21:54:43)

Odp: ZTE MF289F - Porting OpenWRT

it still try to load QCA4019

ath10k_ahb a800000.wifi: qca4019 hw1.0 target 0x01000000 chip_id 0x003b00ff sub 0000:0000

How to force using QCA9984?

it should use ath10k_pci, a800000.wifi looks the second 5G radio on IPQ4019 that is disable into stock firmware

any ideas why the QCA9984 is not seen into pci bus?

42 (edytowany przez stich86 2022-08-03 08:33:32)

Odp: ZTE MF289F - Porting OpenWRT

ok got it smile
i've added pcie@0 to the dts, now i've got 5Ghz interface working big_smile

here is the new dts

// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
// Copyright (c) 2022, Pawel Dembicki <paweldembicki@gmail.com>.

#include "qcom-ipq4019.dtsi"
#include <dt-bindings/soc/qcom,tcsr.h>
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>
#include <dt-bindings/leds/common.h>

/ {
        model = "ZTE MF289F";
        compatible = "zte,mf289f";

        aliases {
                led-boot = &led_internal;
                led-failsafe = &led_internal;
                led-running = &led_internal;
                led-upgrade = &led_internal;
        };

        chosen {
                /*
                 * bootargs forced by u-boot bootipq command:
                 * 'ubi.mtd=rootfs root=mtd:ubi_rootfs rootfstype=squashfs rootwait'
                 */
                bootargs-append = " root=/dev/ubiblock0_1";
        };

        gpio-restart {
                compatible = "gpio-restart";
                gpios = <&tlmm 8 GPIO_ACTIVE_HIGH>;
        };

        leds {
                compatible = "gpio-leds";

                led_internal: led-0 {
                        function = LED_FUNCTION_STATUS;
                        color = <LED_COLOR_ID_BLUE>;
                        gpios = <&tlmm 10 GPIO_ACTIVE_LOW>;
                        label = "blue:internal_led";
                        default-state = "keep";
                };

                led-1 {
                        function = LED_FUNCTION_WLAN;
                        color = <LED_COLOR_ID_BLUE>;
                        gpios = <&tlmm 61 GPIO_ACTIVE_LOW>;
                        linux,default-trigger = "phy0tpt";
                };
        };

        keys {
                compatible = "gpio-keys";

                reset {
                        label = "reset";
                        linux,code = <KEY_RESTART>;
                        gpios = <&tlmm 18 GPIO_ACTIVE_LOW>;
                };

                wps {
                        label = "wps";
                        linux,code = <KEY_WPS_BUTTON>;
                        gpios = <&tlmm 68 GPIO_ACTIVE_LOW>;
                };
        };

        soc {
                rng@22000 {
                        status = "okay";
                };

                mdio@90000 {
                        status = "okay";
                        pinctrl-0 = <&mdio_pins>;
                        pinctrl-names = "default";
                        reset-gpios = <&tlmm 47 GPIO_ACTIVE_LOW>;
                        reset-delay-us = <2000>;
                };

                ess-psgmii@98000 {
                        status = "okay";
                };

                tcsr@1949000 {
                        compatible = "qcom,tcsr";
                        reg = <0x1949000 0x100>;
                        qcom,wifi_glb_cfg = <TCSR_WIFI_GLB_CFG>;
                };

                tcsr@194b000 {
                        /* select hostmode */
                        compatible = "qcom,tcsr";
                        reg = <0x194b000 0x100>;
                        qcom,usb-hsphy-mode-select = <TCSR_USB_HSPHY_HOST_MODE>;
                        status = "okay";
                };

                ess_tcsr@1953000 {
                        compatible = "qcom,tcsr";
                        reg = <0x1953000 0x1000>;
                        qcom,ess-interface-select = <TCSR_ESS_PSGMII>;
                };

                tcsr@1957000 {
                        compatible = "qcom,tcsr";
                        reg = <0x1957000 0x100>;
                        qcom,wifi_noc_memtype_m0_m2 = <TCSR_WIFI_NOC_MEMTYPE_M0_M2>;
                };

                usb2@60f8800 {
                        status = "okay";
                };

                usb3@8af8800 {
                        status = "okay";
                };

                crypto@8e3a000 {
                        status = "okay";
                };

                watchdog@b017000 {
                        status = "okay";
                };

                ess-switch@c000000 {
                        status = "okay";
                };

                edma@c080000 {
                        status = "okay";
                };
        };
};

&blsp_dma {
        status = "okay";
};

&blsp1_spi1 {
        pinctrl-0 = <&spi_0_pins>;
        pinctrl-names = "default";
        status = "okay";
        cs-gpios = <&tlmm 12 GPIO_ACTIVE_HIGH>,
                   <&tlmm 54 GPIO_ACTIVE_HIGH>;

        flash@0 {
                compatible = "jedec,spi-nor", "n25q128a11";
                #address-cells = <1>;
                #size-cells = <1>;
                reg = <0>;
                spi-max-frequency = <24000000>;

                partitions {
                        compatible = "fixed-partitions";
                        #address-cells = <1>;
                        #size-cells = <1>;

                        partition@0 {
                                label = "0:SBL1";
                                reg = <0x0 0x40000>;
                                read-only;
                        };

                        partition@40000 {
                                label = "0:MIBIB";
                                reg = <0x40000 0x20000>;
                                read-only;
                        };

                        partition@60000 {
                                label = "0:QSEE";
                                reg = <0x60000 0x60000>;
                                read-only;
                                };

                        partition@c0000 {
                                label = "0:CDT";
                                reg = <0xc0000 0x10000>;
                                read-only;
                        };

                        partition@d0000 {
                                label = "0:DDRPARAMS";
                                reg = <0xd0000 0x10000>;
                                read-only;
                        };

                        partition@e0000 {
                                label = "0:APPSBLENV";
                                reg = <0xe0000 0x10000>;
                                read-only;
                        };

                        partition@f0000 {
                                label = "0:APPSBL";
                                reg = <0xf0000 0xc0000>;
                                read-only;
                        };

                        partition@1b0000 {
                                label = "0:reserved1";
                                reg = <0x1b0000 0x50000>;
                                read-only;
                        };
                };
        };

        spi-nand@0 {
                compatible = "spi-nand";
                reg = <1>;
                spi-max-frequency = <24000000>;

                partitions {
                        compatible = "fixed-partitions";
                        #address-cells = <1>;
                        #size-cells = <1>;

                        partition@0 {
                                label = "fota-flag";
                                reg = <0x0 0xa0000>;
                                read-only;
                        };

                        partition@a0000 {
                                label = "ART";
                                reg = <0xa0000 0x80000>;
                                read-only;
                                compatible = "nvmem-cells";
                                #address-cells = <1>;
                                #size-cells = <1>;

                                precal_art_1000: precal@1000 {
                                        reg = <0x1000 0x2f20>;
                                };

                                precal_art_5000: precal@5000 {
                                        reg = <0x5000 0x2f20>;
                                };
                        };

                        partition@120000 {
                                label = "mac";
                                reg = <0x120000 0x80000>;
                                read-only;
                                compatible = "nvmem-cells";
                                #address-cells = <1>;
                                #size-cells = <1>;

                                macaddr_config_0: macaddr@0 {
                                        reg = <0x0 0x6>;
                                };
                        };

                        partition@1a0000 {
                                label = "reserved2";
                                reg = <0x1a0000 0xc0000>;
                                read-only;
                        };

                        partition@260000 {
                                label = "cfg-param";
                                reg = <0x260000 0x400000>;
                                read-only;
                        };

                        partition@660000 {
                                label = "log";
                                reg = <0x660000 0x400000>;
                        };

                        partition@a60000 {
                                label = "oops";
                                reg = <0xa60000 0xa0000>;
                        };

                        partition@b00000 {
                                label = "reserved3";
                                reg = <0xb00000 0x500000>;
                                read-only;
                        };

                        partition@1000000 {
                                label = "web";
                                reg = <0x1000000 0x800000>;
                        };

                        partition@1800000 {
                                label = "rootfs";
                                reg = <0x1800000 0x1d00000>;
                        };

                        partition@3500000 {
                                label = "data";
                                reg = <0x3500000 0x1900000>;
                        };

                        partition@4e00000 {
                                label = "fota";
                                reg = <0x4e00000 0x3200000>;
                        };
                };
        };

};

&blsp1_uart1 {
        pinctrl-0 = <&serial_pins>;
        pinctrl-names = "default";
        status = "okay";
};

&cryptobam {
        status = "okay";
};

&gmac0 {
        nvmem-cell-names = "mac-address";
        nvmem-cells = <&macaddr_config_0>;
};

&gmac1 {
        nvmem-cell-names = "mac-address";
        nvmem-cells = <&macaddr_config_0>;
        mac-address-increment = <1>;
};


&qpic_bam {
        status = "okay";
};

&tlmm {
        i2c_0_pins: i2c_0_pinmux {
                mux {
                        pins = "gpio20", "gpio21";
                        function = "blsp_i2c0";
                        bias-disable;
                };
        };

        mdio_pins: mdio_pinmux {
                mux_1 {
                        pins = "gpio6";
                        function = "mdio";
                        bias-pull-up;
                };

                mux_2 {
                        pins = "gpio7";
                        function = "mdc";
                        bias-pull-up;
                };
        };

        serial_pins: serial_pinmux {
                mux {
                        pins = "gpio16", "gpio17";
                        function = "blsp_uart0";
                        bias-disable;
                };
        };

        spi_0_pins: spi_0_pinmux {
                pinmux {
                        function = "blsp_spi0";
                        pins = "gpio13", "gpio14", "gpio15";
                        drive-strength = <12>;
                        bias-disable;
                };

                pinmux_cs {
                        function = "gpio";
                        pins = "gpio12", "gpio54";
                        drive-strength = <2>;
                        bias-disable;
                        output-high;
                };
        };
};

&usb2_hs_phy {
        status = "okay";
};

&usb3_ss_phy {
        status = "okay";
};

&usb3_hs_phy {
        status = "okay";
};

&wifi0 {
        status = "okay";
        nvmem-cell-names = "pre-calibration", "mac-address";
        nvmem-cells = <&precal_art_1000>, <&macaddr_config_0>;
        mac-address-increment = <2>;
        qcom,ath10k-calibration-variant = "zte,mf289f";
};

&pcie0 {
        status = "okay";
        perst-gpio = <&tlmm 38 GPIO_ACTIVE_LOW>;
        wake-gpio = <&tlmm 40 GPIO_ACTIVE_LOW>;
        clkreq-gpio = <&tlmm 39 GPIO_ACTIVE_LOW>;

        bridge@0,0 {
                 reg = <0x00000000 0 0 0 0>;
                 #address-cells = <3>;
                 #size-cells = <2>;
                 ranges;

                 wifi2: wifi@1,0 {
                      nvmem-cell-names = "mac-address";
                      nvmem-cells = <&macaddr_config_0>;
                      mac-address-increment = <3>;
                      compatible = "qcom,ath10k";
                      reg = <0x00010000 0 0 0 0>;
                      qcom,ath10k-calibration-variant = "zte,mf289f";
                };
        };
};

EDIT: added new DTS, this one get the mac-address of 5G from the ART partition, so it's not generate each time smile

43

Odp: ZTE MF289F - Porting OpenWRT

Good job. Test everything and send patches to openwrt.

Masz niepotrzebny router, uszkodzony czy nie - chętnie przygarnę go.

44

Odp: ZTE MF289F - Porting OpenWRT

bad news.. looks like that MF289F from Vodafone Dutch doesn't have QCA9984, so radio layout is similar to MF286D (IPQ4019 on both radios).

Now i've added back again the wifi1 into the DTS to see if we can use a hybrid configuration between Italian and Dutch version smile

i'll give a feedback tomorrow

45

Odp: ZTE MF289F - Porting OpenWRT

Maybe defining two variants is needed then, or just defining . Either way, congratulations!
A nitpick:

spi-nand@0 {

spi-nand@1 {

46 (edytowany przez stich86 2022-08-03 18:11:36)

Odp: ZTE MF289F - Porting OpenWRT

Leo-PL napisał/a:

Maybe defining two variants is needed then, or just defining . Either way, congratulations!
A nitpick:

spi-nand@0 {

spi-nand@1 {

the nand is the same, only difference is the 5Ghz radio.
VFDE doesn't have it, while VFID has it, very vary strange

EDIT: may be I’ve misunderstood your message.
You suggest to use @1 because is an index Also if the name of the object is different?

47

Odp: ZTE MF289F - Porting OpenWRT

Different revision?

Masz niepotrzebny router, uszkodzony czy nie - chętnie przygarnę go.

48

Odp: ZTE MF289F - Porting OpenWRT

Cezary napisał/a:

Different revision?

It seems. Board has space for the third radio, but on VFDE is not soldered, while in VFIT the 5G radio in IPQ4019 missing some RF chip because signal is worse and doesn’t transmit anything

49

Odp: ZTE MF289F - Porting OpenWRT

Maybe there is simpler way to vary them. In label there is HW version , on German probably there is T2 ( i found some picture from  label of germn one). What is on Italian ?

50

Odp: ZTE MF289F - Porting OpenWRT

MiG25 napisał/a:

Maybe there is simpler way to vary them. In label there is HW version , on German probably there is T2 ( i found some picture from  label of germn one). What is on Italian ?

T1

Rev 2 is cheaper…. big_smile