1 | /*
|
---|
2 | * Copyright (c) 2012 Jan Vesely
|
---|
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 | *
|
---|
9 | * - Redistributions of source code must retain the above copyright
|
---|
10 | * notice, this list of conditions and the following disclaimer.
|
---|
11 | * - Redistributions in binary form must reproduce the above copyright
|
---|
12 | * notice, this list of conditions and the following disclaimer in the
|
---|
13 | * documentation and/or other materials provided with the distribution.
|
---|
14 | * - The name of the author may not be used to endorse or promote products
|
---|
15 | * derived from this software without specific prior written permission.
|
---|
16 | *
|
---|
17 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
---|
18 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
---|
19 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
---|
20 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
---|
21 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
---|
22 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
---|
23 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
---|
24 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
---|
25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
---|
26 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
---|
27 | */
|
---|
28 |
|
---|
29 | /** @addtogroup amdm37xdrvcm
|
---|
30 | * @{
|
---|
31 | */
|
---|
32 | /** @file
|
---|
33 | * @brief MPU Clock Management IO register structure.
|
---|
34 | */
|
---|
35 | #ifndef AMDM37x_IVA2_CM_H
|
---|
36 | #define AMDM37x_IVA2_CM_H
|
---|
37 | #include <sys/types.h>
|
---|
38 | #include <macros.h>
|
---|
39 |
|
---|
40 | /* AM/DM37x TRM p.446 */
|
---|
41 | #define IVA2_CM_BASE_ADDRESS 0x48004000
|
---|
42 | #define IVA2_CM_SIZE 8192
|
---|
43 |
|
---|
44 | typedef struct {
|
---|
45 | ioport32_t fclken;
|
---|
46 | #define IVA2_CM_FCLKEN_EN_IVA2_FLAG (1 << 0)
|
---|
47 |
|
---|
48 | ioport32_t clken_pll;
|
---|
49 | #define IVA2_CM_CLKEN_PLL_EN_IVA2_DPLL_LP_MODE_FLAG (1 << 10)
|
---|
50 | #define IVA2_CM_CLKEN_PLL_EN_IVA2_DPLL_DRIFTGUARD (1 << 3)
|
---|
51 | #define IVA2_CM_CLKEN_PLL_EN_IVA2_DPLL_EN_IVA2_DPLL_MASK (0x7)
|
---|
52 | #define IVA2_CM_CLKEN_PLL_EN_IVA2_DPLL_EN_IVA2_DPLL_LP_STOP (0x1)
|
---|
53 | #define IVA2_CM_CLKEN_PLL_EN_IVA2_DPLL_EN_IVA2_DPLL_LP_BYPASS (0x5)
|
---|
54 | #define IVA2_CM_CLKEN_PLL_EN_IVA2_DPLL_EN_IVA2_DPLL_LOCKED (0x7)
|
---|
55 |
|
---|
56 | PADD32[6];
|
---|
57 | const ioport32_t idlest;
|
---|
58 | #define IVA2_CM_IDLEST_ST_IVA2_STANDBY_FLAG (1 << 0)
|
---|
59 |
|
---|
60 | const ioport32_t idlest_pll;
|
---|
61 | #define IVA2_CM_IDLEST_PLL_ST_IVA2_CLK_LOCKED_FLAG (1 << 0)
|
---|
62 |
|
---|
63 | PADD32[3];
|
---|
64 | ioport32_t autoidle_pll;
|
---|
65 | #define IVA2_CM_AUTOIDLE_PLL_AUTO_IVA2_DPLL_MASK (0x7)
|
---|
66 | #define IVA2_CM_AUTOIDLE_PLL_AUTO_IVA2_DPLL_DISABLED (0x0)
|
---|
67 | #define IVA2_CM_AUTOIDLE_PLL_AUTO_IVA2_DPLL_ENABLED (0x1)
|
---|
68 |
|
---|
69 | PADD32[2];
|
---|
70 | ioport32_t clksel1_pll;
|
---|
71 | #define IVA2_CM_CLKSEL1_PLL_IVA2_CLK_SRC_MASK (0x7 << 19)
|
---|
72 | #define IVA2_CM_CLKSEL1_PLL_IVA2_CLK_SRC_SHIFT (19)
|
---|
73 | #define IVA2_CM_CLKSEL1_PLL_IVA2_CLK_SRC_VAL(x) ((x >> 19) & 0x7)
|
---|
74 | #define IVA2_CM_CLKSEL1_PLL_IVA2_CLK_SRC_CORE_DIV_1 (0x1 << 19)
|
---|
75 | #define IVA2_CM_CLKSEL1_PLL_IVA2_CLK_SRC_CORE_DIV_2 (0x2 << 19)
|
---|
76 | #define IVA2_CM_CLKSEL1_PLL_IVA2_CLK_SRC_CORE_DIV_4 (0x4 << 19)
|
---|
77 | #define IVA2_CM_CLKSEL1_PLL_IVA2_DPLL_MULT_MASK (0x7ff << 8)
|
---|
78 | #define IVA2_CM_CLKSEL1_PLL_IVA2_DPLL_MULT_SHIFT (8)
|
---|
79 | #define IVA2_CM_CLKSEL1_PLL_IVA2_DPLL_DIV_MASK (0x7f << 0)
|
---|
80 | #define IVA2_CM_CLKSEL1_PLL_IVA2_DPLL_DIV_SHIFT (0)
|
---|
81 |
|
---|
82 | ioport32_t clksel2_pll;
|
---|
83 | #define IVA2_CM_CLKSEL2_PLL_IVA2_DPLL_CLKOUT_DIV_MASK (0x1f)
|
---|
84 |
|
---|
85 | ioport32_t clkstctrl;
|
---|
86 | #define IVA2_CM_CLKSCTRL_CLKTRCTRL_IVA2_MASK (0x3)
|
---|
87 | #define IVA2_CM_CLKSCTRL_CLKTRCTRL_IVA2_DISABLED (0x0)
|
---|
88 | #define IVA2_CM_CLKSCTRL_CLKTRCTRL_IVA2_START_SLEEP (0x2)
|
---|
89 | #define IVA2_CM_CLKSCTRL_CLKTRCTRL_IVA2_START_WAKEUP (0x2)
|
---|
90 | #define IVA2_CM_CLKSCTRL_CLKTRCTRL_IVA2_AUTOMATIC (0x3)
|
---|
91 |
|
---|
92 | const ioport32_t clkstst;
|
---|
93 | #define IVA2_CM_CLKSTST_CLKACTIVITY_IVA2_ACTIVE_FLAG (1 << 0)
|
---|
94 |
|
---|
95 | } iva2_cm_regs_t;
|
---|
96 |
|
---|
97 | #endif
|
---|
98 | /**
|
---|
99 | * @}
|
---|
100 | */
|
---|
101 |
|
---|