• Home
  • Raw
  • Download

Lines Matching +full:tegra186 +full:- +full:bpmp

15 #include <linux/dma-mapping.h>
20 #include <soc/tegra/bpmp.h>
21 #include <soc/tegra/bpmp-abi.h>
33 #define NO_CPU -1
66 for (i = 0; i < data->num_clusters; i++) { in tegra186_cpufreq_init()
67 struct tegra186_cpufreq_cluster *cluster = &data->clusters[i]; in tegra186_cpufreq_init()
69 cluster->info; in tegra186_cpufreq_init()
72 for (core = 0; core < ARRAY_SIZE(info->cpus); core++) { in tegra186_cpufreq_init()
73 if (info->cpus[core] == policy->cpu) in tegra186_cpufreq_init()
76 if (core == ARRAY_SIZE(info->cpus)) in tegra186_cpufreq_init()
79 policy->driver_data = in tegra186_cpufreq_init()
80 data->regs + info->offset + EDVD_CORE_VOLT_FREQ(core); in tegra186_cpufreq_init()
81 policy->freq_table = cluster->table; in tegra186_cpufreq_init()
85 policy->cpuinfo.transition_latency = 300 * 1000; in tegra186_cpufreq_init()
93 struct cpufreq_frequency_table *tbl = policy->freq_table + index; in tegra186_cpufreq_set_target()
94 void __iomem *edvd_reg = policy->driver_data; in tegra186_cpufreq_set_target()
95 u32 edvd_val = tbl->driver_data; in tegra186_cpufreq_set_target()
103 .name = "tegra186",
112 struct platform_device *pdev, struct tegra_bpmp *bpmp, in init_vhint_table() argument
123 virt = dma_alloc_coherent(bpmp->dev, sizeof(*data), &phys, in init_vhint_table()
126 return ERR_PTR(-ENOMEM); in init_vhint_table()
139 err = tegra_bpmp_transfer(bpmp, &msg); in init_vhint_table()
145 for (i = data->vfloor; i <= data->vceil; i++) { in init_vhint_table()
146 u16 ndiv = data->ndiv[i]; in init_vhint_table()
148 if (ndiv < data->ndiv_min || ndiv > data->ndiv_max) in init_vhint_table()
152 if (i > 0 && ndiv == data->ndiv[i - 1]) in init_vhint_table()
158 table = devm_kcalloc(&pdev->dev, num_rates + 1, sizeof(*table), in init_vhint_table()
161 table = ERR_PTR(-ENOMEM); in init_vhint_table()
165 for (i = data->vfloor, j = 0; i <= data->vceil; i++) { in init_vhint_table()
167 u16 ndiv = data->ndiv[i]; in init_vhint_table()
170 if (ndiv < data->ndiv_min || ndiv > data->ndiv_max) in init_vhint_table()
174 if (i > 0 && ndiv == data->ndiv[i - 1]) in init_vhint_table()
181 point->driver_data = edvd_val; in init_vhint_table()
182 point->frequency = data->ref_clk_hz * ndiv / data->pdiv / in init_vhint_table()
183 data->mdiv / 1000; in init_vhint_table()
189 dma_free_coherent(bpmp->dev, sizeof(*data), virt, phys); in init_vhint_table()
197 struct tegra_bpmp *bpmp; in tegra186_cpufreq_probe() local
201 data = devm_kzalloc(&pdev->dev, sizeof(*data), GFP_KERNEL); in tegra186_cpufreq_probe()
203 return -ENOMEM; in tegra186_cpufreq_probe()
205 data->clusters = devm_kcalloc(&pdev->dev, ARRAY_SIZE(tegra186_clusters), in tegra186_cpufreq_probe()
206 sizeof(*data->clusters), GFP_KERNEL); in tegra186_cpufreq_probe()
207 if (!data->clusters) in tegra186_cpufreq_probe()
208 return -ENOMEM; in tegra186_cpufreq_probe()
210 data->num_clusters = ARRAY_SIZE(tegra186_clusters); in tegra186_cpufreq_probe()
212 bpmp = tegra_bpmp_get(&pdev->dev); in tegra186_cpufreq_probe()
213 if (IS_ERR(bpmp)) in tegra186_cpufreq_probe()
214 return PTR_ERR(bpmp); in tegra186_cpufreq_probe()
217 data->regs = devm_ioremap_resource(&pdev->dev, res); in tegra186_cpufreq_probe()
218 if (IS_ERR(data->regs)) { in tegra186_cpufreq_probe()
219 err = PTR_ERR(data->regs); in tegra186_cpufreq_probe()
223 for (i = 0; i < data->num_clusters; i++) { in tegra186_cpufreq_probe()
224 struct tegra186_cpufreq_cluster *cluster = &data->clusters[i]; in tegra186_cpufreq_probe()
226 cluster->info = &tegra186_clusters[i]; in tegra186_cpufreq_probe()
227 cluster->table = init_vhint_table( in tegra186_cpufreq_probe()
228 pdev, bpmp, cluster->info->bpmp_cluster_id); in tegra186_cpufreq_probe()
229 if (IS_ERR(cluster->table)) { in tegra186_cpufreq_probe()
230 err = PTR_ERR(cluster->table); in tegra186_cpufreq_probe()
235 tegra_bpmp_put(bpmp); in tegra186_cpufreq_probe()
246 tegra_bpmp_put(bpmp); in tegra186_cpufreq_probe()
259 { .compatible = "nvidia,tegra186-ccplex-cluster", },
266 .name = "tegra186-cpufreq",
275 MODULE_DESCRIPTION("NVIDIA Tegra186 cpufreq driver");