mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] mtd: spi-nor: controllers: intel-spi: Add support for command line partitions
@ 2020-04-17 15:26 Ronald G. Minnich
  2020-04-17 16:07 ` Mika Westerberg
  0 siblings, 1 reply; 6+ messages in thread
From: Ronald G. Minnich @ 2020-04-17 15:26 UTC (permalink / raw)
  Cc: Ronald G. Minnich, Tudor Ambarus, Miquel Raynal,
	Richard Weinberger, Vignesh Raghavendra, Mika Westerberg,
	Boris Brezillon, Jethro Beekman, Greg Kroah-Hartman,
	Alexander Sverdlin, Thomas Gleixner, linux-mtd, linux-kernel

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


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] mtd: spi-nor: controllers: intel-spi: Add support for command line partitions
  2020-04-17 15:26 [PATCH] mtd: spi-nor: controllers: intel-spi: Add support for command line partitions Ronald G. Minnich
@ 2020-04-17 16:07 ` Mika Westerberg
  2020-09-25  4:21   ` Vignesh Raghavendra
  0 siblings, 1 reply; 6+ messages in thread
From: Mika Westerberg @ 2020-04-17 16:07 UTC (permalink / raw)
  To: Ronald G. Minnich
  Cc: Ronald G. Minnich, Tudor Ambarus, Miquel Raynal,
	Richard Weinberger, Vignesh Raghavendra, Boris Brezillon,
	Jethro Beekman, Greg Kroah-Hartman, Alexander Sverdlin,
	Thomas Gleixner, linux-mtd, linux-kernel

On Fri, Apr 17, 2020 at 08:26:11AM -0700, Ronald G. Minnich wrote:
> 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>

Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] mtd: spi-nor: controllers: intel-spi: Add support for command line partitions
  2020-04-17 16:07 ` 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
  0 siblings, 1 reply; 6+ messages in thread
From: Vignesh Raghavendra @ 2020-09-25  4:21 UTC (permalink / raw)
  To: Mika Westerberg, Ronald G. Minnich
  Cc: Ronald G. Minnich, Tudor Ambarus, Miquel Raynal,
	Richard Weinberger, Boris Brezillon, Jethro Beekman,
	Greg Kroah-Hartman, Alexander Sverdlin, Thomas Gleixner,
	linux-mtd, linux-kernel



On 4/17/20 9:37 PM, Mika Westerberg wrote:
> On Fri, Apr 17, 2020 at 08:26:11AM -0700, Ronald G. Minnich wrote:
>> 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>
> 
> Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com>
> 

scripts/checkpatch.pl --strict complains:

CHECK: Alignment should match open parenthesis
#46: FILE: drivers/mtd/spi-nor/controllers/intel-spi.c:956:
+	ret = mtd_device_parse_register(&ispi->nor.mtd, part_probes,
+				       NULL, &part, 1);

WARNING: Missing Signed-off-by: line by nominal patch author '"Ronald G. Minnich" <rminnich@gmail.com>'

Regards
Vignesh

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH] mtd: parser: cmdline: Support MTD names containing one or more colons
  2020-09-25  4:21   ` Vignesh Raghavendra
@ 2020-12-23 21:56     ` Ian Goegebuer
  2021-01-04  9:08       ` Miquel Raynal
  0 siblings, 1 reply; 6+ messages in thread
From: Ian Goegebuer @ 2020-12-23 21:56 UTC (permalink / raw)
  To: Vignesh Raghavendra
  Cc: Ronald G . Minnich, Tudor Ambarus, Miquel Raynal,
	Richard Weinberger, Mika Westerberg, Boris Brezillon,
	Jethro Beekman, Greg Kroah-Hartman, Alexander Sverdlin,
	Thomas Gleixner, linux-mtd, linux-kernel, Ian Goegebuer

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>
Signed-off-by: Ian Goegebuer <goegebuer@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 b54a56a68100..9de38851c411 100644
--- a/drivers/mtd/spi-nor/controllers/intel-spi.c
+++ b/drivers/mtd/spi-nor/controllers/intel-spi.c
@@ -903,6 +903,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)
 {
@@ -950,7 +952,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.29.2.729.g45daf8777d-goog


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] mtd: parser: cmdline: Support MTD names containing one or more colons
  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
  0 siblings, 1 reply; 6+ messages in thread
From: Miquel Raynal @ 2021-01-04  9:08 UTC (permalink / raw)
  To: Ian Goegebuer
  Cc: Vignesh Raghavendra, Ronald G . Minnich, Tudor Ambarus,
	Richard Weinberger, Mika Westerberg, Boris Brezillon,
	Jethro Beekman, Greg Kroah-Hartman, Alexander Sverdlin,
	Thomas Gleixner, linux-mtd, linux-kernel

Hello Ian, 

Ian Goegebuer <goegebuer@google.com> wrote on Wed, 23 Dec 2020 13:56:30
-0800:

> 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.

The commit title seem to be taken from another patch and does not
match the below change. Or am I missing something?

> Signed-off-by: "Ronald G. Minnich" <rminnich@google.com>
> Signed-off-by: Ian Goegebuer <goegebuer@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 b54a56a68100..9de38851c411 100644
> --- a/drivers/mtd/spi-nor/controllers/intel-spi.c
> +++ b/drivers/mtd/spi-nor/controllers/intel-spi.c
> @@ -903,6 +903,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)
>  {
> @@ -950,7 +952,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);
>  

Thanks,
Miquèl

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] mtd: parser: cmdline: Support MTD names containing one or more colons
  2021-01-04  9:08       ` Miquel Raynal
@ 2021-01-04 16:24         ` Ron Minnich
  0 siblings, 0 replies; 6+ messages in thread
From: Ron Minnich @ 2021-01-04 16:24 UTC (permalink / raw)
  To: Miquel Raynal
  Cc: Ian Goegebuer, Vignesh Raghavendra, Tudor Ambarus,
	Richard Weinberger, Mika Westerberg, Boris Brezillon,
	Jethro Beekman, Greg Kroah-Hartman, Alexander Sverdlin,
	Thomas Gleixner, linux-mtd, lkml - Kernel Mailing List

It is likely we're missing something -- I am not fully checked out on
the Linux patch process and it's Ian's first patch.

Guidance appreciated.

On Mon, Jan 4, 2021 at 1:08 AM Miquel Raynal <miquel.raynal@bootlin.com> wrote:
>
> Hello Ian,
>
> Ian Goegebuer <goegebuer@google.com> wrote on Wed, 23 Dec 2020 13:56:30
> -0800:
>
> > 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.
>
> The commit title seem to be taken from another patch and does not
> match the below change. Or am I missing something?
>
> > Signed-off-by: "Ronald G. Minnich" <rminnich@google.com>
> > Signed-off-by: Ian Goegebuer <goegebuer@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 b54a56a68100..9de38851c411 100644
> > --- a/drivers/mtd/spi-nor/controllers/intel-spi.c
> > +++ b/drivers/mtd/spi-nor/controllers/intel-spi.c
> > @@ -903,6 +903,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)
> >  {
> > @@ -950,7 +952,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);
> >
>
> Thanks,
> Miquèl

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-01-04 16:25 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-17 15:26 [PATCH] mtd: spi-nor: controllers: intel-spi: Add support for command line partitions Ronald G. Minnich
2020-04-17 16:07 ` 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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®