summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--img/.gitignore1
-rw-r--r--src/build/makefile2
-rwxr-xr-xsrc/build/simics/post_model_hook.simics38
-rw-r--r--src/build/tocgen/makefile20
-rwxr-xr-xsrc/build/tocgen/mkpnortoc.pl323
-rw-r--r--src/build/tocgen/pnortoc.xml134
-rwxr-xr-xsrc/build/tools/cpfiles.pl8
-rw-r--r--src/include/usr/pnor/pnor_reasoncodes.H1
-rw-r--r--src/usr/pnor/pnordd.C29
-rw-r--r--src/usr/pnor/pnordd.H2
-rw-r--r--src/usr/pnor/test/pnorddtest.H111
11 files changed, 629 insertions, 40 deletions
diff --git a/img/.gitignore b/img/.gitignore
index 211a0a0f7..476897d14 100644
--- a/img/.gitignore
+++ b/img/.gitignore
@@ -9,3 +9,4 @@
*.syms
.*.lnkout
hbotStringFile
+*.toc
diff --git a/src/build/makefile b/src/build/makefile
index 8d4c7d750..d9ef1d792 100644
--- a/src/build/makefile
+++ b/src/build/makefile
@@ -1,5 +1,5 @@
ROOTPATH = ../..
-SUBDIRS = linker.d
+SUBDIRS = linker.d tocgen.d
include ${ROOTPATH}/config.mk
diff --git a/src/build/simics/post_model_hook.simics b/src/build/simics/post_model_hook.simics
new file mode 100755
index 000000000..d87f999bc
--- /dev/null
+++ b/src/build/simics/post_model_hook.simics
@@ -0,0 +1,38 @@
+################################################################################
+# IBM_PROLOG_BEGIN_TAG
+# This is an automatically generated prolog.
+#
+# $Source: firmsim firmsim_vob/firmsim_comp/simics/post_model_hook.simics 1$
+#
+# IBM CONFIDENTIAL
+#
+# OBJECT CODE ONLY SOURCE MATERIALS
+#
+# COPYRIGHT International Business Machines Corp. 2011,2011
+# All Rights Reserved
+#
+# The source code for this program is not published or otherwise
+# divested of its trade secrets, irrespective of what has been
+# deposited with the U.S. Copyright Office.
+#
+# IBM_PROLOG_END_TAG
+# post_model_hook.simics
+# This file is used to run a set of commands on the simics console after
+# modules have loaded.
+################################################################################
+# Example for Hostboot group:
+#@os.environ["HOSTBOOT_SYMS"]="./hbicore.syms"
+#@os.environ["HOSTBOOT_OFILE"]="./hbotStringFile"
+#add-directory path="/esw/fips740/Builds/built/hostboot"
+#run-python-file traceHB.py
+#@del os.environ["HOSTBOOT_SYMS"]
+################################################################################
+
+
+#setup traces
+run-python-file traceHB.py
+
+#Load extended image and pnor.toc into phys_mem
+#This will be merged into once the proper tools are written.
+phys_mem.load-file ../img/hbicore_extended.bin 0x500690
+phys_mem.load-file ../img/pnor.toc 0x500000
diff --git a/src/build/tocgen/makefile b/src/build/tocgen/makefile
new file mode 100644
index 000000000..cb872f1f1
--- /dev/null
+++ b/src/build/tocgen/makefile
@@ -0,0 +1,20 @@
+
+#Temporary implementation to get a PNOR TOC created. This will all change once the PNOR
+#layout is finalized and we put together some real build tools.
+#TODO: restructure to fit the usual makefile structure
+ROOTPATH = ../../..
+
+pnortoc:
+ ${ROOTPATH}/src/build/tocgen/mkpnortoc.pl -i ${ROOTPATH}/src/build/tocgen/pnortoc.xml \
+ -o ${ROOTPATH}/img/pnor.toc
+
+all: gen_pass
+
+code_pass:
+
+gen_pass: pnortoc
+
+clean:
+
+beam:
+
diff --git a/src/build/tocgen/mkpnortoc.pl b/src/build/tocgen/mkpnortoc.pl
new file mode 100755
index 000000000..5a3d95d15
--- /dev/null
+++ b/src/build/tocgen/mkpnortoc.pl
@@ -0,0 +1,323 @@
+#!/usr/bin/perl
+# File mkPnorTOC.pl created by ADAM R. MUHLE at 14:39:27 on Mon Aug 1 2011.
+
+#Limitations to address later
+# number fields must be 4 or 8 bytes
+# numbers cannot be over 32 bits
+
+#@TODO - enable "use strict"
+#@TODO - standardize variable names, i_blah for input, etc.
+
+use XML::LibXML;
+#use Data::Dumper;
+use File::Basename;
+
+my $programName = File::Basename::basename $0;
+my $g_trace = 0; # 1 -> enable traces
+$tocDataFile = "";
+$tocOutFile = "";
+
+if ($#ARGV < 0) {
+ usage();
+ exit;
+}
+
+
+#Parse the commandline args
+for ($i=0; $i < $#ARGV + 1; $i++)
+{
+ if ($ARGV[$i] =~ /-h/) {
+ usage();
+ exit 0;
+ }
+ elsif($ARGV[$i] =~ /-v/) {
+ $verbose = 1;
+ }
+ elsif($ARGV[$i] =~ /-i/) {
+ $tocDataFile = $ARGV[++$i];
+ trace(1, "Input Data File=$tocDataFile");
+ }
+ elsif($ARGV[$i] =~ /-o/) {
+ $tocOutFile = $ARGV[++$i];
+ trace(1, "Output Binary File=$tocOutFile");
+ }
+ else {
+ #Error!!
+ }
+}
+
+
+#open output file
+open( BIN_TOC_FILE, ">:raw", $tocOutFile) or die "Can't open $tocOutFile file for writing";
+
+#parse the input XML file
+$parser = XML::LibXML->new();
+$doc = $parser->parse_file($tocDataFile);
+
+#add the SBE field to the TOC
+$sbeNodes = $doc->getElementsByTagName("sbeLoc");
+$onlySbeNode = $sbeNodes->pop();
+writeElementToBinFile(BIN_TOC_FILE, $onlySbeNode);
+
+#Add TOC version field to TOC
+$tocVerNodes = $doc->getElementsByTagName("tocVersion");
+$onlytocVerNode = $tocVerNodes->pop();
+writeElementToBinFile(BIN_TOC_FILE, $onlytocVerNode);
+
+
+#Add the individual TOC entries
+$root = $doc->firstChild;
+$curSibling = $root->firstChild;
+
+do {
+ #just in case the first childe is bad
+ if(!$curSibling)
+ {
+ last;
+ }
+ elsif($curSibling->nodeName eq "tocEntry")
+ {
+ parseTocEntry(BIN_TOC_FILE, $curSibling);
+ }
+ elsif(($curSibling->nodeName eq "sbeLoc") ||
+ ($curSibling->nodeName eq "tocVersion"))
+ {
+ #skip these, already inserted above
+ }
+
+}while($curSibling = $curSibling->nextSibling);
+
+
+close(BIN_TOC_FILE);
+exit;
+
+#################################################
+# Get Length of a field
+# Searches XML element for sub-element called
+# length
+#################################################
+sub getLength
+{
+ $element = @_[0];
+
+ $lenElements = $element->getElementsByLocalName("length");
+ $lenEl = $lenElements->pop();
+
+ $len = $lenEl->firstChild->data;
+ chomp $len;
+ return $len;
+
+}
+
+#################################################
+# Get format of a field
+# Searches XML element for sub-element called
+# format
+#################################################
+sub getFormat
+{
+ $element = @_[0];
+
+ $formatElements = $element->getElementsByLocalName("format");
+ $formatEl = $formatElements->pop();
+
+ $format = $formatEl->firstChild->data;
+ chomp $format;
+ return $format;
+
+}
+
+
+#################################################
+# Get data value from provided XML element
+#
+#################################################
+sub getValue
+{
+ $i_element = @_[0];
+
+ $value = $i_element->firstChild->data;
+
+ $value =~s/\s+$//;
+ chomp $value;
+
+ return $value;
+}
+
+#################################################
+# parse <tocEntry> node, write bin data to file
+#
+#################################################
+sub parseTocEntry
+{
+ ($i_FILEHANDLE, $i_element) = @_;
+ $entryLength = 0;
+ $sumFieldLen = 0;
+ local $curSibling;
+
+
+ $curSibling = $i_element->firstChild;
+ do {
+ #just in case the first childe is bad
+ if(!$curSibling)
+ {
+ last;
+ }
+ elsif($curSibling->nodeName eq "text")
+ {
+ #print "skipping ".$curSibling->nodeName."\n";
+ }
+ elsif($curSibling->nodeName eq "length")
+ {
+ $entryLength = $curSibling->firstChild->data;
+
+ }
+ else
+ {
+ $fieldLen = writeElementToBinFile($i_FILEHANDLE, $curSibling);
+ $sumFieldLen = $sumFieldLen + $fieldLen;
+
+ }
+# ($nextSibling = $curSibling->nextSibling)
+
+ }while($curSibling = $curSibling->nextSibling);
+
+ if($sumFieldLen > $entryLength)
+ {
+ trace(0, "Fields in TOC Entry consumed more space (".$sumFieldLen.") then they were supposed to (".$entryLength.")\n Aborting");
+ exit 1;
+ }
+ elsif($sumFieldLen < $entryLength)
+ {
+ trace(1, "Need to insert padding to fill up TOC entry space");
+ $padBytes = $entryLength - $sumFieldLen;
+ insertPadBytes($i_FILEHANDLE, $padBytes);
+ }
+
+
+}
+#################################################
+# write provided element to binary file
+#
+#################################################
+sub writeElementToBinFile
+{
+ ($i_FILEHANDLE, $i_element) = @_;
+
+ $elValue = getValue($i_element);
+ $len = getLength($i_element);
+ $format = getFormat($i_element);
+
+ trace(1, "Value=".$elValue." Length=".$len." Format=".$format);
+
+
+ if($format =~ "string")
+ {
+ #print in ascii
+ #pad on right side
+ @charArray = unpack("C*", $elValue);
+ foreach $char (@charArray)
+ {
+ print $i_FILEHANDLE pack('C', $char);
+ }
+
+ $zeroPad = $len-length($elValue);
+ insertPadBytes($i_FILEHANDLE, $zeroPad);
+ }
+ elsif ($format =~ "number")
+ {
+ if(($len != 4) &&
+ ($len != 8))
+ {
+ trace(0, "field <length>=".$len.". Currently only lengths of 4 or 8 are supported. \n Aborting program");
+ exit 1;
+ }
+
+ if($len == 8)
+ {
+ print $i_FILEHANDLE pack('N', 0);
+ }
+
+ #check if we have a hex number
+ if($elValue =~ "0x")
+ {
+ $num = oct($elValue);
+ }
+ else
+ {
+ $num = $elValue;
+ }
+
+ #verify number consumes less than 32 bits
+ if($num > 0xFFFFFFFF)
+ {
+ trace(0, "number=".$num.". This is greater than 32 bits in hex and not currently supported!. \n Aborting program");
+ exit 1;
+ }
+
+ print $i_FILEHANDLE pack('N', $num);
+
+ }
+ else
+ {
+ print "ERROR: Unrecognized <format> type: ".$format." Exiting!\n";
+ exit 1;
+ }
+
+ return $len
+
+}
+
+#################################################
+# Insert specifed number of pad bytes into file
+#
+#################################################
+sub insertPadBytes
+{
+ ($i_FILEHANDLE, $i_padBytes) = @_;
+ for($i=0; $i<$i_padBytes; $i++)
+ {
+ print $i_FILEHANDLE pack('C', 0);
+ }
+}
+
+
+
+
+################################################################################
+# trace
+################################################################################
+sub trace
+{
+ ($i_traceLevel, $i_string) = @_;
+
+ #traceLevel 0 is for errors
+ if($i_traceLevel == 0)
+ {
+ print "ERROR: ".$i_string."\n";
+ }
+ elsif ($g_trace >= $i_traceLevel)
+ {
+ print "TRACE: ".$i_string."\n";
+ }
+}
+
+################################################################################
+# print usage instructions
+################################################################################
+sub usage
+{
+print <<"ENDUSAGE";
+ $programName = Creates the PNOR Table of Contents (TOC) based on input XML file.
+
+ Usage:
+ $programName -i <XML File> -o <binary Output File>
+
+ Current Limitations:
+ --Hex/number fields must be 4 or 8 bytes in length
+ --Numbers cannot be over 32 bits (in hex)
+ The script will print and error and exit with a non-zero return code if these
+ conditions are encountered.
+
+ENDUSAGE
+}
diff --git a/src/build/tocgen/pnortoc.xml b/src/build/tocgen/pnortoc.xml
new file mode 100644
index 000000000..2f530bdb6
--- /dev/null
+++ b/src/build/tocgen/pnortoc.xml
@@ -0,0 +1,134 @@
+<pnorToc>
+ <sbeLoc>0x180
+ <length>8</length>
+ <format>number</format>
+ </sbeLoc>
+ <tocVersion>0xFFFF
+ <length>8</length>
+ <format>number</format>
+ </tocVersion>
+ <tocEntry>
+ <length>56</length>
+ <field type="eyeCatch">TOC
+ <length>8</length>
+ <format>string</format>
+ </field>
+ <field type="logical_offset">0
+ <length>8</length>
+ <format>number</format>
+ </field>
+ <field type="physical_offset">0
+ <length>8</length>
+ <format>number</format>
+ </field>
+ <field type="logical_size">0x690
+ <length>8</length>
+ <format>number</format>
+ </field>
+ <field type="physical_size">0x690
+ <length>8</length>
+ <format>number</format>
+ </field>
+ <field type="Act_logical_size">0
+ <length>8</length>
+ <format>number</format>
+ </field>
+ <field type="Act_physical_size">0
+ <length>8</length>
+ <format>number</format>
+ </field>
+ </tocEntry>
+ <tocEntry>
+ <length>56</length>
+ <field type="eyeCatch">HBI
+ <length>8</length>
+ <format>string</format>
+ </field>
+ <field type="logical_offset">0x690
+ <length>8</length>
+ <format>number</format>
+ </field>
+ <field type="physical_offset">0x690
+ <length>8</length>
+ <format>number</format>
+ </field>
+ <field type="logical_size">0x7D000
+ <length>8</length>
+ <format>number</format>
+ </field>
+ <field type="physical_size">0x7D000
+ <length>8</length>
+ <format>number</format>
+ </field>
+ <field type="Act_logical_size">0
+ <length>8</length>
+ <format>number</format>
+ </field>
+ <field type="Act_physical_size">0
+ <length>8</length>
+ <format>number</format>
+ </field>
+ </tocEntry>
+ <tocEntry>
+ <length>56</length>
+ <field type="eyeCatch">GLOBAL
+ <length>8</length>
+ <format>string</format>
+ </field>
+ <field type="logical_offset">0x7D690
+ <length>8</length>
+ <format>number</format>
+ </field>
+ <field type="physical_offset">0x7D690
+ <length>8</length>
+ <format>number</format>
+ </field>
+ <field type="logical_size">4096
+ <length>8</length>
+ <format>number</format>
+ </field>
+ <field type="physical_size">4096
+ <length>8</length>
+ <format>number</format>
+ </field>
+ <field type="Act_logical_size">0
+ <length>8</length>
+ <format>number</format>
+ </field>
+ <field type="Act_physical_size">0
+ <length>8</length>
+ <format>number</format>
+ </field>
+ </tocEntry>
+ <tocEntry>
+ <length>56</length>
+ <field type="eyeCatch">HBD
+ <length>8</length>
+ <format>string</format>
+ </field>
+ <field type="logical_offset">0x7E690
+ <length>8</length>
+ <format>number</format>
+ </field>
+ <field type="physical_offset">0x7E690
+ <length>8</length>
+ <format>number</format>
+ </field>
+ <field type="logical_size">8192
+ <length>8</length>
+ <format>number</format>
+ </field>
+ <field type="physical_size">8192
+ <length>8</length>
+ <format>number</format>
+ </field>
+ <field type="Act_logical_size">0
+ <length>8</length>
+ <format>number</format>
+ </field>
+ <field type="Act_physical_size">0
+ <length>8</length>
+ <format>number</format>
+ </field>
+ </tocEntry>
+</pnorToc>
diff --git a/src/build/tools/cpfiles.pl b/src/build/tools/cpfiles.pl
index dc066d859..b17764e0f 100755
--- a/src/build/tools/cpfiles.pl
+++ b/src/build/tools/cpfiles.pl
@@ -34,6 +34,7 @@ sub printUsage;
#List of files to copy. Path is relative to git repository.
my @files = ("src/build/tools/exthbdump.pl",
+ "src/build/simics/post_model_hook.simics",
"src/build/trace/traceHB.py",
"img/hbotStringFile",
"img/hbicore.syms",
@@ -41,7 +42,9 @@ my @files = ("src/build/tools/exthbdump.pl",
"img/hbicore.bin",
"img/hbicore_test.bin",
"img/hbicore.list",
- "img/hbicore_test.list");
+ "img/hbicore_test.list",
+ "img/hbicore_extended.bin",
+ "img/pnor.toc");
#Directories in base git repository
my @gitRepoDirs = ("img",
@@ -182,7 +185,8 @@ foreach (@files)
#print "$filename, $directories, $suffix\n";
#Copy .bin to the img dir
- if ($suffix eq ".bin")
+ if (($suffix eq ".bin") ||
+ ($suffix eq ".toc"))
{
$copyDir = $imgDir;
}
diff --git a/src/include/usr/pnor/pnor_reasoncodes.H b/src/include/usr/pnor/pnor_reasoncodes.H
index 0e7f002e4..3b45e94e1 100644
--- a/src/include/usr/pnor/pnor_reasoncodes.H
+++ b/src/include/usr/pnor/pnor_reasoncodes.H
@@ -11,6 +11,7 @@ namespace PNOR
MOD_PNORRP_COMPUTEDEVICEADDR = 0x02, /**< pnorrp.C : PnorRP::computeDeviceAddr */
MOD_PNORRP_GETSECTIONINFO = 0x03, /**< pnorrp.C : PnorRP::getSectionInfo */
MOD_PNORRP_COMPUTESECTION = 0x04, /**< pnorrp.C : PnorRP::computeSection */
+ MOD_PNORDD_VERIFYADDRESSRANGE = 0x05 /**< pnordd.C : PnorDD::verifyAddressRange */
};
enum PNORReasonCode
diff --git a/src/usr/pnor/pnordd.C b/src/usr/pnor/pnordd.C
index fe4699fbe..ddc760ba3 100644
--- a/src/usr/pnor/pnordd.C
+++ b/src/usr/pnor/pnordd.C
@@ -18,10 +18,11 @@
#include <errl/errlmanager.H>
#include "pnordd.H"
#include <pnor/pnorif.H>
+#include <pnor/pnor_reasoncodes.H>
-#define FAKE_PNOR_START 7*1024*1024
+#define FAKE_PNOR_START 5*1024*1024
#define FAKE_PNOR_END 8*1024*1024
-
+#define FAKE_PNOR_SIZE 3*1024*1024
extern trace_desc_t* g_trac_pnor;
@@ -158,7 +159,7 @@ errlHndl_t PnorDD::read(void* o_buffer,
size_t& io_buflen,
uint64_t i_address)
{
- TRACDCOMP(g_trac_pnor, "PnorDD::read(i_address=0x%llx)> ", i_address);
+ //TRACDCOMP(g_trac_pnor, "PnorDD::read(i_address=0x%llx)> ", i_address);
errlHndl_t l_err = NULL;
do{
@@ -194,7 +195,7 @@ errlHndl_t PnorDD::write(void* i_buffer,
size_t& io_buflen,
uint64_t i_address)
{
- TRACDCOMP(g_trac_pnor, "PnorDD::write(i_address=0x%llx)> ", i_address);
+ //TRACDCOMP(g_trac_pnor, "PnorDD::write(i_address=0x%llx)> ", i_address);
errlHndl_t l_err = NULL;
do{
@@ -272,7 +273,7 @@ PnorDD::PnorDD()
PnorDD::~PnorDD()
{
- //Nothing todo for now
+ //Nothing to do for now
}
errlHndl_t PnorDD::verifyAddressRange(uint64_t i_address,
@@ -282,10 +283,22 @@ errlHndl_t PnorDD::verifyAddressRange(uint64_t i_address,
do{
- if((i_address < FAKE_PNOR_START) ||
- ((i_address+i_length) > FAKE_PNOR_END))
+ if((i_address+i_length) > FAKE_PNOR_SIZE)
{
- //@TODO create errorlog
+ TRACFCOMP( g_trac_pnor, "PnorDD::verifyAddressRange> Invalid Address Requested : i_address=%d", i_address );
+ /*@
+ * @errortype
+ * @moduleid PNOR::MOD_PNORDD_VERIFYADDRESSRANGE
+ * @reasoncode PNOR::RC_INVALID_SECTION
+ * @userdata1 Requested Address
+ * @userdata2 Requested Length
+ * @devdesc PnorDD::verifyAddressRange> Invalid Address requested
+ */
+ l_err = new ERRORLOG::ErrlEntry(ERRORLOG::ERRL_SEV_UNRECOVERABLE,
+ PNOR::MOD_PNORDD_VERIFYADDRESSRANGE,
+ PNOR::RC_INVALID_ADDRESS,
+ TO_UINT64(i_address),
+ TO_UINT64(i_length));
break;
}
diff --git a/src/usr/pnor/pnordd.H b/src/usr/pnor/pnordd.H
index df953e203..ac5453807 100644
--- a/src/usr/pnor/pnordd.H
+++ b/src/usr/pnor/pnordd.H
@@ -17,7 +17,7 @@ enum lscMode
MMRD = 0, /**< Indicates PNOR is in MMRD Mode */
PMWR, /**< Indicates PNOR is in PMWR Mode */
- LAST_MODE = PMWR,
+ LAST_MODE,
};
diff --git a/src/usr/pnor/test/pnorddtest.H b/src/usr/pnor/test/pnorddtest.H
index a60d53efe..1ca7ed190 100644
--- a/src/usr/pnor/test/pnorddtest.H
+++ b/src/usr/pnor/test/pnorddtest.H
@@ -13,7 +13,8 @@
#include <errl/errltypes.H>
#include <pnor/pnorif.H>
#include <devicefw/userif.H>
-//#include "../pnordd.H"
+
+#define BASE_SCRATCH_SPACE 2*1024*1024+1024*512 //2.5MB offset in fake PNOR
extern trace_desc_t* g_trac_pnor;
using namespace TARGETING;
@@ -24,24 +25,26 @@ class PnorDdTest : public CxxTest::TestSuite
public:
/**
- * @brief PNOR DD test #1
+ * @brief PNOR DD readWriteTest
* Write some data to PNOR and read it back again
+ * Using fakePNOR scratch space (2.5 - 3 MB)
*/
- void testPnorDD1(void)
+ void test_readwrite(void)
{
//@TODO: make this table driven so it can test more values
- //@TODO: compare results with expected data.
//@TODO: Add some more interesting tests
TARGETING::Target* l_testTarget = MASTER_PROCESSOR_CHIP_TARGET_SENTINEL;
size_t l_size = sizeof(uint64_t);
errlHndl_t l_err = NULL;
+ uint64_t fails = 0;
+ uint64_t total = 4;
do{
- TS_TRACE("testPnorDD1: starting");
+ TS_TRACE("PnorDdTest::test_readwrite: starting");
// Perform PnorDD Write 1
- uint64_t l_address = 0x100;
+ uint64_t l_address = BASE_SCRATCH_SPACE+0x100;
uint64_t l_writeData = 0x12345678FEEDB0B0;
l_err = deviceWrite(l_testTarget,
&l_writeData,
@@ -49,19 +52,14 @@ class PnorDdTest : public CxxTest::TestSuite
DEVICE_PNOR_ADDRESS(0, l_address));
if (l_err)
{
- TS_FAIL("testPnorDD1: PNORDD write 1: deviceWrite() failed! Error committed.");
+ TS_FAIL("PnorDdTest::test_readwrite: PNORDD write 1: deviceWrite() failed! Error committed.");
+ fails++;
break;
}
- else
- {
- TS_TRACE("testPnorDD1: PNORDD write 1, Address 0x%llx, Data %llx",
- l_address,
- (long long unsigned)l_writeData);
- }
// Perform PnorDD Write 2
- l_address = 0x108;
+ l_address = BASE_SCRATCH_SPACE+0x108;
l_writeData = 0xFEEDBEEF000ABCDE;
l_err = deviceWrite(l_testTarget,
&l_writeData,
@@ -69,18 +67,73 @@ class PnorDdTest : public CxxTest::TestSuite
DEVICE_PNOR_ADDRESS(0, l_address));
if (l_err)
{
- TS_FAIL("testPnorDD1: PNORDD write 2: deviceWrite() failed! Error committed.");
+ TS_FAIL("PnorDdTest::test_readwrite: PNORDD write 2: deviceWrite() failed! Error committed.");
+ fails++;
break;
}
- else
+
+ // Perform PnorDD read 1
+ l_address = BASE_SCRATCH_SPACE+0x100;
+ uint64_t l_readData = 0;
+ l_err = deviceRead(l_testTarget,
+ &l_readData,
+ l_size,
+ DEVICE_PNOR_ADDRESS(0, l_address));
+ if (l_err)
{
- TS_TRACE("testPnorDD1: PNORDD write 2, Address 0x%llx, Data %llx",
- l_address,
- (long long unsigned)l_writeData);
+ TS_FAIL("PnorDdTest::test_readwrite: PNORDD read 1: deviceRead() failed! Error committed.");
+ fails++;
+ break;
+ }
+ else if(l_readData != 0x12345678FEEDB0B0)
+ {
+ TS_FAIL("PnorDdTest::test_readwrite: PNORDD read 1: Read data not expected value. Addr: 0x%llx, ExpData: 0x12345678FEEDB0B0, ActData: 0x%llx",
+ l_address, (long long unsigned)l_readData);
+ fails++;
+ break;
}
- // Perform PnorDD read 1
- l_address = 0x100;
+ // Perform PnorDD read 2
+ l_address = BASE_SCRATCH_SPACE+0x108;
+ l_err = deviceRead(l_testTarget,
+ &l_readData,
+ l_size,
+ DEVICE_PNOR_ADDRESS(0, l_address));
+ if (l_err)
+ {
+ TS_FAIL("PnorDdTest::test_readwrite: PNORDD read 2: deviceRead() failed! Error committed.");
+ break;
+ }
+ else if(l_readData != 0xFEEDBEEF000ABCDE)
+ {
+ TS_FAIL("PnorDdTest::test_readwrite: PNORDD read 2: Read data not expected value. Addr: 0x%llx, ExpData: 0xFEEDBEEF000ABCDE, ActData: 0x%llx",
+ l_address, (long long unsigned)l_readData );
+ fails++;
+ break;
+ }
+
+ }while(0);
+
+
+ TRACFCOMP(g_trac_pnor, "PnorDdTest::test_readwrite> %d/%d fails", fails, total );
+
+ };
+
+
+/*Not really a real test, just using to verify ext image is loading properly.
+Leaving it commented out because the test-case will not dynamically find the extended image based on the TOC
+// void testPnorDD2(void)
+ {
+
+ TARGETING::Target* l_testTarget = MASTER_PROCESSOR_CHIP_TARGET_SENTINEL;
+ size_t l_size = sizeof(uint64_t);
+ errlHndl_t l_err = NULL;
+
+ do{
+ TS_TRACE("testPnorDD2: starting");
+
+ //Read fakeext data
+ uint64_t l_address = 0x690;
uint64_t l_readData = 0;
l_err = deviceRead(l_testTarget,
&l_readData,
@@ -88,34 +141,36 @@ class PnorDdTest : public CxxTest::TestSuite
DEVICE_PNOR_ADDRESS(0, l_address));
if (l_err)
{
- TS_FAIL("testPnorDD1: PNORDD read 1: deviceRead() failed! Error committed.");
+ TS_FAIL("testPnorDD2: PNORDD read fakeext: deviceRead() failed! Error committed.");
break;
}
else
{
- TS_TRACE("testPnorDD1: PNORDD read 1, Address 0x%llx, Data %llx",
+ TS_TRACE("testPnorDD2: PNORDD read fakeext, Address 0x%llx, Data %llx",
l_address,
(long long unsigned)l_readData);
}
- // Perform PnorDD read 2
- l_address = 0x108;
+ //Read fakeext data
+ l_address = 0x698;
+ l_readData = 0;
l_err = deviceRead(l_testTarget,
&l_readData,
l_size,
DEVICE_PNOR_ADDRESS(0, l_address));
if (l_err)
{
- TS_FAIL("testPnorDD1: PNORDD read 2: deviceRead() failed! Error committed.");
+ TS_FAIL("testPnorDD2: PNORDD read fakeext: deviceRead() failed! Error committed.");
break;
}
else
{
- TS_TRACE("testPnorDD1: PNORDD read 2, Address 0x%llx, Data %llx",
+ TS_TRACE("testPnorDD2: PNORDD read fakeext, Address 0x%llx, Data %llx",
l_address,
(long long unsigned)l_readData);
}
+
}while(0);
@@ -123,7 +178,7 @@ class PnorDdTest : public CxxTest::TestSuite
};
-
+*/
};
OpenPOWER on IntegriCloud