openwrt/target/linux/layerscape/image/armv7.mk
Adrian Schmutzler f52081bcf9 treewide: provide global default for SUPPORTED_DEVICES
The majority of our targets provide a default value for the variable
SUPPORTED_DEVICES, which is used in images to check against the
compatible on a running device:

  SUPPORTED_DEVICES := $(subst _,$(comma),$(1))

At the moment, this is implemented in the Device/Default block of
the individual targets or even subtargets. However, since we
standardized device names and compatible in the recent past, almost
all targets are following the same scheme now:

  device/image name:  vendor_model
  compatible:         vendor,model

The equal redundant definitions are a symptom of this process.

Consequently, this patch moves the definition to image.mk making it
a global default. For the few targets not using the scheme above,
SUPPORTED_DEVICES will be defined to a different value in
Device/Default anyway, overwriting the default. In other words:
This change is supposed to be cosmetic.

This can be used as a global measure to get the current compatible
with: $(firstword $(SUPPORTED_DEVICES))
(Though this is not precisely an achievement of this commit.)

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2021-01-23 12:45:21 +01:00

82 lines
2.5 KiB
Makefile

#
# Copyright 2018-2020 NXP
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
define Device/Default
PROFILES := Default
FILESYSTEMS := squashfs
IMAGES := firmware.bin sysupgrade.bin
KERNEL := kernel-bin | uImage none
KERNEL_INITRAMFS = kernel-bin | gzip | fit gzip $$(DTS_DIR)/$$(DEVICE_DTS).dtb
KERNEL_NAME := zImage
KERNEL_LOADADDR := 0x80008000
KERNEL_ENTRY_POINT := 0x80008000
DEVICE_DTS = $(lastword $(subst _, ,$(1)))
IMAGE_SIZE := 64m
IMAGE/sysupgrade.bin = \
ls-append-dtb $$(DEVICE_DTS) | pad-to 1M | \
append-kernel | pad-to 17M | \
append-rootfs | pad-rootfs | \
check-size $(LS_SYSUPGRADE_IMAGE_SIZE) | append-metadata
endef
define Device/fsl-sdboot
$(Device/rework-sdcard-images)
KERNEL = kernel-bin | gzip | fit gzip $$(DTS_DIR)/$$(DEVICE_DTS).dtb
IMAGES := sdcard.img.gz sysupgrade.bin
IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
endef
define Device/fsl_ls1021a-twr
$(Device/fix-sysupgrade)
DEVICE_VENDOR := NXP
DEVICE_MODEL := TWR-LS1021A
DEVICE_VARIANT := Default
DEVICE_PACKAGES += layerscape-rcw
IMAGE/firmware.bin := \
ls-clean | \
ls-append $(1)-rcw.bin | pad-to 1M | \
ls-append $(1)-uboot.bin | pad-to 3M | \
ls-append $(1)-uboot-env.bin | pad-to 15M | \
ls-append-dtb $$(DEVICE_DTS) | pad-to 16M | \
append-kernel | pad-to 32M | \
append-rootfs | pad-rootfs | check-size
endef
TARGET_DEVICES += fsl_ls1021a-twr
define Device/fsl_ls1021a-twr-sdboot
$(Device/fsl-sdboot)
DEVICE_VENDOR := NXP
DEVICE_MODEL := TWR-LS1021A
DEVICE_VARIANT := SD Card Boot
DEVICE_DTS := ls1021a-twr
IMAGE/sdcard.img.gz := \
ls-clean | \
ls-append-sdhead $(1) | pad-to 4K | \
ls-append $(1)-uboot.bin | pad-to 3M | \
ls-append $(1)-uboot-env.bin | pad-to 16M | \
ls-append-kernel | pad-to $(LS_SD_ROOTFSPART_OFFSET)M | \
append-rootfs | pad-to $(LS_SD_IMAGE_SIZE)M | gzip
endef
TARGET_DEVICES += fsl_ls1021a-twr-sdboot
define Device/fsl_ls1021a-iot-sdboot
$(Device/fsl-sdboot)
DEVICE_VENDOR := NXP
DEVICE_MODEL := LS1021A-IoT
DEVICE_VARIANT := SD Card Boot
DEVICE_DTS := ls1021a-iot
SUPPORTED_DEVICES :=
IMAGE/sdcard.img.gz := \
ls-clean | \
ls-append-sdhead $(1) | pad-to 4K | \
ls-append $(1)-uboot.bin | pad-to 1M | \
ls-append $(1)-uboot-env.bin | pad-to 16M | \
ls-append-kernel | pad-to $(LS_SD_ROOTFSPART_OFFSET)M | \
append-rootfs | pad-to $(LS_SD_IMAGE_SIZE)M | gzip
endef
TARGET_DEVICES += fsl_ls1021a-iot-sdboot