From b975c978112d5fefef1f3e423886706ff205ff45 Mon Sep 17 00:00:00 2001 From: Sachin Gupta Date: Mon, 16 Jan 2017 10:47:51 -0600 Subject: Initialise empty section of l1 loader We have reserved 512 bytes for L1 loader. If size of L1 loader is less than 512 bytes, we want to zero fill rest of areat. That is required to ensure that that there is no are of PIBMEM which is not initalize. Change-Id: I85a9490540472aaee6c671bb317fb53f147ffc32 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/34937 Tested-by: Jenkins Server Reviewed-by: Sachin Gupta --- src/boot/loader_l1.S | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) (limited to 'src/boot') diff --git a/src/boot/loader_l1.S b/src/boot/loader_l1.S index 020a2912..eb35478f 100644 --- a/src/boot/loader_l1.S +++ b/src/boot/loader_l1.S @@ -5,7 +5,7 @@ /* */ /* OpenPOWER sbe Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2016 */ +/* Contributors Listed Below - COPYRIGHT 2016,2017 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -56,8 +56,7 @@ __l1Loader: _liw %r4, SBE_LOADER_BASE_ORIGIN # dest _liw %r9, SBE_SEEPROM_BASE_ORIGIN lwz r5, 4(r3) #size of image in bytes - li r6, 3 - srw r5, r5, r6 # Number of double word transfers + srawi r5, r5, 3 # Number of double word transfers mtctr r5 # set the counter for loop lwz r8, 0(r3) # offset of l2loader section adde r8, r8, r9 # add base address to offset to get absolute address @@ -69,6 +68,8 @@ copy_loop: addi r4, r4, 8 bdnz copy_loop + # initilaise empty section of L1 loader with 0 + bl __initPibmemL1Area ############################################################ # SBE entry function is 4 byte number in image header ############################################################ @@ -80,4 +81,24 @@ copy_loop: .epilogue __l1Loader +# initialise the PIBMEM section for l1 loader with 0 + +__initPibmemL1Area: + _liw %r3, SBE_LOADER_BASE_SECTION # Base Loader Section Location + _liw %r4, SBE_LOADER_BASE_ORIGIN # dest + lwz r5, 4(r3) #size of image in bytes + _liw %r6, SBE_LOADER_BASE_LENGTH #Max size of loader + add r4, r4, r5 + subf r5, r5, r6 + srawi r5, r5, 3 # Number of double word transfers + mtctr r5 # set the counter for loop + li r28, 0 + li r29, 0 +copy_loop_init: + stvd d28, 0(r4) + addi r4, r4, 8 + bdnz copy_loop_init + + blr + #include "pibmem_repair.S" -- cgit v1.2.1