AnsweredAssumed Answered

SPI - F-RAM usage on Linux

Question asked by Steffen Doster on Oct 7, 2019
Latest reply on Oct 7, 2019 by Steffen Doster

Hi everyone,


I'm trying to use a Fujitsu F-RAM on a custom i.MX6 Linux platform.

The F-RAM: should be available with Linux' <spi-nor> driver.


My devicetree configuration for this F-RAM looks like:

ecspi2: ecspi@0200c000 {
    #address-cells = <1>;
    #size-cells = <0>;
    compatible = "fsl,imx6q-ecspi", "fsl,imx51-ecspi";
    reg = <0x0200c000 0x4000>;
    interrupts = <0 32 IRQ_TYPE_LEVEL_HIGH>;
    clocks = <&clks IMX6QDL_CLK_ECSPI2>,
    <&clks IMX6QDL_CLK_ECSPI2>;
    clock-names = "ipg", "per";
    fsl,spi-num-chipselects = <1>;
    pinctrl-names = "default";
    pinctrl-0 = <&pinctrl_ecspi2>;
    dmas = <&sdma 5 7 1>, <&sdma 6 7 2>;
    dma-names = "rx", "tx";
    status = "okay";

/*    spidev: spidev@0 {
 *        compatible = "linux,spidev";
 *        reg = <0>;

 *        spi-max-frequency = <25000000>;
 *        status = "okay";

 *    };
    fram: mb85rs4mt@0 {
        compatible = "jedec,spi-nor";
        reg = <0>;
        spi-max-frequency = <40000000>;
        #address-cells = <1>;
        #size-cells = <1>;
        status = "okay";

        partition@p1 {
        label = "spi-fram";
        reg = <0x0 0x20000>;



I used spidev to debug the device.


My problem is: this configuration does not recognize the F-RAM as it should. The F-RAM has the JEDEC RDID-functionality which gives you the Device-ID by sending RDID-command 0x9f.

Linux attempts to read this register but only gets back 0xffffff.

The Error is:

m25p80 spi1.0: unrecognized JEDEC id bytes: ff, ff, ff
m25p80: probe of spi1.0 failed with error -2

I tried to read the Device-ID with <spidev> and got a valid answer (0x047f27).


The difference between both SPI-communications is the timing!

When I use spidev I send the RDID and immediately (in the same chip-select) some dummy bytes to read the informations sent by the F-RAM.

When Linux tries to get the Device-ID it sends the command (0x9f), sets the Chip-Select back to high and after a while it tries to get the data by setting Chip-Select to low and clocking the device. But then the answer from the device is 0xffffff.


I tried this with other devices mentioned in <spi-nor.c> (for example a m25p20) and they all have the same behavior.


How can I get Linux to do the RDID in a single Chip-Select???