amd/stoneyridge: Clean up smi_util.c

Replace hardcoded values with defined ones.

Change-Id: If963a817a4bea9b6dbb0d41a2bc0789a44a01391
Signed-off-by: Marshall Dawson <marshalldawson3rd@gmail.com>
Reviewed-on: https://review.coreboot.org/21743
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-by: Martin Roth <martinroth@google.com>
Reviewed-by: Marc Jones <marc@marcjonesconsulting.com>
This commit is contained in:
Marshall Dawson 2017-09-22 15:35:32 -06:00 committed by Martin Roth
parent 714c087788
commit 9db0a2dcc8
1 changed files with 2 additions and 5 deletions

View File

@ -8,15 +8,12 @@
#include <console/console.h> #include <console/console.h>
#include <soc/smi.h> #include <soc/smi.h>
#define STONEYRIDGE_SMI_ACPI_COMMAND 75
static void configure_smi(uint8_t smi_num, uint8_t mode) static void configure_smi(uint8_t smi_num, uint8_t mode)
{ {
uint8_t reg32_offset, bit_offset; uint8_t reg32_offset, bit_offset;
uint32_t reg32; uint32_t reg32;
/* SMI sources range from [0:149] */ if (smi_num >= NUMBER_SMITYPES) {
if (smi_num > 149) {
printk(BIOS_WARNING, "BUG: Invalid SMI: %u\n", smi_num); printk(BIOS_WARNING, "BUG: Invalid SMI: %u\n", smi_num);
return; return;
} }
@ -74,5 +71,5 @@ void disable_gevent_smi(uint8_t gevent)
/** Enable SMIs on writes to ACPI SMI command port */ /** Enable SMIs on writes to ACPI SMI command port */
void enable_acpi_cmd_smi(void) void enable_acpi_cmd_smi(void)
{ {
configure_smi(STONEYRIDGE_SMI_ACPI_COMMAND, SMI_MODE_SMI); configure_smi(SMITYPE_SMI_CMD_PORT, SMI_MODE_SMI);
} }