Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,16 @@ required:
- reg
- '#performance-domain-cells'

allOf:
- if:
properties:
compatible:
contains:
const: apple,t6050-cluster-cpufreq
then:
required:
- apple,firmware-managed-thermal

additionalProperties: false

examples:
Expand Down
23 changes: 23 additions & 0 deletions drivers/cpufreq/apple-soc-cpufreq.c
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ struct apple_soc_cpufreq_info {
/* Fail closed when the DT describes no fast die-temperature limit. */
bool needs_thermal_policy;
bool needs_thermal_owner;
bool needs_firmware_thermal_control;
u32 transition_timeout_us;
/* Highest P-state allowed without a thermal policy; 0 if not capped. */
u32 max_unmanaged_pstate;
Expand Down Expand Up @@ -340,6 +341,16 @@ static const struct apple_soc_cpufreq_info soc_t8132_info = {
.ps1_shift = APPLE_DVFS_CMD_PS1_SHIFT,
};

/* Command-state readback, not a measurement of the clock frequency. */
static const struct apple_soc_cpufreq_info soc_t6050_info = {
.verify_transition = true,
.needs_firmware_thermal_control = true,
.transition_timeout_us = 2000,
.max_pstate = 31,
.ps1_mask = APPLE_DVFS_CMD_PS1,
.ps1_shift = APPLE_DVFS_CMD_PS1_SHIFT,
};

static const struct apple_soc_cpufreq_info soc_default_info = {
.has_ps2 = false,
.max_pstate = 15,
Expand Down Expand Up @@ -373,6 +384,10 @@ static const struct of_device_id apple_soc_cpufreq_of_match[] __maybe_unused = {
.compatible = "apple,t8140-cluster-cpufreq",
.data = &soc_t8140_info,
},
{
.compatible = "apple,t6050-cluster-cpufreq",
.data = &soc_t6050_info,
},
{
.compatible = "apple,t8142-cluster-cpufreq",
.data = &soc_t8142_info,
Expand Down Expand Up @@ -1355,6 +1370,14 @@ static int apple_soc_cpufreq_init(struct cpufreq_policy *policy)
goto out_free_priv;
}

/* The boot producer must retain and qualify firmware thermal control. */
if (info->needs_firmware_thermal_control &&
!of_property_read_bool(cluster, "apple,firmware-managed-thermal")) {
dev_err(cpu_dev, "firmware thermal ownership is not declared\n");
ret = -ENODEV;
goto out_iounmap;
}

ret = dev_pm_opp_of_cpumask_add_table(policy->cpus);
if (ret < 0) {
dev_err(cpu_dev, "%s: failed to add OPP table: %d\n", __func__, ret);
Expand Down
Loading