STRUCT CCU_PLL_RATE_TBL(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸŽ€ struct ccu_pll_rate_tbl(9) πŸŽ€

okay so bestie, we're in the Kernel API Manual and this page is literally about a struct. a struct!! and she's the entire vibe of rate↔register mapping. let's go πŸ’…


✨ NAME ✨

struct ccu_pll_rate_tbl β€” the structure that maps between PLL rate and register configuration. that's it, that's the whole job, and she does it flawlessly πŸ’–


✨ SYNOPSIS ✨

struct ccu_pll_rate_tbl {
    unsigned long rate;
    u32 swcr1;
    u32 swcr2;
    u32 swcr3;
 };

like, four fields. clean. iconic. no notes πŸ‘‘


🌸 Members 🌸

  • rate β€” the PLL rate 🫢
  • swcr1 β€” value of register PLLx_SW1_CTRL
  • swcr2 β€” value of register PLLAx_SW2_CTRL
  • swcr3 β€” value of register PLLx_SW3_CTRL (yes it says lowercase value up there, keeping it real, we don't edit history πŸ’€)

✨ DESCRIPTION ✨

so the manual says: see below tables for the register used in PPL/PPLA clocks ✨ (that's PPL/PPLA, exactly how it's written, don't come for me πŸ™ˆ)

Regular PLL type β€” the way this one breaks down:

  • Enable β†’ swcr3 β†’ PLLx_SW3_CTRL - BIT[31]
  • Config β†’ swcr1 β†’ PLLx_SW1_CTRL - BIT[31:0]
  • swcr2 β†’ Not used
  • swcr3 β†’ PLLx_SW3_CTRL - BIT[30:0]

Special PLL type A β€” her whole different era:

  • Enable β†’ swcr2 β†’ PLLAx_SW2_CTRL - BIT[16]
  • Config β†’ swcr1 β†’ PLLAx_SW1_CTRL - BIT[31:0]
  • swcr2 β†’ PLLAx_SW2_CTRL - BIT[15:8]
  • swcr3 β†’ PLLAx_SW3_CTRL - BIT[31:0]

and because the original page serves these tables in their raw, unedited, slightly chaotic form (respect honestly 🫑), here they are verbatim so nothing gets lost in translation:

Regular PLL type | Enable | swcr3 | PLLx_SW3_CTRL - BIT[31]    |
----------------------------------------------- | Config | swcr1 |
PLLx_SW1_CTRL - BIT[31:0]  | |        | swcr2 | Not used
| |        | swcr3 | PLLx_SW3_CTRL - BIT[30:0]  |
Special PLL type A | Enable | swcr2 | PLLAx_SW2_CTRL - BIT[16]   |
----------------------------------------------- | Config | swcr1 |
PLLAx_SW1_CTRL - BIT[31:0] | |        | swcr2 | PLLAx_SW2_CTRL -
BIT[15:8] | |        | swcr3 | PLLAx_SW3_CTRL - BIT[31:0] |

ngl the bit fields are giving "read the table twice" energy, so lowkey just match the register and the BIT range and you're slaying πŸ”₯

heads up bestie: the exact bit positions above are the whole spec β€” don't eyeball them, copy them exactly. no guessing, no improvising, periodt πŸ’€

✨ SEE ALSO ✨

  • Kernel file ./drivers/clk/spacemit/ccu_pll.h β€” go read the real thing, iykyk πŸ¦‹

and that's the page!! πŸŽ€ source: ./drivers/clk/spacemit, dated October 2026 β€” mwah, go touch some registers, ily, bye πŸ’œβœ¨

πŸ“¦ where this page comes from