Commit 7e5c4c26 authored by Arnd Bergmann's avatar Arnd Bergmann

Merge tag 'tegra-for-5.1-clk' of...

Merge tag 'tegra-for-5.1-clk' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux into arm/drivers

clk: tegra: Changes for v5.1-rc1

This contains a couple of prerequisite patches to enable CPU frequency
scaling on Tegra210.

* tag 'tegra-for-5.1-clk' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux:
  clk: tegra: dfll: build clk-dfll.c for Tegra124 and Tegra210
  clk: tegra: dfll: add CVB tables for Tegra210
  clk: tegra: dfll: round down voltages based on alignment
  clk: tegra: dfll: support PWM regulator control
  clk: tegra: dfll: CVB calculation alignment with the regulator
  clk: tegra: dfll: registration for multiple SoCs
Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
parents f35635a6 8bf9437a
...@@ -5,3 +5,8 @@ config TEGRA_CLK_EMC ...@@ -5,3 +5,8 @@ config TEGRA_CLK_EMC
config CLK_TEGRA_BPMP config CLK_TEGRA_BPMP
def_bool y def_bool y
depends on TEGRA_BPMP depends on TEGRA_BPMP
config TEGRA_CLK_DFLL
depends on ARCH_TEGRA_124_SOC || ARCH_TEGRA_210_SOC
select PM_OPP
def_bool y
...@@ -20,7 +20,7 @@ obj-$(CONFIG_ARCH_TEGRA_2x_SOC) += clk-tegra20.o ...@@ -20,7 +20,7 @@ obj-$(CONFIG_ARCH_TEGRA_2x_SOC) += clk-tegra20.o
obj-$(CONFIG_ARCH_TEGRA_3x_SOC) += clk-tegra30.o obj-$(CONFIG_ARCH_TEGRA_3x_SOC) += clk-tegra30.o
obj-$(CONFIG_ARCH_TEGRA_114_SOC) += clk-tegra114.o obj-$(CONFIG_ARCH_TEGRA_114_SOC) += clk-tegra114.o
obj-$(CONFIG_ARCH_TEGRA_124_SOC) += clk-tegra124.o obj-$(CONFIG_ARCH_TEGRA_124_SOC) += clk-tegra124.o
obj-$(CONFIG_ARCH_TEGRA_124_SOC) += clk-tegra124-dfll-fcpu.o obj-$(CONFIG_TEGRA_CLK_DFLL) += clk-tegra124-dfll-fcpu.o
obj-$(CONFIG_ARCH_TEGRA_132_SOC) += clk-tegra124.o obj-$(CONFIG_ARCH_TEGRA_132_SOC) += clk-tegra124.o
obj-y += cvb.o obj-y += cvb.o
obj-$(CONFIG_ARCH_TEGRA_210_SOC) += clk-tegra210.o obj-$(CONFIG_ARCH_TEGRA_210_SOC) += clk-tegra210.o
......
This diff is collapsed.
/* /*
* clk-dfll.h - prototypes and macros for the Tegra DFLL clocksource driver * clk-dfll.h - prototypes and macros for the Tegra DFLL clocksource driver
* Copyright (C) 2013 NVIDIA Corporation. All rights reserved. * Copyright (C) 2013-2019 NVIDIA Corporation. All rights reserved.
* *
* Aleksandr Frid <afrid@nvidia.com> * Aleksandr Frid <afrid@nvidia.com>
* Paul Walmsley <pwalmsley@nvidia.com> * Paul Walmsley <pwalmsley@nvidia.com>
...@@ -22,11 +22,14 @@ ...@@ -22,11 +22,14 @@
#include <linux/reset.h> #include <linux/reset.h>
#include <linux/types.h> #include <linux/types.h>
#include "cvb.h"
/** /**
* struct tegra_dfll_soc_data - SoC-specific hooks/integration for the DFLL driver * struct tegra_dfll_soc_data - SoC-specific hooks/integration for the DFLL driver
* @dev: struct device * that holds the OPP table for the DFLL * @dev: struct device * that holds the OPP table for the DFLL
* @max_freq: maximum frequency supported on this SoC * @max_freq: maximum frequency supported on this SoC
* @cvb: CPU frequency table for this SoC * @cvb: CPU frequency table for this SoC
* @alignment: parameters of the regulator step and offset
* @init_clock_trimmers: callback to initialize clock trimmers * @init_clock_trimmers: callback to initialize clock trimmers
* @set_clock_trimmers_high: callback to tune clock trimmers for high voltage * @set_clock_trimmers_high: callback to tune clock trimmers for high voltage
* @set_clock_trimmers_low: callback to tune clock trimmers for low voltage * @set_clock_trimmers_low: callback to tune clock trimmers for low voltage
...@@ -35,6 +38,7 @@ struct tegra_dfll_soc_data { ...@@ -35,6 +38,7 @@ struct tegra_dfll_soc_data {
struct device *dev; struct device *dev;
unsigned long max_freq; unsigned long max_freq;
const struct cvb_table *cvb; const struct cvb_table *cvb;
struct rail_alignment alignment;
void (*init_clock_trimmers)(void); void (*init_clock_trimmers)(void);
void (*set_clock_trimmers_high)(void); void (*set_clock_trimmers_high)(void);
......
This diff is collapsed.
/* /*
* Utility functions for parsing Tegra CVB voltage tables * Utility functions for parsing Tegra CVB voltage tables
* *
* Copyright (C) 2012-2014 NVIDIA Corporation. All rights reserved. * Copyright (C) 2012-2019 NVIDIA Corporation. All rights reserved.
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as * it under the terms of the GNU General Public License version 2 as
...@@ -62,9 +62,9 @@ static int round_voltage(int mv, const struct rail_alignment *align, int up) ...@@ -62,9 +62,9 @@ static int round_voltage(int mv, const struct rail_alignment *align, int up)
} }
static int build_opp_table(struct device *dev, const struct cvb_table *table, static int build_opp_table(struct device *dev, const struct cvb_table *table,
struct rail_alignment *align,
int speedo_value, unsigned long max_freq) int speedo_value, unsigned long max_freq)
{ {
const struct rail_alignment *align = &table->alignment;
int i, ret, dfll_mv, min_mv, max_mv; int i, ret, dfll_mv, min_mv, max_mv;
min_mv = round_voltage(table->min_millivolts, align, UP); min_mv = round_voltage(table->min_millivolts, align, UP);
...@@ -109,8 +109,9 @@ static int build_opp_table(struct device *dev, const struct cvb_table *table, ...@@ -109,8 +109,9 @@ static int build_opp_table(struct device *dev, const struct cvb_table *table,
*/ */
const struct cvb_table * const struct cvb_table *
tegra_cvb_add_opp_table(struct device *dev, const struct cvb_table *tables, tegra_cvb_add_opp_table(struct device *dev, const struct cvb_table *tables,
size_t count, int process_id, int speedo_id, size_t count, struct rail_alignment *align,
int speedo_value, unsigned long max_freq) int process_id, int speedo_id, int speedo_value,
unsigned long max_freq)
{ {
size_t i; size_t i;
int ret; int ret;
...@@ -124,7 +125,8 @@ tegra_cvb_add_opp_table(struct device *dev, const struct cvb_table *tables, ...@@ -124,7 +125,8 @@ tegra_cvb_add_opp_table(struct device *dev, const struct cvb_table *tables,
if (table->process_id != -1 && table->process_id != process_id) if (table->process_id != -1 && table->process_id != process_id)
continue; continue;
ret = build_opp_table(dev, table, speedo_value, max_freq); ret = build_opp_table(dev, table, align, speedo_value,
max_freq);
return ret ? ERR_PTR(ret) : table; return ret ? ERR_PTR(ret) : table;
} }
......
...@@ -41,6 +41,7 @@ struct cvb_cpu_dfll_data { ...@@ -41,6 +41,7 @@ struct cvb_cpu_dfll_data {
u32 tune0_low; u32 tune0_low;
u32 tune0_high; u32 tune0_high;
u32 tune1; u32 tune1;
unsigned int tune_high_min_millivolts;
}; };
struct cvb_table { struct cvb_table {
...@@ -49,7 +50,6 @@ struct cvb_table { ...@@ -49,7 +50,6 @@ struct cvb_table {
int min_millivolts; int min_millivolts;
int max_millivolts; int max_millivolts;
struct rail_alignment alignment;
int speedo_scale; int speedo_scale;
int voltage_scale; int voltage_scale;
...@@ -59,8 +59,9 @@ struct cvb_table { ...@@ -59,8 +59,9 @@ struct cvb_table {
const struct cvb_table * const struct cvb_table *
tegra_cvb_add_opp_table(struct device *dev, const struct cvb_table *cvb_tables, tegra_cvb_add_opp_table(struct device *dev, const struct cvb_table *cvb_tables,
size_t count, int process_id, int speedo_id, size_t count, struct rail_alignment *align,
int speedo_value, unsigned long max_freq); int process_id, int speedo_id, int speedo_value,
unsigned long max_freq);
void tegra_cvb_remove_opp_table(struct device *dev, void tegra_cvb_remove_opp_table(struct device *dev,
const struct cvb_table *table, const struct cvb_table *table,
unsigned long max_freq); unsigned long max_freq);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment