XenevaOS
Loading...
Searching...
No Matches
imx8mp_pll.h
Go to the documentation of this file.
1
32#ifndef __IMX8MP_PLL_H__
33#define __IMX8MP_PLL_H__
34
35#include <bordoisila_bits.h>
36
42#define __IMX8MP_CCM_BASE__ 0x30360000 //hardcoded from IMX8MP reference PRM, CCM_ANALOG_BASE
44#define __IMX8MP_AUDIO_PLL1_GEN_CTRL __IMX8MP_CCM_BASE__
45#define __IMX8MP_AUDIO_PLL1_FDIV_CTL0 (__IMX8MP_CCM_BASE__ + 0x4)
46#define __IMX8MP_AUDIO_PLL1_FDIV_CTL1 (__IMX8MP_CCM_BASE__ + 0x8)
47#define __IMX8MP_AUDIO_PLL1_SSCG_CTRL (__IMX8MP_CCM_BASE__ + 0xC)
48#define __IMX8MP_AUDIO_PLL1_MNIT_CTRL (__IMX8MP_CCM_BASE__ + 0x10)
49
50
51#define __IMX8MP_AUDIO_PLL2_GEN_CTRL (__IMX8MP_CCM_BASE__ + 0x14)
52#define __IMX8MP_AUDIO_PLL2_FDIV_CTL0 (__IMX8MP_CCM_BASE__ + 0x18)
53#define __IMX8MP_AUDIO_PLL2_FDIV_CTL1 (__IMX8MP_CCM_BASE__ + 0x1C)
54#define __IMX8MP_AUDIO_PLL2_SSCG_CTRL (__IMX8MP_CCM_BASE__ + 0x20)
55#define __IMX8MP_AUDIO_PLL2_MNIT_CTRL (__IMX8MP_CCM_BASE__ + 0x24)
56
57#define __IMX8MP_VIDEO_PLL1_GEN_CTRL (__IMX8MP_CCM_BASE__ + 0x28)
58#define __IMX8MP_VIDEO_PLL1_FDIV_CTL0 (__IMX8MP_CCM_BASE__ + 0x2C)
59#define __IMX8MP_VIDEO_PLL1_FDIV_CTL1 (__IMX8MP_CCM_BASE__ + 0x30)
60#define __IMX8MP_VIDEO_PLL1_SSCG_CTRL (__IMX8MP_CCM_BASE__ + 0x34)
61#define __IMX8MP_VIDEO_PLL1_MNIT_CTRL (__IMX8MP_CCM_BASE__ + 0x38)
62
63#define __IMX8MP_DRAM_PLL_GEN_CTRL (__IMX8MP_CCM_BASE__ + 0x50)
64#define __IMX8MP_DRAM_PLL_FDIV_CTL0 (__IMX8MP_CCM_BASE__ + 0x54)
65#define __IMX8MP_DRAM_PLL_FDIV_CTL1 (__IMX8MP_CCM_BASE__ + 0x58)
66#define __IMX8MP_DRAM_PLL_SSCG_CTRL (__IMX8MP_CCM_BASE__ + 0x5C)
67#define __IMX8MP_DRAM_PLL_MNIT_CTRL (__IMX8MP_CCM_BASE__ + 0x60)
68
69#define __IMX8MP_GPU_PLL_GEN_CTRL (__IMX8MP_CCM_BASE__ + 0x64)
70#define __IMX8MP_GPU_PLL_FDIV_CTL0 (__IMX8MP_CCM_BASE__ + 0x68)
71#define __IMX8MP_GPU_PLL_LOCKD_CTRL (__IMX8MP_CCM_BASE__ + 0x6C)
72#define __IMX8MP_GPU_PLL_MNIT_CTRL (__IMX8MP_CCM_BASE__ + 0x70)
73
74#define __IMX8MP_VPU_PLL_GEN_CTRL (__IMX8MP_CCM_BASE__ + 0x74)
75#define __IMX8MP_VPU_PLL_FDIV_CTL0 (__IMX8MP_CCM_BASE__ + 0x78)
76#define __IMX8MP_VPU_PLL_LOCKD_CTRL (__IMX8MP_CCM_BASE__ + 0x7C)
77#define __IMX8MP_VPU_PLL_MNIT_CTRL (__IMX8MP_CCM_BASE__ + 0x80)
78
79#define __IMX8MP_ARM_PLL_GEN_CTRL (__IMX8MP_CCM_BASE__ + 0x84)
80#define __IMX8MP_ARM_PLL_FDIV_CTL0 (__IMX8MP_CCM_BASE__ + 0x88)
81#define __IMX8MP_ARM_PLL_LOCKD_CTRL (__IMX8MP_CCM_BASE__ + 0x8C)
82#define __IMX8MP_ARM_PLL_MNIT_CTRL (__IMX8MP_CCM_BASE__ + 0x90)
83
84#define __IMX8MP_SYS_PLL1_GEN_CTRL (__IMX8MP_CCM_BASE__ + 0x94)
85#define __IMX8MP_SYS_PLL1_FDIV_CTL0 (__IMX8MP_CCM_BASE__ + 0x98)
86#define __IMX8MP_SYS_PLL1_LOCKD_CTRL (__IMX8MP_CCM_BASE__ + 0x9C)
87#define __IMX8MP_SYS_PLL1_MNIT_CTRL (__IMX8MP_CCM_BASE__ + 0x100)
88
89#define __IMX8MP_SYS_PLL2_GEN_CTRL (__IMX8MP_CCM_BASE__ + 0x104)
90#define __IMX8MP_SYS_PLL2_FDIV_CTL0 (__IMX8MP_CCM_BASE__ + 0x108)
91#define __IMX8MP_SYS_PLL2_LOCKD_CTRL (__IMX8MP_CCM_BASE__ + 0x10C)
92#define __IMX8MP_SYS_PLL2_MNIT_CTRL (__IMX8MP_CCM_BASE__ + 0x110)
93
94#define __IMX8MP_SYS_PLL3_GEN_CTRL (__IMX8MP_CCM_BASE__ + 0x114)
95#define __IMX8MP_SYS_PLL3_FDIV_CTL0 (__IMX8MP_CCM_BASE__ + 0x118)
96#define __IMX8MP_SYS_PLL3_LOCKD_CTRL (__IMX8MP_CCM_BASE__ + 0x11C)
97#define __IMX8MP_SYS_PLL3_MNIT_CTRL (__IMX8MP_CCM_BASE__ + 0x120)
98
99#define __IMX8MP_OSC_MISC_CFG (__IMX8MP_CCM_BASE__ + 0x124)
100#define __IMX8MP_ANAMIX_PLL_MNIT_CTL (__IMX8MP_CCM_BASE__ + 0X128)
101#define __IMX8MP_CCM_ANALOG_DIGPROG 0x800
102
103
105#define IMX8MP_PLL14XX_MDIV_SHIFT 12
106#define IMX8MP_PLL14XX_MDIV_MASK BORDOISILA_GENMASK(21,12)
107#define IMX8MP_PLL14XX_PDIV_SHIFT 4
108#define IMX8MP_PLL14XX_PDIV_MASK BORDOISILA_GENMASK(9,4)
109#define IMX8MP_PLL14XX_SDIV_SHIFT 0
110#define IMX8MP_PLL14XX_SDIV_MASK BORDOISILA_GENMASK(2, 0)
111#define IMX8MP_PLL14XX_KDIV_SHIFT 0
112#define IMX8MP_PLL14XX_KDIV_MASK BORDOISILA_GENMASK(15, 0)
113
114#define LOCK_STATUS BORDOISILA_BIT(31)
115#define LOCK_SEL_MASK BORDOISILA_BIT(29)
116#define CLKE_MASK BORDOISILA_BIT(11)
117#define RST_MASK BORDOISILA_BIT(9)
118#define BYPASS_MASK BORDOISILA_BIT(4)
119
120
122 unsigned int rate;
123 unsigned int pdiv;
124 unsigned int mdiv;
125 unsigned int sdiv;
126 unsigned int kdiv;
127};
128
129
130extern void imx8mp_pll_init();
131
139extern unsigned long imx8mp_pll_recalc_rate(uint64_t pllbase, unsigned long parent_rate);
140
141
143
144#endif
unsigned int uint32_t
Definition acefiex.h:163
COMPILER_DEPENDENT_UINT64 uint64_t
Definition acefiex.h:165
uint32_t imx8mp_pll_get_parent_rate(uint64_t pll_base)
unsigned long imx8mp_pll_recalc_rate(uint64_t pllbase, unsigned long parent_rate)
imx8mp_pll_recalc_rate – recalculate pll rate
void imx8mp_pll_init()
Definition imx8mp_pll.h:121
unsigned int kdiv
Definition imx8mp_pll.h:126
unsigned int rate
Definition imx8mp_pll.h:122
unsigned int pdiv
Definition imx8mp_pll.h:123
unsigned int sdiv
Definition imx8mp_pll.h:125
unsigned int mdiv
Definition imx8mp_pll.h:124