ipq806x: clear IMAGES for devices
[oweals/openwrt.git] / target / linux / ipq806x / image / Makefile
1 # Copyright (c) 2014 The Linux Foundation. All rights reserved.
2 #
3 include $(TOPDIR)/rules.mk
4 include $(INCLUDE_DIR)/image.mk
5
6 UBIFS_OPTS = -m 2048 -e 124KiB -c 4096 -U -F
7 UBINIZE_OPTS = -m 2048 -p 128KiB
8
9 KERNEL_LOADADDR := 0x42208000
10
11 define Image/Prepare
12         $(CP) $(LINUX_DIR)/vmlinux $(KDIR)/$(IMG_PREFIX)-vmlinux.elf
13 endef
14
15 define Image/BuildKernel
16         $(CP) $(KDIR)/$(IMG_PREFIX)-vmlinux.elf $(BIN_DIR)
17 endef
18
19 define Image/Build/squashfs
20         $(call prepare_generic_squashfs,$(KDIR)/root.squashfs)
21 endef
22
23 define Image/Build
24         $(call Image/Build/$(1),$(1))
25         dd if=$(KDIR)/root.$(1) of=$(BIN_DIR)/$(IMG_PREFIX)-$(1)-root.img bs=2k conv=sync
26 endef
27
28 define Build/append-dtb
29         cat $(DTS_DIR)/$(DEVICE_DTS).dtb >> $@
30 endef
31
32 define Device/Default
33         PROFILES := Default
34         KERNEL_INITRAMFS_PREFIX := $$(IMG_PREFIX)-$(1)-initramfs
35         DEVICE_DTS :=
36         KERNEL_PREFIX := $$(IMAGE_PREFIX)
37         IMAGES :=
38 endef
39 DEVICE_VARS += DEVICE_DTS
40
41 define Device/LegacyImage
42         KERNEL_SUFFIX := -uImage
43         KERNEL = kernel-bin | append-dtb | uImage none
44         KERNEL_NAME := zImage
45         KERNEL_INSTALL := 1
46 endef
47
48 define Device/FitImage
49         KERNEL_SUFFIX := -fit-uImage.itb
50         KERNEL = kernel-bin | gzip | fit gzip $$(DTS_DIR)/$$(DEVICE_DTS).dtb
51         KERNEL_NAME := Image
52         KERNEL_INSTALL := 1
53 endef
54
55 define Device/AP148
56         $(call Device/FitImage)
57         DEVICE_DTS := qcom-ipq8064-ap148
58 endef
59
60 define Device/AP148-legacy
61         $(call Device/LegacyImage)
62         DEVICE_DTS := qcom-ipq8064-ap148
63 endef
64
65 define Device/DB149
66         $(call Device/FitImage)
67         DEVICE_DTS := qcom-ipq8064-db149
68 endef
69
70 TARGET_DEVICES += AP148 AP148-legacy DB149
71
72 $(eval $(call BuildImage))