Skip to content

Commit 5e03e07

Browse files
sakumisuRbb666
authored andcommitted
update(cherryusb): update to v1.5.1
Signed-off-by: sakumisu <[email protected]>
1 parent 53fcd9d commit 5e03e07

34 files changed

+2192
-697
lines changed

components/drivers/usb/cherryusb/Kconfig

Lines changed: 98 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ if CHERRYUSB
5252
bool "musb_sunxi"
5353
config CHERRYUSB_DEVICE_MUSB_BK
5454
bool "musb_bk"
55+
config CHERRYUSB_DEVICE_MUSB_SIFLI
56+
bool "musb_sifli"
5557
config CHERRYUSB_DEVICE_MUSB_CUSTOM
5658
bool "musb_custom"
5759
config CHERRYUSB_DEVICE_CHIPIDEA_MCX
@@ -123,7 +125,6 @@ if CHERRYUSB
123125
prompt "Enable usb mtp device, it is commercial charge"
124126
default n
125127

126-
127128
config CHERRYUSB_DEVICE_ADB
128129
bool
129130
prompt "Enable usb adb device"
@@ -134,45 +135,99 @@ if CHERRYUSB
134135
prompt "Enable usb dfu device"
135136
default n
136137

138+
config USBDEV_REQUEST_BUFFER_LEN
139+
int
140+
prompt "Set device control transfer max buffer size"
141+
default 512
142+
143+
config USBDEV_MSC_MAX_BUFSIZE
144+
int
145+
prompt "Set usb msc device max buffer size"
146+
default 512
147+
help
148+
Set the maximum buffer size for usb msc device, it is used to transfer data.
149+
you can change it to a larger value if you need larger speed but must be a power of blocksize.
150+
151+
config USBDEV_RNDIS_USING_LWIP
152+
bool
153+
prompt "Enable usb rndis device with lwip for lan"
154+
default n
155+
156+
config USBDEV_CDC_ECM_USING_LWIP
157+
bool
158+
prompt "Enable usb cdc ecm device with lwip for lan"
159+
default n
160+
137161
choice
138-
prompt "Select usb device template"
162+
prompt "Select usb device template, please select class driver first"
139163
default CHERRYUSB_DEVICE_TEMPLATE_NONE
140164
config CHERRYUSB_DEVICE_TEMPLATE_NONE
141-
bool "none (Implement it yourself)"
165+
bool
166+
prompt "none (Implement it yourself)"
142167
config CHERRYUSB_DEVICE_TEMPLATE_CDC_ACM
143-
bool "cdc_acm"
168+
bool
169+
prompt "cdc_acm"
170+
depends on CHERRYUSB_DEVICE_CDC_ACM
144171
config CHERRYUSB_DEVICE_TEMPLATE_MSC
145-
bool "msc"
172+
bool
173+
prompt "msc_ram"
174+
depends on CHERRYUSB_DEVICE_MSC
146175
config CHERRYUSB_DEVICE_TEMPLATE_HID_KEYBOARD
147-
bool "hid_keyboard"
176+
bool
177+
prompt "hid_keyboard"
178+
depends on CHERRYUSB_DEVICE_HID
148179
config CHERRYUSB_DEVICE_TEMPLATE_HID_MOUSE
149-
bool "hid_mouse"
180+
bool
181+
prompt "hid_mouse"
182+
depends on CHERRYUSB_DEVICE_HID
150183
config CHERRYUSB_DEVICE_TEMPLATE_HID_CUSTOM
151-
bool "hid_custom"
184+
bool
185+
prompt "hid_custom"
186+
depends on CHERRYUSB_DEVICE_HID
152187
config CHERRYUSB_DEVICE_TEMPLATE_VIDEO
153-
bool "video"
188+
bool
189+
prompt "video"
190+
depends on CHERRYUSB_DEVICE_VIDEO
154191
config CHERRYUSB_DEVICE_TEMPLATE_AUDIO_V1_MIC_SPEAKER
155-
bool "audio_v1_mic_speaker_multichan"
192+
bool
193+
prompt "audio_v1_mic_speaker_multichan"
194+
depends on CHERRYUSB_DEVICE_AUDIO
156195
config CHERRYUSB_DEVICE_TEMPLATE_AUDIO_V2_MIC_SPEAKER
157-
bool "audio_v2_mic_speaker_multichan"
196+
bool
197+
prompt "audio_v2_mic_speaker_multichan"
198+
depends on CHERRYUSB_DEVICE_AUDIO
158199
config CHERRYUSB_DEVICE_TEMPLATE_CDC_RNDIS
159-
bool "cdc_rndis"
200+
bool
201+
prompt "cdc_rndis"
202+
depends on CHERRYUSB_DEVICE_CDC_RNDIS
160203
config CHERRYUSB_DEVICE_TEMPLATE_CDC_ECM
161-
bool "cdc_ecm"
204+
bool
205+
prompt "cdc_ecm"
206+
depends on CHERRYUSB_DEVICE_CDC_ECM
162207
config CHERRYUSB_DEVICE_TEMPLATE_CDC_NCM
163-
bool "cdc_ncm"
208+
bool
209+
prompt "cdc_ncm"
210+
depends on CHERRYUSB_DEVICE_CDC_NCM
164211
config CHERRYUSB_DEVICE_TEMPLATE_CDC_ACM_MSC
165-
bool "cdc_acm_msc"
212+
bool
213+
prompt "cdc_acm_msc"
214+
depends on CHERRYUSB_DEVICE_CDC_ACM && CHERRYUSB_DEVICE_MSC
166215
config CHERRYUSB_DEVICE_TEMPLATE_CDC_ACM_MSC_HID
167-
bool "cdc_acm_msc_hid"
216+
bool
217+
prompt "cdc_acm_msc_hid"
218+
depends on CHERRYUSB_DEVICE_CDC_ACM && CHERRYUSB_DEVICE_MSC && CHERRYUSB_DEVICE_HID
168219
config CHERRYUSB_DEVICE_TEMPLATE_WINUSBV1
169-
bool "winusbv1"
220+
bool
221+
prompt "winusbv1"
170222
config CHERRYUSB_DEVICE_TEMPLATE_WINUSBV2_CDC
171-
bool "winusbv2_cdc"
223+
bool
224+
prompt "winusbv2_cdc"
225+
depends on CHERRYUSB_DEVICE_CDC_ACM
172226
config CHERRYUSB_DEVICE_TEMPLATE_WINUSBV2_HID
173-
bool "winusbv2_hid"
227+
bool
228+
prompt "winusbv2_hid"
229+
depends on CHERRYUSB_DEVICE_HID
174230
endchoice
175-
176231
endif
177232

178233
menuconfig CHERRYUSB_HOST
@@ -217,6 +272,8 @@ if CHERRYUSB
217272
bool "musb_sunxi"
218273
config CHERRYUSB_HOST_MUSB_BK
219274
bool "musb_bk"
275+
config CHERRYUSB_HOST_MUSB_SIFLI
276+
bool "musb_sifli"
220277
config CHERRYUSB_HOST_MUSB_CUSTOM
221278
bool "musb_custom"
222279
config CHERRYUSB_HOST_PUSB2
@@ -335,12 +392,27 @@ if CHERRYUSB
335392
config USBHOST_PLATFORM_RTL8152
336393
bool
337394

338-
config CHERRYUSB_HOST_TEMPLATE
339-
bool
340-
prompt "Use usb host template"
341-
default n
395+
config USBHOST_PSC_PRIO
396+
int
397+
prompt "Set hubport change thread priority, 0 is the max priority"
398+
default 0
342399

343-
if CHERRYUSB_HOST_TEMPLATE
400+
config USBHOST_PSC_STACKSIZE
401+
int
402+
prompt "Set hubport change thread stacksize"
403+
default 4096
404+
405+
config USBHOST_REQUEST_BUFFER_LEN
406+
int
407+
prompt "Set host control transfer max buffer size"
408+
default 512
409+
410+
config USBHOST_CONTROL_TRANSFER_TIMEOUT
411+
int
412+
prompt "Set host control transfer timeout, unit is ms"
413+
default 500
414+
415+
menu "Select USB host template, please select class driver first"
344416
config TEST_USBH_CDC_ACM
345417
int
346418
prompt "demo for test cdc acm"
@@ -356,7 +428,6 @@ if CHERRYUSB
356428
prompt "demo for test msc"
357429
default 0
358430
depends on CHERRYUSB_HOST_MSC
359-
endif
431+
endmenu
360432
endif
361-
362433
endif

components/drivers/usb/cherryusb/Kconfig.rtt

Lines changed: 118 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ if RT_USING_CHERRYUSB
5252
bool "musb_sunxi"
5353
config RT_CHERRYUSB_DEVICE_MUSB_BK
5454
bool "musb_bk"
55+
config RT_CHERRYUSB_DEVICE_MUSB_SIFLI
56+
bool "musb_sifli"
5557
config RT_CHERRYUSB_DEVICE_MUSB_CUSTOM
5658
bool "musb_custom"
5759
config RT_CHERRYUSB_DEVICE_CHIPIDEA_MCX
@@ -140,49 +142,110 @@ if RT_USING_CHERRYUSB
140142
prompt "Enable chardev for cdc acm device"
141143
default n
142144

145+
config CONFIG_USBDEV_REQUEST_BUFFER_LEN
146+
int
147+
prompt "Set device control transfer max buffer size"
148+
default 512
149+
150+
config CONFIG_USBDEV_MSC_MAX_BUFSIZE
151+
int
152+
prompt "Set usb msc device max buffer size"
153+
default 512
154+
help
155+
Set the maximum buffer size for usb msc device, it is used to transfer data.
156+
you can change it to a larger value if you need larger speed but must be a power of blocksize.
157+
158+
config CONFIG_USBDEV_RNDIS_USING_LWIP
159+
bool
160+
prompt "Enable usb rndis device with lwip for lan"
161+
default n
162+
163+
config CONFIG_USBDEV_CDC_ECM_USING_LWIP
164+
bool
165+
prompt "Enable usb cdc ecm device with lwip for lan"
166+
default n
167+
143168
choice
144-
prompt "Select usb device template"
169+
prompt "Select usb device template, please select class driver first"
145170
default RT_CHERRYUSB_DEVICE_TEMPLATE_NONE
146171
config RT_CHERRYUSB_DEVICE_TEMPLATE_NONE
147-
bool "none (Implement it yourself)"
172+
bool
173+
prompt "none (Implement it yourself)"
148174
config RT_CHERRYUSB_DEVICE_TEMPLATE_CDC_ACM
149-
bool "cdc_acm"
175+
bool
176+
prompt "cdc_acm"
177+
depends on RT_CHERRYUSB_DEVICE_CDC_ACM
150178
config RT_CHERRYUSB_DEVICE_TEMPLATE_MSC
151-
bool "msc_ram"
179+
bool
180+
prompt "msc_ram"
181+
depends on RT_CHERRYUSB_DEVICE_MSC
152182
config RT_CHERRYUSB_DEVICE_TEMPLATE_MSC_BLKDEV
153-
bool "msc_blkdev"
183+
bool
184+
prompt "msc_blkdev"
185+
depends on RT_CHERRYUSB_DEVICE_MSC
154186
config RT_CHERRYUSB_DEVICE_TEMPLATE_HID_KEYBOARD
155-
bool "hid_keyboard"
187+
bool
188+
prompt "hid_keyboard"
189+
depends on RT_CHERRYUSB_DEVICE_HID
156190
config RT_CHERRYUSB_DEVICE_TEMPLATE_HID_MOUSE
157-
bool "hid_mouse"
191+
bool
192+
prompt "hid_mouse"
193+
depends on RT_CHERRYUSB_DEVICE_HID
158194
config RT_CHERRYUSB_DEVICE_TEMPLATE_HID_CUSTOM
159-
bool "hid_custom"
195+
bool
196+
prompt "hid_custom"
197+
depends on RT_CHERRYUSB_DEVICE_HID
160198
config RT_CHERRYUSB_DEVICE_TEMPLATE_VIDEO
161-
bool "video"
199+
bool
200+
prompt "video"
201+
depends on RT_CHERRYUSB_DEVICE_VIDEO
162202
config RT_CHERRYUSB_DEVICE_TEMPLATE_AUDIO_V1_MIC_SPEAKER
163-
bool "audio_v1_mic_speaker_multichan"
203+
bool
204+
prompt "audio_v1_mic_speaker_multichan"
205+
depends on RT_CHERRYUSB_DEVICE_AUDIO
164206
config RT_CHERRYUSB_DEVICE_TEMPLATE_AUDIO_V2_MIC_SPEAKER
165-
bool "audio_v2_mic_speaker_multichan"
207+
bool
208+
prompt "audio_v2_mic_speaker_multichan"
209+
depends on RT_CHERRYUSB_DEVICE_AUDIO
166210
config RT_CHERRYUSB_DEVICE_TEMPLATE_CDC_RNDIS
167-
bool "cdc_rndis"
211+
bool
212+
prompt "cdc_rndis"
213+
depends on RT_CHERRYUSB_DEVICE_CDC_RNDIS
168214
config RT_CHERRYUSB_DEVICE_TEMPLATE_CDC_ECM
169-
bool "cdc_ecm"
215+
bool
216+
prompt "cdc_ecm"
217+
depends on RT_CHERRYUSB_DEVICE_CDC_ECM
170218
config RT_CHERRYUSB_DEVICE_TEMPLATE_CDC_NCM
171-
bool "cdc_ncm"
219+
bool
220+
prompt "cdc_ncm"
221+
depends on RT_CHERRYUSB_DEVICE_CDC_NCM
172222
config RT_CHERRYUSB_DEVICE_TEMPLATE_CDC_ACM_MSC
173-
bool "cdc_acm_msc"
223+
bool
224+
prompt "cdc_acm_msc"
225+
depends on RT_CHERRYUSB_DEVICE_CDC_ACM && RT_CHERRYUSB_DEVICE_MSC
174226
config RT_CHERRYUSB_DEVICE_TEMPLATE_CDC_ACM_MSC_HID
175-
bool "cdc_acm_msc_hid"
227+
bool
228+
prompt "cdc_acm_msc_hid"
229+
depends on RT_CHERRYUSB_DEVICE_CDC_ACM && RT_CHERRYUSB_DEVICE_MSC && RT_CHERRYUSB_DEVICE_HID
176230
config RT_CHERRYUSB_DEVICE_TEMPLATE_WINUSBV1
177-
bool "winusbv1"
231+
bool
232+
prompt "winusbv1"
178233
config RT_CHERRYUSB_DEVICE_TEMPLATE_WINUSBV2_CDC
179-
bool "winusbv2_cdc"
234+
bool
235+
prompt "winusbv2_cdc"
236+
depends on RT_CHERRYUSB_DEVICE_CDC_ACM
180237
config RT_CHERRYUSB_DEVICE_TEMPLATE_WINUSBV2_HID
181-
bool "winusbv2_hid"
238+
bool
239+
prompt "winusbv2_hid"
240+
depends on RT_CHERRYUSB_DEVICE_HID
182241
config RT_CHERRYUSB_DEVICE_TEMPLATE_ADB
183-
bool "adb"
242+
bool
243+
prompt "adb"
244+
depends on RT_CHERRYUSB_DEVICE_ADB
184245
config RT_CHERRYUSB_DEVICE_TEMPLATE_CDC_ACM_CHARDEV
185-
bool "cdc_acm_chardev"
246+
bool
247+
prompt "cdc_acm_chardev"
248+
depends on RT_CHERRYUSB_DEVICE_CDC_ACM_CHARDEV
186249
endchoice
187250

188251
config CONFIG_USBDEV_MSC_BLOCK_DEV_NAME
@@ -234,6 +297,8 @@ if RT_USING_CHERRYUSB
234297
bool "musb_sunxi"
235298
config RT_CHERRYUSB_HOST_MUSB_BK
236299
bool "musb_bk"
300+
config RT_CHERRYUSB_HOST_MUSB_SIFLI
301+
bool "musb_sifli"
237302
config RT_CHERRYUSB_HOST_MUSB_CUSTOM
238303
bool "musb_custom"
239304
config RT_CHERRYUSB_HOST_PUSB2
@@ -346,6 +411,26 @@ if RT_USING_CHERRYUSB
346411
config CONFIG_USBHOST_PLATFORM_RTL8152
347412
bool
348413

414+
config CONFIG_USBHOST_PSC_PRIO
415+
int
416+
prompt "Set hubport change thread priority, 0 is the max priority"
417+
default 0
418+
419+
config CONFIG_USBHOST_PSC_STACKSIZE
420+
int
421+
prompt "Set hubport change thread stacksize"
422+
default 4096
423+
424+
config CONFIG_USBHOST_REQUEST_BUFFER_LEN
425+
int
426+
prompt "Set host control transfer max buffer size"
427+
default 512
428+
429+
config CONFIG_USBHOST_CONTROL_TRANSFER_TIMEOUT
430+
int
431+
prompt "Set host control transfer timeout, unit is ms"
432+
default 500
433+
349434
config RT_LWIP_PBUF_POOL_BUFSIZE
350435
int "The size of each pbuf in the pbuf pool"
351436
range 1500 2000
@@ -356,23 +441,22 @@ if RT_USING_CHERRYUSB
356441
depends on RT_CHERRYUSB_HOST_MSC
357442
default "/"
358443

359-
config RT_CHERRYUSB_HOST_TEMPLATE
360-
bool
361-
prompt "Use usb host template"
362-
default n
363-
364-
if RT_CHERRYUSB_HOST_TEMPLATE
365-
config TEST_USBH_CDC_ACM
444+
menu "Select USB host template, please select class driver first"
445+
config CONFIG_TEST_USBH_CDC_ACM
366446
int
367-
prompt "demo for test cdc acm"
447+
prompt "demo for test cdc acm, cannot enable this demo, we have used serial framework instead"
368448
default 0
369-
depends on CHERRYUSB_HOST_CDC_ACM
370-
config TEST_USBH_HID
449+
depends on RT_CHERRYUSB_HOST_CDC_ACM
450+
config CONFIG_TEST_USBH_HID
371451
int
372452
prompt "demo for test hid"
373453
default 0
374-
depends on CHERRYUSB_HOST_HID
375-
endif
454+
depends on RT_CHERRYUSB_HOST_HID
455+
config CONFIG_TEST_USBH_MSC
456+
int
457+
prompt "demo for test msc, cannot enable this demo, we have used dfs instead"
458+
default 0
459+
depends on RT_CHERRYUSB_HOST_MSC
460+
endmenu
376461
endif
377-
378462
endif

0 commit comments

Comments
 (0)