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

hal: renesas: Replace the BSP clock settings with new macros. #36

Merged
merged 3 commits into from
Oct 1, 2024

Conversation

soburi
Copy link
Member

@soburi soburi commented Sep 12, 2024

To simplify the DeviceTree notation, we have introduced macros
that derive BSP macro definitions from DeviceTree values.
The clock settings were rewritten by it.

@soburi
Copy link
Member Author

soburi commented Sep 20, 2024

@duynguyenxa @KhiemNguyenT

Could you take a look?

#define BSP_CFG_I3CCLK_DIV BSP_CLOCK_PROP_HAS_STATUS_OKAY_OR(DT_NODELABEL(i3cclk), clk_div, 0)
#define BSP_CFG_UCK_SOURCE RA_CGC_CLK_SRC(DT_CLOCKS_CTLR(DT_NODELABEL(uclk)))
#define BSP_CFG_UCK_DIV RA_CGC_CLK_DIV(DT_NODELABEL(uclk), div, 1)
#define BSP_CFG_U60CK_SOURCE RA_CGC_CLK_SRC(DT_CLOCKS_CTLR(DT_NODELABEL(u64clk)))
Copy link
Member

Choose a reason for hiding this comment

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

@soburi , This seem to be a mistake

Suggested change
#define BSP_CFG_U60CK_SOURCE RA_CGC_CLK_SRC(DT_CLOCKS_CTLR(DT_NODELABEL(u64clk)))
#define BSP_CFG_U60CK_SOURCE RA_CGC_CLK_SRC(DT_CLOCKS_CTLR(DT_NODELABEL(u60clk)))

Copy link
Member Author

Choose a reason for hiding this comment

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

Thank you for catching.
I fixed it.
And found some mistakes in ra6m1, ra8d1 and ra8t1, also fixed.

#define BSP_CFG_LCDCLK_DIV BSP_CLOCK_PROP_HAS_STATUS_OKAY_OR(DT_NODELABEL(lcdclk), clk_div, 0)
#define BSP_CFG_UCK_SOURCE RA_CGC_CLK_SRC(DT_CLOCKS_CTLR(DT_NODELABEL(uclk)))
#define BSP_CFG_UCK_DIV RA_CGC_CLK_DIV(DT_NODELABEL(uclk), div, 1)
#define BSP_CFG_U60CK_SOURCE RA_CGC_CLK_SRC(DT_CLOCKS_CTLR(DT_NODELABEL(u64clk)))
Copy link
Member

Choose a reason for hiding this comment

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

@soburi , ditto

#define BSP_CFG_LCDCLK_DIV BSP_CLOCK_PROP_HAS_STATUS_OKAY_OR(DT_NODELABEL(lcdclk), clk_div, 0)
#define BSP_CFG_UCK_SOURCE RA_CGC_CLK_SRC(DT_CLOCKS_CTLR(DT_NODELABEL(uclk)))
#define BSP_CFG_UCK_DIV RA_CGC_CLK_DIV(DT_NODELABEL(uclk), div, 1)
#define BSP_CFG_U60CK_SOURCE RA_CGC_CLK_SRC(DT_CLOCKS_CTLR(DT_NODELABEL(u64clk)))
Copy link
Member

Choose a reason for hiding this comment

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

@soburi , diito

BSP_CFG_ADCCLK_DIV, BSP_CFG_ADCCLK_SOURCE, BSP_CFG_SDADCCLK_DIV and
BSP_CFG_SDADCCLK_SOURCE are not referenced. Removed these.

BSP_CLOCK_PROP_HAS_STATUS_OKAY_OR was renamed and moved into
`include/zephyr/drivers/clock_control`

Signed-off-by: TOKITA Hiroshi <[email protected]>
Replace the includeed header file from
`zephyr/dt-bindings/clock/ra_clock.h` to
`zephyr/drivers/clock_control/renesas_ra_cgc.h` to
standardize the macros.

Signed-off-by: TOKITA Hiroshi <[email protected]>
To simplify the DeviceTree notation, we have introduced macros
that derive BSP macro definitions from DeviceTree values.
The clock settings were rewritten by it.

Signed-off-by: TOKITA Hiroshi <[email protected]>
Copy link
Member

@duynguyenxa duynguyenxa left a comment

Choose a reason for hiding this comment

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

LGTM
@thaoluonguw , please take a look for this PR, related PR in Zephyr zephyrproject-rtos/zephyr#78365

@soburi
Copy link
Member Author

soburi commented Oct 1, 2024

@thaoluonguw
Could you take a look please?

Copy link
Collaborator

@thaoluonguw thaoluonguw left a comment

Choose a reason for hiding this comment

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

It's look good to me. Thank you.

@soburi
Copy link
Member Author

soburi commented Oct 1, 2024

@KhiemNguyenT
Can I ask for a merge please?

@KhiemNguyenT KhiemNguyenT merged commit 3dafd03 into zephyrproject-rtos:main Oct 1, 2024
@soburi soburi deleted the clock_rework branch October 1, 2024 07:02
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