1 | #ifndef _HWR_MAPPING_H |
---|
2 | #define _HWR_MAPPING_H |
---|
3 | |
---|
4 | /* |
---|
5 | * Registers mapping for the different peripherals |
---|
6 | */ |
---|
7 | |
---|
8 | /* IOC (block device) */ |
---|
9 | enum IOC_registers |
---|
10 | { |
---|
11 | BLOCK_DEVICE_BUFFER, |
---|
12 | BLOCK_DEVICE_LBA, |
---|
13 | BLOCK_DEVICE_COUNT, |
---|
14 | BLOCK_DEVICE_OP, |
---|
15 | BLOCK_DEVICE_STATUS, |
---|
16 | BLOCK_DEVICE_IRQ_ENABLE, |
---|
17 | BLOCK_DEVICE_SIZE, |
---|
18 | BLOCK_DEVICE_BLOCK_SIZE, |
---|
19 | BLOCK_DEVICE_BUFFER_EXT, |
---|
20 | }; |
---|
21 | enum IOC_operations |
---|
22 | { |
---|
23 | BLOCK_DEVICE_NOOP, |
---|
24 | BLOCK_DEVICE_READ, |
---|
25 | BLOCK_DEVICE_WRITE, |
---|
26 | }; |
---|
27 | enum IOC_status |
---|
28 | { |
---|
29 | BLOCK_DEVICE_IDLE, |
---|
30 | BLOCK_DEVICE_BUSY, |
---|
31 | BLOCK_DEVICE_READ_SUCCESS, |
---|
32 | BLOCK_DEVICE_WRITE_SUCCESS, |
---|
33 | BLOCK_DEVICE_READ_ERROR, |
---|
34 | BLOCK_DEVICE_WRITE_ERROR, |
---|
35 | BLOCK_DEVICE_ERROR, |
---|
36 | }; |
---|
37 | |
---|
38 | /* DMA */ |
---|
39 | enum DMA_registers |
---|
40 | { |
---|
41 | DMA_SRC = 0, |
---|
42 | DMA_DST = 1, |
---|
43 | DMA_LEN = 2, |
---|
44 | DMA_RESET = 3, |
---|
45 | DMA_IRQ_DISABLE = 4, |
---|
46 | DMA_SRC_EXT = 5, |
---|
47 | DMA_DST_EXT = 6, |
---|
48 | /**/ |
---|
49 | DMA_END = 7, |
---|
50 | DMA_SPAN = 8, |
---|
51 | }; |
---|
52 | |
---|
53 | /* GCD */ |
---|
54 | enum GCD_registers |
---|
55 | { |
---|
56 | GCD_OPA = 0, |
---|
57 | GCD_OPB = 1, |
---|
58 | GCD_START = 2, |
---|
59 | GCD_STATUS = 3, |
---|
60 | /**/ |
---|
61 | GCD_END = 4, |
---|
62 | }; |
---|
63 | |
---|
64 | /* ICU */ |
---|
65 | enum ICU_registers |
---|
66 | { |
---|
67 | ICU_INT = 0, |
---|
68 | ICU_MASK = 1, |
---|
69 | ICU_MASK_SET = 2, |
---|
70 | ICU_MASK_CLEAR = 3, |
---|
71 | ICU_IT_VECTOR = 4, |
---|
72 | /**/ |
---|
73 | ICU_END = 5, |
---|
74 | ICU_SPAN = 8, |
---|
75 | }; |
---|
76 | enum Xicu_registers |
---|
77 | { |
---|
78 | XICU_WTI_REG = 0, |
---|
79 | XICU_PTI_PER = 1, |
---|
80 | XICU_PTI_VAL = 2, |
---|
81 | XICU_PTI_ACK = 3, |
---|
82 | |
---|
83 | XICU_MSK_PTI = 4, |
---|
84 | XICU_MSK_PTI_ENABLE = 5, |
---|
85 | XICU_MSK_PTI_DISABLE = 6, |
---|
86 | XICU_PTI_ACTIVE = 6, |
---|
87 | |
---|
88 | XICU_MSK_HWI = 8, |
---|
89 | XICU_MSK_HWI_ENABLE = 9, |
---|
90 | XICU_MSK_HWI_DISABLE = 10, |
---|
91 | XICU_HWI_ACTIVE = 10, |
---|
92 | |
---|
93 | XICU_MSK_WTI = 12, |
---|
94 | XICU_MSK_WTI_ENABLE = 13, |
---|
95 | XICU_MSK_WTI_DISABLE = 14, |
---|
96 | XICU_WTI_ACTIVE = 14, |
---|
97 | |
---|
98 | XICU_PRIO = 15, |
---|
99 | }; |
---|
100 | |
---|
101 | #define XICU_REG(func, index) (((func)<<5)|(index)) |
---|
102 | |
---|
103 | /* TIMER */ |
---|
104 | enum TIMER_registers |
---|
105 | { |
---|
106 | TIMER_VALUE = 0, |
---|
107 | TIMER_MODE = 1, |
---|
108 | TIMER_PERIOD = 2, |
---|
109 | TIMER_RESETIRQ = 3, |
---|
110 | /**/ |
---|
111 | TIMER_SPAN = 4, |
---|
112 | }; |
---|
113 | |
---|
114 | /* TTY */ |
---|
115 | enum TTY_registers |
---|
116 | { |
---|
117 | TTY_WRITE = 0, |
---|
118 | TTY_STATUS = 1, |
---|
119 | TTY_READ = 2, |
---|
120 | TTY_CONFIG = 3, |
---|
121 | /**/ |
---|
122 | TTY_SPAN = 4, |
---|
123 | }; |
---|
124 | |
---|
125 | /* IOB */ |
---|
126 | enum IOB_registers |
---|
127 | { |
---|
128 | IOB_IOMMU_PTPR = 0, /* R/W : Page Table Pointer Register */ |
---|
129 | IOB_IOMMU_ACTIVE = 1, /* R/W : IOMMU activated if not 0 */ |
---|
130 | IOB_IOMMU_BVAR = 2, /* R : Bad Virtual Address (unmapped) */ |
---|
131 | IOB_IOMMU_ETR = 3, /* R : Error Type */ |
---|
132 | IOB_IOMMU_BAD_ID = 4, /* R : Faulty Peripheral Index */ |
---|
133 | IOB_INVAL_PTE = 5, /* W : Invalidate a PTE (virtual address) */ |
---|
134 | IOB_IT_ADDR_IOMMU_LO = 6, /* W/R : 32 LSB bits for IOMMU IT*/ |
---|
135 | IOB_IT_ADDR_IOMMU_HI = 7, /* W/R : 32 MSB bits for IOMMU IT */ |
---|
136 | IOB_IT_ADDRESS_BEGIN = 8, /* R/W : Peripheral IT address (2 32 bits registers) */ |
---|
137 | }; |
---|
138 | |
---|
139 | /* MWMR */ |
---|
140 | enum SoclibMwmrRegisters |
---|
141 | { |
---|
142 | MWMR_IOREG_MAX = 16, |
---|
143 | MWMR_RESET = MWMR_IOREG_MAX, |
---|
144 | MWMR_CONFIG_FIFO_WAY, |
---|
145 | MWMR_CONFIG_FIFO_NO, |
---|
146 | MWMR_CONFIG_STATUS_ADDR, |
---|
147 | MWMR_CONFIG_DEPTH, |
---|
148 | MWMR_CONFIG_BUFFER_ADDR, |
---|
149 | MWMR_CONFIG_RUNNING, |
---|
150 | MWMR_CONFIG_WIDTH, |
---|
151 | MWMR_FIFO_FILL_STATUS, |
---|
152 | }; |
---|
153 | |
---|
154 | enum SoclibMwmrWay |
---|
155 | { |
---|
156 | MWMR_TO_COPROC, |
---|
157 | MWMR_FROM_COPROC, |
---|
158 | }; |
---|
159 | |
---|
160 | /* Memory Cache (TSAR) */ |
---|
161 | enum SoclibMemCacheConfigRegs |
---|
162 | { |
---|
163 | MEMC_LOCK, |
---|
164 | MEMC_CMD_TYPE, |
---|
165 | MEMC_ADDR_LO, |
---|
166 | MEMC_ADDR_HI, |
---|
167 | MEMC_BUF_LENGTH |
---|
168 | }; |
---|
169 | |
---|
170 | enum SoclibMemCacheConfigCmd |
---|
171 | { |
---|
172 | MEMC_CMD_NOP, |
---|
173 | MEMC_CMD_INVAL, |
---|
174 | MEMC_CMD_SYNC |
---|
175 | }; |
---|
176 | |
---|
177 | #endif |
---|
178 | |
---|
179 | // Local Variables: |
---|
180 | // tab-width: 4 |
---|
181 | // c-basic-offset: 4 |
---|
182 | // c-file-offsets:((innamespace . 0)(inline-open . 0)) |
---|
183 | // indent-tabs-mode: nil |
---|
184 | // End: |
---|
185 | // vim: filetype=c:expandtab:shiftwidth=4:tabstop=4:softtabstop=4 |
---|
186 | |
---|