From f490295bf213c5e181d16cbe53c163c1c9983e45 Mon Sep 17 00:00:00 2001 From: INAGAKI Hiroshi Date: Mon, 23 Jan 2023 13:01:13 +0900 Subject: [PATCH] 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 Signed-off-by: INAGAKI Hiroshi --- package/firmware/ipq-wifi/Makefile | 2 + .../board-buffalo_wxr-5950ax12.ipq8074 | Bin 0 -> 131184 bytes .../ipq807x/base-files/etc/board.d/02_network | 1 + .../etc/hotplug.d/firmware/11-ath11k-caldata | 1 + .../ipq807x/base-files/lib/upgrade/buffalo.sh | 55 +++ .../base-files/lib/upgrade/platform.sh | 8 + .../boot/dts/qcom/ipq8074-wxr-5950ax12.dts | 376 ++++++++++++++++++ target/linux/ipq807x/image/generic.mk | 13 + 8 files changed, 456 insertions(+) create mode 100644 package/firmware/ipq-wifi/board-buffalo_wxr-5950ax12.ipq8074 create mode 100644 target/linux/ipq807x/base-files/lib/upgrade/buffalo.sh create mode 100644 target/linux/ipq807x/files/arch/arm64/boot/dts/qcom/ipq8074-wxr-5950ax12.dts diff --git a/package/firmware/ipq-wifi/Makefile b/package/firmware/ipq-wifi/Makefile index 861eec13dc..8e7fc4da39 100644 --- a/package/firmware/ipq-wifi/Makefile +++ b/package/firmware/ipq-wifi/Makefile @@ -26,6 +26,7 @@ endef ALLWIFIBOARDS:= \ aruba_ap-365 \ + buffalo_wxr-5950ax12 \ devolo_magic-2-wifi-next \ dynalink_dl-wrx36 \ edgecore_eap102 \ @@ -125,6 +126,7 @@ endef # Add $(eval $(call generate-ipq-wifi-package,,)) $(eval $(call generate-ipq-wifi-package,aruba_ap-365,Aruba AP-365)) +$(eval $(call generate-ipq-wifi-package,buffalo_wxr-5950ax12,Buffalo WXR-5950AX12)) $(eval $(call generate-ipq-wifi-package,devolo_magic-2-wifi-next,devolo Magic 2 WiFi next)) $(eval $(call generate-ipq-wifi-package,dynalink_dl-wrx36,Dynalink DL-WRX36)) $(eval $(call generate-ipq-wifi-package,edgecore_eap102,Edgecore EAP102)) diff --git a/package/firmware/ipq-wifi/board-buffalo_wxr-5950ax12.ipq8074 b/package/firmware/ipq-wifi/board-buffalo_wxr-5950ax12.ipq8074 new file mode 100644 index 0000000000000000000000000000000000000000..57badaa53553d9c81797c6ef761d37f7358ea8f2 GIT binary patch literal 131184 zcmeHw33OCfdgiV7N<|5)QAtQ82?W{~2=2%jETIK0AQmGDpC-2{-Eq5TdM24pcW0bV$H{aiy`Ah|5e@p-TU9=yZ>_ERh4SPiqgkR>()H+#Jb1J)|b|-RJ(WYR=Dbv#uv2$ zspF-+MO!*M7QMK8=i^&DcXmC#b6Zi4!F9Z_WzROUi_R-E91BF@A3} zYU7vZHD)-HLWZ89z%M%Z;A`N51h>?8r5Kmiu3q zISP%RT*ngQXQ^Yc@#AqM`hN=XIwyd;Td`$=$(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j;5SX$EB&zBaQ+Dt&a6v#25CjAPK|l}?1Ox#=KoAfF z1OY)n5D)|e0YN|z5CjAPK|l}?1Ox#=KoAfF1OY)n5D)|e0YN|z5CjAPK|l}?1Ox#= yKoAfF1OY)n5D)|e0YN|z5CjAPK|l}?1Ox#=KoAfF1OY)n5D)|e0YTsa2>gGQyD~li literal 0 HcmV?d00001 diff --git a/target/linux/ipq807x/base-files/etc/board.d/02_network b/target/linux/ipq807x/base-files/etc/board.d/02_network index a8d9d5d6cf..43c67a0f31 100644 --- a/target/linux/ipq807x/base-files/etc/board.d/02_network +++ b/target/linux/ipq807x/base-files/etc/board.d/02_network @@ -11,6 +11,7 @@ ipq807x_setup_interfaces() local board="$1" case "$board" in + buffalo,wxr-5950ax12|\ dynalink,dl-wrx36|\ xiaomi,ax9000) ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4" "wan" diff --git a/target/linux/ipq807x/base-files/etc/hotplug.d/firmware/11-ath11k-caldata b/target/linux/ipq807x/base-files/etc/hotplug.d/firmware/11-ath11k-caldata index 304d3a71b8..eec286e269 100644 --- a/target/linux/ipq807x/base-files/etc/hotplug.d/firmware/11-ath11k-caldata +++ b/target/linux/ipq807x/base-files/etc/hotplug.d/firmware/11-ath11k-caldata @@ -9,6 +9,7 @@ board=$(board_name) case "$FIRMWARE" in "ath11k/IPQ8074/hw2.0/cal-ahb-c000000.wifi.bin") case "$board" in + buffalo,wxr-5950ax12|\ edgecore,eap102|\ edimax,cax1800|\ dynalink,dl-wrx36|\ diff --git a/target/linux/ipq807x/base-files/lib/upgrade/buffalo.sh b/target/linux/ipq807x/base-files/lib/upgrade/buffalo.sh new file mode 100644 index 0000000000..d0ed258890 --- /dev/null +++ b/target/linux/ipq807x/base-files/lib/upgrade/buffalo.sh @@ -0,0 +1,55 @@ +. /lib/functions.sh + +# Prepare UBI devices for OpenWrt installation +# - rootfs (mtd22) +# - remove "ubi_rootfs" volume (rootfs on stock) +# - remove "fw_hash" volume (firmware hash) +# - user_property (mtd24) +# - remove "user_property_ubi" volume (user configuration) +# - remove "extra_property" volume (gzipped syslog) +buffalo_upgrade_prepare() { + local ubi_rootdev ubi_propdev + + if ! ubi_rootdev="$(nand_attach_ubi rootfs)" || \ + ! ubi_propdev="$(nand_attach_ubi user_property)"; then + echo "failed to attach UBI volume \"rootfs\" or \"user_property\", rebooting..." + reboot -f + fi + + ubirmvol /dev/$ubi_rootdev -N ubi_rootfs &> /dev/null || true + ubirmvol /dev/$ubi_rootdev -N fw_hash &> /dev/null || true + + ubirmvol /dev/$ubi_propdev -N user_property_ubi &> /dev/null || true + ubirmvol /dev/$ubi_propdev -N extra_property &> /dev/null || true +} + +# Re-create small dummy ubi_rootfs volume and update +# fw_hash volume to pass the checking by U-Boot +# - rootfs (mtd22) +# - re-create "ubi_rootfs" volume +# - re-create and update "fw_hash" volume +# - rootfs_recover (mtd23) +# - update "fw_hash" volume +buffalo_upgrade_optvol() { + local ubi_rootdev ubi_rcvrdev + local hashvol_root hashvol_rcvr + + if ! ubi_rootdev="$(nand_attach_ubi rootfs)" || \ + ! ubi_rcvrdev="$(nand_attach_ubi rootfs_recover)"; then + echo "failed to attach UBI volume \"rootfs\" or \"rootfs_recover\", rebooting..." + reboot -f + fi + + ubimkvol /dev/$ubi_rootdev -N ubi_rootfs -S 1 + ubimkvol /dev/$ubi_rootdev -N fw_hash -S 1 -t static + + if ! hashvol_root="$(nand_find_volume $ubi_rootdev fw_hash)" || \ + ! hashvol_rcvr="$(nand_find_volume $ubi_rcvrdev fw_hash)"; then + echo "\"fw_hash\" volume in \"rootfs\" or \"rootfs_recover\" not found, rebooting..." + reboot -f + fi + + echo -n "00000000000000000000000000000000" > /tmp/dummyhash.txt + ubiupdatevol /dev/$hashvol_root /tmp/dummyhash.txt + ubiupdatevol /dev/$hashvol_rcvr /tmp/dummyhash.txt +} diff --git a/target/linux/ipq807x/base-files/lib/upgrade/platform.sh b/target/linux/ipq807x/base-files/lib/upgrade/platform.sh index 4a6a91b5f5..683015898a 100644 --- a/target/linux/ipq807x/base-files/lib/upgrade/platform.sh +++ b/target/linux/ipq807x/base-files/lib/upgrade/platform.sh @@ -43,6 +43,14 @@ platform_pre_upgrade() { platform_do_upgrade() { case "$(board_name)" in + buffalo,wxr-5950ax12) + CI_KERN_UBIPART="rootfs" + CI_ROOT_UBIPART="user_property" + buffalo_upgrade_prepare + nand_do_flash_file "$1" || nand_do_upgrade_failed + nand_do_restore_config || nand_do_upgrade_failed + buffalo_upgrade_optvol + ;; dynalink,dl-wrx36) nand_do_upgrade "$1" ;; diff --git a/target/linux/ipq807x/files/arch/arm64/boot/dts/qcom/ipq8074-wxr-5950ax12.dts b/target/linux/ipq807x/files/arch/arm64/boot/dts/qcom/ipq8074-wxr-5950ax12.dts new file mode 100644 index 0000000000..d9b083c4d0 --- /dev/null +++ b/target/linux/ipq807x/files/arch/arm64/boot/dts/qcom/ipq8074-wxr-5950ax12.dts @@ -0,0 +1,376 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +/dts-v1/; + +#include "ipq8074.dtsi" +#include "ipq8074-hk-cpu.dtsi" +#include "ipq8074-ess.dtsi" +#include +#include +#include + +/ { + model = "Buffalo WXR-5950AX12"; + compatible = "buffalo,wxr-5950ax12", "qcom,ipq8074"; + + aliases { + serial0 = &blsp1_uart5; + led-boot = &led_power_white; + led-failsafe = &led_power_red; + led-running = &led_power_white; + led-upgrade = &led_power_white; + label-mac-device = &dp5_syn; + }; + + chosen { + stdout-path = "serial0:115200n8"; + bootargs-append = " ubi.mtd=user_property root=/dev/ubiblock1_0"; + }; + + leds { + compatible = "gpio-leds"; + + led-0 { + label = "white:router"; + gpios = <&tlmm 21 GPIO_ACTIVE_HIGH>; + color = ; + }; + + led-1 { + label = "red:router"; + gpios = <&tlmm 22 GPIO_ACTIVE_HIGH>; + color = ; + }; + + led_power_red: led-2 { + label = "red:power"; + gpios = <&tlmm 31 GPIO_ACTIVE_HIGH>; + color = ; + function = LED_FUNCTION_POWER; + }; + + led_power_white: led-3 { + label = "white:power"; + gpios = <&tlmm 34 GPIO_ACTIVE_HIGH>; + color = ; + function = LED_FUNCTION_POWER; + }; + + led-4 { + label = "white:internet"; + gpios = <&tlmm 43 GPIO_ACTIVE_HIGH>; + color = ; + }; + + led-5 { + label = "red:internet"; + gpios = <&tlmm 44 GPIO_ACTIVE_HIGH>; + color = ; + }; + + led-6 { + label = "red:wireless"; + gpios = <&tlmm 55 GPIO_ACTIVE_HIGH>; + color = ; + function = LED_FUNCTION_WLAN; + }; + + led-7 { + label = "white:wireless"; + gpios = <&tlmm 56 GPIO_ACTIVE_HIGH>; + color = ; + function = LED_FUNCTION_WLAN; + }; + }; + + keys { + compatible = "gpio-keys"; + + /* + * mode: 3x position switch + * + * - ROUTER + * - AP + * - WB (Wireless Bridge) + */ + ap { + label = "mode-ap"; + gpios = <&tlmm 29 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + + bridge { + label = "mode-wb"; + gpios = <&tlmm 30 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + + /* + * op: 2x position switch + * + * - AUTO + * - MANUAL (select Router/AP/WB manually) + */ + manual { + label = "op-manual"; + gpios = <&tlmm 52 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + + wps { + label = "wps"; + gpios = <&tlmm 51 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + + reset { + label = "reset"; + gpios = <&tlmm 54 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; + + reg_usb_vbus: regulator-5v-vbus { + compatible = "regulator-fixed"; + regulator-name = "vbus"; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + gpio = <&tlmm 64 GPIO_ACTIVE_HIGH>; + enable-active-high; + regulator-always-on; + }; +}; + +&tlmm { + mdio_pins: mdio-pins { + mdc { + pins = "gpio68"; + function = "mdc"; + drive-strength = <8>; + bias-pull-up; + }; + + mdio { + pins = "gpio69"; + function = "mdio"; + drive-strength = <8>; + bias-pull-up; + }; + }; +}; + +&blsp1_uart5 { + status = "okay"; +}; + +&prng { + status = "okay"; +}; + +&cryptobam { + status = "okay"; +}; + +&crypto { + status = "okay"; +}; + +&qpic_bam { + status = "okay"; +}; + +&qpic_nand { + status = "okay"; + + nand@0 { + reg = <0>; + nand-ecc-strength = <4>; + nand-ecc-step-size = <512>; + nand-bus-width = <8>; + + partitions { + compatible = "qcom,smem-part"; + + partition-0-appsblenv { + compatible = "fixed-partitions"; + label = "0:appsblenv"; + read-only; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + compatible = "u-boot,env"; + label = "env-data"; + reg = <0x0 0x40000>; + + macaddr_appsblenv_ethaddr: ethaddr { + }; + }; + }; + }; + }; +}; + +&mdio { + status = "okay"; + pinctrl-0 = <&mdio_pins>; + pinctrl-names = "default"; + /* + * RESET pins of phy chips + * + * WXR-5950AX12 has 2x RESET pins for QCA8075 and AQR113C. + * The pin of QCA8075 is for the chip and not phys in the chip, the + * pin of AQR113C is for 2x chips. So both pins are not appropriate + * to declare them as reset-gpios in phy nodes. + * Multiple entries in reset-gpios of mdio may not be supported, but + * leave the following as-is to show that the those reset pin exists. + */ + reset-gpios = <&tlmm 37 GPIO_ACTIVE_LOW>, /* QCA8075 RESET */ + <&tlmm 63 GPIO_ACTIVE_LOW>; /* AQR113C RESET (2x) */ + + aqr113c_1: ethernet-phy@0 { + compatible = "ethernet-phy-ieee802.3-c45"; + reg = <0x0>; + }; + + aqr113c_2: ethernet-phy@8 { + compatible = "ethernet-phy-ieee802.3-c45"; + reg = <0x8>; + }; + + qca8075_1: ethernet-phy@18 { + compatible = "ethernet-phy-ieee802.3-c22"; + reg = <0x18>; + }; + + qca8075_2: ethernet-phy@19 { + compatible = "ethernet-phy-ieee802.3-c22"; + reg = <0x19>; + }; + + qca8075_3: ethernet-phy@1a { + compatible = "ethernet-phy-ieee802.3-c22"; + reg = <0x1a>; + }; + + qca8075_4: ethernet-phy@1b { + compatible = "ethernet-phy-ieee802.3-c22"; + reg = <0x1b>; + }; + + qca8075_5: ethernet-phy@1c { + compatible = "ethernet-phy-ieee802.3-c22"; + reg = <0x1c>; + }; +}; + +&switch { + status = "okay"; + + switch_cpu_bmp = <0x1>; + switch_lan_bmp = <0x3e>; + switch_wan_bmp = <0x40>; + switch_mac_mode = <0xb>; + switch_mac_mode1 = <0xd>; + switch_mac_mode2 = <0xd>; + bm_tick_mode = <0>; + tm_tick_mode = <0>; + + qcom,port_phyinfo { + port@0 { + port_id = <1>; + phy_address = <0x18>; + }; + + port@1 { + port_id = <2>; + phy_address = <0x19>; + }; + + port@2 { + port_id = <3>; + phy_address = <0x1a>; + }; + + port@3 { + port_id = <4>; + phy_address = <0x1b>; + }; + + port@4 { + port_id = <5>; + ethernet-phy-ieee802.3-c45; + phy_address = <0x0>; + }; + + port@5 { + port_id = <6>; + ethernet-phy-ieee802.3-c45; + phy_address = <0x8>; + }; + }; +}; + +&edma { + status = "okay"; +}; + +&dp2 { + status = "okay"; + phy-handle = <&qca8075_2>; + label = "lan4"; + nvmem-cells = <&macaddr_appsblenv_ethaddr>; + nvmem-cell-names = "mac-address-ascii"; +}; + +&dp3 { + status = "okay"; + phy-handle = <&qca8075_3>; + label = "lan3"; + nvmem-cells = <&macaddr_appsblenv_ethaddr>; + nvmem-cell-names = "mac-address-ascii"; +}; + +&dp4 { + status = "okay"; + phy-handle = <&qca8075_4>; + label = "lan2"; + nvmem-cells = <&macaddr_appsblenv_ethaddr>; + nvmem-cell-names = "mac-address-ascii"; +}; + +&dp5_syn { + status = "okay"; + phy-handle = <&aqr113c_1>; + label = "wan"; + nvmem-cells = <&macaddr_appsblenv_ethaddr>; + nvmem-cell-names = "mac-address-ascii"; +}; + +&dp6_syn { + status = "okay"; + phy-handle = <&aqr113c_2>; + label = "lan1"; + nvmem-cells = <&macaddr_appsblenv_ethaddr>; + nvmem-cell-names = "mac-address-ascii"; +}; + +&ssphy_0 { + status = "okay"; +}; + +&qusb_phy_0 { + status = "okay"; +}; + +&usb_0 { + status = "okay"; + + vbus-supply = <®_usb_vbus>; +}; + +&wifi { + status = "okay"; + + qcom,ath11k-calibration-variant = "Buffalo-WXR-5950AX12"; +}; diff --git a/target/linux/ipq807x/image/generic.mk b/target/linux/ipq807x/image/generic.mk index 3145e1b53f..38770a5f24 100644 --- a/target/linux/ipq807x/image/generic.mk +++ b/target/linux/ipq807x/image/generic.mk @@ -17,6 +17,19 @@ define Device/UbiFit IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata endef +define Device/buffalo_wxr-5950ax12 + $(call Device/FitImage) + $(call Device/UbiFit) + DEVICE_VENDOR := Buffalo + DEVICE_MODEL := WXR-5950AX12 + BLOCKSIZE := 128k + PAGESIZE := 2048 + DEVICE_DTS_CONFIG := config@hk01 + SOC := ipq8074 + DEVICE_PACKAGES := ipq-wifi-buffalo_wxr-5950ax12 +endef +TARGET_DEVICES += buffalo_wxr-5950ax12 + define Device/dynalink_dl-wrx36 $(call Device/FitImage) $(call Device/UbiFit) -- 2.30.2