- 14 Jul, 2013 40 commits
-
-
Marek Vasut authored
Check if the configuration file contains the LAST option of TAG command and if so, set up the LAST flag in the SB file. Signed-off-by:
Marek Vasut <marex@denx.de>
-
Marek Vasut authored
Properly set the HAB flag to a #define'd value instead of a hardcoded value. Signed-off-by:
Marek Vasut <marex@denx.de>
-
Marek Vasut authored
Add example configuration files for loading U-Boot and it's SPL on both MX23 and MX28. Signed-off-by:
Marek Vasut <marex@denx.de>
-
Marek Vasut authored
Load the instructions that shall be inserted into the SB image from file. There is now an easy parser and the built-in instruction tables are gone. WARNING: This breaks the command line interface! Signed-off-by:
Marek Vasut <marex@denx.de>
-
Marek Vasut authored
When loading the command table, it is much more beneficial to load it as a linked list, especially since we will be soon loading the table from a file. Signed-off-by:
Marek Vasut <marex@denx.de>
-
Marek Vasut authored
The static IVT tables are no longer used, remove them. Signed-off-by:
Marek Vasut <marex@denx.de>
-
Marek Vasut authored
The command file parsing should be in a separate function and should be called right before the image is being produced. Move the parsing into separate function from set_cpu(). Signed-off-by:
Marek Vasut <marex@denx.de>
-
Marek Vasut authored
Implement simple parser that reads command from text input. This allows us to get rid of the built-in tables and replace them with built-in blocks of text. In the long run, they are easily replacable by file input. Note that in order to preserve all functionality, the table containing instructions need to be hand-patched, therefore there is some copying happening in set_cpu(). Moreover, set_cpu() is now called a little later to ensure the filenames of spl and u-boot are already read. Signed-off-by:
Marek Vasut <marex@denx.de>
-
Marek Vasut authored
The verbose boot flag should be part of the image context, make it so. Signed-off-by:
Marek Vasut <marex@denx.de>
-
Marek Vasut authored
Use enum of list of CPU types to improve the typing of the variable. Signed-off-by:
Marek Vasut <marex@denx.de>
-
Marek Vasut authored
The CPU model should be part of the image context, make it so. Signed-off-by:
Marek Vasut <marex@denx.de>
-
Marek Vasut authored
Write the output file directly instead of creating a block in memory and then writing this whole block into a file. This saves some memory and is a bit easier. Signed-off-by:
Marek Vasut <marex@denx.de>
-
Marek Vasut authored
So far, we only support one section, but once we have proper parser we will be able to support multiple sections. Prepare for this by implementing the section generation in the image tree correctly. Signed-off-by:
Marek Vasut <marex@denx.de>
-
Marek Vasut authored
In case the memory allocation fails in the command parser, there will might remain some allocated memory upon return. Fix this. Signed-off-by:
Marek Vasut <marex@denx.de>
-
Marek Vasut authored
No functional change in the code, just reorder the functions so they are not in such a state of chaos. Signed-off-by:
Marek Vasut <marex@denx.de>
-
Marek Vasut authored
The variable was initialized and reinitialized twice as a remnant of the rework, initialize it only once. Signed-off-by:
Marek Vasut <marex@denx.de>
-
Marek Vasut authored
There is no need to pass the IV explicitly as another argument, the function can pull this information from the image context. Signed-off-by:
Marek Vasut <marex@denx.de>
-
Marek Vasut authored
Update the checksum of the command right after we have all necessary information filled in it instead of doing it late in the function that encrypts the command. Signed-off-by:
Marek Vasut <marex@denx.de>
-
Marek Vasut authored
Split the code that encrypts portions of the image and the code that assembles the resulting image in memory. Signed-off-by:
Marek Vasut <marex@denx.de>
-
Marek Vasut authored
We need to store image digest in image context to let it traverse between the image creation function and image write function. Signed-off-by:
Marek Vasut <marex@denx.de>
-
Marek Vasut authored
Store image dictionary in image context, as this is where it should be according to the documentation. We also need it here to let it traverse between the image creation function and image write function. Signed-off-by:
Marek Vasut <marex@denx.de>
-
Marek Vasut authored
This patch pulls out the function calls that dump the final image at the end of function that creates the image. This will now allow easy separation of them into self-standing function. Signed-off-by:
Marek Vasut <marex@denx.de>
-
Marek Vasut authored
The encryption of command data corrupted the contents of the structure. To prevent that, store the encrypted command data in a separate entry in the command context structure. Signed-off-by:
Marek Vasut <marex@denx.de>
-
Marek Vasut authored
This instruction does nothing and is easy to implement. Signed-off-by:
Marek Vasut <marex@denx.de>
-
Marek Vasut authored
When loading the IVT, make a local copy of it instead of pointing directly onto the static structure. This makes it easier to operate with the file buffers associated with LOAD command in mostly uniform manner. Signed-off-by:
Marek Vasut <marex@denx.de>
-
Marek Vasut authored
The TAG command has to be encrypted using IV from the header, so reinit the AES with the IV for each section. Signed-off-by:
Marek Vasut <marex@denx.de>
-
Marek Vasut authored
This patch fixes the generation of section header block for multiple sections. Before this patch, only one section was always generated, which was incorrect. Signed-off-by:
Marek Vasut <marex@denx.de>
-
Marek Vasut authored
Move the function lower in mxssb.c so there is no longer need for forward declaration of sb_load_file(). Signed-off-by:
Marek Vasut <marex@denx.de>
-
Marek Vasut authored
Move the loading of a file associated with a LOAD instruction into sb_tag_to_command, since this is where the LOAD instruction is filled. This will allow us to keep the handling of LOAD instruction in one place. Signed-off-by:
Marek Vasut <marex@denx.de>
-
Marek Vasut authored
The command stream now only contains the filename as it should. The IVTs are currently handled via little hack, but this will change once there is a proper file parser. Signed-off-by:
Marek Vasut <marex@denx.de>
-
Marek Vasut authored
The image tree will be free'd in main(), so there is no need to worry about freeing it here. Signed-off-by:
Marek Vasut <marex@denx.de>
-
Marek Vasut authored
The cmd allocation in sb_tag_to_command() is no longer needed. It was needed temporarily for compatibility reasons during the transition, but this is resolved now. Signed-off-by:
Marek Vasut <marex@denx.de>
-
Marek Vasut authored
The TAG instruction is wholy filled later and the LOAD instruction fields need to be updated after a file was loaded. Thus, clean up bogus assignments into fields of these instructions. Signed-off-by:
Marek Vasut <marex@denx.de>
-
Marek Vasut authored
The sb_load_binary() call is now redundant, since the files are now loaded while preparing the SB image header. Reduce this to a stub function that fills the sb instruction stream. Signed-off-by:
Marek Vasut <marex@denx.de>
-
Marek Vasut authored
Pull the SB command blocks from the image tree. Signed-off-by:
Marek Vasut <marex@denx.de>
-
Marek Vasut authored
Pull out the section header information from the SB image tree. This allows us to remove some ad-hoc calls. Signed-off-by:
Marek Vasut <marex@denx.de>
-
Marek Vasut authored
The section offset computation has to be done after the SB image header is filled in. Moreover, the TAG command can be filled in only afterwards as well, since it's almost exact copy of the section header. Implement a function that fixes up the section headers and TAG commands. Signed-off-by:
Marek Vasut <marex@denx.de>
-
Marek Vasut authored
Pass the sb_image_ctx context into the cryptographic functions instead of passing the standalone cryptographic structures. This makes the code a little cleaner. Signed-off-by:
Marek Vasut <marex@denx.de>
-
Marek Vasut authored
Swap the malloc upwards as it can now no longer depends on SB header crypto init which filled the SB header with additional data. Now the SB header crypto operation and malloc of the image are truly separate entities. This also groups the SB header crypto operation together nicely. Signed-off-by:
Marek Vasut <marex@denx.de>
-
Marek Vasut authored
Calculate the size of the section block while reading it. This value can be later reused when calculating the placement of the final image blocks. Signed-off-by:
Marek Vasut <marex@denx.de>
-