openwrt/target/linux
INAGAKI Hiroshi f490295bf2
ipq807x: add support for Buffalo WXR-5950AX12
Buffalo WXR-5950AX12 is a 2.4/5 GHz band 11ax (Wi-Fi 6) router, based on
IPQ8074A.

Specification:

- SoC         : Qualcomm IPQ8074A
- RAM         : DDR3 1024 MiB (2x Nanya NT5CC256M16ER-EK)
- Flash       : RAW NAND 256 MiB (Winbond W29N02GZBIBA)
- WLAN        : 2.4/5 GHz (IPQ8074A)
- Ethernet    : 5 ports
  - WAN       : 100/1000/2500/10000 Mbps x1 (AQR113C)
  - LAN       : 100/1000/2500/10000 Mbps x1 (AQR113C),
                10/100/1000 Mbps x3 (QCA8075)
- LED/Keys    : 8x/5x
- UART        : pin header on PCB (J7)
  - assignment: 3.3V, GND, TX, RX from disc marking
  - settings  : 115200n8
- Power       : 12 VDC, 4 A

Flash instruction using initramfs image:

1. Prepare TFTP server with IP address 192.168.11.10
2. Rename OpenWrt initramfs image to "WXR-5950AX12-initramfs.uImage and
   place it to TFTP directory
3. Hold AOSS (WPS) button and power on WXR-5950AX12
4. WXR-5950AX12 downloads initramfs image from TFTP server and boots
   with it automatically
5. Upload sysupgrade image to WXR-5950AX12 and perform sysupgrade
6. Wait ~120 seconds to complete flashing

Partition layout:

0x000000000000-0x000000100000 : "0:sbl1"
0x000000100000-0x000000200000 : "0:mibib"
0x000000200000-0x000000280000 : "0:bootconfig"
0x000000280000-0x000000300000 : "0:bootconfig1"
0x000000300000-0x000000600000 : "0:qsee"
0x000000600000-0x000000900000 : "0:qsee_1"
0x000000900000-0x000000980000 : "0:devcfg"
0x000000980000-0x000000a00000 : "0:devcfg_1"
0x000000a00000-0x000000a80000 : "0:apdp"
0x000000a80000-0x000000b00000 : "0:apdp_1"
0x000000b00000-0x000000b80000 : "0:rpm"
0x000000b80000-0x000000c00000 : "0:rpm_1"
0x000000c00000-0x000000c80000 : "0:cdt"
0x000000c80000-0x000000d00000 : "0:cdt_1"
0x000000d00000-0x000000d80000 : "0:appsblenv"
0x000000d80000-0x000000e80000 : "0:appsbl"
0x000000e80000-0x000000f80000 : "0:appsbl_1"
0x000000f80000-0x000001000000 : "0:art"
0x000001000000-0x000001080000 : "0:art_1"
0x000001080000-0x000001100000 : "0:orgdata"
0x000001100000-0x000001180000 : "0:orgdata_1"
0x000001180000-0x000005180000 : "rootfs"
0x000005180000-0x000009180000 : "rootfs_recover"
0x000009180000-0x000010000000 : "user_property"

Notes:

- WXR-5950AX12 has 2x OS images on NAND flash. The 1st image is for
  normal operation and the 2nd one is for recoverying or firmware
  upgrading on stock.

- Stock U-Boot checks MD5 hashes in "fw_hash" volume in each "root*"
  partition when booting. This is just a comparation of hash strings.

  Behaviors:

  - both "fw_hash" volumes exist, hashes are rootfs == rootfs_recover
    ---> boot from rootfs

  - both "fw_hash" volumes exist, hashes are rootfs != rootfs_recover
    ---> boot from rootfs_recover

    Note: this behavior is used for firmware upgrading on stock

  - "fw_hash" volume in rootfs is missing
    ---> boot from rootfs_recover

  - "fw_hash" volume in rootfs_recover is missing
    ---> boot from rootfs

  - "fw_hash" volumes in both root* partition are missing
    ---> boot from rootfs_recover

Reverting to stock firmware:

1. Decrypt official image by buffalo-enc and remove header

   example of decryption:

   $ buffalo-enc -i wxr_5950ax12_jp_305 -o wxr_5950ax12_jp_305.dec \
                 -d -k olaffuB -O 0xc8

   example of removing header (v3.05):

   - before

   $ hexdump -n 64 -v -C wxr_5950ax12_jp_305.dec
   00000000  57 58 52 2d 35 39 35 30  41 58 31 32 5f 33 2e 30  |WXR-5950AX12_3.0|
   00000010  35 5f 31 2e 30 31 5f 4a  50 5f 6a 70 5f 71 63 61  |5_1.01_JP_jp_qca|
   00000020  0a 66 69 6c 65 6c 65 6e  3d 34 35 33 35 30 39 31  |.filelen=4535091|
   00000030  32 0a 55 42 49 23 01 00  00 00 00 00 00 00 00 00  |2.UBI#..........|
   00000040

   - after

   $ hexdump -n 64 -v -C wxr_5950ax12_jp_305.ubi
   00000000  55 42 49 23 01 00 00 00  00 00 00 00 00 00 00 00  |UBI#............|
   00000010  00 00 08 00 00 00 10 00  78 cf c4 91 00 00 00 00  |........x.......|
   00000020  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
   00000030  00 00 00 00 00 00 00 00  00 00 00 00 3d 2a 64 fd  |............=*d.|
   00000040

2. Boot WXR-5950AX12 with OpenWrt initramfs image

3. Upload modified stock image to WXR-5950AX12

4. Find partitions "rootfs" and "rootfs_recover"

   example:

   root@OpenWrt:/# cat /proc/mtd
   dev:    size   erasesize  name
   ...
   mtd22: 04000000 00020000 "rootfs"
   mtd23: 04000000 00020000 "rootfs_recover"
   ...

   in this case, "rootfs" is mtd22 and "rootfs_recover" is mtd23

5. Format "rootfs"/"rootfs_recover" partition with the uploaded image

   example:

   ubiformat /dev/mtd22 -f /tmp/wxr_5950ax12_jp_305.ubi
   ubiformat /dev/mtd23 -f /tmp/wxr_5950ax12_jp_305.ubi

6. Remove "rootfs"/"rootfs_data" volume from user_property partition

   example:

   . /lib/upgrade/nand.sh
   UBI=$(nand_attach_ubi user_property)
   ubirmvol /dev/$UBI -N rootfs
   ubirmvol /dev/$UBI -N rootfs_data

7. Reboot

MAC addresses:

LAN    : 50:C4:DD:xx:xx:28 (0:APPSBLENV, ethaddr (text))
WAN    : 50:C4:DD:xx:xx:28 (0:APPSBLENV, ethaddr (text))
2.4 GHz: 50:C4:DD:xx:xx:30 (0:APPSBLENV, wlan0addr (text))
5 GHz  : 50:C4:DD:xx:xx:38 (0:APPSBLENV, wlan1addr (text))

Reviewed-by: Robert Marko <robimarko@gmail.com>
Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
2023-02-12 01:18:39 +01:00
..
airoha airoha: disable swconfig 2022-11-27 13:18:29 +01:00
apm821xx treewide: replace wpad-basic-wolfssl default 2023-02-04 02:35:03 +01:00
archs38 treewide: replace wpad-basic-wolfssl default 2023-02-04 02:35:03 +01:00
armvirt kernel: disable CONFIG_CPU_LITTLE_ENDIAN in generic config 2022-10-21 13:47:01 +02:00
at91 treewide: strip useless default n Kconfig lines 2023-02-03 12:50:15 +01:00
ath25 treewide: replace wpad-basic-wolfssl default 2023-02-04 02:35:03 +01:00
ath79 ath79: bump SPI frequency of Senao qca955x routers 2023-02-12 18:07:31 +01:00
bcm27xx kernel: bump 5.15 to 5.15.93 2023-02-11 23:39:30 +01:00
bcm47xx bcm47xx: revert bgmac back to the old limited max frame size 2023-02-07 18:29:34 +01:00
bcm53xx treewide: replace wpad-basic-wolfssl default 2023-02-04 02:35:03 +01:00
bcm63xx bcm63xx: fix dts whitespace 2023-02-09 03:03:50 +01:00
bcm4908 treewide: uniform vendor name for ASUS 2022-11-16 23:30:11 +01:00
bmips treewide: replace wpad-basic-wolfssl default 2023-02-04 02:35:03 +01:00
gemini gemini: add generic subtarget 2022-12-23 19:44:20 +01:00
generic kernel: add missing optimization for page pool 2023-02-13 11:48:55 +01:00
imx cypress-nvram: consolidate NVRAM packages 2022-11-16 20:14:13 +01:00
ipq40xx ipq40xx: fix dts whitespace 2023-02-09 03:03:47 +01:00
ipq806x ipq806x: fix dts whitespace 2023-02-09 03:03:51 +01:00
ipq807x ipq807x: add support for Buffalo WXR-5950AX12 2023-02-12 01:18:39 +01:00
kirkwood kirkwood: fix dts whitespace 2023-02-09 03:03:51 +01:00
lantiq lantiq: ar9/vr9: add fritz-tffs package 2023-02-08 00:19:54 +01:00
layerscape layerscape: Add CONFIG_NVMEM_LAYERSCAPE_SFP kernel configuration option 2023-01-08 18:51:27 +01:00
malta treewide: replace wpad-basic-wolfssl default 2023-02-04 02:35:03 +01:00
mediatek mediatek: mt7622: fix rootfs/ubi detection for Xiaomi AX6S 2023-02-11 21:42:06 +08:00
mpc85xx mpc85xx: p2020: kernel: enable CONFIG_BLK_DEV_NVME 2023-02-07 21:24:37 +01:00
mvebu treewide: replace wpad-basic-wolfssl default 2023-02-04 02:35:03 +01:00
mxs mxs: switch default kernel to 5.15 2023-01-30 11:13:14 +01:00
octeon kernel: disable CONFIG_CPU_LITTLE_ENDIAN in generic config 2022-10-21 13:47:01 +02:00
octeontx octeontx: add sqaushfs and ramdisk to features 2023-01-06 19:44:35 +01:00
omap treewide: replace wpad-basic-wolfssl default 2023-02-04 02:35:03 +01:00
oxnas treewide: replace wpad-basic-wolfssl default 2023-02-04 02:35:03 +01:00
pistachio pistachio: Cleanup kernel configuration 2023-01-28 19:58:20 +01:00
qoriq qoriq: drop unused kernel config 2023-01-09 21:39:45 +02:00
ramips ramips: add support for ASUS RT-AX54 2023-02-12 18:27:45 +01:00
realtek realtek: add support for APRESIA ApresiaLightGS120GT-SS 2023-02-13 12:22:17 +01:00
rockchip treewide: update NVMEM symbols 2023-01-07 01:30:31 +01:00
sunxi treewide: replace wpad-basic-wolfssl default 2023-02-04 02:35:03 +01:00
tegra treewide: replace wpad-basic-wolfssl default 2023-02-04 02:35:03 +01:00
uml treewide: replace wpad-basic-wolfssl default 2023-02-04 02:35:03 +01:00
x86 x86: add Barracuda Networks F12 interfaces 2023-02-03 14:05:37 +01:00
zynq zynq: remove kconfig for 5.10 2023-01-30 18:01:14 +08:00
Makefile build: fix issues with targets installed via feeds 2022-09-27 13:41:12 +02:00