summaryrefslogtreecommitdiffstats
path: root/src/build/debug
diff options
context:
space:
mode:
authorDan Crowell <dcrowell@us.ibm.com>2014-06-17 10:27:07 -0500
committerA. Patrick Williams III <iawillia@us.ibm.com>2014-10-14 08:49:13 -0500
commitf058c4b71a182364fd664f5a4d93cd1fe3e07d19 (patch)
tree348cab519fb07d2172fad68d1df689381c437793 /src/build/debug
parent4b16ee65fc46cb19aca69bd54b6024a948316315 (diff)
downloadtalos-hostboot-f058c4b71a182364fd664f5a4d93cd1fe3e07d19.tar.gz
talos-hostboot-f058c4b71a182364fd664f5a4d93cd1fe3e07d19.zip
Split out SFC logic and add support for AST2400
Refactored the PNOR device driver to pull all SFC-specific code into a new set of classes. Any time a new type of serial flash controller (SFC) is introduced, a new subclass should be created to support it. Also added the full support for the AST2400 BMC that is being used on Palmetto. Change-Id: I9cdbf9b48bbf94615a39804920e170a3142ec386 Origin: Google Shared Technology RTC: 97493 Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/13229 Tested-by: Jenkins Server Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/build/debug')
-rwxr-xr-xsrc/build/debug/simics-debug-framework.pl66
1 files changed, 18 insertions, 48 deletions
diff --git a/src/build/debug/simics-debug-framework.pl b/src/build/debug/simics-debug-framework.pl
index 1d15e7ec2..9572d1efc 100755
--- a/src/build/debug/simics-debug-framework.pl
+++ b/src/build/debug/simics-debug-framework.pl
@@ -6,7 +6,10 @@
#
# OpenPOWER HostBoot Project
#
-# COPYRIGHT International Business Machines Corp. 2011,2014
+# Contributors Listed Below - COPYRIGHT 2011,2014
+# [+] Google Inc.
+# [+] International Business Machines Corp.
+#
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -301,41 +304,10 @@ sub getHRMOR
}
-use constant PNOR_MODE_UNKNOWN => 0;
-use constant PNOR_MODE_MEMCPY => PNOR_MODE_UNKNOWN + 1;
-use constant PNOR_MODE_LPC_MEM => PNOR_MODE_MEMCPY + 1;
-use constant PNOR_MODE_REAL_CMD => PNOR_MODE_LPC_MEM + 1;
-use constant PNOR_MODE_REAL_MMIO => PNOR_MODE_REAL_CMD + 1;
-my $extImageMode = PNOR_MODE_UNKNOWN;
-my $extImageOffset = 0;
-
-use constant PNOR_DD_MODE_OFFSET => 8;
-use constant PNOR_DD_FAKESTART_OFFSET => PNOR_DD_MODE_OFFSET + 16;
-
use constant PNOR_RP_HBEXT_SECTION => 1;
use constant PNOR_RP_SECTIONDATA_SIZE => 3 * 8 + 2;
use constant PNOR_RP_SECTIONDATA_FLASHADDR_OFFSET => 2 * 8;
-sub determineExtImageInfo
-{
- my ($pnorDDAddr, $pnorDDSize) =
- ::findSymbolAddress("Singleton<PnorDD>::instance()::instance");
-
- $extImageMode = read32($pnorDDAddr + PNOR_DD_MODE_OFFSET);
- if ((PNOR_MODE_MEMCPY == $extImageMode) ||
- (PNOR_MODE_LPC_MEM == $extImageMode))
- {
- $extImageOffset = read32($pnorDDAddr + PNOR_DD_FAKESTART_OFFSET);
- }
-
- my ($pnorRPAddr, $pnorRPSize) =
- ::findSymbolAddress("Singleton<PnorRP>::instance()::instance");
-
- $extImageOffset +=
- read32($pnorRPAddr +
- (PNOR_RP_SECTIONDATA_SIZE * PNOR_RP_HBEXT_SECTION) +
- PNOR_RP_SECTIONDATA_FLASHADDR_OFFSET);
-}
# @sub readExtImage
#
@@ -348,26 +320,24 @@ sub readExtImage
my $addr = shift;
my $size = shift;
- if ($extImageMode == PNOR_MODE_UNKNOWN) { determineExtImageInfo(); }
+ my ($pnorRPAddr, $pnorRPSize) =
+ ::findSymbolAddress("Singleton<PnorRP>::instance()::instance");
- if ((PNOR_MODE_MEMCPY == $extImageMode) ||
- (PNOR_MODE_LPC_MEM == $extImageMode))
- {
- $addr += getHRMOR() + $extImageOffset;
- return readData($addr, $size);
- }
- else
- {
- $addr += $extImageOffset;
- sendIPCMsg("read-pnor", "$addr,$size");
+ my $extImageOffset +=
+ read32($pnorRPAddr +
+ (PNOR_RP_SECTIONDATA_SIZE * PNOR_RP_HBEXT_SECTION) +
+ PNOR_RP_SECTIONDATA_FLASHADDR_OFFSET);
- my ($type, $data) = recvIPCMsg();
+ $addr += $extImageOffset;
+ sendIPCMsg("read-pnor", "$addr,$size");
- if (length($data) == $size)
- {
- return $data;
- }
+ my ($type, $data) = recvIPCMsg();
+
+ if (length($data) == $size)
+ {
+ return $data;
}
+
return "";
}
OpenPOWER on IntegriCloud