ramips: use different board names for variants
authorMathias Kresin <dev@kresin.me>
Fri, 23 Dec 2016 08:46:48 +0000 (09:46 +0100)
committerMathias Kresin <dev@kresin.me>
Sat, 24 Dec 2016 09:03:38 +0000 (10:03 +0100)
Use different names for flash size related board variants, to make sure
that only images for the actual flash size are considered as valid by
the image validation code.

Remove the flash size suffix from the string returned by
ramips_board_detect() to ensure that existing scripts relying on the
former used boardname are still working.

Signed-off-by: Mathias Kresin <dev@kresin.me>
14 files changed:
target/linux/ramips/base-files/lib/ramips.sh
target/linux/ramips/base-files/sbin/fixup-mac-address
target/linux/ramips/dts/ASL26555-16M.dts
target/linux/ramips/dts/ASL26555-8M.dts
target/linux/ramips/dts/NIXCORE-16M.dts
target/linux/ramips/dts/NIXCORE-8M.dts
target/linux/ramips/dts/NIXCORE.dtsi
target/linux/ramips/dts/VOCORE-16M.dts
target/linux/ramips/dts/VOCORE-8M.dts
target/linux/ramips/dts/VOCORE.dtsi
target/linux/ramips/dts/WT3020-4M.dts
target/linux/ramips/dts/WT3020-8M.dts
target/linux/ramips/image/mt7620.mk
target/linux/ramips/image/rt305x.mk

index bfb186ddf8ce85f01dfdbf92d7b6615043199475..6b14d19feba5ea20ec38a11f99551d4737e26fc1 100755 (executable)
@@ -55,8 +55,11 @@ ramips_board_detect() {
        *"AR725W")
                name="ar725w"
                ;;
-       *"ASL26555")
-               name="asl26555"
+       *"ASL26555 (8M)")
+               name="asl26555-8M"
+               ;;
+       *"ASL26555 (16M)")
+               name="asl26555-16M"
                ;;
        *"ATP-52B")
                name="atp-52b"
@@ -343,8 +346,11 @@ ramips_board_detect() {
        *"NCS601W")
                name="ncs601w"
                ;;
-       *"NixcoreX1")
-               name="nixcore-x1"
+       *"NixcoreX1 (8M)")
+               name="nixcore-x1-8M"
+               ;;
+       *"NixcoreX1 (16M)")
+               name="nixcore-x1-16M"
                ;;
        *"NW718")
                name="nw718"
@@ -451,8 +457,11 @@ ramips_board_detect() {
        *"V22RW-2X2")
                name="v22rw-2x2"
                ;;
-       *"VoCore")
-               name="vocore"
+       *"VoCore (8M)")
+               name="vocore-8M"
+               ;;
+       *"VoCore (16M)")
+               name="vocore-16M"
                ;;
        *"VR500")
                name="vr500"
@@ -556,8 +565,11 @@ ramips_board_detect() {
        *"WT1520")
                name="wt1520"
                ;;
-       *"WT3020")
-               name="wt3020"
+       *"WT3020 (4M)")
+               name="wt3020-4M"
+               ;;
+       *"WT3020 (8M)")
+               name="wt3020-8M"
                ;;
        *"WZR-AGL300NH")
                name="wzr-agl300nh"
@@ -627,5 +639,5 @@ ramips_board_name() {
        [ -f /tmp/sysinfo/board_name ] && name=$(cat /tmp/sysinfo/board_name)
        [ -z "$name" ] && name="unknown"
 
-       echo "$name"
+       echo "${name%-[0-9]*M}"
 }
index 6e3bac4997cca0443ccab36c64d106067fe0b3d1..3fd8fcb97a16d2d22fb642bb364b7ed262751d48 100755 (executable)
@@ -7,7 +7,8 @@ offset=""
 NEW_MAC=
 YES=
 
-case "$(cat /tmp/sysinfo/board_name)" in
+board=$(ramips_board_name)
+case $board in
        witi)
                partname=factory
                offset=$((0xe000))
index 2887a6ef02734aeb5793a8b181de5168a22d50d8..460fe05efaa99008f013c78674c6b6ca8752267c 100644 (file)
@@ -6,7 +6,7 @@
 
 / {
        compatible = "ASL26555", "ralink,rt3050-soc";
-       model = "Alpha ASL26555";
+       model = "Alpha ASL26555 (16M)";
 
        gpio-keys-polled {
                compatible = "gpio-keys-polled";
index 5ab65938a1a5596de626da4aa7982aeae6607645..288f5552a849393bb669b8c682d163f1d67fbfb3 100644 (file)
@@ -6,7 +6,7 @@
 
 / {
        compatible = "ASL26555", "ralink,rt3050-soc";
-       model = "Alpha ASL26555";
+       model = "Alpha ASL26555 (8M)";
 
        gpio-keys-polled {
                compatible = "gpio-keys-polled";
index 8f848f41af9e3a7a8d78b23a8ec87ded5d9fcdc5..b97c425364fd4a75ff26374227e6d6c71ceea04d 100644 (file)
@@ -2,6 +2,10 @@
 
 #include "NIXCORE.dtsi"
 
+/ {
+       model = "NixcoreX1 (16M)";
+};
+
 &spi0 {
        status = "okay";
 
index 66458676d34c6ae84b2cad7027550f23a535ce3e..55457d9ddebb84ef6e9231628b341369e485e750 100644 (file)
@@ -2,6 +2,10 @@
 
 #include "NIXCORE.dtsi"
 
+/ {
+       model = "NixcoreX1 (8M)";
+};
+
 &spi0 {
        status = "okay";
 
index 4c233d24ba7111b82b29685e8e01f774b3d0eb0d..a827b314089f173c00fb8df0bbea4df871103f2f 100644 (file)
@@ -2,7 +2,6 @@
 
 / {
        compatible = "Nixcore", "ralink,rt5350-soc";
-       model = "Nixcore";
 
        chosen {
                bootargs = "console=ttyS1,57600";
index f51c4f5407e08a4d279f129d272dc66a0aad70f0..dd10784bf15dd3e87e339937585b40956f94bdd2 100644 (file)
@@ -2,6 +2,10 @@
 
 #include "VOCORE.dtsi"
 
+/ {
+       model = "VoCore (16M)";
+};
+
 &spi0 {
        status = "okay";
 
index 1026c865c5590da29be9be915e03f4d0e2f9d429..e3647244f9f0215fb336bd55f4a0bf1ef3348f36 100644 (file)
@@ -2,6 +2,10 @@
 
 #include "VOCORE.dtsi"
 
+/ {
+       model = "VoCore (8M)";
+};
+
 &spi0 {
        status = "okay";
 
index bb8a458831fb3bb419b98c6d82feab80c459d85f..36f784a389ff2edbdc4fc7b2bceeab0982b86a7b 100644 (file)
@@ -2,7 +2,6 @@
 
 / {
        compatible = "VoCore", "ralink,rt5350-soc";
-       model = "VoCore";
 
        gpio-export {
                compatible = "gpio-export";
index 368a24619c66b190d0cedb49b5daf3351dcf702d..6e40d5a86941c1861e42ed97cc46d1032acbfde9 100644 (file)
@@ -6,7 +6,7 @@
 
 / {
        compatible = "wt3020", "ralink,mt7620n-soc";
-       model = "Nexx WT3020";
+       model = "Nexx WT3020 (4M)";
 
        gpio-keys-polled {
                compatible = "gpio-keys-polled";
index 0e15d031f57bad092bc084ea3b02be59d9941693..4ef48cb14efe4b19df5661aab1a590fd064b8133 100644 (file)
@@ -6,7 +6,7 @@
 
 / {
        compatible = "wt3020", "ralink,mt7620n-soc";
-       model = "Nexx WT3020";
+       model = "Nexx WT3020 (8M)";
 
        gpio-keys-polled {
                compatible = "gpio-keys-polled";
index a8c7f5c8c7e99897035d9a288d9e6e430076227a..cfdda97907ef0f88994ebd492fb3d7a3d1348c64 100644 (file)
@@ -89,7 +89,6 @@ define Device/wt3020-4M
   BLOCKSIZE := 4k
   IMAGE_SIZE := $(ralink_default_fw_size_4M)
   IMAGES += factory.bin
-  SUPPORTED_DEVICES := wt3020
   IMAGE/factory.bin := $$(sysupgrade_bin) | check-size $$$$(IMAGE_SIZE) | \
        poray-header -B WT3020 -F 4M
   DEVICE_TITLE := Nexx WT3020 (4MB)
@@ -99,7 +98,6 @@ TARGET_DEVICES += wt3020-4M
 define Device/wt3020-8M
   DTS := WT3020-8M
   IMAGES += factory.bin
-  SUPPORTED_DEVICES := wt3020
   IMAGE/factory.bin := $$(sysupgrade_bin) | check-size $$$$(IMAGE_SIZE) | \
        poray-header -B WT3020 -F 8M
   DEVICE_TITLE := Nexx WT3020 (8MB)
index ac31cfa9ac27f04d6717fef876264eebdd3babfa..06aaf43e8e3b7878e1636c4f4ee75e50575b959d 100644 (file)
@@ -40,7 +40,6 @@ TARGET_DEVICES += all5003
 define Device/asl26555-8M
   DTS := ASL26555-8M
   IMAGE_SIZE := 7744k
-  SUPPORTED_DEVICES := asl26555
   DEVICE_TITLE := Alpha ASL26555 
   DEVICE_PACKAGES := kmod-usb-core kmod-usb-dwc2 kmod-usb-ledtrig-usbport
 endef
@@ -49,7 +48,6 @@ TARGET_DEVICES += asl26555-8M
 define Device/asl26555-16M
   DTS := ASL26555-16M
   IMAGE_SIZE := 15872k
-  SUPPORTED_DEVICES := asl26555
   DEVICE_TITLE := Alpha ASL26555 16M
   DEVICE_PACKAGES :=
 endef
@@ -270,20 +268,18 @@ define Device/ncs601w
 endef
 TARGET_DEVICES += ncs601w
 
-define Device/nixcore-8M
+define Device/nixcore-x1-8M
   DTS := NIXCORE-8M
   IMAGE_SIZE := 7872k
-  SUPPORTED_DEVICES := nixcore-x1
-  DEVICE_TITLE := NixcoreX1 8M
+  DEVICE_TITLE := NixcoreX1 (8M)
   DEVICE_PACKAGES := kmod-usb-core kmod-usb-ohci kmod-usb2 kmod-i2c-core kmod-i2c-ralink kmod-spi-dev
 endef
 TARGET_DEVICES += nixcore-8M
 
-define Device/nixcore-16M
+define Device/nixcore-x1-16M
   DTS := NIXCORE-16M
   IMAGE_SIZE := 16064k
-  SUPPORTED_DEVICES := nixcore-x1
-  DEVICE_TITLE := NixcoreX1 16M
+  DEVICE_TITLE := NixcoreX1 (16M)
   DEVICE_PACKAGES := kmod-usb-core kmod-usb-ohci kmod-usb2 kmod-i2c-core kmod-i2c-ralink kmod-spi-dev
 endef
 TARGET_DEVICES += nixcore-16M
@@ -391,8 +387,7 @@ TARGET_DEVICES += v22rw-2x2
 define Device/vocore-8M
   DTS := VOCORE-8M
   IMAGE_SIZE := 7872k
-  SUPPORTED_DEVICES := vocore
-  DEVICE_TITLE :=  VoCore 8M
+  DEVICE_TITLE := VoCore (8M)
   DEVICE_PACKAGES := kmod-usb-core kmod-usb-ohci kmod-usb2 \
                kmod-i2c-core kmod-i2c-ralink \
                kmod-spi-dev
@@ -402,8 +397,7 @@ TARGET_DEVICES += vocore-8M
 define Device/vocore-16M
   DTS := VOCORE-16M
   IMAGE_SIZE := 16064k
-  SUPPORTED_DEVICES := vocore
-  DEVICE_TITLE := VoCore 16M
+  DEVICE_TITLE := VoCore (16M)
   DEVICE_PACKAGES := kmod-usb-core kmod-usb-ohci kmod-usb2 \
                kmod-i2c-core kmod-i2c-ralink \
                kmod-spi-dev