1 /*
2  * Allwinner SoCs display driver.
3  *
4  * Copyright (C) 2016 Allwinner.
5  *
6  * This file is licensed under the terms of the GNU General Public
7  * License version 2.  This program is licensed "as is" without any
8  * warranty of any kind, whether express or implied.
9  */
10 
11 #ifndef __DE_CLOCK_H__
12 #define __DE_CLOCK_H__
13 
14 #include "../include.h"
15 #include "de_feat.h"
16 
17 enum de_clk_id {
18     DE_CLK_NONE = 0,
19 
20     DE_CLK_CORE0 = 1,
21     DE_CLK_CORE1 = 2,
22     DE_CLK_WB = 3,
23 };
24 
25 struct de_clk_para {
26     enum de_clk_id clk_no;
27     u32 div;
28     u32 ahb_gate_adr;
29     u32 ahb_gate_shift;
30     u32 ahb_reset_adr;
31     u32 ahb_reset_shift;
32     u32 dram_gate_adr;
33     u32 dram_gate_shift;
34     u32 mod_adr;
35     u32 mod_enable_shift;
36     u32 mod_div_adr;
37     u32 mod_div_shift;
38     u32 mod_div_width;
39 };
40 
41 extern s32 de_clk_enable(u32 clk_no);
42 extern s32 de_clk_disable(u32 clk_no);
43 extern s32 de_clk_set_reg_base(uintptr_t reg_base);
44 #if defined(CONFIG_ARCH_SUN50IW10)
45 extern s32 de1_clk_set_reg_base(uintptr_t reg_base);
46 #endif
47 #endif
48