From bf5c56ba57c8b5d60d83f5d590e9b0f4f54c29a2 Mon Sep 17 00:00:00 2001 From: Adrian Schmutzler Date: Thu, 30 Jul 2020 14:29:45 +0200 Subject: [PATCH 01/15] ath79: cosmetic fixes for partition node of D-Link DIR-825 B1 Make the node name match the reg property and remove the unused DT label. Signed-off-by: Adrian Schmutzler --- target/linux/ath79/dts/ar7161_dlink_dir-825-b1.dts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/linux/ath79/dts/ar7161_dlink_dir-825-b1.dts b/target/linux/ath79/dts/ar7161_dlink_dir-825-b1.dts index bb6c31da9e..f9e94a5878 100644 --- a/target/linux/ath79/dts/ar7161_dlink_dir-825-b1.dts +++ b/target/linux/ath79/dts/ar7161_dlink_dir-825-b1.dts @@ -201,7 +201,7 @@ reg = <0x050000 0x610000>; }; - caldata: partition@60000 { + partition@660000 { label = "caldata"; reg = <0x660000 0x010000>; read-only; From 504000d520ac8699137bd6b8dbd55f723f34bfbe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20=C5=A0tetiar?= Date: Tue, 28 Jul 2020 20:47:33 +0200 Subject: [PATCH 02/15] treewide: use DEFAULT := n to disable non-broken devices MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This uses DEFAULT := n on a bunch of devices that previously were "disabled" by commenting out TARGET_DEVICES. This will allow to build them without having to modify the code, but they will not be selected for default build or buildbots. The change is applied to all devices that are not "broken", but suffer from image site limitations or similar, or have been added in the past but never confirmed to run on the device properly: at91: at91-q5xr5: kernel image too big 31aeae077482 ("at91: do not build image for at91-q5xr5") bcm47xx: asus-rt-ac66u: disabled since it was added in 2015 69aefc771fd8 ("brcm47xx: build images for Asus devices") bcm47xx: netgear-wndr3400-vcna, netgear-wnr3500u, netgear-wnr3500-v2-vc added disabled in 2012, but never confirmed to work on devices 5dec9dd3b200 ("brcm47xx: add code to generate images for some netgear devices") bcm53xx: netgear-r8500 added disabled: "start working on Netgear R8500" 3b76c7cf0bdd ("bcm53xx: start working on Netgear R8500") Signed-off-by: Petr Štetiar [limit to subset of devices, adjust commit message/title] Signed-off-by: Adrian Schmutzler --- target/linux/at91/image/sam9x.mk | 3 ++- target/linux/bcm47xx/image/mips74k.mk | 12 ++++++++---- target/linux/bcm53xx/image/Makefile | 3 ++- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/target/linux/at91/image/sam9x.mk b/target/linux/at91/image/sam9x.mk index 8fd6b4506f..beff346725 100644 --- a/target/linux/at91/image/sam9x.mk +++ b/target/linux/at91/image/sam9x.mk @@ -173,8 +173,9 @@ define Device/at91-q5xr5 DEVICE_VENDOR := Exegin DEVICE_MODEL := Q5XR5 KERNEL_SIZE := 2048k + DEFAULT := n endef -#TARGET_DEVICES += at91-q5xr5 +TARGET_DEVICES += at91-q5xr5 define Device/wb45n $(Device/evaluation-fit) diff --git a/target/linux/bcm47xx/image/mips74k.mk b/target/linux/bcm47xx/image/mips74k.mk index 6ca4d21e1f..fb3c594c03 100644 --- a/target/linux/bcm47xx/image/mips74k.mk +++ b/target/linux/bcm47xx/image/mips74k.mk @@ -15,8 +15,9 @@ define Device/asus-rt-ac66u DEVICE_PACKAGES := kmod-b43 $(USB2_PACKAGES) $(Device/asus) PRODUCTID := RT-AC66U + DEFAULT := n endef -# TARGET_DEVICES += asus-rt-ac66u +TARGET_DEVICES += asus-rt-ac66u define Device/asus-rt-n10 DEVICE_MODEL := RT-N10 @@ -399,8 +400,9 @@ define Device/netgear-wndr3400-vcna $(Device/netgear) NETGEAR_BOARD_ID := U12H155T01_NETGEAR NETGEAR_REGION := 2 + DEFAULT := n endef -# TARGET_DEVICES += netgear-wndr3400-vcna +TARGET_DEVICES += netgear-wndr3400-vcna define Device/netgear-wndr4000 DEVICE_MODEL := WNDR4000 @@ -467,8 +469,9 @@ define Device/netgear-wnr3500u $(Device/netgear) NETGEAR_BOARD_ID := U12H136T00_NETGEAR NETGEAR_REGION := 2 + DEFAULT := n endef -# TARGET_DEVICES += netgear-wnr3500u +TARGET_DEVICES += netgear-wnr3500u define Device/netgear-wnr3500-v2 DEVICE_MODEL := WNR3500 @@ -487,7 +490,8 @@ define Device/netgear-wnr3500-v2-vc $(Device/netgear) NETGEAR_BOARD_ID := U12H127T70_NETGEAR NETGEAR_REGION := 2 + DEFAULT := n endef -# TARGET_DEVICES += netgear-wnr3500-v2-vc +TARGET_DEVICES += netgear-wnr3500-v2-vc TARGET_DEVICES += standard standard-noloader-nodictionarylzma diff --git a/target/linux/bcm53xx/image/Makefile b/target/linux/bcm53xx/image/Makefile index b3ec1e99a2..5d4ae08513 100644 --- a/target/linux/bcm53xx/image/Makefile +++ b/target/linux/bcm53xx/image/Makefile @@ -370,8 +370,9 @@ define Device/netgear-r8500 DEVICE_PACKAGES := $(BRCMFMAC_4366B1) $(USB3_PACKAGES) $(Device/netgear) NETGEAR_BOARD_ID := U12H334T00_NETGEAR + DEFAULT := n endef -# TARGET_DEVICES += netgear-r8500 +TARGET_DEVICES += netgear-r8500 define Device/smartrg-sr400ac DEVICE_VENDOR := SmartRG From 1d5260cf72763d92ba8c4aff61b3605e37af614a Mon Sep 17 00:00:00 2001 From: Adrian Schmutzler Date: Tue, 28 Jul 2020 20:47:34 +0200 Subject: [PATCH 03/15] build: add option to mark devices as BROKEN By specifying "BROKEN := 1" or "BROKEN := y" for a device, it will be hidden (and deselected) by default. By that, it provides a stronger option to "disable" a device beyond just using DEFAULT := n. To make these devices visible, just enable the BROKEN option in developer settings as already implemented for targets and packages. Signed-off-by: Adrian Schmutzler --- config/Config-devel.in | 2 +- include/image.mk | 2 ++ scripts/metadata.pm | 4 ++++ scripts/target-metadata.pl | 2 ++ 4 files changed, 9 insertions(+), 1 deletion(-) diff --git a/config/Config-devel.in b/config/Config-devel.in index 11741c7070..6447a79db2 100644 --- a/config/Config-devel.in +++ b/config/Config-devel.in @@ -9,7 +9,7 @@ menuconfig DEVEL default n config BROKEN - bool "Show broken platforms / packages" if DEVEL + bool "Show broken platforms / packages / devices" if DEVEL default n config BINARY_FOLDER diff --git a/include/image.mk b/include/image.mk index 300f7a6619..be934e94d3 100644 --- a/include/image.mk +++ b/include/image.mk @@ -426,6 +426,7 @@ define Device/Init UBOOT_PATH := $(STAGING_DIR_IMAGE)/uboot-$(1) + BROKEN := DEFAULT := endef @@ -638,6 +639,7 @@ Target-Profile-Name: $(DEVICE_DISPLAY) Target-Profile-Packages: $(DEVICE_PACKAGES) Target-Profile-hasImageMetadata: $(if $(foreach image,$(IMAGES),$(findstring append-metadata,$(IMAGE/$(image)))),1,0) Target-Profile-SupportedDevices: $(SUPPORTED_DEVICES) +$(if $(BROKEN),Target-Profile-Broken: $(BROKEN)) $(if $(DEFAULT),Target-Profile-Default: $(DEFAULT)) Target-Profile-Description: $(DEVICE_DESCRIPTION) diff --git a/scripts/metadata.pm b/scripts/metadata.pm index 1826a040a1..f6dce39662 100644 --- a/scripts/metadata.pm +++ b/scripts/metadata.pm @@ -158,6 +158,10 @@ sub parse_target_metadata($) { }; /^Target-Profile-Packages:\s*(.*)\s*$/ and $profile->{packages} = [ split(/\s+/, $1) ]; /^Target-Profile-Description:\s*(.*)\s*/ and $profile->{desc} = get_multiline(*FILE); + /^Target-Profile-Broken:\s*(.+)\s*$/ and do { + $profile->{broken} = 1; + $profile->{default} = "n"; + }; /^Target-Profile-Default:\s*(.+)\s*$/ and $profile->{default} = $1; } close FILE; diff --git a/scripts/target-metadata.pl b/scripts/target-metadata.pl index ee0ab5a718..c58f096573 100755 --- a/scripts/target-metadata.pl +++ b/scripts/target-metadata.pl @@ -239,6 +239,7 @@ config TARGET_$target->{conf}_$profile->{id} bool "$profile->{name}" depends on TARGET_$target->{conf} EOF + $profile->{broken} and print "\tdepends on BROKEN\n"; my @pkglist = merge_package_lists($target->{packages}, $profile->{packages}); foreach my $pkg (@pkglist) { print "\tselect DEFAULT_$pkg\n"; @@ -298,6 +299,7 @@ menuconfig TARGET_DEVICE_$target->{conf}_$profile->{id} depends on TARGET_$target->{conf} default $profile->{default} EOF + $profile->{broken} and print "\tdepends on BROKEN\n"; my @pkglist = merge_package_lists($target->{packages}, $profile->{packages}); foreach my $pkg (@pkglist) { print "\tselect DEFAULT_$pkg if !TARGET_PER_DEVICE_ROOTFS\n"; From e9f7923a1d4b327ef4b9ac25fbe197f2b4ea61d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20=C5=A0tetiar?= Date: Tue, 28 Jul 2020 20:47:35 +0200 Subject: [PATCH 04/15] treewide: mark devices as BROKEN instead of commenting out MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This adds the newly introduced BROKEN flag to a bunch of devices that previously just had TARGET_DEVICES commented out. By this, we can select them in make menuconfig when BROKEN developer config option is selected, instead of having to edit the code. In contrast to DEFAULT := n, this is meant to cover devices that don't boot or don't compile at all. ath25: np25g, wpe53g both disabled during kernel bump 3.18->4.4 without reason given f89a20a89aeb ("ath25: update kernel from 3.18 to 4.4") bcm53xx: linksys-ea6300-v1, linksys-ea9200, linksys-ea9500 broken due to insufficient/broken TRX support 55ff15cfd509 ("bcm53xx: disable building Linksys EA6300 V1 image") cd0f9900a4cd ("bcm53xx: parepare for building more Linksys images") bcm63xx: tplink-archer-c5-v2, tplink-archer-c9-v1 disabled when kernel 5.4 support was added, probably broken 50c6938b95a0 ("bcm53xx: add v5.4 support") Signed-off-by: Petr Štetiar [limit to subset of devices, use BROKEN, adjust commit message/title] Signed-off-by: Adrian Schmutzler --- target/linux/ath25/image/Makefile | 6 ++++-- target/linux/bcm53xx/image/Makefile | 15 ++++++++++----- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/target/linux/ath25/image/Makefile b/target/linux/ath25/image/Makefile index e1ebb159cd..8066ba61a8 100644 --- a/target/linux/ath25/image/Makefile +++ b/target/linux/ath25/image/Makefile @@ -99,15 +99,17 @@ define Device/np25g DEVICE_MODEL := NP25G KERNEL := kernel-bin | gzip-kernel IMAGE/sysupgrade.bin := append-rootfs | pad-rootfs | pad-to 128k | mkmylofw np25g + BROKEN := y endef -#TARGET_DEVICES += np25g +TARGET_DEVICES += np25g define Device/wpe53g DEVICE_VENDOR := Compex DEVICE_MODEL := WPE53G KERNEL := kernel-bin | gzip-kernel IMAGE/sysupgrade.bin := append-rootfs | pad-rootfs | pad-to 128k | mkmylofw wpe53g + BROKEN := y endef -#TARGET_DEVICES += wpe53g +TARGET_DEVICES += wpe53g $(eval $(call BuildImage)) diff --git a/target/linux/bcm53xx/image/Makefile b/target/linux/bcm53xx/image/Makefile index 5d4ae08513..a117e02a45 100644 --- a/target/linux/bcm53xx/image/Makefile +++ b/target/linux/bcm53xx/image/Makefile @@ -250,8 +250,9 @@ define Device/linksys-ea6300-v1 DEVICE_MODEL := EA6300 DEVICE_VARIANT := v1 DEVICE_PACKAGES := $(B43) $(USB3_PACKAGES) + BROKEN := y endef -# TARGET_DEVICES += linksys-ea6300-v1 +TARGET_DEVICES += linksys-ea6300-v1 define Device/linksys-ea6500-v2 DEVICE_VENDOR := Linksys @@ -266,16 +267,18 @@ define Device/linksys-ea9200 DEVICE_MODEL := EA9200 DEVICE_VARIANT := v1 DEVICE_PACKAGES := $(BRCMFMAC_43602A1) $(USB3_PACKAGES) + BROKEN := y endef -# TARGET_DEVICES += linksys-ea9200 +TARGET_DEVICES += linksys-ea9200 define Device/linksys-ea9500 DEVICE_VENDOR := Linksys DEVICE_MODEL := EA9500 DEVICE_PACKAGES := $(BRCMFMAC_4366C0) $(USB3_PACKAGES) DEVICE_DTS := bcm47094-linksys-panamera + BROKEN := y endef -# TARGET_DEVICES += linksys-ea9500 +TARGET_DEVICES += linksys-ea9500 define Device/luxul DEVICE_VENDOR := Luxul @@ -410,8 +413,9 @@ define Device/tplink-archer-c5-v2 IMAGES := bin IMAGE/bin := append-rootfs | bcm53xx-tplink-safeloader TPLINK_BOARD := ARCHER-C5-V2 + BROKEN := y endef -#TARGET_DEVICES += tplink-archer-c5-v2 +TARGET_DEVICES += tplink-archer-c5-v2 define Device/tplink-archer-c9-v1 DEVICE_VENDOR := TP-LINK @@ -421,7 +425,8 @@ define Device/tplink-archer-c9-v1 IMAGES := bin IMAGE/bin := append-rootfs | bcm53xx-tplink-safeloader TPLINK_BOARD := ARCHERC9 + BROKEN := y endef -#TARGET_DEVICES += tplink-archer-c9-v1 +TARGET_DEVICES += tplink-archer-c9-v1 $(eval $(call BuildImage)) From ced167d72971e125825941dae22aad1d318c9dd2 Mon Sep 17 00:00:00 2001 From: David Bauer Date: Thu, 30 Jul 2020 22:33:53 +0200 Subject: [PATCH 05/15] ramips: limit 5GHz channels for RAVPower RP-WD009 When selecting a channel below 100 on the 5GHz radio, the channel will be detected as busy all the time. Survey data from wlan1 frequency: 5240 MHz [in use] channel active time: 165729 ms channel busy time: 158704 ms channel transmit time: 0 ms Channels 100 and above work fine: Survey data from wlan1 frequency: 5500 MHz channel active time: 133000 ms channel busy time: 21090 ms channel transmit time: 0 ms Limit the available channels, so users do not have the impression their device is broken. Signed-off-by: David Bauer --- target/linux/ramips/dts/mt7628an_ravpower_rp-wd009.dts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/linux/ramips/dts/mt7628an_ravpower_rp-wd009.dts b/target/linux/ramips/dts/mt7628an_ravpower_rp-wd009.dts index 5f556af1d3..f592681eb1 100644 --- a/target/linux/ramips/dts/mt7628an_ravpower_rp-wd009.dts +++ b/target/linux/ramips/dts/mt7628an_ravpower_rp-wd009.dts @@ -120,7 +120,7 @@ wifi@0,0 { reg = <0x0000 0 0 0 0>; mediatek,mtd-eeprom = <&factory 0x8000>; - ieee80211-freq-limit = <5000000 6000000>; + ieee80211-freq-limit = <5470000 6000000>; }; }; From 84cb0f7ace73fad15e29e1d74c469b37f90b334d Mon Sep 17 00:00:00 2001 From: Robinson Wu Date: Fri, 17 Jul 2020 15:32:53 +0800 Subject: [PATCH 06/15] ramips: add support for JS76x8 series DEV boards This commit adds support for the Jotale JS76x8 series development boards. These devices have the following specifications: - SOC: MT7628AN/NN, MT7688AN, MT7628DAN - RAM of MT7628AN/NN and MT7688AN: 64/128/256 MB (DDR2) - RAM of MT7628DAN: 64 MB (DDR2) - FLASH:8/16/32 MB (SPI NOR) - Ethernet:3x 10/100 Mbps ethernet ports (MT76x8 built-in switch) - WIFI:1x 2T2R 2.4 GHz Wi-Fi - LEDs:1x system status green LED, 1x wifi green LED, 3x ethernet green LED - Buttons:1x reset button - 1x microSD slot - 4x USB 2.0 port - 1x mini-usb debug UART - 1x DC jack for main power (DC 5V) - 1x TTL/RS232 UART - 1x TTL/RS485 UART - 13x GPIO header - 1x audio codec(wm8960) Installation via OpenWrt: The original firmware is OpenWrt, so both LuCI and sysupgrade can be used. Installation via U-boot web: 1. Power on board with reset button pressed, release it after wifi led start blinking. 2. Setup static IP 192.168.1.123/4 on your PC. 3. Go to 192.168.1.8 in browser and upload "sysupgrade" image. Installation via U-boot tftp: 1. Connect to serial console at the mini usb, which has been connected to UART0 on board (115200 8N1) 2. Setup static IP 192.168.1.123/4 on your PC. 3. Place openwrt-firmware.bin on your PC tftp server (192.168.1.123). 3. Connect one of LAN ports on board to your PC. 4. Start terminal software (e.g. screen /dev/ttyUSB0 115200) on PC. 5. Apply power to board. 6. Interrupt U-boot with keypress of "2". 7. At u-boot prompts: Warning!! Erase Linux in Flash then burn new one. Are you sure?(Y/N) Y Input device IP (192.168.1.8) ==:192.168.1.8 Input server IP (192.168.1.123) ==:192.168.1.123 Input Linux Kernel filename (root_uImage) ==:openwrt-firmware.bin 8. board will download file from tftp server, write it to flash and reboot. Signed-off-by: Robinson Wu [add license to DTS files, fix state_default and reduce to the mimimum, move phy0tpt trigger to DTS, drop ucidef_set_led_timer, fix network ports] Signed-off-by: Adrian Schmutzler --- .../ramips/dts/mt7628an_jotale_js76x8-16m.dts | 13 ++ .../ramips/dts/mt7628an_jotale_js76x8-32m.dts | 13 ++ .../ramips/dts/mt7628an_jotale_js76x8-8m.dts | 13 ++ .../ramips/dts/mt7628an_jotale_js76x8.dtsi | 126 ++++++++++++++++++ target/linux/ramips/image/mt76x8.mk | 27 ++++ .../mt76x8/base-files/etc/board.d/02_network | 17 ++- 6 files changed, 205 insertions(+), 4 deletions(-) create mode 100644 target/linux/ramips/dts/mt7628an_jotale_js76x8-16m.dts create mode 100644 target/linux/ramips/dts/mt7628an_jotale_js76x8-32m.dts create mode 100644 target/linux/ramips/dts/mt7628an_jotale_js76x8-8m.dts create mode 100644 target/linux/ramips/dts/mt7628an_jotale_js76x8.dtsi diff --git a/target/linux/ramips/dts/mt7628an_jotale_js76x8-16m.dts b/target/linux/ramips/dts/mt7628an_jotale_js76x8-16m.dts new file mode 100644 index 0000000000..8e924aeec7 --- /dev/null +++ b/target/linux/ramips/dts/mt7628an_jotale_js76x8-16m.dts @@ -0,0 +1,13 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include "mt7628an_jotale_js76x8.dtsi" + +/ { + compatible = "jotale,js76x8-16m", "jotale,js76x8", "mediatek,mt7628an-soc"; + model = "Jotale JS76x8 (16M)"; +}; + +&firmware { + reg = <0x50000 0xfb0000>; +}; diff --git a/target/linux/ramips/dts/mt7628an_jotale_js76x8-32m.dts b/target/linux/ramips/dts/mt7628an_jotale_js76x8-32m.dts new file mode 100644 index 0000000000..12544fd521 --- /dev/null +++ b/target/linux/ramips/dts/mt7628an_jotale_js76x8-32m.dts @@ -0,0 +1,13 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include "mt7628an_jotale_js76x8.dtsi" + +/ { + compatible = "jotale,js76x8-32m", "jotale,js76x8", "mediatek,mt7628an-soc"; + model = "Jotale JS76x8 (32M)"; +}; + +&firmware { + reg = <0x50000 0x1fb0000>; +}; diff --git a/target/linux/ramips/dts/mt7628an_jotale_js76x8-8m.dts b/target/linux/ramips/dts/mt7628an_jotale_js76x8-8m.dts new file mode 100644 index 0000000000..7dc23349bf --- /dev/null +++ b/target/linux/ramips/dts/mt7628an_jotale_js76x8-8m.dts @@ -0,0 +1,13 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include "mt7628an_jotale_js76x8.dtsi" + +/ { + compatible = "jotale,js76x8-8m", "mediatek,mt7628an-soc"; + model = "Jotale JS76x8 (8M)"; +}; + +&firmware { + reg = <0x50000 0x7b0000>; +}; diff --git a/target/linux/ramips/dts/mt7628an_jotale_js76x8.dtsi b/target/linux/ramips/dts/mt7628an_jotale_js76x8.dtsi new file mode 100644 index 0000000000..61c5d7b7c4 --- /dev/null +++ b/target/linux/ramips/dts/mt7628an_jotale_js76x8.dtsi @@ -0,0 +1,126 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "mt7628an.dtsi" + +#include +#include + +/ { + compatible = "jotale,js76x8", "mediatek,mt7628an-soc"; + + aliases { + led-boot = &led_system; + led-failsafe = &led_system; + led-running = &led_system; + led-upgrade = &led_system; + }; + + chosen { + bootargs = "console=ttyS0,115200"; + }; + + leds { + compatible = "gpio-leds"; + + led_system: system { + label = "js76x8:green:system"; + gpios = <&gpio 37 GPIO_ACTIVE_LOW>; + }; + + wifi { + label = "js76x8:green:wifi"; + gpios = <&gpio 44 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy0tpt"; + }; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + gpios = <&gpio 38 GPIO_ACTIVE_HIGH>; + linux,code = ; + }; + }; +}; + +&state_default { + gpio { + groups = "refclk", "wdt", "wled_an"; + function = "gpio"; + }; +}; + +&spi0 { + status = "okay"; + + pinctrl-names = "default"; + pinctrl-0 = <&spi_pins>, <&spi_cs1_pins>; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <40000000>; + m25p,chunked-io = <32>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "u-boot"; + reg = <0x0 0x30000>; + read-only; + }; + + partition@30000 { + label = "u-boot-env"; + reg = <0x30000 0x10000>; + read-only; + }; + + factory: partition@40000 { + label = "factory"; + reg = <0x40000 0x10000>; + read-only; + }; + + firmware: partition@50000 { + compatible = "denx,uimage"; + label = "firmware"; + /* reg property is set based on flash size in DTS files */ + }; + }; + }; +}; + +&i2c { + status = "okay"; +}; + +&i2s { + status = "okay"; +}; + +&uart1 { + status = "okay"; +}; + +&uart2 { + status = "okay"; +}; + +ðernet { + mtd-mac-address = <&factory 0x28>; +}; + +&sdhci { + status = "okay"; + mediatek,cd-low; +}; + +&wmac { + status = "okay"; +}; diff --git a/target/linux/ramips/image/mt76x8.mk b/target/linux/ramips/image/mt76x8.mk index 4b2255bd6a..00c8fbe43e 100644 --- a/target/linux/ramips/image/mt76x8.mk +++ b/target/linux/ramips/image/mt76x8.mk @@ -160,6 +160,33 @@ define Device/iptime_a604m endef TARGET_DEVICES += iptime_a604m +define Device/jotale_js76x8 + DEVICE_VENDOR := Jotale + DEVICE_MODEL := JS76x8 + DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci +endef + +define Device/jotale_js76x8-8m + $(Device/jotale_js76x8) + IMAGE_SIZE := 7872k + DEVICE_VARIANT := 8M +endef +TARGET_DEVICES += jotale_js76x8-8m + +define Device/jotale_js76x8-16m + $(Device/jotale_js76x8) + IMAGE_SIZE := 16064k + DEVICE_VARIANT := 16M +endef +TARGET_DEVICES += jotale_js76x8-16m + +define Device/jotale_js76x8-32m + $(Device/jotale_js76x8) + IMAGE_SIZE := 32448k + DEVICE_VARIANT := 32M +endef +TARGET_DEVICES += jotale_js76x8-32m + define Device/mediatek_linkit-smart-7688 IMAGE_SIZE := 32448k DEVICE_VENDOR := MediaTek diff --git a/target/linux/ramips/mt76x8/base-files/etc/board.d/02_network b/target/linux/ramips/mt76x8/base-files/etc/board.d/02_network index 0809109c13..cf7e88ebf1 100755 --- a/target/linux/ramips/mt76x8/base-files/etc/board.d/02_network +++ b/target/linux/ramips/mt76x8/base-files/etc/board.d/02_network @@ -92,6 +92,12 @@ ramips_setup_interfaces() ucidef_add_switch "switch0" \ "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" "0:wan" "6@eth0" ;; + jotale,js76x8-8m|\ + jotale,js76x8-16m|\ + jotale,js76x8-32m) + ucidef_add_switch "switch0" \ + "0:lan" "1:lan" "2:lan" "6@eth0" + ;; netgear,r6020|\ netgear,r6080|\ netgear,r6120) @@ -174,6 +180,13 @@ ramips_setup_macs() totolink,a3) wan_mac=$(mtd_get_mac_binary u-boot 0x1fc40) ;; + jotale,js76x8-8m|\ + jotale,js76x8-16m|\ + jotale,js76x8-32m|\ + skylab,skw92a|\ + totolink,lr1200) + wan_mac=$(mtd_get_mac_binary factory 0x2e) + ;; mediatek,linkit-smart-7688|\ onion,omega2|\ onion,omega2p) @@ -189,10 +202,6 @@ ramips_setup_macs() wiznet,wizfi630s) wan_mac=$(macaddr_add "$(mtd_get_mac_binary factory 0x28)" 1) ;; - skylab,skw92a|\ - totolink,lr1200) - wan_mac=$(mtd_get_mac_binary factory 0x2e) - ;; tplink,archer-c20-v4|\ tplink,archer-c50-v3|\ tplink,tl-mr3420-v5|\ From 6867d86e085dd4a284c8ee8878839c9e77546f46 Mon Sep 17 00:00:00 2001 From: Adrian Schmutzler Date: Thu, 9 Jul 2020 19:14:45 +0200 Subject: [PATCH 07/15] build: add DEVICE_COMPAT_VERSION and DEVICE_COMPAT_MESSAGE We regularly encounter the situation that devices are subject to changes that will make them incompatible to previous versions. Removing SUPPORTED_DEVICES will not really be helpful in most of these cases, as this only helps after a rename. To solve this situation, this patchset introduces a compatibility version for devices. It will be implemented via a per-device Make variable DEVICE_COMPAT_VERSION, which will be set to 1.0 globally by default and then can be overwritten as needed. Furthermore, a variable DEVICE_COMPAT_MESSAGE is added, where a message to be displayed during sysupgrade may be specified optionally. This patch only implements the build variables and adds them to the sysupgrade metadata, the evaluation will be addressed in a subsequent patch. To set it, one would just need to add the following to a device node: define Device/somedevice ... DEVICE_COMPAT_VERSION := 1.1 DEVICE_COMPAT_MESSAGE := Config cannot be migrated from swconfig to DSA endef Signed-off-by: Adrian Schmutzler --- include/image-commands.mk | 7 +++++-- include/image.mk | 3 +++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/include/image-commands.mk b/include/image-commands.mk index e7db7128b4..9da712e733 100644 --- a/include/image-commands.mk +++ b/include/image-commands.mk @@ -384,13 +384,16 @@ define Build/tplink-v2-image rm -rf $@.new endef +compat_version=$(if $(DEVICE_COMPAT_VERSION),$(DEVICE_COMPAT_VERSION),1.0) json_quote=$(subst ','\'',$(subst ",\",$(1))) #")') metadata_devices=$(if $(1),$(subst "$(space)","$(comma)",$(strip $(foreach v,$(1),"$(call json_quote,$(v))")))) metadata_json = \ '{ $(if $(IMAGE_METADATA),$(IMAGE_METADATA)$(comma)) \ "metadata_version": "1.0", \ - "supported_devices":[$(call metadata_devices,$(1))], \ + "compat_version": "$(call json_quote,$(compat_version))", \ + $(if $(DEVICE_COMPAT_MESSAGE),"compat_message": "$(call json_quote,$(DEVICE_COMPAT_MESSAGE))"$(comma)) \ + "supported_devices":[$(call metadata_devices,$(SUPPORTED_DEVICES))], \ "version": { \ "dist": "$(call json_quote,$(VERSION_DIST))", \ "version": "$(call json_quote,$(VERSION_NUMBER))", \ @@ -401,7 +404,7 @@ metadata_json = \ }' define Build/append-metadata - $(if $(SUPPORTED_DEVICES),-echo $(call metadata_json,$(SUPPORTED_DEVICES)) | fwtool -I - $@) + $(if $(SUPPORTED_DEVICES),-echo $(call metadata_json) | fwtool -I - $@) [ ! -s "$(BUILD_KEY)" -o ! -s "$(BUILD_KEY).ucert" -o ! -s "$@" ] || { \ cp "$(BUILD_KEY).ucert" "$@.ucert" ;\ usign -S -m "$@" -s "$(BUILD_KEY)" -x "$@.sig" ;\ diff --git a/include/image.mk b/include/image.mk index be934e94d3..e8c2cf7100 100644 --- a/include/image.mk +++ b/include/image.mk @@ -419,6 +419,8 @@ define Device/Init BOARD_NAME := UIMAGE_NAME := + DEVICE_COMPAT_VERSION := 1.0 + DEVICE_COMPAT_MESSAGE := SUPPORTED_DEVICES := IMAGE_METADATA := @@ -436,6 +438,7 @@ DEFAULT_DEVICE_VARS := \ VID_HDR_OFFSET UBINIZE_OPTS UBINIZE_PARTS MKUBIFS_OPTS DEVICE_DTS \ DEVICE_DTS_CONFIG DEVICE_DTS_DIR SOC BOARD_NAME UIMAGE_NAME SUPPORTED_DEVICES \ IMAGE_METADATA KERNEL_ENTRY KERNEL_LOADADDR UBOOT_PATH IMAGE_SIZE \ + DEVICE_COMPAT_VERSION DEVICE_COMPAT_MESSAGE \ DEVICE_VENDOR DEVICE_MODEL DEVICE_VARIANT \ DEVICE_ALT0_VENDOR DEVICE_ALT0_MODEL DEVICE_ALT0_VARIANT \ DEVICE_ALT1_VENDOR DEVICE_ALT1_MODEL DEVICE_ALT1_VARIANT \ From 735de53b2aae9be03611715699bf58dff44e8eff Mon Sep 17 00:00:00 2001 From: Adrian Schmutzler Date: Thu, 9 Jul 2020 19:24:11 +0200 Subject: [PATCH 08/15] base-files: add support for compat_version on device We regularly encounter the situation that devices are subject to changes that will make them incompatible to previous versions. Removing SUPPORTED_DEVICES will not really be helpful in most of these cases, as this only helps after a rename. To solve this situation, this patchset introduces a compatibility version for devices. To complement the DEVICE_COMPAT_VERSION set for the image to be flashed, this implements a compat_version on the device, so it will have something to compare with the image. The only viable way to achieve this seems to be via board.d files, i.e. this is technically adding a compat version for the device's config. Like for the network setup, this will set up a command ucidef_set_compat_version to set the compat_version in board.d. This will then add a string to /etc/board.json, which will be translated into uci system config by bin/config_generate. By this, the compat_version, being a version of the config, will also be exposed to the user. As with DEVICE_COMPAT_VERSION, missing uci entry will be assumed as compat_version "1.0", so we only need to add this if a device needs to be bumped, e.g. ucidef_set_compat_version "1.1" Signed-off-by: Adrian Schmutzler --- package/base-files/files/bin/config_generate | 7 +++++++ package/base-files/files/lib/functions/uci-defaults.sh | 6 ++++++ 2 files changed, 13 insertions(+) diff --git a/package/base-files/files/bin/config_generate b/package/base-files/files/bin/config_generate index abb1388ba1..eb6816e519 100755 --- a/package/base-files/files/bin/config_generate +++ b/package/base-files/files/bin/config_generate @@ -264,6 +264,13 @@ generate_static_system() { uci -q set "system.@system[-1].hostname=$hostname" fi + local compat_version + if json_get_var compat_version compat_version; then + uci -q set "system.@system[-1].compat_version=$compat_version" + else + uci -q set "system.@system[-1].compat_version=1.0" + fi + if json_is_a ntpserver array; then local keys key json_get_keys keys ntpserver diff --git a/package/base-files/files/lib/functions/uci-defaults.sh b/package/base-files/files/lib/functions/uci-defaults.sh index 12b900031d..27a409fe3b 100755 --- a/package/base-files/files/lib/functions/uci-defaults.sh +++ b/package/base-files/files/lib/functions/uci-defaults.sh @@ -68,6 +68,12 @@ ucidef_set_model_name() { json_select .. } +ucidef_set_compat_version() { + json_select_object system + json_add_string compat_version "${1:-1.0}" + json_select .. +} + ucidef_set_interface_lan() { ucidef_set_interface "lan" ifname "$1" protocol "${2:-static}" } From ad3e1f9db4cffaec6700d780308fb6241c09a96f Mon Sep 17 00:00:00 2001 From: Adrian Schmutzler Date: Thu, 9 Jul 2020 19:34:09 +0200 Subject: [PATCH 09/15] base-files: fwtool: implement compatibility check for images We regularly encounter the situation that devices are subject to changes that will make them incompatible to previous versions. Removing SUPPORTED_DEVICES will not really be helpful in most of these cases, as this only helps after a rename. To solve this situation, this patchset introduces a compatibility version for devices. In this patch, the actual checks are implemented into fwtool_check_image(): If an incompatible change is introduced, one can increase either the minor version (1.0->1.1) or the major version (1.0->2.0). Minor version increment: This will still allow sysupgrade, but require to reset config (-n or SAVE_CONFIG=0). If sysupgrade is called without -n, a corresponding message will be printed. If sysupgrade is called with -n, it will just pass, with supported devices being checked as usual. (Which will allow us to add back SUPPORTED_DEVICES for many cases.) Major version increment: This is meant for potential (rare) cases where sysupgrade is not possible at all, because it would break the device. In this case, a warning will be printed, and -n won't help. If image check fails because of one of the versions parts not matching, the content of DEVICE_COMPAT_MESSAGE is printed in addition to the generic message (if set). For both cases, upgrade can still be forced with -F as usual. Signed-off-by: Adrian Schmutzler --- .../base-files/files/lib/upgrade/fwtool.sh | 24 ++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/package/base-files/files/lib/upgrade/fwtool.sh b/package/base-files/files/lib/upgrade/fwtool.sh index a0b3fb0a04..e8277f6fcc 100644 --- a/package/base-files/files/lib/upgrade/fwtool.sh +++ b/package/base-files/files/lib/upgrade/fwtool.sh @@ -44,13 +44,35 @@ fwtool_check_image() { } device="$(cat /tmp/sysinfo/board_name)" + devicecompat="$(uci -q get system.@system[0].compat_version)" + [ -n "$devicecompat" ] || devicecompat="1.0" + + json_get_var imagecompat compat_version + json_get_var compatmessage compat_message + [ -n "$imagecompat" ] || imagecompat="1.0" json_select supported_devices || return 1 json_get_keys dev_keys for k in $dev_keys; do json_get_var dev "$k" - [ "$dev" = "$device" ] && return 0 + if [ "$dev" = "$device" ]; then + # major compat version -> no sysupgrade + if [ "${devicecompat%.*}" != "${imagecompat%.*}" ]; then + echo "The device is supported, but this image is incompatible for sysupgrade based on the image version ($devicecompat->$imagecompat)." + [ -n "$compatmessage" ] && echo "$compatmessage" + return 1 + fi + + # minor compat version -> sysupgrade with -n required + if [ "${devicecompat#.*}" != "${imagecompat#.*}" ] && [ "$SAVE_CONFIG" = "1" ]; then + echo "The device is supported, but the config is incompatible to the new image ($devicecompat->$imagecompat). Please upgrade without keeping config (sysupgrade -n)." + [ -n "$compatmessage" ] && echo "$compatmessage" + return 1 + fi + + return 0 + fi done echo "Device $device not supported by this image" From 02d6ac1060b4a937adce5912cc22177cac86c318 Mon Sep 17 00:00:00 2001 From: Adrian Schmutzler Date: Thu, 9 Jul 2020 19:46:44 +0200 Subject: [PATCH 10/15] base-files: fwtool: make compat_version backward compatible So far, the compatibility mechanism only works if both device and image are already updated to the new routines. This patch extends the sysupgrade metadata and fwtool_check_image() to account for "older" images as well: The basic mechanism for older devices to check for image compatibility is the supported_devices entry. This can be exploited by putting a custom message into this variable of the metadata, so older FW will produce a mismatch and print the message as it thinks it's the list of supported devices. So, we have two cases: device 1.0, image 1.0: The metadata will just contain supported_devices as before. device 1.0, image 1.1: The metadata will contain: "new_supported_devices":["device_string1", "device_string2", ...], "supported_devices":["Image version 1.1 incompatible to device: ..."] If the device is "legacy", i.e. does not have the updated fwtool.sh, it will just fail with image check and print the content of supported_devices. If DEVICE_COMPAT_MESSAGE is set, this will be printed on old devices as well through the same mechanism. Otherwise a generic "Please check documentation ..." is appended. Upgrade can still be performed with -F like when SUPPORTED_DEVICES has been removed to prevent bricking. If the device has updated fwtool.sh (but is 1.0), it will just use the new_supported_devices instead, and work as intended (flashing with -n will work, flashing without will print the appropriate warning). This mechanism should provide a fair tradeoff between simplicity and functionality. Since we touched a lot of fields in metadata, this also bumps metadata_version to 1.1. Signed-off-by: Adrian Schmutzler --- include/image-commands.mk | 7 +++++-- package/base-files/files/lib/upgrade/fwtool.sh | 7 ++++++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/include/image-commands.mk b/include/image-commands.mk index 9da712e733..7a370034c8 100644 --- a/include/image-commands.mk +++ b/include/image-commands.mk @@ -390,10 +390,13 @@ json_quote=$(subst ','\'',$(subst ",\",$(1))) metadata_devices=$(if $(1),$(subst "$(space)","$(comma)",$(strip $(foreach v,$(1),"$(call json_quote,$(v))")))) metadata_json = \ '{ $(if $(IMAGE_METADATA),$(IMAGE_METADATA)$(comma)) \ - "metadata_version": "1.0", \ + "metadata_version": "1.1", \ "compat_version": "$(call json_quote,$(compat_version))", \ $(if $(DEVICE_COMPAT_MESSAGE),"compat_message": "$(call json_quote,$(DEVICE_COMPAT_MESSAGE))"$(comma)) \ - "supported_devices":[$(call metadata_devices,$(SUPPORTED_DEVICES))], \ + $(if $(filter-out 1.0,$(compat_version)),"new_supported_devices":[$(call metadata_devices,$(SUPPORTED_DEVICES))]$(comma)) \ + $(if $(filter-out 1.0,$(compat_version)),"supported_devices": \ + ["$(call json_quote,Image version $(compat_version) incompatible to device: $(if $(DEVICE_COMPAT_MESSAGE),$(DEVICE_COMPAT_MESSAGE),Please check documentation ...))"]$(comma)) \ + $(if $(filter 1.0,$(compat_version)),"supported_devices":[$(call metadata_devices,$(SUPPORTED_DEVICES))]$(comma)) \ "version": { \ "dist": "$(call json_quote,$(VERSION_DIST))", \ "version": "$(call json_quote,$(VERSION_NUMBER))", \ diff --git a/package/base-files/files/lib/upgrade/fwtool.sh b/package/base-files/files/lib/upgrade/fwtool.sh index e8277f6fcc..3a74c72bba 100644 --- a/package/base-files/files/lib/upgrade/fwtool.sh +++ b/package/base-files/files/lib/upgrade/fwtool.sh @@ -51,7 +51,12 @@ fwtool_check_image() { json_get_var compatmessage compat_message [ -n "$imagecompat" ] || imagecompat="1.0" - json_select supported_devices || return 1 + # select correct supported list based on compat_version + # (using this ensures that compatibility check works for devices + # not knowing about compat-version) + local supported=supported_devices + [ "$imagecompat" != "1.0" ] && supported=new_supported_devices + json_select $supported || return 1 json_get_keys dev_keys for k in $dev_keys; do From 494f12c52df6767ec0fabf2b2fac8f453323a4c5 Mon Sep 17 00:00:00 2001 From: Adrian Schmutzler Date: Tue, 14 Jul 2020 16:11:22 +0200 Subject: [PATCH 11/15] mvebu: implement compatibility version for DSA migration This implements the newly introduced compat-version to prevent upgrade between swconfig and DSA for mvebu. Just define a compat version with minor increment and an appropriate message for both image (in Makefile) and device (in base-files). Having taken care of sysupgrade, we can put back the SUPPORTED_DEVICES that have been removed in previous patches to prevent broken config. Attention: All users that already updated to the DSA versions in master will receive the same incompatibility warning since their devices are still "1.0" as far as fwtool can tell. Those, and only those, can bypass the upgrade check by using force (-F) without having to reset config again. In addition, the new version string needs to be put into uci config manually, so the new fwtool knows that it actually deals with a "1.1": uci set "system.@system[-1].compat_version=1.1" uci commit system Signed-off-by: Adrian Schmutzler --- .../base-files/etc/board.d/05_compat-version | 25 +++++++++++++++++++ target/linux/mvebu/image/cortexa9.mk | 19 ++++++++++++++ 2 files changed, 44 insertions(+) create mode 100755 target/linux/mvebu/cortexa9/base-files/etc/board.d/05_compat-version diff --git a/target/linux/mvebu/cortexa9/base-files/etc/board.d/05_compat-version b/target/linux/mvebu/cortexa9/base-files/etc/board.d/05_compat-version new file mode 100755 index 0000000000..dffb94de03 --- /dev/null +++ b/target/linux/mvebu/cortexa9/base-files/etc/board.d/05_compat-version @@ -0,0 +1,25 @@ +#!/bin/sh +# +# Copyright (C) 2020 OpenWrt.org +# + +. /lib/functions.sh +. /lib/functions/uci-defaults.sh + +board_config_update + +case "$(board_name)" in + linksys,wrt1200ac|\ + linksys,wrt1900ac-v1|\ + linksys,wrt1900ac-v2|\ + linksys,wrt1900acs|\ + linksys,wrt3200acm|\ + linksys,wrt32x|\ + solidrun,clearfog-pro-a1) + ucidef_set_compat_version "1.1" + ;; +esac + +board_config_flush + +exit 0 diff --git a/target/linux/mvebu/image/cortexa9.mk b/target/linux/mvebu/image/cortexa9.mk index 74376f9cd7..e86675eeb9 100644 --- a/target/linux/mvebu/image/cortexa9.mk +++ b/target/linux/mvebu/image/cortexa9.mk @@ -6,6 +6,11 @@ # See /LICENSE for more information. # +define Device/dsa-migration + DEVICE_COMPAT_VERSION := 1.1 + DEVICE_COMPAT_MESSAGE := Config cannot be migrated from swconfig to DSA +endef + define Device/buffalo_ls421de $(Device/NAND-128K) DEVICE_VENDOR := Buffalo @@ -77,16 +82,19 @@ endef define Device/linksys_wrt1200ac $(call Device/linksys) + $(Device/dsa-migration) DEVICE_MODEL := WRT1200AC DEVICE_ALT0_VENDOR := Linksys DEVICE_ALT0_MODEL := Caiman DEVICE_DTS := armada-385-linksys-caiman DEVICE_PACKAGES += mwlwifi-firmware-88w8864 + SUPPORTED_DEVICES += armada-385-linksys-caiman linksys,caiman endef TARGET_DEVICES += linksys_wrt1200ac define Device/linksys_wrt1900acs $(call Device/linksys) + $(Device/dsa-migration) DEVICE_MODEL := WRT1900ACS DEVICE_VARIANT := v1 DEVICE_ALT0_VENDOR := Linksys @@ -96,11 +104,13 @@ define Device/linksys_wrt1900acs DEVICE_ALT1_MODEL := Shelby DEVICE_DTS := armada-385-linksys-shelby DEVICE_PACKAGES += mwlwifi-firmware-88w8864 + SUPPORTED_DEVICES += armada-385-linksys-shelby linksys,shelby endef TARGET_DEVICES += linksys_wrt1900acs define Device/linksys_wrt1900ac-v1 $(call Device/linksys) + $(Device/dsa-migration) DEVICE_MODEL := WRT1900AC DEVICE_VARIANT := v1 DEVICE_ALT0_VENDOR := Linksys @@ -108,33 +118,39 @@ define Device/linksys_wrt1900ac-v1 DEVICE_DTS := armada-xp-linksys-mamba DEVICE_PACKAGES += mwlwifi-firmware-88w8864 KERNEL_SIZE := 3072k + SUPPORTED_DEVICES += armada-xp-linksys-mamba linksys,mamba DEFAULT := n endef TARGET_DEVICES += linksys_wrt1900ac-v1 define Device/linksys_wrt1900ac-v2 $(call Device/linksys) + $(Device/dsa-migration) DEVICE_MODEL := WRT1900AC DEVICE_VARIANT := v2 DEVICE_ALT0_VENDOR := Linksys DEVICE_ALT0_MODEL := Cobra DEVICE_DTS := armada-385-linksys-cobra DEVICE_PACKAGES += mwlwifi-firmware-88w8864 + SUPPORTED_DEVICES += armada-385-linksys-cobra linksys,cobra endef TARGET_DEVICES += linksys_wrt1900ac-v2 define Device/linksys_wrt3200acm $(call Device/linksys) + $(Device/dsa-migration) DEVICE_MODEL := WRT3200ACM DEVICE_ALT0_VENDOR := Linksys DEVICE_ALT0_MODEL := Rango DEVICE_DTS := armada-385-linksys-rango DEVICE_PACKAGES += kmod-btmrvl kmod-mwifiex-sdio mwlwifi-firmware-88w8964 + SUPPORTED_DEVICES += armada-385-linksys-rango linksys,rango endef TARGET_DEVICES += linksys_wrt3200acm define Device/linksys_wrt32x $(call Device/linksys) + $(Device/dsa-migration) DEVICE_MODEL := WRT32X DEVICE_ALT0_VENDOR := Linksys DEVICE_ALT0_MODEL := Venom @@ -142,6 +158,7 @@ define Device/linksys_wrt32x DEVICE_PACKAGES += kmod-btmrvl kmod-mwifiex-sdio mwlwifi-firmware-88w8964 KERNEL_SIZE := 3072k KERNEL := kernel-bin | append-dtb + SUPPORTED_DEVICES += armada-385-linksys-venom linksys,venom DEFAULT := n endef TARGET_DEVICES += linksys_wrt32x @@ -234,6 +251,7 @@ endef TARGET_DEVICES += solidrun_clearfog-base-a1 define Device/solidrun_clearfog-pro-a1 + $(Device/dsa-migration) DEVICE_VENDOR := SolidRun DEVICE_MODEL := ClearFog Pro KERNEL_INSTALL := 1 @@ -244,5 +262,6 @@ define Device/solidrun_clearfog-pro-a1 DEVICE_DTS := armada-388-clearfog-pro armada-388-clearfog-base UBOOT := clearfog-u-boot-spl.kwb BOOT_SCRIPT := clearfog + SUPPORTED_DEVICES += armada-388-clearfog armada-388-clearfog-pro endef TARGET_DEVICES += solidrun_clearfog-pro-a1 From 090779b24e436bb5113719eb7067c7b8151abd14 Mon Sep 17 00:00:00 2001 From: Adrian Schmutzler Date: Tue, 14 Jul 2020 16:18:10 +0200 Subject: [PATCH 12/15] kirkwood: implement compatibility version for DSA migration This implements the newly introduced compat-version to prevent upgrade between swconfig and DSA for kirkwood. Just define a compat version with minor increment and an appropriate message for both image (in Makefile) and device (in base-files). Since we never removed SUPPORTED_DEVICES for this target, we don't have to add it back either. Attention: All users that already updated to the DSA versions in master will receive the same incompatibility warning since their devices are still "1.0" as far as fwtool can tell. Those, and only those, can bypass the upgrade check by using force (-F) without having to reset config again. In addition, the new version string needs to be put into uci config manually, so the new fwtool knows that it actually deals with a "1.1": uci set "system.@system[-1].compat_version=1.1" uci commit system Signed-off-by: Adrian Schmutzler --- .../base-files/etc/board.d/05_compat-version | 20 +++++++++++++++++++ target/linux/kirkwood/image/Makefile | 7 +++++++ 2 files changed, 27 insertions(+) create mode 100755 target/linux/kirkwood/base-files/etc/board.d/05_compat-version diff --git a/target/linux/kirkwood/base-files/etc/board.d/05_compat-version b/target/linux/kirkwood/base-files/etc/board.d/05_compat-version new file mode 100755 index 0000000000..8954d69d12 --- /dev/null +++ b/target/linux/kirkwood/base-files/etc/board.d/05_compat-version @@ -0,0 +1,20 @@ +#!/bin/sh +# +# Copyright (C) 2020 OpenWrt.org +# + +. /lib/functions.sh +. /lib/functions/uci-defaults.sh + +board_config_update + +case "$(board_name)" in + linksys,audi|\ + linksys,viper) + ucidef_set_compat_version "1.1" + ;; +esac + +board_config_flush + +exit 0 diff --git a/target/linux/kirkwood/image/Makefile b/target/linux/kirkwood/image/Makefile index ba93fffeb2..6554fc2669 100644 --- a/target/linux/kirkwood/image/Makefile +++ b/target/linux/kirkwood/image/Makefile @@ -10,6 +10,11 @@ include $(INCLUDE_DIR)/image.mk KERNEL_LOADADDR:=0x8000 +define Device/dsa-migration + DEVICE_COMPAT_VERSION := 1.1 + DEVICE_COMPAT_MESSAGE := Config cannot be migrated from swconfig to DSA +endef + define Device/Default PROFILES := Default DEVICE_DTS = $$(if $$(BOARD_NAME),kirkwood-$$(BOARD_NAME),) @@ -92,6 +97,7 @@ endef TARGET_DEVICES += iom_ix2-200 define Device/linksys_audi + $(Device/dsa-migration) DEVICE_VENDOR := Linksys DEVICE_MODEL := EA3500 (Audi) DEVICE_PACKAGES := kmod-mwl8k wpad-basic kmod-gpio-button-hotplug @@ -107,6 +113,7 @@ endef TARGET_DEVICES += linksys_audi define Device/linksys_viper + $(Device/dsa-migration) DEVICE_VENDOR := Linksys DEVICE_MODEL := E4200v2 / EA4500 (Viper) DEVICE_PACKAGES := kmod-mwl8k wpad-basic kmod-gpio-button-hotplug From e496eefccca90c0b244434a11393f6f86fd9194a Mon Sep 17 00:00:00 2001 From: Adrian Schmutzler Date: Fri, 31 Jul 2020 11:21:34 +0200 Subject: [PATCH 13/15] mvebu: increase compat version for SolidRun ClearFog Base When changing the Pro variant to DSA, the ethernet interface rename script was dropped by all devices to keep them in sync: be309bfd7445 ("mvebu: drop 06_set_iface_mac preinit script") Therefore, network config will be broken after upgrade for the Base variant as well. Increase the compat version and provide a message to signal that to the users. Signed-off-by: Adrian Schmutzler --- .../mvebu/cortexa9/base-files/etc/board.d/05_compat-version | 1 + target/linux/mvebu/image/cortexa9.mk | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/target/linux/mvebu/cortexa9/base-files/etc/board.d/05_compat-version b/target/linux/mvebu/cortexa9/base-files/etc/board.d/05_compat-version index dffb94de03..9304b84e7f 100755 --- a/target/linux/mvebu/cortexa9/base-files/etc/board.d/05_compat-version +++ b/target/linux/mvebu/cortexa9/base-files/etc/board.d/05_compat-version @@ -15,6 +15,7 @@ case "$(board_name)" in linksys,wrt1900acs|\ linksys,wrt3200acm|\ linksys,wrt32x|\ + solidrun,clearfog-base-a1|\ solidrun,clearfog-pro-a1) ucidef_set_compat_version "1.1" ;; diff --git a/target/linux/mvebu/image/cortexa9.mk b/target/linux/mvebu/image/cortexa9.mk index e86675eeb9..245e8a2d69 100644 --- a/target/linux/mvebu/image/cortexa9.mk +++ b/target/linux/mvebu/image/cortexa9.mk @@ -244,9 +244,11 @@ define Device/solidrun_clearfog-base-a1 IMAGES := sdcard.img.gz IMAGE/sdcard.img.gz := boot-scr | boot-img-ext4 | sdcard-img-ext4 | gzip | append-metadata DEVICE_DTS := armada-388-clearfog-base armada-388-clearfog-pro - SUPPORTED_DEVICES += armada-388-clearfog-base UBOOT := clearfog-u-boot-spl.kwb BOOT_SCRIPT := clearfog + SUPPORTED_DEVICES += armada-388-clearfog-base + DEVICE_COMPAT_VERSION := 1.1 + DEVICE_COMPAT_MESSAGE := Ethernet interface rename has been dropped endef TARGET_DEVICES += solidrun_clearfog-base-a1 From 664237deaa76d46a3047bc9afd6f57aac800753a Mon Sep 17 00:00:00 2001 From: Adrian Schmutzler Date: Fri, 31 Jul 2020 11:26:11 +0200 Subject: [PATCH 14/15] mvebu: fix alphabetic sorting in 02_network This has been overlooked when removing solidrun,clearfog-a1 entry. Signed-off-by: Adrian Schmutzler --- .../mvebu/cortexa9/base-files/etc/board.d/02_network | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/target/linux/mvebu/cortexa9/base-files/etc/board.d/02_network b/target/linux/mvebu/cortexa9/base-files/etc/board.d/02_network index 9718b332a7..a8974efaa8 100755 --- a/target/linux/mvebu/cortexa9/base-files/etc/board.d/02_network +++ b/target/linux/mvebu/cortexa9/base-files/etc/board.d/02_network @@ -30,18 +30,18 @@ mvebu_setup_interfaces() marvell,axp-gp) ucidef_set_interface_lan "eth0 eth1 eth2 eth3" ;; - solidrun,clearfog-pro-a1) - # eth0 is standalone ethernet - # eth1 is switch - # eth2 is SFP - ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4 lan5 lan6" "eth0 eth2" - ;; solidrun,clearfog-base-a1) # eth0 is standalone ethernet # eth1 is standalone ethernet # eth2 is SFP ucidef_set_interfaces_lan_wan "eth1" "eth0 eth2" ;; + solidrun,clearfog-pro-a1) + # eth0 is standalone ethernet + # eth1 is switch + # eth2 is SFP + ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4 lan5 lan6" "eth0 eth2" + ;; *) ucidef_set_interface_lan "eth0" ;; From c4dd7fc23bfcf3b3f1a838668bb070edc9db5d4b Mon Sep 17 00:00:00 2001 From: Adrian Schmutzler Date: Wed, 29 Jul 2020 21:59:18 +0200 Subject: [PATCH 15/15] hostapd: reorganize config selection hierarchy for WPA3 The current selection of DRIVER_MAKEOPTS and TARGET_LDFLAGS is exceptionally hard to read. This tries to make things a little easier by inverting the hierarchy of the conditions, so SSL_VARIANT is checked first and LOCAL_VARIANT is checked second. This exploits the fact that some of the previous conditions were unnecessary, e.g. there is no hostapd-mesh*, so we don't need to exclude this combination. It also should make it a little easier to see which options are actually switched by SSL_VARIANT and which by LOCAL_VARIANT. The patch is supposed to be cosmetic. Signed-off-by: Adrian Schmutzler --- package/network/services/hostapd/Makefile | 38 ++++++++++++----------- 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/package/network/services/hostapd/Makefile b/package/network/services/hostapd/Makefile index d738605b5a..44312db590 100644 --- a/package/network/services/hostapd/Makefile +++ b/package/network/services/hostapd/Makefile @@ -98,29 +98,31 @@ ifneq ($(LOCAL_VARIANT),mini) DRIVER_MAKEOPTS += CONFIG_IEEE80211W=$(CONFIG_DRIVER_11W_SUPPORT) endif -ifeq ($(LOCAL_VARIANT),full) - ifeq ($(SSL_VARIANT),openssl) - DRIVER_MAKEOPTS += CONFIG_TLS=openssl CONFIG_SAE=y CONFIG_OWE=y CONFIG_SUITEB192=y CONFIG_AP=y CONFIG_MESH=y - TARGET_LDFLAGS += -lcrypto -lssl +ifeq ($(SSL_VARIANT),openssl) + DRIVER_MAKEOPTS += CONFIG_TLS=openssl CONFIG_SAE=y + TARGET_LDFLAGS += -lcrypto -lssl + + ifeq ($(LOCAL_VARIANT),mesh) + DRIVER_MAKEOPTS += CONFIG_AP=y CONFIG_MESH=y endif - ifeq ($(SSL_VARIANT),wolfssl) - DRIVER_MAKEOPTS += CONFIG_TLS=wolfssl CONFIG_WPS_NFC=1 CONFIG_SAE=y CONFIG_OWE=y CONFIG_SUITEB192=y CONFIG_AP=y CONFIG_MESH=y - TARGET_LDFLAGS += -lwolfssl + ifeq ($(LOCAL_VARIANT),full) + DRIVER_MAKEOPTS += CONFIG_OWE=y CONFIG_SUITEB192=y CONFIG_AP=y CONFIG_MESH=y + endif +endif + +ifeq ($(SSL_VARIANT),wolfssl) + DRIVER_MAKEOPTS += CONFIG_TLS=wolfssl CONFIG_SAE=y + TARGET_LDFLAGS += -lwolfssl + + ifeq ($(LOCAL_VARIANT),mesh) + DRIVER_MAKEOPTS += CONFIG_AP=y CONFIG_MESH=y CONFIG_WPS_NFC=1 + endif + ifeq ($(LOCAL_VARIANT),full) + DRIVER_MAKEOPTS += CONFIG_OWE=y CONFIG_SUITEB192=y CONFIG_AP=y CONFIG_MESH=y CONFIG_WPS_NFC=1 endif endif ifneq ($(LOCAL_TYPE),hostapd) - ifeq ($(LOCAL_VARIANT),mesh) - ifeq ($(SSL_VARIANT),openssl) - DRIVER_MAKEOPTS += CONFIG_TLS=openssl CONFIG_AP=y CONFIG_SAE=y CONFIG_MESH=y - TARGET_LDFLAGS += -lcrypto -lssl - endif - ifeq ($(SSL_VARIANT),wolfssl) - DRIVER_MAKEOPTS += CONFIG_TLS=wolfssl CONFIG_WPS_NFC=1 CONFIG_AP=y CONFIG_SAE=y CONFIG_MESH=y - TARGET_LDFLAGS += -lwolfssl - endif - endif - ifdef CONFIG_WPA_RFKILL_SUPPORT DRIVER_MAKEOPTS += NEED_RFKILL=y endif