|
22 | 22 | #include <linux/pm_opp.h>
|
23 | 23 | #include <linux/slab.h>
|
24 | 24 |
|
25 |
| -#define APPLE_DVFS_CMD 0x20 |
26 |
| -#define APPLE_DVFS_CMD_BUSY BIT(31) |
27 |
| -#define APPLE_DVFS_CMD_SET BIT(25) |
28 |
| -#define APPLE_DVFS_CMD_PS2 GENMASK(15, 12) |
29 |
| -#define APPLE_DVFS_CMD_PS1 GENMASK(4, 0) |
30 |
| -#define APPLE_DVFS_CMD_PS1_SHIFT 0 |
| 25 | +#define APPLE_DVFS_CMD 0x20 |
| 26 | +#define APPLE_DVFS_CMD_BUSY BIT(31) |
| 27 | +#define APPLE_DVFS_CMD_SET BIT(25) |
| 28 | +#define APPLE_DVFS_CMD_PS1_S5L8960X GENMASK(24, 22) |
| 29 | +#define APPLE_DVFS_CMD_PS1_S5L8960X_SHIFT 22 |
| 30 | +#define APPLE_DVFS_CMD_PS2 GENMASK(15, 12) |
| 31 | +#define APPLE_DVFS_CMD_PS1 GENMASK(4, 0) |
| 32 | +#define APPLE_DVFS_CMD_PS1_SHIFT 0 |
31 | 33 |
|
32 | 34 | /* Same timebase as CPU counter (24MHz) */
|
33 | 35 | #define APPLE_DVFS_LAST_CHG_TIME 0x38
|
|
36 | 38 | * Apple ran out of bits and had to shift this in T8112...
|
37 | 39 | */
|
38 | 40 | #define APPLE_DVFS_STATUS 0x50
|
| 41 | +#define APPLE_DVFS_STATUS_CUR_PS_S5L8960X GENMASK(5, 3) |
| 42 | +#define APPLE_DVFS_STATUS_CUR_PS_SHIFT_S5L8960X 3 |
| 43 | +#define APPLE_DVFS_STATUS_TGT_PS_S5L8960X GENMASK(2, 0) |
39 | 44 | #define APPLE_DVFS_STATUS_CUR_PS_T8103 GENMASK(7, 4)
|
40 | 45 | #define APPLE_DVFS_STATUS_CUR_PS_SHIFT_T8103 4
|
41 | 46 | #define APPLE_DVFS_STATUS_TGT_PS_T8103 GENMASK(3, 0)
|
@@ -72,6 +77,15 @@ struct apple_cpu_priv {
|
72 | 77 |
|
73 | 78 | static struct cpufreq_driver apple_soc_cpufreq_driver;
|
74 | 79 |
|
| 80 | +static const struct apple_soc_cpufreq_info soc_s5l8960x_info = { |
| 81 | + .has_ps2 = false, |
| 82 | + .max_pstate = 7, |
| 83 | + .cur_pstate_mask = APPLE_DVFS_STATUS_CUR_PS_S5L8960X, |
| 84 | + .cur_pstate_shift = APPLE_DVFS_STATUS_CUR_PS_SHIFT_S5L8960X, |
| 85 | + .ps1_mask = APPLE_DVFS_CMD_PS1_S5L8960X, |
| 86 | + .ps1_shift = APPLE_DVFS_CMD_PS1_S5L8960X_SHIFT, |
| 87 | +}; |
| 88 | + |
75 | 89 | static const struct apple_soc_cpufreq_info soc_t8103_info = {
|
76 | 90 | .has_ps2 = true,
|
77 | 91 | .max_pstate = 15,
|
@@ -99,6 +113,10 @@ static const struct apple_soc_cpufreq_info soc_default_info = {
|
99 | 113 | };
|
100 | 114 |
|
101 | 115 | static const struct of_device_id apple_soc_cpufreq_of_match[] __maybe_unused = {
|
| 116 | + { |
| 117 | + .compatible = "apple,s5l8960x-cluster-cpufreq", |
| 118 | + .data = &soc_s5l8960x_info, |
| 119 | + }, |
102 | 120 | {
|
103 | 121 | .compatible = "apple,t8103-cluster-cpufreq",
|
104 | 122 | .data = &soc_t8103_info,
|
|
0 commit comments