AGESA boards: Clean up Ids.h and Filecode.h includes
[coreboot.git] / src / mainboard / asrock / imb-a180 / BiosCallOuts.c
blob6f3b696a896b253ee853a774c2b1c0fe68443ac0
1 /*
2 * This file is part of the coreboot project.
4 * Copyright (C) 2012 Advanced Micro Devices, Inc.
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.
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.
16 #include <device/azalia.h>
17 #include "AGESA.h"
18 #include "amdlib.h"
19 #include <northbridge/amd/agesa/BiosCallOuts.h>
20 #include <northbridge/amd/agesa/state_machine.h>
21 #include "FchPlatform.h"
22 #include "cbfs.h"
23 #include <stdlib.h>
25 const BIOS_CALLOUT_STRUCT BiosCallouts[] =
27 {AGESA_DO_RESET, agesa_Reset },
28 {AGESA_READ_SPD, agesa_ReadSpd },
29 {AGESA_READ_SPD_RECOVERY, agesa_NoopUnsupported },
30 {AGESA_RUNFUNC_ONAP, agesa_RunFuncOnAp },
31 {AGESA_GET_IDS_INIT_DATA, agesa_EmptyIdsInitData },
32 {AGESA_HOOKBEFORE_DQS_TRAINING, agesa_NoopSuccess },
33 {AGESA_HOOKBEFORE_EXIT_SELF_REF, agesa_NoopSuccess },
34 {AGESA_GNB_GFX_GET_VBIOS_IMAGE, agesa_GfxGetVbiosImage }
36 const int BiosCalloutsLen = ARRAY_SIZE(BiosCallouts);
38 /**
39 * CODEC Initialization Table for Azalia HD Audio using Realtek ALC662 chip
41 static const CODEC_ENTRY Alc662_VerbTbl[] =
43 { 0x14, /*01014010*/ /* Port D - green headphone jack */
44 (AZALIA_PINCFG_PORT_JACK << 30)
45 | ((AZALIA_PINCFG_LOCATION_EXTERNAL | AZALIA_PINCFG_LOCATION_REAR) << 24)
46 | (AZALIA_PINCFG_DEVICE_LINEOUT << 20)
47 | (AZALIA_PINCFG_CONN_MINI_HEADPHONE_JACK << 16)
48 | (AZALIA_PINCFG_COLOR_GREEN << 12)
49 | (1 << 4)
50 | (0 << 0)
52 { 0x15, /*0x90170120*/ /* Port A - white speaker header */
53 (AZALIA_PINCFG_PORT_FIXED << 30)
54 | (AZALIA_PINCFG_LOCATION_INTERNAL << 24)
55 | (AZALIA_PINCFG_DEVICE_SPEAKER << 20)
56 | (AZALIA_PINCFG_CONN_OTHER_ANALOG << 16)
57 | (AZALIA_PINCFG_COLOR_WHITE << 12)
58 | (AZALIA_PINCFG_MISC_IGNORE_PRESENCE << 8)
59 | (2 << 4)
60 | (0 << 0)
62 { 0x16, 0x411111F0 }, /* Port G - not connected */
63 { 0x18, /*0x01A19040*/ /* Port B - pink headphone jack */
64 (AZALIA_PINCFG_PORT_JACK << 30)
65 | ((AZALIA_PINCFG_LOCATION_EXTERNAL | AZALIA_PINCFG_LOCATION_REAR) << 24)
66 | (AZALIA_PINCFG_DEVICE_MICROPHONE << 20)
67 | (AZALIA_PINCFG_CONN_MINI_HEADPHONE_JACK << 16)
68 | (AZALIA_PINCFG_COLOR_PINK << 12)
69 | (4 << 4)
70 | (0 << 0)
72 { 0x19, /*0x02A19050*/ /* Port F - front panel header mic */
73 (AZALIA_PINCFG_PORT_NC << 30)
74 | ((AZALIA_PINCFG_LOCATION_EXTERNAL | AZALIA_PINCFG_LOCATION_FRONT) << 24)
75 | (AZALIA_PINCFG_DEVICE_MICROPHONE << 20)
76 | (AZALIA_PINCFG_CONN_MINI_HEADPHONE_JACK << 16)
77 | (AZALIA_PINCFG_COLOR_PINK << 12)
78 | (5 << 4)
79 | (0 << 0)
81 { 0x1A, /*0x0181304F*/ /* Port C - NL blue headphone jack */
82 (AZALIA_PINCFG_PORT_NC << 30)
83 | ((AZALIA_PINCFG_LOCATION_EXTERNAL | AZALIA_PINCFG_LOCATION_REAR) << 24)
84 | (AZALIA_PINCFG_DEVICE_LINEIN << 20)
85 | (AZALIA_PINCFG_CONN_MINI_HEADPHONE_JACK << 16)
86 | (AZALIA_PINCFG_COLOR_BLUE << 12)
87 | (4 << 4)
88 | (0xF << 0)
90 { 0x1B, /*0x02214030*/ /* Port E - front panel line-out */
91 (AZALIA_PINCFG_PORT_NC << 30)
92 | ((AZALIA_PINCFG_LOCATION_EXTERNAL | AZALIA_PINCFG_LOCATION_FRONT) << 24)
93 | (AZALIA_PINCFG_DEVICE_HP_OUT << 20)
94 | (AZALIA_PINCFG_CONN_MINI_HEADPHONE_JACK << 16)
95 | (AZALIA_PINCFG_COLOR_GREEN << 12)
96 | (3 << 4)
97 | (0 << 0)
99 { 0x1C, 0x411111F0 }, /* CD-in - Not Connected */
100 { 0x1D, 0x411111F0 }, /* PC Beep - Not Connected */
101 { 0x1E, 0x411111F0 }, /* S/PDIF - Not connected */
102 { 0xFF, 0xFFFFFFFF },
105 static const CODEC_TBL_LIST CodecTableList[] =
107 {0x10ec0662, (CODEC_ENTRY*)Alc662_VerbTbl},
108 {(UINT32)0x0FFFFFFFF, (CODEC_ENTRY*)0x0FFFFFFFFUL}
111 void board_FCH_InitReset(struct sysinfo *cb_NA, FCH_RESET_DATA_BLOCK *FchParams_reset)
115 void board_FCH_InitEnv(struct sysinfo *cb_NA, FCH_DATA_BLOCK *FchParams_env)
117 /* Azalia Controller OEM Cqodec Table Pointer */
118 FchParams_env->Azalia.AzaliaOemCodecTablePtr = (CODEC_TBL_LIST*)CodecTableList;