ramips: improve GnuBee Personal Cloud Two support
authorMathias Kresin <dev@kresin.me>
Sat, 17 Feb 2018 08:54:57 +0000 (09:54 +0100)
committerMathias Kresin <dev@kresin.me>
Tue, 20 Feb 2018 18:25:17 +0000 (19:25 +0100)
Use the generic board detection for the GnuBee Personal Cloud Two
instead of the target specific one as all recent additions are doing.

Fixup the pinmux to set all pins used as GPIO to the function GPIO.
Request pins where used.

Drop the i2c from the dts. There is nothing connected. While at it fix an
indentation issue and use references instead of duplicating the whole
node path.

Use the same switch config as for the GB-PC1 and drop the led trigger for
the not supported IP1001 phy connected to second rgmii.

Fixes: c60a21532bc9 ("ramips: Add support for the GnuBee Personal Cloud Two")
Signed-off-by: Mathias Kresin <dev@kresin.me>
target/linux/ramips/base-files/etc/board.d/01_leds
target/linux/ramips/base-files/etc/board.d/02_network
target/linux/ramips/base-files/etc/diag.sh
target/linux/ramips/base-files/lib/ramips.sh
target/linux/ramips/base-files/lib/upgrade/platform.sh
target/linux/ramips/dts/GB-PC2.dts
target/linux/ramips/image/mt7621.mk

index 573dd31c64dee2fa5aa51fee6ffe7be42ec252c2..16d38dd5fe4e4c78f769c54e0b51b1459660a1ab 100755 (executable)
@@ -187,16 +187,11 @@ fonera20n)
        set_usb_led "$boardname:orange:usb"
        set_wifi_led "$boardname:orange:wifi"
        ;;
-gb-pc1)
+gb-pc1|\
+gnubee,gb-pc2)
        ucidef_set_led_switch "lan1" "lan1" "$boardname:green:lan1" "switch0" "0x01"
        ucidef_set_led_switch "lan2" "lan2" "$boardname:green:lan2" "switch0" "0x10"
        ;;
-gb-pc2)
-       ucidef_set_led_switch "lan" "lan" "$board:green:lan" "switch0" "0x01"
-       ucidef_set_led_switch "wan" "wan" "$board:green:wan" "switch0" "0x10"
-       ucidef_set_led_netdev "eth1-g" "eth1-g" "$board:green:eth1-g" "eth1"
-       ucidef_set_led_netdev "eth1-y" "eth1-y" "$board:green:eth1-y" "eth1"
-       ;;
 gl-mt300a|\
 gl-mt300n|\
 gl-mt750)
index 4208321e69ccc25f0fbc966fb99d048c881f1d61..946810b3e26030f092902a42ee21ee94685f5cee 100755 (executable)
@@ -202,14 +202,11 @@ ramips_setup_interfaces()
                ucidef_add_switch "switch0" \
                        "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" "0:wan" "6@eth0"
                ;;
-       gb-pc1)
+       gb-pc1|\
+       gnubee,gb-pc2)
                ucidef_add_switch "switch0" \
                        "0:lan" "4:lan" "6@eth0"
                ;;
-       gb-pc2)
-               ucidef_add_switch "switch0" \
-                       "4:lan" "0:wan" "6@eth0"
-               ;;
        gl-mt300n-v2)
                ucidef_add_switch "switch0" \
                        "1:lan" "0:wan" "6@eth0"
index 04a398c82697e7b98f15494e77e34a19a714d907..c5f62ab66d951643c494a14ce6f5ca91e409983c 100644 (file)
@@ -91,7 +91,7 @@ get_status_led() {
        dir-620-d1|\
        dwr-512-b|\
        gb-pc1|\
-       gb-pc2|\
+       gnubee,gb-pc2|\
        hpm|\
        hw550-3g|\
        mac1200rv2|\
index 74ed5913b8c2e00172f01d5da09afd5c400f7d20..75474fbc6d07532242b3b1d35ed16079fa1343fa 100755 (executable)
@@ -205,9 +205,6 @@ ramips_board_detect() {
        *"GB-PC1")
                name="gb-pc1"
                ;;
-       *"GB-PC2")
-               name="gb-pc2"
-               ;;
        *"GL-MT300A")
                name="gl-mt300a"
                ;;
index fd0198263e92ab5aca80965fc112e43a1933cd7c..23d31e9463ba6dfde204ab729924039cd0e0aafd 100755 (executable)
@@ -61,7 +61,7 @@ platform_check_image() {
        fonera20n|\
        freestation5|\
        gb-pc1|\
-       gb-pc2|\
+       gnubee,gb-pc2|\
        gl-mt300a|\
        gl-mt300n|\
        gl-mt750|\
index f31ac2b843454b9d4b9436c20a90ef6d02a62f70..ccaf54f3c888e6fba8806d5abf6b92ca82c9a980 100644 (file)
                bootargs = "console=ttyS0,57600";
        };
 
-       palmbus: palmbus@1E000000 {
-               i2c@900 {
-                       status = "okay";
-               };
-       };
-
        gpio-keys-polled {
                compatible = "gpio-keys-polled";
                #address-cells = <1>;
                        gpios = <&gpio0 8 GPIO_ACTIVE_LOW>;
                };
 
-               lan {
-                       label = "gb-pc2:green:lan";
+               lan1 {
+                       label = "gb-pc2:green:lan1";
                        gpios = <&gpio0 24 GPIO_ACTIVE_LOW>;
                };
 
-               wan {
-                       label = "gb-pc2:green:wan";
+               lan2 {
+                       label = "gb-pc2:green:lan2";
                        gpios = <&gpio0 25 GPIO_ACTIVE_LOW>;
                };
 
-               eth1-y {
-                       label = "gb-pc2:yellow:eth1-y";
+               lan3-yellow {
+                       label = "gb-pc2:yellow:lan3";
                        gpios = <&gpio0 13 GPIO_ACTIVE_LOW>;
                };
 
-               eth1-g {
-                       label = "gb-pc2:green:eth1-g";
+               lan3-green {
+                       label = "gb-pc2:green:lan3";
                        gpios = <&gpio0 15 GPIO_ACTIVE_LOW>;
                };
 
@@ -75,6 +69,9 @@
 
 &sdhci {
        status = "okay";
+
+       pinctrl-names = "default";
+       pinctrl-0 = <&sdhci_pins>;
 };
 
 &spi0 {
 };
 
 &cpuclock {
-                       compatible = "fixed-clock";
-                       clock-frequency = <900000000>;
+       compatible = "fixed-clock";
+       clock-frequency = <900000000>;
 };
 
 &pcie {
 &pinctrl {
        state_default: pinctrl0 {
                gpio {
-                       ralink,group = "uart3";
+                       ralink,group = "jtag", "rgmii3", "uart3", "wdt";
                        ralink,function = "gpio";
                };
        };
index f0b5a8444f5f552d101cfdaabdfeb3435c10f95a..d3dfb237b68bd3171340c3aa9beb0e6bdfbae9ba 100644 (file)
@@ -83,13 +83,13 @@ define Device/gb-pc1
 endef
 TARGET_DEVICES += gb-pc1
 
-define Device/gb-pc2
+define Device/gnubee_gb-pc2
   DTS := GB-PC2
   DEVICE_TITLE := GnuBee Personal Cloud Two
   DEVICE_PACKAGES := kmod-ata-core kmod-ata-ahci kmod-usb3 kmod-sdhci-mt7620
   IMAGE_SIZE := $(ralink_default_fw_size_32M)
 endef
-TARGET_DEVICES += gb-pc2
+TARGET_DEVICES += gnubee_gb-pc2
 
 define Device/hc5962
   DTS := HC5962