-
Notifications
You must be signed in to change notification settings - Fork 7.1k
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
Add support for cadence SPI #87382
base: main
Are you sure you want to change the base?
Add support for cadence SPI #87382
Conversation
Hello @SrikanthGoud123, and thank you very much for your first pull request to the Zephyr project! |
Add devicetree binding for the Cadence SPI IP. Signed-off-by: Srikanth Boyapally <srikanth.boyapally@amd.com> Message-ID: <20250319100832.3986031-2-srikanth.boyapally@amd.com> State: pending
0b85bef
to
1f65dfa
Compare
drivers/spi/spi_cdns.c
Outdated
mm_reg_t base; | ||
void (*irq_config_func)(const struct device *dev); | ||
uint8_t num_ss_bits; | ||
uint32_t is_decoded_cs; |
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.
Change this 2 attributes to uint6_t, for better alignment.
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.
made changes as per you suggested
drivers/spi/spi_cdns.c
Outdated
}; | ||
|
||
struct cdns_spi_data { | ||
uint16_t slave; |
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.
move it at the end
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.
Done
drivers/spi/spi_cdns.c
Outdated
cdns_spi_cs_cntrl(dev, true); | ||
|
||
#ifdef CONFIG_CDNS_SPI_INTR | ||
do { |
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.
in this case, fifo r/w should happen in the isr. Or else, here it's going to do a back & forth between isr/user thread etc etc... thus more overhead.
It should just enable the interrupt, and wait for completion.
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.
Hi @tbursztyka
Thanks for the review.
changed the logic as per your suggestion.
Introduces the Cadence SPI IP driver. By adding support for master mode, the SPI controller enables the communications with variety of peripherals such as SPI-NOR flash memories, eeprom and Trusted Platform Module(TPM) devices and other peripherals. Additionally, the controller can operate in an external loopback test mode. Signed-off-by: Srikanth Boyapally <srikanth.boyapally@amd.com> Message-ID: <20250319100832.3986031-3-srikanth.boyapally@amd.com> State: pending
1f65dfa
to
69db7d9
Compare
Just realized @XenuIsWatching has made a previous PR about the same hw, in #85973 You'll need to sync. My position would be : first come first served. |
Introduces the Cadence SPI IP driver and dt bindings. By adding support for master mode, the SPI controller enables the communications with variety of peripherals such as SPI-NOR flash memories, eeprom and Trusted Platform Module(TPM) devices and other peripherals. Additionally, the controller can operate in an external loopback test mode