767255ca3ff4b50c5481947b1ed28719236ec78d
[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 UBIFS_OPTS = -F -m 2048 -e 126KiB -c 2048 -U
11 UBI_OPTS = -m 2048 -p 128KiB -s 512
12
13 AT91SAMA5D3XPLAINED_UBIFS_OPTS = -m 2048 -e 124KiB -c 2048
14 AT91SAMA5D3XPLAINED_UBI_OPTS = -m 2048 -p 128KiB -s 2048
15
16 define Build/Clean
17 $(MAKE) -C u-boot clean
18 endef
19
20 define Build/Compile
21 if [ $(CONFIG_AT91_UBOOT) ]; then \
22 $(MAKE) -C u-boot compile; \
23 fi
24 endef
25
26 define Image/Prepare
27 cp $(LINUX_DIR)/arch/arm/boot/Image $(KDIR)/Image
28 cp $(LINUX_DIR)/arch/arm/boot/zImage $(KDIR)/zImage
29 endef
30
31 define MkuImageDtb
32 cat $(KDIR)/zImage $(DTS_DIR)/$(2).dtb > $(KDIR)/zImage-$(1)
33 mkimage -A arm -T kernel -C none -a 0x20008000 -e 0x20008000 \
34 -n "OpenWrt ARM $(LINUX_VERSION)" \
35 -d $(KDIR)/zImage-$(1) $(BIN_DIR)/$(IMG_PREFIX)-$(1)-uImage
36 endef
37
38 define MkOftree
39 cp -u $(KDIR)/zImage $(BIN_DIR)/$(IMG_PREFIX)-zImage
40 cp $(DTS_DIR)/$(2).dtb $(BIN_DIR)/$(IMG_PREFIX)-$(1)-oftree.dtb
41 endef
42
43 # Atmel
44 Image/Build/Kernel/AT91SAM9263EK=$(call MkuImageDtb,9263ek,at91sam9263ek)
45 Image/Build/Kernel/AT91SAM9G15EK=$(call MkuImageDtb,9g15ek,at91sam9g15ek)
46 Image/Build/Kernel/AT91SAM9G20EK=$(call MkOftree,9g20ek,at91sam9g20ek)
47 Image/Build/Kernel/AT91SAM9G20EK-2MMC=$(call MkOftree,9g20ek_2mmc,at91sam9g20ek_2mmc)
48 Image/Build/Kernel/AT91SAM9G25EK=$(call MkuImageDtb,9g25ek,at91sam9g25ek)
49 Image/Build/Kernel/AT91SAM9G35EK=$(call MkuImageDtb,9g35ek,at91sam9g35ek)
50 Image/Build/Kernel/AT91SAM9M10G45EK=$(call MkuImageDtb,9m10g45ek,at91sam9m10g45ek)
51 Image/Build/Kernel/AT91SAM9X25EK=$(call MkuImageDtb,9x25ek,at91sam9x25ek)
52 Image/Build/Kernel/AT91SAM9X35EK=$(call MkuImageDtb,9x35ek,at91sam9x35ek)
53 Image/Build/Kernel/AT91SAMA5D3XPLAINED=$(call MkuImageDtb,sama5,at91-sama5d3_xplained)
54 # CalAmp
55 Image/Build/Kernel/LMU5000=$(call MkuImageDtb,lmu5000,lmu5000)
56 # Calao
57 Image/Build/Kernel/TNYA9260=$(call MkuImageDtb,tny_a9260,tny_a9260)
58 Image/Build/Kernel/TNYA9263=$(call MkuImageDtb,tny_a9263,tny_a9263)
59 Image/Build/Kernel/TNYA9G20=$(call MkuImageDtb,tny_a9g20,tny_a9g20)
60 Image/Build/Kernel/USBA9260=$(call MkuImageDtb,usb_a9260,usb_a9260)
61 Image/Build/Kernel/USBA9263=$(call MkuImageDtb,usb_a9263,usb_a9263)
62 Image/Build/Kernel/USBA9G20=$(call MkuImageDtb,usb_a9g20,usb_a9g20)
63 # Ethernut
64 Image/Build/Kernel/ETHERNUT5=$(call MkuImageDtb,ethernut5,ethernut5)
65 # Exegin
66 Image/Build/Kernel/Q5XR5=$(call MkOftree,q5xr5,at91-q5xr5)
67
68
69 define Image/Build/Kernel/Default
70 $(call Image/Build/Kernel/AT91SAM9263EK)
71 $(call Image/Build/Kernel/AT91SAM9G15EK)
72 $(call Image/Build/Kernel/AT91SAM9G20EK)
73 $(call Image/Build/Kernel/AT91SAM9G20EK-2MMC)
74 $(call Image/Build/Kernel/AT91SAM9G25EK)
75 $(call Image/Build/Kernel/AT91SAM9G35EK)
76 $(call Image/Build/Kernel/AT91SAM9M10G45EK)
77 $(call Image/Build/Kernel/AT91SAM9X25EK)
78 $(call Image/Build/Kernel/AT91SAM9X35EK)
79 $(call Image/Build/Kernel/LMU5000)
80 $(call Image/Build/Kernel/TNYA9260)
81 $(call Image/Build/Kernel/TNYA9263)
82 $(call Image/Build/Kernel/TNYA9G20)
83 $(call Image/Build/Kernel/USBA9260)
84 $(call Image/Build/Kernel/USBA9263)
85 $(call Image/Build/Kernel/USBA9G20)
86 $(call Image/Build/Kernel/ETHERNUT5)
87 $(call Image/Build/Kernel/Q5XR5)
88 endef
89
90 define Image/BuildKernel
91 mkimage -A arm -T kernel -C none -a 0x20008000 -e 0x20008000 -n linux-2.6 \
92 -d $(KDIR)/Image $(BIN_DIR)/$(IMG_PREFIX)-uImage
93 if [ $(CONFIG_FLEXIBITY_ROOT) ]; then \
94 $(INSTALL_BIN) $(BIN_DIR)/$(IMG_PREFIX)-uImage $(TARGET_DIR)/uImage ; \
95 fi
96 $(call Image/Build/Kernel/$(PROFILE))
97 endef
98
99 define Image/Build
100 $(call Image/Build/$(1))
101 cp $(KDIR)/root.$(1) $(BIN_DIR)/$(IMG_PREFIX)-root.$(1)
102 endef
103
104 $(eval $(call BuildImage))