diff options
author | Raptor Engineering Development Team <support@raptorengineering.com> | 2018-01-23 03:11:27 -0600 |
---|---|---|
committer | Raptor Engineering Development Team <support@raptorengineering.com> | 2019-04-19 10:28:12 +0000 |
commit | a5cc1c4293f79f9b8b96c741112d52fe7fb5b5cc (patch) | |
tree | f67c6fc432e5041749b2c24a34e39f4a65089d42 /pyiplobserver | |
parent | b82ab7edd8e9cd533377d20ca5c9697af60dbb1b (diff) | |
download | talos-skeleton-a5cc1c4293f79f9b8b96c741112d52fe7fb5b5cc.tar.gz talos-skeleton-a5cc1c4293f79f9b8b96c741112d52fe7fb5b5cc.zip |
Add skiboot state to IPL observer and LED monitor services
This helps reduce issues with the OCCs dropping off the bus
during skiboot initialization
Diffstat (limited to 'pyiplobserver')
-rw-r--r-- | pyiplobserver/ipl_status_observer.py | 38 |
1 files changed, 36 insertions, 2 deletions
diff --git a/pyiplobserver/ipl_status_observer.py b/pyiplobserver/ipl_status_observer.py index f5e3d25..5329a7c 100644 --- a/pyiplobserver/ipl_status_observer.py +++ b/pyiplobserver/ipl_status_observer.py @@ -40,6 +40,9 @@ IPL_HOSTBOOT_START_ISTEP_MINOR = 0 IPL_COMPLETE_ISTEP_MAJOR = 21 IPL_COMPLETE_ISTEP_MINOR = 3 +SKIBOOT_RUNNING_ISTEP_MAJOR = 22 +SKIBOOT_RUNNING_ISTEP_MINOR = 0 + class IPLStatus(DbusProperties, DbusObjectManager): def __init__(self, bus, obj_name): super(IPLStatus, self).__init__( @@ -74,6 +77,28 @@ class IPLStatus(DbusProperties, DbusObjectManager): print "IPLStatus Init Done" + def getSkibootBootFlag(self): + result = 0 + try: + proc = subprocess.Popen(["devmem", "0x1e789060", "8"], stdout=subprocess.PIPE, stderr=open(os.devnull, 'wb'), shell=False) + (out, err) = proc.communicate() + result = (int(out, 16) & 4) >> 2 + except: + pass + + return result + + def resetSkibootBootFlag(self): + try: + proc = subprocess.Popen(["devmem", "0x1e789060", "8"], stdout=subprocess.PIPE, stderr=open(os.devnull, 'wb'), shell=False) + (out, err) = proc.communicate() + reg_data = int(out, 16) & (~4) + proc = subprocess.Popen(["devmem", "0x1e789060", "8", str(reg_data)], stdout=subprocess.PIPE, stderr=open(os.devnull, 'wb'), shell=False) + (out, err) = proc.communicate() + except: + print "IPLStatus unable to reset skiboot flags!" + pass + def readIPLStatus(self): try: # Set up defaults @@ -96,6 +121,7 @@ class IPLStatus(DbusProperties, DbusObjectManager): self.Set(DBUS_NAME, "current_istep", current_istep) self.IPLStepChanged(current_istep) self.last_istep = current_istep + self.resetSkibootBootFlag() return True; @@ -174,7 +200,13 @@ class IPLStatus(DbusProperties, DbusObjectManager): if ((current_istep_major > 0) or (current_istep_minor > 0 )): current_status = "IPL_RUNNING" if ((current_istep_major == IPL_COMPLETE_ISTEP_MAJOR) and (current_istep_minor == IPL_COMPLETE_ISTEP_MINOR)): - current_status = "IPL_COMPLETE" + if (self.getSkibootBootFlag() == 0): + current_status = "IPL_RUNNING" + current_istep_major = SKIBOOT_RUNNING_ISTEP_MAJOR + current_istep_minor = SKIBOOT_RUNNING_ISTEP_MINOR + current_istep = str(current_istep_major) + "," + str(current_istep_minor) + else: + current_status = "IPL_COMPLETE" # Reset failure counter self.prev_access_fail_count = 0 @@ -198,9 +230,11 @@ class IPLStatus(DbusProperties, DbusObjectManager): pass else: try: - os.remove(IPL_FLAG_DIR + IPL_FLAG_FILE,) + os.remove(IPL_FLAG_DIR + IPL_FLAG_FILE) except: pass + if (current_istep_major < IPL_COMPLETE_ISTEP_MAJOR): + self.resetSkibootBootFlag() # Since it is extremely unlikely that both fetches will fail unless the host is offline, simply check that both fetches passed or failed before continuing if (sbe_fetch_failed == hostboot_fetch_failed): |