ccaeebe7cacf5b91bff92c9c2f97b55ebb89b360
[openwrt/openwrt.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 define Build/at91-install-zImage
13 $(CP) $(KDIR)/zImage $@
14 endef
15
16 ifeq ($(SUBTARGET),legacy)
17 include ./legacy.mk
18 endif
19 ifeq ($(SUBTARGET),sama5)
20 include ./sama5.mk
21 endif
22
23 define Device/Default
24 $(Device/default-nand)
25 PROFILES := Default
26 FILESYSTEMS := squashfs ubifs
27 DEVICE_DTS := $(1)
28 KERNEL_NAME := zImage
29 KERNEL_SIZE := 4096k
30 KERNEL := kernel-bin | append-dtb | lzma | uImage lzma
31 DTB_SIZE := 128k
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-zImage
46 IMAGES += zImage
47 IMAGE/zImage := at91-install-zImage
48 endef
49
50 define Device/evaluation-dtb
51 $(Device/evaluation)
52 $(Device/dtb)
53 $(Device/evaluation-zImage)
54 IMAGES += dtb
55 IMAGE/dtb := install-dtb
56 endef
57
58 define Device/evaluation-fit
59 $(Device/evaluation)
60 KERNEL_SUFFIX := -fit-uImage.itb
61 KERNEL := kernel-bin | lzma | fit lzma $$(DTS_DIR)/$$(DEVICE_DTS).dtb
62 endef
63
64 define Device/production
65 UBINIZE_OPTS := -E 5
66 IMAGES := factory.bin
67 IMAGE/factory.bin := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-ubi
68 endef
69
70 define Device/production-dtb
71 $(Device/production)
72 $(Device/dtb)
73 IMAGE/factory.bin := append-dtb | pad-to $$$$(DTB_SIZE) \
74 | append-kernel | pad-to $$$$(KERNEL_SIZE) | append-ubi
75 endef
76
77 $(eval $(call BuildImage))