summaryrefslogtreecommitdiffstats
path: root/pysystemmgr
diff options
context:
space:
mode:
authorBrad Bishop <bradleyb@fuzziesquirrel.com>2016-09-21 09:17:05 -0400
committerPatrick Williams <patrick@stwcx.xyz>2016-09-23 20:18:45 +0000
commita7ac805b407617f7a83eb152ff823f44d243a9b2 (patch)
tree354902fc7ea17f448c5dc0221b9cc081b5ee9d3d /pysystemmgr
parent7e5ec46d3f67e2447145e6399995ac554a61f152 (diff)
downloadtalos-skeleton-a7ac805b407617f7a83eb152ff823f44d243a9b2.tar.gz
talos-skeleton-a7ac805b407617f7a83eb152ff823f44d243a9b2.zip
configs: Remove gpio code from config files
Move to a new obmc.system module. Change-Id: Ie02a4b2c14cfcf272d8823d44fb9d7c03b796c87 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
Diffstat (limited to 'pysystemmgr')
-rw-r--r--pysystemmgr/obmc/system/__init__.py9
-rw-r--r--pysystemmgr/setup.py1
-rw-r--r--pysystemmgr/system_manager.py3
3 files changed, 12 insertions, 1 deletions
diff --git a/pysystemmgr/obmc/system/__init__.py b/pysystemmgr/obmc/system/__init__.py
new file mode 100644
index 0000000..8799b69
--- /dev/null
+++ b/pysystemmgr/obmc/system/__init__.py
@@ -0,0 +1,9 @@
+GPIO_BASE = 320
+
+def convertGpio(name):
+ name = name.upper()
+ c = name[0:1]
+ offset = int(name[1:])
+ a = ord(c)-65
+ base = a*8+GPIO_BASE
+ return base+offset
diff --git a/pysystemmgr/setup.py b/pysystemmgr/setup.py
index 4207620..a921e9c 100644
--- a/pysystemmgr/setup.py
+++ b/pysystemmgr/setup.py
@@ -2,5 +2,6 @@ from distutils.core import setup
setup(name='pysystemmgr',
version='1.0',
+ packages=['obmc.system'],
scripts=['system_manager.py'],
)
diff --git a/pysystemmgr/system_manager.py b/pysystemmgr/system_manager.py
index 93dfcba..4f9b261 100644
--- a/pysystemmgr/system_manager.py
+++ b/pysystemmgr/system_manager.py
@@ -11,6 +11,7 @@ import obmc.enums
import obmc_system_config as System
import obmc.mapper.utils
import obmc.inventory
+import obmc.system
DBUS_NAME = 'org.openbmc.managers.System'
OBJ_NAME = '/org/openbmc/managers/System'
@@ -136,7 +137,7 @@ class SystemManager(DbusProperties, DbusObjectManager):
gpio_num = gpio['gpio_num']
else:
if 'gpio_pin' in System.GPIO_CONFIG[name]:
- gpio_num = System.convertGpio(gpio['gpio_pin'])
+ gpio_num = obmc.system.convertGpio(gpio['gpio_pin'])
else:
print "ERROR: SystemManager - GPIO lookup failed for "+name
OpenPOWER on IntegriCloud