aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/imx6/image
diff options
context:
space:
mode:
authorLuka Perkov <luka@openwrt.org>2013-05-29 01:27:29 +0000
committerLuka Perkov <luka@openwrt.org>2013-05-29 01:27:29 +0000
commit719e33cf007153b5874cb6a9f37cf0947f64888d (patch)
tree0e499dcd223d3460d7849f512f7fa7421b7cb856 /target/linux/imx6/image
parent09920da426fbb8791eb4ae7beca577f61b7a3cc2 (diff)
downloadupstream-719e33cf007153b5874cb6a9f37cf0947f64888d.tar.gz
upstream-719e33cf007153b5874cb6a9f37cf0947f64888d.tar.bz2
upstream-719e33cf007153b5874cb6a9f37cf0947f64888d.zip
imx6: add new target
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@36753 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/imx6/image')
-rw-r--r--target/linux/imx6/image/Makefile60
1 files changed, 60 insertions, 0 deletions
diff --git a/target/linux/imx6/image/Makefile b/target/linux/imx6/image/Makefile
new file mode 100644
index 0000000000..6c647196c1
--- /dev/null
+++ b/target/linux/imx6/image/Makefile
@@ -0,0 +1,60 @@
+#
+# Copyright (C) 2013 OpenWrt.org
+#
+# 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
+
+BOARDS := \
+ imx6dl-wandboard
+
+# board-specific Flattened Image Tree
+define mkfit
+ /bin/sh $(LINUX_DIR)/scripts/mkits.sh -A arm -C none -a $(2) -e $(2) \
+ -v 'OpenWrt Linux-$(LINUX_VERSION)' \
+ -d $(LINUX_DIR)/arch/arm/boot/dts/$(1).dtb -k $(LINUX_DIR)/arch/arm/boot/zImage \
+ -o $(KDIR)/$(1)-uImage.its
+ mkimage -B $(LINUX_DIR)/scripts/dtc/dtc -f $(KDIR)/$(1)-uImage.its $(BIN_DIR)/openwrt-$(1)-uImage.itb
+endef
+
+# emit FIT images, DTB's and generic zImage
+define Image/BuildKernel
+ $(foreach board,$(BOARDS),
+ $(call mkfit,$(board),0x10008000)
+ cp $(LINUX_DIR)/arch/arm/boot/dts/$(board).dtb $(BIN_DIR)
+ )
+ cp $(LINUX_DIR)/arch/arm/boot/zImage $(BIN_DIR)/openwrt-$(BOARD)-zImage
+endef
+
+# board-specific sysupgrade image
+define BuildFirmware/Generic
+ dd if=$(BIN_DIR)/openwrt-$(1)-uImage.itb of=$(KDIR)/uImage.pad bs=64k conv=sync; \
+ dd if=$(KDIR)/root.$(2) of=$(KDIR)/root.$(2).pad bs=128k conv=sync; \
+ sh $(TOPDIR)/scripts/combined-image.sh \
+ $(KDIR)/uImage.pad \
+ $(KDIR)/root.$(2).pad \
+ $(BIN_DIR)/$(IMG_PREFIX)-$(patsubst jffs2-%,jffs2,$(patsubst squashfs-%,squashfs,$(1)))-sysupgrade.bin
+endef
+
+define Image/Build
+ $(call Image/Build/$(1),$(1))
+ $(foreach board,$(BOARDS),
+ $(call BuildFirmware/Generic,$(board),$(1))
+ )
+endef
+
+# rootfs and board-specific combined kernel+rootfs for convenience
+define Image/Build/squashfs
+ $(call prepare_generic_squashfs,$(KDIR)/root.$(1))
+ dd if=$(KDIR)/root.$(1) of=$(BIN_DIR)/openwrt-$(BOARD)-$(1).img bs=128k conv=sync
+ $(foreach board,$(BOARDS),
+ ( \
+ dd if=$(BIN_DIR)/openwrt-$(board)-uImage.itb bs=2048k conv=sync; \
+ dd if=$(KDIR)/root.$(1) bs=64k conv=sync; \
+ ) > $(BIN_DIR)/$(IMG_PREFIX)-$(board)-$(1).bin
+ )
+endef
+
+$(eval $(call BuildImage))