diff options
author | Tony Lindgren <tony@atomide.com> | 2010-08-04 01:46:24 -0400 |
---|---|---|
committer | Tony Lindgren <tony@atomide.com> | 2010-08-04 01:46:24 -0400 |
commit | 331d919af416b9b92428947ef8c535a3e24c6b31 (patch) | |
tree | 1f58dfe4ea6ed130f7b970f07cd7589864e9cbad /arch/arm/mach-omap2 | |
parent | 047b51fb208c716294b4682c904df8a3ad8b6a69 (diff) | |
parent | fb8ce14c7e16bd218decb3e1655c5d4ff08042f2 (diff) |
Merge branch 'for_2.6.36' of git://git.pwsan.com/linux-2.6 into omap-for-linus
Diffstat (limited to 'arch/arm/mach-omap2')
-rw-r--r-- | arch/arm/mach-omap2/Makefile | 4 | ||||
-rw-r--r-- | arch/arm/mach-omap2/clock3xxx_data.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-omap2/cm.c | 6 | ||||
-rw-r--r-- | arch/arm/mach-omap2/io.c | 11 | ||||
-rw-r--r-- | arch/arm/mach-omap2/omap_hwmod.c | 106 | ||||
-rw-r--r-- | arch/arm/mach-omap2/omap_hwmod_2420_data.c | 79 | ||||
-rw-r--r-- | arch/arm/mach-omap2/omap_hwmod_2430_data.c | 81 | ||||
-rw-r--r-- | arch/arm/mach-omap2/omap_hwmod_3xxx_data.c | 92 | ||||
-rw-r--r-- | arch/arm/mach-omap2/omap_hwmod_common_data.c | 3 | ||||
-rw-r--r-- | arch/arm/mach-omap2/omap_hwmod_common_data.h | 1 | ||||
-rw-r--r-- | arch/arm/mach-omap2/pm.c | 84 |
11 files changed, 357 insertions, 112 deletions
diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile index a5266fab6177..63b2d8859c3c 100644 --- a/arch/arm/mach-omap2/Makefile +++ b/arch/arm/mach-omap2/Makefile | |||
@@ -3,7 +3,7 @@ | |||
3 | # | 3 | # |
4 | 4 | ||
5 | # Common support | 5 | # Common support |
6 | obj-y := id.o io.o control.o mux.o devices.o serial.o gpmc.o timer-gp.o | 6 | obj-y := id.o io.o control.o mux.o devices.o serial.o gpmc.o timer-gp.o pm.o |
7 | 7 | ||
8 | omap-2-3-common = irq.o sdrc.o | 8 | omap-2-3-common = irq.o sdrc.o |
9 | hwmod-common = omap_hwmod.o \ | 9 | hwmod-common = omap_hwmod.o \ |
@@ -15,7 +15,7 @@ clock-common = clock.o clock_common_data.o \ | |||
15 | 15 | ||
16 | obj-$(CONFIG_ARCH_OMAP2) += $(omap-2-3-common) $(prcm-common) $(hwmod-common) | 16 | obj-$(CONFIG_ARCH_OMAP2) += $(omap-2-3-common) $(prcm-common) $(hwmod-common) |
17 | obj-$(CONFIG_ARCH_OMAP3) += $(omap-2-3-common) $(prcm-common) $(hwmod-common) | 17 | obj-$(CONFIG_ARCH_OMAP3) += $(omap-2-3-common) $(prcm-common) $(hwmod-common) |
18 | obj-$(CONFIG_ARCH_OMAP4) += $(prcm-common) | 18 | obj-$(CONFIG_ARCH_OMAP4) += $(prcm-common) $(hwmod-common) |
19 | 19 | ||
20 | obj-$(CONFIG_OMAP_MCBSP) += mcbsp.o | 20 | obj-$(CONFIG_OMAP_MCBSP) += mcbsp.o |
21 | 21 | ||
diff --git a/arch/arm/mach-omap2/clock3xxx_data.c b/arch/arm/mach-omap2/clock3xxx_data.c index 41b155acfca7..c226798e9ac6 100644 --- a/arch/arm/mach-omap2/clock3xxx_data.c +++ b/arch/arm/mach-omap2/clock3xxx_data.c | |||
@@ -1408,7 +1408,7 @@ static struct clk ts_fck = { | |||
1408 | 1408 | ||
1409 | static struct clk usbtll_fck = { | 1409 | static struct clk usbtll_fck = { |
1410 | .name = "usbtll_fck", | 1410 | .name = "usbtll_fck", |
1411 | .ops = &clkops_omap2_dflt, | 1411 | .ops = &clkops_omap2_dflt_wait, |
1412 | .parent = &dpll5_m2_ck, | 1412 | .parent = &dpll5_m2_ck, |
1413 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP3430ES2_CM_FCLKEN3), | 1413 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP3430ES2_CM_FCLKEN3), |
1414 | .enable_bit = OMAP3430ES2_EN_USBTLL_SHIFT, | 1414 | .enable_bit = OMAP3430ES2_EN_USBTLL_SHIFT, |
diff --git a/arch/arm/mach-omap2/cm.c b/arch/arm/mach-omap2/cm.c index 2d83565d2be2..721c3b66740a 100644 --- a/arch/arm/mach-omap2/cm.c +++ b/arch/arm/mach-omap2/cm.c | |||
@@ -50,15 +50,15 @@ int omap2_cm_wait_module_ready(s16 prcm_mod, u8 idlest_id, u8 idlest_shift) | |||
50 | 50 | ||
51 | cm_idlest_reg = cm_idlest_offs[idlest_id - 1]; | 51 | cm_idlest_reg = cm_idlest_offs[idlest_id - 1]; |
52 | 52 | ||
53 | mask = 1 << idlest_shift; | ||
54 | |||
53 | if (cpu_is_omap24xx()) | 55 | if (cpu_is_omap24xx()) |
54 | ena = idlest_shift; | 56 | ena = mask; |
55 | else if (cpu_is_omap34xx()) | 57 | else if (cpu_is_omap34xx()) |
56 | ena = 0; | 58 | ena = 0; |
57 | else | 59 | else |
58 | BUG(); | 60 | BUG(); |
59 | 61 | ||
60 | mask = 1 << idlest_shift; | ||
61 | |||
62 | /* XXX should be OMAP2 CM */ | 62 | /* XXX should be OMAP2 CM */ |
63 | omap_test_timeout(((cm_read_mod_reg(prcm_mod, cm_idlest_reg) & mask) == ena), | 63 | omap_test_timeout(((cm_read_mod_reg(prcm_mod, cm_idlest_reg) & mask) == ena), |
64 | MAX_MODULE_READY_TIME, i); | 64 | MAX_MODULE_READY_TIME, i); |
diff --git a/arch/arm/mach-omap2/io.c b/arch/arm/mach-omap2/io.c index b12d715dee5b..210de9d292fb 100644 --- a/arch/arm/mach-omap2/io.c +++ b/arch/arm/mach-omap2/io.c | |||
@@ -44,6 +44,7 @@ | |||
44 | 44 | ||
45 | #include <plat/clockdomain.h> | 45 | #include <plat/clockdomain.h> |
46 | #include "clockdomains.h" | 46 | #include "clockdomains.h" |
47 | |||
47 | #include <plat/omap_hwmod.h> | 48 | #include <plat/omap_hwmod.h> |
48 | 49 | ||
49 | /* | 50 | /* |
@@ -315,6 +316,8 @@ static int __init _omap2_init_reprogram_sdrc(void) | |||
315 | void __init omap2_init_common_hw(struct omap_sdrc_params *sdrc_cs0, | 316 | void __init omap2_init_common_hw(struct omap_sdrc_params *sdrc_cs0, |
316 | struct omap_sdrc_params *sdrc_cs1) | 317 | struct omap_sdrc_params *sdrc_cs1) |
317 | { | 318 | { |
319 | u8 skip_setup_idle = 0; | ||
320 | |||
318 | pwrdm_init(powerdomains_omap); | 321 | pwrdm_init(powerdomains_omap); |
319 | clkdm_init(clockdomains_omap, clkdm_autodeps); | 322 | clkdm_init(clockdomains_omap, clkdm_autodeps); |
320 | if (cpu_is_omap242x()) | 323 | if (cpu_is_omap242x()) |
@@ -338,9 +341,13 @@ void __init omap2_init_common_hw(struct omap_sdrc_params *sdrc_cs0, | |||
338 | pr_err("Could not init clock framework - unknown CPU\n"); | 341 | pr_err("Could not init clock framework - unknown CPU\n"); |
339 | 342 | ||
340 | omap_serial_early_init(); | 343 | omap_serial_early_init(); |
344 | |||
345 | #ifndef CONFIG_PM_RUNTIME | ||
346 | skip_setup_idle = 1; | ||
347 | #endif | ||
341 | if (cpu_is_omap24xx() || cpu_is_omap34xx()) /* FIXME: OMAP4 */ | 348 | if (cpu_is_omap24xx() || cpu_is_omap34xx()) /* FIXME: OMAP4 */ |
342 | omap_hwmod_late_init(); | 349 | omap_hwmod_late_init(skip_setup_idle); |
343 | omap_pm_if_init(); | 350 | |
344 | if (cpu_is_omap24xx() || cpu_is_omap34xx()) { | 351 | if (cpu_is_omap24xx() || cpu_is_omap34xx()) { |
345 | omap2_sdrc_init(sdrc_cs0, sdrc_cs1); | 352 | omap2_sdrc_init(sdrc_cs0, sdrc_cs1); |
346 | _omap2_init_reprogram_sdrc(); | 353 | _omap2_init_reprogram_sdrc(); |
diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c index b7a4133267d8..cb911d7d1a3c 100644 --- a/arch/arm/mach-omap2/omap_hwmod.c +++ b/arch/arm/mach-omap2/omap_hwmod.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * omap_hwmod implementation for OMAP2/3/4 | 2 | * omap_hwmod implementation for OMAP2/3/4 |
3 | * | 3 | * |
4 | * Copyright (C) 2009 Nokia Corporation | 4 | * Copyright (C) 2009-2010 Nokia Corporation |
5 | * | 5 | * |
6 | * Paul Walmsley, Benoît Cousson, Kevin Hilman | 6 | * Paul Walmsley, Benoît Cousson, Kevin Hilman |
7 | * | 7 | * |
@@ -423,7 +423,7 @@ static int _init_main_clk(struct omap_hwmod *oh) | |||
423 | } | 423 | } |
424 | 424 | ||
425 | /** | 425 | /** |
426 | * _init_interface_clk - get a struct clk * for the the hwmod's interface clks | 426 | * _init_interface_clks - get a struct clk * for the the hwmod's interface clks |
427 | * @oh: struct omap_hwmod * | 427 | * @oh: struct omap_hwmod * |
428 | * | 428 | * |
429 | * Called from _init_clocks(). Populates the @oh OCP slave interface | 429 | * Called from _init_clocks(). Populates the @oh OCP slave interface |
@@ -764,6 +764,7 @@ static struct omap_hwmod *_lookup(const char *name) | |||
764 | /** | 764 | /** |
765 | * _init_clocks - clk_get() all clocks associated with this hwmod | 765 | * _init_clocks - clk_get() all clocks associated with this hwmod |
766 | * @oh: struct omap_hwmod * | 766 | * @oh: struct omap_hwmod * |
767 | * @data: not used; pass NULL | ||
767 | * | 768 | * |
768 | * Called by omap_hwmod_late_init() (after omap2_clk_init()). | 769 | * Called by omap_hwmod_late_init() (after omap2_clk_init()). |
769 | * Resolves all clock names embedded in the hwmod. Must be called | 770 | * Resolves all clock names embedded in the hwmod. Must be called |
@@ -771,7 +772,7 @@ static struct omap_hwmod *_lookup(const char *name) | |||
771 | * has not yet been registered or if the clocks have already been | 772 | * has not yet been registered or if the clocks have already been |
772 | * initialized, 0 on success, or a non-zero error on failure. | 773 | * initialized, 0 on success, or a non-zero error on failure. |
773 | */ | 774 | */ |
774 | static int _init_clocks(struct omap_hwmod *oh) | 775 | static int _init_clocks(struct omap_hwmod *oh, void *data) |
775 | { | 776 | { |
776 | int ret = 0; | 777 | int ret = 0; |
777 | 778 | ||
@@ -886,7 +887,7 @@ static int _reset(struct omap_hwmod *oh) | |||
886 | } | 887 | } |
887 | 888 | ||
888 | /** | 889 | /** |
889 | * _enable - enable an omap_hwmod | 890 | * _omap_hwmod_enable - enable an omap_hwmod |
890 | * @oh: struct omap_hwmod * | 891 | * @oh: struct omap_hwmod * |
891 | * | 892 | * |
892 | * Enables an omap_hwmod @oh such that the MPU can access the hwmod's | 893 | * Enables an omap_hwmod @oh such that the MPU can access the hwmod's |
@@ -894,7 +895,7 @@ static int _reset(struct omap_hwmod *oh) | |||
894 | * Returns -EINVAL if the hwmod is in the wrong state or passes along | 895 | * Returns -EINVAL if the hwmod is in the wrong state or passes along |
895 | * the return value of _wait_target_ready(). | 896 | * the return value of _wait_target_ready(). |
896 | */ | 897 | */ |
897 | static int _enable(struct omap_hwmod *oh) | 898 | int _omap_hwmod_enable(struct omap_hwmod *oh) |
898 | { | 899 | { |
899 | int r; | 900 | int r; |
900 | 901 | ||
@@ -939,7 +940,7 @@ static int _enable(struct omap_hwmod *oh) | |||
939 | * no further work. Returns -EINVAL if the hwmod is in the wrong | 940 | * no further work. Returns -EINVAL if the hwmod is in the wrong |
940 | * state or returns 0. | 941 | * state or returns 0. |
941 | */ | 942 | */ |
942 | static int _idle(struct omap_hwmod *oh) | 943 | int _omap_hwmod_idle(struct omap_hwmod *oh) |
943 | { | 944 | { |
944 | if (oh->_state != _HWMOD_STATE_ENABLED) { | 945 | if (oh->_state != _HWMOD_STATE_ENABLED) { |
945 | WARN(1, "omap_hwmod: %s: idle state can only be entered from " | 946 | WARN(1, "omap_hwmod: %s: idle state can only be entered from " |
@@ -996,19 +997,25 @@ static int _shutdown(struct omap_hwmod *oh) | |||
996 | /** | 997 | /** |
997 | * _setup - do initial configuration of omap_hwmod | 998 | * _setup - do initial configuration of omap_hwmod |
998 | * @oh: struct omap_hwmod * | 999 | * @oh: struct omap_hwmod * |
1000 | * @skip_setup_idle_p: do not idle hwmods at the end of the fn if 1 | ||
999 | * | 1001 | * |
1000 | * Writes the CLOCKACTIVITY bits @clockact to the hwmod @oh | 1002 | * Writes the CLOCKACTIVITY bits @clockact to the hwmod @oh |
1001 | * OCP_SYSCONFIG register. Must be called with omap_hwmod_mutex | 1003 | * OCP_SYSCONFIG register. Must be called with omap_hwmod_mutex held. |
1002 | * held. Returns -EINVAL if the hwmod is in the wrong state or returns | 1004 | * @skip_setup_idle is intended to be used on a system that will not |
1003 | * 0. | 1005 | * call omap_hwmod_enable() to enable devices (e.g., a system without |
1006 | * PM runtime). Returns -EINVAL if the hwmod is in the wrong state or | ||
1007 | * returns 0. | ||
1004 | */ | 1008 | */ |
1005 | static int _setup(struct omap_hwmod *oh) | 1009 | static int _setup(struct omap_hwmod *oh, void *data) |
1006 | { | 1010 | { |
1007 | int i, r; | 1011 | int i, r; |
1012 | u8 skip_setup_idle; | ||
1008 | 1013 | ||
1009 | if (!oh) | 1014 | if (!oh || !data) |
1010 | return -EINVAL; | 1015 | return -EINVAL; |
1011 | 1016 | ||
1017 | skip_setup_idle = *(u8 *)data; | ||
1018 | |||
1012 | /* Set iclk autoidle mode */ | 1019 | /* Set iclk autoidle mode */ |
1013 | if (oh->slaves_cnt > 0) { | 1020 | if (oh->slaves_cnt > 0) { |
1014 | for (i = 0; i < oh->slaves_cnt; i++) { | 1021 | for (i = 0; i < oh->slaves_cnt; i++) { |
@@ -1029,7 +1036,7 @@ static int _setup(struct omap_hwmod *oh) | |||
1029 | 1036 | ||
1030 | oh->_state = _HWMOD_STATE_INITIALIZED; | 1037 | oh->_state = _HWMOD_STATE_INITIALIZED; |
1031 | 1038 | ||
1032 | r = _enable(oh); | 1039 | r = _omap_hwmod_enable(oh); |
1033 | if (r) { | 1040 | if (r) { |
1034 | pr_warning("omap_hwmod: %s: cannot be enabled (%d)\n", | 1041 | pr_warning("omap_hwmod: %s: cannot be enabled (%d)\n", |
1035 | oh->name, oh->_state); | 1042 | oh->name, oh->_state); |
@@ -1041,7 +1048,7 @@ static int _setup(struct omap_hwmod *oh) | |||
1041 | * XXX Do the OCP_SYSCONFIG bits need to be | 1048 | * XXX Do the OCP_SYSCONFIG bits need to be |
1042 | * reprogrammed after a reset? If not, then this can | 1049 | * reprogrammed after a reset? If not, then this can |
1043 | * be removed. If they do, then probably the | 1050 | * be removed. If they do, then probably the |
1044 | * _enable() function should be split to avoid the | 1051 | * _omap_hwmod_enable() function should be split to avoid the |
1045 | * rewrite of the OCP_SYSCONFIG register. | 1052 | * rewrite of the OCP_SYSCONFIG register. |
1046 | */ | 1053 | */ |
1047 | if (oh->class->sysc) { | 1054 | if (oh->class->sysc) { |
@@ -1050,8 +1057,8 @@ static int _setup(struct omap_hwmod *oh) | |||
1050 | } | 1057 | } |
1051 | } | 1058 | } |
1052 | 1059 | ||
1053 | if (!(oh->flags & HWMOD_INIT_NO_IDLE)) | 1060 | if (!(oh->flags & HWMOD_INIT_NO_IDLE) && !skip_setup_idle) |
1054 | _idle(oh); | 1061 | _omap_hwmod_idle(oh); |
1055 | 1062 | ||
1056 | return 0; | 1063 | return 0; |
1057 | } | 1064 | } |
@@ -1062,14 +1069,29 @@ static int _setup(struct omap_hwmod *oh) | |||
1062 | 1069 | ||
1063 | u32 omap_hwmod_readl(struct omap_hwmod *oh, u16 reg_offs) | 1070 | u32 omap_hwmod_readl(struct omap_hwmod *oh, u16 reg_offs) |
1064 | { | 1071 | { |
1065 | return __raw_readl(oh->_rt_va + reg_offs); | 1072 | return __raw_readl(oh->_mpu_rt_va + reg_offs); |
1066 | } | 1073 | } |
1067 | 1074 | ||
1068 | void omap_hwmod_writel(u32 v, struct omap_hwmod *oh, u16 reg_offs) | 1075 | void omap_hwmod_writel(u32 v, struct omap_hwmod *oh, u16 reg_offs) |
1069 | { | 1076 | { |
1070 | __raw_writel(v, oh->_rt_va + reg_offs); | 1077 | __raw_writel(v, oh->_mpu_rt_va + reg_offs); |
1071 | } | 1078 | } |
1072 | 1079 | ||
1080 | /** | ||
1081 | * omap_hwmod_set_slave_idlemode - set the hwmod's OCP slave idlemode | ||
1082 | * @oh: struct omap_hwmod * | ||
1083 | * @idlemode: SIDLEMODE field bits (shifted to bit 0) | ||
1084 | * | ||
1085 | * Sets the IP block's OCP slave idlemode in hardware, and updates our | ||
1086 | * local copy. Intended to be used by drivers that have some erratum | ||
1087 | * that requires direct manipulation of the SIDLEMODE bits. Returns | ||
1088 | * -EINVAL if @oh is null, or passes along the return value from | ||
1089 | * _set_slave_idlemode(). | ||
1090 | * | ||
1091 | * XXX Does this function have any current users? If not, we should | ||
1092 | * remove it; it is better to let the rest of the hwmod code handle this. | ||
1093 | * Any users of this function should be scrutinized carefully. | ||
1094 | */ | ||
1073 | int omap_hwmod_set_slave_idlemode(struct omap_hwmod *oh, u8 idlemode) | 1095 | int omap_hwmod_set_slave_idlemode(struct omap_hwmod *oh, u8 idlemode) |
1074 | { | 1096 | { |
1075 | u32 v; | 1097 | u32 v; |
@@ -1124,7 +1146,7 @@ int omap_hwmod_register(struct omap_hwmod *oh) | |||
1124 | ms_id = _find_mpu_port_index(oh); | 1146 | ms_id = _find_mpu_port_index(oh); |
1125 | if (!IS_ERR_VALUE(ms_id)) { | 1147 | if (!IS_ERR_VALUE(ms_id)) { |
1126 | oh->_mpu_port_index = ms_id; | 1148 | oh->_mpu_port_index = ms_id; |
1127 | oh->_rt_va = _find_mpu_rt_base(oh, oh->_mpu_port_index); | 1149 | oh->_mpu_rt_va = _find_mpu_rt_base(oh, oh->_mpu_port_index); |
1128 | } else { | 1150 | } else { |
1129 | oh->_int_flags |= _HWMOD_NO_MPU_PORT; | 1151 | oh->_int_flags |= _HWMOD_NO_MPU_PORT; |
1130 | } | 1152 | } |
@@ -1164,6 +1186,7 @@ struct omap_hwmod *omap_hwmod_lookup(const char *name) | |||
1164 | /** | 1186 | /** |
1165 | * omap_hwmod_for_each - call function for each registered omap_hwmod | 1187 | * omap_hwmod_for_each - call function for each registered omap_hwmod |
1166 | * @fn: pointer to a callback function | 1188 | * @fn: pointer to a callback function |
1189 | * @data: void * data to pass to callback function | ||
1167 | * | 1190 | * |
1168 | * Call @fn for each registered omap_hwmod, passing @data to each | 1191 | * Call @fn for each registered omap_hwmod, passing @data to each |
1169 | * function. @fn must return 0 for success or any other value for | 1192 | * function. @fn must return 0 for success or any other value for |
@@ -1172,7 +1195,8 @@ struct omap_hwmod *omap_hwmod_lookup(const char *name) | |||
1172 | * caller of omap_hwmod_for_each(). @fn is called with | 1195 | * caller of omap_hwmod_for_each(). @fn is called with |
1173 | * omap_hwmod_for_each() held. | 1196 | * omap_hwmod_for_each() held. |
1174 | */ | 1197 | */ |
1175 | int omap_hwmod_for_each(int (*fn)(struct omap_hwmod *oh)) | 1198 | int omap_hwmod_for_each(int (*fn)(struct omap_hwmod *oh, void *data), |
1199 | void *data) | ||
1176 | { | 1200 | { |
1177 | struct omap_hwmod *temp_oh; | 1201 | struct omap_hwmod *temp_oh; |
1178 | int ret; | 1202 | int ret; |
@@ -1182,7 +1206,7 @@ int omap_hwmod_for_each(int (*fn)(struct omap_hwmod *oh)) | |||
1182 | 1206 | ||
1183 | mutex_lock(&omap_hwmod_mutex); | 1207 | mutex_lock(&omap_hwmod_mutex); |
1184 | list_for_each_entry(temp_oh, &omap_hwmod_list, node) { | 1208 | list_for_each_entry(temp_oh, &omap_hwmod_list, node) { |
1185 | ret = (*fn)(temp_oh); | 1209 | ret = (*fn)(temp_oh, data); |
1186 | if (ret) | 1210 | if (ret) |
1187 | break; | 1211 | break; |
1188 | } | 1212 | } |
@@ -1229,24 +1253,28 @@ int omap_hwmod_init(struct omap_hwmod **ohs) | |||
1229 | 1253 | ||
1230 | /** | 1254 | /** |
1231 | * omap_hwmod_late_init - do some post-clock framework initialization | 1255 | * omap_hwmod_late_init - do some post-clock framework initialization |
1256 | * @skip_setup_idle: if 1, do not idle hwmods in _setup() | ||
1232 | * | 1257 | * |
1233 | * Must be called after omap2_clk_init(). Resolves the struct clk names | 1258 | * Must be called after omap2_clk_init(). Resolves the struct clk names |
1234 | * to struct clk pointers for each registered omap_hwmod. Also calls | 1259 | * to struct clk pointers for each registered omap_hwmod. Also calls |
1235 | * _setup() on each hwmod. Returns 0. | 1260 | * _setup() on each hwmod. Returns 0. |
1236 | */ | 1261 | */ |
1237 | int omap_hwmod_late_init(void) | 1262 | int omap_hwmod_late_init(u8 skip_setup_idle) |
1238 | { | 1263 | { |
1239 | int r; | 1264 | int r; |
1240 | 1265 | ||
1241 | /* XXX check return value */ | 1266 | /* XXX check return value */ |
1242 | r = omap_hwmod_for_each(_init_clocks); | 1267 | r = omap_hwmod_for_each(_init_clocks, NULL); |
1243 | WARN(r, "omap_hwmod: omap_hwmod_late_init(): _init_clocks failed\n"); | 1268 | WARN(r, "omap_hwmod: omap_hwmod_late_init(): _init_clocks failed\n"); |
1244 | 1269 | ||
1245 | mpu_oh = omap_hwmod_lookup(MPU_INITIATOR_NAME); | 1270 | mpu_oh = omap_hwmod_lookup(MPU_INITIATOR_NAME); |
1246 | WARN(!mpu_oh, "omap_hwmod: could not find MPU initiator hwmod %s\n", | 1271 | WARN(!mpu_oh, "omap_hwmod: could not find MPU initiator hwmod %s\n", |
1247 | MPU_INITIATOR_NAME); | 1272 | MPU_INITIATOR_NAME); |
1248 | 1273 | ||
1249 | omap_hwmod_for_each(_setup); | 1274 | if (skip_setup_idle) |
1275 | pr_debug("omap_hwmod: will leave hwmods enabled during setup\n"); | ||
1276 | |||
1277 | omap_hwmod_for_each(_setup, &skip_setup_idle); | ||
1250 | 1278 | ||
1251 | return 0; | 1279 | return 0; |
1252 | } | 1280 | } |
@@ -1270,7 +1298,7 @@ int omap_hwmod_unregister(struct omap_hwmod *oh) | |||
1270 | pr_debug("omap_hwmod: %s: unregistering\n", oh->name); | 1298 | pr_debug("omap_hwmod: %s: unregistering\n", oh->name); |
1271 | 1299 | ||
1272 | mutex_lock(&omap_hwmod_mutex); | 1300 | mutex_lock(&omap_hwmod_mutex); |
1273 | iounmap(oh->_rt_va); | 1301 | iounmap(oh->_mpu_rt_va); |
1274 | list_del(&oh->node); | 1302 | list_del(&oh->node); |
1275 | mutex_unlock(&omap_hwmod_mutex); | 1303 | mutex_unlock(&omap_hwmod_mutex); |
1276 | 1304 | ||
@@ -1292,12 +1320,13 @@ int omap_hwmod_enable(struct omap_hwmod *oh) | |||
1292 | return -EINVAL; | 1320 | return -EINVAL; |
1293 | 1321 | ||
1294 | mutex_lock(&omap_hwmod_mutex); | 1322 | mutex_lock(&omap_hwmod_mutex); |
1295 | r = _enable(oh); | 1323 | r = _omap_hwmod_enable(oh); |
1296 | mutex_unlock(&omap_hwmod_mutex); | 1324 | mutex_unlock(&omap_hwmod_mutex); |
1297 | 1325 | ||
1298 | return r; | 1326 | return r; |
1299 | } | 1327 | } |
1300 | 1328 | ||
1329 | |||
1301 | /** | 1330 | /** |
1302 | * omap_hwmod_idle - idle an omap_hwmod | 1331 | * omap_hwmod_idle - idle an omap_hwmod |
1303 | * @oh: struct omap_hwmod * | 1332 | * @oh: struct omap_hwmod * |
@@ -1311,7 +1340,7 @@ int omap_hwmod_idle(struct omap_hwmod *oh) | |||
1311 | return -EINVAL; | 1340 | return -EINVAL; |
1312 | 1341 | ||
1313 | mutex_lock(&omap_hwmod_mutex); | 1342 | mutex_lock(&omap_hwmod_mutex); |
1314 | _idle(oh); | 1343 | _omap_hwmod_idle(oh); |
1315 | mutex_unlock(&omap_hwmod_mutex); | 1344 | mutex_unlock(&omap_hwmod_mutex); |
1316 | 1345 | ||
1317 | return 0; | 1346 | return 0; |
@@ -1413,7 +1442,7 @@ int omap_hwmod_reset(struct omap_hwmod *oh) | |||
1413 | mutex_lock(&omap_hwmod_mutex); | 1442 | mutex_lock(&omap_hwmod_mutex); |
1414 | r = _reset(oh); | 1443 | r = _reset(oh); |
1415 | if (!r) | 1444 | if (!r) |
1416 | r = _enable(oh); | 1445 | r = _omap_hwmod_enable(oh); |
1417 | mutex_unlock(&omap_hwmod_mutex); | 1446 | mutex_unlock(&omap_hwmod_mutex); |
1418 | 1447 | ||
1419 | return r; | 1448 | return r; |
@@ -1530,6 +1559,29 @@ struct powerdomain *omap_hwmod_get_pwrdm(struct omap_hwmod *oh) | |||
1530 | } | 1559 | } |
1531 | 1560 | ||
1532 | /** | 1561 | /** |
1562 | * omap_hwmod_get_mpu_rt_va - return the module's base address (for the MPU) | ||
1563 | * @oh: struct omap_hwmod * | ||
1564 | * | ||
1565 | * Returns the virtual address corresponding to the beginning of the | ||
1566 | * module's register target, in the address range that is intended to | ||
1567 | * be used by the MPU. Returns the virtual address upon success or NULL | ||
1568 | * upon error. | ||
1569 | */ | ||
1570 | void __iomem *omap_hwmod_get_mpu_rt_va(struct omap_hwmod *oh) | ||
1571 | { | ||
1572 | if (!oh) | ||
1573 | return NULL; | ||
1574 | |||
1575 | if (oh->_int_flags & _HWMOD_NO_MPU_PORT) | ||
1576 | return NULL; | ||
1577 | |||
1578 | if (oh->_state == _HWMOD_STATE_UNKNOWN) | ||
1579 | return NULL; | ||
1580 | |||
1581 | return oh->_mpu_rt_va; | ||
1582 | } | ||
1583 | |||
1584 | /** | ||
1533 | * omap_hwmod_add_initiator_dep - add sleepdep from @init_oh to @oh | 1585 | * omap_hwmod_add_initiator_dep - add sleepdep from @init_oh to @oh |
1534 | * @oh: struct omap_hwmod * | 1586 | * @oh: struct omap_hwmod * |
1535 | * @init_oh: struct omap_hwmod * (initiator) | 1587 | * @init_oh: struct omap_hwmod * (initiator) |
diff --git a/arch/arm/mach-omap2/omap_hwmod_2420_data.c b/arch/arm/mach-omap2/omap_hwmod_2420_data.c index e5530c51f77d..3cc768e8bc04 100644 --- a/arch/arm/mach-omap2/omap_hwmod_2420_data.c +++ b/arch/arm/mach-omap2/omap_hwmod_2420_data.c | |||
@@ -30,42 +30,44 @@ | |||
30 | */ | 30 | */ |
31 | 31 | ||
32 | static struct omap_hwmod omap2420_mpu_hwmod; | 32 | static struct omap_hwmod omap2420_mpu_hwmod; |
33 | static struct omap_hwmod omap2420_l3_hwmod; | 33 | static struct omap_hwmod omap2420_iva_hwmod; |
34 | static struct omap_hwmod omap2420_l3_main_hwmod; | ||
34 | static struct omap_hwmod omap2420_l4_core_hwmod; | 35 | static struct omap_hwmod omap2420_l4_core_hwmod; |
35 | 36 | ||
36 | /* L3 -> L4_CORE interface */ | 37 | /* L3 -> L4_CORE interface */ |
37 | static struct omap_hwmod_ocp_if omap2420_l3__l4_core = { | 38 | static struct omap_hwmod_ocp_if omap2420_l3_main__l4_core = { |
38 | .master = &omap2420_l3_hwmod, | 39 | .master = &omap2420_l3_main_hwmod, |
39 | .slave = &omap2420_l4_core_hwmod, | 40 | .slave = &omap2420_l4_core_hwmod, |
40 | .user = OCP_USER_MPU | OCP_USER_SDMA, | 41 | .user = OCP_USER_MPU | OCP_USER_SDMA, |
41 | }; | 42 | }; |
42 | 43 | ||
43 | /* MPU -> L3 interface */ | 44 | /* MPU -> L3 interface */ |
44 | static struct omap_hwmod_ocp_if omap2420_mpu__l3 = { | 45 | static struct omap_hwmod_ocp_if omap2420_mpu__l3_main = { |
45 | .master = &omap2420_mpu_hwmod, | 46 | .master = &omap2420_mpu_hwmod, |
46 | .slave = &omap2420_l3_hwmod, | 47 | .slave = &omap2420_l3_main_hwmod, |
47 | .user = OCP_USER_MPU, | 48 | .user = OCP_USER_MPU, |
48 | }; | 49 | }; |
49 | 50 | ||
50 | /* Slave interfaces on the L3 interconnect */ | 51 | /* Slave interfaces on the L3 interconnect */ |
51 | static struct omap_hwmod_ocp_if *omap2420_l3_slaves[] = { | 52 | static struct omap_hwmod_ocp_if *omap2420_l3_main_slaves[] = { |
52 | &omap2420_mpu__l3, | 53 | &omap2420_mpu__l3_main, |
53 | }; | 54 | }; |
54 | 55 | ||
55 | /* Master interfaces on the L3 interconnect */ | 56 | /* Master interfaces on the L3 interconnect */ |
56 | static struct omap_hwmod_ocp_if *omap2420_l3_masters[] = { | 57 | static struct omap_hwmod_ocp_if *omap2420_l3_main_masters[] = { |
57 | &omap2420_l3__l4_core, | 58 | &omap2420_l3_main__l4_core, |
58 | }; | 59 | }; |
59 | 60 | ||
60 | /* L3 */ | 61 | /* L3 */ |
61 | static struct omap_hwmod omap2420_l3_hwmod = { | 62 | static struct omap_hwmod omap2420_l3_main_hwmod = { |
62 | .name = "l3_hwmod", | 63 | .name = "l3_main", |
63 | .class = &l3_hwmod_class, | 64 | .class = &l3_hwmod_class, |
64 | .masters = omap2420_l3_masters, | 65 | .masters = omap2420_l3_main_masters, |
65 | .masters_cnt = ARRAY_SIZE(omap2420_l3_masters), | 66 | .masters_cnt = ARRAY_SIZE(omap2420_l3_main_masters), |
66 | .slaves = omap2420_l3_slaves, | 67 | .slaves = omap2420_l3_main_slaves, |
67 | .slaves_cnt = ARRAY_SIZE(omap2420_l3_slaves), | 68 | .slaves_cnt = ARRAY_SIZE(omap2420_l3_main_slaves), |
68 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420) | 69 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420), |
70 | .flags = HWMOD_NO_IDLEST, | ||
69 | }; | 71 | }; |
70 | 72 | ||
71 | static struct omap_hwmod omap2420_l4_wkup_hwmod; | 73 | static struct omap_hwmod omap2420_l4_wkup_hwmod; |
@@ -79,7 +81,7 @@ static struct omap_hwmod_ocp_if omap2420_l4_core__l4_wkup = { | |||
79 | 81 | ||
80 | /* Slave interfaces on the L4_CORE interconnect */ | 82 | /* Slave interfaces on the L4_CORE interconnect */ |
81 | static struct omap_hwmod_ocp_if *omap2420_l4_core_slaves[] = { | 83 | static struct omap_hwmod_ocp_if *omap2420_l4_core_slaves[] = { |
82 | &omap2420_l3__l4_core, | 84 | &omap2420_l3_main__l4_core, |
83 | }; | 85 | }; |
84 | 86 | ||
85 | /* Master interfaces on the L4_CORE interconnect */ | 87 | /* Master interfaces on the L4_CORE interconnect */ |
@@ -89,13 +91,14 @@ static struct omap_hwmod_ocp_if *omap2420_l4_core_masters[] = { | |||
89 | 91 | ||
90 | /* L4 CORE */ | 92 | /* L4 CORE */ |
91 | static struct omap_hwmod omap2420_l4_core_hwmod = { | 93 | static struct omap_hwmod omap2420_l4_core_hwmod = { |
92 | .name = "l4_core_hwmod", | 94 | .name = "l4_core", |
93 | .class = &l4_hwmod_class, | 95 | .class = &l4_hwmod_class, |
94 | .masters = omap2420_l4_core_masters, | 96 | .masters = omap2420_l4_core_masters, |
95 | .masters_cnt = ARRAY_SIZE(omap2420_l4_core_masters), | 97 | .masters_cnt = ARRAY_SIZE(omap2420_l4_core_masters), |
96 | .slaves = omap2420_l4_core_slaves, | 98 | .slaves = omap2420_l4_core_slaves, |
97 | .slaves_cnt = ARRAY_SIZE(omap2420_l4_core_slaves), | 99 | .slaves_cnt = ARRAY_SIZE(omap2420_l4_core_slaves), |
98 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420) | 100 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420), |
101 | .flags = HWMOD_NO_IDLEST, | ||
99 | }; | 102 | }; |
100 | 103 | ||
101 | /* Slave interfaces on the L4_WKUP interconnect */ | 104 | /* Slave interfaces on the L4_WKUP interconnect */ |
@@ -109,18 +112,19 @@ static struct omap_hwmod_ocp_if *omap2420_l4_wkup_masters[] = { | |||
109 | 112 | ||
110 | /* L4 WKUP */ | 113 | /* L4 WKUP */ |
111 | static struct omap_hwmod omap2420_l4_wkup_hwmod = { | 114 | static struct omap_hwmod omap2420_l4_wkup_hwmod = { |
112 | .name = "l4_wkup_hwmod", | 115 | .name = "l4_wkup", |
113 | .class = &l4_hwmod_class, | 116 | .class = &l4_hwmod_class, |
114 | .masters = omap2420_l4_wkup_masters, | 117 | .masters = omap2420_l4_wkup_masters, |
115 | .masters_cnt = ARRAY_SIZE(omap2420_l4_wkup_masters), | 118 | .masters_cnt = ARRAY_SIZE(omap2420_l4_wkup_masters), |
116 | .slaves = omap2420_l4_wkup_slaves, | 119 | .slaves = omap2420_l4_wkup_slaves, |
117 | .slaves_cnt = ARRAY_SIZE(omap2420_l4_wkup_slaves), | 120 | .slaves_cnt = ARRAY_SIZE(omap2420_l4_wkup_slaves), |
118 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420) | 121 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420), |
122 | .flags = HWMOD_NO_IDLEST, | ||
119 | }; | 123 | }; |
120 | 124 | ||
121 | /* Master interfaces on the MPU device */ | 125 | /* Master interfaces on the MPU device */ |
122 | static struct omap_hwmod_ocp_if *omap2420_mpu_masters[] = { | 126 | static struct omap_hwmod_ocp_if *omap2420_mpu_masters[] = { |
123 | &omap2420_mpu__l3, | 127 | &omap2420_mpu__l3_main, |
124 | }; | 128 | }; |
125 | 129 | ||
126 | /* MPU */ | 130 | /* MPU */ |
@@ -133,11 +137,40 @@ static struct omap_hwmod omap2420_mpu_hwmod = { | |||
133 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420), | 137 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420), |
134 | }; | 138 | }; |
135 | 139 | ||
140 | /* | ||
141 | * IVA1 interface data | ||
142 | */ | ||
143 | |||
144 | /* IVA <- L3 interface */ | ||
145 | static struct omap_hwmod_ocp_if omap2420_l3__iva = { | ||
146 | .master = &omap2420_l3_main_hwmod, | ||
147 | .slave = &omap2420_iva_hwmod, | ||
148 | .clk = "iva1_ifck", | ||
149 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
150 | }; | ||
151 | |||
152 | static struct omap_hwmod_ocp_if *omap2420_iva_masters[] = { | ||
153 | &omap2420_l3__iva, | ||
154 | }; | ||
155 | |||
156 | /* | ||
157 | * IVA2 (IVA2) | ||
158 | */ | ||
159 | |||
160 | static struct omap_hwmod omap2420_iva_hwmod = { | ||
161 | .name = "iva", | ||
162 | .class = &iva_hwmod_class, | ||
163 | .masters = omap2420_iva_masters, | ||
164 | .masters_cnt = ARRAY_SIZE(omap2420_iva_masters), | ||
165 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420) | ||
166 | }; | ||
167 | |||
136 | static __initdata struct omap_hwmod *omap2420_hwmods[] = { | 168 | static __initdata struct omap_hwmod *omap2420_hwmods[] = { |
137 | &omap2420_l3_hwmod, | 169 | &omap2420_l3_main_hwmod, |
138 | &omap2420_l4_core_hwmod, | 170 | &omap2420_l4_core_hwmod, |
139 | &omap2420_l4_wkup_hwmod, | 171 | &omap2420_l4_wkup_hwmod, |
140 | &omap2420_mpu_hwmod, | 172 | &omap2420_mpu_hwmod, |
173 | &omap2420_iva_hwmod, | ||
141 | NULL, | 174 | NULL, |
142 | }; | 175 | }; |
143 | 176 | ||
diff --git a/arch/arm/mach-omap2/omap_hwmod_2430_data.c b/arch/arm/mach-omap2/omap_hwmod_2430_data.c index 0852d954da40..4526628ed287 100644 --- a/arch/arm/mach-omap2/omap_hwmod_2430_data.c +++ b/arch/arm/mach-omap2/omap_hwmod_2430_data.c | |||
@@ -30,47 +30,47 @@ | |||
30 | */ | 30 | */ |
31 | 31 | ||
32 | static struct omap_hwmod omap2430_mpu_hwmod; | 32 | static struct omap_hwmod omap2430_mpu_hwmod; |
33 | static struct omap_hwmod omap2430_l3_hwmod; | 33 | static struct omap_hwmod omap2430_iva_hwmod; |
34 | static struct omap_hwmod omap2430_l3_main_hwmod; | ||
34 | static struct omap_hwmod omap2430_l4_core_hwmod; | 35 | static struct omap_hwmod omap2430_l4_core_hwmod; |
35 | 36 | ||
36 | /* L3 -> L4_CORE interface */ | 37 | /* L3 -> L4_CORE interface */ |
37 | static struct omap_hwmod_ocp_if omap2430_l3__l4_core = { | 38 | static struct omap_hwmod_ocp_if omap2430_l3_main__l4_core = { |
38 | .master = &omap2430_l3_hwmod, | 39 | .master = &omap2430_l3_main_hwmod, |
39 | .slave = &omap2430_l4_core_hwmod, | 40 | .slave = &omap2430_l4_core_hwmod, |
40 | .user = OCP_USER_MPU | OCP_USER_SDMA, | 41 | .user = OCP_USER_MPU | OCP_USER_SDMA, |
41 | }; | 42 | }; |
42 | 43 | ||
43 | /* MPU -> L3 interface */ | 44 | /* MPU -> L3 interface */ |
44 | static struct omap_hwmod_ocp_if omap2430_mpu__l3 = { | 45 | static struct omap_hwmod_ocp_if omap2430_mpu__l3_main = { |
45 | .master = &omap2430_mpu_hwmod, | 46 | .master = &omap2430_mpu_hwmod, |
46 | .slave = &omap2430_l3_hwmod, | 47 | .slave = &omap2430_l3_main_hwmod, |
47 | .user = OCP_USER_MPU, | 48 | .user = OCP_USER_MPU, |
48 | }; | 49 | }; |
49 | 50 | ||
50 | /* Slave interfaces on the L3 interconnect */ | 51 | /* Slave interfaces on the L3 interconnect */ |
51 | static struct omap_hwmod_ocp_if *omap2430_l3_slaves[] = { | 52 | static struct omap_hwmod_ocp_if *omap2430_l3_main_slaves[] = { |
52 | &omap2430_mpu__l3, | 53 | &omap2430_mpu__l3_main, |
53 | }; | 54 | }; |
54 | 55 | ||
55 | /* Master interfaces on the L3 interconnect */ | 56 | /* Master interfaces on the L3 interconnect */ |
56 | static struct omap_hwmod_ocp_if *omap2430_l3_masters[] = { | 57 | static struct omap_hwmod_ocp_if *omap2430_l3_main_masters[] = { |
57 | &omap2430_l3__l4_core, | 58 | &omap2430_l3_main__l4_core, |
58 | }; | 59 | }; |
59 | 60 | ||
60 | /* L3 */ | 61 | /* L3 */ |
61 | static struct omap_hwmod omap2430_l3_hwmod = { | 62 | static struct omap_hwmod omap2430_l3_main_hwmod = { |
62 | .name = "l3_hwmod", | 63 | .name = "l3_main", |
63 | .class = &l3_hwmod_class, | 64 | .class = &l3_hwmod_class, |
64 | .masters = omap2430_l3_masters, | 65 | .masters = omap2430_l3_main_masters, |
65 | .masters_cnt = ARRAY_SIZE(omap2430_l3_masters), | 66 | .masters_cnt = ARRAY_SIZE(omap2430_l3_main_masters), |
66 | .slaves = omap2430_l3_slaves, | 67 | .slaves = omap2430_l3_main_slaves, |
67 | .slaves_cnt = ARRAY_SIZE(omap2430_l3_slaves), | 68 | .slaves_cnt = ARRAY_SIZE(omap2430_l3_main_slaves), |
68 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430) | 69 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430), |
70 | .flags = HWMOD_NO_IDLEST, | ||
69 | }; | 71 | }; |
70 | 72 | ||
71 | static struct omap_hwmod omap2430_l4_wkup_hwmod; | 73 | static struct omap_hwmod omap2430_l4_wkup_hwmod; |
72 | static struct omap_hwmod omap2430_mmc1_hwmod; | ||
73 | static struct omap_hwmod omap2430_mmc2_hwmod; | ||
74 | 74 | ||
75 | /* L4_CORE -> L4_WKUP interface */ | 75 | /* L4_CORE -> L4_WKUP interface */ |
76 | static struct omap_hwmod_ocp_if omap2430_l4_core__l4_wkup = { | 76 | static struct omap_hwmod_ocp_if omap2430_l4_core__l4_wkup = { |
@@ -81,7 +81,7 @@ static struct omap_hwmod_ocp_if omap2430_l4_core__l4_wkup = { | |||
81 | 81 | ||
82 | /* Slave interfaces on the L4_CORE interconnect */ | 82 | /* Slave interfaces on the L4_CORE interconnect */ |
83 | static struct omap_hwmod_ocp_if *omap2430_l4_core_slaves[] = { | 83 | static struct omap_hwmod_ocp_if *omap2430_l4_core_slaves[] = { |
84 | &omap2430_l3__l4_core, | 84 | &omap2430_l3_main__l4_core, |
85 | }; | 85 | }; |
86 | 86 | ||
87 | /* Master interfaces on the L4_CORE interconnect */ | 87 | /* Master interfaces on the L4_CORE interconnect */ |
@@ -91,13 +91,14 @@ static struct omap_hwmod_ocp_if *omap2430_l4_core_masters[] = { | |||
91 | 91 | ||
92 | /* L4 CORE */ | 92 | /* L4 CORE */ |
93 | static struct omap_hwmod omap2430_l4_core_hwmod = { | 93 | static struct omap_hwmod omap2430_l4_core_hwmod = { |
94 | .name = "l4_core_hwmod", | 94 | .name = "l4_core", |
95 | .class = &l4_hwmod_class, | 95 | .class = &l4_hwmod_class, |
96 | .masters = omap2430_l4_core_masters, | 96 | .masters = omap2430_l4_core_masters, |
97 | .masters_cnt = ARRAY_SIZE(omap2430_l4_core_masters), | 97 | .masters_cnt = ARRAY_SIZE(omap2430_l4_core_masters), |
98 | .slaves = omap2430_l4_core_slaves, | 98 | .slaves = omap2430_l4_core_slaves, |
99 | .slaves_cnt = ARRAY_SIZE(omap2430_l4_core_slaves), | 99 | .slaves_cnt = ARRAY_SIZE(omap2430_l4_core_slaves), |
100 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430) | 100 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430), |
101 | .flags = HWMOD_NO_IDLEST, | ||
101 | }; | 102 | }; |
102 | 103 | ||
103 | /* Slave interfaces on the L4_WKUP interconnect */ | 104 | /* Slave interfaces on the L4_WKUP interconnect */ |
@@ -111,18 +112,19 @@ static struct omap_hwmod_ocp_if *omap2430_l4_wkup_masters[] = { | |||
111 | 112 | ||
112 | /* L4 WKUP */ | 113 | /* L4 WKUP */ |
113 | static struct omap_hwmod omap2430_l4_wkup_hwmod = { | 114 | static struct omap_hwmod omap2430_l4_wkup_hwmod = { |
114 | .name = "l4_wkup_hwmod", | 115 | .name = "l4_wkup", |
115 | .class = &l4_hwmod_class, | 116 | .class = &l4_hwmod_class, |
116 | .masters = omap2430_l4_wkup_masters, | 117 | .masters = omap2430_l4_wkup_masters, |
117 | .masters_cnt = ARRAY_SIZE(omap2430_l4_wkup_masters), | 118 | .masters_cnt = ARRAY_SIZE(omap2430_l4_wkup_masters), |
118 | .slaves = omap2430_l4_wkup_slaves, | 119 | .slaves = omap2430_l4_wkup_slaves, |
119 | .slaves_cnt = ARRAY_SIZE(omap2430_l4_wkup_slaves), | 120 | .slaves_cnt = ARRAY_SIZE(omap2430_l4_wkup_slaves), |
120 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430) | 121 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430), |
122 | .flags = HWMOD_NO_IDLEST, | ||
121 | }; | 123 | }; |
122 | 124 | ||
123 | /* Master interfaces on the MPU device */ | 125 | /* Master interfaces on the MPU device */ |
124 | static struct omap_hwmod_ocp_if *omap2430_mpu_masters[] = { | 126 | static struct omap_hwmod_ocp_if *omap2430_mpu_masters[] = { |
125 | &omap2430_mpu__l3, | 127 | &omap2430_mpu__l3_main, |
126 | }; | 128 | }; |
127 | 129 | ||
128 | /* MPU */ | 130 | /* MPU */ |
@@ -135,11 +137,40 @@ static struct omap_hwmod omap2430_mpu_hwmod = { | |||
135 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430), | 137 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430), |
136 | }; | 138 | }; |
137 | 139 | ||
140 | /* | ||
141 | * IVA2_1 interface data | ||
142 | */ | ||
143 | |||
144 | /* IVA2 <- L3 interface */ | ||
145 | static struct omap_hwmod_ocp_if omap2430_l3__iva = { | ||
146 | .master = &omap2430_l3_main_hwmod, | ||
147 | .slave = &omap2430_iva_hwmod, | ||
148 | .clk = "dsp_fck", | ||
149 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
150 | }; | ||
151 | |||
152 | static struct omap_hwmod_ocp_if *omap2430_iva_masters[] = { | ||
153 | &omap2430_l3__iva, | ||
154 | }; | ||
155 | |||
156 | /* | ||
157 | * IVA2 (IVA2) | ||
158 | */ | ||
159 | |||
160 | static struct omap_hwmod omap2430_iva_hwmod = { | ||
161 | .name = "iva", | ||
162 | .class = &iva_hwmod_class, | ||
163 | .masters = omap2430_iva_masters, | ||
164 | .masters_cnt = ARRAY_SIZE(omap2430_iva_masters), | ||
165 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430) | ||
166 | }; | ||
167 | |||
138 | static __initdata struct omap_hwmod *omap2430_hwmods[] = { | 168 | static __initdata struct omap_hwmod *omap2430_hwmods[] = { |
139 | &omap2430_l3_hwmod, | 169 | &omap2430_l3_main_hwmod, |
140 | &omap2430_l4_core_hwmod, | 170 | &omap2430_l4_core_hwmod, |
141 | &omap2430_l4_wkup_hwmod, | 171 | &omap2430_l4_wkup_hwmod, |
142 | &omap2430_mpu_hwmod, | 172 | &omap2430_mpu_hwmod, |
173 | &omap2430_iva_hwmod, | ||
143 | NULL, | 174 | NULL, |
144 | }; | 175 | }; |
145 | 176 | ||
diff --git a/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c b/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c index 39b0c0eaa37d..5d8eb58ba5e3 100644 --- a/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c +++ b/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c | |||
@@ -32,51 +32,53 @@ | |||
32 | */ | 32 | */ |
33 | 33 | ||
34 | static struct omap_hwmod omap3xxx_mpu_hwmod; | 34 | static struct omap_hwmod omap3xxx_mpu_hwmod; |
35 | static struct omap_hwmod omap3xxx_l3_hwmod; | 35 | static struct omap_hwmod omap3xxx_iva_hwmod; |
36 | static struct omap_hwmod omap3xxx_l3_main_hwmod; | ||
36 | static struct omap_hwmod omap3xxx_l4_core_hwmod; | 37 | static struct omap_hwmod omap3xxx_l4_core_hwmod; |
37 | static struct omap_hwmod omap3xxx_l4_per_hwmod; | 38 | static struct omap_hwmod omap3xxx_l4_per_hwmod; |
38 | 39 | ||
39 | /* L3 -> L4_CORE interface */ | 40 | /* L3 -> L4_CORE interface */ |
40 | static struct omap_hwmod_ocp_if omap3xxx_l3__l4_core = { | 41 | static struct omap_hwmod_ocp_if omap3xxx_l3_main__l4_core = { |
41 | .master = &omap3xxx_l3_hwmod, | 42 | .master = &omap3xxx_l3_main_hwmod, |
42 | .slave = &omap3xxx_l4_core_hwmod, | 43 | .slave = &omap3xxx_l4_core_hwmod, |
43 | .user = OCP_USER_MPU | OCP_USER_SDMA, | 44 | .user = OCP_USER_MPU | OCP_USER_SDMA, |
44 | }; | 45 | }; |
45 | 46 | ||
46 | /* L3 -> L4_PER interface */ | 47 | /* L3 -> L4_PER interface */ |
47 | static struct omap_hwmod_ocp_if omap3xxx_l3__l4_per = { | 48 | static struct omap_hwmod_ocp_if omap3xxx_l3_main__l4_per = { |
48 | .master = &omap3xxx_l3_hwmod, | 49 | .master = &omap3xxx_l3_main_hwmod, |
49 | .slave = &omap3xxx_l4_per_hwmod, | 50 | .slave = &omap3xxx_l4_per_hwmod, |
50 | .user = OCP_USER_MPU | OCP_USER_SDMA, | 51 | .user = OCP_USER_MPU | OCP_USER_SDMA, |
51 | }; | 52 | }; |
52 | 53 | ||
53 | /* MPU -> L3 interface */ | 54 | /* MPU -> L3 interface */ |
54 | static struct omap_hwmod_ocp_if omap3xxx_mpu__l3 = { | 55 | static struct omap_hwmod_ocp_if omap3xxx_mpu__l3_main = { |
55 | .master = &omap3xxx_mpu_hwmod, | 56 | .master = &omap3xxx_mpu_hwmod, |
56 | .slave = &omap3xxx_l3_hwmod, | 57 | .slave = &omap3xxx_l3_main_hwmod, |
57 | .user = OCP_USER_MPU, | 58 | .user = OCP_USER_MPU, |
58 | }; | 59 | }; |
59 | 60 | ||
60 | /* Slave interfaces on the L3 interconnect */ | 61 | /* Slave interfaces on the L3 interconnect */ |
61 | static struct omap_hwmod_ocp_if *omap3xxx_l3_slaves[] = { | 62 | static struct omap_hwmod_ocp_if *omap3xxx_l3_main_slaves[] = { |
62 | &omap3xxx_mpu__l3, | 63 | &omap3xxx_mpu__l3_main, |
63 | }; | 64 | }; |
64 | 65 | ||
65 | /* Master interfaces on the L3 interconnect */ | 66 | /* Master interfaces on the L3 interconnect */ |
66 | static struct omap_hwmod_ocp_if *omap3xxx_l3_masters[] = { | 67 | static struct omap_hwmod_ocp_if *omap3xxx_l3_main_masters[] = { |
67 | &omap3xxx_l3__l4_core, | 68 | &omap3xxx_l3_main__l4_core, |
68 | &omap3xxx_l3__l4_per, | 69 | &omap3xxx_l3_main__l4_per, |
69 | }; | 70 | }; |
70 | 71 | ||
71 | /* L3 */ | 72 | /* L3 */ |
72 | static struct omap_hwmod omap3xxx_l3_hwmod = { | 73 | static struct omap_hwmod omap3xxx_l3_main_hwmod = { |
73 | .name = "l3_hwmod", | 74 | .name = "l3_main", |
74 | .class = &l3_hwmod_class, | 75 | .class = &l3_hwmod_class, |
75 | .masters = omap3xxx_l3_masters, | 76 | .masters = omap3xxx_l3_main_masters, |
76 | .masters_cnt = ARRAY_SIZE(omap3xxx_l3_masters), | 77 | .masters_cnt = ARRAY_SIZE(omap3xxx_l3_main_masters), |
77 | .slaves = omap3xxx_l3_slaves, | 78 | .slaves = omap3xxx_l3_main_slaves, |
78 | .slaves_cnt = ARRAY_SIZE(omap3xxx_l3_slaves), | 79 | .slaves_cnt = ARRAY_SIZE(omap3xxx_l3_main_slaves), |
79 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430) | 80 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), |
81 | .flags = HWMOD_NO_IDLEST, | ||
80 | }; | 82 | }; |
81 | 83 | ||
82 | static struct omap_hwmod omap3xxx_l4_wkup_hwmod; | 84 | static struct omap_hwmod omap3xxx_l4_wkup_hwmod; |
@@ -90,7 +92,7 @@ static struct omap_hwmod_ocp_if omap3xxx_l4_core__l4_wkup = { | |||
90 | 92 | ||
91 | /* Slave interfaces on the L4_CORE interconnect */ | 93 | /* Slave interfaces on the L4_CORE interconnect */ |
92 | static struct omap_hwmod_ocp_if *omap3xxx_l4_core_slaves[] = { | 94 | static struct omap_hwmod_ocp_if *omap3xxx_l4_core_slaves[] = { |
93 | &omap3xxx_l3__l4_core, | 95 | &omap3xxx_l3_main__l4_core, |
94 | }; | 96 | }; |
95 | 97 | ||
96 | /* Master interfaces on the L4_CORE interconnect */ | 98 | /* Master interfaces on the L4_CORE interconnect */ |
@@ -100,18 +102,19 @@ static struct omap_hwmod_ocp_if *omap3xxx_l4_core_masters[] = { | |||
100 | 102 | ||
101 | /* L4 CORE */ | 103 | /* L4 CORE */ |
102 | static struct omap_hwmod omap3xxx_l4_core_hwmod = { | 104 | static struct omap_hwmod omap3xxx_l4_core_hwmod = { |
103 | .name = "l4_core_hwmod", | 105 | .name = "l4_core", |
104 | .class = &l4_hwmod_class, | 106 | .class = &l4_hwmod_class, |
105 | .masters = omap3xxx_l4_core_masters, | 107 | .masters = omap3xxx_l4_core_masters, |
106 | .masters_cnt = ARRAY_SIZE(omap3xxx_l4_core_masters), | 108 | .masters_cnt = ARRAY_SIZE(omap3xxx_l4_core_masters), |
107 | .slaves = omap3xxx_l4_core_slaves, | 109 | .slaves = omap3xxx_l4_core_slaves, |
108 | .slaves_cnt = ARRAY_SIZE(omap3xxx_l4_core_slaves), | 110 | .slaves_cnt = ARRAY_SIZE(omap3xxx_l4_core_slaves), |
109 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430) | 111 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), |
112 | .flags = HWMOD_NO_IDLEST, | ||
110 | }; | 113 | }; |
111 | 114 | ||
112 | /* Slave interfaces on the L4_PER interconnect */ | 115 | /* Slave interfaces on the L4_PER interconnect */ |
113 | static struct omap_hwmod_ocp_if *omap3xxx_l4_per_slaves[] = { | 116 | static struct omap_hwmod_ocp_if *omap3xxx_l4_per_slaves[] = { |
114 | &omap3xxx_l3__l4_per, | 117 | &omap3xxx_l3_main__l4_per, |
115 | }; | 118 | }; |
116 | 119 | ||
117 | /* Master interfaces on the L4_PER interconnect */ | 120 | /* Master interfaces on the L4_PER interconnect */ |
@@ -120,13 +123,14 @@ static struct omap_hwmod_ocp_if *omap3xxx_l4_per_masters[] = { | |||
120 | 123 | ||
121 | /* L4 PER */ | 124 | /* L4 PER */ |
122 | static struct omap_hwmod omap3xxx_l4_per_hwmod = { | 125 | static struct omap_hwmod omap3xxx_l4_per_hwmod = { |
123 | .name = "l4_per_hwmod", | 126 | .name = "l4_per", |
124 | .class = &l4_hwmod_class, | 127 | .class = &l4_hwmod_class, |
125 | .masters = omap3xxx_l4_per_masters, | 128 | .masters = omap3xxx_l4_per_masters, |
126 | .masters_cnt = ARRAY_SIZE(omap3xxx_l4_per_masters), | 129 | .masters_cnt = ARRAY_SIZE(omap3xxx_l4_per_masters), |
127 | .slaves = omap3xxx_l4_per_slaves, | 130 | .slaves = omap3xxx_l4_per_slaves, |
128 | .slaves_cnt = ARRAY_SIZE(omap3xxx_l4_per_slaves), | 131 | .slaves_cnt = ARRAY_SIZE(omap3xxx_l4_per_slaves), |
129 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430) | 132 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), |
133 | .flags = HWMOD_NO_IDLEST, | ||
130 | }; | 134 | }; |
131 | 135 | ||
132 | /* Slave interfaces on the L4_WKUP interconnect */ | 136 | /* Slave interfaces on the L4_WKUP interconnect */ |
@@ -140,18 +144,19 @@ static struct omap_hwmod_ocp_if *omap3xxx_l4_wkup_masters[] = { | |||
140 | 144 | ||
141 | /* L4 WKUP */ | 145 | /* L4 WKUP */ |
142 | static struct omap_hwmod omap3xxx_l4_wkup_hwmod = { | 146 | static struct omap_hwmod omap3xxx_l4_wkup_hwmod = { |
143 | .name = "l4_wkup_hwmod", | 147 | .name = "l4_wkup", |
144 | .class = &l4_hwmod_class, | 148 | .class = &l4_hwmod_class, |
145 | .masters = omap3xxx_l4_wkup_masters, | 149 | .masters = omap3xxx_l4_wkup_masters, |
146 | .masters_cnt = ARRAY_SIZE(omap3xxx_l4_wkup_masters), | 150 | .masters_cnt = ARRAY_SIZE(omap3xxx_l4_wkup_masters), |
147 | .slaves = omap3xxx_l4_wkup_slaves, | 151 | .slaves = omap3xxx_l4_wkup_slaves, |
148 | .slaves_cnt = ARRAY_SIZE(omap3xxx_l4_wkup_slaves), | 152 | .slaves_cnt = ARRAY_SIZE(omap3xxx_l4_wkup_slaves), |
149 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430) | 153 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), |
154 | .flags = HWMOD_NO_IDLEST, | ||
150 | }; | 155 | }; |
151 | 156 | ||
152 | /* Master interfaces on the MPU device */ | 157 | /* Master interfaces on the MPU device */ |
153 | static struct omap_hwmod_ocp_if *omap3xxx_mpu_masters[] = { | 158 | static struct omap_hwmod_ocp_if *omap3xxx_mpu_masters[] = { |
154 | &omap3xxx_mpu__l3, | 159 | &omap3xxx_mpu__l3_main, |
155 | }; | 160 | }; |
156 | 161 | ||
157 | /* MPU */ | 162 | /* MPU */ |
@@ -164,12 +169,41 @@ static struct omap_hwmod omap3xxx_mpu_hwmod = { | |||
164 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), | 169 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), |
165 | }; | 170 | }; |
166 | 171 | ||
172 | /* | ||
173 | * IVA2_2 interface data | ||
174 | */ | ||
175 | |||
176 | /* IVA2 <- L3 interface */ | ||
177 | static struct omap_hwmod_ocp_if omap3xxx_l3__iva = { | ||
178 | .master = &omap3xxx_l3_main_hwmod, | ||
179 | .slave = &omap3xxx_iva_hwmod, | ||
180 | .clk = "iva2_ck", | ||
181 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
182 | }; | ||
183 | |||
184 | static struct omap_hwmod_ocp_if *omap3xxx_iva_masters[] = { | ||
185 | &omap3xxx_l3__iva, | ||
186 | }; | ||
187 | |||
188 | /* | ||
189 | * IVA2 (IVA2) | ||
190 | */ | ||
191 | |||
192 | static struct omap_hwmod omap3xxx_iva_hwmod = { | ||
193 | .name = "iva", | ||
194 | .class = &iva_hwmod_class, | ||
195 | .masters = omap3xxx_iva_masters, | ||
196 | .masters_cnt = ARRAY_SIZE(omap3xxx_iva_masters), | ||
197 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430) | ||
198 | }; | ||
199 | |||
167 | static __initdata struct omap_hwmod *omap3xxx_hwmods[] = { | 200 | static __initdata struct omap_hwmod *omap3xxx_hwmods[] = { |
168 | &omap3xxx_l3_hwmod, | 201 | &omap3xxx_l3_main_hwmod, |
169 | &omap3xxx_l4_core_hwmod, | 202 | &omap3xxx_l4_core_hwmod, |
170 | &omap3xxx_l4_per_hwmod, | 203 | &omap3xxx_l4_per_hwmod, |
171 | &omap3xxx_l4_wkup_hwmod, | 204 | &omap3xxx_l4_wkup_hwmod, |
172 | &omap3xxx_mpu_hwmod, | 205 | &omap3xxx_mpu_hwmod, |
206 | &omap3xxx_iva_hwmod, | ||
173 | NULL, | 207 | NULL, |
174 | }; | 208 | }; |
175 | 209 | ||
diff --git a/arch/arm/mach-omap2/omap_hwmod_common_data.c b/arch/arm/mach-omap2/omap_hwmod_common_data.c index 1e80b914fa1a..08a134243ecb 100644 --- a/arch/arm/mach-omap2/omap_hwmod_common_data.c +++ b/arch/arm/mach-omap2/omap_hwmod_common_data.c | |||
@@ -66,3 +66,6 @@ struct omap_hwmod_class mpu_hwmod_class = { | |||
66 | .name = "mpu" | 66 | .name = "mpu" |
67 | }; | 67 | }; |
68 | 68 | ||
69 | struct omap_hwmod_class iva_hwmod_class = { | ||
70 | .name = "iva" | ||
71 | }; | ||
diff --git a/arch/arm/mach-omap2/omap_hwmod_common_data.h b/arch/arm/mach-omap2/omap_hwmod_common_data.h index 3645a28c7c27..c34e98bf1242 100644 --- a/arch/arm/mach-omap2/omap_hwmod_common_data.h +++ b/arch/arm/mach-omap2/omap_hwmod_common_data.h | |||
@@ -20,5 +20,6 @@ | |||
20 | extern struct omap_hwmod_class l3_hwmod_class; | 20 | extern struct omap_hwmod_class l3_hwmod_class; |
21 | extern struct omap_hwmod_class l4_hwmod_class; | 21 | extern struct omap_hwmod_class l4_hwmod_class; |
22 | extern struct omap_hwmod_class mpu_hwmod_class; | 22 | extern struct omap_hwmod_class mpu_hwmod_class; |
23 | extern struct omap_hwmod_class iva_hwmod_class; | ||
23 | 24 | ||
24 | #endif | 25 | #endif |
diff --git a/arch/arm/mach-omap2/pm.c b/arch/arm/mach-omap2/pm.c new file mode 100644 index 000000000000..68f9f2e95891 --- /dev/null +++ b/arch/arm/mach-omap2/pm.c | |||
@@ -0,0 +1,84 @@ | |||
1 | /* | ||
2 | * pm.c - Common OMAP2+ power management-related code | ||
3 | * | ||
4 | * Copyright (C) 2010 Texas Instruments, Inc. | ||
5 | * Copyright (C) 2010 Nokia Corporation | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify | ||
8 | * it under the terms of the GNU General Public License version 2 as | ||
9 | * published by the Free Software Foundation. | ||
10 | */ | ||
11 | |||
12 | #include <linux/kernel.h> | ||
13 | #include <linux/init.h> | ||
14 | #include <linux/io.h> | ||
15 | #include <linux/err.h> | ||
16 | |||
17 | #include <plat/omap-pm.h> | ||
18 | #include <plat/omap_device.h> | ||
19 | #include <plat/common.h> | ||
20 | |||
21 | static struct omap_device_pm_latency *pm_lats; | ||
22 | |||
23 | static struct device *mpu_dev; | ||
24 | static struct device *dsp_dev; | ||
25 | static struct device *l3_dev; | ||
26 | |||
27 | struct device *omap2_get_mpuss_device(void) | ||
28 | { | ||
29 | WARN_ON_ONCE(!mpu_dev); | ||
30 | return mpu_dev; | ||
31 | } | ||
32 | |||
33 | struct device *omap2_get_dsp_device(void) | ||
34 | { | ||
35 | WARN_ON_ONCE(!dsp_dev); | ||
36 | return dsp_dev; | ||
37 | } | ||
38 | |||
39 | struct device *omap2_get_l3_device(void) | ||
40 | { | ||
41 | WARN_ON_ONCE(!l3_dev); | ||
42 | return l3_dev; | ||
43 | } | ||
44 | |||
45 | /* static int _init_omap_device(struct omap_hwmod *oh, void *user) */ | ||
46 | static int _init_omap_device(char *name, struct device **new_dev) | ||
47 | { | ||
48 | struct omap_hwmod *oh; | ||
49 | struct omap_device *od; | ||
50 | |||
51 | oh = omap_hwmod_lookup(name); | ||
52 | if (WARN(!oh, "%s: could not find omap_hwmod for %s\n", | ||
53 | __func__, name)) | ||
54 | return -ENODEV; | ||
55 | |||
56 | od = omap_device_build(oh->name, 0, oh, NULL, 0, pm_lats, 0, false); | ||
57 | if (WARN(IS_ERR(od), "%s: could not build omap_device for %s\n", | ||
58 | __func__, name)) | ||
59 | return -ENODEV; | ||
60 | |||
61 | *new_dev = &od->pdev.dev; | ||
62 | |||
63 | return 0; | ||
64 | } | ||
65 | |||
66 | /* | ||
67 | * Build omap_devices for processors and bus. | ||
68 | */ | ||
69 | static void omap2_init_processor_devices(void) | ||
70 | { | ||
71 | _init_omap_device("mpu", &mpu_dev); | ||
72 | _init_omap_device("iva", &dsp_dev); | ||
73 | _init_omap_device("l3_main", &l3_dev); | ||
74 | } | ||
75 | |||
76 | static int __init omap2_common_pm_init(void) | ||
77 | { | ||
78 | omap2_init_processor_devices(); | ||
79 | omap_pm_if_init(); | ||
80 | |||
81 | return 0; | ||
82 | } | ||
83 | device_initcall(omap2_common_pm_init); | ||
84 | |||