coreboot-kgpe-d16/src/include/reset.h

43 lines
1.1 KiB
C
Raw Normal View History

#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);
Consolidate reset API, add generic reset_prepare mechanism There are many good reasons why we may want to run some sort of generic callback before we're executing a reset. Unfortunateley, that is really hard right now: code that wants to reset simply calls the hard_reset() function (or one of its ill-differentiated cousins) which is directly implemented by a myriad of different mainboards, northbridges, SoCs, etc. More recent x86 SoCs have tried to solve the problem in their own little corner of soc/intel/common, but it's really something that would benefit all of coreboot. This patch expands the concept onto all boards: hard_reset() and friends get implemented in a generic location where they can run hooks before calling the platform-specific implementation that is now called do_hard_reset(). The existing Intel reset_prepare() gets generalized as soc_reset_prepare() (and other hooks for arch, mainboard, etc. can now easily be added later if necessary). We will also use this central point to ensure all platforms flush their cache before reset, which is generally useful for all cases where we're trying to persist information in RAM across reboots (like the new persistent CBMEM console does). Also remove cpu_reset() completely since it's not used anywhere and doesn't seem very useful compared to the others. Change-Id: I41b89ce4a923102f0748922496e1dd9bce8a610f Signed-off-by: Julius Werner <jwerner@chromium.org> Reviewed-on: https://review.coreboot.org/19789 Reviewed-by: Aaron Durbin <adurbin@chromium.org> Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Furquan Shaikh <furquan@google.com>
2017-05-19 01:03:26 +02:00
#endif