coreboot/src/include/reset.h
Subrata Banik ae0adb7c16 lib: Introduce early power off support Kconfig option
This commit introduces the `HAVE_EARLY_POWEROFF_SUPPORT` Kconfig option
and the `platform_do_early_poweroff()` API.

The Kconfig option enables platform-specific early power off support,
which is often required on Intel platforms. The corresponding API allows
platforms to implement the necessary hardware operations for early power
off, typically before memory initialization.

BUG=b:339673254
TEST=Able to build and boot google/brox.

Change-Id: I05b9882e100825a4fb733163a65f820c8c943361
Signed-off-by: Subrata Banik <subratabanik@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/86417
Reviewed-by: Karthik Ramasubramanian <kramasub@google.com>
Reviewed-by: Julius Werner <jwerner@chromium.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2025-02-15 18:59:11 +00:00

59 lines
1.8 KiB
C

/* SPDX-License-Identifier: GPL-2.0-only */
#ifndef RESET_H
#define RESET_H
/*
* Generic board reset function. Call from common code that
* wants to trigger a reset.
*/
__noreturn void board_reset(void);
/*
* SoC or board specific implementation of the board reset.
*
* Implementations shall meet the following criteria:
*
* o For vboot support, the TPM MUST be reset.
*
* o All SoC/chipset blocks SHOULD be reset except for those
* that are intentionally meant to survive reset (e.g. tomb-
* stone registers and that sort of stuff).
*
* o All external SoC pins SHOULD return to power-on reset values.
*
* o The CPU MUST resume execution from power-on reset vector
* (same as cold boot).
*
* o Other board components (e.g. PCI, SDIO and stuff) SHOULD
* be reset.
*
* o USB SHOULD be power-cycled.
*
* o Board components that are intended to be fully independent
* from SoC (e.g. EC and EC-attached devices, the Cr50 on
* Chromebooks) SHOULD NOT be reset.
*
* General recommendations:
*
* o DRAM SHOULD NOT lose power if possible.
*
* o Reset time SHOULD be minimized
*/
void do_board_reset(void);
/*
* Performs platform-specific actions for early power off.
*
* This function handles the necessary steps to initiate an early power off
* sequence. This might involve configuring specific hardware registers,
* sending commands to power management controllers, or performing other
* platform-specific operations. It is crucial that this
* function is implemented correctly to ensure a clean and controlled shutdown.
*
* Note: Issuing power off early before memory initialization is not supported use case on
* Intel chipset, therefore, it might need a special platform specific handing
* to power-off the platform early.
*/
void platform_do_early_poweroff(void);
#endif