psp_verstage: initialize i2c in soc_init

GSC is connected with AP via i2c bus so we need to enable i2c in
psp_verstage.

Signed-off-by: Kangheui Won <khwon@chromium.org>
Change-Id: I5f7b73be67a692ea7de31ae53bd111d0e4b6998c
Reviewed-on: https://review.coreboot.org/c/coreboot/+/55136
Reviewed-by: Furquan Shaikh <furquan@google.com>
Reviewed-by: Raul Rangel <rrangel@chromium.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
Kangheui Won 2021-05-26 13:40:21 +10:00 committed by Werner Zeh
parent 7ca3ecb73a
commit 32f43e0e13
3 changed files with 6 additions and 20 deletions

View File

@ -19,7 +19,3 @@ void verstage_mainboard_early_init(void)
{ {
setup_gpio(); setup_gpio();
} }
void verstage_mainboard_init(void)
{
}

View File

@ -1,11 +1,8 @@
/* SPDX-License-Identifier: GPL-2.0-or-later */ /* SPDX-License-Identifier: GPL-2.0-or-later */
#include <amdblocks/gpio_banks.h> #include <amdblocks/gpio_banks.h>
#include <amdblocks/i2c.h>
#include <baseboard/variants.h> #include <baseboard/variants.h>
#include <console/console.h>
#include <security/vboot/vboot_common.h> #include <security/vboot/vboot_common.h>
#include <soc/southbridge.h>
static void setup_gpio(void) static void setup_gpio(void)
{ {
@ -18,20 +15,7 @@ static void setup_gpio(void)
printk(BIOS_DEBUG, "GPIOs setup\n"); printk(BIOS_DEBUG, "GPIOs setup\n");
} }
static void setup_i2c(void)
{
printk(BIOS_DEBUG, "Setting up i2c\n");
i2c_soc_early_init();
printk(BIOS_DEBUG, "i2c setup\n");
}
void verstage_mainboard_early_init(void) void verstage_mainboard_early_init(void)
{ {
setup_gpio(); setup_gpio();
} }
void verstage_mainboard_init(void)
{
enable_aoac_devices();
setup_i2c();
}

View File

@ -4,6 +4,7 @@
#include <amdblocks/acpimmio.h> #include <amdblocks/acpimmio.h>
#include <amdblocks/espi.h> #include <amdblocks/espi.h>
#include <amdblocks/i2c.h>
#include <amdblocks/spi.h> #include <amdblocks/spi.h>
#include <arch/exception.h> #include <arch/exception.h>
#include <arch/hlt.h> #include <arch/hlt.h>
@ -155,4 +156,9 @@ void verstage_soc_init(void)
{ {
if (CONFIG(SOC_AMD_COMMON_BLOCK_USE_ESPI)) if (CONFIG(SOC_AMD_COMMON_BLOCK_USE_ESPI))
espi_setup(); espi_setup();
enable_aoac_devices();
printk(BIOS_DEBUG, "Setting up i2c\n");
i2c_soc_early_init();
printk(BIOS_DEBUG, "i2c setup\n");
} }