diff options
author | Adam Muhle <armuhle@us.ibm.com> | 2013-05-23 14:02:23 -0500 |
---|---|---|
committer | A. Patrick Williams III <iawillia@us.ibm.com> | 2013-06-03 13:06:14 -0500 |
commit | 337ef5a9a1f8a413644ae1cfd344896ba3c872ea (patch) | |
tree | 5e5cdd920cbdcf811e54e7b6e9e6481f7b17a3d9 /src/usr | |
parent | cf0ce1fae5dbdb9586146bf21c3e56d3a21baa9d (diff) | |
download | talos-hostboot-337ef5a9a1f8a413644ae1cfd344896ba3c872ea.tar.gz talos-hostboot-337ef5a9a1f8a413644ae1cfd344896ba3c872ea.zip |
Define User Data bits in PNOR TOC
Change-Id: Ie2bc561c2cfdbea32ba08d9e74bf1f36cf1f43cd
RTC: 66209
Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/4687
Tested-by: Jenkins Server
Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/usr')
-rw-r--r-- | src/usr/pnor/common/ffs_hb.H | 70 | ||||
-rw-r--r-- | src/usr/pnor/ffs.h | 55 | ||||
-rw-r--r-- | src/usr/pnor/pnorrp.C | 18 |
3 files changed, 75 insertions, 68 deletions
diff --git a/src/usr/pnor/common/ffs_hb.H b/src/usr/pnor/common/ffs_hb.H index 489e65434..6174c24ee 100644 --- a/src/usr/pnor/common/ffs_hb.H +++ b/src/usr/pnor/common/ffs_hb.H @@ -1,26 +1,25 @@ -/* IBM_PROLOG_BEGIN_TAG - * This is an automatically generated prolog. - * - * $Source: src/usr/pnor/common/ffs_hb.H $ - * - * IBM CONFIDENTIAL - * - * COPYRIGHT International Business Machines Corp. 2012 - * - * p1 - * - * Object Code Only (OCO) source materials - * Licensed Internal Code Source Materials - * IBM HostBoot Licensed Internal Code - * - * The source code for this program is not published or other- - * wise divested of its trade secrets, irrespective of what has - * been deposited with the U.S. Copyright Office. - * - * Origin: 30 - * - * IBM_PROLOG_END_TAG - */ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/usr/pnor/common/ffs_hb.H $ */ +/* */ +/* IBM CONFIDENTIAL */ +/* */ +/* COPYRIGHT International Business Machines Corp. 2012,2013 */ +/* */ +/* p1 */ +/* */ +/* Object Code Only (OCO) source materials */ +/* Licensed Internal Code Source Materials */ +/* IBM HostBoot Licensed Internal Code */ +/* */ +/* The source code for this program is not published or otherwise */ +/* divested of its trade secrets, irrespective of what has been */ +/* deposited with the U.S. Copyright Office. */ +/* */ +/* Origin: 30 */ +/* */ +/* IBM_PROLOG_END_TAG */ #ifndef _FFS_HB_H #define _FFS_HB_H @@ -47,9 +46,17 @@ */ enum { - FFS_MISC_ECC_PROTECT = 0x80, /**< ECC protected */ - FFS_MISC_SIDELESS = 0x40, /**< Preserved across code updates (sideless) =1 */ - FFS_MISC_CRC_PROTECTED = 0x20, /**< CRC protected */ + FFS_CHIPSEL_UNUSED = 0xFF, /**< Chip select not used */ + FFS_COMPRESS_UNUSED = 0xFF, /**< Compression not used */ + + FFS_INTEG_ECC_PROTECT = 0x8000, /**< Data Integrity: ECC protected */ + FFS_INTEG_UNUSED = 0x1FFF, /**< Unused Data Integrity Bits */ + + FFS_VERS_SHA512 = 0x80, /**< SHA512 used for Version */ + FFS_VERS_SHA512_PER_EC = 0x40, /**< SHA512 version per EC */ + FFS_VERS_UNUSED = 0x3F, /**< Unused Version bits */ + + FFS_MISC_PRESERVED = 0x80, /**< Preserved across code updates */ FFS_MISC_UNUSED = 0x1F, /**< Unused MISC Flags */ }; @@ -58,11 +65,12 @@ enum * This matches the PNOR binary layout of the data[] in an ffs_entry. */ struct ffs_hb_user_t{ - uint32_t sizeAct; /**< Actual Size of the image */ - uint8_t chip; /**< Chip Select (0,1) */ - uint8_t compressType; /**< Compression Indication/alg (0=not compressed) */ - uint8_t miscFlags; /**< Misc Partition related Flags */ - uint8_t freeMisc[5]; /**< Unused Miscellaneious Info */ + uint8_t chip; /**< Chip Select (0,1) */ + uint8_t compressType; /**< Compression Indication/alg (0=not compressed) */ + uint16_t dataInteg; /**< Indicates Data Integrity mechanism */ + uint8_t verCheck; /**< Indicates Version check type */ + uint8_t miscFlags; /**< Misc Partition related Flags */ + uint8_t freeMisc[2]; /**< Unused Miscellaneious Info */ uint32_t freeUser[13]; /**< Unused User Data */ } PACKED; diff --git a/src/usr/pnor/ffs.h b/src/usr/pnor/ffs.h index e640c1e79..99f29d63b 100644 --- a/src/usr/pnor/ffs.h +++ b/src/usr/pnor/ffs.h @@ -1,26 +1,25 @@ -/* IBM_PROLOG_BEGIN_TAG - * This is an automatically generated prolog. - * - * $Source: src/usr/pnor/ffs.h $ - * - * IBM CONFIDENTIAL - * - * COPYRIGHT International Business Machines Corp. 2012 - * - * p1 - * - * Object Code Only (OCO) source materials - * Licensed Internal Code Source Materials - * IBM HostBoot Licensed Internal Code - * - * The source code for this program is not published or other- - * wise divested of its trade secrets, irrespective of what has - * been deposited with the U.S. Copyright Office. - * - * Origin: 30 - * - * IBM_PROLOG_END_TAG - */ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/usr/pnor/ffs.h $ */ +/* */ +/* IBM CONFIDENTIAL */ +/* */ +/* COPYRIGHT International Business Machines Corp. 2012,2013 */ +/* */ +/* p1 */ +/* */ +/* Object Code Only (OCO) source materials */ +/* Licensed Internal Code Source Materials */ +/* IBM HostBoot Licensed Internal Code */ +/* */ +/* The source code for this program is not published or otherwise */ +/* divested of its trade secrets, irrespective of what has been */ +/* deposited with the U.S. Copyright Office. */ +/* */ +/* Origin: 30 */ +/* */ +/* IBM_PROLOG_END_TAG */ /* * Copyright (c) International Business Machines Corp., 2012 * @@ -32,7 +31,12 @@ #ifndef __FFS_H__ #define __FFS_H__ +/* Pull in the correct header depending on what is being built */ +#if defined(__KERNEL__) +#include <linux/types.h> +#else #include <stdint.h> +#endif /* The version of this partition implementation */ #define FFS_VERSION_1 1 @@ -71,6 +75,7 @@ enum type { * Flag bit definitions */ #define FFS_FLAGS_PROTECTED 0x0001 +#define FFS_FLAGS_U_BOOT_ENV 0x0002 /* * Number of user data words @@ -87,6 +92,7 @@ enum type { * @id: Partition entry ID [1..65536] * @type: Describe type of partition * @flags: Partition attributes (optional) + * @actual: Actual partition size (in bytes) * @resvd: Reserved words for future use * @user: User data (optional) * @checksum: Partition entry checksum (includes all above) @@ -99,7 +105,8 @@ struct ffs_entry { uint32_t id; uint32_t type; uint32_t flags; - uint32_t resvd[5]; + uint32_t actual; + uint32_t resvd[4]; struct { uint32_t data[FFS_USER_WORDS]; } user; diff --git a/src/usr/pnor/pnorrp.C b/src/usr/pnor/pnorrp.C index af865d8d7..015b9f6ce 100644 --- a/src/usr/pnor/pnorrp.C +++ b/src/usr/pnor/pnorrp.C @@ -325,7 +325,7 @@ errlHndl_t PnorRP::getSectionInfo( PNOR::SectionId i_section, o_info.vaddr = iv_TOC[side][id].virtAddr; o_info.size = iv_TOC[side][id].size; o_info.eccProtected = (bool)(iv_TOC[side][id].miscFlags & - FFS_MISC_ECC_PROTECT); + FFS_INTEG_ECC_PROTECT); } return l_errhdl; @@ -469,17 +469,9 @@ errlHndl_t PnorRP::readTOC() //virtAddr //The PNOR data is broken up into 3 blocks of Virtual Addresses, A, B, and Sideless. //For Sections found to be sideless, both PNOR sides will map to the same virtual address. - if(!(ffsUserData->miscFlags & FFS_MISC_SIDELESS)) - { - iv_TOC[cur_side][secId].virtAddr = nextVAddr[cur_side]; - nextVAddr[cur_side] += iv_TOC[cur_side][secId].size; - } - else - { - //TODO: Map both sides of PNOR to the same VADDR for Sideless (RTC: 34764) - iv_TOC[cur_side][secId].virtAddr = nextVAddr[SIDELESS_VADDR_INDEX]; - nextVAddr[SIDELESS_VADDR_INDEX] += iv_TOC[cur_side][secId].size; - } + //TODO RTC: 34764, remove VADDR ranges for SIDE B & SIDELESS + iv_TOC[cur_side][secId].virtAddr = nextVAddr[cur_side]; + nextVAddr[cur_side] += iv_TOC[cur_side][secId].size; //flashAddr iv_TOC[cur_side][secId].flashAddr = ((uint64_t)cur_entry->base)*PAGESIZE; @@ -794,7 +786,7 @@ errlHndl_t PnorRP::computeDeviceAddr( void* i_vaddr, // pull out the information we need to return from our global copy o_chip = iv_TOC[side][id].chip; - o_ecc = (bool)(iv_TOC[side][id].miscFlags & FFS_MISC_ECC_PROTECT); + o_ecc = (bool)(iv_TOC[side][id].miscFlags & FFS_INTEG_ECC_PROTECT); o_offset = l_vaddr - iv_TOC[side][id].virtAddr; //offset into pnor o_offset += iv_TOC[side][id].flashAddr; |