amd/stoneyridge/include/soc/southbridge.h: Replace SATA magic numbers

CONFIG_STONEYRIDGE_SATA_MODE is compared against "magical numbers".
Because actual literals are in AGESA.h and adding agesa_headers.h to
southbridge.h causes compile errors, move comparison code from southbridge.h
to southbridge.c (where they are actually used). Replace these numbers
with actual literals.

BUG=b:71754828
TEST=Build kahlee.

Change-Id: I711473bf492d5ceca026ccd112c2c389a23bdbf9
Signed-off-by: Richard Spiegel <richard.spiegel@silverbackltd.com>
Reviewed-on: https://review.coreboot.org/23296
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
This commit is contained in:
Richard Spiegel 2018-01-16 14:40:10 -07:00 committed by Martin Roth
parent a318d2812d
commit 7ea8e02f4b
2 changed files with 14 additions and 14 deletions

View File

@ -287,20 +287,6 @@
#define WIDEIO_RANGE_ERROR -1
#define TOTAL_WIDEIO_PORTS 3
static inline int sb_sata_enable(void)
{
/* True if IDE or AHCI. */
return (CONFIG_STONEYRIDGE_SATA_MODE == 0) ||
(CONFIG_STONEYRIDGE_SATA_MODE == 2);
}
static inline int sb_ide_enable(void)
{
/* True if IDE or LEGACY IDE. */
return (CONFIG_STONEYRIDGE_SATA_MODE == 0) ||
(CONFIG_STONEYRIDGE_SATA_MODE == 3);
}
void sb_enable_rom(void);
void configure_stoneyridge_uart(void);
void sb_clk_output_48Mhz(void);

View File

@ -38,6 +38,20 @@ static int is_sata_config(void)
|| (CONFIG_STONEYRIDGE_SATA_MODE == SataLegacyIde));
}
static inline int sb_sata_enable(void)
{
/* True if IDE or AHCI. */
return (CONFIG_STONEYRIDGE_SATA_MODE == SataNativeIde) ||
(CONFIG_STONEYRIDGE_SATA_MODE == SataAhci);
}
static inline int sb_ide_enable(void)
{
/* True if IDE or LEGACY IDE. */
return (CONFIG_STONEYRIDGE_SATA_MODE == SataNativeIde) ||
(CONFIG_STONEYRIDGE_SATA_MODE == SataLegacyIde);
}
void SetFchResetParams(FCH_RESET_INTERFACE *params)
{
params->Xhci0Enable = IS_ENABLED(CONFIG_STONEYRIDGE_XHCI_ENABLE);