[9c0eba6] | 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 |
|
---|
[4122410] | 29 | /** @addtogroup amdm37x
|
---|
[9c0eba6] | 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
|
---|
[7ee7e6a] | 37 |
|
---|
| 38 | #include <ddi.h>
|
---|
[9c0eba6] | 39 | #include <macros.h>
|
---|
| 40 |
|
---|
| 41 | /* AM/DM37x TRM p.446 */
|
---|
| 42 | #define IVA2_CM_BASE_ADDRESS 0x48004000
|
---|
| 43 | #define IVA2_CM_SIZE 8192
|
---|
| 44 |
|
---|
| 45 | typedef struct {
|
---|
| 46 | ioport32_t fclken;
|
---|
| 47 | #define IVA2_CM_FCLKEN_EN_IVA2_FLAG (1 << 0)
|
---|
| 48 |
|
---|
| 49 | ioport32_t clken_pll;
|
---|
| 50 | #define IVA2_CM_CLKEN_PLL_EN_IVA2_DPLL_LP_MODE_FLAG (1 << 10)
|
---|
| 51 | #define IVA2_CM_CLKEN_PLL_EN_IVA2_DPLL_DRIFTGUARD (1 << 3)
|
---|
| 52 | #define IVA2_CM_CLKEN_PLL_EN_IVA2_DPLL_EN_IVA2_DPLL_MASK (0x7)
|
---|
| 53 | #define IVA2_CM_CLKEN_PLL_EN_IVA2_DPLL_EN_IVA2_DPLL_LP_STOP (0x1)
|
---|
| 54 | #define IVA2_CM_CLKEN_PLL_EN_IVA2_DPLL_EN_IVA2_DPLL_LP_BYPASS (0x5)
|
---|
| 55 | #define IVA2_CM_CLKEN_PLL_EN_IVA2_DPLL_EN_IVA2_DPLL_LOCKED (0x7)
|
---|
| 56 |
|
---|
[af60409] | 57 | PADD32(6);
|
---|
[9c0eba6] | 58 | const ioport32_t idlest;
|
---|
| 59 | #define IVA2_CM_IDLEST_ST_IVA2_STANDBY_FLAG (1 << 0)
|
---|
| 60 |
|
---|
| 61 | const ioport32_t idlest_pll;
|
---|
| 62 | #define IVA2_CM_IDLEST_PLL_ST_IVA2_CLK_LOCKED_FLAG (1 << 0)
|
---|
| 63 |
|
---|
[af60409] | 64 | PADD32(3);
|
---|
[9c0eba6] | 65 | ioport32_t autoidle_pll;
|
---|
| 66 | #define IVA2_CM_AUTOIDLE_PLL_AUTO_IVA2_DPLL_MASK (0x7)
|
---|
| 67 | #define IVA2_CM_AUTOIDLE_PLL_AUTO_IVA2_DPLL_DISABLED (0x0)
|
---|
| 68 | #define IVA2_CM_AUTOIDLE_PLL_AUTO_IVA2_DPLL_ENABLED (0x1)
|
---|
| 69 |
|
---|
[af60409] | 70 | PADD32(2);
|
---|
[9c0eba6] | 71 | ioport32_t clksel1_pll;
|
---|
| 72 | #define IVA2_CM_CLKSEL1_PLL_IVA2_CLK_SRC_MASK (0x7 << 19)
|
---|
| 73 | #define IVA2_CM_CLKSEL1_PLL_IVA2_CLK_SRC_SHIFT (19)
|
---|
| 74 | #define IVA2_CM_CLKSEL1_PLL_IVA2_CLK_SRC_VAL(x) ((x >> 19) & 0x7)
|
---|
| 75 | #define IVA2_CM_CLKSEL1_PLL_IVA2_CLK_SRC_CORE_DIV_1 (0x1 << 19)
|
---|
| 76 | #define IVA2_CM_CLKSEL1_PLL_IVA2_CLK_SRC_CORE_DIV_2 (0x2 << 19)
|
---|
| 77 | #define IVA2_CM_CLKSEL1_PLL_IVA2_CLK_SRC_CORE_DIV_4 (0x4 << 19)
|
---|
| 78 | #define IVA2_CM_CLKSEL1_PLL_IVA2_DPLL_MULT_MASK (0x7ff << 8)
|
---|
| 79 | #define IVA2_CM_CLKSEL1_PLL_IVA2_DPLL_MULT_SHIFT (8)
|
---|
| 80 | #define IVA2_CM_CLKSEL1_PLL_IVA2_DPLL_DIV_MASK (0x7f << 0)
|
---|
| 81 | #define IVA2_CM_CLKSEL1_PLL_IVA2_DPLL_DIV_SHIFT (0)
|
---|
| 82 |
|
---|
| 83 | ioport32_t clksel2_pll;
|
---|
| 84 | #define IVA2_CM_CLKSEL2_PLL_IVA2_DPLL_CLKOUT_DIV_MASK (0x1f)
|
---|
| 85 |
|
---|
| 86 | ioport32_t clkstctrl;
|
---|
| 87 | #define IVA2_CM_CLKSCTRL_CLKTRCTRL_IVA2_MASK (0x3)
|
---|
| 88 | #define IVA2_CM_CLKSCTRL_CLKTRCTRL_IVA2_DISABLED (0x0)
|
---|
| 89 | #define IVA2_CM_CLKSCTRL_CLKTRCTRL_IVA2_START_SLEEP (0x2)
|
---|
| 90 | #define IVA2_CM_CLKSCTRL_CLKTRCTRL_IVA2_START_WAKEUP (0x2)
|
---|
| 91 | #define IVA2_CM_CLKSCTRL_CLKTRCTRL_IVA2_AUTOMATIC (0x3)
|
---|
| 92 |
|
---|
| 93 | const ioport32_t clkstst;
|
---|
| 94 | #define IVA2_CM_CLKSTST_CLKACTIVITY_IVA2_ACTIVE_FLAG (1 << 0)
|
---|
| 95 |
|
---|
| 96 | } iva2_cm_regs_t;
|
---|
| 97 |
|
---|
| 98 | #endif
|
---|
| 99 | /**
|
---|
| 100 | * @}
|
---|
| 101 | */
|
---|