layerscape: make initramfs kernel fit packed
[openwrt/staging/wigyori.git] / target / linux / layerscape / image / armv7.mk
1 #
2 # Copyright 2018-2020 NXP
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 define Device/Default
9 PROFILES := Default
10 FILESYSTEMS := squashfs
11 IMAGES := firmware.bin sysupgrade.bin
12 KERNEL := kernel-bin | uImage none
13 KERNEL_INITRAMFS = kernel-bin | gzip | fit gzip $$(DTS_DIR)/$$(DEVICE_DTS).dtb
14 KERNEL_NAME := zImage
15 KERNEL_LOADADDR := 0x80008000
16 KERNEL_ENTRY_POINT := 0x80008000
17 DEVICE_DTS = $(lastword $(subst _, ,$(1)))
18 SUPPORTED_DEVICES = $(subst _,$(comma),$(1))
19 IMAGE_SIZE := 64m
20 IMAGE/sysupgrade.bin = \
21 ls-append-dtb $$(DEVICE_DTS) | pad-to 1M | \
22 append-kernel | pad-to 17M | \
23 append-rootfs | pad-rootfs | \
24 check-size $(LS_SYSUPGRADE_IMAGE_SIZE) | append-metadata
25 endef
26
27 define Device/fsl-sdboot
28 $(Device/rework-sdcard-images)
29 KERNEL = kernel-bin | gzip | fit gzip $$(DTS_DIR)/$$(DEVICE_DTS).dtb
30 IMAGES := sdcard.img.gz sysupgrade.bin
31 IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
32 endef
33
34 define Device/fsl_ls1021a-twr
35 $(Device/fix-sysupgrade)
36 DEVICE_VENDOR := NXP
37 DEVICE_MODEL := TWR-LS1021A
38 DEVICE_VARIANT := Default
39 DEVICE_PACKAGES += layerscape-rcw
40 IMAGE/firmware.bin := \
41 ls-clean | \
42 ls-append $(1)-rcw.bin | pad-to 1M | \
43 ls-append $(1)-uboot.bin | pad-to 3M | \
44 ls-append $(1)-uboot-env.bin | pad-to 15M | \
45 ls-append-dtb $$(DEVICE_DTS) | pad-to 16M | \
46 append-kernel | pad-to 32M | \
47 append-rootfs | pad-rootfs | check-size
48 endef
49 TARGET_DEVICES += fsl_ls1021a-twr
50
51 define Device/fsl_ls1021a-twr-sdboot
52 $(Device/fsl-sdboot)
53 DEVICE_VENDOR := NXP
54 DEVICE_MODEL := TWR-LS1021A
55 DEVICE_VARIANT := SD Card Boot
56 DEVICE_DTS := ls1021a-twr
57 IMAGE/sdcard.img.gz := \
58 ls-clean | \
59 ls-append-sdhead $(1) | pad-to 4K | \
60 ls-append $(1)-uboot.bin | pad-to 3M | \
61 ls-append $(1)-uboot-env.bin | pad-to 16M | \
62 ls-append-kernel | pad-to $(LS_SD_ROOTFSPART_OFFSET)M | \
63 append-rootfs | pad-to $(LS_SD_IMAGE_SIZE)M | gzip
64 endef
65 TARGET_DEVICES += fsl_ls1021a-twr-sdboot
66
67 define Device/fsl_ls1021a-iot-sdboot
68 $(Device/fsl-sdboot)
69 DEVICE_VENDOR := NXP
70 DEVICE_MODEL := LS1021A-IoT
71 DEVICE_VARIANT := SD Card Boot
72 DEVICE_DTS := ls1021a-iot
73 SUPPORTED_DEVICES :=
74 IMAGE/sdcard.img.gz := \
75 ls-clean | \
76 ls-append-sdhead $(1) | pad-to 4K | \
77 ls-append $(1)-uboot.bin | pad-to 1M | \
78 ls-append $(1)-uboot-env.bin | pad-to 16M | \
79 ls-append-kernel | pad-to $(LS_SD_ROOTFSPART_OFFSET)M | \
80 append-rootfs | pad-to $(LS_SD_IMAGE_SIZE)M | gzip
81 endef
82 TARGET_DEVICES += fsl_ls1021a-iot-sdboot