/* IBM_PROLOG_BEGIN_TAG */ /* This is an automatically generated prolog. */ /* */ /* $Source: src/usr/pnor/pnorrp.H $ */ /* */ /* IBM CONFIDENTIAL */ /* */ /* COPYRIGHT International Business Machines Corp. 2011,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 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 __PNOR_PNORRP_H #define __PNOR_PNORRP_H #include #include #include #include #include #include /** * PNOR Resource Provider */ class PnorRP { public: /** * @brief Static Initializer * @param[in] ref to errlHndl_t */ static void init( errlHndl_t &io_rtaskRetErrl ); /** * @brief Return the size and address of a given section of PNOR data * Called by external PNOR::getSectionInfo() * * @param[in] i_section PNOR section * @param[in] i_side Side select * @param[out] o_info Location and size information * * @return errlHndl_t Error log if request was invalid */ errlHndl_t getSectionInfo( PNOR::SectionId i_section, PNOR::SideSelect i_side, PNOR::SectionInfo_t& o_info ); protected: /** * @brief Constructor */ PnorRP(); /** * @brief Destructor */ ~PnorRP(); private: /** * PNOR Constants */ enum { BASE_VADDR = VMM_VADDR_PNOR_RP, /**< 2GB = 0x80000000*/ NUM_SIDES = 2, /**< A, B */ SIDE_SIZE = 32*MEGABYTE, /**< Allocate 32 MB (0x2000000) of VA per side */ NUM_VADDR_BLOCKS = NUM_SIDES+1, /**< Number of VADDR blocks. */ SIDEA_VADDR = BASE_VADDR, /**< Base address of Side A */ SIDEB_VADDR = SIDEA_VADDR + SIDE_SIZE, /**< Base address of Side B */ SIDELESS_VADDR = SIDEB_VADDR + SIDE_SIZE, /**< Sideless data Base Addr */ TOTAL_SIZE = SIDE_SIZE*NUM_VADDR_BLOCKS, /**< Size of PNOR VA region */ LAST_VADDR = BASE_VADDR + TOTAL_SIZE, /**< End of our VA range */ /** Real number of bytes required to read 1 logical page */ PAGESIZE_PLUS_ECC = PAGESIZE * (9/8), // 8 bytes of data + 1 byte of ECC SUPPORTED_FFS_VERSION = 0x1, /**< Supported FFS Version */ FFS_TABLE_BASE_ADDR = 0x0, /**< Currently only have FFS table */ }; /** * Internal information to deal with the sections of PNOR */ struct SectionData_t { PNOR::SectionId id; /**< Identifier for this section */ PNOR::SideSelect side; /** Side Select */ uint64_t virtAddr; /**< Virtual address for the start of the section */ uint32_t flashAddr; /**< Address in flash */ uint32_t size; /**< Actual size of content in bytes (not including ECC) */ uint8_t chip; /**< Chip Select */ uint8_t miscFlags; /**