| 1 |
|
| 2 |
|
| 3 |
#include <amdblocks/agesawrapper.h> |
| 4 |
#include <device/device.h> |
| 5 |
#include <soc/pci_devs.h> |
| 6 |
#include <static.h> |
| 7 |
|
| 8 |
static int is_sata_config(void) |
| 9 |
{ |
| 10 |
return !((SataNativeIde == CONFIG_STONEYRIDGE_SATA_MODE) |
| 11 |
|| (SataLegacyIde == CONFIG_STONEYRIDGE_SATA_MODE)); |
| 12 |
} |
| 13 |
|
| 14 |
static inline int sb_sata_enable(void) |
| 15 |
{ |
| 16 |
|
| 17 |
return (SataNativeIde == CONFIG_STONEYRIDGE_SATA_MODE) || |
| 18 |
(SataAhci == CONFIG_STONEYRIDGE_SATA_MODE); |
| 19 |
} |
| 20 |
|
| 21 |
static inline int sb_ide_enable(void) |
| 22 |
{ |
| 23 |
|
| 24 |
return (SataNativeIde == CONFIG_STONEYRIDGE_SATA_MODE) || |
| 25 |
(SataLegacyIde == CONFIG_STONEYRIDGE_SATA_MODE); |
| 26 |
} |
| 27 |
|
| 28 |
void SetFchResetParams(FCH_RESET_INTERFACE *params) |
| 29 |
{ |
| 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; |
| 37 |
} |
| 38 |
} |
| 39 |
|
| 40 |
void SetFchEnvParams(FCH_INTERFACE *params) |
| 41 |
{ |
| 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; |
| 53 |
} |
| 54 |
} |
| 55 |
|
| 56 |
void SetFchMidParams(FCH_INTERFACE *params) |
| 57 |
{ |
| 58 |
SetFchEnvParams(params); |
| 59 |
} |