summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/bootloader.ld3
-rw-r--r--src/bootloader/bl_start.S49
-rw-r--r--src/usr/pnor/pnor_utils.C2
-rw-r--r--src/usr/pnor/pnor_utils.H2
-rw-r--r--src/usr/pnor/test/pnorutilsTest.H6
5 files changed, 45 insertions, 17 deletions
diff --git a/src/bootloader.ld b/src/bootloader.ld
index 0550a58b3..fbee6ccc8 100644
--- a/src/bootloader.ld
+++ b/src/bootloader.ld
@@ -24,6 +24,7 @@
/* */
/* IBM_PROLOG_END_TAG */
base_load_address = 0x00000000;
+sbe_hb_structures = 0x00000004;
/* @TODO-RTC:138273-Support multiple nodes using relative HRMOR */
/* Text section offset = 12KB (space reserved for exception vectors) */
text_load_address = 0x00003000;
@@ -32,6 +33,8 @@ SECTIONS
{
. = base_load_address;
+ . = sbe_hb_structures;
+
. = text_load_address;
.text ALIGN(0x0020): {
*(.text.intvects)
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
diff --git a/src/usr/pnor/pnor_utils.C b/src/usr/pnor/pnor_utils.C
index a78b5cdc1..96ab528ee 100644
--- a/src/usr/pnor/pnor_utils.C
+++ b/src/usr/pnor/pnor_utils.C
@@ -260,7 +260,7 @@ void PNOR::getSectionEnum (ffs_entry* i_entry,
*/
void PNOR::parseEntries (ffs_hdr* i_ffs_hdr,
uint32_t& io_errCode,
- SectionData_t *& io_TOC,
+ SectionData_t * io_TOC,
ffs_entry*& o_err_entry)
{
//Walk through all the entries in the table and parse the data.
diff --git a/src/usr/pnor/pnor_utils.H b/src/usr/pnor/pnor_utils.H
index 1ceada403..daff13c3b 100644
--- a/src/usr/pnor/pnor_utils.H
+++ b/src/usr/pnor/pnor_utils.H
@@ -217,7 +217,7 @@ void getSectionEnum (ffs_entry* i_entry,
*/
void parseEntries (ffs_hdr* i_ffs_hdr,
uint32_t& io_errCode,
- SectionData_t*& io_TOC,
+ SectionData_t* io_TOC,
ffs_entry*& o_err_entry);
} // End namespace PNOR
diff --git a/src/usr/pnor/test/pnorutilsTest.H b/src/usr/pnor/test/pnorutilsTest.H
index 937d59b85..c71f90e54 100644
--- a/src/usr/pnor/test/pnorutilsTest.H
+++ b/src/usr/pnor/test/pnorutilsTest.H
@@ -274,7 +274,7 @@ class pnorutilsTest : public CxxTest::TestSuite
//Mess up the checksum of an entry
l_tocBuffer[208] = 0xFF;
- PNOR::SectionData_t * l_TOC;
+ PNOR::SectionData_t l_TOC[PNOR::NUM_SECTIONS];
ffs_hdr* l_ffs_hdr = NULL;
PNOR::checkForNullBuffer(l_tocBuffer, l_errCode, l_ffs_hdr);
PNOR::checkHeader(l_ffs_hdr, l_errCode);
@@ -315,7 +315,7 @@ class pnorutilsTest : public CxxTest::TestSuite
l_tocBuffer[213] = 0xFF;
l_tocBuffer[214] = 0xFF;
- PNOR::SectionData_t * l_TOC;
+ PNOR::SectionData_t l_TOC[PNOR::NUM_SECTIONS];
ffs_hdr* l_ffs_hdr = NULL;
PNOR::checkForNullBuffer(l_tocBuffer, l_errCode, l_ffs_hdr);
PNOR::checkHeader(l_ffs_hdr, l_errCode);
@@ -338,4 +338,4 @@ class pnorutilsTest : public CxxTest::TestSuite
}
};
-#endif \ No newline at end of file
+#endif
OpenPOWER on IntegriCloud