allnet,all5002)
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x10000" "0x10000"
;;
+ampedwireless,ally-00x19k|\
+ampedwireless,ally-r1900k)
+ ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x20000" "4"
+ ;;
buffalo,wsr-1166dhp|\
buffalo,wsr-600dhp|\
mediatek,linkit-smart-7688|\
--- /dev/null
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+
+#include "mt7621_ampedwireless_ally.dtsi"
+
+/ {
+ compatible = "ampedwireless,ally-00x19k", "mediatek,mt7621-soc";
+ model = "Amped Wireless ALLY-00X19K";
+};
+
+&switch0 {
+ ports {
+ port@2 {
+ status = "okay";
+ label = "lan";
+ };
+ };
+};
+
+&xhci {
+ status = "disabled";
+};
--- /dev/null
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+
+#include "mt7621_ampedwireless_ally.dtsi"
+
+/ {
+ compatible = "ampedwireless,ally-r1900k", "mediatek,mt7621-soc";
+ model = "Amped Wireless ALLY-R1900K";
+};
+
+&switch0 {
+ ports {
+ port@1 {
+ status = "okay";
+ label = "wan";
+ };
+
+ port@2 {
+ status = "okay";
+ label = "lan1";
+ };
+
+ port@3 {
+ status = "okay";
+ label = "lan2";
+ };
+
+ port@4 {
+ status = "okay";
+ label = "lan3";
+ };
+ };
+};
--- /dev/null
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+
+#include "mt7621.dtsi"
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+
+/ {
+ aliases {
+ led-boot = &led_status_amber;
+ led-failsafe = &led_status_amber;
+ led-running = &led_status_green;
+ led-upgrade = &led_status_red;
+ };
+
+ keys {
+ compatible = "gpio-keys";
+
+ led_switch {
+ label = "led_switch";
+ gpios = <&gpio 13 GPIO_ACTIVE_HIGH>;
+ linux,code = <KEY_LIGHTS_TOGGLE>;
+ linux,input-type = <EV_SW>;
+ };
+
+ reset {
+ label = "reset";
+ gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
+ linux,code = <KEY_RESTART>;
+ };
+
+ wps {
+ label = "wps";
+ gpios = <&gpio 18 GPIO_ACTIVE_HIGH>;
+ linux,code = <KEY_WPS_BUTTON>;
+ };
+ };
+
+ leds {
+ compatible = "gpio-leds";
+
+ led_status_green: status_green {
+ label = "green:status";
+ gpios = <&gpio 7 GPIO_ACTIVE_HIGH>;
+ };
+
+ led_status_red: status_red {
+ label = "red:status";
+ gpios = <&gpio 12 GPIO_ACTIVE_HIGH>;
+ };
+
+ led_status_amber: status_amber {
+ label = "amber:status";
+ gpios = <&gpio 14 GPIO_ACTIVE_HIGH>;
+ };
+ };
+};
+
+&pcie {
+ status = "okay";
+};
+
+&pcie0 {
+ wifi@0,0 {
+ compatible = "pci14c3,7615";
+ reg = <0x0000 0 0 0 0>;
+ mediatek,mtd-eeprom = <&factory 0x0000>;
+ ieee80211-freq-limit = <2400000 2500000>;
+ };
+};
+
+&pcie1 {
+ wifi@0,0 {
+ compatible = "pci14c3,7615";
+ reg = <0x0000 0 0 0 0>;
+ mediatek,mtd-eeprom = <&factory 0x8000>;
+ ieee80211-freq-limit = <5000000 6000000>;
+ };
+};
+
+&state_default {
+ gpio {
+ groups = "uart2", "uart3", "jtag", "wdt";
+ function = "gpio";
+ };
+};
+
+&nand {
+ status = "okay";
+
+ 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>;
+ };
+
+ factory: partition@100000 {
+ label = "factory";
+ reg = <0x100000 0x40000>;
+ read-only;
+ };
+
+ /*
+ * uboot expects to find kernels at 0x140000 & 0x2140000,
+ * referred to as Uimage & Uimage1 in factory FW, respectively.
+ * U-boot variable 'bootImage' controls which is booted;
+ * 0 for the first, 1 for the 2nd.
+ * There's a 3rd partition, Uimage2 (0x4140000), which
+ * I expected to be a recovery image, but is actually blank.
+ *
+ * A kernel is considered suitable for handing control over
+ * if its linux magic number exists & uImage CRC are correct.
+ * If either of those conditions fail, 'bootImage' value
+ * is toggled in uboot env & a restart performed in the hope that the
+ * alternate kernel is okay.
+ *
+ * Note uboot's tftp flash install writes the transferred
+ * image to the active kernel partition.
+ */
+
+ partition@140000 {
+ label = "kernel";
+ reg = <0x140000 0x400000>;
+ };
+
+ partition@540000 {
+ label = "ubi";
+ reg = <0x540000 0x1c00000>;
+ };
+
+ partition@2140000 {
+ label = "oem";
+ reg = <0x2140000 0x2000000>;
+ };
+
+ partition@4140000 {
+ label = "backup";
+ reg = <0x4140000 0x2000000>;
+ };
+
+ partition@6140000 {
+ label = "chime";
+ reg = <0x6140000 0xa00000>;
+ };
+
+ partition@6b40000 {
+ label = "data";
+ reg = <0x6b40000 0xa00000>;
+ };
+
+ partition@7540000 {
+ label = "reserved";
+ reg = <0x7540000 0x840000>;
+ read-only;
+ };
+
+ partition@7d80000 {
+ label = "nvram";
+ reg = <0x7d80000 0x100000>;
+ read-only;
+ };
+
+ partition@7e80000 {
+ label = "hwconfig";
+ reg = <0x7e80000 0x100000>;
+ read-only;
+ };
+ };
+};
endef
TARGET_DEVICES += alfa-network_quad-e4g
+define Device/ampedwireless_ally_common
+ $(Device/dsa-migration)
+ DEVICE_VENDOR := Amped Wireless
+ DEVICE_PACKAGES := kmod-mt7615e kmod-mt7615-firmware uboot-envtools
+ IMAGE_SIZE := 32768k
+ KERNEL_SIZE := 4096k
+ BLOCKSIZE := 128k
+ PAGESIZE := 2048
+ UBINIZE_OPTS := -E 5
+ KERNEL_INITRAMFS := $(KERNEL_DTB) | uImage lzma -n 'flashable-initramfs' |\
+ edimax-header -s CSYS -m RN68 -f 0x001c0000 -S 0x01100000
+ IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
+endef
+
+define Device/ampedwireless_ally-r1900k
+ $(Device/ampedwireless_ally_common)
+ DEVICE_MODEL := ALLY-R1900K
+ DEVICE_PACKAGES += kmod-usb3
+endef
+TARGET_DEVICES += ampedwireless_ally-r1900k
+
+define Device/ampedwireless_ally-00x19k
+ $(Device/ampedwireless_ally_common)
+ DEVICE_MODEL := ALLY-00X19K
+endef
+TARGET_DEVICES += ampedwireless_ally-00x19k
+
define Device/asiarf_ap7621-001
$(Device/dsa-migration)
IMAGE_SIZE := 16000k
local board="$1"
case $board in
- asiarf,ap7621-001|\
- winstars,ws-wn583a6)
- ucidef_set_interfaces_lan_wan "lan" "wan"
- ;;
- asiarf,ap7621-nv1|\
- glinet,gl-mt1300|\
- jcg,q20|\
- lenovo,newifi-d1|\
- mikrotik,routerboard-m33g|\
- xiaomi,mi-router-3g|\
- xiaomi,mi-router-3g-v2|\
- xiaomi,mi-router-4|\
- xiaomi,mi-router-4a-gigabit)
- ucidef_set_interfaces_lan_wan "lan1 lan2" "wan"
- ;;
+ ampedwireless,ally-00x19k|\
edimax,re23s|\
mikrotik,routerboard-m11g|\
netgear,ex6150|\
ubnt,unifi-nanohd)
ucidef_set_interface_lan "lan"
;;
+ ampedwireless,ally-r1900k|\
gehua,ghl-r-001|\
hiwifi,hc5962|\
xiaomi,mi-router-3-pro|\
xiaomi,redmi-router-ac2100)
ucidef_set_interfaces_lan_wan "lan1 lan2 lan3" "wan"
;;
+ asiarf,ap7621-001|\
+ winstars,ws-wn583a6)
+ ucidef_set_interfaces_lan_wan "lan" "wan"
+ ;;
+ asiarf,ap7621-nv1|\
+ glinet,gl-mt1300|\
+ jcg,q20|\
+ lenovo,newifi-d1|\
+ mikrotik,routerboard-m33g|\
+ xiaomi,mi-router-3g|\
+ xiaomi,mi-router-3g-v2|\
+ xiaomi,mi-router-4|\
+ xiaomi,mi-router-4a-gigabit)
+ ucidef_set_interfaces_lan_wan "lan1 lan2" "wan"
+ ;;
gnubee,gb-pc1|\
gnubee,gb-pc2)
ucidef_set_interface_lan "lan1 lan2"
local label_mac=""
case $board in
+ ampedwireless,ally-00x19k)
+ lan_mac=$(mtd_get_mac_ascii hwconfig HW.LAN.MAC.Address)
+ label_mac=$lan_mac
+ ;;
+ ampedwireless,ally-r1900k)
+ lan_mac=$(mtd_get_mac_ascii hwconfig HW.LAN.MAC.Address)
+ wan_mac=$(mtd_get_mac_ascii hwconfig HW.WAN.MAC.Address)
+ label_mac=$lan_mac
+ ;;
asus,rt-ac65p|\
asus,rt-ac85p)
wan_mac=$(mtd_get_mac_ascii u-boot-env et1macaddr)
fi
}
;;
+ ampedwireless,ally-00x19k|\
+ ampedwireless,ally-r1900k)
+ if [ "$(fw_printenv --lock / -n bootImage 2>/dev/null)" != "0" ]; then
+ fw_setenv --lock / bootImage 0 || exit 1
+ fi
+ ;;
mikrotik,routerboard-750gr3|\
mikrotik,routerboard-760igs|\
mikrotik,routerboard-m11g|\
esac
case "$board" in
+ ampedwireless,ally-00x19k|\
+ ampedwireless,ally-r1900k|\
asus,rt-ac65p|\
asus,rt-ac85p|\
dlink,dir-1960-a1|\