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