9
0
Fork 0
Commit Graph

431 Commits

Author SHA1 Message Date
Sascha Hauer 6134116686 Merge branch 'for-next/mvebu' 2017-03-13 08:16:44 +01:00
Sascha Hauer 4e11672653 Merge branch 'for-next/imx' 2017-03-13 08:16:44 +01:00
Oleksij Rempel 3ca576cc4a scripts: imx/mxs remove mxs-usb-loader
... and use imx-usb-loader instead

Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2017-03-09 07:57:52 +01:00
Oleksij Rempel 701f728c2a scripts: imx imx-usb-loader: add support for imx23 and imx28
This code was rewrtitten from mxs-usb-loader.

Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2017-03-09 07:41:22 +01:00
Oleksij Rempel ef55d12d59 scripts: imx imx-usb-loader: warn if device was excluded by path option
notify user about the reason why device was ignored by imx-usb-loader.

Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2017-03-06 08:13:03 +01:00
Oleksij Rempel 65c50e5859 scripts: imx imx-usb-loader: add usb path support
In some cases we need to work with more than one device attached
to one host. For this situation we need path filter to make sure
we talk with proper device.

Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2017-03-03 07:24:07 +01:00
Sascha Hauer e2805b5ee5 scripts: mxsimage: Fix build with OpenSSL < 1.1.x
Move the compatibility wrapper functions up so that they
are defined before they are used.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2017-03-02 13:54:49 +01:00
Alexander Kurz f0a2d7f036 scripts: imx-usb-loader: implement DCD v2 check command
The DCD v2 check command supported by i.MX53 and later SoC polls a given
memory location as long as a given condition is true.
Enable imx-usb-loader to perform this check. When the timeout is hit,
imx-usb-loader returns an error. For practical reasons the timeout
computation will differ from the native implementation, since performing
check commands via USB will be much slower compared to native processing.

Signed-off-by: Alexander Kurz <akurz@blala.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2017-02-22 09:18:30 +01:00
Uwe Kleine-König 9de72c2e4f scripts/kwboot: new parameter -n to skip a number of NAKs
On some machines the CPU resets twice and so kwboot must hit the second
window to enter debug or boot mode. For this scenario it helps to ignore
a number of NAKs. If you choose a number too high for booting, the process
is only slowed down because when the CPU enters UART boot mode it sends NAKs
when not getting any input.

This new option also helps when there are voltage fluctuations due to the
power up sequence which might be interpreted as valid chars.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2017-02-14 08:47:37 +01:00
Uwe Kleine-König 67fafb1230 scripts: kwboot: fix image check for padded images
When there is some padding between header and payload the claim

	header_size + image_size == file_size

fails. Relax the check accordingly to:

	header_size <= image_offset &&
	image_offset + image_size == file_size

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2017-02-14 08:47:37 +01:00
Sascha Hauer 30139163b7 Merge branch 'for-next/imx' 2017-02-13 09:26:04 +01:00
Sascha Hauer a9ba8a1d0d Merge branch 'for-next/arm' 2017-02-13 09:26:03 +01:00
Juergen Borleis ea55770308 ARM: i.MX: Add i.MX7 base architecture support
Signed-off-by Juergen Borleis <jbe@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2017-01-20 09:10:30 +01:00
Juergen Borleis 14ff9d5823 imx-usb-loader: add i.MX7S support
Signed-off-by: Juergen Borleis <jbe@pengutronix.de>
2017-01-19 15:15:14 +01:00
Juergen Borleis cacc393c1e imx-usb-loader: this table is used internally only, so keep it static
Signed-off-by: Juergen Borleis <jbe@pengutronix.de>
2017-01-19 15:15:08 +01:00
Juergen Borleis 8bb4fcd5d9 imx-usb-loader: let constant data be const
Signed-off-by: Juergen Borleis <jbe@pengutronix.de>
2017-01-19 15:15:03 +01:00
Geyslan G. Bem 731909c0b4 checkpatch: fix another left brace warning
This patch escapes a regex that uses left brace.

Using checkpatch.pl with Perl 5.22.0 generates the warning: "Unescaped
left brace in regex is deprecated, passed through in regex;"

Comment from regcomp.c in Perl source: "Currently we don't warn when the
lbrace is at the start of a construct.  This catches it in the middle of
a literal string, or when it's the first thing after something like
"\b"."

This works as a complement to 4e5d56bd ("checkpatch: fix left brace
warning").

Signed-off-by: Geyslan G. Bem <geyslan@gmail.com>
Signed-off-by: Joe Perches <joe@perches.com>
Suggested-by: Peter Senna Tschudin <peter.senna@gmail.com>
Cc: Eddie Kovsky <ewk@edkovsky.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2017-01-18 08:45:02 +01:00
Vicente Bergas 2e372b80ad scripts/omap4_usbboot: use libusb
Signed-off-by: Vicente Bergas <vicencb@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2017-01-13 07:56:44 +01:00
Sascha Hauer 917225203f Merge branch 'for-next/mvebu' 2017-01-11 19:00:04 +01:00
Uwe Kleine-König fed8acd6c0 scripts/kwbimage: allow to overwrite binary
This is a preparation to let barebox provide the binary.0.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2017-01-10 08:27:53 +01:00
Uwe Kleine-König d0cd9b439b scripts/kwbimage: use ALIGN_SUP instead of open-coding it
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2017-01-10 08:27:53 +01:00
Uwe Kleine-König c9583d9852 scripts/kwbimage: fix typo
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2017-01-10 08:27:53 +01:00
Uwe Kleine-König dcc7d82141 scripts/kwbimage: fix handling of binary header
A binary header is 12 bytes + (4 bytes * Number of Arguments) bigger
than the actual binary. Before this commit image extraction was wrong an
made binary.0 too big by four bytes at the end (which were 0 in all usual
cases). Image creation had the same problem which resulted in broken
images when the binary doesn't end in 4 bytes containing 0.

Further handle binaries with a length that is not aligned to 4 bytes.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2017-01-10 08:27:53 +01:00
Alexander Kurz 65fa5bc56d scripts: imx imx-usb-loader: add i.MX6SL support
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>
2017-01-10 08:27:23 +01:00
Alexander Kurz 05d48a72a9 scripts: imx imx-usb-loader: sort USB id list
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>
2017-01-10 08:27:23 +01:00
Sascha Hauer 2079d38666 scripts: mxsimage: Fix build with OpenSSL 1.1.x
The EVP_MD_CTX and EVP_CIPHER_CTX are made opaque since 1.1.x , so instead
of embedding them directly into struct sb_image_ctx and initializing them
using EVP_*_CTX_init(), we use pointers and allocate the crypto contexts
using EVP_*_CTX_new().

This is an adoption of the U-Boot commit 7bae13b7579a6b from Marek Vasut

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2017-01-09 13:41:12 +01:00
Sascha Hauer 8eb1fb3519 Merge branch 'for-next/vybrid' 2016-11-14 12:37:20 +01:00
Sascha Hauer f772aa92c2 Merge branch 'for-next/misc' 2016-11-14 12:35:49 +01:00
Andrey Smirnov d72301826e i.MX: scripts: Add "vf610" soc to imx-image
Needed in order to support Vybrid SoCs.

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-11-11 08:57:25 +01:00
Alexander Kurz c3223f98c0 scripts imx-image: add DCD NOP command support
The DCD NOP command is available for all flash header v2 devices (i.MX28,
50, 53, 6 and 7).

Signed-off-by: Alexander Kurz <akurz@blala.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-11-07 08:55:15 +01:00
Sascha Hauer 02ede48e67 gen-dtb-s: Put compressed dtb in different section
For builtin dtbs all compiled dtbs matching section .dtb.rodata.*
are collected in a single section. Since every dtb is compiled as
uncompressed and also as compressed binary each dtb ends up twice
in the section. Let's put the compressed variants in .dtbz.rodata.*
sections rather than .dtb.rodata.*.z so they end up in the binary
only once.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Tested-by: Daniel Krüger <daniel.krueger@systec-electronic.com>
2016-10-24 07:50:18 +02:00
Sascha Hauer 64b164356a Merge branch 'for-next/mvebu' 2016-10-10 08:31:08 +02:00
Uwe Kleine-König 481274a935 scripts: kwboot: set boot source to UART before sending
Sending an image that specifies one of the alternative boot sources doesn't
make sense. So change the boot source to UART on the fly.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-10-04 21:14:20 +02:00
Uwe Kleine-König 90184dbc36 scripts: kwboot: simplify kwboot_mmap_image
There was only a single caller who passes prot=PROT_READ unconditionally.
So drop this parameter and simplify accordingly.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-10-04 21:14:19 +02:00
Uwe Kleine-König ebec445092 scripts: kwboot: shorten delay between two boot messages
Together with the previous changes that allow to handle the scenario where
too many messages were sent, this greatly improves the probability to hit
the time window during which the CPU accepts a boot message.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-10-04 21:14:19 +02:00
Uwe Kleine-König 1a64dd3854 scripts: kwboot: improve diagnostic output
After entering uart boot mode the CPU prints some diagnostic messages.
Showing them to the user helps her to notice when the message window was
missed or there is an other problem.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-10-04 21:14:19 +02:00
Uwe Kleine-König 446ff0216e scripts: kwboot: flush input and output only once
When flushing input before sending of a boot message the acknowledging
reply for the previous message from the CPU might be discarded and so
missed.

So only flush once before sending boot messages in a loop.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-10-04 21:14:19 +02:00
Uwe Kleine-König 331391d686 scripts: kwboot: try to resync on packet boundary after receiving a NAK
If we sent the boot message too often the CPU might already have started
to interpret this as an xmodem packet. As sender and receiver are not in
sync it's impossible to transfer a packet successfully.

So when we get a NAK send '\xff' bytes until the receiver reaches the
packet boundary. When we send too many the SoC replies with a NAK for
each byte and doesn't interpret it as the start of a new package (which
must start with SOH == '\x01').

A slower alternative would be to wait for another NAK which is sent when
reception of the already started packet times out.

This was tested on an Armada XP based machine with bootrom version 1.20.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-10-04 21:13:54 +02:00
Sascha Hauer 5e61dd3fb5 Add comp_copy function for use with CONFIG_IMAGE_COMPRESSION_NONE
The Makefile compression commands all append the size of the
uncompressed image. With CONFIG_IMAGE_COMPRESSION_NONE simply
'shipped' is used which does not append the size. Add and use
a special comp_copy function which adds the size. This helps
us to get the uncompressed image size in the startup code later.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-09-15 09:23:43 +02:00
Sascha Hauer 074a8fdc92 Merge branch 'for-next/socfpga' 2016-09-13 14:56:06 +02:00
Sascha Hauer b2c398f440 Merge branch 'for-next/imx' 2016-09-13 14:56:04 +02:00
Alexander Kurz 2f9ff8a8f7 scripts: imx: add support for i.MX50
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>
2016-09-12 08:23:09 +02:00
Andrey Smirnov f7a2e37fcd i.MX: scripts: Fix a bug in imx-image
In order to clear a bitmask, "Set" bit has to be '0' and "Mask" bit
'1'. Since "Set" is bit 4 and "Mask" is bit 3 this leaves us with a
overal or-mask of 1 << 3. Orginal code was doing the inverse and setting
bit #4 to '1' bit #3 to '0'.

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-09-05 08:43:29 +02:00
Alexander Kurz c973b3adbf scripts: imx-usb-loader: cleanup DCD v2 processing
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>
2016-09-05 08:37:32 +02:00
Alexander Kurz 4bbfe971bb scripts: imx-usb-loader: structured DCD v1 element access
DCD v1 elements are encoded little endian.

Signed-off-by: Alexander Kurz <akurz@blala.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-08-22 08:02:04 +02:00
Alexander Kurz fdb7f089e5 scripts: imx-usb-loader: enable DCD 16-bit write for hdr v1
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>
2016-08-22 08:01:35 +02:00
Alexander Kurz 2af7f2b26b scripts: imx-image: DCD check command for v2 only
DCD check command is currently implemented for imximg v2 only.
This command may also be available for v1 as mentioned in IMX35RM as
DCD-address-type "wait/read", but due to the lack of further details
it will be not supported.

Signed-off-by: Alexander Kurz <akurz@blala.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-08-22 07:59:31 +02:00
Alexander Kurz a6e1dbebd1 scripts: imx-usb-loader: do DCD only once, cleanup
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>
2016-08-22 07:51:05 +02:00
Trent Piepho 994fa02f5d socfpga: Add support for V1 images to socfpga_mkimage
Altera's SocFPGA Arria10 SoC uses a new image format, different from
the one used on CycloneV.  The formats are similar, with the header
matching up to the point where the version field is 1 instead of 0.
At that point the header fields diverge.  The CRC and checksum use is
the same between the two.

This patch extends socfpga_mkimage to support generating the new
format with a version command line option.  The default will be V0 for
CycloneV.

The new format is, IMHO, not as good as the previous one.  It requires
the start location be after the header, while the V0 format would
allow the start location to be before or after.  Barebox boot images
are designed to start from offset 0, which is before the header.  To
avoid modifying the common barebox start code specifically for
Arria10, I instead add a trampoline instruction after the V1 header to
jump to the real start location, wherever it might be.

Signed-off-by: Trent Piepho <tpiepho@kymetacorp.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-08-18 08:22:16 +02:00
Steffen Trumtrar eabab33283 scripts: socfpga_get_sequencer: convert potential CRLF to LF
If u-boot was generated under a DOS system, the sequencer files will have CRLF
linebreaks. The indent-tool has problems with this and as a result the code
will not compile anymore.
Fix up any CRLFs prior with the dos2unix tool.

Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-08-18 08:18:32 +02:00