summaryrefslogtreecommitdiffstats
path: root/drivers/usb/host/dwc2.c
diff options
context:
space:
mode:
authorAlexey Brodkin <Alexey.Brodkin@synopsys.com>2018-02-28 16:16:58 +0300
committerMarek Vasut <marex@denx.de>2018-03-17 03:15:18 +0100
commit42637fdae833f8c3e8a0270ea7e74152cbd8ef38 (patch)
tree13388cdd515312f53a6cab5d64dc8b2a318b3968 /drivers/usb/host/dwc2.c
parent6f6b7cfa89e5aa3b643196a4ccc8b1ba5d6fa7a4 (diff)
downloadu-boot-42637fdae833f8c3e8a0270ea7e74152cbd8ef38.tar.gz
u-boot-42637fdae833f8c3e8a0270ea7e74152cbd8ef38.tar.xz
u-boot-42637fdae833f8c3e8a0270ea7e74152cbd8ef38.zip
usb: dwc2: Allow selection of data buffer size
If we use hardware with very small RAM (let's consider just a couple of hundreds of kB but not megabytes) it is not super convenient to lose 64kB for statically allocated bufer which most probably won't be used as big as it is. Typically we'll have much shorter data packages to excahnge and in the worst case longer packets will be split on separate transactions. For those corner-cases user will be able to set his buffer size of choice via USB_DWC2_BUFFER_SIZE option in menuconfig. By default we'll use 64 kB as it was hard-coeded before so existing users shouldn't be affected at all. Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com> Cc: Marek Vasut <marex@denx.de>
Diffstat (limited to 'drivers/usb/host/dwc2.c')
-rw-r--r--drivers/usb/host/dwc2.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/usb/host/dwc2.c b/drivers/usb/host/dwc2.c
index 0efe645044..e436c711e7 100644
--- a/drivers/usb/host/dwc2.c
+++ b/drivers/usb/host/dwc2.c
@@ -25,7 +25,7 @@ DECLARE_GLOBAL_DATA_PTR;
#define DWC2_HC_CHANNEL 0
#define DWC2_STATUS_BUF_SIZE 64
-#define DWC2_DATA_BUF_SIZE (64 * 1024)
+#define DWC2_DATA_BUF_SIZE (CONFIG_USB_DWC2_BUFFER_SIZE * 1024)
#define MAX_DEVICE 16
#define MAX_ENDPOINT 16