Blame SOURCES/opal-prd-49999302251b3e3e2fdca2cbcdeb6aab9add7412.patch

f021ee
diff -up skiboot-5.9/core/hostservices.c.me skiboot-5.9/core/hostservices.c
f021ee
--- skiboot-5.9/core/hostservices.c.me	2017-10-31 05:29:28.000000000 +0100
f021ee
+++ skiboot-5.9/core/hostservices.c	2018-01-22 11:42:23.462547265 +0100
f021ee
@@ -697,34 +697,49 @@ static int hservice_clr_special_wakeup(s
f021ee
 	return 0;
f021ee
 }
f021ee
 
f021ee
-static int hservice_wakeup(uint32_t i_core, uint32_t i_mode)
f021ee
+int hservice_wakeup(uint32_t i_core, uint32_t i_mode)
f021ee
 {
f021ee
+	int (*set_wakeup)(struct cpu_thread *cpu);
f021ee
+	int (*clear_wakeup)(struct cpu_thread *cpu);
f021ee
 	struct cpu_thread *cpu;
f021ee
 	int rc = OPAL_SUCCESS;
f021ee
 
f021ee
-	/*
f021ee
-	 * Mask out the top nibble of i_core since it may contain
f021ee
-	 * 0x4 (which we use for XSCOM targeting)
f021ee
-	 */
f021ee
-	i_core &= 0x0fffffff;
f021ee
+	switch (proc_gen) {
f021ee
+	case proc_gen_p8:
f021ee
+		/*
f021ee
+		 * Mask out the top nibble of i_core since it may contain
f021ee
+		 * 0x4 (which we use for XSCOM targeting)
f021ee
+		 */
f021ee
+		i_core &= 0x0fffffff;
f021ee
+		i_core <<= 3;
f021ee
+		set_wakeup = hservice_set_special_wakeup;
f021ee
+		clear_wakeup = hservice_clr_special_wakeup;
f021ee
+		break;
f021ee
+	case proc_gen_p9:
f021ee
+		i_core &= SPR_PIR_P9_MASK;
f021ee
+		i_core <<= 2;
f021ee
+		set_wakeup = dctl_set_special_wakeup;
f021ee
+		clear_wakeup = dctl_clear_special_wakeup;
f021ee
+		break;
f021ee
+	default:
f021ee
+		return OPAL_UNSUPPORTED;
f021ee
+	}
f021ee
 
f021ee
 	/* What do we need to do ? */
f021ee
 	switch(i_mode) {
f021ee
 	case 0: /* Assert special wakeup */
f021ee
-		/* XXX Assume P8 */
f021ee
-		cpu = find_cpu_by_pir(i_core << 3);
f021ee
+		cpu = find_cpu_by_pir(i_core);
f021ee
 		if (!cpu)
f021ee
 			return OPAL_PARAMETER;
f021ee
 		prlog(PR_DEBUG, "HBRT: Special wakeup assert for core 0x%x,"
f021ee
 		      " count=%d\n", i_core, cpu->hbrt_spec_wakeup);
f021ee
 		if (cpu->hbrt_spec_wakeup == 0)
f021ee
-			rc = hservice_set_special_wakeup(cpu);
f021ee
+			rc = set_wakeup(cpu);
f021ee
 		if (rc == 0)
f021ee
 			cpu->hbrt_spec_wakeup++;
f021ee
 		return rc;
f021ee
 	case 1: /* Deassert special wakeup */
f021ee
-		/* XXX Assume P8 */
f021ee
-		cpu = find_cpu_by_pir(i_core << 3);
f021ee
+		cpu = find_cpu_by_pir(i_core);
f021ee
 		if (!cpu)
f021ee
 			return OPAL_PARAMETER;
f021ee
 		prlog(PR_DEBUG, "HBRT: Special wakeup release for core"
f021ee
@@ -738,7 +753,7 @@ static int hservice_wakeup(uint32_t i_co
f021ee
 		/* What to do with count on errors ? */
f021ee
 		cpu->hbrt_spec_wakeup--;
f021ee
 		if (cpu->hbrt_spec_wakeup == 0)
f021ee
-			rc = hservice_clr_special_wakeup(cpu);
f021ee
+			rc = clear_wakeup(cpu);
f021ee
 		return rc;
f021ee
 	case 2: /* Clear all special wakeups */
f021ee
 		prlog(PR_DEBUG, "HBRT: Special wakeup release for all cores\n");
f021ee
@@ -746,7 +761,7 @@ static int hservice_wakeup(uint32_t i_co
f021ee
 			if (cpu->hbrt_spec_wakeup) {
f021ee
 				cpu->hbrt_spec_wakeup = 0;
f021ee
 				/* What to do on errors ? */
f021ee
-				hservice_clr_special_wakeup(cpu);
f021ee
+				clear_wakeup(cpu);
f021ee
 			}
f021ee
 		}
f021ee
 		return OPAL_SUCCESS;
f021ee
diff -up skiboot-5.9/external/opal-prd/opal-prd.c.me skiboot-5.9/external/opal-prd/opal-prd.c
f021ee
--- skiboot-5.9/external/opal-prd/opal-prd.c.me	2017-10-31 05:29:28.000000000 +0100
f021ee
+++ skiboot-5.9/external/opal-prd/opal-prd.c	2018-01-22 11:42:23.463547227 +0100
f021ee
@@ -163,6 +163,9 @@ struct func_desc {
f021ee
 	void *toc;
f021ee
 } hbrt_entry;
f021ee
 
f021ee
+static int nr_chips;
f021ee
+static u64 chips[256];
f021ee
+
f021ee
 static int read_prd_msg(struct opal_prd_ctx *ctx);
f021ee
 
f021ee
 static struct prd_range *find_range(const char *name, uint32_t instance)
f021ee
@@ -521,6 +524,24 @@ int hservice_i2c_write(uint64_t i_master
f021ee
 			 i_offset, i_length, i_data);
f021ee
 }
f021ee
 
f021ee
+int hservice_wakeup(u32 core, u32 mode)
f021ee
+{
f021ee
+	struct opal_prd_msg msg;
f021ee
+
f021ee
+	msg.hdr.type = OPAL_PRD_MSG_TYPE_CORE_SPECIAL_WAKEUP;
f021ee
+	msg.hdr.size = htobe16(sizeof(msg));
f021ee
+	msg.spl_wakeup.core = htobe32(core);
f021ee
+	msg.spl_wakeup.mode = htobe32(mode);
f021ee
+
f021ee
+	if (write(ctx->fd, &msg, sizeof(msg)) != sizeof(msg)) {
f021ee
+		pr_log(LOG_ERR, "FW: Failed to send CORE_SPECIAL_WAKEUP msg %x : %m\n",
f021ee
+		       core);
f021ee
+		return -1;
f021ee
+	}
f021ee
+
f021ee
+	return 0;
f021ee
+}
f021ee
+
f021ee
 static void ipmi_init(struct opal_prd_ctx *ctx)
f021ee
 {
f021ee
 	insert_module("ipmi_devintf");
f021ee
@@ -1170,6 +1191,52 @@ static void print_ranges(struct opal_prd
f021ee
 	}
f021ee
 }
f021ee
 
f021ee
+static int chip_init(void)
f021ee
+{
f021ee
+	struct dirent *dirent;
f021ee
+	char *path;
f021ee
+	DIR *dir;
f021ee
+	__be32 *chipid;
f021ee
+	void *buf;
f021ee
+	int rc, len, i;
f021ee
+
f021ee
+	dir = opendir(devicetree_base);
f021ee
+	if (!dir) {
f021ee
+		pr_log(LOG_ERR, "FW: Can't open %s", devicetree_base);
f021ee
+		return  -1;
f021ee
+	}
f021ee
+
f021ee
+	for (;;) {
f021ee
+		dirent = readdir(dir);
f021ee
+		if (!dirent)
f021ee
+			break;
f021ee
+
f021ee
+		if (strncmp("xscom", dirent->d_name, 5))
f021ee
+			continue;
f021ee
+
f021ee
+		rc = asprintf(&path, "%s/%s/ibm,chip-id", devicetree_base,
f021ee
+			      dirent->d_name);
f021ee
+		if (rc < 0) {
f021ee
+			pr_log(LOG_ERR, "FW: Failed to create chip-id path");
f021ee
+			return -1;
f021ee
+		}
f021ee
+
f021ee
+		rc = open_and_read(path, &buf, &len;;
f021ee
+		if (rc) {
f021ee
+			pr_log(LOG_ERR, "FW; Failed to read chipid");
f021ee
+			return -1;
f021ee
+		}
f021ee
+		chipid = buf;
f021ee
+		chips[nr_chips++] = be32toh(*chipid);
f021ee
+	}
f021ee
+
f021ee
+	pr_log(LOG_DEBUG, "FW: Chip init");
f021ee
+	for (i = 0; i < nr_chips; i++)
f021ee
+		pr_log(LOG_DEBUG, "FW: Chip 0x%lx", chips[i]);
f021ee
+
f021ee
+	return 0;
f021ee
+}
f021ee
+
f021ee
 static int prd_init_ranges(struct opal_prd_ctx *ctx)
f021ee
 {
f021ee
 	struct dirent *dirent;
f021ee
@@ -1290,6 +1357,10 @@ static int prd_init(struct opal_prd_ctx
f021ee
 		return -1;
f021ee
 	}
f021ee
 
f021ee
+	rc = chip_init();
f021ee
+	if (rc)
f021ee
+		pr_log(LOG_ERR, "FW: Failed to initialize chip IDs");
f021ee
+
f021ee
 	return 0;
f021ee
 }
f021ee
 
f021ee
@@ -1433,6 +1504,41 @@ static int handle_msg_sbe_passthrough(st
f021ee
 	return rc;
f021ee
 }
f021ee
 
f021ee
+static int handle_msg_fsp_occ_reset(struct opal_prd_msg *msg)
f021ee
+{
f021ee
+	struct opal_prd_msg omsg;
f021ee
+	int rc = -1, i;
f021ee
+
f021ee
+	pr_debug("FW: FSP requested OCC reset");
f021ee
+
f021ee
+	if (!hservice_runtime->reset_pm_complex) {
f021ee
+		pr_log_nocall("reset_pm_complex");
f021ee
+		return rc;
f021ee
+	}
f021ee
+
f021ee
+	for (i = 0; i < nr_chips; i++) {
f021ee
+		pr_debug("PM: calling pm_complex_reset(0x%lx)", chips[i]);
f021ee
+		rc = call_reset_pm_complex(chips[i]);
f021ee
+		if (rc) {
f021ee
+			pr_log(LOG_ERR, "PM: Failed pm_complex_reset(0x%lx) %m",
f021ee
+			       chips[i]);
f021ee
+			break;
f021ee
+		}
f021ee
+	}
f021ee
+
f021ee
+	omsg.hdr.type = OPAL_PRD_MSG_TYPE_FSP_OCC_RESET_STATUS;
f021ee
+	omsg.hdr.size = htobe16(sizeof(omsg));
f021ee
+	omsg.fsp_occ_reset_status.chip = msg->occ_reset.chip;
f021ee
+	omsg.fsp_occ_reset_status.status = htobe64(rc);
f021ee
+
f021ee
+	if (write(ctx->fd, &omsg, sizeof(omsg)) != sizeof(omsg)) {
f021ee
+		pr_log(LOG_ERR, "FW: Failed to send FSP_OCC_RESET_STATUS msg: %m");
f021ee
+		return -1;
f021ee
+	}
f021ee
+
f021ee
+	return rc;
f021ee
+}
f021ee
+
f021ee
 static int handle_prd_msg(struct opal_prd_ctx *ctx, struct opal_prd_msg *msg)
f021ee
 {
f021ee
 	int rc = -1;
f021ee
@@ -1453,6 +1559,9 @@ static int handle_prd_msg(struct opal_pr
f021ee
 	case OPAL_PRD_MSG_TYPE_SBE_PASSTHROUGH:
f021ee
 		rc = handle_msg_sbe_passthrough(ctx, msg);
f021ee
 		break;
f021ee
+	case OPAL_PRD_MSG_TYPE_FSP_OCC_RESET:
f021ee
+		rc = handle_msg_fsp_occ_reset(msg);
f021ee
+		break;
f021ee
 	default:
f021ee
 		pr_log(LOG_WARNING, "Invalid incoming message type 0x%x",
f021ee
 				msg->hdr.type);
f021ee
@@ -1985,6 +2094,9 @@ static int run_prd_daemon(struct opal_pr
f021ee
 		hinterface.pnor_write = NULL;
f021ee
 	}
f021ee
 
f021ee
+	if (!is_fsp_system())
f021ee
+		hinterface.wakeup = NULL;
f021ee
+
f021ee
 	ipmi_init(ctx);
f021ee
 
f021ee
 	pr_debug("HBRT: calling hservices_init");
f021ee
diff -up skiboot-5.9/external/opal-prd/thunk.S.me skiboot-5.9/external/opal-prd/thunk.S
f021ee
--- skiboot-5.9/external/opal-prd/thunk.S.me	2017-10-31 05:29:28.000000000 +0100
f021ee
+++ skiboot-5.9/external/opal-prd/thunk.S	2018-01-22 11:42:23.463547227 +0100
f021ee
@@ -183,7 +183,7 @@ hinterface:
f021ee
 	DISABLED_THUNK(hservice_lid_load)
f021ee
 	DISABLED_THUNK(hservice_lid_unload)
f021ee
 	CALLBACK_THUNK(hservice_get_reserved_mem)
f021ee
-	DISABLED_THUNK(hservice_wakeup)
f021ee
+	CALLBACK_THUNK(hservice_wakeup)
f021ee
 	CALLBACK_THUNK(hservice_nanosleep)
f021ee
 	DISABLED_THUNK(hservice_report_occ_failure)
f021ee
 	CALLBACK_THUNK(hservice_clock_gettime)
f021ee
diff -up skiboot-5.9/hw/occ.c.me skiboot-5.9/hw/occ.c
f021ee
--- skiboot-5.9/hw/occ.c.me	2017-10-31 05:29:28.000000000 +0100
f021ee
+++ skiboot-5.9/hw/occ.c	2018-01-22 11:42:23.463547227 +0100
f021ee
@@ -1837,6 +1837,44 @@ out:
f021ee
 	return rc;
f021ee
 }
f021ee
 
f021ee
+static u32 last_seq_id;
f021ee
+
f021ee
+int fsp_occ_reset_status(u64 chipid, s64 status)
f021ee
+{
f021ee
+	struct fsp_msg *stat;
f021ee
+	int rc = OPAL_NO_MEM;
f021ee
+	int status_word = 0;
f021ee
+
f021ee
+	prlog(PR_INFO, "HBRT: OCC stop() completed with %lld\n", status);
f021ee
+
f021ee
+	if (status) {
f021ee
+		struct proc_chip *chip = get_chip(chipid);
f021ee
+
f021ee
+		if (!chip)
f021ee
+			return OPAL_PARAMETER;
f021ee
+
f021ee
+		status_word = 0xfe00 | (chip->pcid & 0xff);
f021ee
+		log_simple_error(&e_info(OPAL_RC_OCC_RESET),
f021ee
+				 "OCC: Error %lld in OCC reset of chip %lld\n",
f021ee
+				 status, chipid);
f021ee
+	} else {
f021ee
+		occ_msg_queue_occ_reset();
f021ee
+	}
f021ee
+
f021ee
+	stat = fsp_mkmsg(FSP_CMD_RESET_OCC_STAT, 2, status_word, last_seq_id);
f021ee
+	if (!stat)
f021ee
+		return rc;
f021ee
+
f021ee
+	rc = fsp_queue_msg(stat, fsp_freemsg);
f021ee
+	if (rc) {
f021ee
+		fsp_freemsg(stat);
f021ee
+		log_simple_error(&e_info(OPAL_RC_OCC_RESET),
f021ee
+			"OCC: Error %d queueing FSP OCC RESET STATUS message\n",
f021ee
+			rc);
f021ee
+	}
f021ee
+	return rc;
f021ee
+}
f021ee
+
f021ee
 static void occ_do_reset(u8 scope, u32 dbob_id, u32 seq_id)
f021ee
 {
f021ee
 	struct fsp_msg *rsp, *stat;
f021ee
@@ -1877,7 +1915,18 @@ static void occ_do_reset(u8 scope, u32 d
f021ee
 	 * FSP will request OCC to left in stopped state.
f021ee
 	 */
f021ee
 
f021ee
-	rc = host_services_occ_stop();
f021ee
+	switch (proc_gen) {
f021ee
+	case proc_gen_p8:
f021ee
+		rc = host_services_occ_stop();
f021ee
+		break;
f021ee
+	case proc_gen_p9:
f021ee
+		last_seq_id = seq_id;
f021ee
+		chip = next_chip(NULL);
f021ee
+		prd_fsp_occ_reset(chip->id);
f021ee
+		return;
f021ee
+	default:
f021ee
+		return;
f021ee
+	}
f021ee
 
f021ee
 	/* Handle fallback to preload */
f021ee
 	if (rc == -ENOENT && chip->homer_base) {
f021ee
diff -up skiboot-5.9/hw/prd.c.me skiboot-5.9/hw/prd.c
f021ee
--- skiboot-5.9/hw/prd.c.me	2017-10-31 05:29:28.000000000 +0100
f021ee
+++ skiboot-5.9/hw/prd.c	2018-01-22 11:42:23.464547189 +0100
f021ee
@@ -29,6 +29,7 @@ enum events {
f021ee
 	EVENT_OCC_ERROR	= 1 << 1,
f021ee
 	EVENT_OCC_RESET	= 1 << 2,
f021ee
 	EVENT_SBE_PASSTHROUGH = 1 << 3,
f021ee
+	EVENT_FSP_OCC_RESET = 1 << 4,
f021ee
 };
f021ee
 
f021ee
 static uint8_t events[MAX_CHIPS];
f021ee
@@ -114,6 +115,10 @@ static void prd_msg_consumed(void *data)
f021ee
 		proc = msg->sbe_passthrough.chip;
f021ee
 		event = EVENT_SBE_PASSTHROUGH;
f021ee
 		break;
f021ee
+	case OPAL_PRD_MSG_TYPE_FSP_OCC_RESET:
f021ee
+		proc = msg->occ_reset.chip;
f021ee
+		event = EVENT_FSP_OCC_RESET;
f021ee
+		break;
f021ee
 	default:
f021ee
 		prlog(PR_ERR, "PRD: invalid msg consumed, type: 0x%x\n",
f021ee
 				msg->hdr.type);
f021ee
@@ -188,6 +193,9 @@ static void send_next_pending_event(void
f021ee
 	} else if (event & EVENT_SBE_PASSTHROUGH) {
f021ee
 		prd_msg->hdr.type = OPAL_PRD_MSG_TYPE_SBE_PASSTHROUGH;
f021ee
 		prd_msg->sbe_passthrough.chip = proc;
f021ee
+	} else if (event & EVENT_FSP_OCC_RESET) {
f021ee
+		prd_msg->hdr.type = OPAL_PRD_MSG_TYPE_FSP_OCC_RESET;
f021ee
+		prd_msg->occ_reset.chip = proc;
f021ee
 	}
f021ee
 
f021ee
 	/*
f021ee
@@ -274,6 +282,11 @@ void prd_occ_reset(uint32_t proc)
f021ee
 	prd_event(proc, EVENT_OCC_RESET);
f021ee
 }
f021ee
 
f021ee
+void prd_fsp_occ_reset(uint32_t proc)
f021ee
+{
f021ee
+	prd_event(proc, EVENT_FSP_OCC_RESET);
f021ee
+}
f021ee
+
f021ee
 void prd_sbe_passthrough(uint32_t proc)
f021ee
 {
f021ee
 	prd_event(proc, EVENT_SBE_PASSTHROUGH);
f021ee
@@ -418,6 +431,14 @@ static int64_t opal_prd_msg(struct opal_
f021ee
 	case OPAL_PRD_MSG_TYPE_FIRMWARE_REQUEST:
f021ee
 		rc = prd_msg_handle_firmware_req(msg);
f021ee
 		break;
f021ee
+	case OPAL_PRD_MSG_TYPE_FSP_OCC_RESET_STATUS:
f021ee
+		rc = fsp_occ_reset_status(msg->fsp_occ_reset_status.chip,
f021ee
+					  msg->fsp_occ_reset_status.status);
f021ee
+		break;
f021ee
+	case OPAL_PRD_MSG_TYPE_CORE_SPECIAL_WAKEUP:
f021ee
+		rc = hservice_wakeup(msg->spl_wakeup.core,
f021ee
+				     msg->spl_wakeup.mode);
f021ee
+		break;
f021ee
 	default:
f021ee
 		rc = OPAL_UNSUPPORTED;
f021ee
 	}
f021ee
diff -up skiboot-5.9/include/hostservices.h.me skiboot-5.9/include/hostservices.h
f021ee
--- skiboot-5.9/include/hostservices.h.me	2018-01-22 11:42:23.464547189 +0100
f021ee
+++ skiboot-5.9/include/hostservices.h	2018-01-22 11:42:57.522259222 +0100
f021ee
@@ -38,5 +38,7 @@ void host_services_occ_base_setup(void);
f021ee
 
f021ee
 int find_master_and_slave_occ(uint64_t **master, uint64_t **slave,
f021ee
 			      int *nr_masters, int *nr_slaves);
f021ee
+int hservice_wakeup(uint32_t i_core, uint32_t i_mode);
f021ee
+int fsp_occ_reset_status(u64 chipid, s64 status);
f021ee
 
f021ee
 #endif /* __HOSTSERVICES_H */
f021ee
diff -up skiboot-5.9/include/opal-api.h.me skiboot-5.9/include/opal-api.h
f021ee
--- skiboot-5.9/include/opal-api.h.me	2017-10-31 05:29:28.000000000 +0100
f021ee
+++ skiboot-5.9/include/opal-api.h	2018-01-22 11:42:23.465547151 +0100
f021ee
@@ -1054,6 +1054,9 @@ enum opal_prd_msg_type {
f021ee
 	OPAL_PRD_MSG_TYPE_FIRMWARE_RESPONSE, /* HBRT <-- OPAL */
f021ee
 	OPAL_PRD_MSG_TYPE_FIRMWARE_NOTIFY, /* HBRT <-- OPAL */
f021ee
 	OPAL_PRD_MSG_TYPE_SBE_PASSTHROUGH, /* HBRT <-- OPAL */
f021ee
+	OPAL_PRD_MSG_TYPE_FSP_OCC_RESET, /* HBRT <-- OPAL */
f021ee
+	OPAL_PRD_MSG_TYPE_FSP_OCC_RESET_STATUS, /* HBRT --> OPAL */
f021ee
+	OPAL_PRD_MSG_TYPE_CORE_SPECIAL_WAKEUP, /* HBRT --> OPAL */
f021ee
 };
f021ee
 
f021ee
 struct opal_prd_msg_header {
f021ee
@@ -1101,6 +1104,14 @@ struct opal_prd_msg {
f021ee
 		struct {
f021ee
 			__be64	chip;
f021ee
 		} sbe_passthrough;
f021ee
+		struct {
f021ee
+			__be64 chip;
f021ee
+			__be64 status; /* 0 SUCCESS */
f021ee
+		} fsp_occ_reset_status;
f021ee
+		struct {
f021ee
+			__be32 core;
f021ee
+			__be32 mode;
f021ee
+		} spl_wakeup;
f021ee
 	};
f021ee
 };
f021ee
 
f021ee
diff -up skiboot-5.9/include/skiboot.h.me skiboot-5.9/include/skiboot.h
f021ee
--- skiboot-5.9/include/skiboot.h.me	2017-10-31 05:29:28.000000000 +0100
f021ee
+++ skiboot-5.9/include/skiboot.h	2018-01-22 11:42:23.465547151 +0100
f021ee
@@ -293,6 +293,7 @@ extern void prd_occ_reset(uint32_t proc)
f021ee
 extern void prd_sbe_passthrough(uint32_t proc);
f021ee
 extern void prd_init(void);
f021ee
 extern void prd_register_reserved_memory(void);
f021ee
+extern void prd_fsp_occ_reset(uint32_t proc);
f021ee
 
f021ee
 /* Flatten device-tree */
f021ee
 extern void *create_dtb(const struct dt_node *root, bool exclusive);
f021ee
diff -up skiboot-5.9/core/direct-controls.c.me skiboot-5.9/core/direct-controls.c
f021ee
--- skiboot-5.9/core/direct-controls.c.me	2017-10-31 00:29:28.000000000 -0400
f021ee
+++ skiboot-5.9/core/direct-controls.c	2018-01-22 07:12:07.642733620 -0500
f021ee
@@ -220,7 +220,7 @@ static int p9_sreset_thread(struct cpu_t
f021ee
 	return 0;
f021ee
 }
f021ee
 
f021ee
-static int dctl_set_special_wakeup(struct cpu_thread *t)
f021ee
+int dctl_set_special_wakeup(struct cpu_thread *t)
f021ee
 {
f021ee
 	struct cpu_thread *c = t->primary;
f021ee
 	int rc = OPAL_SUCCESS;
f021ee
@@ -238,7 +238,7 @@ static int dctl_set_special_wakeup(struc
f021ee
 	return rc;
f021ee
 }
f021ee
 
f021ee
-static int dctl_clear_special_wakeup(struct cpu_thread *t)
f021ee
+int dctl_clear_special_wakeup(struct cpu_thread *t)
f021ee
 {
f021ee
 	struct cpu_thread *c = t->primary;
f021ee
 	int rc = OPAL_SUCCESS;
f021ee
diff -up skiboot-5.9/hw/prd.c.me skiboot-5.9/hw/prd.c
f021ee
--- skiboot-5.9/hw/prd.c.me	2018-01-22 07:14:59.985852136 -0500
f021ee
+++ skiboot-5.9/hw/prd.c	2018-01-22 07:15:11.146054087 -0500
f021ee
@@ -23,6 +23,7 @@
f021ee
 #include <fsp.h>
f021ee
 #include <mem_region.h>
f021ee
 #include <prd-fw-msg.h>
f021ee
+#include <hostservices.h>
f021ee
 
f021ee
 enum events {
f021ee
 	EVENT_ATTN	= 1 << 0,
f021ee
diff -up skiboot-5.9/include/cpu.h.me skiboot-5.9/include/cpu.h
f021ee
--- skiboot-5.9/include/cpu.h.me	2017-10-31 00:29:28.000000000 -0400
f021ee
+++ skiboot-5.9/include/cpu.h	2018-01-22 07:12:07.642733620 -0500
f021ee
@@ -284,4 +284,7 @@ extern void cpu_idle_delay(unsigned long
f021ee
 extern void cpu_set_radix_mode(void);
f021ee
 extern void cpu_fast_reboot_complete(void);
f021ee
 
f021ee
+int dctl_set_special_wakeup(struct cpu_thread *t);
f021ee
+int dctl_clear_special_wakeup(struct cpu_thread *t);
f021ee
+
f021ee
 #endif /* __CPU_H */