mtd: spi-nor: add cmdlineparts to intel-spi
Subsystems (2)
PATCH 1/1 mtd: spi-nor: add cmdlineparts to intel-spi
On Intel platforms, the usable SPI area is located several MiB in from the start, to leave room for descriptors and the Management Engine binary. Further, not all the remaining space can be used, as the last 16 MiB contains firmware.
To make the SPI usable for mtdblock and other devices, it is necessary to enable command line partitions so the middle usable region can be specified.
Add a part_probes array which includes only "cmdelineparts", and change to mtd_device_parse_register to use this part_probes.
--- drivers/mtd/spi-nor/controllers/intel-spi.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/mtd/spi-nor/controllers/intel-spi.c +4 -1
@@ -894,6 +894,8 @@ static const struct spi_nor_controller_ops intel_spi_controller_ops = { .erase = intel_spi_erase, }; +static const char *const part_probes[] = {"cmdlinepart" ,NULL }; +struct intel_spi *intel_spi_probe (struct device *dev,struct resource *mem,const struct intel_spi_boardinfo *info) {
@@ -941,7 +943,8 @@ struct intel_spi *intel_spi_probe(struct device *dev,if (!ispi->writeable || !writeable) ispi->nor.mtd.flags &= ~MTD_WRITEABLE ; - ret =mtd_device_register (&ispi->nor.mtd, &part,1 ); + ret =mtd_device_parse_register (&ispi->nor.mtd, part_probes, +NULL , &part,1 );if (ret)return ERR_PTR (ret);
Signature · 6 lines
2.26.1.301.g55bc3eb7cb9-goog ______________________________________________________ Linux MTD discussion mailing list http://lists.infradead.org/mailman/listinfo/linux-mtd/
Quoted 5 lines · Ronald G. Minnich
On Intel platforms, the usable SPI area is located several MiB in from the start, to leave room for descriptors and the Management Engine binary. Further, not all the remaining space can be used, as the last 16 MiB contains firmware.
Quoted 8 lines
To make the SPI usable for mtdblock and other devices, it is necessary to enable command line partitions so the middle usable region can be specified.
Add a
part_probesarray which includes only "cmdelineparts", and change tomtd_device_parse_registerto use thispart_probes.Signed-off-by Ronald G. Minnich <[email protected]>
I guess the $subject should be something like:
mtd: spi-nor: controllers: intel-spi: Add support for command line partitions
The patch itself looks good to me,