diff options
author | Elizabeth Liner <eliner@us.ibm.com> | 2016-09-27 09:51:33 -0500 |
---|---|---|
committer | Daniel M. Crowell <dcrowell@us.ibm.com> | 2017-02-16 09:27:03 -0500 |
commit | 3b69a19abe72dffb47c5d088dc98d963d89f94e8 (patch) | |
tree | 1eba860231d445d236b5ea343644751291782b13 /src/usr/fsi/fsi_common.C | |
parent | a7304a5938ed39e09913ee2b6c085119bc7cb0b0 (diff) | |
download | talos-hostboot-3b69a19abe72dffb47c5d088dc98d963d89f94e8.tar.gz talos-hostboot-3b69a19abe72dffb47c5d088dc98d963d89f94e8.zip |
Adding FSI and PNOR interfaces for PRD FIRDATA in HBRT
Change-Id: I515a328e50536d92f0ab80229cd8d939f89412c7
RTC:127358
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/35008
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com>
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/usr/fsi/fsi_common.C')
-rw-r--r-- | src/usr/fsi/fsi_common.C | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/src/usr/fsi/fsi_common.C b/src/usr/fsi/fsi_common.C new file mode 100644 index 000000000..ca4f5c5a7 --- /dev/null +++ b/src/usr/fsi/fsi_common.C @@ -0,0 +1,65 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/usr/fsi/fsi_common.C $ */ +/* */ +/* OpenPOWER HostBoot Project */ +/* */ +/* Contributors Listed Below - COPYRIGHT 2016,2017 */ +/* [+] 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 */ +#include "fsi_common.H" +#include <fsi/fsiif.H> + +/** + * @brief Convert a type/port pair into a FSI address offset + */ +uint64_t FSI::getPortOffset(TARGETING::FSI_MASTER_TYPE i_type, + uint8_t i_port) +{ + uint64_t offset = 0; + if( TARGETING::FSI_MASTER_TYPE_MFSI == i_type ) + { + switch(i_port) + { + case(0): offset = FSI::MFSI_PORT_0; break; + case(1): offset = FSI::MFSI_PORT_1; break; + case(2): offset = FSI::MFSI_PORT_2; break; + case(3): offset = FSI::MFSI_PORT_3; break; + case(4): offset = FSI::MFSI_PORT_4; break; + case(5): offset = FSI::MFSI_PORT_5; break; + case(6): offset = FSI::MFSI_PORT_6; break; + case(7): offset = FSI::MFSI_PORT_7; break; + } + } + else if( TARGETING::FSI_MASTER_TYPE_CMFSI == i_type ) + { + switch(i_port) + { + case(0): offset = FSI::CMFSI_PORT_0; break; + case(1): offset = FSI::CMFSI_PORT_1; break; + case(2): offset = FSI::CMFSI_PORT_2; break; + case(3): offset = FSI::CMFSI_PORT_3; break; + case(4): offset = FSI::CMFSI_PORT_4; break; + case(5): offset = FSI::CMFSI_PORT_5; break; + case(6): offset = FSI::CMFSI_PORT_6; break; + case(7): offset = FSI::CMFSI_PORT_7; break; + } + } + + return offset; +} |