summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornagurram-in <nagendra.g@in.ibm.com>2016-12-22 04:38:01 -0600
committerWilliam G. Hoffa <wghoffa@us.ibm.com>2017-01-05 15:16:48 -0500
commit872acfd22f47d1eb77d695ff279b17e57924675d (patch)
tree89e5382b791c540170d8fd3d47bd2d7457b16f44
parent53e816f368c031c575628d863e6eaf2f347fa168 (diff)
downloadtalos-hostboot-872acfd22f47d1eb77d695ff279b17e57924675d.tar.gz
talos-hostboot-872acfd22f47d1eb77d695ff279b17e57924675d.zip
SP-LPC changes for P9 HDAT
Change-Id: I54564668fa88989a8744bf7cd2f2b8aa1c428698 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/34174 Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com> Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Reviewed-by: William G. Hoffa <wghoffa@us.ibm.com>
-rwxr-xr-xsrc/include/usr/hdat/hdat_reasoncodes.H4
-rwxr-xr-xsrc/usr/hdat/hdatspsubsys.C88
-rwxr-xr-xsrc/usr/hdat/hdatspsubsys.H41
3 files changed, 117 insertions, 16 deletions
diff --git a/src/include/usr/hdat/hdat_reasoncodes.H b/src/include/usr/hdat/hdat_reasoncodes.H
index 4a733343d..2eb0114f8 100755
--- a/src/include/usr/hdat/hdat_reasoncodes.H
+++ b/src/include/usr/hdat/hdat_reasoncodes.H
@@ -102,6 +102,7 @@ enum HDATModuleId
MOD_NACA_GET_MEM = 0x2b,
MOD_HBRT_LOAD_DATA = 0x2c,
MOD_UTIL_FULL_MVPD_READ_FUNC = 0x2d,
+ MOD_HDAT_SPSUBSYS_FILL_DATA_PTRS = 0x2e,
};
@@ -144,7 +145,8 @@ enum HDATReasonCode
RC_DATA_AREA_FAIL = HDAT_COMP_ID | 0x19,
RC_NULL_PTR_PASSED = HDAT_COMP_ID | 0x1a,
RC_INVALID_NACA = HDAT_COMP_ID | 0x1b,
- RC_DEV_READ_VPD_FAIL = HDAT_COMP_ID | 0x1c,
+ RC_DEV_READ_VPD_FAIL = HDAT_COMP_ID | 0x1c,
+ RC_NO_BMC_TARGET_FOUND = HDAT_COMP_ID | 0x1d,
};
} //namespace HDAT
diff --git a/src/usr/hdat/hdatspsubsys.C b/src/usr/hdat/hdatspsubsys.C
index 540d43e25..aa54f0869 100755
--- a/src/usr/hdat/hdatspsubsys.C
+++ b/src/usr/hdat/hdatspsubsys.C
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2016 */
+/* Contributors Listed Below - COPYRIGHT 2016,2017 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -38,6 +38,9 @@
#include <sys/mm.h>
#include <sys/mmio.h>
#include <pnor/pnorif.H>
+#include <lpc/lpc_const.H>
+#include <console/uartif.H>
+#include <ipmi/ipmiif.H>
#include <util/align.H>
#include "hdatspsubsys.H"
#include "hdathdif.H"
@@ -132,8 +135,6 @@ static errlHndl_t hdatGetPathInfo(
o_pathArray[o_arrayHdr.hdatArrayCnt].
hdatLinkStatus = HDAT_CURRENT_LINK;
o_pathArray[o_arrayHdr.hdatArrayCnt].hdatML2ChipVer = 0x10;
- o_pathArray[o_arrayHdr.hdatArrayCnt].
- hdatSlcaCnt = LPC_PATH_FRU_CNT_FOR_BMC;
// Get the master proc handle.
@@ -164,12 +165,46 @@ static errlHndl_t hdatGetPathInfo(
o_pathArray[o_arrayHdr.hdatArrayCnt].hdatProcChipId =
l_pMasterProcChipTargetHandle->getAttr<ATTR_ORDINAL_ID>();
- uint64_t l_gxcBaseAddr = 0;
- memcpy(&o_pathArray[o_arrayHdr.hdatArrayCnt].hdatGxcBaseAddr,
- &l_gxcBaseAddr,
- sizeof(o_pathArray[o_arrayHdr.hdatArrayCnt].hdatGxcBaseAddr));
}
+ o_pathArray[o_arrayHdr.hdatArrayCnt].hdatLPCHCBarIOAdrSpc =
+ LPC::LPCHC_IO_SPACE;
+ o_pathArray[o_arrayHdr.hdatArrayCnt].hdatLPCHCBarMemAdrSpc =
+ LPC::LPCHC_MEM_SPACE;
+ o_pathArray[o_arrayHdr.hdatArrayCnt].hdatLPCHCBarFwAdrSpc =
+ LPC::LPCHC_FW_SPACE;
+ o_pathArray[o_arrayHdr.hdatArrayCnt].hdatLPCHCBarIntRegSpc =
+ LPC::LPCHC_REG_SPACE;
+#ifdef CONFIG_CONSOLE
+ CONSOLE::UartInfo_t l_uartInfo = CONSOLE::getUartInfo();
+
+ o_pathArray[o_arrayHdr.hdatArrayCnt].hdatBarOfUARTDev =
+ l_uartInfo.lpcBaseAddr;
+ o_pathArray[o_arrayHdr.hdatArrayCnt].hdatSizeofUARTAdrSpc =
+ l_uartInfo.lpcSize;
+ o_pathArray[o_arrayHdr.hdatArrayCnt].hdatUARTFreqHz =
+ l_uartInfo.clockFreqHz;
+ o_pathArray[o_arrayHdr.hdatArrayCnt].hdatCurUARTDevBaudRate =
+ l_uartInfo.freqHz;
+ o_pathArray[o_arrayHdr.hdatArrayCnt].hdatUARTInterruptDetails.
+ hdatUARTIntrNum = l_uartInfo.interruptNum;
+ o_pathArray[o_arrayHdr.hdatArrayCnt].hdatUARTInterruptDetails.
+ hdatTriggerType = l_uartInfo.interruptTrigger;
+#endif
+
+#ifdef CONFIG_BMC_IPMI
+ IPMI::BmcInfo_t l_bmcInfo = IPMI::getBmcInfo();
+
+ o_pathArray[o_arrayHdr.hdatArrayCnt].hdatBARofBTDevAdrSpc =
+ l_bmcInfo.bulkTransferLpcBaseAddr;
+ o_pathArray[o_arrayHdr.hdatArrayCnt].hdatSizeofBTDevAdrSpc =
+ l_bmcInfo.bulkTransferSize;
+ o_pathArray[o_arrayHdr.hdatArrayCnt].hdatBTInterruptDetails.
+ hdatSMSAttnIntrNum = l_bmcInfo.smsAttnInterrupt;
+ o_pathArray[o_arrayHdr.hdatArrayCnt].hdatBTInterruptDetails.
+ hdatBMCtoHostRespIntrNum = l_bmcInfo.bmcToHostInterrupt;
+#endif
+
// LPC link doesn't have any FRU's in the path
// except the end points Service Processor and master proc
// The Fru's slca index should be populated for this entry by
@@ -357,6 +392,45 @@ errlHndl_t HdatSpSubsys::hdatFillDataPtrs()
iv_impl.hdatStatus = HDAT_SP_INSTALLED;
iv_impl.hdatStatus |= HDAT_SP_PRIMARY;
iv_impl.hdatStatus |= HDAT_SP_FUNCTIONAL;
+#if 0 // TODO : RTC 166755
+ TARGETING::PredicateCTM l_bmcFilter(CLASS_CHIP, TYPE_SP, MODEL_BMC);
+ TARGETING::PredicateHwas l_pred;
+ l_pred.present(true);
+ TARGETING::PredicatePostfixExpr l_presentSp;
+ l_presentSp.push(&l_bmcFilter).push(&l_pred).And();
+
+ TARGETING::TargetRangeFilter l_filter(
+ TARGETING::targetService().begin(),
+ TARGETING::targetService().end(),
+ &l_presentSp);
+
+ // As of now we are not supporting any other bmc stacks.But there is a scope for
+ // improvement here by using data driven approach. TODO : RTC@166476
+ if(l_filter)
+ {
+ strcpy( iv_impl.hdatBmcFamily , "ibm,bmc,openbmc");
+ }
+ else
+ {
+ /*@
+ * @errortype
+ * @moduleid HDAT::MOD_HDAT_SPSUBSYS_FILL_DATA_PTRS
+ * @reasoncode HDAT::RC_NO_BMC_TARGET_FOUND
+ * @devdesc No BMC target found
+ * @custdesc Firmware encountered an internal
+ * error while retrieving target data
+ */
+ hdatBldErrLog(l_errlHndl,
+ MOD_HDAT_SPSUBSYS_FILL_DATA_PTRS,
+ RC_NO_BMC_TARGET_FOUND,
+ 0,0,0,0);
+
+ HDAT_ERR("No BMC found on this machine");
+ break;
+
+ }
+#endif
+ strcpy( iv_impl.hdatBmcFamily , "ibm,ast2500,openbmc");
// Fill the FRU data
iv_fru.hdatSlcaIdx = 0;
diff --git a/src/usr/hdat/hdatspsubsys.H b/src/usr/hdat/hdatspsubsys.H
index 927bc13f0..9d91c1072 100755
--- a/src/usr/hdat/hdatspsubsys.H
+++ b/src/usr/hdat/hdatspsubsys.H
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2016 */
+/* Contributors Listed Below - COPYRIGHT 2016,2017 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -82,8 +82,27 @@ struct hdatSpImpl_t
uint16_t hdatStatus; // 0x0004 SP functionality/status
uint8_t hdatChipVer; // 0x0006 SP chip DD level
uint8_t hdatReserved1; // 0x0007 padding for alignment
+ char hdatBmcFamily[64]; // 0x0008 bmc family
} __attribute__ ((packed));
+/** @brief Structure for uart interrupt info
+*/
+struct uartIntData_t
+{
+ uint8_t hdatUARTIntrNum;// UART Interrupt number
+ uint8_t hdatTriggerType;// UART interrupt trigger type
+ uint8_t hdatResrved2[2];// Reserved
+};
+
+/** @brief Structure for Bulk Transfer Interrupt info
+*/
+
+struct btIntData_t
+{
+ uint8_t hdatSMSAttnIntrNum;
+ uint8_t hdatBMCtoHostRespIntrNum;
+ uint8_t hdatReserved[2];
+};
/** @brief Structure definition for the I/O path to the service processor
*/
@@ -92,13 +111,19 @@ struct hdatSpIoPath_t
uint16_t hdatPathType; // 0x0000 I/O path type
uint16_t hdatLinkStatus; // 0x0002 PSI Link status
uint8_t hdatML2ChipVer; // 0x0004 Chip DD level of ML2 controller
- uint8_t hdatResvd[1]; // 0x0005 Reserved
- uint16_t hdatSlcaCnt; // 0x0006 Count of entries in hdatSlxaIdx
- uint16_t hdatSlcaIdx[8]; // 0x0008 Array of SLCA indexes
- uint32_t hdatProcChipId; // 0x0018 Processor chip id
- uint8_t hdatResvd1[4]; // 0x001C Padding for alignment
- hdatMsAddr_t hdatGxcBaseAddr; // 0x0020 PSI GX Base address
-
+ uint8_t hdatResvd[3]; // 0x0005 Reserved
+ uint32_t hdatProcChipId; // 0x0008 Processor chip id
+ uint32_t hdatLPCHCBarIOAdrSpc; // 0x000C LPCHC BAR for I/O Adr Space
+ uint32_t hdatLPCHCBarMemAdrSpc; // 0x0010 LPCHC BAR for MemAdr Space
+ uint32_t hdatLPCHCBarFwAdrSpc; // 0x0014 LPCHC BAR for FW Adr Space
+ uint32_t hdatLPCHCBarIntRegSpc; // 0x0018 LPCHC BAR for Internal Reg Space
+ uint32_t hdatReserved1; // 0x001C Reserved
+ uint64_t hdatBarOfUARTDev; // 0x0020 BAR of UART device on LPC bus
+ uint32_t hdatSizeofUARTAdrSpc; // 0x0028 Size of UART device adr space
+ uint32_t hdatUARTFreqHz; // 0x002C Clock Frequcny of UART buad clock
+ uint32_t hdatCurUARTDevBaudRate;// 0x0030 Current Baud rate of UART device
+ uartIntData_t hdatUARTInterruptDetails; // 0x0034 UART interrupt details
+ btIntData_t hdatBTInterruptDetails; // 0x0048 Bulk Tansfer Interrupt Details
} __attribute__ ((packed));
#define HDAT_NON_FUNCTIONAL 0 // PSI link is not functional
OpenPOWER on IntegriCloud