- 30 Jul, 2013 1 commit
-
-
Marek Vasut authored
This patch adds support for generating DCD blocks. The DCD blocks can be used to write values to memory or preconfigure the hardware or CPU. Signed-off-by:
Marek Vasut <marex@denx.de>
-
- 29 Jul, 2013 5 commits
-
-
Marek Vasut authored
While the BootROM doesn't check the IVT header, the first and last byte were swapped, so fix this. Signed-off-by:
Marek Vasut <marex@denx.de>
-
Marek Vasut authored
In this mode, the file contents will not be dumped and so will not be presented any further output. The tool will only return a return value depending on whether the verification passed or failed. This is useful in scripts. Signed-off-by:
Marek Vasut <marex@denx.de>
-
Marek Vasut authored
The image key is part of the image context, don't make it into a self-standing variable. Instead, wrap it into the image context structure. Signed-off-by:
Marek Vasut <marex@denx.de>
-
Marek Vasut authored
When printing the section flags, the BOOTABLE flag is assigned via a ternary operator, clean this up. Signed-off-by:
Marek Vasut <marex@denx.de>
-
Marek Vasut authored
If the file we try to verify is not aligned, it doesn't follow the specification and is therefore corrupted. Check this condition early in the process. Signed-off-by:
Marek Vasut <marex@denx.de>
-
- 28 Jul, 2013 6 commits
-
-
Marek Vasut authored
The HAB flag was printed in such a manner that it unaligned the dump of the image. Do a cosmetic fix. Signed-off-by:
Marek Vasut <marex@denx.de>
-
Marek Vasut authored
Check only 20 bytes of ths SHA1 sum of the whole image, as that's the actual length of the SHA1 hash. Signed-off-by:
Marek Vasut <marex@denx.de>
-
Marek Vasut authored
The unaligned payload case is not well defined. The FSL tool luckily handles it so that it stuffs random data at the end of the payload to align it. We will do the same when verifying the image, we will up-align the data we read to 16b and then operate on this as if it was aligned. Signed-off-by:
Marek Vasut <marex@denx.de>
-
Marek Vasut authored
When verifying the image, read the key from the image instead of expecting a zero key. The FSL tool, even if explicitly told to use zero key, uses a random key. Signed-off-by:
Marek Vasut <marex@denx.de>
-
Marek Vasut authored
Instead of passing an array to compute the CBC-MAC of the section table, use directly the one in the key dictionary. Signed-off-by:
Marek Vasut <marex@denx.de>
-
Marek Vasut authored
Make sure the output filename is closed when generating the SB image. This patch fixes an oversight that got in during the rework. Signed-off-by:
Marek Vasut <marex@denx.de>
-
- 21 Jul, 2013 11 commits
-
-
Marek Vasut authored
To make better use of the type-checking capabilities of compiler, replace the SB_HAB_IVT_HEADER macro with a function sb_hab_ivt_header(), which does exactly the same thing. Signed-off-by:
Marek Vasut <marex@denx.de>
-
Marek Vasut authored
Use fopen/fclose/fread/fwrite/fseek/ftell functions to operate with files to avoid using fdopen() and such. This also requires some data type adjustment, which in turn removes some warnings produced by clang analyzer. Signed-off-by:
Marek Vasut <marex@denx.de>
-
Marek Vasut authored
Instead of having such free-standing variables, wrap the input and output file names into image context alongside configuration file name. Signed-off-by:
Marek Vasut <marex@denx.de>
-
Marek Vasut authored
The values used in the SB configuration file must always be 32-bit due to the MXS limitation. Make sure the input values are properly sanitized. Signed-off-by:
Marek Vasut <marex@denx.de>
-
Marek Vasut authored
In the current setup, the sb_token_to_long() couldn't parse the full range of unsigned values. Fix this by returning the converted value via pointer reference and make the sb_token_to_long() return it's return value properly. Signed-off-by:
Marek Vasut <marex@denx.de>
-
Marek Vasut authored
Make the data type used in crc32() call more precise to avoid clang warnings with -Weverything. Signed-off-by:
Marek Vasut <marex@denx.de>
-
Marek Vasut authored
Use the ARRAY_SIZE macro consistently for the SB MODE command table of options. Signed-off-by:
Marek Vasut <marex@denx.de>
-
Marek Vasut authored
This final test was missing in the tool, verification of the SHA1 digest of the whole image. Implement it. Signed-off-by:
Marek Vasut <marex@denx.de>
-
Marek Vasut authored
This header is present only on Linux, so get rid of it. The problem is that we can no longer use __cpu_to_be16() function, which is Linux specific. This function can be replaced in a slightly hackish way by using the htons() call, as they do the same thing -- convert uint16_t from the host endianness to the network endianness (which is BE). The same goes the other way around, from __be16_to_cpu() is replaced by ntohs(), which is again a slight hack. Signed-off-by:
Marek Vasut <marex@denx.de>
-
Marek Vasut authored
Rework the condition that checks whether user supplied the input/output and configuration filenames correctly so that clang does not complain. Signed-off-by:
Marek Vasut <marex@denx.de>
-
Marek Vasut authored
This was a result of shuffling the code around, remove this useless line. Signed-off-by:
Marek Vasut <marex@denx.de>
-
- 17 Jul, 2013 3 commits
-
-
Marek Vasut authored
By using the -i option of MXSSB, one can now validate if the input image is correct. MXSSB will also dump the contents of the image. Signed-off-by:
Marek Vasut <marex@denx.de>
-
Marek Vasut authored
The MODE command string-value mapping table will be re-used by the image validator when it will be dumping the image contents, so pull the table out from the function. Signed-off-by:
Marek Vasut <marex@denx.de>
-
Marek Vasut authored
Rework the crypto functions so they can both encrypt and decrypt the payload. This will make use of them easy once we implement image verification. Signed-off-by:
Marek Vasut <marex@denx.de>
-
- 16 Jul, 2013 10 commits
-
-
Marek Vasut authored
Rename the functions to better match their purpose. This will come helpful when implementing image verification. Signed-off-by:
Marek Vasut <marex@denx.de>
-
Marek Vasut authored
Documentation is a must, add proper README file for this tool. Signed-off-by:
Marek Vasut <marex@denx.de>
-
Marek Vasut authored
The last missing command is the MODE command. Implement this command for the completeness of the command set. Signed-off-by:
Marek Vasut <marex@denx.de>
-
Marek Vasut authored
With the current parser, it is very easy to implement the commands. Implement the FILL command, which fills the memory with pattern. Signed-off-by:
Marek Vasut <marex@denx.de>
-
Marek Vasut authored
The jump command is almost identical to the CALL command, with the difference that CALL command saves stack and allows the called code to return into the BootROM. JUMP command does not do that, it just sets the PC register to a value and that's it. The sematics of both commands are almost identical though, therefore implement JUMP as a minor adjustment to CALL. Signed-off-by:
Marek Vasut <marex@denx.de>
-
Marek Vasut authored
It's year 2013 now, update the copyright message. Since the tool now also supports MX233, mention it in the description. Signed-off-by:
Marek Vasut <marex@denx.de>
-
Marek Vasut authored
The command stream is now in a configuration file, the target_cpu field is no longer used. Remove it. Signed-off-by:
Marek Vasut <marex@denx.de>
-
Marek Vasut authored
The section count can be calculated while parsing the configuration file. Do it and then use it when filling the SB image header. Moreover, the bootable section and possible multiple bootable sections collision can also be much better identified while parsing the configuration file. Signed-off-by:
Marek Vasut <marex@denx.de>
-
Marek Vasut authored
Rework the command parser. The command parsing can happen when reading the configuration file already, there is no need to read the configuration file in and parse only the result. The parser is now executed directly on each line that is read by from the configuration file instead and builds the image tree right away. Moreover, the parser is now implemented in much cleaner way and the command and section generation is cleanly separated. Finally, the memory usage of the tool went down by 20% . Signed-off-by:
Marek Vasut <marex@denx.de>
-
Marek Vasut authored
The IVT flag is completely useless now, especially since we treat the IVT as yet another data payload rather than something special. Signed-off-by:
Marek Vasut <marex@denx.de>
-
- 14 Jul, 2013 4 commits
-
-
Marek Vasut authored
Add the newly allocated section into the section list very early, so that in case of a failure during command parsing, the section can be properly deallocated with all the other sections. Signed-off-by:
Marek Vasut <marex@denx.de>
-
Marek Vasut authored
Report proper error messages when the command parsing function fails. Also report line number at which the error happened. Signed-off-by:
Marek Vasut <marex@denx.de>
-
Marek Vasut authored
Move the line tokenization fully into the sb_tag_to_command(). Moreover, improve error return and reporting from this function. Signed-off-by:
Marek Vasut <marex@denx.de>
-
Marek Vasut authored
Save the number at which line the command was. This will help when reporting errors from the parser. Signed-off-by:
Marek Vasut <marex@denx.de>
-