[PATCH v4 10/21] PM / devfreq: rockchip-dfi: Add RK3568 support
Jonathan Cameron
Jonathan.Cameron at Huawei.com
Wed May 17 07:46:16 PDT 2023
> > > +
> > > + regmap_read(regmap_pmu, RK3568_PMUGRF_OS_REG2, ®2);
> > > + regmap_read(regmap_pmu, RK3568_PMUGRF_OS_REG3, ®3);
> > > +
> > > + dfi->ddr_type = FIELD_GET(RK3568_PMUGRF_OS_REG2_DRAMTYPE_INFO, reg2);
> > > +
> > > + if (FIELD_GET(RK3568_PMUGRF_OS_REG3_SYSREG_VERSION, reg3) >= 0x3)
> > > + dfi->ddr_type |= FIELD_GET(RK3568_PMUGRF_OS_REG3_DRAMTYPE_INFO_V3, reg3) << 3;
> >
> > This is unusual enough that I'd suggest some comments to say how
> > the bits are distributed across the two registers.
>
> I'd say in version 3 of the register structure they realized that they
> need two bits more for the ddr_type and have put them in BIT(12) and
> BIT(13) of RK3568_PMUGRF_OS_REG3. I think the code makes that
> sufficiently clear and apart from this code taken from the downstream
> kernel I don't have any documentation of these registers.
>
> Sascha
OK, that's fine.
Jonathan
>
More information about the Linux-rockchip
mailing list