Skip to content

Commit 7e8ce63

Browse files
committed
dts: bindings: usb: Specify fifo sizes in devicetree
Add g-rx-fifo-size, g-np-tx-fifo-size and g-tx-fifo-size required properties to snps,dwc2 compatible. Property names are the same as used in Linux because Zephyr aims for devicetree source compatibility with other operating systems. Specifying fifo sizes in devicetree greatly reduces necessary driver complexity and allows application developer to adjust the sizes if necessary to best utilize underlying hardware. Signed-off-by: Tomasz Moń <[email protected]>
1 parent c2423b1 commit 7e8ce63

File tree

6 files changed

+57
-0
lines changed

6 files changed

+57
-0
lines changed

dts/arm/intel_socfpga_std/socfpga.dtsi

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,11 @@
238238
ghwcfg1 = <0x00000000>;
239239
ghwcfg2 = <0x208ffc90>;
240240
ghwcfg4 = <0xfe0f0020>;
241+
/* 8064 locations with full flexibility */
242+
g-rx-fifo-size = <608>;
243+
g-np-tx-fifo-size = <32>;
244+
g-tx-fifo-size = <512 512 512 512 512 512 512 512
245+
512 512 512 512 512 512 256>;
241246
status = "disabled";
242247
};
243248

@@ -251,6 +256,11 @@
251256
ghwcfg1 = <0x00000000>;
252257
ghwcfg2 = <0x208ffc90>;
253258
ghwcfg4 = <0xfe0f0020>;
259+
/* 8064 locations with full flexibility */
260+
g-rx-fifo-size = <608>;
261+
g-np-tx-fifo-size = <32>;
262+
g-tx-fifo-size = <512 512 512 512 512 512 512 512
263+
512 512 512 512 512 512 256>;
254264
status = "okay";
255265
};
256266

dts/bindings/usb/snps,dwc2.yaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,3 +51,22 @@ properties:
5151
description: |
5252
Value of the GHWCFG4 register. It is used to determine available endpoint
5353
types during driver pre-initialization.
54+
55+
g-rx-fifo-size:
56+
type: int
57+
required: true
58+
description: |
59+
Rx Data FIFO Depth. Must not exceed GRXFSIZ.RxFDep power-on value.
60+
61+
g-np-tx-fifo-size:
62+
type: int
63+
required: true
64+
description: |
65+
IN Endpoint 0 FIFO Depth. Must not exceed GNPTXFSIZ.NPTXFDep power-on value.
66+
67+
g-tx-fifo-size:
68+
type: array
69+
required: true
70+
description: |
71+
IN Endpoint Transmit fifo depths. Values must not exceed their respective
72+
DIEPTXFn.INEPnTxFDep power-on values.

dts/vendor/nordic/nrf54h20.dtsi

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -638,6 +638,16 @@
638638
ghwcfg1 = <0xaa555000>;
639639
ghwcfg2 = <0x22abfc72>;
640640
ghwcfg4 = <0x1e10aa60>;
641+
/* 3050 locations available, GRXFSIZ is 548,
642+
* GNPTXFSIZ and DIEPTXFn are 512. The default
643+
* values (upper bounds) sum up above the limit.
644+
* Allow High-Bandwidth only on TxFIFO 1 and 2.
645+
* Use maximum possible for RxFIFO and allocate
646+
* everything remaining for TxFIFO 0.
647+
*/
648+
g-rx-fifo-size = <548>;
649+
g-np-tx-fifo-size = <198>;
650+
g-tx-fifo-size = <512 512 256 256 256 256 256>;
641651
status = "disabled";
642652
};
643653

dts/vendor/nordic/nrf54lm20a.dtsi

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,11 @@
232232
ghwcfg1 = <0x0>;
233233
ghwcfg2 = <0x22affc52>;
234234
ghwcfg4 = <0x3e10aa60>;
235+
/* 3040 locations with full flexibility */
236+
g-rx-fifo-size = <592>;
237+
g-np-tx-fifo-size = <32>;
238+
g-tx-fifo-size = <512 256 256 256 256 256 256 256
239+
16 16 16 16 16 16 16>;
235240
status = "disabled";
236241
};
237242

dts/vendor/nordic/nrf9280.dtsi

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -397,6 +397,16 @@
397397
ghwcfg1 = <0xaa555000>;
398398
ghwcfg2 = <0x22abfc72>;
399399
ghwcfg4 = <0x1e10aa60>;
400+
/* 3050 locations available, GRXFSIZ is 548,
401+
* GNPTXFSIZ and DIEPTXFn are 512. The default
402+
* values (upper bounds) sum up above the limit.
403+
* Allow High-Bandwidth only on TxFIFO 1 and 2.
404+
* Use maximum possible for RxFIFO and allocate
405+
* everything remaining for TxFIFO 0.
406+
*/
407+
g-rx-fifo-size = <548>;
408+
g-np-tx-fifo-size = <198>;
409+
g-tx-fifo-size = <512 512 256 256 256 256 256>;
400410
status = "disabled";
401411
};
402412

dts/xtensa/espressif/esp32s3/esp32s3_common.dtsi

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -422,6 +422,9 @@
422422
ghwcfg1 = <0x00000000>;
423423
ghwcfg2 = <0x224dd930>;
424424
ghwcfg4 = <0xd3f0a030>;
425+
g-rx-fifo-size = <64>;
426+
g-np-tx-fifo-size = <32>;
427+
g-tx-fifo-size = <40 40 40 40>;
425428
};
426429

427430
timer0: counter@6001f000 {

0 commit comments

Comments
 (0)