From 32f120b783f1a0467993cdfd15efdef06cad56d8 Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Wed, 24 Jan 2018 01:27:51 +0100 Subject: [PATCH] ramips: various fixes for zbt-we1226 Convert userspace code to use generic device-tree compatible board detection method. Users of the existing code will have to use sysupgrade -F once to switch to the new generic board naming. Properly setup pinctrl fixing the switch port LEDs. Fixes commit 9c4fe103cb (ramips: add support for ZBT-WE1226) Reported-by: Mathias Kresin Signed-off-by: Daniel Golle --- .../linux/ramips/base-files/etc/board.d/01_leds | 2 +- .../ramips/base-files/etc/board.d/02_network | 2 +- target/linux/ramips/base-files/etc/diag.sh | 4 ++-- target/linux/ramips/base-files/lib/ramips.sh | 3 --- .../ramips/base-files/lib/upgrade/platform.sh | 2 +- target/linux/ramips/dts/ZBT-WE1226.dts | 16 ++++++++-------- target/linux/ramips/image/mt76x8.mk | 4 ++-- 7 files changed, 15 insertions(+), 18 deletions(-) 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 37630cde66c9..110b588339a9 100755 --- a/target/linux/ramips/base-files/etc/board.d/01_leds +++ b/target/linux/ramips/base-files/etc/board.d/01_leds @@ -491,7 +491,7 @@ zbt-we826-32M) set_wifi_led "zbt-we826:green:wifi" set_usb_led "zbt-we826:green:usb" ;; -zbt-we1226) +zbtlink,zbt-we1226) set_wifi_led "$boardname:green:wlan" ucidef_set_led_switch "lan1" "LAN1" "$boardname:green:lan1" "switch0" "0x01" ucidef_set_led_switch "lan2" "LAN2" "$boardname:green:lan2" "switch0" "0x02" 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 705532753d22..d3855947dbaa 100755 --- a/target/linux/ramips/base-files/etc/board.d/02_network +++ b/target/linux/ramips/base-files/etc/board.d/02_network @@ -350,7 +350,7 @@ ramips_setup_interfaces() ucidef_add_switch "switch0" \ "1:lan" "2:lan" "0:wan" "6@eth0" ;; - zbt-we1226|\ + zbtlink,zbt-we1226|\ y1) ucidef_add_switch "switch0" \ "0:lan:2" "1:lan:1" "4:wan" "6@eth0" diff --git a/target/linux/ramips/base-files/etc/diag.sh b/target/linux/ramips/base-files/etc/diag.sh index dadb1bb6f6b2..068df1df689e 100644 --- a/target/linux/ramips/base-files/etc/diag.sh +++ b/target/linux/ramips/base-files/etc/diag.sh @@ -315,8 +315,8 @@ get_status_led() { zbt-we826-32M) status_led="zbt-we826:green:power" ;; - zbt-we1226) - status_led="zbt-we1226:green:wlan" + zbtlink,zbt-we1226) + status_led="$boardname:green:wlan" ;; zbt-wg3526-16M|\ zbt-wg3526-32M) diff --git a/target/linux/ramips/base-files/lib/ramips.sh b/target/linux/ramips/base-files/lib/ramips.sh index 491320badf4e..75474fbc6d07 100755 --- a/target/linux/ramips/base-files/lib/ramips.sh +++ b/target/linux/ramips/base-files/lib/ramips.sh @@ -685,9 +685,6 @@ ramips_board_detect() { *"ZBT-WA05") name="zbt-wa05" ;; - *"ZBT-WE1226") - name="zbt-we1226" - ;; *"ZBT-WE1326") name="zbt-we1326" ;; diff --git a/target/linux/ramips/base-files/lib/upgrade/platform.sh b/target/linux/ramips/base-files/lib/upgrade/platform.sh index dd7616034bcc..892dfe3fbe95 100755 --- a/target/linux/ramips/base-files/lib/upgrade/platform.sh +++ b/target/linux/ramips/base-files/lib/upgrade/platform.sh @@ -204,7 +204,7 @@ platform_check_image() { zbt-ape522ii|\ zbt-cpe102|\ zbt-wa05|\ - zbt-we1226|\ + zbtlink,zbt-we1226|\ zbt-we1326|\ zbt-we2026|\ zbtlink,zbt-we3526|\ diff --git a/target/linux/ramips/dts/ZBT-WE1226.dts b/target/linux/ramips/dts/ZBT-WE1226.dts index 67e4353c127a..5ece7567f354 100644 --- a/target/linux/ramips/dts/ZBT-WE1226.dts +++ b/target/linux/ramips/dts/ZBT-WE1226.dts @@ -5,7 +5,7 @@ #include "mt7628an.dtsi" / { - compatible = "zbt,we1226", "mediatek,mt7628an-soc"; + compatible = "zbtlink,zbt-we1226", "mediatek,mt7628an-soc"; model = "Zbtlink ZBT-WE1226"; chosen { @@ -33,19 +33,19 @@ gpio-leds { compatible = "gpio-leds"; - lan2 { - label = "zbt-we1226:green:lan2"; + wan { + label = "zbt-we1226:green:wan"; gpios = <&gpio1 7 GPIO_ACTIVE_LOW>; }; lan1 { label = "zbt-we1226:green:lan1"; - gpios = <&gpio1 10 GPIO_ACTIVE_LOW>; + gpios = <&gpio1 11 GPIO_ACTIVE_LOW>; }; - wan { - label = "zbt-we1226:green:wan"; - gpios = <&gpio1 11 GPIO_ACTIVE_LOW>; + lan2 { + label = "zbt-we1226:green:lan2"; + gpios = <&gpio1 10 GPIO_ACTIVE_LOW>; }; wlan { @@ -58,7 +58,7 @@ &pinctrl { state_default: pinctrl0 { gpio { - ralink,group = "i2c", "wled_an"; + ralink,group = "p0led_an", "p1led_an", "p4led_an", "wdt", "wled_an"; ralink,function = "gpio"; }; }; diff --git a/target/linux/ramips/image/mt76x8.mk b/target/linux/ramips/image/mt76x8.mk index f58a2208c17e..d12aaf0eecb9 100644 --- a/target/linux/ramips/image/mt76x8.mk +++ b/target/linux/ramips/image/mt76x8.mk @@ -248,9 +248,9 @@ define Device/wrtnode2r endef TARGET_DEVICES += wrtnode2r -define Device/zbt-we1226 +define Device/zbtlink_zbt-we1226 DTS := ZBT-WE1226 IMAGE_SIZE := $(ralink_default_fw_size_8M) DEVICE_TITLE := ZBTlink ZBT-WE1226 endef -TARGET_DEVICES += zbt-we1226 +TARGET_DEVICES += zbtlink_zbt-we1226 -- 2.30.2