Skip to contentSkip to conversation

Octeon 6xxx: Add Power Throttling support for CN6xxx and above

PATCH New philby john 1 participant 1 message Jun 7, 2012 MIPS

lore
Share & tools
lore
#0 lore raw

PATCH 2/2 Octeon 6xxx: Add Power Throttling support for CN6xxx and above

From 9d9f2b330ad635dff9aa141cd96bde2907385032 Mon Sep 17 00:00:00 2001
From: Philby John <[email protected]>
Date: Thu, 7 Jun 2012 12:09:31 +0530
Subject: [PATCH] Octeon 6xxx: Add Power Throttling support for CN6xxx and above

This patch adds the sysfs primitives for power throttling.

Octeon2 supports dynamic power control which aids to cut down power consumption. The code exposes a "percentage" power throttling limiter by means of /sys interface for each available cpu. Setting this value to 0 will set power consumption to a minimum as it will only execute a couple instructions every PERIOD as set in the PowThrottle register. If set to 100% for that particular cpu, it will consume maximum power.

---
 arch/mips/cavium-octeon/Kconfig             |   12 ++
 arch/mips/cavium-octeon/Makefile            |    1 +
 arch/mips/cavium-octeon/octeon_pwr_throtl.c |  177 +++++++++++++++++++++++++++
 3 files changed, 190 insertions(+), 0 deletions(-)
 create mode 100644 arch/mips/cavium-octeon/octeon_pwr_throtl.c
arch/mips/cavium-octeon/Kconfig +12 -0
index f9e275a..7a7f7e7 100644
@@ -97,5 +97,17 @@ config SWIOTLB
 	select IOMMU_HELPER
 	select NEED_SG_DMA_LENGTH
 
+config CAVIUM_POWER_THROTTLING
+	bool "Enable support for power throttling on Octeon 63xx and above"
+	depends on CPU_CAVIUM_OCTEON
+	default n
+	help
+	  On Octeon 6xxx and above dynamic power can be controlled
+	  by setting the PowThrottle registers for each cpu. This could be
+	  beneficial for lower power consumption requirements.
+
+	  If your application makes extensive use of high-energy instructions
+	  (such as Octeon cryptographic accleration) it's better to leave this
+	  option disabled as it may have slight impact on performance.
 
 endif # CPU_CAVIUM_OCTEON
arch/mips/cavium-octeon/Makefile +1 -0
index 19eb043..912f9bb 100644
@@ -15,3 +15,4 @@ obj-y += octeon-memcpy.o
 obj-y += executive/
 
 obj-$(CONFIG_SMP)                     += smp.o
+obj-$(CONFIG_CAVIUM_POWER_THROTTLING) += octeon_pwr_throtl.o
arch/mips/cavium-octeon/octeon_pwr_throtl.c new file +177 -0

177 lines not on this page · raw message

Signature · 1 line
1.6.3.3.338.ge89ce