drivers/usbdev: support config usb req buffer alignment bytes

we need to alloc req buffer in cacheline size units, othersize the
data may by incorrect.

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
This commit is contained in:
dongjiuzhu1
2024-03-25 14:55:17 +08:00
committed by Xiang Xiao
parent 9ebed49d29
commit 2b571e1d11
2 changed files with 11 additions and 1 deletions
+6
View File
@@ -25,6 +25,12 @@ config USBDEV_DUALSPEED
---help---
Hardware handles high and full speed operation (USB 2.0)
config USBDEV_EPBUFFER_ALIGNMENT
int "The usbdev ep req bffer aligned bytes"
default 0
---help---
The aligned bytes of usbdev ep req buffer
choice
prompt "Select USB device powered"
default USBDEV_SELFPOWERED
+5 -1
View File
@@ -47,7 +47,11 @@
# define EP_ALLOCBUFFER(ep,nb) (ep)->ops->allocbuffer(ep,nb)
# define EP_FREEBUFFER(ep,buf) (ep)->ops->freebuffer(ep,buf)
#else
# define EP_ALLOCBUFFER(ep,nb) kmm_malloc(nb)
# if CONFIG_USBDEV_EPBUFFER_ALIGNMENT != 0
# define EP_ALLOCBUFFER(ep,nb) kmm_memalign(CONFIG_USBDEV_EPBUFFER_ALIGNMENT, nb)
# else
# define EP_ALLOCBUFFER(ep,nb) kmm_malloc(nb)
# endif
# define EP_FREEBUFFER(ep,buf) kmm_free(buf)
#endif