AnsweredAssumed Answered

QSPI driver dosent work with s25fl164k ? I am using sdk 1.8.

Question asked by Dhruvalkumar Patel on Aug 11, 2016
Latest reply on Nov 11, 2016 by Andrew Wozniak

My board design is based on ls1021aiot board . I have ls1020a on board and with different qspi flash chip than on ls1021aiot board.

 

QSPI flash part on our board "s25fl164k" . WIth existing driver I was able to perform "Erase" operation . I am not sure about write but "READ" is deffinately not working as it crashes my system when I try to read a mtd partition. I have done following changes at driver and device tree to work for my "qspi " flash part.

 

Changes in device tree :

 

kernel/3.12/arch/arm/boot/dts/

 

&qspi {

        num-cs = <2>;

        bus-num = <0>;

        fsl,spi-num-chipselects = <2>;

        fsl,spi-flash-chipselects = <0>;

        status = "okay";

 

 

        qflash0: s25fl164k@0 {

                #address-cells = <1>;

                #size-cells = <1>;

                compatible = "spansion,s25fl164k", "jedec,spi-nor";

                spi-max-frequency = <20000000>;

                reg = <0>;

                m25p,fast-read;

 

 

                partition@0 {

                        label = "rcw";

                        reg = <0x0 0x1000>;

                };

 

 

                partition@1 {

                        label = "u-boot";

                        reg = <0x10000 0x100000>;

                };

 

 

                partition@3 {

                        label = "environment";

                        reg = <0x110000 0x600000>;

                };

        };

};

 

Changes in kernel driver

kernel/3.12/drivers/mtd/spi-nor/spi-nor.c I added following line of code in device list structure .

 

{ "s25fl164k",  INFO(0x014017,      0,  64 * 1024, 128, SECT_4K) },

 

 

What else Do I need to do to make this qSPI flash work ? Am I missing something ?  I habe my u-boot environment stored in qspi flash and I want to access them from linux using fw_printenv and fw_setenv . I will appreciate your help.

 

 

Thanks

Dhruval

Outcomes