Hi Pavel,
Thanks for the example code. I'm not sure it answers my question, but I can see the send_get_bytes* functions in eSPI.zip do look fairly safe from TX FIFO overflows. However it seems like a waste of the FIFO to insert only one byte and then immediately wait for the FIFO to empty out before proceeding. Is there a reason for this? Also, why does it have to check that both TXCNT is 32 and TXE is set? Shouldn't one or the other be sufficient to let you know the TX FIFO is empty? And what happens if the the code is interrupted and TX FIFO remains empty for a while. Does the eSPI give up with an underrun, or send a dummy character, or does it hold the clock and resume when the TX FIFO eventually gets fed?
https://community.nxp.com/thread/463168 mentions AN3904 which has detailed information on these sorts of questions for an older chip. I was hoping for a pointer to something like that for the eSPI in the QorIQ chips.
For my original question. The T1040 Reference Manual says:
The eSPI core handshake protocol can be implemented by using a polling or interrupt mechanism. When using a polling mechanism, the core reads the SPIE in a predefined frequency and acts according to the value of the SPIE bits. The polling frequency depends on the eSPI serial channel frequency.
So I'm interested in a little more detail on the relationship between the "predefined frequency" at which I'm supposed to poll the SPIE and the eSPI serial channel frequency. If the channel frequency is 25MHz, does that mean I should only expect the SPIE to be updated on 25MHz intervals?