3 * Copyright (C) 2013 Texas Instruments Incorporated
5 * Hwmod common for AM335x and AM43x
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License as
9 * published by the Free Software Foundation version 2.
11 * This program is distributed "as is" WITHOUT ANY WARRANTY of any
12 * kind, whether express or implied; without even the implied warranty
13 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
17 #include <linux/types.h>
19 #include "omap_hwmod.h"
22 #include "omap_hwmod_33xx_43xx_common_data.h"
26 #define CLKCTRL(oh, clkctrl) ((oh).prcm.omap4.clkctrl_offs = (clkctrl))
27 #define RSTCTRL(oh, rstctrl) ((oh).prcm.omap4.rstctrl_offs = (rstctrl))
28 #define RSTST(oh, rstst) ((oh).prcm.omap4.rstst_offs = (rstst))
32 * instance(s): l3_main, l3_s, l3_instr
34 static struct omap_hwmod_class am33xx_l3_hwmod_class = {
38 struct omap_hwmod am33xx_l3_main_hwmod = {
40 .class = &am33xx_l3_hwmod_class,
41 .clkdm_name = "l3_clkdm",
42 .flags = HWMOD_INIT_NO_IDLE,
43 .main_clk = "l3_gclk",
46 .modulemode = MODULEMODE_SWCTRL,
52 struct omap_hwmod am33xx_l3_s_hwmod = {
54 .class = &am33xx_l3_hwmod_class,
55 .clkdm_name = "l3s_clkdm",
59 struct omap_hwmod am33xx_l3_instr_hwmod = {
61 .class = &am33xx_l3_hwmod_class,
62 .clkdm_name = "l3_clkdm",
63 .flags = HWMOD_INIT_NO_IDLE,
64 .main_clk = "l3_gclk",
67 .modulemode = MODULEMODE_SWCTRL,
74 * instance(s): l4_ls, l4_hs, l4_wkup, l4_fw
76 struct omap_hwmod_class am33xx_l4_hwmod_class = {
81 struct omap_hwmod am33xx_l4_ls_hwmod = {
83 .class = &am33xx_l4_hwmod_class,
84 .clkdm_name = "l4ls_clkdm",
85 .flags = HWMOD_INIT_NO_IDLE,
86 .main_clk = "l4ls_gclk",
89 .modulemode = MODULEMODE_SWCTRL,
95 struct omap_hwmod am33xx_l4_wkup_hwmod = {
97 .class = &am33xx_l4_hwmod_class,
98 .clkdm_name = "l4_wkup_clkdm",
99 .flags = HWMOD_INIT_NO_IDLE,
102 .modulemode = MODULEMODE_SWCTRL,
110 static struct omap_hwmod_class am33xx_mpu_hwmod_class = {
114 struct omap_hwmod am33xx_mpu_hwmod = {
116 .class = &am33xx_mpu_hwmod_class,
117 .clkdm_name = "mpu_clkdm",
118 .flags = HWMOD_INIT_NO_IDLE,
119 .main_clk = "dpll_mpu_m2_ck",
122 .modulemode = MODULEMODE_SWCTRL,
129 * Wakeup controller sub-system under wakeup domain
131 struct omap_hwmod_class am33xx_wkup_m3_hwmod_class = {
137 * power and reset manager (whole prcm infrastructure)
139 static struct omap_hwmod_class am33xx_prcm_hwmod_class = {
144 struct omap_hwmod am33xx_prcm_hwmod = {
146 .class = &am33xx_prcm_hwmod_class,
147 .clkdm_name = "l4_wkup_clkdm",
154 static struct omap_hwmod_class_sysconfig am33xx_emif_sysc = {
158 struct omap_hwmod_class am33xx_emif_hwmod_class = {
160 .sysc = &am33xx_emif_sysc,
166 static struct omap_hwmod_class am33xx_ocmcram_hwmod_class = {
170 struct omap_hwmod am33xx_ocmcram_hwmod = {
172 .class = &am33xx_ocmcram_hwmod_class,
173 .clkdm_name = "l3_clkdm",
174 .flags = HWMOD_INIT_NO_IDLE,
175 .main_clk = "l3_gclk",
178 .modulemode = MODULEMODE_SWCTRL,
183 /* 'smartreflex' class */
184 static struct omap_hwmod_class am33xx_smartreflex_hwmod_class = {
185 .name = "smartreflex",
189 struct omap_hwmod am33xx_smartreflex0_hwmod = {
190 .name = "smartreflex0",
191 .class = &am33xx_smartreflex_hwmod_class,
192 .clkdm_name = "l4_wkup_clkdm",
193 .main_clk = "smartreflex0_fck",
196 .modulemode = MODULEMODE_SWCTRL,
202 struct omap_hwmod am33xx_smartreflex1_hwmod = {
203 .name = "smartreflex1",
204 .class = &am33xx_smartreflex_hwmod_class,
205 .clkdm_name = "l4_wkup_clkdm",
206 .main_clk = "smartreflex1_fck",
209 .modulemode = MODULEMODE_SWCTRL,
215 * 'control' module class
217 struct omap_hwmod_class am33xx_control_hwmod_class = {
223 static struct omap_hwmod_class_sysconfig gpmc_sysc = {
227 .sysc_flags = (SYSC_HAS_AUTOIDLE | SYSC_HAS_SIDLEMODE |
228 SYSC_HAS_SOFTRESET | SYSS_HAS_RESET_STATUS),
229 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
230 .sysc_fields = &omap_hwmod_sysc_type1,
233 static struct omap_hwmod_class am33xx_gpmc_hwmod_class = {
238 struct omap_hwmod am33xx_gpmc_hwmod = {
240 .class = &am33xx_gpmc_hwmod_class,
241 .clkdm_name = "l3s_clkdm",
242 /* Skip reset for CONFIG_OMAP_GPMC_DEBUG for bootloader timings */
243 .flags = DEBUG_OMAP_GPMC_HWMOD_FLAGS,
244 .main_clk = "l3s_gclk",
247 .modulemode = MODULEMODE_SWCTRL,
252 static void omap_hwmod_am33xx_clkctrl(void)
254 CLKCTRL(am33xx_smartreflex0_hwmod,
255 AM33XX_CM_WKUP_SMARTREFLEX0_CLKCTRL_OFFSET);
256 CLKCTRL(am33xx_smartreflex1_hwmod,
257 AM33XX_CM_WKUP_SMARTREFLEX1_CLKCTRL_OFFSET);
258 CLKCTRL(am33xx_gpmc_hwmod, AM33XX_CM_PER_GPMC_CLKCTRL_OFFSET);
259 CLKCTRL(am33xx_l4_ls_hwmod, AM33XX_CM_PER_L4LS_CLKCTRL_OFFSET);
260 CLKCTRL(am33xx_l4_wkup_hwmod, AM33XX_CM_WKUP_L4WKUP_CLKCTRL_OFFSET);
261 CLKCTRL(am33xx_l3_main_hwmod, AM33XX_CM_PER_L3_CLKCTRL_OFFSET);
262 CLKCTRL(am33xx_mpu_hwmod , AM33XX_CM_MPU_MPU_CLKCTRL_OFFSET);
263 CLKCTRL(am33xx_l3_instr_hwmod , AM33XX_CM_PER_L3_INSTR_CLKCTRL_OFFSET);
264 CLKCTRL(am33xx_ocmcram_hwmod , AM33XX_CM_PER_OCMCRAM_CLKCTRL_OFFSET);
267 void omap_hwmod_am33xx_reg(void)
269 omap_hwmod_am33xx_clkctrl();
272 static void omap_hwmod_am43xx_clkctrl(void)
274 CLKCTRL(am33xx_smartreflex0_hwmod,
275 AM43XX_CM_WKUP_SMARTREFLEX0_CLKCTRL_OFFSET);
276 CLKCTRL(am33xx_smartreflex1_hwmod,
277 AM43XX_CM_WKUP_SMARTREFLEX1_CLKCTRL_OFFSET);
278 CLKCTRL(am33xx_gpmc_hwmod, AM43XX_CM_PER_GPMC_CLKCTRL_OFFSET);
279 CLKCTRL(am33xx_l4_ls_hwmod, AM43XX_CM_PER_L4LS_CLKCTRL_OFFSET);
280 CLKCTRL(am33xx_l4_wkup_hwmod, AM43XX_CM_WKUP_L4WKUP_CLKCTRL_OFFSET);
281 CLKCTRL(am33xx_l3_main_hwmod, AM43XX_CM_PER_L3_CLKCTRL_OFFSET);
282 CLKCTRL(am33xx_mpu_hwmod , AM43XX_CM_MPU_MPU_CLKCTRL_OFFSET);
283 CLKCTRL(am33xx_l3_instr_hwmod , AM43XX_CM_PER_L3_INSTR_CLKCTRL_OFFSET);
284 CLKCTRL(am33xx_ocmcram_hwmod , AM43XX_CM_PER_OCMCRAM_CLKCTRL_OFFSET);
287 void omap_hwmod_am43xx_reg(void)
289 omap_hwmod_am43xx_clkctrl();