Skip to content
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: dma: siwx917: Add DMA driver #65

Merged

Conversation

smalae
Copy link
Contributor

@smalae smalae commented Nov 15, 2024

Addition of DMA driver for Si91x

@smalae smalae force-pushed the feature/siwg91x-dma branch 5 times, most recently from fb76625 to abf2150 Compare November 18, 2024 07:23
@jerome-pouiller
Copy link
Contributor

Hello @smalae,

Could you configure git with your real name[1]:

git config --global user.name "Sai Santhosh Malae"
git config --global user.email "[email protected]"

(You can use git commit --amend --reset-author to change the author of existing commits).

In addition, could you follow the Zephyr Pull Request[2] guidelines[3].

[1] https://docs.zephyrproject.org/latest/contribute/guidelines.html#git-setup
[2] https://docs.zephyrproject.org/latest/contribute/guidelines.html#pull-request-guidelines
[3] https://docs.zephyrproject.org/latest/contribute/guidelines.html#contribution-workflow

@jerome-pouiller
Copy link
Contributor

The introduction letter of your PR properly identify three steps to introduce this driver (driver by itself, DT configuration and tests). I suggest to split your commits to reflect these steps. Thus, the review you be more efficient.

Could you also enable your tests in CI (.github/workflows/build.yml and .github/workflows/upstream-build.yml)

@smalae
Copy link
Contributor Author

smalae commented Nov 18, 2024

Hello @smalae,

Could you configure git with your real name[1]:

git config --global user.name "Sai Santhosh Malae"
git config --global user.email "[email protected]"

(You can use git commit --amend --reset-author to change the author of existing commits).

In addition, could you follow the Zephyr Pull Request[2] guidelines[3].

[1] https://docs.zephyrproject.org/latest/contribute/guidelines.html#git-setup [2] https://docs.zephyrproject.org/latest/contribute/guidelines.html#pull-request-guidelines [3] https://docs.zephyrproject.org/latest/contribute/guidelines.html#contribution-workflow

Sure @jerome-pouiller

@smalae
Copy link
Contributor Author

smalae commented Nov 18, 2024

The introduction letter of your PR properly identify three steps to introduce this driver (driver by itself, DT configuration and tests). I suggest to split your commits to reflect these steps. Thus, the review you be more efficient.

Could you also enable your tests in CI (.github/workflows/build.yml and .github/workflows/upstream-build.yml)

Sure, I will split into multiple commits

tests/drivers/dma/udma_tests/src/test_dma.c Outdated Show resolved Hide resolved
tests/drivers/dma/udma_tests/src/test_dma.c Outdated Show resolved Hide resolved
drivers/dma/Kconfig.siwx917 Outdated Show resolved Hide resolved
drivers/dma/dma_silabs_siwx917.c Outdated Show resolved Hide resolved
drivers/dma/dma_silabs_siwx917.c Outdated Show resolved Hide resolved
drivers/dma/dma_silabs_siwx917.c Outdated Show resolved Hide resolved
drivers/dma/dma_silabs_siwx917.c Outdated Show resolved Hide resolved
drivers/dma/dma_silabs_siwx917.c Outdated Show resolved Hide resolved
drivers/dma/dma_silabs_siwx917.c Outdated Show resolved Hide resolved
@smalae smalae force-pushed the feature/siwg91x-dma branch 4 times, most recently from 65ce8e1 to 775f722 Compare November 19, 2024 11:14
@smalae smalae marked this pull request as ready for review November 19, 2024 11:17
drivers/dma/dma_silabs_siwx917.c Outdated Show resolved Hide resolved
drivers/dma/dma_silabs_siwx917.c Outdated Show resolved Hide resolved
drivers/dma/dma_silabs_siwx917.c Outdated Show resolved Hide resolved
drivers/dma/dma_silabs_siwx917.c Show resolved Hide resolved
drivers/dma/dma_silabs_siwx917.c Outdated Show resolved Hide resolved
drivers/dma/dma_silabs_siwx917.c Outdated Show resolved Hide resolved
drivers/dma/dma_silabs_siwx917.c Outdated Show resolved Hide resolved
drivers/dma/dma_silabs_siwx917.c Outdated Show resolved Hide resolved
drivers/dma/dma_silabs_siwx917.c Outdated Show resolved Hide resolved
drivers/dma/dma_silabs_siwx917.c Outdated Show resolved Hide resolved
@smalae smalae force-pushed the feature/siwg91x-dma branch 2 times, most recently from 347269f to 5a0c8e4 Compare November 25, 2024 11:13
@jhedberg
Copy link
Collaborator

@smalae could you explain a bit what you mean by this part related to the new test case you're adding:

This test case does not need to be pushed upstream. It can only reside in Downstream.

Even though it doesn't need to be upstream and can reside downstream, is there a good reason to do that? If it's generic, i.e. can be applied to any DMA driver, then I think upstream is the right place for it. Keeping code purely downstream always comes with a maintenance overhead, so it's good to avoid that whenever possible.

@smalae
Copy link
Contributor Author

smalae commented Nov 26, 2024

@smalae could you explain a bit what you mean by this part related to the new test case you're adding:

This test case does not need to be pushed upstream. It can only reside in Downstream.

Even though it doesn't need to be upstream and can reside downstream, is there a good reason to do that? If it's generic, i.e. can be applied to any DMA driver, then I think upstream is the right place for it. Keeping code purely downstream always comes with a maintenance overhead, so it's good to avoid that whenever possible.

@jhedberg agreed that it will cause the maintenance overhead. But this test case is almost similar to the existing test case with a few additional tests added (different data sizes and transfer lengths). I feel adding this test case upstream may not be necessary. Is it okay to remove this test case from the PR and retain it in my fork? Anyhow, the basic DMA test chan_blen_transfer can be run by CI. @jerome-pouiller, your thoughts?

@smalae smalae force-pushed the feature/siwg91x-dma branch 3 times, most recently from efc52f3 to 869a6e4 Compare November 26, 2024 14:27
@smalae smalae force-pushed the feature/siwg91x-dma branch 3 times, most recently from 212f9f3 to 5b7ff89 Compare November 29, 2024 11:53
@smalae
Copy link
Contributor Author

smalae commented Nov 29, 2024

But this test case is almost similar to the existing test case with a few additional tests added (different data sizes and transfer lengths). I feel adding this test case upstream may not be necessary.

I'm still a bit confused by what you mean with "not necessary". I don't think that's the metric we should use for making downstream/upstream decisions. "Is it useful/beneficial?" is a better one. If there's something that upstream tests don't cover and that "something" can be applied to any DMA controller (or most controllers), then proposing a change upstream would likely be well received as long as it's implemented in a reasonable way (e.g. does some refactoring if the alternative is to add lots of duplicated test code).

Thank you for your feedback. I see your point about considering whether something is 'useful/beneficial' rather than just 'necessary.' However, in this case, my concern was more about the immediate scope and focus of the current implementation. While I agree that upstream changes can be beneficial when they address broader use cases, I believe that the proposed change may not fit well into the current scope without introducing unnecessary complexity or duplication. I'll revisit the idea with this in mind and ensure we stay aligned with the overall goals for simplicity and maintainability. For now, I am only going with the existing UDMA test case in Zephyr.

soc/silabs/silabs_siwx917/siwg917/linker.ld Show resolved Hide resolved
drivers/dma/dma_silabs_siwx917.c Outdated Show resolved Hide resolved
drivers/dma/dma_silabs_siwx917.c Outdated Show resolved Hide resolved
drivers/dma/dma_silabs_siwx917.c Outdated Show resolved Hide resolved
drivers/dma/dma_silabs_siwx917.c Outdated Show resolved Hide resolved
drivers/dma/dma_silabs_siwx917.c Outdated Show resolved Hide resolved
drivers/dma/dma_silabs_siwx917.c Outdated Show resolved Hide resolved
drivers/dma/dma_silabs_siwx917.c Outdated Show resolved Hide resolved
drivers/dma/dma_silabs_siwx917.c Outdated Show resolved Hide resolved
drivers/dma/dma_silabs_siwx917.c Outdated Show resolved Hide resolved
@smalae smalae force-pushed the feature/siwg91x-dma branch 2 times, most recently from 4e002f1 to c94c114 Compare December 5, 2024 06:00
Copy link
Contributor

@jerome-pouiller jerome-pouiller left a comment

Choose a reason for hiding this comment

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

Sorry, I haven't been able spot all the issues in one go. I know it is a bit annoying. I believe this is the last round.

drivers/dma/dma_silabs_siwx917.c Outdated Show resolved Hide resolved
drivers/dma/dma_silabs_siwx917.c Outdated Show resolved Hide resolved
drivers/dma/dma_silabs_siwx917.c Outdated Show resolved Hide resolved
drivers/dma/dma_silabs_siwx917.c Outdated Show resolved Hide resolved
drivers/dma/dma_silabs_siwx917.c Outdated Show resolved Hide resolved
drivers/dma/dma_silabs_siwx917.c Outdated Show resolved Hide resolved
drivers/dma/dma_silabs_siwx917.c Outdated Show resolved Hide resolved
drivers/dma/dma_silabs_siwx917.c Outdated Show resolved Hide resolved
drivers/dma/dma_silabs_siwx917.c Outdated Show resolved Hide resolved
drivers/dma/dma_silabs_siwx917.c Outdated Show resolved Hide resolved
@smalae smalae force-pushed the feature/siwg91x-dma branch from c94c114 to e2d5148 Compare December 9, 2024 05:58
@smalae smalae requested a review from a team as a code owner December 9, 2024 05:58
Copy link
Contributor

@jerome-pouiller jerome-pouiller left a comment

Choose a reason for hiding this comment

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

Still this small issue with dma_rom_buff and we will be fine.

drivers/dma/dma_silabs_siwx917.c Outdated Show resolved Hide resolved
drivers/dma/dma_silabs_siwx917.c Outdated Show resolved Hide resolved
@smalae smalae force-pushed the feature/siwg91x-dma branch 3 times, most recently from b0f9e86 to d546e47 Compare December 9, 2024 12:22
@smalae smalae force-pushed the feature/siwg91x-dma branch from d546e47 to 243e5a1 Compare December 9, 2024 14:13
Copy link
Contributor

@jerome-pouiller jerome-pouiller left a comment

Choose a reason for hiding this comment

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

Looks good. @smalae can you update the revision of hal_silabs in west.yml, so we can merge this PR.

@smalae smalae force-pushed the feature/siwg91x-dma branch from 243e5a1 to 0263c8b Compare December 10, 2024 05:31
Implement DMA driver for siwx917 using UDMA peripheral. Following Zephyr
DMA APIs are supported as part of this implementation,
1. dma_api_config
2. dma_api_reload
3. dma_api_start
4. dma_api_stop
5. dma_api_get_status

Signed-off-by: Sai Santhosh Malae <[email protected]>
@Martinhoff-maker Martinhoff-maker merged commit 1e3784e into SiliconLabsSoftware:main Dec 11, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants