summaryrefslogtreecommitdiffstats
path: root/src/build
diff options
context:
space:
mode:
authorMarty Gloff <mgloff@us.ibm.com>2017-05-08 11:25:11 -0500
committerDaniel M. Crowell <dcrowell@us.ibm.com>2017-06-08 10:41:38 -0400
commit4edfbd997e46ab635821558047b80ba38a2d7f15 (patch)
treed25ae8b4fbb3fd16dedfde1d5f37d63cb63e6a4a /src/build
parentbb0796065c4a8035b0f0a9bddee61edc8f221c38 (diff)
downloadtalos-hostboot-4edfbd997e46ab635821558047b80ba38a2d7f15.tar.gz
talos-hostboot-4edfbd997e46ab635821558047b80ba38a2d7f15.zip
Use effective fabric position for LPC operations in the bootloader
When the LPC BAR value is supplied in the SBE to BL structure, use it as the base LPC address, otherwise, still use the LPC constant. Save the value being used in the Bootloader data (which is reorganized to align data blocks on boundaries). Also add hb-bldata to parse out the Bootloader data. Change-Id: I1db19467464b90e0190c4df5f7404624c9423eb5 RTC: 173525 Depends-on: I2b0d1959c303df8c9c28c8f0a5b5be1e77aa154f Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/40217 Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com> Reviewed-by: Matt Derksen <mderkse1@us.ibm.com> Reviewed-by: Corey V. Swenson <cswenson@us.ibm.com> Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/build')
-rw-r--r--src/build/debug/Hostboot/BlData.pm168
-rwxr-xr-xsrc/build/simics/hb-simdebug.py22
2 files changed, 189 insertions, 1 deletions
diff --git a/src/build/debug/Hostboot/BlData.pm b/src/build/debug/Hostboot/BlData.pm
new file mode 100644
index 000000000..91d2f89d3
--- /dev/null
+++ b/src/build/debug/Hostboot/BlData.pm
@@ -0,0 +1,168 @@
+# IBM_PROLOG_BEGIN_TAG
+# This is an automatically generated prolog.
+#
+# $Source: src/build/debug/Hostboot/BlData.pm $
+#
+# OpenPOWER HostBoot Project
+#
+# Contributors Listed Below - COPYRIGHT 2017
+# [+] 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.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+# implied. See the License for the specific language governing
+# permissions and limitations under the License.
+#
+# IBM_PROLOG_END_TAG
+
+use strict;
+
+package Hostboot::BlData;
+use Exporter;
+our @EXPORT_OK = ('main');
+
+sub formatData
+{
+ my $data = shift;
+ my $dataRaw = "";
+
+ for (my $i = 0; $i < length($data); $i++)
+ {
+ my $dataHexStr = sprintf("%02X", ord(substr($data, $i, 1)));
+ $dataRaw .= $dataHexStr;
+
+ if ($i % 16 == 15)
+ {
+ $dataRaw .= "\n";
+ }
+ elsif ($i % 4 == 3)
+ {
+ $dataRaw .= " ";
+ }
+ }
+
+ return $dataRaw."\n";
+}
+
+sub main
+{
+ ::setBootloader();
+
+ my $btLdrHrmor = 0x0000000008200000;
+
+ my ($dataSym, $dataSize) = ::findSymbolAddress("Bootloader::g_blData");
+ if (not defined $dataSym) { ::userDisplay "Cannot find symbol.\n"; die; }
+ my $dataSymStr = sprintf("0x%08X", $dataSym);
+
+ ::userDisplay "------------Bootloader Data------------";
+ ::userDisplay "\nData Symbol Address: ";
+ ::userDisplay $dataSymStr;
+
+ my ($scratchSym, $scratchSize) =
+ ::findSymbolAddress("Bootloader::g_blScratchSpace");
+ if (not defined $scratchSym) { ::userDisplay "Cannot find symbol.\n"; die; }
+ my $scratchSymStr = sprintf("0x%08X", $scratchSym);
+
+ ::userDisplay "\nScratch Space Symbol Address: ";
+ ::userDisplay $scratchSymStr;
+ ::userDisplay "\n--------------------------------------------\n";
+
+ my $dataAddr = 0x0000000008208000;
+
+ my $traceAddr = $dataAddr;
+ my $traceAddrStr = sprintf("0x%08X", $traceAddr);
+ ::sendIPCMsg("read-data", "$traceAddr,64"); # Trace buffer is 64 bytes
+ my ($type1, $trace) = ::recvIPCMsg();
+ my $traceData = formatData($trace);
+
+ ::userDisplay "\nTrace Buffer Address: ";
+ ::userDisplay $traceAddrStr;
+ ::userDisplay "\n\nTrace Data:\n";
+ ::userDisplay $traceData;
+ ::userDisplay "\n--------------------------------------------\n";
+
+
+ my $indexAddr = $dataAddr + 64;
+ my $indexAddrStr = sprintf("0x%08X", $indexAddr);
+ ::sendIPCMsg("read-data", "$indexAddr,1"); # Trace index is 1 byte
+ my ($type2, $index) = ::recvIPCMsg();
+ $index =~ s/\0+//g; #strip off nulls
+ my $indexStr = sprintf("0x%02X", ord($index));
+
+ ::userDisplay "\nTrace Index Address: ";
+ ::userDisplay $indexAddrStr;
+ ::userDisplay "\n\nTrace Index (Next Entry): ";
+ ::userDisplay $indexStr;
+ ::userDisplay "\n\n--------------------------------------------\n";
+
+
+ my $tiDataAreaAddr = $dataAddr + 80;
+ my $tiDataAreaAddrStr = sprintf("0x%08X", $tiDataAreaAddr);
+ ::sendIPCMsg("read-data", "$tiDataAreaAddr,48"); # TI Data Area is 48 bytes
+ my ($type6, $tiDataArea) = ::recvIPCMsg();
+ my $tiDataAreaData = formatData($tiDataArea);
+
+ ::userDisplay "\nTI Data Area Address: ";
+ ::userDisplay $tiDataAreaAddrStr;
+ ::userDisplay "\n\nTI Data Area:\n";
+ ::userDisplay $tiDataAreaData;
+ ::userDisplay "\n--------------------------------------------\n";
+
+
+ my $hbbPnorSecAddr = $dataAddr + 128;
+ my $hbbPnorSecAddrStr = sprintf("0x%08X", $hbbPnorSecAddr);
+ ::sendIPCMsg("read-data", "$hbbPnorSecAddr,32"); # Section data is 32 bytes
+ my ($type5, $hbbPnorSec) = ::recvIPCMsg();
+ my $hbbPnorSecData = formatData($hbbPnorSec);
+
+ ::userDisplay "\nHBB PNOR Section Data Address: ";
+ ::userDisplay $hbbPnorSecAddrStr;
+ ::userDisplay "\n\nHBB PNOR Section Data:\n";
+ ::userDisplay $hbbPnorSecData;
+ ::userDisplay "\n--------------------------------------------\n";
+
+
+ my $secRomValAddr = $dataAddr + 160;
+ my $secRomValAddrStr = sprintf("0x%08X", $secRomValAddr);
+ ::sendIPCMsg("read-data", "$secRomValAddr,1"); # Secure ROM Valid is 1 byte
+ my ($type4, $secRomVal) = ::recvIPCMsg();
+ $secRomVal =~ s/\0+//g; #strip off nulls
+ my $secRomValStr = sprintf("0x%02X", ord($secRomVal));
+
+ ::userDisplay "\nSecure ROM Valid Address: ";
+ ::userDisplay $secRomValAddrStr;
+ ::userDisplay "\n\nSecure ROM Valid: ";
+ ::userDisplay $secRomValStr;
+ ::userDisplay "\n\n--------------------------------------------\n";
+
+
+ my $blToHbAddr = $dataAddr + 176;
+ my $blToHbAddrStr = sprintf("0x%08X", $blToHbAddr);
+ ::sendIPCMsg("read-data", "$blToHbAddr,89"); # BL to HB data is 89 bytes
+ my ($type3, $blToHb) = ::recvIPCMsg();
+ my $blToHbData = formatData($blToHb);
+
+ ::userDisplay "\nBL to HB Data Address: ";
+ ::userDisplay $blToHbAddrStr;
+ ::userDisplay "\n\nBootloader to Hostboot Data:\n";
+ ::userDisplay $blToHbData;
+ ::userDisplay "\n--------------------------------------------\n";
+
+ ::clearBootloader();
+}
+
+sub helpInfo
+{
+ my %info = (
+ name => "BlData",
+ intro => ["Displays Bootloader data."],
+ );
+}
diff --git a/src/build/simics/hb-simdebug.py b/src/build/simics/hb-simdebug.py
index d9f7be5aa..f43877807 100755
--- a/src/build/simics/hb-simdebug.py
+++ b/src/build/simics/hb-simdebug.py
@@ -5,7 +5,7 @@
#
# OpenPOWER HostBoot Project
#
-# Contributors Listed Below - COPYRIGHT 2011,2016
+# Contributors Listed Below - COPYRIGHT 2011,2017
# [+] International Business Machines Corp.
#
#
@@ -87,6 +87,26 @@ Examples: \n
#------------------------------------------------
#------------------------------------------------
+new_command("hb-bldata",
+ lambda: run_hb_debug_framework("BlData", outputFile = "hb-bldata.output"),
+ #alias = "hbt",
+ type = ["hostboot-commands"],
+ #see_also = ["hb-trace"],
+ see_also = [ ],
+ short = "Display Bootloader data",
+ doc = """
+Parameters: \n
+
+Defaults: \n
+ 'syms' = './hbibl.syms' \n\n
+
+Examples: \n
+ hb-bldata \n\n
+ NOTE: Results are unpredictable after control is passed to Hostboot Base.\n
+ """)
+
+#------------------------------------------------
+#------------------------------------------------
new_command("hb-printk",
lambda: run_hb_debug_framework("Printk", outputFile = "hb-printk.output"),
#alias = "hbt",
OpenPOWER on IntegriCloud