Skip to content

Conversation

kevinwang821020
Copy link
Contributor

@kevinwang821020 kevinwang821020 commented Feb 6, 2025

This PR primarily updates the ATCDMAC driver. The updates include:

  1. Upgrading ATCDMAC to support compatibility with devices of the same series.
  2. Update config and overlay files for dma test cases. This includes adding config and overlay files for scatter_gather, as well as disabling DCACHE in loop_transfer and chan_blen_transfer since these two tests do not support the .nocache memory region.

@zephyrbot zephyrbot added area: RISCV RISCV Architecture (32-bit & 64-bit) area: DMA Direct Memory Access labels Feb 6, 2025
@kevinwang821020 kevinwang821020 force-pushed the dma_update_for_multi_serial branch from e22bc59 to b22929b Compare February 12, 2025 05:56
Copy link
Contributor

@teburd teburd left a comment

Choose a reason for hiding this comment

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

The change in compatible is likely to be a breaking change, are there no andes soc or boards in the tree that need updating? Release notes updated?

@kevinwang821020
Copy link
Contributor Author

@teburd Thank you for your reply. I'm not sure if you're referring to the SoC DTS part — if so, I’ve also updated the Andes AE350 device node(dts/riscv/andes/andes_v5_ae350.dtsi) in this PR.

@kevinwang821020 kevinwang821020 requested a review from teburd April 14, 2025 05:41
teburd
teburd previously approved these changes Apr 29, 2025
@kartben kartben requested a review from Copilot May 15, 2025 19:10
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR upgrades the ATCDMAC driver to support serial devices and improves compatibility by renaming driver identifiers and updating configuration, device tree, and build files. Key changes include:

  • Transitioning from ATCDMAC300 to a unified ATCDMACx00 driver with updated register offset handling.
  • Updating DT bindings and YAML files to support the new driver version.
  • Adjusting test configuration files and build scripts accordingly.

Reviewed Changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tests/drivers/dma/scatter_gather/boards/adp_xc7k_ae350.overlay Added overlay for scatter_gather test target.
tests/drivers/dma/scatter_gather/boards/adp_xc7k_ae350.conf Added config file enabling nocache memory and SoC PMA configuration.
tests/drivers/dma/loop_transfer/boards/adp_xc7k_ae350.conf
tests/drivers/dma/chan_blen_transfer/boards/adp_xc7k_ae350.conf
Updated test configurations to disable DCACHE support.
dts/riscv/andes/andes_v5_ae350.dtsi Changed compatible string and added max-data-width property.
dts/bindings/dma/andestech,atcdmacx00.yaml Added new DT binding file for the updated DMA driver.
dts/bindings/dma/andestech,atcdmac300.yaml Removed obsolete binding file.
drivers/dma/dma_andes_atcdmacx00.c Overhauled source code with new naming, updated register offset computations and chain-block management.
drivers/dma/Kconfig.andes_atcdmacx00
drivers/dma/Kconfig
drivers/dma/CMakeLists.txt
Updated build configuration and Kconfig to reference the new driver.
Comments suppressed due to low confidence (1)

drivers/dma/dma_andes_atcdmacx00.c:463

  • [nitpick] Consider adding a comment explaining the rationale behind using FIELD_GET for extracting the lower 32 bits of the address to clarify its usage for future maintenance and to ensure correct behavior on both 32- and 64-bit systems.
sys_write32((uint32_t)FIELD_GET(GENMASK(31, 0), (src)), DMA_CH_SRC_ADDR(dev, channel));

@kevinwang821020 kevinwang821020 requested a review from teburd May 28, 2025 00:49
@kevinwang821020
Copy link
Contributor Author

@teburd , sorry to bother you. Due to system requirements, I’m kindly requesting your review once again.
Thank you very much for your time and help—I truly appreciate it!
Also, if you know anyone who could help review this PR, I'd really appreciate it.
Thanks again for your assistance!

@kevinwang821020
Copy link
Contributor Author

Hi @fkokosinski
sorry to bother you — would you mind helping review this PR when you have a moment?
I really appreciate it!

@kevinwang821020
Copy link
Contributor Author

kevinwang821020 commented Jul 28, 2025

Rebased code based on changes in PR #90632 for atcdmac300.

@kevinwang821020 kevinwang821020 force-pushed the dma_update_for_multi_serial branch from 4e2c4e2 to 42e4dde Compare July 28, 2025 06:06
@kevinwang821020
Copy link
Contributor Author

kevinwang821020 commented Jul 28, 2025

@teburd
Sorry for the interruption, could you help review this PR again?

Because PR #90632 has introduced the cache operation for the chain_block (need both DCACHE and CACHE_MANAGEMENT are enabled).
And the board defalt Kconfig for adp_xc7k in test case at previous codebase had an incorrect setting(only enable NOCACHE_MEMORY, but driver does not support NOCACHE_MEMORY at that time).
These lead the PR #93697 results in a build failure after updating adp_xc7k's Kconfig.

To fix the issue, following action was performed in this PR
Beside rebased against PR #90632, integrated operations for various DCACHE, CACHE_MANAGEMENT, and NOCACHE_MEMORY enable scenarios.

teburd
teburd previously approved these changes Jul 31, 2025
Copy link
Contributor

@teburd teburd left a comment

Choose a reason for hiding this comment

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

Trusting an Andes author knows best here, but the chain struct is a bit hard to grasp the changes on. I see many of the values got moved to the offset struct instead. Some commentary on this would be good to see.

@kevinwang821020
Copy link
Contributor Author

I've updated the board's default config in the test cases. ==> Disabled DCACHE on dma test cases(even the test case support NONCACHE memory) because some Andes SoC don't support the portable noncached memory feature now.

@kevinwang821020 kevinwang821020 requested a review from teburd August 7, 2025 08:12
@kevinwang821020 kevinwang821020 force-pushed the dma_update_for_multi_serial branch from 0f3235e to 963bd42 Compare August 8, 2025 07:41
teburd
teburd previously approved these changes Aug 18, 2025
@kevinwang821020
Copy link
Contributor Author

@jimmyzhe,
Since you're familiar with the Andes platform, could you review this PR?
Thanks for your help

@jimmyzhe
Copy link
Contributor

Could you also update adp_xc7k/ae350/clic in tests/drivers/dma/chan_blen_transfer, loop_transfer, and scatter_gather? This platform was merged a few weeks ago.

…vice

1. Upgrade the ATCDMAC driver to make it compatible with multiple
   ATCDMAC series drivers.
2. Rename the driver from ATCDMAC300 to ATCDMACX00.

Signed-off-by: Kevin Wang <kevinwang821020@google.com>
@kevinwang821020 kevinwang821020 force-pushed the dma_update_for_multi_serial branch from 963bd42 to cb5b8af Compare August 21, 2025 09:14
@kevinwang821020 kevinwang821020 changed the title drivers: dma: atcdmac300: Upgrade atcdmac driver to support serial device drivers: dma: atcdmac300: Upgrade atcdmac driver to support series device Aug 21, 2025
@kevinwang821020 kevinwang821020 force-pushed the dma_update_for_multi_serial branch from cb5b8af to e930c22 Compare August 21, 2025 09:40
1. Add config and overlay file in test scatter_gather for adp_xc7k_ae350
   and adp_xc7k_ae350_clic to support the test case.
2. Modify the config file in test chan_blen_transfer and loop_transfer
   because the tests do not support the NOCACHE memory configuration,
   the DCACHE configuration needs to be disabled.

Signed-off-by: Kevin Wang <kevinwang821020@google.com>
@kevinwang821020 kevinwang821020 force-pushed the dma_update_for_multi_serial branch from e930c22 to fa14b84 Compare August 21, 2025 09:47
@kevinwang821020
Copy link
Contributor Author

Could you also update adp_xc7k/ae350/clic in tests/drivers/dma/chan_blen_transfer, loop_transfer, and scatter_gather? This platform was merged a few weeks ago.

Understood. The relevant source files have been updated and verified.

Copy link

Please retry analysis of this Pull-Request directly on SonarQube Cloud

@kartben kartben merged commit 618b6b4 into zephyrproject-rtos:main Aug 21, 2025
26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: DMA Direct Memory Access area: RISCV RISCV Architecture (32-bit & 64-bit) platform: Andes Technology
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants