[PATCH 1/9] PM: Add debug commands for units clocks gating

Brad Figg brad.figg at canonical.com
Wed Aug 19 03:44:06 UTC 2009


From: Tawfik Bayouk <tawfik at marvell.com>

Signed-off-by: Tawfik Bayouk <tawfik at marvell.com>
Signed-off-by: Saeed Bishara <saeed at marvell.com>
Signed-off-by: Brad Figg <brad.figg at canonical.com>
---
 arch/arm/mach-dove/pm.c |   34 +++++++++++++++++++++++++++++++++-
 1 files changed, 33 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mach-dove/pm.c b/arch/arm/mach-dove/pm.c
index 082c594..74ed90e 100755
--- a/arch/arm/mach-dove/pm.c
+++ b/arch/arm/mach-dove/pm.c
@@ -283,7 +283,7 @@ int pmu_proc_write(struct file *file, const char *buffer,unsigned long count,
 		MV_REG_WRITE(CPU_MAIN_IRQ_MASK_REG, mc);
 		MV_REG_WRITE(CPU_MAIN_IRQ_MASK_HIGH_REG, mc2);
 		goto done;
-	}
+	}        	
 
 	str = "deepidle";
 	if(!strncmp(buffer+len, str,strlen(str))) {
@@ -379,6 +379,37 @@ int pmu_proc_write(struct file *file, const char *buffer,unsigned long count,
 		goto done;
 	}
 
+	str = "units ";
+	if(!strncmp(buffer+len, str,strlen(str))) {
+		len += strlen(str);
+		str = "off";
+		if(!strncmp(buffer+len, str,strlen(str))) {
+			MV_U32 units_reg;			
+			len += strlen(str);
+
+			printk("Units Disabled: SATA, NAND, CAM, AUD0, AUD1, CESA, PDMA, XOR0, XOR1\n");
+			/* Unit clock gating */
+			units_reg = MV_REG_READ(0xD0038);
+			units_reg &= ~0x01C0BC08;
+			MV_REG_WRITE(0xD0038, units_reg);
+
+			goto done;
+		}
+		str = "on";
+		if (!strncmp(buffer+len, str, strlen(str))) {
+			MV_U32 units_reg;
+			len += strlen(str);
+
+			printk(KERN_INFO "Units Enabled: SATA, NAND, CAM, AUD0, AUD1, CESA, PDMA, XOR0, XOR1\n");
+			/* Unit clock gating */
+			units_reg = MV_REG_READ(0xD0038);
+			units_reg |= 0x01C0BC08;
+			MV_REG_WRITE(0xD0038, units_reg);
+			goto done;
+		}
+		goto done;
+	}
+
 	str = "vpu ";
 	if(!strncmp(buffer+len, str,strlen(str))) {
 		len += strlen(str);
@@ -532,6 +563,7 @@ int pmu_proc_read(char* page, char** start, off_t off, int count,int* eof,
 	len += sprintf(page+len,"   gpu <on|off>\n");
 	len += sprintf(page+len,"   vpu <on|off>\n");
 	len += sprintf(page+len,"   wlan <on|off>\n");
+	len += sprintf(page+len,"   units <on|off>\n");
 	len += sprintf(page+len,"   deepcnt\n");
 	return len;
 }
-- 
1.6.0.4





More information about the kernel-team mailing list