3b01d421310b6c2c90073dcc46962098b8d1c148
[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),sam9x)
17 include ./sam9x.mk
18 endif
19 ifeq ($(SUBTARGET),sama5)
20 include ./sama5.mk
21 endif
22
23 AT91_SD_BOOT_PARTSIZE:=64
24 FAT32_BLOCK_SIZE:=1024
25 FAT32_BLOCKS:=$(shell echo \
26 $$(($(AT91_SD_BOOT_PARTSIZE)*1024*1024/$(FAT32_BLOCK_SIZE))))
27
28 define Device/Default
29 $(Device/default-nand)
30 PROFILES := Default
31 FILESYSTEMS := squashfs ubifs ext4
32 DEVICE_DTS := $(1)
33 KERNEL_NAME := zImage
34 KERNEL_SIZE := 4096k
35 KERNEL := kernel-bin | append-dtb | lzma | uImage lzma
36 DTB_SIZE := 128k
37 endef
38
39 define Device/dtb
40 KERNEL := kernel-bin | lzma | uImage lzma
41 endef
42
43 define Device/evaluation-sdimage
44 IMAGES += sdcard.img.gz
45 IMAGE/sdcard.img.gz := at91-sdcard
46 endef
47
48 define Device/evaluation
49 KERNEL_INSTALL := 1
50 KERNEL_SUFFIX := -uImage
51 IMAGES := root.ubi
52 IMAGE/root.ubi := append-ubi
53 endef
54
55 define Device/evaluation-zImage
56 IMAGES += zImage
57 IMAGE/zImage := at91-install-zImage
58 endef
59
60 define Device/evaluation-dtb
61 $(Device/evaluation)
62 $(Device/dtb)
63 $(Device/evaluation-zImage)
64 IMAGES += dtb
65 IMAGE/dtb := install-dtb
66 endef
67
68 define Device/evaluation-fit
69 $(Device/evaluation)
70 KERNEL_SUFFIX := -fit-uImage.itb
71 KERNEL := kernel-bin | lzma | fit lzma $$(DTS_DIR)/$$(DEVICE_DTS).dtb
72 endef
73
74 define Device/production
75 UBINIZE_OPTS := -E 5
76 IMAGES := factory.bin
77 IMAGE/factory.bin := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-ubi
78 endef
79
80 define Device/production-dtb
81 $(Device/production)
82 $(Device/dtb)
83 IMAGE/factory.bin := append-dtb | pad-to $$$$(DTB_SIZE) \
84 | append-kernel | pad-to $$$$(KERNEL_SIZE) | append-ubi
85 endef
86
87 $(eval $(call BuildImage))