This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AM625: OSPI flash memory of the EVK (PROC114E3) as a QSPI not working

Part Number: AM625

Hello,


we have tried to test OSPI flash memory of the EVK (PROC114E3) as a QSPI by doing suggested hardware and software modifications but we are not able to detect memory as a QSPI and it works fine as a OSPI.

We have followed suggestions for the software as per mentioned in below link but it is not working.

3.2.2.10. OSPI/QSPI — Processor SDK AM62x Documentation

&ospi0 {
        flash@0 {
                compatible = "spansion,s28hs512t","jedec,spi-nor";
                reg = <0x0>;
                spi-tx-bus-width = <1>;
                spi-rx-bus-width = <4>;
                spi-max-frequency = <25000000>;
                cdns,tshsl-ns = <60>;
                cdns,tsd2d-ns = <60>;
                cdns,tchsh-ns = <60>;
                cdns,tslch-ns = <60>;
                cdns,read-delay = <4>;
                cdns,phy-mode;

 

                partitions {
                        compatible = "fixed-partitions";
                        #address-cells = <1>;
                        #size-cells = <1>;

 

                        partition@0 {
                                label = "ospi.tiboot3";
                                reg = <0x0 0x80000>;
                        };

 

                        partition@80000 {
                                label = "ospi.tispl";
                                reg = <0x80000 0x200000>;
                        };

 

                        partition@280000 {
                                label = "ospi.u-boot";
                                reg = <0x280000 0x400000>;
                        };

 

                        partition@680000 {
                                label = "ospi.env";
                                reg = <0x680000 0x40000>;
                        };

                        partition@6c0000 {
                                label = "ospi.env.backup";
                                reg = <0x6c0000 0x40000>;
                        };

 

                        partition@800000 {
                                label = "ospi.rootfs";
                                reg = <0x800000 0x37c0000>;
                        };

 

                        partition@3fc0000 {
                                label = "ospi.phypattern";
                                reg = <0x3fc0000 0x40000>;
                        };
                };
        };
};

Error:

[    1.133941] spi spi0.0: setup: ignoring unsupported mode bits 200
[    1.140344] spi-nor spi0.0: unrecognized JEDEC id bytes: ff ff ff ff ff ff

Please suggest your precious thoughts and ways to resolve the issue.

Thanks,

chintan K

  • Hi chintan,

    let me find one of those boards and see how this needs to be configured. Will get back to you soon.

    Regards, Andreas

  • You can demonstrate 4-wire QSPI mode on our AM62-SK EVM by making the following changes:

    a0797059@dasso:~/git/linux (HEAD detached at 08.06.00.006)
    $ git diff
    diff --git a/arch/arm64/boot/dts/ti/k3-am625-sk.dts b/arch/arm64/boot/dts/ti/k3-am625-sk.dts
    index bd5463076e92..a2e484278dd8 100644
    --- a/arch/arm64/boot/dts/ti/k3-am625-sk.dts
    +++ b/arch/arm64/boot/dts/ti/k3-am625-sk.dts
    @@ -125,8 +125,8 @@ &ospi0 {
            spi_nor_flash: flash@0 {
                    compatible = "jedec,spi-nor";
                    reg = <0x0>;
    -               spi-tx-bus-width = <8>;
    -               spi-rx-bus-width = <8>;
    +               spi-tx-bus-width = <1>;
    +               spi-rx-bus-width = <4>;
                    spi-max-frequency = <25000000>;
                    cdns,tshsl-ns = <60>;
                    cdns,tsd2d-ns = <60>;
    diff --git a/arch/arm64/boot/dts/ti/k3-am62x-sk-common.dtsi b/arch/arm64/boot/dts/ti/k3-am62x-sk-common.dtsi
    index 95ca9e6482ba..2689f6a36dfe 100644
    --- a/arch/arm64/boot/dts/ti/k3-am62x-sk-common.dtsi
    +++ b/arch/arm64/boot/dts/ti/k3-am62x-sk-common.dtsi
    @@ -365,10 +365,6 @@ AM62X_IOPAD(0x00c, PIN_INPUT, 0) /* (E25) OSPI0_D0 */
                            AM62X_IOPAD(0x010, PIN_INPUT, 0) /* (G24) OSPI0_D1 */
                            AM62X_IOPAD(0x014, PIN_INPUT, 0) /* (F25) OSPI0_D2 */
                            AM62X_IOPAD(0x018, PIN_INPUT, 0) /* (F24) OSPI0_D3 */
    -                       AM62X_IOPAD(0x01c, PIN_INPUT, 0) /* (J23) OSPI0_D4 */
    -                       AM62X_IOPAD(0x020, PIN_INPUT, 0) /* (J25) OSPI0_D5 */
    -                       AM62X_IOPAD(0x024, PIN_INPUT, 0) /* (H25) OSPI0_D6 */
    -                       AM62X_IOPAD(0x028, PIN_INPUT, 0) /* (J22) OSPI0_D7 */
                            AM62X_IOPAD(0x008, PIN_INPUT, 0) /* (J24) OSPI0_DQS */
                    >;
            };

    Then booting with that DTB file you get the below entries in the Kernel log, indicating the OSPI device probe went well:

    root@am62xx-evm:~# dmesg | grep spi
    [    1.221081] spi-nor spi0.0: s28hs512t (65536 Kbytes)
    [    1.226115] 7 fixed-partitions partitions found on MTD device fc40000.spi.0
    [    1.233068] Creating 7 MTD partitions on "fc40000.spi.0":
    [    1.238462] 0x000000000000-0x000000080000 : "ospi.tiboot3"
    [    1.245188] 0x000000080000-0x000000280000 : "ospi.tispl"
    [    1.251529] 0x000000280000-0x000000680000 : "ospi.u-boot"
    [    1.257966] 0x000000680000-0x0000006c0000 : "ospi.env"
    [    1.264098] 0x0000006c0000-0x000000700000 : "ospi.env.backup"
    [    1.270876] 0x000000800000-0x000003fc0000 : "ospi.rootfs"
    [    1.277300] 0x000003fc0000-0x000004000000 : "ospi.phypattern"

    Then, as an additional experiment, when I remove the chip-select related pinmux entry
    AM62X_IOPAD(0x02c, PIN_OUTPUT, 0) /* (F23) OSPI0_CSn0 */
    I get basically the same error you reported:

    root@am62xx-evm:~# dmesg | grep spi
    [    1.220831] spi-nor spi0.0: unrecognized JEDEC id bytes: ff ff ff ff ff ff
    [    1.227774] spi-nor: probe of spi0.0 failed with error -2

    Regards, Andreas