From ccac2392f7af47c7397d8b804e8dfb706a9467fa Mon Sep 17 00:00:00 2001 From: Pavithra Palanisamy Date: Mon, 25 Mar 2019 16:47:42 +0530 Subject: [PATCH] pack: Add support to pack CDTs based on specific memory profiles Change-Id: I0de52b34ae0dbbc4971e8df48679a192ff1b1609 Signed-off-by: Pavithra Palanisamy --- tools/pack.py | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/tools/pack.py b/tools/pack.py index 6111275eb7..6181b1446e 100644 --- a/tools/pack.py +++ b/tools/pack.py @@ -85,6 +85,7 @@ ARCH_NAME = "" SRC_DIR = "" MODE = "" image_type = "all" +memory_size = "default" lk = "false" # @@ -603,7 +604,10 @@ class Pack(object): memory = section.find(".//memory").text except AttributeError, e: memory = "128M16" - filename = "cdt-" + board + "_" + memory + ".bin" + if memory_size != "default": + filename = "cdt-" + board + "_" + memory + "_LM" + memory_size + ".bin" + else: + filename = "cdt-" + board + "_" + memory + ".bin" else: filename = "cdt-" + board + ".bin" @@ -1027,7 +1031,10 @@ class Pack(object): except AttributeError, e: memory = "128M16" - filename = "cdt-" + board + "_" + memory + ".bin" + if memory_size != "default": + filename = "cdt-" + board + "_" + memory + "_LM" + memory_size + ".bin" + else: + filename = "cdt-" + board + "_" + memory + ".bin" file_info = "ddr-" + board + "_" + memory else: filename = "cdt-" + board + ".bin" @@ -1520,6 +1527,7 @@ class ArgParser(object): global SRC_DIR global ARCH_NAME global image_type + global memory_size global lk """Start the parsing process, and populate members with parsed value. @@ -1530,7 +1538,7 @@ class ArgParser(object): cdir = os.path.abspath(os.path.dirname("")) if len(sys.argv) > 1: try: - opts, args = getopt(sys.argv[1:], "", ["arch=", "fltype=", "srcPath=", "inImage=", "outImage=", "image_type=", "lk"]) + opts, args = getopt(sys.argv[1:], "", ["arch=", "fltype=", "srcPath=", "inImage=", "outImage=", "image_type=", "memory=", "lk"]) except GetoptError, e: raise UsageError(e.msg) @@ -1553,6 +1561,9 @@ class ArgParser(object): elif option == "--image_type": image_type = value + elif option == "--memory": + memory_size = value + elif option =="--lk": lk = "true" @@ -1616,6 +1627,10 @@ class ArgParser(object): print print " --outImage \tPath to the directory where single image will be generated" print + print " --memory \tMemory size for low memory profile" + print " \t\tIf it is not specified CDTs with default memory size are taken for single-image packing.\n" + print " \t\tIf specified, CDTs created with specified memory size will be used for single-image.\n" + print print " --lk \t\tReplace u-boot with lkboot for appsbl" print " \t\tThis Argument does not take any value" print "Pack Version: %s" % version