d1ae61484a713428fb3db246052cdc3be30536e8
[lede-git/.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 ifeq ($(SUBTARGET),sama5d3)
17 include ./sama5d3.mk
18 UBIFS_OPTS := -m 2048 -e 124KiB -c 2048
19 endif
20
21 define Device/Default
22   PROFILES := Default
23   FILESYSTEMS := squashfs ubifs
24   DEVICE_DTS := $(1)
25   KERNEL_NAME := zImage
26   KERNEL_SIZE := 4096k
27   KERNEL := kernel-bin | append-dtb | lzma | uImage lzma
28   BLOCKSIZE := 128k
29   PAGESIZE := 2048
30   SUBPAGESIZE := 512
31   DTB_SIZE :=
32 endef
33
34 define Device/dtb
35   KERNEL := kernel-bin | lzma | uImage lzma
36 endef
37
38 define Device/evaluation
39   KERNEL_INSTALL := 1
40   KERNEL_SUFFIX := -uImage
41   IMAGES := root.ubi
42   IMAGE/root.ubi := append-ubi
43 endef
44
45 define Device/evaluation-dtb
46   $(Device/evaluation)
47   $(Device/dtb)
48   IMAGES += dtb
49   IMAGE/dtb := install-dtb
50 endef
51
52 define Device/production
53   UBINIZE_OPTS := -E 5
54   IMAGES := factory.bin
55   IMAGE/factory.bin := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-ubi
56 endef
57
58 define Device/production-dtb
59   $(Device/production)
60   $(Device/dtb)
61   DTB_SIZE := 128k
62   IMAGE/factory.bin := append-dtb | pad-to $$$$(DTB_SIZE) \
63           | append-kernel | pad-to $$$$(KERNEL_SIZE) | append-ubi
64 endef
65
66 $(eval $(call BuildImage))