OMAP: CM, hwmod, omap_device fixes and updates
Subsystems (5)
cover OMAP: CM, hwmod, omap_device fixes and updates
This is a series of fixes & updates mostly to hwmod and omap_device that are required for the on-going hwmod conversions and runtime PM conversion of drivers.
While some of these are fixes, they are not urgent for 2.6.35 and can wait until the next merge window.
This series applies on top of the runtime PM series just posted and is also available as the pm-wip/hwmods branch of my linux-omap-pm git tree:
git://git.kernel.org/pub/scm/linux/kernel/git/khilman/linux-omap-pm.git
This has been tested with various hwmod & runtime PM conversions (UART, MMC, dmtimer) on OMAP2, OMAP3 and OMAP4.
Kevin
Benoit Cousson (2):
OMAP: hwmod: Fix the missing braces OMAP2&3: hwmod: Remove _hwmod prefix in name string
Kevin Hilman (10):
OMAP24xx: CM: fix mask used for checking IDLEST status
OMAP: hwmod: allow idle after HWMOD_INIT_NO_IDLE OMAP2/3: hwmod: L3 and L4 CORE/PER/WKUP hwmods don't have IDLEST
OMAP: hwmod: add non-locking versions of enable and idle functions
OMAP: hwmod: don't auto-disable hwmod when !CONFIG_PM_RUNTIME
OMAP: omap_device: ensure hwmod tracks attached omap_device pointer
OMAP: omap_device: add flag to disable automatic bus-level
suspend/resume
OMAP: create omap_devices for MPU, DSP, L3
OMAP: hwmod data: add class for DSP hwmods
OMAP3: hwmod data: add data for OMAP3 IVA2
Rajendra Nayak (1):
OMAP4: hwmod: Enable omap_device build for OMAP4
arch/arm/mach-omap2/cm.c | 6 +- arch/arm/mach-omap2/devices.c | 2 + arch/arm/mach-omap2/io.c | 55 ++++++++++++++++++++++- arch/arm/mach-omap2/omap_hwmod.c | 60 +++++++++++++++++++++--- arch/arm/mach-omap2/omap_hwmod_2420_data.c | 15 ++++--- arch/arm/mach-omap2/omap_hwmod_2430_data.c | 15 ++++--- arch/arm/mach-omap2/omap_hwmod_3xxx_data.c | 51 ++++++++++++++++++--- arch/arm/mach-omap2/omap_hwmod_common_data.c | 3 + arch/arm/mach-omap2/omap_hwmod_common_data.h | 1 + arch/arm/plat-omap/Makefile | 1 + arch/arm/plat-omap/include/plat/common.h | 4 ++ arch/arm/plat-omap/include/plat/omap_device.h | 5 ++ arch/arm/plat-omap/include/plat/omap_hwmod.h | 2 + arch/arm/plat-omap/omap_device.c | 8 +++- 14 files changed, 194 insertions(+), 34 deletions(-)
PATCH 1/13 OMAP24xx: CM: fix mask used for checking IDLEST status
On OMAP24xx, the polarity for the IDLEST bits is opposite of OMAP3. The mask used to check this was using the bit position instead of the bit mask.
This patch fixes the problem by using the bit mask instead of the bit field.
--- arch/arm/mach-omap2/cm.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-)
arch/arm/mach-omap2/cm.c +3 -3
@@ -50,15 +50,15 @@ int omap2_cm_wait_module_ready(s16 prcm_mod, u8 idlest_id, u8 idlest_shift) cm_idlest_reg = cm_idlest_offs[idlest_id -1 ]; + mask =1 << idlest_shift; +if (cpu_is_omap24xx ()) - ena = idlest_shift; + ena = mask;else if (cpu_is_omap34xx ()) ena =0 ;else BUG (); - mask =1 << idlest_shift; -/* XXX should be OMAP2 CM */ omap_test_timeout (((cm_read_mod_reg (prcm_mod, cm_idlest_reg) & mask) == ena),MAX_MODULE_READY_TIME , i);
Signature · 1 line
1.7.0.2
PATCH 2/13 OMAP: hwmod: allow idle after HWMOD_INIT_NO_IDLE
In reply to Kevin HilmanIf an omap_hwmod is setup using HWMOD_INIT_NO_IDLE flag, there is currently way to idle it since omap_hwmod_idle() requires the hwmod to be in the enabled state.
This patch adds a check to omap_hwmod_idle() so if the hwmod was has the INIT_NO_IDLE flag, calling omap_hwmod_idle() will still succeed.
--- arch/arm/mach-omap2/omap_hwmod.c | 11 ++++++++++- 1 files changed, 10 insertions(+), 1 deletions(-)
arch/arm/mach-omap2/omap_hwmod.c +10 -1
@@ -938,7 +938,13 @@ static int _enable(struct omap_hwmod *oh)*/ static int _idle (struct omap_hwmod *oh) { -if (oh->_state != _HWMOD_STATE_ENABLED) { +/* +* To idle, hwmod must be enabled, EXCEPT if hwmod was +* initialized using the INIT_NO_IDLE flag. In this case it +* will not yet be enabled so we have to allow it to be idled. +*/ +if ((oh->_state != _HWMOD_STATE_ENABLED) && + !(oh->flags &HWMOD_INIT_NO_IDLE )) {WARN (1 ,"omap_hwmod: %s: idle state can only be entered from " "enabled state\n" , oh->name);return -EINVAL ;
@@ -953,6 +959,9 @@ static int _idle(struct omap_hwmod *oh) oh->_state = _HWMOD_STATE_IDLE; +/* Clear init flag which should only affect first call to idle */ + oh->flags &= ~HWMOD_INIT_NO_IDLE ; +return 0 ; }
Signature · 1 line
1.7.0.2
PATCH 3/13 OMAP2/3: hwmod: L3 and L4 CORE/PER/WKUP hwmods don't have IDLEST
In reply to Kevin HilmanSince these hwmods do not have IDLEST, set the HWMOD_NO_IDLEST flag, otherwise _enable() will fail due to failing _wait_target_ready().
--- arch/arm/mach-omap2/omap_hwmod_2420_data.c | 9 ++++++--- arch/arm/mach-omap2/omap_hwmod_2430_data.c | 9 ++++++--- arch/arm/mach-omap2/omap_hwmod_3xxx_data.c | 12 ++++++++---- 3 files changed, 20 insertions(+), 10 deletions(-)
arch/arm/mach-omap2/omap_hwmod_2420_data.c +6 -3
@@ -65,7 +65,8 @@ static struct omap_hwmod omap2420_l3_hwmod = { .masters_cnt = ARRAY_SIZE(omap2420_l3_masters), .slaves = omap2420_l3_slaves, .slaves_cnt = ARRAY_SIZE(omap2420_l3_slaves), - .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420) + .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420), + .flags = HWMOD_NO_IDLEST, };static struct omap_hwmod omap2420_l4_wkup_hwmod;
@@ -95,7 +96,8 @@ static struct omap_hwmod omap2420_l4_core_hwmod = { .masters_cnt = ARRAY_SIZE(omap2420_l4_core_masters), .slaves = omap2420_l4_core_slaves, .slaves_cnt = ARRAY_SIZE(omap2420_l4_core_slaves), - .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420) + .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420), + .flags = HWMOD_NO_IDLEST, };/* Slave interfaces on the L4_WKUP interconnect */
@@ -115,7 +117,8 @@ static struct omap_hwmod omap2420_l4_wkup_hwmod = { .masters_cnt = ARRAY_SIZE(omap2420_l4_wkup_masters), .slaves = omap2420_l4_wkup_slaves, .slaves_cnt = ARRAY_SIZE(omap2420_l4_wkup_slaves), - .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420) + .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420), + .flags = HWMOD_NO_IDLEST, };/* Master interfaces on the MPU device */
arch/arm/mach-omap2/omap_hwmod_2430_data.c +6 -3
@@ -65,7 +65,8 @@ static struct omap_hwmod omap2430_l3_hwmod = { .masters_cnt = ARRAY_SIZE(omap2430_l3_masters), .slaves = omap2430_l3_slaves, .slaves_cnt = ARRAY_SIZE(omap2430_l3_slaves), - .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430) + .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430), + .flags = HWMOD_NO_IDLEST, };static struct omap_hwmod omap2430_l4_wkup_hwmod;
@@ -97,7 +98,8 @@ static struct omap_hwmod omap2430_l4_core_hwmod = { .masters_cnt = ARRAY_SIZE(omap2430_l4_core_masters), .slaves = omap2430_l4_core_slaves, .slaves_cnt = ARRAY_SIZE(omap2430_l4_core_slaves), - .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430) + .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430), + .flags = HWMOD_NO_IDLEST, };/* Slave interfaces on the L4_WKUP interconnect */
@@ -117,7 +119,8 @@ static struct omap_hwmod omap2430_l4_wkup_hwmod = { .masters_cnt = ARRAY_SIZE(omap2430_l4_wkup_masters), .slaves = omap2430_l4_wkup_slaves, .slaves_cnt = ARRAY_SIZE(omap2430_l4_wkup_slaves), - .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430) + .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430), + .flags = HWMOD_NO_IDLEST, };/* Master interfaces on the MPU device */
arch/arm/mach-omap2/omap_hwmod_3xxx_data.c +8 -4
@@ -76,7 +76,8 @@ static struct omap_hwmod omap3xxx_l3_hwmod = { .masters_cnt = ARRAY_SIZE(omap3xxx_l3_masters), .slaves = omap3xxx_l3_slaves, .slaves_cnt = ARRAY_SIZE(omap3xxx_l3_slaves), - .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430) + .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), + .flags = HWMOD_NO_IDLEST, };static struct omap_hwmod omap3xxx_l4_wkup_hwmod;
@@ -106,7 +107,8 @@ static struct omap_hwmod omap3xxx_l4_core_hwmod = { .masters_cnt = ARRAY_SIZE(omap3xxx_l4_core_masters), .slaves = omap3xxx_l4_core_slaves, .slaves_cnt = ARRAY_SIZE(omap3xxx_l4_core_slaves), - .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430) + .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), + .flags = HWMOD_NO_IDLEST, };/* Slave interfaces on the L4_PER interconnect */
@@ -126,7 +128,8 @@ static struct omap_hwmod omap3xxx_l4_per_hwmod = { .masters_cnt = ARRAY_SIZE(omap3xxx_l4_per_masters), .slaves = omap3xxx_l4_per_slaves, .slaves_cnt = ARRAY_SIZE(omap3xxx_l4_per_slaves), - .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430) + .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), + .flags = HWMOD_NO_IDLEST, };/* Slave interfaces on the L4_WKUP interconnect */
@@ -146,7 +149,8 @@ static struct omap_hwmod omap3xxx_l4_wkup_hwmod = { .masters_cnt = ARRAY_SIZE(omap3xxx_l4_wkup_masters), .slaves = omap3xxx_l4_wkup_slaves, .slaves_cnt = ARRAY_SIZE(omap3xxx_l4_wkup_slaves), - .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430) + .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), + .flags = HWMOD_NO_IDLEST, };/* Master interfaces on the MPU device */
Signature · 1 line
1.7.0.2
PATCH 4/13 OMAP: hwmod: Fix the missing braces
In reply to Kevin HilmanFrom: Benoit Cousson <[email protected]>
As reported by Sergei, a couple of braces were missing after the WARM removal patch.
[07/22] OMAP: hwmod: Replace WARN by pr_warning if clock lookup failed
https://patchwork.kernel.org/patch/100756/
--- arch/arm/mach-omap2/omap_hwmod.c | 9 ++++++--- 1 files changed, 6 insertions(+), 3 deletions(-)
arch/arm/mach-omap2/omap_hwmod.c +6 -3
@@ -409,10 +409,11 @@ static int _init_main_clk(struct omap_hwmod *oh)return 0 ; oh->_clk =omap_clk_get_by_name (oh->main_clk); -if (!oh->_clk) +if (!oh->_clk) {pr_warning ("omap_hwmod: %s: cannot clk_get main_clk %s\n" , oh->name, oh->main_clk);return -EINVAL ; + }if (!oh->_clk->clkdm) pr_warning("omap_hwmod: %s: missing clockdomain for %s.\n",
@@ -444,10 +445,11 @@ static int _init_interface_clks(struct omap_hwmod *oh)continue ; c =omap_clk_get_by_name (os->clk); -if (!c) +if (!c) {pr_warning ("omap_hwmod: %s: cannot clk_get interface_clk %s\n" , oh->name, os->clk); ret = -EINVAL ; + } os->_clk = c; }
@@ -470,10 +472,11 @@ static int _init_opt_clks(struct omap_hwmod *oh)for (i = oh->opt_clks_cnt, oc = oh->opt_clks; i >0 ; i--, oc++) { c =omap_clk_get_by_name (oc->clk); -if (!c) +if (!c) {pr_warning ("omap_hwmod: %s: cannot clk_get opt_clk %s\n" , oh->name, oc->clk); ret = -EINVAL ; + } oc->_clk = c; }
Signature · 1 line
1.7.0.2
PATCH 5/13 OMAP2&3: hwmod: Remove _hwmod prefix in name string
In reply to Kevin HilmanFrom: Benoit Cousson <[email protected]>
In the lastest OMAP4 hwmod data file, the _hwmod was removed in order to save some memory space and because it does not bring a lot.
Align OMAP2420, 2430 and 3430 data files with the same convention.
--- arch/arm/mach-omap2/omap_hwmod_2420_data.c | 6 +++--- arch/arm/mach-omap2/omap_hwmod_2430_data.c | 6 +++--- arch/arm/mach-omap2/omap_hwmod_3xxx_data.c | 8 ++++---- 3 files changed, 10 insertions(+), 10 deletions(-)
arch/arm/mach-omap2/omap_hwmod_2420_data.c +3 -3
@@ -59,7 +59,7 @@ static struct omap_hwmod_ocp_if *omap2420_l3_masters[] = {/* L3 */ static struct omap_hwmod omap2420_l3_hwmod = { - .name ="l3_hwmod" , + .name ="l3_main" , .class = &l3_hwmod_class, .masters = omap2420_l3_masters, .masters_cnt =ARRAY_SIZE (omap2420_l3_masters),
@@ -90,7 +90,7 @@ static struct omap_hwmod_ocp_if *omap2420_l4_core_masters[] = {/* L4 CORE */ static struct omap_hwmod omap2420_l4_core_hwmod = { - .name ="l4_core_hwmod" , + .name ="l4_core" , .class = &l4_hwmod_class, .masters = omap2420_l4_core_masters, .masters_cnt =ARRAY_SIZE (omap2420_l4_core_masters),
@@ -111,7 +111,7 @@ static struct omap_hwmod_ocp_if *omap2420_l4_wkup_masters[] = {/* L4 WKUP */ static struct omap_hwmod omap2420_l4_wkup_hwmod = { - .name ="l4_wkup_hwmod" , + .name ="l4_wkup" , .class = &l4_hwmod_class, .masters = omap2420_l4_wkup_masters, .masters_cnt =ARRAY_SIZE (omap2420_l4_wkup_masters),
arch/arm/mach-omap2/omap_hwmod_2430_data.c +3 -3
@@ -59,7 +59,7 @@ static struct omap_hwmod_ocp_if *omap2430_l3_masters[] = {/* L3 */ static struct omap_hwmod omap2430_l3_hwmod = { - .name ="l3_hwmod" , + .name ="l3_main" , .class = &l3_hwmod_class, .masters = omap2430_l3_masters, .masters_cnt =ARRAY_SIZE (omap2430_l3_masters),
@@ -92,7 +92,7 @@ static struct omap_hwmod_ocp_if *omap2430_l4_core_masters[] = {/* L4 CORE */ static struct omap_hwmod omap2430_l4_core_hwmod = { - .name ="l4_core_hwmod" , + .name ="l4_core" , .class = &l4_hwmod_class, .masters = omap2430_l4_core_masters, .masters_cnt =ARRAY_SIZE (omap2430_l4_core_masters),
@@ -113,7 +113,7 @@ static struct omap_hwmod_ocp_if *omap2430_l4_wkup_masters[] = {/* L4 WKUP */ static struct omap_hwmod omap2430_l4_wkup_hwmod = { - .name ="l4_wkup_hwmod" , + .name ="l4_wkup" , .class = &l4_hwmod_class, .masters = omap2430_l4_wkup_masters, .masters_cnt =ARRAY_SIZE (omap2430_l4_wkup_masters),
arch/arm/mach-omap2/omap_hwmod_3xxx_data.c +4 -4
@@ -70,7 +70,7 @@ static struct omap_hwmod_ocp_if *omap3xxx_l3_masters[] = {/* L3 */ static struct omap_hwmod omap3xxx_l3_hwmod = { - .name ="l3_hwmod" , + .name ="l3_main" , .class = &l3_hwmod_class, .masters = omap3xxx_l3_masters, .masters_cnt =ARRAY_SIZE (omap3xxx_l3_masters),
@@ -101,7 +101,7 @@ static struct omap_hwmod_ocp_if *omap3xxx_l4_core_masters[] = {/* L4 CORE */ static struct omap_hwmod omap3xxx_l4_core_hwmod = { - .name ="l4_core_hwmod" , + .name ="l4_core" , .class = &l4_hwmod_class, .masters = omap3xxx_l4_core_masters, .masters_cnt =ARRAY_SIZE (omap3xxx_l4_core_masters),
@@ -122,7 +122,7 @@ static struct omap_hwmod_ocp_if *omap3xxx_l4_per_masters[] = {/* L4 PER */ static struct omap_hwmod omap3xxx_l4_per_hwmod = { - .name ="l4_per_hwmod" , + .name ="l4_per" , .class = &l4_hwmod_class, .masters = omap3xxx_l4_per_masters, .masters_cnt =ARRAY_SIZE (omap3xxx_l4_per_masters),
@@ -143,7 +143,7 @@ static struct omap_hwmod_ocp_if *omap3xxx_l4_wkup_masters[] = {/* L4 WKUP */ static struct omap_hwmod omap3xxx_l4_wkup_hwmod = { - .name ="l4_wkup_hwmod" , + .name ="l4_wkup" , .class = &l4_hwmod_class, .masters = omap3xxx_l4_wkup_masters, .masters_cnt =ARRAY_SIZE (omap3xxx_l4_wkup_masters),
Signature · 1 line
1.7.0.2
PATCH 6/13 OMAP: hwmod: add non-locking versions of enable and idle functions
In reply to Kevin HilmanSome hwmods may need to be idled/enabled in atomic context, so non-locking versions of these functions are required.
Most users should not need these and usage of theses should be controlled to understand why access is being done in atomic context. For this reason, the non-locking functions are only exposed at the hwmod level and not at the omap-device level.
The use-case that led to the need for the non-locking versions is hwmods that are enabled/idled from within the core idle/suspend path. Since interrupts are already disabled here, the mutex-based locking in hwmod can sleep and will cause potential deadlocks.
--- arch/arm/mach-omap2/omap_hwmod.c | 32 ++++++++++++++++++++++--- arch/arm/plat-omap/include/plat/omap_hwmod.h | 2 + 2 files changed, 30 insertions(+), 4 deletions(-)
arch/arm/mach-omap2/omap_hwmod.c +28 -4
@@ -1287,6 +1287,18 @@ int omap_hwmod_unregister(struct omap_hwmod *oh) }/** +* __omap_hwmod_enable - enable an omap_hwmod (non-locking version) +* @oh: struct omap_hwmod * +* +* Enable an omap_hwomd @oh. Intended to be called in rare cases +* where usage is required in atomic context. +*/ +int __omap_hwmod_enable (struct omap_hwmod *oh) +{ +return _enable (oh); +} + +/** * omap_hwmod_enable - enable an omap_hwmod * @oh: struct omap_hwmod * *
@@ -1301,12 +1313,26 @@ int omap_hwmod_enable(struct omap_hwmod *oh)return -EINVAL ;mutex_lock (&omap_hwmod_mutex); - r =_enable (oh); + r =__omap_hwmod_enable (oh);mutex_unlock (&omap_hwmod_mutex);return r; } + +/** +* __omap_hwmod_idle - idle an omap_hwmod (non-locking) +* @oh: struct omap_hwmod * +* +* Idle an omap_hwomd @oh. Intended to be called in rare instances where +* used in atomic context. +*/ +int __omap_hwmod_idle (struct omap_hwmod *oh) +{ +_idle (oh); +return 0 ; +} +/** * omap_hwmod_idle - idle an omap_hwmod * @oh: struct omap_hwmod *
@@ -1319,9 +1345,7 @@ int omap_hwmod_idle(struct omap_hwmod *oh)if (!oh)return -EINVAL ; -mutex_lock (&omap_hwmod_mutex); -_idle (oh); -mutex_unlock (&omap_hwmod_mutex); +__omap_hwmod_idle (oh);return 0 ; }
arch/arm/plat-omap/include/plat/omap_hwmod.h +2 -0
@@ -486,7 +486,9 @@ int omap_hwmod_for_each(int (*fn)(struct omap_hwmod *oh));int omap_hwmod_late_init (void );int omap_hwmod_enable (struct omap_hwmod *oh); +int __omap_hwmod_enable (struct omap_hwmod *oh);int omap_hwmod_idle (struct omap_hwmod *oh); +int __omap_hwmod_idle (struct omap_hwmod *oh);int omap_hwmod_shutdown (struct omap_hwmod *oh);int omap_hwmod_enable_clocks (struct omap_hwmod *oh);
Signature · 1 line
1.7.0.2
PATCH 7/13 OMAP: hwmod: don't auto-disable hwmod when !CONFIG_PM_RUNTIME
In reply to Kevin HilmanWhen runtime PM is disabled, the pm_runtime_idle() and _enable() functions will be effectively noops and will not result in enable and idle calls at the hwmod level.
In order for drivers to still work when runtime PM is disabled, ensure that all hwmods are left in an enabled state so that even without runtime PM management, they will still work.
--- arch/arm/mach-omap2/omap_hwmod.c | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-)
arch/arm/mach-omap2/omap_hwmod.c +8 -0
@@ -1059,6 +1059,14 @@ static int _setup(struct omap_hwmod *oh) } } +#ifndef CONFIG_PM_RUNTIME +/* +* If runtime PM is not enabled, leave the device enabled +* since runtime PM will not be dynamically managing the device. +*/ + oh->flags |=HWMOD_INIT_NO_IDLE ; +#endif +if (!(oh->flags &HWMOD_INIT_NO_IDLE ))_idle (oh);
Signature · 1 line
1.7.0.2
PATCH 8/13 OMAP4: hwmod: Enable omap_device build for OMAP4
In reply to Kevin HilmanFrom: Rajendra Nayak <[email protected]>
--- arch/arm/plat-omap/Makefile | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
arch/arm/plat-omap/Makefile +1 -0
@@ -15,6 +15,7 @@ obj-$(CONFIG_ARCH_OMAP16XX) += ocpi.o # omap_device support (OMAP2+ only at the moment) obj-$(CONFIG_ARCH_OMAP2) += omap_device.o obj-$(CONFIG_ARCH_OMAP3) += omap_device.o +obj-$(CONFIG_ARCH_OMAP4) += omap_device.o obj-$(CONFIG_OMAP_MCBSP) += mcbsp.o obj-$(CONFIG_OMAP_IOMMU) += iommu.o iovmm.o
Signature · 1 line
1.7.0.2
PATCH 9/13 OMAP: omap_device: ensure hwmod tracks attached omap_device pointer
In reply to Kevin HilmanThe omap_hwmod struct has a field to track the omap_device that is attached to it, but it was not being assigned. Fix by assigning omap_device pointer when omap_device is built.
--- arch/arm/plat-omap/omap_device.c | 8 ++++++-- 1 files changed, 6 insertions(+), 2 deletions(-)
arch/arm/plat-omap/omap_device.c +6 -2
@@ -359,8 +359,8 @@ struct omap_device *omap_device_build_ss(const char *pdev_name, int pdev_id,struct omap_device *od;char *pdev_name2;struct resource *res =NULL ; -int res_count; -struct omap_hwmod **hwmods; +int i, res_count; +struct omap_hwmod *oh, **hwmods;if (!ohs || oh_cnt ==0 || !pdev_name)return ERR_PTR (-EINVAL );
@@ -416,6 +416,10 @@ struct omap_device *omap_device_build_ss(const char *pdev_name, int pdev_id,else ret =omap_device_register (od); +/* each hwmod has a pointer to its attached omap_device */ +for (i =0 , oh = hwmods[0 ]; i < oh_cnt; i++, oh++) + oh->od = od; +if (ret) goto odbs_exit4;
Signature · 1 line
1.7.0.2
PATCH 10/13 OMAP: omap_device: add flag to disable automatic bus-level suspend/resume
In reply to Kevin HilmanAs part of the runtime PM support, bus-level code can automatically handle the enable/idle for each omap_device. There are, however, some special cases where we don't want the bus-level layer to handle this, and instead handle it manually.
Specific use cases are for omap_devices that are controlled inside the idle path (like UART.)
--- arch/arm/plat-omap/include/plat/omap_device.h | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-)
arch/arm/plat-omap/include/plat/omap_device.h +5 -0
@@ -68,12 +68,16 @@ struct omap_device {struct omap_device_pm_latency *pm_lats;u32 dev_wakeup_lat;u32 _dev_wakeup_lat_limit; +u32 flags;u8 pm_lats_cnt;s8 pm_lat_level;u8 hwmods_cnt;u8 _state; }; +/* flags for struct omap_device */ +#define OMAP_DEVICE_NO_BUS_SUSPEND BIT(0) +/* Device driver interface (call via platform_data fn ptrs) */ int omap_device_enable (struct platform_device *pdev);
@@ -142,6 +146,7 @@ struct omap_device_pm_latency {u32 flags; }; +/* flags for struct omap_device_pm_latency */ #define OMAP_DEVICE_LATENCY_AUTO_ADJUST BIT(1)/* Get omap_device pointer from platform_device pointer */
Signature · 1 line
1.7.0.2
PATCH 11/13 OMAP: create omap_devices for MPU, DSP, L3
In reply to Kevin HilmanCreate simple omap_devices for the main processors and busses.
This is required to support the forth-coming device-based OPP approach, where OPPs are managed and tracked at the device level.
So that these primary devices are available for early PM initialization, they are created as early platform_devices.
--- arch/arm/mach-omap2/devices.c | 2 + arch/arm/mach-omap2/io.c | 55 +++++++++++++++++++++++++++++- arch/arm/plat-omap/include/plat/common.h | 4 ++ 3 files changed, 60 insertions(+), 1 deletions(-)
arch/arm/mach-omap2/devices.c +2 -0
@@ -15,6 +15,7 @@#include <linux/platform_device.h> #include <linux/io.h> #include <linux/clk.h> +#include <linux/err.h> #include <mach/hardware.h> #include <mach/irqs.h>
@@ -29,6 +30,7 @@#include <mach/gpio.h> #include <plat/mmc.h> #include <plat/dma.h> +#include <plat/omap_device.h> #include "mux.h"
arch/arm/mach-omap2/io.c +54 -1
73 lines not on this page · raw message
arch/arm/plat-omap/include/plat/common.h +4 -0
@@ -87,4 +87,8 @@ void omap2_set_globals_uart(struct omap_globals *); } \ }) +struct device *omap_get_mpu_device (void ); +struct device *omap_get_dsp_device (void ); +struct device *omap_get_l3_device (void ); +#endif /* __ARCH_ARM_MACH_OMAP_COMMON_H */
Signature · 1 line
1.7.0.2
PATCH 12/13 OMAP: hwmod data: add class for DSP hwmods
In reply to Kevin HilmanAdd a new hwmod class for DSP devices. To be used when hwmods are created for DSP on OMAP3 (a.k.a. IVA2.)
--- arch/arm/mach-omap2/omap_hwmod_common_data.c | 3 +++ arch/arm/mach-omap2/omap_hwmod_common_data.h | 1 + 2 files changed, 4 insertions(+), 0 deletions(-)
arch/arm/mach-omap2/omap_hwmod_common_data.c +3 -0
@@ -66,3 +66,6 @@ struct omap_hwmod_class mpu_hwmod_class = { .name = "mpu" }; +struct omap_hwmod_class dsp_hwmod_class = { + .name ="dsp" +};
arch/arm/mach-omap2/omap_hwmod_common_data.h +1 -0
@@ -20,5 +20,6 @@extern struct omap_hwmod_class l3_hwmod_class;extern struct omap_hwmod_class l4_hwmod_class;extern struct omap_hwmod_class mpu_hwmod_class; +extern struct omap_hwmod_class dsp_hwmod_class;#endif
Signature · 1 line
1.7.0.2
PATCH 13/13 OMAP3: hwmod data: add data for OMAP3 IVA2
In reply to Kevin HilmanAdd hwmod data for DSP on OMAP3 (a.k.a. IVA2.)
--- arch/arm/mach-omap2/omap_hwmod_3xxx_data.c | 31 ++++++++++++++++++++++++++++ 1 files changed, 31 insertions(+), 0 deletions(-)
arch/arm/mach-omap2/omap_hwmod_3xxx_data.c +31 -0
@@ -32,6 +32,7 @@*/ static struct omap_hwmod omap3xxx_mpu_hwmod; +static struct omap_hwmod omap3xxx_iva2_hwmod;static struct omap_hwmod omap3xxx_l3_hwmod;static struct omap_hwmod omap3xxx_l4_core_hwmod;static struct omap_hwmod omap3xxx_l4_per_hwmod;
@@ -168,12 +169,42 @@ static struct omap_hwmod omap3xxx_mpu_hwmod = { .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), }; +/* +* IVA2_2 interface data +*/ + +/* IVA2 <- L3 interface */ +static struct omap_hwmod_ocp_if omap3xxx_l3__iva2 = { + .master = &omap3xxx_l3_hwmod, + .slave = &omap3xxx_iva2_hwmod, + .clk ="iva2_ck" , + .user =OCP_USER_MPU |OCP_USER_SDMA , +}; + +static struct omap_hwmod_ocp_if *omap3xxx_iva2_masters[] = { + &omap3xxx_l3__iva2, +}; + +/* +* IVA2 (IVA2) +*/ + +static struct omap_hwmod omap3xxx_iva2_hwmod = { + .name ="dsp" , + .class = &dsp_hwmod_class, + .main_clk ="iva2_ck" , + .masters = omap3xxx_iva2_masters, + .masters_cnt =ARRAY_SIZE (omap3xxx_iva2_masters), + .omap_chip =OMAP_CHIP_INIT (CHIP_IS_OMAP3430 ) +}; +static __initdata struct omap_hwmod *omap3xxx_hwmods[] = { &omap3xxx_l3_hwmod, &omap3xxx_l4_core_hwmod, &omap3xxx_l4_per_hwmod, &omap3xxx_l4_wkup_hwmod, &omap3xxx_mpu_hwmod, + &omap3xxx_iva2_hwmod,NULL , };
Signature · 1 line
1.7.0.2
RE: [PATCH 04/13] OMAP: hwmod: Fix the missing braces
In reply to Kevin HilmanQuoted 9 lines · Kevin Hilman
Sent: Wednesday, June 23, 2010 6:43 PM
To: [email protected]
Cc: [email protected]; Cousson, Benoit; Sergei Shtylyov
Subject: [PATCH 04/13] OMAP: hwmod: Fix the missing bracesFrom: Benoit Cousson <[email protected]>
As reported by Sergei, a couple of braces were missing after the WARM removal patch.
s/WARM/WARN?
Quoted 9 lines
[07/22] OMAP: hwmod: Replace WARN by
pr_warningif clock lookup failedhttps://patchwork.kernel.org/patch/100756/
Signed-off-by Benoit Cousson <[email protected]>Cc Paul Walmsley <[email protected]>Cc Sergei Shtylyov <[email protected]>Signed-off-by Kevin Hilman <[email protected]>
Paul Walmsley
maintainerRE: [PATCH 04/13] OMAP: hwmod: Fix the missing braces
Quoted 6 lines · Anand
Quoted 5 lines · Kevin Hilman
Sent: Wednesday, June 23, 2010 6:43 PM
To: [email protected]
Cc: [email protected]; Cousson, Benoit; Sergei Shtylyov
Subject: [PATCH 04/13] OMAP: hwmod: Fix the missing braces
Quoted 6 lines
Quoted 4 lines
From: Benoit Cousson <[email protected]>
As reported by Sergei, a couple of braces were missing after the WARM removal patch.
s/WARM/WARN?
Thanks, just fixed that in the patch description.
- Paul
Re: [PATCH 10/13] OMAP: omap_device: add flag to disable automatic bus-level suspend/resume
In reply to Kevin HilmanHi Kevin,
A few comments:
Your "add runtime PM support at bus-level" series has a unstated dependency on this patch. If you fix one minor issue (below), it's probably easiest if you merge it with that other series to avoid cross-dependencies.
Quoted 18 lines · Kevin Hilman
As part of the runtime PM support, bus-level code can automatically handle the enable/idle for each
omap_device. There are, however, some special cases where we don't want the bus-level layer to handle this, and instead handle it manually.Specific use cases are for
omap_devicesthat are controlled inside the idle path (like UART.)Signed-off-by Kevin Hilman <[email protected]>--- arch/arm/plat-omap/include/plat/omap_device.h | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-)arch/arm/plat-omap/include/plat/omap_device.h +0
-0
arch/arm/plat-omap/include/plat/omap_device.h struct omap_device { · line 71
Quoted 4 lines
arch/arm/plat-omap/include/plat/omap_device.h +1
-0@@ -68,12 +68,16 @@ struct omap_device {struct omap_device_pm_latency *pm_lats;u32 dev_wakeup_lat;u32 _dev_wakeup_lat_limit; +u32 flags;
This should be a u8. Fix that and it is
Quoted 28 lines
arch/arm/plat-omap/include/plat/omap_device.h +4
-0u8 pm_lats_cnt;s8 pm_lat_level;u8 hwmods_cnt;u8 _state; }; +/* flags for struct omap_device */ +#define OMAP_DEVICE_NO_BUS_SUSPEND BIT(0) +/* Device driver interface (call via platform_data fn ptrs) */ int omap_device_enable (struct platform_device *pdev);@@ -142,6 +146,7 @@ struct omap_device_pm_latency {u32 flags; }; +/* flags for struct omap_device_pm_latency */ #define OMAP_DEVICE_LATENCY_AUTO_ADJUST BIT(1)/* Get omap_device pointer from platform_device pointer */ Signature · 6 lines
1.7.0.2 -- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
- Paul
Paul Walmsley
maintainerRe: [PATCH 02/13] OMAP: hwmod: allow idle after HWMOD_INIT_NO_IDLE
In reply to Kevin HilmanHi Kevin,
something doesn't make sense in this patch...
Quoted 3 lines · Kevin Hilman
If an
omap_hwmodis setup usingHWMOD_INIT_NO_IDLEflag, there is currently way to idle it sinceomap_hwmod_idle()requires the hwmod to be in the enabled state.
The only thing that HWMOD_INIT_NO_IDLE does is prevent the hwmod from being idled at the end of _setup(). By that time, the hwmod has already been enabled, and its state has been set to _HWMOD_STATE_ENABLED. So there shouldn't be anything preventing the hwmod from being idled at that point?
Maybe the problem is that some hwmods were failing _wait_target_ready() and so were never entering the ENABLED state? If so, that looks like it's fixed appropriately by your patch 3.
Quoted 29 lines
This patch adds a check to
omap_hwmod_idle()so if the hwmod was has theINIT_NO_IDLEflag, callingomap_hwmod_idle()will still succeed.Cc Paul Walmsley <[email protected]>Signed-off-by Kevin Hilman <[email protected]>--- arch/arm/mach-omap2/omap_hwmod.c | 11 ++++++++++- 1 files changed, 10 insertions(+), 1 deletions(-)arch/arm/mach-omap2/omap_hwmod.c +7
-1@@ -938,7 +938,13 @@ static int _enable(struct omap_hwmod *oh)*/ static int _idle (struct omap_hwmod *oh) { -if (oh->_state != _HWMOD_STATE_ENABLED) { +/* +* To idle, hwmod must be enabled, EXCEPT if hwmod was +* initialized using the INIT_NO_IDLE flag. In this case it +* will not yet be enabled so we have to allow it to be idled. +*/ +if ((oh->_state != _HWMOD_STATE_ENABLED) && + !(oh->flags &HWMOD_INIT_NO_IDLE )) {WARN (1 ,"omap_hwmod: %s: idle state can only be entered from " "enabled state\n" , oh->name);return -EINVAL ;
arch/arm/mach-omap2/omap_hwmod.c static int _idle(struct omap_hwmod *oh) · line 963
Quoted 5 lines
arch/arm/mach-omap2/omap_hwmod.c +2
-0@@ -953,6 +959,9 @@ static int _idle(struct omap_hwmod *oh) oh->_state = _HWMOD_STATE_IDLE; +/* Clear init flag which should only affect first call to idle */ + oh->flags &= ~HWMOD_INIT_NO_IDLE ;
- Paul
Paul Walmsley
maintainerRe: [PATCH 05/13] OMAP2&3: hwmod: Remove _hwmod prefix in name string
In reply to Kevin HilmanBenoît,
one minor comment here:
Quoted 6 lines · Kevin Hilman
From: Benoit Cousson <[email protected]>
In the lastest OMAP4 hwmod data file, the
_hwmodwas removed in order to save some memory space and because it does not bring a lot.
Align OMAP2420, 2430 and 3430 data files with the same convention.
Shouldn't we also synchronize the names of the structures as well? i.e., if the name is changed to "l3_main", shouldn't the name of the structure also be changed from
static struct omap_hwmod omap2420_l3_hwmod = {to
static struct omap_hwmod omap2420_l3_main_hwmod = {(... as one example?)
- Paul
Quoted 116 lines
Signed-off-by Benoit Cousson <[email protected]>Cc Paul Walmsley <[email protected]>Cc Rajendra Nayak <[email protected]>Signed-off-by Kevin Hilman <[email protected]>--- arch/arm/mach-omap2/omap_hwmod_2420_data.c | 6 +++--- arch/arm/mach-omap2/omap_hwmod_2430_data.c | 6 +++--- arch/arm/mach-omap2/omap_hwmod_3xxx_data.c | 8 ++++---- 3 files changed, 10 insertions(+), 10 deletions(-)arch/arm/mach-omap2/omap_hwmod_2420_data.c +3
-3@@ -59,7 +59,7 @@ static struct omap_hwmod_ocp_if *omap2420_l3_masters[] = {/* L3 */ static struct omap_hwmod omap2420_l3_hwmod = { - .name ="l3_hwmod" , + .name ="l3_main" , .class = &l3_hwmod_class, .masters = omap2420_l3_masters, .masters_cnt =ARRAY_SIZE (omap2420_l3_masters),@@ -90,7 +90,7 @@ static struct omap_hwmod_ocp_if *omap2420_l4_core_masters[] = {/* L4 CORE */ static struct omap_hwmod omap2420_l4_core_hwmod = { - .name ="l4_core_hwmod" , + .name ="l4_core" , .class = &l4_hwmod_class, .masters = omap2420_l4_core_masters, .masters_cnt =ARRAY_SIZE (omap2420_l4_core_masters),@@ -111,7 +111,7 @@ static struct omap_hwmod_ocp_if *omap2420_l4_wkup_masters[] = {/* L4 WKUP */ static struct omap_hwmod omap2420_l4_wkup_hwmod = { - .name ="l4_wkup_hwmod" , + .name ="l4_wkup" , .class = &l4_hwmod_class, .masters = omap2420_l4_wkup_masters, .masters_cnt =ARRAY_SIZE (omap2420_l4_wkup_masters),arch/arm/mach-omap2/omap_hwmod_2430_data.c +3
-3@@ -59,7 +59,7 @@ static struct omap_hwmod_ocp_if *omap2430_l3_masters[] = {/* L3 */ static struct omap_hwmod omap2430_l3_hwmod = { - .name ="l3_hwmod" , + .name ="l3_main" , .class = &l3_hwmod_class, .masters = omap2430_l3_masters, .masters_cnt =ARRAY_SIZE (omap2430_l3_masters),@@ -92,7 +92,7 @@ static struct omap_hwmod_ocp_if *omap2430_l4_core_masters[] = {/* L4 CORE */ static struct omap_hwmod omap2430_l4_core_hwmod = { - .name ="l4_core_hwmod" , + .name ="l4_core" , .class = &l4_hwmod_class, .masters = omap2430_l4_core_masters, .masters_cnt =ARRAY_SIZE (omap2430_l4_core_masters),@@ -113,7 +113,7 @@ static struct omap_hwmod_ocp_if *omap2430_l4_wkup_masters[] = {/* L4 WKUP */ static struct omap_hwmod omap2430_l4_wkup_hwmod = { - .name ="l4_wkup_hwmod" , + .name ="l4_wkup" , .class = &l4_hwmod_class, .masters = omap2430_l4_wkup_masters, .masters_cnt =ARRAY_SIZE (omap2430_l4_wkup_masters),arch/arm/mach-omap2/omap_hwmod_3xxx_data.c +4
-4@@ -70,7 +70,7 @@ static struct omap_hwmod_ocp_if *omap3xxx_l3_masters[] = {/* L3 */ static struct omap_hwmod omap3xxx_l3_hwmod = { - .name ="l3_hwmod" , + .name ="l3_main" , .class = &l3_hwmod_class, .masters = omap3xxx_l3_masters, .masters_cnt =ARRAY_SIZE (omap3xxx_l3_masters),@@ -101,7 +101,7 @@ static struct omap_hwmod_ocp_if *omap3xxx_l4_core_masters[] = {/* L4 CORE */ static struct omap_hwmod omap3xxx_l4_core_hwmod = { - .name ="l4_core_hwmod" , + .name ="l4_core" , .class = &l4_hwmod_class, .masters = omap3xxx_l4_core_masters, .masters_cnt =ARRAY_SIZE (omap3xxx_l4_core_masters),@@ -122,7 +122,7 @@ static struct omap_hwmod_ocp_if *omap3xxx_l4_per_masters[] = {/* L4 PER */ static struct omap_hwmod omap3xxx_l4_per_hwmod = { - .name ="l4_per_hwmod" , + .name ="l4_per" , .class = &l4_hwmod_class, .masters = omap3xxx_l4_per_masters, .masters_cnt =ARRAY_SIZE (omap3xxx_l4_per_masters),@@ -143,7 +143,7 @@ static struct omap_hwmod_ocp_if *omap3xxx_l4_wkup_masters[] = {/* L4 WKUP */ static struct omap_hwmod omap3xxx_l4_wkup_hwmod = { - .name ="l4_wkup_hwmod" , + .name ="l4_wkup" , .class = &l4_hwmod_class, .masters = omap3xxx_l4_wkup_masters, .masters_cnt =ARRAY_SIZE (omap3xxx_l4_wkup_masters),Signature · 1 line
1.7.0.2
- Paul
Paul Walmsley
maintainerRe: [PATCH 06/13] OMAP: hwmod: add non-locking versions of enable and idle functions
In reply to Kevin HilmanHi Kevin
Quoted 8 lines · Kevin Hilman
Some hwmods may need to be idled/enabled in atomic context, so non-locking versions of these functions are required.
Most users should not need these and usage of theses should be controlled to understand why access is being done in atomic context. For this reason, the non-locking functions are only exposed at the hwmod level and not at the omap-device level.
Quoted 4 lines
The use-case that led to the need for the non-locking versions is hwmods that are enabled/idled from within the core idle/suspend path. Since interrupts are already disabled here, the mutex-based locking in hwmod can sleep and will cause potential deadlocks.
I accept the use-case. But maybe it would be preferable to rename _enable(), _idle(), _shutdown() to _omap_hwmod_{enable,idle,shutdown}() ? That would avoid the need to add new functions that just call the existing ones.
- Paul
Quoted 87 lines
Cc Paul Walmsley <[email protected]>Signed-off-by Kevin Hilman <[email protected]>--- arch/arm/mach-omap2/omap_hwmod.c | 32 ++++++++++++++++++++++--- arch/arm/plat-omap/include/plat/omap_hwmod.h | 2 + 2 files changed, 30 insertions(+), 4 deletions(-)arch/arm/mach-omap2/omap_hwmod.c +28
-4@@ -1287,6 +1287,18 @@ int omap_hwmod_unregister(struct omap_hwmod *oh) }/** +* __omap_hwmod_enable - enable an omap_hwmod (non-locking version) +* @oh: struct omap_hwmod * +* +* Enable an omap_hwomd @oh. Intended to be called in rare cases +* where usage is required in atomic context. +*/ +int __omap_hwmod_enable (struct omap_hwmod *oh) +{ +return _enable (oh); +} + +/** * omap_hwmod_enable - enable an omap_hwmod * @oh: struct omap_hwmod * * @@ -1301,12 +1313,26 @@ int omap_hwmod_enable(struct omap_hwmod *oh)return -EINVAL ;mutex_lock (&omap_hwmod_mutex); - r =_enable (oh); + r =__omap_hwmod_enable (oh);mutex_unlock (&omap_hwmod_mutex);return r; } + +/** +* __omap_hwmod_idle - idle an omap_hwmod (non-locking) +* @oh: struct omap_hwmod * +* +* Idle an omap_hwomd @oh. Intended to be called in rare instances where +* used in atomic context. +*/ +int __omap_hwmod_idle (struct omap_hwmod *oh) +{ +_idle (oh); +return 0 ; +} +/** * omap_hwmod_idle - idle an omap_hwmod * @oh: struct omap_hwmod * @@ -1319,9 +1345,7 @@ int omap_hwmod_idle(struct omap_hwmod *oh)if (!oh)return -EINVAL ; -mutex_lock (&omap_hwmod_mutex); -_idle (oh); -mutex_unlock (&omap_hwmod_mutex); +__omap_hwmod_idle (oh);return 0 ; }arch/arm/plat-omap/include/plat/omap_hwmod.h +2
-0@@ -486,7 +486,9 @@ int omap_hwmod_for_each(int (*fn)(struct omap_hwmod *oh));int omap_hwmod_late_init (void );int omap_hwmod_enable (struct omap_hwmod *oh); +int __omap_hwmod_enable (struct omap_hwmod *oh);int omap_hwmod_idle (struct omap_hwmod *oh); +int __omap_hwmod_idle (struct omap_hwmod *oh);int omap_hwmod_shutdown (struct omap_hwmod *oh);int omap_hwmod_enable_clocks (struct omap_hwmod *oh);Signature · 1 line
1.7.0.2
- Paul
Paul Walmsley
maintainerRe: [PATCH 08/13] OMAP4: hwmod: Enable omap_device build for OMAP4
In reply to Kevin HilmanHi Rajendra
Quoted 2 lines · Kevin Hilman
From: Rajendra Nayak <[email protected]>
Please add a brief patch changelog entry here. Maybe just say this is necessary for integration code using omap_device to work on OMAP4?
Quoted 23 lines
Signed-off-by Rajendra Nayak <[email protected]>Signed-off-by Benoit Cousson <[email protected]>Cc Paul Walmsley <[email protected]>Signed-off-by Kevin Hilman <[email protected]>--- arch/arm/plat-omap/Makefile | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)arch/arm/plat-omap/Makefile +1
-0@@ -15,6 +15,7 @@ obj-$(CONFIG_ARCH_OMAP16XX) += ocpi.o # omap_device support (OMAP2+ only at the moment) obj-$(CONFIG_ARCH_OMAP2) += omap_device.o obj-$(CONFIG_ARCH_OMAP3) += omap_device.o +obj-$(CONFIG_ARCH_OMAP4) += omap_device.o obj-$(CONFIG_OMAP_MCBSP) += mcbsp.o obj-$(CONFIG_OMAP_IOMMU) += iommu.o iovmm.oSignature · 1 line
1.7.0.2
- Paul
Paul Walmsley
maintainerRe: [PATCH 11/13] OMAP: create omap_devices for MPU, DSP, L3
In reply to Kevin HilmanHi Kevin,
some comments below -
Quoted 7 lines · Kevin Hilman
Create simple
omap_devicesfor the main processors and busses.This is required to support the forth-coming device-based OPP approach, where OPPs are managed and tracked at the device level.
So that these primary devices are available for early PM initialization, they are created as early
platform_devices.
The idea sounds good, but -
Quoted 45 lines
Cc Paul Walmsley <[email protected]>Signed-off-by Kevin Hilman <[email protected]>--- arch/arm/mach-omap2/devices.c | 2 + arch/arm/mach-omap2/io.c | 55 +++++++++++++++++++++++++++++- arch/arm/plat-omap/include/plat/common.h | 4 ++ 3 files changed, 60 insertions(+), 1 deletions(-)arch/arm/mach-omap2/devices.c +2
-0@@ -15,6 +15,7 @@#include <linux/platform_device.h> #include <linux/io.h> #include <linux/clk.h> +#include <linux/err.h> #include <mach/hardware.h> #include <mach/irqs.h> @@ -29,6 +30,7 @@#include <mach/gpio.h> #include <plat/mmc.h> #include <plat/dma.h> +#include <plat/omap_device.h> #include "mux.h" arch/arm/mach-omap2/io.c +1
-1@@ -45,7 +45,7 @@#include <plat/clockdomain.h> #include "clockdomains.h" -#include <plat/omap_hwmod.h> +#include <plat/omap_device.h> /* * The machine specific code may provide the extra mapping besides the @@ -313,6 +313,58 @@ static int __init _omap2_init_reprogram_sdrc(void)return v; }
arch/arm/mach-omap2/io.c static int __init _omap2_init_reprogram_sdrc(void) · line 324
Quoted 10 lines
arch/arm/mach-omap2/io.c +9
-0+static struct omap_device_pm_latency *pm_lats; + +static DEFINE_PER_CPU(struct device *, mpu_dev); +static struct devicee *dsp_dev; +static struct device *l3_dev; + +struct device *omap_get_mpu_device (void ) +{ + mpu_dev =per_cpu (mpu_dev,smp_processor_id ());
Looks like this will trash the per-CPU mpu_dev on SMP. You'll need to rename one of these two mpu_devs.
Also, won't the use of smp_processor_id() mean that this will just return the struct device * for the MPU that is running this code? So on a two-CPU system, it would be either CPU 0 or 1, randomly. I guess one solution would be to pass in the processor ID to omap_get_mpu_device().
Quoted 27 lines
arch/arm/mach-omap2/io.c +27
-0+WARN_ON_ONCE (!mpu_dev); +return mpu_dev; +} + +struct device *omap_get_dsp_device (void ) +{ +WARN_ON_ONCE (!dsp_dev); +return dsp_dev; +} + +struct device *omap_get_l3_device (void ) +{ +WARN_ON_ONCE (!l3_dev); +return l3_dev; +} + +static int _init_omap_device (struct omap_hwmod *oh,void *user) +{ +struct omap_device *od; +const char *name = oh->name; +struct device **new_dev = (struct device **)user; + + od =omap_device_build (name,0 , oh,NULL ,0 , pm_lats,0 , true); +if (WARN (IS_ERR (od),"Could not build omap_device for %s\n" , name)) +return -ENODEV ; + + *new_dev = &od->pdev.dev;
arch/arm/mach-omap2/io.c static int __init _omap2_init_reprogram_sdrc(void) · line 361
Quoted 10 lines
arch/arm/mach-omap2/io.c +10
-0+ +return 0 ; +} + +/* +* Build omap_devices for processors and bus. +*/ +static void omap_init_processor_devices (void ) +{ + mpu_dev =per_cpu (mpu_dev,smp_processor_id ());
(same issues as above)
arch/arm/mach-omap2/io.c static int __init _omap2_init_reprogram_sdrc(void) · line 363
Quoted 2 lines
arch/arm/mach-omap2/io.c +2
-0+ +omap_hwmod_for_each_by_class ("mpu" , _init_omap_device, &mpu_dev);
This won't work on SMP - it will use the same mpu_dev variable for each MPU, so mpu_dev will contain the struct device * for the last MPU hwmod iterated over.
Also, there is a hidden assumption that the hwmods of class "mpu" will be iterated over in the order that the per_cpu() variable expects...
arch/arm/mach-omap2/io.c static int __init _omap2_init_reprogram_sdrc(void) · line 365
Quoted 2 lines
arch/arm/mach-omap2/io.c +2
-0+omap_hwmod_for_each_by_class ("dsp" , _init_omap_device, &dsp_dev); +omap_hwmod_for_each_by_class ("l3" , _init_omap_device, &l3_dev);
If there is more than one hwmod in these classes, these will lose the omap_device pointers for all but the final omap_hwmod iterated over.
It's probably easier to just call omap_hwmod_lookup()/_init_omap_device() directly and forget about omap_hwmod_for_each_by_class() for the above two cases - maybe all three...
Quoted 29 lines
arch/arm/mach-omap2/io.c +3
-0+} +void __init omap2_init_common_hw (struct omap_sdrc_params *sdrc_cs0,struct omap_sdrc_params *sdrc_cs1) {@@ -342,6 +394,7 @@ void __init omap2_init_common_hw(struct omap_sdrc_params *sdrc_cs0,omap_serial_early_init ();if (cpu_is_omap24xx () ||cpu_is_omap34xx ())/* FIXME: OMAP4 */ omap_hwmod_late_init (); +omap_init_processor_devices ();omap_pm_if_init ();if (cpu_is_omap24xx () ||cpu_is_omap34xx ()) {omap2_sdrc_init (sdrc_cs0, sdrc_cs1);arch/arm/plat-omap/include/plat/common.h +4
-0@@ -87,4 +87,8 @@ void omap2_set_globals_uart(struct omap_globals *); } \ }) +struct device *omap_get_mpu_device (void ); +struct device *omap_get_dsp_device (void ); +struct device *omap_get_l3_device (void ); +#endif /* __ARCH_ARM_MACH_OMAP_COMMON_H */ Signature · 1 line
1.7.0.2
- Paul
Paul Walmsley
maintainerRe: [PATCH 11/13] OMAP: create omap_devices for MPU, DSP, L3
Hi Kevin,
one other thought.
Quoted 6 lines · Paul Walmsley
Quoted 4 lines · Kevin Hilman
Create simple
omap_devicesfor the main processors and busses.This is required to support the forth-coming device-based OPP approach, where OPPs are managed and tracked at the device level.
If these omap_devices are only to deal with OPPs, you might only need one omap_device for the MPU subsystem for OMAP4, since I think both cores receive the same clock. That might simplify this patch for the current timeframe.
- Paul
RE: [PATCH 11/13] OMAP: create omap_devices for MPU, DSP, L3
In reply to Paul WalmsleyQuoted 83 lines
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Paul Walmsley
Sent: Thursday, June 24, 2010 11:57 AM
To: Kevin Hilman
Cc: [email protected]
Subject: Re: [PATCH 11/13] OMAP: createomap_devicesfor MPU, DSP, L3Hi Kevin,
some comments below -
Quoted 7 lines · Kevin Hilman
Create simple
omap_devicesfor the main processors and busses.This is required to support the forth-coming device-based OPP approach, where OPPs are managed and tracked at the device level.
So that these primary devices are available for early PM initialization, they are created as early
platform_devices.The idea sounds good, but -
Quoted 45 lines
Cc Paul Walmsley <[email protected]>Signed-off-by Kevin Hilman <[email protected]>--- arch/arm/mach-omap2/devices.c | 2 + arch/arm/mach-omap2/io.c | 55 +++++++++++++++++++++++++++++- arch/arm/plat-omap/include/plat/common.h | 4 ++ 3 files changed, 60 insertions(+), 1 deletions(-)arch/arm/mach-omap2/devices.c +2
-0@@ -15,6 +15,7 @@#include <linux/platform_device.h> #include <linux/io.h> #include <linux/clk.h> +#include <linux/err.h> #include <mach/hardware.h> #include <mach/irqs.h> @@ -29,6 +30,7 @@#include <mach/gpio.h> #include <plat/mmc.h> #include <plat/dma.h> +#include <plat/omap_device.h> #include "mux.h" arch/arm/mach-omap2/io.c +1
-1@@ -45,7 +45,7 @@#include <plat/clockdomain.h> #include "clockdomains.h" -#include <plat/omap_hwmod.h> +#include <plat/omap_device.h> /* * The machine specific code may provide the extra mapping besides the @@ -313,6 +313,58 @@ static int __init _omap2_init_reprogram_sdrc(void)return v; }arch/arm/mach-omap2/io.c static int __init _omap2_init_reprogram_sdrc(void) · line 324
Quoted 10 lines
arch/arm/mach-omap2/io.c +9
-0+static struct omap_device_pm_latency *pm_lats; + +static DEFINE_PER_CPU(struct device *, mpu_dev); +static struct devicee *dsp_dev; +static struct device *l3_dev; + +struct device *omap_get_mpu_device (void ) +{ + mpu_dev =per_cpu (mpu_dev,smp_processor_id ());Looks like this will trash the per-CPU
mpu_devon SMP. You'll need to rename one of these twompu_devs.
Quoted 5 lines
Also, won't the use of
smp_processor_id()mean that this will just return the struct device * for the MPU that is running this code? So on a two-CPU system, it would be either CPU 0 or 1, randomly. I guess one solution would be to pass in the processor ID toomap_get_mpu_device().
MPUSS and both CPU's are clocked from same clock source, so above assumption still work on OMAP4.
Quoted 96 lines
Quoted 27 lines
arch/arm/mach-omap2/io.c +27
-0+WARN_ON_ONCE (!mpu_dev); +return mpu_dev; +} + +struct device *omap_get_dsp_device (void ) +{ +WARN_ON_ONCE (!dsp_dev); +return dsp_dev; +} + +struct device *omap_get_l3_device (void ) +{ +WARN_ON_ONCE (!l3_dev); +return l3_dev; +} + +static int _init_omap_device (struct omap_hwmod *oh,void *user) +{ +struct omap_device *od; +const char *name = oh->name; +struct device **new_dev = (struct device **)user; + + od =omap_device_build (name,0 , oh,NULL ,0 , pm_lats,0 , true); +if (WARN (IS_ERR (od),"Could not build omap_device for %s\n" , name)) +return -ENODEV ; + + *new_dev = &od->pdev.dev;arch/arm/mach-omap2/io.c static int __init _omap2_init_reprogram_sdrc(void) · line 361
Quoted 10 lines
arch/arm/mach-omap2/io.c +10
-0+ +return 0 ; +} + +/* +* Build omap_devices for processors and bus. +*/ +static void omap_init_processor_devices (void ) +{ + mpu_dev =per_cpu (mpu_dev,smp_processor_id ());(same issues as above)
arch/arm/mach-omap2/io.c static int __init _omap2_init_reprogram_sdrc(void) · line 363
Quoted 2 lines
arch/arm/mach-omap2/io.c +2
-0+ +omap_hwmod_for_each_by_class ("mpu" , _init_omap_device, &mpu_dev);This won't work on SMP - it will use the same
mpu_devvariable for each MPU, sompu_devwill contain the struct device * for the last MPU hwmod iterated over.Also, there is a hidden assumption that the hwmods of class "mpu" will be iterated over in the order that the
per_cpu()variable expects...arch/arm/mach-omap2/io.c static int __init _omap2_init_reprogram_sdrc(void) · line 365
Quoted 2 lines
arch/arm/mach-omap2/io.c +2
-0+omap_hwmod_for_each_by_class ("dsp" , _init_omap_device, &dsp_dev); +omap_hwmod_for_each_by_class ("l3" , _init_omap_device, &l3_dev);If there is more than one hwmod in these classes, these will lose the
omap_devicepointers for all but the finalomap_hwmoditerated over.It's probably easier to just call omap_hwmod_lookup()/_init_omap_device() directly and forget about
omap_hwmod_for_each_by_class()for the above two cases - maybe all three...Quoted 27 lines
arch/arm/mach-omap2/io.c +3
-0+} +void __init omap2_init_common_hw (struct omap_sdrc_params *sdrc_cs0,struct omap_sdrc_params *sdrc_cs1) {@@ -342,6 +394,7 @@ void __init omap2_init_common_hw(struct omap_sdrc_params *sdrc_cs0,omap_serial_early_init ();if (cpu_is_omap24xx () ||cpu_is_omap34xx ())/* FIXME: OMAP4 */ omap_hwmod_late_init (); +omap_init_processor_devices ();omap_pm_if_init ();if (cpu_is_omap24xx () ||cpu_is_omap34xx ()) {omap2_sdrc_init (sdrc_cs0, sdrc_cs1);arch/arm/plat-omap/include/plat/common.h +4
-1@@ -87,4 +87,8 @@ void omap2_set_globals_uart(struct omap_globals *); } \ }) +struct device *omap_get_mpu_device (void ); +struct device *omap_get_dsp_device (void ); +struct device *omap_get_l3_device (void ); +#endif /* __ARCH_ARM_MACH_OMAP_COMMON_H */ --Quoted 2 lines
1.7.0.2
- Paul
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Paul Walmsley
maintainerRE: [PATCH 11/13] OMAP: create omap_devices for MPU, DSP, L3
Quoted 12 lines · Santosh
Quoted 12 lines
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Paul Walmsley
Sent: Thursday, June 24, 2010 11:57 AMarch/arm/mach-omap2/io.c static int __init _omap2_init_reprogram_sdrc(void) · line 324
Quoted 3 lines
arch/arm/mach-omap2/io.c +3
-0+struct device *omap_get_mpu_device (void ) +{ + mpu_dev =per_cpu (mpu_dev,smp_processor_id ());Looks like this will trash the per-CPU
mpu_devon SMP. You'll need to rename one of these twompu_devs.
Quoted 7 lines
Quoted 5 lines
Also, won't the use of
smp_processor_id()mean that this will just return the struct device * for the MPU that is running this code? So on a two-CPU system, it would be either CPU 0 or 1, randomly. I guess one solution would be to pass in the processor ID toomap_get_mpu_device().MPUSS and both CPU's are clocked from same clock source, so above assumption still work on OMAP4.
If the point is to only return an omap_device corresponding to the MPU subsystem, then all the per_cpu() stuff is unnecessary and can be dropped, and the function should be so named (e.g., omap_get_mpuss_device()).
- Paul
RE: [PATCH 11/13] OMAP: create omap_devices for MPU, DSP, L3
Quoted 27 lines
-----Original Message-----
From: Paul Walmsley [mailto:[email protected]]
Sent: Thursday, June 24, 2010 12:50 PM
To: Shilimkar, Santosh
Cc: Kevin Hilman; [email protected]
Subject: RE: [PATCH 11/13] OMAP: createomap_devicesfor MPU, DSP, L3Quoted 2 lines · Santosh
Quoted 2 lines
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf OfPaul
Quoted 15 lines
Quoted 15 lines
Walmsley
Sent: Thursday, June 24, 2010 11:57 AMarch/arm/mach-omap2/io.c static int __init _omap2_init_reprogram_sdrc(void) · line 324
Quoted 3 lines
arch/arm/mach-omap2/io.c +3
-0+struct device *omap_get_mpu_device (void ) +{ + mpu_dev =per_cpu (mpu_dev,smp_processor_id ());Looks like this will trash the per-CPU
mpu_devon SMP. You'll need to rename one of these twompu_devs.Also, won't the use of
smp_processor_id()mean that this will just return the struct device * for the MPU that is running this code? So on a two-CPU system, it would be either CPU 0 or 1, randomly. I guess one solution would be to pass in the processor ID toomap_get_mpu_device().
Quoted 7 lines
Quoted 2 lines
MPUSS and both CPU's are clocked from same clock source, so above assumption still work on OMAP4.
If the point is to only return an
omap_devicecorresponding to the MPU subsystem, then all theper_cpu()stuff is unnecessary and can be dropped, and the function should be so named (e.g.,omap_get_mpuss_device()).
Indeed !!
Even otherwise the patch is not really initializing per-cpu device because init(omap_hwmod_for_each_by_class("mpu", _init_omap_device, &mpu_dev);) is called only on one CPU.
Regards,
Santosh
RE: [PATCH 05/13] OMAP2&3: hwmod: Remove _hwmod prefix in name string
In reply to Paul WalmsleyHi Paul,
Quoted 22 lines
From: Paul Walmsley [mailto:[email protected]]
Sent: Thursday, June 24, 2010 7:05 AMBenoît,
one minor comment here:
Quoted 6 lines · Kevin Hilman
From: Benoit Cousson <[email protected]>
In the lastest OMAP4 hwmod data file, the
_hwmodwas removed in order to save some memory space and because it does not bring a lot.
Align OMAP2420, 2430 and 3430 data files with the same convention.Shouldn't we also synchronize the names of the structures as well? i.e.,
if the name is changed to "l3_main", shouldn't the name of the structure
also be changed from
Quoted 7 lines
static struct omap_hwmod omap2420_l3_hwmod = {to
static struct omap_hwmod omap2420_l3_main_hwmod = {(... as one example?)
You're right, I didn't change that because only the string is relevant for the lookup, but it will be much more consitent to change the structures as well.
I'll do it.
Thanks,
Benoit
Quoted 135 lines
- Paul
Quoted 5 lines
Signed-off-by Benoit Cousson <[email protected]>Cc Paul Walmsley <[email protected]>Cc Rajendra Nayak <[email protected]>Signed-off-by Kevin Hilman <[email protected]>Review
Quoted 7 lines
--- arch/arm/mach-omap2/omap_hwmod_2420_data.c | 6 +++--- arch/arm/mach-omap2/omap_hwmod_2430_data.c | 6 +++--- arch/arm/mach-omap2/omap_hwmod_3xxx_data.c | 8 ++++---- 3 files changed, 10 insertions(+), 10 deletions(-)(quoted diff) +0
-0
b/arch/arm/mach-omap2/omap_hwmod_2420_data.carch/arm/mach-omap2/omap_hwmod_2420_data.c static struct omap_hwmod_ocp_if
Quoted 4 lines
index a8b57a6..646386c 100644
arch/arm/mach-omap2/omap_hwmod_2420_data.c +0
-0@@ -59,7 +59,7 @@ static struct omap_hwmod_ocp_if*omap2420_l3_masters[] = {
arch/arm/mach-omap2/omap_hwmod_2420_data.c static struct omap_hwmod_ocp_if
Quoted 9 lines
arch/arm/mach-omap2/omap_hwmod_2420_data.c +1
-1/* L3 */ static struct omap_hwmod omap2420_l3_hwmod = { - .name ="l3_hwmod" , + .name ="l3_main" , .class = &l3_hwmod_class, .masters = omap2420_l3_masters, .masters_cnt =ARRAY_SIZE (omap2420_l3_masters),@@ -90,7 +90,7 @@ static struct omap_hwmod_ocp_if*omap2420_l4_core_masters[] = {
arch/arm/mach-omap2/omap_hwmod_2420_data.c static struct omap_hwmod_ocp_if
Quoted 9 lines
arch/arm/mach-omap2/omap_hwmod_2420_data.c +1
-1/* L4 CORE */ static struct omap_hwmod omap2420_l4_core_hwmod = { - .name ="l4_core_hwmod" , + .name ="l4_core" , .class = &l4_hwmod_class, .masters = omap2420_l4_core_masters, .masters_cnt =ARRAY_SIZE (omap2420_l4_core_masters),@@ -111,7 +111,7 @@ static struct omap_hwmod_ocp_if*omap2420_l4_wkup_masters[] = {
Review
Quoted 9 lines
arch/arm/mach-omap2/omap_hwmod_2420_data.c +1
-1/* L4 WKUP */ static struct omap_hwmod omap2420_l4_wkup_hwmod = { - .name ="l4_wkup_hwmod" , + .name ="l4_wkup" , .class = &l4_hwmod_class, .masters = omap2420_l4_wkup_masters, .masters_cnt =ARRAY_SIZE (omap2420_l4_wkup_masters),(quoted diff) +0
-0
b/arch/arm/mach-omap2/omap_hwmod_2430_data.carch/arm/mach-omap2/omap_hwmod_2430_data.c static struct omap_hwmod_ocp_if
Quoted 4 lines
index 8b1f74b..b2100cf 100644
arch/arm/mach-omap2/omap_hwmod_2430_data.c +0
-0@@ -59,7 +59,7 @@ static struct omap_hwmod_ocp_if*omap2430_l3_masters[] = {
arch/arm/mach-omap2/omap_hwmod_2430_data.c static struct omap_hwmod_ocp_if
Quoted 9 lines
arch/arm/mach-omap2/omap_hwmod_2430_data.c +1
-1/* L3 */ static struct omap_hwmod omap2430_l3_hwmod = { - .name ="l3_hwmod" , + .name ="l3_main" , .class = &l3_hwmod_class, .masters = omap2430_l3_masters, .masters_cnt =ARRAY_SIZE (omap2430_l3_masters),@@ -92,7 +92,7 @@ static struct omap_hwmod_ocp_if*omap2430_l4_core_masters[] = {
arch/arm/mach-omap2/omap_hwmod_2430_data.c static struct omap_hwmod_ocp_if
Quoted 9 lines
arch/arm/mach-omap2/omap_hwmod_2430_data.c +1
-1/* L4 CORE */ static struct omap_hwmod omap2430_l4_core_hwmod = { - .name ="l4_core_hwmod" , + .name ="l4_core" , .class = &l4_hwmod_class, .masters = omap2430_l4_core_masters, .masters_cnt =ARRAY_SIZE (omap2430_l4_core_masters),@@ -113,7 +113,7 @@ static struct omap_hwmod_ocp_if*omap2430_l4_wkup_masters[] = {
Review
Quoted 9 lines
arch/arm/mach-omap2/omap_hwmod_2430_data.c +1
-1/* L4 WKUP */ static struct omap_hwmod omap2430_l4_wkup_hwmod = { - .name ="l4_wkup_hwmod" , + .name ="l4_wkup" , .class = &l4_hwmod_class, .masters = omap2430_l4_wkup_masters, .masters_cnt =ARRAY_SIZE (omap2430_l4_wkup_masters),(quoted diff) +0
-0
b/arch/arm/mach-omap2/omap_hwmod_3xxx_data.carch/arm/mach-omap2/omap_hwmod_3xxx_data.c static struct omap_hwmod_ocp_if
Quoted 4 lines
index e288b20..ec6a5f8 100644
arch/arm/mach-omap2/omap_hwmod_3xxx_data.c +0
-0@@ -70,7 +70,7 @@ static struct omap_hwmod_ocp_if*omap3xxx_l3_masters[] = {
arch/arm/mach-omap2/omap_hwmod_3xxx_data.c static struct omap_hwmod_ocp_if
Quoted 9 lines
arch/arm/mach-omap2/omap_hwmod_3xxx_data.c +1
-1/* L3 */ static struct omap_hwmod omap3xxx_l3_hwmod = { - .name ="l3_hwmod" , + .name ="l3_main" , .class = &l3_hwmod_class, .masters = omap3xxx_l3_masters, .masters_cnt =ARRAY_SIZE (omap3xxx_l3_masters),@@ -101,7 +101,7 @@ static struct omap_hwmod_ocp_if*omap3xxx_l4_core_masters[] = {
arch/arm/mach-omap2/omap_hwmod_3xxx_data.c static struct omap_hwmod_ocp_if
Quoted 9 lines
arch/arm/mach-omap2/omap_hwmod_3xxx_data.c +1
-1/* L4 CORE */ static struct omap_hwmod omap3xxx_l4_core_hwmod = { - .name ="l4_core_hwmod" , + .name ="l4_core" , .class = &l4_hwmod_class, .masters = omap3xxx_l4_core_masters, .masters_cnt =ARRAY_SIZE (omap3xxx_l4_core_masters),@@ -122,7 +122,7 @@ static struct omap_hwmod_ocp_if*omap3xxx_l4_per_masters[] = {
arch/arm/mach-omap2/omap_hwmod_3xxx_data.c static struct omap_hwmod_ocp_if
Quoted 9 lines
arch/arm/mach-omap2/omap_hwmod_3xxx_data.c +1
-1/* L4 PER */ static struct omap_hwmod omap3xxx_l4_per_hwmod = { - .name ="l4_per_hwmod" , + .name ="l4_per" , .class = &l4_hwmod_class, .masters = omap3xxx_l4_per_masters, .masters_cnt =ARRAY_SIZE (omap3xxx_l4_per_masters),@@ -143,7 +143,7 @@ static struct omap_hwmod_ocp_if*omap3xxx_l4_wkup_masters[] = {
Quoted 11 lines
arch/arm/mach-omap2/omap_hwmod_3xxx_data.c +1
-2/* L4 WKUP */ static struct omap_hwmod omap3xxx_l4_wkup_hwmod = { - .name ="l4_wkup_hwmod" , + .name ="l4_wkup" , .class = &l4_hwmod_class, .masters = omap3xxx_l4_wkup_masters, .masters_cnt =ARRAY_SIZE (omap3xxx_l4_wkup_masters), --1.7.0.2
Quoted 1 line
- Paul
Texas Instruments France SA, 821 Avenue Jack Kilby, 06270 Villeneuve Loubet. 036 420 040 R.C.S Antibes. Capital de EUR 753.920
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
RE: [PATCH 06/13] OMAP: hwmod: add non-locking versions of enable and idle functions
In reply to Paul WalmsleyQuoted 102 lines
-----Original Message-----
From: [email protected] [mailto:linux-omap- [email protected]] On Behalf Of Paul Walmsley
Sent: Thursday, June 24, 2010 10:39 AM
To: Kevin Hilman
Cc: [email protected]
Subject: Re: [PATCH 06/13] OMAP: hwmod: add non-locking versions of enable and idle functionsHi Kevin
Quoted 8 lines · Kevin Hilman
Some hwmods may need to be idled/enabled in atomic context, so non-locking versions of these functions are required.
Most users should not need these and usage of theses should be controlled to understand why access is being done in atomic context. For this reason, the non-locking functions are only exposed at the hwmod level and not at the omap-device level.
Quoted 4 lines
The use-case that led to the need for the non-locking versions is hwmods that are enabled/idled from within the core idle/suspend path. Since interrupts are already disabled here, the mutex-based locking in hwmod can sleep and will cause potential deadlocks.
I accept the use-case. But maybe it would be preferable to rename
_enable(),_idle(),_shutdown()to _omap_hwmod_{enable,idle,shutdown}() ? That would avoid the need to add new functions that just call the existing ones.- Paul
Quoted 5 lines
Cc Paul Walmsley <[email protected]>Signed-off-by Kevin Hilman <[email protected]>--- arch/arm/mach-omap2/omap_hwmod.c | 32++++++++++++++++++++++---
arch/arm/mach-
Quoted 4 lines
arch/arm/plat-omap/include/plat/omap_hwmod.h | 2 + 2 files changed, 30 insertions(+), 4 deletions(-)arch/arm/mach- renamed from arch/arm/mach-omap2/omap_hwmod.c +0
-0
omap2/omap_hwmod.cQuoted 29 lines
index 3d11523..8b2b44a 100644
arch/arm/mach-omap2/omap_hwmod.c +13
-1@@ -1287,6 +1287,18 @@ int omap_hwmod_unregister(struct omap_hwmod *oh) }/** +* __omap_hwmod_enable - enable an omap_hwmod (non-locking version) +* @oh: struct omap_hwmod * +* +* Enable an omap_hwomd @oh. Intended to be called in rare cases +* where usage is required in atomic context. +*/ +int __omap_hwmod_enable (struct omap_hwmod *oh) +{ +return _enable (oh); +} + +/** * omap_hwmod_enable - enable an omap_hwmod * @oh: struct omap_hwmod * * @@ -1301,12 +1313,26 @@ int omap_hwmod_enable(struct omap_hwmod *oh)return -EINVAL ;mutex_lock (&omap_hwmod_mutex); - r =_enable (oh); + r =__omap_hwmod_enable (oh);mutex_unlock (&omap_hwmod_mutex);arch/arm/mach-omap2/omap_hwmod.c int omap_hwmod_enable(struct omap_hwmod *oh) · line 1327
Quoted 10 lines
arch/arm/mach-omap2/omap_hwmod.c +6
-0return r; } + +/** +* __omap_hwmod_idle - idle an omap_hwmod (non-locking) +* @oh: struct omap_hwmod * +* +* Idle an omap_hwomd @oh. Intended to be called in rare instances where
Quoted 15 lines
arch/arm/mach-omap2/omap_hwmod.c +8
-0+* used in atomic context. +*/ +int __omap_hwmod_idle (struct omap_hwmod *oh) +{ +_idle (oh); +return 0 ; +} +/** * omap_hwmod_idle - idle an omap_hwmod * @oh: struct omap_hwmod * @@ -1319,9 +1345,7 @@ int omap_hwmod_idle(struct omap_hwmod *oh)if (!oh)return -EINVAL ;
Quoted 5 lines
arch/arm/mach-omap2/omap_hwmod.c int omap_hwmod_idle(struct omap_hwmod *oh) · line 1349
Quoted 5 lines
arch/arm/mach-omap2/omap_hwmod.c +1
-3-mutex_lock (&omap_hwmod_mutex); -_idle (oh); -mutex_unlock (&omap_hwmod_mutex); +__omap_hwmod_idle (oh);
BTW: The mutex locks are missing. Typo?
Quoted 28 lines
Review
Quoted 3 lines
arch/arm/mach-omap2/omap_hwmod.c +0
-0return 0 ; }(quoted diff) +0
-0
b/arch/arm/plat-omap/include/plat/omap_hwmod.harch/arm/plat-omap/include/plat/omap_hwmod.h int omap_hwmod_for_each(int (*fn)(struct omap_hwmod
Quoted 4 lines
index 0eccc09..9a3f4dc 100644
arch/arm/plat-omap/include/plat/omap_hwmod.h +0
-0@@ -486,7 +486,9 @@ int omap_hwmod_for_each(int (*fn)(struct omap_hwmod*oh));
Quoted 10 lines
arch/arm/plat-omap/include/plat/omap_hwmod.h +2
-1int omap_hwmod_late_init (void );int omap_hwmod_enable (struct omap_hwmod *oh); +int __omap_hwmod_enable (struct omap_hwmod *oh);int omap_hwmod_idle (struct omap_hwmod *oh); +int __omap_hwmod_idle (struct omap_hwmod *oh);int omap_hwmod_shutdown (struct omap_hwmod *oh);int omap_hwmod_enable_clocks (struct omap_hwmod *oh); --Quoted 2 lines
1.7.0.2
- Paul
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
RE: [PATCH 08/13] OMAP4: hwmod: Enable omap_device build for OMAP4
In reply to Paul WalmsleyQuoted 11 lines
-----Original Message-----
From: Paul Walmsley [mailto:[email protected]]
Sent: Thursday, June 24, 2010 12:11 AM
To: Nayak, Rajendra
Cc: Kevin Hilman; [email protected]; Cousson, Benoit
Subject: Re: [PATCH 08/13] OMAP4: hwmod: Enableomap_devicebuild for OMAP4Hi Rajendra
Quoted 7 lines
Quoted 2 lines · Kevin Hilman
From: Rajendra Nayak <[email protected]>
Please add a brief patch changelog entry here. Maybe just say this is necessary for integration code using
omap_deviceto work on OMAP4?
Yes, will do, not sure how that got missed.
thanks
Quoted 27 lines
Quoted 22 lines
Signed-off-by Rajendra Nayak <[email protected]>Signed-off-by Benoit Cousson <[email protected]>Cc Paul Walmsley <[email protected]>Signed-off-by Kevin Hilman <[email protected]>--- arch/arm/plat-omap/Makefile | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)arch/arm/plat-omap/Makefile +1
-1@@ -15,6 +15,7 @@ obj-$(CONFIG_ARCH_OMAP16XX) += ocpi.o # omap_device support (OMAP2+ only at the moment) obj-$(CONFIG_ARCH_OMAP2) += omap_device.o obj-$(CONFIG_ARCH_OMAP3) += omap_device.o +obj-$(CONFIG_ARCH_OMAP4) += omap_device.o obj-$(CONFIG_OMAP_MCBSP) += mcbsp.o obj-$(CONFIG_OMAP_IOMMU) += iommu.o iovmm.o --Quoted 2 lines
1.7.0.2
- Paul
Re: [PATCH 10/13] OMAP: omap_device: add flag to disable automatic bus-level suspend/resume
In reply to Paul WalmsleyQuoted 8 lines · Paul Walmsley
Hi Kevin,
A few comments:
Your "add runtime PM support at bus-level" series has a unstated dependency on this patch. If you fix one minor issue (below), it's probably easiest if you merge it with that other series to avoid cross-dependencies.
If I switch (back) to just using pm_runtime_* API in the system PM path _noirq methods, then rather than setting this flag at the omap_device level, drivers that want to prevent this can simply do a runtime_pm_get_sync() if they want to prevent a bus-level suspend.
Any thoughts/objectsion to that?
Kevin
Quoted 60 lines · Kevin Hilman
Quoted 19 lines
As part of the runtime PM support, bus-level code can automatically handle the enable/idle for each
omap_device. There are, however, some special cases where we don't want the bus-level layer to handle this, and instead handle it manually.Specific use cases are for
omap_devicesthat are controlled inside the idle path (like UART.)Signed-off-by Kevin Hilman <[email protected]>--- arch/arm/plat-omap/include/plat/omap_device.h | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-)arch/arm/plat-omap/include/plat/omap_device.h +0
-0arch/arm/plat-omap/include/plat/omap_device.h struct omap_device { · line 71
Quoted 4 lines
arch/arm/plat-omap/include/plat/omap_device.h +1
-0@@ -68,12 +68,16 @@ struct omap_device {struct omap_device_pm_latency *pm_lats;u32 dev_wakeup_lat;u32 _dev_wakeup_lat_limit; +u32 flags;This should be a u8. Fix that and it is
Acked-by Paul Walmsley <[email protected]>Quoted 28 lines
arch/arm/plat-omap/include/plat/omap_device.h +4
-0u8 pm_lats_cnt;s8 pm_lat_level;u8 hwmods_cnt;u8 _state; }; +/* flags for struct omap_device */ +#define OMAP_DEVICE_NO_BUS_SUSPEND BIT(0) +/* Device driver interface (call via platform_data fn ptrs) */ int omap_device_enable (struct platform_device *pdev);@@ -142,6 +146,7 @@ struct omap_device_pm_latency {u32 flags; }; +/* flags for struct omap_device_pm_latency */ #define OMAP_DEVICE_LATENCY_AUTO_ADJUST BIT(1)/* Get omap_device pointer from platform_device pointer */ Signature · 6 lines
1.7.0.2 -- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html- Paul
Re: [PATCH 02/13] OMAP: hwmod: allow idle after HWMOD_INIT_NO_IDLE
In reply to Paul WalmsleyQuoted 16 lines · Paul Walmsley
Hi Kevin,
something doesn't make sense in this patch...
Quoted 3 lines · Kevin Hilman
If an
omap_hwmodis setup usingHWMOD_INIT_NO_IDLEflag, there is currently way to idle it sinceomap_hwmod_idle()requires the hwmod to be in the enabled state.The only thing that
HWMOD_INIT_NO_IDLEdoes is prevent the hwmod from being idled at the end of_setup(). By that time, the hwmod has already been enabled, and its state has been set to_HWMOD_STATE_ENABLED. So there shouldn't be anything preventing the hwmod from being idled at that point?
Quoted 3 lines
Maybe the problem is that some hwmods were failing
_wait_target_ready()and so were never entering the ENABLED state? If so, that looks like it's fixed appropriately by your patch 3.
Hmm, strange.
Indeed, this patch predates patch 3, so may not be necessary anymore. I will check into it.
Kevin
Re: [PATCH 08/13] OMAP4: hwmod: Enable omap_device build for OMAP4
In reply to Nayak, RajendraQuoted 11 lines · Rajendra
Quoted 11 lines
-----Original Message-----
From: Paul Walmsley [mailto:[email protected]]
Sent: Thursday, June 24, 2010 12:11 AM
To: Nayak, Rajendra
Cc: Kevin Hilman; [email protected]; Cousson, Benoit
Subject: Re: [PATCH 08/13] OMAP4: hwmod: Enableomap_devicebuild for OMAP4Hi Rajendra
On Wed, 23 Jun 2010, Kevin Hilman wrote:
Quoted 7 lines
Quoted 5 lines
Quoted 2 lines
From: Rajendra Nayak <[email protected]>
Please add a brief patch changelog entry here. Maybe just say this is necessary for integration code using
omap_deviceto work on OMAP4?Yes, will do, not sure how that got missed.
Rajendra,
If you just reply here with the changelog entry, I will update it in this series.
This patch is needed in this series as the patch "OMAP: create omap_devices for MPU, DSP, L3" depends on it.
Thanks,
Kevin
Re: [PATCH 06/13] OMAP: hwmod: add non-locking versions of enable and idle functions
In reply to Paul WalmsleyQuoted 17 lines · Paul Walmsley
Hi Kevin
Quoted 8 lines · Kevin Hilman
Some hwmods may need to be idled/enabled in atomic context, so non-locking versions of these functions are required.
Most users should not need these and usage of theses should be controlled to understand why access is being done in atomic context. For this reason, the non-locking functions are only exposed at the hwmod level and not at the omap-device level.
Quoted 4 lines
The use-case that led to the need for the non-locking versions is hwmods that are enabled/idled from within the core idle/suspend path. Since interrupts are already disabled here, the mutex-based locking in hwmod can sleep and will cause potential deadlocks.
Quoted 4 lines
I accept the use-case. But maybe it would be preferable to rename
_enable(),_idle(),_shutdown()to _omap_hwmod_{enable,idle,shutdown}() ? That would avoid the need to add new functions that just call the existing ones.
OK, will make that change.
Kevin
Re: [PATCH 06/13] OMAP: hwmod: add non-locking versions of enable and idle functions
In reply to Basak, Partha"Basak, Partha" <[email protected]> writes:
[...]
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
/**
*omap_hwmod_idle- idle anomap_hwmod
* @oh: structomap_hwmod*arch/arm/mach-omap2/omap_hwmod.c +0
-0@@ -1319,9 +1345,7 @@ int omap_hwmod_idle(struct omap_hwmod *oh)if (!oh)return -EINVAL ;
Quoted 8 lines
Quoted 5 lines
arch/arm/mach-omap2/omap_hwmod.c int omap_hwmod_idle(struct omap_hwmod *oh) · line 1349
Quoted 5 lines
arch/arm/mach-omap2/omap_hwmod.c +1
-3-mutex_lock (&omap_hwmod_mutex); -_idle (oh); -mutex_unlock (&omap_hwmod_mutex); +__omap_hwmod_idle (oh);BTW: The mutex locks are missing. Typo?
Good catch Partha.
I wish I could explain that as only a typo. Unfortunately, it was just a "not paying close enough attention" mistake.
Thanks,
Kevin
Re: [PATCH 11/13] OMAP: create omap_devices for MPU, DSP, L3
In reply to Paul WalmsleyQuoted 10 lines · Paul Walmsley
Hi Kevin,
one other thought.
Quoted 4 lines · Paul Walmsley
Quoted 2 lines · Kevin Hilman
Create simple
omap_devicesfor the main processors and busses.
Quoted 7 lines
Quoted 2 lines
Quoted 2 lines
This is required to support the forth-coming device-based OPP approach, where OPPs are managed and tracked at the device level.
If these
omap_devicesare only to deal with OPPs, you might only need oneomap_devicefor the MPU subsystem for OMAP4, since I think both cores receive the same clock. That might simplify this patch for the current timeframe.
Agreed.
Again, I fall victim to my own last-minute changes. Up until yesterday I wasn't trying to deal with SMP, and decided to add it yesterday, clearly without a good (enough) understanding of the PER_CPU stuff for SMP.
Will re-spin without the SMP and multiple-devices-in-class support.
Kevin
Paul Walmsley
maintainerRe: [PATCH 10/13] OMAP: omap_device: add flag to disable automatic bus-level suspend/resume
In reply to Kevin HilmanQuoted 11 lines · Kevin Hilman
Quoted 8 lines · Paul Walmsley
Hi Kevin,
A few comments:
Your "add runtime PM support at bus-level" series has a unstated dependency on this patch. If you fix one minor issue (below), it's probably easiest if you merge it with that other series to avoid cross-dependencies.
Quoted 7 lines
If I switch (back) to just using pm_runtime_* API in the system PM path
_noirqmethods, then rather than setting this flag at theomap_devicelevel, drivers that want to prevent this can simply do aruntime_pm_get_sync()if they want to prevent a bus-level suspend.Any thoughts/objectsion to that?
Sounds fine to me.
- Paul
Re: [PATCH 10/13] OMAP: omap_device: add flag to disable automatic bus-level suspend/resume
Quoted 19 lines · Paul Walmsley
Quoted 17 lines · Kevin Hilman
Quoted 8 lines · Paul Walmsley
Hi Kevin,
A few comments:
Your "add runtime PM support at bus-level" series has a unstated dependency on this patch. If you fix one minor issue (below), it's probably easiest if you merge it with that other series to avoid cross-dependencies.
If I switch (back) to just using pm_runtime_* API in the system PM path
_noirqmethods, then rather than setting this flag at theomap_devicelevel, drivers that want to prevent this can simply do aruntime_pm_get_sync()if they want to prevent a bus-level suspend.
Quoted 3 lines
Quoted 1 line
Any thoughts/objectsion to that?
Sounds fine to me.
OK, good. Then I'll just drop this patch.
Thanks,
Kevin
Paul Walmsley
maintainerRe: [PATCH 12/13] OMAP: hwmod data: add class for DSP hwmods
In reply to Kevin HilmanHi Kevin,
Quoted 2 lines · Kevin Hilman
Add a new hwmod class for DSP devices. To be used when hwmods are created for DSP on OMAP3 (a.k.a. IVA2.)
I guess this patch is not needed any more? But if it is, it might be best to name the class "iva2" or something like that, since the IVA2 subsystem contains more than just the DSP; it also contains the dedicated hardware video accelerator blocks, which are separate from the DSP.
- Paul
Quoted 33 lines
Cc Paul Walmsley <[email protected]>Signed-off-by Kevin Hilman <[email protected]>--- arch/arm/mach-omap2/omap_hwmod_common_data.c | 3 +++ arch/arm/mach-omap2/omap_hwmod_common_data.h | 1 + 2 files changed, 4 insertions(+), 0 deletions(-)arch/arm/mach-omap2/omap_hwmod_common_data.c +3
-0@@ -66,3 +66,6 @@ struct omap_hwmod_class mpu_hwmod_class = { .name = "mpu" }; +struct omap_hwmod_class dsp_hwmod_class = { + .name ="dsp" +};arch/arm/mach-omap2/omap_hwmod_common_data.h +1
-0@@ -20,5 +20,6 @@extern struct omap_hwmod_class l3_hwmod_class;extern struct omap_hwmod_class l4_hwmod_class;extern struct omap_hwmod_class mpu_hwmod_class; +extern struct omap_hwmod_class dsp_hwmod_class;#endif Signature · 1 line
1.7.0.2
- Paul
RE: [PATCH 08/13] OMAP4: hwmod: Enable omap_device build for OMAP4
In reply to Kevin HilmanQuoted 29 lines
-----Original Message-----
From: Kevin Hilman [mailto:[email protected]]
Sent: Thursday, June 24, 2010 12:52 PM
To: Nayak, Rajendra
Cc: Paul Walmsley; [email protected]; Cousson, Benoit
Subject: Re: [PATCH 08/13] OMAP4: hwmod: Enableomap_devicebuild for OMAP4Quoted 6 lines · Rajendra
Quoted 6 lines
-----Original Message-----
From: Paul Walmsley [mailto:[email protected]]
Sent: Thursday, June 24, 2010 12:11 AM
To: Nayak, Rajendra
Cc: Kevin Hilman; [email protected]; Cousson, Benoit
Subject: Re: [PATCH 08/13] OMAP4: hwmod: Enableomap_devicebuild forOMAP4
Quoted 11 lines
Quoted 10 lines
Hi Rajendra
Quoted 2 lines · Kevin Hilman
From: Rajendra Nayak <[email protected]>
Please add a brief patch changelog entry here. Maybe just say this is necessary for integration code using
omap_deviceto work on OMAP4?
Quoted 6 lines
Quoted 1 line
Yes, will do, not sure how that got missed.
Rajendra,
If you just reply here with the changelog entry, I will update it in this series.
Ok, this one should do.
Enable omap_device layer support for OMAP4, so that drivers can use them to enable/idle/shutdown devices.
Quoted 7 lines
This patch is needed in this series as the patch "OMAP: create
omap_devicesfor MPU, DSP, L3" depends on it.Thanks,
Kevin
Re: [PATCH 12/13] OMAP: hwmod data: add class for DSP hwmods
In reply to Paul WalmsleyQuoted 11 lines · Paul Walmsley
Hi Kevin,
Quoted 2 lines · Kevin Hilman
Add a new hwmod class for DSP devices. To be used when hwmods are created for DSP on OMAP3 (a.k.a. IVA2.)
I guess this patch is not needed any more? But if it is, it might be best to name the class "iva2" or something like that, since the IVA2 subsystem contains more than just the DSP; it also contains the dedicated hardware video accelerator blocks, which are separate from the DSP.
Right, I'll be dropping this patch too as I'm just switching to use omap_hwmod_lookup() instead of the class iterators.
Kevin
Re: [PATCH 13/13] OMAP3: hwmod data: add data for OMAP3 IVA2
In reply to Kevin HilmanQuoted 4 lines · Kevin Hilman
Add hwmod data for DSP on OMAP3 (a.k.a. IVA2.)
Cc Paul Walmsley <[email protected]>Signed-off-by Kevin Hilman <[email protected]>
Also changing the name here from "dsp" to "iva2".
Kevin
Quoted 58 lines
--- arch/arm/mach-omap2/omap_hwmod_3xxx_data.c | 31 ++++++++++++++++++++++++++++ 1 files changed, 31 insertions(+), 0 deletions(-)arch/arm/mach-omap2/omap_hwmod_3xxx_data.c +31
-0@@ -32,6 +32,7 @@*/ static struct omap_hwmod omap3xxx_mpu_hwmod; +static struct omap_hwmod omap3xxx_iva2_hwmod;static struct omap_hwmod omap3xxx_l3_hwmod;static struct omap_hwmod omap3xxx_l4_core_hwmod;static struct omap_hwmod omap3xxx_l4_per_hwmod;@@ -168,12 +169,42 @@ static struct omap_hwmod omap3xxx_mpu_hwmod = { .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), }; +/* +* IVA2_2 interface data +*/ + +/* IVA2 <- L3 interface */ +static struct omap_hwmod_ocp_if omap3xxx_l3__iva2 = { + .master = &omap3xxx_l3_hwmod, + .slave = &omap3xxx_iva2_hwmod, + .clk ="iva2_ck" , + .user =OCP_USER_MPU |OCP_USER_SDMA , +}; + +static struct omap_hwmod_ocp_if *omap3xxx_iva2_masters[] = { + &omap3xxx_l3__iva2, +}; + +/* +* IVA2 (IVA2) +*/ + +static struct omap_hwmod omap3xxx_iva2_hwmod = { + .name ="dsp" , + .class = &dsp_hwmod_class, + .main_clk ="iva2_ck" , + .masters = omap3xxx_iva2_masters, + .masters_cnt =ARRAY_SIZE (omap3xxx_iva2_masters), + .omap_chip =OMAP_CHIP_INIT (CHIP_IS_OMAP3430 ) +}; +static __initdata struct omap_hwmod *omap3xxx_hwmods[] = { &omap3xxx_l3_hwmod, &omap3xxx_l4_core_hwmod, &omap3xxx_l4_per_hwmod, &omap3xxx_l4_wkup_hwmod, &omap3xxx_mpu_hwmod, + &omap3xxx_iva2_hwmod,NULL , };
Re: [PATCH 12/13] OMAP: hwmod data: add class for DSP hwmods
In reply to Kevin HilmanQuoted 9 lines · Kevin Hilman
Quoted 7 lines · Paul Walmsley
Hi Kevin,
Quoted 2 lines · Kevin Hilman
Add a new hwmod class for DSP devices. To be used when hwmods are created for DSP on OMAP3 (a.k.a. IVA2.)
Quoted 7 lines
Quoted 4 lines
I guess this patch is not needed any more? But if it is, it might be best to name the class "iva2" or something like that, since the IVA2 subsystem contains more than just the DSP; it also contains the dedicated hardware video accelerator blocks, which are separate from the DSP.
Right, I'll be dropping this patch too as I'm just switching to use
omap_hwmod_lookup()instead of the class iterators.
Turns out I need a class even when doing the omap_hwmod_lookup() as omap_hwmod_register() fails if there is no class or class name.
I'll keep this pach but s/dsp/iva2/
Kevin
Re: [PATCH 12/13] OMAP: hwmod data: add class for DSP hwmods
Quoted 16 lines · Kevin Hilman
Quoted 14 lines · Kevin Hilman
Quoted 11 lines · Paul Walmsley
Hi Kevin,
Quoted 2 lines · Kevin Hilman
Add a new hwmod class for DSP devices. To be used when hwmods are created for DSP on OMAP3 (a.k.a. IVA2.)
I guess this patch is not needed any more? But if it is, it might be best to name the class "iva2" or something like that, since the IVA2 subsystem contains more than just the DSP; it also contains the dedicated hardware video accelerator blocks, which are separate from the DSP.
Quoted 8 lines
Quoted 2 lines
Right, I'll be dropping this patch too as I'm just switching to use
omap_hwmod_lookup()instead of the class iterators.Turns out I need a class even when doing the
omap_hwmod_lookup()asomap_hwmod_register()fails if there is no class or class name.I'll keep this pach but s/dsp/iva2/
On second thought, I'll use "iva" to match how the naming was done for OMAP4.
Kevin
Re: [PATCH 13/13] OMAP3: hwmod data: add data for OMAP3 IVA2
In reply to Kevin HilmanQuoted 8 lines · Kevin Hilman
Quoted 4 lines · Kevin Hilman
Add hwmod data for DSP on OMAP3 (a.k.a. IVA2.)
Cc Paul Walmsley<[email protected]>Signed-off-by Kevin Hilman<[email protected]>Also changing the name here from "dsp" to "iva2".
You should just name it iva. The 2 is a version information. That's why we renamed as well ivahd -> iva in OMAP4.
In theory the dsp should be captured as a submodule of the iva in that case.
Benoit
Quoted 65 lines
Kevin
Quoted 48 lines
--- arch/arm/mach-omap2/omap_hwmod_3xxx_data.c | 31 ++++++++++++++++++++++++++++ 1 files changed, 31 insertions(+), 0 deletions(-)arch/arm/mach-omap2/omap_hwmod_3xxx_data.c +29
-0@@ -32,6 +32,7 @@*/ static struct omap_hwmod omap3xxx_mpu_hwmod; +static struct omap_hwmod omap3xxx_iva2_hwmod;static struct omap_hwmod omap3xxx_l3_hwmod;static struct omap_hwmod omap3xxx_l4_core_hwmod;static struct omap_hwmod omap3xxx_l4_per_hwmod;@@ -168,12 +169,42 @@ static struct omap_hwmod omap3xxx_mpu_hwmod = { .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), }; +/* +* IVA2_2 interface data +*/ + +/* IVA2<- L3 interface */ +static struct omap_hwmod_ocp_if omap3xxx_l3__iva2 = { + .master =&omap3xxx_l3_hwmod, + .slave =&omap3xxx_iva2_hwmod, + .clk ="iva2_ck" , + .user =OCP_USER_MPU |OCP_USER_SDMA , +}; + +static struct omap_hwmod_ocp_if *omap3xxx_iva2_masters[] = { + &omap3xxx_l3__iva2, +}; + +/* +* IVA2 (IVA2) +*/ + +static struct omap_hwmod omap3xxx_iva2_hwmod = { + .name ="dsp" , + .class =&dsp_hwmod_class, + .main_clk ="iva2_ck" , + .masters = omap3xxx_iva2_masters, + .masters_cnt =ARRAY_SIZE (omap3xxx_iva2_masters), + .omap_chip =OMAP_CHIP_INIT (CHIP_IS_OMAP3430 ) +};arch/arm/mach-omap2/omap_hwmod_3xxx_data.c static struct omap_hwmod omap3xxx_mpu_hwmod = { · line 209
Quoted 10 lines
arch/arm/mach-omap2/omap_hwmod_3xxx_data.c +2
-0+static __initdata struct omap_hwmod *omap3xxx_hwmods[] = { &omap3xxx_l3_hwmod, &omap3xxx_l4_core_hwmod, &omap3xxx_l4_per_hwmod, &omap3xxx_l4_wkup_hwmod, &omap3xxx_mpu_hwmod, + &omap3xxx_iva2_hwmod,NULL , };--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 08/13] OMAP4: hwmod: Enable omap_device build for OMAP4
In reply to Nayak, RajendraQuoted 31 lines · Rajendra
Quoted 31 lines
-----Original Message-----
From: Kevin Hilman [mailto:[email protected]]
Sent: Thursday, June 24, 2010 12:52 PM
To: Nayak, Rajendra
Cc: Paul Walmsley; [email protected]; Cousson, Benoit
Subject: Re: [PATCH 08/13] OMAP4: hwmod: Enableomap_devicebuild for OMAP4Quoted 6 lines · Rajendra
Quoted 6 lines
-----Original Message-----
From: Paul Walmsley [mailto:[email protected]]
Sent: Thursday, June 24, 2010 12:11 AM
To: Nayak, Rajendra
Cc: Kevin Hilman; [email protected]; Cousson, Benoit
Subject: Re: [PATCH 08/13] OMAP4: hwmod: Enableomap_devicebuild forOMAP4
Quoted 5 lines
Quoted 5 lines
Hi Rajendra
On Wed, 23 Jun 2010, Kevin Hilman wrote:
Quoted 7 lines
Quoted 5 lines
Quoted 2 lines
From: Rajendra Nayak <[email protected]>
Please add a brief patch changelog entry here. Maybe just say this is necessary for integration code using
omap_deviceto work on OMAP4?Yes, will do, not sure how that got missed.
Rajendra,
Quoted 8 lines
Quoted 2 lines
If you just reply here with the changelog entry, I will update it in this series.
Ok, this one should do.
Enable
omap_devicelayer support for OMAP4, so that drivers can use them to enable/idle/shutdown devices.
Thanks, will add for next spin of this series.
Thanks,
Kevin
Re: [PATCH 02/13] OMAP: hwmod: allow idle after HWMOD_INIT_NO_IDLE
In reply to Kevin HilmanQuoted 18 lines · Kevin Hilman
Quoted 16 lines · Paul Walmsley
Hi Kevin,
something doesn't make sense in this patch...
Quoted 3 lines · Kevin Hilman
If an
omap_hwmodis setup usingHWMOD_INIT_NO_IDLEflag, there is currently way to idle it sinceomap_hwmod_idle()requires the hwmod to be in the enabled state.The only thing that
HWMOD_INIT_NO_IDLEdoes is prevent the hwmod from being idled at the end of_setup(). By that time, the hwmod has already been enabled, and its state has been set to_HWMOD_STATE_ENABLED. So there shouldn't be anything preventing the hwmod from being idled at that point?
Quoted 9 lines
Quoted 3 lines
Maybe the problem is that some hwmods were failing
_wait_target_ready()and so were never entering the ENABLED state? If so, that looks like it's fixed appropriately by your patch 3.Hmm, strange.
Indeed, this patch predates patch 3, so may not be necessary anymore. I will check into it.
Just to update... this patch is no longer needed. Dropping from the series and an updated pm-hwmods branch has been pushed.
Kevin
Paul Walmsley
maintainerRe: [PATCH 07/13] OMAP: hwmod: don't auto-disable hwmod when !CONFIG_PM_RUNTIME
In reply to Kevin HilmanHi,
Quoted 9 lines · Kevin Hilman
When runtime PM is disabled, the
pm_runtime_idle()and_enable()functions will be effectively noops and will not result in enable and idle calls at the hwmod level.In order for drivers to still work when runtime PM is disabled, ensure that all hwmods are left in an enabled state so that even without runtime PM management, they will still work.
Signed-off-by Kevin Hilman <[email protected]>
I'd prefer to keep the hwmod code free of references to higher-layer code, so I'll use the following patch instead.
- Paul
OMAP: hwmod: allow omap_hwmod_late_init() caller to skip module idle in _setup()
From: Paul Walmsley <[email protected]>
On kernels that don't use the omap_device_enable() calls to enable devices, leave all on-chip devices enabled in hwmod _setup(). Otherwise, accesses to those devices are likely to fail, crashing the system. It's expected that kernels built without CONFIG_PM_RUNTIME will be the primary use-case for this. This functionality is controlled by adding an extra parameter to omap_hwmod_late_init().
This patch is based on the patch "OMAP: hwmod: don't auto-disable hwmod when !CONFIG_PM_RUNTIME" by Kevin Hilman <[email protected]>.
--- arch/arm/mach-omap2/io.c | 9 ++++++ arch/arm/mach-omap2/omap_hwmod.c | 37 ++++++++++++++++++-------- arch/arm/plat-omap/include/plat/omap_hwmod.h | 5 ++-- 3 files changed, 36 insertions(+), 15 deletions(-)
arch/arm/mach-omap2/io.c +8 -1
@@ -313,6 +313,8 @@ static int __init _omap2_init_reprogram_sdrc(void)void __init omap2_init_common_hw (struct omap_sdrc_params *sdrc_cs0,struct omap_sdrc_params *sdrc_cs1) { +u8 skip_setup_idle =0 ; +pwrdm_init (powerdomains_omap);clkdm_init (clockdomains_omap, clkdm_autodeps);if (cpu_is_omap242x ())
@@ -337,8 +339,13 @@ void __init omap2_init_common_hw(struct omap_sdrc_params *sdrc_cs0,pr_err ("Could not init clock framework - unknown CPU\n" );omap_serial_early_init (); + +#ifndef CONFIG_PM_RUNTIME + skip_setup_idle =1 ; +#endif if (cpu_is_omap24xx () ||cpu_is_omap34xx ())/* FIXME: OMAP4 */ -omap_hwmod_late_init (); +omap_hwmod_late_init (skip_setup_idle); +omap_pm_if_init ();if (cpu_is_omap24xx () ||cpu_is_omap34xx ()) {omap2_sdrc_init (sdrc_cs0, sdrc_cs1);
arch/arm/mach-omap2/omap_hwmod.c +25 -12
@@ -761,6 +761,7 @@ static struct omap_hwmod *_lookup(const char *name)/** * _init_clocks - clk_get() all clocks associated with this hwmod * @oh: struct omap_hwmod * +* @data: not used; pass NULL * * Called by omap_hwmod_late_init() (after omap2_clk_init()). * Resolves all clock names embedded in the hwmod. Must be called
@@ -768,7 +769,7 @@ static struct omap_hwmod *_lookup(const char *name)* has not yet been registered or if the clocks have already been * initialized, 0 on success, or a non-zero error on failure. */ -static int _init_clocks (struct omap_hwmod *oh) +static int _init_clocks (struct omap_hwmod *oh,void *data) {int ret =0 ;
@@ -993,19 +994,25 @@ static int _shutdown(struct omap_hwmod *oh)/** * _setup - do initial configuration of omap_hwmod * @oh: struct omap_hwmod * +* @skip_setup_idle_p: do not idle hwmods at the end of the fn if 1 * * Writes the CLOCKACTIVITY bits @clockact to the hwmod @oh -* OCP_SYSCONFIG register. Must be called with omap_hwmod_mutex -* held. Returns -EINVAL if the hwmod is in the wrong state or returns -* 0. +* OCP_SYSCONFIG register. Must be called with omap_hwmod_mutex held. +* @skip_setup_idle is intended to be used on a system that will not +* call omap_hwmod_enable() to enable devices (e.g., a system without +* PM runtime). Returns -EINVAL if the hwmod is in the wrong state or +* returns 0. */ -static int _setup (struct omap_hwmod *oh) +static int _setup (struct omap_hwmod *oh,void *data) {int i, r; +u8 skip_setup_idle; -if (!oh) +if (!oh || !data)return -EINVAL ; + skip_setup_idle = *(u8 *)data; +/* Set iclk autoidle mode */ if (oh->slaves_cnt >0 ) {for (i =0 ; i < oh->slaves_cnt; i++) {
@@ -1047,7 +1054,7 @@ static int _setup(struct omap_hwmod *oh) } } -if (!(oh->flags &HWMOD_INIT_NO_IDLE )) +if (!(oh->flags &HWMOD_INIT_NO_IDLE ) && !skip_setup_idle)_omap_hwmod_idle (oh);return 0 ;
@@ -1161,6 +1168,7 @@ struct omap_hwmod *omap_hwmod_lookup(const char *name)/** * omap_hwmod_for_each - call function for each registered omap_hwmod * @fn: pointer to a callback function +* @data: void * data to pass to callback function * * Call @fn for each registered omap_hwmod, passing @data to each * function. @fn must return 0 for success or any other value for
@@ -1169,7 +1177,8 @@ struct omap_hwmod *omap_hwmod_lookup(const char *name)* caller of omap_hwmod_for_each(). @fn is called with * omap_hwmod_for_each() held. */ -int omap_hwmod_for_each (int (*fn)(struct omap_hwmod *oh)) +int omap_hwmod_for_each (int (*fn)(struct omap_hwmod *oh,void *data), +void *data) {struct omap_hwmod *temp_oh;int ret;
@@ -1179,7 +1188,7 @@ int omap_hwmod_for_each(int (*fn)(struct omap_hwmod *oh))mutex_lock (&omap_hwmod_mutex);list_for_each_entry (temp_oh, &omap_hwmod_list, node) { - ret = (*fn)(temp_oh); + ret = (*fn)(temp_oh, data);if (ret)break ; }
@@ -1226,24 +1235,28 @@ int omap_hwmod_init(struct omap_hwmod **ohs)/** * omap_hwmod_late_init - do some post-clock framework initialization +* @skip_setup_idle: if 1, do not idle hwmods in _setup() * * Must be called after omap2_clk_init(). Resolves the struct clk names * to struct clk pointers for each registered omap_hwmod. Also calls * _setup() on each hwmod. Returns 0. */ -int omap_hwmod_late_init (void ) +int omap_hwmod_late_init (u8 skip_setup_idle) {int r;/* XXX check return value */ - r =omap_hwmod_for_each (_init_clocks); + r =omap_hwmod_for_each (_init_clocks,NULL );WARN (r,"omap_hwmod: omap_hwmod_late_init(): _init_clocks failed\n" ); mpu_oh =omap_hwmod_lookup (MPU_INITIATOR_NAME );WARN (!mpu_oh,"omap_hwmod: could not find MPU initiator hwmod %s\n" ,MPU_INITIATOR_NAME ); -omap_hwmod_for_each (_setup); +if (skip_setup_idle) +pr_debug ("omap_hwmod: will leave hwmods enabled during setup\n" ); + +omap_hwmod_for_each (_setup, &skip_setup_idle);return 0 ; }
arch/arm/plat-omap/include/plat/omap_hwmod.h +3 -2
@@ -482,8 +482,9 @@ int omap_hwmod_init(struct omap_hwmod **ohs);int omap_hwmod_register (struct omap_hwmod *oh);int omap_hwmod_unregister (struct omap_hwmod *oh);struct omap_hwmod *omap_hwmod_lookup (const char *name); -int omap_hwmod_for_each (int (*fn)(struct omap_hwmod *oh)); -int omap_hwmod_late_init (void ); +int omap_hwmod_for_each (int (*fn)(struct omap_hwmod *oh,void *data), +void *data); +int omap_hwmod_late_init (u8 skip_setup_idle);int omap_hwmod_enable (struct omap_hwmod *oh);int _omap_hwmod_enable (struct omap_hwmod *oh);
Paul Walmsley
maintainerRe: [PATCH 09/13] OMAP: omap_device: ensure hwmod tracks attached omap_device pointer
In reply to Kevin HilmanHi,
Quoted 6 lines · Kevin Hilman
The
omap_hwmodstruct has a field to track theomap_devicethat is attached to it, but it was not being assigned. Fix by assigningomap_devicepointer whenomap_deviceis built.Cc Paul Walmsley <[email protected]>Signed-off-by Kevin Hilman <[email protected]>
This patch has been modified to use array indexing rather than pointer arithmetic; I think it is easier to read and debug; revised patch below.
- Paul
OMAP: omap_device: ensure hwmod tracks attached omap_device pointer
From: Kevin Hilman <[email protected]>
The omap_hwmod struct has a field to track the omap_device that is attached to it, but it was not being assigned. Fix by assigning omap_device pointer when omap_device is built.
--- arch/arm/plat-omap/omap_device.c | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-)
arch/arm/plat-omap/omap_device.c +4 -1
@@ -359,7 +359,7 @@ struct omap_device *omap_device_build_ss(const char *pdev_name, int pdev_id,struct omap_device *od;char *pdev_name2;struct resource *res =NULL ; -int res_count; +int i, res_count;struct omap_hwmod **hwmods;if (!ohs || oh_cnt ==0 || !pdev_name)
@@ -416,6 +416,9 @@ struct omap_device *omap_device_build_ss(const char *pdev_name, int pdev_id,else ret =omap_device_register (od); +for (i =0 ; i < oh_cnt; i++) + hwmods[i]->od = od; +if (ret) goto odbs_exit4;
Paul Walmsley
maintainerRe: [PATCH 08/13] OMAP4: hwmod: Enable omap_device build for OMAP4
In reply to Kevin HilmanHi,
Quoted 6 lines · Kevin Hilman
From: Rajendra Nayak <[email protected]>
Signed-off-by Rajendra Nayak <[email protected]>Signed-off-by Benoit Cousson <[email protected]>Cc Paul Walmsley <[email protected]>Signed-off-by Kevin Hilman <[email protected]>
This patch has been updated to include Benoît's compile fix; revised patch below.
- Paul
OMAP4: hwmod: Enable omap_device build for OMAP4
From: Rajendra Nayak <[email protected]>
Enable omap_device layer support for OMAP4, so that drivers can use them to enable/idle/shutdown devices.
--- arch/arm/mach-omap2/Makefile | 2 +- arch/arm/plat-omap/Makefile | 1 + 2 files changed, 2 insertions(+), 1 deletions(-)
arch/arm/mach-omap2/Makefile +1 -1
@@ -15,7 +15,7 @@ clock-common = clock.o clock_common_data.o \ obj-$(CONFIG_ARCH_OMAP2) += $(omap-2-3-common) $(prcm-common) $(hwmod-common) obj-$(CONFIG_ARCH_OMAP3) += $(omap-2-3-common) $(prcm-common) $(hwmod-common) -obj-$(CONFIG_ARCH_OMAP4) += $(prcm-common) +obj-$(CONFIG_ARCH_OMAP4) += $(prcm-common) $(hwmod-common) obj-$(CONFIG_OMAP_MCBSP) += mcbsp.o
arch/arm/plat-omap/Makefile +1 -0
@@ -15,6 +15,7 @@ obj-$(CONFIG_ARCH_OMAP16XX) += ocpi.o # omap_device support (OMAP2+ only at the moment) obj-$(CONFIG_ARCH_OMAP2) += omap_device.o obj-$(CONFIG_ARCH_OMAP3) += omap_device.o +obj-$(CONFIG_ARCH_OMAP4) += omap_device.o obj-$(CONFIG_OMAP_MCBSP) += mcbsp.o obj-$(CONFIG_OMAP_IOMMU) += iommu.o iovmm.o
Paul Walmsley
maintainerRe: [PATCH 05/13] OMAP2&3: hwmod: Remove _hwmod prefix in name string
In reply to Kevin HilmanHi,
Quoted 11 lines · Kevin Hilman
From: Benoit Cousson <[email protected]>
In the lastest OMAP4 hwmod data file, the
_hwmodwas removed in order to save some memory space and because it does not bring a lot.
Align OMAP2420, 2430 and 3430 data files with the same convention.Signed-off-by Benoit Cousson <[email protected]>Cc Paul Walmsley <[email protected]>Cc Rajendra Nayak <[email protected]>Signed-off-by Kevin Hilman <[email protected]>
I've taken Benoît's original patch for this, so have converted your
Signed-off-by: into an Acked-by: for this patch.
- Paul