From bcafb757808072be63d2ec0c2e61bca63bcf866e Mon Sep 17 00:00:00 2001 From: Marty Gloff Date: Thu, 17 Dec 2015 16:18:46 -0600 Subject: Deliver bootloader to fsp and pnor Minimal load application -- Create the main bootloader application that drives the load, verification, and relocation of the HBB image and that branches execution to the beginning of the HBB memory. Bootloader Stack Space -- Implement option of allocating stack space in main store apart from the bootloader image so as to not use up image space and to allow sufficient stack space. Deliver the HBBL (HostBoot BootLoader) image out to FIPS. Create an HBBL partition in the PNOR. Change-Id: I659f19428a8588c4b9bea13338efd46c70caaf43 RTC:137932 Depends-on:I740f6f8a707760756a261535e62e2d0a849324f8 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/809 Tested-by: Jenkins Server Reviewed-by: Christian R. Geddes Reviewed-by: Daniel M. Crowell Reviewed-by: William G. Hoffa --- src/include/bootloader/bootloader.H | 68 +++++++++++++++++++++++++++++++++---- 1 file changed, 61 insertions(+), 7 deletions(-) (limited to 'src/include/bootloader') diff --git a/src/include/bootloader/bootloader.H b/src/include/bootloader/bootloader.H index 89b4bd761..65b715c09 100644 --- a/src/include/bootloader/bootloader.H +++ b/src/include/bootloader/bootloader.H @@ -33,15 +33,17 @@ */ #include -#include +#include +#include +#include extern "C" void task_end_stub(); +extern "C" void enterHBB(uint64_t i_hbb_hrmor, uint64_t i_hbb_offset); #define assert(expr) \ {\ if (unlikely(!(expr)))\ {\ - MAGIC_INSTRUCTION(MAGIC_BREAK); /* @TODO RTC:133821 temp bringup */ \ task_end_stub();\ }\ } @@ -49,6 +51,14 @@ extern "C" void task_end_stub(); #define printk(format...) namespace Bootloader{ + /** + * @brief Pointer to bootloader scratch space + * + * Pointer to location in main storage which bootloader uses as + * scratch space + */ + extern uint8_t *g_blScratchSpace; + /** @enum MMIOLoadStoreSizes * @brief List of MMIO Load and Store Sizes. * @@ -81,13 +91,57 @@ namespace Bootloader{ uint32_t i_size, MMIOLoadStoreSizes i_ld_st_size); - /** - * @brief Pointer to bootloader scratch space + /** @enum HbbLengths + * @brief List of HBB lengths. * - * Pointer to location in main storage which bootloader uses as - * scratch space + * These are the lengths of the Hostboot Base data or instructions + * with and without ECC. */ - extern uint8_t *g_blScratchSpace; + enum HbbLengths + { + /** LENGTH_WO_ECC */ + LENGTH_WO_ECC = 8, + /** LENGTH_W_ECC */ + LENGTH_W_ECC = 9 + }; + + /** @enum HbAddrs + * @brief List of addresses where HBB and HBBL code is stored. + * + * These specify locations where the Hostboot Bootloader code is + * stored and where it stores the Hostboot Base code. The HBB code + * is copied to various locations as the HBBL works with it. Then + * HBB is copied to its running location and its execution is started. + */ + enum HbAddrs + { + // @TODO-RTC:138273-Support multiple nodes using relative HRMOR + + /** HRMOR */ + HBBL_HRMOR = 130*MEGABYTE, + HBB_HRMOR = 128*MEGABYTE, + + /** Location of working copy of HBB with ECC */ + HBB_ECC_WORKING_ADDR = (HBBL_HRMOR + 1*MEGABYTE), + + /** Location of HBBL */ + HBBL_ADDR = HBBL_HRMOR, + /** Location of HBBL exception vectors */ + HBBL_EXCEPTION_VECTORS_ADDR = HBBL_ADDR, + /** Location of HBBL code */ + HBBL_CODE_ADDR = HBBL_ADDR + 12*KILOBYTE, + /** Location of HBBL scratch space */ + HBBL_SCRATCH_SPACE_ADDR = HBBL_ADDR + 64*KILOBYTE, + + /** Location of working copy of HBB without ECC */ + HBB_WORKING_ADDR = (HBBL_HRMOR - 1*MEGABYTE), + /** Location of running copy of HBB */ + HBB_RUNNING_ADDR = (HBBL_HRMOR - 2*MEGABYTE), + /** Offset for starting running copy of HBB */ + HBB_RUNNING_OFFSET = 0, + /** Mask to indicate HRMOR should be ignored for the address */ + IGNORE_HRMOR_MASK = 0x8000000000000000ul + }; } // end namespace Bootloader #endif -- cgit v1.2.1