summaryrefslogtreecommitdiff
path: root/src/vendorcode/amd/opensil/genoa_poc
diff options
context:
space:
mode:
authorFelix Held <felix-coreboot@felixheld.de>2024-01-16 00:50:46 +0100
committerFelix Held <felix-coreboot@felixheld.de>2024-01-25 22:51:15 +0000
commitdc12a3817ae49123fadbe99fcab6c039f3b4b53d (patch)
treeb571b16563f0208c0b2f4bccc669820f98653f98 /src/vendorcode/amd/opensil/genoa_poc
parente5197e17786a5ebf231e1fd93e45b22fb753df6e (diff)
soc/amd/genoa_poc: rely less on boot state hooks
Call setup_opensil, opensil_entry, and fch_init in the right order from the init method of the SoC's chip operations. This brings this SoC both more in line with the other SoCs and avoids using boot state hooks for this which also makes the sequence in which those functions are called easier to understand. Previously the boot states were used so that setup_opensil was run before configure_mpio which was run before opensil_entry(SIL_TP1), but since configure_mpio is called from setup_opensil, this is no longer necessary. TEST=Onyx still boots to the payload and the MPIO configuration reported from the openSIL code is still the same. The FCH init code now runs before the resource allocation like on the AMD SoCs that rely on FSP. Signed-off-by: Felix Held <felix-coreboot@felixheld.de> Change-Id: Ic752635da5eaa9e333cfb927836f0d260d2ac049 Reviewed-on: https://review.coreboot.org/c/coreboot/+/79985 Reviewed-by: Marshall Dawson <marshalldawson3rd@gmail.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
Diffstat (limited to 'src/vendorcode/amd/opensil/genoa_poc')
-rw-r--r--src/vendorcode/amd/opensil/genoa_poc/opensil.h4
-rw-r--r--src/vendorcode/amd/opensil/genoa_poc/ramstage.c11
2 files changed, 7 insertions, 8 deletions
diff --git a/src/vendorcode/amd/opensil/genoa_poc/opensil.h b/src/vendorcode/amd/opensil/genoa_poc/opensil.h
index fbf46b3b8c..473238d04a 100644
--- a/src/vendorcode/amd/opensil/genoa_poc/opensil.h
+++ b/src/vendorcode/amd/opensil/genoa_poc/opensil.h
@@ -4,6 +4,7 @@
#define _OPENSIL_H_
#include <acpi/acpi.h>
+#include <xSIM-api.h>
void SIL_STATUS_report(const char *function, const int status);
// Add the memory map to dev, starting at index idx, returns last use idx
@@ -13,4 +14,7 @@ void opensil_fill_fadt_io_ports(acpi_fadt_t *fadt);
void configure_mpio(void);
+void setup_opensil(void);
+void opensil_entry(SIL_TIMEPOINT timepoint);
+
#endif
diff --git a/src/vendorcode/amd/opensil/genoa_poc/ramstage.c b/src/vendorcode/amd/opensil/genoa_poc/ramstage.c
index 7d03b32aec..11289bb81b 100644
--- a/src/vendorcode/amd/opensil/genoa_poc/ramstage.c
+++ b/src/vendorcode/amd/opensil/genoa_poc/ramstage.c
@@ -112,7 +112,7 @@ static void configure_sata(void)
}
}
-static void setup_opensil(void *unused)
+void setup_opensil(void)
{
const SIL_STATUS debug_ret = SilDebugSetup(HostDebugService);
SIL_STATUS_report("SilDebugSetup", debug_ret);
@@ -129,9 +129,7 @@ static void setup_opensil(void *unused)
configure_mpio();
}
-BOOT_STATE_INIT_ENTRY(BS_DEV_INIT_CHIPS, BS_ON_ENTRY, setup_opensil, NULL);
-
-static void opensil_entry(void *timepoint)
+void opensil_entry(SIL_TIMEPOINT timepoint)
{
SIL_STATUS ret;
SIL_TIMEPOINT tp = (uintptr_t)timepoint;
@@ -162,7 +160,4 @@ static void opensil_entry(void *timepoint)
}
}
-/* TODO: look into calling these functions from some SoC device operations instead of using
- * BOOT_STATE_INIT_ENTRY */
-BOOT_STATE_INIT_ENTRY(BS_DEV_INIT_CHIPS, BS_ON_EXIT, opensil_entry, (void *)SIL_TP1);
-/* TODO add other timepoints later. Are they NOOP? */
+/* TODO: also call timepoints 2 and 3 from coreboot. Are they NOOP? */