AMD SB800: Drop component prefix from filenames.
[coreboot.git] / src / southbridge / amd / cimx_wrapper / sb800 / cfg.h
1 /*
2  * This file is part of the coreboot project.
3  *
4  * Copyright (C) 2010 Advanced Micro Devices, Inc.
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; version 2 of the License.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
18  */
19
20 #ifndef _SB800_CFG_H_
21 #define _SB800_CFG_H_
22
23 #include <stdint.h>
24
25 /**
26  * @def BIOS_SIZE_1M
27  * @def BIOS_SIZE_2M
28  * @def BIOS_SIZE_4M
29  * @def BIOS_SIZE_8M
30  */
31 #define BIOS_SIZE_1M                    0
32 #define BIOS_SIZE_2M                    1
33 #define BIOS_SIZE_4M                    3
34 #define BIOS_SIZE_8M                    7
35
36 /* In SB800, default ROM size is 1M Bytes, if your platform ROM
37  * bigger than 1M you have to set the ROM size outside CIMx module and
38  * before AGESA module get call.
39  */
40 #ifndef BIOS_SIZE
41 #if CONFIG_COREBOOT_ROMSIZE_KB_1024 == 1
42   #define BIOS_SIZE BIOS_SIZE_1M
43 #elif CONFIG_COREBOOT_ROMSIZE_KB_2048 == 1
44   #define BIOS_SIZE BIOS_SIZE_2M
45 #elif CONFIG_COREBOOT_ROMSIZE_KB_4096 == 1
46   #define BIOS_SIZE BIOS_SIZE_4M
47 #elif CONFIG_COREBOOT_ROMSIZE_KB_8192 == 1
48   #define BIOS_SIZE BIOS_SIZE_8M
49 #endif
50 #endif
51
52 /**
53  * @def SPREAD_SPECTRUM
54  * @brief
55  *  0 - Disable Spread Spectrum function
56  *  1 - Enable  Spread Spectrum function
57  */
58 #define SPREAD_SPECTRUM                 0
59
60 /**
61  * @def SB_HPET_TIMER
62  * @breif
63  *  0 - Disable hpet
64  *  1 - Enable  hpet
65  */
66 #define HPET_TIMER                      1
67
68 /**
69  * @def USB_CONFIG
70  * @brief bit[0-6] used to control USB
71  *   0 - Disable
72  *   1 - Enable
73  *  Usb Ohci1 Contoller (Bus 0 Dev 18 Func0) is define at BIT0
74  *  Usb Ehci1 Contoller (Bus 0 Dev 18 Func2) is define at BIT1
75  *  Usb Ohci2 Contoller (Bus 0 Dev 19 Func0) is define at BIT2
76  *  Usb Ehci2 Contoller (Bus 0 Dev 19 Func2) is define at BIT3
77  *  Usb Ohci3 Contoller (Bus 0 Dev 22 Func0) is define at BIT4
78  *  Usb Ehci3 Contoller (Bus 0 Dev 22 Func2) is define at BIT5
79  *  Usb Ohci4 Contoller (Bus 0 Dev 20 Func5) is define at BIT6
80  */
81 #define USB_CINFIG              0x7F
82
83 /**
84  * @def PCI_CLOCK_CTRL
85  * @breif bit[0-4] used for PCI Slots Clock Control,
86  *   0 - disable
87  *   1 - enable
88  *  PCI SLOT 0 define at BIT0
89  *  PCI SLOT 1 define at BIT1
90  *  PCI SLOT 2 define at BIT2
91  *  PCI SLOT 3 define at BIT3
92  *  PCI SLOT 4 define at BIT4
93  */
94 #define PCI_CLOCK_CTRL                  0x1F
95
96 /**
97  * @def SATA_CONTROLLER
98  * @breif INCHIP Sata Controller
99  */
100 #ifndef SATA_CONTROLLER
101   #define SATA_CONTROLLER               ENABLED
102 #endif
103
104 /**
105  * @def SATA_MODE
106  * @breif INCHIP Sata Controller Mode
107  *   NOTE: DO NOT ALLOW SATA & IDE use same mode
108  */
109 #ifndef SATA_MODE
110   #define SATA_MODE                     NATIVE_IDE_MODE
111 #endif
112
113 /**
114  * @breif INCHIP Sata IDE Controller Mode
115  */
116 #define IDE_LEGACY_MODE                 0
117 #define IDE_NATIVE_MODE                 1
118
119 /**
120  * @def SATA_IDE_MODE
121  * @breif INCHIP Sata IDE Controller Mode
122  *   NOTE: DO NOT ALLOW SATA & IDE use same mode
123  */
124 #ifndef SATA_IDE_MODE
125   #define SATA_IDE_MODE                 IDE_LEGACY_MODE
126 #endif
127
128 /**
129  * @def EXTERNAL_CLOCK
130  * @brief 00/10: Reference clock from crystal oscillator via
131  *  PAD_XTALI and PAD_XTALO
132  *
133  * @def INTERNAL_CLOCK
134  * @brief 01/11: Reference clock from internal clock through
135  *  CP_PLL_REFCLK_P and CP_PLL_REFCLK_N via RDL
136  */
137 #define EXTERNAL_CLOCK          0x00
138 #define INTERNAL_CLOCK          0x01
139
140 /* NOTE: inagua have to using internal clock,
141  * otherwise can not detect sata drive
142  */
143 #define SATA_CLOCK_SOURCE       INTERNAL_CLOCK
144
145 /**
146  * @def SATA_PORT_MULT_CAP_RESERVED
147  * @brief 1 ON, 0 0FF
148  */
149 #define SATA_PORT_MULT_CAP_RESERVED     1
150
151 /**
152  * @def   AZALIA_AUTO
153  * @brief Detect Azalia controller automatically.
154  *
155  * @def   AZALIA_DISABLE
156  * @brief Disable Azalia controller.
157
158  * @def   AZALIA_ENABLE
159  * @brief Enable Azalia controller.
160  */
161 #define AZALIA_AUTO                     0
162 #define AZALIA_DISABLE                  1
163 #define AZALIA_ENABLE                   2
164
165 /**
166  * @breif INCHIP HDA controller
167  */
168 #ifndef AZALIA_CONTROLLER
169   #define AZALIA_CONTROLLER             AZALIA_AUTO
170 #endif
171
172 /**
173  * @def AZALIA_PIN_CONFIG
174  * @brief
175  *  0 - disable
176  *  1 - enable
177  */
178 #ifndef AZALIA_PIN_CONFIG
179   #define AZALIA_PIN_CONFIG             1
180 #endif
181
182 /**
183  * @def AZALIA_SDIN_PIN
184  * @brief
185  *  SDIN0 is define at BIT0 & BIT1
186  *   00 - GPIO PIN
187  *   01 - Reserved
188  *   10 - As a Azalia SDIN pin
189  *  SDIN1 is define at BIT2 & BIT3
190  *  SDIN2 is define at BIT4 & BIT5
191  *  SDIN3 is define at BIT6 & BIT7
192  */
193 #ifndef AZALIA_SDIN_PIN
194   //#define AZALIA_SDIN_PIN             0xAA
195   #define AZALIA_SDIN_PIN               0x2A
196 #endif
197
198 /**
199  * @def GPP_CONTROLLER
200  */
201 #ifndef GPP_CONTROLLER
202   #define GPP_CONTROLLER                ENABLED
203 #endif
204
205 /**
206  * @def GPP_CFGMODE
207  * @brief GPP Link Configuration
208  * four possible configuration:
209  *  GPP_CFGMODE_X4000
210  *  GPP_CFGMODE_X2200
211  *  GPP_CFGMODE_X2110
212  *  GPP_CFGMODE_X1111
213  */
214 #ifndef GPP_CFGMODE
215   #define GPP_CFGMODE                   GPP_CFGMODE_X1111
216 #endif
217
218 /**
219  * @brief South Bridge CIMx configuration
220  */
221 void sb800_cimx_config(AMDSBCFG *sb_cfg);
222
223 /**
224  * @brief Entry point of Southbridge CIMx callout
225  *
226  * prototype UINT32 (*SBCIM_HOOK_ENTRY)(UINT32 Param1, UINT32 Param2, void* pConfig)
227  *
228  * @param[in] func    Southbridge CIMx Function ID.
229  * @param[in] data    Southbridge Input Data.
230  * @param[in] sb_cfg  Southbridge configuration structure pointer.
231  */
232 u32 sb800_callout_entry(u32 func, u32 data, void* sb_cfg);
233
234 #endif