tree: Remove unused <assert.h>
[coreboot.git] / src / soc / amd / stoneyridge / fch_agesa.c
blob5031971de11f7864bbaca5ec5aa27837121a1223
1 /* SPDX-License-Identifier: GPL-2.0-only */
3 #include <amdblocks/agesawrapper.h>
4 #include <device/device.h>
5 #include <soc/pci_devs.h>
6 #include <static.h>
8 static int is_sata_config(void)
10 return !((SataNativeIde == CONFIG_STONEYRIDGE_SATA_MODE)
11 || (SataLegacyIde == CONFIG_STONEYRIDGE_SATA_MODE));
14 static inline int sb_sata_enable(void)
16 /* True if IDE or AHCI. */
17 return (SataNativeIde == CONFIG_STONEYRIDGE_SATA_MODE) ||
18 (SataAhci == CONFIG_STONEYRIDGE_SATA_MODE);
21 static inline int sb_ide_enable(void)
23 /* True if IDE or LEGACY IDE. */
24 return (SataNativeIde == CONFIG_STONEYRIDGE_SATA_MODE) ||
25 (SataLegacyIde == CONFIG_STONEYRIDGE_SATA_MODE);
28 void SetFchResetParams(FCH_RESET_INTERFACE *params)
30 params->Xhci0Enable = CONFIG(STONEYRIDGE_XHCI_ENABLE);
31 if (is_dev_enabled(DEV_PTR(sata))) {
32 params->SataEnable = sb_sata_enable();
33 params->IdeEnable = sb_ide_enable();
34 } else {
35 params->SataEnable = FALSE;
36 params->IdeEnable = FALSE;
40 void SetFchEnvParams(FCH_INTERFACE *params)
42 params->AzaliaController = AzEnable;
43 params->SataClass = CONFIG_STONEYRIDGE_SATA_MODE;
44 if (is_dev_enabled(DEV_PTR(sata))) {
45 params->SataEnable = is_sata_config();
46 params->IdeEnable = !params->SataEnable;
47 params->SataIdeMode = (CONFIG_STONEYRIDGE_SATA_MODE ==
48 SataLegacyIde);
49 } else {
50 params->SataEnable = FALSE;
51 params->IdeEnable = FALSE;
52 params->SataIdeMode = FALSE;
56 void SetFchMidParams(FCH_INTERFACE *params)
58 SetFchEnvParams(params);