FSL-QUADSPI

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

FSL-QUADSPI

1,907 Views
bahi
Contributor I

Hello,

 linuxqoriq is running on Soc LS1043a.

Memory: cypress CY15B104QSN,CY15V104QSN
    QUAD SPI F-RAM

Below i pasted my uboot dts. 

With uboot i can read/write/erase the qspi memory.

I pasted above the linux dts. With linux i can't probe the the qspi driver.

Can you have a look on my linux dts and tell me if there is something wrong ?

Thank you.

Best regards

dts uboot:
    qspi: quadspi@1550000
    {
        compatible = "fsl,ls1043a-qspi", "fsl,ls1021a-qspi","fsl,vf610-qspi";
        #address-cells = <1>;
        #size-cells = <0>;
        reg = <0x0 0x1550000 0x0 0x10000>,
            <0x0 0x40000000 0x0 0x4000000>;
        reg-names = "QuadSPI", "QuadSPI-memory";
        interrupts = <0 99 0x4>;
        num-cs = <4>;
        big-endian;
        clock-names = "qspi_en", "qspi";
        clocks = <&clockgen 4 0>, <&clockgen 4 0>;
        status = "disabled";
    };


 
sf probe output is ok
======================================
=> sf probe 2
SF: Detected cy15v104q with page size 256 Bytes, erase size 512 Bytes, total 512 KiB
 
=> sf probe 3
SF: Detected cy15v104q with page size 256 Bytes, erase size 512 Bytes, total 512 KiB


The driver is probed.


=====================================================
dts linux
=====================================================

fsl_ls1043a.dtsi:
=================
qspi: quadspi@1550000
{
    compatible = "fsl,ls1021a-qspi","fsl,vf610-qspi";
    #address-cells = <1>;
    #size-cells = <0>;
    reg = <0x0 0x1550000 0x0 0x10000>,
        <0x0 0x40000000 0x0 0x4000000>;
    reg-names = "QuadSPI", "QuadSPI-memory";
    interrupts = <0 99 0x4>;
    num-cs = <4>;
    clock-names = "qspi_en", "qspi";
    clocks = <&clockgen 4 0>, <&clockgen 4 0>;
    big-endian;
    status = "disabled";
};

myproject.dtsi:
===============
&qspi
{
    status = "okay";
        fsl,qspi-has-second-chip;
    qflash0:cy15v104q@0
    {
        #address-cells = <1>;
        #size-cells = <1>;
        compatible = "cy15v104q", "jedec,spi-nor";  /* 16MB */
        reg = <0x0>;
        spi-tx-bus-width = <4>;       
        spi-rx-bus-width = <4>;       
        spi-max-frequency = <65200000>; /* input clock */
    };

    // QSPI_B CS1, FRAM 4Mbits, CY15V104QSN-108LPXI
    qflash1: fram@1
    {
        #address-cells = <1>;
        #size-cells = <1>;
        compatible = "cy15v104q", "jedec,spi-nor";
        reg = <0x1>;
        spi-tx-bus-width = <4>;       
        spi-rx-bus-width = <4>;       
        spi-max-frequency = <65200000>; /* input clock */
    };
};





linux output is KO
=====================================
fsl-quadspi 1550000.quadspi: memory fram name: (null)
fsl-quadspi 1550000.quadspi: memory fram name: (null) not in nor id table
fsl-quadspi 1550000.quadspi: memory fram try auto-detect
fsl-quadspi 1550000.quadspi: temp: 0 id bytes: ff, ff, ff
fsl-quadspi 1550000.quadspi: unrecognized JEDEC id bytes: ff, ff, ff
fsl-quadspi 1550000.quadspi: memory fram error ENOENT
fsl-quadspi 1550000.quadspi: Freescale QuadSPI probe failed
fsl-quadspi: probe of 1550000.quadspi failed with error -2

 
 
 

 

0 Kudos
Reply
3 Replies

1,894 Views
yipingwang
NXP TechSupport
NXP TechSupport

Please add the device list for the qspi flash cy15v104q on your target board, please edit "static const struct flash_info spi_nor_ids" in drivers/mtd/spi-nor/spi-nor.c.

Please refer to patch https://patchwork.ozlabs.org/project/linux-mtd/patch/20200305120242.1391-1-s.hauer@pengutronix.de/

0 Kudos
Reply

1,876 Views
bahi
Contributor I

Hi Yiping,

thank you for your help.

I tested the patch but the result is the same.

I want to add something to the description of the issue.

With uboot:

when i type "sf probe 2" the signal QSPI_B_CS0 falls down and the memory can be read with the command "sf read" as shown below:

=> sf read 0x80000000 0 0x10
device 0 offset 0x0, size 0x10
SF: 16 bytes @ 0x0 Read: OK

But with linux (when starting) the signals QSPI_B_CS0 is always high.

When the driver starts and try to read the "cypress identifier" the signal QSPI_B_CS0 is always high and the memory is not selected. So we can't read the "cypress identifier".

To get the chip select we need to read the right register address.

May be there is something wrong in the dtsi file:

reg = <0x0 0x1550000 0x0 0x10000>, <0x0 0x40000000 0x0 0x4000000>;

What is your opinion on this point ?

Best regards

Bahi

 

 

 

0 Kudos
Reply

1,870 Views
yipingwang
NXP TechSupport
NXP TechSupport

Required SPI slave node properties:
- reg: There are two buses (A and B) with two chip selects each.
This encodes to which bus and CS the flash is connected:
<0>: Bus A, CS 0
<1>: Bus A, CS 1
<2>: Bus B, CS 0
<3>: Bus B, CS 1

0 Kudos
Reply