From 153f92adbed953c068b09b3ef7d9f5369488c13c Mon Sep 17 00:00:00 2001 From: Felix Held Date: Tue, 8 Dec 2020 17:27:30 +0100 Subject: soc/amd/cezanne: add basic early FCH initialization to bootblock Change-Id: I1c6d32a5498a7adcee3c8c3145f85e9dba26bf7e Signed-off-by: Felix Held Reviewed-on: https://review.coreboot.org/c/coreboot/+/48475 Tested-by: build bot (Jenkins) Reviewed-by: Marshall Dawson --- src/soc/amd/cezanne/Makefile.inc | 1 + src/soc/amd/cezanne/bootblock.c | 3 +++ src/soc/amd/cezanne/early_fch.c | 21 +++++++++++++++++++++ src/soc/amd/cezanne/include/soc/southbridge.h | 3 +++ 4 files changed, 28 insertions(+) create mode 100644 src/soc/amd/cezanne/early_fch.c diff --git a/src/soc/amd/cezanne/Makefile.inc b/src/soc/amd/cezanne/Makefile.inc index df3355e77b..946e48004b 100644 --- a/src/soc/amd/cezanne/Makefile.inc +++ b/src/soc/amd/cezanne/Makefile.inc @@ -5,6 +5,7 @@ ifeq ($(CONFIG_SOC_AMD_CEZANNE),y) all-y += config.c bootblock-y += bootblock.c +bootblock-y += early_fch.c romstage-y += romstage.c diff --git a/src/soc/amd/cezanne/bootblock.c b/src/soc/amd/cezanne/bootblock.c index 7fe9f81e28..8e1bff0fbf 100644 --- a/src/soc/amd/cezanne/bootblock.c +++ b/src/soc/amd/cezanne/bootblock.c @@ -3,6 +3,7 @@ #include #include #include +#include #include asmlinkage void bootblock_c_entry(uint64_t base_timestamp) @@ -20,8 +21,10 @@ asmlinkage void bootblock_c_entry(uint64_t base_timestamp) void bootblock_soc_early_init(void) { + fch_pre_init(); } void bootblock_soc_init(void) { + fch_early_init(); } diff --git a/src/soc/amd/cezanne/early_fch.c b/src/soc/amd/cezanne/early_fch.c new file mode 100644 index 0000000000..6616d075b9 --- /dev/null +++ b/src/soc/amd/cezanne/early_fch.c @@ -0,0 +1,21 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#include +#include +#include +#include + +/* Before console init */ +void fch_pre_init(void) +{ + enable_acpimmio_decode_pm04(); + fch_smbus_init(); + fch_enable_cf9_io(); + fch_enable_legacy_io(); +} + +/* After console init */ +void fch_early_init(void) +{ + fch_print_pmxc0_status(); +} diff --git a/src/soc/amd/cezanne/include/soc/southbridge.h b/src/soc/amd/cezanne/include/soc/southbridge.h index 0f26ff0807..2456ebc6f9 100644 --- a/src/soc/amd/cezanne/include/soc/southbridge.h +++ b/src/soc/amd/cezanne/include/soc/southbridge.h @@ -5,4 +5,7 @@ #include +void fch_pre_init(void); +void fch_early_init(void); + #endif /* AMD_CEZANNE_SOUTHBRIDGE_H */ -- cgit v1.2.3