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 | BLOCK_DEVICE_BUFFER, |
---|
11 | BLOCK_DEVICE_LBA, |
---|
12 | BLOCK_DEVICE_COUNT, |
---|
13 | BLOCK_DEVICE_OP, |
---|
14 | BLOCK_DEVICE_STATUS, |
---|
15 | BLOCK_DEVICE_IRQ_ENABLE, |
---|
16 | BLOCK_DEVICE_SIZE, |
---|
17 | BLOCK_DEVICE_BLOCK_SIZE, |
---|
18 | }; |
---|
19 | enum IOC_operations { |
---|
20 | BLOCK_DEVICE_NOOP, |
---|
21 | BLOCK_DEVICE_READ, |
---|
22 | BLOCK_DEVICE_WRITE, |
---|
23 | }; |
---|
24 | enum IOC_status{ |
---|
25 | BLOCK_DEVICE_IDLE, |
---|
26 | BLOCK_DEVICE_BUSY, |
---|
27 | BLOCK_DEVICE_READ_SUCCESS, |
---|
28 | BLOCK_DEVICE_WRITE_SUCCESS, |
---|
29 | BLOCK_DEVICE_READ_ERROR, |
---|
30 | BLOCK_DEVICE_WRITE_ERROR, |
---|
31 | BLOCK_DEVICE_ERROR, |
---|
32 | }; |
---|
33 | |
---|
34 | /* DMA */ |
---|
35 | enum DMA_registers { |
---|
36 | DMA_SRC = 0, |
---|
37 | DMA_DST = 1, |
---|
38 | DMA_LEN = 2, |
---|
39 | DMA_RESET = 3, |
---|
40 | DMA_IRQ_DISABLE = 4, |
---|
41 | /**/ |
---|
42 | DMA_END = 5, |
---|
43 | DMA_SPAN = 8, |
---|
44 | }; |
---|
45 | |
---|
46 | /* GCD */ |
---|
47 | enum GCD_registers { |
---|
48 | GCD_OPA = 0, |
---|
49 | GCD_OPB = 1, |
---|
50 | GCD_START = 2, |
---|
51 | GCD_STATUS = 3, |
---|
52 | /**/ |
---|
53 | GCD_END = 4, |
---|
54 | }; |
---|
55 | |
---|
56 | /* ICU */ |
---|
57 | enum ICU_registers { |
---|
58 | ICU_INT = 0, |
---|
59 | ICU_MASK = 1, |
---|
60 | ICU_MASK_SET = 2, |
---|
61 | ICU_MASK_CLEAR = 3, |
---|
62 | ICU_IT_VECTOR = 4, |
---|
63 | /**/ |
---|
64 | ICU_END = 5, |
---|
65 | ICU_SPAN = 8, |
---|
66 | }; |
---|
67 | enum Xicu_registers { |
---|
68 | XICU_WTI_REG = 0, |
---|
69 | XICU_PTI_PER = 1, |
---|
70 | XICU_PTI_VAL = 2, |
---|
71 | XICU_PTI_ACK = 3, |
---|
72 | |
---|
73 | XICU_MSK_PTI = 4, |
---|
74 | XICU_MSK_PTI_ENABLE = 5, |
---|
75 | XICU_MSK_PTI_DISABLE = 6, |
---|
76 | XICU_PTI_ACTIVE = 6, |
---|
77 | |
---|
78 | XICU_MSK_HWI = 8, |
---|
79 | XICU_MSK_HWI_ENABLE = 9, |
---|
80 | XICU_MSK_HWI_DISABLE = 10, |
---|
81 | XICU_HWI_ACTIVE = 10, |
---|
82 | |
---|
83 | XICU_MSK_WTI = 12, |
---|
84 | XICU_MSK_WTI_ENABLE = 13, |
---|
85 | XICU_MSK_WTI_DISABLE = 14, |
---|
86 | XICU_WTI_ACTIVE = 14, |
---|
87 | |
---|
88 | XICU_PRIO = 15, |
---|
89 | }; |
---|
90 | |
---|
91 | #define XICU_REG(func, index) (((func)<<5)|(index)) |
---|
92 | |
---|
93 | /* TIMER */ |
---|
94 | enum TIMER_registers { |
---|
95 | TIMER_VALUE = 0, |
---|
96 | TIMER_MODE = 1, |
---|
97 | TIMER_PERIOD = 2, |
---|
98 | TIMER_RESETIRQ = 3, |
---|
99 | /**/ |
---|
100 | TIMER_SPAN = 4, |
---|
101 | }; |
---|
102 | |
---|
103 | /* TTY */ |
---|
104 | enum TTY_registers { |
---|
105 | TTY_WRITE = 0, |
---|
106 | TTY_STATUS = 1, |
---|
107 | TTY_READ = 2, |
---|
108 | TTY_CONFIG = 3, |
---|
109 | /**/ |
---|
110 | TTY_SPAN = 4, |
---|
111 | }; |
---|
112 | |
---|
113 | /* IOB */ |
---|
114 | enum IOB_registers { |
---|
115 | IOB_IOMMU_PTPR = 0, /* R/W : Page Table Pointer Register */ |
---|
116 | IOB_IOMMU_ACTIVE = 1, /* R/W : IOMMU activated if not 0 */ |
---|
117 | IOB_IOMMU_BVAR = 2, /* R : Bad Virtual Address (unmapped) */ |
---|
118 | IOB_IOMMU_ETR = 3, /* R : Error Type */ |
---|
119 | IOB_IOMMU_BAD_ID = 4, /* R : Faulty Peripheral Index */ |
---|
120 | IOB_INVAL_PTE = 5, /* W : Invalidate a PTE (virtual address) */ |
---|
121 | IOB_IT_ADDR_IOMMU_LO = 6, /* W/R : 32 LSB bits for IOMMU IT*/ |
---|
122 | IOB_IT_ADDR_IOMMU_HI = 7, /* W/R : 32 MSB bits for IOMMU IT */ |
---|
123 | IOB_IT_ADDRESS_BEGIN = 8, /* R/W : Peripheral IT address (2 32 bits registers) */ |
---|
124 | }; |
---|
125 | |
---|
126 | /* MWMR */ |
---|
127 | enum SoclibMwmrRegisters { |
---|
128 | MWMR_IOREG_MAX = 16, |
---|
129 | MWMR_RESET = MWMR_IOREG_MAX, |
---|
130 | MWMR_CONFIG_FIFO_WAY, |
---|
131 | MWMR_CONFIG_FIFO_NO, |
---|
132 | MWMR_CONFIG_STATUS_ADDR, |
---|
133 | MWMR_CONFIG_DEPTH, |
---|
134 | MWMR_CONFIG_BUFFER_ADDR, |
---|
135 | MWMR_CONFIG_RUNNING, |
---|
136 | MWMR_CONFIG_WIDTH, |
---|
137 | MWMR_FIFO_FILL_STATUS, |
---|
138 | }; |
---|
139 | |
---|
140 | enum SoclibMwmrWay { |
---|
141 | MWMR_TO_COPROC, |
---|
142 | MWMR_FROM_COPROC, |
---|
143 | }; |
---|
144 | |
---|
145 | #endif |
---|
146 | |
---|