1 /*
2  * Copyright (c) 2006-2021, RT-Thread Development Team
3  *
4  * SPDX-License-Identifier: Apache-2.0
5  *
6  * Change Logs:
7  * Date           Author       Notes
8  * 2021-01-30     lizhirui     first version
9  */
10 
11 #ifndef BOARD_H__
12 #define BOARD_H__
13 
14 #include "rtconfig.h"
15 #include "mem_layout.h"
16 #include "irq_num.h"
17 
18 /*
19  * K230 Memory Map
20  *
21  * See K230 Technical Reference Manual, chapter 1.5 Address Space mapping
22  */
23 #define SRAM_BASE_ADDR              (0x80200000UL)
24 #define SRAM_IO_SIZE                (0x00200000UL)
25 
26 #define KPU_BASE_ADDR               (0x80400000UL)
27 #define KPU_IO_SIZE                 (0x00000800UL)
28 
29 #define FFT_BASE_ADDR               (0x80400800UL)
30 #define FFT_IO_SIZE                 (0x00000400UL)
31 
32 #define AI2D_BASE_ADDR              (0x80400C00UL)
33 #define AI2D_IO_SIZE                (0x00000400UL)
34 
35 #define GSDMA_BASE_ADDR             (0x80800000UL)
36 #define GSDMA_IO_SIZE               (0x00004000UL)
37 
38 #define DMA_BASE_ADDR               (0x80804000UL)
39 #define DMA_IO_SIZE                 (0x00004000UL)
40 
41 #define DECOMP_BASE_ADDR            (0x80808000UL)
42 #define DECOMP_IO_SIZE              (0x00004000UL)
43 
44 #define NON_AI2D_BASE_ADDR          (0x8080C000UL)
45 #define NON_AI2D_IO_SIZE            (0x00004000UL)
46 
47 #define ISP_BASE_ADDR               (0x90000000UL)
48 #define ISP_IO_SIZE                 (0x00008000UL)
49 
50 #define DEWARP_BASE_ADDR            (0x90008000UL)
51 #define DEWARP_IO_SIZE              (0x00001000UL)
52 
53 #define CSI_BASE_ADDR               (0x90009000UL)
54 #define CSI_IO_SIZE                 (0x00002000UL)
55 
56 #define VPU_BASE_ADDR               (0x90400000UL)
57 #define VPU_IO_SIZE                 (0x00010000UL)
58 
59 /*2.5D*/
60 #define TAAH_GPU_BASE_ADDR          (0x90800000UL)
61 #define TAAH_GPU_IO_SIZE            (0x00040000UL)
62 
63 #define VO_BASE_ADDR                (0x90840000UL)
64 #define VO_IO_SIZE                  (0x00010000UL)
65 
66 #define DSI_BASE_ADDR               (0x90850000UL)
67 #define DSI_IO_SIZE                 (0x00001000UL)
68 
69 #define GPU_ENGINE_BASE_ADDR        (0x90A00000UL)
70 #define GPU_ENGINE_IO_SIZE          (0x00000800UL)
71 
72 #define PMU_BASE_ADDR               (0x91000000UL)
73 #define PMU_IO_SIZE                 (0x00000C00UL)
74 
75 #define RTC_BASE_ADDR               (0x91000C00UL)
76 #define RTC_IO_SIZE                 (0x00000400UL)
77 
78 #define CMU_BASE_ADDR               (0x91100000UL)
79 #define CMU_IO_SIZE                 (0x00001000UL)
80 
81 #define RMU_BASE_ADDR               (0x91101000UL)
82 #define RMU_IO_SIZE                 (0x00001000UL)
83 
84 #define BOOT_BASE_ADDR              (0x91102000UL)
85 #define BOOT_IO_SIZE                (0x00001000UL)
86 
87 #define PWR_BASE_ADDR               (0x91103000UL)
88 #define PWR_IO_SIZE                 (0x00001000UL)
89 
90 #define MAILBOX_BASE_ADDR           (0x91104000UL)
91 #define MAILBOX_IO_SIZE             (0x00001000UL)
92 
93 #define IOMUX_BASE_ADDR             (0x91105000UL)
94 #define IOMUX_IO_SIZE               (0x00000800UL)
95 
96 #define HW_TIMER_BASE_ADDR          (0x91105800UL)
97 #define HW_TIMER_IO_SIZE            (0x00000800UL)
98 
99 #define WDT0_BASE_ADDR              (0x91106000UL)
100 #define WDT0_IO_SIZE                (0x00000800UL)
101 
102 #define WDT1_BASE_ADDR              (0x91106800UL)
103 #define WDT1_IO_SIZE                (0x00000800UL)
104 
105 #define TS_BASE_ADDR                (0x91107000UL)
106 #define TS_IO_SIZE                  (0x00000800UL)
107 
108 #define HDI_BASE_ADDR               (0x91107800UL)
109 #define HDI_IO_SIZE                 (0x00000800UL)
110 
111 #define STC_BASE_ADDR               (0x91108000UL)
112 #define STC_IO_SIZE                 (0x00001000UL)
113 
114 #define BOOTROM_BASE_ADDR           (0x91200000UL)
115 #define BOOTROM_IO_SIZE             (0x00010000UL)
116 
117 #define SECURITY_BASE_ADDR          (0x91210000UL)
118 #define SECURITY_IO_SIZE            (0x00008000UL)
119 
120 #define UART0_BASE_ADDR             (0x91400000UL)
121 #define UART0_IO_SIZE               (0x00001000UL)
122 
123 #define UART1_BASE_ADDR             (0x91401000UL)
124 #define UART1_IO_SIZE               (0x00001000UL)
125 
126 #define UART2_BASE_ADDR             (0x91402000UL)
127 #define UART2_IO_SIZE               (0x00001000UL)
128 
129 #define UART3_BASE_ADDR             (0x91403000UL)
130 #define UART3_IO_SIZE               (0x00001000UL)
131 
132 #define UART4_BASE_ADDR             (0x91404000UL)
133 #define UART4_IO_SIZE               (0x00001000UL)
134 
135 #define I2C0_BASE_ADDR              (0x91405000UL)
136 #define I2C0_IO_SIZE                (0x00001000UL)
137 
138 #define I2C1_BASE_ADDR              (0x91406000UL)
139 #define I2C1_IO_SIZE                (0x00001000UL)
140 
141 #define I2C2_BASE_ADDR              (0x91407000UL)
142 #define I2C2_IO_SIZE                (0x00001000UL)
143 
144 #define I2C3_BASE_ADDR              (0x91408000UL)
145 #define I2C3_IO_SIZE                (0x00001000UL)
146 
147 #define I2C4_BASE_ADDR              (0x91409000UL)
148 #define I2C4_IO_SIZE                (0x00001000UL)
149 
150 #define PWM_BASE_ADDR               (0x9140A000UL)
151 #define PWM_IO_SIZE                 (0x00001000UL)
152 
153 #define GPIO0_BASE_ADDR             (0x9140B000UL)
154 #define GPIO0_IO_SIZE               (0x00001000UL)
155 
156 #define GPIO1_BASE_ADDR             (0x9140C000UL)
157 #define GPIO1_IO_SIZE               (0x00001000UL)
158 
159 #define ADC_BASE_ADDR               (0x9140D000UL)
160 #define ADC_IO_SIZE                 (0x00001000UL)
161 
162 #define CODEC_BASE_ADDR             (0x9140E000UL)
163 #define CODEC_IO_SIZE               (0x00001000UL)
164 
165 #define AUDIO_BASE_ADDR             (0x9140F000UL)
166 #define AUDIO_IO_SIZE               (0x00001000UL)
167 
168 #define USB2_BASE_ADDR              (0x91500000UL)
169 #define USB2_IO_SIZE                (0x00080000UL)
170 
171 #define SD_HC_BASE_ADDR             (0x91580000UL)
172 #define SD_HC_IO_SIZE               (0x00002000UL)
173 
174 #define SPI_QOPI_BASE_ADDR          (0x91582000UL)
175 #define SPI_QOPI_IO_SIZE            (0x00002000UL)
176 
177 #define SPI_OPI_BASE_ADDR           (0x91584000UL)
178 #define SPI_OPI_IO_SIZE             (0x00001000UL)
179 
180 #define HI_SYS_CONFIG_BASE_ADDR     (0x91585000UL)
181 #define HI_SYS_CONFIG_IO_SIZE       (0x00000400UL)
182 
183 #define DDRC_CONF_BASE_ADDR         (0x98000000UL)
184 #define DDRC_CONF_IO_SIZE           (0x02000000UL)
185 
186 #define SPI_XIP_FLASH_BASE_ADDR     (0xC0000000UL)
187 #define SPI_XIP_FLASH_IO_SIZE       (0x08000000UL)
188 
189 #define IO_SPACE_BASE_ADDR          (KPU_BASE_ADDR)
190 
191 #define TIMER_CLK_FREQ  (27000000)
192 
193 #endif // BOARD_H__
194