kirkwood: use the generic board detect
authorMathias Kresin <dev@kresin.me>
Thu, 28 Dec 2017 09:18:48 +0000 (10:18 +0100)
committerMathias Kresin <dev@kresin.me>
Tue, 9 Jan 2018 21:06:55 +0000 (22:06 +0100)
Drop the target specific detection function in favour of the generic
one provided by base-files.

Signed-off-by: Mathias Kresin <dev@kresin.me>
package/boot/uboot-envtools/files/kirkwood
target/linux/kirkwood/base-files/etc/board.d/01_leds
target/linux/kirkwood/base-files/etc/board.d/02_network
target/linux/kirkwood/base-files/etc/diag.sh
target/linux/kirkwood/base-files/etc/init.d/linksys_recovery
target/linux/kirkwood/base-files/etc/init.d/nsa310_fancontrol
target/linux/kirkwood/base-files/lib/kirkwood.sh [deleted file]
target/linux/kirkwood/base-files/lib/preinit/01_sysinfo [deleted file]
target/linux/kirkwood/base-files/lib/upgrade/platform.sh
target/linux/kirkwood/image/Makefile

index cfd3550ea98883817ddfc5d91d12b4b7f93ba21c..516b52e24ff928d8313a1d1a112fe15756084db2 100644 (file)
@@ -13,15 +13,15 @@ touch /etc/config/ubootenv
 board=$(board_name)
 
 case "$board" in
-dockstar|\
-ib62x0|\
-linksys-viper|\
-nsa310b|\
-nsa325|\
-pogo_e02)
+seagate,dockstar|\
+raidsonic,ib-nas62x0|\
+linksys,viper|\
+zyxel,nsa310b|\
+zyxel,nsa325|\
+cloudengines,pogoe02)
        ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x20000" "0x20000"
        ;;
-linksys-audi)
+linksys,audi)
        ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x4000" "0x4000"
        ;;
 esac
index a0b4eca04fce6e52d8cc601cd5ccfe79d2b3784a..b8a9b479e46b6b2dfd86b7989714081b689f8639 100755 (executable)
@@ -10,37 +10,37 @@ board_config_update
 board=$(board_name)
 
 case "$board" in
-"dockstar")
+"seagate,dockstar")
        ucidef_set_led_default "health" "health" "status:green:health" "1"
        ucidef_set_led_default "fault" "fault" "status:orange:fault" "1"
        ;;
-"linksys-audi")
+"linksys,audi")
        ucidef_set_led_default "power" "power" "audi:green:power" "1"
        ;;
-"linksys-viper")
+"linksys,viper")
        ucidef_set_led_default "health" "health" "viper:white:health" "1"
        ucidef_set_led_default "pulse" "pulse" "viper:white:pulse" "1"
        ;;
-"goflexhome" | \
-"goflexnet")
+"seagate,goflexhome" | \
+"seagate,goflexnet")
        ucidef_set_led_default "health" "health" "status:green:health" "1"
        ucidef_set_led_default "fault" "fault" "status:orange:fault" "0"
        ;;
-"ib62x0")
+"raidsonic,ib-nas62x0")
        ucidef_set_led_default "health" "health" "ib62x0:green:os" "1"
        ucidef_set_led_default "fault" "fault" "ib62x0:red:os" "1"
        ;;
-"pogo_e02")
+"cloudengines,pogoe02")
        ucidef_set_led_default "health" "health" "pogo_e02:green:health" "1"
        ucidef_set_led_default "fault" "fault" "pogo_e02:orange:fault" "1"
        ;;
-"nsa310b")
+"zyxel,nsa310b")
        ucidef_set_led_default "health" "health" "nsa310:green:sys" "1"
        ucidef_set_led_usbhost "usb" "USB" "nsa310:green:usb"
        ucidef_set_led_ataport "hdd" "HDD" "nsa310:green:hdd" "1"
        ucidef_set_led_ataport "esata" "eSata" "nsa310:green:esata" "2"
        ;;
-"nsa325")
+"zyxel,nsa325")
        ucidef_set_led_default "health" "health" "nsa325:green:sys" "1"
        ucidef_set_led_usbhost "usb" "USB" "nsa325:green:usb"
        ucidef_set_led_ataport "hdd1" "HDD1" "nsa325:green:sata1" "1"
index 549d232df936bae899df32e2c3109ea9e11a4de8..b83d0d25cc724521e33922eebd806480ccc4222a 100755 (executable)
@@ -11,24 +11,24 @@ board_config_update
 board=$(board_name)
 
 case "$board" in
-"dockstar"|\
-"goflexhome"|\
-"goflexnet"|\
-"ib62x0"|\
-"iconnect"|\
-"pogo_e02")
+"seagate,dockstar"|\
+"seagate,goflexhome"|\
+"seagate,goflexnet"|\
+"raidsonic,ib-nas62x0"|\
+"iom,iconnect-1.1"|\
+"cloudengines,pogoe02")
        ucidef_set_interface_lan "eth0" "dhcp"
        ;;
-"linksys-audi"|\
-"linksys-viper")
+"linksys,audi"|\
+"linksys,viper")
        ucidef_add_switch "switch0" \
                "0:lan" "1:lan" "2:lan" "3:lan" "4:wan" "5@eth0" "6@eth1"
        ;;
-"nsa310b"|"nsa325")
+"zyxel,nsa310b"|"zyxel,nsa325")
        ucidef_set_interface_lan "eth0" "dhcp"
        ucidef_set_interface_macaddr "lan" $( mtd_get_mac_ascii uboot_env ethaddr )
        ;;
-"on100")
+"cisco,on100")
        ucidef_set_interface_lan "eth0 eth1"
        ;;
 *)
index 71a1639c2a6da6d84d3a98bb2bbbae361634e0e5..0ff2ccb17aa55187fc450395db249b6a1be0c056 100755 (executable)
@@ -6,24 +6,24 @@
 
 get_status_led() {
        case $(board_name) in
-       dockstar|\
-       goflexhome|\
-       goflexnet)
+       seagate,dockstar|\
+       seagate,goflexhome|\
+       seagate,goflexnet)
                status_led="status:orange:fault"
                ;;
-       pogo_e02)
+       cloudengines,pogoe02)
                status_led="pogo_e02:orange:fault"
                ;;
-       linksys-audi)
+       linksys,audi)
                status_led="audi:green:power"
                ;;
-       linksys-viper)
+       linksys,viper)
                status_led="viper:white:health"
                ;;
-       nsa310b)
+       zyxel,nsa310b)
                status_led="nsa310:green:sys"
                ;;
-       on100)
+       cisco,on100)
                status_led="on100:green:health"
                ;;
        esac
index ba7e4bb3930069d36707e06906bd82943b0b1613..8fd2f387abd275d49de6a9c7435547c00c7e6e95 100755 (executable)
@@ -6,7 +6,7 @@ boot() {
 . /lib/functions.sh
 
 case $(board_name) in
-       linksys-audi|linksys-viper)
+       linksys,audi|linksys,viper)
                # make sure auto_recovery in uboot is always on
                AUTO_RECOVERY_ENA="`fw_printenv -n auto_recovery`"
                if [ "$AUTO_RECOVERY_ENA" != "yes" ] ; then
index 4073c2d559dc4c10091cad4c01b834c4516948a5..10eb5aa73cc16add150ed58bcef2e1e8822b8474 100755 (executable)
@@ -10,7 +10,7 @@ boot() {
 path_to_hwmon='/sys/devices/platform/ocp@f1000000/f1011000.i2c/i2c-0/0-002e/hwmon/hwmon0'
 
 case $(board_name) in
-       nsa310b)
+       zyxel,nsa310b)
        echo 2 > "$path_to_hwmon/pwm1_enable" # fan is on pwm1
        echo 1 > "$path_to_hwmon/pwm1_auto_channels" # temp1 is the only one that changes
        echo 23000 > "$path_to_hwmon/temp1_auto_temp_min"
diff --git a/target/linux/kirkwood/base-files/lib/kirkwood.sh b/target/linux/kirkwood/base-files/lib/kirkwood.sh
deleted file mode 100644 (file)
index 6474b06..0000000
+++ /dev/null
@@ -1,72 +0,0 @@
-#!/bin/sh
-#
-# Copyright (C) 2014 OpenWrt.org
-#
-
-KIRKWOOD_BOARD_NAME=
-KIRKWOOD_MODEL=
-
-kirkwood_board_detect() {
-       local machine
-       local name
-
-       machine=$(cat /proc/device-tree/model)
-
-       case "$machine" in
-       "Seagate FreeAgent Dockstar")
-               name="dockstar"
-               ;;
-
-        "Seagate GoFlex Home")
-                name="goflexhome"
-                ;;
-
-       "Seagate GoFlex Net")
-               name="goflexnet"
-               ;;
-
-       "Iomega Iconnect")
-               name="iconnect"
-               ;;
-
-       "RaidSonic ICY BOX IB-NAS62x0 (Rev B)")
-               name="ib62x0"
-               ;;
-
-       "Cisco Systems ON100")
-               name="on100"
-               ;;
-
-       "Cloud Engines Pogoplug E02")
-               name="pogo_e02"
-               ;;
-
-       "Linksys Audi (EA3500)")
-               name="linksys-audi"
-               ;;
-
-       "Linksys Viper (E4200v2 / EA4500)")
-               name="linksys-viper"
-               ;;
-
-       "ZyXEL NSA310b")
-               name="nsa310b"
-               ;;
-
-       "ZyXEL NSA325")
-               name="nsa325"
-               ;;
-
-       *)
-               name="generic"
-               ;;
-       esac
-
-       [ -z "$KIRKWOOD_BOARD_NAME" ] && KIRKWOOD_BOARD_NAME="$name"
-       [ -z "$KIRKWOOD_MODEL" ] && KIRKWOOD_MODEL="$machine"
-
-       [ -e "/tmp/sysinfo/" ] || mkdir -p "/tmp/sysinfo/"
-
-       echo "$KIRKWOOD_BOARD_NAME" > /tmp/sysinfo/board_name
-       echo "$KIRKWOOD_MODEL" > /tmp/sysinfo/model
-}
diff --git a/target/linux/kirkwood/base-files/lib/preinit/01_sysinfo b/target/linux/kirkwood/base-files/lib/preinit/01_sysinfo
deleted file mode 100644 (file)
index d45fc92..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-#!/bin/sh
-
-do_sysinfo_kirkwood() {
-       . /lib/kirkwood.sh
-
-       kirkwood_board_detect
-}
-
-boot_hook_add preinit_main do_sysinfo_kirkwood
index dd06aa7f2258a718a324676aa4844f5eb5a377e8..27012bd21d13b48d300ed53c2bd12bd2699a9601 100644 (file)
@@ -11,8 +11,8 @@ platform_do_upgrade() {
        local board="$(board_name)"
 
        case "$board" in
-       "linksys-audi"|\
-       "linksys-viper")
+       "linksys,audi"|\
+       "linksys,viper")
                platform_do_upgrade_linksys "$ARGV"
                ;;
        *)
index b75ef9fbb2274110d6f1bd8968e3043aadc23c05..20b368f70924225c185efdf9b6e98eb99ec5f174 100644 (file)
@@ -30,18 +30,21 @@ endef
 define Device/dockstar
   DEVICE_DTS := kirkwood-dockstar
   DEVICE_TITLE := Seagate FreeAgent Dockstar
+  SUPPORTED_DEVICES += seagate,dockstar
 endef
 TARGET_DEVICES += dockstar
 
 define Device/goflexnet
   DEVICE_TITLE := Seagate GoFlexNet
   DEVICE_DTS := kirkwood-goflexnet
+  SUPPORTED_DEVICES += seagate,goflexnet
 endef
 TARGET_DEVICES += goflexnet
 
 define Device/goflexhome
   DEVICE_TITLE := Seagate GoFlexHome
   DEVICE_DTS := kirkwood-goflexhome
+  SUPPORTED_DEVICES += seagate,goflexhome
 endef
 TARGET_DEVICES += goflexhome
 
@@ -53,6 +56,7 @@ define Device/linksys-audi
   KERNEL_IN_UBI := 0
   UBINIZE_OPTS := -E 5
   IMAGE/factory.bin := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-ubi
+  SUPPORTED_DEVICES += linksys,audi
 endef
 TARGET_DEVICES += linksys-audi
 
@@ -64,12 +68,14 @@ define Device/linksys-viper
   KERNEL_IN_UBI := 0
   UBINIZE_OPTS := -E 5
   IMAGE/factory.bin := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-ubi
+  SUPPORTED_DEVICES += linksys,viper
 endef
 TARGET_DEVICES += linksys-viper
 
 define Device/iconnect
   DEVICE_TITLE := Iomega Iconnect
   DEVICE_DTS := kirkwood-iconnect
+  SUPPORTED_DEVICES += iom,iconnect-1.1
 endef
 TARGET_DEVICES += iconnect
 
@@ -77,6 +83,7 @@ define Device/nsa310b
   DEVICE_TITLE := ZyXEL NSA310b
   DEVICE_DTS := kirkwood-nsa310b
   DEVICE_PACKAGES := kmod-r8169 kmod-gpio-button-hotplug kmod-hwmon-lm85
+  SUPPORTED_DEVICES += zyxel,nsa310b
 endef
 TARGET_DEVICES += nsa310b
 
@@ -84,6 +91,7 @@ define Device/nsa325
   DEVICE_TITLE := ZyXEL NSA325 (v1 and v2)
   DEVICE_DTS := kirkwood-nsa325
   DEVICE_PACKAGES := kmod-gpio-button-hotplug kmod-rtc-pcf8563 kmod-usb3
+  SUPPORTED_DEVICES += zyxel,nsa325
 endef
 TARGET_DEVICES += nsa325
 
@@ -95,18 +103,21 @@ define Device/on100
   KERNEL_IN_UBI := 0
   UBINIZE_OPTS := -E 5
   IMAGE/factory.bin := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-ubi
+  SUPPORTED_DEVICES := cisco,on100
 endef
 TARGET_DEVICES += on100
 
 define Device/pogo_e02
   DEVICE_TITLE := Cloud Engines Pogoplug E02
   DEVICE_DTS := kirkwood-pogo_e02
+  SUPPORTED_DEVICES += cloudengines,pogoe02
 endef
 TARGET_DEVICES += pogo_e02
 
 define Device/ib62x0
   DEVICE_TITLE := RaidSonic ICY BOX IB-NAS62x0
   DEVICE_DTS := kirkwood-ib62x0
+  SUPPORTED_DEVICES += raidsonic,ib-nas62x0
 endef
 TARGET_DEVICES += ib62x0