Skip to contentSkip to conversation

dspbridge-pm patches

PATCH In review Omar Ramirez Luna 2 participants 10 messages Jan 16, 2010 – Jan 18, 2010

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

cover dspbridge-pm patches

This set of patches is required to compile dspbridge branch against pm branch.

Current set fixes:
- compilation issues due to header migration from mach to plat.
- Bridge DVFS migration to cpufreq_register_notifier.
- Fix initializaton of platform data DVFS functions because of EXPORT_SYMBOL removal.

dspbridge-pm is currently based on pm-2.6.32.

Fernando Guzman Lugo (1):
DSPBRIDGE: change to cpufreq_register_notifier for OPP changes

Omar Ramirez Luna (2):
DSPBRIDGE: Fix header locations mach to plat
DSPBRIDGE: Use dspbridge to initialize platform data

 arch/arm/mach-omap2/Makefile                   |    4 ++-
 arch/arm/mach-omap2/dspbridge.c                |    2 +-
 arch/arm/plat-omap/include/dspbridge/host_os.h |    2 +-
 drivers/dsp/bridge/Kconfig                     |    2 +-
 drivers/dsp/bridge/rmgr/drv_interface.c        |   25 ++++++++++++++---------
 drivers/dsp/bridge/wmd/tiomap3430.c            |    2 +-
 6 files changed, 22 insertions(+), 15 deletions(-)
#1 lore raw

PATCH 1/3 DSPBRIDGE: Fix header locations mach to plat

Fix header locations, replaced mach to plat

---
 arch/arm/mach-omap2/dspbridge.c                |    2 +-
 arch/arm/plat-omap/include/dspbridge/host_os.h |    2 +-
 drivers/dsp/bridge/wmd/tiomap3430.c            |    2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
arch/arm/mach-omap2/dspbridge.c +1 -1
index ea109a3..4150896 100644
@@ -14,7 +14,7 @@
 #include <linux/platform_device.h>
 
 #ifdef CONFIG_BRIDGE_DVFS
-#include <mach/omap-pm.h>
+#include <plat/omap-pm.h>
 #endif
 
 #include <dspbridge/host_os.h>
arch/arm/plat-omap/include/dspbridge/host_os.h +1 -1
index 6fe1462..74cf6d4 100644
@@ -54,7 +54,7 @@
 #include <linux/ioport.h>
 #include <linux/platform_device.h>
 #include <dspbridge/dbtype.h>
-#include <mach/clock.h>
+#include <plat/clock.h>
 #include <linux/clk.h>
 #include <linux/pagemap.h>
 #include <asm/cacheflush.h>
drivers/dsp/bridge/wmd/tiomap3430.c +1 -1
index 7138396..b123707 100644
@@ -34,7 +34,7 @@
 #include <mach-omap2/cm.h>
 #include <mach-omap2/prm-regbits-34xx.h>
 #include <mach-omap2/cm-regbits-34xx.h>
-#include <mach/control.h>
+#include <plat/control.h>
 
 /*  ----------------------------------- DSP/BIOS Bridge */
 #include <dspbridge/std.h>
Signature · 1 line
1.6.2.4
#2 lore raw

PATCH 2/3 DSPBRIDGE: change to cpufreq_register_notifier for OPP changes

From: Fernando Guzman Lugo <[email protected]>

This patch changes clk_notifier_unregister with cpufreq_unregister_notifier, which is used for OPP change notifications

---
 drivers/dsp/bridge/Kconfig              |    2 +-
 drivers/dsp/bridge/rmgr/drv_interface.c |   25 +++++++++++++++----------
 2 files changed, 16 insertions(+), 11 deletions(-)
drivers/dsp/bridge/Kconfig +1 -1
index e494f02..ea639e3 100644
@@ -13,7 +13,7 @@ menuconfig MPU_BRIDGE
 
 config BRIDGE_DVFS
 	bool "Enable Bridge Dynamic Voltage and Frequency Scaling (DVFS)"
-	depends on MPU_BRIDGE && OMAP_PM_SRF
+	depends on MPU_BRIDGE && OMAP_PM_SRF && CPU_FREQ
 	default n
 	help
 	  DVFS allows DSP Bridge to initiate the operating point change to
drivers/dsp/bridge/rmgr/drv_interface.c +15 -10
index 8fce70c..19682b5 100644
@@ -236,15 +236,18 @@ u32 vdd1_dsp_freq[6][4] = {
 };
 
 #ifdef CONFIG_BRIDGE_DVFS
-static int dspbridge_post_scale(struct notifier_block *op, unsigned long level,
-				void *ptr)
+static int dspbridge_scale_notification(struct notifier_block *op,
+		unsigned long val, void *ptr)
 {
-	PWR_PM_PostScale(PRCM_VDD1, level);
+	struct dspbridge_platform_data *pdata =
+					omap_dspbridge_dev->dev.platform_data;
+	if (CPUFREQ_POSTCHANGE == val && pdata->dsp_get_opp)
+		PWR_PM_PostScale(PRCM_VDD1, pdata->dsp_get_opp());
 	return 0;
 }
 
 static struct notifier_block iva_clk_notifier = {
-	.notifier_call = dspbridge_post_scale,
+	.notifier_call = dspbridge_scale_notification,
 	NULL,
 };
 #endif
@@ -380,12 +383,13 @@ static int __devinit omap34xx_bridge_probe(struct platform_device *pdev)
 			GT_0trace(driverTrace, GT_7CLASS,
 			"clk_get PASS to get iva2_ck \n");
 		}
-		if (!clk_notifier_register(clk_handle, &iva_clk_notifier)) {
+		if (!cpufreq_register_notifier(&iva_clk_notifier,
+						CPUFREQ_TRANSITION_NOTIFIER)) {
 			GT_0trace(driverTrace, GT_7CLASS,
-			"clk_notifier_register PASS for iva2_ck \n");
+				"cpufreq_register_notifier PASS for iva2_ck\n");
 		} else {
 			GT_0trace(driverTrace, GT_7CLASS,
-			"clk_notifier_register FAIL for iva2_ck \n");
+				"cpufreq_register_notifier FAIL for iva2_ck\n");
 		}
 #endif
 		driverContext = DSP_Init(&initStatus);
@@ -429,12 +433,13 @@ static int __devexit omap34xx_bridge_remove(struct platform_device *pdev)
 		goto func_cont;
 
 #ifdef CONFIG_BRIDGE_DVFS
-	if (!clk_notifier_unregister(clk_handle, &iva_clk_notifier)) {
+	if (!cpufreq_unregister_notifier(&iva_clk_notifier,
+						CPUFREQ_TRANSITION_NOTIFIER)) {
 		GT_0trace(driverTrace, GT_7CLASS,
-		"clk_notifier_unregister PASS for iva2_ck \n");
+			"cpufreq_unregister_notifier PASS for iva2_ck\n");
 	} else {
 		GT_0trace(driverTrace, GT_7CLASS,
-		"clk_notifier_unregister FAILED for iva2_ck \n");
+			"cpufreq_unregister_notifier FAILED for iva2_ck\n");
 	}
 #endif /* #ifdef CONFIG_BRIDGE_DVFS */
 
Signature · 1 line
1.6.2.4
#3 lore raw

PATCH 3/3 DSPBRIDGE: Use dspbridge to initialize platform data

Include dspbridge compilation whenever bridge driver is selected to be compiled, either as a module or part of the kernel. This will initialize platform data specific PM functions.

---
 arch/arm/mach-omap2/Makefile |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
arch/arm/mach-omap2/Makefile +3 -1
index a37c713..1693c03 100644
@@ -57,7 +57,9 @@ obj-$(CONFIG_OMAP_IOMMU)		+= $(iommu-y)
 # Debobs
 obj-$(CONFIG_OMAP3_DEBOBS)	+= debobs.o
 
-obj-$(CONFIG_MPU_BRIDGE)		+= dspbridge.o
+ifneq ($(CONFIG_MPU_BRIDGE),)
+obj-y					+= dspbridge.o
+endif
 
 # Specific board support
 obj-$(CONFIG_MACH_OMAP_GENERIC)		+= board-generic.o
Signature · 1 line
1.6.2.4
Acked-by on v1 3/3
#4 lore raw

Re: [PATCH 3/3] DSPBRIDGE: Use dspbridge to initialize platform data

Quoted 14 lines · ext Omar Ramirez Luna

Include dspbridge compilation whenever bridge driver is selected to be compiled, either as a module or part of the kernel. This will initialize platform data specific PM functions.

---
 arch/arm/mach-omap2/Makefile |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
arch/arm/mach-omap2/Makefile +0 -0
index a37c713..1693c03 100644

arch/arm/mach-omap2/Makefile obj-$(CONFIG_OMAP_IOMMU) += $(iommu-y) · line 65

Quoted 10 lines
arch/arm/mach-omap2/Makefile +3 -1
@@ -57,7 +57,9 @@ obj-$(CONFIG_OMAP_IOMMU)		+= $(iommu-y)
 # Debobs
 obj-$(CONFIG_OMAP3_DEBOBS)	+= debobs.o
 
-obj-$(CONFIG_MPU_BRIDGE)		+= dspbridge.o
+ifneq ($(CONFIG_MPU_BRIDGE),)
+obj-y					+= dspbridge.o
+endif
 
 # Specific board support
 obj-$(CONFIG_MACH_OMAP_GENERIC)		+= board-generic.o
author Applied
#5 lore raw

RE: [PATCH 3/3] DSPBRIDGE: Use dspbridge to initialize platform data

Quoted 12 lines

From: Ameya Palande on Monday, January 18, 2010 4:32 AM

Quoted 9 lines · ext Omar Ramirez Luna

Include dspbridge compilation whenever bridge driver is selected to be compiled, either as a module or part of the kernel. This will initialize platform data specific PM functions.

---
 arch/arm/mach-omap2/Makefile |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

[snip]

Quoted 2 lines

Pushed to dspbridge-pm

- omar

Acked-by on v1 2/3
#6 lore raw

Re: [PATCH 2/3] DSPBRIDGE: change to cpufreq_register_notifier for OPP changes

In reply to Omar Ramirez Luna
Quoted 76 lines · ext Omar Ramirez Luna

From: Fernando Guzman Lugo <[email protected]>

This patch changes clk_notifier_unregister with cpufreq_unregister_notifier, which is used for OPP change notifications

---
 drivers/dsp/bridge/Kconfig              |    2 +-
 drivers/dsp/bridge/rmgr/drv_interface.c |   25 +++++++++++++++----------
 2 files changed, 16 insertions(+), 11 deletions(-)
drivers/dsp/bridge/Kconfig +1 -1
index e494f02..ea639e3 100644
@@ -13,7 +13,7 @@ menuconfig MPU_BRIDGE
 
 config BRIDGE_DVFS
 	bool "Enable Bridge Dynamic Voltage and Frequency Scaling (DVFS)"
-	depends on MPU_BRIDGE && OMAP_PM_SRF
+	depends on MPU_BRIDGE && OMAP_PM_SRF && CPU_FREQ
 	default n
 	help
 	  DVFS allows DSP Bridge to initiate the operating point change to
drivers/dsp/bridge/rmgr/drv_interface.c +13 -8
index 8fce70c..19682b5 100644
@@ -236,15 +236,18 @@ u32 vdd1_dsp_freq[6][4] = {
 };
 
 #ifdef CONFIG_BRIDGE_DVFS
-static int dspbridge_post_scale(struct notifier_block *op, unsigned long level,
-				void *ptr)
+static int dspbridge_scale_notification(struct notifier_block *op,
+		unsigned long val, void *ptr)
 {
-	PWR_PM_PostScale(PRCM_VDD1, level);
+	struct dspbridge_platform_data *pdata =
+					omap_dspbridge_dev->dev.platform_data;
+	if (CPUFREQ_POSTCHANGE == val && pdata->dsp_get_opp)
+		PWR_PM_PostScale(PRCM_VDD1, pdata->dsp_get_opp());
 	return 0;
 }
 
 static struct notifier_block iva_clk_notifier = {
-	.notifier_call = dspbridge_post_scale,
+	.notifier_call = dspbridge_scale_notification,
 	NULL,
 };
 #endif
@@ -380,12 +383,13 @@ static int __devinit omap34xx_bridge_probe(struct platform_device *pdev)
 			GT_0trace(driverTrace, GT_7CLASS,
 			"clk_get PASS to get iva2_ck \n");
 		}
-		if (!clk_notifier_register(clk_handle, &iva_clk_notifier)) {
+		if (!cpufreq_register_notifier(&iva_clk_notifier,
+						CPUFREQ_TRANSITION_NOTIFIER)) {
 			GT_0trace(driverTrace, GT_7CLASS,
-			"clk_notifier_register PASS for iva2_ck \n");
+				"cpufreq_register_notifier PASS for iva2_ck\n");
 		} else {
 			GT_0trace(driverTrace, GT_7CLASS,
-			"clk_notifier_register FAIL for iva2_ck \n");
+				"cpufreq_register_notifier FAIL for iva2_ck\n");
 		}
 #endif
 		driverContext = DSP_Init(&initStatus);
@@ -429,12 +433,13 @@ static int __devexit omap34xx_bridge_remove(struct platform_device *pdev)
 		goto func_cont;
 
 #ifdef CONFIG_BRIDGE_DVFS
-	if (!clk_notifier_unregister(clk_handle, &iva_clk_notifier)) {
+	if (!cpufreq_unregister_notifier(&iva_clk_notifier,
+						CPUFREQ_TRANSITION_NOTIFIER)) {

drivers/dsp/bridge/rmgr/drv_interface.c static int __devexit omap34xx_bridge_remove(struct platform_device *pdev) · line 445

Quoted 10 lines
drivers/dsp/bridge/rmgr/drv_interface.c +2 -2
 		GT_0trace(driverTrace, GT_7CLASS,
-		"clk_notifier_unregister PASS for iva2_ck \n");
+			"cpufreq_unregister_notifier PASS for iva2_ck\n");
 	} else {
 		GT_0trace(driverTrace, GT_7CLASS,
-		"clk_notifier_unregister FAILED for iva2_ck \n");
+			"cpufreq_unregister_notifier FAILED for iva2_ck\n");
 	}
 #endif /* #ifdef CONFIG_BRIDGE_DVFS */
 
author Applied
#7 lore raw

RE: [PATCH 2/3] DSPBRIDGE: change to cpufreq_register_notifier for OPP changes

Quoted 15 lines

From: Ameya Palande on Monday, January 18, 2010 4:20 AM

Quoted 12 lines · ext Omar Ramirez Luna

From: Fernando Guzman Lugo <[email protected]>

This patch changes clk_notifier_unregister with cpufreq_unregister_notifier, which is used for OPP change notifications

---
 drivers/dsp/bridge/Kconfig              |    2 +-
 drivers/dsp/bridge/rmgr/drv_interface.c |   25 +++++++++++++++----------
 2 files changed, 16 insertions(+), 11 deletions(-)

[snip]

Quoted 1 line

Pushed to dspbridge-pm

- omar

Acked-by on v1 1/3
#8 lore raw

Re: [PATCH 1/3] DSPBRIDGE: Fix header locations mach to plat

In reply to Omar Ramirez Luna
Quoted 40 lines · ext Omar Ramirez Luna

Fix header locations, replaced mach to plat

---
 arch/arm/mach-omap2/dspbridge.c                |    2 +-
 arch/arm/plat-omap/include/dspbridge/host_os.h |    2 +-
 drivers/dsp/bridge/wmd/tiomap3430.c            |    2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
arch/arm/mach-omap2/dspbridge.c +1 -1
index ea109a3..4150896 100644
@@ -14,7 +14,7 @@
 #include <linux/platform_device.h>
 
 #ifdef CONFIG_BRIDGE_DVFS
-#include <mach/omap-pm.h>
+#include <plat/omap-pm.h>
 #endif
 
 #include <dspbridge/host_os.h>
arch/arm/plat-omap/include/dspbridge/host_os.h +1 -1
index 6fe1462..74cf6d4 100644
@@ -54,7 +54,7 @@
 #include <linux/ioport.h>
 #include <linux/platform_device.h>
 #include <dspbridge/dbtype.h>
-#include <mach/clock.h>
+#include <plat/clock.h>
 #include <linux/clk.h>
 #include <linux/pagemap.h>
 #include <asm/cacheflush.h>
drivers/dsp/bridge/wmd/tiomap3430.c +0 -0
index 7138396..b123707 100644

drivers/dsp/bridge/wmd/tiomap3430.c line 40

Quoted 8 lines
drivers/dsp/bridge/wmd/tiomap3430.c +1 -1
@@ -34,7 +34,7 @@
 #include <mach-omap2/cm.h>
 #include <mach-omap2/prm-regbits-34xx.h>
 #include <mach-omap2/cm-regbits-34xx.h>
-#include <mach/control.h>
+#include <plat/control.h>
 
 /*  ----------------------------------- DSP/BIOS Bridge */
 #include <dspbridge/std.h>
author Applied
#9 lore raw

RE: [PATCH 1/3] DSPBRIDGE: Fix header locations mach to plat

Quoted 12 lines

From: Ameya Palande on Monday, January 18, 2010 3:55 AM

Quoted 9 lines · ext Omar Ramirez Luna

Fix header locations, replaced mach to plat

---
 arch/arm/mach-omap2/dspbridge.c                |    2 +-
 arch/arm/plat-omap/include/dspbridge/host_os.h |    2 +-
 drivers/dsp/bridge/wmd/tiomap3430.c            |    2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

[snip]

Quoted 1 line

Pushed to dspbridge-pm

- omar