Update AT91 kernel to 3.10.34
[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 define Build/Clean
11 $(MAKE) -C u-boot clean
12 endef
13
14 define Build/Compile
15 if [ $(CONFIG_AT91_UBOOT) ]; then \
16 $(MAKE) -C u-boot compile; \
17 fi
18 endef
19
20 define Image/Prepare
21 cp $(LINUX_DIR)/arch/arm/boot/zImage $(KDIR)/zImage
22 endef
23
24 define MkuImageDtb
25 cat $(KDIR)/zImage $(LINUX_DIR)/arch/arm/boot/dts/$(2).dtb > $(KDIR)/zImage-$(1)
26 mkimage -A arm -T kernel -C none -a 0x20008000 -e 0x20008000 \
27 -n "OpenWrt ARM $(LINUX_VERSION)" \
28 -d $(KDIR)/zImage-$(1) $(BIN_DIR)/$(IMG_PREFIX)-$(1)-uImage
29 endef
30
31 # Atmel
32 Image/Build/Kernel/AT91SAM9263EK=$(call MkuImageDtb,9263ek,at91sam9263ek)
33 Image/Build/Kernel/AT91SAM9G15EK=$(call MkuImageDtb,9g15ek,at91sam9g15ek)
34 Image/Build/Kernel/AT91SAM9G20EK=$(call MkuImageDtb,9g20ek,at91sam9g20ek)
35 Image/Build/Kernel/AT91SAM9G20EK-2MMC=$(call MkuImageDtb,9g20ek_2mmc,at91sam9g20ek_2mmc)
36 Image/Build/Kernel/AT91SAM9G25EK=$(call MkuImageDtb,9g25ek,at91sam9g25ek)
37 Image/Build/Kernel/AT91SAM9G35EK=$(call MkuImageDtb,9g35ek,at91sam9g35ek)
38 Image/Build/Kernel/AT91SAM9M10G45EK=$(call MkuImageDtb,9m10g45ek,at91sam9m10g45ek)
39 Image/Build/Kernel/AT91SAM9X25EK=$(call MkuImageDtb,9x25ek,at91sam9x25ek)
40 Image/Build/Kernel/AT91SAM9X35EK=$(call MkuImageDtb,9x35ek,at91sam9x35ek)
41 # CalAmp
42 Image/Build/Kernel/LMU5000=$(call MkuImageDtb,lmu5000,lmu5000)
43 # Caloa
44 Image/Build/Kernel/TNYA9260=$(call MkuImageDtb,tny_a9260,tny_a9260)
45 Image/Build/Kernel/TNYA9263=$(call MkuImageDtb,tny_a9263,tny_a9263)
46 Image/Build/Kernel/TNYA9G20=$(call MkuImageDtb,tny_a9g20,tny_a9g20)
47 Image/Build/Kernel/USBA9260=$(call MkuImageDtb,usb_a9260,usb_a9260)
48 Image/Build/Kernel/USBA9263=$(call MkuImageDtb,usb_a9263,usb_a9263)
49 Image/Build/Kernel/USBA9G20=$(call MkuImageDtb,usb_a9g20,usb_a9g20)
50 # Ethernut
51 Image/Build/Kernel/ETHERNUT5=$(call MkuImageDtb,ethernut5,ethernut5)
52
53 define Image/Build/Kernel/Default
54 $(call Image/Build/Kernel/AT91SAM9263EK)
55 $(call Image/Build/Kernel/AT91SAM9G15EK)
56 $(call Image/Build/Kernel/AT91SAM9G20EK)
57 $(call Image/Build/Kernel/AT91SAM9G20EK-2MMC)
58 $(call Image/Build/Kernel/AT91SAM9G25EK)
59 $(call Image/Build/Kernel/AT91SAM9G35EK)
60 $(call Image/Build/Kernel/AT91SAM9M10G45EK)
61 $(call Image/Build/Kernel/AT91SAM9X25EK)
62 $(call Image/Build/Kernel/AT91SAM9X35EK)
63 $(call Image/Build/Kernel/LMU5000)
64 $(call Image/Build/Kernel/TNYA9260)
65 $(call Image/Build/Kernel/TNYA9263)
66 $(call Image/Build/Kernel/TNYA9G20)
67 $(call Image/Build/Kernel/USBA9260)
68 $(call Image/Build/Kernel/USBA9263)
69 $(call Image/Build/Kernel/USBA9G20)
70 $(call Image/Build/Kernel/ETHERNUT5)
71 endef
72
73 define Image/BuildKernel
74 mkimage -A arm -T kernel -C none -a 0x20008000 -e 0x20008000 -n linux-2.6 \
75 -d $(LINUX_DIR)/arch/arm/boot/Image $(BIN_DIR)/uImage
76 if [ $(CONFIG_FLEXIBITY_ROOT) ]; then \
77 $(INSTALL_BIN) $(BIN_DIR)/uImage $(TARGET_DIR)/uImage ; \
78 fi
79 $(call Image/Build/Kernel/$(PROFILE))
80 endef
81
82 define Image/Build
83 $(call Image/Build/$(1))
84 cp $(KDIR)/root.$(1) $(BIN_DIR)/$(IMG_PREFIX)-root.$(1)
85 endef
86
87 $(eval $(call BuildImage))