diff mbox

[U-Boot] spi: add "jedec,spi-nor" to spi_flash_std_ids

Message ID 20170808045727.11468-1-judge.packham@gmail.com
State Rejected
Delegated to: Jagannadha Sutradharudu Teki
Headers show

Commit Message

Chris Packham Aug. 8, 2017, 4:57 a.m. UTC
"jedec,spi-nor" is used by Linux for many boards with spi flash. In fact
according to the binding documentation this must be included for any SPI
NOR flash that can be identified by the JEDEC READ ID opcode (0x9F).
Make device trees more portable between Linux an U-Boot by supporting
"jedec,spi-nor" in addition to the U-Boot specific "spi-flash".

Signed-off-by: Chris Packham <judge.packham@gmail.com>
---
This fixes my issues with the spi speed selection on db-88f6820-amc. I
didn't find anything in the commit message from the initial
implementation saying that "jedec,spi-nor" was omitted intentionally so
I've settled on this instead of updating armada-385-amc.dts.

If there is a good reason not to make this change I'm happy to submit a patch
that just updates armada-385-amc.dts.

 drivers/mtd/spi/sf_probe.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Raghavendra, Vignesh Aug. 8, 2017, 1:33 p.m. UTC | #1
On Tuesday 08 August 2017 10:27 AM, Chris Packham wrote:
> "jedec,spi-nor" is used by Linux for many boards with spi flash. In fact
> according to the binding documentation this must be included for any SPI
> NOR flash that can be identified by the JEDEC READ ID opcode (0x9F).
> Make device trees more portable between Linux an U-Boot by supporting
> "jedec,spi-nor" in addition to the U-Boot specific "spi-flash".
> 
> Signed-off-by: Chris Packham <judge.packham@gmail.com>
> ---

+1

Use of U-Boot specific compatible "spi-flash" has caused quite a bit of
confusions and also problems while syncing U-Boot and kernel DTs. IMO,
its better if we could probe JEDEC SPI NOR flashes based on generic
"jedec,spi-nor" compatible as well like Linux.

> This fixes my issues with the spi speed selection on db-88f6820-amc. I
> didn't find anything in the commit message from the initial
> implementation saying that "jedec,spi-nor" was omitted intentionally so
> I've settled on this instead of updating armada-385-amc.dts.
> 
> If there is a good reason not to make this change I'm happy to submit a patch
> that just updates armada-385-amc.dts.>
>  drivers/mtd/spi/sf_probe.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/mtd/spi/sf_probe.c b/drivers/mtd/spi/sf_probe.c
> index 7b296378d2be..1953ec3cb748 100644
> --- a/drivers/mtd/spi/sf_probe.c
> +++ b/drivers/mtd/spi/sf_probe.c
> @@ -164,6 +164,7 @@ static const struct dm_spi_flash_ops spi_flash_std_ops = {
>  
>  static const struct udevice_id spi_flash_std_ids[] = {
>  	{ .compatible = "spi-flash" },
> +	{ .compatible = "jedec,spi-nor" },
>  	{ }
>  };
>  
>
Chris Packham Aug. 15, 2017, 12:32 a.m. UTC | #2
+Jagan@gmail not sure what your primary u-boot address is

On Wed, Aug 9, 2017 at 1:33 AM, Vignesh R <vigneshr@ti.com> wrote:
>
>
> On Tuesday 08 August 2017 10:27 AM, Chris Packham wrote:
>> "jedec,spi-nor" is used by Linux for many boards with spi flash. In fact
>> according to the binding documentation this must be included for any SPI
>> NOR flash that can be identified by the JEDEC READ ID opcode (0x9F).
>> Make device trees more portable between Linux an U-Boot by supporting
>> "jedec,spi-nor" in addition to the U-Boot specific "spi-flash".
>>
>> Signed-off-by: Chris Packham <judge.packham@gmail.com>
>> ---
>
> +1
>
> Use of U-Boot specific compatible "spi-flash" has caused quite a bit of
> confusions and also problems while syncing U-Boot and kernel DTs. IMO,
> its better if we could probe JEDEC SPI NOR flashes based on generic
> "jedec,spi-nor" compatible as well like Linux.
>
>> This fixes my issues with the spi speed selection on db-88f6820-amc. I
>> didn't find anything in the commit message from the initial
>> implementation saying that "jedec,spi-nor" was omitted intentionally so
>> I've settled on this instead of updating armada-385-amc.dts.
>>
>> If there is a good reason not to make this change I'm happy to submit a patch
>> that just updates armada-385-amc.dts.>
>>  drivers/mtd/spi/sf_probe.c | 1 +
>>  1 file changed, 1 insertion(+)
>>
>> diff --git a/drivers/mtd/spi/sf_probe.c b/drivers/mtd/spi/sf_probe.c
>> index 7b296378d2be..1953ec3cb748 100644
>> --- a/drivers/mtd/spi/sf_probe.c
>> +++ b/drivers/mtd/spi/sf_probe.c
>> @@ -164,6 +164,7 @@ static const struct dm_spi_flash_ops spi_flash_std_ops = {
>>
>>  static const struct udevice_id spi_flash_std_ids[] = {
>>       { .compatible = "spi-flash" },
>> +     { .compatible = "jedec,spi-nor" },
>>       { }
>>  };
>>
>>
>
> --
> Regards
> Vignesh
Jagan Teki Aug. 28, 2017, 11:21 a.m. UTC | #3
On Tue, Aug 8, 2017 at 10:27 AM, Chris Packham <judge.packham@gmail.com> wrote:
> "jedec,spi-nor" is used by Linux for many boards with spi flash. In fact
> according to the binding documentation this must be included for any SPI
> NOR flash that can be identified by the JEDEC READ ID opcode (0x9F).
> Make device trees more portable between Linux an U-Boot by supporting
> "jedec,spi-nor" in addition to the U-Boot specific "spi-flash".
>
> Signed-off-by: Chris Packham <judge.packham@gmail.com>
> ---
> This fixes my issues with the spi speed selection on db-88f6820-amc. I
> didn't find anything in the commit message from the initial
> implementation saying that "jedec,spi-nor" was omitted intentionally so
> I've settled on this instead of updating armada-385-amc.dts.
>
> If there is a good reason not to make this change I'm happy to submit a patch
> that just updates armada-385-amc.dts.

At this point try to use spi-flash in dts since we're in WIP for
spi-nor support once ie in-place then only we have sync the compatible
of what Linux is using.

thanks!
diff mbox

Patch

diff --git a/drivers/mtd/spi/sf_probe.c b/drivers/mtd/spi/sf_probe.c
index 7b296378d2be..1953ec3cb748 100644
--- a/drivers/mtd/spi/sf_probe.c
+++ b/drivers/mtd/spi/sf_probe.c
@@ -164,6 +164,7 @@  static const struct dm_spi_flash_ops spi_flash_std_ops = {
 
 static const struct udevice_id spi_flash_std_ids[] = {
 	{ .compatible = "spi-flash" },
+	{ .compatible = "jedec,spi-nor" },
 	{ }
 };