Changeset 298 for soft/giet_vm/giet_drivers/iob_driver.c
- Timestamp:
- Apr 3, 2014, 2:00:10 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
soft/giet_vm/giet_drivers/iob_driver.c
r258 r298 8 8 // This driver supports the TSAR vci_io_bridge, that is a bridge to access 9 9 // The external peripherals, implementing an IO_MMU. 10 // This component can be instanciated in more than one cluster. 10 11 /////////////////////////////////////////////////////////////////////////////////// 11 12 // The seg_iob_base virtual base addresses must be defined in giet_vsegs.ld file. 13 // The physical base address is supposed to be (cluster_xy << 32) | seg_iob_base. 12 14 /////////////////////////////////////////////////////////////////////////////////// 13 15 … … 24 26 #endif 25 27 28 26 29 /////////////////////////////////////////////////////////////////////////////// 27 // _iob_inval_tlb_entry() 30 // This low level function returns the value contained in register "index" 31 // in the IOB component contained in cluster "cluster_xy" 32 /////////////////////////////////////////////////////////////////////////////// 33 unsigned int _iob_get_register( unsigned int cluster_xy, // cluster index 34 unsigned int index ) // register index 35 { 36 unsigned long long paddr = (unsigned long long)(unsigned int)&seg_iob_base + 37 ((unsigned long long)cluster_xy << 32) + 38 ((unsigned long long)index << 2); 39 40 return _physical_read( paddr ); 41 } 42 /////////////////////////////////////////////////////////////////////////////// 43 // This low level function sets a new value in register "index" 44 // in the IOB component contained in cluster "cluster_xy" 45 /////////////////////////////////////////////////////////////////////////////// 46 void _iob_set_register( unsigned int cluster_xy, // cluster index 47 unsigned int index, // register index 48 unsigned int value ) // value to be written 49 { 50 unsigned long long paddr = (unsigned long long)(unsigned int)&seg_iob_base + 51 ((unsigned long long)cluster_xy << 32) + 52 ((unsigned long long)index << 2); 53 54 _physical_write( paddr, value ); 55 } 56 57 58 59 60 /////////////////////////////////////////////////////////////////////////////// 28 61 // This function invalidates a TLB entry identified by a virtual address. 29 // Returns 0 if success, returns 1 if failure30 62 /////////////////////////////////////////////////////////////////////////////// 31 unsigned int _iob_inval_tlb_entry( unsigned int vaddr ) 63 void _iob_inval_tlb_entry( unsigned int cluster_xy, 64 unsigned int vaddr ) 32 65 { 33 #if USE_IOB 66 _iob_set_register( cluster_xy, 67 IOB_INVAL_PTE, 68 vaddr ); 69 } 34 70 35 unsigned int * iob_address = (unsigned int *) &seg_iob_base ; 36 iob_address[IOB_INVAL_PTE] = vaddr; 37 return 0; 71 /////////////////////////////////////////////////////////////////////////////// 72 // This function sets a new value in IOB_IOMMU_PTPR register. 73 /////////////////////////////////////////////////////////////////////////////// 74 void _iob_set_iommu_ptpr( unsigned int cluster_xy, 75 unsigned int value ) 76 { 77 _iob_set_register( cluster_xy, 78 IOB_IOMMU_PTPR, 79 value ); 80 } 38 81 39 #else 82 /////////////////////////////////////////////////////////////////////////////// 83 // This function sets a new value in IOB_XICU_BASE register. 84 /////////////////////////////////////////////////////////////////////////////// 85 void _iob_set_xicu_base( unsigned int cluster_xy, 86 unsigned int value ) 87 { 88 _iob_set_register( cluster_xy, 89 IOB_XICU_BASE, 90 value ); 91 } 40 92 41 return 1; 93 /////////////////////////////////////////////////////////////////////////////// 94 // This function sets a new value in IOB_XICU_SIZE register. 95 /////////////////////////////////////////////////////////////////////////////// 96 void _iob_set_xicu_size( unsigned int cluster_xy, 97 unsigned int value ) 98 { 99 _iob_set_register( cluster_xy, 100 IOB_XICU_SIZE, 101 value ); 102 } 42 103 43 #endif44 }45 104 46 105
Note: See TracChangeset
for help on using the changeset viewer.