diff options
author | Rick Ward <rward15@us.ibm.com> | 2018-11-06 16:51:42 -0600 |
---|---|---|
committer | Daniel M. Crowell <dcrowell@us.ibm.com> | 2018-11-09 13:27:04 -0600 |
commit | 8351efdb3b65ed4fc5472e78efd5db315663e42f (patch) | |
tree | c12686656b0e9c54d017232b8681b3ee5e9ecac5 /src/include | |
parent | 7d4f360d16e2c8f734d361486e7334f2d31f9a20 (diff) | |
download | talos-hostboot-8351efdb3b65ed4fc5472e78efd5db315663e42f.tar.gz talos-hostboot-8351efdb3b65ed4fc5472e78efd5db315663e42f.zip |
Inband MMIO access to OCMB (skeleton)
This is a skeleton version of the new MMIO device driver that
will give access to the OCMB. It is being pushed to allow related
development to progress.
Change-Id: Iefec0677e63db6af29d81389c630584ba9dff16c
RTC: 189447
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/68489
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Reviewed-by: Matt Derksen <mderkse1@us.ibm.com>
Reviewed-by: Christian R. Geddes <crgeddes@us.ibm.com>
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com>
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/usr/devicefw/userif.H | 12 | ||||
-rw-r--r-- | src/include/usr/mmio/mmio.H | 71 |
2 files changed, 83 insertions, 0 deletions
diff --git a/src/include/usr/devicefw/userif.H b/src/include/usr/devicefw/userif.H index 25d355ccf..a6c7f26b0 100644 --- a/src/include/usr/devicefw/userif.H +++ b/src/include/usr/devicefw/userif.H @@ -71,6 +71,7 @@ namespace DeviceFW NODECOMM, NVDIMM, FAPI_I2C, + MMIO, LAST_ACCESS_TYPE, }; @@ -394,6 +395,17 @@ namespace DeviceFW DEVICE_FAPI_I2C_ADDRESS_WCONFIG( 0, NULL ) /** + * @brief Additional device addressing parameters for MMIO ops. + * @param[in] i_offset - offset (bytes) into the device + * @param[in] i_accessLimit - number of bytes to read/write at a + * time (device limitation) + */ + #define DEVICE_MMIO_ADDRESS(i_offset, i_accessLimit) \ + DeviceFW::MMIO, \ + static_cast<uint64_t>((i_offset)), \ + static_cast<uint64_t>((i_accessLimit)) + + /** * @brief Perform a hardware read operation. * * @param[in] i_target Device target to operate on. diff --git a/src/include/usr/mmio/mmio.H b/src/include/usr/mmio/mmio.H new file mode 100644 index 000000000..e340e29e4 --- /dev/null +++ b/src/include/usr/mmio/mmio.H @@ -0,0 +1,71 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/include/usr/mmio/mmio.H $ */ +/* */ +/* OpenPOWER HostBoot Project */ +/* */ +/* Contributors Listed Below - COPYRIGHT 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_H +#define __MMIO_H + +/** @file mmio.H + * @brief Provides the interfaces to perform a MMIO operation + * */ + +namespace MMIO +{ +/** + * @brief Memory map OCMBs. + * This function maps OCMB memory and registers into Hostboot virtual memory.. + * + */ +void 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 |