[Sound-open-firmware] [PATCH] rimage: add correct FW version to binary

Liam Girdwood liam.r.girdwood at linux.intel.com
Mon Jun 4 13:03:41 CEST 2018


From: Tomasz Lauda <tomasz.lauda at linux.intel.com>

Now correct FW version is included into binary.

Signed-off-by: Tomasz Lauda <tomasz.lauda at linux.intel.com>
---
 Makefile.am      |  2 ++
 rimage/man_apl.c | 24 ++++++++++--------------
 rimage/man_cnl.c | 24 ++++++++++--------------
 3 files changed, 22 insertions(+), 28 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 5eebb33..d2c4956 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -55,5 +55,7 @@ doc-dummy:
 doc: doc-dummy
 	$(MAKE) -C doc doc
 
+if !BUILD_RIMAGE
 all-local:
 	rm -f $(top_srcdir)/src/include/version.h
+endif
diff --git a/rimage/man_apl.c b/rimage/man_apl.c
index 7b32ea1..efe8583 100644
--- a/rimage/man_apl.c
+++ b/rimage/man_apl.c
@@ -15,12 +15,8 @@
 #include "cse.h"
 #include "plat_auth.h"
 #include "manifest.h"
-
-/* hard coded atm - will pass this in from cmd line and git */
-#define MAN_FW_HDR_VERSION_MAJOR	9
-#define MAN_FW_HDR_VERSION_MINOR	22
-#define MAN_FW_HDR_VERSION_HOTFIX	1
-#define MAN_FW_HDR_VERSION_BUILD	0x7da
+#include <config.h>
+#include <version.h>
 
 /* manifest template */
 struct fw_image_manifest apl_manifest = {
@@ -65,10 +61,10 @@ struct fw_image_manifest apl_manifest = {
 		.header_id	= MAN_CSS_HDR_ID,
 		.padding	= 0,
 		.version = {
-			.major_version	= MAN_FW_HDR_VERSION_MAJOR,
-			.minor_version	= MAN_FW_HDR_VERSION_MINOR,
-			.hotfix_version = MAN_FW_HDR_VERSION_HOTFIX,
-			.build_version	= MAN_FW_HDR_VERSION_BUILD,
+			.major_version	= SOF_MAJOR,
+			.minor_version	= SOF_MINOR,
+			.hotfix_version = 0,
+			.build_version	= SOF_BUILD,
 		},
 		.modulus_size	= MAN_CSS_MOD_SIZE,
 		.exponent_size	= MAN_CSS_EXP_SIZE,
@@ -134,10 +130,10 @@ struct fw_image_manifest apl_manifest = {
 			.preload_page_count	= 0,	/* size in pages from $CPD */
 			.fw_image_flags	= SOF_MAN_FW_HDR_FLAGS,
 			.feature_mask	= SOF_MAN_FW_HDR_FEATURES,
-			.major_version	= MAN_FW_HDR_VERSION_MAJOR,
-			.minor_version	= MAN_FW_HDR_VERSION_MINOR,
-			.hotfix_version	= MAN_FW_HDR_VERSION_HOTFIX,
-			.build_version	= MAN_FW_HDR_VERSION_BUILD,
+			.major_version	= SOF_MAJOR,
+			.minor_version	= SOF_MINOR,
+			.hotfix_version	= 0,
+			.build_version	= SOF_BUILD,
 			.load_offset	= MAN_DESC_OFFSET,
 		},
 	},
diff --git a/rimage/man_cnl.c b/rimage/man_cnl.c
index 2aec2a7..5ce8c9d 100644
--- a/rimage/man_cnl.c
+++ b/rimage/man_cnl.c
@@ -15,12 +15,8 @@
 #include "cse.h"
 #include "plat_auth.h"
 #include "manifest.h"
-
-/* hard coded atm - will pass this in from cmd line and git */
-#define MAN_FW_HDR_VERSION_MAJOR	10
-#define MAN_FW_HDR_VERSION_MINOR	23
-#define MAN_FW_HDR_VERSION_HOTFIX	0
-#define MAN_FW_HDR_VERSION_BUILD	0x2a4
+#include <config.h>
+#include <version.h>
 
 /* manifest template */
 struct fw_image_manifest cnl_manifest = {
@@ -64,10 +60,10 @@ struct fw_image_manifest cnl_manifest = {
 		.header_id	= MAN_CSS_HDR_ID,
 		.padding	= 0,
 		.version = {
-			.major_version	= MAN_FW_HDR_VERSION_MAJOR,
-			.minor_version	= MAN_FW_HDR_VERSION_MINOR,
-			.hotfix_version = MAN_FW_HDR_VERSION_HOTFIX,
-			.build_version	= MAN_FW_HDR_VERSION_BUILD,
+			.major_version	= SOF_MAJOR,
+			.minor_version	= SOF_MINOR,
+			.hotfix_version = 0,
+			.build_version	= SOF_BUILD,
 		},
 		.modulus_size	= MAN_CSS_MOD_SIZE,
 		.exponent_size	= MAN_CSS_EXP_SIZE,
@@ -133,10 +129,10 @@ struct fw_image_manifest cnl_manifest = {
 			.preload_page_count	= 0,	/* size in pages from $CPD */
 			.fw_image_flags	= SOF_MAN_FW_HDR_FLAGS,
 			.feature_mask	= SOF_MAN_FW_HDR_FEATURES,
-			.major_version	= MAN_FW_HDR_VERSION_MAJOR,
-			.minor_version	= MAN_FW_HDR_VERSION_MINOR,
-			.hotfix_version	= MAN_FW_HDR_VERSION_HOTFIX,
-			.build_version	= MAN_FW_HDR_VERSION_BUILD,
+			.major_version	= SOF_MAJOR,
+			.minor_version	= SOF_MINOR,
+			.hotfix_version	= 0,
+			.build_version	= SOF_BUILD,
 			.load_offset	= 0x30000,
 		},
 	},
-- 
2.17.0



More information about the Sound-open-firmware mailing list