summaryrefslogtreecommitdiffstats
path: root/import/chips/p9/common
diff options
context:
space:
mode:
authorRahul Batra <rbatra@us.ibm.com>2017-08-25 14:38:58 -0500
committerJoshua Hunsberger <jahunsbe@us.ibm.com>2017-10-23 19:11:38 -0500
commit64cbd70d6ad902725648d5b7fa2de9e5a5d805dc (patch)
treed4f62ac94e033200f440f15a49d2813c8be1e9fe /import/chips/p9/common
parent46ac80391d6fd81a7219c5fd9d6b79ff07ffd2bb (diff)
downloadtalos-hcode-64cbd70d6ad902725648d5b7fa2de9e5a5d805dc.tar.gz
talos-hcode-64cbd70d6ad902725648d5b7fa2de9e5a5d805dc.zip
PSTATE: Common IPC Code Updates
- Added IPC IRQ Handler Hook Done - Added dcbi/dcbf for PK when read/writing counts Change-Id: Ie63a1f60a6c133256a9827aed4f0b74abe6e13ab Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/45176 Tested-by: PPE CI <ppe-ci+hostboot@us.ibm.com> Tested-by: Hostboot CI <hostboot-ci+hostboot@us.ibm.com> Reviewed-by: Douglas R. Gilbert <dgilbert@us.ibm.com> Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Reviewed-by: Juan R. Medina <jrmedina@us.ibm.com> Reviewed-by: Jennifer A. Stofer <stofer@us.ibm.com>
Diffstat (limited to 'import/chips/p9/common')
-rw-r--r--import/chips/p9/common/pmlib/occlib/ipc_api.h16
-rw-r--r--import/chips/p9/common/pmlib/occlib/ipc_core.c37
2 files changed, 52 insertions, 1 deletions
diff --git a/import/chips/p9/common/pmlib/occlib/ipc_api.h b/import/chips/p9/common/pmlib/occlib/ipc_api.h
index 436f023f..4ee0f897 100644
--- a/import/chips/p9/common/pmlib/occlib/ipc_api.h
+++ b/import/chips/p9/common/pmlib/occlib/ipc_api.h
@@ -350,6 +350,22 @@ int ipc_enable(void);
///
int ipc_disable(uint32_t target_id);
+///////////////////////////////////////////////////////////////////////////////
+/// Set the ipc irq handler done hook
+///
+/// \param func Function pointer to the done hook function
+///
+/// This interface should be used by a processor that wants to
+/// hook into the IPC IRQ handler after all the messages in the buffer
+/// have processed.
+///
+/// Possible return codes for this function are:
+///
+/// \retval IPC_RC_SUCCESS Function pointer was successfully set.
+///
+/// \retval IPC_RC_INVALID_FUNC_PTR Function pointer is NULL.
+///
+void ipc_set_done_hook(void* func);
///////////////////////////////////////////////////////////////////////////////
/// Associates an IPC function ID with a handler function
diff --git a/import/chips/p9/common/pmlib/occlib/ipc_core.c b/import/chips/p9/common/pmlib/occlib/ipc_core.c
index 4d5ecbe5..89cd6a5f 100644
--- a/import/chips/p9/common/pmlib/occlib/ipc_core.c
+++ b/import/chips/p9/common/pmlib/occlib/ipc_core.c
@@ -29,11 +29,27 @@
#include "kernel.h"
#include "ipc_api.h"
#include "occhw_shared_data.h"
+#if __PK__
+ #include "ppe42_cache.h"
+#endif
/// If G_ipc_enabled is zero then calls to ipc_send_cmd() will return
/// IPC_RC_SELF_BLOCKED.
uint8_t G_ipc_enabled = 0;
+///////////////////////////////////////////////////////////////////////////////
+///Default IPC Handler Done Hook
+///
+void ipc_irq_handler_default_done_hook() { }
+
+///
+///Function pointer that holds address to done hook
+///function. It is called inside the IPC IRQ handler when
+///all IPC msgs have been processed
+void (*G_ipc_irq_handler_done_hook)() = &ipc_irq_handler_default_done_hook;
+//Set the done hook function to empty default function
+//G_ipc_irq_handler_done_hook = ;
+
#ifndef STATIC_IPC_TABLES
ipc_func_table_entry_t G_ipc_mt_handlers[IPC_MT_MAX_FUNCTIONS];
ipc_func_table_entry_t G_ipc_st_handlers[IPC_ST_MAX_FUNCTIONS];
@@ -70,6 +86,9 @@ int ipc_send_msg(ipc_msg_t* msg, uint32_t target_id)
KERN_CRITICAL_SECTION_ENTER(KERN_CRITICAL, &ctx);
//Determine the number of entries in the buffer
+#if __PK__
+ dcbi(read_count);
+#endif
num_entries = *write_count - *read_count;
//If the cbuf isn't full, then add the message and raise an interrupt
@@ -83,6 +102,12 @@ int ipc_send_msg(ipc_msg_t* msg, uint32_t target_id)
#ifdef GPE_IPC_TIMERS
msg->begin_time = in32(OCB_OTBR);
#endif
+
+#if __PK__
+ dcbf(write_count);
+ sync();
+#endif
+
//raise the IPC interrupt on the target
KERN_IRQ_STATUS_SET(IPC_GET_IRQ(target_id), 1);
}
@@ -346,6 +371,7 @@ void ipc_process_cbuf(uint32_t sender_id)
// If all buffers are empty then we're done
if(sender_id > OCCHW_INST_ID_MAX)
{
+ G_ipc_irq_handler_done_hook();
break;
}
@@ -399,6 +425,8 @@ int ipc_init(void)
}
#endif
+
+
return IPC_RC_SUCCESS;
}
@@ -439,7 +467,6 @@ int ipc_enable(void)
//Allow us to send out new commands
G_ipc_enabled = 1;
-
}
while(0);
@@ -501,3 +528,11 @@ int ipc_disable(uint32_t target_id)
return rc;
}
+
+///////////////////////////////////////////////////////////////////////////////
+/// Sets the IPC IRQ Done Hook function
+///
+void ipc_set_done_hook(void* f)
+{
+ G_ipc_irq_handler_done_hook = f;
+}
OpenPOWER on IntegriCloud