Skip to contentSkip to conversation

OMAP: pm-next: few more PM updates for 2.6.37

PATCH New Kevin Hilman 1 participant 4 messages Sep 23, 2010

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

cover OMAP: pm-next: few more PM updates for 2.6.37

Here area few more PM updates targetted for 2.6.37.

These are added to the pm-next brach available here:

git://git.kernel.org/pub/scm/linux/kernel/git/khilman/linux-omap-pm.git pm-next

Benoit Cousson (2):
OMAP4: hwmod: Add initial data for OMAP4430 ES1 & ES2
OMAP4: pm: Change l3_main to l3_main_1 during bus device init

Kevin Hilman (1):
OMAP: GPIO: ensure debounce clocks are disabled during idle/suspend

 arch/arm/mach-omap2/Makefile                 |    1 +
 arch/arm/mach-omap2/io.c                     |    7 +-
 arch/arm/mach-omap2/omap_hwmod_44xx_data.c   |  482 ++++++++++++++++++++++++++
 arch/arm/mach-omap2/pm.c                     |    7 +-
 arch/arm/plat-omap/Makefile                  |    2 +-
 arch/arm/plat-omap/gpio.c                    |    6 +-
 arch/arm/plat-omap/include/plat/omap_hwmod.h |    1 +
 7 files changed, 498 insertions(+), 8 deletions(-)
 create mode 100644 arch/arm/mach-omap2/omap_hwmod_44xx_data.c
Signature · 1 line
1.7.2.1
#1 lore raw

PATCH 1/3 OMAP4: hwmod: Add initial data for OMAP4430 ES1 & ES2

From: Benoit Cousson <[email protected]>

The current version contains only the interconnects and the mpu hwmods.
The remaining hwmods will be introduced by further patches on top of this one.

- enable as well omap_hwmod.c build for OMAP4 Soc

Please not that this file uses the new naming convention for naming HW IPs. This convention will be backported soon for previous OMAP2 & 3 data files.

new name        trm name
-------------   -------------------
counter_32k     synctimer_32k
l3_main         l3
timerX          gptimerX / dmtimerX
mmcX            mmchsX / sdmmcX
dma_system      sdma
smartreflex_X   sr_X / sr?
usb_host_fs     usbfshost
usb_otg_hs      hsusbotg
usb_tll_hs      usbtllhs_config
wd_timerX       wdtimerX
ipu             cortexm3 / ducati
dsp             c6x / tesla
iva             ivahd / iva2.2
kbd             kbdocp / keyboard
mailbox         system_mailbox
mpu             cortexa9 / chiron
Cc Paul Walmsley <[email protected]>
Cc Kevin Hilman <[email protected]>
Cc Rajendra Nayak <[email protected]>
---
 arch/arm/mach-omap2/Makefile                 |    1 +
 arch/arm/mach-omap2/io.c                     |    7 +-
 arch/arm/mach-omap2/omap_hwmod_44xx_data.c   |  482 ++++++++++++++++++++++++++
 arch/arm/plat-omap/Makefile                  |    2 +-
 arch/arm/plat-omap/include/plat/omap_hwmod.h |    1 +
 5 files changed, 489 insertions(+), 4 deletions(-)
 create mode 100644 arch/arm/mach-omap2/omap_hwmod_44xx_data.c
arch/arm/mach-omap2/Makefile +1 -0
index 88d3a1e..29d40b2 100644
@@ -87,6 +87,7 @@ obj-$(CONFIG_ARCH_OMAP2430)		+= opp2430_data.o
 obj-$(CONFIG_ARCH_OMAP2420)		+= omap_hwmod_2420_data.o
 obj-$(CONFIG_ARCH_OMAP2430)		+= omap_hwmod_2430_data.o
 obj-$(CONFIG_ARCH_OMAP3)		+= omap_hwmod_3xxx_data.o
+obj-$(CONFIG_ARCH_OMAP4)		+= omap_hwmod_44xx_data.o
 
 # EMU peripherals
 obj-$(CONFIG_OMAP3_EMU)			+= emu.o
arch/arm/mach-omap2/io.c +4 -3
index b9ea70b..490d870 100644
@@ -323,6 +323,9 @@ void __init omap2_init_common_hw(struct omap_sdrc_params *sdrc_cs0,
 		omap2430_hwmod_init();
 	else if (cpu_is_omap34xx())
 		omap3xxx_hwmod_init();
+	else if (cpu_is_omap44xx())
+		omap44xx_hwmod_init();
+
 	/* The OPP tables have to be registered before a clk init */
 	omap_pm_if_early_init(mpu_opps, dsp_opps, l3_opps);
 
@@ -342,9 +345,7 @@ void __init omap2_init_common_hw(struct omap_sdrc_params *sdrc_cs0,
 #ifndef CONFIG_PM_RUNTIME
 	skip_setup_idle = 1;
 #endif
-	if (cpu_is_omap24xx() || cpu_is_omap34xx())   /* FIXME: OMAP4 */
-		omap_hwmod_late_init(skip_setup_idle);
-
+	omap_hwmod_late_init(skip_setup_idle);
 	if (cpu_is_omap24xx() || cpu_is_omap34xx()) {
 		omap2_sdrc_init(sdrc_cs0, sdrc_cs1);
 		_omap2_init_reprogram_sdrc();
arch/arm/mach-omap2/omap_hwmod_44xx_data.c new file +482 -0

482 lines not on this page · raw message

arch/arm/plat-omap/Makefile +1 -1
index 9405831..2a15191 100644
@@ -31,4 +31,4 @@ obj-y += $(i2c-omap-m) $(i2c-omap-y)
 # OMAP mailbox framework
 obj-$(CONFIG_OMAP_MBOX_FWK) += mailbox.o
 
-obj-$(CONFIG_OMAP_PM_NOOP) += omap-pm-noop.o
\ No newline at end of file
+obj-$(CONFIG_OMAP_PM_NOOP) += omap-pm-noop.o
arch/arm/plat-omap/include/plat/omap_hwmod.h +1 -0
index a4e508d..cab4a68 100644
@@ -534,5 +534,6 @@ int omap_hwmod_for_each_by_class(const char *classname,
 extern int omap2420_hwmod_init(void);
 extern int omap2430_hwmod_init(void);
 extern int omap3xxx_hwmod_init(void);
+extern int omap44xx_hwmod_init(void);
 
 #endif
Signature · 1 line
1.7.2.1
#2 lore raw

PATCH 2/3 OMAP4: pm: Change l3_main to l3_main_1 during bus device init

In reply to Kevin Hilman

From: Benoit Cousson <[email protected]>

The OMAP4 L3 interconnect is split in 3 part for power saving reason. Because of that there is no l3_main like on OMAP2 & 3 but 3 differentes l3_main_X instances.

In the case of OMAP4, query only the l3_main_1 part. The clock and voltage are shared across the 3 instances.

---
 arch/arm/mach-omap2/pm.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)
arch/arm/mach-omap2/pm.c +5 -2
index 4477d5d..59ca03b 100644
@@ -81,9 +81,12 @@ static void omap2_init_processor_devices(void)
 {
 	_init_omap_device("mpu", &mpu_dev);
 	_init_omap_device("iva", &iva_dev);
-	if (cpu_is_omap44xx())
+	if (cpu_is_omap44xx()) {
+		_init_omap_device("l3_main_1", &l3_dev);
 		_init_omap_device("dsp", &dsp_dev);
-	_init_omap_device("l3_main", &l3_dev);
+	} else {
+		_init_omap_device("l3_main", &l3_dev);
+	}
 }
 
 /*
Signature · 1 line
1.7.2.1
#3 lore raw

PATCH 3/3 OMAP: GPIO: ensure debounce clocks are disabled during idle/suspend

In reply to Kevin Hilman

If a GPIO bank has more than one GPIO with debounce enabled, the debounce clock will not be fully disabled before going to idle/suspend.

In the idle path, we just do a single clk_disable() of the bank's debounce clock. If there are multiple debounce-enabled GPIOs in the bank, that clocks usage count will be > 1, so the clk_disable() will not actually disable the clock.

So the fix is to clk_disable() for every debounce-enabled GPIO in the bank (and an equivalent clk_enable() of course.)

---
 arch/arm/plat-omap/gpio.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
arch/arm/plat-omap/gpio.c +4 -2
index 7951eef..11c5b0e 100644
@@ -2085,8 +2085,9 @@ void omap2_gpio_prepare_for_idle(int power_state)
 	for (i = min; i < gpio_bank_count; i++) {
 		struct gpio_bank *bank = &gpio_bank[i];
 		u32 l1, l2;
+		int j;
 
-		if (bank->dbck_enable_mask)
+		for (j = 0; j < hweight_long(bank->dbck_enable_mask); j++)
 			clk_disable(bank->dbck);
 
 		if (power_state > PWRDM_POWER_OFF)
@@ -2152,8 +2153,9 @@ void omap2_gpio_resume_after_idle(void)
 	for (i = min; i < gpio_bank_count; i++) {
 		struct gpio_bank *bank = &gpio_bank[i];
 		u32 l, gen, gen0, gen1;
+		int j;
 
-		if (bank->dbck_enable_mask)
+		for (j = 0; j < hweight_long(bank->dbck_enable_mask); j++)
 			clk_enable(bank->dbck);
 
 		if (!workaround_enabled)
Signature · 1 line
1.7.2.1