99c7e21669e1150006a934b9dd90f6017e561646
[librecmc/librecmc.git] / target / linux / at91 / image / Makefile
1 #
2 # Copyright (C) 2006-2013 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7 include $(TOPDIR)/rules.mk
8 include $(INCLUDE_DIR)/image.mk
9
10 KERNEL_LOADADDR := 0x20008000
11
12 ifeq ($(SUBTARGET),legacy)
13 include ./legacy.mk
14 UBIFS_OPTS := -m 2048 -e 126KiB -c 2048
15 endif
16
17 ifeq ($(SUBTARGET),sama5)
18 include ./sama5.mk
19 UBIFS_OPTS := -m 2048 -e 124KiB -c 2048
20 endif
21
22 define Device/Default
23   PROFILES := Default
24   FILESYSTEMS := squashfs ubifs
25   DEVICE_DTS := $(1)
26   KERNEL_NAME := zImage
27   KERNEL_SIZE := 4096k
28   KERNEL := kernel-bin | append-dtb | lzma | uImage lzma
29   BLOCKSIZE := 128k
30   PAGESIZE := 2048
31   SUBPAGESIZE := 512
32   DTB_SIZE :=
33 endef
34
35 define Device/dtb
36   KERNEL := kernel-bin | lzma | uImage lzma
37 endef
38
39 define Device/evaluation
40   KERNEL_INSTALL := 1
41   KERNEL_SUFFIX := -uImage
42   IMAGES := root.ubi
43   IMAGE/root.ubi := append-ubi
44 endef
45
46 define Device/evaluation-zImage
47   IMAGES += zImage
48   IMAGE/zImage := install-zImage
49 endef
50
51 define Device/evaluation-dtb
52   $(Device/evaluation)
53   $(Device/dtb)
54   $(Device/evaluation-zImage)
55   IMAGES += dtb
56   IMAGE/dtb := install-dtb
57 endef
58
59 define Device/production
60   UBINIZE_OPTS := -E 5
61   IMAGES := factory.bin
62   IMAGE/factory.bin := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-ubi
63 endef
64
65 define Device/production-dtb
66   $(Device/production)
67   $(Device/dtb)
68   DTB_SIZE := 128k
69   IMAGE/factory.bin := append-dtb | pad-to $$$$(DTB_SIZE) \
70           | append-kernel | pad-to $$$$(KERNEL_SIZE) | append-ubi
71 endef
72
73 $(eval $(call BuildImage))