Commit graph

934 commits

Author SHA1 Message Date
Gokul Sriram Palanisamy
41eae48e0d pack.py: Updated to support lkboot single image
LK bootloader needs kernel image with a different
image header format. Hence, we need to pack the
single image with a custom kernel image.

Change-Id: I326fa92a72beace40f92753eac13b638705aeb14
Signed-off-by: Gokul Sriram Palanisamy <gokulsri@codeaurora.org>
2019-01-24 05:38:11 -08:00
Pavithra Palanisamy
fb64e6ded8 ipq807x: Enable support to generate apps-only images.
Change-Id: I678d621be99d07321b05f34cfe626607785c882f
Signed-off-by: Pavithra Palanisamy <pavip@codeaurora.org>
2019-01-04 12:44:17 +05:30
Linux Build Service Account
b38b3905e6 Merge "pack.py: included lkboot in single image" 2018-12-31 13:04:35 -08:00
Linux Build Service Account
1bde547522 Merge "pack.py: included lkboot in single image" 2018-12-31 13:04:35 -08:00
Gokul Sriram Palanisamy
44cffe4325 pack.py: included lkboot in single image
Added an additional option '--lk'.
With this option '--lk' included, pack script will
use lkboot.mbn instead of u-boot.mbn for APPSBL.

This option applies to 'emmc' only image.
Other flash types will discard this option.

Applies to ipq806x and ipq40xx SoCs.

Change-Id: Ic3b5a3398e3d007fe1d144e069e62a6157b9a2ef
Signed-off-by: Gokul Sriram Palanisamy <gokulsri@codeaurora.org>
2018-12-27 11:38:38 +05:30
Gokul Sriram Palanisamy
7b83f68369 pack.py: included lkboot in single image
Added an additional option '--lk'.
With this option '--lk' included, pack script will
use lkboot.mbn instead of u-boot.mbn for APPSBL.

This option applies to 'emmc' only image.
Other flash types will discard this option.

Applies to ipq807x SoCs.

Change-Id: Id2b6f6946f66d26e1d6c9c1c5dcec0d0fb5d26a8
Signed-off-by: Gokul Sriram Palanisamy <gokulsri@codeaurora.org>
2018-12-26 21:33:04 -08:00
Saravanan Jaganathan
93d70cd30f tools: pack: Choose nand-4k only for nand
nand-4k is auto picked only for nand and not for norplusnand.

Change-Id: Id78940ebebde7d8e814a8334d11b65f69ac1520e
Signed-off-by: Saravanan Jaganathan <sjaganat@codeaurora.org>
2018-12-26 16:56:55 +05:30
Pavithra Palanisamy
e3c24574bd ipq807x: Add support to pack nand single-image for 4K pagesized NAND
Change-Id: I247422b032076895102029482505ed8ef657fbf2
Signed-off-by: Pavithra Palanisamy <pavip@codeaurora.org>
2018-12-16 22:33:53 -08:00
Pavithra Palanisamy
bfb3a33102 ipq807x: Add support to use defined mkimage for creating U-boot image.
Change-Id: I61f9f3b5baeb9bfb854f7a48b6ccdb7d912fdca7
Signed-off-by: Pavithra Palanisamy <pavip@codeaurora.org>
2018-12-12 19:42:24 +05:30
Pavithra Palanisamy
640bab8ee8 ipq807x: Add support for "tiny-nor" flash type in single-image generation
Change-Id: I3c03233e8e9290fd8e601135afa7c5d421c29e71
Signed-off-by: Pavithra Palanisamy <pavip@codeaurora.org>
2018-12-06 10:54:21 +05:30
Pavithra Palanisamy
f29bf1f4bd ipq: Add support to pack wififw images on availability
This change adds "optional" property to avoid pack error
on unavailability of wififw version-specific binaries and
abort while flashing.

Change-Id: I7351e3e717f12b1e730db710b4364404d177768d
Signed-off-by: Pavithra Palanisamy <pavip@codeaurora.org>
2018-10-30 21:52:46 -07:00
Pavithra Palanisamy
06f249ac4c ipq807x: Modify flash script to flash V1 images in default case.
This change adds support to flash V1 images as if default version is 1,
if the soc version information are not supported in boot loader.

Change-Id: I7867ae3b26032215da45d2a97d61ea7398e152d9
Signed-off-by: Pavithra Palanisamy <pavip@codeaurora.org>
2018-09-11 13:17:44 +05:30
Pavithra Palanisamy
5a41b59a6d ipq807x: Modified pack script to name images based on version.
This change modifies the pack script to generate soc-version
specific names for images to be packed into single image.

Change-Id: Ic6406fe0fc164d8c6e7b2622c97915aac2afaac8
Signed-off-by: Pavithra Palanisamy <pavip@codeaurora.org>
2018-09-03 16:31:52 +05:30
Pavithra Palanisamy
e34f309ed1 ipq807x: Modify pack script to flash SoC-version specific binaries
Change-Id: I6903a732e83d716763f04c18ed45e54edb995783
Signed-off-by: Pavithra Palanisamy <pavip@codeaurora.org>
2018-08-31 21:50:16 +05:30
Avinash Pandey
34ee85c62f sysupgrade: Skip ubi section authentication in NOR/eMMC boot.
Change-Id: I2b2ba59c95eb0e7f9ca17527515f34fc50aeacd6
Signed-off-by: Avinash Pandey <avinasv@codeaurora.org>
2018-08-14 12:42:07 +05:30
Naresh Kumar Mehta
49df6fc9bb qca: Append -fpie to HOST_EXTRACFLAGS
Change-Id: I2c95398e0d6b3d6acf7af48b3e29fa124deb552d
Signed-off-by: Naresh Kumar Mehta <naresh@codeaurora.org>
2018-07-26 14:34:40 +05:30
Avinash Pandey
37c8e79460 sysupgrade: Avoid dereferencing of buffer to fix KW issue.
This kw issue occurred with below message:
"Use of free memory (access) - possible".
In order to fix this issue, we have removed all 
dereferenced buffer after freeing the buffer..

Change-Id: I080c45b17397333c3f897b960bdf6fca01b7a53e
Signed-off-by: Avinash Pandey <avinasv@codeaurora.org>
2018-03-23 11:25:27 +05:30
Avinash Pandey
a14e102f05 Sysupgrade: Fixing kw issues for buffer overflow.
Kw issues occurred with below message:
 "Array 'buf'of size 256 may use index value(s) -2..0".
In order to fix this issue, error message will be
returned with array index out of index if buffer
size isless than 0 or if it increases buffer size.

Change-Id: I5a7885b0ee2fd6e9c0ac3083b28366f1ae5ceaee
Signed-off-by: Avinash Pandey <avinasv@codeaurora.org>
2018-03-20 13:07:36 +05:30
Linux Build Service Account
6efdb60f4b Merge "sysupgrade: Read the files whose names starts with section type" 2018-03-02 13:51:52 -08:00
Linux Build Service Account
932c29bf3c Merge "sysupgrade: Add SBL_NAND_PREAMBLE if preamble bytes exist in image" 2018-03-02 02:04:54 -08:00
Linux Build Service Account
8775f69613 Merge "sysupgrade: Add support to process SBL for ipq806x nand boot" 2018-03-02 02:04:54 -08:00
Avinash Pandey
745ead5b92 sysupgrade: Read the files whose names starts with section type
Currently we are reading the .bin files who are having the type
in their image names, but this has problem when the image type
is overlapping in two file names ex. wififw_ubi.bin and ubi.bin.
To avoid this problem, we will take files whose names starts
with our image type.

Change-Id: Ib3ab64fb2bbf5c9c59b1ec644c409dee31be77a1
Signed-off-by: Avinash Pandey <avinasv@codeaurora.org>
2018-03-02 12:57:59 +05:30
Linux Build Service Account
f88ff6844b Merge "tools: Added ipq806x packing support" 2018-03-01 03:30:00 -08:00
Rajkumar Ayyasamy
5af0067f28 tools: Added ipq806x packing support
Change-Id: Id9becc59f3ecde2a262eaf91882c21650a6f90fa
Signed-off-by: Rajkumar Ayyasamy <arajkuma@codeaurora.org>
2018-03-01 11:25:59 +05:30
Linux Build Service Account
220d52fc46 Merge "qca: Modify pack.py script" 2018-02-28 03:32:33 -08:00
Linux Build Service Account
3174e97d20 Merge "ipq40xx: Replace sprintf with snprintf" 2018-02-27 23:40:26 -08:00
Rajkumar Ayyasamy
72d8969c0e tools: add snapshot of pack.py tool
This is a snapshot of the pack.py as of uboot-1.0
commit:

1fb1d5910acd0cf3950084b5d10b443af9803a05(ipq40xx:
Write actual file size in nand in case of NOR+NAND boot)

Change-Id: I85a3ffef3a17c0989d315777ff70c8e03114b6b7
Signed-off-by: Rajkumar Ayyasamy <arajkuma@codeaurora.org>
2018-02-26 22:53:12 -08:00
Linux Build Service Account
64b3c8f03a Merge "Sysupgrade: Add signature certificate size check as warning." 2018-02-26 00:14:45 -08:00
Avinash Pandey
5432bb2a0b Sysupgrade: Add signature certificate size check as warning.
For ipq807x, signature certificate size is dynamic and it is not fixed.
Hence we will treat signature certificate size check as warning. 

Change-Id: I6528212aaf9297217b19cb34311fc96500a7f38f
Signed-off-by: Avinash Pandey <avinasv@codeaurora.org>
2018-02-23 19:52:13 +05:30
Avinash Pandey
7eeddceddf Sysupgrade: Fixing kw issues in string functions.
This change replaces banned function namely, strncat and 
strncpy to strlcat and strlcpy respectively.

Change-Id: Ic02f59b29d1e58a937670f5e53dd1199cb55e53e
Signed-off-by: Avinash Pandey <avinasv@codeaurora.org>
2018-02-22 22:39:07 -08:00
Pavithra Palanisamy
77ed38c1cd qca: Modify pack.py script
Add print statements to display the failure reason for flashing.

Change-Id: Ib355271bdef307f6a981b32738a1a4195dc979ec
Signed-off-by: Pavithra Palanisamy <pavip@codeaurora.org>
2018-02-22 18:03:48 +05:30
Gokul Sriram Palanisamy
6cca4bdfa9 ARM: qca: Removed unused file hk_pack.py
Change-Id: I9a3df73a8a9523cc815f51c0a87052e34f0b593e
Signed-off-by: Gokul Sriram Palanisamy <gokulsri@codeaurora.org>
2018-02-22 11:03:18 +05:30
Ram Chandra Jangir
62928dc964 sysupgrade: Add SBL_NAND_PREAMBLE if preamble bytes exist in image
Now we are adding preamble value to read SBL header if ubi section
is present in the image. But in case of NOR+NAND images, though we are
having SBL in NOR and ubi section is also present and NAND_PREAMBLE
is getting added. which is breaking NOR+NAND sysupgrade.

Added functionality to compare first 12 bytes of section with pre
defined PREAMBLE value. If values matches, add the NAND_PREAMBLE to
read SBL header.

Change-Id: I704ee86cc50aa3ce3b2ab6ec34beab866ffde4b9
Signed-off-by: Anto Norbert <norbrt@codeaurora.org>
2018-02-20 15:23:40 +05:30
Ram Chandra Jangir
f40cda9a42 sysupgrade: Add support to process SBL for ipq806x nand boot
This change adds the correct Sbl_Hdr instead of Mbn_Hdr, since
sbl header is different than normal Mbn_Hdr, and adds the sbl
header size as 80.
SBL in nand starts with preamble before the sbl header, so here
it adds the preamble for header start address as well as
src, sig and cert offset values.

Change-Id: I9a56d7b4a51890b74a5ee5fe3047a38801d23803
Signed-off-by: Ram Chandra Jangir <rjangir@codeaurora.org>
2018-02-20 15:20:10 +05:30
Avinash Pandey
bcfcba7eb2 sysupgrade: Add support to authenticate image using TZ
This change will look for existence of file /sys/sec_upgrade/sec_auth
if the file exists, it performs image authentication with the new
approach i.e TZ enabled mechanism.

It reads all the sections of the single image and writes each
section's type and image file path in /sys/sec_upgrade/sec_auth.
If a written section image is a proper signed image, then it will
return success else will cause the failure.

Change-Id: I649581e0ab74a66d677e5bfbf1c34fd83cb2465d
Signed-off-by: Avinash Pandey <avinasv@codeaurora.org>
2018-02-08 16:14:32 +05:30
Sasirekaa Madhesu
c5ffa908c0 ipq40xx: Replace sprintf with snprintf
Change-Id: I2f1d31901ce4c4b15dad9e25265597518d4b4122
Signed-off-by: Sasirekaa Madhesu <smadhesu@codeaurora.org>
2018-02-08 12:40:04 +05:30
Venkat Raju Sana
2b68fba7af ipq807x: Add support for fail-safe boot on WIFI FW partition.
Change-Id: I82a541555298a589e6acf9a57d56304af441a0ce
Signed-off-by: Venkat Raju Sana <vrsana@codeaurora.org>
2018-01-04 04:28:28 -08:00
Pavithra Palanisamy
a392418a4f Sysupgrade: Add support for devcfg version check
This change adds support to check devcfg version and
allows sysupgrade only if the version is higher.

Change-Id: I7192f428c50c1b1b9eeddd1aac0d57d341d32436
Signed-off-by: Pavithra Palanisamy <pavip@codeaurora.org>
2017-11-03 04:18:26 -07:00
Pavithra Palanisamy
0e3043fd78 sysupgrade: Use memcmp() instead of strcmp()
Currently our sysupgrade is comparing the calculated hash,
and referenced hash using strcmp(), A valid binary hash can
contain zeros or null, this can make strcmp() to stop when it
encounters a zero or null. To check the entire hash, not just
the bytes of the hash up to the first zero, we will use memcmp().

The existing code uses mbn_header->code_size for calculating
source offset from the image, this change adds mbn_header_size
for the calculation.

Change-Id: Iaae39d04e8e4aafc686a5acbc499b11b2b8d6602
Signed-off-by: Pavithra Palanisamy <pavip@codeaurora.org>
2017-10-16 10:59:25 +05:30
pavip
fb8e307bbc sysupgrade: Add support to process 64 bit image
The existing sysupgrade treats all images as 32-bit image.
This change adds a check to signify the image class and
adds functions to process the headers respectively.

Change-Id: I04040fdc6e1a9c6c2df2407cd4b26dddaf4a008c
Signed-off-by: Pavithra Palanisamy <pavip@codeaurora.org>
2017-10-13 20:05:52 +05:30
Saravanan Jaganathan
7d086407d3 tools: Added support for APSS only single images
Change-Id: I6dfce00e629a9e34e95a88d4031bb117c539aeab
Signed-off-by: Saravanan Jaganathan <sjaganat@codeaurora.org>
Signed-off-by: Gokul Sriram Palanisamy <gokulsri@codeaurora.org>
2017-10-12 04:46:06 -07:00
Gokul Sriram Palanisamy
767b457534 ipq807x: Fix KW issues in sysupgrade.c and cmd_bootqca.c
Change-Id: I665f3d596cf235be7347faf68f0bf1ea8b10de7a
Signed-off-by: Gokul Sriram Palanisamy <gokulsri@codeaurora.org>
2017-09-07 04:17:41 -07:00
Aditya Kumar Patra S
75bf44bef1 tools: Fixed rootfs partition name for norplusnand and emmc images
Change-Id: Ibb684dc288460f0d1e8719b093766d80f535db18
Signed-off-by: Aditya Kumar Patra S <apatr@codeaurora.org>
2017-07-12 17:22:10 +05:30
Sachin Sundar
1ed5f5b1a2 sysupgrade: Add sysupgrade support for signed images.
Change-Id: I2b4a5aeaa311e08ec59f70c3a9e3a88e11dc10f1
Signed-off-by: Sachin Sundar <ssundar@codeaurora.org>
2017-06-08 11:18:32 +05:30
Aditya Kumar Patra S
d688553904 qca: tools: Modified pack.py to support new packing model
Change-Id: I8c97407cf6c8f9068f7945c488bd7c4857f8a5b1
Signed-off-by: Aditya Kumar Patra S <apatr@codeaurora.org>
2017-05-30 07:37:05 -07:00
Aditya Kumar Patra S
57c087df8d qca: tools: Standardize arguments passed to pack script
Change-Id: I61c1ae44d50ae358c8bbe8e1fc9a4a13b08beaff
Signed-off-by: Aditya Kumar Patra S <apatr@codeaurora.org>
2017-05-16 05:38:49 -07:00
Aditya Kumar Patra S
46b4a1d90b qca: tools: update for ipq806x in pack script
Added ipq806x support to new single-image package
styled pack script

Change-Id: I7c6518da38e1be01182d120c33aeff4d8a69ad55
Signed-off-by: Aditya Kumar Patra S <apatr@codeaurora.org>
2017-04-25 21:48:51 -07:00
Aditya Kumar Patra S
0e8178e9ea qca: tools: pack script for new single-image package
supports ipq40xx, ipq807x, ipq807x-64bit boards

Change-Id: I4f29dc8eed62c471b797b5b4d021b6ccdf8dbecc
Signed-off-by: Aditya Kumar Patra S <apatr@codeaurora.org>
2017-03-22 14:39:46 +05:30
Aditya Kumar Patra S
117caa3ffb Revert "qca: tools: Modified pack.py to support new single-image package"
This reverts commit b68f13eae8.

Change-Id: I8cabf4f636d4e5a69f656a2142ee78b5fa4630d0
Signed-off-by: Aditya Kumar Patra S <apatr@codeaurora.org>
2017-03-21 12:19:27 +05:30
Aditya Kumar Patra S
dc9ccafd96 qca: tools: Support for IPQ807x 64 bit mode in pack.py
1. User has to invoke the pack.py with mode(32 or 64) as the
third parameter.
2. If third parameter is empty, default 32 bit files will be
fetched to create single image.

Change-Id: I9aa589e88995b8f82cf6d39871f3db63235aa808
Signed-off-by: Aditya Kumar Patra S <apatr@codeaurora.org>
2017-03-16 05:15:27 -07:00