summaryrefslogtreecommitdiffstats
path: root/scripts
Commit message (Collapse)AuthorAgeFilesLines
* scripts: make __init__.py nonemptySascha Hauer2016-02-123-0/+3
| | | | | | Otherwise they get removed by make distclean. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/ratp'Sascha Hauer2016-02-0822-0/+5408
|\
| * host side for barebox remote controlJan Luebbe2016-01-189-0/+1535
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This contains the host tool for barebox remote control. It is written in Phython with its own implementation of the RATP protocol. Currently this is a very simple tool which needs more work, but the code can also be used as a library. Example output: console: '. ' console: '.. ' console: 'dev ' console: 'env ' console: 'mnt ' console: '\n' Result: BBPacketCommandReturn(exit_code=0) Signed-off-by: Jan Lübbe <j.luebbe@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Tested-by: Andrey Smirnov <andrew.smirnov@gmail.com>
| * pyserial: decrease timeoutsSascha Hauer2016-01-181-4/+4
| | | | | | | | | | | | | | | | pyserial has very generous timeouts which introduces quite big latencies at least when used on rfc2217 ports. Decrease timeouts to make it more reactive. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * include pyserial trunkJan Luebbe2016-01-1813-0/+3873
| | | | | | | | | | | | | | The current pyserial is broken, this version contains the fix for: http://sourceforge.net/p/pyserial/bugs/166/ Signed-off-by: Jan Luebbe <jlu@pengutronix.de>
* | Merge branch 'for-next/hab'Sascha Hauer2016-02-0841-930/+3194
|\ \
| * | scripts: imx-usb-loader: Do not zero out boot_data_ptrSascha Hauer2016-02-041-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | This shouldn't be necessary. So far it didn't hurt either, but now this invalidates the signature of the image, so keep the image unmodified. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | Make: i.MX: Allow to pass config file to cmd_imx_imageSascha Hauer2016-02-041-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | Pass the config file to cmd_imx_image as arguments to make it more flexible. Also add the possibility for another arg containing additional options. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | scripts: imx-image: Allow to create HAB signed images suitable for USB uploadSascha Hauer2016-02-041-6/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For USB upload we must execute the DCD table manually and invalidate the DCD table in the uploaded image afterwards to prevent the ROM from executing the DCD data again. Doing this changes the image and thus also invalidates the signature. To make HAB signed images suitable for USB upload possible we add an option to create HAB signed images suitable for USB upload. With this option the image is created like this: - The image is created like usual, but with already invalidated DCD data (DCD length is set to zero) - This image is then signed using the CST - After this the DCD data is made valid (Set DCD length to the real length) imx-usb-loader now finds valid DCD data, executes it and by invalidating the DCD data it restores the state the image had during signing. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | scripts: imx-image: Factor out a read_file functionSascha Hauer2016-02-041-16/+30
| | | | | | | | | | | | | | | | | | | | | The same code will be used a second time in a followup patch, so factor out a common function. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | scripts: imx-usb-loader: Use dcd len to invalidate dcd dataSascha Hauer2016-02-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | We invalidate the dcd data in the uploaded image since we already processed it manually. To do so we have set the dcd pointer to 0. Doing it this way prevents the ROM from executing the HAB code in debug mode. Use the dcd length instead to invalidate the dcd data. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | scripts: imx: Generate signed images with imx-imageSascha Hauer2016-02-043-117/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The imx-image tool can now generate signed images itself, so we can switch to this mechanism: - Move the CSF templates to header files which can be included by the flash config files - remove images/Makefile.imxhabv4 which is no longer necessary. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | scripts: imx: Allow to create signed imagesSascha Hauer2016-02-043-21/+167
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch allows to call CST directly from imx-image to create signed images. CST is called whenever the config file contains the hab <str> commands which means a CSF is generated. Calling CST requires some quirks. First of all CST returns successfully whenever a CSF exists, no matter is the CSF actually contains something sensible or not. So to detect if CST has been called successfully we have to check if it generated output, not if it returned successfully. Then CST uses csfsig.bin as a temporary file which breaks when the tool is called multiple times at once, something which often happens in parallel builds. We therefore have to lock accesses to this file using flock(). Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | scripts: imx: Create CSF files from imx config fileSascha Hauer2016-02-042-1/+109
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is the first step to support creating signed images directly with the imx-image tool. i.MX images must be signed using the Freescale CST tool. CST needs informations already present in the imx-image tool, so it's convenient to call CST directly from imx-image. CST takes CSF files (Command Sequence Files) as input. This patch supports generating CSF files from the imx-image configuration file. This adds three new commands to the config file: hab <str>: All options to the hab command are directly passed through to the CSF. hab_blocks: This generates the "Blocks =" line in the CSF. This is the place where the CSF needs information which is contained in the imx-image tool: The image size, the image filename and the load address. super_root_key <file>: For HABv3 the super root key hash is needed in the i.MX flash header. This command is used to specify the path to the super root key. Needed for HABv3 only. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | scripts: imx-image: Support adding a Super Root Key to the imageSascha Hauer2016-02-043-0/+135
| | | | | | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | scripts: imx-image: pass config data to add_header_*Sascha Hauer2016-02-041-4/+10
| | | | | | | | | | | | | | | | | | | | | Now that we have a config data struct we can pass it to add_header_* to reduce the argument count. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | scripts: imx-image: move more variables to context dataSascha Hauer2016-02-042-11/+13
| | | | | | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | scripts: imx: Drop double checkSascha Hauer2016-02-021-3/+0
| | | | | | | | | | | | | | | | | | We have the same "if (*line == '\0')" check twice. Remove one of them. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | scripts: imx-usb-loader: Add -s and -i optionsSascha Hauer2016-02-021-1/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Normally imx-usb-loader interprets and executes the DCD table from an uploaded image and invalidates the DCD before uploading the image itself to prevent the i.MX ROM code from executing it again. With HAB signed images this is not possible since invalidating the DCD table modifies the image which also makes the signature invalid. To support this usecase add two new options to imx-usb-loader: The -i option allows to pass in an external config file which can be used to setup SDRAM. The DCD table in the image can then be made empty so that the ROM does not see a second SDRAM setup. The -s option allows to skip interpreting the DCD table in the image. This may when some setup stuff is still in the images DCD table but shall be executed by the ROM and not by imx-usb-loader. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | scripts: imx: make libusb variables globalSascha Hauer2016-02-021-91/+81
| | | | | | | | | | | | | | | | | | | | | No need to pass the libusb context through from function to function. Make them globally visible. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | scripts: imx: move config file parser to separate fileSascha Hauer2016-02-024-329/+352
| | | | | | | | | | | | | | | | | | | | | To make the config parser usable by imx-usb-loader also move it to a separate file. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | scripts: imx-image: move check to context dataSascha Hauer2016-02-021-7/+22
| | | | | | | | | | | | | | | | | | | | | Move the config parsers check function to context data to make it possible to pass in a different version of this function later. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | scripts: imx-image: move write_mem to context dataSascha Hauer2016-02-021-8/+15
| | | | | | | | | | | | | | | | | | | | | Move the config parsers write_mem function to context data to make it possible to pass in a different version of this function later. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | scripts: imx-image: Add context struct to config parsersSascha Hauer2016-02-021-30/+36
| | | | | | | | | | | | | | | | | | | | | | | | This adds a context struct to the config parser. This is a first step to make the config parser usable from both imx-image and imx-usb-loader which will be needed later. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | scripts: imx: Consolidate flash headers in imx toolsSascha Hauer2016-02-023-106/+84
| | | | | | | | | | | | | | | | | | | | | | | | Both imx-image and imx-usb-loader use their own variants of the i.MX flash header definitions. Consolidate them to avoid code duplication. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | scripts: imx-usb-loader: Move load_file upSascha Hauer2016-02-021-86/+86
| | | | | | | | | | | | | | | | | | To avoid forward declaration in a later patch. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | scripts: imx-usb-loader: fully read images into memorySascha Hauer2016-02-021-171/+75
| | | | | | | | | | | | | | | | | | | | | | | | | | | imx-usb-loader tries to safe memory by reading the image in chunks. This is unnecessarily complicated. The images are small, so fully read them into memory and store them in a single buffer. This makes handling them a lot easier. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | scripts: imx-image: Allow dcd offset 0x0Sascha Hauer2016-02-021-2/+2
| | | | | | | | | | | | | | | | | | | | | 0 is a valid offset for the dcd, so do not use this value to detect an unset dcd offset. Use 0xffffffff instead. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | scripts: imx-usb-loader: Move definitions upSascha Hauer2016-02-021-5/+5
| | | | | | | | | | | | | | | | | | The macros are needed earlier in a later patch. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | scripts: imx-usb-loader: Make readonly arguments constSascha Hauer2016-02-021-4/+5
| | | | | | | | | | | | | | | | | | | | | The buffers passed to dump_long and dump_bytes are not (and shouldn't be) modified. Make the arguments const. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | scripts: mxs: Use Kernel includesSascha Hauer2016-02-021-3/+1
| | | | | | | | | | | | | | | | | | Use the common definition of ARRAY_SIZE and roundup. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | scripts: imx: Use Kernel includesSascha Hauer2016-02-022-10/+2
| | | | | | | | | | | | | | | | | | Use the common definition of ARRAY_SIZE and offsetof. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | scripts: Add scripts/include to host compiler includesSascha Hauer2016-02-021-0/+1
| | | | | | | | | | | | | | | | | | So that host tools can use the kernel includes. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | scripts/include: Add ARRAY_SIZESascha Hauer2016-02-021-0/+2
| | | | | | | | | | | | | | | | | | | | | ARRAY_SIZE is another define commonly used in tools. Add it to the kernel includes. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | scripts: Add common header files for toolsSascha Hauer2016-02-0230-0/+1975
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This imports the tools/include dir from the Kernel as of 4.5-rc1 to barebox. The Kernel has many useful defines and helpers which are often duplicated in the different tools. Let's create a copy of them in a common place for all tools. Some files have been skipped for now as I currently see no use for them: include/linux/filter.h include/linux/hash.h include/linux/rbtree.h include/linux/rbtree_augmented.h They can be added later if needed. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | kwboot: do a filetype check before sending the imageUwe Kleine-König2016-01-261-2/+70
|/ / | | | | | | | | Signed-off-by: Uwe Kleine-König <uwe@kleine-koenig.org> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | imx-usb-loader: whitespace fixupSascha Hauer2015-12-161-2/+2
| | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | imx-usb-loader: Add i.MX6ul supportFlorian Vallee2015-12-161-0/+7
|/ | | | | Signed-off-by: Florian Vallee <fvallee@eukrea.fr> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* docproc: drop unused utilitySergey Koshechkin2015-11-133-405/+1
| | | | | Signed-off-by: Sergey Koshechkin <serge.koshechkin@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mk-omap-image: make some locally used functions staticSergey Koshechkin2015-11-101-1/+1
| | | | | Signed-off-by: Sergey Koshechkin <serge.koshechkin@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/mvebu'Sascha Hauer2015-11-061-20/+31
|\
| * scripts/kwbimage: Make BINARY files relative to config fileSascha Hauer2015-10-191-4/+13
| | | | | | | | | | | | | | | | | | | | | | | | The BINARY files given in the config files are expected to be relative to the place kwbimage is called from. This is bad since it breaks where kwbimage is called from the build directory and not the source directory. It makes more sense to make the paths in the config files relative to the config files which works with out of tree builds and is also more what a user normally expects. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * scripts/kwbimage: Move configfile opening to the function that reads itSascha Hauer2015-10-191-16/+18
| | | | | | | | | | | | | | | | The configfile is read in image_create_config_parse(), so move opening the file to there aswell and pass the configfile as filename instead of FILE *. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/misc'Sascha Hauer2015-11-061-4/+4
|\ \
| * | checkpatch: fix left brace warningAlexander Aring2015-10-271-4/+4
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Running checkpatch with perl version 5.22 occur the following warnings: Unescaped left brace in regex is deprecated, ... checkpatch.pl line 2017. Unescaped left brace in regex is deprecated, ... checkpatch.pl line 2267. Unescaped left brace in regex is deprecated, ... checkpatch.pl line 2268. ... lot of weird things ... )\(.*\).*\s{ <-- HERE / at ./scripts/checkpatch.pl line 2016. This patch fix these warning, an similar commit was done in linux kernel commit: 4e5d56bdf892e18832a6540b63ebf709966bce2a ("checkpatch: fix left brace warning"). Signed-off-by: Alexander Aring <alex.aring@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* / ARM: Allow compressed dtb binariesSascha Hauer2015-10-271-0/+19
|/ | | | | | | | | | | | | | | In the current multi image build process the DTBs end up uncompressed in the PBL. This can be annoying because the PBL is often very size constrained. This patch allows to put the DTBs in as lzo compressed binary into the PBL. Since lzo offers quite good compression ratios for DTBs no other compression algorithm has been implemented for now. Boards which want to use the compressed DTBs only have to change the __dtb_ prefix in the DTB name to __dtb_z_. Also they should select ARM_USE_COMPRESSED_DTB to make sure barebox supports uncompressing the DTB. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/misc'Sascha Hauer2015-08-061-2/+2
|\
| * socfpga_mkimage: Fix/clarify error messageSascha Hauer2015-07-081-2/+2
| | | | | | | | | | | | | | | | | | The actual max_image_size may be smaller than the define MAX_IMAGE_SIZE due to the additional header needed, so print max_image_size in the error message. Also, when complaining about a too big image say how big the image actually is. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | scripts: imx-image: Make in-place capableSascha Hauer2015-07-161-23/+24
| | | | | | | | | | | | | | Read in the source image completely before starting to write the output image. This makes it possible to pass the same file as input and output. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | scripts: imx-image: Do not pad imageSascha Hauer2015-07-161-1/+1
|/ | | | | | | | | | | | | | | | | | | | | | We have to pad the load size to the next 4k boundary, but only for the HAB4 case we actually care what data is loaded in the rest of the image. This lets the padding depend on the prepare_sign option. Background for this patch is a new yet-to-be-introduced image loading mechanism for i.MX. This new mechanism only loads the PBL portion of the image to memory, and not the whole image anymore. This means that the image in this case changes from: i.MX header (with loadsize: whole image), PBL, payload, padding to: i.MX header (with loadsize: header + PBL + padding), PBL, padding, payload With the padding between PBL and payload we are no longer able to find the payload, so we cannot add the padding there. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>