[meta-lsi] [PATCH 58/86] linux-yocto: Add support for DTB and FIT images

Daniel Dragomir daniel.dragomir at windriver.com
Wed Oct 29 08:36:06 PDT 2014


From: Paul Butler <paul.butler at windriver.com>

LSI Axxia boards are able to boot from FIT images.
Add support to build the dtb and fit images including the
dtb, linux image and both: multi.fit images.

Signed-off-by: Paul Butler <paul.butler at windriver.com>
---
 recipes-kernel/linux/fit/GNUmakefile  | 84 +++++++++++++++++++++++++++++++++++
 recipes-kernel/linux/fit/fdt.its.in   | 34 ++++++++++++++
 recipes-kernel/linux/fit/linux.its.in | 37 +++++++++++++++
 recipes-kernel/linux/fit/multi.its.in | 52 ++++++++++++++++++++++
 4 files changed, 207 insertions(+)
 create mode 100644 recipes-kernel/linux/fit/GNUmakefile
 create mode 100644 recipes-kernel/linux/fit/fdt.its.in
 create mode 100644 recipes-kernel/linux/fit/linux.its.in
 create mode 100644 recipes-kernel/linux/fit/multi.its.in

diff --git a/recipes-kernel/linux/fit/GNUmakefile b/recipes-kernel/linux/fit/GNUmakefile
new file mode 100644
index 0000000..104aa8a
--- /dev/null
+++ b/recipes-kernel/linux/fit/GNUmakefile
@@ -0,0 +1,84 @@
+################################################################################
+#
+# GNUmakefile
+#
+# Image makefile for LSI Axxia systems.  Along with CROSS_COMPILE and
+# tools in the PAT, the following are required.
+#
+#        ARCH : The architecture.
+# DESCRIPTION : A descriptive string for the image.
+#     ADDRESS : The load and entry address.
+#         DTB : The device tree.
+#     VMLINUX : The Linux ELF image.
+#
+################################################################################
+
+ifdef ARCH
+ASSERT_ARCH = 
+else
+ASSERT_ARCH = \
+ at echo "ARCH is not defined!" ; exit 1
+endif
+
+ifdef DESCRIPTION
+ASSERT_DESCRIPTION = 
+else
+ASSERT_DESCRIPTION = \
+ at echo "DESCRIPTION is not defined!" ; exit 1
+endif
+
+ifdef ADDRESS
+ASSERT_ADDRESS = 
+else
+ASSERT_ADDRESS = \
+ at echo "ADDRESS is not defined!" ; exit 1
+endif
+
+ifdef DTB
+ASSERT_DTB = 
+else
+ASSERT_DTB = \
+ at echo "DTB is not defined!" ; exit 1
+endif
+
+ifdef VMLINUX
+ASSERT_VMLINUX = 
+else
+ASSERT_VMLINUX = \
+ at echo "VMLINUX is not defined!" ; exit 1
+endif
+
+%.its: %.its.in
+	@$(ASSERT_ARCH)
+	@$(ASSERT_ADDRESS)
+	@$(ASSERT_DESCRIPTION)
+	@sed -e 's/ARCH/$(ARCH)/' -e 's/LOAD/$(ADDRESS)/' \
+		-e 's/ENTRY/$(ADDRESS)/' \
+		-e 's/DESCRIPTION/"$(DESCRIPTION)"/' $< >$@
+
+all: clean linux.fit fdt.fit multi.fit
+
+linux.fit: linux.its vmlinux.bin.gz
+	mkimage -f linux.its $@
+
+fdt.fit: fdt.its
+	@$(ASSERT_DTB)
+	cp $(DTB) linux.dtb
+	mkimage -f fdt.its $@
+	rm -f linux.dtb
+
+multi.fit: multi.its vmlinux.bin.gz
+	@$(ASSERT_DTB)
+	cp $(DTB) linux.dtb
+	mkimage -f multi.its $@
+	rm -f linux.dtb
+
+vmlinux.bin.gz: vmlinux.bin
+	gzip -f -c -9 $< >$@
+
+vmlinux.bin: $(VMLINUX)
+	@$(ASSERT_VMLINUX)
+	${CROSS_COMPILE}objcopy -O binary -R .note -R .comment -S $< $@
+
+clean:
+	@rm -f vmlinux.bin vmlinux.bin.gz *.its *.img *.fit
diff --git a/recipes-kernel/linux/fit/fdt.its.in b/recipes-kernel/linux/fit/fdt.its.in
new file mode 100644
index 0000000..2dee86d
--- /dev/null
+++ b/recipes-kernel/linux/fit/fdt.its.in
@@ -0,0 +1,34 @@
+/*
+ * LSI Axxia FIT image for U-Boot (device tree only).
+ */
+
+/dts-v1/;
+
+/ {
+	description = DESCRIPTION;
+	#address-cells = <1>;
+
+	images {
+		fdt at 1 {
+			description = "Flattened Device Tree blob";
+			data = /incbin/("./linux.dtb");
+			type = "flat_dt";
+			arch = "ARCH";
+			compression = "none";
+			hash at 1 {
+				algo = "crc32";
+			};
+			hash at 2 {
+				algo = "sha1";
+			};
+		};
+	};
+
+	configurations {
+		default = "conf at 1";
+		conf at 1 {
+			description = DESCRIPTION;
+			fdt = "fdt at 1";
+		};
+	};
+};
diff --git a/recipes-kernel/linux/fit/linux.its.in b/recipes-kernel/linux/fit/linux.its.in
new file mode 100644
index 0000000..5552f21
--- /dev/null
+++ b/recipes-kernel/linux/fit/linux.its.in
@@ -0,0 +1,37 @@
+/*
+ * LSI Axxia FIT image for U-Boot (Linux only).
+ */
+
+/dts-v1/;
+
+/ {
+	description = DESCRIPTION;
+	#address-cells = <1>;
+
+	images {
+		kernel at 1 {
+			description = "Linux Kernel";
+			data = /incbin/("./vmlinux.bin.gz");
+			type = "kernel";
+			arch = "ARCH";
+			os = "linux";
+			compression = "gzip";
+			load = <LOAD>;
+			entry = <ENTRY>;
+			hash at 1 {
+				algo = "crc32";
+			};
+			hash at 2 {
+				algo = "sha1";
+			};
+		};
+	};
+
+	configurations {
+		default = "conf at 1";
+		conf at 1 {
+			description = DESCRIPTION;
+			kernel = "kernel at 1";
+		};
+	};
+};
diff --git a/recipes-kernel/linux/fit/multi.its.in b/recipes-kernel/linux/fit/multi.its.in
new file mode 100644
index 0000000..90e7c69
--- /dev/null
+++ b/recipes-kernel/linux/fit/multi.its.in
@@ -0,0 +1,52 @@
+/*
+ * LSI Axxia FIT multi image for U-Boot (Linux and Device Tree).
+ */
+
+/dts-v1/;
+
+/ {
+	description = DESCRIPTION;
+	#address-cells = <1>;
+
+	images {
+		kernel at 1 {
+			description = "Linux Kernel";
+			data = /incbin/("./vmlinux.bin.gz");
+			type = "kernel";
+			arch = "ARCH";
+			os = "linux";
+			compression = "gzip";
+			load = <LOAD>;
+			entry = <ENTRY>;
+			hash at 1 {
+				algo = "crc32";
+			};
+			hash at 2 {
+				algo = "sha1";
+			};
+		};
+
+		fdt at 1 {
+			description = "Flattened Device Tree blob";
+			data = /incbin/("./linux.dtb");
+			type = "flat_dt";
+			arch = "ARCH";
+			compression = "none";
+			hash at 1 {
+				algo = "crc32";
+			};
+			hash at 2 {
+				algo = "sha1";
+			};
+		};
+	};
+
+	configurations {
+		default = "conf at 1";
+		conf at 1 {
+			description = DESCRIPTION;
+			kernel = "kernel at 1";
+			fdt = "fdt at 1";
+		};
+	};
+};
-- 
1.8.1.4



More information about the meta-lsi mailing list