summaryrefslogtreecommitdiffstats
path: root/src/bootloader
diff options
context:
space:
mode:
authorMarty Gloff <mgloff@us.ibm.com>2016-03-23 15:30:34 -0500
committerWilliam G. Hoffa <wghoffa@us.ibm.com>2016-04-05 13:25:22 -0400
commit6e0d21f16e8153125f8dbd2a8feb4ce56ff54e39 (patch)
tree6d2195550cb402f358beb46f6fb0ddce57a2136b /src/bootloader
parent2d6c5d55d9427de5fdb66ef880d19c9f5eb24328 (diff)
downloadtalos-hostboot-6e0d21f16e8153125f8dbd2a8feb4ce56ff54e39.tar.gz
talos-hostboot-6e0d21f16e8153125f8dbd2a8feb4ce56ff54e39.zip
Bootloader needs to dcbz the cache before using it
Add loops to do dcbz instructions. One loop covers L3 cache from the end of the Bootloader load to the end of the area used for storing a copy of HBB with ECC. The other loop covers L3 cache from the start of the area for storing the running copy of HBB to the start of the Bootloader load. Change-Id: If3bb157fe0ea1e61ed5db6c1264b5756cc8453d9 RTC:147380 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/22413 Tested-by: Jenkins Server Tested-by: FSP CI Jenkins Reviewed-by: Christian R. Geddes <crgeddes@us.ibm.com> Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com> Reviewed-by: CHRISTINA L. GRAVES <clgraves@us.ibm.com> Reviewed-by: William G. Hoffa <wghoffa@us.ibm.com>
Diffstat (limited to 'src/bootloader')
-rw-r--r--src/bootloader/bl_start.S49
1 files changed, 37 insertions, 12 deletions
diff --git a/src/bootloader/bl_start.S b/src/bootloader/bl_start.S
index 9af07a45f..a4cb577c0 100644
--- a/src/bootloader/bl_start.S
+++ b/src/bootloader/bl_start.S
@@ -25,6 +25,12 @@
.include "kernel/ppcconsts.S"
+.set SBE_HB_VERSION, sbe_hb_structures ;// uint32_t
+.set SBE_HB_SBEBOOTSIDE, sbe_hb_structures+4 ;// uint8_t
+.set SBE_HB_PNORBOOTSIDE, sbe_hb_structures+5 ;// uint8_t
+.set SBE_HB_PNORSIZEMB, sbe_hb_structures+6 ;// uint16_t
+.set SBE_HB_BLLOADSIZE, sbe_hb_structures+8 ;// uint64_t
+
.section .text.bootloaderasm
.global _start
@@ -70,18 +76,37 @@ _main:
lis r1, _start@h
addis r1, r1, 1 ;// 64k (1 * 0x10000)
- ;// Zero space from end of load to bottom of stack
- lis r3, end_load_address@h
- ori r3, r3, end_load_address@l
- li r4, 7
- add r3, r3, r4
- andc r3, r3, r4
- li r4, 0
-_zero_space_loop:
- std r4, 0(r3)
- addi r3, r3, 8
- cmpld cr7, r3, r1
- blt cr7, _zero_space_loop
+ ;// Do dcbz from end of Bootloader load to end of HBB ECC working space
+_dcbz_after_bl:
+ lis r5, SBE_HB_BLLOADSIZE@h
+ ori r5, r5, SBE_HB_BLLOADSIZE@l
+ ld r5, 0(r5) ;// get ending EA from SBE HB structure
+ lis r6, 0
+ addis r6, r6, 32 ;// 2M (32 * 0x10000)
+ addi r6, r6, -1 ;// end before 2M
+_dcbz_after_bl_loop:
+ dcbz 0,r5
+ addi r5, r5, 128
+ cmpld cr7, r5, r6
+ blt cr7, _dcbz_after_bl_loop
+
+ ;// Do dcbz from start of HBB running space to start of Bootloader load
+_dcbz_before_bl:
+ li r7, 1
+ rotldi r7, r7, 63 ;// set bit mask for ignoring HRMOR
+
+ lis r5, 0
+ addis r5, r5, 2048 ;// 128M (2048 * 0x10000) is start of HBB
+ or r5, r5, r7 ;// ignore HRMOR
+
+ mfspr r6, HRMOR ;// use HRMOR as start of Bootloader
+ addi r6, r6, -1 ;// end before Bootloader
+ or r6, r6, r7 ;// ignore HRMOR
+_dcbz_before_bl_loop:
+ dcbz 0,r5
+ addi r5, r5, 128
+ cmpld cr7, r5, r6
+ blt cr7, _dcbz_before_bl_loop
;// Call main.
bl main
OpenPOWER on IntegriCloud