diff options
author | INAGAKI Hiroshi <musashino.open@gmail.com> | 2023-01-23 13:01:13 +0900 |
---|---|---|
committer | Christian Marangi <ansuelsmth@gmail.com> | 2023-02-12 01:18:39 +0100 |
commit | f490295bf213c5e181d16cbe53c163c1c9983e45 (patch) | |
tree | 1b6cff41d173a2cf6aedabd878263a88ce7d057d /target/linux/ipq807x/files/arch/arm64/boot/dts/qcom | |
parent | d256c0bfd715d7b6bc687e9734e802eec475e477 (diff) | |
download | upstream-f490295bf213c5e181d16cbe53c163c1c9983e45.tar.gz upstream-f490295bf213c5e181d16cbe53c163c1c9983e45.tar.bz2 upstream-f490295bf213c5e181d16cbe53c163c1c9983e45.zip |
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>
Diffstat (limited to 'target/linux/ipq807x/files/arch/arm64/boot/dts/qcom')
-rw-r--r-- | target/linux/ipq807x/files/arch/arm64/boot/dts/qcom/ipq8074-wxr-5950ax12.dts | 376 |
1 files changed, 376 insertions, 0 deletions
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 <dt-bindings/gpio/gpio.h> +#include <dt-bindings/leds/common.h> +#include <dt-bindings/input/input.h> + +/ { + 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_COLOR_ID_WHITE>; + }; + + led-1 { + label = "red:router"; + gpios = <&tlmm 22 GPIO_ACTIVE_HIGH>; + color = <LED_COLOR_ID_RED>; + }; + + led_power_red: led-2 { + label = "red:power"; + gpios = <&tlmm 31 GPIO_ACTIVE_HIGH>; + color = <LED_COLOR_ID_RED>; + function = LED_FUNCTION_POWER; + }; + + led_power_white: led-3 { + label = "white:power"; + gpios = <&tlmm 34 GPIO_ACTIVE_HIGH>; + color = <LED_COLOR_ID_WHITE>; + function = LED_FUNCTION_POWER; + }; + + led-4 { + label = "white:internet"; + gpios = <&tlmm 43 GPIO_ACTIVE_HIGH>; + color = <LED_COLOR_ID_WHITE>; + }; + + led-5 { + label = "red:internet"; + gpios = <&tlmm 44 GPIO_ACTIVE_HIGH>; + color = <LED_COLOR_ID_RED>; + }; + + led-6 { + label = "red:wireless"; + gpios = <&tlmm 55 GPIO_ACTIVE_HIGH>; + color = <LED_COLOR_ID_RED>; + function = LED_FUNCTION_WLAN; + }; + + led-7 { + label = "white:wireless"; + gpios = <&tlmm 56 GPIO_ACTIVE_HIGH>; + color = <LED_COLOR_ID_WHITE>; + 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 = <BTN_0>; + }; + + bridge { + label = "mode-wb"; + gpios = <&tlmm 30 GPIO_ACTIVE_LOW>; + linux,code = <BTN_1>; + }; + + /* + * op: 2x position switch + * + * - AUTO + * - MANUAL (select Router/AP/WB manually) + */ + manual { + label = "op-manual"; + gpios = <&tlmm 52 GPIO_ACTIVE_LOW>; + linux,code = <BTN_2>; + }; + + wps { + label = "wps"; + gpios = <&tlmm 51 GPIO_ACTIVE_LOW>; + linux,code = <KEY_WPS_BUTTON>; + }; + + reset { + label = "reset"; + gpios = <&tlmm 54 GPIO_ACTIVE_LOW>; + linux,code = <KEY_RESTART>; + }; + }; + + 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"; +}; |