Re: [Patch v1 3/3] cpufreq: tegra194: Add support for Tegra234

From: Sumit Gupta
Date: Tue Mar 22 2022 - 08:06:39 EST




On 22/03/22 11:20, Viresh Kumar wrote:
External email: Use caution opening links or attachments


On 16-03-22, 19:28, Sumit Gupta wrote:
@@ -442,6 +538,13 @@ static int tegra194_cpufreq_probe(struct platform_device *pdev)
if (!data->tables)
return -ENOMEM;

+ if (of_device_is_compatible(pdev->dev.of_node, "nvidia,tegra234-ccplex-cluster")) {

Since you have soc specific data, that should be used here to know if you need
to map registers or not. You shouldn't use device-compatible here again.
SoC data struct has 'actmon_cntr_base' field which will be populated for SoC's using MMIO. Will use this to check before doing ioremap and add the change in v2.

struct tegra_cpufreq_soc {
struct tegra_cpufreq_ops *ops;
int maxcpus_per_cluster;
phys_addr_t actmon_cntr_base;
};

if (soc->actmon_cntr_base) {
/* mmio registers are used for frequency request and re-construction */
data->regs = devm_platform_ioremap_resource(pdev, 0);
if (IS_ERR(data->regs))
return PTR_ERR(data->regs);
}


+ /* mmio registers are used for frequency request and re-construction */
+ data->regs = devm_platform_ioremap_resource(pdev, 0);
+ if (IS_ERR(data->regs))
+ return PTR_ERR(data->regs);
+ }
+
platform_set_drvdata(pdev, data);

bpmp = tegra_bpmp_get(&pdev->dev);
@@ -486,6 +589,7 @@ static int tegra194_cpufreq_remove(struct platform_device *pdev)

static const struct of_device_id tegra194_cpufreq_of_match[] = {
{ .compatible = "nvidia,tegra194-ccplex", .data = &tegra194_cpufreq_soc },
+ { .compatible = "nvidia,tegra234-ccplex-cluster", .data = &tegra234_cpufreq_soc },
{ /* sentinel */ }
};

--
2.17.1

--
viresh