Ignore:
Timestamp:
Apr 26, 2017, 2:08:13 PM (7 years ago)
Author:
alain
Message:

Introduce dev_fbf, dev dma, dev_iob

File:
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/kernel/devices/dev_iob.h

    r1 r3  
    11/*
    2  * dev_iox.h - IOX (bridge to external I/O) generic device API.
     2 * dev_iob.h - IOB (bridge to external I/O) generic device API.
    33 *
    44 * Authors   Alain Greiner  (2016)
     
    1414 * ALMOS-MKH is distributed in the hope that it will be useful, but
    1515 * WITHOUT ANY WARRANTY; without even the implied warranty of
    16  * MERCHANTABILITY or FITNESS FOR A PARTIOXLAR PURPOSE.  See the GNU
     16 * MERCHANTABILITY or FITNESS FOR A PARTIOBLAR PURPOSE.  See the GNU
    1717 * General Public License for more details.
    1818 *
     
    2222 */
    2323
    24 #ifndef _DEV_IOX_H_
    25 #define _DEV_IOX_H_
     24#ifndef _DEV_IOB_H_
     25#define _DEV_IOB_H_
    2626
    2727#include <almos_config.h>
     
    3030
    3131/*****************************************************************************************
    32  *     Generic IOX (bridge to external IO peripherals) definition.
     32 *     Generic IOB (bridge to external IO peripherals) definition.
    3333 *
    34  * The IOX device is used to access external peripherals. It implements an IO-MMU service
     34 * The IOB device is used to access external peripherals. It implements an IO-MMU service
    3535 * for DMA transactions launched by DMA capable external peripherals.
    36  * This IOX peripheral is acting as a dynamically configurable bridge, used for others
    37  * I/O operations. Therefore, ALMOS-MKH does not use the IOX device waiting queue,
    38  * and calls directly the IOX driver blocking functions, using the device lock to
    39  * get exclusive access to the IOX bridge internal state.
     36 * This IOB peripheral is acting as a dynamically configurable bridge, used for others
     37 * I/O operations. Therefore, ALMOS-MKH does not use the IOB device waiting queue,
     38 * and calls directly the IOB driver blocking functions, using the device lock to
     39 * get exclusive access to the IOB bridge internal state.
    4040 ****************************************************************************************/
    4141 
     42/****  Forward declarations  ****/
     43
     44struct chdev_s;
    4245
    4346/*****************************************************************************************
    44  * This enum defines the various implementations of the IOX generic device.
     47 * This enum defines the various implementations of the IOB generic device.
    4548 * This array must be kept consistent with the define in arch_info.h file
    4649 ****************************************************************************************/
    4750
    48 enum iox_impl_e
     51enum iob_impl_e
    4952{
    50     IMPL_IOX_IOB =   0,         /* vci_iob component used in TSAR                       */
    51     IMPL_IOX_I86 =   1,         /* TBD                                                  */
     53    IMPL_IOB_TSR =   0,         /* vci_iob component used in TSAR                       */
     54    IMPL_IOB_I86 =   1,         /* TBD                                                  */
    5255}
    53 iox_impl_t;
     56iob_impl_t;
    5457
    5558/*****************************************************************************************
    56  * This function initializes the IOX device descriptor with IOMMU disabled.
     59 * This function initializes the IOB device descriptor with IOMMU disabled.
    5760 *****************************************************************************************
    58  * @ dev_xp     : extended pointer on IOX device descriptor.
     61 * @ chdev      :  pointer on IOB chdev descriptor.
    5962 ****************************************************************************************/
    60 void dev_iox_init( xptr_t dev_xp );
     63void dev_iob_init( struct chdev_s * chdev );
    6164
    6265/*****************************************************************************************
    63  * This function activates the IOMMU for the IOX device identified by its
     66 * This function activates the IOMMU for the IOB device identified by its
    6467 * extended pointer.
    6568 *****************************************************************************************
    66  * @ dev_xp   : extended pointer on IOX device descriptor.
     69 * @ dev_xp   : extended pointer on IOB device descriptor.
    6770 ****************************************************************************************/
    68 void dev_iox_iommu_enable( xptr_t dev_xp );
     71void dev_iob_iommu_enable( xptr_t dev_xp );
    6972
    7073/*****************************************************************************************
    71  * This function desactivates the IO-MMU for the IOX device identified by its
     74 * This function desactivates the IO-MMU for the IOB device identified by its
    7275 * extended pointer.
    7376 *****************************************************************************************
    74  * @ dev_xp   : extended pointer on IOX device descriptor.
     77 * @ dev_xp   : extended pointer on IOB device descriptor.
    7578 ****************************************************************************************/
    76 void dev_iox_iommu_disable( xptr_t dev_xp );
     79void dev_iob_iommu_disable( xptr_t dev_xp );
    7780
    7881/*****************************************************************************************
    7982 * This function set a new value in the IO-MMU PTPR register.
    8083 *****************************************************************************************
    81  * @ dev_xp   : extended pointer on IOX device descriptor.
     84 * @ dev_xp   : extended pointer on IOB device descriptor.
    8285 * @ wdata    : value to be written in PTPR register.
    8386 ****************************************************************************************/
    84 void dev_iox_set_ptpr( xptr_t    dev_xp,
     87void dev_iob_set_ptpr( xptr_t    dev_xp,
    8588                       uint32_t  wdata );
    8689                       
     
    8891 * This function invalidates an IOMMU TLB entry identified by its vpn.
    8992 *****************************************************************************************
    90  * @ dev_xp   : extended pointer on IOX device descriptor.
     93 * @ dev_xp   : extended pointer on IOB device descriptor.
    9194 * @ vpn      : virtual page number in IO virtual space.
    9295 ****************************************************************************************/
    93 void dev_iox_inval_page( xptr_t  dev_xp,
     96void dev_iob_inval_page( xptr_t  dev_xp,
    9497                         vpn_t   vpn );
    9598
     
    97100 * This function return informations relative to an error reported by the IOMMU.
    98101 *****************************************************************************************
    99  * @ dev_xp   : extended pointer on IOX device descriptor.
     102 * @ dev_xp   : extended pointer on IOB device descriptor.
    100103 * @ error    : [out] pointer on buffer for erro type.
    101104 * @ bvar     : [out] pointer on buffer for bad virtual address.
    102105 * @ srcid    : [out] pointer on buffer for faulty peripheral index.
    103106 ****************************************************************************************/
    104 void dev_iox_get_status( xptr_t     dev_xp,
     107void dev_iob_get_status( xptr_t     dev_xp,
    105108                         uint32_t * error,
    106109                         uint32_t * bvar,
    107110                         uint32_t * srcid );
    108111
    109 #endif  /* _DEV_IOX_H_ */
     112#endif  /* _DEV_IOB_H_ */
Note: See TracChangeset for help on using the changeset viewer.