1 /* SPDX-License-Identifier: GPL-2.0-only */
3 #include <console/console.h>
6 #include <soc/intel/common/reset.h>
9 static const uint8_t fsp_reset_guid
[16] = {
10 0xff, 0x97, 0x05, 0xea, 0x58, 0x88, 0xca, 0x41,
11 0xbb, 0xc1, 0xfe, 0x18, 0xfc, 0xd2, 0x8e, 0x22
14 static const uint8_t fsp_global_reset_guid
[16] = {
15 0x4c, 0x1b, 0xb3, 0x9d, 0xef, 0xf5, 0xbb, 0x48,
16 0x94, 0x2b, 0x18, 0x1f, 0x7e, 0x3a, 0x3e, 0x40
19 /* Platform Reset String as per Intel FSP is "PCH RESET" in unicode */
20 #define PLATFORM_RESET_STRING_LENGTH 20
22 struct pch_reset_data
{
23 char reserved
[PLATFORM_RESET_STRING_LENGTH
];
24 efi_guid_t global_reset_uid
;
27 /* This structure is used to provide information about PCH Reset */
28 struct fsp_reset_hob
{
29 EFI_RESET_TYPE reset_type
;
30 struct pch_reset_data reset_data
;
33 void chipset_handle_reset(efi_return_status_t status
)
35 if (status
== CONFIG_FSP_STATUS_GLOBAL_RESET
) {
36 printk(BIOS_DEBUG
, "GLOBAL RESET!\n");
40 fsp_printk(status
, BIOS_ERR
, "unhandled reset type");
41 die("unknown reset type");
44 static efi_return_status_t
fsp_reset_type_to_status(EFI_RESET_TYPE reset_type
)
46 efi_return_status_t status
;
50 status
= FSP_STATUS_RESET_REQUIRED_COLD
;
53 status
= FSP_STATUS_RESET_REQUIRED_WARM
;
56 printk(BIOS_ERR
, "unhandled reset type %x\n", reset_type
);
57 die("unknown reset type");
64 * Return PCH Reset Status
65 * The return status can be between EfiResetCold, EfiResetWarm, EfiResetShutdown
66 * or EfiResetPlatformSpecific.
68 * If reset type is `EfiResetPlatformSpecific` then relying on pch_reset_data structure
69 * to know if the reset type is a global reset.
71 efi_return_status_t
fsp_get_pch_reset_status(void)
74 const struct fsp_reset_hob
*hob
= fsp_find_extension_hob_by_guid(fsp_reset_guid
, &size
);
78 if ((hob
->reset_type
== EfiResetPlatformSpecific
) &&
79 fsp_guid_compare((void *)&(hob
->reset_data
.global_reset_uid
),
80 fsp_global_reset_guid
))
81 return CONFIG_FSP_STATUS_GLOBAL_RESET
;
83 return fsp_reset_type_to_status(hob
->reset_type
);