Commit graph

7 commits

Author SHA1 Message Date
Sascha Hauer
6ab66787fc imx-bbu-nand-fcb: Split space for firmware in two equal regions
We used to write the second firmware right after the first
firmware. However, splitting the available space into two
equal regions has advantages: When we update barebox the next
time the generated FCB/DBBT blocks will be the same as with the
last update, so in case of power failure it is more likely that
we have valid data in one of the FCB/DBBT areas.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-06-12 08:29:48 +02:00
Sascha Hauer
4e880df347 imx-bbu-nand-fcb: Erase whole partition
Now that we use a partition for the bootloader instead of
the whole NAND device we can erase it completely instead of
hardcoded 2MB.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-06-12 08:29:48 +02:00
Sascha Hauer
c3400f3d64 imx-bbu-nand-fcb: Let DBBT start at page 1
We used to put the FCB in the first two NAND blocks and the DBBT
in the third and fourth block. It's much more space efficient to
put the FCB and DBBT together into the same eraseblock in different
pages. This way we can store four FCBs and four DBBTs instead of
two only.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-06-12 08:29:48 +02:00
Sascha Hauer
22f8077c39 imx-bbu-nand-fcb: make available for i.MX28 aswell
The code can be used with slight modifications on i.MX28 aswell.
Add a i.MX28 registration function and move the differences to
function callbacks.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-06-12 08:28:26 +02:00
Sascha Hauer
103b88ace1 imx-bbu-nand-fcb: Use barebox partition instead of whole device
We used to use nand0 device for storing barebox and made the assumption
that there is enough space at the beginning of the first device. Instead,
use the barebox partition directly. This requires that the partition
where barebox should be stored is named 'barebox', that is the case for
all boards currently.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-06-12 08:28:04 +02:00
Sascha Hauer
92a5a43ac7 imx-bbu-nand-fcb: Fix debug messages
We should print the block number before increasing it, not afterwards.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-06-12 08:28:04 +02:00
Sascha Hauer
a10366acd8 ARM: i.MX6: bbu nand: Move to common place
The code can be used on i.MX28 aswell, so move it to a common place.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-06-12 08:28:04 +02:00
Renamed from arch/arm/mach-imx/imx6-bbu-nand.c (Browse further)