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-commands.mk b/include/image-commands.mk index e7db7128b4..7a370034c8 100644 --- a/include/image-commands.mk +++ b/include/image-commands.mk @@ -384,13 +384,19 @@ 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))], \ + "metadata_version": "1.1", \ + "compat_version": "$(call json_quote,$(compat_version))", \ + $(if $(DEVICE_COMPAT_MESSAGE),"compat_message": "$(call json_quote,$(DEVICE_COMPAT_MESSAGE))"$(comma)) \ + $(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))", \ @@ -401,7 +407,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 18ad10cfe2..20c13ed199 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 := @@ -426,6 +428,7 @@ define Device/Init UBOOT_PATH := $(STAGING_DIR_IMAGE)/uboot-$(1) + BROKEN := DEFAULT := endef @@ -435,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 \ @@ -638,6 +642,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/package/base-files/files/bin/config_generate b/package/base-files/files/bin/config_generate index e405d87d7a..a08f091d03 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}" } diff --git a/package/base-files/files/lib/upgrade/fwtool.sh b/package/base-files/files/lib/upgrade/fwtool.sh index a0b3fb0a04..3a74c72bba 100644 --- a/package/base-files/files/lib/upgrade/fwtool.sh +++ b/package/base-files/files/lib/upgrade/fwtool.sh @@ -44,13 +44,40 @@ fwtool_check_image() { } device="$(cat /tmp/sysinfo/board_name)" + devicecompat="$(uci -q get system.@system[0].compat_version)" + [ -n "$devicecompat" ] || devicecompat="1.0" - json_select supported_devices || return 1 + json_get_var imagecompat compat_version + json_get_var compatmessage compat_message + [ -n "$imagecompat" ] || imagecompat="1.0" + + # 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 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" 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 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 5414995648..adbe2e1fb8 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"; 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/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/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; 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 008b02de9d..86a37b2c3e 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 @@ -370,8 +373,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 @@ -409,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 @@ -420,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)) 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 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" ;; 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..9304b84e7f --- /dev/null +++ b/target/linux/mvebu/cortexa9/base-files/etc/board.d/05_compat-version @@ -0,0 +1,26 @@ +#!/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-base-a1|\ + 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..245e8a2d69 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 @@ -227,13 +244,16 @@ 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 define Device/solidrun_clearfog-pro-a1 + $(Device/dsa-migration) DEVICE_VENDOR := SolidRun DEVICE_MODEL := ClearFog Pro KERNEL_INSTALL := 1 @@ -244,5 +264,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 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/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>; }; }; 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|\