]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - sys/arm/allwinner/clkng/aw_ccung.h
MFV: file 5.33
[FreeBSD/FreeBSD.git] / sys / arm / allwinner / clkng / aw_ccung.h
1 /*-
2  * Copyright (c) 2017 Emmanuel Vadot <manu@freebsd.org>
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  * 1. Redistributions of source code must retain the above copyright
9  *    notice, this list of conditions and the following disclaimer.
10  * 2. Redistributions in binary form must reproduce the above copyright
11  *    notice, this list of conditions and the following disclaimer in the
12  *    documentation and/or other materials provided with the distribution.
13  *
14  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
15  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
16  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
17  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
18  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
19  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
20  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
21  * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
22  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24  * SUCH DAMAGE.
25  *
26  * $FreeBSD$
27  */
28
29 #ifndef __CCU_NG_H__
30 #define __CCU_NG_H__
31
32 enum aw_ccung_type {
33         H3_CCU = 1,
34         H3_R_CCU,
35         A31_CCU,
36         A64_CCU,
37         A64_R_CCU,
38         A13_CCU,
39         A83T_CCU,
40         A83T_R_CCU,
41 };
42
43 struct aw_ccung_softc {
44         device_t                dev;
45         struct resource         *res;
46         struct clkdom           *clkdom;
47         struct mtx              mtx;
48         int                     type;
49         struct aw_ccung_reset   *resets;
50         int                     nresets;
51         struct aw_ccung_gate    *gates;
52         int                     ngates;
53         struct aw_clk_init      *clk_init;
54         int                     n_clk_init;
55 };
56
57 struct aw_ccung_reset {
58         uint32_t        offset;
59         uint32_t        shift;
60 };
61
62 struct aw_ccung_gate {
63         const char      *name;
64         const char      *parent_name;
65         uint32_t        id;
66         uint32_t        offset;
67         uint32_t        shift;
68 };
69
70 #endif /* __CCU_NG_H__ */