diff options
author | Wael El-Essawy <welessa@us.ibm.com> | 2016-10-04 09:09:45 -0500 |
---|---|---|
committer | Wael El-Essawy <welessa@us.ibm.com> | 2016-10-11 17:44:46 -0400 |
commit | 609700b4ae20895c3d0713c8cfcb4717915b2bcd (patch) | |
tree | 3db0853a5230446428e865fe75cbc36ed6524b23 /src/occ_405/main.c | |
parent | c21550d3951c6b88f12de2b5aa9565a6c23b6bd4 (diff) | |
download | talos-occ-609700b4ae20895c3d0713c8cfcb4717915b2bcd.tar.gz talos-occ-609700b4ae20895c3d0713c8cfcb4717915b2bcd.zip |
Use HOMER Init Data
Enable reading and usage of HOMER init data.
i.e. nest frequency, attention type...
Change-Id: Ic9e0bc47fc110983e7e995191eda1ed6578a1ae8
RTC: 145754
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/30674
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Reviewed-by: William A. Bryan <wilbryan@us.ibm.com>
Reviewed-by: Martha Broyles <mbroyles@us.ibm.com>
Reviewed-by: Wael El-Essawy <welessa@us.ibm.com>
Diffstat (limited to 'src/occ_405/main.c')
-rwxr-xr-x | src/occ_405/main.c | 77 |
1 files changed, 32 insertions, 45 deletions
diff --git a/src/occ_405/main.c b/src/occ_405/main.c index b73c7cc..75c4476 100755 --- a/src/occ_405/main.c +++ b/src/occ_405/main.c @@ -1087,18 +1087,9 @@ int main(int argc, char **argv) // Get the homer version uint32_t l_homer_version = 0; - //l_homerrc = homer_hd_map_read_unmap(HOMER_VERSION, - // &l_homer_version, - // &l_ssxrc); - - //if ((HOMER_SUCCESS != l_homerrc) && (HOMER_SSX_UNMAP_ERR != l_homerrc)) - { - // Attempt to use max version if we can't read the homer. - //l_homer_version = HOMER_VERSION_MAX; - - // For Simics, assume Homer version 2 (no FIR support) - l_homer_version = HOMER_VERSION_2; - } + l_homerrc = homer_hd_map_read_unmap(HOMER_VERSION, + &l_homer_version, + &l_ssxrc); // Get proc_pb_frequency from HOMER host data and calculate the timebase // frequency for the OCC. Pass the timebase frequency to ssx_initialize. @@ -1107,19 +1098,18 @@ int main(int argc, char **argv) // HOMER, ie. if the MRW says that proc_pb_frequency is 2400 MHz, then // pass 600000000 (600MHz) - // The offset from the start of the HOMER is 0x00100000, we will need to + // The offset from the start of the HOMER is 0x000C0000, we will need to // create a temporary mapping to this section of the HOMER with ppc405_mmu_map - // (at address 0x00000000) read the value, convert it, and then unmap. + // (at address 0x800C0000) read the value, convert it, and then unmap. // Don't do a version check before reading the nest freq, it's present in // all HOMER versions. uint32_t l_tb_freq_hz = 0; - //l_homerrc2 = homer_hd_map_read_unmap(HOMER_NEST_FREQ, - // &l_tb_freq_hz, - // &l_ssxrc2); + l_homerrc2 = homer_hd_map_read_unmap(HOMER_NEST_FREQ, + &l_tb_freq_hz, + &l_ssxrc2); - //if ((HOMER_SUCCESS == l_homerrc2) || (HOMER_SSX_UNMAP_ERR == l_homerrc2)) - if(0) + if ((HOMER_SUCCESS == l_homerrc2) || (HOMER_SSX_UNMAP_ERR == l_homerrc2)) { // Data is in Mhz upon return and needs to be converted to Hz and then // quartered. @@ -1176,35 +1166,32 @@ int main(int argc, char **argv) // nest frequency which was required above to enable SSX and tracing). CHECKPOINT(HOMER_ACCESS_INITS); - if (l_homer_version >= HOMER_VERSION_2) + // Get OCC interrupt type from HOMER host data area. This will tell OCC + // which interrupt to Host it should be using. + uint32_t l_occ_int_type = 0; + l_homerrc = homer_hd_map_read_unmap(HOMER_INT_TYPE, + &l_occ_int_type, + &l_ssxrc); + + if ((HOMER_SUCCESS == l_homerrc) || (HOMER_SSX_UNMAP_ERR == l_homerrc)) { - // Get OCC interrupt type from HOMER host data area. This will tell OCC - // which interrupt to Host it should be using. - uint32_t l_occ_int_type = 0; - //l_homerrc = homer_hd_map_read_unmap(HOMER_INT_TYPE, - // &l_occ_int_type, - // &l_ssxrc); - - //if ((HOMER_SUCCESS == l_homerrc) || (HOMER_SSX_UNMAP_ERR == l_homerrc)) - if(0) - { - G_occ_interrupt_type = (uint8_t) l_occ_int_type; - } - else - { - // For Simics we are assuming the FSP communication path as the default - G_occ_interrupt_type = FSP_SUPPORTED_OCC; - //G_occ_interrupt_type = PSIHB_INTERRUPT; - } + G_occ_interrupt_type = (uint8_t) l_occ_int_type; + } + else + { + // if HOMER host data read fails, assume the FSP communication + // path as the default + G_occ_interrupt_type = FSP_SUPPORTED_OCC; + //G_occ_interrupt_type = PSIHB_INTERRUPT; + } - MAIN_TRAC_INFO("HOMER accessed, rc=%d, host interrupt type=%d, ssx_rc=%d", - l_homerrc, l_occ_int_type, l_ssxrc); + MAIN_TRAC_INFO("HOMER accessed, rc=%d, host interrupt type=%d, ssx_rc=%d", + l_homerrc, l_occ_int_type, l_ssxrc); - // Handle any errors from the interrupt type access - homer_log_access_error(l_homerrc, - l_ssxrc, - l_occ_int_type); - } + // Handle any errors from the interrupt type access + homer_log_access_error(l_homerrc, + l_ssxrc, + l_occ_int_type); /* //TEMP -- NO FIR SUPPORT if (l_homer_version >= HOMER_VERSION_3) |