-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
soc: renesas: ra: ra4m1: Migrate to FSP-based configuration #76794
base: main
Are you sure you want to change the base?
Conversation
The following west manifest projects have been modified in this Pull Request:
Note: This message is automatically posted and updated by the Manifest GitHub Action. |
2840072
to
78cb002
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.
@soburi , I think you need to brush up the PR. There are some changes for RA2A1 are mixed into.
78cb002
to
6da34c3
Compare
0708bdb
to
b58b9d0
Compare
Update done. |
source = <RA_PLL_SOURCE_MAIN_OSC>; | ||
div = <RA_PLL_DIV_2>; |
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.
wrong:
- source: define another clock and make it source using eg
clocks = <&main_osc>;
- divider should be given as integer
div = <2>;
.
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.
@duynguyenxa @quytranpzz
Are these properties actually used?
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.
@soburi , these properties are used to provide information for the bsp_clock_cfg.h in the hal layer:
#define BSP_CFG_PLL_SOURCE \
BSP_CLOCK_PROP_HAS_STATUS_OKAY_OR(DT_NODELABEL(pll), source, RA_PLL_SOURCE_DISABLE)
#define BSP_CFG_PLL_DIV BSP_CLOCK_PROP_HAS_STATUS_OKAY_OR(DT_NODELABEL(pll), div, RA_PLL_DIV_2)
#if DT_NODE_HAS_STATUS(DT_NODELABEL(pll), okay)
The BSP_CFG_PLL_SOURCE, and BSP_CFG_PLL_DIV BSP will be used in the bsp_clock_init() to configure PLL clock.
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.
FYI: We can't have HALisms in DT.
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.
@gmarull , the macro is defined in zephyr main repo, zephyr/include/zephyr/dt-bindings/clock/ra_clock.h
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.
it still looks wrong, why isn't div = <2>
? Are such values encoding what HAL expects?
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.
@gmarull , sorry for late response, it's expect the value map with HWM here for the pll.
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.
The root of this problem is that the DeviceTree is a hardware description language,
and how values are handled should not be mixed in here.
In other words, the DeviceTree should be able to describe semantic values; for example, if the division factor is 2, then it should be describable as "2", and it should be up to the implementation side, i.e., the .h or .c file, to convert this to bit notation.
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.
I splitted out this issue to #78365.
|
||
pclka: pclka { | ||
compatible = "renesas,ra-cgc-pclk"; | ||
clk_div = <RA_SYS_CLOCK_DIV_16>; |
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 underscores in properties please.
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.
I have created #78097.
I will fix it after this PR is merged.
soc/renesas/ra/ra4m1/Kconfig
Outdated
help | ||
Enable support for Renesas RA4M1 MCU series |
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.
help | |
Enable support for Renesas RA4M1 MCU series |
Update HAL to improve the BSP clock setting process. Signed-off-by: TOKITA Hiroshi <[email protected]>
Like some other string properties, I will add a derived form to FULL_NAME to make it easier to reference from macros. Signed-off-by: TOKITA Hiroshi <[email protected]>
Adding tests for DT_NODE_FULL_NAME_UNQUOTED(), DT_NODE_FULL_NAME_TOKEN(), and DT_NODE_FULL_NAME_UPPER_TOKEN(). Signed-off-by: TOKITA Hiroshi <[email protected]>
Changes the path name of a DTS node so that it can be used as the stem of a BSP macro. All nodes to be changed are referenced via labels, so only the name is changed. Signed-off-by: TOKITA Hiroshi <[email protected]>
DeviceTree typically references the clock source using the `clocks` property defined in `base.yaml`, so we'll change it to this. Also delete the custom clock source definitions in `renesas,ra-cgc-pclk-block.yaml`, `renesas,ra-cgc-pclk.yaml`, and `renesas,ra-cgc-pll.yaml`. Signed-off-by: TOKITA Hiroshi <[email protected]>
Move the process of replacing numerical values with macros to the header, and set the division ratio in a numeric without using macros in the device tree. Change `clk-div` defined in `renesas,ra-cgc-pclk.yaml` to `div`. Signed-off-by: TOKITA Hiroshi <[email protected]>
Adding the macros `RA_CGC_CLK_SRC` and `RA_CGC_CLK_DIV` that derive the BSP clock settings from the DeviceTree node settings. I also define some aliases to fill in the gaps with the BSP naming conventions. Signed-off-by: TOKITA Hiroshi <[email protected]>
b58b9d0
to
a722194
Compare
Change to use FSP to integrate with other Renesas RA series. Signed-off-by: TOKITA Hiroshi <[email protected]>
Since the Option Setting Memory area is set in FSP, the Kconfig value switches between using the FSP implementation or the existing Option Setting Memory implementation. Signed-off-by: TOKITA Hiroshi <[email protected]>
Switch the pinctrl driver to renesas,ra-pinctrl-pfs which can be used with FSP. Signed-off-by: TOKITA Hiroshi <[email protected]>
Switch the clock controller driver to renesas,ra-cgc-pclkblock which can be used with FSP. Signed-off-by: TOKITA Hiroshi <[email protected]>
Update configuration for migrate to FSP Signed-off-by: TOKITA Hiroshi <[email protected]>
Update configuration for migrate to FSP Signed-off-by: TOKITA Hiroshi <[email protected]>
Remove the renesas,ra-pinctrl driver, which is no longer needed after migrating to the FSP-based implementation. Signed-off-by: TOKITA Hiroshi <[email protected]>
Remove the renesas,ra-clock-generation-circuit driver, which is no longer needed after migrating to the FSP-based implementation. Signed-off-by: TOKITA Hiroshi <[email protected]>
a722194
to
7e0d6c4
Compare
Change to use FSP to integrate with other Renesas RA series.