summaryrefslogtreecommitdiffstats
path: root/sbe
diff options
context:
space:
mode:
authorSunil.Kumar <skumar8j@in.ibm.com>2016-03-28 05:39:12 -0500
committerPrachi Gupta <pragupta@us.ibm.com>2016-06-08 11:46:01 -0500
commitaa3aeb6f4dd59758316fd808a744f48b0c8b11ed (patch)
tree954e19871d9705ce8503ffa80c7518d81cf10465 /sbe
parent47a5377968c75bdbf15ab86d00c18b526b77fc71 (diff)
downloadtalos-sbe-aa3aeb6f4dd59758316fd808a744f48b0c8b11ed.tar.gz
talos-sbe-aa3aeb6f4dd59758316fd808a744f48b0c8b11ed.zip
Pibmem repair code
Change-Id: If2e768d82fa743241e413f619f34f33dcf8da04b Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/22517 Tested-by: Jenkins Server Reviewed-by: SRINIVAS V. POLISETTY <srinivan@in.ibm.com> Reviewed-by: Soma Bhanutej <soma.bhanu@in.ibm.com> Reviewed-by: Sachin Gupta <sgupta2m@in.ibm.com>
Diffstat (limited to 'sbe')
-rw-r--r--sbe/image/pm_loader.S4
-rw-r--r--sbe/image/pm_otprom_loader.S6
-rw-r--r--sbe/image/pm_pibmem_repair.S39
-rw-r--r--sbe/image/sbe_link.H3
4 files changed, 49 insertions, 3 deletions
diff --git a/sbe/image/pm_loader.S b/sbe/image/pm_loader.S
index 1f926181..db228f12 100644
--- a/sbe/image/pm_loader.S
+++ b/sbe/image/pm_loader.S
@@ -13,6 +13,8 @@
.section .loader_text, "ax", @progbits
+ .global _pibmemRepair
+
__vectors:
############################################################
@@ -25,6 +27,7 @@ __system_reset:
__pmLoader:
+ bl _pibmemRepair
_liw %r3, SBE_LOADER_BASE_SECTION # Base Loader Section Location
_liw %r4, SBE_LOADER_BASE_ORIGIN # dest
_liw %r9, SBE_SEEPROM_BASE_ORIGIN
@@ -53,3 +56,4 @@ copy_loop:
.epilogue __pmLoader
+#include "pm_pibmem_repair.S"
diff --git a/sbe/image/pm_otprom_loader.S b/sbe/image/pm_otprom_loader.S
index f98d42cc..d16849fe 100644
--- a/sbe/image/pm_otprom_loader.S
+++ b/sbe/image/pm_otprom_loader.S
@@ -26,7 +26,7 @@ __reserved:
# 0x0040 : otprom loader
#############################################################
_start:
-lis r4 , 0x50 #dummy instruction
+#lis r4 , 0x50 #dummy instruction
.org __reserved + 0x0040
.macro .pm_otprom_fixed_system
.section .fixed, "a", @progbits
@@ -41,7 +41,7 @@ __seeprom3_config_reg:
__otprom_magic_num:
.quad 0x584950205345504D
__sbe_config_reg:
- .quad 0x000A800060000000
+ .quad 0x000A80003C000000
.endm
oos_start: #R4 --> A0000 R5 --> 5003F R6 --> C000_0818
lis r4 , 0xA
@@ -70,7 +70,7 @@ oos_write_mode_reg:
b oos_write_mode_done
oos_load_const_brd:
- lis r2 , 0x6 #load constant BRD = 6 to first 2 bytes of R2
+ lis r2 , 0x3 #load constant BRD = 3 to first 2 bytes of R2
b oos_write_mode_reg
oos_write_mode_done:
diff --git a/sbe/image/pm_pibmem_repair.S b/sbe/image/pm_pibmem_repair.S
new file mode 100644
index 00000000..26cca971
--- /dev/null
+++ b/sbe/image/pm_pibmem_repair.S
@@ -0,0 +1,39 @@
+#include "sbe_link.H"
+#include "pk.h"
+
+.set d0 , 0
+ .text
+ .section .loader_text, "ax", @progbits
+
+_pibmemRepair:
+
+ _liw %r3, SBE_FIXED_SECTION # Fixed Section Location
+ _liw %r9, SBE_SEEPROM_BASE_ORIGIN
+ lwz r8, 0(r3) # offset of Fixed section
+ adde r8, r8, r9 # add base address to offset to get absolute address
+ lis r5, 0x8
+ ori r5, r5 , 0x800B #point to repair reg 0 addr
+ lis r0, 0x4000 # load repair #0 with 0x4000_0000 --> enable fence and repr_mux_sel is disabled
+ stvd d0, 0(r5)
+ lvd d0, 0(r8) # r8 was pointing to attributes
+ stvd d0, 1(r5) # store repair reg 1
+ lvd d0, 8(r8) # r8 was pointing to attributes
+ stvd d0, 2(r5) # store repair reg 2
+ lvd d0, 16(r8) # r8 was pointing to attributes
+ stvd d0, 3(r5) # store repair reg 3
+ lis r0, 0x8000 # load repair #0 with 0x8000_0000 --> disable fence and repr_mux_sel is enabled
+ stvd d0 , 0(r5)
+
+###################################################################
+########### Update DBG_LCL_REG to enable trace ####################
+###################################################################
+
+ lis r5, 0xc000 # local_reg_addr (R5 = C0000120)
+ ori r5, r5, 0x0120
+ andi. r0, r0, 0x0
+ andi. r1, r1, 0x0
+ oris r0, r0, 0x8A00 # set the bit 0 to enable the debug blot-on
+ stvd d0, 0(r5) # DBG_LCL_REG
+
+ blr # back to pm_loader
+
diff --git a/sbe/image/sbe_link.H b/sbe/image/sbe_link.H
index 46cc9f5c..f6eac1e7 100644
--- a/sbe/image/sbe_link.H
+++ b/sbe/image/sbe_link.H
@@ -72,5 +72,8 @@
/// The fixed section of Otprom
#define OTPROM_FIXED_SIZE (OTPROM_ORIGIN + 0x340)
+/// Sbe fixed sction for the pibmem repair
+#define SBE_FIXED_SECTION (SBE_SEEPROM_BASE_ORIGIN + SBE_XIP_TOC_OFFSET + 12)
+
#endif // __SBE_LINK_H
OpenPOWER on IntegriCloud