Commit Graph

16 Commits

Author SHA1 Message Date
Penny Chiu
ef386340a6 Add update BCT configs feature
This feature reads the BCT data from BCT or BCT with bootloader
appended binary, updates the BCT data based on config file, then
writes to new image file.

Signed-off-by: Penny Chiu <pchiu@nvidia.com>
Signed-off-by: Stephen Warren <swarren@nvidia.com>
2014-04-15 12:02:07 -06:00
Penny Chiu
5f0b21a2b6 Add Tegra124 bct data access for jtag control and chip uid
Add support for read secure_jtag_control and unique_chip_id from
cfg file and write them into BCT structure, and bct_dump can also
parse the two fields and show the data.

Signed-off-by: Penny Chiu <pchiu@nvidia.com>
Signed-off-by: Stephen Warren <swarren@nvidia.com>
2014-04-15 12:02:06 -06:00
Penny Chiu
19eae541aa Use block_size and page_size tokens when dump BCT data
Change to use block_size and page_size tokens instead of
block_size_log2 and page_size_log2 tokens when dump BCT
data.

Signed-off-by: Penny Chiu <pchiu@nvidia.com>
Signed-off-by: Stephen Warren <swarren@nvidia.com>
2014-04-15 12:02:06 -06:00
Penny Chiu
0cb60abe4a Add token_supported function
Add a function called token_supported in cbootimage_soc_config.
It is used to check if the input token is supported in specific
tegra soc.

Signed-off-by: Penny Chiu <pchiu@nvidia.com>
Signed-off-by: Stephen Warren <swarren@nvidia.com>
2014-04-15 12:02:06 -06:00
Penny Chiu
b81d219677 Accept void pointer as input data type for get/set_value functions
This change uses void * as input data type for
cbootimage_soc_config.get/set_value and context_set_value functions.
This makes the functions can accept various data types based on
different tokens.

Signed-off-by: Penny Chiu <pchiu@nvidia.com>
Signed-off-by: Stephen Warren <swarren@nvidia.com>
2014-04-15 12:02:06 -06:00
Penny Chiu
ee24d10641 Add page_size validation when setting page_size value
The valid page_size value should be a power of two, so add this
check when setting page_size value.

Signed-off-by: Penny Chiu <pchiu@nvidia.com>
Signed-off-by: Stephen Warren <swarren@nvidia.com>
2014-04-15 12:02:05 -06:00
Penny Chiu
3d0bff52c4 Add format functions to express BCT and bootloader data value
Add a new field to the value_data table, which is the function to
use to format the data value.

Signed-off-by: Penny Chiu <pchiu@nvidia.com>
Signed-off-by: Stephen Warren <swarren@nvidia.com>
2014-04-15 12:02:05 -06:00
Stephen Warren
ebf44ed327 Implement --soc command-line option
Implement command-line option "-s tegra20" and "--soc tegra20". These
mirror the existing -t/--tegra option, but require the full chip name
(tegra20) rather than an abbreviated name (-t20). This is more consistent
with just about everything else upstream.

Suggested-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Reviewed-by: Thierry Reding <treding@nvidia.com>
2013-08-28 08:53:16 -06:00
Penny Chiu
7a4b402df1 Add Tegra124 support
Add the Tegra124 chip support to cbootimage. User can use "-t124" as
option to parse .cfg and generate BCT/image for Tegra124.

Signed-off-by: Penny Chiu <pchiu@nvidia.com>
[swarren, modified change to usage() to avoid re-indenting it all]
Signed-off-by: Stephen Warren <swarren@nvidia.com>
2013-08-27 10:40:55 -06:00
Stephen Warren
ce1847a2b3 crypto: produce consistent hash for zero-length data
In real-world use-cases, hashing zero-length data likely never happens.
However, it is relevant when testing cbootimage with a dummy zero-length
bootloader binary, e.g.:

touch u-boot.bin
cbootimage -t30 ../tamonten-ng/tegra30.img.cfg tegra30-tec-ng.img

In this scenario, it's useful to create a consistent hash, so that one
can compare the resultant images before and after applying patches, to
check for regressions.

Hence, zero out the hash data so it has consistent content if it isn't
written to.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Reviewed-by: Thierry Reding <treding@nvidia.com>
2013-08-27 10:04:16 -06:00
Stefan Agner
14574161a6 Add automake option subdir-objects to prevent warnings
The SoC specific code is in subdirectories which leads to warnings in
newer
automake versions. The option subdir-objects prevents those warnings.

Signed-off-by: Stefan Agner <stefan@agner.ch>
Reviewed-by: Thierry Reding <thierry.reding@gmail.com>
Signed-off-by: Stephen Warren <swarren@nvidia.com>
2013-08-23 10:43:06 -06:00
Penny Chiu
737ec8332c Add support for Tegra114 SPI boot device
This patch adds SpiFlashParams to generate/dump BCT for SPI flash.

Signed-off-by: Penny Chiu <pchiu@nvidia.com>
Acked-by: Allen Martin <amartin@nvidia.com>
Signed-off-by: Stephen Warren <swarren@nvidia.com>
2013-06-10 12:27:16 -06:00
Marc Dietrich
79789fd80d Fix assert with help output only
This moves an assert down if only "-h" and not SOC is given on the
command line.

Signed-off-by: Marc Dietrich <marvin24@gmx.de>
Signed-off-by: Stephen Warren <swarren@nvidia.com>
2013-04-12 13:09:18 -06:00
Allen Martin
624cec685c Add autotools support
Remove previous hardcoded GNUmakefile and replace with autoconf/automake
generated configure script and Makefile.

Signed-off-by: Allen Martin <amartin@nvidia.com>
Change-Id: I48d3f6f20423109dc662418b92900876a8f8d1da
Reviewed-on: http://git-master/r/217547
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Stephen Warren <swarren@nvidia.com>
Tested-by: Stephen Warren <swarren@nvidia.com>
2013-04-09 11:18:26 -07:00
Allen Martin
480901aba3 Add missing header files
This is in preparation of switching to autotools, add explicit #includes
for header files where there was an implicit dependency.

Signed-off-by: Allen Martin <amartin@nvidia.com>
Change-Id: I8ca5832638ac7043f2b4e687c52bbe6e0a755eef
Reviewed-on: http://git-master/r/217546
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Stephen Warren <swarren@nvidia.com>
Tested-by: Stephen Warren <swarren@nvidia.com>
2013-04-09 11:18:02 -07:00
Allen Martin
f536ef21b1 Move all source files to subdir "src"
This is in preparation for adding autotools support to help separate the source
code from the build support files.

Signed-off-by: Allen Martin <amartin@nvidia.com>
Change-Id: I128c258db7bbf2c1adf34fbaad188ea7678b79ff
Reviewed-on: http://git-master/r/217545
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Stephen Warren <swarren@nvidia.com>
Tested-by: Stephen Warren <swarren@nvidia.com>
2013-04-09 11:17:38 -07:00