source: mainline/uspace/drv/platform/amdm37x/cm/mpu.h@ 901b302

ticket/834-toolchain-update topic/msim-upgrade topic/simplify-dev-export
Last change on this file since 901b302 was 09ab0a9a, checked in by Jiri Svoboda <jiri@…>, 7 years ago

Fix vertical spacing with new Ccheck revision.

  • Property mode set to 100644
File size: 3.5 KB
Line 
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 amdm37x
30 * @{
31 */
32/** @file
33 * @brief MPU Clock Management IO register structure.
34 */
35#ifndef AMDM37x_MPU_CM_H
36#define AMDM37x_MPU_CM_H
37
38#include <ddi.h>
39#include <macros.h>
40
41/* AM/DM37x TRM p.455 */
42#define MPU_CM_BASE_ADDRESS 0x48004900
43#define MPU_CM_SIZE 8192
44
45typedef struct {
46 PADD32(1);
47 ioport32_t clken_pll;
48#define MPU_CM_CLKEN_PLL_EN_MPU_DPLL_LP_MODE_FLAG (1 << 10)
49#define MPU_CM_CLKEN_PLL_EN_MPU_DPLL_DRIFTGUARD (1 << 3)
50#define MPU_CM_CLKEN_PLL_EN_MPU_DPLL_EN_MPU_DPLL_MASK (0x7)
51#define MPU_CM_CLKEN_PLL_EN_MPU_DPLL_EN_MPU_DPLL_LP_BYPASS (0x5)
52#define MPU_CM_CLKEN_PLL_EN_MPU_DPLL_EN_MPU_DPLL_LOCKED (0x7)
53
54 PADD32(6);
55 const ioport32_t idlest;
56#define MPU_CM_IDLEST_ST_MPU_STANDBY_FLAG (1 << 0)
57
58 const ioport32_t idlest_pll;
59#define MPU_CM_IDLEST_PLL_ST_MPU_CLK_LOCKED_FLAG (1 << 0)
60
61 PADD32(3);
62 ioport32_t autoidle_pll;
63#define MPU_CM_AUTOIDLE_PLL_AUTO_MPU_DPLL_MASK (0x7)
64#define MPU_CM_AUTOIDLE_PLL_AUTO_MPU_DPLL_DISABLED (0x0)
65#define MPU_CM_AUTOIDLE_PLL_AUTO_MPU_DPLL_ENABLED (0x1)
66
67 PADD32(2);
68 ioport32_t clksel1_pll;
69#define MPU_CM_CLKSEL1_PLL_MPU_CLK_SRC_MASK (0x7 << 19)
70#define MPU_CM_CLKSEL1_PLL_MPU_CLK_SRC_SHIFT (19)
71#define MPU_CM_CLKSEL1_PLL_MPU_CLK_SRC_VAL(x) ((x >> 19) & 0x7)
72#define MPU_CM_CLKSEL1_PLL_MPU_CLK_SRC_CORE_DIV_1 (0x1 << 19)
73#define MPU_CM_CLKSEL1_PLL_MPU_CLK_SRC_CORE_DIV_2 (0x2 << 19)
74#define MPU_CM_CLKSEL1_PLL_MPU_CLK_SRC_CORE_DIV_4 (0x4 << 19)
75#define MPU_CM_CLKSEL1_PLL_MPU_DPLL_MULT_MASK (0x7ff << 8)
76#define MPU_CM_CLKSEL1_PLL_MPU_DPLL_MULT_SHIFT (8)
77#define MPU_CM_CLKSEL1_PLL_MPU_DPLL_DIV_MASK (0x7f << 0)
78#define MPU_CM_CLKSEL1_PLL_MPU_DPLL_DIV_SHIFT (0)
79
80 ioport32_t clksel2_pll;
81#define MPU_CM_CLKSEL2_PLL_MPU_DPLL_CLKOUT_DIV_MASK (0x1f)
82
83 ioport32_t clkstctrl;
84#define MPU_CM_CLKSCTRL_CLKTRCTRL_MPU_MASK (0x3)
85#define MPU_CM_CLKSCTRL_CLKTRCTRL_MPU_DISABLED (0x0)
86#define MPU_CM_CLKSCTRL_CLKTRCTRL_MPU_START_WAKEUP (0x2)
87#define MPU_CM_CLKSCTRL_CLKTRCTRL_MPU_AUTOMATIC (0x3)
88
89 const ioport32_t clkstst;
90#define MPU_CM_CLKSTST_CLKACTIVITY_MPU_ACTIVE_FLAG (1 << 0)
91
92} mpu_cm_regs_t;
93
94#endif
95/**
96 * @}
97 */
Note: See TracBrowser for help on using the repository browser.