summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarty Gloff <mgloff@us.ibm.com>2015-07-20 10:17:22 -0500
committerPatrick Williams <iawillia@us.ibm.com>2015-12-11 14:01:19 -0600
commit3187da27c464de6422ecb1bc12a085fc5b31f610 (patch)
tree6f428e9c8fa95fa1fb7255b8fe87fc15d1c58438
parent47aef30b4dd8cc9f6d8e05cbe8a7be0c0b7cd24b (diff)
downloadtalos-hostboot-3187da27c464de6422ecb1bc12a085fc5b31f610.tar.gz
talos-hostboot-3187da27c464de6422ecb1bc12a085fc5b31f610.zip
P9 - FakePNOR scripts for Nimbus simics
Tools/scripts to support a fake pnor configuration in Simics. Change-Id: Idf060cbfb589f3ccabde96d56bbe84b6cc9902a9 RTC:127337 Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/19176 Tested-by: Jenkins Server Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com> Reviewed-by: Christian Geddes <crgeddes@us.ibm.com> Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
-rw-r--r--src/build/buildpnor/makefile4
-rw-r--r--src/build/buildpnor/pnorLayoutFake.xml118
-rw-r--r--src/build/mkrules/dist.targets.mk2
-rwxr-xr-xsrc/build/mkrules/hbfw/img/makefile61
-rw-r--r--src/usr/errl/errlmanager.C4
-rw-r--r--src/usr/pnor/pnor_common.C5
-rw-r--r--src/usr/pnor/pnorrp.C30
-rw-r--r--src/usr/pnor/sfc_fake.C6
8 files changed, 212 insertions, 18 deletions
diff --git a/src/build/buildpnor/makefile b/src/build/buildpnor/makefile
index 0ba9842b1..748711761 100644
--- a/src/build/buildpnor/makefile
+++ b/src/build/buildpnor/makefile
@@ -5,7 +5,9 @@
#
# OpenPOWER HostBoot Project
#
-# COPYRIGHT International Business Machines Corp. 2012,2014
+# Contributors Listed Below - COPYRIGHT 2012,2015
+# [+] 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.
diff --git a/src/build/buildpnor/pnorLayoutFake.xml b/src/build/buildpnor/pnorLayoutFake.xml
new file mode 100644
index 000000000..3f58fba96
--- /dev/null
+++ b/src/build/buildpnor/pnorLayoutFake.xml
@@ -0,0 +1,118 @@
+<!-- IBM_PROLOG_BEGIN_TAG -->
+<!-- This is an automatically generated prolog. -->
+<!-- -->
+<!-- $Source: src/build/buildpnor/pnorLayoutFake.xml $ -->
+<!-- -->
+<!-- OpenPOWER HostBoot Project -->
+<!-- -->
+<!-- Contributors Listed Below - COPYRIGHT 2015 -->
+<!-- [+] 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 -->
+<!--
+Layout Description
+<metadata> Element -> Contains high-level information about the PNOR layout.
+ <imageSize> -> Size of PNOR image in bytes.
+ <blockSize> -> size of erase blocks in bytes.
+ <tocSize> -> size of each partition table
+ <sideAOffset> -> Location of Side A Partition Table
+ <sideBOffset> -> Location of Side B Partition Table
+ <side> -> Contains information about the side
+ <id> -> Id of the side (A or B)
+ <arrangement> -> Tag that specifies the arrangement of the side
+ (A-B-D or A-D-B)
+ A-B-D: Primary TOC (A),Backup TOC (B), and Section Information (Data - D)
+ A-D-B: Primary TOC (A), Section Information (Data - D), Backup TOC (B)
+ <golden/> -> Indicates that the side of the PNOR is golden
+</metadata>
+<section> Element -> Contains information about a PNOR Partition
+ <description> -> Text description of the partition.
+ Does not have to be machine readable.
+ <eyeCatch> -> Name of the Partition
+ <physicalOffset>-> Offset of the Partition in PNOR
+ in bytes.
+ <physicalSize> -> Size of the Partition in bytes.
+ <side> -> Side that this section is associated with.
+ could be (A, B, or sideless)
+ A - Section is associated with side A
+ B - Section is associated with side B
+ sideless - Indicates partition will be in both TOCs but
+ only one copy of the partition should be created
+ <testonly/> -> Indicates partition is used for internal testing only.
+ Partition should be skipped in production environments.
+ <ecc/> -> Indicates Partition should be ECC protected
+ <sha512Version/>-> Indicates Partition uses SHA512 for version information.
+ <sha512perEC/> -> Indicates SHA512 is used to indicate version for each
+ EC-specific image within the Partition.
+ <preserved/> -> Indicates Partition is preserved across code updates.
+</section>
+-->
+
+<pnor>
+ <metadata>
+ <!-- NOTE: buildpnor expects power of 2 size, go to 8M for 6M image -->
+ <!-- @FIXME RTC 132396 -->
+ <imageSize>0x800000</imageSize>
+ <blockSize>0x1000</blockSize>
+ <tocSize>0x1000</tocSize>
+ <sideAOffset>0x0</sideAOffset>
+ <sideBOffset>0x1000</sideBOffset>
+ <arrangement>A-B-D</arrangement>
+ <side>
+ <id>A</id>
+ </side>
+ </metadata>
+ <section>
+ <!-- NOTE: smaller than official layout for fake-PNOR -->
+ <description>Module VPD (256K) -only supports 4 processors</description>
+ <eyeCatch>MVPD</eyeCatch>
+ <physicalOffset>0x2000</physicalOffset>
+ <physicalRegionSize>0x40000</physicalRegionSize>
+ <side>sideless</side>
+ </section>
+ <section>
+ <!-- NOTE: smaller than official layout for fake-PNOR -->
+ <description>DIMM JEDEC (128K) -only supports 4 processors</description>
+ <eyeCatch>DJVPD</eyeCatch>
+ <physicalOffset>0x42000</physicalOffset>
+ <physicalRegionSize>0x20000</physicalRegionSize>
+ <side>sideless</side>
+ </section>
+ <section>
+ <!-- NOTE: smaller than official layout for fake-PNOR -->
+ <description>Hostboot Extended image (3MB)</description>
+ <eyeCatch>HBI</eyeCatch>
+ <physicalOffset>0x62000</physicalOffset>
+ <physicalRegionSize>0x500000</physicalRegionSize>
+ <side>sideless</side>
+ </section>
+ <section>
+ <!-- NOTE: smaller than official layout for fake-PNOR -->
+ <description>Hostboot Error Logs (64K)</description>
+ <eyeCatch>HBEL</eyeCatch>
+ <physicalOffset>0x562000</physicalOffset>
+ <physicalRegionSize>0x10000</physicalRegionSize>
+ <side>sideless</side>
+ </section>
+ <section>
+ <!-- NOTE: smaller than official layout for fake-PNOR -->
+ <description>Attribute Data (128k)</description>
+ <eyeCatch>HBD</eyeCatch>
+ <physicalOffset>0x572000</physicalOffset>
+ <physicalRegionSize>0x20000</physicalRegionSize>
+ <side>sideless</side>
+ </section>
+</pnor>
diff --git a/src/build/mkrules/dist.targets.mk b/src/build/mkrules/dist.targets.mk
index 06a9a65f5..f056cc93c 100644
--- a/src/build/mkrules/dist.targets.mk
+++ b/src/build/mkrules/dist.targets.mk
@@ -58,6 +58,7 @@ COPY_FILES = \
src/build/vpo/VBU_Cacheline.pm:vpo \
src/build/simics/hb-pnor-vpd-preload.pl:vpo \
src/build/buildpnor/pnorLayoutVpo.xml:vpo \
+ src/build/buildpnor/pnorLayoutFake.xml:vpo \
img/errlparser:tools,vpo,openpower \
img/hbotStringFile:tools,vpo,openpower \
img/isteplist.csv:tools,vpo,openpower \
@@ -202,6 +203,7 @@ fsp.tar_CONTENTS = \
src/build/buildpnor/buildSbePart.pl \
src/build/buildpnor/buildpnor.pl \
src/build/buildpnor/defaultPnorLayout.xml \
+ $(if $(FAKEPNOR), src/build/buildpnor/pnorLayoutFake.xml, ) \
img/simics_MURANO_targeting.bin \
img/simics_VENICE_targeting.bin \
img/simics_NAPLES_targeting.bin \
diff --git a/src/build/mkrules/hbfw/img/makefile b/src/build/mkrules/hbfw/img/makefile
index d59798ee2..1f29c09cb 100755
--- a/src/build/mkrules/hbfw/img/makefile
+++ b/src/build/mkrules/hbfw/img/makefile
@@ -53,6 +53,7 @@ ENGD_OBJPATH = ${HBFW_OBJPATH:S/hbfw\/img/engd\/href/g}
#################################################
BASE_IMAGE = hostboot.bin
EXT_IMAGE = hostboot_extended.bin
+EXT_FAKE_IMAGE = hostboot_extended.bin.fake
HBRT_IMAGE = hostboot_runtime.bin
HBRT_SHA_IMAGE = hostboot_runtime.sha.bin
HBRT_HEADER_IMAGE = hostboot_runtime.header.bin
@@ -71,10 +72,13 @@ TEMP_IMAGE = hostboot.temp.bin
TESTDATA = hbtestdata.bin
TESTDATA_ECC = hbtestdata.bin.ecc
HBEL_ECC_IMAGE = hbel.bin.ecc
+HBEL_IMAGE = hbel.bin
GUARD_ECC_IMAGE = guard.bin.ecc
GLOBAL_ECC_IMAGE = global.bin.ecc
DJVPD_ECC_IMAGE = djvpd.bin.ecc
+DJVPD_IMAGE = djvpd.bin
MVPD_ECC_IMAGE = mvpd.bin.ecc
+MVPD_IMAGE = mvpd.bin
CVPD_ECC_IMAGE = cvpd.bin.ecc
PAYLOAD_ECC_IMAGE = payload.bin.ecc
@@ -90,6 +94,7 @@ ALL_HB_IMAGES = ${BASE_IMAGES} \
${TESTDATA} ${TESTDATA_ECC} \
${HBEL_ECC_IMAGE} ${GUARD_ECC_IMAGE} ${GLOBAL_ECC_IMAGE} \
${DJVPD_ECC_IMAGE} ${MVPD_ECC_IMAGE} ${CVPD_ECC_IMAGE} \
+ ${HBEL_IMAGE} ${DJVPD_IMAGE} ${MVPD_IMAGE} \
${PAYLOAD_ECC_IMAGE}
cp_hbfiles: .SPECTARG
@@ -108,6 +113,9 @@ cp_hbfiles: .SPECTARG
# dd command will pad image up to the next 4K page
dd if=${EXT_IMAGE} of=${EXT_PAD_IMAGE} ibs=4k count=1280 conv=sync
ecc --inject ${EXT_PAD_IMAGE} --output ${EXT_ECC_IMAGE} --p8
+ .if(${FAKEPNOR} != "")
+ dd if=${EXT_IMAGE} of=${EXT_FAKE_IMAGE} ibs=5120k conv=sync
+ .endif
# Add version header w/ HBRT sha hash
echo -en VERSION\\0 > ${HBRT_SHA_IMAGE}
sha512sum ${HBRT_IMAGE} | awk '{print $$1}' | xxd -pr -r >> ${HBRT_SHA_IMAGE}
@@ -137,6 +145,9 @@ cp_hbfiles: .SPECTARG
# Fill the following partitions with FF's and then ECC them
dd if=/dev/zero bs=128K count=1 | tr "\000" "\377" > ${TEMP_IMAGE}
ecc --inject ${TEMP_IMAGE} --output ${HBEL_ECC_IMAGE} --p8
+ .if(${FAKEPNOR} != "")
+ dd if=/dev/zero bs=64K count=1 | tr "\000" "\377" > ${HBEL_IMAGE}
+ .endif
# GUARD partition
dd if=/dev/zero bs=16K count=1 | tr "\000" "\377" > ${TEMP_IMAGE}
ecc --inject ${TEMP_IMAGE} --output ${GUARD_ECC_IMAGE} --p8
@@ -146,9 +157,15 @@ cp_hbfiles: .SPECTARG
# DJVPD partition
dd if=/dev/zero bs=256K count=1 | tr "\000" "\377" > ${TEMP_IMAGE}
ecc --inject ${TEMP_IMAGE} --output ${DJVPD_ECC_IMAGE} --p8
+ .if(${FAKEPNOR} != "")
+ dd if=/dev/zero bs=128K count=1 | tr "\000" "\377" > ${DJVPD_IMAGE}
+ .endif
# MVPD partition
dd if=/dev/zero bs=512K count=1 | tr "\000" "\377" > ${TEMP_IMAGE}
ecc --inject ${TEMP_IMAGE} --output ${MVPD_ECC_IMAGE} --p8
+ .if(${FAKEPNOR} != "")
+ dd if=/dev/zero bs=256K count=1 | tr "\000" "\377" > ${MVPD_IMAGE}
+ .endif
# CVPD partition
dd if=/dev/zero bs=256K count=1 | tr "\000" "\377" > ${TEMP_IMAGE}
ecc --inject ${TEMP_IMAGE} --output ${CVPD_ECC_IMAGE} --p8
@@ -233,6 +250,7 @@ PNOR_BUILD_SCRIPT = ${buildpnor.pl:P}
.tryinclude <${.PATH:Ffips_pnor.mk}>
HOSTBOOT_DEFAULT_SECTIONS = HBB=${BASE_W_HEADER_ECC_IMAGE},HBI=${EXT_ECC_HEADER_IMAGE},HBRT=${HBRT_ECC_HEADER_IMAGE},TEST=${TESTDATA_ECC},TESTRO=${TESTDATA_ECC},HBEL=${HBEL_ECC_IMAGE},GUARD=${GUARD_ECC_IMAGE},GLOBAL=${GLOBAL_ECC_IMAGE},PAYLOAD=${PAYLOAD_ECC_IMAGE},CVPD=${CVPD_ECC_IMAGE},MVPD=${MVPD_ECC_IMAGE},DJVPD=${DJVPD_ECC_IMAGE}
+HOSTBOOT_FAKEPNOR_SECTIONS = HBI=${EXT_FAKE_IMAGE},HBEL=${HBEL_IMAGE},MVPD=${MVPD_IMAGE},DJVPD=${DJVPD_IMAGE}
HBFW_OBJPATH = ${.PATH:M*obj*}
@@ -245,6 +263,7 @@ MURANO_TARG_IMG_ECC = simics_MURANO_targeting.bin.ecc
NAPLES_TARG_IMG_ECC = simics_NAPLES_targeting.bin.ecc
VENICE_TARG_IMG_ECC = simics_VENICE_targeting.bin.ecc
NIMBUS_TARG_IMG_ECC = simics_NIMBUS_targeting.bin.ecc
+NIMBUS_TARG_IMG_FAKE = simics_NIMBUS_targeting.bin.fake
MURANO_SLW_IMG = ${ENGD_OBJPATH:Fs1.ref_image.hdr.bin}
NAPLES_SLW_IMG = ${ENGD_OBJPATH:Fs1.ref_image.hdr.bin}
VENICE_SLW_IMG = ${ENGD_OBJPATH:Fp8.ref_image.hdr.bin}
@@ -284,6 +303,8 @@ inject_ecc: build_sbe_partitions
ecc --inject ${TEMP_IMG} --output ${VENICE_TARG_IMG_ECC} --p8; \
dd if=${${NIMBUS_TARG_IMG}:P} of=${TEMP_IMG} ibs=1024k conv=sync; \
ecc --inject ${TEMP_IMG} --output ${NIMBUS_TARG_IMG_ECC} --p8; \
+ #for NIMBUS fake pnor skip version header
+ dd if=${${NIMBUS_TARG_IMG}:P} of=${NIMBUS_TARG_IMG_FAKE} ibs=4k count=32 skip=1 conv=sync; \
# SBE partition
dd if=${${MURANO_SBE_IMG}:P} of=${TEMP_IMG} ibs=256k conv=sync; \
ecc --inject ${TEMP_IMG} --output ${MURANO_SBE_IMG_ECC} --p8; \
@@ -311,13 +332,23 @@ MURANO_SECT = HBD=${MURANO_TARG_IMG_ECC},SBE=${MURANO_SBE_IMG_ECC},SBEC=${SBEC_I
NAPLES_SECT = HBD=${NAPLES_TARG_IMG_ECC},SBE=${NAPLES_SBE_IMG_ECC},SBEC=${SBEC_IMG_ECC},WINK=${NAPLES_LOCAL_SLW_IMG_ECC}
VENICE_SECT = HBD=${VENICE_TARG_IMG_ECC},SBE=${VENICE_SBE_IMG_ECC},SBEC=${SBEC_IMG_ECC},WINK=${VENICE_LOCAL_SLW_IMG_ECC}
NIMBUS_SECT = HBD=${NIMBUS_TARG_IMG_ECC},SBE=${NIMBUS_SBE_IMG_ECC},SBEC=${SBEC_IMG_ECC},WINK=${NIMBUS_LOCAL_SLW_IMG_ECC}
-
+FAKE_SECT = HBD=${NIMBUS_TARG_IMG_FAKE}
+
+# To build fake PNOR, set FAKEPNOR to filename of file to build,
+# ie, 'export FAKEPNOR=fake8m.pnor'
+# To not build fake PNOR, do not set FAKEPNOR or clear its setting,
+# ie, 'export FAKEPNOR='
+.if(${FAKEPNOR} != "")
+ FAKE_PNOR_IMG_INFO = \
+ ${FAKEPNOR}:pnorLayoutFake.xml:${FAKE_SECT},${HOSTBOOT_FAKEPNOR_SECTIONS}
+.endif
PNOR_IMG_INFO = \
murano.pnor:defaultPnorLayout.xml:${MURANO_SECT},${HOSTBOOT_DEFAULT_SECTIONS} \
naples.pnor:defaultPnorLayout.xml:${NAPLES_SECT},${HOSTBOOT_DEFAULT_SECTIONS} \
venice.pnor:defaultPnorLayout.xml:${VENICE_SECT},${HOSTBOOT_DEFAULT_SECTIONS} \
nimbus.pnor:defaultPnorLayout.xml:${NIMBUS_SECT},${HOSTBOOT_DEFAULT_SECTIONS} \
+ ${FAKE_PNOR_IMG_INFO} \
${FIPS_PNOR_INFO}
@@ -341,10 +372,19 @@ BUILD_SPECIFIC_IMAGE: .SPECTARG ${IMAGE_TARGET}
${IMAGE_TARGET}: ${IMAGE_LAYOUT} ${IMAGE_BINS} ${PNOR_BUILD_SCRIPT}
- .if(${PNOR} == ${IMAGE_TARGET} || ${PNOR} == "")
- ${PNOR_BUILD_SCRIPT} --pnorOutBin ${IMAGE_TARGET} \
- ${TARGET_TEST:b--test} --pnorLayout ${IMAGE_LAYOUT} \
- ${IMAGE_BIN_OPTION} --fpartCmd "fpart" --fcpCmd "fcp"
+ .if empty(FFSCMD)
+ .if(${PNOR} == ${IMAGE_TARGET} || ${PNOR} == "" || \
+ ${FAKEPNOR} == ${IMAGE_TARGET})
+ ${PNOR_BUILD_SCRIPT} --pnorOutBin ${IMAGE_TARGET} \
+ ${TARGET_TEST:b--test} --pnorLayout ${IMAGE_LAYOUT} \
+ ${IMAGE_BIN_OPTION} --fpartCmd "fpart" --fcpCmd "fcp"
+ .endif
+ .else
+ .if(${PNOR} == ${IMAGE_TARGET})
+ ${PNOR_BUILD_SCRIPT} --pnorOutBin ${IMAGE_TARGET} \
+ ${TARGET_TEST:b--test} --pnorLayout ${IMAGE_LAYOUT} \
+ ${IMAGE_BIN_OPTION} --ffsCmd "ffs"
+ .endif
.endif
.endif
@@ -353,19 +393,26 @@ build_pnor_images:.SPECTARG ${PNOR_IMG_INFO:S/^/__IMAGE_BUILD\//g}
clobber_build_pnor_images:
${PNOR_IMG_INFO:@image@${pnorimg:!rm -f ${image:s/:/ /g:xs/ .*//};!e}@}
-
#################################################
#Special target to copy images to flash dir for simics
#################################################
FLASH_DEST = $(MAKETOP)$(OBJECTDIRTOP)../images/$(CONTEXT)/lab/flash
FLASH_IMG = ${BASE_IMAGE} ${BASE_ECC_IMAGE}
+FAKE_PNOR = fake6m.pnor
update_images_for_sandbox: inject_ecc build_sbe_partitions build_pnor_images
mkdir -p ${FLASH_DEST}
#Copy hostboot base image to flash dir
${FLASH_IMG:@image@${baseimg:!cd ${FLASH_DEST}; cp -f ${.PATH:F${image}} ${image};!e}@}
+ #Truncate fake pnor image down to 6MB and copy to flash dir
+ ${FAKE_PNOR_IMG_INFO:@image@${pnorimg:!dd if=${image:s/:/ /g:xs/ .*//} of=${FAKE_PNOR} bs=6M count=1; \
+ cp -f ${FAKE_PNOR} ${FLASH_DEST}/${FAKE_PNOR};!e}@}
#Copy pnor images to flash dir
- ${PNOR_IMG_INFO:@image@${pnorimg:!cd ${FLASH_DEST}; if [ "${PNOR}" == "${image:s/:/ /g:xs/ .*//}" ] || [ "${PNOR}" == "" ]; then cp -f ${.PATH:F${image:s/:/ /g:xs/ .*//}} ${image:s/:/ /g:xs/ .*//}; fi !e}@}
+ ${PNOR_IMG_INFO:@image@${pnorimg:!cd ${FLASH_DEST}; \
+ if [ "${PNOR}" == "${image:s/:/ /g:xs/ .*//}" ] || \
+ [ "${PNOR}" == "" ] || \
+ [ "${FAKEPNOR}" == "${image:s/:/ /g:xs/ .*//}" ]; \
+ then cp -f ${.PATH:F${image:s/:/ /g:xs/ .*//}} ${image:s/:/ /g:xs/ .*//}; fi !e}@}
.endif
diff --git a/src/usr/errl/errlmanager.C b/src/usr/errl/errlmanager.C
index ff0e62304..fe48a2a8a 100644
--- a/src/usr/errl/errlmanager.C
+++ b/src/usr/errl/errlmanager.C
@@ -249,10 +249,8 @@ void ErrlManager::errlogMsgHndlr ()
case ERRLOG_ACCESS_PNOR_TYPE:
{
// PNOR is up and running now.
-// @todo-RTC:127337 Fake PNOR support
-#if (0)
setupPnorInfo();
-#endif
+
//We are done with the msg
msg_free(theMsg);
diff --git a/src/usr/pnor/pnor_common.C b/src/usr/pnor/pnor_common.C
index eeb2ed3fa..47eb670e8 100644
--- a/src/usr/pnor/pnor_common.C
+++ b/src/usr/pnor/pnor_common.C
@@ -33,6 +33,7 @@
#include <initservice/initserviceif.H>
#include <util/align.H>
#include <errl/errlmanager.H>
+#include <config.h> // @FIXME RTC 132398
// Trace definition
trace_desc_t* g_trac_pnor = NULL;
@@ -119,6 +120,7 @@ errlHndl_t PNOR::mmioToPhysicalOffset(uint64_t& o_hbbAddress)
errlHndl_t l_err = NULL;
do
{
+#ifndef CONFIG_SFC_IS_FAKE // @FIXME RTC 132398
uint64_t l_hbbMMIO = 0;
size_t l_size = sizeof(uint64_t);
TARGETING::Target* l_masterProc =
@@ -138,6 +140,9 @@ errlHndl_t PNOR::mmioToPhysicalOffset(uint64_t& o_hbbAddress)
l_hbbMMIO = (l_hbbMMIO >> 32) & PNOR::LPC_TOP_OF_FLASH_OFFSET;
o_hbbAddress = ((9*l_hbbMMIO) - (9*PNOR::LPC_SFC_MMIO_OFFSET)
- PNOR::PNOR_SIZE) /8;
+#else // @FIXME RTC 132398
+ o_hbbAddress = 1; // @FIXME RTC 132398
+#endif // @FIXME RTC 132398
} while (0);
return l_err;
}
diff --git a/src/usr/pnor/pnorrp.C b/src/usr/pnor/pnorrp.C
index 6b84e09e6..53b52bc46 100644
--- a/src/usr/pnor/pnorrp.C
+++ b/src/usr/pnor/pnorrp.C
@@ -479,15 +479,19 @@ errlHndl_t PnorRP::findTOC()
//while TOC not found and we are within the flash size
while((!l_foundTOC) && (l_tempHBB > 0) && (l_tempHBB < PNOR_SIZE))
{
+ printk("l_tempHBB=%lX\n",l_tempHBB); //@fixme RTC 132400
//Align HBB down -- looking at 0x0 or 0x2000000
l_toc = ALIGN_DOWN_X(l_tempHBB, l_shiftAmount*MEGABYTE);
+ printk("1) read l_toc=%lX\n",l_toc); //@fixme RTC 132400
l_err = readFromDevice(l_toc, l_chip, false, l_tocBuffer,
l_fatalError);
if(l_err)
{
+ printk("**error**\n"); //@fixme RTC 132400
TRACFCOMP(g_trac_pnor,"findTOC: readFromDevice failed "
"searching for primaryTOC");
- break;
+ delete l_err; //@fixme RTC 132401
+ //break; //@fixme RTC 132401
}
l_ffs_hdr = (ffs_hdr*)l_tocBuffer;
@@ -498,13 +502,15 @@ errlHndl_t PnorRP::findTOC()
//If TOC not found at 0x0 or 0x2000000
//Align HBB down + 8000 -- looking at 0x8000 or 0x2008000
l_toc += TOC_SIZE;
+ printk("2) read l_toc=%lX\n",l_toc); //@fixme RTC 132400
l_err = readFromDevice(l_toc, l_chip, false, l_tocBuffer,
l_fatalError);
if(l_err)
{
TRACFCOMP(g_trac_pnor,"findTOC: readFromDevice failed "
"searching for backupTOC for A-B-D arrangement");
- break;
+ delete l_err; //@fixme RTC 132401
+ //break; //@fixme RTC 132401
}
l_ffs_hdr = (ffs_hdr*)l_tocBuffer;
@@ -520,13 +526,15 @@ errlHndl_t PnorRP::findTOC()
// -- looking at 0x1FF8000 or 0x3FF8000
l_toc = ALIGN_X(l_tempHBB, l_shiftAmount*MEGABYTE);
l_toc -= TOC_SIZE;
+ printk("3) read l_toc=%lX\n",l_toc); //@fixme RTC 132400
l_err = readFromDevice(l_toc, l_chip, false, l_tocBuffer,
l_fatalError);
if(l_err)
{
TRACFCOMP(g_trac_pnor,"findTOC: readFromDevice failed"
"searching for backupTOC for A-D-B arrangement");
- break;
+ delete l_err; //@fixme RTC 132401
+ //break; //@fixme RTC 132401
}
l_ffs_hdr = (ffs_hdr*)l_tocBuffer;
@@ -548,17 +556,27 @@ errlHndl_t PnorRP::findTOC()
//found at least one TOC
if(l_foundTOC)
{
+ printk("valid toc - l_foundTOC=%d, l_toc=%lX\n",
+ l_foundTOC, l_toc); //@fixme RTC 132400
TRACFCOMP(g_trac_pnor, "findTOC> found at least one toc at 0x%X", l_toc);
//look for BACKUP_PART and read it
uint64_t l_backupTOC = INVALID_OFFSET;
PNOR::findPhysicalOffset(l_ffs_hdr,"BACKUP_PART",l_backupTOC);
+ printk("look for BACKUP_PART and read it - l_backupTOC=%lX\n",l_backupTOC); //@fixme RTC 132400
+ printk("l_ffs_hdr=%p\n",l_ffs_hdr); //@fixme RTC 132400
//figure out if the toc found belongs to the side we booted from
//or if it belongs to the other side
uint64_t l_foundHBB;
PNOR::findPhysicalOffset(l_ffs_hdr, "HBB", l_foundHBB);
bool l_isActiveTOC = (l_foundHBB == l_hbbAddr);
+ printk("figure out side - l_foundHBB=%lX, l_hbbAddr=%lX, l_isActiveTOC=%d\n",l_foundHBB,
+ l_hbbAddr, l_isActiveTOC); //@fixme RTC 132400
+ printk("l_ffs_hdr=%p\n",l_ffs_hdr); //@fixme RTC 132400
+ l_isActiveTOC = 1; //@fixme RTC 132401
+ printk("forced to true - l_isActiveTOC=%d\n",
+ l_isActiveTOC); //@fixme RTC 132400
#ifdef CONFIG_PNOR_TWO_SIDE_SUPPORT
uint64_t l_otherPrimaryTOC = INVALID_OFFSET;
@@ -682,6 +700,7 @@ errlHndl_t PnorRP::findTOC()
TRACFCOMP(g_trac_pnor,"findTOC>No valid TOC found, looked"
"at following addresses PrimaryTOC:0x%08X, BackupTOC:"
"0x%08X", l_toc, l_backupTOC);
+ printk("hitting INITSERVICE::doShutdown(PNOR::RC_PARTITION_TABLE_CORRUPTED)\n"); //@fixme RTC 132400
INITSERVICE::doShutdown(PNOR::RC_PARTITION_TABLE_CORRUPTED);
}
@@ -689,11 +708,14 @@ errlHndl_t PnorRP::findTOC()
}
else
{
+ printk("no valid toc - l_foundTOC=%d, l_toc=%lX\n",l_foundTOC, l_toc); //@fixme RTC 132400
+ printk("l_tocBuffer=%p\n",l_tocBuffer); //@fixme RTC 132400
+ sync();
//no valid TOC found
TRACFCOMP(g_trac_pnor, "No valid TOC found");
if (l_err)
{
- errlCommit(l_err, PNOR_COMP_ID);
+ //errlCommit(l_err, PNOR_COMP_ID); //@fixme RTC 132401
}
INITSERVICE::doShutdown(PNOR::RC_PARTITION_TABLE_NOT_FOUND);
}
diff --git a/src/usr/pnor/sfc_fake.C b/src/usr/pnor/sfc_fake.C
index 9071043a2..5f02214f5 100644
--- a/src/usr/pnor/sfc_fake.C
+++ b/src/usr/pnor/sfc_fake.C
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2014 */
+/* Contributors Listed Below - COPYRIGHT 2014,2015 */
/* [+] Google Inc. */
/* [+] International Business Machines Corp. */
/* */
@@ -47,9 +47,9 @@
// C o n s t a n t s
/*****************************************************************************/
-// By default we well use the top of the cache 4MB-8MB
+// By default we will use the top of the cache 4MB-10MB
#define FAKE_PNOR_START (4*MEGABYTE)
-#define FAKE_PNOR_END (8*MEGABYTE)
+#define FAKE_PNOR_END (10*MEGABYTE)
#define FAKE_PNOR_SIZE (FAKE_PNOR_END-FAKE_PNOR_START)
OpenPOWER on IntegriCloud