diff options
author | Corey Swenson <cswenson@us.ibm.com> | 2018-12-07 16:49:09 -0600 |
---|---|---|
committer | Daniel M. Crowell <dcrowell@us.ibm.com> | 2019-01-14 10:20:13 -0600 |
commit | 37132b70227cde9f5896268a264b13e74703cf3d (patch) | |
tree | 935c6a2701d4f6d170886631f185db41ad65b6c6 /src/usr/pnor | |
parent | dd65f35941d2c97663f11223a3ba8b9b32e6b89d (diff) | |
download | talos-hostboot-37132b70227cde9f5896268a264b13e74703cf3d.tar.gz talos-hostboot-37132b70227cde9f5896268a264b13e74703cf3d.zip |
Generate error when pnor is not accessed via ipmi
Change-Id: Ia44001c45dbe5a0f4f51202136d2649bb365d73f
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/69585
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com>
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/usr/pnor')
-rw-r--r-- | src/usr/pnor/pnor_hiomapdd.C | 23 | ||||
-rw-r--r-- | src/usr/pnor/pnor_hiomapdd.H | 3 |
2 files changed, 23 insertions, 3 deletions
diff --git a/src/usr/pnor/pnor_hiomapdd.C b/src/usr/pnor/pnor_hiomapdd.C index 5f998fca1..2b7acf863 100644 --- a/src/usr/pnor/pnor_hiomapdd.C +++ b/src/usr/pnor/pnor_hiomapdd.C @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2011,2018 */ +/* Contributors Listed Below - COPYRIGHT 2011,2019 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -181,6 +181,14 @@ void getPnorInfo( PnorInfo_t& o_pnorInfo ) Singleton<PnorHiomapDD>::instance().getNorSize(); } +/** + * @brief Get HIOMAP PNOR access mode + */ +PNOR::hiomapMode getPnorAccessMode(void) +{ + return Singleton<PnorHiomapDD>::instance().getAccessMode(); +} + // Register access functions to DD framework DEVICE_REGISTER_ROUTE(DeviceFW::READ, DeviceFW::PNOR, @@ -218,18 +226,26 @@ uint32_t PnorHiomapDD::getNorWorkarounds(void) return iv_pnor->getNorWorkarounds(); } -static PnorIf* probeHiomapTransport(TARGETING::Target* i_target) +PNOR::hiomapMode PnorHiomapDD::getAccessMode(void) +{ + return iv_mode; +} + +static PnorIf* probeHiomapTransport(TARGETING::Target* i_target, + PNOR::hiomapMode& io_mode) { PnorIf* pnor; do { if ((pnor = PnorIpmiDD::probe(i_target))) { + io_mode = PNOR::PNOR_IPMI; break; } if ((pnor = PnorMboxDD::probe(i_target))) { + io_mode = PNOR::PNOR_MBOX; break; } } while (0); @@ -250,8 +266,9 @@ static PnorIf* probeHiomapTransport(TARGETING::Target* i_target) } PnorHiomapDD::PnorHiomapDD(TARGETING::Target* i_target) +:iv_mode(PNOR::PNOR_UNKNOWN) { - iv_pnor = probeHiomapTransport(i_target); + iv_pnor = probeHiomapTransport(i_target, iv_mode); } PnorHiomapDD::~PnorHiomapDD() diff --git a/src/usr/pnor/pnor_hiomapdd.H b/src/usr/pnor/pnor_hiomapdd.H index 8bda811d5..49e1e824d 100644 --- a/src/usr/pnor/pnor_hiomapdd.H +++ b/src/usr/pnor/pnor_hiomapdd.H @@ -49,6 +49,8 @@ class PnorHiomapDD : public PnorIf PnorHiomapDD(TARGETING::Target* i_target = NULL); ~PnorHiomapDD(); + PNOR::hiomapMode getAccessMode(void); + virtual errlHndl_t readFlash(void* o_buffer, size_t& io_buflen, uint64_t i_address); @@ -63,6 +65,7 @@ class PnorHiomapDD : public PnorIf private: PnorIf* iv_pnor; + PNOR::hiomapMode iv_mode; }; #endif |