summaryrefslogtreecommitdiff
path: root/src/parse.c
Commit message (Collapse)AuthorAgeFilesLines
* Correct spelling mistakesHEADmasterEdward Betts2019-09-191-1/+1
| | | | | Signed-off-by: Edward Betts <edward@4angle.com> Signed-off-by: Stephen Warren <swarren@nvidia.com>
* Fix various abort(), crashes, and memory errorsStephen Warren2018-09-171-1/+1
| | | | | | | | | | | | cbootimage doesn't have extensive error-checking of the input files. Thus it's easy to trigger aborts (which in turn segfault to exit the app) and bad memory accesses by providing under-sized binary input files or configuration files with missing required statements. Add a bit more error-checking to clean up some of these cases. No doubt there are more, but this change only fixes those that have been reported. Signed-off-by: Stephen Warren <swarren@nvidia.com> Reviewed-by: Thierry Reding <treding@nvidia.com>
* Use C99 uintXX_t instead of implementation-specific u_intXX_t typesThomas Petazzoni2017-10-031-39/+39
| | | | | | | | | | | | | | | | | | | | The u_intXX_t types are implementation-specific and not part of a standard. As an example, they are not provided by the musl C library. Therefore, this commit switches cbootimage to use the C99 uintXX_t types. This commit has been produced by: 1. Running: find . -name '*.[ch]' | xargs sed -i 's%u_int\([0-9]*\)_t%uint\1_t%g' 2. Adding a #include <stdint.h> in cbootimage.h The result has been compile tested with the musl C library. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> (swarren, validated "objdump -d cbootimage" is identical before/after) Signed-off-by: Stephen Warren <swarren@nvidia.com>
* cbootimage: allow working with paths that contain '@'Patrick Georgi2016-03-141-1/+1
| | | | | Signed-off-by: Patrick Georgi <patrick@openbios.org> Signed-off-by: Stephen Warren <swarren@nvidia.com>
* Add new configuration keyword "RehashBl"Jimmy Zhang2015-10-191-0/+9
| | | | | | | | | | | | | | | | | | This feature is needed in case an image is updated at later stage after bootimage has been created. How to use: Add keyword "RehashBl" to configuration file, for example, update.cfg: RehashBl; Invoke cbootimage to re-calculate bootloader aes hash, for example, for bootimage bootloader.bin: $ cbootimage -s tegra210 --update update.cfg bootloader.bin bootloader.bin-resigned Where bootloader.bin-resigned is the resigned bootimage bootloader.bin Signed-off-by: Jimmy Zhang <jimmzhang@nvidia.com> Signed-off-by: Stephen Warren <swarren@nvidia.com>
* Add support for update pubkey and rsa-pss signaturesJimmy Zhang2015-10-191-0/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | Create new configuration keywords: RsaKeyModulusFile: pubkey modulus RsaPssSigBlFile: bootloader rsa pss signature RsaPssSigBctFile: bct rsa pss signature Sample Configuration file update_bl_sig.cfg RsaKeyModulusFile = pubkey.mod; RsaPssSigBlFile = bl.sig; where pubkey.mod and bl.sig are files that contain the public key modulus and bootloader's rsa-pss signature respectively. public key modulus and signature are created through utilities outside cbootimage. Command line example: $ cbootimage -s tegra210 -u update_bl_sig.cfg image.bin image.bin-bl-signed Above three new keywords added in this CL are only implemented to support for T210. Signed-off-by: Jimmy Zhang <jimmzhang@nvidia.com> Signed-off-by: Stephen Warren <swarren@nvidia.com>
* Add support for Tegra210Jimmy Zhang2015-03-251-0/+1
| | | | | | | | | | | | | | | | This patch adds support for Tegra210. The command option is --soc tegra210 or -s tegra210 T210 specific files are added under src/t210 directory. Main changes from earlier soc are many new fileds are added to structure nvboot_sdram_params and the number of boot devices that can be defined within bct is reduced from 4 to 1. Signed-off-by: Jimmy Zhang <jimmzhang@nvidia.com> Tested-by: Thierry Reding <treding@nvidia.com> Signed-off-by: Stephen Warren <swarren@nvidia.com>
* Add Tegra132 support for the cbootimage utilityVince Hsu2014-07-151-1/+62
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds support for Tegra132. This are only slight differences between Tegra124 and Tegra132. The command line usage is exactly the same as other platforms like Tegra124. The structure nvboot_mts_info is added into the bct for Tegra132. So the bootrom and first stage bootloader know where to load the preboot and mts images. Two parse items "Mts=" and "MtsPreboot=" are added to embedded MTS images in BCT image like what we do for bootloader. The syntax is also the same. For example: MtsPreboot = <preboot_image>,<load_address>,<entry_address>,Complete; Mts = <mts_image>,<load_address>,<entry_address>,Complete; The load and entry addresses depned on your board design. Four files are added in src/t132: nvbctlib_t132.c - is cloned from nvbctlib_t124.c and adds mts information getter and setter. nvboot_bct_t132.h - adds mts structure into bct nvboot_sdram_param_t132.h - clone of nvboot_sdram_param_t124.h parse_t132.c - clone of parse_t124.c Signed-off-by: Vince Hsu <vinceh@nvidia.com> Acked-by: Allen Martin <amartin@nvidia.com>
* Add Tegra124 bct data access for jtag control and chip uidPenny Chiu2014-04-151-0/+76
| | | | | | | | | 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>
* Accept void pointer as input data type for get/set_value functionsPenny Chiu2014-04-151-1/+1
| | | | | | | | | | 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>
* Move all source files to subdir "src"Allen Martin2013-04-091-0/+803
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>