Skip to content

Commit

Permalink
Fix alignment issues in SBE-HB structure
Browse files Browse the repository at this point in the history
Add padding to keep all fields aligned to 8-bytes
Add explicit attribute to ensure structure is packed

Change-Id: I55ca10034d7adf3e766edb4d0071f649c7c90446
CQ: SW391259
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/41584
Reviewed-by: Martin Gloff <mgloff@us.ibm.com>
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Tested-by: PPE CI <ppe-ci+hostboot@us.ibm.com>
Tested-by: Hostboot CI <hostboot-ci+hostboot@us.ibm.com>
Reviewed-by: Thi N. Tran <thi@us.ibm.com>
Reviewed-by: Sachin Gupta <sgupta2m@in.ibm.com>
Reviewed-by: Jennifer A. Stofer <stofer@us.ibm.com>
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/41614
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com>
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
  • Loading branch information
dcrowell77 committed Jun 13, 2017
1 parent e1b36d9 commit 22441c2
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/import/chips/p9/procedures/hwp/nest/p9_sbe_hb_structures.H
Expand Up @@ -74,6 +74,8 @@ union BootloaderSecureSettings
};

// Structure starts at the bootloader zero address
// Note - this structure must remain 64-bit aligned to
// maintain compatibility with Hostboot
struct BootloaderConfigData_t
{
uint32_t version; // bytes 4:7 Version field so we know if there is new data being added
Expand All @@ -82,8 +84,10 @@ struct BootloaderConfigData_t
uint16_t pnorSizeMB; // bytes 10:11 Size of PNOR in MB [ATTR_PNOR_SIZE]
uint64_t blLoadSize; // bytes 12:19 Size of Load (Exception vectors and Bootloader)
BootloaderSecureSettings secureSettings ; // byte 20
uint64_t xscomBAR; // bytes 21:28 XSCOM MMIO BAR
uint64_t lpcBAR; // bytes 29:36 LPC MMIO BAR
};
uint8_t reserved[7]; // bytes 21:27 Reserved space to maintain 64-bit alignment
uint64_t xscomBAR; // bytes 28:35 XSCOM MMIO BAR
uint64_t lpcBAR; // bytes 36:43 LPC MMIO BAR
}; // Note: Want to use '__attribute__((packed))' but compiler won't let us


#endif

0 comments on commit 22441c2

Please sign in to comment.