diff options
author | Ben Whitten <ben.whitten@gmail.com> | 2017-05-03 22:15:20 +0100 |
---|---|---|
committer | Mathias Kresin <dev@kresin.me> | 2017-06-12 21:07:31 +0200 |
commit | c2f052acaeb480e89d3ce39c47f49ad16b3464ac (patch) | |
tree | c9c0120592edc98f86d438704131d25acc4a1147 /target/linux/at91/image/Makefile | |
parent | a53f8ba6771de64c9c82a2e6867791226f3003cb (diff) | |
download | mtk-20170518-c2f052acaeb480e89d3ce39c47f49ad16b3464ac.zip mtk-20170518-c2f052acaeb480e89d3ce39c47f49ad16b3464ac.tar.gz mtk-20170518-c2f052acaeb480e89d3ce39c47f49ad16b3464ac.tar.bz2 |
at91: convert boards to generic build target
Evaluation boards are left in component form to ease flashing
using vendor tooling and instructions. These boards also do
not include the EOF marker in the UBIFS as the bootloaders
are recent and easily upgradeable.
The end product boards use factory.bin images based on the
dts layout and include EOF markers as bootloader UBI support
is not determined.
Signed-off-by: Ben Whitten <ben.whitten@gmail.com>
Signed-off-by: Mathias Kresin <dev@kresin.me>
Diffstat (limited to 'target/linux/at91/image/Makefile')
-rw-r--r-- | target/linux/at91/image/Makefile | 112 |
1 files changed, 42 insertions, 70 deletions
diff --git a/target/linux/at91/image/Makefile b/target/linux/at91/image/Makefile index 0a4c95d..d1ae614 100644 --- a/target/linux/at91/image/Makefile +++ b/target/linux/at91/image/Makefile @@ -7,88 +7,60 @@ include $(TOPDIR)/rules.mk include $(INCLUDE_DIR)/image.mk -UBIFS_OPTS = -F -m 2048 -e 126KiB -c 2048 -U -UBI_OPTS = -m 2048 -p 128KiB -s 512 +KERNEL_LOADADDR := 0x20008000 -AT91SAMA5D3XPLAINED_UBIFS_OPTS = -m 2048 -e 124KiB -c 2048 -AT91SAMA5D3XPLAINED_UBI_OPTS = -m 2048 -p 128KiB -s 2048 +ifeq ($(SUBTARGET),legacy) +include ./legacy.mk +UBIFS_OPTS := -m 2048 -e 126KiB -c 2048 +endif +ifeq ($(SUBTARGET),sama5d3) +include ./sama5d3.mk +UBIFS_OPTS := -m 2048 -e 124KiB -c 2048 +endif -define Image/Prepare - cp $(LINUX_DIR)/arch/arm/boot/Image $(KDIR)/Image - cp $(LINUX_DIR)/arch/arm/boot/zImage $(KDIR)/zImage +define Device/Default + PROFILES := Default + FILESYSTEMS := squashfs ubifs + DEVICE_DTS := $(1) + KERNEL_NAME := zImage + KERNEL_SIZE := 4096k + KERNEL := kernel-bin | append-dtb | lzma | uImage lzma + BLOCKSIZE := 128k + PAGESIZE := 2048 + SUBPAGESIZE := 512 + DTB_SIZE := endef -define MkuImageDtb - cat $(KDIR)/zImage $(DTS_DIR)/$(2).dtb > $(KDIR)/zImage-$(1) - 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 +define Device/dtb + KERNEL := kernel-bin | lzma | uImage lzma endef -define MkOftree - cp -u $(KDIR)/zImage $(BIN_DIR)/$(IMG_PREFIX)-zImage - cp $(DTS_DIR)/$(2).dtb $(BIN_DIR)/$(IMG_PREFIX)-$(1)-oftree.dtb +define Device/evaluation + KERNEL_INSTALL := 1 + KERNEL_SUFFIX := -uImage + IMAGES := root.ubi + IMAGE/root.ubi := append-ubi endef -# Atmel -Image/Build/Kernel/AT91SAM9263EK=$(call MkuImageDtb,9263ek,at91sam9263ek) -Image/Build/Kernel/AT91SAM9G15EK=$(call MkuImageDtb,9g15ek,at91sam9g15ek) -Image/Build/Kernel/AT91SAM9G20EK=$(call MkOftree,9g20ek,at91sam9g20ek) -Image/Build/Kernel/AT91SAM9G20EK-2MMC=$(call MkOftree,9g20ek_2mmc,at91sam9g20ek_2mmc) -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) -Image/Build/Kernel/AT91SAMA5D3XPLAINED=$(call MkuImageDtb,sama5,at91-sama5d3_xplained) -# CalAmp -Image/Build/Kernel/LMU5000=$(call MkuImageDtb,lmu5000,lmu5000) -# Calao -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) -# Exegin -Image/Build/Kernel/Q5XR5=$(call MkOftree,q5xr5,at91-q5xr5) - - -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) - $(call Image/Build/Kernel/Q5XR5) +define Device/evaluation-dtb + $(Device/evaluation) + $(Device/dtb) + IMAGES += dtb + IMAGE/dtb := install-dtb endef -define Image/BuildKernel - mkimage -A arm -T kernel -C none -a 0x20008000 -e 0x20008000 -n linux-2.6 \ - -d $(KDIR)/Image $(BIN_DIR)/$(IMG_PREFIX)-uImage - if [ $(CONFIG_FLEXIBITY_ROOT) ]; then \ - $(INSTALL_BIN) $(BIN_DIR)/$(IMG_PREFIX)-uImage $(TARGET_DIR)/uImage ; \ - fi - $(call Image/Build/Kernel/$(PROFILE)) +define Device/production + UBINIZE_OPTS := -E 5 + IMAGES := factory.bin + IMAGE/factory.bin := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-ubi endef -define Image/Build - $(call Image/Build/$(1)) - cp $(KDIR)/root.$(1) $(BIN_DIR)/$(IMG_PREFIX)-root.$(1) +define Device/production-dtb + $(Device/production) + $(Device/dtb) + DTB_SIZE := 128k + IMAGE/factory.bin := append-dtb | pad-to $$$$(DTB_SIZE) \ + | append-kernel | pad-to $$$$(KERNEL_SIZE) | append-ubi endef $(eval $(call BuildImage)) |