-
Notifications
You must be signed in to change notification settings - Fork 8.1k
drivers: counter: sam: Introduce sama7g5 pit64b #93806
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
base: main
Are you sure you want to change the base?
drivers: counter: sam: Introduce sama7g5 pit64b #93806
Conversation
cab20e9 to
454c794
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.
Hi Xing,
You need to follow always the dependency order. In this case, you need to reorder the commits:
dts: arm: microchip: sam: add pit64b device to sama7g5
drivers: counter: add support for sama7g54 PIT64B
Then you need to proper extract and name those commits:
west: Add mchp sam pit64b dependency (when applicable)
dts: bindings: counter: Add mchp sam pit64b
soc: ? You need to add the early init because it is a pre-req to the driver.
drivers: counter: Introduce pit64b driver
boards: ? You need to consume the driver on a board
tests: ? You should enable the tests using that board (when applicable)
In the first commit, you create the binding and already can add the relevant nodes inside MPU dtsi.
In the drivers commit, you will put all the driver/kconfig/cmake work at once.
Finally you can consume the driver on a board.
This sequence allow each maintainer look in the topics that are relevant and do not break git bisect. If we see that something is missing in the hal, the west changes should be the first commit in the series using the reference pull/<pr number>/head.
BTW, we do not accept a driver that it is not build on a test or on a board.
454c794 to
daff86a
Compare
Hi Gerson, Thank you so much for this detailed guide! I have reorder these commits, please help to check.
For this issue: Many thanks. |
daff86a to
44a0874
Compare
44a0874 to
7d8dc4a
Compare
b7f5d08 to
b7cbe60
Compare
Hi Gerson, |
|
needs rebase |
b7cbe60 to
ab762ca
Compare
PR has been rebased. |
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.
No implicit boolean conversions in if-statements. https://docs.zephyrproject.org/latest/contribute/coding_guidelines/index.html#:~:text=85,N/A
ab762ca to
61d45bf
Compare
| k_spinlock_key_t key; | ||
|
|
||
| key = k_spin_lock(&data->lock); | ||
|
|
||
| *ticks = (uint32_t)pit_counter_value(config->regs); | ||
|
|
||
| k_spin_unlock(&data->lock, key); |
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.
Alternative is to use K_SPINLOCK, which is a bit cleaner IMO (doesn't work with return statements in the block).
K_SPINLOCK(&data->lock) {
*ticks = (uint32_t)pit_counter_value(config->regs);
}|
Xing, I think you need to rebase due to CI issues. |
Gerson, So, maybe this issue "Some checks were not successful" can be fixed by a rebase? |
Probably, a Python dependency was added on |
ahh, so if CI is broken then we need to wait the fix. |
A fix has already been merged to |
|
Many thanks for comments. |
Add pit64b1 ~ pit64b5 counter devices to sama7g5 Signed-off-by: CHEN Xing <[email protected]>
Add driver for sama7g54 PIT64B Use PIT64B as a zephyr counter device Signed-off-by: CHEN Xing <[email protected]>
Update mmu region for mchp sam pit64b Add gclk configuration for mchp sam pit64b Signed-off-by: CHEN Xing <[email protected]>
Add and enable pit64b1 counter device. Signed-off-by: CHEN Xing <[email protected]>
Counter devices can use this definition to specify alarm flags. Signed-off-by: CHEN Xing <[email protected]>
Add support for pit64b1 counter device. Signed-off-by: CHEN Xing <[email protected]>
61d45bf to
bab918b
Compare
|
I have rebase this PR, and the CI issue has gone. |
|
needs rebase |



Add counter driver for sama7g5 pit64b IP, use it as a standard zephyr counter device.
pit64 has only one compare register, by default pit64 counter device only have top_value channel, and have no alarm channel.
Didn't add support in samples/drivers/counter/alarm because pit64b counter device have no alarm channel by default.
Didn't add support in tests/drivers/counter/counter_basic_api because pit64b has no get_value() api, and get_value_64() should be used.