File tree Expand file tree Collapse file tree 13 files changed +1234
-10
lines changed
Documentation/platforms/risc-v/bl808
boards/risc-v/bl808/ox64/src Expand file tree Collapse file tree 13 files changed +1234
-10
lines changed Original file line number Diff line number Diff line change 48
48
EMAC No
49
49
GPADC Yes
50
50
GPIO Yes
51
- I2C No
51
+ I2C Yes
52
52
I2S No
53
53
PWM No
54
54
SPI Yes
Original file line number Diff line number Diff line change 54
54
/* D0 IRQs ******************************************************************/
55
55
56
56
#define BL808_IRQ_UART3 (RISCV_IRQ_SEXT + BL808_IRQ_NUM_BASE + 4)
57
+ #define BL808_IRQ_I2C2 (RISCV_IRQ_SEXT + BL808_IRQ_NUM_BASE + 5)
58
+ #define BL808_IRQ_I2C3 (RISCV_IRQ_SEXT + BL808_IRQ_NUM_BASE + 6)
57
59
#define BL808_IRQ_SPI1 (RISCV_IRQ_SEXT + BL808_IRQ_NUM_BASE + 7)
58
60
#define BL808_IRQ_D0_IPC (RISCV_IRQ_SEXT + BL808_IRQ_NUM_BASE + 38)
59
61
#define BL808_IRQ_TIMER1_CH0 (RISCV_IRQ_SEXT + BL808_IRQ_NUM_BASE + 61)
68
70
#define BL808_IRQ_UART0 (RISCV_IRQ_SEXT + BL808_IRQ_NUM_BASE + BL808_M0_IRQ_OFFSET + 28)
69
71
#define BL808_IRQ_UART1 (RISCV_IRQ_SEXT + BL808_IRQ_NUM_BASE + BL808_M0_IRQ_OFFSET + 29)
70
72
#define BL808_IRQ_UART2 (RISCV_IRQ_SEXT + BL808_IRQ_NUM_BASE + BL808_M0_IRQ_OFFSET + 30)
73
+ #define BL808_IRQ_I2C0 (RISCV_IRQ_SEXT + BL808_IRQ_NUM_BASE + BL808_M0_IRQ_OFFSET + 32)
71
74
#define BL808_IRQ_TIMER0_CH0 (RISCV_IRQ_SEXT + BL808_IRQ_NUM_BASE + BL808_M0_IRQ_OFFSET + 36)
72
75
#define BL808_IRQ_TIMER0_CH1 (RISCV_IRQ_SEXT + BL808_IRQ_NUM_BASE + BL808_M0_IRQ_OFFSET + 37)
73
76
#define BL808_IRQ_WDT0 (RISCV_IRQ_SEXT + BL808_IRQ_NUM_BASE + BL808_M0_IRQ_OFFSET + 38)
77
+ #define BL808_IRQ_I2C1 (RISCV_IRQ_SEXT + BL808_IRQ_NUM_BASE + BL808_M0_IRQ_OFFSET + 39)
74
78
75
79
#endif /* __ARCH_RISCV_INCLUDE_BL808_IRQ_H */
Original file line number Diff line number Diff line change @@ -106,6 +106,98 @@ config BL808_GPADC_SCAN_ORD11
106
106
107
107
endmenu
108
108
109
+ menuconfig BL808_I2C0
110
+ bool "I2C 0"
111
+ default n
112
+ select I2C
113
+ select I2C_DRIVER
114
+ select ARCH_HAVE_I2CRESET
115
+
116
+ if BL808_I2C0
117
+
118
+ comment "Refer to datasheet for valid pin assignments"
119
+
120
+ config BL808_I2C0_SCL
121
+ int "SCL Pin"
122
+ default 6
123
+ range 0 45
124
+
125
+ config BL808_I2C0_SDA
126
+ int "SDA Pin"
127
+ default 7
128
+ range 0 45
129
+
130
+ endif
131
+
132
+ menuconfig BL808_I2C1
133
+ bool "I2C 1"
134
+ default n
135
+ select I2C
136
+ select I2C_DRIVER
137
+ select ARCH_HAVE_I2CRESET
138
+
139
+ if BL808_I2C1
140
+
141
+ comment "Refer to datasheet for valid pin assignments"
142
+
143
+ config BL808_I2C1_SCL
144
+ int "SCL Pin"
145
+ default 6
146
+ range 0 45
147
+
148
+ config BL808_I2C1_SDA
149
+ int "SDA Pin"
150
+ default 7
151
+ range 0 45
152
+
153
+ endif
154
+
155
+ menuconfig BL808_I2C2
156
+ bool "I2C 2"
157
+ default n
158
+ select I2C
159
+ select I2C_DRIVER
160
+ select ARCH_HAVE_I2CRESET
161
+
162
+ if BL808_I2C2
163
+
164
+ comment "Refer to datasheet for valid pin assignments"
165
+
166
+ config BL808_I2C2_SCL
167
+ int "SCL Pin"
168
+ default 6
169
+ range 0 45
170
+
171
+ config BL808_I2C2_SDA
172
+ int "SDA Pin"
173
+ default 7
174
+ range 0 45
175
+
176
+ endif
177
+
178
+ menuconfig BL808_I2C3
179
+ bool "I2C 3"
180
+ default n
181
+ select I2C
182
+ select I2C_DRIVER
183
+ select ARCH_HAVE_I2CRESET
184
+
185
+ if BL808_I2C3
186
+
187
+ comment "Refer to datasheet for valid pin assignments"
188
+
189
+ config BL808_I2C3_SCL
190
+ int "SCL Pin"
191
+ default 6
192
+ range 0 45
193
+
194
+ config BL808_I2C3_SDA
195
+ int "SDA Pin"
196
+ default 7
197
+ range 0 45
198
+
199
+ endif
200
+
109
201
config BL808_UART0
110
202
bool "UART 0"
111
203
default n
Original file line number Diff line number Diff line change @@ -31,3 +31,4 @@ CHIP_CSRCS = bl808_start.c bl808_irq_dispatch.c bl808_irq.c
31
31
CHIP_CSRCS += bl808_timerisr.c bl808_allocateheap.c
32
32
CHIP_CSRCS += bl808_gpio.c bl808_mm_init.c bl808_pgalloc.c bl808_serial.c
33
33
CHIP_CSRCS += bl808_gpadc.c bl808_spi.c bl808_timer.c bl808_wdt.c
34
+ CHIP_CSRCS += bl808_i2c.c
Original file line number Diff line number Diff line change 58
58
59
59
#define GPIO_MODE_SHIFT (10) /* Bit 10: Port Mode */
60
60
#define GPIO_MODE_MASK (1 << GPIO_MODE_SHIFT)
61
- # define GPIO_INPUT (1 << GPIO_MODE_SHIFT) /* Input Enable */
62
- # define GPIO_OUTPUT (0 << GPIO_MODE_SHIFT) /* Output Enable */
61
+ #define GPIO_INPUT (1 << GPIO_MODE_SHIFT) /* Input Enable */
62
+ #define GPIO_OUTPUT (0 << GPIO_MODE_SHIFT) /* Output Enable */
63
63
64
64
/* Input/Output pull-ups/downs:
65
65
*
116
116
#define GPIO_FUNC_SDH (0 << GPIO_FUNC_SHIFT) /* SDH */
117
117
#define GPIO_FUNC_SPI0 (1 << GPIO_FUNC_SHIFT) /* SPI0 */
118
118
#define GPIO_FUNC_FLASH (2 << GPIO_FUNC_SHIFT) /* Flash */
119
+ #define GPIO_FUNC_I2C0 (5 << GPIO_FUNC_SHIFT) /* I2C0 */
119
120
#define GPIO_FUNC_I2C1 (6 << GPIO_FUNC_SHIFT) /* I2C1 */
120
121
#define GPIO_FUNC_UART (7 << GPIO_FUNC_SHIFT) /* UART */
121
122
#define GPIO_FUNC_CAM (9 << GPIO_FUNC_SHIFT) /* CSI */
122
123
#define GPIO_FUNC_ANA (10 << GPIO_FUNC_SHIFT) /* Analog */
123
124
#define GPIO_FUNC_SWGPIO (11 << GPIO_FUNC_SHIFT) /* Software GPIO */
124
125
#define GPIO_FUNC_PWM0 (16 << GPIO_FUNC_SHIFT) /* PWM0 */
125
126
#define GPIO_FUNC_SPI1 (18 << GPIO_FUNC_SHIFT) /* SPI1 */
127
+ #define GPIO_FUNC_I2C2 (19 << GPIO_FUNC_SHIFT) /* I2C2 */
128
+ #define GPIO_FUNC_I2C3 (20 << GPIO_FUNC_SHIFT) /* I2C3 */
126
129
#define GPIO_FUNC_JTAG_D0 (27 << GPIO_FUNC_SHIFT) /* JTAG */
127
130
128
131
/****************************************************************************
You can’t perform that action at this time.
0 commit comments