source: soft/giet_vm/giet_drivers/iob_driver.h

Last change on this file was 437, checked in by alain, 10 years ago

Introducing dynamic allocation of peripheral channel(TTY, NIC, TIM, CMA)
Removint the ICU driver : ICU component not supported anymore.
Removing the FBF driver.

File size: 3.4 KB
Line 
1///////////////////////////////////////////////////////////////////////////////////
2// File     : iob_driver.h
3// Date     : 01/11/2013
4// Author   : alain greiner
5// Copyright (c) UPMC-LIP6
6///////////////////////////////////////////////////////////////////////////////////
7// The iob_driver.c and iob_driver.h files are part ot the GIET-VM kernel.
8// This driver supports the TSAR vci_io_bridge, that is a bridge to access
9// The external peripherals, implementing an IO_MMU.
10// The SEG_IOB_BASE virtual addresses must be defined in hard_config.h file.
11// The physical base address is (cluster_io << 32) | SEG_IOB_BASE.
12///////////////////////////////////////////////////////////////////////////////////
13
14#ifndef _GIET_IOB_DRIVER_H_
15#define _GIET_IOB_DRIVER_H_
16
17///////////////////////////////////////////////////////////////////////////////////
18//                registers offsets and iommu error codes
19///////////////////////////////////////////////////////////////////////////////////
20
21enum IOB_registers
22{
23    IOB_IOMMU_PTPR       = 0,      // R/W : Page Table Pointer Register
24    IOB_IOMMU_ACTIVE     = 1,      // R/W : IOMMU activated if not 0
25    IOB_IOMMU_BVAR       = 2,      // R   : Bad Virtual Address (unmapped)
26    IOB_IOMMU_ETR        = 3,      // R   : Error Type
27    IOB_IOMMU_BAD_ID     = 4,      // R   : Faulty Peripheral Index (SRCID)
28    IOB_INVAL_PTE        = 5,      // W   : Invalidate a PTE (virtual address)
29    IOB_WTI_ENABLE       = 6,      // R/W : Enable WTIs (both IOMMU and peripherals)
30    IOB_WTI_ADDR_LO      = 7,      // W/R : 32 LSB bits for IOMMU WTI
31    IOB_WTI_ADDR_HI      = 8,      // W/R : 32 MSB bits for IOMMU WTI
32};
33
34enum mmu_error_type_e
35{
36    MMU_NONE                      = 0x0000, // None
37    MMU_WRITE_ACCES_VIOLATION     = 0x0008, // Write access to a non writable page
38    MMU_WRITE_PT1_ILLEGAL_ACCESS  = 0x0040, // Write Bus Error accessing Table 1       
39    MMU_READ_PT1_UNMAPPED             = 0x1001, // Read  Page fault on Page Table 1     
40    MMU_READ_PT2_UNMAPPED             = 0x1002, // Read  Page fault on Page Table 2 
41    MMU_READ_PT1_ILLEGAL_ACCESS   = 0x1040, // Read  Bus Error in Table1 access     
42    MMU_READ_PT2_ILLEGAL_ACCESS   = 0x1080, // Read  Bus Error in Table2 access         
43    MMU_READ_DATA_ILLEGAL_ACCESS  = 0x1100, // Read  Bus Error in cache access
44};
45
46
47///////////////////////////////////////////////////////////////////////////////////
48//                       access functions
49///////////////////////////////////////////////////////////////////////////////////
50
51///////////////////////////////////////////////////////////////////////////////
52// This function invalidates a TLB entry identified by a virtual address.
53///////////////////////////////////////////////////////////////////////////////
54extern void _iob_inval_tlb_entry( unsigned int cluster_xy,
55                                  unsigned int vaddr );
56
57///////////////////////////////////////////////////////////////////////////////
58// This function sets a new value in IOB_IOMMU_PTPR register.
59///////////////////////////////////////////////////////////////////////////////
60extern void _iob_set_iommu_ptpr(  unsigned int cluster_xy,
61                                  unsigned int value );
62
63
64
65#endif
66
67// Local Variables:
68// tab-width: 4
69// c-basic-offset: 4
70// c-file-offsets:((innamespace . 0)(inline-open . 0))
71// indent-tabs-mode: nil
72// End:
73// vim: filetype=c:expandtab:shiftwidth=4:tabstop=4:softtabstop=4
74
Note: See TracBrowser for help on using the repository browser.