959b1cb0a36b902dc27b1f0a0fcb1699b73e8691
[openwrt/staging/jow.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 include $(SUBTARGET).mk
17
18 AT91_SD_BOOT_PARTSIZE:=64
19 FAT32_BLOCK_SIZE:=1024
20 FAT32_BLOCKS:=$(shell echo \
21 $$(($(AT91_SD_BOOT_PARTSIZE)*1024*1024/$(FAT32_BLOCK_SIZE))))
22
23 define Device/Default
24 $(Device/default-nand)
25 PROFILES := Default
26 FILESYSTEMS := squashfs ubifs ext4
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-sdimage
39 IMAGES += sdcard.img.gz
40 IMAGE/sdcard.img.gz := at91-sdcard
41 endef
42
43 define Device/evaluation
44 KERNEL_INSTALL := 1
45 KERNEL_SUFFIX := -uImage
46 IMAGES := root.ubi
47 IMAGE/root.ubi := append-ubi
48 endef
49
50 define Device/evaluation-zImage
51 IMAGES += zImage
52 IMAGE/zImage := at91-install-zImage
53 endef
54
55 define Device/evaluation-dtb
56 $(Device/evaluation)
57 $(Device/dtb)
58 KERNEL_SUFFIX := -fit-zImage.itb
59 KERNEL := kernel-bin | gzip | fit gzip $$(KDIR)/image-$$(DEVICE_DTS).dtb
60 endef
61
62 define Device/evaluation-fit
63 $(Device/evaluation)
64 KERNEL_SUFFIX := -fit-uImage.itb
65 KERNEL := kernel-bin | lzma | fit lzma $$(KDIR)/image-$$(DEVICE_DTS).dtb
66 endef
67
68 define Device/production
69 UBINIZE_OPTS := -E 5
70 IMAGES := factory.bin
71 IMAGE/factory.bin := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-ubi
72 endef
73
74 define Device/production-dtb
75 $(Device/production)
76 $(Device/dtb)
77 IMAGE/factory.bin := append-dtb | pad-to $$$$(DTB_SIZE) \
78 | append-kernel | pad-to $$$$(KERNEL_SIZE) | append-ubi
79 endef
80
81 $(eval $(call BuildImage))