Changeset 496 for soft/giet_vm
- Timestamp:
- Feb 8, 2015, 1:12:23 PM (10 years ago)
- Location:
- soft/giet_vm/giet_drivers
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
soft/giet_vm/giet_drivers/bdv_driver.c
r469 r496 27 27 /////////////////////////////////////////////////////////////////////////////// 28 28 29 __attribute__((section(".kdata"))) 29 30 spin_lock_t _bdv_lock __attribute__((aligned(64))); 31 32 __attribute__((section(".kdata"))) 30 33 unsigned int _bdv_status; 34 35 __attribute__((section(".kdata"))) 31 36 unsigned int _bdv_gtid; 32 37 … … 132 137 _puts(","); 133 138 _putd( p ); 134 _puts("] launch transfer in polling mode\n"); 139 _puts("] launch transfer in polling mode at cycle "); 140 _putd( _get_proctime() ); 141 _puts("\n"); 135 142 #endif 136 143 unsigned int status; … … 196 203 _puts(","); 197 204 _putd( p ); 198 _puts("] launch transfer in nterrupt mode\n"); 205 _puts("] launch transfer in interrupt mode at cycle "); 206 _putd( _get_proctime() ); 207 _puts("\n"); 199 208 #endif 200 209 … … 350 359 _putd(remote_x ); 351 360 _puts(","); 352 _putd(remo re_y );361 _putd(remote_y ); 353 362 _puts(","); 354 363 _putd(remote_p ); -
soft/giet_vm/giet_drivers/bdv_driver.h
r456 r496 48 48 #define _GIET_BDV_DRIVER_H_ 49 49 50 #include " locks.h"50 #include "kernel_locks.h" 51 51 52 52 /////////////////////////////////////////////////////////////////////////////////// -
soft/giet_vm/giet_drivers/dma_driver.c
r481 r496 48 48 // in the DMA component contained in cluster "cluster_xy" 49 49 /////////////////////////////////////////////////////////////////////////////// 50 51 #if NB_DMA_CHANNELS > 0 50 52 static 51 53 unsigned int _dma_get_register( unsigned int cluster_xy, // cluster index … … 61 63 return ioread32( (void*)vaddr ); 62 64 } 65 #endif 63 66 64 67 /////////////////////////////////////////////////////////////////////////////// … … 66 69 // in the DMA component contained in cluster "cluster_xy" 67 70 /////////////////////////////////////////////////////////////////////////////// 71 72 #if NB_DMA_CHANNELS > 0 68 73 static 69 74 void _dma_set_register( unsigned int cluster_xy, // cluster index … … 80 85 iowrite32( (void*)vaddr, value ); 81 86 } 87 #endif 82 88 83 89 //////////////////////////////////////////////// -
soft/giet_vm/giet_drivers/ioc_driver.c
r481 r496 67 67 /////////////////////////////////////////////////////////////////////////////// 68 68 69 #define in_unckdata __attribute__((section (".unckdata"))) 70 71 in_unckdata volatile unsigned int _ioc_iommu_ix1 = 0; 72 in_unckdata volatile unsigned int _ioc_iommu_npages; 69 __attribute__((section (".kdata"))) 70 volatile unsigned int _ioc_iommu_ix1 = 0; 71 72 __attribute__((section (".kdata"))) 73 volatile unsigned int _ioc_iommu_npages; 73 74 74 75 /////////////////////////////////////////////////////////////////////////////// … … 96 97 unsigned int y = (procid >> P_WIDTH) & ((1<<Y_WIDTH)-1); 97 98 unsigned int p = procid & ((1<<P_WIDTH)-1); 98 _puts("\n[IOC DEBUG] _ioc_access() : P["); 99 _putd( x ); 100 _puts(","); 101 _putd( y ); 102 _puts(","); 103 _putd( p ); 104 _puts("] enters at cycle "); 105 _putd( _get_proctime() ); 106 _puts("\n - channel = "); 107 _putd( channel ); 108 _puts("\n - mode = "); 109 _putd( mode ); 110 _puts("\n - vaddr = "); 111 _putx( buf_vaddr ); 112 _puts("\n - sectors = "); 113 _putd( count ); 114 _puts("\n - lba = "); 115 _putx( lba ); 116 _puts("\n"); 99 _printf("\n[IOC DEBUG] _ioc_access() : P[%d,%d,%d] enters at cycle %d\n" 100 " - channel = %d\n" 101 " - mode = %d\n" 102 " - vaddr = %x\n" 103 " - sectors = %d\n" 104 " - lba = %x\n", 105 x, y , p, _get_proctime(), channel, mode, buf_vaddr, count, lba ); 117 106 #endif 118 107 … … 140 129 141 130 // computing memory buffer physical address 142 if ( (mode == IOC_BOOT_MODE) && ((_get_mmu_mode() & 0x4) == 0) ) // identity mapping131 if ( (mode == IOC_BOOT_MODE) && ((_get_mmu_mode() & 0x4) == 0) ) // identity 143 132 { 144 133 buf_paddr = (paddr_t)buf_vaddr; 145 134 } 146 else 135 else // V2P translation required 147 136 { 148 137 // get page table virtual address … … 280 269 #elif ( USE_IOC_RDK ) 281 270 282 return rdk_get_status();271 return _rdk_get_status(); 283 272 284 273 #endif -
soft/giet_vm/giet_drivers/ioc_driver.h
r437 r496 1 /////////////////////////////////////////////////////////////////////////////// ////1 /////////////////////////////////////////////////////////////////////////////// 2 2 // File : ioc_driver.h 3 3 // Date : 01/11/2013 4 4 // Author : alain greiner 5 5 // Copyright (c) UPMC-LIP6 6 /////////////////////////////////////////////////////////////////////////////// ////6 /////////////////////////////////////////////////////////////////////////////// 7 7 // The ioc_driver.c and ioc_driver.h files are part ot the GIET-VM kernel. 8 8 // … … 69 69 // The user buffer is unmapped by the _ioc_completed() function when 70 70 // the transfer is completed. 71 /////////////////////////////////////////////////////////////////////////////// ////71 /////////////////////////////////////////////////////////////////////////////// 72 72 73 73 #ifndef _GIET_IOC_DRIVER_H_ 74 74 #define _GIET_IOC_DRIVER_H_ 75 75 76 /////////////////////////////////////////////////////////////////////////////// ////76 /////////////////////////////////////////////////////////////////////////////// 77 77 // IOC (vci_block device) registers offsets 78 /////////////////////////////////////////////////////////////////////////////// ////78 /////////////////////////////////////////////////////////////////////////////// 79 79 80 80 enum IOC_driver_modes … … 85 85 }; 86 86 87 /////////////////////////////////////////////////////////////////////////////// ////88 // IOC global variables (generic disk controller)89 /////////////////////////////////////////////////////////////////////////////// ////87 /////////////////////////////////////////////////////////////////////////////// 88 // External global variables 89 /////////////////////////////////////////////////////////////////////////////// 90 90 91 91 extern volatile unsigned int _ioc_iommu_ix1; 92 92 extern volatile unsigned int _ioc_iommu_npages; 93 93 94 /////////////////////////////////////////////////////////////////////////////// ////94 /////////////////////////////////////////////////////////////////////////////// 95 95 // External functions 96 /////////////////////////////////////////////////////////////////////////////// ////96 /////////////////////////////////////////////////////////////////////////////// 97 97 98 98 /////////////////////////////////////////////////////////////////////////////// -
soft/giet_vm/giet_drivers/mmc_driver.c
r481 r496 9 9 #include <mmc_driver.h> 10 10 #include <tty0.h> 11 #include < locks.h>11 #include <kernel_locks.h> 12 12 #include <utils.h> 13 13 … … 37 37 # error: You must define PERI_CLUSTER_INCREMENT in the hard_config.h file 38 38 #endif 39 40 /////////////////////////////////////////////////////////////////////////////// 41 // Distributed locks protecting MMC components (one per cluster) 42 /////////////////////////////////////////////////////////////////////////////// 43 44 __attribute__((section(".kdata"))) 45 spin_lock_t _mmc_lock[X_SIZE][Y_SIZE] __attribute__((aligned(64))); 39 46 40 47 /////////////////////////////////////////////////////////////////////////////// … … 87 94 if ( (x >= X_SIZE) || (y >= Y_SIZE) ) 88 95 { 89 _puts("\n[GIET ERROR] in _m emc_inval() : illegal cluster coordinates\n");96 _puts("\n[GIET ERROR] in _mmc_inval() : illegal cluster coordinates\n"); 90 97 _exit(); 91 98 } 92 99 93 // get the hard queuinglock protecting exclusive access to MEMC100 // get the lock protecting exclusive access to MEMC 94 101 _spin_lock_acquire( &_mmc_lock[x][y] ); 95 102 96 103 // write inval arguments 97 _mmc_set_register( cluster_xy , 0, MEMC_ADDR_LO , (unsigned int)buf_paddr );98 _mmc_set_register( cluster_xy , 0, MEMC_ADDR_HI , (unsigned int)(buf_paddr>>32) );99 _mmc_set_register( cluster_xy , 0, MEMC_BUF_LENGTH, buf_length );100 _mmc_set_register( cluster_xy , 0, MEMC_CMD_TYPE , MEMC_CMD_INVAL );104 _mmc_set_register(cluster_xy, 0, MEMC_ADDR_LO , (unsigned int)buf_paddr ); 105 _mmc_set_register(cluster_xy, 0, MEMC_ADDR_HI , (unsigned int)(buf_paddr>>32) ); 106 _mmc_set_register(cluster_xy, 0, MEMC_BUF_LENGTH, buf_length ); 107 _mmc_set_register(cluster_xy, 0, MEMC_CMD_TYPE , MEMC_CMD_INVAL ); 101 108 102 109 // release the lock … … 116 123 if ( (x >= X_SIZE) || (y >= Y_SIZE) ) 117 124 { 118 _puts( "\n[GIET ERROR] in _m emc_sync() : illegal cluster coordinates");125 _puts( "\n[GIET ERROR] in _mmc_sync() : illegal cluster coordinates"); 119 126 _exit(); 120 127 } 121 128 122 // get the hard queuinglock protecting exclusive access to MEMC129 // get the lock protecting exclusive access to MEMC 123 130 _spin_lock_acquire( &_mmc_lock[x][y] ); 124 131 … … 131 138 // release the lock 132 139 _spin_lock_release( &_mmc_lock[x][y] ); 140 } 141 142 ///////////////////////////////////////////// 143 unsigned int _mmc_instrument( unsigned int x, 144 unsigned int y, 145 unsigned int reg ) 146 { 147 // parameters checking 148 if ( (x >= X_SIZE) || (y >= Y_SIZE) ) 149 { 150 _puts( "\n[GIET ERROR] in _mmc_instrument() : illegal cluster coordinates"); 151 _exit(); 152 } 153 154 unsigned int cluster_xy = (x << Y_WIDTH) + y; 155 return( _mmc_get_register(cluster_xy , 1 , reg) ); 133 156 } 134 157 -
soft/giet_vm/giet_drivers/mmc_driver.h
r483 r496 10 10 11 11 #include <hard_config.h> 12 #include < locks.h>12 #include <kernel_locks.h> 13 13 14 14 /////////////////////////////////////////////////////////////////////////////////// 15 15 // TSAR Memory Cache configuration registers offsets and commands 16 16 /////////////////////////////////////////////////////////////////////////////////// 17 18 enum SoclibMemCacheFunc 19 { 20 MEMC_CONFIG = 0, 21 MEMC_INSTRM = 1, 22 MEMC_RERROR = 2, 23 24 MEMC_FUNC_SPAN = 0x200 25 }; 17 26 18 27 enum SoclibMemCacheConfigRegs … … 31 40 }; 32 41 42 enum SoclibMemCacheInstrRegs { 43 44 // NUMBER OF LOCAL TRANSACTIONS ON DIRECT NETWORK 45 46 MEMC_LOCAL_READ_LO = 0x00, 47 MEMC_LOCAL_READ_HI = 0x01, 48 MEMC_LOCAL_WRITE_LO = 0x02, 49 MEMC_LOCAL_WRITE_HI = 0x03, 50 MEMC_LOCAL_LL_LO = 0x04, 51 MEMC_LOCAL_LL_HI = 0x05, 52 MEMC_LOCAL_SC_LO = 0x06, 53 MEMC_LOCAL_SC_HI = 0x07, 54 MEMC_LOCAL_CAS_LO = 0x08, 55 MEMC_LOCAL_CAS_HI = 0x09, 56 57 // NUMBER OF REMOTE TRANSACTIONS ON DIRECT NETWORK 58 59 MEMC_REMOTE_READ_LO = 0x10, 60 MEMC_REMOTE_READ_HI = 0x11, 61 MEMC_REMOTE_WRITE_LO = 0x12, 62 MEMC_REMOTE_WRITE_HI = 0x13, 63 MEMC_REMOTE_LL_LO = 0x14, 64 MEMC_REMOTE_LL_HI = 0x15, 65 MEMC_REMOTE_SC_LO = 0x16, 66 MEMC_REMOTE_SC_HI = 0x17, 67 MEMC_REMOTE_CAS_LO = 0x18, 68 MEMC_REMOTE_CAS_HI = 0x19, 69 70 // COST OF TRANSACTIONS ON DIRECT NETWORK 71 72 MEMC_COST_READ_LO = 0x20, 73 MEMC_COST_READ_HI = 0x21, 74 MEMC_COST_WRITE_LO = 0x22, 75 MEMC_COST_WRITE_HI = 0x23, 76 MEMC_COST_LL_LO = 0x24, 77 MEMC_COST_LL_HI = 0x25, 78 MEMC_COST_SC_LO = 0x26, 79 MEMC_COST_SC_HI = 0x27, 80 MEMC_COST_CAS_LO = 0x28, 81 MEMC_COST_CAS_HI = 0x29, 82 83 // NUMBER OF LOCAL TRANSACTIONS ON CC NETWORK 84 85 MEMC_LOCAL_MUPDATE_LO = 0x40, 86 MEMC_LOCAL_MUPDATE_HI = 0x41, 87 MEMC_LOCAL_MINVAL_LO = 0x42, 88 MEMC_LOCAL_MINVAL_HI = 0x43, 89 MEMC_LOCAL_CLEANUP_LO = 0x44, 90 MEMC_LOCAL_CLEANUP_HI = 0x45, 91 92 // NUMBER OF REMOTE TRANSACTIONS ON CC NETWORK 93 94 MEMC_REMOTE_MUPDATE_LO = 0x50, 95 MEMC_REMOTE_MUPDATE_HI = 0x51, 96 MEMC_REMOTE_MINVAL_LO = 0x52, 97 MEMC_REMOTE_MINVAL_HI = 0x53, 98 MEMC_REMOTE_CLEANUP_LO = 0x54, 99 MEMC_REMOTE_CLEANUP_HI = 0x55, 100 101 // COST OF TRANSACTIONS ON CC NETWORK 102 103 MEMC_COST_MUPDATE_LO = 0x60, 104 MEMC_COST_MUPDATE_HI = 0x61, 105 MEMC_COST_MINVAL_LO = 0x62, 106 MEMC_COST_MINVAL_HI = 0x63, 107 MEMC_COST_CLEANUP_LO = 0x64, 108 MEMC_COST_CLEANUP_HI = 0x65, 109 110 // TOTAL 111 112 MEMC_TOTAL_MUPDATE_LO = 0x68, 113 MEMC_TOTAL_MUPDATE_HI = 0x69, 114 MEMC_TOTAL_MINVAL_LO = 0x6A, 115 MEMC_TOTAL_MINVAL_HI = 0x6B, 116 MEMC_TOTAL_BINVAL_LO = 0x6C, 117 MEMC_TOTAL_BINVAL_HI = 0x6D, 118 }; 119 33 120 #define MMC_REG(func,idx) ((func<<7)|idx) 34 35 ///////////////////////////////////////////////////////////////////////////////36 // Distributed locks protecting MMC components (one per cluster)37 ///////////////////////////////////////////////////////////////////////////////38 39 spin_lock_t _mmc_lock[X_SIZE][Y_SIZE] __attribute__((aligned(64)));40 121 41 122 /////////////////////////////////////////////////////////////////////////////////// 42 123 // MEMC access functions (for TSAR architecture) 43 124 /////////////////////////////////////////////////////////////////////////////////// 125 126 extern unsigned int _mmc_instrument( unsigned int x, 127 unsigned int y, 128 unsigned int reg ); 44 129 45 130 extern void _mmc_inval( unsigned long long buf_paddr, -
soft/giet_vm/giet_drivers/tty_driver.c
r469 r496 17 17 # error: You must define SEG_TTY_BASE in the hard_config.h file 18 18 #endif 19 20 //////////////////////////////////////////////////////////////////////////////////// 21 // global variables 22 //////////////////////////////////////////////////////////////////////////////////// 23 24 __attribute__((section(".kdata"))) 25 unsigned int _tty_rx_buf[NB_TTY_CHANNELS]; 26 27 __attribute__((section(".kdata"))) 28 unsigned int _tty_rx_full[NB_TTY_CHANNELS]; 19 29 20 30 //////////////////////////////////////////////////////////////////////////////////// -
soft/giet_vm/giet_drivers/tty_driver.h
r469 r496 25 25 26 26 #include "hard_config.h" 27 #include " locks.h"27 #include "kernel_locks.h" 28 28 29 29 /////////////////////////////////////////////////////////////////////////////////// … … 40 40 TTY_SPAN = 4, 41 41 }; 42 43 ////////////////////////////////////////////////////////////////////////////////////44 // global variables45 // These variables must be defined both in boot code and in kernel_init code.46 ////////////////////////////////////////////////////////////////////////////////////47 48 extern sbt_lock_t _tty_tx_lock[NB_TTY_CHANNELS];49 50 extern unsigned int _tty_rx_buf[NB_TTY_CHANNELS];51 extern unsigned int _tty_rx_full[NB_TTY_CHANNELS];52 42 53 43 ////////////////////////////////////////////////////////////////////////////////// -
soft/giet_vm/giet_drivers/xcu_driver.c
r490 r496 101 101 else 102 102 { 103 _p uts("[GIET ERROR] _xcu_set_mask() receives illegal IRQ type\n");103 _printf("[GIET ERROR] _xcu_set_mask() receives illegal IRQ type\n"); 104 104 _exit(); 105 105 } … … 108 108 109 109 #else 110 _p uts("[GIET ERROR] _xcu_set_mask() should not be used if USE_XCU not set\n");110 _printf("[GIET ERROR] _xcu_set_mask() should not be used if USE_XCU not set\n"); 111 111 _exit(); 112 112 #endif … … 155 155 156 156 #else 157 _p uts("[GIET ERROR] _xcu_get_index should not be used if USE_XCU is not set\n");157 _printf("[GIET ERROR] _xcu_get_index should not be used if USE_XCU is not set\n"); 158 158 _exit(); 159 159 #endif … … 176 176 177 177 #else 178 _p uts("[GIET ERROR] _xcu_send_wti() should not be used if USE_XCU is not set\n");178 _printf("[GIET ERROR] _xcu_send_wti() should not be used if USE_XCU is not set\n"); 179 179 _exit(); 180 180 #endif … … 221 221 222 222 #else 223 _p uts("[GIET ERROR] in _xcu_get_wti_value() USE_XCU is not set\n");223 _printf("[GIET ERROR] in _xcu_get_wti_value() USE_XCU is not set\n"); 224 224 _exit(); 225 225 #endif … … 236 236 237 237 #else 238 _p uts("[GIET ERROR] in _xcu_get_wti_address() USE_XCU is not set\n");238 _printf("[GIET ERROR] in _xcu_get_wti_address() USE_XCU is not set\n"); 239 239 _exit(); 240 240 #endif … … 256 256 257 257 #else 258 _p uts("[GIET ERROR] in _xcu_timer_start() USE_XCU is not set\n");258 _printf("[GIET ERROR] in _xcu_timer_start() USE_XCU is not set\n"); 259 259 _exit(); 260 260 #endif … … 275 275 276 276 #else 277 _p uts("[GIET ERROR] in _xcu_timer_stop() USE_XCU is not set\n");277 _printf("[GIET ERROR] in _xcu_timer_stop() USE_XCU is not set\n"); 278 278 _exit(); 279 279 #endif
Note: See TracChangeset
for help on using the changeset viewer.