diff options
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/sys/mmio.h | 15 | ||||
-rw-r--r-- | src/include/usr/hbotcompid.H | 7 | ||||
-rw-r--r-- | src/include/usr/isteps/istep12list.H | 1 | ||||
-rw-r--r-- | src/include/usr/mmio/mmio.H | 39 | ||||
-rw-r--r-- | src/include/usr/mmio/mmio_reasoncodes.H | 57 |
5 files changed, 85 insertions, 34 deletions
diff --git a/src/include/sys/mmio.h b/src/include/sys/mmio.h index 75d923e41..e1dfdbf4d 100644 --- a/src/include/sys/mmio.h +++ b/src/include/sys/mmio.h @@ -152,11 +152,24 @@ static const uint64_t MMIO_IBSCOM_UE_DETECTED = 0x53434F4D4641494C; /** Constants used to define IBSCOM MMIO address ranges */ -static const uint64_t MMIO_IBSCOM_BASE_MASK = 0x6030220000000; +static const uint64_t MMIO_IBSCOM_BASE_MASK = 0x0006030220000000; static const uint64_t MMIO_IBSCOM_DMI_MASK = 0x000000001FFFFFFF; static const uint64_t MMIO_IBSCOM_CHIP_MASK = 0x00001C0000000000; static const uint64_t MMIO_IBSCOM_GROUP_MASK = 0x0001700000000000; +/** Constant used by kernel to signal to OCMB MMIO device driver + * that a UE was triggered during the OCMB MMIO Read operation + * Value is "OCMBFAIL" in ASCII. + */ +static const uint64_t MMIO_OCMB_UE_DETECTED = 0x4F434D424641494C; + +/** Constants used to define OCMB MMIO address ranges + * OCMB physical memory starts at 3TB + 16GB + * 64 OCMBs * 4GB per OCMB = 256GB +*/ +static const uint64_t MMIO_OCMB_BASE_MASK = 0x0006030400000000; // 3TB + 16GB +static const uint64_t MMIO_OCMB_BASE_RANGE = 0x00000070FFFFFFFF; // 256GB + #ifdef __cplusplus } #endif diff --git a/src/include/usr/hbotcompid.H b/src/include/usr/hbotcompid.H index 40739f2ba..c9987ac6d 100644 --- a/src/include/usr/hbotcompid.H +++ b/src/include/usr/hbotcompid.H @@ -453,6 +453,13 @@ const compId_t EXPSCOM_COMP_ID = 0x3600; const char EXPSCOM_COMP_NAME[] = "expscom"; //@} +/** @name MMIO + * Hostboot MMIO Interface + */ +//@{ +const compId_t MMIO_COMP_ID = 0x3700; +const char MMIO_COMP_NAME[] = "mmio"; + /** @name NVRAM * NVRAM Support component */ diff --git a/src/include/usr/isteps/istep12list.H b/src/include/usr/isteps/istep12list.H index 36927fb43..161c17732 100644 --- a/src/include/usr/isteps/istep12list.H +++ b/src/include/usr/isteps/istep12list.H @@ -290,6 +290,7 @@ const DepModInfo g_istep12Dependancies = { DEP_LIB(libnestmemutils.so), DEP_LIB(libisteps_io.so), DEP_LIB(libisteps_mss.so), + DEP_LIB(libmmio.so), NULL } }; 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 |