diff options
Diffstat (limited to 'src/usr')
| -rw-r--r-- | src/usr/hwpf/hwp/build_winkle_images/build_winkle_images.C | 2 | ||||
| -rw-r--r-- | src/usr/hwpf/hwp/occ/occ.C | 47 | ||||
| -rw-r--r-- | src/usr/hwpf/hwp/start_payload/start_payload.C | 41 | ||||
| -rw-r--r-- | src/usr/targeting/common/util.C | 39 | ||||
| -rw-r--r-- | src/usr/targeting/common/xmltohb/simics_MURANO.system.xml | 8 | ||||
| -rw-r--r-- | src/usr/targeting/common/xmltohb/simics_VENICE.system.xml | 18 |
6 files changed, 115 insertions, 40 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 ff6e936f7..6a67bcd7c 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 @@ -382,7 +382,7 @@ void* call_host_build_winkle( void *io_pArgs ) l_memBase = get_top_mem_addr(); assert (l_memBase != 0, "host_build_winkle: Top of memory was 0!"); - l_memBase -= VMM_HOMER_REGION_SIZE; + l_memBase -= VMM_ALL_HOMER_OCC_MEMORY_SIZE; } TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace, "HOMER base = %x", l_memBase); diff --git a/src/usr/hwpf/hwp/occ/occ.C b/src/usr/hwpf/hwp/occ/occ.C index cea9c392c..e39d1e73f 100644 --- a/src/usr/hwpf/hwp/occ/occ.C +++ b/src/usr/hwpf/hwp/occ/occ.C @@ -36,6 +36,7 @@ #include <targeting/common/commontargeting.H> #include <targeting/common/utilFilter.H> #include <targeting/common/targetservice.H> +#include <targeting/common/util.H> // fapi support #include <fapi.H> @@ -185,12 +186,16 @@ namespace HBOCC * @param[in] i_target Target proc to load * @param[in] i_homerVirtAddrBase Virtual * address of current - * procs HOMER + * proc's HOMER + * @param[in] i_homerPhysAddrBase Physical + * address of current + * proc's HOMER * * @return errlHndl_t Error log image load failed */ errlHndl_t load(Target* i_target, - void* i_homerVirtAddrBase) + void* i_homerVirtAddrBase, + uint64_t i_homerPhysAddrBase) { errlHndl_t l_errl = NULL; uint64_t targHomer = 0; @@ -202,15 +207,13 @@ namespace HBOCC ENTER_MRK"HBOCC:load()" ); do{ - //Figure out OCC image offset for Target //OCC image offset = HOMER_SIZE*ProcPosition + // OCC offset within HOMR (happens to be zero) uint8_t tmpPos = i_target->getAttr<ATTR_POSITION>(); tmpOffset = tmpPos*VMM_HOMER_INSTANCE_SIZE + HOMER_OFFSET_TO_OCC_IMG; - targHomer = VMM_HOMER_REGION_START_ADDR + - tmpOffset; + targHomer = i_homerPhysAddrBase + tmpOffset; occVirt = reinterpret_cast<void *> (reinterpret_cast<uint64_t>(i_homerVirtAddrBase) @@ -284,7 +287,8 @@ namespace HBOCC // BAR3 is the OCC Common Area // Bar size is in MB, obtained value of 8MB from Tim Hallett const uint64_t bar3_size_MB = VMM_OCC_COMMON_SIZE_IN_MB; - const uint64_t occ_common_addr = VMM_OCC_COMMON_START_ADDR; + const uint64_t occ_common_addr = i_homerPhysAddrBase + + VMM_HOMER_REGION_SIZE; TRACUCOMP( g_fapiImpTd, INFO_MRK"OCC Common Address: 0x%.8X, size=0x%.8X", @@ -349,12 +353,16 @@ namespace HBOCC * @param[in] i_homerVirtAddrBase Base Virtual * address of all HOMER * images + * @param[in] i_homerPhysAddrBase Base Physical + * address of all HOMER + * images * * @return errlHndl_t Error log image load failed */ errlHndl_t loadnStartOcc(Target* i_target0, Target* i_target1, - void* i_homerVirtAddrBase) + void* i_homerVirtAddrBase, + uint64_t i_homerPhysAddrBase) { errlHndl_t l_errl = NULL; @@ -386,7 +394,8 @@ namespace HBOCC //============================== l_errl = load(i_target0, - i_homerVirtAddrBase); + i_homerVirtAddrBase, + i_homerPhysAddrBase); if(l_errl != NULL) { TRACFCOMP( g_fapiImpTd, ERR_MRK"loadnStartOcc: load failed for target 0" ); @@ -396,7 +405,8 @@ namespace HBOCC if(i_target1 != NULL) { l_errl = load(i_target1, - i_homerVirtAddrBase); + i_homerVirtAddrBase, + i_homerPhysAddrBase); if(l_errl != NULL) { TRACFCOMP( g_fapiImpTd, ERR_MRK"loadnStartOcc: load failed for target 1" ); @@ -525,9 +535,20 @@ namespace HBOCC assert(VMM_HOMER_REGION_SIZE <= THIRTYTWO_GB, "loadnStartAllOccs: Unsupported HOMER Region size"); + //If running Sapphire need to place this at the top of memory + uint64_t homerPhysAddrBase = VMM_HOMER_REGION_START_ADDR; + if(TARGETING::is_sapphire_load()) + { + homerPhysAddrBase = TARGETING::get_top_mem_addr(); + assert (homerPhysAddrBase != 0, + "loadnStartAllOccs: Top of memory was 0!"); + homerPhysAddrBase -= VMM_ALL_HOMER_OCC_MEMORY_SIZE; + } + TRACFCOMP( g_fapiTd, "HOMER is at %.16X", homerPhysAddrBase ); + //Map entire homer region into virtual memory homerVirtAddrBase = - mm_block_map(reinterpret_cast<void*>(VMM_HOMER_REGION_START_ADDR), + mm_block_map(reinterpret_cast<void*>(homerPhysAddrBase), VMM_HOMER_REGION_SIZE); TargetHandleList procChips; @@ -565,7 +586,8 @@ namespace HBOCC { l_errl = loadnStartOcc(*itr, NULL, - homerVirtAddrBase); + homerVirtAddrBase, + homerPhysAddrBase); if(l_errl) { TRACFCOMP( g_fapiImpTd, ERR_MRK"loadnStartAllOccs: loadnStartOcc failed!" ); @@ -614,7 +636,8 @@ namespace HBOCC TRACUCOMP( g_fapiImpTd, INFO_MRK"loadnStartAllOccs: calling loadnStartOcc." ); l_errl = loadnStartOcc(targ0, targ1, - homerVirtAddrBase); + homerVirtAddrBase, + homerPhysAddrBase); if(l_errl) { TRACFCOMP( g_fapiImpTd, ERR_MRK"loadnStartAllOccs: loadnStartOcc failed!" ); diff --git a/src/usr/hwpf/hwp/start_payload/start_payload.C b/src/usr/hwpf/hwp/start_payload/start_payload.C index b55ea4cbe..86f0e39c5 100644 --- a/src/usr/hwpf/hwp/start_payload/start_payload.C +++ b/src/usr/hwpf/hwp/start_payload/start_payload.C @@ -224,10 +224,11 @@ void* call_host_runtime_setup( void *io_pArgs ) = sys->getAttr<TARGETING::ATTR_PAYLOAD_KIND>(); - //Only run OCC in AVP mode. Run the rest in !AVP mode - if( is_avp_load() ) + //Start OCC in AVP (or Sapphire mode for now) + if( is_avp_load() || is_sapphire_load() ) { - TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace, "Skipping host_runtime_setup in AVP mode. Starting OCC" ); + TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace, "Starting OCC" ); + //Load modules needed by OCC bool occ_loaded = false; @@ -274,8 +275,9 @@ void* call_host_runtime_setup( void *io_pArgs ) } break; } - else if( is_sapphire_load() && - INITSERVICE::spLess()) + + if( is_sapphire_load() && + INITSERVICE::spLess()) { // Write the devtree out when in SPLess // Sapphire mode @@ -288,19 +290,16 @@ void* call_host_runtime_setup( void *io_pArgs ) break; } } - else //PHYP or SAPPHIRE with FSP + else if( TARGETING::PAYLOAD_KIND_PHYP == payload_kind ) { - //If PHYP then clean the PORE BARs - if( TARGETING::PAYLOAD_KIND_PHYP == payload_kind ) + //If PHYP then clear out the PORE BARs + l_err = clearPoreBars(); + if( l_err ) { - l_err = clearPoreBars(); - if( l_err ) - { - break; - } + break; } - //Update the MDRT value + //Update the MDRT value (for MS Dump) l_err = RUNTIME::write_MDRT_Count(); if(l_err != NULL) { @@ -319,6 +318,20 @@ void* call_host_runtime_setup( void *io_pArgs ) break; } } + else if( TARGETING::PAYLOAD_KIND_NONE == payload_kind ) + { + // Write the HostServices attributes into mainstore + // for our testcases + l_err = RUNTIME::populate_attributes(); + if ( l_err ) + { + TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace, + "Could not populate attributes" ); + // break from do loop if error occured + break; + } + } + // - Update HDAT/DEVTREE with tpmd logs diff --git a/src/usr/targeting/common/util.C b/src/usr/targeting/common/util.C index a53f2c88a..d592d411f 100644 --- a/src/usr/targeting/common/util.C +++ b/src/usr/targeting/common/util.C @@ -32,6 +32,7 @@ //****************************************************************************** #include <targeting/common/attributes.H> #include <targeting/common/targetservice.H> +#include <targeting/common/utilFilter.H> namespace TARGETING { @@ -194,5 +195,43 @@ bool is_avp_load(void) || (mnfg_flags & TARGETING::MNFG_FLAG_BIT_MNFG_HDAT_AVP_ENABLE)); } +/** + * @brief Utility function to obtain the highest known address in the system + */ +uint64_t get_top_mem_addr(void) +{ + uint64_t top_addr = 0; + + do + { + // Get all functional proc chip targets + TARGETING::TargetHandleList l_cpuTargetList; + TARGETING::getAllChips(l_cpuTargetList, TYPE_PROC); + + for ( size_t proc = 0; proc < l_cpuTargetList.size(); proc++ ) + { + TARGETING::Target * l_pProc = l_cpuTargetList[proc]; + + //Not checking success here as fail results in no change to + // top_addr + uint64_t l_mem_bases[8] = {0,}; + uint64_t l_mem_sizes[8] = {0,}; + l_pProc->tryGetAttr<TARGETING::ATTR_PROC_MEM_BASES>(l_mem_bases); + l_pProc->tryGetAttr<TARGETING::ATTR_PROC_MEM_SIZES>(l_mem_sizes); + + for (size_t i=0; i< 8; i++) + { + if(l_mem_sizes[i]) //non zero means that there is memory present + { + top_addr = std::max(top_addr, + l_mem_bases[i] + l_mem_sizes[i]); + } + } + } + }while(0); + + return top_addr; +} + } diff --git a/src/usr/targeting/common/xmltohb/simics_MURANO.system.xml b/src/usr/targeting/common/xmltohb/simics_MURANO.system.xml index 61c47d4c6..0bc8b5cd5 100644 --- a/src/usr/targeting/common/xmltohb/simics_MURANO.system.xml +++ b/src/usr/targeting/common/xmltohb/simics_MURANO.system.xml @@ -211,7 +211,7 @@ <default>10</default> </attribute> <attribute><id>PM_SPIVID_FREQUENCY</id> - <default>0b11</default> + <default>0x3</default> </attribute> <!-- End pm_plat_attributes.xml --> <attribute><id>MAX_EXS_PER_PROC_CHIP</id> @@ -364,7 +364,7 @@ <default>1250</default> </attribute> <attribute><id>PM_SPIVID_PORT_ENABLE</id> - <default>0b100</default><!-- PORT0NONRED --> + <default>0x4</default><!-- PORT0NONRED --> </attribute> <attribute><id>PM_SLEEP_TYPE</id></attribute> <attribute><id>PM_APSS_CHIP_SELECT</id> @@ -1119,7 +1119,7 @@ <default>1250</default> </attribute> <attribute><id>PM_SPIVID_PORT_ENABLE</id> - <default>0b000</default><!-- NONE --> + <default>0x0</default><!-- NONE --> </attribute> <attribute><id>PM_SLEEP_ENTRY</id></attribute> <attribute><id>PM_SLEEP_EXIT</id></attribute> @@ -2636,7 +2636,7 @@ <default>1250</default> </attribute> <attribute><id>PM_SPIVID_PORT_ENABLE</id> - <default>0b000</default><!-- NONE --> + <default>0x0</default><!-- NONE --> </attribute> <attribute><id>PM_SLEEP_ENTRY</id></attribute> <attribute><id>PM_SLEEP_EXIT</id></attribute> diff --git a/src/usr/targeting/common/xmltohb/simics_VENICE.system.xml b/src/usr/targeting/common/xmltohb/simics_VENICE.system.xml index 79db7a86f..0af784c87 100644 --- a/src/usr/targeting/common/xmltohb/simics_VENICE.system.xml +++ b/src/usr/targeting/common/xmltohb/simics_VENICE.system.xml @@ -337,7 +337,7 @@ <default>1250</default> </attribute> <attribute><id>PM_SPIVID_PORT_ENABLE</id> - <default>0b111</default><!-- REDUNDANT --> + <default>0x7</default><!-- REDUNDANT --> </attribute> <attribute><id>PM_SLEEP_ENTRY</id></attribute> <attribute><id>PM_SLEEP_EXIT</id></attribute> @@ -1458,7 +1458,7 @@ <default>1250</default> </attribute> <attribute><id>PM_SPIVID_PORT_ENABLE</id> - <default>0b111</default><!-- REDUNDANT --> + <default>0x7</default><!-- REDUNDANT --> </attribute> <attribute><id>PM_SLEEP_ENTRY</id></attribute> <attribute><id>PM_SLEEP_EXIT</id></attribute> @@ -2579,7 +2579,7 @@ <default>1250</default> </attribute> <attribute><id>PM_SPIVID_PORT_ENABLE</id> - <default>0b111</default><!-- REDUNDANT --> + <default>0x7</default><!-- REDUNDANT --> </attribute> <attribute><id>PM_SLEEP_ENTRY</id></attribute> <attribute><id>PM_SLEEP_EXIT</id></attribute> @@ -3699,7 +3699,7 @@ <default>1250</default> </attribute> <attribute><id>PM_SPIVID_PORT_ENABLE</id> - <default>0b111</default><!-- REDUNDANT --> + <default>0x7</default><!-- REDUNDANT --> </attribute> <attribute><id>PM_SLEEP_ENTRY</id></attribute> <attribute><id>PM_SLEEP_EXIT</id></attribute> @@ -4818,7 +4818,7 @@ <default>1250</default> </attribute> <attribute><id>PM_SPIVID_PORT_ENABLE</id> - <default>0b111</default><!-- REDUNDANT --> + <default>0x7</default><!-- REDUNDANT --> </attribute> <attribute><id>PM_SLEEP_ENTRY</id></attribute> <attribute><id>PM_SLEEP_EXIT</id></attribute> @@ -5906,7 +5906,7 @@ <default>1250</default> </attribute> <attribute><id>PM_SPIVID_PORT_ENABLE</id> - <default>0b111</default><!-- REDUNDANT --> + <default>0x7</default><!-- REDUNDANT --> </attribute> <attribute><id>PM_SLEEP_ENTRY</id></attribute> <attribute><id>PM_SLEEP_EXIT</id></attribute> @@ -6992,7 +6992,7 @@ <default>1250</default> </attribute> <attribute><id>PM_SPIVID_PORT_ENABLE</id> - <default>0b111</default><!-- REDUNDANT --> + <default>0x7</default><!-- REDUNDANT --> </attribute> <attribute><id>PM_SLEEP_ENTRY</id></attribute> <attribute><id>PM_SLEEP_EXIT</id></attribute> @@ -8079,7 +8079,7 @@ <default>1250</default> </attribute> <attribute><id>PM_SPIVID_PORT_ENABLE</id> - <default>0b111</default><!-- REDUNDANT --> + <default>0x7</default><!-- REDUNDANT --> </attribute> <attribute><id>PM_SLEEP_ENTRY</id></attribute> <attribute><id>PM_SLEEP_EXIT</id></attribute> @@ -16093,7 +16093,7 @@ <default>1250</default> </attribute> <attribute><id>PM_SPIVID_PORT_ENABLE</id> - <default>0b111</default><!-- REDUNDANT --> + <default>0x7</default><!-- REDUNDANT --> </attribute> <attribute><id>PM_SLEEP_ENTRY</id></attribute> <attribute><id>PM_SLEEP_EXIT</id></attribute> |

