xref: /openbmc/qemu/include/hw/misc/imx25_ccm.h (revision 520e210c)
1 /*
2  * IMX25 Clock Control Module
3  *
4  * Copyright (C) 2012 NICTA
5  * Updated by Jean-Christophe Dubois <jcd@tribudubois.net>
6  *
7  * This work is licensed under the terms of the GNU GPL, version 2 or later.
8  * See the COPYING file in the top-level directory.
9  */
10 
11 #ifndef IMX25_CCM_H
12 #define IMX25_CCM_H
13 
14 #include "hw/misc/imx_ccm.h"
15 
16 #define IMX25_CCM_MPCTL_REG  0
17 #define IMX25_CCM_UPCTL_REG  1
18 #define IMX25_CCM_CCTL_REG   2
19 #define IMX25_CCM_CGCR0_REG  3
20 #define IMX25_CCM_CGCR1_REG  4
21 #define IMX25_CCM_CGCR2_REG  5
22 #define IMX25_CCM_PCDR0_REG  6
23 #define IMX25_CCM_PCDR1_REG  7
24 #define IMX25_CCM_PCDR2_REG  8
25 #define IMX25_CCM_PCDR3_REG  9
26 #define IMX25_CCM_RCSR_REG   10
27 #define IMX25_CCM_CRDR_REG   11
28 #define IMX25_CCM_DCVR0_REG  12
29 #define IMX25_CCM_DCVR1_REG  13
30 #define IMX25_CCM_DCVR2_REG  14
31 #define IMX25_CCM_DCVR3_REG  15
32 #define IMX25_CCM_LTR0_REG   16
33 #define IMX25_CCM_LTR1_REG   17
34 #define IMX25_CCM_LTR2_REG   18
35 #define IMX25_CCM_LTR3_REG   19
36 #define IMX25_CCM_LTBR0_REG  20
37 #define IMX25_CCM_LTBR1_REG  21
38 #define IMX25_CCM_PMCR0_REG  22
39 #define IMX25_CCM_PMCR1_REG  23
40 #define IMX25_CCM_PMCR2_REG  24
41 #define IMX25_CCM_MCR_REG    25
42 #define IMX25_CCM_LPIMR0_REG 26
43 #define IMX25_CCM_LPIMR1_REG 27
44 #define IMX25_CCM_MAX_REG    28
45 
46 /* CCTL */
47 #define CCTL_ARM_CLK_DIV_SHIFT (30)
48 #define CCTL_ARM_CLK_DIV_MASK  (0x3)
49 #define CCTL_AHB_CLK_DIV_SHIFT (28)
50 #define CCTL_AHB_CLK_DIV_MASK  (0x3)
51 #define CCTL_MPLL_BYPASS_SHIFT (22)
52 #define CCTL_MPLL_BYPASS_MASK  (0x1)
53 #define CCTL_USB_DIV_SHIFT     (16)
54 #define CCTL_USB_DIV_MASK      (0x3F)
55 #define CCTL_ARM_SRC_SHIFT     (13)
56 #define CCTL_ARM_SRC_MASK      (0x1)
57 #define CCTL_UPLL_DIS_SHIFT    (23)
58 #define CCTL_UPLL_DIS_MASK     (0x1)
59 
60 #define EXTRACT(value, name) (((value) >> CCTL_##name##_SHIFT) \
61                               & CCTL_##name##_MASK)
62 #define INSERT(value, name) (((value) & CCTL_##name##_MASK) << \
63                              CCTL_##name##_SHIFT)
64 
65 #define TYPE_IMX25_CCM "imx25.ccm"
66 #define IMX25_CCM(obj) OBJECT_CHECK(IMX25CCMState, (obj), TYPE_IMX25_CCM)
67 
68 typedef struct IMX25CCMState {
69     /* <private> */
70     IMXCCMState parent_obj;
71 
72     /* <public> */
73     MemoryRegion iomem;
74 
75     uint32_t reg[IMX25_CCM_MAX_REG];
76 
77 } IMX25CCMState;
78 
79 #endif /* IMX25_CCM_H */
80