2016-05-23 |
imd: make it work on big-endian machines
...
The commit
commit 5e33577
Author: Sascha Hauer <s.hauer@pengutronix.de>
Date: Tue Mar 29 10:06:46 2016 +0200
imd: use struct imd_header * as argument
introduces additional imd type checks like this
if (!imd_is_string(imd->type))
return NULL;
These checks work incorrectly on any big-endian machine
because the imd->type field needs addition conversion
to little-endian byteorder before use.
Here is the imd command output on big-endian qemu-malta:
barebox:/ imd /dev/nor0.barebox
release: <NULL>
build: <NULL>
This patch fixes the problem by adding necessary conversion
via imd_read_type().
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Antony Pavlov
authored
on 20 May 2016
Sascha Hauer
committed
on 23 May 2016
|
2016-04-15 |
stdio: replace fprintf(stderr,...) with eprintf
...
We have a shortcut for fprintf(stderr, so use it. This is done to
be able to remove fprintf in the next step.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 15 Apr 2016
|
2016-04-01 |
imd: Add function to read parameters
...
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 1 Apr 2016
|
imd: export functions
...
To make the image metadata API usable for external users export
some functions.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 1 Apr 2016
|
imd: rename imd_search_validate to imd_get
...
The name is more suitable for what the function does. Also let the
function return a pointer to the imd data found in the buffer.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 1 Apr 2016
|
imd: string returned from imd_string_data should be const
...
imd_string_data() returns the original data, so the string should be
const.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 1 Apr 2016
|
2016-03-29 |
imd: use struct imd_header * as argument
...
imd_concat_strings() and imd_string_data() are easier to handle when
they take a struct imd_header * instead of a struct imd_entry_string *.
Change this.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 29 Mar 2016
|
2015-02-12 |
imd: provide dummy imd_command_setenv
...
If CONFIG_CMD_IMD is not set there is no imd_command_setenv in the
barebox binary that can be linked to. Although the whole imd infrastructure
will be removed by the linker later in the build process as soon as it
figures out that nothing inside barebox is using it, we still have to
provide a dummy function to keep the build going.
Fixes:
In function `imd_command': undefined reference to `imd_command_setenv'
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Lucas Stach
authored
on 17 Dec 2014
Sascha Hauer
committed
on 12 Feb 2015
|
2014-08-07 |
Add support for metadata in barebox images
...
It's often useful to get some information about a barebox image
before starting or flashing it. This patch introduces barebox
Image MetaData (IMD). When enabled a barebox image will contain
a list of tags containing the desired information. We have tags
for:
- the barebox release (2014.07.0-00160-g035de50-dirty)
- the build timestamp (#741 Mon Jul 28 15:08:54 CEST 2014)
- the board model the image is intended for
- the device tree toplevel compatible property
Also there is an additional generic key-value store which stores
parameters for which no dedicated tag exists. In this patch it
is used for the memory size an image supports.
Since there is no fixed offset in a barebox image which can be
used for storing the information, the metadata is stored somewhere
in the image and found by iterating over the image. This works
for most image types, but obviously not for SoC images which are
encoded or encrypted in some way.
There is a 'imd' tool compiled from the same sources for barebox,
for the compile host and for the target, so the metadata information
is available whereever needed.
For device tree boards the model and of_compatible tags are automatically
generated.
Example output of the imd tool for a Phytec phyFLEX image:
build: #889 Wed Jul 30 16:08:54 CEST 2014
release: 2014.07.0-00167-g6b2070d-dirty
parameter: memsize=1024
of_compatible: phytec,imx6x-pbab01 phytec,imx6dl-pfla02 fsl,imx6dl
model: Phytec phyFLEX-i.MX6 Duallite Carrier-Board
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 7 Aug 2014
|