56
56
#define APMU_CCIC1 0xf4
57
57
#define APMU_USBHSIC0 0xf8
58
58
#define APMU_USBHSIC1 0xfc
59
+ #define APMU_GPU 0xcc
59
60
60
61
#define MPMU_FCCR 0x8
61
62
#define MPMU_POSR 0x10
@@ -245,6 +246,14 @@ static DEFINE_SPINLOCK(ccic0_lock);
245
246
static DEFINE_SPINLOCK (ccic1_lock );
246
247
static const char * const ccic_parent_names [] = {"pll1_2" , "pll1_16" , "vctcxo" };
247
248
249
+ static DEFINE_SPINLOCK (gpu_lock );
250
+ static const char * const mmp2_gpu_gc_parent_names [] = {"pll1_2" , "pll1_3" , "pll2_2" , "pll2_3" , "pll2" , "usb_pll" };
251
+ static u32 mmp2_gpu_gc_parent_table [] = { 0x0000 , 0x0040 , 0x0080 , 0x00c0 , 0x1000 , 0x1040 };
252
+ static const char * const mmp2_gpu_bus_parent_names [] = {"pll1_4" , "pll2" , "pll2_2" , "usb_pll" };
253
+ static u32 mmp2_gpu_bus_parent_table [] = { 0x0000 , 0x0020 , 0x0030 , 0x4020 };
254
+ static const char * const mmp3_gpu_bus_parent_names [] = {"pll1_4" , "pll1_6" , "pll1_2" , "pll2_2" };
255
+ static const char * const mmp3_gpu_gc_parent_names [] = {"pll1" , "pll2" , "pll1_p" , "pll2_p" };
256
+
248
257
static struct mmp_clk_mix_config ccic0_mix_config = {
249
258
.reg_info = DEFINE_MIX_REG_INFO (4 , 17 , 2 , 6 , 32 ),
250
259
};
@@ -257,6 +266,15 @@ static struct mmp_param_mux_clk apmu_mux_clks[] = {
257
266
{MMP2_CLK_DISP1_MUX , "disp1_mux" , disp_parent_names , ARRAY_SIZE (disp_parent_names ), CLK_SET_RATE_PARENT , APMU_DISP1 , 6 , 2 , 0 , & disp1_lock },
258
267
};
259
268
269
+ static struct mmp_param_mux_clk mmp3_apmu_mux_clks [] = {
270
+ {0 , "gpu_bus_mux" , mmp3_gpu_bus_parent_names , ARRAY_SIZE (mmp3_gpu_bus_parent_names ),
271
+ CLK_SET_RATE_PARENT , APMU_GPU , 4 , 2 , 0 , & gpu_lock },
272
+ {0 , "gpu_3d_mux" , mmp3_gpu_gc_parent_names , ARRAY_SIZE (mmp3_gpu_gc_parent_names ),
273
+ CLK_SET_RATE_PARENT , APMU_GPU , 6 , 2 , 0 , & gpu_lock },
274
+ {0 , "gpu_2d_mux" , mmp3_gpu_gc_parent_names , ARRAY_SIZE (mmp3_gpu_gc_parent_names ),
275
+ CLK_SET_RATE_PARENT , APMU_GPU , 12 , 2 , 0 , & gpu_lock },
276
+ };
277
+
260
278
static struct mmp_param_div_clk apmu_div_clks [] = {
261
279
{0 , "disp0_div" , "disp0_mux" , CLK_SET_RATE_PARENT , APMU_DISP0 , 8 , 4 , 0 , & disp0_lock },
262
280
{0 , "disp0_sphy_div" , "disp0_mux" , CLK_SET_RATE_PARENT , APMU_DISP0 , 15 , 5 , 0 , & disp0_lock },
@@ -265,6 +283,11 @@ static struct mmp_param_div_clk apmu_div_clks[] = {
265
283
{0 , "ccic1_sphy_div" , "ccic1_mix_clk" , CLK_SET_RATE_PARENT , APMU_CCIC1 , 10 , 5 , 0 , & ccic1_lock },
266
284
};
267
285
286
+ static struct mmp_param_div_clk mmp3_apmu_div_clks [] = {
287
+ {0 , "gpu_3d_div" , "gpu_3d_mux" , CLK_SET_RATE_PARENT , APMU_GPU , 24 , 4 , 0 , & gpu_lock },
288
+ {0 , "gpu_2d_div" , "gpu_2d_mux" , CLK_SET_RATE_PARENT , APMU_GPU , 28 , 4 , 0 , & gpu_lock },
289
+ };
290
+
268
291
static struct mmp_param_gate_clk apmu_gate_clks [] = {
269
292
{MMP2_CLK_USB , "usb_clk" , "usb_pll" , 0 , APMU_USB , 0x9 , 0x9 , 0x0 , 0 , & usb_lock },
270
293
{MMP2_CLK_USBHSIC0 , "usbhsic0_clk" , "usb_pll" , 0 , APMU_USBHSIC0 , 0x1b , 0x1b , 0x0 , 0 , & usbhsic0_lock },
@@ -285,6 +308,16 @@ static struct mmp_param_gate_clk apmu_gate_clks[] = {
285
308
{MMP2_CLK_CCIC1 , "ccic1_clk" , "ccic1_mix_clk" , CLK_SET_RATE_PARENT , APMU_CCIC1 , 0x1b , 0x1b , 0x0 , 0 , & ccic1_lock },
286
309
{MMP2_CLK_CCIC1_PHY , "ccic1_phy_clk" , "ccic1_mix_clk" , CLK_SET_RATE_PARENT , APMU_CCIC1 , 0x24 , 0x24 , 0x0 , 0 , & ccic1_lock },
287
310
{MMP2_CLK_CCIC1_SPHY , "ccic1_sphy_clk" , "ccic1_sphy_div" , CLK_SET_RATE_PARENT , APMU_CCIC1 , 0x300 , 0x300 , 0x0 , 0 , & ccic1_lock },
311
+ {MMP2_CLK_GPU_BUS , "gpu_bus_clk" , "gpu_bus_mux" , CLK_SET_RATE_PARENT , APMU_GPU , 0xa , 0xa , 0x0 , MMP_CLK_GATE_NEED_DELAY , & gpu_lock },
312
+ };
313
+
314
+ static struct mmp_param_gate_clk mmp2_apmu_gate_clks [] = {
315
+ {MMP2_CLK_GPU_3D , "gpu_3d_clk" , "gpu_3d_mux" , CLK_SET_RATE_PARENT , APMU_GPU , 0x5 , 0x5 , 0x0 , MMP_CLK_GATE_NEED_DELAY , & gpu_lock },
316
+ };
317
+
318
+ static struct mmp_param_gate_clk mmp3_apmu_gate_clks [] = {
319
+ {MMP3_CLK_GPU_3D , "gpu_3d_clk" , "gpu_3d_div" , CLK_SET_RATE_PARENT , APMU_GPU , 0x5 , 0x5 , 0x0 , MMP_CLK_GATE_NEED_DELAY , & gpu_lock },
320
+ {MMP3_CLK_GPU_2D , "gpu_2d_clk" , "gpu_2d_div" , CLK_SET_RATE_PARENT , APMU_GPU , 0x1c0000 , 0x1c0000 , 0x0 , MMP_CLK_GATE_NEED_DELAY , & gpu_lock },
288
321
};
289
322
290
323
static void mmp2_axi_periph_clk_init (struct mmp2_clk_unit * pxa_unit )
@@ -320,6 +353,34 @@ static void mmp2_axi_periph_clk_init(struct mmp2_clk_unit *pxa_unit)
320
353
321
354
mmp_register_gate_clks (unit , apmu_gate_clks , pxa_unit -> apmu_base ,
322
355
ARRAY_SIZE (apmu_gate_clks ));
356
+
357
+ if (pxa_unit -> model == CLK_MODEL_MMP3 ) {
358
+ mmp_register_mux_clks (unit , mmp3_apmu_mux_clks , pxa_unit -> apmu_base ,
359
+ ARRAY_SIZE (mmp3_apmu_mux_clks ));
360
+
361
+ mmp_register_div_clks (unit , mmp3_apmu_div_clks , pxa_unit -> apmu_base ,
362
+ ARRAY_SIZE (mmp3_apmu_div_clks ));
363
+
364
+ mmp_register_gate_clks (unit , mmp3_apmu_gate_clks , pxa_unit -> apmu_base ,
365
+ ARRAY_SIZE (mmp3_apmu_gate_clks ));
366
+ } else {
367
+ clk_register_mux_table (NULL , "gpu_3d_mux" , mmp2_gpu_gc_parent_names ,
368
+ ARRAY_SIZE (mmp2_gpu_gc_parent_names ),
369
+ CLK_SET_RATE_PARENT ,
370
+ pxa_unit -> apmu_base + APMU_GPU ,
371
+ 0 , 0x10c0 , 0 ,
372
+ mmp2_gpu_gc_parent_table , & gpu_lock );
373
+
374
+ clk_register_mux_table (NULL , "gpu_bus_mux" , mmp2_gpu_bus_parent_names ,
375
+ ARRAY_SIZE (mmp2_gpu_bus_parent_names ),
376
+ CLK_SET_RATE_PARENT ,
377
+ pxa_unit -> apmu_base + APMU_GPU ,
378
+ 0 , 0x4030 , 0 ,
379
+ mmp2_gpu_bus_parent_table , & gpu_lock );
380
+
381
+ mmp_register_gate_clks (unit , mmp2_apmu_gate_clks , pxa_unit -> apmu_base ,
382
+ ARRAY_SIZE (mmp2_apmu_gate_clks ));
383
+ }
323
384
}
324
385
325
386
static void mmp2_clk_reset_init (struct device_node * np ,
0 commit comments