summaryrefslogtreecommitdiffstats
path: root/src/usr/mmio/mmio.H
blob: 96ea25e8d8b3088857aee5ebae604994f8392b6c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
/* IBM_PROLOG_BEGIN_TAG                                                   */
/* This is an automatically generated prolog.                             */
/*                                                                        */
/* $Source: src/usr/mmio/mmio.H $                                         */
/*                                                                        */
/* OpenPOWER HostBoot Project                                             */
/*                                                                        */
/* Contributors Listed Below - COPYRIGHT 2018,2019                        */
/* [+] 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

#include <errl/errlentry.H>
#include <devicefw/driverif.H>
#include <targeting/common/target.H>

/** @file  mmio.H
 *  @brief Provides interface to perform MMIO operations to Explorer chips
 *  */

namespace MMIO
{
/**
 * @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 ocmbMmioPerformOp(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
OpenPOWER on IntegriCloud