From: "Ronald G. Minnich" <rminnich@gmail.com>
To: unlisted-recipients:; (no To-header on input)
Cc: "Ronald G. Minnich" <rminnich@google.com>,
Tudor Ambarus <tudor.ambarus@microchip.com>,
Miquel Raynal <miquel.raynal@bootlin.com>,
Richard Weinberger <richard@nod.at>,
Vignesh Raghavendra <vigneshr@ti.com>,
Mika Westerberg <mika.westerberg@linux.intel.com>,
Boris Brezillon <bbrezillon@kernel.org>,
Jethro Beekman <jethro@fortanix.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Alexander Sverdlin <alexander.sverdlin@nokia.com>,
Thomas Gleixner <tglx@linutronix.de>,
linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: [PATCH] mtd: spi-nor: controllers: intel-spi: Add support for command line partitions
Date: Fri, 17 Apr 2020 08:26:11 -0700 [thread overview]
Message-ID: <20200417152613.176554-1-rminnich@google.com> (raw)
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.
Signed-off-by: Ronald G. Minnich <rminnich@google.com>
---
drivers/mtd/spi-nor/controllers/intel-spi.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/mtd/spi-nor/controllers/intel-spi.c b/drivers/mtd/spi-nor/controllers/intel-spi.c
index 61d2a0ad2131..132129e89d07 100644
--- a/drivers/mtd/spi-nor/controllers/intel-spi.c
+++ b/drivers/mtd/spi-nor/controllers/intel-spi.c
@@ -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);
--
2.26.1.301.g55bc3eb7cb9-goog
next reply other threads:[~2020-04-17 15:26 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-17 15:26 Ronald G. Minnich [this message]
2020-04-17 16:07 ` [PATCH] mtd: spi-nor: controllers: intel-spi: Add support for command line partitions Mika Westerberg
2020-09-25 4:21 ` Vignesh Raghavendra
2020-12-23 21:56 ` [PATCH] mtd: parser: cmdline: Support MTD names containing one or more colons Ian Goegebuer
2021-01-04 9:08 ` Miquel Raynal
2021-01-04 16:24 ` Ron Minnich
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200417152613.176554-1-rminnich@google.com \
--to=rminnich@gmail.com \
--cc=alexander.sverdlin@nokia.com \
--cc=bbrezillon@kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=jethro@fortanix.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mtd@lists.infradead.org \
--cc=mika.westerberg@linux.intel.com \
--cc=miquel.raynal@bootlin.com \
--cc=richard@nod.at \
--cc=rminnich@google.com \
--cc=tglx@linutronix.de \
--cc=tudor.ambarus@microchip.com \
--cc=vigneshr@ti.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox