aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/imx6/Makefile
diff options
context:
space:
mode:
authorJohn Crispin <blogic@openwrt.org>2014-06-11 12:59:22 +0000
committerJohn Crispin <blogic@openwrt.org>2014-06-11 12:59:22 +0000
commit2e87c25986dc90d0449f6af701144fead97d77dc (patch)
treecc5689bae68f3505296251513374ec3ed048fbe5 /target/linux/imx6/Makefile
parentfc4bed72a8fe3fdae5c935ff4c75eb490f6b468f (diff)
downloadupstream-2e87c25986dc90d0449f6af701144fead97d77dc.tar.gz
upstream-2e87c25986dc90d0449f6af701144fead97d77dc.tar.bz2
upstream-2e87c25986dc90d0449f6af701144fead97d77dc.zip
kernel: add a NAND_SUPPORT symbol
Signed-off-by: John Crispin <blogic@openwrt.org> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@41122 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/imx6/Makefile')
-rw-r--r--target/linux/imx6/Makefile2pre { line-height: 125%; margin: 0; } td.linenos pre { color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px; } span.linenos { color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px; } td.linenos pre.special { color: #000000; background-color: #ffffc0; padding: 0 5px 0 5px; } span.linenos.special { color: #000000; background-color: #ffffc0; padding: 0 5px 0 5px; } .highlight .hll { background-color: #ffffcc } .highlight { background: #ffffff; } .highlight .c { color: #888888 } /* Comment */ .highlight .err { color: #a61717; background-color: #e3d2d2 } /* Error */ .highlight .k { color: #008800; font-weight: bold } /* Keyword */ .highlight .ch { color: #888888 } /* Comment.Hashbang */ .highlight .cm { color: #888888 } /* Comment.Multiline */ .highlight .cp { color: #cc0000; font-weight: bold } /* Comment.Preproc */ .highlight .cpf { color: #888888 } /* Comment.PreprocFile */ .highlight .c1 { color: #888888 } /* Comment.Single */ .highlight .cs { color: #cc0000; font-weight: bold; background-color: #fff0f0 } /* Comment.Special */ .highlight .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */ .highlight .ge { font-style: italic } /* Generic.Emph */ .highlight .gr { color: #aa0000 } /* Generic.Error */ .highlight .gh { color: #333333 } /* Generic.Heading */ .highlight .gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */ .highlight .go { color: #888888 } /* Generic.Output */ .highlight .gp { color: #555555 } /* Generic.Prompt */ .highlight .gs { font-weight: bold } /* Generic.Strong */ .highlight .gu { color: #666666 } /* Generic.Subheading */ .highlight .gt { color: #aa0000 } /* Generic.Traceback */ .highlight .kc { color: #008800; font-weight: bold } /* Keyword.Constant */ .highlight .kd { color: #008800; font-weight: bold } /* Keyword.Declaration */ .highlight .kn { color: #008800; font-weight: bold } /* Keyword.Namespace */ .highlight .kp { color: #008800 } /* Keyword.Pseudo */ .highlight .kr { color: #008800; font-weight: bold } /* Keyword.Reserved */ .highlight .kt { color: #888888; font-weight: bold } /* Keyword.Type */ .highlight .m { color: #0000DD; font-weight: bold } /* Literal.Number */ .highlight .s { color: #dd2200; background-color: #fff0f0 } /* Literal.String */ .highlight .na { color: #336699 } /* Name.Attribute */ .highlight .nb { color: #003388 } /* Name.Builtin */ .highlight .nc { color: #bb0066; font-weight: bold } /* Name.Class */ .highlight .no { color: #003366; font-weight: bold } /* Name.Constant */ .highlight .nd { color: #555555 } /* Name.Decorator */ .highlight .ne { color: #bb0066; font-weight: bold } /* Name.Exception */ .highlight .nf { color: #0066bb; font-weight: bold } /* Name.Function */ .highlight .nl { color: #336699; font-style: italic } /* Name.Label */ .highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */ .highlight .py { color: #336699; font-weight: bold } /* Name.Property */ .highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */ .highlight .nv { color: #336699 } /* Name.Variable */ .highlight .ow { color: #008800 } /* Operator.Word */ .highlight .w { color: #bbbbbb } /* Text.Whitespace */ .highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */ .highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */ .highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
#
# Copyright (C) 2010 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk

JFFS2_BLOCKSIZE:=64k

include $(INCLUDE_DIR)/image.mk

INITRAMFS_SUFFIX:=

ifeq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),y)
	INITRAMFS_SUFFIX:=-initramfs
endif

define zimage_name
$(IMG_PREFIX)-$(1)-zImage$(INITRAMFS_SUFFIX)
endef

define uimage_name
$(IMG_PREFIX)-$(1)-uImage$(INITRAMFS_SUFFIX)
endef

define imgname
$(BIN_DIR)/$(IMG_PREFIX)-$(2)-$(patsubst jffs2-%,jffs2,$(patsubst squashfs-%,squashfs,$(1)))
endef

define rootfsname
$(BIN_DIR)/$(IMG_PREFIX)-$(2)-root.$(patsubst jffs2-%,jffs2,$(patsubst squashfs-%,squashfs,$(1)))
endef

define build_squashfs
	dd if=$(KDIR)/root.squashfs of=$(KDIR)/root.squashfs-$(1) bs=$(1) conv=sync
	$(call add_jffs2_mark,$(KDIR)/root.squashfs-$(1))
	dd if=$(KDIR)/root.squashfs-$(1) of=$(BIN_DIR)/$(IMG_PREFIX)-root.squashfs-$(1) bs=$(1) conv=sync
endef

define prepare_zimage
	echo -en "\x$(2)\x1c\xa0\xe3\x$(3)\x10\x81\xe3" > $(KDIR)/$(call zimage_name,$(1))
	cat $(LINUX_DIR)/arch/arm/boot/zImage >> $(KDIR)/$(call zimage_name,$(1))
endef

define prepare_uimage
	$(call prepare_zimage,$(1),$(2),$(3))
	mkimage -A arm -O linux -T kernel -a 0x100000 -e 0x100000 -C none \
		-n 'OpenWrt Linux-$(LINUX_VERSION)' \
		-d $(KDIR)/$(call zimage_name,$(1)) \
		$(KDIR)/$(call uimage_name,$(1))
endef

define Image/Prepare
	# NSB3AST : mach id 2917 (0xb65)
	$(call prepare_zimage,nsb3ast,0b,65)
	# NS-K330 : mach id 3108 (0xc24)
	$(call prepare_uimage,ns-k330,0c,24)
endef

define Image/BuildKernel
	cat $(KDIR)/$(call zimage_name,nsb3ast) > $(BIN_DIR)/$(call zimage_name,nsb3ast)
	cat $(KDIR)/$(call zimage_name,ns-k330) > $(BIN_DIR)/$(call zimage_name,ns-k330)
	cat $(KDIR)/$(call uimage_name,ns-k330) > $(BIN_DIR)/$(call uimage_name,ns-k330)
endef

define Image/Build/Generic
	if [ `stat -c%s "$(KDIR)/$(call zimage_name,$(2))"` -gt 1048576 ]; then \
		echo "Warning: $(KDIR)/$(call zimage_name,$(2)) is too big"; \
	else if [ `stat -c%s $(KDIR)/root.$(1)` -gt $(3) ]; then \
		echo "Warning: of=$(BIN_DIR)/$(IMG_PREFIX)-root.$(1) is too big"; \
	else \
		cat $(KDIR)/root.$(1) > $(call rootfsname,$(1),$(2)); \
		( \
			dd if=$(KDIR)/$(call zimage_name,$(2)) bs=1024k conv=sync; \
			dd if=$(BIN_DIR)/$(IMG_PREFIX)-root.$(1) \
		) > $(call imgname,$(1),$(2)).img; \
	fi; fi
endef

define Image/Build/uImage
	if [ `stat -c%s "$(KDIR)/$(call uimage_name,$(2))"` -gt 1048576 ]; then \
		echo "Warning: $(KDIR)/$(call uimage_name,$(2)) is too big"; \
	else if [ `stat -c%s $(KDIR)/root.$(1)` -gt $(3) ]; then \
		echo "Warning: of=$(BIN_DIR)/$(IMG_PREFIX)-root.$(1) is too big"; \
	else \
		cat $(KDIR)/root.$(1) > $(call rootfsname,$(1),$(2)); \
		( \
			dd if=$(KDIR)/$(call uimage_name,$(2)) bs=1024k conv=sync; \
			dd if=$(BIN_DIR)/$(IMG_PREFIX)-root.$(1) \
		) > $(call imgname,$(1),$(2))-uImage.img; \
	fi; fi
endef

define Image/Build/NSB3AST
	$(call Image/Build/Generic,$(1),nsb3ast,7077888)
endef

define Image/Build/NSK330
	$(call Image/Build/Generic,$(1),ns-k330,2686976)
	$(call Image/Build/uImage,$(1),ns-k330,2686976)
endef

define Image/Build/squashfs
	$(call prepare_generic_squashfs,$(KDIR)/root.squashfs)

	$(call build_squashfs,64k)
	$(call Image/Build/NSB3AST,squashfs-64k)
	$(call Image/Build/NSK330,squashfs-64k)
endef

define Image/Build/jffs2-64k
	dd if=$(KDIR)/root.$(1) of=$(BIN_DIR)/$(IMG_PREFIX)-root.$(1) bs=64k conv=sync
endef

define Image/Build
	$(call Image/Build/$(1),$(1))
endef

$(eval $(call BuildImage))