[PATCH v2 1/2] cpufreq: mediatek-hw: Add support for Mediatek cpufreq HW driver
Viresh Kumar
viresh.kumar at linaro.org
Thu Aug 27 00:26:53 EDT 2020
On 26-08-20, 20:57, Hector Yuan wrote:
> On Mon, 2020-08-24 at 15:36 +0530, Viresh Kumar wrote:
> > On 13-08-20, 15:07, Hector Yuan wrote:
> > > CONFIG_ARM_ALLWINNER_SUN50I_CPUFREQ_NVMEM=m
> > > CONFIG_ARM_ARMADA_37XX_CPUFREQ=y
> > > +CONFIG_ARM_MEDIATEK_CPUFREQ_HW=m
> >
> > What about a 'default m' in Kconfig itself ?
> > OK, will update in V3.
Hector, you need to remove (or not add) the right bracket (>) before the
beginning of your lines. This makes it incredibly difficult to read.
> > > + for (i = 0; i < LUT_MAX_ENTRIES; i++) {
> > > + data = readl_relaxed(base + (i * LUT_ROW_SIZE));
> > > + freq = FIELD_GET(LUT_FREQ, data) * 1000;
> > > + volt = FIELD_GET(LUT_VOLT, data);
> > > + if (freq != prev_freq) {
> > > + table[i].frequency = freq;
> > > + dev_pm_opp_add(cpu_dev, freq * 1000, volt);
> >
> > Why are you adding OPPs here and rather why using OPP specific stuff
> > at all in the driver ?
> > yes, the opp information is read from CPU HW engine.Then add it to the CPU dev OPP one by one.
I asked a different question, why are you adding OPPs ? You don't need the OPPs
at all in my opinion. You can just create the frequency table and that's it.
> > > + for_each_possible_cpu(cpu) {
> > > + cpu_np = of_cpu_device_node_get(cpu);
> > > + if (!cpu_np)
> > > + continue;
> > > +
> > > + ret = of_parse_phandle_with_args(cpu_np, "mtk,freq-domain",
> >
> > Where are bindings of this node and how does this look ?
> > Can refer to the same patch series, I split it to another patch.Each cpu will be group into one frequency domain for the CPU DVFS.
That binding only defines "mediatek,cpufreq-hw" and not "mtk,freq-domain".
--
viresh
More information about the Linux-mediatek
mailing list