diff options
author | Sachin Gupta <sgupta2m@in.ibm.com> | 2016-01-29 04:44:03 -0600 |
---|---|---|
committer | AMIT J. TENDOLKAR <amit.tendolkar@in.ibm.com> | 2016-03-16 08:49:45 -0400 |
commit | ef20438c35a75c8f1369ec229ab6453b6736be81 (patch) | |
tree | 128ac1f02c920f05351a5412e8c87e74856bdecf /sbe/sbefw | |
parent | aa9944c7e4b268a458f1f28478d9772edf8af2d8 (diff) | |
download | talos-sbe-ef20438c35a75c8f1369ec229ab6453b6736be81.tar.gz talos-sbe-ef20438c35a75c8f1369ec229ab6453b6736be81.zip |
HBBL input support
Change-Id: I9335651edfded154bffea166c92cc3007efe0ef9
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/11680
Tested-by: Jenkins Server
Reviewed-by: Santosh S. Puranik <santosh.puranik@in.ibm.com>
Reviewed-by: RAJA DAS <rajadas2@in.ibm.com>
Reviewed-by: AMIT J. TENDOLKAR <amit.tendolkar@in.ibm.com>
Diffstat (limited to 'sbe/sbefw')
-rw-r--r-- | sbe/sbefw/sbeXipUtils.H | 40 | ||||
-rw-r--r-- | sbe/sbefw/sbecmdiplcontrol.C | 18 |
2 files changed, 51 insertions, 7 deletions
diff --git a/sbe/sbefw/sbeXipUtils.H b/sbe/sbefw/sbeXipUtils.H new file mode 100644 index 00000000..c77b60c1 --- /dev/null +++ b/sbe/sbefw/sbeXipUtils.H @@ -0,0 +1,40 @@ +#ifndef SBE_XIP_UTILS_H +#define SBE_XIP_UTILS_H + +#include "p9_xip_image.h" +#include "ppe42_scom.h" // for PPE_STVD +#include "sbe_link.H" // for SBE_BASE_ORIGIN, SBE_SEEPROM_BASE_ORIGIN + +// Unconditional jump to a memory location +#define JUMP_TO_ADDR(VAL ) \ +{ \ +asm volatile ( \ + "mtlr %0 \n\t" \ + : \ + : "r" (VAL)); \ +asm volatile ( \ + "blr \n\t" \ + : \ + );\ +} + +// PIBMEM start address +const uint32_t g_pibMemAddr = SBE_BASE_ORIGIN; +// SEEPROM start address +const uint32_t g_headerAddr = SBE_SEEPROM_BASE_ORIGIN; +// IVPR register address +const uint32_t g_ivprLoc = 0xC0000160; + +// Get XIP image header +inline P9XipHeader * getXipHdr() +{ + P9XipHeader *hdr = (P9XipHeader *)( g_headerAddr ); + return hdr; +} + +// Get Section start addess +inline uint8_t * getSectionAddr( P9XipSection * i_section ) +{ + return ( (uint8_t *)( g_headerAddr + i_section->iv_offset)); +} +#endif // SBE_XIP_UTILS_H diff --git a/sbe/sbefw/sbecmdiplcontrol.C b/sbe/sbefw/sbecmdiplcontrol.C index c06676dd..36202e4c 100644 --- a/sbe/sbefw/sbecmdiplcontrol.C +++ b/sbe/sbefw/sbecmdiplcontrol.C @@ -53,6 +53,7 @@ #include "p9_sbe_instruct_start.H" #include "p9_sbe_load_bootloader.H" +#include "sbeXipUtils.H" // For getting hbbl offset // Forward declaration using namespace fapi2; ReturnCode sbeExecuteIstep (uint8_t i_major, uint8_t i_minor); @@ -500,14 +501,17 @@ ReturnCode istepWithCore( sbeIstepHwp_t i_hwp) ReturnCode istepLoadBootLoader( sbeIstepHwp_t i_hwp) { - ReturnCode rc = FAPI2_RC_SUCCESS; -#ifndef SBE_ISTEP_STUBBED - // TODO via RTC 135345 - // Send right Ex, address and size of HB loader + // Get master Ex + uint8_t exId = 0; Target<TARGET_TYPE_PROC_CHIP > proc = plat_getChipTarget(); - fapi2::Target<fapi2::TARGET_TYPE_EX > exTgt((uint64_t)7); - rc = p9_sbe_load_bootloader( proc, exTgt, 0, NULL ); -#endif + FAPI_ATTR_GET(fapi2::ATTR_MASTER_EX,proc,exId); + fapi2::Target<fapi2::TARGET_TYPE_EX > exTgt(exId); + // Get hbbl section + P9XipHeader *hdr = getXipHdr(); + P9XipSection *hbblSection = &(hdr->iv_section[P9_XIP_SECTION_HBBL]); + + ReturnCode rc = p9_sbe_load_bootloader( proc, exTgt, hbblSection->iv_size, + getSectionAddr(hbblSection) ); return rc; } |