Re: [PATCH v6 1/4] dt-bindings: clock: rockchip: Add RK3572 CRU
From: Cunhao Lu
Date: Fri Nov 20 2026 - 04:41:04 EST
Hi Jonas,
Thank you for your review.
> [...]
> > +#define PCLK_DDR_MON 527
> > +
> > +/* Secure clocks */
> > +#define ACLK_CCI 600
> > +#define SCLK_DDR 601
> > +#define CLK_STIMER0_ROOT 602
> > +#define PCLK_SECURE_S 603
> > +#define HCLK_SECURE_S 604
> > +#define ACLK_SECURE_S 605
> > +#define CLK_PKA_CRYPTO_S 606
> > +#define PCLK_KLAD 607
> > +#define HCLK_CRYPTO_S 608
> > +#define HCLK_KLAD 609
> > +#define ACLK_CRYPTO_S 610
> > +#define PCLK_OTPC_S 611
> > +#define CLK_OTPC_S 612
> > +#define PCLK_WDT_S 613
> > +#define TCLK_WDT_S 614
> > +#define HCLK_TRNG_S 615
>
> Are these secure clocks meant to be used as SCMI clock ids? Why a gap from
> 527 to 600? If I am not mistaken SCMI ids should similar to Linux clock ids
> start at 0 and be a consecutive series.
Yes, these are SCMI clock IDs. The CRU IDs end at 527, but the SCMI
IDs are a separate set. The vendor header [1] uses 600-615 for this
group, matching the IDs in the released RK3572 BL31 firmware.
I haven't found the RK3572 BL31 source on GitHub, so I can't rebuild
the firmware. That also means I can't change the clock IDs it exposes
via SCMI. If I numbered this group from zero in the binding, Linux
would request ID 1 for the DDR clock, but the firmware on existing
boards expects 601. With those IDs, I wouldn't be able to read the
correct clock data on my board.
I'll add the SCMI_ prefix in the next version and keep the firmware IDs
unchanged.
> [...]
> > +/* CRU-->SOFTRST_CON01 */
> > +#define SRST_ARESETN_TOP_BIU 0
> > +#define SRST_PRESETN_TOP_BIU 1
> > +#define SRST_ARESETN_TOP_MID_BIU 2
> > +#define SRST_HRESETN_TOP_BIU 3
>
> Please drop the unnecessary/redundant RESETN in all constants. The SRST
> prefix is already a short for Software Reset.
I'll fix the names in the next version.
> Please see [1] for the header I prepared for U-Boot mainline RK3572 support,
> it should have all these symbols cleaned up, to match naming patterns used
> for all currently supported Rockchip SoCs.
>
> [1] https://git.u-boot-project.org/u-boot/contributors/kwiboo/u-boot/-/blob/rk3562/include/dt-bindings/reset/rockchip%2Crk3572-cru.h
Thanks, I'll follow the naming convention in your header in the next
revision. I did notice two possible issues with the reset IDs:
Your header skips 421 between SRST_LINKSYM_HDMITXPHY0 (420) and
SRST_P_PHPPHY_CRU (422). I've fixed this gap in the current patch.
Your header also assigns ID 453 to both SRST_H_PMU1_BIU and
SRST_H_PMU1_FW, but the lookup table [2] maps them to bits 9 and 10
of PMU1 SOFTRST_CON03, respectively. Could you confirm whether these
two reset lines are meant to share an ID?
[1] https://github.com/rockchip-linux/kernel/blob/470f9dccbdc42e7b8a824d0a5c5640a10e9457d2/include/dt-bindings/clock/rockchip,rk3572-cru.h#L542-L560
[2] https://git.u-boot-project.org/u-boot/contributors/kwiboo/u-boot/-/blob/85afc941266af08ab30a897dde794f952321025a/drivers/reset/rst-rk3572.c#L605-606
Best regards,
Cunhao Lu
pw-bot: cr