We're using the OSPI controller to connect to a quad SPI NOR flash, and we're trying to understand the Read Data Capture chapter and have some questions:
The OSPI module appears to be clocked with 133 MHz.
We want to run our flash device with 66MHz (or more) and the TRM chapter 12.3.2.4.2.1 states, that "The loopback mode (only for Quad flash devices) can work in two cases. [...] Thus SPI mode 0 is the first of two modes that support high MHz operation (greater than 50 MHz)."
- We assume that we should use the loopback mode?
- What clock excatly is looped back? Since the ICLK-Pin is missing on the AM65xx, is the OSPI_OCLK looped internally? We had a look at the K2G TRM, and it looks as if the OSPI chapter is (partially) a copy of the K2G QSPI documentation. The K2G has a dedicated QSPI_RCLK pin.
Further reading chapter 12.3.2.4.2.1.2 tells us that the DELAY_FLD bit field controls the additional number of read data capture cycles (this is the fast reference clock, running at least x4 of the device clock) that should be applied to the internal read data capture circuit.
- Does this mean that the delay mode only works if we configure the Baud Rate divisior of the OSPI controller to /4 or more? In our case this would lead to ~33MHz Flash operation, which is less than the stated 50Mhz above and thus does not require the loopback mode.
- Is the number of cycles of the DELAY_FLD always applied to the internal read data capture ciricuit or only if the BYPASS_FLD is set to 0x0?
Further comparing the AM65x TRM and the K2G TRM we saw that the K2G contained a paragraph that explained how the DELAY_FLD should be trained using Read ID STIG command, and that we should expect at least three valid settings, and use the middle one. In our tests we only ever had two working DELAY_FLD settings.
- Are there any guidelines for training the DELAY_FLD value for the AM65x?
Finally we tried to increase the OSPI reference clock in order to verify our assumption about baud rate divisor > 4 (reference clock needs to be at least x4 device clock), but we were unable to configure the OSPI clock to something higher. We tried using the following code snippet:
/* Fixup frequency of OSPI module */
uint64_t ospiFunClk = (uint64_t)(266000000);
Sciclient_pmSetModuleClkFreq(TISCI_DEV_MCU_FSS0, TISCI_DEV_MCU_FSS0_BUS_OSPI0_RCLK_CLK, ospiFunClk, TISCI_MSG_FLAG_AOP, SCICLIENT_SERVICE_WAIT_FOREVER);
Sciclient_pmGetModuleClkFreq(TISCI_DEV_MCU_FSS0, TISCI_DEV_MCU_FSS0_BUS_OSPI0_RCLK_CLK, &ospiFunClk, SCICLIENT_SERVICE_WAIT_FOREVER);
The returned value is always 133 MHz.
- Is there a way to find out about supported clock speeds?
Best Regards,
Dominic