summaryrefslogtreecommitdiffstats
path: root/src/occ_405/pgpe/pgpe_shared.h
blob: 12a7d73c537d5f5d1bb2b91f0d6627b1d04e822d (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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
/* IBM_PROLOG_BEGIN_TAG                                                   */
/* This is an automatically generated prolog.                             */
/*                                                                        */
/* $Source: src/occ_405/pgpe/pgpe_shared.h $                              */
/*                                                                        */
/* OpenPOWER OnChipController Project                                     */
/*                                                                        */
/* Contributors Listed Below - COPYRIGHT 2011,2018                        */
/* [+] International Business Machines Corp.                              */
/*                                                                        */
/*                                                                        */
/* Licensed under the Apache License, Version 2.0 (the "License");        */
/* you may not use this file except in compliance with the License.       */
/* You may obtain a copy of the License at                                */
/*                                                                        */
/*     http://www.apache.org/licenses/LICENSE-2.0                         */
/*                                                                        */
/* Unless required by applicable law or agreed to in writing, software    */
/* distributed under the License is distributed on an "AS IS" BASIS,      */
/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or        */
/* implied. See the License for the specific language governing           */
/* permissions and limitations under the License.                         */
/*                                                                        */
/* IBM_PROLOG_END_TAG                                                     */

#define PGPE_HEADER_ADDR             0xFFF20180 // 0xfff20000 + 0x180

#define PPMR_MAGIC_NUMBER_10         0x50504D525F312E30ull   // "PPMR_1.0"
#define OPPB_MAGIC_NUMBER_10         0x4F43435050423030ull   // "OCCPPB00"
#define PGPE_MAGIC_NUMBER_10         0x504750455F312E30ull   // "PGPE_1.0"

// Offset addresses of PGPE Header parameters (relative to start address)
#define PGPE_SHARED_SRAM_ADDR_OFFSET           0x0c
#define PGPE_SHARED_SRAM_LEN_OFFSET            0x14
#define PGPE_GENERATED_PSTATE_TBL_ADDR_OFFSET  0x38 // generated table address is offset from beginning of HOMER
#define PGPE_GENERATED_PSTATE_TBL_SZ_OFFSET    0x3C
#define PGPE_OCC_PSTATE_TBL_ADDR_OFFSET        0x40 // OCC table address is a SRAM address
#define PGPE_OCC_PSTATE_TBL_SZ_OFFSET          0x44
#define PGPE_BEACON_ADDR_OFFSET                0x48
#define PGPE_ACTUAL_QUAD_STATUS_ADDR_OFFSET    0x4c
#define PGPE_WOF_STATE_ADDR_OFFSET             0x50
#define PGPE_REQUESTED_ACTIVE_QUAD_ADDR_OFFSET 0x54
#define PGPE_WOF_TBLS_ADDR_OFFSET              0x58
#define PGPE_WOF_TBLS_LEN_OFFSET               0x5C

// This size must be a multiple of 128
typedef struct __attribute__ ((packed))
{
    uint64_t  magic_number;
    uint32_t  bc_offset;
    uint32_t  reserved;
    uint32_t  bl_offset;
    uint32_t  bl_length;
    uint32_t  build_date;
    uint32_t  version;
    uint8_t   resvd_flag[8];
    uint32_t  pgpe_hcode_offset;
    uint32_t  pgpe_hcode_length;
    uint32_t  gppb_offset;
    uint32_t  gppb_length;
    uint32_t  lppb_offset;
    uint32_t  lppb_length;
    uint32_t  oppb_offset;
    uint32_t  oppb_length;
    uint32_t  pstables_offset;
    uint32_t  pstables_length;
    uint8_t   pad[48];
} ppmr_header_t __attribute__ ((aligned (128)));


typedef struct __attribute__ ((packed))
{
    uint32_t shared_sram_addr;
    uint32_t shared_sram_length;
    uint32_t generated_pstate_table_homer_offset;
    uint32_t generated_pstate_table_length;
    uint32_t occ_pstate_table_sram_addr;
    uint32_t occ_pstate_table_length;
    uint32_t beacon_sram_addr;
    uint32_t actual_quad_status_sram_addr;
    uint32_t wof_state_address;
    uint32_t requested_active_quad_sram_addr;
    uint32_t wof_tables_addr;
    uint32_t wof_tables_length;
} pgpe_header_data_t;

extern pgpe_header_data_t G_pgpe_header;



OpenPOWER on IntegriCloud