| 1 | /////////////////////////////////////////////////////////////////////////////////// |
|---|
| 2 | // File : iob_driver.h |
|---|
| 3 | // Date : 01/11/2013 |
|---|
| 4 | // Author : alain greiner |
|---|
| 5 | // Copyright (c) UPMC-LIP6 |
|---|
| 6 | /////////////////////////////////////////////////////////////////////////////////// |
|---|
| 7 | |
|---|
| 8 | #ifndef _GIET_IOB_DRIVER_H_ |
|---|
| 9 | #define _GIET_IOB_DRIVER_H_ |
|---|
| 10 | |
|---|
| 11 | /////////////////////////////////////////////////////////////////////////////////// |
|---|
| 12 | // vci_io_bridge : registers offsets and iommu error codes |
|---|
| 13 | /////////////////////////////////////////////////////////////////////////////////// |
|---|
| 14 | |
|---|
| 15 | enum IOB_registers |
|---|
| 16 | { |
|---|
| 17 | IOB_IOMMU_PTPR = 0, // R/W : Page Table Pointer Register |
|---|
| 18 | IOB_IOMMU_ACTIVE = 1, // R/W : IOMMU activated if not 0 |
|---|
| 19 | IOB_IOMMU_BVAR = 2, // R : Bad Virtual Address (unmapped) |
|---|
| 20 | IOB_IOMMU_ETR = 3, // R : Error Type |
|---|
| 21 | IOB_IOMMU_BAD_ID = 4, // R : Faulty Peripheral Index (SRCID) |
|---|
| 22 | IOB_INVAL_PTE = 5, // W : Invalidate a PTE (virtual address) |
|---|
| 23 | IOB_WTI_ENABLE = 6, // R/W : Enable WTIs (both IOMMU and peripherals) |
|---|
| 24 | IOB_WTI_ADDR_LO = 7, // W/R : 32 LSB bits for IOMMU WTI |
|---|
| 25 | IOB_WTI_ADDR_HI = 8, // W/R : 32 MSB bits for IOMMU WTI |
|---|
| 26 | }; |
|---|
| 27 | |
|---|
| 28 | enum mmu_error_type_e |
|---|
| 29 | { |
|---|
| 30 | MMU_NONE = 0x0000, // None |
|---|
| 31 | MMU_WRITE_ACCES_VIOLATION = 0x0008, // Write access to a non writable page |
|---|
| 32 | MMU_WRITE_PT1_ILLEGAL_ACCESS = 0x0040, // Write Bus Error accessing Table 1 |
|---|
| 33 | MMU_READ_PT1_UNMAPPED = 0x1001, // Read Page fault on Page Table 1 |
|---|
| 34 | MMU_READ_PT2_UNMAPPED = 0x1002, // Read Page fault on Page Table 2 |
|---|
| 35 | MMU_READ_PT1_ILLEGAL_ACCESS = 0x1040, // Read Bus Error in Table1 access |
|---|
| 36 | MMU_READ_PT2_ILLEGAL_ACCESS = 0x1080, // Read Bus Error in Table2 access |
|---|
| 37 | MMU_READ_DATA_ILLEGAL_ACCESS = 0x1100, // Read Bus Error in cache access |
|---|
| 38 | }; |
|---|
| 39 | |
|---|
| 40 | |
|---|
| 41 | /////////////////////////////////////////////////////////////////////////////////// |
|---|
| 42 | // TSAR IOB access functions |
|---|
| 43 | /////////////////////////////////////////////////////////////////////////////////// |
|---|
| 44 | |
|---|
| 45 | extern void _iob_inval_tlb_entry( unsigned int cluster_xy, |
|---|
| 46 | unsigned int vaddr ); |
|---|
| 47 | |
|---|
| 48 | extern void _iob_set_iommu_ptpr( unsigned int cluster_xy, |
|---|
| 49 | unsigned int value ); |
|---|
| 50 | |
|---|
| 51 | /////////////////////////////////////////////////////////////////////////////////// |
|---|
| 52 | |
|---|
| 53 | #endif |
|---|
| 54 | |
|---|
| 55 | // Local Variables: |
|---|
| 56 | // tab-width: 4 |
|---|
| 57 | // c-basic-offset: 4 |
|---|
| 58 | // c-file-offsets:((innamespace . 0)(inline-open . 0)) |
|---|
| 59 | // indent-tabs-mode: nil |
|---|
| 60 | // End: |
|---|
| 61 | // vim: filetype=c:expandtab:shiftwidth=4:tabstop=4:softtabstop=4 |
|---|
| 62 | |
|---|