Commit graph

916 commits

Author SHA1 Message Date
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
Aditya Kumar Patra S
b68f13eae8 qca: tools: Modified pack.py to support new single-image package
Change-Id: Ic791fead3f4fa64bfeb35f8b2d713aab6de38bfc
Signed-off-by: Aditya Kumar Patra S <apatr@codeaurora.org>
2017-03-09 16:54:29 +05:30
Aditya Kumar Patra S
12f0be0d05 qca: tools: Added pack.py tool support
Change-Id: Ic19f502d28525eb21c614f2ad55555a5a6ecbcf7
Signed-off-by: Aditya Kumar Patra S <apatr@codeaurora.org>
2016-11-09 04:18:28 -08:00
Gokul Sriram Palanisamy
c5d203be8e ipq806x: Creates u-boot.mbn by adding mbn header
Adds support to add mbn header to u-boot.bin as mbn header is needed by
sbl of all boards with ipq806x soc. A python script at tools/mkheader.py
is included which creates u-boot.mbn from u-boot.bin.

Change-Id: I070d82d9af0ed772cd4970b8fde152a8e3068823
Signed-off-by: Gokul Sriram Palanisamy <gpalan@codeaurora.org>
2016-10-12 08:58:50 -07:00
Simon Glass
25525ebe31 rockchip: Drop a debug message when outputing SPI images
There is an unnecessary sector count displayed. Drop it.

Signed-off-by: Simon Glass <sjg@chromium.org>
2016-01-08 07:59:06 -07:00
Simon Glass
9b03701a10 rockchip: Enable generation of SPI images
This feature was dropped at some point. Restore it.

Signed-off-by: Simon Glass <sjg@chromium.org>
2016-01-08 07:59:00 -07:00
Nathan Rossi
bc36605035 tools: zynqimage: Clean up check_params
Clean up the param checking, removing some code paths that will never
happen.

Signed-off-by: Nathan Rossi <nathan@nathanrossi.com>
Cc: Michal Simek <michal.simek@xilinx.com>
Cc: Tom Rini <trini@konsulko.com>
Reported-by: Coverity (CID 133251)
Reviewed-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2015-12-18 13:15:57 +01:00
Tom Rini
35065cdd94 Merge git://git.denx.de/u-boot-rockchip 2015-12-16 14:50:03 -05:00
Peter Robinson
69bf2d2faf tools: env: include compiler.h
With gcc 5.2 and later we get a bunch of "error: unknown type name" for
'uint8_t', 'uint32_t' and friends.

Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
2015-12-13 20:22:00 -05:00
Jeffy Chen
7bf274b9ca rockchip: mkimage: use imagename to select spl hdr & spl size
Our chips may have different spl size and spl header, so
use imagename(passed by "mkimage -n") to select them now.

Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
Acked-by: Simon Glass <sjg@chromium.org>
2015-12-13 17:07:29 -07:00
Jeffy Chen
5cc5b901e6 Revert "rockchip: Add max spl size & spl header configs"
This reverts commit 10b4615f9d7e177ec7fe644fbb2616e0e0956f6e

Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
Acked-by: Simon Glass <sjg@chromium.org>
2015-12-13 17:07:06 -07:00
Thomas Chou
8951523c6a buildman: README: add links for toolchains not available on kernel.org
Add links for toolchains not available on kernel.org.

The sh4 toolchains from kernel.org dose not work for some boards,
so use the sh from Sourcery.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2015-12-10 20:34:23 -07:00
Marek Vasut
3463314125 mkimage: Fix warning from fix for generating multi and script images again
Seems 6ae6e160 broke creating images in certain cases, there
are two problems with that patch.

First is that the expression "!x == 4 || !x == 6" is ambiguous.  The
intention here was "!(x == 4) || !(x == 6)" based on reading further in
the file, where this was borrowed from.  This however is interpreted by
gcc as "(!x) == 4 || (!x) == 6" and always false.  gcc-5.x will warn
about this case.

The second problem is that we do not want to test for the case of "(NOT x
is 4) OR (NOT x is 6)" but instead "(x is not equal to 4) AND (x is not
equal to 6)".  This is because in those two cases we already execute the
code question in another part of the file.  Rewrite the expression and
add parenthesis for clarity.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Tom Rini <trini@konsulko.com>
Cc: Philippe De Swert <philippedeswert@gmail.com>
Cc: Simon Glass <sjg@chromium.org>
[trini: Re-word Marek's explanation]
2015-12-07 13:28:09 -05:00
Philippe De Swert
6ae6e16005 mkimage : Fix generating multi and script images
Seems 92a655c3 broke creating multi and script type images.
Since the file1:file2:file3 string does not get split up,
it fails on trying to open an non-existing file.

mkimage -A arm -O linux -T multi -C none -d zImage:splash.bmp:device.dtb uimage
tools/mkimage: Can't open zImage:splash.bmp:device.dtb: No such file or directory

Since the sizes of the different parts seem to get added in the actual
routine that handles multi and script type images, we can probably skip the
bit of the code that causes the failure for that type of images.

Signed-off-by: Philippe De Swert <philippedeswert@gmail.com>
2015-12-05 18:22:35 -05:00
Jeffy Chen
3641339eff rockchip: Add support for rk's second level loader
The Rockchip boot ROM could load & run an initial spl loader,
and continue to load a second level boot-loader(which stored
right after the initial loader) when it returns.
Modify idblock generation code to support it.

Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
Acked-by: Simon Glass <sjg@chromium.org>
2015-12-01 08:07:22 -07:00
Jeffy Chen
6ae5860942 rockchip: Add max spl size & spl header configs
Our chips may have different max spl size and spl header, so
we need to add configs for that.

Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
Acked-by: Simon Glass <sjg@chromium.org>
Dropped CONFIG_ROCKCHIP_MAX_SPL_SIZE from rk3288_common.h,
Added $(if...) to tools/Makefile to fix widespread build breakage
Signed-off-by: Simon Glass <sjg@chromium.org>

Series-changes: 8
- Drop CONFIG_ROCKCHIP_MAX_SPL_SIZE from rk3288_common.h,
- Add $(if...) to tools/Makefile to fix widespread build breakage
2015-12-01 08:07:22 -07:00
Reinhard Pfau
76b391cdee tools/kwbimage: fix size computations for v1 images
Fix computation of haeder size and binary header size.
Size of opt header and some 32bit values were not taken into account. This could
result in invalid boot images (due to the wrong binary header size, the image could
claim to have another extension header after the binary extension although there
is none).

Use "uint32_t" instead of "unsigned int" for header size computation.

Signed-off-by: Reinhard Pfau <reinhard.pfau@gdsys.cc>
Reviewed-by: Stefan Roese <sr@denx.de>
Cc: Luka Perkov <luka.perkov@sartura.hr>
2015-11-29 16:02:44 +01:00
Reinhard Pfau
a8840dced0 tools/kwbimage: fix endianess issue
KWB image header values are in little endian (LE).
So adding appropriate cpu_to_leXX() calls to allow building those images
on BE hosts, too.

Signed-off-by: Reinhard Pfau <reinhard.pfau@gdsys.cc>
Reviewed-by: Stefan Roese <sr@denx.de>
2015-11-29 16:02:44 +01:00
Stefan Roese
7772085930 tools/kwbimage.c: Make sure that the resulting image is 4-byte aligned
With the dtb added to the main U-Boot image, it can happen, that
the resulting image is not 4-byte aligned. As the dtb tends to
be unaligned. But the image needs to be 4-byte aligned. At least the
Marvell hdrparser tool complains if its unaligned. By returning 1 here
in kwbimage_generate(), called via tparams->vrec_header() in mkimage.c,
mkimage will automatically pad the resulting image to a 4-byte size
if necessary.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Luka Perkov <luka.perkov@sartura.hr>
Cc: Dirk Eibach <eibach@gdsys.de>
2015-11-29 16:02:44 +01:00