Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 19 Oct 2013 06:47:02 +0000 (UTC)
From:      Randall Stewart <rrs@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r256760 - head/sys/arm/mv
Message-ID:  <201310190647.r9J6l28G035210@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: rrs
Date: Sat Oct 19 06:47:02 2013
New Revision: 256760
URL: http://svnweb.freebsd.org/changeset/base/256760

Log:
  Corrects the Kirkwood dreamplug to use
  the right register for power managment. It
  was incorrectly using the clock register
  which also caused the status to be the
  opposite of what it is supposed to be.
  1 - its disabled
  0 - its enabled
  
  Per kirkwood spec FSS_88F6180_9x_6281_OpenSource.pdf

Modified:
  head/sys/arm/mv/common.c
  head/sys/arm/mv/mvreg.h

Modified: head/sys/arm/mv/common.c
==============================================================================
--- head/sys/arm/mv/common.c	Sat Oct 19 06:30:20 2013	(r256759)
+++ head/sys/arm/mv/common.c	Sat Oct 19 06:47:02 2013	(r256760)
@@ -153,8 +153,11 @@ struct fdt_pm_mask_entry fdt_pm_mask_tab
 static __inline int
 pm_is_disabled(uint32_t mask)
 {
-
+#if defined(SOC_MV_KIRKWOOD)
+	return (soc_power_ctrl_get(mask) == mask);
+#else
 	return (soc_power_ctrl_get(mask) == mask ? 0 : 1);
+#endif
 }
 
 /*
@@ -221,7 +224,16 @@ fdt_pm(phandle_t node)
 			continue;
 
 		compat = fdt_is_compatible(node, fdt_pm_mask_table[i].compat);
-
+#if defined(SOC_MV_KIRKWOOD)
+		if (compat && (cpu_pm_ctrl & fdt_pm_mask_table[i].mask)) {
+			dev_mask |= (1 << i);
+			ena = 0;
+			break;
+		} else if (compat) {
+			dev_mask |= (1 << i);
+			break;
+		}
+#else
 		if (compat && (~cpu_pm_ctrl & fdt_pm_mask_table[i].mask)) {
 			dev_mask |= (1 << i);
 			ena = 0;
@@ -230,6 +242,7 @@ fdt_pm(phandle_t node)
 			dev_mask |= (1 << i);
 			break;
 		}
+#endif
 	}
 
 	return (ena);

Modified: head/sys/arm/mv/mvreg.h
==============================================================================
--- head/sys/arm/mv/mvreg.h	Sat Oct 19 06:30:20 2013	(r256759)
+++ head/sys/arm/mv/mvreg.h	Sat Oct 19 06:47:02 2013	(r256760)
@@ -142,7 +142,11 @@
 /*
  * Power Control
  */
+#if defined(SOC_MV_KIRKWOOD)
+#define CPU_PM_CTRL		0x18
+#else
 #define CPU_PM_CTRL		0x1C
+#endif
 #define CPU_PM_CTRL_NONE	0
 #define CPU_PM_CTRL_ALL		~0x0
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201310190647.r9J6l28G035210>