blob: dba62e3fe7c1e19e21397fb557126d68db490a81 [file] [log] [blame]
Matt Spinler9eda7bc2017-01-19 15:29:35 -06001From e21d90ae8c131eae9d78e3d06f29cab55c952884 Mon Sep 17 00:00:00 2001
2From: Matt Spinler <spinler@us.ibm.com>
3Date: Thu, 19 Jan 2017 09:06:48 -0600
4Subject: [PATCH] CFAM reg 0x2918 access hack
5
6---
7 libpdbg/bmcfsi.c | 11 ++++++++++-
8 1 file changed, 10 insertions(+), 1 deletion(-)
9
10diff --git a/libpdbg/bmcfsi.c b/libpdbg/bmcfsi.c
11index 64dbd69..f763f2a 100644
12--- a/libpdbg/bmcfsi.c
13+++ b/libpdbg/bmcfsi.c
14@@ -247,7 +247,16 @@ static uint64_t fsi_abs_ar(uint32_t addr, int read)
15 /* Reformat the address. I'm not sure I fully understand this
16 * yet but we basically shift the bottom byte and add 0b01
17 * (for the write word?) */
18- addr = ((addr & 0x1fff00) | ((addr & 0xff) << 2)) << 1;
19+
20+ /* Hack: this shifting doesn't work for all addresses, but it does
21+ * work for 2918 and (and 2nd chip 2918) so use it just for that */
22+ if ((addr == 0x2918) || (addr == 0x102918)) {
23+ addr = ((addr & 0x1ffe00) | ((addr & 0x1ff) << 2)) << 1;
24+ }
25+ else {
26+ addr = ((addr & 0x1fff00) | ((addr & 0xff) << 2)) << 1;
27+ }
28+
29 addr |= 0x3;
30 addr |= slave_id << 26;
31 addr |= (0x8ULL | !!(read)) << 22;
32--
332.11.0
34