]> git.sur5r.net Git - freertos/blob - FreeRTOS/Demo/RISC-V_RV32_SiFive_HiFive1_FreedomStudio/bsp/metal-platform.h
4ecd3e3365e3056ab5690cd1295b85bf928ebe7b
[freertos] / FreeRTOS / Demo / RISC-V_RV32_SiFive_HiFive1_FreedomStudio / bsp / metal-platform.h
1 /* Copyright 2019 SiFive, Inc */
2 /* SPDX-License-Identifier: Apache-2.0 */
3 /* ----------------------------------- */
4 /* ----------------------------------- */
5
6 #ifndef SIFIVE_HIFIVE1_REVB____METAL_PLATFORM_H
7 #define SIFIVE_HIFIVE1_REVB____METAL_PLATFORM_H
8
9 /* From clock@0 */
10 #define METAL_FIXED_CLOCK_0_CLOCK_FREQUENCY 16000000UL
11
12 /* From clock@2 */
13 #define METAL_FIXED_CLOCK_2_CLOCK_FREQUENCY 72000000UL
14
15 /* From clock@5 */
16 #define METAL_FIXED_CLOCK_5_CLOCK_FREQUENCY 32000000UL
17
18 #define METAL_FIXED_CLOCK
19
20 /* From clint@2000000 */
21 #define METAL_RISCV_CLINT0_2000000_BASE_ADDRESS 33554432UL
22 #define METAL_RISCV_CLINT0_0_BASE_ADDRESS 33554432UL
23 #define METAL_RISCV_CLINT0_2000000_SIZE 65536UL
24 #define METAL_RISCV_CLINT0_0_SIZE 65536UL
25
26 #define METAL_RISCV_CLINT0
27 #define METAL_RISCV_CLINT0_MSIP_BASE 0UL
28 #define METAL_RISCV_CLINT0_MTIMECMP_BASE 16384UL
29 #define METAL_RISCV_CLINT0_MTIME 49144UL
30
31 /* From interrupt_controller@c000000 */
32 #define METAL_RISCV_PLIC0_C000000_BASE_ADDRESS 201326592UL
33 #define METAL_RISCV_PLIC0_0_BASE_ADDRESS 201326592UL
34 #define METAL_RISCV_PLIC0_C000000_SIZE 67108864UL
35 #define METAL_RISCV_PLIC0_0_SIZE 67108864UL
36 #define METAL_RISCV_PLIC0_C000000_RISCV_MAX_PRIORITY 7UL
37 #define METAL_RISCV_PLIC0_0_RISCV_MAX_PRIORITY 7UL
38 #define METAL_RISCV_PLIC0_C000000_RISCV_NDEV 27UL
39 #define METAL_RISCV_PLIC0_0_RISCV_NDEV 27UL
40
41 #define METAL_RISCV_PLIC0
42 #define METAL_RISCV_PLIC0_PRIORITY_BASE 0UL
43 #define METAL_RISCV_PLIC0_PENDING_BASE 4096UL
44 #define METAL_RISCV_PLIC0_ENABLE_BASE 8192UL
45 #define METAL_RISCV_PLIC0_THRESHOLD 2097152UL
46 #define METAL_RISCV_PLIC0_CLAIM 2097156UL
47
48 /* From aon@10000000 */
49 #define METAL_SIFIVE_AON0_10000000_BASE_ADDRESS 268435456UL
50 #define METAL_SIFIVE_AON0_0_BASE_ADDRESS 268435456UL
51 #define METAL_SIFIVE_AON0_10000000_SIZE 32768UL
52 #define METAL_SIFIVE_AON0_0_SIZE 32768UL
53
54 #define METAL_SIFIVE_AON0
55 #define METAL_SIFIVE_AON0_WDOGCFG 0UL
56 #define METAL_SIFIVE_AON0_WDOGCOUNT 8UL
57 #define METAL_SIFIVE_AON0_WDOGS 16UL
58 #define METAL_SIFIVE_AON0_WDOGFEED 24UL
59 #define METAL_SIFIVE_AON0_WDOGKEY 28UL
60 #define METAL_SIFIVE_AON0_WDOGCMP 32UL
61 #define METAL_SIFIVE_AON0_RTCCFG 64UL
62 #define METAL_SIFIVE_AON0_RTCLO 72UL
63 #define METAL_SIFIVE_AON0_RTCHI 72UL
64 #define METAL_SIFIVE_AON0_RTCS 80UL
65 #define METAL_SIFIVE_AON0_RTCCMP 96UL
66 #define METAL_SIFIVE_AON0_LFROSCCFG 112UL
67 #define METAL_SIFIVE_AON0_BACKUP0 128UL
68 #define METAL_SIFIVE_AON0_BACKUP1 132UL
69 #define METAL_SIFIVE_AON0_BACKUP2 136UL
70 #define METAL_SIFIVE_AON0_BACKUP3 140UL
71 #define METAL_SIFIVE_AON0_BACKUP4 144UL
72 #define METAL_SIFIVE_AON0_BACKUP5 148UL
73 #define METAL_SIFIVE_AON0_BACKUP6 152UL
74 #define METAL_SIFIVE_AON0_BACKUP7 152UL
75 #define METAL_SIFIVE_AON0_BACKUP8 160UL
76 #define METAL_SIFIVE_AON0_BACKUP9 164UL
77 #define METAL_SIFIVE_AON0_BACKUP10 168UL
78 #define METAL_SIFIVE_AON0_BACKUP11 172UL
79 #define METAL_SIFIVE_AON0_BACKUP12 176UL
80 #define METAL_SIFIVE_AON0_BACKUP13 180UL
81 #define METAL_SIFIVE_AON0_BACKUP14 184UL
82 #define METAL_SIFIVE_AON0_BACKUP15 188UL
83 #define METAL_SIFIVE_AON0_BACKUP16 192UL
84 #define METAL_SIFIVE_AON0_BACKUP17 196UL
85 #define METAL_SIFIVE_AON0_BACKUP18 200UL
86 #define METAL_SIFIVE_AON0_BACKUP19 204UL
87 #define METAL_SIFIVE_AON0_BACKUP20 208UL
88 #define METAL_SIFIVE_AON0_BACKUP21 212UL
89 #define METAL_SIFIVE_AON0_BACKUP22 216UL
90 #define METAL_SIFIVE_AON0_BACKUP23 220UL
91 #define METAL_SIFIVE_AON0_BACKUP24 224UL
92 #define METAL_SIFIVE_AON0_BACKUP25 228UL
93 #define METAL_SIFIVE_AON0_BACKUP26 232UL
94 #define METAL_SIFIVE_AON0_BACKUP27 236UL
95 #define METAL_SIFIVE_AON0_BACKUP28 240UL
96 #define METAL_SIFIVE_AON0_BACKUP29 244UL
97 #define METAL_SIFIVE_AON0_BACKUP30 248UL
98 #define METAL_SIFIVE_AON0_BACKUP31 252UL
99 #define METAL_SIFIVE_AON0_PMU_WAKEUP_BASE 256UL
100 #define METAL_SIFIVE_AON0_PWM_SLEEP_BASE 288UL
101 #define METAL_SIFIVE_AON0_PMUIE 320UL
102 #define METAL_SIFIVE_AON0_PMUCAUSE 324UL
103 #define METAL_SIFIVE_AON0_PMUSLEEP 328UL
104 #define METAL_SIFIVE_AON0_PMUKEY 332UL
105
106 /* From clock@3 */
107
108 #define METAL_SIFIVE_FE310_G000_HFROSC
109
110 /* From clock@1 */
111
112 #define METAL_SIFIVE_FE310_G000_HFXOSC
113
114 /* From prci@10008000 */
115 #define METAL_SIFIVE_FE310_G000_PRCI_10008000_BASE_ADDRESS 268468224UL
116 #define METAL_SIFIVE_FE310_G000_PRCI_0_BASE_ADDRESS 268468224UL
117 #define METAL_SIFIVE_FE310_G000_PRCI_10008000_SIZE 32768UL
118 #define METAL_SIFIVE_FE310_G000_PRCI_0_SIZE 32768UL
119
120 #define METAL_SIFIVE_FE310_G000_PRCI
121 #define METAL_SIFIVE_FE310_G000_PRCI_HFROSCCFG 0UL
122 #define METAL_SIFIVE_FE310_G000_PRCI_HFXOSCCFG 4UL
123 #define METAL_SIFIVE_FE310_G000_PRCI_PLLCFG 8UL
124 #define METAL_SIFIVE_FE310_G000_PRCI_PLLOUTDIV 12UL
125
126 /* From clock@4 */
127 #define METAL_SIFIVE_FE310_G000_PLL_4_CLOCK_FREQUENCY 16000000UL
128
129 #define METAL_SIFIVE_FE310_G000_PLL
130
131 /* From gpio@10012000 */
132 #define METAL_SIFIVE_GPIO0_10012000_BASE_ADDRESS 268509184UL
133 #define METAL_SIFIVE_GPIO0_0_BASE_ADDRESS 268509184UL
134 #define METAL_SIFIVE_GPIO0_10012000_SIZE 4096UL
135 #define METAL_SIFIVE_GPIO0_0_SIZE 4096UL
136
137 #define METAL_SIFIVE_GPIO0
138 #define METAL_SIFIVE_GPIO0_VALUE 0UL
139 #define METAL_SIFIVE_GPIO0_INPUT_EN 4UL
140 #define METAL_SIFIVE_GPIO0_OUTPUT_EN 8UL
141 #define METAL_SIFIVE_GPIO0_PORT 12UL
142 #define METAL_SIFIVE_GPIO0_PUE 16UL
143 #define METAL_SIFIVE_GPIO0_DS 20UL
144 #define METAL_SIFIVE_GPIO0_RISE_IE 24UL
145 #define METAL_SIFIVE_GPIO0_RISE_IP 28UL
146 #define METAL_SIFIVE_GPIO0_FALL_IE 32UL
147 #define METAL_SIFIVE_GPIO0_FALL_IP 36UL
148 #define METAL_SIFIVE_GPIO0_HIGH_IE 40UL
149 #define METAL_SIFIVE_GPIO0_HIGH_IP 44UL
150 #define METAL_SIFIVE_GPIO0_LOW_IE 48UL
151 #define METAL_SIFIVE_GPIO0_LOW_IP 52UL
152 #define METAL_SIFIVE_GPIO0_IOF_EN 56UL
153 #define METAL_SIFIVE_GPIO0_IOF_SEL 60UL
154 #define METAL_SIFIVE_GPIO0_OUT_XOR 64UL
155
156 /* From led@0red */
157
158 /* From led@0green */
159
160 /* From led@0blue */
161
162 #define METAL_SIFIVE_GPIO_LEDS
163
164 /* From i2c@10016000 */
165 #define METAL_SIFIVE_I2C0_10016000_BASE_ADDRESS 268525568UL
166 #define METAL_SIFIVE_I2C0_0_BASE_ADDRESS 268525568UL
167 #define METAL_SIFIVE_I2C0_10016000_SIZE 4096UL
168 #define METAL_SIFIVE_I2C0_0_SIZE 4096UL
169
170 #define METAL_SIFIVE_I2C0
171 #define METAL_SIFIVE_I2C0_PRESCALE_LOW 0UL
172 #define METAL_SIFIVE_I2C0_PRESCALE_HIGH 4UL
173 #define METAL_SIFIVE_I2C0_CONTROL 8UL
174 #define METAL_SIFIVE_I2C0_TRANSMIT 12UL
175 #define METAL_SIFIVE_I2C0_RECEIVE 12UL
176 #define METAL_SIFIVE_I2C0_COMMAND 16UL
177 #define METAL_SIFIVE_I2C0_STATUS 16UL
178
179 /* From local_external_interrupts_0 */
180
181 #define METAL_SIFIVE_LOCAL_EXTERNAL_INTERRUPTS0
182
183 /* From pwm@10015000 */
184 #define METAL_SIFIVE_PWM0_10015000_BASE_ADDRESS 268521472UL
185 #define METAL_SIFIVE_PWM0_0_BASE_ADDRESS 268521472UL
186 #define METAL_SIFIVE_PWM0_10015000_SIZE 4096UL
187 #define METAL_SIFIVE_PWM0_0_SIZE 4096UL
188
189 #define METAL_SIFIVE_PWM0
190 #define METAL_SIFIVE_PWM0_PWMCFG 0UL
191 #define METAL_SIFIVE_PWM0_PWMCOUNT 8UL
192 #define METAL_SIFIVE_PWM0_PWMS 16UL
193 #define METAL_SIFIVE_PWM0_PWMCMP0 32UL
194 #define METAL_SIFIVE_PWM0_PWMCMP1 36UL
195 #define METAL_SIFIVE_PWM0_PWMCMP2 40UL
196 #define METAL_SIFIVE_PWM0_PWMCMP3 44UL
197
198 /* From spi@10014000 */
199 #define METAL_SIFIVE_SPI0_10014000_BASE_ADDRESS 268517376UL
200 #define METAL_SIFIVE_SPI0_0_BASE_ADDRESS 268517376UL
201 #define METAL_SIFIVE_SPI0_10014000_SIZE 4096UL
202 #define METAL_SIFIVE_SPI0_0_SIZE 4096UL
203
204 #define METAL_SIFIVE_SPI0
205 #define METAL_SIFIVE_SPI0_SCKDIV 0UL
206 #define METAL_SIFIVE_SPI0_SCKMODE 4UL
207 #define METAL_SIFIVE_SPI0_CSID 16UL
208 #define METAL_SIFIVE_SPI0_CSDEF 20UL
209 #define METAL_SIFIVE_SPI0_CSMODE 24UL
210 #define METAL_SIFIVE_SPI0_DELAY0 40UL
211 #define METAL_SIFIVE_SPI0_DELAY1 44UL
212 #define METAL_SIFIVE_SPI0_FMT 64UL
213 #define METAL_SIFIVE_SPI0_TXDATA 72UL
214 #define METAL_SIFIVE_SPI0_RXDATA 76UL
215 #define METAL_SIFIVE_SPI0_TXMARK 80UL
216 #define METAL_SIFIVE_SPI0_RXMARK 84UL
217 #define METAL_SIFIVE_SPI0_FCTRL 96UL
218 #define METAL_SIFIVE_SPI0_FFMT 100UL
219 #define METAL_SIFIVE_SPI0_IE 112UL
220 #define METAL_SIFIVE_SPI0_IP 116UL
221
222 /* From serial@10013000 */
223 #define METAL_SIFIVE_UART0_10013000_BASE_ADDRESS 268513280UL
224 #define METAL_SIFIVE_UART0_0_BASE_ADDRESS 268513280UL
225 #define METAL_SIFIVE_UART0_10013000_SIZE 4096UL
226 #define METAL_SIFIVE_UART0_0_SIZE 4096UL
227
228 #define METAL_SIFIVE_UART0
229 #define METAL_SIFIVE_UART0_TXDATA 0UL
230 #define METAL_SIFIVE_UART0_RXDATA 4UL
231 #define METAL_SIFIVE_UART0_TXCTRL 8UL
232 #define METAL_SIFIVE_UART0_RXCTRL 12UL
233 #define METAL_SIFIVE_UART0_IE 16UL
234 #define METAL_SIFIVE_UART0_IP 20UL
235 #define METAL_SIFIVE_UART0_DIV 24UL
236
237 #endif /* SIFIVE_HIFIVE1_REVB____METAL_PLATFORM_H*/