diff options
author | Mark Wenning <wenning@us.ibm.com> | 2012-04-12 15:12:33 -0500 |
---|---|---|
committer | A. Patrick Williams III <iawillia@us.ibm.com> | 2012-05-08 09:50:06 -0500 |
commit | 6c5431a87a7730b50d50092f33078a5c9ddd6ca4 (patch) | |
tree | d08459d6f8f7f8f157acb9ece2d050a5f2dc989e /src/usr | |
parent | 32749fd1bcf7c34241f2ccee242c1cb611a65928 (diff) | |
download | talos-hostboot-6c5431a87a7730b50d50092f33078a5c9ddd6ca4.tar.gz talos-hostboot-6c5431a87a7730b50d50092f33078a5c9ddd6ca4.zip |
Call the Sleep/Winkle build HWP
RTC: 39785
Change-Id: I0e07c0f2a7827ee33bc0488e993734157b1850e1
Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/910
Tested-by: Jenkins Server
Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/usr')
-rw-r--r-- | src/usr/hwpf/hwp/build_winkle_images/build_winkle_images.C | 268 | ||||
-rw-r--r-- | src/usr/hwpf/hwp/build_winkle_images/build_winkle_images.H | 2 | ||||
-rw-r--r-- | src/usr/hwpf/hwp/build_winkle_images/makefile | 5 | ||||
-rw-r--r-- | src/usr/hwpf/hwp/makefile | 7 | ||||
-rw-r--r-- | src/usr/mvpd/makefile | 4 | ||||
-rw-r--r-- | src/usr/pnor/test/pnorddtest.H | 29 |
6 files changed, 233 insertions, 82 deletions
diff --git a/src/usr/hwpf/hwp/build_winkle_images/build_winkle_images.C b/src/usr/hwpf/hwp/build_winkle_images/build_winkle_images.C index 3ed8bfa38..d4525095e 100644 --- a/src/usr/hwpf/hwp/build_winkle_images/build_winkle_images.C +++ b/src/usr/hwpf/hwp/build_winkle_images/build_winkle_images.C @@ -1,36 +1,32 @@ -// IBM_PROLOG_BEGIN_TAG -// This is an automatically generated prolog. -// -// $Source: src/usr/hwpf/hwp/build_winkle_images/build_winkle_images.C $ -// -// IBM CONFIDENTIAL -// -// COPYRIGHT International Business Machines Corp. 2012 -// -// p1 -// -// Object Code Only (OCO) source materials -// Licensed Internal Code Source Materials -// IBM HostBoot Licensed Internal Code -// -// The source code for this program is not published or other- -// wise divested of its trade secrets, irrespective of what has -// been deposited with the U.S. Copyright Office. -// -// Origin: 30 -// -// IBM_PROLOG_END - +/* IBM_PROLOG_BEGIN_TAG + * This is an automatically generated prolog. + * + * $Source: src/usr/hwpf/hwp/build_winkle_images/build_winkle_images.C $ + * + * IBM CONFIDENTIAL + * + * COPYRIGHT International Business Machines Corp. 2012 + * + * p1 + * + * Object Code Only (OCO) source materials + * Licensed Internal Code Source Materials + * IBM HostBoot Licensed Internal Code + * + * The source code for this program is not published or other- + * wise divested of its trade secrets, irrespective of what has + * been deposited with the U.S. Copyright Office. + * + * Origin: 30 + * + * IBM_PROLOG_END_TAG + */ /** * @file build_winkle_images.C * * Support file for IStep: build_winkle_images * Build Winkle Images * - * ***************************************************************** - * THIS FILE WAS GENERATED ON 2012-04-11:1608 - * ***************************************************************** - * */ /******************************************************************************/ @@ -38,11 +34,14 @@ /******************************************************************************/ #include <stdint.h> +#include <vfs/vfs.H> // PORE image + #include <trace/interface.H> #include <initservice/taskargs.H> #include <errl/errlentry.H> #include <initservice/isteps_trace.H> +#include <initservice/initsvcreasoncodes.H> // targeting support #include <targeting/common/commontargeting.H> @@ -51,6 +50,10 @@ #include <fapi.H> #include <fapiPlatHwpInvoker.H> +#include <devicefw/userif.H> +#include <mvpd/mvpdenums.H> +#include <mvpd/mvpdreasoncodes.H> + #include "build_winkle_images.H" // Uncomment these files as they become available: @@ -62,8 +65,91 @@ namespace BUILD_WINKLE_IMAGES using namespace TARGETING; using namespace fapi; +using namespace DeviceFW; + +// @@@@@ CUSTOM BLOCK: @@@@@ + +/** + * @def pointer to area for output PORE image + * @todo - make system call to allocate 512k - 1M of space to put output + * image. Currently hardwired to 0x78000 + * + */ +void * const g_pOutputPoreImg + = reinterpret_cast<void * const >(OUTPUT_PORE_IMAGE); + +/** + * @brief Load PORE image and return a pointer to it, or NULL + * + * @param[in] - target pointer - pointer to the processor target, + * eventually we will need to know which processor to know + * which image to load. + * @param[out] - address of the PORE image + * @param[out] - size of the PORE image + * + * @return NULL if success, errorlog if failure + * + * @todo $$ Add code to UNload this image/module when all the + * HWP's are finished. + * + */ +errlHndl_t loadPoreImage( TARGETING::Target *i_CpuTarget, + const char *& o_rporeAddr, + size_t & o_rporeSize ) +{ + errlHndl_t l_errl = NULL; + const char * fileName = "procpore.dat"; + /** + * @todo add code here later to look up the IDEC of the processor and + * load the appropriate PORE image. Currently we just have the single + * image. + */ + do + { + // Load the file + TRACDCOMP( ISTEPS_TRACE::g_trac_isteps_trace, + "Load PORE file %s", + fileName ); + l_errl = VFS::module_load( fileName ); + + if ( l_errl ) + { + TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace, + "ERROR: opening binary PORE file: %s", + fileName ); + + // quit and return errorlog + break; + } + + // Get the starting address of the file/module + TRACDCOMP( ISTEPS_TRACE::g_trac_isteps_trace, + "Get starting address/size" ); + + l_errl = VFS::module_address( fileName, + o_rporeAddr, + o_rporeSize ); + if ( l_errl ) + { + TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace, + "ERROR: getting address of binary PORE file : %s", + fileName ); + + // quit and return errorlog + break; + } + + TRACDCOMP( ISTEPS_TRACE::g_trac_isteps_trace, + "PORE addr = 0x%p, size=0x%x", + o_rporeAddr, + o_rporeSize ); + + } while ( 0 ); + + return l_errl; +} // // Wrapper function to call 15.1 : @@ -72,47 +158,111 @@ using namespace fapi; void call_host_build_winkle( void *io_pArgs ) { errlHndl_t l_errl = NULL; + TARGETING::TargetService& l_targetService = targetService(); + uint8_t l_cpuNum = 0; - TRACDCOMP( ISTEPS_TRACE::g_trac_isteps_trace, + const char *l_pPoreImage = NULL; + size_t l_poreSize = 0; + void *l_pImageOut = NULL; + uint32_t l_sizeImageOut = 0; + + + TRACDCOMP( ISTEPS_TRACE::g_trac_isteps_trace, "call_host_build_winkle entry" ); -#if 0 // @@@@@ CUSTOM BLOCK: @@@@@ + // figure out what targets we need // customize any other inputs // set up loops to go through all targets (if parallel, spin off a task) - // dump physical path to targets - EntityPath l_path; - l_path = l_@targetN_target->getAttr<ATTR_PHYS_PATH>(); - l_path.dump(); + // Use PredicateIsFunctional to filter only functional chips + TARGETING::PredicateIsFunctional l_isFunctional; + + TARGETING::PredicateCTM l_procChipFilter( CLASS_CHIP, TYPE_PROC ); + TARGETING::PredicatePostfixExpr l_functionalAndProcChipFilter; + l_functionalAndProcChipFilter + .push(&l_procChipFilter) + .push(&l_isFunctional) + .And(); + TARGETING::TargetRangeFilter l_cpuFilter( + l_targetService.begin(), + l_targetService.end(), + &l_functionalAndProcChipFilter ); + + for ( l_cpuNum=0; l_cpuFilter; ++l_cpuFilter, l_cpuNum++ ) + { + // make a local copy of the CPU target + TARGETING::Target* l_cpu_target = *l_cpuFilter; + + TRACDCOMP( ISTEPS_TRACE::g_trac_isteps_trace, + "Run cpuNum 0x%x", + l_cpuNum ); + + // dump physical path to target + EntityPath l_path; + l_path = l_cpu_target->getAttr<ATTR_PHYS_PATH>(); + l_path.dump(); + + l_errl = loadPoreImage( l_cpu_target, + l_pPoreImage, + l_poreSize ); + if ( l_errl ) + { + TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace, + "host_build_winkle ERROR : Returning errorlog, PLID=0x%x", + l_errl->plid() ); + // drop out of loop and return errlog to fail. + break; + } + + // cast OUR type of target to a FAPI type of target. + const fapi::Target l_fapi_cpu_target( + TARGET_TYPE_PROC_CHIP, + reinterpret_cast<void *> + (const_cast<TARGETING::Target*>(l_cpu_target)) ); + + // + // stub - get address of output buffer for PORE image + // + l_pImageOut = g_pOutputPoreImg; - // cast OUR type of target to a FAPI type of target. - const fapi::Target l_fapi_@targetN_target( - TARGET_TYPE_MEMBUF_CHIP, - reinterpret_cast<void *> - (const_cast<TARGETING::Target*>(l_@targetN_target)) ); +#if 0 + // $$$$$ comment out for now $$$$$ + // call the HWP with each fapi::Target + FAPI_INVOKE_HWP( l_errl, + proc_slw_build, + l_fapi_cpu_target, + reinterpret_cast<const void*>(poreImage), + reinterpret_cast<uint32_t>(poreSize), + l_pImageOut, + &l_sizeImageOut + ); +#endif - // call the HWP with each fapi::Target - FAPI_INVOKE_HWP( l_errl, host_build_winkle, _args_...); - if ( l_errl ) - { - TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace, - "ERROR : .........." ); - errlCommit( l_errl, HWPF_COMP_ID ); - } - else - { - TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace, - "SUCCESS : .........." ); - } + if ( l_errl ) + { + TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace, + "host_build_winkle ERROR : Returning errorlog, PLID=0x%x", + l_errl->plid() ); + // drop out if we hit an error and quit. + break; + } + else + { + TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace, + "host_build_winkle SUCCESS : out image size = 0x%x ", + l_sizeImageOut ); + } + + } // endfor // @@@@@ END CUSTOM BLOCK: @@@@@ -#endif - TRACDCOMP( ISTEPS_TRACE::g_trac_isteps_trace, + + TRACDCOMP( ISTEPS_TRACE::g_trac_isteps_trace, "call_host_build_winkle exit" ); - // end task, returning any errorlogs to IStepDisp + // end task, returning any errorlogs to IStepDisp task_end2( l_errl ); } @@ -126,7 +276,7 @@ void call_proc_set_pore_bar( void *io_pArgs ) { errlHndl_t l_errl = NULL; - TRACDCOMP( ISTEPS_TRACE::g_trac_isteps_trace, + TRACDCOMP( ISTEPS_TRACE::g_trac_isteps_trace, "call_proc_set_pore_bar entry" ); #if 0 @@ -150,22 +300,22 @@ void call_proc_set_pore_bar( void *io_pArgs ) FAPI_INVOKE_HWP( l_errl, proc_set_pore_bar, _args_...); if ( l_errl ) { - TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace, + TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace, "ERROR : .........." ); errlCommit( l_errl, HWPF_COMP_ID ); } else { - TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace, + TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace, "SUCCESS : .........." ); } // @@@@@ END CUSTOM BLOCK: @@@@@ #endif - TRACDCOMP( ISTEPS_TRACE::g_trac_isteps_trace, + TRACDCOMP( ISTEPS_TRACE::g_trac_isteps_trace, "call_proc_set_pore_bar exit" ); - // end task, returning any errorlogs to IStepDisp + // end task, returning any errorlogs to IStepDisp task_end2( l_errl ); } diff --git a/src/usr/hwpf/hwp/build_winkle_images/build_winkle_images.H b/src/usr/hwpf/hwp/build_winkle_images/build_winkle_images.H index 8a7ca9f7c..7fda04299 100644 --- a/src/usr/hwpf/hwp/build_winkle_images/build_winkle_images.H +++ b/src/usr/hwpf/hwp/build_winkle_images/build_winkle_images.H @@ -33,7 +33,7 @@ * tasks by the @ref IStepDispatcher. * * ***************************************************************** - * THIS FILE WAS GENERATED ON 2012-04-11:1608 + * THIS FILE WAS GENERATED ON 2012-04-12:1228 * ***************************************************************** * */ diff --git a/src/usr/hwpf/hwp/build_winkle_images/makefile b/src/usr/hwpf/hwp/build_winkle_images/makefile index 61606d951..f03ef1d30 100644 --- a/src/usr/hwpf/hwp/build_winkle_images/makefile +++ b/src/usr/hwpf/hwp/build_winkle_images/makefile @@ -34,7 +34,7 @@ EXTRAINCDIR += ${ROOTPATH}/src/include/usr/hwpf/hwp ## pointer to common HWP files EXTRAINCDIR += ${ROOTPATH}/src/usr/hwpf/hwp/include -## NOTE: add the base istep dir here. +## NOTE: add the base istep dir here. EXTRAINCDIR += ${ROOTPATH}/src/usr/hwpf/hwp/build_winkle_images ## Include sub dirs @@ -46,11 +46,12 @@ EXTRAINCDIR += ${ROOTPATH}/src/usr/hwpf/hwp/build_winkle_images ## NOTE: add new object files when you add a new HWP OBJS = build_winkle_images.o - ## NOTE: add a new directory onto the vpaths when you add a new HWP ## EXAMPLE: # VPATH += ${ROOTPATH}/src/usr/hwpf/hwp/build_winkle_images/<HWP_dir> +## Point to the PORE image in PNOR +BINARY_FILES = $(IMGDIR)/procpore.dat:1f6e49c91e2a2b0df5fad6c215c8f09d9f19fce6 include ${ROOTPATH}/config.mk diff --git a/src/usr/hwpf/hwp/makefile b/src/usr/hwpf/hwp/makefile index 5bdb3a274..f32621d62 100644 --- a/src/usr/hwpf/hwp/makefile +++ b/src/usr/hwpf/hwp/makefile @@ -5,7 +5,7 @@ # # IBM CONFIDENTIAL # -# COPYRIGHT International Business Machines Corp. 2011 +# COPYRIGHT International Business Machines Corp. 2011 - 2012 # # p1 # @@ -19,7 +19,7 @@ # # Origin: 30 # -# IBM_PROLOG_END +# IBM_PROLOG_END_TAG ROOTPATH = ../../../.. MODULE = hwp @@ -38,12 +38,11 @@ OBJS = fapiTestHwp.o \ fapiHwpExecInitFile.o \ dimmBadDqBitmapFuncs.o \ dimmBadDqBitmapAccessHwp.o - + SUBDIRS = dmi_training.d sbe_centaur_init.d mc_init.d \ dram_training.d activate_powerbus.d build_winkle_images.d \ core_activate.d dram_initialization.d edi_ei_initialization.d \ establish_system_smp.d load_payload.d \ start_clocks_on_nest_chiplets.d start_payload.d - include ${ROOTPATH}/config.mk diff --git a/src/usr/mvpd/makefile b/src/usr/mvpd/makefile index fdd3a4439..5833a9238 100644 --- a/src/usr/mvpd/makefile +++ b/src/usr/mvpd/makefile @@ -19,7 +19,7 @@ # # Origin: 30 # -# IBM_PROLOG_END +# IBM_PROLOG_END_TAG ROOTPATH = ../../.. MODULE = mvpd @@ -27,6 +27,6 @@ OBJS = mvpd.o SUBDIRS = test.d -BINARY_FILES = $(IMGDIR)/procmvpd.dat:3f53917bea971716dd1005dcc889ff02e69b4a59 +BINARY_FILES = $(IMGDIR)/procmvpd.dat:e23067dae839f5b434ec12b5c86d2ae4fbb51259 include ${ROOTPATH}/config.mk diff --git a/src/usr/pnor/test/pnorddtest.H b/src/usr/pnor/test/pnorddtest.H index 0b81356b6..b191bdc29 100644 --- a/src/usr/pnor/test/pnorddtest.H +++ b/src/usr/pnor/test/pnorddtest.H @@ -40,7 +40,8 @@ #include <list> #include <targeting/common/attributes.H> -#define BASE_SCRATCH_SPACE (3*1024*1024+1024*512) //3.5MB offset in fake PNOR +//$$ #define BASE_SCRATCH_SPACE (3*1024*1024+1024*512) //3.5MB offset in fake PNOR +#define BASE_SCRATCH_SPACE (3*1024*1024) //3.0MB offset in fake PNOR extern trace_desc_t* g_trac_pnor; @@ -64,7 +65,7 @@ class PnorDdTest : public CxxTest::TestSuite { TARGETING::Target* l_testTarget = TARGETING::MASTER_PROCESSOR_CHIP_TARGET_SENTINEL; - size_t l_size = sizeof(uint64_t); + size_t l_size = sizeof(uint64_t); errlHndl_t l_err = NULL; uint64_t fails = 0; uint64_t total = 0; @@ -90,7 +91,7 @@ class PnorDdTest : public CxxTest::TestSuite total++; if(l_size != sizeof(uint64_t)) { - TS_FAIL("PnorDdTest::test_readwrite: PNORDD write 1: Write length not expected value. Addr: 0x%llx, Exp: %d, Act: %d", l_address, + TS_FAIL("PnorDdTest::test_readwrite: PNORDD write 1: Write length not expected value. Addr: 0x%llx, Exp: %d, Act: %d", l_address, sizeof(uint64_t), l_size); fails++; } @@ -113,7 +114,7 @@ class PnorDdTest : public CxxTest::TestSuite total++; if(l_size != sizeof(uint64_t)) { - TS_FAIL("PnorDdTest::test_readwrite: PNORDD write 2: Write length not expected value. Addr: 0x%llx, Exp: %d, Act: %d", l_address, + TS_FAIL("PnorDdTest::test_readwrite: PNORDD write 2: Write length not expected value. Addr: 0x%llx, Exp: %d, Act: %d", l_address, sizeof(uint64_t), l_size); fails++; } @@ -143,7 +144,7 @@ class PnorDdTest : public CxxTest::TestSuite total++; if(l_size != sizeof(uint64_t)) { - TS_FAIL("PnorDdTest::test_readwrite: PNORDD read 1: Read length not expected value. Addr: 0x%llx, Exp: %d, Act: %d", l_address, + TS_FAIL("PnorDdTest::test_readwrite: PNORDD read 1: Read length not expected value. Addr: 0x%llx, Exp: %d, Act: %d", l_address, sizeof(uint64_t), l_size); fails++; } @@ -172,7 +173,7 @@ class PnorDdTest : public CxxTest::TestSuite total++; if(l_size != sizeof(uint64_t)) { - TS_FAIL("PnorDdTest::test_readwrite: PNORDD read 2: Read length not expected value. Addr: 0x%llx, Exp: %d, Act: %d", l_address, + TS_FAIL("PnorDdTest::test_readwrite: PNORDD read 2: Read length not expected value. Addr: 0x%llx, Exp: %d, Act: %d", l_address, sizeof(uint64_t), l_size); fails++; } @@ -191,7 +192,7 @@ class PnorDdTest : public CxxTest::TestSuite { TARGETING::Target* l_testTarget = TARGETING::MASTER_PROCESSOR_CHIP_TARGET_SENTINEL; - size_t l_size = sizeof(uint64_t); + size_t l_size = sizeof(uint64_t); errlHndl_t l_err = NULL; uint64_t fails = 0; uint64_t total = 0; @@ -318,7 +319,7 @@ class PnorDdTest : public CxxTest::TestSuite { TARGETING::Target* l_testTarget = TARGETING::MASTER_PROCESSOR_CHIP_TARGET_SENTINEL; - size_t l_size = sizeof(uint64_t); + size_t l_size = sizeof(uint64_t); errlHndl_t l_err = NULL; uint64_t fails = 0; uint64_t total = 0; @@ -326,7 +327,7 @@ class PnorDdTest : public CxxTest::TestSuite do{ TS_TRACE("PnorDdTest::test_crossblock: starting"); - // Find the nearest erase-block (4K) boundary + // Find the nearest erase-block (4K) boundary uint64_t l_boundary = (BASE_SCRATCH_SPACE+4096) - (BASE_SCRATCH_SPACE%4096); uint64_t l_address = 0; @@ -381,7 +382,7 @@ class PnorDdTest : public CxxTest::TestSuite void test_readwrite_modes(void) { PnorDD* pnordd = NULL; - size_t l_size = sizeof(uint64_t); + size_t l_size = sizeof(uint64_t); errlHndl_t l_err = NULL; uint64_t fails = 0; uint64_t total = 0; @@ -533,7 +534,7 @@ class PnorDdTest : public CxxTest::TestSuite void test_smartwrite_modes(void) { PnorDD* pnordd = NULL; - size_t l_size = sizeof(uint64_t); + size_t l_size = sizeof(uint64_t); errlHndl_t l_err = NULL; uint64_t fails = 0; uint64_t total = 0; @@ -680,7 +681,7 @@ class PnorDdTest : public CxxTest::TestSuite void test_crossblock_modes(void) { PnorDD* pnordd = NULL; - size_t l_size = sizeof(uint64_t); + size_t l_size = sizeof(uint64_t); errlHndl_t l_err = NULL; uint64_t fails = 0; uint64_t total = 0; @@ -709,7 +710,7 @@ class PnorDdTest : public CxxTest::TestSuite } pnordd = new PnorDD(*m); - // Find the nearest erase-block (4K) boundary + // Find the nearest erase-block (4K) boundary uint64_t l_boundary = (BASE_SCRATCH_SPACE+4096) - (BASE_SCRATCH_SPACE%4096); uint64_t l_address = 0; @@ -769,7 +770,7 @@ Leaving it commented out because the test-case will not dynamically find the ext { TARGETING::Target* l_testTarget = MASTER_PROCESSOR_CHIP_TARGET_SENTINEL; - size_t l_size = sizeof(uint64_t); + size_t l_size = sizeof(uint64_t); errlHndl_t l_err = NULL; do{ |