From b3671ec5de62f9c15ee74a8134b4a711cc785886 Mon Sep 17 00:00:00 2001 From: Subrata Banik Date: Sun, 6 Feb 2022 18:21:50 +0530 Subject: soc/intel/*/pmc: Add `finalize` operation for pmc This patch implements the required operations to perform prior to booting to OS using coreboot native driver when platform decides to skip FSP notify APIs, i.e., Ready to Boot and End Of Firmware. Additionally, move the PMCON status bit clear operation to `.final` ops to cover any such chances where FSP-S Notify Phase or any other later boot stage may request a global reset and PMCON status bit remains set. BUG=b:211954778 TEST=Able to build brya with these changes. Signed-off-by: Subrata Banik Change-Id: I0a0b869849d5d8c76031b8999f3d28817ac69247 Reviewed-on: https://review.coreboot.org/c/coreboot/+/61649 Tested-by: build bot (Jenkins) Reviewed-by: Tim Wawrzynczak Reviewed-by: Lean Sheng Tan --- src/soc/intel/jasperlake/pmc.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src/soc/intel/jasperlake/pmc.c') diff --git a/src/soc/intel/jasperlake/pmc.c b/src/soc/intel/jasperlake/pmc.c index 47c3bb104b..5ad692b73f 100644 --- a/src/soc/intel/jasperlake/pmc.c +++ b/src/soc/intel/jasperlake/pmc.c @@ -117,6 +117,22 @@ static void pmc_fill_ssdt(const struct device *dev) generate_acpi_power_engine(); } +/* + * `pmc_final` function is native implementation of equivalent events performed by + * each FSP NotifyPhase() API invocations. + * + * + * Clear PMCON status bits (Global Reset/Power Failure/Host Reset Status bits) + * + * Perform the PMCON status bit clear operation from `.final` + * to cover any such chances where later boot stage requested a global + * reset and PMCON status bit remains set. + */ +static void pmc_final(struct device *dev) +{ + pmc_clear_pmcon_sts(); +} + struct device_operations pmc_ops = { .read_resources = soc_pmc_read_resources, .set_resources = noop_set_resources, @@ -125,4 +141,5 @@ struct device_operations pmc_ops = { #if CONFIG(HAVE_ACPI_TABLES) .acpi_fill_ssdt = pmc_fill_ssdt, #endif + .final = pmc_final, }; -- cgit v1.2.3