]> git.dujemihanovic.xyz Git - u-boot.git/commit
mtd: spi-nor: add unlock all config option
authorMichael Walle <michael@walle.cc>
Wed, 9 Dec 2020 09:53:25 +0000 (10:53 +0100)
committerPriyanka Jain <priyanka.jain@nxp.com>
Mon, 8 Feb 2021 08:31:13 +0000 (14:01 +0530)
commit5d867bcc2321041445ebb60d437b818bf706162f
treea6c4c43eba2ea3bf96920663bb6abd0afef41b30
parent3936fd998668846f77468d8f6a662e906920969c
mtd: spi-nor: add unlock all config option

Provide an explicit configuration option to disable default "unlock all"
of any flash chip which supports locking. It doesn't make sense to
automatically unprotect the entire flash on each u-boot startup if the
block protection bits are actually used.

Traditionally, the unlock was there to be able to write to flash devices
which powered-up with the block protection bits set. Over time this
feature creeped into all flash devices which support locking.

For a more detailed description and discussion see:
https://lore.kernel.org/linux-mtd/20201203162959.29589-8-michael@walle.cc/

Keep things simple in u-boot and just provide a configration option to
disable this behavior which can be set per board.

Signed-off-by: Michael Walle <michael@walle.cc>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
drivers/mtd/spi/Kconfig
drivers/mtd/spi/spi-nor-core.c