[U-Boot] SPI flash protection

Albert ARIBAUD albert.aribaud at free.fr
Sun Jan 30 10:36:17 CET 2011


Hi Simon :)

Le 29/01/2011 18:00, Simon Guinot a écrit :
> Hi,
>
> I am looking to add U-Boot support for the LaCie Network Space v2 board.
>
> The SoC is a Kirkwood 88F6281_A0 and the boot device is a Macronix SPI
> flash (MX25L4005A). My problem is that the embedded stock U-Boot (1.1.4
> version patched by Marvell and LaCie) enable write protection for the
> SPI flash. Then, after an U-Boot update, turn off this protection is
> needed to allow saving U-Boot environment.
>
> It is not clear for me how to proceed. Disable the write protection from
> the board setup code could be an idea but a problem is that the SPI flash
> API don't export any helpful method...
> Maybe I should add one ?
>
> An another idea is disabling the write protection anyway while
> initializing the flash (from the low level macronix driver). It is quite
> straightforward but I don't know if a flash driver is allowed to do
> that. After all, a flash could be protected for some good reasons.
>
> My last idea is doing nothing and let an another piece of software
> handle the problem...
>
> Thanks in advance for advices.

My personal take: let users of the board do their own mistakes and thus, 
do not protect the Flash, *except* for U-Boot itself.

So, if SPI Flash protection is possible on block or sector levels, 
protect the blocks/sectors where U-Boot is located, including the 
environment.

Saveenv should unprotect and re-protect the environment sector/block.

As for the kernel and rootfs... You can either leave them unprotected or 
protected.

> Simon
>
> PS: some pointers about this project:
>
> git : http://git.lacie-nas.org/u-boot-lacie.git (branch netspace_v2)

You should keep this branch based on u-boot/master generally, and on 
u-boot-arm/master right now because it has the most recent ARM commits.

Amicalement,
-- 
Albert.


More information about the U-Boot mailing list