tree: drop last paragraph of GPL copyright header
[coreboot.git] / src / mainboard / asus / f2a85-m_le / BiosCallOuts.c
blob28da177b304057c9d1013e18ed3d5f7889c829ed
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 "AGESA.h"
17 #include <northbridge/amd/agesa/BiosCallOuts.h>
18 #include "OptionsIds.h"
20 #include <cbfs.h>
21 #include <vendorcode/amd/agesa/f15tn/Proc/Fch/FchPlatform.h>
22 #include <stdlib.h>
24 static AGESA_STATUS Fch_Oem_config(UINT32 Func, UINTN FchData, VOID *ConfigPtr);
26 const BIOS_CALLOUT_STRUCT BiosCallouts[] =
28 {AGESA_DO_RESET, agesa_Reset },
29 {AGESA_READ_SPD, agesa_ReadSpd },
30 {AGESA_READ_SPD_RECOVERY, agesa_NoopUnsupported },
31 {AGESA_RUNFUNC_ONAP, agesa_RunFuncOnAp },
32 {AGESA_GET_IDS_INIT_DATA, agesa_EmptyIdsInitData },
33 {AGESA_HOOKBEFORE_DQS_TRAINING, agesa_NoopSuccess },
34 {AGESA_HOOKBEFORE_EXIT_SELF_REF, agesa_NoopSuccess },
35 {AGESA_FCH_OEM_CALLOUT, Fch_Oem_config },
36 {AGESA_GNB_GFX_GET_VBIOS_IMAGE, agesa_GfxGetVbiosImage }
38 const int BiosCalloutsLen = ARRAY_SIZE(BiosCallouts);
40 /**
41 * ASUS F2A85-M board ALC887-VD Verb Table
43 * Copied from `/sys/class/sound/hwC1D0/init_pin_configs` when running
44 * the vendor BIOS.
46 const CODEC_ENTRY f2a85_m_alc887_VerbTbl[] = {
47 {0x11, 0x99430140},
48 {0x12, 0x411111f0},
49 {0x14, 0x01014010},
50 {0x15, 0x411111f0},
51 {0x16, 0x411111f0},
52 {0x17, 0x411111f0},
53 {0x18, 0x01a19850},
54 {0x19, 0x02a19c60},
55 {0x1a, 0x0181305f},
56 {0x1b, 0x02214c20},
57 {0x1c, 0x411111f0},
58 {0x1d, 0x4004c601},
59 {0x1e, 0x01456130},
60 {0x1f, 0x411111f0},
61 {0xff, 0xffffffff}
64 static const CODEC_TBL_LIST CodecTableList[] =
66 {0x10ec0887, (CODEC_ENTRY*)&f2a85_m_alc887_VerbTbl[0]},
67 {(UINT32)0x0FFFFFFFF, (CODEC_ENTRY*)0x0FFFFFFFFUL}
70 /**
71 * Fch Oem setting callback
73 * Configure platform specific Hudson device,
74 * such Azalia, SATA, GEC, IMC etc.
76 static AGESA_STATUS Fch_Oem_config(UINT32 Func, UINTN FchData, VOID *ConfigPtr)
78 AMD_CONFIG_PARAMS *StdHeader = ConfigPtr;
80 if (StdHeader->Func == AMD_INIT_RESET) {
81 FCH_RESET_DATA_BLOCK *FchParams_reset = (FCH_RESET_DATA_BLOCK *)FchData;
82 printk(BIOS_DEBUG, "Fch OEM config in INIT RESET ");
83 FchParams_reset->LegacyFree = IS_ENABLED(CONFIG_HUDSON_LEGACY_FREE);
84 FchParams_reset->FchReset.Xhci0Enable = IS_ENABLED(CONFIG_HUDSON_XHCI_ENABLE);
85 FchParams_reset->FchReset.Xhci1Enable = IS_ENABLED(CONFIG_HUDSON_XHCI_ENABLE);
86 } else if (StdHeader->Func == AMD_INIT_ENV) {
87 FCH_DATA_BLOCK *FchParams_env = (FCH_DATA_BLOCK *)FchData;
88 printk(BIOS_DEBUG, "Fch OEM config in INIT ENV ");
90 /* Azalia Controller OEM Codec Table Pointer */
91 FchParams_env->Azalia.AzaliaOemCodecTablePtr = (CODEC_TBL_LIST *)(&CodecTableList[0]);
92 /* Azalia Controller Front Panel OEM Table Pointer */
93 FchParams_env->Imc.ImcEnable = FALSE;
94 FchParams_env->Hwm.HwMonitorEnable = FALSE;
95 FchParams_env->Hwm.HwmFchtsiAutoPoll = FALSE;/* 1 enable, 0 disable TSI Auto Polling */
97 /* XHCI configuration */
98 FchParams_env->Usb.Xhci0Enable = IS_ENABLED(CONFIG_HUDSON_XHCI_ENABLE);
99 FchParams_env->Usb.Xhci1Enable = IS_ENABLED(CONFIG_HUDSON_XHCI_ENABLE);
101 printk(BIOS_DEBUG, "Done\n");
103 return AGESA_SUCCESS;