ath79: consolidate common definitions for OpenMesh devices

The shared image definitions for OpenMesh devices are currently
organized based on device families. This introduces some duplicate
code, as the image creation code is mostly the same for those.

This patch thus derives two basic shared definitions that work for
all devices and only requires a few variables to be moved back to
the device definitions.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
This commit is contained in:
Adrian Schmutzler 2021-01-19 14:28:05 +01:00
parent 4fbdadc0bf
commit bcb311497d

View File

@ -8,6 +8,7 @@ DEVICE_VARS += ADDPATTERN_ID ADDPATTERN_VERSION
DEVICE_VARS += SEAMA_SIGNATURE SEAMA_MTDBLOCK DEVICE_VARS += SEAMA_SIGNATURE SEAMA_MTDBLOCK
DEVICE_VARS += KERNEL_INITRAMFS_PREFIX DAP_SIGNATURE DEVICE_VARS += KERNEL_INITRAMFS_PREFIX DAP_SIGNATURE
DEVICE_VARS += EDIMAX_HEADER_MAGIC EDIMAX_HEADER_MODEL DEVICE_VARS += EDIMAX_HEADER_MAGIC EDIMAX_HEADER_MODEL
DEVICE_VARS += OPENMESH_CE_TYPE
define Build/add-elecom-factory-initramfs define Build/add-elecom-factory-initramfs
$(eval edimax_model=$(word 1,$(1))) $(eval edimax_model=$(word 1,$(1)))
@ -1525,148 +1526,144 @@ define Device/ocedo_ursus
endef endef
TARGET_DEVICES += ocedo_ursus TARGET_DEVICES += ocedo_ursus
define Device/openmesh_mr600-common define Device/openmesh_common_64k
SOC := ar9344
DEVICE_VENDOR := OpenMesh DEVICE_VENDOR := OpenMesh
DEVICE_MODEL := MR600
DEVICE_PACKAGES := uboot-envtools DEVICE_PACKAGES := uboot-envtools
IMAGE_SIZE := 7808k IMAGE_SIZE := 7808k
BLOCKSIZE := 64k BLOCKSIZE := 64k
OPENMESH_CE_TYPE :=
KERNEL := kernel-bin | append-dtb | lzma | uImage lzma | \ KERNEL := kernel-bin | append-dtb | lzma | uImage lzma | \
pad-to $$(BLOCKSIZE) pad-to $$(BLOCKSIZE)
IMAGE/sysupgrade.bin := append-rootfs | pad-rootfs | \ IMAGE/sysupgrade.bin := append-rootfs | pad-rootfs | \
openmesh-image ce_type=MR600 | append-metadata openmesh-image ce_type=$$$$(OPENMESH_CE_TYPE) | append-metadata
endef
define Device/openmesh_common_256k
DEVICE_VENDOR := OpenMesh
DEVICE_PACKAGES := uboot-envtools
IMAGE_SIZE := 7168k
BLOCKSIZE := 256k
OPENMESH_CE_TYPE :=
KERNEL := kernel-bin | append-dtb | lzma | uImage lzma | \
pad-to $$(BLOCKSIZE)
IMAGE/sysupgrade.bin := append-rootfs | pad-rootfs | \
openmesh-image ce_type=$$$$(OPENMESH_CE_TYPE) | append-metadata
endef endef
define Device/openmesh_mr600-v1 define Device/openmesh_mr600-v1
$(Device/openmesh_mr600-common) $(Device/openmesh_common_64k)
SOC := ar9344
DEVICE_MODEL := MR600
DEVICE_VARIANT := v1 DEVICE_VARIANT := v1
OPENMESH_CE_TYPE := MR600
SUPPORTED_DEVICES += mr600 SUPPORTED_DEVICES += mr600
endef endef
TARGET_DEVICES += openmesh_mr600-v1 TARGET_DEVICES += openmesh_mr600-v1
define Device/openmesh_mr600-v2 define Device/openmesh_mr600-v2
$(Device/openmesh_mr600-common) $(Device/openmesh_common_64k)
SOC := ar9344
DEVICE_MODEL := MR600
DEVICE_VARIANT := v2 DEVICE_VARIANT := v2
OPENMESH_CE_TYPE := MR600
SUPPORTED_DEVICES += mr600v2 SUPPORTED_DEVICES += mr600v2
endef endef
TARGET_DEVICES += openmesh_mr600-v2 TARGET_DEVICES += openmesh_mr600-v2
define Device/openmesh_mr900-common
SOC := qca9558
DEVICE_VENDOR := OpenMesh
DEVICE_MODEL := MR900
DEVICE_PACKAGES := uboot-envtools
IMAGE_SIZE := 7808k
BLOCKSIZE := 64k
KERNEL := kernel-bin | append-dtb | lzma | uImage lzma | \
pad-to $$(BLOCKSIZE)
IMAGE/sysupgrade.bin := append-rootfs | pad-rootfs | \
openmesh-image ce_type=MR900 | append-metadata
endef
define Device/openmesh_mr900-v1 define Device/openmesh_mr900-v1
$(Device/openmesh_mr900-common) $(Device/openmesh_common_64k)
SOC := qca9558
DEVICE_MODEL := MR900
DEVICE_VARIANT := v1 DEVICE_VARIANT := v1
OPENMESH_CE_TYPE := MR900
SUPPORTED_DEVICES += mr900 SUPPORTED_DEVICES += mr900
endef endef
TARGET_DEVICES += openmesh_mr900-v1 TARGET_DEVICES += openmesh_mr900-v1
define Device/openmesh_mr900-v2 define Device/openmesh_mr900-v2
$(Device/openmesh_mr900-common) $(Device/openmesh_common_64k)
SOC := qca9558
DEVICE_MODEL := MR900
DEVICE_VARIANT := v2 DEVICE_VARIANT := v2
OPENMESH_CE_TYPE := MR900
SUPPORTED_DEVICES += mr900v2 SUPPORTED_DEVICES += mr900v2
endef endef
TARGET_DEVICES += openmesh_mr900-v2 TARGET_DEVICES += openmesh_mr900-v2
define Device/openmesh_om2p-common
DEVICE_VENDOR := OpenMesh
DEVICE_PACKAGES := uboot-envtools
IMAGE_SIZE := 7168k
BLOCKSIZE := 256k
KERNEL := kernel-bin | append-dtb | lzma | uImage lzma | \
pad-to $$(BLOCKSIZE)
IMAGE/sysupgrade.bin := append-rootfs | pad-rootfs | \
openmesh-image ce_type=OM2P | append-metadata
endef
define Device/openmesh_om2p-v2 define Device/openmesh_om2p-v2
$(Device/openmesh_om2p-common) $(Device/openmesh_common_256k)
SOC := ar9330 SOC := ar9330
DEVICE_MODEL := OM2P DEVICE_MODEL := OM2P
DEVICE_VARIANT := v2 DEVICE_VARIANT := v2
OPENMESH_CE_TYPE := OM2P
SUPPORTED_DEVICES += om2pv2 SUPPORTED_DEVICES += om2pv2
endef endef
TARGET_DEVICES += openmesh_om2p-v2 TARGET_DEVICES += openmesh_om2p-v2
define Device/openmesh_om2p-v4 define Device/openmesh_om2p-v4
$(Device/openmesh_om2p-common) $(Device/openmesh_common_256k)
SOC := qca9533 SOC := qca9533
DEVICE_MODEL := OM2P DEVICE_MODEL := OM2P
DEVICE_VARIANT := v4 DEVICE_VARIANT := v4
OPENMESH_CE_TYPE := OM2P
SUPPORTED_DEVICES += om2pv4 SUPPORTED_DEVICES += om2pv4
endef endef
TARGET_DEVICES += openmesh_om2p-v4 TARGET_DEVICES += openmesh_om2p-v4
define Device/openmesh_om2p-hs-v1 define Device/openmesh_om2p-hs-v1
$(Device/openmesh_om2p-common) $(Device/openmesh_common_256k)
SOC := ar9341 SOC := ar9341
DEVICE_MODEL := OM2P-HS DEVICE_MODEL := OM2P-HS
DEVICE_VARIANT := v1 DEVICE_VARIANT := v1
OPENMESH_CE_TYPE := OM2P
SUPPORTED_DEVICES += om2p-hs SUPPORTED_DEVICES += om2p-hs
endef endef
TARGET_DEVICES += openmesh_om2p-hs-v1 TARGET_DEVICES += openmesh_om2p-hs-v1
define Device/openmesh_om2p-hs-v2 define Device/openmesh_om2p-hs-v2
$(Device/openmesh_om2p-common) $(Device/openmesh_common_256k)
SOC := ar9341 SOC := ar9341
DEVICE_MODEL := OM2P-HS DEVICE_MODEL := OM2P-HS
DEVICE_VARIANT := v2 DEVICE_VARIANT := v2
OPENMESH_CE_TYPE := OM2P
SUPPORTED_DEVICES += om2p-hsv2 SUPPORTED_DEVICES += om2p-hsv2
endef endef
TARGET_DEVICES += openmesh_om2p-hs-v2 TARGET_DEVICES += openmesh_om2p-hs-v2
define Device/openmesh_om2p-hs-v3 define Device/openmesh_om2p-hs-v3
$(Device/openmesh_om2p-common) $(Device/openmesh_common_256k)
SOC := ar9341 SOC := ar9341
DEVICE_MODEL := OM2P-HS DEVICE_MODEL := OM2P-HS
DEVICE_VARIANT := v3 DEVICE_VARIANT := v3
OPENMESH_CE_TYPE := OM2P
SUPPORTED_DEVICES += om2p-hsv3 SUPPORTED_DEVICES += om2p-hsv3
endef endef
TARGET_DEVICES += openmesh_om2p-hs-v3 TARGET_DEVICES += openmesh_om2p-hs-v3
define Device/openmesh_om2p-hs-v4 define Device/openmesh_om2p-hs-v4
$(Device/openmesh_om2p-common) $(Device/openmesh_common_256k)
SOC := qca9533 SOC := qca9533
DEVICE_MODEL := OM2P-HS DEVICE_MODEL := OM2P-HS
DEVICE_VARIANT := v4 DEVICE_VARIANT := v4
OPENMESH_CE_TYPE := OM2P
SUPPORTED_DEVICES += om2p-hsv4 SUPPORTED_DEVICES += om2p-hsv4
endef endef
TARGET_DEVICES += openmesh_om2p-hs-v4 TARGET_DEVICES += openmesh_om2p-hs-v4
define Device/openmesh_om2p-lc define Device/openmesh_om2p-lc
$(Device/openmesh_om2p-common) $(Device/openmesh_common_256k)
SOC := ar9330 SOC := ar9330
DEVICE_MODEL := OM2P-LC DEVICE_MODEL := OM2P-LC
OPENMESH_CE_TYPE := OM2P
SUPPORTED_DEVICES += om2p-lc SUPPORTED_DEVICES += om2p-lc
endef endef
TARGET_DEVICES += openmesh_om2p-lc TARGET_DEVICES += openmesh_om2p-lc
define Device/openmesh_om5p-common
SOC := ar9344
DEVICE_VENDOR := OpenMesh
DEVICE_PACKAGES := uboot-envtools
IMAGE_SIZE := 7808k
BLOCKSIZE := 64k
KERNEL := kernel-bin | append-dtb | lzma | uImage lzma | \
pad-to $$(BLOCKSIZE)
IMAGE/sysupgrade.bin := append-rootfs | pad-rootfs | \
openmesh-image ce_type=OM5P | append-metadata
endef
define Device/openmesh_om5p define Device/openmesh_om5p
$(Device/openmesh_om5p-common) $(Device/openmesh_common_64k)
SOC := ar9344
DEVICE_MODEL := OM5P DEVICE_MODEL := OM5P
OPENMESH_CE_TYPE := OM5P
SUPPORTED_DEVICES += om5p SUPPORTED_DEVICES += om5p
endef endef
TARGET_DEVICES += openmesh_om5p TARGET_DEVICES += openmesh_om5p