Changeset 3 for trunk/kernel/devices/dev_iob.h
- Timestamp:
- Apr 26, 2017, 2:08:13 PM (8 years ago)
- File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/devices/dev_iob.h
r1 r3 1 1 /* 2 * dev_io x.h - IOX(bridge to external I/O) generic device API.2 * dev_iob.h - IOB (bridge to external I/O) generic device API. 3 3 * 4 4 * Authors Alain Greiner (2016) … … 14 14 * ALMOS-MKH is distributed in the hope that it will be useful, but 15 15 * WITHOUT ANY WARRANTY; without even the implied warranty of 16 * MERCHANTABILITY or FITNESS FOR A PARTIO XLAR PURPOSE. See the GNU16 * MERCHANTABILITY or FITNESS FOR A PARTIOBLAR PURPOSE. See the GNU 17 17 * General Public License for more details. 18 18 * … … 22 22 */ 23 23 24 #ifndef _DEV_IO X_H_25 #define _DEV_IO X_H_24 #ifndef _DEV_IOB_H_ 25 #define _DEV_IOB_H_ 26 26 27 27 #include <almos_config.h> … … 30 30 31 31 /***************************************************************************************** 32 * Generic IO X(bridge to external IO peripherals) definition.32 * Generic IOB (bridge to external IO peripherals) definition. 33 33 * 34 * The IO Xdevice is used to access external peripherals. It implements an IO-MMU service34 * The IOB device is used to access external peripherals. It implements an IO-MMU service 35 35 * for DMA transactions launched by DMA capable external peripherals. 36 * This IO Xperipheral is acting as a dynamically configurable bridge, used for others37 * I/O operations. Therefore, ALMOS-MKH does not use the IO Xdevice waiting queue,38 * and calls directly the IO Xdriver blocking functions, using the device lock to39 * get exclusive access to the IO Xbridge 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. 40 40 ****************************************************************************************/ 41 41 42 /**** Forward declarations ****/ 43 44 struct chdev_s; 42 45 43 46 /***************************************************************************************** 44 * This enum defines the various implementations of the IO Xgeneric device.47 * This enum defines the various implementations of the IOB generic device. 45 48 * This array must be kept consistent with the define in arch_info.h file 46 49 ****************************************************************************************/ 47 50 48 enum io x_impl_e51 enum iob_impl_e 49 52 { 50 IMPL_IO X_IOB= 0, /* vci_iob component used in TSAR */51 IMPL_IO X_I86 = 1, /* TBD */53 IMPL_IOB_TSR = 0, /* vci_iob component used in TSAR */ 54 IMPL_IOB_I86 = 1, /* TBD */ 52 55 } 53 io x_impl_t;56 iob_impl_t; 54 57 55 58 /***************************************************************************************** 56 * This function initializes the IO Xdevice descriptor with IOMMU disabled.59 * This function initializes the IOB device descriptor with IOMMU disabled. 57 60 ***************************************************************************************** 58 * @ dev_xp : extended pointer on IOX devicedescriptor.61 * @ chdev : pointer on IOB chdev descriptor. 59 62 ****************************************************************************************/ 60 void dev_io x_init( xptr_t dev_xp);63 void dev_iob_init( struct chdev_s * chdev ); 61 64 62 65 /***************************************************************************************** 63 * This function activates the IOMMU for the IO Xdevice identified by its66 * This function activates the IOMMU for the IOB device identified by its 64 67 * extended pointer. 65 68 ***************************************************************************************** 66 * @ dev_xp : extended pointer on IO Xdevice descriptor.69 * @ dev_xp : extended pointer on IOB device descriptor. 67 70 ****************************************************************************************/ 68 void dev_io x_iommu_enable( xptr_t dev_xp );71 void dev_iob_iommu_enable( xptr_t dev_xp ); 69 72 70 73 /***************************************************************************************** 71 * This function desactivates the IO-MMU for the IO Xdevice identified by its74 * This function desactivates the IO-MMU for the IOB device identified by its 72 75 * extended pointer. 73 76 ***************************************************************************************** 74 * @ dev_xp : extended pointer on IO Xdevice descriptor.77 * @ dev_xp : extended pointer on IOB device descriptor. 75 78 ****************************************************************************************/ 76 void dev_io x_iommu_disable( xptr_t dev_xp );79 void dev_iob_iommu_disable( xptr_t dev_xp ); 77 80 78 81 /***************************************************************************************** 79 82 * This function set a new value in the IO-MMU PTPR register. 80 83 ***************************************************************************************** 81 * @ dev_xp : extended pointer on IO Xdevice descriptor.84 * @ dev_xp : extended pointer on IOB device descriptor. 82 85 * @ wdata : value to be written in PTPR register. 83 86 ****************************************************************************************/ 84 void dev_io x_set_ptpr( xptr_t dev_xp,87 void dev_iob_set_ptpr( xptr_t dev_xp, 85 88 uint32_t wdata ); 86 89 … … 88 91 * This function invalidates an IOMMU TLB entry identified by its vpn. 89 92 ***************************************************************************************** 90 * @ dev_xp : extended pointer on IO Xdevice descriptor.93 * @ dev_xp : extended pointer on IOB device descriptor. 91 94 * @ vpn : virtual page number in IO virtual space. 92 95 ****************************************************************************************/ 93 void dev_io x_inval_page( xptr_t dev_xp,96 void dev_iob_inval_page( xptr_t dev_xp, 94 97 vpn_t vpn ); 95 98 … … 97 100 * This function return informations relative to an error reported by the IOMMU. 98 101 ***************************************************************************************** 99 * @ dev_xp : extended pointer on IO Xdevice descriptor.102 * @ dev_xp : extended pointer on IOB device descriptor. 100 103 * @ error : [out] pointer on buffer for erro type. 101 104 * @ bvar : [out] pointer on buffer for bad virtual address. 102 105 * @ srcid : [out] pointer on buffer for faulty peripheral index. 103 106 ****************************************************************************************/ 104 void dev_io x_get_status( xptr_t dev_xp,107 void dev_iob_get_status( xptr_t dev_xp, 105 108 uint32_t * error, 106 109 uint32_t * bvar, 107 110 uint32_t * srcid ); 108 111 109 #endif /* _DEV_IO X_H_ */112 #endif /* _DEV_IOB_H_ */
Note: See TracChangeset
for help on using the changeset viewer.