blob: 0cf7d6bc55cbdb80e0aa539decbeb23267b32f0e [file] [log] [blame]
Alexandru Gagniuc5005bb062011-04-11 20:17:22 +00001/*
2 * This file is part of the coreboot project.
3 *
4 * Copyright (C) 2011 Alexandru Gagniuc <mr.nuke.me@gmail.com>
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, either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
Stefan Reinauer5ff7c132011-10-31 12:56:45 -070015 *
Alexandru Gagniuc5005bb062011-04-11 20:17:22 +000016 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20
21/**
22 * @file post_codes.h
Stefan Reinauer5ff7c132011-10-31 12:56:45 -070023 *
Alexandru Gagniuc5005bb062011-04-11 20:17:22 +000024 * This aims to be a central point for POST codes used throughout coreboot.
25 * All POST codes should be declared here as macros, and post_code() should
26 * be used with the macros instead of hardcoded values. This allows us to
27 * quicly reference POST codes when nothing is working
Stefan Reinauer5ff7c132011-10-31 12:56:45 -070028 *
Alexandru Gagniuc5005bb062011-04-11 20:17:22 +000029 * The format for a POST code macro is
30 * #define POST_WHAT_WE_COMMUNICATE_IS_HAPPENING_WHEN_THIS_CODE_IS_POSTED
31 * Lets's keep it at POST_* instead of POST_CODE_*
Stefan Reinauer5ff7c132011-10-31 12:56:45 -070032 *
Alexandru Gagniuc5005bb062011-04-11 20:17:22 +000033 * This file is also included by early assembly files. Only use #define s;
34 * no function prototypes allowed here
Stefan Reinauer5ff7c132011-10-31 12:56:45 -070035 *
Alexandru Gagniuc5005bb062011-04-11 20:17:22 +000036 * DOCUMENTATION:
Stefan Reinauer5ff7c132011-10-31 12:56:45 -070037 * Please document any and all post codes using Doxygen style comments. We
Alexandru Gagniuc5005bb062011-04-11 20:17:22 +000038 * want to be able to generate a verbose enough documentation that is useful
39 * during debugging. Failure to do so will result in your patch being rejected
40 * without any explanation or effort on part of the maintainers.
Stefan Reinauer5ff7c132011-10-31 12:56:45 -070041 *
Alexandru Gagniuc5005bb062011-04-11 20:17:22 +000042 */
43#ifndef POST_CODES_H
44#define POST_CODES_H
45
46/**
47 * \brief Entry into 'crt0.s'. reset code jumps to here
Stefan Reinauer5ff7c132011-10-31 12:56:45 -070048 *
Alexandru Gagniuc5005bb062011-04-11 20:17:22 +000049 * First instruction that gets executed after the reset vector jumps.
50 * This indicates that the reset vector points to the correct code segment.
51 */
52#define POST_RESET_VECTOR_CORRECT 0x01
53
54/**
55 * \brief Entry into protected mode
Stefan Reinauer5ff7c132011-10-31 12:56:45 -070056 *
Alexandru Gagniuc5005bb062011-04-11 20:17:22 +000057 * Preparing to enter protected mode. This is POSTed right before changing to
58 * protected mode.
59 */
60#define POST_ENTER_PROTECTED_MODE 0x10
61
62/**
63 * \brief Start copying coreboot to RAM with decompression if compressed
Stefan Reinauer5ff7c132011-10-31 12:56:45 -070064 *
Alexandru Gagniuc5005bb062011-04-11 20:17:22 +000065 * POSTed before ramstage is about to be loaded into memory
66 */
67#define POST_PREPARE_RAMSTAGE 0x11
68
69/**
70 * \brief Copy/decompression finished; jumping to RAM
Stefan Reinauer5ff7c132011-10-31 12:56:45 -070071 *
Alexandru Gagniuc5005bb062011-04-11 20:17:22 +000072 * This is called after ramstage is loaded in memory, and before
73 * the code jumps there. This represents the end of romstage.
74 */
75#define POST_RAMSTAGE_IS_PREPARED 0x12
76
77
78/**
79 * \brief Entry into c_start
Stefan Reinauer5ff7c132011-10-31 12:56:45 -070080 *
Alexandru Gagniuc5005bb062011-04-11 20:17:22 +000081 * c_start.S is the first code executing in ramstage.
82 */
83#define POST_ENTRY_C_START 0x13
84
85/**
Duncan Laurie04c5bae2012-08-13 09:37:42 -070086 * \brief Pre call to hardwaremain()
87 *
88 * POSTed right before hardwaremain is called from c_start.S
89 */
90#define POST_PRE_HARDWAREMAIN 0x79
91
92/**
Alexandru Gagniuc5005bb062011-04-11 20:17:22 +000093 * \brief Entry into coreboot in hardwaremain (RAM)
Stefan Reinauer5ff7c132011-10-31 12:56:45 -070094 *
Alexandru Gagniuc5005bb062011-04-11 20:17:22 +000095 * This is the first call in hardwaremain.c. If this code is POSTed, then
96 * ramstage has succesfully loaded and started executing.
97 */
98#define POST_ENTRY_RAMSTAGE 0x80
99
100/**
101 * \brief Console is initialized
Stefan Reinauer5ff7c132011-10-31 12:56:45 -0700102 *
Alexandru Gagniuc5005bb062011-04-11 20:17:22 +0000103 * The console is initialized and is ready for usage
104 */
105#define POST_CONSOLE_READY 0x39
106
107/**
108 * \brief Console boot message succeeded
Stefan Reinauer5ff7c132011-10-31 12:56:45 -0700109 *
Alexandru Gagniuc5005bb062011-04-11 20:17:22 +0000110 * First console message has been succesfully sent through the console backend
111 * driver.
112 */
113#define POST_CONSOLE_BOOT_MSG 0x40
114
115/**
Vikram Narayanan0713ca32012-01-23 01:44:44 +0530116 * \brief Before enabling the cache
117 *
118 * Going to enable the cache
119 */
120#define POST_ENABLING_CACHE 0x60
121
122/**
Alexandru Gagniuc5005bb062011-04-11 20:17:22 +0000123 * \brief Devices have been enumerated
Stefan Reinauer5ff7c132011-10-31 12:56:45 -0700124 *
Alexandru Gagniuc5005bb062011-04-11 20:17:22 +0000125 * Bus scan, and device enumeration has completed.
126 */
127#define POST_DEVICE_ENUMERATION_COMPLETE 0x66
128
129/**
130 * \brief Devices have been configured
Stefan Reinauer5ff7c132011-10-31 12:56:45 -0700131 *
Alexandru Gagniuc5005bb062011-04-11 20:17:22 +0000132 * Device confgration has completed.
133 */
134#define POST_DEVICE_CONFIGURATION_COMPLETE 0x88
135
136/**
137 * \brief Devices have been enabled
Stefan Reinauer5ff7c132011-10-31 12:56:45 -0700138 *
Alexandru Gagniuc5005bb062011-04-11 20:17:22 +0000139 * Devices have been enabled.
140 */
141#define POST_DEVICES_ENABLED 0x89
142
143/**
Stefan Reinauer52095f52012-08-07 13:14:20 -0700144 * \brief Devices have been initialized
145 *
146 * Devices have been initialized.
147 */
148#define POST_DEVICES_INITIALIZED 0x8a
149
150/**
Alexandru Gagniuc5005bb062011-04-11 20:17:22 +0000151 * \brief Entry into elf boot
Stefan Reinauer5ff7c132011-10-31 12:56:45 -0700152 *
Alexandru Gagniuc5005bb062011-04-11 20:17:22 +0000153 * This POST code is called right before invoking jmp_to_elf_entry()
154 * jmp_to_elf_entry() invokes the payload, and should never return
155 */
156#define POST_ENTER_ELF_BOOT 0xf8
157
158/**
159 * \brief Jumping to payload
Stefan Reinauer5ff7c132011-10-31 12:56:45 -0700160 *
Alexandru Gagniuc5005bb062011-04-11 20:17:22 +0000161 * Called right before jumping to a payload. If the boot sequence stops with
162 * this code, chances are the payload freezes.
163 */
164#define POST_JUMPING_TO_PAYLOAD 0xf3
165
166/**
167 * \brief Not supposed to get here
Stefan Reinauer5ff7c132011-10-31 12:56:45 -0700168 *
Alexandru Gagniuc5005bb062011-04-11 20:17:22 +0000169 * A function that should not have returned, returned
Stefan Reinauer5ff7c132011-10-31 12:56:45 -0700170 *
Alexandru Gagniuc5005bb062011-04-11 20:17:22 +0000171 * Check the console output for details.
172 */
173#define POST_DEAD_CODE 0xee
174
175/**
Duncan Laurie04c5bae2012-08-13 09:37:42 -0700176 * \brief Final code before OS resumes
Stefan Reinauer5ff7c132011-10-31 12:56:45 -0700177 *
Duncan Laurie04c5bae2012-08-13 09:37:42 -0700178 * Called right before jumping to the OS resume vector.
Alexandru Gagniuc5005bb062011-04-11 20:17:22 +0000179 */
Duncan Laurie04c5bae2012-08-13 09:37:42 -0700180#define POST_OS_RESUME 0xfd
181
182/**
183 * \brief Final code before OS boots
184 *
185 * This may not be called depending on the payload used.
186 */
187#define POST_OS_BOOT 0xfe
Alexandru Gagniuc5005bb062011-04-11 20:17:22 +0000188
189/**
190 * \brief Elfload fail or die() called
Stefan Reinauer5ff7c132011-10-31 12:56:45 -0700191 *
Alexandru Gagniuc5005bb062011-04-11 20:17:22 +0000192 * Coreboot was not able to load the payload, no payload was detected
Stefan Reinauer5ff7c132011-10-31 12:56:45 -0700193 * or die() was called.
Alexandru Gagniuc5005bb062011-04-11 20:17:22 +0000194 * \n
195 * If this code appears before entering ramstage, then most likely
196 * ramstage is corrupted, and reflashing of the ROM chip is needed.
197 * \n
198 * If this code appears after ramstage, there is a problem with the payload
199 * If the payload was built out-of-tree, check that it was compiled as
200 * a coreboot payload
201 * \n
202 * Check the console output to see exactly where the failure occured.
203 */
204#define POST_DIE 0xff
205
206
207/*
208 * The following POST codes are taken from src/include/cpu/amd/geode_post_code.h
209 * They overlap with previous codes, and most are not even used
210 * Some maiboards still require them, but they are deprecated. We want to consolidate
211 * our own POST code structure with the codes above.
Stefan Reinauer5ff7c132011-10-31 12:56:45 -0700212 *
Alexandru Gagniuc5005bb062011-04-11 20:17:22 +0000213 * standard AMD post definitions for the AMD Geode
214 */
215#define POST_Output_Port (0x080) /* port to write post codes to*/
216
217#define POST_preSioInit (0x000)
218#define POST_clockInit (0x001)
219#define POST_CPURegInit (0x002)
220#define POST_UNREAL (0x003)
221#define POST_CPUMemRegInit (0x004)
222#define POST_CPUTest (0x005)
223#define POST_memSetup (0x006)
224#define POST_memSetUpStack (0x007)
225#define POST_memTest (0x008)
226#define POST_shadowRom (0x009)
227#define POST_memRAMoptimize (0x00A)
228#define POST_cacheInit (0x00B)
229#define POST_northBridgeInit (0x00C)
230#define POST_chipsetInit (0x00D)
231#define POST_sioTest (0x00E)
232#define POST_pcATjunk (0x00F)
233
234#define POST_intTable (0x010)
235#define POST_memInfo (0x011)
236#define POST_romCopy (0x012)
237#define POST_PLLCheck (0x013)
238#define POST_keyboardInit (0x014)
239#define POST_cpuCacheOff (0x015)
240#define POST_BDAInit (0x016)
241#define POST_pciScan (0x017)
242#define POST_optionRomInit (0x018)
243#define POST_ResetLimits (0x019)
244#define POST_summary_screen (0x01A)
245#define POST_Boot (0x01B)
246#define POST_SystemPreInit (0x01C)
247#define POST_ClearRebootFlag (0x01D)
248#define POST_GLIUInit (0x01E)
249#define POST_BootFailed (0x01F)
250
251#define POST_CPU_ID (0x020)
252#define POST_COUNTERBROKEN (0x021)
253#define POST_DIFF_DIMMS (0x022)
254#define POST_WIGGLE_MEM_LINES (0x023)
255#define POST_NO_GLIU_DESC (0x024)
256#define POST_CPU_LCD_CHECK (0x025)
257#define POST_CPU_LCD_PASS (0x026)
258#define POST_CPU_LCD_FAIL (0x027)
259#define POST_CPU_STEPPING (0x028)
260#define POST_CPU_DM_BIST_FAILURE (0x029)
261#define POST_CPU_FLAGS (0x02A)
262#define POST_CHIPSET_ID (0x02B)
263#define POST_CHIPSET_ID_PASS (0x02C)
264#define POST_CHIPSET_ID_FAIL (0x02D)
265#define POST_CPU_ID_GOOD (0x02E)
266#define POST_CPU_ID_FAIL (0x02F)
267
268/* PCI config*/
269#define P80_PCICFG (0x030)
270
271/* PCI io*/
272#define P80_PCIIO (0x040)
273
274/* PCI memory*/
275#define P80_PCIMEM (0x050)
276
277/* SIO*/
278#define P80_SIO (0x060)
279
280/* Memory Setp*/
281#define P80_MEM_SETUP (0x070)
282#define POST_MEM_SETUP (0x070)
283#define ERROR_32BIT_DIMMS (0x071)
284#define POST_MEM_SETUP2 (0x072)
285#define POST_MEM_SETUP3 (0x073)
286#define POST_MEM_SETUP4 (0x074)
287#define POST_MEM_SETUP5 (0x075)
288#define POST_MEM_ENABLE (0x076)
289#define ERROR_NO_DIMMS (0x077)
290#define ERROR_DIFF_DIMMS (0x078)
291#define ERROR_BAD_LATENCY (0x079)
292#define ERROR_SET_PAGE (0x07A)
293#define ERROR_DENSITY_DIMM (0x07B)
294#define ERROR_UNSUPPORTED_DIMM (0x07C)
295#define ERROR_BANK_SET (0x07D)
296#define POST_MEM_SETUP_GOOD (0x07E)
297#define POST_MEM_SETUP_FAIL (0x07F)
298
299#define POST_UserPreInit (0x080)
300#define POST_UserPostInit (0x081)
301#define POST_Equipment_check (0x082)
302#define POST_InitNVRAMBX (0x083)
303#define POST_NoPIRTable (0x084)
304#define POST_ChipsetFingerPrintPass (0x085)
305#define POST_ChipsetFingerPrintFail (0x086)
306#define POST_CPU_IM_TAG_BIST_FAILURE (0x087)
307#define POST_CPU_IM_DATA_BIST_FAILURE (0x088)
308#define POST_CPU_FPU_BIST_FAILURE (0x089)
309#define POST_CPU_BTB_BIST_FAILURE (0x08A)
310#define POST_CPU_EX_BIST_FAILURE (0x08B)
311#define POST_Chipset_PI_Test_Fail (0x08C)
312#define POST_Chipset_SMBus_SDA_Test_Fail (0x08D)
313#define POST_BIT_CLK_Fail (0x08E)
314
315#define POST_STACK_SETUP (0x090)
316#define POST_CPU_PF_BIST_FAILURE (0x091)
317#define POST_CPU_L2_BIST_FAILURE (0x092)
318#define POST_CPU_GLCP_BIST_FAILURE (0x093)
319#define POST_CPU_DF_BIST_FAILURE (0x094)
320#define POST_CPU_VG_BIST_FAILURE (0x095)
321#define POST_CPU_VIP_BIST_FAILURE (0x096)
322#define POST_STACK_SETUP_PASS (0x09E)
323#define POST_STACK_SETUP_FAIL (0x09F)
324
325#define POST_PLL_INIT (0x0A0)
326#define POST_PLL_MANUAL (0x0A1)
327#define POST_PLL_STRAP (0x0A2)
328#define POST_PLL_RESET_FAIL (0x0A3)
329#define POST_PLL_PCI_FAIL (0x0A4)
330#define POST_PLL_MEM_FAIL (0x0A5)
331#define POST_PLL_CPU_VER_FAIL (0x0A6)
332
333#define POST_MEM_TESTMEM (0x0B0)
334#define POST_MEM_TESTMEM1 (0x0B1)
335#define POST_MEM_TESTMEM2 (0x0B2)
336#define POST_MEM_TESTMEM3 (0x0B3)
337#define POST_MEM_TESTMEM4 (0x0B4)
338#define POST_MEM_TESTMEM_PASS (0x0BE)
339#define POST_MEM_TESTMEM_FAIL (0x0BF)
340
341#define POST_SECUROM_SECBOOT_START (0x0C0)
342#define POST_SECUROM_BOOTSRCSETUP (0x0C1)
343#define POST_SECUROM_REMAP_FAIL (0x0C2)
344#define POST_SECUROM_BOOTSRCSETUP_FAIL (0x0C3)
345#define POST_SECUROM_DCACHESETUP (0x0C4)
346#define POST_SECUROM_DCACHESETUP_FAIL (0x0C5)
347#define POST_SECUROM_ICACHESETUP (0x0C6)
348#define POST_SECUROM_DESCRIPTORSETUP (0x0C7)
349#define POST_SECUROM_DCACHESETUPBIOS (0x0C8)
350#define POST_SECUROM_PLATFORMSETUP (0x0C9)
351#define POST_SECUROM_SIGCHECKBIOS (0x0CA)
352#define POST_SECUROM_ICACHESETUPBIOS (0x0CB)
353#define POST_SECUROM_PASS (0x0CC)
354#define POST_SECUROM_FAIL (0x0CD)
355
356#define POST_RCONFInitError (0x0CE)
357#define POST_CacheInitError (0x0CF)
358
359#define POST_ROM_PREUNCOMPRESS (0x0D0)
360#define POST_ROM_UNCOMPRESS (0x0D1)
361#define POST_ROM_SMM_INIT (0x0D2)
362#define POST_ROM_VID_BIOS (0x0D3)
363#define POST_ROM_LCDINIT (0x0D4)
364#define POST_ROM_SPLASH (0x0D5)
365#define POST_ROM_HDDINIT (0x0D6)
366#define POST_ROM_SYS_INIT (0x0D7)
367#define POST_ROM_DMM_INIT (0x0D8)
368#define POST_ROM_TVINIT (0x0D9)
369#define POST_ROM_POSTUNCOMPRESS (0x0DE)
370
371#define P80_CHIPSET_INIT (0x0E0)
372#define POST_PreChipsetInit (0x0E1)
373#define POST_LateChipsetInit (0x0E2)
374#define POST_NORTHB_INIT (0x0E8)
375
376#define POST_INTR_SEG_JUMP (0x0F0)
377
378#endif /* THE_ALMIGHTY_POST_CODES_H */