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.
17 #include <northbridge/amd/agesa/BiosCallOuts.h>
18 #include "OptionsIds.h"
21 #include <vendorcode/amd/agesa/f15tn/Proc/Fch/FchPlatform.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
);
41 * ASUS F2A85-M board ALC887-VD Verb Table
43 * Copied from `/sys/class/sound/hwC1D0/init_pin_configs` when running
46 const CODEC_ENTRY f2a85_m_alc887_VerbTbl
[] = {
64 static const CODEC_TBL_LIST CodecTableList
[] =
66 {0x10ec0887, (CODEC_ENTRY
*)&f2a85_m_alc887_VerbTbl
[0]},
67 {(UINT32
)0x0FFFFFFFF, (CODEC_ENTRY
*)0x0FFFFFFFFUL
}
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
;