@@ -24,6 +24,17 @@ static const u8 ipq_pll_offsets[][PLL_OFF_MAX_REGS] = {
24
24
[PLL_OFF_TEST_CTL ] = 0x30 ,
25
25
[PLL_OFF_TEST_CTL_U ] = 0x34 ,
26
26
},
27
+ [CLK_ALPHA_PLL_TYPE_STROMER_PLUS ] = {
28
+ [PLL_OFF_L_VAL ] = 0x08 ,
29
+ [PLL_OFF_ALPHA_VAL ] = 0x10 ,
30
+ [PLL_OFF_ALPHA_VAL_U ] = 0x14 ,
31
+ [PLL_OFF_USER_CTL ] = 0x18 ,
32
+ [PLL_OFF_USER_CTL_U ] = 0x1c ,
33
+ [PLL_OFF_CONFIG_CTL ] = 0x20 ,
34
+ [PLL_OFF_STATUS ] = 0x28 ,
35
+ [PLL_OFF_TEST_CTL ] = 0x30 ,
36
+ [PLL_OFF_TEST_CTL_U ] = 0x34 ,
37
+ },
27
38
};
28
39
29
40
static struct clk_alpha_pll ipq_pll_huayra = {
@@ -44,6 +55,38 @@ static struct clk_alpha_pll ipq_pll_huayra = {
44
55
},
45
56
};
46
57
58
+ static struct clk_alpha_pll ipq_pll_stromer_plus = {
59
+ .offset = 0x0 ,
60
+ .regs = ipq_pll_offsets [CLK_ALPHA_PLL_TYPE_STROMER_PLUS ],
61
+ .flags = SUPPORTS_DYNAMIC_UPDATE ,
62
+ .clkr = {
63
+ .enable_reg = 0x0 ,
64
+ .enable_mask = BIT (0 ),
65
+ .hw .init = & (struct clk_init_data ){
66
+ .name = "a53pll" ,
67
+ .parent_data = & (const struct clk_parent_data ) {
68
+ .fw_name = "xo" ,
69
+ },
70
+ .num_parents = 1 ,
71
+ .ops = & clk_alpha_pll_stromer_ops ,
72
+ },
73
+ },
74
+ };
75
+
76
+ static const struct alpha_pll_config ipq5332_pll_config = {
77
+ .l = 0x3e ,
78
+ .config_ctl_val = 0x4001075b ,
79
+ .config_ctl_hi_val = 0x304 ,
80
+ .main_output_mask = BIT (0 ),
81
+ .aux_output_mask = BIT (1 ),
82
+ .early_output_mask = BIT (3 ),
83
+ .alpha_en_mask = BIT (24 ),
84
+ .status_val = 0x3 ,
85
+ .status_mask = GENMASK (10 , 8 ),
86
+ .lock_det = BIT (2 ),
87
+ .test_ctl_hi_val = 0x00400003 ,
88
+ };
89
+
47
90
static const struct alpha_pll_config ipq6018_pll_config = {
48
91
.l = 0x37 ,
49
92
.config_ctl_val = 0x240d4828 ,
@@ -69,16 +112,25 @@ static const struct alpha_pll_config ipq8074_pll_config = {
69
112
};
70
113
71
114
struct apss_pll_data {
115
+ int pll_type ;
72
116
struct clk_alpha_pll * pll ;
73
117
const struct alpha_pll_config * pll_config ;
74
118
};
75
119
120
+ static struct apss_pll_data ipq5332_pll_data = {
121
+ .pll_type = CLK_ALPHA_PLL_TYPE_STROMER_PLUS ,
122
+ .pll = & ipq_pll_stromer_plus ,
123
+ .pll_config = & ipq5332_pll_config ,
124
+ };
125
+
76
126
static struct apss_pll_data ipq8074_pll_data = {
127
+ .pll_type = CLK_ALPHA_PLL_TYPE_HUAYRA ,
77
128
.pll = & ipq_pll_huayra ,
78
129
.pll_config = & ipq8074_pll_config ,
79
130
};
80
131
81
132
static struct apss_pll_data ipq6018_pll_data = {
133
+ .pll_type = CLK_ALPHA_PLL_TYPE_HUAYRA ,
82
134
.pll = & ipq_pll_huayra ,
83
135
.pll_config = & ipq6018_pll_config ,
84
136
};
@@ -111,7 +163,10 @@ static int apss_ipq_pll_probe(struct platform_device *pdev)
111
163
if (!data )
112
164
return - ENODEV ;
113
165
114
- clk_alpha_pll_configure (data -> pll , regmap , data -> pll_config );
166
+ if (data -> pll_type == CLK_ALPHA_PLL_TYPE_HUAYRA )
167
+ clk_alpha_pll_configure (data -> pll , regmap , data -> pll_config );
168
+ else if (data -> pll_type == CLK_ALPHA_PLL_TYPE_STROMER_PLUS )
169
+ clk_stromer_pll_configure (data -> pll , regmap , data -> pll_config );
115
170
116
171
ret = devm_clk_register_regmap (dev , & data -> pll -> clkr );
117
172
if (ret )
@@ -122,6 +177,7 @@ static int apss_ipq_pll_probe(struct platform_device *pdev)
122
177
}
123
178
124
179
static const struct of_device_id apss_ipq_pll_match_table [] = {
180
+ { .compatible = "qcom,ipq5332-a53pll" , .data = & ipq5332_pll_data },
125
181
{ .compatible = "qcom,ipq6018-a53pll" , .data = & ipq6018_pll_data },
126
182
{ .compatible = "qcom,ipq8074-a53pll" , .data = & ipq8074_pll_data },
127
183
{ }
0 commit comments