summaryrefslogtreecommitdiffstats
path: root/src/occBootLoader/bootMain.h
blob: 78862b2004d855995bb7e49497b21ab91630a562 (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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
/* IBM_PROLOG_BEGIN_TAG                                                   */
/* This is an automatically generated prolog.                             */
/*                                                                        */
/* $Source: src/occBootLoader/bootMain.h $                                */
/*                                                                        */
/* OpenPOWER OnChipController Project                                     */
/*                                                                        */
/* Contributors Listed Below - COPYRIGHT 2014,2017                        */
/* [+] 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                                                     */

#ifndef _bootMain_h
#define _bootMain_h

//*************************************************************************/
// Includes
//*************************************************************************/
#ifndef __ASSEMBLER__
#include <common_types.h> // defines imageHdr_t and other types
#endif  /* __ASSEMBLER__ */

//*************************************************************************/
// Externs
//*************************************************************************/

//*************************************************************************/
// Macros
//*************************************************************************/

//*************************************************************************/
// Defines/Enums
//*************************************************************************/
#define MACHINE_CHECK_ENABLE        0x00001000
#define DATA_CACHE_BLOCK_ENABLE     0x80000000
#define DATA_CACHE_BLOCK_ADDR       0x00000000
#define DATA_CACHE_SIZE             (16 * 1024)
#define CACHE_LINE_SIZE             32
#define DATA_CACHE_LINES            (DATA_CACHE_SIZE/CACHE_LINE_SIZE)

// Data cache address + 8K
#define STACK_POINTER_ADDR          (DATA_CACHE_BLOCK_ADDR + 0x2000)

#ifndef __ASSEMBLER__

typedef enum CHKPOINT
{
    BOOT_TEST_SRAM_CHKPOINT =               0x00000001,
    BOOT_LOAD_IMAGE_CHKPOINT =              0x00000002,
    BOOT_LOAD_GPE0_CHKPOINT =               0x00000003,
    BOOT_LOAD_GPE1_CHKPOINT =               0x00000004,
    BOOT_CALCULTE_CHKSUM_CHKPOINT_405 =     0x00000005,
    BOOT_CALCULTE_CHKSUM_CHKPOINT_GPE0 =    0x00000006,
    BOOT_CALCULTE_CHKSUM_CHKPOINT_GPE1 =    0x00000007,
    BOOT_GET_NEST_FREQ_CHKPOINT =           0x00000008,
    BOOT_SSX_BOOT_CALL_CHKPOINT =           0x00000009,
    BOOT_SSX_RETURNED_CHKPOINT =            0x0000000A
}CHKPOINT;

#endif  /* __ASSEMBLER__ */

#define SRAM_TEST_START_ADDRESS     0xFFF00000
#define SRAM_START_ADDRESS_FULL     0xFFF00000
#define SRAM_START_ADDRESS_405      0xFFF40000
#define SRAM_START_ADDRESS_GPE0     0xFFF01000
#define SRAM_START_ADDRESS_GPE1     0xFFF10000
#define SRAM_TEST_END_ADDRESS       0xFFFBFFFF
#define SRAM_END_ADDRESS_405        0xFFFBFFFF
#define SRAM_END_ADDRESS_GPE0       0xFFF0FFFF
#define SRAM_END_ADDRESS_GPE1       0xFFF1FFFF
#define SRAM_TEST_BIT_PATTERN       0xA5A5A5A5
#define EYE_CATCHER_ADDRESS         0x1234ABCD

#define BOOT_LOADER_ID              "OCC Boot Image\0"

// Define to write val to SPRG0 register
#define WRITE_TO_SPRG0(val) \
    ({__asm__ __volatile__ ("mtsprg0 %0;" ::"r"(val));})

#define WRITE_TO_SPRG1_AND_HALT(rc) \
    ({__asm__ __volatile__ ("mtsprg1 %0;" "tw 31,0,0;": : "r" (rc));})

//*************************************************************************/
// Structures
//*************************************************************************/

//*************************************************************************/
// Globals
//*************************************************************************/

//*************************************************************************/
// Function Prototypes
//*************************************************************************/

//*************************************************************************/
// Functions
//*************************************************************************/

#endif // _bootMain_h

OpenPOWER on IntegriCloud