2007-03-04 17:29:44 +00:00
|
|
|
#
|
2013-04-26 16:55:40 +00:00
|
|
|
# Copyright (C) 2006-2013 OpenWrt.org
|
2007-03-04 17:29:44 +00:00
|
|
|
#
|
|
|
|
# This is free software, licensed under the GNU General Public License v2.
|
|
|
|
# See /LICENSE for more information.
|
|
|
|
#
|
|
|
|
include $(TOPDIR)/rules.mk
|
|
|
|
include $(INCLUDE_DIR)/image.mk
|
|
|
|
|
2014-04-29 21:02:05 +00:00
|
|
|
UBIFS_OPTS = -F -m 2048 -e 126KiB -c 2048 -U
|
|
|
|
UBI_OPTS = -m 2048 -p 128KiB -s 512
|
|
|
|
|
2007-03-04 17:29:44 +00:00
|
|
|
define Build/Clean
|
2010-07-22 11:32:38 +00:00
|
|
|
$(MAKE) -C u-boot clean
|
2007-03-20 09:59:17 +00:00
|
|
|
endef
|
|
|
|
|
|
|
|
define Build/Compile
|
2010-07-22 11:32:38 +00:00
|
|
|
if [ $(CONFIG_AT91_UBOOT) ]; then \
|
|
|
|
$(MAKE) -C u-boot compile; \
|
|
|
|
fi
|
2007-03-04 17:29:44 +00:00
|
|
|
endef
|
|
|
|
|
|
|
|
define Image/Prepare
|
2013-04-26 16:55:40 +00:00
|
|
|
cp $(LINUX_DIR)/arch/arm/boot/zImage $(KDIR)/zImage
|
|
|
|
endef
|
|
|
|
|
|
|
|
define MkuImageDtb
|
2014-07-21 18:42:06 +00:00
|
|
|
cat $(KDIR)/zImage $(DTS_DIR)/$(2).dtb > $(KDIR)/zImage-$(1)
|
2013-04-26 16:55:40 +00:00
|
|
|
mkimage -A arm -T kernel -C none -a 0x20008000 -e 0x20008000 \
|
|
|
|
-n "OpenWrt ARM $(LINUX_VERSION)" \
|
|
|
|
-d $(KDIR)/zImage-$(1) $(BIN_DIR)/$(IMG_PREFIX)-$(1)-uImage
|
|
|
|
endef
|
|
|
|
|
2014-04-29 21:02:05 +00:00
|
|
|
define MkOftree
|
|
|
|
cp -u $(KDIR)/zImage $(BIN_DIR)/$(IMG_PREFIX)-zImage
|
2014-07-21 18:42:06 +00:00
|
|
|
cp $(DTS_DIR)/$(2).dtb $(BIN_DIR)/$(IMG_PREFIX)-$(1)-oftree.dtb
|
2014-04-29 21:02:05 +00:00
|
|
|
endef
|
|
|
|
|
2013-04-26 16:55:40 +00:00
|
|
|
# Atmel
|
|
|
|
Image/Build/Kernel/AT91SAM9263EK=$(call MkuImageDtb,9263ek,at91sam9263ek)
|
|
|
|
Image/Build/Kernel/AT91SAM9G15EK=$(call MkuImageDtb,9g15ek,at91sam9g15ek)
|
2014-04-29 21:02:05 +00:00
|
|
|
Image/Build/Kernel/AT91SAM9G20EK=$(call MkOftree,9g20ek,at91sam9g20ek)
|
|
|
|
Image/Build/Kernel/AT91SAM9G20EK-2MMC=$(call MkOftree,9g20ek_2mmc,at91sam9g20ek_2mmc)
|
2013-04-26 16:55:40 +00:00
|
|
|
Image/Build/Kernel/AT91SAM9G25EK=$(call MkuImageDtb,9g25ek,at91sam9g25ek)
|
|
|
|
Image/Build/Kernel/AT91SAM9G35EK=$(call MkuImageDtb,9g35ek,at91sam9g35ek)
|
|
|
|
Image/Build/Kernel/AT91SAM9M10G45EK=$(call MkuImageDtb,9m10g45ek,at91sam9m10g45ek)
|
|
|
|
Image/Build/Kernel/AT91SAM9X25EK=$(call MkuImageDtb,9x25ek,at91sam9x25ek)
|
|
|
|
Image/Build/Kernel/AT91SAM9X35EK=$(call MkuImageDtb,9x35ek,at91sam9x35ek)
|
|
|
|
# CalAmp
|
|
|
|
Image/Build/Kernel/LMU5000=$(call MkuImageDtb,lmu5000,lmu5000)
|
2014-09-03 03:09:14 +00:00
|
|
|
# Calao
|
2013-04-26 16:55:40 +00:00
|
|
|
Image/Build/Kernel/TNYA9260=$(call MkuImageDtb,tny_a9260,tny_a9260)
|
|
|
|
Image/Build/Kernel/TNYA9263=$(call MkuImageDtb,tny_a9263,tny_a9263)
|
|
|
|
Image/Build/Kernel/TNYA9G20=$(call MkuImageDtb,tny_a9g20,tny_a9g20)
|
|
|
|
Image/Build/Kernel/USBA9260=$(call MkuImageDtb,usb_a9260,usb_a9260)
|
|
|
|
Image/Build/Kernel/USBA9263=$(call MkuImageDtb,usb_a9263,usb_a9263)
|
|
|
|
Image/Build/Kernel/USBA9G20=$(call MkuImageDtb,usb_a9g20,usb_a9g20)
|
|
|
|
# Ethernut
|
|
|
|
Image/Build/Kernel/ETHERNUT5=$(call MkuImageDtb,ethernut5,ethernut5)
|
|
|
|
|
|
|
|
define Image/Build/Kernel/Default
|
|
|
|
$(call Image/Build/Kernel/AT91SAM9263EK)
|
|
|
|
$(call Image/Build/Kernel/AT91SAM9G15EK)
|
|
|
|
$(call Image/Build/Kernel/AT91SAM9G20EK)
|
|
|
|
$(call Image/Build/Kernel/AT91SAM9G20EK-2MMC)
|
|
|
|
$(call Image/Build/Kernel/AT91SAM9G25EK)
|
|
|
|
$(call Image/Build/Kernel/AT91SAM9G35EK)
|
|
|
|
$(call Image/Build/Kernel/AT91SAM9M10G45EK)
|
|
|
|
$(call Image/Build/Kernel/AT91SAM9X25EK)
|
|
|
|
$(call Image/Build/Kernel/AT91SAM9X35EK)
|
|
|
|
$(call Image/Build/Kernel/LMU5000)
|
|
|
|
$(call Image/Build/Kernel/TNYA9260)
|
|
|
|
$(call Image/Build/Kernel/TNYA9263)
|
|
|
|
$(call Image/Build/Kernel/TNYA9G20)
|
|
|
|
$(call Image/Build/Kernel/USBA9260)
|
|
|
|
$(call Image/Build/Kernel/USBA9263)
|
|
|
|
$(call Image/Build/Kernel/USBA9G20)
|
|
|
|
$(call Image/Build/Kernel/ETHERNUT5)
|
2007-03-04 17:29:44 +00:00
|
|
|
endef
|
|
|
|
|
|
|
|
define Image/BuildKernel
|
2010-10-11 16:31:47 +00:00
|
|
|
mkimage -A arm -T kernel -C none -a 0x20008000 -e 0x20008000 -n linux-2.6 \
|
2013-04-26 16:55:40 +00:00
|
|
|
-d $(LINUX_DIR)/arch/arm/boot/Image $(BIN_DIR)/uImage
|
2011-07-03 18:51:59 +00:00
|
|
|
if [ $(CONFIG_FLEXIBITY_ROOT) ]; then \
|
2013-04-26 16:55:40 +00:00
|
|
|
$(INSTALL_BIN) $(BIN_DIR)/uImage $(TARGET_DIR)/uImage ; \
|
2011-07-03 18:51:59 +00:00
|
|
|
fi
|
2013-04-26 16:55:40 +00:00
|
|
|
$(call Image/Build/Kernel/$(PROFILE))
|
2007-03-04 17:29:44 +00:00
|
|
|
endef
|
|
|
|
|
|
|
|
define Image/Build
|
2013-04-26 16:55:40 +00:00
|
|
|
$(call Image/Build/$(1))
|
2010-10-11 16:31:39 +00:00
|
|
|
cp $(KDIR)/root.$(1) $(BIN_DIR)/$(IMG_PREFIX)-root.$(1)
|
2007-03-04 17:29:44 +00:00
|
|
|
endef
|
|
|
|
|
|
|
|
$(eval $(call BuildImage))
|