compatible = "nvidia,tegra210-dvfs-rail";
vdd_core-supply = <&max77620_sd0>;
vmin-cdev = <&core_vmin_cdev>;
+ vmax-cdev = <&core_vmax_cdev>;
};
cpu_vmin_cdev: vdd-cpu-vmin-cdev@5 {
nvidia,constraint;
nvidia,trips = <&gpu_vmax1 1130>;
};
+
+ core_vmax_cdev: vdd-core-vmax-cdev@10 {
+ reg = <10>;
+ cooling-min-state = <0>;
+ cooling-max-state = <1>;
+ #cooling-cells = <2>;
+ compatible = "nvidia,tegra210-rail-vmax-cdev";
+ cdev-type = "core_hot";
+ nvidia,constraint;
+ nvidia,trips = <&core_vmax1 1130>;
+ };
};
thermal-zones {
};
Tdiode_tegra {
SET_MAP_TRIP(core, core, vmin, 1, 20000);
+ SET_MAP_TRIP(core, core, vmax, 1, 86000);
};
CPU-therm {
SET_MAP_TRIP(cpu, cpu, vmax, 1, 86000);
static struct tegra_cooling_device core_vmin_cdev = {
.compatible = "nvidia,tegra210-rail-vmin-cdev",
};
+static int vdd_core_vmax_trips_table[MAX_THERMAL_LIMITS];
+static int vdd_core_therm_caps_table[MAX_THERMAL_LIMITS];
+static struct tegra_cooling_device core_vmax_cdev = {
+ .compatible = "nvidia,tegra210-rail-vmax-cdev",
+};
static int vdd_cpu_vmin_trips_table[MAX_THERMAL_LIMITS];
static int vdd_cpu_therm_floors_table[MAX_THERMAL_LIMITS];
.step = VDD_SAFE_STEP,
.step_up = 1300,
.vmin_cdev = &core_vmin_cdev,
+ .vmax_cdev = &core_vmax_cdev,
.alignment = {
.step_uv = 12500, /* 12.5mV */
},
/*
* CPU Vmax cooling device registration for pll mode:
* - Use CPU capping method provided by CPUFREQ platform driver
- * - Skip registration if most aggressive cap is above maximum voltage
+ * - Skip registration if most aggressive cap is at/above maximum voltage
*/
static int __init tegra21_dvfs_register_cpu_vmax_cdev(void)
{
* adjusted for each voltage cap trip-point (in case when GPU thermal
* scaling initialization failed, fall back on using WC rate limit across all
* thermal ranges).
- * - Skip registration if most aggressive cap is above maximum voltage
+ * - Skip registration if most aggressive cap is at/above maximum voltage
*/
static int tegra21_gpu_volt_cap_apply(int *cap_idx, int new_idx, int level)
{
rail->vmin_cdev = NULL;
}
+ if (rail->vmax_cdev) {
+ if (tegra_dvfs_rail_of_init_vmax_thermal_profile(
+ vdd_core_vmax_trips_table, vdd_core_therm_caps_table,
+ rail, NULL))
+ rail->vmax_cdev = NULL;
+ }
+
return 0;
}
.attr = {.name = "gpu_time_at_user_rate", .mode = 0444} },
};
+/*
+ * Core Vmax cooling device registration:
+ * - Use VDD_CORE capping method provided by DVFS
+ * - Skip registration if most aggressive cap is at/above maximum voltage
+ */
static void __init tegra21_dvfs_register_core_vmax_cdev(void)
{
- /* FIXME: implement */
+ struct dvfs_rail *rail;
+
+ rail = &tegra21_dvfs_rail_vdd_core;
+ rail->apply_vmax_cap = tegra_dvfs_therm_vmax_core_cap_apply;
+ if (rail->vmax_cdev) {
+ int i = rail->vmax_cdev->trip_temperatures_num;
+ if (i && rail->therm_mv_caps[i-1] < rail->nominal_millivolts)
+ tegra_dvfs_rail_register_vmax_cdev(rail);
+ }
}
/*