diff options
| author | Brian Bakke <bbakke@us.ibm.com> | 2018-05-22 11:30:26 -0500 |
|---|---|---|
| committer | Daniel M. Crowell <dcrowell@us.ibm.com> | 2018-06-07 13:37:46 -0400 |
| commit | e364f91be1727019dd594c57d496e5ce43e8f5f0 (patch) | |
| tree | 3515d4777d5ca4705fc232b02110d6c480151eff /src/include | |
| parent | 0c6d58230e615000dee1a1940bf4bc84ad5c1798 (diff) | |
| download | blackbird-hostboot-e364f91be1727019dd594c57d496e5ce43e8f5f0.tar.gz blackbird-hostboot-e364f91be1727019dd594c57d496e5ce43e8f5f0.zip | |
Fixes to node IPC messaging to handle non-zero base addresses
Current code has each Node calculate each Remote Node's IPC area
remote address by performing a fixed format calculation.
This change has each Node calculating its IPC area Remote address
and posting this value to a local SCOM register. A Node reads
a Remote Node's SCOM register to acquire the Remote IPC area
address.
Change-Id: I25260ce180e0d07e5e81990d4c1f99e249912491
RTC:191463
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/59177
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Reviewed-by: William G. Hoffa <wghoffa@us.ibm.com>
Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com>
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Reviewed-by: Prachi Gupta <pragupta@us.ibm.com>
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/include')
| -rw-r--r-- | src/include/kernel/ipc.H | 39 | ||||
| -rw-r--r-- | src/include/kernel/syscalls.H | 8 | ||||
| -rw-r--r-- | src/include/sys/internode.h | 2 | ||||
| -rw-r--r-- | src/include/sys/mmio.h | 8 | ||||
| -rw-r--r-- | src/include/sys/msg.h | 29 | ||||
| -rw-r--r-- | src/include/usr/xscom/xscomif.H | 11 |
6 files changed, 91 insertions, 6 deletions
diff --git a/src/include/kernel/ipc.H b/src/include/kernel/ipc.H index eeeea2d4b..a29d982a1 100644 --- a/src/include/kernel/ipc.H +++ b/src/include/kernel/ipc.H @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2013,2015 */ +/* Contributors Listed Below - COPYRIGHT 2013,2018 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -26,6 +26,7 @@ #define __IPC_H #include <sys/msg.h> +#include <sys/internode.h> #define IPC_DATA_AREA_LOCKED 0xFFFFFFFFFFFFFFFFul #define IPC_DATA_AREA_READ 0xFFFFFFFFFFFFFFFEul @@ -33,12 +34,48 @@ namespace KernelIpc { + + /** @fn send() + * @brief Send an IPC message to a remote node + * + * @param[in] i_q - message queue + * @param[in] i_msg - message + * + * @note + */ + int send(uint64_t i_q, msg_t * i_msg); + + /** @fn updateRemoteIpcAddr() + * @brief update the Remote Address used to send IPC + * messages to the specified node + * + * @param[in] i_node - node + * @param[in] i_remoteAddr - IPC address of Remote Node's ipc_data_area + * + * @note + */ + int updateRemoteIpcAddr(uint64_t i_node, uint64_t i_remoteAddr); + + /** @fn qryLocalIpcInfo() + * @brief query the node and remote address other nodes will use to + * send messages to this IPC instance. + * + * @param[in] i_pONode - buffer the node will be returned in + * @param[in] i_pOAddr - buffer the address will be returned in + * + * @note + */ + int qryLocalIpcInfo(uint64_t * i_pONode, uint64_t * i_pOAddr); + + struct ipc_data_area_t { uint64_t msg_queue_id; msg_t msg_payload; uint64_t hrmor_base; uint32_t pir; + struct ipc_data_area_t * + remote_ipc_data_addr[internode_info_vals_t::MAX_NODES_PER_SYS]; }; /** diff --git a/src/include/kernel/syscalls.H b/src/include/kernel/syscalls.H index c7a03d6b6..c606ad771 100644 --- a/src/include/kernel/syscalls.H +++ b/src/include/kernel/syscalls.H @@ -126,7 +126,13 @@ namespace Systemcalls /** set_mchk_data() */ MISC_SETMCHKDATA, - SYSCALL_MAX + /** updateRemoteIpcAddr() */ + UPDATE_REMOTE_IPC_ADDR, + + /** qryLocalIpcInfo() */ + QRY_LOCAL_IPC_INFO, + + SYSCALL_MAX }; /** @enum SysCalls_FastPath diff --git a/src/include/sys/internode.h b/src/include/sys/internode.h index 5581c1e6d..8db0252f6 100644 --- a/src/include/sys/internode.h +++ b/src/include/sys/internode.h @@ -26,7 +26,7 @@ #define __INTERNODE_H // Memory area preserved on MPIPL -#include <vmmconst.h> +#include <usr/vmmconst.h> enum internode_info_vals_t { diff --git a/src/include/sys/mmio.h b/src/include/sys/mmio.h index 71340973a..75d923e41 100644 --- a/src/include/sys/mmio.h +++ b/src/include/sys/mmio.h @@ -93,8 +93,12 @@ enum MMIO_Scratch_Register /** Identifies where hostboot currently resides and how large the * space is */ MMIO_SCRATCH_MEMORY_STATE = 0x08, - /** Spare scratch reg */ - MMIO_SCRATCH_SPARE = 0x10, + /** The address of the Local Node's ipc_data_area buffer in + * the Remote Node's radix. + * The Local Node and the Remote Node use different absolute + * 64 bit values to access the same ipc_data_area buffer. + * This register contains the value the Remote Node needs to use. */ + MMIO_SCRATCH_IPC_DATA_ADDR = 0x10, /** Identifies if Hostboot is active after host_start_payload. */ MMIO_SCRATCH_HOSTBOOT_ACTIVE = 0x18, }; diff --git a/src/include/sys/msg.h b/src/include/sys/msg.h index 2b7f2a8f4..94fda6891 100644 --- a/src/include/sys/msg.h +++ b/src/include/sys/msg.h @@ -284,6 +284,35 @@ int msg_respond(msg_q_t q, msg_t* msg); msg_t* msg_wait(msg_q_t q); +/** @fn updateRemoteIpcAddr + * @brief Update a Remote Node's IPC buffer address + * + * @param[in] i_node - node + * @param[in] i_remoteAddr - Remote Node's IPC buffer address + * + * @return Result of update. + * @retval 0 - Success + * @retval EINVAL - Invalid Node. + */ + // low nibble is remote node number +#define IPC_INVALID_REMOTE_ADDR_MASK 0xFFFFFFFFFFFFFFF0ull +#define IPC_INVALID_REMOTE_ADDR 0x00000000deadadd0ull + +int updateRemoteIpcAddr(uint64_t i_node, uint64_t i_remoteAddr); + + +/** @fn qryLocalIpcInfo + * @brief Query the local Node's node number and IPC bfr address + * + * @param[out] o_node - returned Node + * @param[out] o_addr - returned Local Node's IPC bfr address + * + * @return Result of query. + * @retval 0 - Success + */ +int qryLocalIpcInfo( uint64_t & o_node, uint64_t & o_addr); + + /** @fn msg_is_async * @brief Indicates if message is asynchronous. * diff --git a/src/include/usr/xscom/xscomif.H b/src/include/usr/xscom/xscomif.H index 65b7410f1..e547c4621 100644 --- a/src/include/usr/xscom/xscomif.H +++ b/src/include/usr/xscom/xscomif.H @@ -35,7 +35,7 @@ namespace XSCOM uint64_t get_master_bar( void ); /** - * @brief Generate a fully-qualified MMIO address for a physical scom + * @brief Generate a fully-qualified MMIO address for a physical scom * address, relative to the given processor target * @param[in] i_proc - Processor * @param[in] i_scomAddr - Physical scom address to convert @@ -44,6 +44,15 @@ uint64_t get_master_bar( void ); uint64_t generate_mmio_addr( TARGETING::Target* i_proc, uint64_t i_scomAddr ); +/** + * @brief Multicast Read of core XSCOM register on remote Node + * @param[in] i_node - logical Node Number + * @param[in] i_scomAddr - Physical scom address to read + * @return uint64_t - Register value + */ +uint64_t readRemoteCoreScomMultiCast( uint64_t i_node, + uint64_t i_scomAddr ); + }; // namespace XSCOM #endif // end __XSCOMIF_H |

