Skip to content

Commit

Permalink
Fix Bl-To-Hb Data Issue
Browse files Browse the repository at this point in the history
This commit fixes an issue where data was incorrectly added to the
middle of the existing BlToHbData struct.  The secure settings
at fault have been moved to the end of the structure.

Change-Id: I9ecb3256325aaeb633e250cb60e4f4ffc6010dba
RTC:163094
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/42005
Reviewed-by: Martin Gloff <mgloff@us.ibm.com>
Reviewed-by: Stephen M. Cprek <smcprek@us.ibm.com>
Reviewed-by: Nicholas E. Bofferding <bofferdn@us.ibm.com>
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com>
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
  • Loading branch information
mabaiocchi authored and dcrowell77 committed Jun 17, 2017
1 parent 87824e3 commit 2895249
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/bootloader/bootloader.C
Expand Up @@ -123,7 +123,7 @@ namespace Bootloader{
{
// Add cases as additional versions are created
default:
g_blData->blToHbData.version = BLTOHB_MMIOBARS;
g_blData->blToHbData.version = BLTOHB_SECURE_OVERRIDES;
break;
}

Expand Down
19 changes: 10 additions & 9 deletions src/include/bootloader/bootloaderif.H
Expand Up @@ -54,9 +54,10 @@ const uint64_t BLTOHB_EYECATCHER = 0x23626C746F686200; // #BLTOHB\0
enum BlToHbDataVersion
{
// [release:4][version:4]
BLTOHB_INIT = 0x0000000900000001,
BLTOHB_SAB = 0x0000000900000002,
BLTOHB_MMIOBARS = 0x0000000900000003
BLTOHB_INIT = 0x0000000900000001,
BLTOHB_SAB = 0x0000000900000002,
BLTOHB_MMIOBARS = 0x0000000900000003,
BLTOHB_SECURE_OVERRIDES = 0x0000000900000004,
};


Expand All @@ -76,9 +77,9 @@ struct BlToHbData
secureRomSize(0), hwKeysHash(nullptr),
hwKeysHashSize(0), hbbHeader(nullptr),
hbbHeaderSize(0), secureAccessBit(0),
securityOverride(0), allowAttrOverrides(0),
xscomBAR(MMIO_GROUP0_CHIP0_XSCOM_BASE_ADDR),
lpcBAR(MMIO_GROUP0_CHIP0_LPC_BASE_ADDR) {}
lpcBAR(MMIO_GROUP0_CHIP0_LPC_BASE_ADDR),
securityOverride(0), allowAttrOverrides(0) {}

// Simple way to tell if data is valid
uint64_t eyeCatch;
Expand All @@ -100,14 +101,14 @@ struct BlToHbData
size_t hbbHeaderSize;
// Secure Setting - Secure Access Bit
bool secureAccessBit;
// Secure Setting - Security Override
bool securityOverride;
// Secure Setting - Allow Attribute Overrides in Securemode
bool allowAttrOverrides;
// XSCOM MMIO BAR
uint64_t xscomBAR;
// LPC MMIO BAR
uint64_t lpcBAR;
// Secure Setting - Security Override
bool securityOverride;
// Secure Setting - Allow Attribute Overrides in Securemode
bool allowAttrOverrides;
} __attribute__((packed));

/**
Expand Down
11 changes: 10 additions & 1 deletion src/kernel/bltohbdatamgr.C
Expand Up @@ -131,9 +131,18 @@ printk("Version=%lX\n",i_data.version);
if(iv_data.version >= Bootloader::BLTOHB_SAB)
{
iv_data.secureAccessBit = i_data.secureAccessBit;
iv_data.securityOverride = i_data.securityOverride;
}

if(iv_data.version >= Bootloader::BLTOHB_SECURE_OVERRIDES)
{
iv_data.securityOverride = i_data.securityOverride;
iv_data.allowAttrOverrides = i_data.allowAttrOverrides;
}
else
{
iv_data.securityOverride = 0;
iv_data.allowAttrOverrides = 0;
}

// Ensure Bootloader to HB structure has the MMIO members
if( iv_data.version >= Bootloader::BLTOHB_MMIOBARS )
Expand Down

0 comments on commit 2895249

Please sign in to comment.