- Timestamp:
- Jul 20, 2017, 3:22:07 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/hal/x86_64/drivers/soclib_iob.h
r75 r264 28 28 #include <chdev.h> 29 29 30 /******************************************************************************************31 * SOCLIB_IOB Registers Mnemonics32 *****************************************************************************************/33 34 enum IOB_registers35 {36 IOB_IOMMU_PTPR = 0, // R/W : Page Table Pointer Register37 IOB_IOMMU_ACTIVE = 1, // R/W : IOMMU activated if not 038 IOB_IOMMU_BVAR = 2, // R : Bad Virtual Address (unmapped)39 IOB_IOMMU_ERROR = 3, // R : Error Type40 IOB_IOMMU_SRCID = 4, // R : Faulty Peripheral Index (SRCID)41 IOB_INVAL_PTE = 5, // W : Invalidate a PTE (virtual address)42 IOB_WTI_ENABLE = 6, // R/W : Enable WTIs (both IOMMU and peripherals)43 IOB_WTI_ADDR_LO = 7, // W/R : 32 LSB bits for IOMMU WTI44 IOB_WTI_ADDR_HI = 8, // W/R : 32 MSB bits for IOMMU WTI45 };46 47 enum mmu_error_type_e48 {49 MMU_NONE = 0x0000, // None50 MMU_WRITE_ACCES_VIOLATION = 0x0008, // Write access to a non writable page51 MMU_WRITE_PT1_ILLEGAL_ACCESS = 0x0040, // Write Bus Error accessing Table 152 MMU_READ_PT1_UNMAPPED = 0x1001, // Read Page fault on Page Table 153 MMU_READ_PT2_UNMAPPED = 0x1002, // Read Page fault on Page Table 254 MMU_READ_PT1_ILLEGAL_ACCESS = 0x1040, // Read Bus Error in Table1 access55 MMU_READ_PT2_ILLEGAL_ACCESS = 0x1080, // Read Bus Error in Table2 access56 MMU_READ_DATA_ILLEGAL_ACCESS = 0x1100, // Read Bus Error in cache access57 };58 59 60 /******************************************************************************************61 * This function initializes the SOCLIB IOB component:62 ******************************************************************************************63 * @ chdev : local pointer on IOB chdev descriptor.64 *****************************************************************************************/65 30 void soclib_iob_init( chdev_t * chdev ); 66 31 67 /******************************************************************************************68 * This function set a new value in the IOB_IOMMU_ACTIVE register.69 ******************************************************************************************70 * @ iob_xp : extended pointer on the remote XCU device descriptor.71 * @ value : value to be written in register.72 *****************************************************************************************/73 32 void soclib_iob_set_active( xptr_t iox_xp, 74 33 uint32_t value ); 75 34 76 /******************************************************************************************77 * This function set a new value in the IOB_IOMMU_PTPR register.78 ******************************************************************************************79 * @ iob_xp : extended pointer on the remote XCU device descriptor.80 * @ value : value to be written in register IOMMU.81 *****************************************************************************************/82 35 void soclib_iob_set_ptpr( xptr_t iob_xp, 83 36 uint32_t value ); 84 37 85 /******************************************************************************************86 * This function invaldates a TLB entry identified by its vpn.87 ******************************************************************************************88 * @ iox_xp : extended pointer on the remote XCU device descriptor.89 * @ vpn : virtual page number.90 *****************************************************************************************/91 38 void soclib_iob_inval_page( xptr_t iox_xp, 92 39 vpn_t vpn ); 93 40 94 /******************************************************************************************95 * This function returns the content of IOB_IOMMU_BVAR register.96 ******************************************************************************************97 * @ iox_xp : extended pointer on the remote XCU device descriptor.98 * @ return registered bad virtual address (after error reported by IOMMU).99 *****************************************************************************************/100 41 uint32_t soclib_iob_get_bvar( xptr_t iox_xp ); 101 42 102 /******************************************************************************************103 * This function returns the content of IOB_IOMMU_SRCID register.104 ******************************************************************************************105 * @ iox_xp : extended pointer on the remote XCU device descriptor.106 * @ return registered faulty peripheral index (after error reported by IOMMU).107 *****************************************************************************************/108 43 uint32_t soclib_iob_get_srcid( xptr_t iox_xp ); 109 44 110 /******************************************************************************************111 * This function returns the content of IOB_IOMMU_ERROR register.112 ******************************************************************************************113 * @ iox_xp : extended pointer on the remote XCU device descriptor.114 * @ return registered error type (after error reported by IOMMU).115 *****************************************************************************************/116 45 uint32_t soclib_iob_get_error( xptr_t iox_xp ); 117 118 119 46 120 47 #endif 121 48 122 // Local Variables:123 // tab-width: 4124 // c-basic-offset: 4125 // c-file-offsets:((innamespace . 0)(inline-open . 0))126 // indent-tabs-mode: nil127 // End:128 // vim: filetype=c:expandtab:shiftwidth=4:tabstop=4:softtabstop=4129
Note: See TracChangeset
for help on using the changeset viewer.