Because of the Thanksgiving holiday in the U.S., TI E2E™ design support forum responses may be delayed the week of November 23.

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 work frequency

Part Number: AM625

Hi:

      We use spi nor flash,  we want to run it at 100MHz. 
      Should we use the phy-mode and phypattern? How to enable phy-mode and phypattern?
      Could you please support us? Thank you.

  • Hello Tom Zhang,

    Thank you for your query !

    Would you please provide more information regarding the used SPI NOR Flash - the exact type of the Flash memory you use. Can you provide the datasheet.

    Please send the data to me using the private E2E chat if it can NOT be shared here !

    For read operations at 100 MHz you should use OSPI PHY master mode with two possible clock topologies depending on your memory:

    External Board Loopback with PHY data tuning (in case of a Quad-SPI memory, no DQS output)

    DQS to DQS connectivity (for Octal-SPI memory) with PHY data tuning

    I need to know the protocol you wish to use  such as  Octal-SPI / Quad-SPI / xSPI.

    Would you like to support AM625 ROM boot and/or custom SBL boot from the NOR SPI memory ? (Please consider that the ROM booting supports up to 50 MHz OSPI0_CLK frequencies.)

    I look forward to your response !

    Best Regards,

    Anastas Yordanov

  • Hi Anastas:

       The protocol is Quad-SPI
       The clk in rom maybe is 20M. We want it runs 100MHz in uboot and linux.

  • Hello Tom Zhang,

    From hardware point of view a PHY read access at OSPI0_CLK=100 MHz in Quad SPI mode ( ~50 MBytes / sec in PHY SDR or ~100 MBytes/sec in PHY DDR ) by proper software adjustments in the  U-Boot or Linux drivers  should be possible.

    With the assumption that most QSPI flashes do NOT have DQS pin, I recommend - External Board Loopback topology with PHY data tuning. If the memory package (more than 8 pins) has a hardware reset pin, I will recommend attaching it via some logic to the processor's RESETSTATz output pin. 

    Regarding my previous question: "Would you please provide more information regarding the used SPI NOR Flash - the exact type of the Flash memory you use. Can you provide the datasheet."

    I wanted this information to be able to assess the compatibility between the AM625 SoC and your selected Quad-SPI NOR Flash memory in terms of ROM supported QSPI boot protocol, as well as the electrical and timing parameters. I suppose you already did this. Let me know if you need help ?

    The clk in rom maybe is 20M.

     With AM625 ROM "QSPI Boot Mode" you should have OSPI0_CLK running at 50 MHz after the initial phase. With 20MHz I am not sure, which one is the boot mode you use. Would you specify the BOOTMODE settings with which you successfully boot from the QSPI Flash memory ?

    Thank you !

    Best Regards,

    Anastas Yordanov

  • Hi Anastas:

        The BOOTMODE is QSPI NOR, No DQS output.

        In the dts of uboot and linux, 

       &ospi0 {

           flash0{

            spi-max-frequency = <100000000>;

            cdns,phy-mode;
          };

          partitions {

                 ......

                 partitionxxxxxx{

                         label = "phypattern";

                         ......

                } ;

                 ......

          ];   

       };

       Does this changes support phy mode for QPSI nor runs at 100MHz?

  • Hi Tom Zhang,

    Thank you for the update !

    No DQS output.

    Can you confirm the External Board Loopback is your chosen OSPI0 hardware clocking topology ?

    The chosen ROM QSPI BOOTMODE (1S-1S-4S) shall be fine. For 100 MHz stable read access operations in the customized U-Boot and Linux app, please make sure to have:

    1. The AM625 output pin OSPI0_LBCLKO connected through a dummy series resistor 0R to the AM625 OSPI0_DQS input. The LBCLKO -> DQS connecting PCB trace length shall follow the guide in the AM62x Datasheet / Section, OSPI/QSPI/SPI Board Design and Layout Guidelines /Section, External Board Loopback.

    2. Select OSPI PHY SDR with PHY Data Tuning

    3. Select OSPI PHY DDR with PHY Data tuning

     I will let our Linux SDK OSPI driver expert comment on the corrections necessary for the U-Boot / Linux device tree source. Please expect that some delay in the response may be possible depending on his workload.

    Thanks

    Best Regards,

    Anastas Yordanov

  • Hi Tom,

    Quoting from doc: https://software-dl.ti.com/processor-sdk-linux/esd/AM62X/latest/exports/docs/linux/Foundational_Components/U-Boot/UG-QSPI.html

    1. "spi-max-frequency: defines the maximum frequency in Hertz at which the SPI bus can operate. Set 1/4th or 1/8th of ‘assigned-clocks’ value of ‘ospi0’ node for SDR and DDR mode respectively. If PHY Calibration is enabled, this value is ignored, and the maximum frequency is determined by the value specified in the ‘assigned-clocks’ property of ‘ospi0’ node."

      So, setting spi-max-frequency on the DT does nothing in this case.

    2. The partition label is wrong. You've used label = "phypattern".
      TI's driver does a literal string match, and every reference DTS (AM625 SK, AM62A, AM62A-LP NAND) uses the <mtd-prefix>.phypattern form.

      The pattern partition must be named exactly ospi.phypattern, and you still have to flash TI's ospi_phy_pattern binary to that offset (last erase sector) via sf update.

    Regards,
    Vinu

  • Hi Vinuchandran:

        Does phy mode works on QSPI nor flash?

        In flash driver, it loads phypattern file by searching the offset of label "<mtd-prefix>.phypattern" from partition sub-node. I don't find it should be the last erase sector in flash driver. Can the driver load phypattern file if it isn't the last erase sector?

  • Hi Tom,

    1. As  mentioned earlier, for a Quad flash with no DQS pin, PHY read tuning is supported via the External Board Loopback topology.

    2. No, that's just where TI puts it in their example DTS, not something the driver enforces. The pattern can be located at any address other than 0x0, and it can be relocated by simply updating the "ospi.phypattern" partition entry in the device tree.
      Refer: AM6442: PHY calibration for OSPI 

    Regards,
    Vinu

  • Hi Vinuchandran:

        There is no DQS pin on nor flash, and not External Board Loopback. 

        In 5.4.1 of TRM, if no DQS and bootmode8 = 1(not External Board Loopback), the clk is low speed, it should be <= 50MHz.

        If  support clk > 50MHz,  1. the flash has DQS signal or  2. bootmode8 = 0(External Board Loopback), right?

  • Hi Tom,

    This is correct. Since the flash has no DQS pin, we'd need External Board Loopback (BOOTMODE8=0) to get past 50 MHz.

    Regards,
    Vinu

  • Hi Vinuchandran:

        Thank you.

        For SDR, you said, the spi-max-frequency is 1/4th of ‘assigned-clocks’ value of 'ospi0' node.

        In dts, the assigned-clocks is 166666666, so the spi-max-frequency is 41666666,right?

        Is 166666666 is the max value of assigned-clocks of ospi0 node?Can we set the value > 166666666?

  • Hi Tom,

    That is taken directly from the Processor SDK documentation.

    166666666 is not an architectural hard ceiling. But it's only applicable in TAP mode.

    Refer:  AM625: OSPI Throughput 

    Once PHY mode is active, spi-max-frequency is ignored entirely and OSPI0_CLK just equals whatever assigned-clock-rates you set on &ospi0.

    Regards,
    Vinu

  • Hi Vinuchandran:

        What is TAP mode?

        We can't use PHY mode as there is no DQS pin and external loopback.Can we set the assigned-clocks as 200MHz, and set the spi-max-frequency as 50MHz, so that the spi nor flash can work as 50MHz? 

  • Hi,

        What is TAP mode?

    Please refer https://www.ti.com/lit/an/spva044a/spva044a.pdf?ts=1785304039189 for understanding about the modes.

    Can we set the assigned-clocks as 200MHz, and set the spi-max-frequency as 50MHz, so that the spi nor flash can work as 50MHz? 

    Should be possible.

    Regards,
    Vinu

  • Hi Vinuchandran:

       How to check if we are using TAP mode or check which mode we are using?

       Are there only TAP mode or PHY mode? If we can't use PHY mode , the mode we can use is only TAP mode?

       Is 166666666 is the max clk value of TAP mode?

  • Hi Tom,

    Functionally there are only 2 modes. TAP and PHY.

    TAP mode :  fixed internal capture delay, set manually via cdns,read-delay, no calibration

    PHY mode : calibrated capture delay, tuned against the phypattern data at probe time

    From Linux, please try running 

    dmesg | grep -iE "cadence|qspi|phy"

    to identify the mode. Otherwise you'll have to check the PHY_EN bit on the Cadence controller's CONFIG register.

     Is 166666666 is the max clk value of TAP mode?

    As I mentioned earlier, it's not a hard ceiling.

    166666666 is not an architectural hard ceiling. But it's only applicable in TAP mode.
    Should be possible.

    If you actually wanted to run TAP mode right up against the real 50 MHz ceiling, you need to pick a reference clock where the divisor lands you closer to 50 MHz (which is 200Mhz)

    Please go through the links that I've shared earlier.

    Regards,
    Vinu

  • Hi Vinuchandran:

        Thank you for your help.

        Now, we don't modify the assigned-clocks(166MHz) of ospi0 node,  and set spi-max-frequency as 41.67M (1/4 of 166MHz) without PHY mode.

  • Sure, Tom.

    Regards,
    Vinu