05f0b58af70eef41f7b309e999bfb5aefedbe391
[openwrt/staging/hauke.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 = $(lastword $(subst _, ,$(1)))
28 SUPPORTED_DEVICES := $(subst _,$(comma),$(1))
29 KERNEL_NAME := zImage
30 KERNEL_SIZE := 4096k
31 KERNEL := kernel-bin | append-dtb | lzma | uImage lzma
32 DTB_SIZE := 128k
33 endef
34
35 define Device/dtb
36 KERNEL := kernel-bin | lzma | uImage lzma
37 endef
38
39 define Device/evaluation-sdimage
40 IMAGES += sdcard.img.gz
41 IMAGE/sdcard.img.gz := at91-sdcard
42 endef
43
44 define Device/evaluation
45 KERNEL_INSTALL := 1
46 KERNEL_SUFFIX := -uImage
47 IMAGES := root.ubi
48 IMAGE/root.ubi := append-ubi
49 endef
50
51 define Device/evaluation-zImage
52 IMAGES += zImage
53 IMAGE/zImage := at91-install-zImage
54 endef
55
56 define Device/evaluation-dtb
57 $(Device/evaluation)
58 $(Device/dtb)
59 KERNEL_SUFFIX := -fit-zImage.itb
60 KERNEL = kernel-bin | gzip | fit gzip $$(KDIR)/image-$$(DEVICE_DTS).dtb
61 endef
62
63 define Device/evaluation-fit
64 $(Device/evaluation)
65 KERNEL_SUFFIX := -fit-uImage.itb
66 KERNEL = kernel-bin | lzma | fit lzma $$(KDIR)/image-$$(DEVICE_DTS).dtb
67 endef
68
69 define Device/production
70 UBINIZE_OPTS := -E 5
71 IMAGES := factory.bin
72 IMAGE/factory.bin := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-ubi
73 endef
74
75 define Device/production-dtb
76 $(Device/production)
77 $(Device/dtb)
78 IMAGE/factory.bin := append-dtb | pad-to $$$$(DTB_SIZE) | \
79 append-kernel | pad-to $$$$(KERNEL_SIZE) | append-ubi
80 endef
81
82 $(eval $(call BuildImage))