ath79: WNR612v2: improve device support
authorMichal Cieslakiewicz <michal.cieslakiewicz@wp.pl>
Wed, 16 Oct 2019 10:39:51 +0000 (12:39 +0200)
committerAdrian Schmutzler <freifunk@adrianschmutzler.de>
Mon, 17 Aug 2020 13:49:57 +0000 (15:49 +0200)
This patch improves ath79 support for Netgear WNR612v2.
Router functionality becomes identical to ar71xx version.

Changes include:
* software control over LAN LEDs via sysfs
* correct MAC addresses for network interfaces
* correct image size in device definition
* dts: 'keys' renamed to 'ath9k-keys'
* dts: 'label-mac-device' set to eth1 (LAN)
* dts: formatting adjustments

Signed-off-by: Michal Cieslakiewicz <michal.cieslakiewicz@wp.pl>
(cherry picked from commit d74324e407de7fb641310070762923f7e4cd2d6c)
[remove label-mac-device]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
target/linux/ath79/dts/ar7240_netgear_wnr612-v2.dts
target/linux/ath79/dts/ar7240_netgear_wnr612-v2.dtsi
target/linux/ath79/dts/ar7240_on_n150r.dts
target/linux/ath79/image/tiny-netgear.mk

index b3ceecf9324bb0ea4fc7de42b53293c9cb195b46..e6e3e8b6da058d07d2a6832e981db9925b92fdcc 100644 (file)
@@ -4,7 +4,7 @@
 #include "ar7240_netgear_wnr612-v2.dtsi"
 
 / {
-       model = "Netgear WNR612 v2";
        compatible = "netgear,wnr612-v2", "qca,ar7240";
+       model = "Netgear WNR612 v2";
 };
 
index 8e934429a3afc35fd22d41a5f172905c2204b492..07a2217a7730a0cfddc0ad169191a8442b8769af 100644 (file)
@@ -14,7 +14,7 @@
                led-upgrade = &power;
        };
 
-       keys {
+       ath9k-keys {
                compatible = "gpio-keys-polled";
                poll-interval = <20>;
 
 
        leds {
                compatible = "gpio-leds";
+
+               pinctrl-names = "default";
+               pinctrl-0 = <&jtag_disable_pins &switch_led_disable_pins &clks_disable_pins>;
+
                power: power {
                        label = "netgear:green:power";
                        gpios = <&gpio 11 GPIO_ACTIVE_LOW>;
                        label = "netgear:green:wan";
                        gpios = <&gpio 17 GPIO_ACTIVE_LOW>;
                };
+       };
+
+       ath9k-leds {
+               compatible = "gpio-leds";
 
                wlan: wlan {
                        label = "netgear:green:wlan";
@@ -70,7 +78,7 @@
                        #address-cells = <1>;
                        #size-cells = <1>;
 
-                       uboot: partition@0 {
+                       partition@0 {
                                reg = <0x0 0x40000>;
                                label = "u-boot";
                                read-only;
@@ -87,7 +95,7 @@
                                label = "firmware";
                        };
 
-                       partition@3f0000 {
+                       art: partition@3f0000 {
                                reg = <0x3f0000 0x10000>;
                                label = "art";
                                read-only;
 &eth0 {
        status = "okay";
 
-       mtd-mac-address = <&uboot 0x1fc00>;
-       mtd-mac-address-increment = <(-1)>;
+       mtd-mac-address = <&art 0x0>;
 };
 
 &eth1 {
        status = "okay";
 
-       mtd-mac-address = <&uboot 0x1fc00>;
-       mtd-mac-address-increment = <1>;
+       mtd-mac-address = <&art 0x6>;
 };
 
 &pcie {
        ath9k: wifi@0,0 {
                compatible = "pci168c,002b";
                reg = <0x0000 0 0 0 0>;
+               mtd-mac-address = <&art 0x0>;
+               mtd-mac-address-increment = <1>;
                qca,no-eeprom;
                #gpio-cells = <2>;
                gpio-controller;
index a318846a83c2544fec4bdc2b98ce6cbbb72a4818..886ac6dad5862c9b70292dc8cb6fb831a549597b 100644 (file)
@@ -4,7 +4,7 @@
 #include "ar7240_netgear_wnr612-v2.dtsi"
 
 / {
-       model = "ON Network N150R";
        compatible = "on,n150r", "qca,ar7240";
+       model = "ON Network N150R";
 };
 
index 42d6cab8bd7acd172c2038203416f9be25afdaa9..de1529901460746dce11eff3078edb7368d3a9bc 100644 (file)
@@ -4,7 +4,7 @@ define Device/netgear_ar7240
   ATH_SOC := ar7240
   NETGEAR_KERNEL_MAGIC := 0x32303631
   KERNEL_INITRAMFS := kernel-bin | append-dtb | lzma -d20 | netgear-uImage lzma
-  IMAGE_SIZE := 3904k
+  IMAGE_SIZE := 3712k
   IMAGE/default := append-kernel | pad-to $$$$(BLOCKSIZE) | netgear-squashfs | append-rootfs | pad-rootfs
   $(Device/netgear_ath79)
 endef