[PATCH] ramips: add support for netgear r6020
Evan Jobling
evan.jobling at uon.edu.au
Sat May 30 06:39:47 EDT 2020
Signed-off-by: Evan Jobling <evan.jobling at uon.edu.au>
---
.../ramips/dts/mt7628an_netgear_r6020.dts | 144 ++++++++++++++++++
target/linux/ramips/image/mt76x8.mk | 24 +++
.../mt76x8/base-files/etc/board.d/01_leds | 5 +
.../mt76x8/base-files/etc/board.d/02_network | 1 +
4 files changed, 174 insertions(+)
create mode 100644 target/linux/ramips/dts/mt7628an_netgear_r6020.dts
diff --git a/target/linux/ramips/dts/mt7628an_netgear_r6020.dts b/target/li=
nux/ramips/dts/mt7628an_netgear_r6020.dts
new file mode 100644
index 0000000000..717fdde3fa
--- /dev/null
+++ b/target/linux/ramips/dts/mt7628an_netgear_r6020.dts
@@ -0,0 +1,144 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+/dts-v1/;
+
+#include "mt7628an.dtsi"
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+
+/ {
+ compatible =3D "netgear,r6020", "mediatek,mt7628an-soc";
+ model =3D "Netgear R6020 (AC750)";
+
+ aliases {
+ led-boot =3D &led_power;
+ led-failsafe =3D &led_power;
+ led-running =3D &led_power;
+ led-upgrade =3D &led_power;
+ };
+
+ keys {
+ compatible =3D "gpio-keys";
+
+ reset {
+ label =3D "reset";
+ gpios =3D <&gpio 6 GPIO_ACTIVE_LOW>;
+ linux,code =3D <KEY_RESTART>;
+ };
+ };
+
+ leds {
+ compatible =3D "gpio-leds";
+
+ lan {
+ label =3D "r6020:green:lan";
+ gpios =3D <&gpio 12 GPIO_ACTIVE_LOW>;
+ };
+
+ led_power: power {
+ label =3D "r6020:green:power";
+ gpios =3D <&gpio 11 GPIO_ACTIVE_LOW>;
+ };
+
+ wlan {
+ label =3D "r6020:green:wlan2g";
+ gpios =3D <&gpio 10 GPIO_ACTIVE_LOW>;
+ };
+
+ wlan_orange {
+ label =3D "r6020:orange:wlan2g";
+ gpios =3D <&gpio 9 GPIO_ACTIVE_LOW>;
+ };
+
+ wlan5 {
+ label =3D "r6020:green:wlan5g";
+ gpios =3D <&gpio 8 GPIO_ACTIVE_LOW>;
+ };
+
+ wlan5_orange {
+ label =3D "r6020:orange:wlan5g";
+ gpios =3D <&gpio 7 GPIO_ACTIVE_LOW>;
+ };
+ };
+};
+
+&pinctrl {
+ state_default: pinctrl0 {
+ gpio {
+ ralink,group =3D "p0led_an", "p1led_an", "p2led_an",
+ "p3led_an", "p4led_an", "wdt", "wled=
_an";
+ ralink,function =3D "gpio";
+ };
+ };
+};
+
+&spi0 {
+ status =3D "okay";
+
+ flash at 0 {
+ compatible =3D "jedec,spi-nor";
+ reg =3D <0>;
+ spi-max-frequency =3D <10000000>;
+ m25p,chunked-io =3D <32>;
+
+ partitions {
+ compatible =3D "fixed-partitions";
+ #address-cells =3D <1>;
+ #size-cells =3D <1>;
+
+ partition at 0 {
+ label =3D "u-boot";
+ reg =3D <0x0 0x40000>;
+ read-only;
+ };
+
+ factory: partition at 40000 {
+ label =3D "factory";
+ reg =3D <0x40000 0x20000>;
+ read-only;
+ };
+
+ nvram: partition at 60000 {
+ label =3D "nvram";
+ reg =3D <0x60000 0x30000>;
+ read-only;
+ };
+
+ partition at 90000 {
+ compatible =3D "denx,uimage";
+ label =3D "firmware";
+ reg =3D <0x90000 0x6f0000>;
+ };
+
+ partition at 780000 {
+ label =3D "reserved";
+ reg =3D <0x780000 0x80000>;
+ read-only;
+ };
+ };
+ };
+};
+
+&wmac {
+ status =3D "okay";
+ mediatek,mtd-eeprom =3D <&factory 0x0>;
+};
+
+
+ðernet {
+ mtd-mac-address =3D <&nvram 0x100b0>;
+};
+
+
+&pcie {
+ status =3D "okay";
+};
+
+&pcie0 {
+ wifi at 0,0 {
+ reg =3D <0x0000 0 0 0 0>;
+ mediatek,mtd-eeprom =3D <&factory 0x8000>;
+ ieee80211-freq-limit =3D <5000000 6000000>;
+ mtd-mac-address-increment =3D <(2)>;
+ };
+};
diff --git a/target/linux/ramips/image/mt76x8.mk b/target/linux/ramips/imag=
e/mt76x8.mk
index 16b5958ad1..2bfe71e15f 100644
--- a/target/linux/ramips/image/mt76x8.mk
+++ b/target/linux/ramips/image/mt76x8.mk
@@ -189,6 +189,28 @@ define Device/mercury_mac1200r-v2
endef
TARGET_DEVICES +=3D mercury_mac1200r-v2
+
+define Device/netgear_r6020
+ BLOCKSIZE :=3D 64k
+ IMAGE_SIZE :=3D 7270k
+ DEVICE_VENDOR :=3D NETGEAR
+ DEVICE_MODEL :=3D R6020
+ DEVICE_PACKAGES :=3D kmod-mt76x2 kmod-usb2 kmod-usb-ohci
+ SERCOMM_KERNEL_OFFSET :=3D 0x90000
+ SERCOMM_HWID :=3D CFR
+ SERCOMM_HWVER :=3D A001
+ SERCOMM_SWVER :=3D 0x0040
+ IMAGES +=3D factory.img
+ IMAGE/default :=3D append-kernel | pad-to $$$$(BLOCKSIZE)| append-rootfs=
| pad-rootfs
+ IMAGE/sysupgrade.bin :=3D $$(IMAGE/default) | append-metadata | check-si=
ze
+ IMAGE/factory.img :=3D pad-extra 576k | $$(IMAGE/default) | \
+ pad-to $$$$(BLOCKSIZE) | sercom-footer | pad-to 128 | zip R6020.bin=
| \
+ sercom-seal
+endef
+TARGET_DEVICES +=3D netgear_r6020
+
+
+
define Device/netgear_r6120
BLOCKSIZE :=3D 64k
IMAGE_SIZE :=3D 15744k
@@ -208,6 +230,8 @@ define Device/netgear_r6120
endef
TARGET_DEVICES +=3D netgear_r6120
+
+
define Device/onion_omega2
IMAGE_SIZE :=3D 16064k
DEVICE_VENDOR :=3D Onion
diff --git a/target/linux/ramips/mt76x8/base-files/etc/board.d/01_leds b/ta=
rget/linux/ramips/mt76x8/base-files/etc/board.d/01_leds
index 685895452a..a80c5e8ef9 100755
--- a/target/linux/ramips/mt76x8/base-files/etc/board.d/01_leds
+++ b/target/linux/ramips/mt76x8/base-files/etc/board.d/01_leds
@@ -46,6 +46,11 @@ hiwifi,hc5761a)
mediatek,linkit-smart-7688)
ucidef_set_led_wlan "wifi" "wifi" "linkit-smart-7688:orange:wifi" "=
phy0tpt"
;;
+netgear,r6020)
+ ucidef_set_led_switch "lan" "lan" "$boardname:green:lan" "switch0" =
"0x0f"
+ ucidef_set_led_wlan "wlan2g" "WiFi 2.4GHz" "$boardname:green:wlan2g=
" "phy0tpt"
+ ucidef_set_led_wlan "wlan5g" "WiFi 5GHz" "$boardname:green:wlan5g" =
"phy1tpt"
+ ;;
netgear,r6120)
ucidef_set_led_switch "lan" "lan" "$boardname:green:lan" "switch0" =
"0x0f"
ucidef_set_led_switch "wan" "wan" "$boardname:green:wan" "switch0" =
"0x10"
diff --git a/target/linux/ramips/mt76x8/base-files/etc/board.d/02_network b=
/target/linux/ramips/mt76x8/base-files/etc/board.d/02_network
index 398b5e88c7..816ff54a6c 100755
--- a/target/linux/ramips/mt76x8/base-files/etc/board.d/02_network
+++ b/target/linux/ramips/mt76x8/base-files/etc/board.d/02_network
@@ -92,6 +92,7 @@ ramips_setup_interfaces()
ucidef_add_switch "switch0" \
"1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" "0:wan" "6@=
eth0"
;;
+ netgear,r6020|\
netgear,r6120)
ucidef_add_switch "switch0" \
"0:lan:4" "1:lan:3" "2:lan:2" "3:lan:1" "4:wan" "6@=
eth0"
--
2.26.2
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel
More information about the openwrt-devel
mailing list