Browse Source

ath79: port buffalo WZR-450HP2 from ar71xx

Referencing commit a1837135e04b

Hardware
--------
SoC:	Qualcomm Atheros QCA9558
RAM:	128M DDR2 (Nanya NT5TU64M16HG-AC)
FLASH:	128M SPI-NAND (Spansion S34ML01G100TFI00)
WLAN:	QCA9558 3T3R 802.11 bgn
ETH:	Qualcomm Atheros QCA8337
UART:	115200 8n1
BUTTON:	Reset - WPS - "Router" switch
LED:	2x system-LED, 2x wlan-LED, 1x internet-LED,
	2x routing-LED
	LEDs besides the ethernet ports are controlled
	by the ethernet switch

MAC Address:
 use		address(sample 1)	source
 label		cc:e1:d5:xx:xx:ed	art@macaddr_wan
 lan		cc:e1:d5:xx:xx:ec	art@macaddr_lan
 wan		cc:e1:d5:xx:xx:ed	$label
 WiFi4_2G	cc:e1:d5:xx:xx:ec	art@cal_ath9k

Installation from Serial Console
------------

1. Connect to the serial console. Power up the device and interrupt
   autoboot when prompted

2. Connect a TFTP server reachable at 192.168.11.10/24
   to the ethernet port. Serve the OpenWrt initramfs image as
   "openwrt.bin"

3. Boot the initramfs image using U-Boot
   ath> tftpboot 0x84000000 openwrt.bin
   ath> bootm 0x84000000

4. Copy the OpenWrt sysupgrade image to the device using scp and
   install it like a normal upgrade (with no need to keeping config
   since no config from "previous OpenWRT installation" could be kept
   at all)

   # sysupgrade -n /path/to/openwrt/sysupgrade.bin

Installation from Web Interface
------------

To flash just do a firmware upgrade from the stock firmware (Buffalo
branded dd-wrt) with squashfs-factory.bin

Signed-off-by: Edward Chow <[email protected]>
Link: https://github.com/openwrt/openwrt/pull/17227
(cherry picked from commit 42254d3f5fa010466195c167c13f704ba85b3f54)
Link: https://github.com/openwrt/openwrt/pull/17359
Signed-off-by: Hauke Mehrtens <[email protected]>
Edward Chow 1 year ago
parent
commit
db0300cb1b

+ 1 - 0
package/boot/uboot-envtools/files/ath79

@@ -28,6 +28,7 @@ asus,rt-ac59u-v2|\
 asus,zenwifi-cd6n|\
 asus,zenwifi-cd6r|\
 buffalo,bhr-4grv2|\
+buffalo,wzr-450hp2|\
 devolo,magic-2-wifi|\
 engenius,eap300-v2|\
 engenius,eap350-v1|\

+ 179 - 0
target/linux/ath79/dts/qca9558_buffalo_wzr-450hp2.dts

@@ -0,0 +1,179 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+
+#include "qca955x.dtsi"
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+#include <dt-bindings/leds/common.h>
+
+/ {
+	compatible = "buffalo,wzr-450hp2", "qca,qca9558";
+	model = "Buffalo WZR-450HP2/WZR-450HP2D";
+
+	aliases {
+		led-boot = &led_status_green;
+		led-failsafe = &led_status_green;
+		led-running = &led_status_green;
+		led-upgrade = &led_status_green;
+		label-mac-device = &eth0;
+	};
+
+	leds {
+		compatible = "gpio-leds";
+
+		led_status_green: status_green {
+			function = LED_FUNCTION_STATUS;
+			color = <LED_COLOR_ID_GREEN>;
+			gpios = <&gpio 20 GPIO_ACTIVE_LOW>;
+			default-state = "on";
+		};
+
+		led_wlan_green: wlan_green {
+			function = LED_FUNCTION_WLAN;
+			color = <LED_COLOR_ID_GREEN>;
+			gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
+			linux,default-trigger = "phy0tpt";
+		};
+
+		led_wps_green: wps_green {
+			function = LED_FUNCTION_WPS;
+			color = <LED_COLOR_ID_GREEN>;
+			gpios = <&gpio 3 GPIO_ACTIVE_LOW>;
+		};
+	};
+
+	keys {
+		compatible = "gpio-keys";
+
+		reset {
+			label = "Reset button";
+			linux,code = <KEY_RESTART>;
+			gpios = <&gpio 17 GPIO_ACTIVE_LOW>;
+			debounce-interval = <60>;
+		};
+
+		rfkill {
+		       label = "RFKILL button";
+		       linux,code = <KEY_RFKILL>;
+		       gpios = <&gpio 21 GPIO_ACTIVE_LOW>;
+		       debounce-interval = <60>;
+		};
+	};
+};
+
+&spi {
+	status = "okay";
+
+	flash@0 {
+		compatible = "jedec,spi-nor";
+		reg = <0>;
+		spi-max-frequency = <25000000>;
+
+		partitions {
+			compatible = "fixed-partitions";
+			#address-cells = <1>;
+			#size-cells = <1>;
+
+			partition@0 {
+				label = "u-boot";
+				reg = <0x0 0x40000>;
+				read-only;
+			};
+
+			partition@40000 {
+				reg = <0x40000 0x10000>;
+				label = "u-boot-env";
+			};
+
+			partition@50000 {
+				compatible = "denx,uimage";
+				reg = <0x50000 0xf90000>;
+				label = "firmware";
+			};
+
+			partition@fe0000 {
+				reg = <0xfe0000 0x10000>;
+				label = "user_property";
+				read-only;
+			};
+
+			art: partition@ff0000 {
+				label = "art";
+				reg = <0xff0000 0x10000>;
+				read-only;
+
+				nvmem-layout {
+					compatible = "fixed-layout";
+					#address-cells = <1>;
+					#size-cells = <1>;
+
+					macaddr_wan: macaddr@0 {
+						reg = <0x0 0x6>;
+					};
+
+					macaddr_lan: macaddr@6 {
+						reg = <0x6 0x6>;
+					};
+
+					cal_ath9k: cal_ath9k@1000 {
+						reg = <0x1000 0x440>;
+					};
+				};
+			};
+		};
+	};
+};
+
+&mdio0 {
+	status = "okay";
+
+	phy0: ethernet-phy@0 {
+		reg = <0>;
+
+		qca,ar8327-initvals = <
+			0x04 0x07600000 /* PORT0 PAD MODE CTRL: RGMII, to eth0 */
+			0x0c 0x00080080 /* PORT6 PAD MODE CTRL: SGMII, to eth1 */
+			0x10 0x81000080 /* POWER ON STRAP */
+			0x50 0xcc35cc35 /* LED_CTRL0 */
+			0x54 0xca35ca35 /* LED_CTRL1 */
+			0x58 0xc935c935 /* LED_CTRL2 */
+			0x5c 0x03ffff00 /* LED_CTRL3 */
+			0x7c 0x0000007e /* PORT0_STATUS */
+			0x94 0x0000007e /* PORT6_STATUS */
+		>;
+	};
+};
+
+&eth0 {
+	status = "okay";
+
+	nvmem-cells = <&macaddr_wan>;
+	nvmem-cell-names = "mac-address";
+	phy-handle = <&phy0>;
+	pll-data = <0x56000000 0x00000101 0x00001616>;
+
+	gmac-config {
+		device = <&gmac>;
+		rgmii-enabled = <1>;
+	};
+};
+
+&eth1 {
+	status = "okay";
+
+	nvmem-cells = <&macaddr_lan>;
+	nvmem-cell-names = "mac-address";
+	pll-data = <0x03000101 0x00000101 0x00001616>;
+
+	fixed-link {
+		speed = <1000>;
+		full-duplex;
+	};
+};
+
+&wmac {
+	status = "okay";
+
+	nvmem-cells = <&cal_ath9k>;
+	nvmem-cell-names = "calibration";
+};

+ 4 - 0
target/linux/ath79/generic/base-files/etc/board.d/02_network

@@ -213,6 +213,10 @@ ath79_setup_interfaces()
 		ucidef_add_switch "switch0" \
 			"0@eth1" "1:lan" "2:lan" "3:lan" "4:lan" "5:wan" "6@eth0"
 		;;
+	buffalo,wzr-450hp2)
+		ucidef_add_switch "switch0" \
+			"6@eth1" "1:lan" "2:lan" "3:lan" "4:lan" "5:wan" "0@eth0"
+		;;
 	buffalo,wzr-600dhp|\
 	buffalo,wzr-hp-ag300h|\
 	tplink,archer-c25-v1|\

+ 12 - 0
target/linux/ath79/image/generic.mk

@@ -759,6 +759,18 @@ define Device/buffalo_wzr-hp-g450h
 endef
 TARGET_DEVICES += buffalo_wzr-hp-g450h
 
+define Device/buffalo_wzr-450hp2
+  $(Device/buffalo_common)
+  SOC := qca9558
+  DEVICE_MODEL := WZR-450HP2
+  DEVICE_ALT0_VENDOR := Buffalo
+  DEVICE_ALT0_MODEL := WZR-450HP2D
+  BUFFALO_PRODUCT := WZR-450HP2
+  IMAGE_SIZE := 15936k
+  SUPPORTED_DEVICES += wzr-450hp2
+endef
+TARGET_DEVICES += buffalo_wzr-450hp2
+
 define Device/comfast_cf-e110n-v2
   SOC := qca9533
   DEVICE_VENDOR := COMFAST