soc/amd: factor out common AOAC device enable and status query functions
The code on Stoneyridge didn't set the FCH_AOAC_TARGET_DEVICE_STATE bits to FCH_AOAC_D0_INITIALIZED like the code for Picasso does, but that is the default value after reset for those bits on both platforms. Change-Id: I7cae23257ae54da73b713fe88aca5edfa4656754 Signed-off-by: Felix Held <felix-coreboot@felixheld.de> Reviewed-on: https://review.coreboot.org/c/coreboot/+/48183 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Marshall Dawson <marshalldawson3rd@gmail.com>
This commit is contained in:
@ -146,28 +146,6 @@ const struct irq_idx_name *sb_get_apic_reg_association(size_t *size)
|
||||
return irq_association;
|
||||
}
|
||||
|
||||
static void power_on_aoac_device(unsigned int dev)
|
||||
{
|
||||
uint8_t byte;
|
||||
|
||||
/* Power on the UART and AMBA devices */
|
||||
byte = aoac_read8(AOAC_DEV_D3_CTL(dev));
|
||||
byte |= FCH_AOAC_PWR_ON_DEV;
|
||||
aoac_write8(AOAC_DEV_D3_CTL(dev), byte);
|
||||
}
|
||||
|
||||
static bool is_aoac_device_enabled(unsigned int dev)
|
||||
{
|
||||
uint8_t byte;
|
||||
|
||||
byte = aoac_read8(AOAC_DEV_D3_STATE(dev));
|
||||
byte &= (FCH_AOAC_PWR_RST_STATE | FCH_AOAC_RST_CLK_OK_STATE);
|
||||
if (byte == (FCH_AOAC_PWR_RST_STATE | FCH_AOAC_RST_CLK_OK_STATE))
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
void enable_aoac_devices(void)
|
||||
{
|
||||
bool status;
|
||||
|
Reference in New Issue
Block a user