pack: Remove flash wifi_fw command

'flash wifi_fw' command writes into flash based
on 'rootfs' partition offset. After sysupgrade,
flashing single image at u-boot write wifi firmware
into failsafe partitions because post sysupgarde
primary and failsafe partitions are swapped vice-versa.
Single image always boots with primary partitions, and
the wifi firmware flashed into failsafe partition won't
be loaded subsequently q6 will crash.

This patch resolves issue by using "ubi" command's instead
of "flash wifi_fw" command.

Signed-off-by: Manikanta Mylavarapu <mmanikan@codeaurora.org>
Change-Id: I9a89872ade5cbd753272e11fd15e7b8f06d4f92c
This commit is contained in:
Manikanta Mylavarapu 2021-03-18 08:17:08 +05:30
parent ebcbd6d5f6
commit 5ddba484f3

View file

@ -760,7 +760,23 @@ class Pack(object):
script.start_if_or("machid", machid_list)
script.start_activity("Flashing " + fw_filename[:-13] + ":")
script.imxtract(fw_filename[:-13] + "-" + sha1(fw_filename))
script.append('flash wifi_fw', fatal=False)
rootfs_info = self.__get_part_info("rootfs")
rootfs_offset = rootfs_info.offset
rootfs_len = rootfs_info.length
wifi_fw_cmd = "setenv mtdids nand0=nand0\n"
wifi_fw_cmd += "setenv mtdparts mtdparts=nand0:0x%x@0x%x(rootfs)\n" % (rootfs_len,rootfs_offset)
wifi_fw_cmd += "ubi part rootfs\n"
img_size = self.__get_img_size(fw_filename)
wifi_fw_cmd += "ubi write $fileaddr wifi_fw %x" % img_size
script.append(wifi_fw_cmd, fatal=False)
#Enable the below lines for debugging purpose
"""
script.append("mtdparts", fatal=False)
script.append("ubi info layout", fatal=False)
"""
script.finish_activity()
script.end_if()
@ -1903,7 +1919,7 @@ class Pack(object):
its_fp.write(its_data)
its_fp.close()
try:
cmd = [SRC_DIR + "/mkimage", "-f", self.its_fname, self.img_fname]
ret = subprocess.call(cmd)