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: support numaker 64-bit clock module index (draft 2) #2

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ccli8
Copy link
Owner

@ccli8 ccli8 commented Jun 17, 2024

This is a draft of supporting 64-bit clock module index on NuMaker SoC series.
Relevant points include:

  1. No m55m1x yet, take m2l31x as an example
  2. In binding file nuvoton,numaker-pcc.yaml, add clock cell clock-module-index-hi32
  3. In clock header file for DT, 64-bit value of FOO_MODULE macro expands to two 32-bit cells in BE order
    NOTE: See dt-bindings/clock/numaker_m2l31x_clock.h
    NOTE: Check the link for requirement of 64-bit integer in zephyr
    https://docs.zephyrproject.org/latest/build/dts/intro-syntax-structure.html
  4. Clock ontrol driver is soc-conditional on clock module index
  5. Other drivers (gpio, serial, etc.) also must be soc-conditional on clock module index

Changes to existent soc port (taking m46x as an example):

  1. In m46x.dtsi, change #clock-cells to 4 from 3
  2. Re-generate numaker_m46x_clock.h which has FOO_MODULE macro expanding to two cells, with MSB cell being 0x0
  3. No need to change other drivers for not supporting 64-bit module index

…aft 2)

This is a draft of supporting 64-bit clock module index on NuMaker SoC series.
Relevant points include:
1. No m55m1x yet, take m2l31x as an example
2. In binding file nuvoton,numaker-pcc.yaml, add clock cell clock-module-index-hi32
3. In clock header file for DT, 64-bit value of FOO_MODULE macro expands to two 32-bit cells in BE order
   NOTE: See dt-bindings/clock/numaker_m2l31x_clock.h
   NOTE: Check the link for requirement of 64-bit integer in zephyr
         https://docs.zephyrproject.org/latest/build/dts/intro-syntax-structure.html
4. In clock ontrol driver,
   (1) Type of clock module is fixed to uint64_t
   (2) SoC-conditional on type of clock module index on passed to BSP driver
5. Other drivers (gpio, serial, etc.) also must be soc-conditional on clock module index

Changes to existent soc port (taking m46x as an example):
1. In m46x.dtsi, change #clock-cells to 4 from 3
2. Re-generate numaker_m46x_clock.h which has FOO_MODULE macro expanding to two cells, with MSB cell being 0x0
3. No need to change other drivers for not supporting 64-bit module index

Signed-off-by: Chun-Chieh Li <[email protected]>
@ccli8 ccli8 force-pushed the nvt_clock_module_index_64bit_d2 branch from 47bfb61 to 8cca51e Compare June 17, 2024 06: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.

1 participant