2016-04-19 |
filetype: Fix booting ARM Linux Kernels with CONFIG_EFI enabled
...
When an ARM kernel is built with CONFIG_EFI enabled, then the
kernel image also looks like a EXE file. Move ARM zImage detection
before EXE detection so that the kernel is still detected as zImage.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 19 Apr 2016
|
fix erasing/protecting flashes with unspecified size
...
fixes: 81737c1 mtd: Fix erasing of devices >4GiB
Several places erased a complete flash partition passing ~0 as count to
erase(). With the above commit count to erase was changed from an unsigned
type to a signed type, so the (count > f->size - offset) check in
erase() no longer triggers and the ~0 count is no longer adjusted to the whole
device size. Among other things this results in saveenv failures on NOR
flashes.
This patch fixes this by introducing an explicit macro for erasing the
whole device which is tested for in erase(). All other negative values
are rejected.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Reported-by: Giorgio <giorgio.nicole@arcor.de>
Sascha Hauer
committed
on 19 Apr 2016
|
2016-04-08 |
Merge branch 'for-next/imx-bbu-nand-fcb'
Sascha Hauer
committed
on 8 Apr 2016
|
Merge branch 'for-next/imx'
Sascha Hauer
committed
on 8 Apr 2016
|
imx-bbu-nand-fcb: Print error message when out of pebs
...
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 8 Apr 2016
|
imx-bbu-nand-fcb: Make robust against power cuts
...
This patch makes the update to Nand robust against power
failures. With this we make sure that during every step of the
update at least one of the two images on Nand is readable and
valid.
Also this patch makes it possible to refresh/repair the boot
images on Nand. This may become necessary when a previous update
has been interrupted due to a power cut, or when the number of
bitflips is near to the number we can correct. This is also done
in a way that allow power cuts at every step.
We assume the following layout in the Nand flash:
fwmaxsize = (n_blocks - 4) / 2
block
0 ----------------------
| FCB/DBBT 0 |
1 ----------------------
| FCB/DBBT 1 |
2 ----------------------
| FCB/DBBT 2 |
3 ----------------------
| FCB/DBBT 3 |
4 ----------------------
| Firmware slot 0 |
4 + fwmaxsize ----------------------
| Firmware slot 1 |
----------------------
When the layout found on the device differs from the above the update
won't be robust, but nevertheless works. Since the layout is changed
to the above during the update, the next update will be robust.
Here's the strategy we use to implement a robust update:
The FCBs contain pointers to the firmware slots in the
Firmware1_startingPage and Firmware2_startingPage fields. Note that
Firmware1_startingPage doesn't necessarily point to slot 0. We
exchange the pointers during update to atomically switch between the
old and the new firmware.
- We read the first valid FCB and the firmware slots.
- We check which firmware slot is currently used by the ROM:
- if no FCB is found or its layout differs from the above layout,
continue without robust update
- if only one firmware slot is readable, the ROM uses it
- if both slots are readable, the ROM will use slot 0
- Step 1: erase/update the slot currently unused by the ROM
- Step 2: Update FCBs/DBBTs, thereby letting Firmware1_startingPage
point to the slot we just updated. From this moment
on the new firmware will be used and running a
refresh/repair after a power failure after this
step will complete the update.
- Step 3: erase/update the other firmwre slot
- Step 4: Eventually write FCBs/DBBTs again. This may become
necessary when step 3 revealed new bad blocks.
Refreshing the firmware which is needed when when blocks
become unreadable due to read disturbance works the same way,
only that the new firmware is the same as the old firmware
and that it will only be written when reading from the device
returns -EUCLEAN indicating that a block needs to be
rewritten.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 8 Apr 2016
|
imx-bbu-nand-fcb: Print error when writing blocks fails
...
When writing to a block fails the update handler fails relatively
silent. Print an error message in this case.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 8 Apr 2016
|
imx-bbu-nand-fcb: When writing firmware return new bad blocks
...
Positive return values of imx_bbu_write_firmware() so far indicate
the last block that has been written to. This value is unused, so
return values > 0 to indicate if there are new bad blocks. This
information can be used in the next step to know if the DBBT has
to be rewritten.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 8 Apr 2016
|
imx-bbu-nand-fcb: Only write FCBs/DBBTs when necessary
...
Instead of writing the FCBs/DBBTs on every update write them
only if they have changed or if a block needs cleanup (returns
-EUCLEAN)
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 8 Apr 2016
|
imx-bbu-nand-fcb: erase on demand
...
Instead of erasing the whole partition on update entry, erase the areas
separately when we actually want to write them. This is done as a step
towards robust update.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 8 Apr 2016
|
imx-bbu-nand-fcb: factor out a fcb write function
...
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 8 Apr 2016
|
imx-bbu-nand-fcb: Use mtd-peb API to write firmware
...
With this patch we verify the firmware written to the NAND and thus
can react on write failures. We torture the block and if it went
bad we mark it as bad.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 8 Apr 2016
|
imx-bbu-nand-fcb: factor out layout functions
...
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 8 Apr 2016
|
bbu: Allow to refresh/repair images
...
Some SoCs allow to store multiple boot images on a device in order to
improve robustness. This adds a -r option to barebox_update to indicate
we do not want to make an update but instead repair/refresh an existing
image. Handlers which want to support this feature must set the
BBU_HANDLER_CAN_REFRESH flag during registration.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 8 Apr 2016
|
2016-04-07 |
common: add dependency !SANDBOX on imd target tool
...
The build of bareboximd-target tool fails on sandbox architecture:
CC scripts/bareboximd-target
/tmp/ccoGPulo.o: In function `imd_concat_strings':
scripts/../common/imd.c:216: undefined reference to `barebox_malloc'
/tmp/ccoGPulo.o: In function `read_file_2':
scripts/bareboximd.c:68: undefined reference to `barebox_open'
scripts/bareboximd.c:74: undefined reference to `barebox_lseek'
scripts/bareboximd.c:84: undefined reference to `barebox_lseek'
scripts/bareboximd.c:90: undefined reference to `barebox_malloc'
scripts/bareboximd.c:99: undefined reference to `barebox_read'
scripts/bareboximd.c:119: undefined reference to `barebox_free'
scripts/bareboximd.c:121: undefined reference to `barebox_close'
/tmp/ccoGPulo.o: In function `imd_command':
scripts/../common/imd.c:292: undefined reference to `barebox_printf'
scripts/../common/imd.c:319: undefined reference to `barebox_printf'
scripts/../common/imd.c:322: undefined reference to `barebox_free'
scripts/../common/imd.c:324: undefined reference to `barebox_printf'
/tmp/ccoGPulo.o: In function `usage':
scripts/bareboximd.c:134: undefined reference to `barebox_printf'
collect2: error: ld returned 1 exit status
scripts/Makefile:58: recipe for target 'scripts/bareboximd-target' failed
See also
commit d4aa015
Author: Alexander Aring <alex.aring@gmail.com>
Date: Tue Nov 19 02:08:13 2013 +0100
common: add dependency !SANDBOX on target tools
The build of target tools fails on sandbox architecture.
We don't need any target tools in this case, so add a dependency.
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Cc: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Antony Pavlov
authored
on 7 Apr 2016
Sascha Hauer
committed
on 7 Apr 2016
|
2016-04-06 |
bbu: print and evaluate image Metadata
...
With imd we can store metadata in barebox images. Let's use this
information to further verify that the image that is to be flashed
is the correct one. This patch extracts the device tree compatible
from the image and compares it with the one from the currently
running barebox. If it doesn't match the update is aborted with a
warning.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 6 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
|
2016-03-17 |
common: Add EPROBE_DEFER to strerror
...
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Andrey Smirnov
authored
on 15 Mar 2016
Sascha Hauer
committed
on 17 Mar 2016
|
2016-03-11 |
Merge branch 'for-next/mtd'
Sascha Hauer
committed
on 11 Mar 2016
|
Merge branch 'for-next/misc'
Sascha Hauer
committed
on 11 Mar 2016
|
Merge branch 'for-next/doc'
Sascha Hauer
committed
on 11 Mar 2016
|
Merge branch 'for-next/bbu'
Sascha Hauer
committed
on 11 Mar 2016
|
fastboot: Add a ARM Barebox filetype handler
...
This will automatically call barebox_update for the transfered file if
it is an ARM Barebox image and the destination file is defined by some
update handler.
Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Markus Pargmann
authored
on 17 Feb 2016
Sascha Hauer
committed
on 11 Mar 2016
|
2016-03-04 |
imx-bbu-nand-fcb: Remove double write of first fcb
...
The first FCB page was written twice. One time is enough, drop the
second write.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 4 Mar 2016
|
imx-bbu-nand-fcb: optimize check for bad block loop
...
The argument passed to dbbt_data_create() contains the number of blocks,
not the last block. This means we can exit the loop with '<' instead of
'<='
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 4 Mar 2016
|
ratp: use proper defines for BAREBOX_CMD
...
Signed-off-by: Lucas Stach <dev@lynxeye.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Lucas Stach
authored
on 2 Mar 2016
Sascha Hauer
committed
on 4 Mar 2016
|