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: clock_control: add Ambiq clock control driver #63097

Merged

Conversation

aaronyegx
Copy link
Contributor

@aaronyegx aaronyegx commented Sep 26, 2023

This PR basically implements clock control driver for Ambiq Apollo series soc.
The clock control driver is mainly used to enable/disable the XTAL32MHz and XTAL32kHz and output it via specific IO to the dedicated modules, for example, the BLE controller inside of Apollo4 Blue Plus soc.
It is enabled in Apollo4 Blue Plus.

Verified the below Zephyr standard APIs worked as expected in apollo4p_blue_kxr_evb:

  • clock_control_configure()
  • clock_control_get_rate()
  • clock_control_on()
  • clock_control_off()

The configured clock IOs could output the accurate 32MHz and 32kHz clock and made the connected module (e.g., the BLE controller) work properly.

This PR should be merged after the HAL PR zephyrproject-rtos/hal_ambiq#8 merged.

@zephyrbot zephyrbot added manifest manifest-hal_ambiq DNM This PR should not be merged (Do Not Merge) labels Sep 26, 2023
@zephyrbot
Copy link
Collaborator

zephyrbot commented Sep 26, 2023

The following west manifest projects have been modified in this Pull Request:

Name Old Revision New Revision Diff
hal_ambiq zephyrproject-rtos/hal_ambiq@0a7c993 zephyrproject-rtos/hal_ambiq@0c5ea57 (main) zephyrproject-rtos/[email protected]

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

@gxyescut gxyescut force-pushed the add-clock-control-driver branch from 42a79c4 to a3e5e81 Compare September 26, 2023 12:40
@aaronyegx aaronyegx marked this pull request as ready for review September 26, 2023 13:39
@zephyrbot zephyrbot added platform: Ambiq Ambiq area: Devicetree Binding PR modifies or adds a Device Tree binding area: Clock Control labels Sep 26, 2023
@gxyescut gxyescut force-pushed the add-clock-control-driver branch 2 times, most recently from f603625 to 3b33b0d Compare September 27, 2023 03:22
@aaronyegx aaronyegx changed the title Add Ambiq clock control driver drivers: clock_control: add Ambiq clock control driver Sep 27, 2023
@aaronyegx
Copy link
Contributor Author

Hi @nordic-krch @MaureenHelm @carlescufi @galak @nashif, could you help take a look at this PR? Thank you very much.

@aaronyegx
Copy link
Contributor Author

Hi @MaureenHelm @fkokosinski @tgorochowik, if possible, could you take a look at this pull request? Thanks so much.

@aaronyegx
Copy link
Contributor Author

Hi @nordic-krch , could you help talk a look and let's know what I can do to move forward this PR? Thanks.

nordic-krch
nordic-krch previously approved these changes Oct 12, 2023
Copy link
Contributor

@nordic-krch nordic-krch left a comment

Choose a reason for hiding this comment

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

Sorry for the delay. It looks ok with one minor comment.

include/zephyr/drivers/clock_control/clock_control_ambiq.h Outdated Show resolved Hide resolved
MaureenHelm
MaureenHelm previously approved these changes Oct 18, 2023
dts/arm/ambiq/ambiq_apollo4p_blue.dtsi Outdated Show resolved Hide resolved
dts/arm/ambiq/ambiq_apollo4p_blue.dtsi Outdated Show resolved Hide resolved
nordic-krch
nordic-krch previously approved these changes Oct 23, 2023
@aaronyegx aaronyegx force-pushed the add-clock-control-driver branch from dcfb710 to 85d0345 Compare October 23, 2023 14:00
@aaronyegx
Copy link
Contributor Author

Thanks @fkokosinski for merging the corresponding HAL PR.
Hi @nordic-krch @MaureenHelm , thanks for your review and approving. I addressed your comments and updated the west.yaml with latest HAL revision. Could you take another look at this, please?

nordic-krch
nordic-krch previously approved these changes Oct 25, 2023
@aaronyegx
Copy link
Contributor Author

Hi @MaureenHelm , could you revisit this? Thanks.

@aaronyegx
Copy link
Contributor Author

aaronyegx commented Oct 27, 2023

Rebased the branch to solve the conflict. @MaureenHelm @nordic-krch Looking forward to your revisiting, sorry for inconvenience.

nordic-krch
nordic-krch previously approved these changes Oct 30, 2023
@aaronyegx
Copy link
Contributor Author

@nordic-krch Sorry I had to rebase again to solve new conflicts for this pending PR.

Hi @fkokosinski , could you take a look as well to help move forward this PR? Thanks very much.

@zchen-ambiq
Copy link

Hi, this is Zhongyi Chen from Ambiq. We could completely understand how busy you are with so many PRs to review. It'd greatly appreciated if you can help to review in time especially for those PRs sitting there a long time and their author addressing quickly to your comment. @nordic-krch @fabiobaltieri Thank you in advance.

@aaronyegx aaronyegx requested a review from MaureenHelm November 2, 2023 22:49
@aaronyegx
Copy link
Contributor Author

Hi @MaureenHelm , could you help revisit, please? Thank you.

nordic-krch
nordic-krch previously approved these changes Nov 3, 2023
drivers/clock_control/clock_control_ambiq.c Outdated Show resolved Hide resolved
drivers/clock_control/clock_control_ambiq.c Outdated Show resolved Hide resolved
drivers/clock_control/clock_control_ambiq.c Outdated Show resolved Hide resolved
drivers/clock_control/clock_control_ambiq.c Outdated Show resolved Hide resolved
@aaronyegx
Copy link
Contributor Author

Hi @fabiobaltieri thanks for your review, I addressed your comments.

@aaronyegx aaronyegx force-pushed the add-clock-control-driver branch from d4e1316 to 08212f4 Compare November 3, 2023 14:48
This commit adds Ambiq clock_control driver support.

Signed-off-by: Aaron Ye <[email protected]>
This commit instantiates the clock control for Apollo4 Blue Plus.

Signed-off-by: Aaron Ye <[email protected]>
This commit enables clock control instances for apollo4p_blue_kxr_evb.
Also adds pin configuration for each instance.

Signed-off-by: Aaron Ye <[email protected]>
This commit adds am_hal_mcuctrl.c for wide usage.

Signed-off-by: Aaron Ye <[email protected]>
@aaronyegx aaronyegx force-pushed the add-clock-control-driver branch from 08212f4 to be7baae Compare November 4, 2023 00:28
@aaronyegx
Copy link
Contributor Author

Hi @nordic-krch , could you help revisit again? Sorry to always dismiss your approving because of comment addressing and conflict resolving.

@carlescufi carlescufi merged commit 12eac1e into zephyrproject-rtos:main Nov 7, 2023
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants