aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/ramips
diff options
context:
space:
mode:
Diffstat (limited to 'target/linux/ramips')
-rw-r--r--target/linux/ramips/dts/mt7621_zyxel_nwa-ax.dtsi151
-rw-r--r--target/linux/ramips/dts/mt7621_zyxel_nwa50ax.dts45
-rw-r--r--target/linux/ramips/dts/mt7621_zyxel_nwa55axe.dts6
-rw-r--r--target/linux/ramips/image/mt7621.mk34
-rw-r--r--target/linux/ramips/mt7621/base-files/etc/board.d/02_network4
-rw-r--r--target/linux/ramips/mt7621/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac6
-rwxr-xr-xtarget/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh4
7 files changed, 248 insertions, 2 deletions
diff --git a/target/linux/ramips/dts/mt7621_zyxel_nwa-ax.dtsi b/target/linux/ramips/dts/mt7621_zyxel_nwa-ax.dtsi
new file mode 100644
index 0000000000..e1353346a8
--- /dev/null
+++ b/target/linux/ramips/dts/mt7621_zyxel_nwa-ax.dtsi
@@ -0,0 +1,151 @@
+#include "mt7621.dtsi"
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+
+/ {
+ aliases {
+ label-mac-device = &gmac0;
+ };
+};
+
+&nand {
+ status = "okay";
+
+ mediatek,nmbm;
+ mediatek,bmt-max-ratio = <15>;
+ mediatek,bmt-max-reserved-blocks = <64>;
+ mediatek,bmt-remap-range =
+ <0x0 0x980000>,
+ <0x2980000 0x7800000>;
+
+ partitions {
+ compatible = "fixed-partitions";
+ #address-cells = <1>;
+ #size-cells = <1>;
+
+ partition@0 {
+ label = "u-boot";
+ reg = <0x0 0x80000>;
+ read-only;
+ };
+
+ partition@80000 {
+ label = "u-boot-env";
+ reg = <0x80000 0x80000>;
+ read-only;
+ };
+
+ factory: partition@100000 {
+ label = "factory";
+ reg = <0x100000 0x80000>;
+ read-only;
+ };
+
+ partition@180000 {
+ label = "firmware";
+ reg = <0x180000 0x2800000>;
+
+ /* This concatenates kernel1 & kernel2 & rootfs */
+
+ compatible = "fixed-partitions";
+ #address-cells = <1>;
+ #size-cells = <1>;
+
+ partition@0 {
+ label = "kernel";
+ reg = <0x0 0x800000>;
+ };
+
+ partition@400000 {
+ label = "ubi";
+ reg = <0x800000 0x2000000>;
+ };
+ };
+
+ partition@2980000 {
+ label = "zy_firmware_1";
+ reg = <0x2980000 0x2800000>;
+ read-only;
+ };
+
+ partition@5180000 {
+ label = "zy_rootfs_data";
+ reg = <0x5180000 0x1400000>;
+ read-only;
+ };
+
+ partition@6580000 {
+ label = "zy_logs";
+ reg = <0x6580000 0xd00000>;
+ read-only;
+ };
+
+ partition@7280000 {
+ label = "myzyxel";
+ reg = <0x7280000 0x480000>;
+ read-only;
+ };
+
+ partition@7700000 {
+ label = "bootconfig";
+ reg = <0x7700000 0x80000>;
+ };
+
+ mrd: partition@7780000 {
+ label = "mrd";
+ reg = <0x7780000 0x80000>;
+ read-only;
+ };
+ };
+};
+
+&pcie {
+ status = "okay";
+};
+
+&pcie1 {
+ wlan_5g: wifi@0,0 {
+ reg = <0x0 0 0 0 0>;
+ compatible = "mediatek,mt76";
+
+ mediatek,mtd-eeprom = <&factory 0x0>;
+
+ /* MAC-Address set in userspace */
+ };
+};
+
+&gmac0 {
+ nvmem-cells = <&macaddr_mrd_1fff8>;
+ nvmem-cell-names = "mac-address";
+};
+
+&switch0 {
+ ports {
+ port@4 {
+ status = "okay";
+ label = "lan";
+ };
+ };
+};
+
+&mrd {
+ compatible = "nvmem-cells";
+ #address-cells = <1>;
+ #size-cells = <1>;
+
+ macaddr_mrd_1fff8: macaddr@1fff8 {
+ reg = <0x1fff8 0x6>;
+ };
+};
+
+&state_default {
+ gpio {
+ groups = "uart3", "rgmii2";
+ function = "gpio";
+ };
+};
+
+&ethernet {
+ pinctrl-0 = <&mdio_pins>, <&rgmii1_pins>;
+};
diff --git a/target/linux/ramips/dts/mt7621_zyxel_nwa50ax.dts b/target/linux/ramips/dts/mt7621_zyxel_nwa50ax.dts
new file mode 100644
index 0000000000..70323f2422
--- /dev/null
+++ b/target/linux/ramips/dts/mt7621_zyxel_nwa50ax.dts
@@ -0,0 +1,45 @@
+#include "mt7621_zyxel_nwa-ax.dtsi"
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+
+/ {
+ compatible = "zyxel,nwa50ax", "mediatek,mt7621-soc";
+ model = "ZyXEL NWA50AX";
+
+ aliases {
+ led-boot = &led_system_green;
+ led-failsafe = &led_system_red;
+ led-running = &led_system_green;
+ led-upgrade = &led_system_red;
+ };
+
+ leds {
+ compatible = "gpio-leds";
+
+ led_system_red: system_red {
+ label = "red:system";
+ gpios = <&gpio 6 GPIO_ACTIVE_HIGH>;
+ };
+
+ led_system_green: system_green {
+ label = "green:system";
+ gpios = <&gpio 7 GPIO_ACTIVE_HIGH>;
+ };
+
+ system_blue {
+ label = "blue:system";
+ gpios = <&gpio 8 GPIO_ACTIVE_HIGH>;
+ };
+ };
+
+ keys {
+ compatible = "gpio-keys";
+
+ reset {
+ label = "reset";
+ gpios = <&gpio 30 GPIO_ACTIVE_LOW>;
+ linux,code = <KEY_RESTART>;
+ };
+ };
+};
diff --git a/target/linux/ramips/dts/mt7621_zyxel_nwa55axe.dts b/target/linux/ramips/dts/mt7621_zyxel_nwa55axe.dts
new file mode 100644
index 0000000000..04bbe340f2
--- /dev/null
+++ b/target/linux/ramips/dts/mt7621_zyxel_nwa55axe.dts
@@ -0,0 +1,6 @@
+#include "mt7621_zyxel_nwa-ax.dtsi"
+
+/ {
+ compatible = "zyxel,nwa55axe", "mediatek,mt7621-soc";
+ model = "ZyXEL NWA55AX";
+};
diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk
index c07ab39afd..a3bdacb32a 100644
--- a/target/linux/ramips/image/mt7621.mk
+++ b/target/linux/ramips/image/mt7621.mk
@@ -90,6 +90,13 @@ define Build/zytrx-header
mv $@.new $@
endef
+define Build/zyxel-nwa-fit
+ $(TOPDIR)/scripts/mkits-zyxel-fit.sh \
+ $@.its $@ "6b e1 6f e1 ff ff ff ff ff ff"
+ PATH=$(LINUX_DIR)/scripts/dtc:$(PATH) mkimage -f $@.its $@.new
+ @mv $@.new $@
+endef
+
define Device/dsa-migration
DEVICE_COMPAT_VERSION := 1.1
DEVICE_COMPAT_MESSAGE := Config cannot be migrated from swconfig to DSA
@@ -2193,6 +2200,33 @@ define Device/zyxel_nr7101
endef
TARGET_DEVICES += zyxel_nr7101
+define Device/zyxel_nwa-ax
+ $(Device/dsa-migration)
+ DEVICE_VENDOR := ZyXEL
+ BLOCKSIZE := 128k
+ PAGESIZE := 2048
+ KERNEL_SIZE := 8192k
+ UBINIZE_OPTS := -E 5
+ DEVICE_PACKAGES := kmod-mt7915e uboot-envtools zyxel-bootconfig
+ KERNEL := kernel-bin | lzma | fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb
+ IMAGES += factory.bin ramboot-factory.bin
+ IMAGE/factory.bin := append-kernel | pad-to $$(KERNEL_SIZE) | append-ubi | zyxel-nwa-fit
+ IMAGE/ramboot-factory.bin := append-kernel | pad-to $$(KERNEL_SIZE) | append-ubi
+ IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
+endef
+
+define Device/zyxel_nwa50ax
+ $(Device/zyxel_nwa-ax)
+ DEVICE_MODEL := NWA50AX
+endef
+TARGET_DEVICES += zyxel_nwa50ax
+
+define Device/zyxel_nwa55axe
+ $(Device/zyxel_nwa-ax)
+ DEVICE_MODEL := NWA55AXE
+endef
+TARGET_DEVICES += zyxel_nwa55axe
+
define Device/zyxel_wap6805
$(Device/dsa-migration)
BLOCKSIZE := 128k
diff --git a/target/linux/ramips/mt7621/base-files/etc/board.d/02_network b/target/linux/ramips/mt7621/base-files/etc/board.d/02_network
index 4b273e5a15..c285227080 100644
--- a/target/linux/ramips/mt7621/base-files/etc/board.d/02_network
+++ b/target/linux/ramips/mt7621/base-files/etc/board.d/02_network
@@ -21,7 +21,9 @@ ramips_setup_interfaces()
tplink,re650-v2|\
ubnt,unifi-6-lite|\
ubnt,unifi-flexhd|\
- ubnt,unifi-nanohd)
+ ubnt,unifi-nanohd|\
+ zyxel,nwa50ax|\
+ zyxel,nwa55axe)
ucidef_set_interface_lan "lan"
;;
ampedwireless,ally-r1900k|\
diff --git a/target/linux/ramips/mt7621/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac b/target/linux/ramips/mt7621/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac
index 0e08fb6df3..b92a4dcda6 100644
--- a/target/linux/ramips/mt7621/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac
+++ b/target/linux/ramips/mt7621/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac
@@ -106,4 +106,10 @@ case "$board" in
[ "$PHYNBR" = "1" ] && \
macaddr_setbit_la "$(mtd_get_mac_binary Factory 0xe000)" > /sys${DEVPATH}/macaddress
;;
+ zyxel,nwa50ax|\
+ zyxel,nwa55axe)
+ hw_mac_addr="$(mtd_get_mac_binary mrd 0x1fff8)"
+ [ "$PHYNBR" = "0" ] && macaddr_add $hw_mac_addr 1 > /sys${DEVPATH}/macaddress
+ [ "$PHYNBR" = "1" ] && macaddr_add $hw_mac_addr 2 > /sys${DEVPATH}/macaddress
+ ;;
esac
diff --git a/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh b/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh
index cf3caff702..6cfc852c11 100755
--- a/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh
@@ -95,7 +95,9 @@ platform_do_upgrade() {
xiaomi,mi-router-cr6606|\
xiaomi,mi-router-cr6608|\
xiaomi,mi-router-cr6609|\
- xiaomi,redmi-router-ac2100)
+ xiaomi,redmi-router-ac2100|\
+ zyxel,nwa50ax|\
+ zyxel,nwa55axe)
nand_do_upgrade "$1"
;;
iodata,wn-ax1167gr2|\