]> www.infradead.org Git - users/jedix/linux-maple.git/commit
mtd: spi-nor: Add a post BFPT parsing fixup hook
authorBoris Brezillon <boris.brezillon@bootlin.com>
Thu, 6 Dec 2018 10:37:35 +0000 (11:37 +0100)
committerBoris Brezillon <boris.brezillon@bootlin.com>
Mon, 10 Dec 2018 20:59:07 +0000 (21:59 +0100)
commit2aaa5f7e0c07a0f14e514ed3b343d66a31dfb300
treeee19535dced00bd86b546e92edd2fd3bc15e41e2
parent548ed6847f5303e4f33ecd6de5670cac15bfe6ac
mtd: spi-nor: Add a post BFPT parsing fixup hook

Experience has proven that SFDP tables are sometimes wrong, and parsing
of these broken tables can lead to erroneous flash config.

This leaves us 2 options:

1/ set the SPI_NOR_SKIP_SFDP flag and completely ignore SFDP parsing
2/ fix things at runtime

While #1 should always work, it might imply extra work if most of the
SFDP is correct. #2 has the benefit of keeping the generic SFDP parsing
logic almost untouched while allowing SPI NOR manufacturer drivers to
fix the broken bits.

Add a spi_nor_fixups struct where we'll put all our fixup hooks, each
of them being called at a different point in the scan process.

We start a hook called just after the BFPT parsing to allow fixing up
info extracted from the BFPT section. More hooks will be added if other
sections need to be fixed.

Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com>
Reviewed-by: Tudor Ambarus <tudor.ambarus@microchip.com>
drivers/mtd/spi-nor/spi-nor.c