source: soft/giet_vm/giet_drivers/mmc_driver.h @ 667

Last change on this file since 667 was 615, checked in by bellefin, 10 years ago

Introduce mmc distributed lock
The locks are distributed in the kernel heaps (one lock in each cluster) and there is a global table in the kernel data segment which contains the addresses of all the locks.
The _mmc_boot_mode variable is defined in boot.c and kernel_init.c and defines which kind of lock is used.
The distributed locks are initialized inside the kernel_init() function.

File size: 4.2 KB
Line 
1///////////////////////////////////////////////////////////////////////////////////
2// File     : mmc_driver.h
3// Date     : 01/11/2013
4// Author   : alain greiner
5// Copyright (c) UPMC-LIP6
6///////////////////////////////////////////////////////////////////////////////////
7
8#ifndef _GIET_MMC_DRIVERS_H_
9#define _GIET_MMC_DRIVERS_H_
10
11#include <hard_config.h>
12#include <kernel_locks.h>
13#include <kernel_malloc.h>
14
15///////////////////////////////////////////////////////////////////////////////////
16// TSAR Memory Cache configuration registers offsets and commands
17///////////////////////////////////////////////////////////////////////////////////
18
19enum SoclibMemCacheFunc
20{
21    MEMC_CONFIG = 0,
22    MEMC_INSTRM = 1,
23    MEMC_RERROR = 2,
24
25    MEMC_FUNC_SPAN = 0x200
26};
27
28enum SoclibMemCacheConfigRegs
29{
30    MEMC_ADDR_LO,
31    MEMC_ADDR_HI,
32    MEMC_BUF_LENGTH,
33    MEMC_CMD_TYPE
34};
35
36enum SoclibMemCacheConfigCmd
37{
38    MEMC_CMD_NOP,
39    MEMC_CMD_INVAL,
40    MEMC_CMD_SYNC
41};
42
43enum SoclibMemCacheInstrRegs {
44
45    // NUMBER OF LOCAL TRANSACTIONS ON DIRECT NETWORK
46
47    MEMC_LOCAL_READ_LO   = 0x00,
48    MEMC_LOCAL_READ_HI   = 0x01,
49    MEMC_LOCAL_WRITE_LO  = 0x02,
50    MEMC_LOCAL_WRITE_HI  = 0x03,
51    MEMC_LOCAL_LL_LO     = 0x04,
52    MEMC_LOCAL_LL_HI     = 0x05,
53    MEMC_LOCAL_SC_LO     = 0x06,
54    MEMC_LOCAL_SC_HI     = 0x07,
55    MEMC_LOCAL_CAS_LO    = 0x08,
56    MEMC_LOCAL_CAS_HI    = 0x09,
57
58    // NUMBER OF REMOTE TRANSACTIONS ON DIRECT NETWORK
59
60    MEMC_REMOTE_READ_LO  = 0x10,
61    MEMC_REMOTE_READ_HI  = 0x11,
62    MEMC_REMOTE_WRITE_LO = 0x12,
63    MEMC_REMOTE_WRITE_HI = 0x13,
64    MEMC_REMOTE_LL_LO    = 0x14,
65    MEMC_REMOTE_LL_HI    = 0x15,
66    MEMC_REMOTE_SC_LO    = 0x16,
67    MEMC_REMOTE_SC_HI    = 0x17,
68    MEMC_REMOTE_CAS_LO   = 0x18,
69    MEMC_REMOTE_CAS_HI   = 0x19,
70
71    // COST OF TRANSACTIONS ON DIRECT NETWORK
72
73    MEMC_COST_READ_LO    = 0x20,
74    MEMC_COST_READ_HI    = 0x21,
75    MEMC_COST_WRITE_LO   = 0x22,
76    MEMC_COST_WRITE_HI   = 0x23,
77    MEMC_COST_LL_LO      = 0x24,
78    MEMC_COST_LL_HI      = 0x25,
79    MEMC_COST_SC_LO      = 0x26,
80    MEMC_COST_SC_HI      = 0x27,
81    MEMC_COST_CAS_LO     = 0x28,
82    MEMC_COST_CAS_HI     = 0x29,
83
84    // NUMBER OF LOCAL TRANSACTIONS ON CC NETWORK
85
86    MEMC_LOCAL_MUPDATE_LO  = 0x40,
87    MEMC_LOCAL_MUPDATE_HI  = 0x41,
88    MEMC_LOCAL_MINVAL_LO   = 0x42,
89    MEMC_LOCAL_MINVAL_HI   = 0x43,
90    MEMC_LOCAL_CLEANUP_LO  = 0x44,
91    MEMC_LOCAL_CLEANUP_HI  = 0x45,
92
93    // NUMBER OF REMOTE TRANSACTIONS ON CC NETWORK
94
95    MEMC_REMOTE_MUPDATE_LO = 0x50,
96    MEMC_REMOTE_MUPDATE_HI = 0x51,
97    MEMC_REMOTE_MINVAL_LO  = 0x52,
98    MEMC_REMOTE_MINVAL_HI  = 0x53,
99    MEMC_REMOTE_CLEANUP_LO = 0x54,
100    MEMC_REMOTE_CLEANUP_HI = 0x55,
101
102    // COST OF TRANSACTIONS ON CC NETWORK
103
104    MEMC_COST_MUPDATE_LO   = 0x60,
105    MEMC_COST_MUPDATE_HI   = 0x61,
106    MEMC_COST_MINVAL_LO    = 0x62,
107    MEMC_COST_MINVAL_HI    = 0x63,
108    MEMC_COST_CLEANUP_LO   = 0x64,
109    MEMC_COST_CLEANUP_HI   = 0x65,
110
111    // TOTAL
112
113    MEMC_TOTAL_MUPDATE_LO  = 0x68,
114    MEMC_TOTAL_MUPDATE_HI  = 0x69,
115    MEMC_TOTAL_MINVAL_LO   = 0x6A,
116    MEMC_TOTAL_MINVAL_HI   = 0x6B,
117    MEMC_TOTAL_BINVAL_LO   = 0x6C,
118    MEMC_TOTAL_BINVAL_HI   = 0x6D,
119};
120
121#define MMC_REG(func,idx) ((func<<7)|idx)
122
123///////////////////////////////////////////////////////////////////////////////////
124// MEMC access functions (for TSAR architecture)
125///////////////////////////////////////////////////////////////////////////////////
126
127extern void _mmc_init_locks();
128
129extern unsigned int _mmc_instrument( unsigned int x,
130                                     unsigned int y,
131                                     unsigned int reg );
132
133extern void _mmc_inval( unsigned long long buf_paddr, 
134                        unsigned int buf_length );
135
136extern void _mmc_sync(  unsigned long long buf_paddr, 
137                        unsigned int buf_length);
138
139extern void _mmc_isr( unsigned int irq_type,
140                      unsigned int irq_id,
141                      unsigned int channel );
142
143///////////////////////////////////////////////////////////////////////////////////
144
145#endif
146
147// Local Variables:
148// tab-width: 4
149// c-basic-offset: 4
150// c-file-offsets:((innamespace . 0)(inline-open . 0))
151// indent-tabs-mode: nil
152// End:
153// vim: filetype=c:expandtab:shiftwidth=4:tabstop=4:softtabstop=4
154
Note: See TracBrowser for help on using the repository browser.