1
2
3
4
5
6
7#ifndef _ASM_ARCH_CCU_H
8#define _ASM_ARCH_CCU_H
9
10
11
12
13
14
15
16enum ccu_flags {
17 CCU_CLK_F_IS_VALID = BIT(0),
18 CCU_RST_F_IS_VALID = BIT(1),
19};
20
21
22
23
24
25
26
27struct ccu_clk_gate {
28 u16 off;
29 u32 bit;
30 enum ccu_flags flags;
31};
32
33#define GATE(_off, _bit) { \
34 .off = _off, \
35 .bit = _bit, \
36 .flags = CCU_CLK_F_IS_VALID, \
37}
38
39
40
41
42
43
44
45struct ccu_reset {
46 u16 off;
47 u32 bit;
48 enum ccu_flags flags;
49};
50
51#define RESET(_off, _bit) { \
52 .off = _off, \
53 .bit = _bit, \
54 .flags = CCU_RST_F_IS_VALID, \
55}
56
57
58
59
60
61
62
63struct ccu_desc {
64 const struct ccu_clk_gate *gates;
65 const struct ccu_reset *resets;
66};
67
68
69
70
71
72
73
74struct ccu_priv {
75 void *base;
76 const struct ccu_desc *desc;
77};
78
79
80
81
82
83int sunxi_clk_probe(struct udevice *dev);
84
85extern struct clk_ops sunxi_clk_ops;
86
87
88
89
90
91
92
93
94int sunxi_reset_bind(struct udevice *dev, ulong count);
95
96#endif
97