summaryrefslogtreecommitdiffstats
path: root/src/include/usr/mmio
diff options
context:
space:
mode:
authorRick Ward <rward15@us.ibm.com>2018-10-03 13:22:01 -0500
committerChristian R. Geddes <crgeddes@us.ibm.com>2018-12-13 14:55:16 -0600
commit8923b2a9a3c9c477c646df3a4c66690a75ab8479 (patch)
tree4436a6b7fbbdae005ef5dce8eac97b25c837662a /src/include/usr/mmio
parentf7cb4b2a4cf432f56d91c12e39e4dae41e8facdf (diff)
downloadtalos-hostboot-8923b2a9a3c9c477c646df3a4c66690a75ab8479.tar.gz
talos-hostboot-8923b2a9a3c9c477c646df3a4c66690a75ab8479.zip
Inband MMIO access to OCMB
This is an untested version of the new MMIO device driver that will give access to the OCMB. It will be tested once the Axone model IPLs in Simics. Change-Id: I4bc1d2f7306f1b238d1d65c24462ac4121266b11 RTC: 189447 RTC: 189220 Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/66941 Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com> Reviewed-by: Nicholas E. Bofferding <bofferdn@us.ibm.com> Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Reviewed-by: Matt Derksen <mderkse1@us.ibm.com> Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com> Reviewed-by: Christian R. Geddes <crgeddes@us.ibm.com>
Diffstat (limited to 'src/include/usr/mmio')
-rw-r--r--src/include/usr/mmio/mmio.H39
-rw-r--r--src/include/usr/mmio/mmio_reasoncodes.H57
2 files changed, 63 insertions, 33 deletions
diff --git a/src/include/usr/mmio/mmio.H b/src/include/usr/mmio/mmio.H
index e340e29e4..b0a9c522e 100644
--- a/src/include/usr/mmio/mmio.H
+++ b/src/include/usr/mmio/mmio.H
@@ -22,50 +22,23 @@
/* permissions and limitations under the License. */
/* */
/* IBM_PROLOG_END_TAG */
-#ifndef __MMIO_H
-#define __MMIO_H
+#ifndef __USR_MMIO_MMIO_H
+#define __USR_MMIO_MMIO_H
/** @file mmio.H
- * @brief Provides the interfaces to perform a MMIO operation
+ * @brief Provides the interface to initialize MMIO operations
* */
namespace MMIO
{
/**
* @brief Memory map OCMBs.
- * This function maps OCMB memory and registers into Hostboot virtual memory..
+ * This function maps OCMB memory and registers it into Hostboot virtual memory.
*
+ * @return nullptr on success, valid error log(errlHndl_t) if an error occurred
*/
-void mmioSetup();
+errlHndl_t mmioSetup();
-/**
- * @brief Complete the MMIO operation.
- * This function performs read or write operations on OCMBs by accessing
- * virtual memory that was previously memory mapped to the OCMBs.
- * It follows a pre-defined function prototype in order to be registered
- * with the device driver framework.
- *
- * @param[in] i_opType Operation type, see driverif.H
- * @param[in] i_target MMIO target
- * @param[in/out] io_buffer Read: Pointer to output data storage
- * Write: Pointer to input data storage
- * @param[in/out] io_buflen Input: Read: size of data to read (in bytes)
- * Write: Size of data to write
- * Output: Read: Size of output data
- * Write: Size of data written
- * @param[in] i_accessType Access type
- * @param[in] i_args This is an argument list for DD framework.
- * In this function, there are two arguments,
- * the offset (bytes) into the device, and the number
- * of bytes to read at a time (device limitation).
- * @return errlHndl_t
- */
-errlHndl_t mmioPerformOp(DeviceFW::OperationType i_opType,
- TARGETING::TargetHandle_t i_target,
- void* io_buffer,
- size_t& io_buflen,
- int64_t i_accessType,
- va_list i_args);
}; // End namespace
#endif
diff --git a/src/include/usr/mmio/mmio_reasoncodes.H b/src/include/usr/mmio/mmio_reasoncodes.H
new file mode 100644
index 000000000..7e2481934
--- /dev/null
+++ b/src/include/usr/mmio/mmio_reasoncodes.H
@@ -0,0 +1,57 @@
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/include/usr/mmio/mmio_reasoncodes.H $ */
+/* */
+/* OpenPOWER HostBoot Project */
+/* */
+/* Contributors Listed Below - COPYRIGHT 2011,2018 */
+/* [+] International Business Machines Corp. */
+/* */
+/* */
+/* Licensed under the Apache License, Version 2.0 (the "License"); */
+/* you may not use this file except in compliance with the License. */
+/* You may obtain a copy of the License at */
+/* */
+/* http://www.apache.org/licenses/LICENSE-2.0 */
+/* */
+/* Unless required by applicable law or agreed to in writing, software */
+/* distributed under the License is distributed on an "AS IS" BASIS, */
+/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */
+/* implied. See the License for the specific language governing */
+/* permissions and limitations under the License. */
+/* */
+/* IBM_PROLOG_END_TAG */
+#ifndef __MMIO_REASONCODES_H
+#define __MMIO_REASONCODES_H
+
+#include <hbotcompid.H>
+
+namespace MMIO
+{
+ enum MMIOModuleId
+ {
+ MOD_MMIO_INVALID = 0x00,
+ MOD_MMIO_SETUP = 0x01,
+ MOD_MMIO_PERFORM_OP = 0x02,
+ MOD_MMIO_GET_PROC_SCOM = 0x03,
+ MOD_MMIO_SET_PROC_SCOM = 0x04,
+ };
+
+ enum MMIOReasonCode
+ {
+ RC_INVALID = MMIO_COMP_ID | 0x00,
+ RC_INVALID_SETUP = MMIO_COMP_ID | 0x01,
+ RC_INVALID_BUFFER = MMIO_COMP_ID | 0x02,
+ RC_INSUFFICIENT_BUFFER = MMIO_COMP_ID | 0x03,
+ RC_INCORRECT_BUFFER_LENGTH = MMIO_COMP_ID | 0x04,
+ RC_INVALID_OFFSET = MMIO_COMP_ID | 0x05,
+ RC_INVALID_OFFSET_ALIGNMENT = MMIO_COMP_ID | 0x06,
+ RC_INVALID_ACCESS_LIMIT = MMIO_COMP_ID | 0x07,
+ RC_BAD_MMIO_READ = MMIO_COMP_ID | 0x08,
+ RC_BAD_MMIO_WRITE = MMIO_COMP_ID | 0x09,
+ RC_PROC_NOT_FOUND = MMIO_COMP_ID | 0x0A,
+ };
+};
+
+#endif
OpenPOWER on IntegriCloud