clk: adi: sc846: allow CCF unused clock cleanup + clock tree corrections - #3506
clk: adi: sc846: allow CCF unused clock cleanup + clock tree corrections#3506qasim-ijaz wants to merge 2 commits into
Conversation
The DDR CDU gate must remain enabled while the system is running. This was previously masked by the clk_ignore_unused kernel parameter, which prevented unused clocks from being disabled. Mark the DDR CDU gate as CLK_IS_CRITICAL so that it remains enabled when unused clock cleanup is allowed to run. Signed-off-by: Qasim Ijaz <Qasim.Ijaz@analog.com>
CCLK2_x and DCLK1_x are derived directly from their respective CGU VCOs and divide their parent clocks by 3 and 5, respectively. They are currently incorrectly parented to the corresponding pllclk_half clocks. Correct the parent clocks of CCLK2_x and DCLK1_x to use the right CGU VCOs as specified by the HRM. Signed-off-by: Qasim Ijaz <Qasim.Ijaz@analog.com>
da50858 to
196423f
Compare
LLM reviewThis series fixes two bugs introduced with the ADI SC846 clock driver: an incorrect run: 32446712956
|
sipraga
left a comment
There was a problem hiding this comment.
You also mentioned something about a CCLK (?) getting disabled and causing a system hang, but I don't see a fix for that here. What was that?
| CLK_SET_RATE_PARENT, 1, 3); | ||
| clks[ADSP_SC846_CLK_CGU1_DCLK1_1] = | ||
| clk_register_fixed_factor(NULL, "dclk1_1", "cgu1_pllclk_half", | ||
| clk_register_fixed_factor(NULL, "dclk1_1", "cgu1_vco", |
There was a problem hiding this comment.
The diagram is unnecessarily confusing in the HRM haha, I see why it was like this to begin with
There was a problem hiding this comment.
Yes, while this driver was being written during initial bring up I thought the parent clocks were pllclk_half since I was going off the diagram itself. However calculating the rate for a CCLK2_x clock like CCLK2_1 is roughly: VCO rate * (1/3), and the VCO rate for CGU1 is 3600000000 so the CCLK2_1 rate should be 1200000000 (1.2GHz) but the current CCF clk dump shows 300000000, which is wrong. My suspicions were further confirmed because the DDR test files Arturs shared a few days ago (he shared them when you asked what the ARM core rate was in the chat you might remember) also say CCLK2_1's rate is 1200 Mhz aka 1.2GHz (my changes fix all this ofc)
There was a problem hiding this comment.
That also explains what I saw when trying to work out the nominal ARM clock frequency.
Yes so it turns out setting the ARM to clock via the "N/A" field in the CDU causes it to act as if it was clocked by CCLK0_1 (Im not sure if its actually clocked by that but im highly suspicious of it), I ran an experiment where I ensured ARM was clocked by "N/A" (which it already is) and then I disabled CCLK0_1 in both U-Boot and Linux and the system crashes/freezes on both. I then ran a second experiment where I reparented the ARM to a non-N/A field and then I tried to disable CCLK0_1 again and this time nothing happened. SO it seems N/A might be connected to CCLK0_1 or is itself CCLK0_1 or something, this also explains why DGM marked this as Anyways the right solution going forward is not to make CCLK0_1 a critical clock (thats more of a messy workaround imo), its to just stop using N/A, this is a U-Boot related fix which I am working on right now (I think that will have to be merged first before this to avoid breaking stuff) |
|
From the LLM:
Not sure this is right, the SC598 marks the final DDR mux as |
I guess the above is the outcome of consumers to not really care about clocks and just assuming they are enabled. As XSPI is concerned, after we're done with the clock rework I definitely want the xspi driver to get and enable it's clock (and honor spi_max_speed on the flash node which means |
PR Description
The SC846 SoCs currently rely on the
clk_ignore_unusedkernel command line parameter to prevent unused clocks from being disabled (mainly as a bring up related workaround). These fixes attempt to correct the clock driver so the system can boot without that parameter + it introduces a clock tree fix to correct the parent clocks of DCLK1_x and CCLK2_x.The following unused clocks are disabled by CCF as they have no consumers:
xspi1,sclk1_1,sclk0_1,oclk_1,lp,dclk_1,spdif,sclk1_0,can,oclk_0,pwm,mshc,trace, andxspi0.Related issue: #3476
PR Type
PR Checklist