2 * Copyright (c) 2017, Impinj, Inc.
4 * i.MX7 CCM, PMU and ANALOG IP blocks emulation code
6 * Author: Andrey Smirnov <andrew.smirnov@gmail.com>
8 * This work is licensed under the terms of the GNU GPL, version 2 or later.
9 * See the COPYING file in the top-level directory.
15 #include "hw/misc/imx_ccm.h"
16 #include "qemu/bitops.h"
18 enum IMX7AnalogRegisters
{
28 ANALOG_PLL_DDR_SS_SET
,
29 ANALOG_PLL_DDR_SS_CLR
,
30 ANALOG_PLL_DDR_SS_TOG
,
32 ANALOG_PLL_DDR_NUM_SET
,
33 ANALOG_PLL_DDR_NUM_CLR
,
34 ANALOG_PLL_DDR_NUM_TOG
,
36 ANALOG_PLL_DDR_DENOM_SET
,
37 ANALOG_PLL_DDR_DENOM_CLR
,
38 ANALOG_PLL_DDR_DENOM_TOG
,
60 ANALOG_PLL_AUDIO_SS_SET
,
61 ANALOG_PLL_AUDIO_SS_CLR
,
62 ANALOG_PLL_AUDIO_SS_TOG
,
64 ANALOG_PLL_AUDIO_NUM_SET
,
65 ANALOG_PLL_AUDIO_NUM_CLR
,
66 ANALOG_PLL_AUDIO_NUM_TOG
,
67 ANALOG_PLL_AUDIO_DENOM
,
68 ANALOG_PLL_AUDIO_DENOM_SET
,
69 ANALOG_PLL_AUDIO_DENOM_CLR
,
70 ANALOG_PLL_AUDIO_DENOM_TOG
,
76 ANALOG_PLL_VIDEO_SS_SET
,
77 ANALOG_PLL_VIDEO_SS_CLR
,
78 ANALOG_PLL_VIDEO_SS_TOG
,
80 ANALOG_PLL_VIDEO_NUM_SET
,
81 ANALOG_PLL_VIDEO_NUM_CLR
,
82 ANALOG_PLL_VIDEO_NUM_TOG
,
83 ANALOG_PLL_VIDEO_DENOM
,
84 ANALOG_PLL_VIDEO_DENOM_SET
,
85 ANALOG_PLL_VIDEO_DENOM_CLR
,
86 ANALOG_PLL_VIDEO_DENOM_TOG
,
92 ANALOG_DIGPROG
= 0x800 / sizeof(uint32_t),
95 ANALOG_PLL_LOCK
= BIT(31)
98 enum IMX7CCMRegisters
{
99 CCM_MAX
= 0xBE00 / sizeof(uint32_t) + 1,
102 enum IMX7PMURegisters
{
103 PMU_MAX
= 0x140 / sizeof(uint32_t),
106 #define TYPE_IMX7_CCM "imx7.ccm"
107 #define IMX7_CCM(obj) OBJECT_CHECK(IMX7CCMState, (obj), TYPE_IMX7_CCM)
109 typedef struct IMX7CCMState
{
111 IMXCCMState parent_obj
;
116 uint32_t ccm
[CCM_MAX
];
120 #define TYPE_IMX7_ANALOG "imx7.analog"
121 #define IMX7_ANALOG(obj) OBJECT_CHECK(IMX7AnalogState, (obj), TYPE_IMX7_ANALOG)
123 typedef struct IMX7AnalogState
{
125 IMXCCMState parent_obj
;
129 MemoryRegion container
;
131 MemoryRegion digprog
;
135 uint32_t analog
[ANALOG_MAX
];
136 uint32_t pmu
[PMU_MAX
];
139 #endif /* IMX7_CCM_H */