blob: 30cd71e3c3dc6da78e95c03e32b4793c638b2b73 [file] [log] [blame]
Angel Pons182dbde2020-04-02 23:49:05 +02001/* SPDX-License-Identifier: GPL-2.0-only */
2/* This file is part of the coreboot project. */
Frank Vibrans63e62b02011-02-14 18:38:14 +00003
4#ifndef _AMD_SB_LIB_H_
5#define _AMD_SB_LIB_H_
6
David Hendricks6053a9c2018-01-28 18:01:10 -08007#include <console/vtxprintf.h>
Frank Vibrans63e62b02011-02-14 18:38:14 +00008
9#pragma pack (push, 1)
10
11#define IMAGE_ALIGN 32*1024
12#define NUM_IMAGE_LOCATION 32
13
14//Entry Point Call
Elyes HAOUAS251279c2018-07-08 12:41:56 +020015typedef void (*CIM_IMAGE_ENTRY) (void *pConfig);
Frank Vibrans63e62b02011-02-14 18:38:14 +000016
17//Hook Call
18
19typedef struct _CIMFILEHEADER
20{
21 unsigned int AMDLogo;
22 unsigned long long CreatorID;
23 unsigned int Version1;
24 unsigned int Version2;
25 unsigned int Version3;
26 unsigned int ModuleInfoOffset;
27 unsigned int EntryPoint;
28 unsigned int ImageBase;
29 unsigned int RelocTableOffset;
30 unsigned int ImageSize;
31 unsigned short CheckSum;
32 unsigned char ImageType;
33 unsigned char Reserved2;
34} CIMFILEHEADER;
35
36#ifndef BIT0
37 #define BIT0 (1 << 0)
38#endif
39#ifndef BIT1
40 #define BIT1 (1 << 1)
41#endif
42#ifndef BIT2
43 #define BIT2 (1 << 2)
44#endif
45#ifndef BIT3
46 #define BIT3 (1 << 3)
47#endif
48#ifndef BIT4
49 #define BIT4 (1 << 4)
50#endif
51#ifndef BIT5
52 #define BIT5 (1 << 5)
53#endif
54#ifndef BIT6
55 #define BIT6 (1 << 6)
56#endif
57#ifndef BIT7
58 #define BIT7 (1 << 7)
59#endif
60#ifndef BIT8
61 #define BIT8 (1 << 8)
62#endif
63#ifndef BIT9
64 #define BIT9 (1 << 9)
65#endif
66#ifndef BIT10
67 #define BIT10 (1 << 10)
68#endif
69#ifndef BIT11
70 #define BIT11 (1 << 11)
71#endif
72#ifndef BIT12
73 #define BIT12 (1 << 12)
74#endif
75#ifndef BIT13
76 #define BIT13 (1 << 13)
77#endif
78#ifndef BIT14
79 #define BIT14 (1 << 14)
80#endif
81#ifndef BIT15
82 #define BIT15 (1 << 15)
83#endif
84#ifndef BIT16
85 #define BIT16 (1 << 16)
86#endif
87#ifndef BIT17
88 #define BIT17 (1 << 17)
89#endif
90#ifndef BIT18
91 #define BIT18 (1 << 18)
92#endif
93#ifndef BIT19
94 #define BIT19 (1 << 19)
95#endif
96#ifndef BIT20
97 #define BIT20 (1 << 20)
98#endif
99#ifndef BIT21
100 #define BIT21 (1 << 21)
101#endif
102#ifndef BIT22
103 #define BIT22 (1 << 22)
104#endif
105#ifndef BIT23
106 #define BIT23 (1 << 23)
107#endif
108#ifndef BIT24
109 #define BIT24 (1 << 24)
110#endif
111#ifndef BIT25
112 #define BIT25 (1 << 25)
113#endif
114#ifndef BIT26
115 #define BIT26 (1 << 26)
116#endif
117#ifndef BIT27
118 #define BIT27 (1 << 27)
119#endif
120#ifndef BIT28
121 #define BIT28 (1 << 28)
122#endif
123#ifndef BIT29
124 #define BIT29 (1 << 29)
125#endif
126#ifndef BIT30
127 #define BIT30 (1 << 30)
128#endif
129#ifndef BIT31
130 #define BIT31 (1 << 31)
131#endif
132
133#pragma pack (pop)
134
135typedef enum
136{
137 AccWidthUint8 = 0,
138 AccWidthUint16,
139 AccWidthUint32,
140} ACC_WIDTH;
141
142#define S3_SAVE 0x80
143
144#endif