target: use SPDX license identifiers on Makefiles
[openwrt/openwrt.git] / target / linux / at91 / image / Makefile
1 # SPDX-License-Identifier: GPL-2.0-only
2 #
3 # Copyright (C) 2006-2013 OpenWrt.org
4
5 include $(TOPDIR)/rules.mk
6 include $(INCLUDE_DIR)/image.mk
7
8 KERNEL_LOADADDR := 0x20008000
9
10 define Build/at91-install-zImage
11 $(CP) $(KDIR)/zImage $@
12 endef
13
14 include $(SUBTARGET).mk
15
16 AT91_SD_BOOT_PARTSIZE:=64
17 FAT32_BLOCK_SIZE:=1024
18 FAT32_BLOCKS:=$(shell echo \
19 $$(($(AT91_SD_BOOT_PARTSIZE)*1024*1024/$(FAT32_BLOCK_SIZE))))
20
21 define Device/Default
22 $(Device/default-nand)
23 PROFILES := Default
24 FILESYSTEMS := squashfs ubifs ext4
25 DEVICE_DTS = $(lastword $(subst _, ,$(1)))
26 KERNEL_NAME := zImage
27 KERNEL_SIZE := 4096k
28 KERNEL := kernel-bin | append-dtb | lzma | uImage lzma
29 DTB_SIZE := 128k
30 endef
31
32 define Device/dtb
33 KERNEL := kernel-bin | lzma | uImage lzma
34 endef
35
36 define Device/evaluation-sdimage
37 IMAGES += sdcard.img.gz
38 IMAGE/sdcard.img.gz := at91-sdcard
39 endef
40
41 define Device/evaluation
42 KERNEL_INSTALL := 1
43 KERNEL_SUFFIX := -uImage
44 IMAGES := root.ubi
45 IMAGE/root.ubi := append-ubi
46 endef
47
48 define Device/evaluation-zImage
49 IMAGES += zImage
50 IMAGE/zImage := at91-install-zImage
51 endef
52
53 define Device/evaluation-dtb
54 $(Device/evaluation)
55 $(Device/dtb)
56 KERNEL_SUFFIX := -fit-zImage.itb
57 KERNEL = kernel-bin | gzip | fit gzip $$(KDIR)/image-$$(DEVICE_DTS).dtb
58 endef
59
60 define Device/evaluation-fit
61 $(Device/evaluation)
62 KERNEL_SUFFIX := -fit-uImage.itb
63 KERNEL = kernel-bin | lzma | fit lzma $$(KDIR)/image-$$(DEVICE_DTS).dtb
64 endef
65
66 define Device/production
67 UBINIZE_OPTS := -E 5
68 IMAGES := factory.bin
69 IMAGE/factory.bin := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-ubi
70 endef
71
72 define Device/production-dtb
73 $(Device/production)
74 $(Device/dtb)
75 IMAGE/factory.bin := append-dtb | pad-to $$$$(DTB_SIZE) | \
76 append-kernel | pad-to $$$$(KERNEL_SIZE) | append-ubi
77 endef
78
79 $(eval $(call BuildImage))