···11-/*22- *33- * Copyright (C) 2013 Texas Instruments Incorporated44- *55- * Data common for AM335x and AM43x66- *77- * This program is free software; you can redistribute it and/or88- * modify it under the terms of the GNU General Public License as99- * published by the Free Software Foundation version 2.1010- *1111- * This program is distributed "as is" WITHOUT ANY WARRANTY of any1212- * kind, whether express or implied; without even the implied warranty1313- * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the1414- * GNU General Public License for more details.1515- */1616-1717-#ifndef __ARCH_ARM_MACH_OMAP2_OMAP_HWMOD_33XX_43XX_COMMON_DATA_H1818-#define __ARCH_ARM_MACH_OMAP2_OMAP_HWMOD_33XX_43XX_COMMON_DATA_H1919-2020-extern struct omap_hwmod_ocp_if am33xx_l3_main__l3_s;2121-extern struct omap_hwmod_ocp_if am33xx_l3_s__l4_ls;2222-extern struct omap_hwmod_ocp_if am33xx_l3_s__l4_wkup;2323-extern struct omap_hwmod_ocp_if am33xx_l3_main__l3_instr;2424-extern struct omap_hwmod_ocp_if am33xx_l3_s__l3_main;2525-extern struct omap_hwmod_ocp_if am33xx_gfx__l3_main;2626-extern struct omap_hwmod_ocp_if am33xx_l3_main__gfx;2727-extern struct omap_hwmod_ocp_if am33xx_l4_ls__timer2;2828-extern struct omap_hwmod_ocp_if am33xx_l3_main__ocmc;2929-3030-extern struct omap_hwmod am33xx_l3_main_hwmod;3131-extern struct omap_hwmod am33xx_l3_s_hwmod;3232-extern struct omap_hwmod am33xx_l3_instr_hwmod;3333-extern struct omap_hwmod am33xx_l4_ls_hwmod;3434-extern struct omap_hwmod am33xx_l4_wkup_hwmod;3535-extern struct omap_hwmod am33xx_gfx_hwmod;3636-extern struct omap_hwmod am33xx_prcm_hwmod;3737-extern struct omap_hwmod am33xx_ocmcram_hwmod;3838-extern struct omap_hwmod am33xx_smartreflex0_hwmod;3939-extern struct omap_hwmod am33xx_smartreflex1_hwmod;4040-4141-extern struct omap_hwmod_class am33xx_emif_hwmod_class;4242-extern struct omap_hwmod_class am33xx_l4_hwmod_class;4343-extern struct omap_hwmod_class am33xx_wkup_m3_hwmod_class;4444-extern struct omap_hwmod_class am33xx_control_hwmod_class;4545-extern struct omap_hwmod_class am33xx_timer_hwmod_class;4646-extern struct omap_hwmod_class am33xx_ehrpwm_hwmod_class;4747-extern struct omap_hwmod_class am33xx_spi_hwmod_class;4848-4949-void omap_hwmod_am33xx_reg(void);5050-void omap_hwmod_am43xx_reg(void);5151-5252-#endif
···11-/*22- *33- * Copyright (C) 2013 Texas Instruments Incorporated44- *55- * Interconnects common for AM335x and AM43x66- *77- * This program is free software; you can redistribute it and/or88- * modify it under the terms of the GNU General Public License as99- * published by the Free Software Foundation version 2.1010- *1111- * This program is distributed "as is" WITHOUT ANY WARRANTY of any1212- * kind, whether express or implied; without even the implied warranty1313- * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the1414- * GNU General Public License for more details.1515- */1616-1717-#include <linux/sizes.h>1818-#include "omap_hwmod.h"1919-#include "omap_hwmod_33xx_43xx_common_data.h"2020-2121-/* l3 main -> l3 s */2222-struct omap_hwmod_ocp_if am33xx_l3_main__l3_s = {2323- .master = &am33xx_l3_main_hwmod,2424- .slave = &am33xx_l3_s_hwmod,2525- .clk = "l3s_gclk",2626- .user = OCP_USER_MPU | OCP_USER_SDMA,2727-};2828-2929-/* l3 s -> l4 per/ls */3030-struct omap_hwmod_ocp_if am33xx_l3_s__l4_ls = {3131- .master = &am33xx_l3_s_hwmod,3232- .slave = &am33xx_l4_ls_hwmod,3333- .clk = "l3s_gclk",3434- .user = OCP_USER_MPU | OCP_USER_SDMA,3535-};3636-3737-/* l3 s -> l4 wkup */3838-struct omap_hwmod_ocp_if am33xx_l3_s__l4_wkup = {3939- .master = &am33xx_l3_s_hwmod,4040- .slave = &am33xx_l4_wkup_hwmod,4141- .clk = "l3s_gclk",4242- .user = OCP_USER_MPU | OCP_USER_SDMA,4343-};4444-4545-/* l3 main -> l3 instr */4646-struct omap_hwmod_ocp_if am33xx_l3_main__l3_instr = {4747- .master = &am33xx_l3_main_hwmod,4848- .slave = &am33xx_l3_instr_hwmod,4949- .clk = "l3s_gclk",5050- .user = OCP_USER_MPU | OCP_USER_SDMA,5151-};5252-5353-/* l3 s -> l3 main*/5454-struct omap_hwmod_ocp_if am33xx_l3_s__l3_main = {5555- .master = &am33xx_l3_s_hwmod,5656- .slave = &am33xx_l3_main_hwmod,5757- .clk = "l3s_gclk",5858- .user = OCP_USER_MPU | OCP_USER_SDMA,5959-};
···11-/*22- *33- * Copyright (C) 2013 Texas Instruments Incorporated44- *55- * Hwmod common for AM335x and AM43x66- *77- * This program is free software; you can redistribute it and/or88- * modify it under the terms of the GNU General Public License as99- * published by the Free Software Foundation version 2.1010- *1111- * This program is distributed "as is" WITHOUT ANY WARRANTY of any1212- * kind, whether express or implied; without even the implied warranty1313- * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the1414- * GNU General Public License for more details.1515- */1616-1717-#include <linux/types.h>1818-1919-#include "omap_hwmod.h"2020-#include "cm33xx.h"2121-#include "prm33xx.h"2222-#include "omap_hwmod_33xx_43xx_common_data.h"2323-#include "prcm43xx.h"2424-#include "common.h"2525-2626-#define CLKCTRL(oh, clkctrl) ((oh).prcm.omap4.clkctrl_offs = (clkctrl))2727-#define RSTCTRL(oh, rstctrl) ((oh).prcm.omap4.rstctrl_offs = (rstctrl))2828-#define RSTST(oh, rstst) ((oh).prcm.omap4.rstst_offs = (rstst))2929-3030-/*3131- * 'l3' class3232- * instance(s): l3_main, l3_s, l3_instr3333- */3434-static struct omap_hwmod_class am33xx_l3_hwmod_class = {3535- .name = "l3",3636-};3737-3838-struct omap_hwmod am33xx_l3_main_hwmod = {3939- .name = "l3_main",4040- .class = &am33xx_l3_hwmod_class,4141- .clkdm_name = "l3_clkdm",4242- .flags = HWMOD_INIT_NO_IDLE,4343- .main_clk = "l3_gclk",4444- .prcm = {4545- .omap4 = {4646- .modulemode = MODULEMODE_SWCTRL,4747- },4848- },4949-};5050-5151-/* l3_s */5252-struct omap_hwmod am33xx_l3_s_hwmod = {5353- .name = "l3_s",5454- .class = &am33xx_l3_hwmod_class,5555- .clkdm_name = "l3s_clkdm",5656-};5757-5858-/* l3_instr */5959-struct omap_hwmod am33xx_l3_instr_hwmod = {6060- .name = "l3_instr",6161- .class = &am33xx_l3_hwmod_class,6262- .clkdm_name = "l3_clkdm",6363- .flags = HWMOD_INIT_NO_IDLE,6464- .main_clk = "l3_gclk",6565- .prcm = {6666- .omap4 = {6767- .modulemode = MODULEMODE_SWCTRL,6868- },6969- },7070-};7171-7272-/*7373- * 'l4' class7474- * instance(s): l4_ls, l4_hs, l4_wkup, l4_fw7575- */7676-struct omap_hwmod_class am33xx_l4_hwmod_class = {7777- .name = "l4",7878-};7979-8080-/* l4_ls */8181-struct omap_hwmod am33xx_l4_ls_hwmod = {8282- .name = "l4_ls",8383- .class = &am33xx_l4_hwmod_class,8484- .clkdm_name = "l4ls_clkdm",8585- .flags = HWMOD_INIT_NO_IDLE,8686- .main_clk = "l4ls_gclk",8787- .prcm = {8888- .omap4 = {8989- .modulemode = MODULEMODE_SWCTRL,9090- },9191- },9292-};9393-9494-/* l4_wkup */9595-struct omap_hwmod am33xx_l4_wkup_hwmod = {9696- .name = "l4_wkup",9797- .class = &am33xx_l4_hwmod_class,9898- .clkdm_name = "l4_wkup_clkdm",9999- .flags = HWMOD_INIT_NO_IDLE,100100- .prcm = {101101- .omap4 = {102102- .modulemode = MODULEMODE_SWCTRL,103103- },104104- },105105-};106106-107107-/*108108- * 'prcm' class109109- * power and reset manager (whole prcm infrastructure)110110- */111111-static struct omap_hwmod_class am33xx_prcm_hwmod_class = {112112- .name = "prcm",113113-};114114-115115-/* prcm */116116-struct omap_hwmod am33xx_prcm_hwmod = {117117- .name = "prcm",118118- .class = &am33xx_prcm_hwmod_class,119119- .clkdm_name = "l4_wkup_clkdm",120120-};121121-122122-/* 'smartreflex' class */123123-static struct omap_hwmod_class am33xx_smartreflex_hwmod_class = {124124- .name = "smartreflex",125125-};126126-127127-/* smartreflex0 */128128-struct omap_hwmod am33xx_smartreflex0_hwmod = {129129- .name = "smartreflex0",130130- .class = &am33xx_smartreflex_hwmod_class,131131- .clkdm_name = "l4_wkup_clkdm",132132- .main_clk = "smartreflex0_fck",133133- .prcm = {134134- .omap4 = {135135- .modulemode = MODULEMODE_SWCTRL,136136- },137137- },138138-};139139-140140-/* smartreflex1 */141141-struct omap_hwmod am33xx_smartreflex1_hwmod = {142142- .name = "smartreflex1",143143- .class = &am33xx_smartreflex_hwmod_class,144144- .clkdm_name = "l4_wkup_clkdm",145145- .main_clk = "smartreflex1_fck",146146- .prcm = {147147- .omap4 = {148148- .modulemode = MODULEMODE_SWCTRL,149149- },150150- },151151-};152152-153153-static void omap_hwmod_am33xx_clkctrl(void)154154-{155155- CLKCTRL(am33xx_smartreflex0_hwmod,156156- AM33XX_CM_WKUP_SMARTREFLEX0_CLKCTRL_OFFSET);157157- CLKCTRL(am33xx_smartreflex1_hwmod,158158- AM33XX_CM_WKUP_SMARTREFLEX1_CLKCTRL_OFFSET);159159- CLKCTRL(am33xx_l4_ls_hwmod, AM33XX_CM_PER_L4LS_CLKCTRL_OFFSET);160160- CLKCTRL(am33xx_l4_wkup_hwmod, AM33XX_CM_WKUP_L4WKUP_CLKCTRL_OFFSET);161161- CLKCTRL(am33xx_l3_main_hwmod, AM33XX_CM_PER_L3_CLKCTRL_OFFSET);162162- CLKCTRL(am33xx_l3_instr_hwmod , AM33XX_CM_PER_L3_INSTR_CLKCTRL_OFFSET);163163-}164164-165165-void omap_hwmod_am33xx_reg(void)166166-{167167- omap_hwmod_am33xx_clkctrl();168168-}169169-170170-static void omap_hwmod_am43xx_clkctrl(void)171171-{172172- CLKCTRL(am33xx_smartreflex0_hwmod,173173- AM43XX_CM_WKUP_SMARTREFLEX0_CLKCTRL_OFFSET);174174- CLKCTRL(am33xx_smartreflex1_hwmod,175175- AM43XX_CM_WKUP_SMARTREFLEX1_CLKCTRL_OFFSET);176176- CLKCTRL(am33xx_l4_ls_hwmod, AM43XX_CM_PER_L4LS_CLKCTRL_OFFSET);177177- CLKCTRL(am33xx_l4_wkup_hwmod, AM43XX_CM_WKUP_L4WKUP_CLKCTRL_OFFSET);178178- CLKCTRL(am33xx_l3_main_hwmod, AM43XX_CM_PER_L3_CLKCTRL_OFFSET);179179-}180180-181181-void omap_hwmod_am43xx_reg(void)182182-{183183- omap_hwmod_am43xx_clkctrl();184184-}
-81
arch/arm/mach-omap2/omap_hwmod_43xx_data.c
···11-/*22- * Copyright (C) 2013 Texas Instruments Incorporated33- *44- * Hwmod present only in AM43x and those that differ other than register55- * offsets as compared to AM335x.66- *77- * This program is free software; you can redistribute it and/or88- * modify it under the terms of the GNU General Public License as99- * published by the Free Software Foundation version 2.1010- *1111- * This program is distributed "as is" WITHOUT ANY WARRANTY of any1212- * kind, whether express or implied; without even the implied warranty1313- * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the1414- * GNU General Public License for more details.1515- */1616-1717-#include "omap_hwmod.h"1818-#include "omap_hwmod_33xx_43xx_common_data.h"1919-#include "prcm43xx.h"2020-#include "omap_hwmod_common_data.h"2121-2222-/* IP blocks */2323-static struct omap_hwmod am43xx_l4_hs_hwmod = {2424- .name = "l4_hs",2525- .class = &am33xx_l4_hwmod_class,2626- .clkdm_name = "l3_clkdm",2727- .flags = HWMOD_INIT_NO_IDLE,2828- .main_clk = "l4hs_gclk",2929- .prcm = {3030- .omap4 = {3131- .clkctrl_offs = AM43XX_CM_PER_L4HS_CLKCTRL_OFFSET,3232- .modulemode = MODULEMODE_SWCTRL,3333- },3434- },3535-};3636-3737-/* Interfaces */3838-3939-static struct omap_hwmod_ocp_if am43xx_l3_main__l4_hs = {4040- .master = &am33xx_l3_main_hwmod,4141- .slave = &am43xx_l4_hs_hwmod,4242- .clk = "l3s_gclk",4343- .user = OCP_USER_MPU | OCP_USER_SDMA,4444-};4545-4646-static struct omap_hwmod_ocp_if am43xx_l4_wkup__smartreflex0 = {4747- .master = &am33xx_l4_wkup_hwmod,4848- .slave = &am33xx_smartreflex0_hwmod,4949- .clk = "sys_clkin_ck",5050- .user = OCP_USER_MPU,5151-};5252-5353-static struct omap_hwmod_ocp_if am43xx_l4_wkup__smartreflex1 = {5454- .master = &am33xx_l4_wkup_hwmod,5555- .slave = &am33xx_smartreflex1_hwmod,5656- .clk = "sys_clkin_ck",5757- .user = OCP_USER_MPU,5858-};5959-6060-static struct omap_hwmod_ocp_if *am43xx_hwmod_ocp_ifs[] __initdata = {6161- &am33xx_l3_s__l4_ls,6262- &am33xx_l3_s__l4_wkup,6363- &am43xx_l3_main__l4_hs,6464- &am33xx_l3_main__l3_s,6565- &am33xx_l3_main__l3_instr,6666- &am33xx_l3_s__l3_main,6767- &am43xx_l4_wkup__smartreflex0,6868- &am43xx_l4_wkup__smartreflex1,6969- NULL,7070-};7171-7272-int __init am43xx_hwmod_init(void)7373-{7474- int ret;7575-7676- omap_hwmod_am43xx_reg();7777- omap_hwmod_init();7878- ret = omap_hwmod_register_links(am43xx_hwmod_ocp_ifs);7979-8080- return ret;8181-}