QSPI problems on my ls1021a board

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

QSPI problems on my ls1021a board

4,647 Views
hwei
Contributor III

Hi,

I meet some problems while I try to access QSPI flash in linux kernel. What I write into/read from QSPI are different.

The linux kernel can recognize my QSPI flash - s25fl256s, but when I try to erase/read/write it, I get some error message:

erase:

fsl-quadspi 1550000.quadspi: can't surport opr dc

read

fsl-quadspi 1550000.quadspi: can't surport opr c

write

fsl-quadspi 1550000.quadspi: can't surport opr 12

They are from the function set_lut in spi-fsl-quadspi.c.

Is this a driver problem or a flash compatible problem?

Thanks

Tags (4)
15 Replies

2,357 Views
jitenpatel
Contributor II

Hi H Wei,

I am also facing the exact problem as your. The solution to the above issue was not clear. If you had got any solution please do share with us

0 Kudos

2,354 Views
hwei
Contributor III

No further information, we have eliminated the QSPI flash.

0 Kudos

2,354 Views
yipingwang
NXP TechSupport
NXP TechSupport

Hello H Wei,

This is QSPI driver problem, and the error comes from drivers/mtd/devices/m25p80.c.


Actually in the coming release, we will rewrite SPI NOR driver, since many patches about it, I attached the source code to you directly, please just have a reference, it is still under developing and testing. Please put the folder spi-nor under drivers/mtd, and also refer to the dts file, you need to modify as the following.(refer to the file spi-nor/spi-nor.c)


compatible = "spansion,s25fl128s"

as

compatible = "spansion,s25fl256s0"



Have a great day,
Yiping

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

2,354 Views
shanfeifei
Contributor II

hi,Yiping,i am fei,i have some questions to ask you,what is your email,my email is  feiyashan@163.com , thank you.

0 Kudos

2,357 Views
robertsmigielsk
Contributor II

Works great on my VF522 based board which contains the s25fl256s0

0 Kudos

2,357 Views
hwei
Contributor III

Hi Yiping,

I have downloaded this new driver, but while I try to compile it in linux kernel, I get an error:

drivers/mtd/spi-nor/fsl-quadspi.c:28:31: fatal error: linux/mtd/spi-nor.h: No such file or directory

Can you provide me this header file too?

Thanks

0 Kudos

2,357 Views
yipingwang
NXP TechSupport
NXP TechSupport

Hello H Wei,

Please refer to the attachment, save it as include/linux/mtd/spi-nor.h.

For any problem, please feel free to let me know.

Thanks,

Yiping

2,357 Views
hwei
Contributor III

Hi Yiping,

Thanks.

I have tried this driver, but I get an error:

fsl-quadspi 1550000.quadspi: cmd 0x9f timeout, addr@00000000, FR:0x0100000c, SR:0x00380000

fsl-quadspi 1550000.quadspi: Freescale QuadSPI probe failed

fsl-quadspi: probe of 1550000.quadspi failed with error -110

0 Kudos

2,357 Views
yipingwang
NXP TechSupport
NXP TechSupport

Hello  H Wei,

The driver failed at reading JEDEC ID.

Please check whether the device information defined in drivers/mtd/spi-nor/spi-nor.c coincide with the device on your target board.


Have a great day,
Yiping

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

2,357 Views
hwei
Contributor III

Hi Yiping,

I have found another problem in using QSPI, it's in u-boot.

My QSPI flash is 32MB and I have configured the QSPI flash size in u-boot:

#define CONFIG_SPI_FLASH_BAR

#define FSL_QSPI_FLASH_SIZE (1 << 25)

But I can only erase the first 16MB of it.

Here is the log:

=> sf probe

SF: Detected S25FL256S_64K with page size 256 Bytes, erase size 64 KiB, total 32 MiB

=> sf erase 0x0 0x1000000

SF: 16777216 bytes @ 0x0 Erased: OK

=> sf erase 0x0 0x1010000

data abort

    MAYBE you should read doc/README.arm-unaligned-accesses

pc : [<fff7c27c>]          lr : [<00000001>]

sp : fef52ca8  ip : 000f0000     fp : fef55f88

r10: 000f0000  r9 : fef52ed0     r8 : 04000f00

r7 : 01000003  r6 : 00000001     r5 : fef52d16  r4 : fef57808

r3 : 01550000  r2 : 00000001     r1 : 40000000  r0 : 00000000

Flags: Nzcv  IRQs off  FIQs off  Mode SVC_32

Resetting CPU ...

resetting ...

Is there any more configuration I should update?

Thanks.

0 Kudos

2,357 Views
yipingwang
NXP TechSupport
NXP TechSupport

Hello H Wei,

For this problem, there are also related patches to fix it, please do the verification with the latest released SDK 1.7.

If your problem remains, please feel free to let me know.

Thanks,

Yiping

0 Kudos

2,357 Views
hwei
Contributor III

Hi Yiping,

The QSPI flash still cannot work properly.

1. I can only erase the first 16M of my 32M QSPI flash in uboot.

=> sf probe                                                                                               
SF: Detected S25FL256S_64K with page size 256 Bytes, erase size 64 KiB, total 32 MiB                      
=> sf erase 0 1000000                                                                                     
SF: 16777216 bytes @ 0x0 Erased: OK                                                                       
=> sf erase 0 1000001                                                                                     

SF: 16777217 bytes @ 0x0 Erased: ERROR

=> sf erase 0 1100000

2. While I try to erase the qspi flash in linux, it will prompt "Unsupported cmd 0xdc".

fsl-quadspi 1550000.quadspi: s25fl256s1 (32768 Kbytes)

1 ofpart partitions found on MTD device 1550000.quadspi

Creating 1 MTD partitions on "1550000.quadspi":

0x000000000000-0x000002000000 : "qspi"

fsl-quadspi 1550000.quadspi: QuadSPI SPI NOR flash driver

and

# flash_erase /dev/mtd9 0 512

Erasing 64 Kibytfsl-quadspi 1550000.quadspi: Unsupported cmd 0xdc

e @ 0 --  0 % comfsl-quadspi 1550000.quadspi: Unsupported cmd 0xdc

Erasing 64fsl-quadspi 1550000.quadspi: Unsupported cmd 0xdc

Kibyte @ 10000 -fsl-quadspi 1550000.quadspi: Unsupported cmd 0xdc

fsl-quadspi 1550000.quadspi: Unsupported cmd 0xdc

Erasing 64 Kibytefsl-quadspi 1550000.quadspi: Unsupported cmd 0xdc

@ 20000 --  0 % fsl-quadspi 1550000.quadspi: Unsupported cmd 0xdc

Erasingfsl-quadspi 1550000.quadspi: Unsupported cmd 0xdc

64 Kibyte @ 3000fsl-quadspi 1550000.quadspi: Unsupported cmd 0xdc

0 --  0 % completfsl-quadspi 1550000.quadspi: Unsupported cmd 0xdc

...

Erasingfsl-quadspi 1550000.quadspi: Unsupported cmd 0xdc

64 Kibyte @ 1bc0fsl-quadspi 1550000.quadspi: Unsupported cmd 0xdc

000 -- 86 % complfsl-quadspi 1550000.quadspi: Unsupported cmd 0xdc

Erasing 64 Kfsl-quadspi 1550000.quadspi: Unsupported cmd 0xdc

ibyte @ 1bd0000 -fsl-quadspi 1550000.quadspi: Unsupported cmd 0xdc

Erasing 64 Kibyte @ 1ff0000 -- 100 % complete

Thanks

0 Kudos

2,357 Views
yipingwang
NXP TechSupport
NXP TechSupport

Hello H Wei,

Please check whether adding "#define CONFIG_SPI_FLASH_BAR" in u-boot header file would be helpful.

Thanks,

Yiping

0 Kudos

2,357 Views
hwei
Contributor III

Hi Yiping,

I already have it in the header file:

/*SPI device */

#define CONFIG_CMD_SF

#define CONFIG_SPI_FLASH_SPANSION

#define CONFIG_SPI_FLASH

#define CONFIG_FSL_SPI_INTERFACE

#define CONFIG_SPI_FLASH_BAR

/* QSPI */

#define CONFIG_FSL_QSPI

#ifdef CONFIG_FSL_QSPI

#define QSPI_AMBA_BASE                  0x40000000

#define FSL_QSPI_FLASH_SIZE            (1 << 25)

#define FSL_QSPI_FLASH_NUM             1

#endif

This QSPI flash can be recognized without any warning or error, but I cannot get full access to it.

Thanks

0 Kudos

2,357 Views
hwei
Contributor III

Hi Yiping,

Thanks, I have checked it:

The device information in m25p80.c

{ "s25fl256s1", INFO(0x010219, 0x4d01,  64 * 1024, 512, 0) }

The device information in spi-nor.c

{ "s25fl256s1", INFO(0x010219, 0x4d01,  64 * 1024, 512, SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) },

They are almost the same except for the last part, and it's the update part, right?

0 Kudos