summaryrefslogtreecommitdiffstats
path: root/scripts/imx
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* imx-image: Correctly fill image size in prepended headerAndrey Smirnov2015-05-072-1/+12
| | | | | | | | | If called with '-b' option 'imx-image' tool prepends barebox header to the image, but the tool does not fill the data at image size offset correctly. Fix that. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* imx-image: add option to prepare image for HAB signingMarc Kleine-Budde2015-04-151-1/+12
| | | | | Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* imx-image: pad generated image to 4kMarc Kleine-Budde2015-04-031-1/+14
| | | | | Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* imx-image: main: make use of round_up instead of open coding itMarc Kleine-Budde2015-04-031-1/+2
| | | | | Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* imx-image: mx35: increase load image size, due to dobule headerMarc Kleine-Budde2015-04-031-0/+3
| | | | | | | | | | | | | Since commit: 690e39202747 imx-image: handle i.MX35 special case the IVT+DCD header is placed both at 0x0 and 0x1000, this patch reflects this change and increases the load image size accordingly. Cc: Eric Bénard <eric@eukrea.com> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* imx-image: introduce HEADER_LEN and replace several 0x1000 and 4096Marc Kleine-Budde2015-04-031-6/+7
| | | | | Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* imx-image: replace 0x400 by FLASH_HEADER_OFFSETMarc Kleine-Budde2015-04-031-2/+3
| | | | | Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* imx-image: add_header_v2(): replace hardcoded 0x400 by offset parameterMarc Kleine-Budde2015-04-031-3/+3
| | | | | Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> 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-image: handle i.MX35 special caseEric Bénard2014-09-251-5/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | From the i.MX35 user manual : Since MLC NAND Flash devices do not guarantee error-free boot blocks, the i.MX35 boot code requires that the first 4 Kbytes of boot code be duplicated in a subsequent block to serve as a second copy option. Actually imx-image puts the image at 4k but it seems that the i.MX35 bootrom copies only from 8k as it expects that there is a copy of the first 0-4k in 4k-8k (and is supposed to use this copy if there is an ECC error in the first 4k) as we can see in the following lines : barebox@Eukrea CPUIMX35:/ md -s /dev/nand0 0x0 00000000: ea0003fe eafffffe eafffffe eafffffe ................ 00000010: eafffffe eafffffe eafffffe eafffffe ................ 00000020: 65726162 00786f62 00000000 00000000 barebox......... =-> header is @ 0 in flash barebox@Eukrea CPUIMX35:/ md -s /dev/nand0 0x1000 00001000: 56341200 00000000 0001eda1 00000000 ..4V............ 00001010: 00000000 00000000 00000000 00000000 ................ =-> so we have data @ 0x1000 in flash barebox@Eukrea CPUIMX35:/ md 0x87f00000 87f00000: 00000000 00000000 00000000 00000000 ................ 87f00010: 00000000 00000000 00000000 00000000 ................ =-> but we don't find this data in RAM barebox@Eukrea CPUIMX35:/ md -s /dev/nand0 0x2000 00002000: ea000012 eafffffe eafffffe eafffffe ................ 00002010: eafffffe eafffffe eafffffe eafffffe ................ 00002020: 65726162 00786f62 00000000 00034272 barebox.....rB.. =-> so we have the image @ 0x2000 in flash barebox@Eukrea CPUIMX35:/ md 0x87f01000 87f01000: ea000871 eafffffe eafffffe eafffffe q............... 87f01010: eafffffe eafffffe eafffffe eafffffe ................ 87f01020: 65726162 00786f62 87f02000 0003b520 barebox.. .. ... =-> and we find it in RAM Signed-off-by: Eric Bénard <eric@eukrea.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* imx-image: Handle check commands correctlySascha Hauer2014-09-191-21/+15
| | | | | | | | The length of two subsequent check commands was incorrectly calculated. The check commands have a fixed length anyway, so program a fixed length in the check command and skip the code from check_last_dcd. 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-image: add input validation to mwLucas Stach2014-09-011-3/+18
| | | | | | | | | | Stop and print a helpful message if we encounter an illegal token while parsing the DCD config, instead of silently swallowing the error and pushing random stuff into the DCD. Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* imx-image: don't leak file handleLucas Stach2014-04-231-4/+6
| | | | | Signed-off-by: Lucas Stach <dev@lynxeye.de> 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-272-0/+8
|/ | | | | | | 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-image: Align image sizeSascha Hauer2013-08-151-3/+13
| | | | | | | Several boot modes on i.MX can't cope with partial pages or non word aligned image lengths, so align the size to 4k. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* scripts: imx-image: allow semicolon as command delimiterSascha Hauer2013-07-221-5/+34
| | | | | | | | | When we want to pass the imxcfg files through cpp we also want to allow defines which define multiple commands. For this to work we have to use an additional command delimiter as we can't pass '\n' though cpp. Use ';' for this. 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-315-0/+2272
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>