tools: pack: add new option to select fw based on machid

IPQ5018 uses option qcn6122 to enable wifi fw selection.
This patch adds a new generic name 'multi_wifi_fw' to do
the same.

Change-Id: I6ca01e5c16537ea6d9f5e53f956d7e68566dc5ae
Signed-off-by: Rajkumar Ayyasamy <quic_arajkuma@quicinc.com>
This commit is contained in:
Rajkumar Ayyasamy 2021-11-27 17:04:39 +05:30 committed by Gerrit - the friendly Code Review server
parent 4291c86117
commit d84c9f230d

View file

@ -89,8 +89,8 @@ memory_size = "default"
lk = "false"
skip_4k_nand = "false"
atf = "false"
qcn6122 = "false"
tiny_16m = "false"
multi_wifi_fw = "false"
# Note: ipq806x didn't expose any relevant version */
soc_hw_version_ipq40xx = { 0x20050100 };
@ -1275,7 +1275,7 @@ class Pack(object):
try:
diff_soc_ver_files = section.attrib['diff_soc_ver_files']
except KeyError, e:
if (qcn6122 == "true" or tiny_16m == "true") and 'wififw_type_min' in section.attrib:
if (multi_wifi_fw == "true" or tiny_16m == "true") and 'wififw_type_min' in section.attrib:
wifi_fw_type_min = section.attrib['wififw_type_min']
wifi_fw_type_max = section.attrib['wififw_type_max']
else:
@ -1341,7 +1341,7 @@ class Pack(object):
if flinfo.type != "emmc":
img = section.find('img_name')
if img != None and 'wififw_type' in img.attrib and (qcn6122 == "true" or tiny_16m == "true"):
if img != None and 'wififw_type' in img.attrib and (multi_wifi_fw == "true" or tiny_16m == "true"):
imgs = section.findall('img_name')
try:
for img in imgs:
@ -1438,7 +1438,7 @@ class Pack(object):
if ret == 0:
return 0
if self.flash_type in [ "nand", "nand-4k", "norplusnand", "norplusnand-4k" ] and partition == "rootfs" and qcn6122 == "true":
if self.flash_type in [ "nand", "nand-4k", "norplusnand", "norplusnand-4k" ] and partition == "rootfs" and multi_wifi_fw == "true":
fw_imgs = section.findall('img_name')
for fw_img in fw_imgs:
@ -1717,7 +1717,7 @@ class Pack(object):
diff_soc_ver_files = section.attrib['diff_soc_ver_files']
partition = section.attrib['label']
except KeyError, e:
if (qcn6122 == "true" or tiny_16m == "true") and 'wififw_type_min' in section.attrib:
if (multi_wifi_fw == "true" or tiny_16m == "true") and 'wififw_type_min' in section.attrib:
wifi_fw_type_min = section.attrib['wififw_type_min']
wifi_fw_type_max = section.attrib['wififw_type_max']
partition = section.attrib['label']
@ -1783,7 +1783,7 @@ class Pack(object):
img = section.find('img_name')
if img != None and 'wififw_type' in img.attrib and (qcn6122 == "true" or tiny_16m == "true"):
if img != None and 'wififw_type' in img.attrib and (multi_wifi_fw == "true" or tiny_16m == "true"):
imgs = section.findall('img_name')
try:
for img in imgs:
@ -1888,7 +1888,7 @@ class Pack(object):
if filename != "":
self.__gen_script_append_images(filename, soc_version, wifi_fw_type, images, flinfo, root, section_conf, partition)
if self.flash_type in [ "nand", "nand-4k", "norplusnand", "norplusnand-4k" ] and section_conf == "rootfs" and qcn6122 == "true":
if self.flash_type in [ "nand", "nand-4k", "norplusnand", "norplusnand-4k" ] and section_conf == "rootfs" and multi_wifi_fw == "true":
fw_imgs = section.findall('img_name')
try:
@ -2241,7 +2241,7 @@ class ArgParser(object):
global lk
global atf
global skip_4k_nand
global qcn6122
global multi_wifi_fw
"""Start the parsing process, and populate members with parsed value.
@ -2251,7 +2251,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=", "memory=", "lk", "skip_4k_nand", "atf", "qcn6122"])
opts, args = getopt(sys.argv[1:], "", ["arch=", "fltype=", "srcPath=", "inImage=", "outImage=", "image_type=", "memory=", "lk", "skip_4k_nand", "atf", "qcn6122", "multi_wifi_fw"])
except GetoptError, e:
raise UsageError(e.msg)
@ -2287,7 +2287,10 @@ class ArgParser(object):
skip_4k_nand = "true"
elif option == "--qcn6122":
qcn6122 = "true"
multi_wifi_fw = "true"
elif option == "--multi_wifi_fw":
multi_wifi_fw = "true"
#Verify Arguments passed by user