Skip to content

Support SPI driver for Renesas RA6, RA4, RA2 devices #79285

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

Merged
merged 4 commits into from
Nov 25, 2024

Conversation

thaoluonguw
Copy link
Collaborator

@thaoluonguw thaoluonguw commented Oct 1, 2024

Add support for SPI driver for RA6, RA4, RA2 devices

  • RA6: EK_RA6E2, EK_RA6M1, EK_RA6M2, EK_RA6M3, EK_RA6M4, EK_RA6M5, FPB_RA6E1, FPB_RA6E2

  • RA4: EK_RA4W1, EK_RA4M2, EK_RA4M3, EK_RA4E2

  • RA2: EK_RA2A1

@thaoluonguw thaoluonguw added the platform: Renesas RA Renesas Electronics Corporation, RA label Oct 1, 2024
@zephyrbot
Copy link
Collaborator

zephyrbot commented Oct 1, 2024

The following west manifest projects have changed revision in this Pull Request:

Name Old Revision New Revision Diff

All manifest checks OK

Note: This message is automatically posted and updated by the Manifest GitHub Action.

@zephyrbot zephyrbot added manifest manifest-hal_renesas DNM This PR should not be merged (Do Not Merge) labels Oct 1, 2024
@thaoluonguw thaoluonguw force-pushed the support_renesas_ra6_spi branch from 3ea7407 to c21060e Compare October 11, 2024 16:29
@zephyrbot zephyrbot removed the DNM This PR should not be merged (Do Not Merge) label Oct 11, 2024
@thaoluonguw thaoluonguw requested a review from ydamigos October 11, 2024 17:23
@thaoluonguw thaoluonguw marked this pull request as ready for review October 11, 2024 17:23
@zephyrbot zephyrbot added the area: SPI SPI bus label Oct 11, 2024
@soburi
Copy link
Member

soburi commented Oct 11, 2024

Does this work with RA2, 4, 8?

@duynguyenxa duynguyenxa force-pushed the support_renesas_ra6_spi branch from c21060e to 7b62c6c Compare October 14, 2024 09:24
@thaoluonguw
Copy link
Collaborator Author

Hello @soburi,

Does this work with RA2, 4, 8?

It expects to work with RA2 and RA4. We are updating device tree and verifying for RA4 and RA2. They will be update later or in another PR.

For RA8, it already supported. It uses sci_b (spi_b_renesas_ra8.c).

@soburi
Copy link
Member

soburi commented Oct 14, 2024

Hello @soburi,

Does this work with RA2, 4, 8?

It expects to work with RA2 and RA4. We are updating device tree and verifying for RA4 and RA2. They will be update later or in another PR.

For RA8, it already supported. It uses sci_b (spi_b_renesas_ra8.c).

Understood. I was worried that the implementation would need to be tweaked for each model.

Copy link
Collaborator

@tbursztyka tbursztyka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All seems quite fine to me (but for the tiny comment I made on the code part)

Aside of this, could you split your first commit in 3:

  • one for the driver (its dts bindings and the actual driver)
  • one for the boards
  • and one for the tests

case SPI_EVENT_ERR_FRAMING: /* Framing error */
case SPI_EVENT_ERR_MODE_UNDERRUN: /* Underrun error */
spi_context_cs_control(&data->ctx, false);
spi_context_complete(&data->ctx, dev, 0);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this path seems to be the one for errors, but you still return 0 as code? (it should be -EIO)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tbursztyka: Thank you for your feedback, we updated it. Could you please re-check again?

@khoa-nguyen-18 khoa-nguyen-18 force-pushed the support_renesas_ra6_spi branch from 7b62c6c to ed3ff1d Compare October 28, 2024 06:56
@tbursztyka
Copy link
Collaborator

Can you rebase and push again? CI is failing but not from your commits

@khoa-nguyen-18 khoa-nguyen-18 force-pushed the support_renesas_ra6_spi branch from a12cc7a to a37abed Compare November 8, 2024 08:47
ydamigos
ydamigos previously approved these changes Nov 8, 2024
@khoa-nguyen-18
Copy link
Contributor

Add and merge SPI support for RA4, RA2 commits into SPI support for RA6 commits

@khoa-nguyen-18 khoa-nguyen-18 force-pushed the support_renesas_ra6_spi branch from 581e1dd to 330e613 Compare November 19, 2024 08:23
@khoa-nguyen-18
Copy link
Contributor

just rebase main to solve conflict

@thaoluonguw thaoluonguw changed the title Support SPI driver for Renesas RA6 devices Support SPI driver for Renesas RA6, RA4, RA2 devices Nov 19, 2024
tbursztyka
tbursztyka previously approved these changes Nov 19, 2024
khoa-nguyen-18 and others added 4 commits November 20, 2024 08:30
- Add SPI driver support for RA
- RA2A1 not support slave select keeping level so disable it
in Kconfig

Signed-off-by: Tri Nguyen <tri.nguyen.wj@bp.renesas.com>
Signed-off-by: Thao Luong <thao.luong.uw@renesas.com>
Signed-off-by: Khoa Nguyen <khoa.nguyen.xh@renesas.com>
Add device node support SPI driver for ra6-cm4, ra6-cm33,
ra4-cm4, ra4-cm33, ra2xx MCU

Signed-off-by: Tri Nguyen <tri.nguyen.wj@bp.renesas.com>
Signed-off-by: Thao Luong <thao.luong.uw@renesas.com>
Signed-off-by: Khoa Nguyen <khoa.nguyen.xh@renesas.com>
- Add SPI support for ek_ra6m1, ek_ra6m2, ek_ra6m3, ek_ra6m4,
ek_ra6m5, ek_ra6e2, fpb_ra6e1, fpb_ra6e2, ek_ra4e2, ek_ra4m2,
ek_ra4m3, ek_ra4w1, ek_ra2a1

- Add SPI support doc for these board

Signed-off-by: Tri Nguyen <tri.nguyen.wj@bp.renesas.com>
Signed-off-by: Thao Luong <thao.luong.uw@renesas.com>
Signed-off-by: Khoa Nguyen <khoa.nguyen.xh@renesas.com>
Add overlay and add config to support test spi_loopback for:
ek_ra6m1, ek_ra6m2, ek_ra6m3, ek_ra6m4, ek_ra6m5, ek_ra6e2,
fpb_ra6e1, fpb_ra6e2, ek_ra4w1, ek_ra4m2, ek_ra4m3, ek_ra4e2,
ek_ra2a1.

Signed-off-by: Tri Nguyen <tri.nguyen.wj@bp.renesas.com>
Signed-off-by: Thao Luong <thao.luong.uw@renesas.com>
Signed-off-by: Khoa Nguyen <khoa.nguyen.xh@renesas.com>
@khoa-nguyen-18
Copy link
Contributor

rebase main to solve conflicts

@stmofek
Copy link

stmofek commented Nov 22, 2024

Hallo,
since it’s been open for a while, I wanted to check if there are any outstanding issues or additional information needed to move it forward.
If there are any changes, tests, or documentation required, please let me know. I’m happy to address them promptly to help get the MR merged.
Best regards

@ydamigos ydamigos requested a review from tbursztyka November 22, 2024 12:50
@tbursztyka
Copy link
Collaborator

@stmofek every time a PR is updated, it looses its previous approvals.

@kartben kartben merged commit 8d7ae89 into zephyrproject-rtos:main Nov 25, 2024
35 checks passed
@khoa-nguyen-18 khoa-nguyen-18 deleted the support_renesas_ra6_spi branch December 10, 2024 08:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: SPI SPI bus platform: Renesas RA Renesas Electronics Corporation, RA
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants