summaryrefslogtreecommitdiffstats
path: root/src/include/usr/pnor/pnorif.H
blob: 1b551d8eead5688f22245bc3b4ce48c3231805c1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#ifndef __PNOR_PNORIF_H
#define __PNOR_PNORIF_H

#include <stdint.h>
#include <builtins.h>

namespace PNOR
{

/**
 * PNOR Sections
 */
enum SectionId
{
    TOC,            /**< Table of Contents */
    GLOBAL_DATA,    /**< Global Data */
    SBE_IPL,        /**< Self-Boot Enginer IPL image */
    HB_BASE_CODE,   /**< Hostboot Base Image */
    HB_DATA,        /**< Hostboot Data */
    HB_ERRLOGS,     /**< Hostboot Error log Repository */
    HB_EXT_CODE,    /**< Hostboot Extended Image */
    HB_RUNTIME,     /**< Hostboot Runtime Image */
    PAYLOAD,        /**< HAL/OPAL */
    PFW_LITE_CODE,  /**< PFW-lite */
    OCC_CODE,       /**< OCC Code Image */
    KVM_PART_INFO,  /**< KVM Partition Information */
    CODE_UPDATE,    /**< Code Update Overhead */
    NUM_SECTIONS,   /**< Number of defined sections */

    FIRST_SECTION = TOC,  /**< First section (for looping) */
    LAST_SECTION = CODE_UPDATE,  /**< Last section (for looping) */
    INVALID_SECTION = NUM_SECTIONS,  /**< Used for error cases, initialization */
};

/**
 * Information about a section of PNOR
 */
struct SectionInfo_t
{
    SectionId id;  /**< Identifier for this section */
    const char* name;  /**< Name of the section */
    uint64_t vaddr;  /**< Virtual address for the start of the section */
    uint64_t size;  /**< Actual size of content in bytes */
    bool eccProtected;  /**< Section is ECC protected */
};

/**
 * Select a side of flash to access
 */
enum SideSelect
{
    SIDE_A    = 0xA, /**< A-side of flash */
    SIDE_B    = 0xB, /**< B-side of flash */
    SIDELESS  = 0xF, /**< Sideless data */
};



/**
 * @brief  Return the size and address of a given section of PNOR data
 *
 * @param[in] i_section  PNOR section
 * @param[in] i_side  Side select
 * @param[out] o_info  Location and size information
 *
 * @return size_t  Offset of section in bytes
 */
void getSectionInfo( SectionId i_section,
                     SideSelect i_side,
                     SectionInfo_t& o_info );


}
#endif
OpenPOWER on IntegriCloud