-
Notifications
You must be signed in to change notification settings - Fork 6.9k
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
Fix renesas pll clock config #79766
Merged
mmahadevan108
merged 2 commits into
zephyrproject-rtos:main
from
renesas:fix_renesas_pll_clock_config
Nov 5, 2024
Merged
Fix renesas pll clock config #79766
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Copyright (c) 2024 Renesas Electronics Corporation | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
description: Renesas RA Clock Generation Circuit PLL Clock out line | ||
|
||
compatible: "renesas,ra-cgc-pll-out" | ||
|
||
include: [clock-controller.yaml, base.yaml] | ||
|
||
properties: | ||
div: | ||
required: true | ||
type: int | ||
freq: | ||
required: true | ||
type: int | ||
|
||
"#clock-cells": | ||
const: 0 |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 frequency originally input to the PLL is multiplied and divided by PLLMUL and PLLDIV, and the divided frequency is then further divided by P, Q, and R to determine the frequency.
Is the frequency set here reflecting PLLMUL and PLLDIV?
I would like to find this calculately if possible, but if it becomes too complicated I think this is fine.
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 , The fix is not relate to the calculation of PLL P Q R frequency but to separate them as device node so that other node can choose them as clock source, the previous patch only allow the node to choose <&pll> as clock source, now we can set <&pllp>, <&pllq>, <&pllr>. Frequency calculation is as your understanding.
Your request here is to create a macro for the frequency calculation instead of set them on device tree, is my understanding correct ?
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
I understood why the change is necessary.
This change separates PLLP, Q, and R into independent nodes, so I think it becomes necessary to correctly express their relationship with the PLL.
What I'm paying attention to is whether the device tree give an appropriate expression for the hardware configuration.
From the register configuration, it appears that PLLP, Q, and R are dividers that use the PLL as their source, so I don't think they have frequency attributes here, these has only 'ratio'.
Instead, I think we need to calculate the relationship to the PLL.
This is why we need a frequency calculation macro.
I think that a "fixed-factor-clock" like definition can be used for this node.
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 got it, I think for each clock node here we will need a clock driver to provide enough information for the child node, current clock design for now there is no good way to get pll frequency. So now, to keep it simple I would like to keep this implementation,
Next patch for clock driver we will update driver for each clock node and change PLL Q P R into fixed-factor-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.
I think there is no problem with proceeding as is, but if possible, it may be preferable to incorporate this change into 4.0.0 as well, since this would not result in any changes to the external interface.