-
Notifications
You must be signed in to change notification settings - Fork 6.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
drivers: espi: xec: Add support for eSPI flash channel #24214
drivers: espi: xec: Add support for eSPI flash channel #24214
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did not see FC interrupt enables set in the read routine. The FC write routine does have interrupt enables for FC Done and channel enable change.
@scottwcpg I have the FC interrupts enabled during initialization at espi_init_flash(), would that be enough? Should this be done for each transaction? |
OK, I did not see the interrupt enable in the init routine. You should be OK with interrupt enable in init. The is one corner case if you ever set the ABORT_ACCESS bit then HW will set DONE and ABORTED_BY_SLAVE which will fire the interrupt. |
23241f3
to
422b46a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The eSPI flash channel status register bits are read-write-1-to-clear. Performing a bit-wise OR to clear one bit results in clearing all active bits at the time the register is read. The other eSPI channels' status registers are the same.
@scottwcpg , could you further clarify? Or add the comment into the line of code?
|
Lines 880 and 886 in espi_mchp_xec.c are both in the ISR but I observe all write to eSPI HW status registers are using bit-wise OR. All the eSPI status register implement read-only or read-write-1-clear bits. The bit-wise OR may clear other bits if the other bits are read as "1" in the read modify write sequence. |
Got it. We have a widespread problem in the driver that will cause failures in corner cases (more than 1 bit set in these registers) during OR'd |
Ok, sounds like a plan. |
@scottwcpg Created #24464 to fix OOB and maybe peripheral channels Update register flash status access as indicated. |
422b46a
to
e285b9c
Compare
All checks are passing now. Tip: The bot edits this comment instead of posting a new one, so you can check the comment's history to see earlier messages. |
e285b9c
to
b037c12
Compare
Add driver implementation to support flash read/writ transactions over eSPI bus. Signed-off-by: Jose Alberto Meza <jose.a.meza.arellano@intel.com>
Extend sample code to demonstrate the eSPI API to read/write flash. Remove trailing \n Use LOG_ERR when applicable instead of LOG_WRN Treat warnings as errors. Signed-off-by: Jose Alberto Meza <jose.a.meza.arellano@intel.com>
drivers: espi: xec: Add support for eSPI flash channel
Add driver implementation to support flash read/writ transactions
over eSPI bus.
Depends partially on #23796