[U-Boot] [PATCH 1/2] mkimage: Report information about fpga

Michal Simek michal.simek at xilinx.com
Tue May 17 14:59:11 CEST 2016


Add FIT_FPGA_PROP that user can identify an optional
entry for fpga.

Signed-off-by: Michal Simek <michal.simek at xilinx.com>
---

 common/image-fit.c                    |  4 +++
 common/image.c                        |  1 +
 doc/uImage.FIT/multi-with-fpga.its    | 67 +++++++++++++++++++++++++++++++++++
 doc/uImage.FIT/source_file_format.txt |  3 ++
 include/image.h                       |  4 ++-
 5 files changed, 78 insertions(+), 1 deletion(-)
 create mode 100644 doc/uImage.FIT/multi-with-fpga.its

diff --git a/common/image-fit.c b/common/image-fit.c
index 25f8a1183d58..498ec6400425 100644
--- a/common/image-fit.c
+++ b/common/image-fit.c
@@ -1483,6 +1483,10 @@ void fit_conf_print(const void *fit, int noffset, const char *p)
 	if (uname)
 		printf("%s  FDT:          %s\n", p, uname);
 
+	uname = (char *)fdt_getprop(fit, noffset, FIT_FPGA_PROP, NULL);
+	if (uname)
+		printf("%s  FPGA:         %s\n", p, uname);
+
 	/* Print out all of the specified loadables */
 	for (loadables_index = 0;
 	     fdt_get_string_index(fit, noffset,
diff --git a/common/image.c b/common/image.c
index 9824685344bb..ec78b7eab336 100644
--- a/common/image.c
+++ b/common/image.c
@@ -160,6 +160,7 @@ static const table_entry_t uimage_type[] = {
 	{	IH_TYPE_RKSPI,      "rkspi",      "Rockchip SPI Boot Image" },
 	{	IH_TYPE_ZYNQIMAGE,  "zynqimage",  "Xilinx Zynq Boot Image" },
 	{	IH_TYPE_ZYNQMPIMAGE, "zynqmpimage", "Xilinx ZynqMP Boot Image" },
+	{	IH_TYPE_FPGA,       "fpga",       "FPGA Image" },
 	{	-1,		    "",		  "",			},
 };
 
diff --git a/doc/uImage.FIT/multi-with-fpga.its b/doc/uImage.FIT/multi-with-fpga.its
new file mode 100644
index 000000000000..0cdb31fe91c4
--- /dev/null
+++ b/doc/uImage.FIT/multi-with-fpga.its
@@ -0,0 +1,67 @@
+/*
+ * U-Boot uImage source file with multiple kernels, ramdisks and FDT blobs
+ * This example makes use of the 'loadables' field
+ */
+
+/dts-v1/;
+
+/ {
+	description = "Configuration to load fpga before Kernel";
+	#address-cells = <1>;
+
+	images {
+		fdt at 1 {
+			description = "zc706";
+			data = /incbin/("/tftpboot/devicetree.dtb");
+			type = "flat_dt";
+			arch = "arm";
+			compression = "none";
+			load = <0x10000000>;
+			hash at 1 {
+				algo = "md5";
+			};
+		};
+
+		fpga at 1 {
+			description = "FPGA";
+			data = /incbin/("/tftpboot/download.bit");
+			type = "fpga";
+			arch = "arm";
+			compression = "none";
+			load = <0x30000000>;
+			hash at 1 {
+				algo = "md5";
+			};
+		};
+
+		linux_kernel at 1 {
+			description = "Linux";
+			data = /incbin/("/tftpboot/zImage");
+			type = "kernel";
+			arch = "arm";
+			os = "linux";
+			compression = "none";
+			load = <0x8000>;
+			entry = <0x8000>;
+			hash at 1 {
+				algo = "md5";
+			};
+		};
+	};
+
+	configurations {
+		default = "config at 2";
+		config at 1 {
+			description = "Linux";
+			kernel = "linux_kernel at 1";
+			fdt = "fdt at 1";
+		};
+
+		config at 2 {
+			description = "Linux with fpga";
+			kernel = "linux_kernel at 1";
+			fdt = "fdt at 1";
+			fpga = "fpga at 1";
+		};
+	};
+};
diff --git a/doc/uImage.FIT/source_file_format.txt b/doc/uImage.FIT/source_file_format.txt
index 9c527c3e012d..3f5418045e5b 100644
--- a/doc/uImage.FIT/source_file_format.txt
+++ b/doc/uImage.FIT/source_file_format.txt
@@ -236,6 +236,7 @@ o config at 1
   |- kernel = "kernel sub-node unit name"
   |- ramdisk = "ramdisk sub-node unit name"
   |- fdt = "fdt sub-node unit-name"
+  |- fpga = "fpga sub-node unit-name"
   |- loadables = "loadables sub-node unit-name"
 
 
@@ -251,6 +252,8 @@ o config at 1
     "fdt type").
   - setup : Unit name of the corresponding setup binary (used for booting
     an x86 kernel). This contains the setup.bin file built by the kernel.
+  - fpga : Unit name of the corresponding fpga bitstream blob
+    (component image node of a "fpga type").
   - loadables : Unit name containing a list of additional binaries to be
     loaded at their given locations.  "loadables" is a comma-separated list
     of strings. U-Boot will load each binary at its given start-address.
diff --git a/include/image.h b/include/image.h
index a8488f2b392e..e2a90ca202b1 100644
--- a/include/image.h
+++ b/include/image.h
@@ -247,8 +247,9 @@ struct lmb;
 #define IH_TYPE_RKSPI		25	/* Rockchip SPI image		*/
 #define IH_TYPE_ZYNQIMAGE	26	/* Xilinx Zynq Boot Image */
 #define IH_TYPE_ZYNQMPIMAGE	27	/* Xilinx ZynqMP Boot Image */
+#define IH_TYPE_FPGA		28	/* FPGA Image */
 
-#define IH_TYPE_COUNT		28	/* Number of image types */
+#define IH_TYPE_COUNT		29	/* Number of image types */
 
 /*
  * Compression Types
@@ -810,6 +811,7 @@ int bootz_setup(ulong image, ulong *start, ulong *end);
 #define FIT_LOADABLE_PROP	"loadables"
 #define FIT_DEFAULT_PROP	"default"
 #define FIT_SETUP_PROP		"setup"
+#define FIT_FPGA_PROP		"fpga"
 
 #define FIT_MAX_HASH_LEN	HASH_MAX_DIGEST_SIZE
 
-- 
1.9.1



More information about the U-Boot mailing list