soc/amd: factor out fch_smbus_init

Change-Id: I6df9323dc4e7ca99fd5368f0262e850c0aca5c54
Signed-off-by: Felix Held <felix-coreboot@felixheld.de>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/48218
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Marshall Dawson <marshalldawson3rd@gmail.com>
This commit is contained in:
Felix Held
2020-12-01 21:17:17 +01:00
parent 875e5aa96c
commit 43a5f88bb4
5 changed files with 23 additions and 28 deletions

View File

@@ -332,20 +332,6 @@ static void setup_misc(int *reboot)
}
}
static void fch_smbus_init(void)
{
/* 400 kHz smbus speed. */
const uint8_t smbus_speed = (66000000 / (400000 * 4));
pm_write8(SMB_ASF_IO_BASE, SMB_BASE_ADDR >> 8);
smbus_write8(SMBTIMING, smbus_speed);
/* Clear all SMBUS status bits */
smbus_write8(SMBHSTSTAT, SMBHST_STAT_CLEAR);
smbus_write8(SMBSLVSTAT, SMBSLV_STAT_CLEAR);
asf_write8(SMBHSTSTAT, SMBHST_STAT_CLEAR);
asf_write8(SMBSLVSTAT, SMBSLV_STAT_CLEAR);
}
/* Before console init */
void bootblock_fch_early_init(void)
{