From: Mathias Kresin Date: Sat, 17 Feb 2018 08:54:57 +0000 (+0100) Subject: ramips: improve GnuBee Personal Cloud Two support X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=cb741654e5b9b659ffc7cb5c1e1fa362aa8c4652;p=openwrt%2Fstaging%2Fblogic.git ramips: improve GnuBee Personal Cloud Two support 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 --- diff --git a/target/linux/ramips/base-files/etc/board.d/01_leds b/target/linux/ramips/base-files/etc/board.d/01_leds index 573dd31c64de..16d38dd5fe4e 100755 --- a/target/linux/ramips/base-files/etc/board.d/01_leds +++ b/target/linux/ramips/base-files/etc/board.d/01_leds @@ -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) diff --git a/target/linux/ramips/base-files/etc/board.d/02_network b/target/linux/ramips/base-files/etc/board.d/02_network index 4208321e69cc..946810b3e260 100755 --- a/target/linux/ramips/base-files/etc/board.d/02_network +++ b/target/linux/ramips/base-files/etc/board.d/02_network @@ -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" diff --git a/target/linux/ramips/base-files/etc/diag.sh b/target/linux/ramips/base-files/etc/diag.sh index 04a398c82697..c5f62ab66d95 100644 --- a/target/linux/ramips/base-files/etc/diag.sh +++ b/target/linux/ramips/base-files/etc/diag.sh @@ -91,7 +91,7 @@ get_status_led() { dir-620-d1|\ dwr-512-b|\ gb-pc1|\ - gb-pc2|\ + gnubee,gb-pc2|\ hpm|\ hw550-3g|\ mac1200rv2|\ diff --git a/target/linux/ramips/base-files/lib/ramips.sh b/target/linux/ramips/base-files/lib/ramips.sh index 74ed5913b8c2..75474fbc6d07 100755 --- a/target/linux/ramips/base-files/lib/ramips.sh +++ b/target/linux/ramips/base-files/lib/ramips.sh @@ -205,9 +205,6 @@ ramips_board_detect() { *"GB-PC1") name="gb-pc1" ;; - *"GB-PC2") - name="gb-pc2" - ;; *"GL-MT300A") name="gl-mt300a" ;; diff --git a/target/linux/ramips/base-files/lib/upgrade/platform.sh b/target/linux/ramips/base-files/lib/upgrade/platform.sh index fd0198263e92..23d31e9463ba 100755 --- a/target/linux/ramips/base-files/lib/upgrade/platform.sh +++ b/target/linux/ramips/base-files/lib/upgrade/platform.sh @@ -61,7 +61,7 @@ platform_check_image() { fonera20n|\ freestation5|\ gb-pc1|\ - gb-pc2|\ + gnubee,gb-pc2|\ gl-mt300a|\ gl-mt300n|\ gl-mt750|\ diff --git a/target/linux/ramips/dts/GB-PC2.dts b/target/linux/ramips/dts/GB-PC2.dts index f31ac2b84345..ccaf54f3c888 100644 --- a/target/linux/ramips/dts/GB-PC2.dts +++ b/target/linux/ramips/dts/GB-PC2.dts @@ -18,12 +18,6 @@ bootargs = "console=ttyS0,57600"; }; - palmbus: palmbus@1E000000 { - i2c@900 { - status = "okay"; - }; - }; - gpio-keys-polled { compatible = "gpio-keys-polled"; #address-cells = <1>; @@ -50,23 +44,23 @@ 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 { @@ -114,8 +111,8 @@ }; &cpuclock { - compatible = "fixed-clock"; - clock-frequency = <900000000>; + compatible = "fixed-clock"; + clock-frequency = <900000000>; }; &pcie { @@ -129,7 +126,7 @@ &pinctrl { state_default: pinctrl0 { gpio { - ralink,group = "uart3"; + ralink,group = "jtag", "rgmii3", "uart3", "wdt"; ralink,function = "gpio"; }; }; diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk index f0b5a8444f5f..d3dfb237b68b 100644 --- a/target/linux/ramips/image/mt7621.mk +++ b/target/linux/ramips/image/mt7621.mk @@ -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