Re: [RFC] Accessing QSPI device under mtd

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On 11/3/20 1:00 AM, Vignesh Raghavendra wrote:
> 
> 
> On 11/2/20 8:33 AM, Dinh Nguyen wrote:
>>
>>
>> On 10/31/20 12:24 AM, Vignesh Raghavendra wrote:
>>>
>>>
>>> On 10/31/20 12:53 AM, Dinh Nguyen wrote:
>>>> Hi Vignesh,
>>>>
>>>> I'm using the standard arm64 defconfig. Attached are 2 bootlogs, v5.8
>>>> and v5.9. On the v5.8, I can see the QSPI devices under /dev/mtdX, and
>>>> has this in the bootlog:
>>>>
>>>> [    1.073562] cadence-qspi ff8d2000.spi: mt25qu02g (262144 Kbytes)
>>>> [    1.079865] 2 fixed-partitions partitions found on MTD device
>>>> ff8d2000.spi.0
>>>> [    1.086917] Creating 2 MTD partitions on "ff8d2000.spi.0":
>>>> [    1.092401] 0x000000000000-0x000003fe0000 : "Boot and fpga data"
>>>> [    1.103073] 0x000003fe0000-0x000010000000 : "Root Filesystem - JFFS2"
>>>>
>>>> In v5.9, I don't see the above output in the bootlog, and there are no
>>>> /dev/mtdX. I did a bisect and it resulted in commit "a314f6367787ee mtd:
>>>> spi-nor: Convert cadence-quadspi to use spi-mem framework". If I revert
>>>> this patch, then QSPI device is under /dev/mtdX.
>>>>
>>>> There were no changes in the Stratix10 DTS files between v5.8 and v5.9
>>>> that should have any affect on QSPI.
>>>>
>>>
>>> I think I found the problem. Looking at
>>> arch/arm64/boot/dts/altera/socfpga_stratix10_socdk.dts:
>>>
>>> 	&qspi {
>>>         	...
>>> 	        flash@0 {
>>>         	        compatible = "n25q00a";
>>> 			...
>>> 		};
>>> 	};
>>>
>>> Flash node is using non standard compatible "n25q00a". Per
>>> Documentation/devicetree/bindings/mtd/jedec,spi-nor.txt, SPI NOR flash
>>> node must include "jedec,spi-nor" as compatible.
>>>
>>> Old driver under drivers/mtd/spi-nor/ worked because, it directly called
>>> spi_nor_scan() w/o looking at compatible string.
>>>
>>> Could you try adding "jedec,spi-nor" to flash node's compatible list and
>>> see if everything works?
>>>
>>>
>>
>> Yes, that fixed it! I have a question though, if I also change it to
>> "jedec,spi-nor" on the v5.8 kernel, prior to the spi-mem commit, I get
>> this error:
>>
>> [    1.075268] cadence-qspi ff8d2000.spi: unrecognized JEDEC id bytes:
>> d0 5d 91 08 22 00
>> [    1.083091] cadence-qspi ff8d2000.spi: Cadence QSPI NOR probe failed -2
>> [    1.089761] cadence-qspi: probe of ff8d2000.spi failed with error -2
>>
>> Do you know why that is?
>>
> 
> Hmm, that should not happen.. Flash nodes "compatible" line as no effect
> with old driver (even deleting it won't matter). Is this change on top
> of plain v5.8 or do you have some other changes to spi-nor or controller
> driver?

Just a plain v5.8.

> 
> Only way to debug would be to see difference in controller register
> configuration with and without "jedec,spi-nor"
> 

It works if I have both "micron,n25q00a", "jedec,spi-nor";

Dinh



[Index of Archives]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux