9
0
Fork 0
Commit Graph

21 Commits

Author SHA1 Message Date
Marc Kleine-Budde b6c786528b imx-image: add option to prepare image for HAB signing
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-04-15 07:12:17 +02:00
Marc Kleine-Budde 7cb4778e7f imx-image: pad generated image to 4k
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-04-03 15:45:26 +02:00
Marc Kleine-Budde 4a50ffc746 imx-image: main: make use of round_up instead of open coding it
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-04-03 15:45:26 +02:00
Marc Kleine-Budde 5e5ced6073 imx-image: mx35: increase load image size, due to dobule header
Since commit:

    690e392027 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>
2015-04-03 15:45:26 +02:00
Marc Kleine-Budde 8acb4e65ce imx-image: introduce HEADER_LEN and replace several 0x1000 and 4096
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-04-03 15:45:26 +02:00
Marc Kleine-Budde 15034f8fa8 imx-image: replace 0x400 by FLASH_HEADER_OFFSET
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-04-03 15:45:26 +02:00
Marc Kleine-Budde 01e879bcdf imx-image: add_header_v2(): replace hardcoded 0x400 by offset parameter
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-04-03 15:45:26 +02:00
Sascha Hauer ee2a559afd imx-usb-loader: Add i.MX6sx support
Not much to do here, only add the Product ID.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-11-27 11:25:23 +01:00
Eric Bénard 690e392027 imx-image: handle i.MX35 special case
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>
2014-09-25 08:13:24 +02:00
Sascha Hauer 072a7964a3 imx-image: Handle check commands correctly
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>
2014-09-19 07:44:37 +02:00
Sascha Hauer f83a3e39f5 imx-usb-loader: Skip unknown tags
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>
2014-09-19 07:44:37 +02:00
Lucas Stach 75359aaafc scripts: imx-image: add input validation to mw
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>
2014-09-01 14:24:51 +02:00
Lucas Stach 4d5ad7c9c6 imx-image: don't leak file handle
Signed-off-by: Lucas Stach <dev@lynxeye.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-04-23 09:05:52 +02:00
Alexander Shiyan 9ef62b72ef scripts: imx-usb-loader: Fix memory leak
Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-01-29 21:38:10 +01:00
Sascha Hauer e9ea6eeaab Merge branch 'for-next/misc'
Conflicts:
	scripts/Makefile
2013-12-06 08:23:24 +01:00
Sascha Hauer b4184e34bf scripts: imx-image: Add i.MX25 support
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>
2013-11-27 13:55:41 +01:00
Alexander Shiyan a84fbbe655 imx-usb-loader: Fix signed/unsigned arguments for printf
"%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>
2013-11-11 08:52:05 +01:00
Sascha Hauer d3924e4fe5 imx-image: Align image size
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>
2013-08-15 14:53:17 +02:00
Sascha Hauer cf7c8f37d6 scripts: imx-image: allow semicolon as command delimiter
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>
2013-07-22 16:17:01 +02:00
Sascha Hauer 61373caa29 imx-usb-loader: Add i.MX6 Solo/DualLite support
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-06-25 16:01:39 +02:00
Sascha Hauer 134a788ac5 scripts: Add imx-usb-loader tool
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>
2013-05-31 08:31:41 +02:00