aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--target/linux/ath79/dts/qca9557_zyxel_nbg6616.dts126
-rw-r--r--target/linux/ath79/dts/qca9558_zyxel_nbg6716.dts158
-rw-r--r--target/linux/ath79/dts/qca955x_zyxel_nbg6x16.dtsi138
-rwxr-xr-xtarget/linux/ath79/generic/base-files/etc/board.d/02_network6
-rw-r--r--target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/11-ath10k-caldata3
-rw-r--r--target/linux/ath79/generic/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac5
-rw-r--r--target/linux/ath79/generic/base-files/lib/preinit/10_fix_eth_mac.sh5
-rw-r--r--target/linux/ath79/image/generic.mk17
8 files changed, 313 insertions, 145 deletions
diff --git a/target/linux/ath79/dts/qca9557_zyxel_nbg6616.dts b/target/linux/ath79/dts/qca9557_zyxel_nbg6616.dts
new file mode 100644
index 0000000000..81fe766fd9
--- /dev/null
+++ b/target/linux/ath79/dts/qca9557_zyxel_nbg6616.dts
@@ -0,0 +1,126 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+/dts-v1/;
+
+#include "qca955x_zyxel_nbg6x16.dtsi"
+
+/ {
+ compatible = "zyxel,nbg6616", "qca,qca9557";
+ model = "ZyXEL NBG6616";
+
+ aliases {
+ led-boot = &led_power;
+ led-failsafe = &led_power;
+ led-running = &led_power;
+ led-upgrade = &led_power;
+ };
+
+ leds {
+ compatible = "gpio-leds";
+
+ led_power: power {
+ label = "nbg6616:green:power";
+ gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
+ };
+
+ usb1 {
+ label = "nbg6616:green:usb1";
+ gpios = <&gpio 21 GPIO_ACTIVE_LOW>;
+ linux,default-trigger = "usbport";
+ trigger-sources = <&hub_port0>;
+ };
+
+ usb2 {
+ label = "nbg6616:green:usb2";
+ gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
+ linux,default-trigger = "usbport";
+ trigger-sources = <&hub_port1>;
+ };
+
+ wifi2g {
+ label = "nbg6616:green:wifi2g";
+ gpios = <&gpio 19 GPIO_ACTIVE_LOW>;
+ linux,default-trigger = "phy1tpt";
+ };
+
+ wifi5g {
+ label = "nbg6616:green:wifi5g";
+ gpios = <&gpio 17 GPIO_ACTIVE_LOW>;
+ linux,default-trigger = "phy0tpt";
+ };
+
+ wps {
+ label = "nbg6616:green:wps";
+ gpios = <&gpio 0 GPIO_ACTIVE_LOW>;
+ };
+ };
+};
+
+&gpio_usb_power {
+ line-name = "nbg6616:power:usb";
+};
+
+&spi {
+ status = "okay";
+
+ num-cs = <1>;
+
+ 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 = <0x000000 0x030000>;
+ read-only;
+ };
+
+ partition@30000 {
+ label = "u-boot-env";
+ reg = <0x030000 0x010000>;
+ };
+
+ art: partition@40000 {
+ label = "art";
+ reg = <0x040000 0x010000>;
+ read-only;
+ };
+
+ partition@50000 {
+ label = "zyxel_rfsd";
+ reg = <0x050000 0x060000>;
+ };
+
+ partition@b0000 {
+ label = "romd";
+ reg = <0x0b0000 0x060000>;
+ };
+
+ partition@110000 {
+ label = "header";
+ reg = <0x110000 0x010000>;
+ };
+
+ partition@120000 {
+ label = "firmware";
+ reg = <0x120000 0xee0000>;
+ compatible = "denx,uimage";
+ };
+ };
+ };
+};
+
+&pcie1 {
+ status = "okay";
+
+ wifi@0,0 {
+ compatible = "qcom,ath10k";
+ reg = <0 0 0 0 0>;
+ qca,no-eeprom;
+ };
+};
diff --git a/target/linux/ath79/dts/qca9558_zyxel_nbg6716.dts b/target/linux/ath79/dts/qca9558_zyxel_nbg6716.dts
index 2249263522..90328078dd 100644
--- a/target/linux/ath79/dts/qca9558_zyxel_nbg6716.dts
+++ b/target/linux/ath79/dts/qca9558_zyxel_nbg6716.dts
@@ -1,10 +1,7 @@
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
/dts-v1/;
-#include <dt-bindings/gpio/gpio.h>
-#include <dt-bindings/input/input.h>
-
-#include "qca955x.dtsi"
+#include "qca955x_zyxel_nbg6x16.dtsi"
/ {
compatible = "zyxel,nbg6716", "qca,qca9558";
@@ -61,59 +58,26 @@
gpios = <&gpio 21 GPIO_ACTIVE_LOW>;
};
};
+};
- keys {
- compatible = "gpio-keys";
-
- reset {
- label = "reset";
- linux,code = <KEY_RESTART>;
- gpios = <&gpio 23 GPIO_ACTIVE_LOW>;
- debounce-interval = <60>;
- };
-
- wifi {
- label = "WiFi button";
- linux,code = <KEY_RFKILL>;
- linux,input-type = <EV_SW>;
- gpios = <&gpio 1 GPIO_ACTIVE_HIGH>;
- debounce-interval = <60>;
- };
-
- usb1 {
- label = "USB1 eject button";
- linux,code = <BTN_1>;
- gpios = <&gpio 0 GPIO_ACTIVE_LOW>;
- debounce-interval = <60>;
- };
-
- usb2 {
- label = "USB2 eject button";
- linux,code = <BTN_2>;
- gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
- debounce-interval = <60>;
- };
-
- wps {
- label = "WPS button";
- linux,code = <KEY_WPS_BUTTON>;
- gpios = <&gpio 22 GPIO_ACTIVE_LOW>;
- debounce-interval = <60>;
- };
+&keys {
+ usb1 {
+ label = "USB1 eject button";
+ linux,code = <BTN_1>;
+ gpios = <&gpio 0 GPIO_ACTIVE_LOW>;
+ debounce-interval = <60>;
};
-};
-&gpio {
- usb_power {
- gpio-hog;
- gpios = <16 0>;
- output-high;
- line-name = "nbg6716:power:usb";
+ usb2 {
+ label = "USB2 eject button";
+ linux,code = <BTN_2>;
+ gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
+ debounce-interval = <60>;
};
};
-&uart {
- status = "okay";
+&gpio_usb_power {
+ line-name = "nbg6716:power:usb";
};
&spi {
@@ -196,71 +160,6 @@
};
};
-&mdio0 {
- status = "okay";
-
- phy17: ethernet-phy@11 {
- reg = <0x11>;
- phy-mode = "rgmii-id";
- };
-
- switch0@1f {
- compatible = "qca,ar8327";
- reg = <0x1f>;
- qca,ar8327-initvals = <
- 0x04 0x87600000 /* PORT0 PAD MODE CTRL */
- 0x0c 0x00080080 /* PORT6 PAD MODE CTRL */
- 0x10 0x81000080 /* POWER_ON_STRAP */
- 0x50 0xffb7ffb7 /* LED_CTRL0 */
- 0x54 0xffb7ffb7 /* LED_CTRL1 */
- 0x58 0xffb7ffb7 /* LED_CTRL2 */
- 0x5c 0x03ffff00 /* LED_CTRL3 */
- 0x7c 0x0000007e /* PORT0_STATUS */
- 0x94 0x0000007e /* PORT6 STATUS */
- >;
- };
-};
-
-&mdio1 {
- status = "okay";
-
- phy1: ethernet-phy@1 {
- reg = <1>;
- phy-mode = "sgmii";
- };
-};
-
-
-&eth0 {
- status = "okay";
-
- pll-data = <0xa6000000 0x00000101 0x00001616>;
- phy-handle = <&phy17>;
-
- fixed-link {
- speed = <1000>;
- full-duplex;
- };
-};
-
-&eth1 {
- status = "okay";
-
- pll-data = <0x03000101 0x00000101 0x00001616>;
- phy-handle = <&phy1>;
-
- fixed-link {
- speed = <1000>;
- full-duplex;
- };
-};
-
-&wmac {
- status = "okay";
-
- mtd-cal-data = <&art 0x1000>;
-};
-
&pcie1 {
status = "okay";
@@ -270,30 +169,3 @@
qcom,ath10k-calibration-variant = "ZyXEL-NBG6716";
};
};
-
-&usb_phy0 {
- status = "okay";
-};
-
-&usb_phy1 {
- status = "okay";
-};
-
-&usb0 {
- status = "okay";
-
- hub_port0: port@1 {
- reg = <1>;
- #trigger-source-cells = <0>;
- };
-
-};
-
-&usb1 {
- status = "okay";
-
- hub_port1: port@1 {
- reg = <1>;
- #trigger-source-cells = <0>;
- };
-};
diff --git a/target/linux/ath79/dts/qca955x_zyxel_nbg6x16.dtsi b/target/linux/ath79/dts/qca955x_zyxel_nbg6x16.dtsi
new file mode 100644
index 0000000000..dfc6728be1
--- /dev/null
+++ b/target/linux/ath79/dts/qca955x_zyxel_nbg6x16.dtsi
@@ -0,0 +1,138 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+
+#include "qca955x.dtsi"
+
+/ {
+ keys: keys {
+ compatible = "gpio-keys";
+
+ wifi {
+ label = "WiFi on/off button";
+ linux,code = <KEY_RFKILL>;
+ linux,input-type = <EV_SW>;
+ gpios = <&gpio 1 GPIO_ACTIVE_HIGH>;
+ debounce-interval = <60>;
+ };
+
+ wps {
+ label = "WPS button";
+ linux,code = <KEY_WPS_BUTTON>;
+ gpios = <&gpio 22 GPIO_ACTIVE_LOW>;
+ debounce-interval = <60>;
+ };
+
+ reset {
+ label = "Reset button";
+ linux,code = <KEY_RESTART>;
+ gpios = <&gpio 23 GPIO_ACTIVE_LOW>;
+ debounce-interval = <60>;
+ };
+ };
+};
+
+&gpio {
+ gpio_usb_power: usb_power {
+ gpio-hog;
+ gpios = <16 0>;
+ output-high;
+ };
+};
+
+&uart {
+ status = "okay";
+};
+
+&mdio0 {
+ status = "okay";
+
+ phy17: ethernet-phy@11 {
+ reg = <0x11>;
+ phy-mode = "rgmii-id";
+ };
+
+ switch0@1f {
+ compatible = "qca,ar8327";
+ reg = <0x1f>;
+ qca,ar8327-initvals = <
+ 0x04 0x87600000 /* PORT0 PAD MODE CTRL */
+ 0x0c 0x00080080 /* PORT6 PAD MODE CTRL */
+ 0x10 0x81000080 /* POWER_ON_STRAP */
+ 0x50 0xffb7ffb7 /* LED_CTRL0 */
+ 0x54 0xffb7ffb7 /* LED_CTRL1 */
+ 0x58 0xffb7ffb7 /* LED_CTRL2 */
+ 0x5c 0x03ffff00 /* LED_CTRL3 */
+ 0x7c 0x0000007e /* PORT0_STATUS */
+ 0x94 0x0000007e /* PORT6 STATUS */
+ >;
+ };
+};
+
+&mdio1 {
+ status = "okay";
+
+ phy1: ethernet-phy@1 {
+ reg = <1>;
+ phy-mode = "sgmii";
+ };
+};
+
+
+&eth0 {
+ status = "okay";
+
+ pll-data = <0xa6000000 0x00000101 0x00001616>;
+ phy-handle = <&phy17>;
+
+ fixed-link {
+ speed = <1000>;
+ full-duplex;
+ };
+};
+
+&eth1 {
+ status = "okay";
+
+ pll-data = <0x03000101 0x00000101 0x00001616>;
+ phy-handle = <&phy1>;
+
+ fixed-link {
+ speed = <1000>;
+ full-duplex;
+ };
+};
+
+&wmac {
+ status = "okay";
+
+ mtd-cal-data = <&art 0x1000>;
+};
+
+&usb_phy0 {
+ status = "okay";
+};
+
+&usb_phy1 {
+ status = "okay";
+};
+
+&usb0 {
+ status = "okay";
+
+ hub_port0: port@1 {
+ reg = <1>;
+ #trigger-source-cells = <0>;
+ };
+
+};
+
+&usb1 {
+ status = "okay";
+
+ hub_port1: port@1 {
+ reg = <1>;
+ #trigger-source-cells = <0>;
+ };
+};
diff --git a/target/linux/ath79/generic/base-files/etc/board.d/02_network b/target/linux/ath79/generic/base-files/etc/board.d/02_network
index b4e1829618..01b083ddad 100755
--- a/target/linux/ath79/generic/base-files/etc/board.d/02_network
+++ b/target/linux/ath79/generic/base-files/etc/board.d/02_network
@@ -131,7 +131,8 @@ ath79_setup_interfaces()
"0@eth0" "1:lan" "2:lan" "3:lan" "4:lan"
;;
comfast,cf-wr650ac-v1|\
- comfast,cf-wr650ac-v2)
+ comfast,cf-wr650ac-v2|\
+ zyxel,nbg6616)
ucidef_add_switch "switch0" \
"0@eth0" "1:lan" "2:lan" "3:lan" "4:lan" "5:wan" "6@eth1"
;;
@@ -540,6 +541,9 @@ ath79_setup_macs()
wd,mynet-wifi-rangeextender)
lan_mac=$(nvram get et0macaddr)
;;
+ zyxel,nbg6616)
+ label_mac=$(mtd_get_mac_ascii u-boot-env ethaddr)
+ ;;
esac
[ -n "$lan_mac" ] && ucidef_set_interface_macaddr "lan" $lan_mac
diff --git a/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/11-ath10k-caldata b/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
index 863fdc842a..37f1792fad 100644
--- a/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
+++ b/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
@@ -59,7 +59,8 @@ case "$FIRMWARE" in
engenius,epg5000|\
iodata,wn-ac1167dgr|\
iodata,wn-ac1600dgr2|\
- sitecom,wlr-7100)
+ sitecom,wlr-7100|\
+ zyxel,nbg6616)
caldata_extract "art" 0x5000 0x844
ath10k_patch_mac $(macaddr_add $(mtd_get_mac_ascii u-boot-env ethaddr) +1)
;;
diff --git a/target/linux/ath79/generic/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac b/target/linux/ath79/generic/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac
index 8ea23a8ac6..b592da00e3 100644
--- a/target/linux/ath79/generic/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac
+++ b/target/linux/ath79/generic/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac
@@ -50,4 +50,9 @@ case "$board" in
[ "$PHYNBR" -eq 0 ] && \
macaddr_add "$(mtd_get_mac_text mac 0x18)" 1 > /sys${DEVPATH}/macaddress
;;
+ zyxel,nbg6616)
+ # Set mac address for 2.4g device
+ [ "$PHYNBR" -eq 1 ] && \
+ mtd_get_mac_ascii u-boot-env ethaddr > /sys${DEVPATH}/macaddress
+ ;;
esac
diff --git a/target/linux/ath79/generic/base-files/lib/preinit/10_fix_eth_mac.sh b/target/linux/ath79/generic/base-files/lib/preinit/10_fix_eth_mac.sh
index c5d9cd536f..ad7372eb03 100644
--- a/target/linux/ath79/generic/base-files/lib/preinit/10_fix_eth_mac.sh
+++ b/target/linux/ath79/generic/base-files/lib/preinit/10_fix_eth_mac.sh
@@ -17,6 +17,11 @@ preinit_set_mac_address() {
siemens,ws-ap3610)
ip link set dev eth0 address $(mtd_get_mac_ascii cfg1 ethaddr)
;;
+ zyxel,nbg6616)
+ ethaddr=$(mtd_get_mac_ascii u-boot-env ethaddr)
+ ip link set dev eth0 address $(macaddr_add $ethaddr 2)
+ ip link set dev eth1 address $(macaddr_add $ethaddr 3)
+ ;;
esac
}
diff --git a/target/linux/ath79/image/generic.mk b/target/linux/ath79/image/generic.mk
index 81117f0827..e2c37f7a57 100644
--- a/target/linux/ath79/image/generic.mk
+++ b/target/linux/ath79/image/generic.mk
@@ -1510,3 +1510,20 @@ define Device/zbtlink_zbt-wd323
kmod-usb-serial kmod-usb-serial-cp210x uqmi
endef
TARGET_DEVICES += zbtlink_zbt-wd323
+
+define Device/zyxel_nbg6616
+ SOC := qca9557
+ DEVICE_VENDOR := ZyXEL
+ DEVICE_MODEL := NBG6616
+ DEVICE_PACKAGES := kmod-usb2 kmod-usb-ledtrig-usbport kmod-rtc-pcf8563 \
+ kmod-ath10k-ct ath10k-firmware-qca988x-ct
+ IMAGE_SIZE := 15232k
+ RAS_BOARD := NBG6616
+ RAS_ROOTFS_SIZE := 14464k
+ RAS_VERSION := "OpenWrt Linux-$(LINUX_VERSION)"
+ IMAGES += factory.bin
+ IMAGE/factory.bin := append-kernel | pad-to $$$$(BLOCKSIZE) | \
+ append-rootfs | pad-rootfs | pad-to 64k | check-size | zyxel-ras-image
+ SUPPORTED_DEVICES += nbg6616
+endef
+TARGET_DEVICES += zyxel_nbg6616