summaryrefslogtreecommitdiffstats
path: root/scripts/imx/imx-usb-loader.c
Commit message (Collapse)AuthorAgeFilesLines
* imx-usb-loader: add i.MX7S supportJuergen Borleis2017-01-191-0/+7
| | | | Signed-off-by: Juergen Borleis <jbe@pengutronix.de>
* imx-usb-loader: this table is used internally only, so keep it staticJuergen Borleis2017-01-191-1/+1
| | | | Signed-off-by: Juergen Borleis <jbe@pengutronix.de>
* imx-usb-loader: let constant data be constJuergen Borleis2017-01-191-7/+7
| | | | Signed-off-by: Juergen Borleis <jbe@pengutronix.de>
* scripts: imx imx-usb-loader: add i.MX6SL supportAlexander Kurz2017-01-101-0/+7
| | | | | | | Add the i.MX6SL USB id to the list of known ids. Signed-off-by: Alexander Kurz <akurz@blala.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* scripts: imx imx-usb-loader: sort USB id listAlexander Kurz2017-01-101-28/+28
| | | | | | | For better readability sort the list of known USB ids by VID and PID. Signed-off-by: Alexander Kurz <akurz@blala.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* scripts: imx: add support for i.MX50Alexander Kurz2016-09-121-0/+3
| | | | | | | | Add imximg support for i.MX50 processors which use the i.MX flash header v2 format. Signed-off-by: Alexander Kurz <akurz@blala.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* scripts: imx-usb-loader: cleanup DCD v2 processingAlexander Kurz2016-09-051-46/+79
| | | | | | | | | | | | | Re-Implement the DCD v2 processing. Processing for the DCD write command went into a separate function enabling the over-all DCD processing to handle check, nop and unlock commands as well. The trivial NOP command is supported right away. Further changes: put in some data consistancy checks and error handling, do structured member access and proper endianess handling and direct error messages to stderr. Signed-off-by: Alexander Kurz <akurz@blala.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* scripts: imx-usb-loader: structured DCD v1 element accessAlexander Kurz2016-08-221-8/+11
| | | | | | | DCD v1 elements are encoded little endian. Signed-off-by: Alexander Kurz <akurz@blala.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* scripts: imx-usb-loader: enable DCD 16-bit write for hdr v1Alexander Kurz2016-08-221-7/+2
| | | | | | | Do some cleanup which enables DCDv1 16 bit write access as side effect. Signed-off-by: Alexander Kurz <akurz@blala.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* scripts: imx-usb-loader: do DCD only once, cleanupAlexander Kurz2016-08-221-9/+6
| | | | | | | | | Only the first encountered DCD block should be processed, optional DCD processing may be switched off by command option. Clean up the corresponding logic. Signed-off-by: Alexander Kurz <akurz@blala.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* scripts: imx-usb-loader: split off topic-code into functionsAlexander Kurz2016-07-181-67/+92
| | | | | | | | | Improve code understandability: extract the "jump application" Serial Download Protocol access method and file-to-buffer reader functionality out of do_irom_download(). Signed-off-by: Alexander Kurz <akurz@blala.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* scripts: imx-usb-loader: structured protocol accessAlexander Kurz2016-07-181-67/+65
| | | | | | | | Do some cleanup and access the elements of Serial Download Protocol messages in endianess-portable manner using proper typed struct members. Signed-off-by: Alexander Kurz <akurz@blala.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* scripts: imx-usb-loader: remove useless variableAlexander Kurz2016-07-181-3/+1
| | | | | | | Remove a variable raising complexity for no reason. Signed-off-by: Alexander Kurz <akurz@blala.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* scripts: imx-usb-loader: remove useless codeAlexander Kurz2016-07-181-46/+3
| | | | | | | | | The configuration interface for struct usb_work is not implemented here leaving the options set on fixed settings or even uninitialized. Do some cleanup and remove those half-cooked dead code passages. Signed-off-by: Alexander Kurz <akurz@blala.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* scripts: imx-usb-loader: const function argsAlexander Kurz2016-07-181-12/+17
| | | | | Signed-off-by: Alexander Kurz <akurz@blala.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* scripts: imx: const function argumentsAlexander Kurz2016-07-181-2/+2
| | | | | Signed-off-by: Alexander Kurz <akurz@blala.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* scripts: imx-usb-loader: support set_bits/clear_bitsSascha Hauer2016-04-281-6/+39
| | | | | | | Now that we can use set_bits/clear_bits in the DCD tables, add support for this in the imx-usb-loader aswell. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* scripts: imx-usb-loader: make debug output more usefulSascha Hauer2016-04-281-3/+4
| | | | | | | | - print write_memory message only in verbose mode, but in all cases when memory is written - print more information about the DCD section just executed Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* scripts: imx: support set_bits/clear_bitsSascha Hauer2016-04-281-1/+2
| | | | | | | The i.MX SoCs support setting bits and clearing bits in their DCD table. This adds commands for these in the imx-image tool. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* 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>
* 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-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: Consolidate flash headers in imx toolsSascha Hauer2016-02-021-60/+29
| | | | | | | | 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-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: imx: Use Kernel includesSascha Hauer2016-02-021-5/+1
| | | | | | Use the common definition of ARRAY_SIZE and offsetof. 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>
* imx-usb-loader: Add i.MX6sx supportSascha Hauer2014-11-271-0/+7
| | | | | | Not much to do here, only add the Product ID. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* imx-usb-loader: Skip unknown tagsSascha Hauer2014-09-191-2/+4
| | | | | | | | | | Instead of bailing out skip unknown tags. These tags are usually doing operations to poll for a certain register state. The correct solution is to implement this register polling, but for now delay execution for a while and assume the register has the correct state afterwards. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* scripts: imx-usb-loader: Fix memory leakAlexander Shiyan2014-01-291-1/+4
| | | | | Signed-off-by: Alexander Shiyan <shc_work@mail.ru> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/misc'Sascha Hauer2013-12-061-4/+4
|\ | | | | | | | | Conflicts: scripts/Makefile
| * imx-usb-loader: Fix signed/unsigned arguments for printfAlexander Shiyan2013-11-111-4/+4
| | | | | | | | | | | | | | | | "%i" in format string requires a signed integer. "%d" in format string requires a signed integer. Signed-off-by: Alexander Shiyan <shc_work@mail.ru> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | scripts: imx-image: Add i.MX25 supportSascha Hauer2013-11-271-0/+7
|/ | | | | | | The i.MX25 works like the i.MX51, just add the SoC magic and the USB product id. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* imx-usb-loader: Add i.MX6 Solo/DualLite supportSascha Hauer2013-06-251-1/+8
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* scripts: Add imx-usb-loader toolSascha Hauer2013-05-311-0/+1427
This adds host tools for i.MX to generate the i.MX internal flash header format and a tool to upload these images to an i.MX SoC via USB. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>