summaryrefslogtreecommitdiffstats
path: root/src/usr/hwpf/plat
diff options
context:
space:
mode:
authorThi Tran <thi@us.ibm.com>2012-02-15 14:23:22 -0600
committerA. Patrick Williams III <iawillia@us.ibm.com>2012-02-20 10:00:23 -0600
commit0fdcf72d9262f74d933481497fe466ee0f4d5ffb (patch)
treedd40c9a60c9480b681c4ef5583b6e2e25178f1ff /src/usr/hwpf/plat
parent8aaee89b88f8c7bc75aa51f6db9feb2d236682d3 (diff)
downloadtalos-hostboot-0fdcf72d9262f74d933481497fe466ee0f4d5ffb.tar.gz
talos-hostboot-0fdcf72d9262f74d933481497fe466ee0f4d5ffb.zip
Fix CFAM register address calculation
Change CFAM SCAN trace to 32-bit values Update based on Patrick & Dan's comment Update based on Patrick's comment Change-Id: I003048f23656c2f2c043fb8c605442429cfbf973 Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/671 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/hwpf/plat')
-rw-r--r--src/usr/hwpf/plat/fapiPlatHwAccess.C13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/usr/hwpf/plat/fapiPlatHwAccess.C b/src/usr/hwpf/plat/fapiPlatHwAccess.C
index 5539caefc..18d7ad4a4 100644
--- a/src/usr/hwpf/plat/fapiPlatHwAccess.C
+++ b/src/usr/hwpf/plat/fapiPlatHwAccess.C
@@ -280,8 +280,9 @@ fapi::ReturnCode platGetCfamRegister(const fapi::Target& i_target,
// Perform CFAM read via FSI
// Address needs to be multiply by 4 because register addresses are word
- // offsets but the FSI addresses are byte offsets
- uint64_t l_addr = (i_address << 2);
+ // offsets but the FSI addresses are byte offsets.
+ // However, we need to preserve the engine's offset of 0x0C00 and 0x1000.
+ uint64_t l_addr = ((i_address & 0x003F) << 2) | (i_address & 0xFF00);
uint32_t l_data = 0;
size_t l_size = sizeof(uint32_t);
l_err = deviceRead(l_target,
@@ -345,7 +346,8 @@ fapi::ReturnCode platPutCfamRegister(const fapi::Target& i_target,
// Perform CFAM write via FSI
// Address needs to be multiply by 4 because register addresses are word
// offsets but the FSI addresses are byte offsets
- uint64_t l_addr = (i_address << 2);
+ // However, we need to preserve the engine's offset of 0x0C00 and 0x1000.
+ uint64_t l_addr = ((i_address & 0x003F) << 2) | (i_address & 0xFF00);
uint32_t l_data = i_data.getWord(0);
size_t l_size = sizeof(uint32_t);
l_err = deviceWrite(l_target,
@@ -434,8 +436,9 @@ fapi::ReturnCode platModifyCfamRegister(const fapi::Target& i_target,
// Read current value
// Address needs to be multiply by 4 because register addresses are word
- // offsets but the FSI addresses are byte offsets
- uint64_t l_addr = (i_address << 2);
+ // offsets but the FSI addresses are byte offsets.
+ // However, we need to preserve the engine's offset of 0x0C00 and 0x1000.
+ uint64_t l_addr = ((i_address & 0x003F) << 2) | (i_address & 0xFF00);
uint32_t l_data = 0;
size_t l_size = sizeof(uint32_t);
l_err = deviceRead(l_target,
OpenPOWER on IntegriCloud