ramips: various Netgear R6120 fixes
authorDavid Bauer <mail@david-bauer.net>
Fri, 1 Feb 2019 23:34:43 +0000 (00:34 +0100)
committerChristian Lamparter <chunkeey@gmail.com>
Thu, 14 Feb 2019 15:56:14 +0000 (16:56 +0100)
The R6120 has no 5GHz WLAN LED, the assigned GPIO in fact controls
the WAN LED.

Renames the LED accordingly in the device-tree.
Removes the 5GHz WLAN LED trigger.
Adds the correct WAN port LED trigger.

----

Currently, the MAC address for the Netgear R6120 is read from the NVRAM
partition. The offset for the MAC address however is not consistent
across devices or firmware versions.

Switch to using the factory partition like all other Netgear devices do.

----

The LAN ports of the R6120 are labled in reverse on the casing.

Adjust LuCI switchport numbering accordingly.

----

The WiFi eeprom offsets for the R6120 are currently wrong (5GHz offset
is bigger than the partition itself).

Fixes poor performance on 2.4 and 5 GHz.

Signed-off-by: David Bauer <mail@david-bauer.net>
target/linux/ramips/base-files/etc/board.d/01_leds
target/linux/ramips/base-files/etc/board.d/02_network
target/linux/ramips/dts/R6120.dts

index 4e2d534c998a7dbfb0990b2a8bdcb5f77fe74233..f19d6be6e8e71bc2f34c2ae420844b8393cc7bed 100755 (executable)
@@ -252,8 +252,8 @@ mzk-ex750np)
        ;;
 netgear,r6120)
        ucidef_set_led_switch "lan" "lan" "$boardname:green:lan" "switch0" "0x0f"
+       ucidef_set_led_switch "wan" "wan" "$boardname:green:wan" "switch0" "0x10"
        ucidef_set_led_wlan "wlan2g" "WiFi 2.4GHz" "$boardname:green:wlan2g" "phy0tpt"
-       ucidef_set_led_wlan "wlan5g" "WiFi 5GHz" "$boardname:green:wlan5g" "phy1tpt"
        ;;
 oy-0001)
        set_wifi_led "$boardname:green:wifi"
index d84e738e89ad7c96f71b4e874b304ba550fcf1cb..fca3398f2d3e34f2c597db27469293480f222673 100755 (executable)
@@ -108,7 +108,6 @@ ramips_setup_interfaces()
        mtc,wr1201|\
        mzk-750dhp|\
        mzk-w300nh2|\
-       netgear,r6120|\
        nixcore-x1-8M|\
        nixcore-x1-16M|\
        oy-0001|\
@@ -341,6 +340,10 @@ ramips_setup_interfaces()
                        "0:lan" "1:lan" "2:lan" "3:lan" "6t@eth0"
                ucidef_set_interface_wan "usb0"
                ;;
+       netgear,r6120)
+               ucidef_add_switch "switch0" \
+                       "0:lan:4" "1:lan:3" "2:lan:2" "3:lan:1" "4:wan" "6@eth0"
+               ;;
        hc5761)
                ucidef_add_switch "switch0" \
                        "1:lan" "4:lan" "0:wan" "6@eth0"
index e7eb3f9aaa37896552e0c675ecd28bc890d0280b..07b1a165d344ca35ca58e4bce705256e5a84343c 100644 (file)
                        gpios = <&gpio1 9 GPIO_ACTIVE_LOW>;
                };
 
-               wlan5 {
-                       label = "r6120:green:wlan5g";
+               wan {
+                       label = "r6120:green:wan";
                        gpios = <&gpio1 8 GPIO_ACTIVE_LOW>;
                };
 
-               wlan5_orange {
-                       label = "r6120:orange:wlan5g";
+               wan_orange {
+                       label = "r6120:orange:wan";
                        gpios = <&gpio1 7 GPIO_ACTIVE_LOW>;
                };
        };
                                read-only;
                        };
 
-                       nvram: partition@60000 {
+                       partition@60000 {
                                label = "nvram";
                                reg = <0x60000 0x30000>;
                                read-only;
 
 &wmac {
        status = "okay";
-       mtd-mac-address = <&nvram 0x100b0>;
-       mediatek,mtd-eeprom = <&factory 0x20000>;
+       mtd-mac-address = <&factory 0x4>;
+       mediatek,mtd-eeprom = <&factory 0x0>;
 };
 
 &ethernet {
-       mtd-mac-address = <&nvram 0x100b0>;
+       mtd-mac-address = <&factory 0x4>;
 };
 
 &pcie {
 &pcie0 {
        wifi@0,0 {
                reg = <0x0000 0 0 0 0>;
-               mediatek,mtd-eeprom = <&factory 0x28000>;
+               mediatek,mtd-eeprom = <&factory 0x8000>;
                ieee80211-freq-limit = <5000000 6000000>;
-               mtd-mac-address = <&nvram 0x100b0>;
+               mtd-mac-address = <&factory 0x4>;
                mtd-mac-address-increment = <(2)>;
        };
 };