LS1021A, Linux 4.9 and QSPI

cancel
Showing results for 
Search instead for 
Did you mean: 

LS1021A, Linux 4.9 and QSPI

762 Views
delovealexandre
Contributor I

Hello

I'm working on the ls1021a with the SDK Linux 4.4 and i want to use it with the Linux 4.9, however there is a problem with the qspi.

In fact, the fsl_quadspi driver from the SDK works with the ls1021a, but the fsl_quadspi from 4.9 returns the error "fsl-quadspi 1550000.quadspi: Unsupported cmd 0x70" when accessing the qspi. The reason is that the spi_nor driver calls:

ret = nor->read_reg(nor, SPINOR_OP_RDFSR, &val, 1);

 and SPINOR_OP_RDFSR is defined in include/linux/mtd/spi-nor.h:

#define SPINOR_OP_RDFSR        0x70    /* Read flag status register */

But then there is a difference between the fsl_quadspi driver from the SDK and linux 4.9:

In the SDK, SPINOR_OP_RDFSR is handled by the function fsl_qspi_get_seqid line 539:

    case SPINOR_OP_RDFSR:
        return SEQID_RDFSR;

In 4.9, SPINOR_OP_RDFSR isn't handled by the function fsl_qspi_get_seqid:

switch (cmd) {
    case SPINOR_OP_READ_1_1_4:
        return SEQID_QUAD_READ;
    case SPINOR_OP_WREN:
        return SEQID_WREN;
    case SPINOR_OP_WRDI:
        return SEQID_WRDI;
    case SPINOR_OP_RDSR:
        return SEQID_RDSR;
    case SPINOR_OP_SE:
        return SEQID_SE;
    case SPINOR_OP_CHIP_ERASE:
        return SEQID_CHIP_ERASE;
    case SPINOR_OP_PP:
        return SEQID_PP;
    case SPINOR_OP_RDID:
        return SEQID_RDID;
    case SPINOR_OP_WRSR:
        return SEQID_WRSR;
    case SPINOR_OP_RDCR:
        return SEQID_RDCR;
    case SPINOR_OP_EN4B:
        return SEQID_EN4B;
    case SPINOR_OP_BRWR:
        return SEQID_BRWR;
    default:
        if (cmd == q->nor[0].erase_opcode)
            return SEQID_SE;
        dev_err(q->dev, "Unsupported cmd 0x%.2x\n", cmd);
        break;

 Is there any way to patch the 4.9 fsl_quadspi driver in order to use it with the ls1021a? Or is there any SDK with linux 4.9?

Thanks

Regards

Alexandre Delove

3 Replies

411 Views
yipingwang
NXP TechSupport
NXP TechSupport

Hello Delove Alexandre,

You could use SDK 1803 release including TWR-LS1021A, it provides the dual kernel version LTS 4.9.79 and LTS 4.14.16.

If you want to use flexbuild based LSDK release, please refer to the section "4.2 How to build LSDK with Flexbuild" in the document https://www.nxp.com/docs/en/supporting-information/LSDK-KC-REV18.03.pdf to download flexbuild 1803 tar ball.

If you prefer to use Yocto release, please refer to  readme - qoriq-components/yocto-sdk - Repo manifest for QorIQ Yocto SDK to download SDK 1803 Yocto release.


Have a great day,
TIC

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

0 Kudos

411 Views
delovealexandre
Contributor I

Hi yipingwang and thanks for your answer

So i found the LSDK sources here => qoriq-components/linux - Linux Tree for QorIQ support 

And while looking at them, i noticed that the spi-nor.c (fsl-quadspi.c\spi-nor\mtd\drivers - qoriq-components/linux - Linux Tree for QorIQ support ) file doesn't support SPINOR_OP_RDFSR command. Is it the right path for the sources or is there another place to find them? I found a tar.gz named lsdk_1803.tar.gz on the NXP website but it was only binaries.

Regards

Alexandre Delove

0 Kudos

411 Views
yipingwang
NXP TechSupport
NXP TechSupport

Please download flexbuild_lsdk1803.tgz from Layerscape SDK|NXP.

Execute the following commands to get kernel source in ~/flexbuild/packages/linux/linux.

$ tar xvzf flexbuild_<version>.tgz

$ cd flexbuild

$ source setup.env

$ flex-builder -c linux -m ls1021atwr


Have a great day,
TIC

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

0 Kudos