5 Replies Latest reply on Jun 9, 2020 4:36 AM by ApurvaS_36

    S25FS512S bring up with kernel 4.19 on iMX8

    NaKu_4715361

      Hi,

       

      I'm trying to bring up S25FS512S on iMX8 platform with kernel 4.19, The way frameworks of SPI nor ON IMX is FlexSPI driver scans and attached NOR Flash and registers to MTD  framework with read/write hooks,

       

      Below is my dtb entry,

       

          flash0: s25fl512s@0 {

              reg = <0>;

              #address-cells = <1>;

              #size-cells = <1>;

              compatible = "cypress,s25fl512s";

              spi-max-frequency = <20000000>;

              spi-nor,ddr-quad-read-dummy = <8>;

          };

       

      Note : compatible is does not makes sens here as this node is scanned by flexspi parent node driver.

       

      On flexspi driver probe reading SFDP and verified all the data is correct as mentioned in datasheet,

       

      [    0.730947] fsl-flexspi 5d120000.flexspi: After matching with name  or id

      [    0.730954] fsl-flexspi 5d120000.flexspi: SPI NOr sizes size 4000000 sector size 262144 num sector 256 page size 256

      [    0.730958] fsl-flexspi 5d120000.flexspi: Info hardware capabilities 16480

      [    0.730979] fsl-flexspi 5d120000.flexspi: SFDP header

      [    0.730984] fsl-flexspi 5d120000.flexspi: head signature 0x50444653

      [    0.730988] fsl-flexspi 5d120000.flexspi: Minor  0x6

      [    0.730991] fsl-flexspi 5d120000.flexspi: Major  0x1

      [    0.730995] fsl-flexspi 5d120000.flexspi: Basic nph  0x5

      [    0.731002] fsl-flexspi 5d120000.flexspi: i 0 head id ff00 major 1 manior 0 length 9 parameter_table_pointer 90 10 0

       

       

      [    0.731035] fsl-flexspi 5d120000.flexspi: i 0 head id ff00 major 1 manior 5 length 10 parameter_table_pointer 90 10 0

       

       

      [    0.731041] fsl-flexspi 5d120000.flexspi: i 1 head id ff00 major 1 manior 6 length 10 parameter_table_pointer 90 10 0

       

       

      [    0.731047] fsl-flexspi 5d120000.flexspi: i 2 head id ff81 major 1 manior 0 length 10 parameter_table_pointer d8 10 0

       

       

      [    0.731053] fsl-flexspi 5d120000.flexspi: i 3 head id ff84 major 1 manior 0 length 2 parameter_table_pointer d0 10 0

       

       

      [    0.731059] fsl-flexspi 5d120000.flexspi: i 4 head id 101 major 1 manior 1 length 47 parameter_table_pointer 0 10 0

       

       

      [    0.731102] fsl-flexspi 5d120000.flexspi: non-uniform erase sector maps are not supported yet.

      [    0.731113] fsl-flexspi 5d120000.flexspi: to 0x00000000:0x00000000, len:1, cmd:35

      [    0.731131] fsl-flexspi 5d120000.flexspi: s25fl512s (65536 Kbytes)

      [    0.731138] fsl-flexspi 5d120000.flexspi: mtd .name = 5d120000.flexspi, .size = 0x4000000 (64MiB), .erasesize = 0x00040000 (256KiB) .numeraseregions = 0

      [    0.732319] slram: not enough parameters.

       

      Here I could see blocke device ,

      brw-rw---- 1 root disk 31, 0 Apr 20 19:46 /dev/mtdblock0

       

      but when i'm trying to write onto device and getting below errors

       

      [  171.736515] fsl-flexspi 5d120000.flexspi: Unsupported cmd 0x12

      [  171.742497] fsl-flexspi 5d120000.flexspi: to 0x00000000:0x00000000, len:1, cmd:05

      [  171.742513] fsl-flexspi 5d120000.flexspi: to 0x00000000:0x00000000, len:1, cmd:06

      [  171.742526] fsl-flexspi 5d120000.flexspi: nor write to 0x00000000:0x00028200, len : 512

      [  171.742595] fsl-flexspi 5d120000.flexspi: to 0x00000000:0x00028200, len:512, cmd:12

      [  171.742599] fsl-flexspi 5d120000.flexspi: Unsupported cmd 0x12

      [  171.748590] fsl-flexspi 5d120000.flexspi: to 0x00000000:0x00000000, len:1, cmd:05

      [  171.748606] fsl-flexspi 5d120000.flexspi: to 0x00000000:0x00000000, len:1, cmd:06

      [  171.748620] fsl-flexspi 5d120000.flexspi: nor write to 0x00000000:0x00028400, len : 512

      [  171.748683] fsl-flexspi 5d120000.flexspi: to 0x00000000:0x00028400, len:512, cmd:12

      [  171.748687] fsl-flexspi 5d120000.flexspi: Unsupported cmd 0x12

      [  171.754677] fsl-flexspi 5d120000.flexspi: to 0x00000000:0x00000000, len:1, cmd:05

      [  171.754693] fsl-flexspi 5d120000.flexspi: to 0x00000000:0x00000000, len:1, cmd:06

      [  171.754707] fsl-flexspi 5d120000.flexspi: nor write to 0x00000000:0x00028600, len : 512

      [  171.754769] fsl-flexspi 5d120000.flexspi: to 0x00000000:0x00028600, len:512, cmd:12

      [  171.754773] fsl-flexspi 5d120000.flexspi: Unsupported cmd 0x12

      [  171.760759] fsl-flexspi 5d120000.flexspi: to 0x00000000:0x00000000, len:1, cmd:05

      [  171.760775] fsl-flexspi 5d120000.flexspi: to 0x00000000:0x00000000, len:1, cmd:06

      [  171.760789] fsl-flexspi 5d120000.flexspi: nor write to 0x00000000:0x00028800, len : 512

      [  171.760852] fsl-flexspi 5d120000.flexspi: to 0x00000000:0x00028800, len:512, cmd:12

      [  171.760856] fsl-flexspi 5d120000.flexspi: Unsupported cmd 0x12

      [  171.766838] fsl-flexspi 5d120000.flexspi: to 0x00000000:0x00000000, len:1, cmd:05

      [  171.766854] fsl-flexspi 5d120000.flexspi: to 0x00000000:0x00000000, len:1, cmd:06

      [  171.766868] fsl-flexspi 5d120000.flexspi: nor write to 0x00000000:0x00028a00, len : 512

      [  171.766936] fsl-flexspi 5d120000.flexspi: to 0x00000000:0x00028a00, len:512, cmd:12

      [  171.766940] fsl-flexspi 5d120000.flexspi: Unsupported cmd 0x12

      [  171.772933] fsl-flexspi 5d120000.flexspi: to 0x00000000:0x00000000, len:1, cmd:05

      [  171.772971] fsl-flexspi 5d120000.flexspi: to 0x00000000:0x00000000, len:1, cmd:06

      [  171.772986] fsl-flexspi 5d120000.flexspi: nor write to 0x00000000:0x00028c00, len : 512

      [  171.773049] fsl-flexspi 5d120000.flexspi: to 0x00000000:0x00028c00, len:512, cmd:12

       

       

      Any suggestions or instructions to resolve this would be great help.

       

      Thanks,

      Naresh

        • 1. Re: S25FS512S bring up with kernel 4.19 on iMX8
          ApurvaS_36

          Hi Naresh,

           

          Thank you for contacting Cypress Community.

          Could you please confirm the part number of the device? Is it S25FL512S or S25FS512S?

           

          Regards,

          Apurva

          • 2. Re: S25FS512S bring up with kernel 4.19 on iMX8
            NaKu_4715361

            Hi Apurva,

             

            The part number is S25FS512S.

             

            Thanks,

            Naresh

            • 3. Re: S25FS512S bring up with kernel 4.19 on iMX8
              ApurvaS_36

              Hi Naresh,

               

              Thank you for your response.

              Could you please explain why you have used 's25fl512s' in your code?

               

              Regards,

              Apurva

              • 4. Re: S25FS512S bring up with kernel 4.19 on iMX8
                NaKu_4715361

                Hi Apurva,

                 

                Its just name mapping for Flash ID string in IMX8 driver, I verified the ID and its say below,

                [    0.723241] fsl-flexspi 5d120000.flexspi: id bytes: 01, 02, 20 , 4d, 00, 81

                 

                5th byte is 81(S25FS512S).

                 

                In DTB name its does effect much as it's not referred any where in the driver code. did S25FS512S is verified with kernel 4.19 on iMX.8 ?.

                 

                Thanks,

                Naresh

                • 5. Re: S25FS512S bring up with kernel 4.19 on iMX8
                  ApurvaS_36

                  Hi Naresh,

                   

                  Seems like S25FS512S driver is not included in your software. S25FS512S driver Linux Patch can be found on Cypress website. Please see the attached instruction on how to find it.

                  After applying the patch to the kernel tree, new options are selectable in the kernel configuration menu (Device Drivers -> Memory Technology Device support -> Cypress SPI Device Support). In this submenu, the chip driver as well as the desired HAL driver need to be enabled.

                  For the generic HAL driver, in addition to enabling the new driver stack in the kernel configuration, the underlying board driver (or device tree node) has to be changed to bind the SPI device with "cy-snor" instead of "spi-nor".

                  For the i.MX8 FlexSPI HAL driver, the standard driver stack (spi-nor/fsl-flexspi) needs to be disabled. The Cypress driver stack (cy-snor/cy-snor-flexspi) uses the existing device tree nodes and will probe and manage attached SPI memory.

                  For more details refer to the README file included in the downloaded software package.

                  The S25FS512S flash seems to be up and running since the device ID and SFDP data read from the device are correct.

                  Please note, S25FS512S default Page Program buffer size is 256 bytes. To Page Program in 512 bytes size, Configuration Register-3 bit 4 (CR3V[4]) needs to be set to 1.

                   

                  Regards,

                  Apurva