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