diff options
author | Bill Schwartz <whs@us.ibm.com> | 2015-02-11 05:17:23 -0600 |
---|---|---|
committer | A. Patrick Williams III <iawillia@us.ibm.com> | 2015-02-28 05:45:10 -0600 |
commit | a50a539ac062255f4975bf7becb4a903ab75ae22 (patch) | |
tree | c2af7522ea78a7de7c5afdd2774f62cc369a2b6e /src/usr/devtree | |
parent | ab2957e461780b42fb378abcf954baa735dc948b (diff) | |
download | talos-hostboot-a50a539ac062255f4975bf7becb4a903ab75ae22.tar.gz talos-hostboot-a50a539ac062255f4975bf7becb4a903ab75ae22.zip |
Report pnor side booted up on A/B to OPAL
This story will use the getPnorInfo and getSideInfo interfaces
to fill in devtree entries informing Opal about the existence,
location, and state of PNOR sides that we know about. We will pass up a list
of TOCs associated with the active side and the inactive side.
RTC: 109703
Change-Id: I740b086a9e22a0bc167141e3565bf813e50d9a00
Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/15727
Reviewed-by: PRACHI GUPTA <pragupta@us.ibm.com>
Tested-by: Jenkins Server
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/usr/devtree')
-rw-r--r-- | src/usr/devtree/bld_devtree.C | 110 |
1 files changed, 110 insertions, 0 deletions
diff --git a/src/usr/devtree/bld_devtree.C b/src/usr/devtree/bld_devtree.C index 221d7db0e..f2e9438aa 100644 --- a/src/usr/devtree/bld_devtree.C +++ b/src/usr/devtree/bld_devtree.C @@ -405,6 +405,113 @@ void add_i2c_info( const TARGETING::Target* i_targ, } +void bld_getSideInfo(PNOR::SideId i_side, + uint32_t o_TOCaddress[2], + uint8_t & o_count, + bool & o_isGolden) +{ + errlHndl_t errhdl = NULL; + PNOR::SideInfo_t l_info; + + o_count = 0; + o_isGolden = false; + + errhdl = getSideInfo (i_side, l_info); + if (!errhdl) + { + // return the valid TOC offsets & count of valid TOCs + if (PNOR::INVALID_OFFSET != l_info.primaryTOC) + { + o_TOCaddress[o_count++] = l_info.primaryTOC; + } + if (PNOR::INVALID_OFFSET != l_info.backupTOC) + { + o_TOCaddress[o_count++] = l_info.backupTOC; + } + o_isGolden = l_info.isGolden; + } + else + { + // commit error and return 0 TOC offsets + errlCommit(errhdl, DEVTREE_COMP_ID); + } + + return; +} + +void bld_fdt_pnor(devTree * i_dt, + dtOffset_t i_parentNode) +{ + do + { + uint32_t l_active[2] = {PNOR::INVALID_OFFSET,PNOR::INVALID_OFFSET}; + uint32_t l_golden[2] = {PNOR::INVALID_OFFSET,PNOR::INVALID_OFFSET}; + uint8_t l_count = 0; + bool l_isGolden = false; + bool l_goldenFound = false; + uint8_t l_goldenCount = 0; + PNOR::PnorInfo_t l_pnorInfo; + + //Get pnor address and size + getPnorInfo (l_pnorInfo); + + dtOffset_t l_pnorNode = i_dt->addNode(i_parentNode, + "pnor", + l_pnorInfo.mmioOffset); + + const uint8_t l_isaLinkage = 0; // 0==Mem + uint32_t pnor_prop[3] = {l_isaLinkage, + l_pnorInfo.mmioOffset, + l_pnorInfo.flashSize}; + i_dt->addPropertyCells32(l_pnorNode, "reg", pnor_prop, 3); + + //Add Working/Active parition + bld_getSideInfo(PNOR::WORKING,l_active,l_count,l_isGolden); + if (l_count) // valid TOCs present + { + i_dt->addPropertyCells32(l_pnorNode, + "active-image-tocs", l_active, l_count); + // capture golden + if (l_isGolden) + { + l_golden[0] = l_active[0]; + l_golden[1] = l_active[1]; + l_goldenCount = l_count; + l_goldenFound = true; + } + } + +#if CONFIG_PNOR_TWO_SIDE_SUPPORT + //Add Alternate parition + uint32_t l_alternate[2] = {PNOR::INVALID_OFFSET,PNOR::INVALID_OFFSET}; + + bld_getSideInfo(PNOR::ALTERNATE,l_alternate,l_count,l_isGolden); + if (l_count) // valid TOCs present + { + i_dt->addPropertyCells32(l_pnorNode, + "alternate-image-tocs",l_alternate,l_count); + // capture golden + if (l_isGolden) + { + l_golden[0] = l_alternate[0]; + l_golden[1] = l_alternate[1]; + l_goldenCount = l_count; + l_goldenFound = true; + } + } +#endif + + //Include golden if there is one + if (l_goldenFound) + { + i_dt->addPropertyCells32(l_pnorNode, + "golden-image-tocs",l_golden,l_goldenCount); + } + + } while (0); + + return; +} void bld_xscom_node(devTree * i_dt, dtOffset_t & i_parentNode, const TARGETING::Target * i_pProc, uint32_t i_chipid) @@ -488,6 +595,8 @@ void bld_xscom_node(devTree * i_dt, dtOffset_t & i_parentNode, i_dt->addPropertyCell32(lpcNode, "#address-cells", 2); i_dt->addPropertyCell32(lpcNode, "#size-cells", 1); + bld_fdt_pnor (i_dt, lpcNode); + } /*NX*/ @@ -908,6 +1017,7 @@ void load_hbrt_image(uint64_t& io_address) } } + errlHndl_t bld_fdt_system(devTree * i_dt, bool i_smallTree) { errlHndl_t errhdl = NULL; |