aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Gerlach2020-10-13 03:41:23 -0500
committerDave Gerlach2020-10-16 13:05:46 -0500
commit06c24e0a883432f68ba00f73e203be9e29130e94 (patch)
tree0917f97be05fe30f043acd7bb2a71d2868368bfe
parent8ca1ad4cffaa7516857e85883cb5731edd2a179f (diff)
downloadk3-image-gen-06c24e0a883432f68ba00f73e203be9e29130e94.tar.gz
k3-image-gen-06c24e0a883432f68ba00f73e203be9e29130e94.tar.xz
k3-image-gen-06c24e0a883432f68ba00f73e203be9e29130e94.zip
scripts: sysfw_boardcfg_blob_creator: Take any combination of boardcfgs
With the new bootflows being introduced, it is possible for different combinations of boardcfgs to be needed in different blobs. To account for this, allow any combination of boardcfgs to be specified for the sysfw_boardcfg_blob_creator script and generate binaries as needed. Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
-rwxr-xr-xscripts/sysfw_boardcfg_blob_creator.py34
1 files changed, 20 insertions, 14 deletions
diff --git a/scripts/sysfw_boardcfg_blob_creator.py b/scripts/sysfw_boardcfg_blob_creator.py
index 1f2fdc0..f638a36 100755
--- a/scripts/sysfw_boardcfg_blob_creator.py
+++ b/scripts/sysfw_boardcfg_blob_creator.py
@@ -28,7 +28,7 @@ class BoardCfgDesc():
28 self.fh = open(outfile, 'wb') 28 self.fh = open(outfile, 'wb')
29 bytes = self.fh.write(struct.pack('<BB', num_elems, sw_rev)) 29 bytes = self.fh.write(struct.pack('<BB', num_elems, sw_rev))
30 self.offset += bytes 30 self.offset += bytes
31 self.offset += 4 * struct.calcsize(self.fmt) 31 self.offset += num_elems * struct.calcsize(self.fmt)
32 self.tmpdir = tempfile.mkdtemp() 32 self.tmpdir = tempfile.mkdtemp()
33 descfile = os.path.join(self.tmpdir, "desc") 33 descfile = os.path.join(self.tmpdir, "desc")
34 bcfgfile = os.path.join(self.tmpdir, "bcfg") 34 bcfgfile = os.path.join(self.tmpdir, "bcfg")
@@ -66,23 +66,29 @@ class BoardCfgDesc():
66def create_sysfw_blob(args): 66def create_sysfw_blob(args):
67 """Create a SYSFW data blob to be used as a component in combined image """ 67 """Create a SYSFW data blob to be used as a component in combined image """
68 68
69 if args.boardcfg is None or args.boardcfg_sec is None or args.boardcfg_pm is None or args.boardcfg_rm is None:
70 logging.error("**** All 4 boardcfg binaries need to be provided ****")
71 raise Exception("Insufficient arguments")
72
73 logging.info("#### Creating SYSFW data blob - %s ####", args.output_file.name) 69 logging.info("#### Creating SYSFW data blob - %s ####", args.output_file.name)
74 logging.info("#### SW Rev = %d", args.sw_rev) 70 logging.info("#### SW Rev = %d", args.sw_rev)
75 logging.info("#### Device Group = %d", args.devgrp) 71 logging.info("#### Device Group = %d", args.devgrp)
76 logging.info("#### Board config binary - %s", args.boardcfg.name)
77 logging.info("#### Board config security binary - %s", args.boardcfg_sec.name)
78 logging.info("#### Board config PM binary - %s", args.boardcfg_pm.name)
79 logging.info("#### Board config RM binary - %s", args.boardcfg_rm.name)
80 72
81 blob = BoardCfgDesc(args.output_file.name, args.devgrp, args.sw_rev) 73 cnt = 0
82 blob.add_boardcfg(BOARDCFG, args.boardcfg.name) 74 if args.boardcfg is not None: cnt = cnt + 1
83 blob.add_boardcfg(BOARDCFG_SEC, args.boardcfg_sec.name) 75 if args.boardcfg_sec is not None: cnt = cnt + 1
84 blob.add_boardcfg(BOARDCFG_PM, args.boardcfg_pm.name) 76 if args.boardcfg_pm is not None: cnt = cnt + 1
85 blob.add_boardcfg(BOARDCFG_RM, args.boardcfg_rm.name) 77 if args.boardcfg_rm is not None: cnt = cnt + 1
78
79 blob = BoardCfgDesc(args.output_file.name, args.devgrp, args.sw_rev, cnt)
80 if args.boardcfg is not None:
81 logging.info("#### Board config binary - %s", args.boardcfg.name)
82 blob.add_boardcfg(BOARDCFG, args.boardcfg.name)
83 if args.boardcfg_sec is not None:
84 logging.info("#### Board config security binary - %s", args.boardcfg_sec.name)
85 blob.add_boardcfg(BOARDCFG_SEC, args.boardcfg_sec.name)
86 if args.boardcfg_pm is not None:
87 logging.info("#### Board config PM binary - %s", args.boardcfg_pm.name)
88 blob.add_boardcfg(BOARDCFG_PM, args.boardcfg_pm.name)
89 if args.boardcfg_rm is not None:
90 logging.info("#### Board config RM binary - %s", args.boardcfg_rm.name)
91 blob.add_boardcfg(BOARDCFG_RM, args.boardcfg_rm.name)
86 92
87 blob.finalize() 93 blob.finalize()
88 94