aboutsummaryrefslogtreecommitdiff
path: root/src/soc/intel/cannonlake/reset.c
diff options
context:
space:
mode:
authorSridhar Siricilla <sridhar.siricilla@intel.com>2019-08-31 14:54:57 +0530
committerPatrick Georgi <pgeorgi@google.com>2019-09-16 07:29:36 +0000
commitd415c206b5a657f84a3ab68a272c1187dccc2e12 (patch)
tree10453e375998cf5fab3d6bec39e7bf09f739a029 /src/soc/intel/cannonlake/reset.c
parent198f427907074767550841c8375f5cc0fae9e68c (diff)
src/soc/intel/{common,cnl,skl,icl}: Move global reset req function to common
send_heci_reset_req_message() is defined in multiple places, hence move it to common code. TEST=Verified on CMLRVP/Hatch/Soraka/Bobba/Dragon Egg boards. Change-Id: I691fc0610356ef1f64ffa7cc4fe7a39b1344cc16 Signed-off-by: Rizwan Qureshi <rizwan.qureshi@intel.com> Signed-off-by: Sridhar Siricilla <sridhar.siricilla@intel.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/35228 Reviewed-by: V Sowmya <v.sowmya@intel.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/soc/intel/cannonlake/reset.c')
-rw-r--r--src/soc/intel/cannonlake/reset.c57
1 files changed, 1 insertions, 56 deletions
diff --git a/src/soc/intel/cannonlake/reset.c b/src/soc/intel/cannonlake/reset.c
index e92396f39a..e01c22c463 100644
--- a/src/soc/intel/cannonlake/reset.c
+++ b/src/soc/intel/cannonlake/reset.c
@@ -22,65 +22,10 @@
#include <string.h>
#include <soc/pci_devs.h>
-/* Reset Request */
-#define MKHI_GLOBAL_RESET 0x0b
-#define MKHI_STATUS_SUCCESS 0
-
-#define GR_ORIGIN_BIOS_MEM_INIT 0x01
-#define GR_ORIGIN_BIOS_POST 0x02
-#define GR_ORIGIN_MEBX 0x03
-
-#define GLOBAL_RST_TYPE 0x01
-
-#define BIOS_HOST_ADD 0x00
-#define HECI_MKHI_ADD 0x07
-
-static int send_heci_reset_message(void)
-{
- int status;
- struct reset_reply {
- u8 group_id;
- u8 command;
- u8 reserved;
- u8 result;
- } __packed reply;
- struct reset_message {
- u8 group_id;
- u8 cmd;
- u8 reserved;
- u8 result;
- u8 req_origin;
- u8 reset_type;
- } __packed;
- struct reset_message msg = {
- .cmd = MKHI_GLOBAL_RESET,
- .req_origin = GR_ORIGIN_BIOS_POST,
- .reset_type = GLOBAL_RST_TYPE
- };
- size_t reply_size;
-
- heci_reset();
-
- status = heci_send(&msg, sizeof(msg), BIOS_HOST_ADD, HECI_MKHI_ADD);
- if (status != 1)
- return -1;
-
- reply_size = sizeof(reply);
- memset(&reply, 0, reply_size);
- if (!heci_receive(&reply, &reply_size))
- return -1;
- if (reply.result != MKHI_STATUS_SUCCESS) {
- printk(BIOS_DEBUG, "Returned Mkhi Status is not success!\n");
- return -1;
- }
- printk(BIOS_DEBUG, "Heci receive success!\n");
- return 0;
-}
-
void do_global_reset(void)
{
/* Ask CSE to do the global reset */
- if (!send_heci_reset_message())
+ if (!send_heci_reset_req_message(GLOBAL_RESET))
return;
/* global reset if CSE fail to reset */