ramips: several fixes for HC5x61
authorDeng Qingfang <dengqf6@mail2.sysu.edu.cn>
Fri, 14 Dec 2018 10:15:52 +0000 (18:15 +0800)
committerMathias Kresin <dev@kresin.me>
Sat, 15 Dec 2018 19:02:07 +0000 (20:02 +0100)
 - Mark other partitions as read-only for HC5x61

 - Only enable USB and PCIe for HC5761/HC5861
   HC5661 doesn't have a USB port, and there is nothing attached to its PCIe.

 - Fix HC5761 switch ports
   HC5761 has only 3 ethernet ports (1x WAN + 2x LAN). Remove unused ports.

 - Fix HC5861 5GHz radio
   HC5861 has MT7612EN 5GHz WiFi chip, not MT7610EN.

 - Fix HC5761/HC5861 WiFi LEDs
   After 5GHz is enabled, it becomes wlan0. And 2.4GHz would be wlan1.

 - Fix HC5x61 image size
   It should be 15872k (0xf80000)

Signed-off-by: Deng Qingfang <dengqf6@mail2.sysu.edu.cn>
target/linux/ramips/base-files/etc/board.d/01_leds
target/linux/ramips/base-files/etc/board.d/02_network
target/linux/ramips/dts/HC5761.dts
target/linux/ramips/dts/HC5861.dts
target/linux/ramips/dts/HC5X61.dtsi
target/linux/ramips/image/mt7620.mk

index f8c4b05b9a55e6ae194553dd683d28ba51e65310..0fca40e1e01044e1519f73bc8605c09665054290 100755 (executable)
@@ -167,15 +167,11 @@ hc5661a)
        ucidef_set_led_netdev "internet" "internet" "$boardname:blue:internet" "eth0.2"
        set_wifi_led "$boardname:blue:wlan2g"
        ;;
-hc5761)
-       ucidef_set_led_netdev "internet" "internet" "$boardname:blue:internet" "eth0.2"
-       set_wifi_led "$boardname:blue:wlan2g"
-       ucidef_set_led_netdev "wifi5g" "wifi5g" "$boardname:blue:wlan5g" "rai0"
-       ;;
+hc5761|\
 hc5861)
        ucidef_set_led_netdev "internet" "internet" "$boardname:blue:internet" "eth0.2"
-       set_wifi_led "$boardname:blue:wlan2g"
-       ucidef_set_led_netdev "wifi5g" "wifi5g" "$boardname:blue:wlan5g" "rai0"
+       ucidef_set_led_netdev "wifi5g" "wifi5g" "$boardname:blue:wlan5g" "wlan0"
+       ucidef_set_led_netdev "wifi2g" "wifi2g" "$boardname:blue:wlan2g" "wlan1"
        ;;
 hg255d)
        set_wifi_led "$boardname:green:wlan"
index 2f5005009ac65e226eb4971c316e767c08a88378..eed8d503923ea7894d5cec420df26945c6b61d3c 100755 (executable)
@@ -304,7 +304,8 @@ ramips_setup_interfaces()
                ucidef_add_switch "switch1" \
                        "1:lan" "2:lan" "3:lan" "4:lan" "0:wan" "6@eth0"
                ;;
-       hc5*61|\
+       hc5661|\
+       hc5861|\
        y1s)
                ucidef_add_switch "switch0" \
                        "1:lan" "2:lan" "3:lan" "4:lan" "5:lan" "0:wan" "6@eth0"
@@ -327,6 +328,10 @@ ramips_setup_interfaces()
                        "0:lan" "1:lan" "2:lan" "3:lan" "6t@eth0"
                ucidef_set_interface_wan "usb0"
                ;;
+       hc5761)
+               ucidef_add_switch "switch0" \
+                       "1:lan" "4:lan" "0:wan" "6@eth0"
+               ;;
        mzk-dp150n|\
        vocore-8M|\
        vocore-16M)
index 785535811dc8022ce68239006b2eca929d89c322..31ed99ad09b6aeb62ca1d68ead9ad70eb198c390 100644 (file)
        };
 };
 
+&ehci {
+       status = "okay";
+};
+
+&ohci {
+       status = "okay";
+};
+
+&pcie {
+       status = "okay";
+};
+
 &pcie0 {
        mt76@0,0 {
                reg = <0x0000 0 0 0 0>;
index f157991d9104976d6c65f52d0f45cd51abfbff89..519996486c7f6b528a9a7afcdc3466ef56465b93 100644 (file)
        };
 };
 
+&ehci {
+       status = "okay";
+};
+
+&ohci {
+       status = "okay";
+};
+
 &ethernet {
        status = "okay";
        mtd-mac-address = <&factory 0x4>;
        mediatek,port4 = "gmac";
 };
 
+&pcie {
+       status = "okay";
+};
+
 &pcie0 {
        mt76@0,0 {
                reg = <0x0000 0 0 0 0>;
index 256d94a250a433a22f7b39f7a5f254e7d8449c21..8da05adeefb1554799f591247cfd9b88b7f8b49d 100644 (file)
@@ -67,6 +67,7 @@
                        partition@0 {
                                label = "u-boot";
                                reg = <0x0 0x30000>;
+                               read-only;
                        };
 
                        partition@30000 {
@@ -78,6 +79,7 @@
                        factory: partition@40000 {
                                label = "factory";
                                reg = <0x40000 0x10000>;
+                               read-only;
                        };
 
                        partition@50000 {
                        partition@fd0000 {
                                label = "hwf_config";
                                reg = <0xfd0000 0x10000>;
+                               read-only;
                        };
 
                        bdinfo: partition@fe0000 {
                                label = "bdinfo";
                                reg = <0xfe0000 0x10000>;
+                               read-only;
                        };
 
                        partition@ff0000 {
                                label = "backup";
                                reg = <0xff0000 0x10000>;
+                               read-only;
                        };
                };
        };
 };
 
-&ehci {
-       status = "okay";
-};
-
-&ohci {
-       status = "okay";
-};
-
 &ethernet {
        pinctrl-names = "default";
        pinctrl-0 = <&ephy_pins>;
        pinctrl-0 = <&pa_pins>;
 };
 
-&pcie {
-       status = "okay";
-};
-
 &pinctrl {
        state_default: pinctrl0 {
                gpio {
index 10c3748885580aef45a7ce3911a2eeb5ac740db3..3a8b04a39c442db6965184e6d27c91076d1cb9b5 100644 (file)
@@ -297,15 +297,15 @@ TARGET_DEVICES += gl-mt750
 
 define Device/hc5661
   DTS := HC5661
-  IMAGE_SIZE := $(ralink_default_fw_size_16M)
+  IMAGE_SIZE := 15872k
   DEVICE_TITLE := HiWiFi HC5661
-  DEVICE_PACKAGES := kmod-usb2 kmod-sdhci-mt7620 kmod-usb-ledtrig-usbport
+  DEVICE_PACKAGES := kmod-sdhci-mt7620
 endef
 TARGET_DEVICES += hc5661
 
 define Device/hc5761
   DTS := HC5761
-  IMAGE_SIZE := $(ralink_default_fw_size_16M)
+  IMAGE_SIZE := 15872k
   DEVICE_TITLE := HiWiFi HC5761
   DEVICE_PACKAGES := kmod-mt76x0e kmod-usb2 kmod-usb-ohci kmod-sdhci-mt7620 kmod-usb-ledtrig-usbport
 endef
@@ -313,9 +313,9 @@ TARGET_DEVICES += hc5761
 
 define Device/hc5861
   DTS := HC5861
-  IMAGE_SIZE := $(ralink_default_fw_size_16M)
+  IMAGE_SIZE := 15872k
   DEVICE_TITLE := HiWiFi HC5861
-  DEVICE_PACKAGES := kmod-mt76x0e kmod-usb2 kmod-usb-ohci kmod-sdhci-mt7620 kmod-usb-ledtrig-usbport
+  DEVICE_PACKAGES := kmod-mt76x2 kmod-usb2 kmod-usb-ohci kmod-sdhci-mt7620 kmod-usb-ledtrig-usbport
 endef
 TARGET_DEVICES += hc5861