Use flexspi controller to communicate with a device using regular SPI

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

Use flexspi controller to communicate with a device using regular SPI

4,536 Views
betheev
Contributor I

Hi,

is it at all possible to use the flexspi controller of an i.MX8M Plus processor and spidev to talk to a device that speaks regular SPI (mode 0)? If yes, how do you do that? I get the following error:

$ spidev_test -v --device /dev/spidev0.0 -p "0xFF"
spi mode: 0x0
bits per word: 8
max speed: 500000 Hz (500 kHz)
can't send spi message: Unknown error 524
Aborted (core dumped)

Note: I modified spidev_test to use SPI_IOC_WR_MODE and SPI_IOC_RD_MODE instead of SPI_IOC_WR_MODE32 and SPI_IOC_RD_MODE32.

Tags (1)
0 Kudos
Reply
16 Replies

1,808 Views
lukipedio
Contributor I

Hi @Chavira ,

   I have found this thread, but I notice it has not a clear conclusion regarding the initial question.

   From my understanding, the spi-nor driver is not part of the SPI subsystem and it does not allow to use FlexSPI peripheral

   for low-level tasks like serializing data over a one-wire SPI interface.

   Is there any alternative to a custom driver?

   Using s SPI/eSPI interface is obviously the recommended way of doing.

    I am working on a Layerscaper processor. FlexSPI is available (only one channel with two chip select).

    I am struggling to understand the issue, since the schematics does use FlexSPI for both QSPI and Slave Serial programming of a slave FPGA.

 

  

 

 

0 Kudos
Reply

4,453 Views
betheev
Contributor I

I added the property "nxp,fspi-individual-mode" that I had overlooked but I'm still getting the same error:

&flexspi {
   nxp,fspi-individual-mode;
    status = "okay";
    spidev0: spi@0 {
        reg = <0>;
        compatible = "rohm,dh2228fv";
        spi-max-frequency = <10000000>;
        spi-rx-bus-width = <1>;
        spi-tx-bus-width = <1>;
    };
};

 

0 Kudos
Reply

4,520 Views
Chavira
NXP TechSupport
NXP TechSupport

Hi @betheev!
Thank you for contacting NXP Support!

 

The SPI bus is working good by my side.

What BSP version are you using?

What board are you using?

 

Can you share your device tree?

 

Best Regards!
Chavira

0 Kudos
Reply

4,440 Views
xojico
Contributor I

 

Chavira,

Do you understand that xSPI and ordinary SPI are two very different things?

0 Kudos
Reply

4,497 Views
betheev
Contributor I

Hi Chavira,

I'm glad to hear it is working on your side. That gives me hope

I'm working with a SOM-SMARC-MX8M-Plus from Seco. I'm using the seco-imx8mp-d18.dts file as reference device tree and have attached spidev as follows:

&flexspi {
    status = "okay";
    spidev0: spi@0 {
        reg = <0>;
        compatible = "rohm,dh2228fv";
        spi-max-frequency = <10000000>;
        spi-rx-bus-width = <1>;
        spi-tx-bus-width = <1>;
    };
};

For the sake of simplicity, let's assume that the device I want to talk to is always selected.

What I have managed to understand so far is that, in general, flexspi controllers are part of the MTD Linux subsystem (because their main purpose is to communicate with flash devices) whereas spidev belongs to the SPI subsystem and that's why spidev cannot "talk" to flexspi controllers. However, the NXP FSPI Controller Driver is under drivers/spi/. I was expecting it to play nice with spidev. So what am I missing? Why does spidev_test return an error?

Best regards,

Betheev

0 Kudos
Reply

4,441 Views
xojico
Contributor I

flexSPI is designed for storage following the xSPI standard. The full name of xSPI (JESD251C) is EXpanded Serial Peripheral Interface (xSPI) for Non Volatile Memory Devices. SPI has only a few datasheets and is a de facto standard for applications. It is designed for connectivity. These two standards have completely different purposes. The standard protocol definitions are very different. It is impossible to use xSPI to do the work of ordinary SPI.

0 Kudos
Reply

4,407 Views
Chavira
NXP TechSupport
NXP TechSupport

Hi @xojico!

 

FlexSPI Flash with support for XIP  and support for either one Octal SPI, or parallel read mode of two identical Quad SPI FLASH devices. It also supports both Serial NOR and Serial NAND flash using the FlexSPI.

 

Unfortunately he i.MX 8M Plus does not natively support the xSPI (JESD251) standard.

FlexSPI: Supported on i.MX 8M Plus, used for interfacing with NOR flash (e.g., QSPI, Octal SPI) and xSPI (JESD251) is not officially supported or documented as compliant in the i.MX 8M Plus datasheet or reference manual.

 

Best Regards!

Chavira

0 Kudos
Reply

4,349 Views
xojico
Contributor I

I suggest you ask the engineers who designed your chips. Which flexspi IP did they use? Which standard the flexspi ip follows ? Your ignorance makes you have no idea what question Betheev is asking.

0 Kudos
Reply

4,377 Views
betheev
Contributor I

Hi Chavira,

what about my original question? You say that regular SPI is working on your side. How? What driver do you use? How did you configure your device tree? I analyzed the spi code a bit further and the reason I get the error is because spi-nxp-fspi.c does not implement the function spi_controller-> transfer called here

Best regards,

Betheev

0 Kudos
Reply

4,347 Views
xojico
Contributor I

See? This is the level of NXP engineers. If I don't tell him the knowledge of xSPI, he will never know it in his life. And  Chavira  won't answer your original question, because before I tell him this knowledge, he has no idea and can't understand your question. 

 

Chavira  cannot tell an  xSPI and a SPI. 

0 Kudos
Reply

4,359 Views
betheev
Contributor I

After spending a long time reading driver code, I finally understood the problem. The only driver compatible with "nxp,imx8mp-fspi" as required by the flexspi node in imx8mp.dtsi is drivers/spi/spi-nxp-fspi.c. This driver, however, does not implement any of the functions transfer() (deprecated), transfer_one() or transfer_one_message() of struct spi_controller that the SPI device driver (drivers/spi/spi.c) needs to send SPI messages.

@Chavira: what driver did you use to send regular SPI messages using the flexspi node in the device tree?

0 Kudos
Reply

4,430 Views
betheev
Contributor I

I understand that xSPI has a completely different purpose but doesn't it nonetheless provide compatibility with legacy SPI devices? According to this website, it does.

0 Kudos
Reply

1,750 Views
doyayax
Contributor II

If you read the spec carefully, you will find the description "limited backward compatibility".

It is just for "The 1S-1S-1S mode supports a limited subset of SPI protocol commands, to enable basic target device identification in the same protocol used by legacy SPI target devices."

and "Once each target device is identified, it is expected that the protocol will be switched to 8D-8D-8D."

Beside/By the way , xSPI is primarily targeted at storage devices.

The xSPI specification is called "Expanded Serial Peripheral Interface (xSPI) for Non-Volatile Memory Devices".

One question for you, did you read the spec?

 

JEDEC Standard No. 251C
Page 12
5.5 Legacy SPI Compatibility

xSPI target devices support the 1S-1S-1S protocol for limited backward compatibility with the legacy single IO Serial Peripheral Interface (SPI) protocol. The 1S-1S-1S mode supports a limited subset of SPI protocol commands, to enable basic target device identification in the same protocol used by legacy SPI target devices. This backward compatibility can simplify the POR and configuration process for systems that may use legacy SPI targets on the xSPI interface signals. Once each target device is identified, it is expected that the protocol will be switched to 8D-8D-8D.

 

0 Kudos
Reply

1,739 Views
doyayax
Contributor II

The website says "In this blog post, we will delve into the details of different SPI standards, including XSPI, QSPI, Octal SPI, as well as the specific considerations for PSRAM (Pseudo SRAM) and NOR Flash memory devices. By exploring their technical aspects, applications, and comparisons, we can gain a comprehensive understanding of the unique features and benefits offered by each standard."

 

for PSRAM (Pseudo SRAM) and NOR Flash memory devices.

 

0 Kudos
Reply

1,741 Views
doyayax
Contributor II

The xSPI specification is called "Expanded Serial Peripheral Interface (xSPI) for Non-Volatile Memory Devices".

The compatibility here is based on the premise of all Non-Volatile Memory Devices. Using 1s-1s-1s, there is limited compatibility with some legacy SPI NOR devices.

0 Kudos
Reply

1,749 Views
doyayax
Contributor II

 

@betheev 

@xojico introduced the relevant specs; have you read it?

0 Kudos
Reply
%3CLINGO-SUB%20id%3D%22lingo-sub-2099045%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EUse%20flexspi%20controller%20to%20communicate%20with%20a%20device%20using%20regular%20SPI%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2099045%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%2C%3C%2FP%3E%3CP%3Eis%20it%20at%20all%20possible%20to%20use%20the%20flexspi%20controller%20of%20an%20i.MX8M%20Plus%20processor%20and%20spidev%20to%20talk%20to%20a%20device%20that%20speaks%20regular%20SPI%20(mode%200)%3F%20If%20yes%2C%20how%20do%20you%20do%20that%3F%20I%20get%20the%20following%20error%3A%3C%2FP%3E%3CP%3E%24%20spidev_test%20-v%20--device%20%2Fdev%2Fspidev0.0%20-p%20%220xFF%22%3CBR%20%2F%3Espi%20mode%3A%200x0%3CBR%20%2F%3Ebits%20per%20word%3A%208%3CBR%20%2F%3Emax%20speed%3A%20500000%20Hz%20(500%20kHz)%3CBR%20%2F%3Ecan't%20send%20spi%20message%3A%20Unknown%20error%20524%3CBR%20%2F%3EAborted%20(core%20dumped)%3C%2FP%3E%3CP%3ENote%3A%20I%20modified%20spidev_test%20to%20use%26nbsp%3BSPI_IOC_WR_MODE%20and%26nbsp%3BSPI_IOC_RD_MODE%20instead%20of%26nbsp%3BSPI_IOC_WR_MODE32%20and%26nbsp%3BSPI_IOC_RD_MODE32.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2099045%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CLINGO-LABEL%3Ei.MX%208%20Family%20%7C%20i.MX%208QuadMax%20(8QM)%20%7C%208QuadPlus%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ELinux%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2320678%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20Use%20flexspi%20controller%20to%20communicate%20with%20a%20device%20using%20regular%20SPI%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2320678%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EThe%20website%20says%20%22%3CSPAN%3EIn%20this%20blog%20post%2C%20we%20will%20delve%20into%20the%20details%20of%20different%20SPI%20standards%2C%20including%20XSPI%2C%20QSPI%2C%20Octal%20SPI%2C%20as%20well%20as%20the%20specific%20considerations%20for%20%3CSTRONG%3EPSRAM%20(Pseudo%20SRAM)%20and%20NOR%20Flash%20memory%20devices.%3C%2FSTRONG%3E%20By%20exploring%20their%20technical%20aspects%2C%20applications%2C%20and%20comparisons%2C%20we%20can%20gain%20a%20comprehensive%20understanding%20of%20the%20unique%20features%20and%20benefits%20offered%20by%20each%20standard.%22%3C%2FSPAN%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%3E%3CSPAN%3Efor%26nbsp%3B%3CSTRONG%3EPSRAM%20(Pseudo%20SRAM)%20and%20NOR%20Flash%20memory%20devices.%3C%2FSTRONG%3E%3C%2FSPAN%3E%3C%2FP%3E%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2320675%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20Use%20flexspi%20controller%20to%20communicate%20with%20a%20device%20using%20regular%20SPI%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2320675%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E%3CSPAN%3EThe%20xSPI%20specification%20is%20called%20%22Expanded%20Serial%20Peripheral%20Interface%20(xSPI)%20for%26nbsp%3B%3C%2FSPAN%3E%3CSTRONG%3ENon-Volatile%20Memory%20Devices%22%3C%2FSTRONG%3E%3CSPAN%3E.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3EThe%20compatibility%20here%20is%20based%20on%20the%20premise%20of%20all%20Non-Volatile%20Memory%20Devices.%20Using%201s-1s-1s%2C%20there%20is%20limited%20compatibility%20with%20some%20legacy%20SPI%20NOR%20devices.%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2320669%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20Use%20flexspi%20controller%20to%20communicate%20with%20a%20device%20using%20regular%20SPI%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2320669%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CBR%20%2F%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F250572%22%20target%3D%22_blank%22%3E%40betheev%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F248958%22%20target%3D%22_blank%22%3E%40xojico%3C%2FA%3E%26nbsp%3Bintroduced%20the%20relevant%20specs%3B%20have%20you%20read%20it%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2320668%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20Use%20flexspi%20controller%20to%20communicate%20with%20a%20device%20using%20regular%20SPI%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2320668%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EIf%20you%20read%20the%20spec%20carefully%2C%20you%20will%20find%20the%20description%20%3CSTRONG%3E%22limited%20backward%20compatibility%22%3C%2FSTRONG%3E.%3C%2FP%3E%3CP%3EIt%20is%20just%20for%20%3CSTRONG%3E%22The%201S-1S-1S%20mode%20supports%20a%20limited%20subset%20of%20SPI%20protocol%20commands%2C%20to%20enable%20basic%20target%20device%20identification%20in%20the%20same%20protocol%20used%20by%20legacy%20SPI%20target%20devices.%22%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3Eand%20%3CSTRONG%3E%22Once%20each%20target%20device%20is%20identified%2C%20it%20is%20expected%20that%20the%20protocol%20will%20be%20switched%20to%208D-8D-8D.%22%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3EBeside%2FBy%20the%20way%20%2C%20xSPI%20is%20primarily%20targeted%20at%20storage%20devices.%3C%2FP%3E%3CP%3EThe%20xSPI%20specification%20is%20called%20%22Expanded%20Serial%20Peripheral%20Interface%20(xSPI)%20for%20%3CSTRONG%3ENon-Volatile%20Memory%20Devices%22%3C%2FSTRONG%3E.%3C%2FP%3E%3CP%3EOne%20question%20for%20you%2C%20did%20you%20read%20the%20spec%3F%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EJEDEC%20Standard%20No.%20251C%3CBR%20%2F%3EPage%2012%3CBR%20%2F%3E5.5%20Legacy%20SPI%20Compatibility%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-markup%22%3E%3CCODE%3ExSPI%20target%20devices%20support%20the%201S-1S-1S%20protocol%20for%20limited%20backward%20compatibility%20with%20the%20legacy%20single%20IO%20Serial%20Peripheral%20Interface%20(SPI)%20protocol.%20The%201S-1S-1S%20mode%20supports%20a%20limited%20subset%20of%20SPI%20protocol%20commands%2C%20to%20enable%20basic%20target%20device%20identification%20in%20the%20same%20protocol%20used%20by%20legacy%20SPI%20target%20devices.%20This%20backward%20compatibility%20can%20simplify%20the%20POR%20and%20configuration%20process%20for%20systems%20that%20may%20use%20legacy%20SPI%20targets%20on%20the%20xSPI%20interface%20signals.%20Once%20each%20target%20device%20is%20identified%2C%20it%20is%20expected%20that%20the%20protocol%20will%20be%20switched%20to%208D-8D-8D.%3C%2FCODE%3E%3C%2FPRE%3E%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2319129%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20Use%20flexspi%20controller%20to%20communicate%20with%20a%20device%20using%20regular%20SPI%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2319129%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F206761%22%20target%3D%22_blank%22%3E%40Chavira%3C%2FA%3E%26nbsp%3B%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%20%26nbsp%3BI%20have%20found%20this%20thread%2C%20but%20I%20notice%20it%20has%20not%20a%20clear%20conclusion%20regarding%20the%20initial%20question.%3C%2FP%3E%3CP%3E%26nbsp%3B%20%26nbsp%3BFrom%20my%20understanding%2C%20the%20spi-nor%20driver%20is%20not%20part%20of%20the%20SPI%20subsystem%20and%20it%20does%20not%20allow%20to%20use%20FlexSPI%20peripheral%3C%2FP%3E%3CP%3E%26nbsp%3B%20%26nbsp%3Bfor%20low-level%20tasks%20like%20serializing%20data%20over%20a%20one-wire%20SPI%20interface.%3C%2FP%3E%3CP%3E%26nbsp%3B%20%26nbsp%3BIs%20there%20any%20alternative%20to%20a%20custom%20driver%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%20%26nbsp%3BUsing%20s%20SPI%2FeSPI%20interface%20is%20obviously%20the%20recommended%20way%20of%20doing.%3C%2FP%3E%3CP%3E%26nbsp%3B%20%26nbsp%3B%20I%20am%20working%20on%20a%20Layerscaper%20processor.%20FlexSPI%20is%20available%20(only%20one%20channel%20with%20two%20chip%20select).%3C%2FP%3E%3CP%3E%26nbsp%3B%20%26nbsp%3B%20I%20am%20struggling%20to%20understand%20the%20issue%2C%20since%20the%20schematics%20does%20use%20FlexSPI%20for%20both%20QSPI%20and%20Slave%20Serial%20programming%20of%20a%20slave%20FPGA.%3C%2FP%3E%3CBR%20%2F%3E%3CP%3E%26nbsp%3B%26nbsp%3B%3C%2FP%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2100685%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20Use%20flexspi%20controller%20to%20communicate%20with%20a%20device%20using%20regular%20SPI%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2100685%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3ESee%3F%20This%20is%20the%20level%20of%20NXP%20engineers.%20If%20I%20don't%20tell%20him%20the%20knowledge%20of%20xSPI%2C%20he%20will%20never%20know%20it%20in%20his%20life.%20And%26nbsp%3B%20Chavira%26nbsp%3B%26nbsp%3Bwon't%20answer%20your%20original%20question%2C%20because%20before%20I%20tell%20him%20this%20knowledge%2C%20he%20has%20no%20idea%20and%20can't%20understand%20your%20question.%26nbsp%3B%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EChavira%26nbsp%3B%20cannot%20tell%20an%26nbsp%3B%20xSPI%20and%20a%20SPI.%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2100682%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20Use%20flexspi%20controller%20to%20communicate%20with%20a%20device%20using%20regular%20SPI%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2100682%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EI%20suggest%20you%20ask%20the%20engineers%20who%20designed%20your%20chips.%20Which%20flexspi%20IP%20did%20they%20use%3F%20Which%20standard%20the%20flexspi%20ip%20follows%20%3F%20Your%20ignorance%20makes%20you%20have%20no%20idea%20what%20question%20Betheev%20is%20asking.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2100533%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20Use%20flexspi%20controller%20to%20communicate%20with%20a%20device%20using%20regular%20SPI%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2100533%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EAfter%20spending%20a%20long%20time%20reading%20driver%20code%2C%20I%20finally%20understood%20the%20problem.%20The%20only%20driver%20compatible%20with%20%22nxp%2Cimx8mp-fspi%22%20as%20required%20by%20the%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fgit.seco.com%2Fclea-os%2Fbsp%2Fnxp%2Flinux-seco-imx%2F-%2Fblob%2Fseco_lf-6.6.23-2.0.0_d18-dev-memlogo%2Farch%2Farm64%2Fboot%2Fdts%2Fseco%2Finclude%2Fimx8mp.dtsi%3Fref_type%3Dheads%23L1292%22%20target%3D%22_self%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3Eflexspi%20node%20in%26nbsp%3Bimx8mp.dtsi%3C%2FA%3E%20is%20%3CA%20href%3D%22https%3A%2F%2Fgit.seco.com%2Fclea-os%2Fbsp%2Fnxp%2Flinux-seco-imx%2F-%2Fblob%2Fseco_lf-6.6.23-2.0.0_d18-dev-memlogo%2Fdrivers%2Fspi%2Fspi-nxp-fspi.c%3Fref_type%3Dheads%23L1533%22%20target%3D%22_self%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3Edrivers%2Fspi%2Fspi-nxp-fspi.c%3C%2FA%3E.%20This%20driver%2C%20however%2C%20does%20not%20implement%20any%20of%20the%20functions%20%3CSTRONG%3Etransfer()%3C%2FSTRONG%3E%20(deprecated)%2C%20%3CSTRONG%3Etransfer_one()%3C%2FSTRONG%3E%20or%20%3CSTRONG%3Etransfer_one_message()%3C%2FSTRONG%3E%20of%20%3CSTRONG%3Estruct%20spi_controller%3C%2FSTRONG%3E%20that%20the%20SPI%20device%20driver%20(drivers%2Fspi%2Fspi.c)%20needs%20to%20send%20SPI%20messages.%3C%2FP%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F206761%22%20target%3D%22_blank%22%3E%40Chavira%3C%2FA%3E%3A%20what%20driver%20did%20you%20use%20to%20send%26nbsp%3Bregular%20SPI%20messages%20using%20the%20flexspi%20node%20in%20the%20device%20tree%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2100329%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20Use%20flexspi%20controller%20to%20communicate%20with%20a%20device%20using%20regular%20SPI%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2100329%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%20Chavira%2C%3C%2FP%3E%3CP%3Ewhat%20about%20my%20original%20question%3F%20You%20say%20that%20regular%20SPI%20is%20working%20on%20your%20side.%20How%3F%20What%20driver%20do%20you%20use%3F%20How%20did%20you%20configure%20your%20device%20tree%3F%20I%20analyzed%20the%20spi%20code%20a%20bit%20further%20and%20the%20reason%20I%20get%20the%20error%20is%20because%20spi-nxp-fspi.c%20does%20not%20implement%26nbsp%3Bthe%20function%20spi_controller-%26gt%3B%20transfer%20called%20%3CA%20href%3D%22https%3A%2F%2Fgit.seco.com%2Fclea-os%2Fbsp%2Fnxp%2Flinux-seco-imx%2F-%2Fblob%2Fseco_lf-6.6.23-2.0.0_d18-dev-memlogo%2Fdrivers%2Fspi%2Fspi.c%3Fref_type%3Dheads%23L4042%22%20target%3D%22_self%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3Ehere%3C%2FA%3E.%26nbsp%3B%3C%2FP%3E%3CP%3EBest%20regards%2C%3C%2FP%3E%3CP%3EBetheev%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2099977%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20Use%20flexspi%20controller%20to%20communicate%20with%20a%20device%20using%20regular%20SPI%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2099977%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%20%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F248958%22%20target%3D%22_blank%22%3E%40xojico%3C%2FA%3E!%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CP%3EFlexSPI%20Flash%20with%20support%20for%20XIP%26nbsp%3B%20and%20support%20for%20either%20one%20Octal%20SPI%2C%20or%20parallel%20read%20mode%20of%20two%20identical%20Quad%20SPI%20FLASH%20devices.%20It%20also%20supports%20both%20Serial%20NOR%20and%20Serial%20NAND%20flash%20using%20the%20FlexSPI.%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CP%3EUnfortunately%20he%20i.MX%208M%20Plus%20does%20not%20natively%20support%20the%20xSPI%20(JESD251)%20standard.%3C%2FP%3E%0A%3CP%3EFlexSPI%3A%20Supported%20on%20i.MX%208M%20Plus%2C%20used%20for%20interfacing%20with%20NOR%20flash%20(e.g.%2C%20QSPI%2C%20Octal%20SPI)%20and%20xSPI%20(JESD251)%20is%20not%20officially%20supported%20or%20documented%20as%20compliant%20in%20the%20i.MX%208M%20Plus%20datasheet%20or%20reference%20manual.%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CP%3EBest%20Regards!%3C%2FP%3E%0A%3CP%3EChavira%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2099790%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20Use%20flexspi%20controller%20to%20communicate%20with%20a%20device%20using%20regular%20SPI%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2099790%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EI%20understand%20that%20xSPI%20has%20a%20completely%20different%20purpose%20but%20doesn't%20it%20nonetheless%26nbsp%3B%3CSPAN%3Eprovide%20compatibility%20with%20legacy%20SPI%20devices%3F%20According%20to%20%3CA%20href%3D%22https%3A%2F%2Fwww.arasan.com%2Fblog%2Funderstanding-serial-peripheral-interface-spi-standards-a-comprehensive-overview%2F%22%20target%3D%22_self%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3Ethis%20website%3C%2FA%3E%2C%20it%20does.%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2099755%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20Use%20flexspi%20controller%20to%20communicate%20with%20a%20device%20using%20regular%20SPI%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2099755%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CBR%20%2F%3E%3CP%3E%3CSPAN%3EChavira%2C%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3EDo%20you%20understand%20that%20xSPI%20and%20ordinary%20SPI%20are%20two%20very%20different%20things%3F%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2099751%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20Use%20flexspi%20controller%20to%20communicate%20with%20a%20device%20using%20regular%20SPI%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2099751%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EflexSPI%20is%20designed%20for%20storage%20following%20the%20xSPI%20standard.%20The%20full%20name%20of%20xSPI%20(JESD251C)%20is%20EXpanded%20Serial%20Peripheral%20Interface%20(xSPI)%20for%20Non%20Volatile%20Memory%20Devices.%20SPI%20has%20only%20a%20few%20datasheets%20and%20is%20a%20de%20facto%20standard%20for%20applications.%20It%20is%20designed%20for%20connectivity.%20These%20two%20standards%20have%20completely%20different%20purposes.%20The%20standard%20protocol%20definitions%20are%20very%20different.%20It%20is%20impossible%20to%20use%20xSPI%20to%20do%20the%20work%20of%20ordinary%20SPI.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2099578%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20Use%20flexspi%20controller%20to%20communicate%20with%20a%20device%20using%20regular%20SPI%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2099578%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EI%20added%20the%20property%20%22nxp%2Cfspi-individual-mode%22%20that%20I%20had%20overlooked%20but%20I'm%20still%20getting%20the%20same%20error%3A%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-c%22%3E%3CCODE%3E%26amp%3Bflexspi%20%7B%0A%20%20%20nxp%2Cfspi-individual-mode%3B%0A%20%20%20%20status%20%3D%20%22okay%22%3B%0A%20%20%20%20spidev0%3A%20spi%400%20%7B%0A%20%20%20%20%20%20%20%20reg%20%3D%20%26lt%3B0%26gt%3B%3B%0A%20%20%20%20%20%20%20%20compatible%20%3D%20%22rohm%2Cdh2228fv%22%3B%0A%20%20%20%20%20%20%20%20spi-max-frequency%20%3D%20%26lt%3B10000000%26gt%3B%3B%0A%20%20%20%20%20%20%20%20spi-rx-bus-width%20%3D%20%26lt%3B1%26gt%3B%3B%0A%20%20%20%20%20%20%20%20spi-tx-bus-width%20%3D%20%26lt%3B1%26gt%3B%3B%0A%20%20%20%20%7D%3B%0A%7D%3B%3C%2FCODE%3E%3C%2FPRE%3E%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2099291%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20Use%20flexspi%20controller%20to%20communicate%20with%20a%20device%20using%20regular%20SPI%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2099291%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%20Chavira%2C%3C%2FP%3E%3CP%3EI'm%20glad%20to%20hear%20it%20is%20working%20on%20your%20side.%20That%20gives%20me%20hope%20%3CLI-EMOJI%20id%3D%22lia_slightly-smiling-face%22%20title%3D%22%3Aslightly_smiling_face%3A%22%3E%3C%2FLI-EMOJI%3E%3C%2FP%3E%3CP%3EI'm%20working%20with%20a%20%3CA%20href%3D%22https%3A%2F%2Fedge.seco.com%2Fen_eu%2Fsom-smarc-mx8m-plus.html%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noreferrer%22%3ESOM-SMARC-MX8M-Plus%3C%2FA%3E%20from%20Seco.%20I'm%20using%20the%20%3CA%20href%3D%22https%3A%2F%2Fgit.seco.com%2Fclea-os%2Fbsp%2Fnxp%2Flinux-seco-imx%2F-%2Fblob%2Fseco_lf-6.6.23-2.0.0_d18-dev-memlogo%2Farch%2Farm64%2Fboot%2Fdts%2Fseco%2Fseco-imx8mp-d18.dts%3Fref_type%3Dheads%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noreferrer%22%3Eseco-imx8mp-d18.dts%3C%2FA%3E%26nbsp%3Bfile%20as%20reference%20device%20tree%20and%20have%20attached%20spidev%20as%20follows%3A%3C%2FP%3E%3CP%3E%26amp%3Bflexspi%20%7B%3CBR%20%2F%3E%26nbsp%3B%20%26nbsp%3B%20status%20%3D%20%22okay%22%3B%3CBR%20%2F%3E%26nbsp%3B%20%26nbsp%3B%20spidev0%3A%20spi%400%20%7B%3CBR%20%2F%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20reg%20%3D%20%26lt%3B0%26gt%3B%3B%3CBR%20%2F%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20compatible%20%3D%20%22rohm%2Cdh2228fv%22%3B%3CBR%20%2F%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20spi-max-frequency%20%3D%20%26lt%3B10000000%26gt%3B%3B%3CBR%20%2F%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20spi-rx-bus-width%20%3D%20%26lt%3B1%26gt%3B%3B%3CBR%20%2F%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20spi-tx-bus-width%20%3D%20%26lt%3B1%26gt%3B%3B%3CBR%20%2F%3E%26nbsp%3B%20%26nbsp%3B%20%7D%3B%3CBR%20%2F%3E%7D%3B%3C%2FP%3E%3CP%3EFor%20the%20sake%20of%20simplicity%2C%20let's%20assume%20that%20the%20device%20I%20want%20to%20talk%20to%20is%20always%20selected.%3C%2FP%3E%3CP%3EWhat%20I%20have%20managed%20to%20understand%20so%20far%20is%20that%2C%20in%20general%2C%20flexspi%20controllers%20are%20part%20of%20the%20MTD%20Linux%20subsystem%20(because%20their%20main%20purpose%20is%20to%20communicate%20with%20flash%20devices)%20whereas%20spidev%20belongs%20to%20the%20SPI%20subsystem%20and%20that's%20why%20spidev%20cannot%20%22talk%22%20to%20flexspi%20controllers.%20However%2C%20the%20%3CA%20href%3D%22https%3A%2F%2Fgit.seco.com%2Fclea-os%2Fbsp%2Fnxp%2Flinux-seco-imx%2F-%2Fblob%2Fseco_lf-6.6.23-2.0.0_d18-dev-memlogo%2Fdrivers%2Fspi%2Fspi-nxp-fspi.c%3Fref_type%3Dheads%22%20target%3D%22_self%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3ENXP%20FSPI%20Controller%20Driver%3C%2FA%3E%26nbsp%3Bis%20under%20drivers%2Fspi%2F.%20I%20was%20expecting%20it%20to%20play%20nice%20with%20spidev.%20So%20what%20am%20I%20missing%3F%20Why%20does%20spidev_test%20return%20an%20error%3F%3C%2FP%3E%3CP%3EBest%20regards%2C%3C%2FP%3E%3CP%3EBetheev%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2099073%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20Use%20flexspi%20controller%20to%20communicate%20with%20a%20device%20using%20regular%20SPI%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2099073%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%20%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F250572%22%20target%3D%22_blank%22%3E%40betheev%3C%2FA%3E!%3CBR%20%2F%3EThank%20you%20for%20contacting%20NXP%20Support!%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CP%3EThe%20SPI%20bus%20is%20working%20good%20by%20my%20side.%3C%2FP%3E%0A%3CP%3EWhat%20BSP%20version%20are%20you%20using%3F%3C%2FP%3E%0A%3CP%3EWhat%20board%20are%20you%20using%3F%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CP%3ECan%20you%20share%20your%20device%20tree%3F%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CP%3EBest%20Regards!%3CBR%20%2F%3EChavira%3C%2FP%3E%3C%2FLINGO-BODY%3E