2016-04-08 |
Merge branch 'for-next/rtc'
Sascha Hauer
committed
on 8 Apr 2016
|
Merge branch 'for-next/mtd-imx-nand'
Sascha Hauer
committed
on 8 Apr 2016
|
Merge branch 'for-next/misc'
Sascha Hauer
committed
on 8 Apr 2016
|
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
|
Merge branch 'for-next/imd'
Sascha Hauer
committed
on 8 Apr 2016
|
Merge branch 'for-next/arm'
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
|
mtd: nand: export nand_check_erased_buf
...
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
|
Release v2016.04.0
...
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 8 Apr 2016
|
defaultenv-2: add automount for nfs
...
Automatically mount the path that is also used for net booting by
default to /mnt/nfs.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Uwe Kleine-König
authored
on 23 Mar 2016
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
|
efi: let the generic relocate code handle all relocations
...
Part of the barebox code and variables are put in separate sections
(.barebox* and .initcall*). When this code is compiled as position
independent code then the compiler creates corresponding .rela.barebox* and
.rela.initcall* sections with the relocation table entries.
These sections don't match the .rela.data* wildcard in the linker script.
As a result, they are not added to the .rela section during linking but are
added individually after it instead. And when the EFI binary is created
from the ELF binary, these sections are not copied.
This has two side effects:
1. The corresponding relocations are not handled by the generic relocation
code. 'fixup_tables()' was added to do these relocations manually.
2. In the DYNAMIC section, the RELASZ entry contains the total size of
relocations in bytes. This includes the .rela.barebox* and .rela.initcall*
sections. This value is not modified when the EFI binary is created. So the
value is too large.
The generic relocation code in _relocate() used this value when iterating
over all relocation entries. With the wrong RELASZ value it iterates beyond
the end of the .rela section into uninitialized memory. After power-on this
memory is zero and the relocation code interprets this as 'nothing to do',
so there is no visible effect. After a soft reset, random data in that area
may produce a seemingly valid relocation entry, a random address is
modified and barebox crashes.
This patch adds the .rela.barebox* and .rela.initcall* sections to the
normal .rela section. The RELASZ now contains the correct size and the
generic relocation code works correctly. 'fixup_tables()' must be removed
at the same time to avoid relocating these entries twice.
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Michael Olbrich
authored
on 5 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
|
scripts: imx: imx-image: Fix image size for HABv3 images
...
When the image contains CSF data we must add CSF_LEN to the image
size pointer.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 6 Apr 2016
|
commands: Create nand_bitflip command
...
This adds a command to flip bits in a Nand flash. This is useful for
testing purposes to check if flipped bits are corrected and if the
driver returns the correct number of bitflips.
The command writes a configurable number of bitflips to a single Nand
page. If the -r option is not given the results are reproducible, so
calling the same command twice will revert the bitflips.
The command uses the raw read/write Nand operations which are probably
less tested than the regular read/write operations, so the command may
produce surprising results.
As of writing the command has been tested with the GPMI Nand driver and
the imx-nand driver with fixes posted.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 6 Apr 2016
|
mtd: ubi: Make debug options configurable
...
This makes the UBI debug options configurable. This make the debug
options actually available to the user and also allows the compiler
to optimize away the debug code when the options are disabled.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 6 Apr 2016
|
mtd: ubi: Use mtd_peb_erase
...
mtd_peb_erase provides the same functionality as do_sync_erase. Use it.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 6 Apr 2016
|
mtd: ubi: Use mtd_peb_write
...
mtd_peb_write provides the same functionality as ubi_io_write. Use it.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 6 Apr 2016
|
mtd: ubi: Use mtd_peb_read
...
mtd_peb_read provides the same functionality as ubi_io_read. Use
it.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 6 Apr 2016
|
mtd: ubi: Use mtd_peb_torture
...
The mtd-peb API provides a torture test derived from the UBI torture
test. Use it. Since the mtd-peb variant of the torture test will also
mark a block as bad when the test fails this also makes a separate
ubi_io_mark_bad unnecessary.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 6 Apr 2016
|