1 // SPDX-License-Identifier: GPL-2.0-only
3 * AM33XX Clock Domain data.
5 * Copyright (C) 2011-2012 Texas Instruments Incorporated - https://www.ti.com/
6 * Vaibhav Hiremath <hvaibhav@ti.com>
9 #include <linux/kernel.h>
12 #include "clockdomain.h"
15 #include "cm-regbits-33xx.h"
17 static struct clockdomain l4ls_am33xx_clkdm
= {
19 .pwrdm
= { .name
= "per_pwrdm" },
20 .cm_inst
= AM33XX_CM_PER_MOD
,
21 .clkdm_offs
= AM33XX_CM_PER_L4LS_CLKSTCTRL_OFFSET
,
22 .flags
= CLKDM_CAN_SWSUP
,
25 static struct clockdomain l3s_am33xx_clkdm
= {
27 .pwrdm
= { .name
= "per_pwrdm" },
28 .cm_inst
= AM33XX_CM_PER_MOD
,
29 .clkdm_offs
= AM33XX_CM_PER_L3S_CLKSTCTRL_OFFSET
,
30 .flags
= CLKDM_CAN_SWSUP
,
33 static struct clockdomain l4fw_am33xx_clkdm
= {
35 .pwrdm
= { .name
= "per_pwrdm" },
36 .cm_inst
= AM33XX_CM_PER_MOD
,
37 .clkdm_offs
= AM33XX_CM_PER_L4FW_CLKSTCTRL_OFFSET
,
38 .flags
= CLKDM_CAN_SWSUP
,
41 static struct clockdomain l3_am33xx_clkdm
= {
43 .pwrdm
= { .name
= "per_pwrdm" },
44 .cm_inst
= AM33XX_CM_PER_MOD
,
45 .clkdm_offs
= AM33XX_CM_PER_L3_CLKSTCTRL_OFFSET
,
46 .flags
= CLKDM_CAN_SWSUP
,
49 static struct clockdomain l4hs_am33xx_clkdm
= {
51 .pwrdm
= { .name
= "per_pwrdm" },
52 .cm_inst
= AM33XX_CM_PER_MOD
,
53 .clkdm_offs
= AM33XX_CM_PER_L4HS_CLKSTCTRL_OFFSET
,
54 .flags
= CLKDM_CAN_SWSUP
,
57 static struct clockdomain ocpwp_l3_am33xx_clkdm
= {
58 .name
= "ocpwp_l3_clkdm",
59 .pwrdm
= { .name
= "per_pwrdm" },
60 .cm_inst
= AM33XX_CM_PER_MOD
,
61 .clkdm_offs
= AM33XX_CM_PER_OCPWP_L3_CLKSTCTRL_OFFSET
,
62 .flags
= CLKDM_CAN_SWSUP
,
65 static struct clockdomain pruss_ocp_am33xx_clkdm
= {
66 .name
= "pruss_ocp_clkdm",
67 .pwrdm
= { .name
= "per_pwrdm" },
68 .cm_inst
= AM33XX_CM_PER_MOD
,
69 .clkdm_offs
= AM33XX_CM_PER_PRUSS_CLKSTCTRL_OFFSET
,
70 .flags
= CLKDM_CAN_SWSUP
,
73 static struct clockdomain cpsw_125mhz_am33xx_clkdm
= {
74 .name
= "cpsw_125mhz_clkdm",
75 .pwrdm
= { .name
= "per_pwrdm" },
76 .cm_inst
= AM33XX_CM_PER_MOD
,
77 .clkdm_offs
= AM33XX_CM_PER_CPSW_CLKSTCTRL_OFFSET
,
78 .flags
= CLKDM_CAN_SWSUP
,
81 static struct clockdomain lcdc_am33xx_clkdm
= {
83 .pwrdm
= { .name
= "per_pwrdm" },
84 .cm_inst
= AM33XX_CM_PER_MOD
,
85 .clkdm_offs
= AM33XX_CM_PER_LCDC_CLKSTCTRL_OFFSET
,
86 .flags
= CLKDM_CAN_SWSUP
,
89 static struct clockdomain clk_24mhz_am33xx_clkdm
= {
90 .name
= "clk_24mhz_clkdm",
91 .pwrdm
= { .name
= "per_pwrdm" },
92 .cm_inst
= AM33XX_CM_PER_MOD
,
93 .clkdm_offs
= AM33XX_CM_PER_CLK_24MHZ_CLKSTCTRL_OFFSET
,
94 .flags
= CLKDM_CAN_SWSUP
,
97 static struct clockdomain l4_wkup_am33xx_clkdm
= {
98 .name
= "l4_wkup_clkdm",
99 .pwrdm
= { .name
= "wkup_pwrdm" },
100 .cm_inst
= AM33XX_CM_WKUP_MOD
,
101 .clkdm_offs
= AM33XX_CM_WKUP_CLKSTCTRL_OFFSET
,
102 .flags
= CLKDM_CAN_SWSUP
,
105 static struct clockdomain l3_aon_am33xx_clkdm
= {
106 .name
= "l3_aon_clkdm",
107 .pwrdm
= { .name
= "wkup_pwrdm" },
108 .cm_inst
= AM33XX_CM_WKUP_MOD
,
109 .clkdm_offs
= AM33XX_CM_L3_AON_CLKSTCTRL_OFFSET
,
110 .flags
= CLKDM_CAN_SWSUP
,
113 static struct clockdomain l4_wkup_aon_am33xx_clkdm
= {
114 .name
= "l4_wkup_aon_clkdm",
115 .pwrdm
= { .name
= "wkup_pwrdm" },
116 .cm_inst
= AM33XX_CM_WKUP_MOD
,
117 .clkdm_offs
= AM33XX_CM_L4_WKUP_AON_CLKSTCTRL_OFFSET
,
118 .flags
= CLKDM_CAN_SWSUP
,
121 static struct clockdomain mpu_am33xx_clkdm
= {
123 .pwrdm
= { .name
= "mpu_pwrdm" },
124 .cm_inst
= AM33XX_CM_MPU_MOD
,
125 .clkdm_offs
= AM33XX_CM_MPU_CLKSTCTRL_OFFSET
,
126 .flags
= CLKDM_CAN_SWSUP
,
129 static struct clockdomain l4_rtc_am33xx_clkdm
= {
130 .name
= "l4_rtc_clkdm",
131 .pwrdm
= { .name
= "rtc_pwrdm" },
132 .cm_inst
= AM33XX_CM_RTC_MOD
,
133 .clkdm_offs
= AM33XX_CM_RTC_CLKSTCTRL_OFFSET
,
134 .flags
= CLKDM_CAN_SWSUP
,
137 static struct clockdomain gfx_l3_am33xx_clkdm
= {
138 .name
= "gfx_l3_clkdm",
139 .pwrdm
= { .name
= "gfx_pwrdm" },
140 .cm_inst
= AM33XX_CM_GFX_MOD
,
141 .clkdm_offs
= AM33XX_CM_GFX_L3_CLKSTCTRL_OFFSET
,
142 .flags
= CLKDM_CAN_SWSUP
,
145 static struct clockdomain gfx_l4ls_gfx_am33xx_clkdm
= {
146 .name
= "gfx_l4ls_gfx_clkdm",
147 .pwrdm
= { .name
= "gfx_pwrdm" },
148 .cm_inst
= AM33XX_CM_GFX_MOD
,
149 .clkdm_offs
= AM33XX_CM_GFX_L4LS_GFX_CLKSTCTRL__1_OFFSET
,
150 .flags
= CLKDM_CAN_SWSUP
,
153 static struct clockdomain l4_cefuse_am33xx_clkdm
= {
154 .name
= "l4_cefuse_clkdm",
155 .pwrdm
= { .name
= "cefuse_pwrdm" },
156 .cm_inst
= AM33XX_CM_CEFUSE_MOD
,
157 .clkdm_offs
= AM33XX_CM_CEFUSE_CLKSTCTRL_OFFSET
,
158 .flags
= CLKDM_CAN_SWSUP
,
161 static struct clockdomain
*clockdomains_am33xx
[] __initdata
= {
167 &ocpwp_l3_am33xx_clkdm
,
168 &pruss_ocp_am33xx_clkdm
,
169 &cpsw_125mhz_am33xx_clkdm
,
171 &clk_24mhz_am33xx_clkdm
,
172 &l4_wkup_am33xx_clkdm
,
173 &l3_aon_am33xx_clkdm
,
174 &l4_wkup_aon_am33xx_clkdm
,
176 &l4_rtc_am33xx_clkdm
,
177 &gfx_l3_am33xx_clkdm
,
178 &gfx_l4ls_gfx_am33xx_clkdm
,
179 &l4_cefuse_am33xx_clkdm
,
183 void __init
am33xx_clockdomains_init(void)
185 clkdm_register_platform_funcs(&am33xx_clkdm_operations
);
186 clkdm_register_clkdms(clockdomains_am33xx
);
187 clkdm_complete_init();