1 // SPDX-License-Identifier: GPL-2.0-only
3 * AM43xx Clock domains framework
5 * Copyright (C) 2013 Texas Instruments, Inc.
8 #include <linux/kernel.h>
11 #include "clockdomain.h"
15 static struct clockdomain l4_cefuse_43xx_clkdm
= {
16 .name
= "l4_cefuse_clkdm",
17 .pwrdm
= { .name
= "cefuse_pwrdm" },
18 .prcm_partition
= AM43XX_CM_PARTITION
,
19 .cm_inst
= AM43XX_CM_CEFUSE_INST
,
20 .clkdm_offs
= AM43XX_CM_CEFUSE_CEFUSE_CDOFFS
,
21 .flags
= CLKDM_CAN_SWSUP
,
24 static struct clockdomain mpu_43xx_clkdm
= {
26 .pwrdm
= { .name
= "mpu_pwrdm" },
27 .prcm_partition
= AM43XX_CM_PARTITION
,
28 .cm_inst
= AM43XX_CM_MPU_INST
,
29 .clkdm_offs
= AM43XX_CM_MPU_MPU_CDOFFS
,
30 .flags
= CLKDM_CAN_HWSUP_SWSUP
,
33 static struct clockdomain l4ls_43xx_clkdm
= {
35 .pwrdm
= { .name
= "per_pwrdm" },
36 .prcm_partition
= AM43XX_CM_PARTITION
,
37 .cm_inst
= AM43XX_CM_PER_INST
,
38 .clkdm_offs
= AM43XX_CM_PER_L4LS_CDOFFS
,
39 .flags
= CLKDM_CAN_SWSUP
,
42 static struct clockdomain tamper_43xx_clkdm
= {
43 .name
= "tamper_clkdm",
44 .pwrdm
= { .name
= "tamper_pwrdm" },
45 .prcm_partition
= AM43XX_CM_PARTITION
,
46 .cm_inst
= AM43XX_CM_TAMPER_INST
,
47 .clkdm_offs
= AM43XX_CM_TAMPER_TAMPER_CDOFFS
,
48 .flags
= CLKDM_CAN_SWSUP
,
51 static struct clockdomain l4_rtc_43xx_clkdm
= {
52 .name
= "l4_rtc_clkdm",
53 .pwrdm
= { .name
= "rtc_pwrdm" },
54 .prcm_partition
= AM43XX_CM_PARTITION
,
55 .cm_inst
= AM43XX_CM_RTC_INST
,
56 .clkdm_offs
= AM43XX_CM_RTC_RTC_CDOFFS
,
57 .flags
= CLKDM_CAN_SWSUP
,
60 static struct clockdomain pruss_ocp_43xx_clkdm
= {
61 .name
= "pruss_ocp_clkdm",
62 .pwrdm
= { .name
= "per_pwrdm" },
63 .prcm_partition
= AM43XX_CM_PARTITION
,
64 .cm_inst
= AM43XX_CM_PER_INST
,
65 .clkdm_offs
= AM43XX_CM_PER_ICSS_CDOFFS
,
66 .flags
= CLKDM_CAN_SWSUP
,
69 static struct clockdomain ocpwp_l3_43xx_clkdm
= {
70 .name
= "ocpwp_l3_clkdm",
71 .pwrdm
= { .name
= "per_pwrdm" },
72 .prcm_partition
= AM43XX_CM_PARTITION
,
73 .cm_inst
= AM43XX_CM_PER_INST
,
74 .clkdm_offs
= AM43XX_CM_PER_OCPWP_L3_CDOFFS
,
75 .flags
= CLKDM_CAN_SWSUP
,
78 static struct clockdomain l3s_tsc_43xx_clkdm
= {
79 .name
= "l3s_tsc_clkdm",
80 .pwrdm
= { .name
= "wkup_pwrdm" },
81 .prcm_partition
= AM43XX_CM_PARTITION
,
82 .cm_inst
= AM43XX_CM_WKUP_INST
,
83 .clkdm_offs
= AM43XX_CM_WKUP_L3S_TSC_CDOFFS
,
84 .flags
= CLKDM_CAN_SWSUP
,
87 static struct clockdomain dss_43xx_clkdm
= {
89 .pwrdm
= { .name
= "per_pwrdm" },
90 .prcm_partition
= AM43XX_CM_PARTITION
,
91 .cm_inst
= AM43XX_CM_PER_INST
,
92 .clkdm_offs
= AM43XX_CM_PER_DSS_CDOFFS
,
93 .flags
= CLKDM_CAN_SWSUP
,
96 static struct clockdomain l3_aon_43xx_clkdm
= {
97 .name
= "l3_aon_clkdm",
98 .pwrdm
= { .name
= "wkup_pwrdm" },
99 .prcm_partition
= AM43XX_CM_PARTITION
,
100 .cm_inst
= AM43XX_CM_WKUP_INST
,
101 .clkdm_offs
= AM43XX_CM_WKUP_L3_AON_CDOFFS
,
102 .flags
= CLKDM_CAN_SWSUP
,
105 static struct clockdomain emif_43xx_clkdm
= {
106 .name
= "emif_clkdm",
107 .pwrdm
= { .name
= "per_pwrdm" },
108 .prcm_partition
= AM43XX_CM_PARTITION
,
109 .cm_inst
= AM43XX_CM_PER_INST
,
110 .clkdm_offs
= AM43XX_CM_PER_EMIF_CDOFFS
,
111 .flags
= CLKDM_CAN_SWSUP
,
114 static struct clockdomain l4_wkup_aon_43xx_clkdm
= {
115 .name
= "l4_wkup_aon_clkdm",
116 .pwrdm
= { .name
= "wkup_pwrdm" },
117 .prcm_partition
= AM43XX_CM_PARTITION
,
118 .cm_inst
= AM43XX_CM_WKUP_INST
,
119 .clkdm_offs
= AM43XX_CM_WKUP_L4_WKUP_AON_CDOFFS
,
122 static struct clockdomain l3_43xx_clkdm
= {
124 .pwrdm
= { .name
= "per_pwrdm" },
125 .prcm_partition
= AM43XX_CM_PARTITION
,
126 .cm_inst
= AM43XX_CM_PER_INST
,
127 .clkdm_offs
= AM43XX_CM_PER_L3_CDOFFS
,
128 .flags
= CLKDM_CAN_SWSUP
,
131 static struct clockdomain l4_wkup_43xx_clkdm
= {
132 .name
= "l4_wkup_clkdm",
133 .pwrdm
= { .name
= "wkup_pwrdm" },
134 .prcm_partition
= AM43XX_CM_PARTITION
,
135 .cm_inst
= AM43XX_CM_WKUP_INST
,
136 .clkdm_offs
= AM43XX_CM_WKUP_WKUP_CDOFFS
,
137 .flags
= CLKDM_CAN_SWSUP
,
140 static struct clockdomain cpsw_125mhz_43xx_clkdm
= {
141 .name
= "cpsw_125mhz_clkdm",
142 .pwrdm
= { .name
= "per_pwrdm" },
143 .prcm_partition
= AM43XX_CM_PARTITION
,
144 .cm_inst
= AM43XX_CM_PER_INST
,
145 .clkdm_offs
= AM43XX_CM_PER_CPSW_CDOFFS
,
146 .flags
= CLKDM_CAN_SWSUP
,
149 static struct clockdomain gfx_l3_43xx_clkdm
= {
150 .name
= "gfx_l3_clkdm",
151 .pwrdm
= { .name
= "gfx_pwrdm" },
152 .prcm_partition
= AM43XX_CM_PARTITION
,
153 .cm_inst
= AM43XX_CM_GFX_INST
,
154 .clkdm_offs
= AM43XX_CM_GFX_GFX_L3_CDOFFS
,
155 .flags
= CLKDM_CAN_SWSUP
,
158 static struct clockdomain l3s_43xx_clkdm
= {
160 .pwrdm
= { .name
= "per_pwrdm" },
161 .prcm_partition
= AM43XX_CM_PARTITION
,
162 .cm_inst
= AM43XX_CM_PER_INST
,
163 .clkdm_offs
= AM43XX_CM_PER_L3S_CDOFFS
,
164 .flags
= CLKDM_CAN_SWSUP
,
167 static struct clockdomain
*clockdomains_am43xx
[] __initdata
= {
168 &l4_cefuse_43xx_clkdm
,
173 &pruss_ocp_43xx_clkdm
,
174 &ocpwp_l3_43xx_clkdm
,
179 &l4_wkup_aon_43xx_clkdm
,
182 &cpsw_125mhz_43xx_clkdm
,
188 void __init
am43xx_clockdomains_init(void)
190 clkdm_register_platform_funcs(&am43xx_clkdm_operations
);
191 clkdm_register_clkdms(clockdomains_am43xx
);
192 clkdm_complete_init();