summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDan Crowell <dcrowell@us.ibm.com>2015-02-17 10:46:28 -0600
committerA. Patrick Williams III <iawillia@us.ibm.com>2015-02-19 21:18:47 -0600
commit74b5d9951f657e62da93975e71f0c671e9791df5 (patch)
tree87b0130f8f932bcced1838893d5c78a7f080cb46 /src
parentd479744400ed31923540c1c99d01638f4d2de0f0 (diff)
downloadtalos-hostboot-74b5d9951f657e62da93975e71f0c671e9791df5.tar.gz
talos-hostboot-74b5d9951f657e62da93975e71f0c671e9791df5.zip
Fix I2C devtree values
Change-Id: Ibc78e9d1545ba6f973cc09185b90f08653d56111 Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/15785 Tested-by: Jenkins Server Reviewed-by: Joshua P. Rispoli <jprispol@us.ibm.com> Reviewed-by: Corey V. Swenson <cswenson@us.ibm.com> Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src')
-rw-r--r--src/include/usr/i2c/i2cif.H2
-rw-r--r--src/usr/devtree/bld_devtree.C5
-rwxr-xr-xsrc/usr/i2c/i2c.C3
3 files changed, 6 insertions, 4 deletions
diff --git a/src/include/usr/i2c/i2cif.H b/src/include/usr/i2c/i2cif.H
index f03e3bbcd..d9d5a0133 100644
--- a/src/include/usr/i2c/i2cif.H
+++ b/src/include/usr/i2c/i2cif.H
@@ -158,7 +158,7 @@ struct MasterInfo_t
{
uint64_t scomAddr; //< Base scom address for control regs
uint8_t engine; //< Engine number
- uint32_t freq; //< Clock frequency of master in Hz
+ uint32_t freq; //< Local Bus frequency of master in Hz
};
/**
diff --git a/src/usr/devtree/bld_devtree.C b/src/usr/devtree/bld_devtree.C
index 8ea4de329..55d2485c1 100644
--- a/src/usr/devtree/bld_devtree.C
+++ b/src/usr/devtree/bld_devtree.C
@@ -235,8 +235,7 @@ void add_i2c_info( const TARGETING::Target* i_targ,
i_dt->addPropertyCell32(l_i2cNode, "chip-engine#", i2cm->engine);
const char* l_i2cCompatStrs[] = {l_masterName, NULL};
i_dt->addPropertyStrings(l_i2cNode, "compatible", l_i2cCompatStrs);
- i_dt->addPropertyCell32(l_i2cNode, "clock-frequency",
- i2cm->freq / 4); //Opal wants it pre-divided
+ i_dt->addPropertyCell32(l_i2cNode, "clock-frequency", i2cm->freq);
i_dt->addPropertyCell32(l_i2cNode, "#address-cells", 1);
i_dt->addPropertyCell32(l_i2cNode, "#size-cells", 0);
@@ -274,7 +273,7 @@ void add_i2c_info( const TARGETING::Target* i_targ,
*/
dtOffset_t l_busNode = i_dt->addNode( l_i2cNode,
"i2c-bus", eep->port );
- i_dt->addPropertyCell32(l_busNode, "reg", 0);
+ i_dt->addPropertyCell32(l_busNode, "reg", eep->port);
i_dt->addPropertyCell32(l_busNode, "bus-frequency", eep->busFreq);
i_dt->addPropertyCell32(l_busNode, "#address-cells", 1);
i_dt->addPropertyCell32(l_busNode, "#size-cells", 0);
diff --git a/src/usr/i2c/i2c.C b/src/usr/i2c/i2c.C
index 5b405fa70..6cc3bdf95 100755
--- a/src/usr/i2c/i2c.C
+++ b/src/usr/i2c/i2c.C
@@ -2980,6 +2980,9 @@ void getMasterInfo( const TARGETING::Target* i_chip,
info.scomAddr = 0x000A0000 + engine*0x20;
info.engine = engine;
info.freq = i2cGetNestFreq()*1000*1000; //convert MHz->Hz
+ // PIB_CLK = NEST_FREQ /4
+ // Local Bus = PIB_CLK / 4
+ info.freq = info.freq/16; //convert nest to local bus
o_info.push_back(info);
}
OpenPOWER on IntegriCloud