forked from lowRISC/opentitan
-
Notifications
You must be signed in to change notification settings - Fork 0
/
usbdev.hjson
1604 lines (1579 loc) · 52.5 KB
/
usbdev.hjson
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// Copyright lowRISC contributors (OpenTitan project).
// Licensed under the Apache License, Version 2.0, see LICENSE for details.
// SPDX-License-Identifier: Apache-2.0
{
name: "usbdev",
human_name: "USB Device",
one_line_desc: "USB 2.0 Full Speed device interface (12 Mbit/s)",
one_paragraph_desc: '''
USB Device provides compatibility with the industry standard Universal Serial Bus by implementing a Full Speed device (12 Mbit/s) according to the USB 2.0 Specification.
USB Device supports up to 12 bidirectional endpoints which may be used to support all of the USB 2.0 transfer types, including Isochronous transfers.
Support for packet transmission and reception is provided in hardware, with the generation of interrupts for software to mediate the different stages of Control and Data Transfers.
The maximum packet size for transfers is configurable up to the specification limit of 64 bytes per packet, reducing the protocol overhead for Bulk transfers, and the inbuilt 2 KiB memory can accommodate 32 packets.
USB Device may be configured to use either a single-ended interface to an external differential transceiver or a differential input/output for more direct interfacing and reduced hardware complexity when prototyping.
'''
// Unique comportable IP identifier defined under KNOWN_CIP_IDS in the regtool.
cip_id: "31",
design_spec: "../doc",
dv_doc: "../doc/dv",
hw_checklist: "../doc/checklist",
sw_checklist: "/sw/device/lib/dif/dif_usbdev",
version: "2.0.0",
life_stage: "L1",
design_stage: "D2S",
verification_stage: "V2S",
dif_stage: "S2",
clocking: [
// clk_i must be 48 MHz
{clock: "clk_i", reset: "rst_ni", primary: true},
{clock: "clk_aon_i", reset: "rst_aon_ni"},
]
bus_interfaces: [
{ protocol: "tlul", direction: "device" }
],
available_inout_list: [
{ name: "usb_dp", desc: "USB data D+" }
{ name: "usb_dn", desc: "USB data D-" }
],
available_input_list: [
{ name: "sense", desc: "USB host VBUS sense" }
],
available_output_list: [],
inter_signal_list: [
{ name: "usb_rx_d",
desc: "USB RX data from an external differential receiver, if available"
type: "uni",
act: "rcv",
package: "",
struct: "logic",
width: "1"
}
{ name: "usb_tx_d",
desc: "USB transmit data value (not used if usb_tx_se0 is set)"
type: "uni",
act: "req",
package: "",
struct: "logic",
width: "1"
}
{ name: "usb_tx_se0",
desc: "Force transmission of a USB single-ended zero (i.e. both D+ and D- are low) regardless of usb_tx_d"
type: "uni",
act: "req",
package: "",
struct: "logic",
width: "1"
}
{ name: "usb_tx_use_d_se0",
desc: "Use the usb_tx_d and usb_tx_se0 TX interface, instead of usb_dp_o and usb_dn_o"
type: "uni",
act: "req",
package: "",
struct: "logic",
width: "1"
}
{ name: "usb_dp_pullup",
desc: "USB D+ pullup control"
type: "uni",
act: "req",
package: "",
struct: "logic",
width: "1"
}
{ name: "usb_dn_pullup",
desc: "USB D- pullup control"
type: "uni",
act: "req",
package: "",
struct: "logic",
width: "1"
}
{ name: "usb_rx_enable",
desc: "USB differential receiver enable"
type: "uni",
act: "req",
package: "",
struct: "logic",
width: "1"
}
{ name: "usb_ref_val",
desc: "This indicates that USB timing reference signal 'usb_ref_pulse' is valid"
type: "uni",
act: "req",
package: "",
struct: "logic",
width: "1"
}
{ name: "usb_ref_pulse",
desc: "USB timing reference signal. This signal pulses for a single 48MHz clock every 1ms USB frame"
type: "uni",
act: "req",
package: "",
struct: "logic",
width: "1"
},
{ name: "usb_aon_suspend_req",
desc: "Request to activate the AON/Wake module and take control of the USB pullups"
type: "uni",
act: "req",
package: "",
struct: "logic",
width: "1"
},
{ name: "usb_aon_wake_ack",
desc: "Acknowledge a wake signal from the AON/Wake and relinquish control of the USB pullups"
type: "uni",
act: "req",
package: "",
struct: "logic",
width: "1"
},
{ name: "usb_aon_bus_reset",
desc: "Indicates that the reason for waking was that a USB Bus Reset occurred"
type: "uni",
act: "rcv",
package: "",
struct: "logic",
width: "1"
},
{ name: "usb_aon_sense_lost",
desc: "Indicates that the reason for waking was that the VBUS/SENSE signal became deasserted"
type: "uni",
act: "rcv",
package: "",
struct: "logic",
width: "1"
},
{ name: "usb_aon_bus_not_idle",
desc: "Indicates that the reason for waking was that the USB is in a non-idle state"
type: "uni",
act: "rcv",
package: "",
struct: "logic",
width: "1"
},
{ name: "usb_aon_wake_detect_active",
desc: "Indicates that the external AON/Wake module is active and controlling the USB pullups",
type: "uni",
act: "rcv",
package: "",
struct: "logic",
width: "1"
},
{ struct: "ram_1p_cfg",
package: "prim_ram_1p_pkg",
type: "uni",
name: "ram_cfg",
act: "rcv"
}
]
param_list: [
{ name: "Stub",
type: "bit",
default: "0",
desc: "Stub out the core of entropy_src logic"
local: "false",
expose: "true"
},
{ name: "NEndpoints",
type: "int",
default: "12",
desc: "Number of endpoints",
local: "true"
},
{ name: "RcvrWakeTimeUs",
type: "int",
default: "1",
desc: "Maximum number of microseconds for the differential receiver to become operational",
local: "false",
expose: "true"
}
],
interrupt_list: [
{ name: "pkt_received"
desc: '''
Raised if a packet was received using an OUT or SETUP transaction.
This interrupt is directly tied to whether the RX FIFO is empty, so it should be cleared only after handling the FIFO entry.
'''
type: "status"
}
{ name: "pkt_sent"
desc: '''
Raised if a packet was sent as part of an IN transaction.
This interrupt is directly tied to whether a sent packet has not been acknowledged in the !!in_sent register.
It should be cleared only after clearing all bits in the !!in_sent register.
'''
type: "status"
}
{ name: "disconnected",
desc: '''
Raised if VBUS is lost, thus the link is disconnected.
'''
}
{ name: "host_lost",
desc: '''
Raised if link is active but SOF was not received from host for 4.096 ms. The SOF should be every 1 ms.
'''
}
{ name: "link_reset",
desc: '''
Raised if the link is at SE0 longer than 3 us indicating a link reset (host asserts for min 10 ms, device can react after 2.5 us).
'''
}
{ name: "link_suspend",
desc: '''
Raised if the line has signaled J for longer than 3ms and is therefore in suspend state.
'''
}
{ name: "link_resume",
desc: '''
Raised when the link becomes active again after being suspended.
'''
}
{ name: "av_out_empty",
desc: '''
Raised when the Available OUT Buffer FIFO is empty and the device interface is enabled.
This interrupt is directly tied to the FIFO status, so the Available OUT Buffer FIFO must be provided with a free buffer before the interrupt can be cleared.
'''
type: "status"
}
{ name: "rx_full",
desc: '''
Raised when the RX FIFO is full and the device interface is enabled.
This interrupt is directly tied to the FIFO status, so the RX FIFO must have an entry removed before the interrupt is cleared.
If the condition is not cleared, the interrupt can re-assert.
'''
type: "status"
}
{ name: "av_overflow",
desc: '''
Raised if a write was done to either the Available OUT Buffer FIFO or the Available SETUP Buffer FIFO when the FIFO was full.
'''
}
{ name: "link_in_err",
desc: '''
Raised if a packet to an IN endpoint started to be received but was
then dropped due to an error. After transmitting the IN payload,
the USB device expects a valid ACK handshake packet. This error is
raised if either the packet or CRC is invalid, leading to a NAK instead,
or if a different token was received.
'''
}
{ name: "rx_crc_err",
desc: '''
Raised if a CRC error occurred on a received packet.
'''
}
{ name: "rx_pid_err",
desc: '''
Raised if an invalid Packet IDentifier (PID) was received.
'''
}
{ name: "rx_bitstuff_err",
desc: '''
Raised if an invalid bitstuffing was received.
'''
}
{ name: "frame",
desc: '''
Raised when the USB frame number is updated with a valid SOF.
'''
}
{ name: "powered",
desc: "Raised if VBUS is applied."
}
{ name: "link_out_err",
desc: '''
Raised if a packet to an OUT endpoint started to be received but was then dropped due to an error.
This error is raised if the data toggle, token, packet and/or CRC are invalid, or if the appropriate Available OUT Buffer FIFO is empty and/or the Received Buffer FIFO is full when a packet should have been received.
'''
}
{
name: "av_setup_empty",
desc: '''
Raised when the Available SETUP Buffer FIFO is empty and the device interface is enabled.
This interrupt is directly tied to the FIFO status, so the Available SETUP Buffer FIFO must be provided with a free buffer before the interrupt can be cleared.
'''
type: "status"
}
]
alert_list: [
{ name: "fatal_fault",
desc: '''
This fatal alert is triggered when a fatal TL-UL bus integrity fault is detected.
'''
}
],
features: [
{
name: "USBDEV.CONN.VBUS"
desc: '''Detection of VBUS/SENSE signal from the host controller, indicating a
connection and/or supplying power.
'''
}
{
name: "USBDEV.CONN.PULLUP"
desc: '''Assertion and removal of pull up resistor indicating Full Speed device
presence on the USB.
'''
}
{
name: "USBDEV.CONN.REF_PULSE"
desc: '''Generation of a reference pulse in response to Start Of Frame packet
reception, to synchronize the device clock with that of the host controller.
'''
}
{
name: "USBDEV.CONN.PIN_CONFIG"
desc: '''Support for different pin configurations; pin flipping, transmission and
reception modes.
'''
}
{
name: "USBDEV.CONN.RESET"
desc: '''usbdev reset and the ability to empty the Av and Rx FIFOs. Required for
adapting to polarity of SBU connections on USB-C cables.
'''
}
{
name: "USBDEV.BUFFER.MEMORY"
desc: '''usbdev presents a conventional 512-entry 32-bit RAM on the memory bus
that supports read/write operations for receiving and sending packets over
the USB. Writing and reading of partial words is not supported.
'''
}
{
name: "USBDEV.TRANSFER.CONTROL_RX"
desc: "Reception of packets in Control Transfers from the host controller."
}
{
name: "USBDEV.TRANSFER.CONTROL_TX"
desc: "Transmission of response packets in Control Transfers from the host."
}
{
name: "USBDEV.TRANSFER.ENDPOINTS"
desc: "Use of multiple endpoints in communication with the host controller."
}
{
name: "USBDEV.TRANSFER.BULK"
desc: "Bulk Transfer streams."
}
{
name: "USBDEV.TRANSFER.ISOCHRONOUS"
desc: "Support for Isochronous Transfers and Endpoints."
}
{
name: "USBDEV.TRANSFER.CONTROL"
desc: '''Support for Control Transfers/Endpoints other than the Default Control Pipe
at Endpoint Zero.
'''
}
{
name: "USBDEV.TRANSFER.INTERRUPT"
desc: "Support for Interrupt Transfers and Endpoints."
}
{
name: "USBDEV.POWER.SUSPEND"
desc: "Detection of Suspend request from the host."
}
{
name: "USBDEV.POWER.RESUME"
desc: "Detection of Resume Signaling from the host controller."
}
{
name: "USBDEV.POWER.AON"
desc: "Handover of the USB to the AON module that handles Wake signaling."
}
{
name: "USBDEV.POWER.WAKE_DISCONNECT",
desc: "Wake from Sleep in response to Disconnection."
}
{
name: "USBDEV.POWER.WAKE_RESUME",
desc: "Wake from Sleep in response to Resume Signaling."
}
{
name: "USBDEV.POWER.WAKE_BUS_RESET",
desc: "Wake from Sleep in response to Bus Reset from host."
}
{
name: "USBDEV.POWER.TOGGLE_RESTORE",
desc: '''Save and restore Data Toggles for all IN and OUT endpoints.
Resuming from Deep Sleep requires the ability to restore the Data Toggles
to an arbitrary state. (Requires prod-only RTL changes.)
'''
}
],
countermeasures: [
{ name: "BUS.INTEGRITY",
desc: "End-to-end bus integrity scheme."
}
]
regwidth: "32",
registers: [
{ name: "usbctrl",
desc: "USB Control",
swaccess: "rw",
hwaccess: "hro",
fields: [
{
bits: "0",
name: "enable",
desc: '''
Set to connect the USB interface (i.e. assert the pullup).
'''
tags: [// Prevent usb from being enabled to avoid other unforeseen side effects.
"excl:CsrNonInitTests:CsrExclWrite"]
}
{
bits: "1",
name: "resume_link_active",
swaccess: "wo"
hwqe: "true",
desc: '''
Write a 1 to this bit to instruct usbdev to jump to the LinkResuming state.
The write will only have an effect when the device is in the LinkPowered state.
Its intention is to handle a resume-from-suspend event after the IP has been powered down.
'''
}
{
bits: "22:16",
name: "device_address",
hwaccess: "hrw",
desc: '''
Device address set by host (this should be copied from
the Set Device ID SETUP packet).
This will be zeroed by the hardware when the link resets.
'''
tags: [// This field is reset to 0 if usb is not enabled.
"excl:CsrNonInitTests:CsrExclWriteCheck"]
}
]
}
{ multireg: {
name: "ep_out_enable",
count: "NEndpoints"
cname: "Endpoint"
desc: '''
Enable an endpoint to respond to transactions in the downstream direction.
Note that as the default endpoint, endpoint 0 must be enabled in both the IN and OUT directions before enabling the USB interface to connect.
'''
swaccess: "rw",
hwaccess: "hro",
fields: [
{
bits: "0",
name: "enable",
desc: '''
This bit must be set to enable downstream transactions to be received on the endpoint and elicit responses.
If the bit is clear, any SETUP or OUT packets sent to the endpoint will be ignored.
'''
}
]
}
}
{ multireg: {
name: "ep_in_enable",
count: "NEndpoints"
cname: "Endpoint"
desc: '''
Enable an endpoint to respond to transactions in the upstream direction.
Note that as the default endpoint, endpoint 0 must be enabled in both the IN and OUT directions before enabling the USB interface to connect.
'''
swaccess: "rw",
hwaccess: "hro",
fields: [
{
bits: "0",
name: "enable",
desc: '''
This bit must be set to enable upstream transactions to be received on the endpoint and elicit responses.
If the bit is clear then any IN packets sent to the endpoint will be ignored.
'''
}
]
}
}
{ name: "usbstat",
desc: "USB Status",
swaccess: "ro",
hwaccess: "hwo",
hwext: "true",
fields: [
{
bits: "10:0",
name: "frame",
desc: '''
Frame index received from host. On an active link, this will increment every milisecond.
'''
}
{
bits: "11",
name: "host_lost",
desc: '''
Start of frame not received from host for 4.096 ms and the line is active.
'''
}
{
bits: "14:12",
name: "link_state",
desc: '''
State of USB link, decoded from line.
'''
enum: [
{ value: "0",
name: "disconnected",
desc: "Link disconnected (no VBUS or no pull-up connected)"
},
{ value: "1",
name: "powered",
desc: "Link powered and connected, but not reset yet"
},
{ value: "2",
name: "powered_suspended",
desc: "Link suspended (constant idle/J for > 3 ms), but not reset yet"
},
{ value: "3",
name: "active",
desc: "Link active"
},
{ value: "4",
name: "suspended",
desc: "Link suspended (constant idle for > 3 ms), was active before becoming suspended"
},
{ value: "5",
name: "active_nosof",
desc: "Link active but no SOF has been received since the last reset."
},
{ value: "6",
name: "resuming",
desc: "Link resuming to an active state, pending the end of resume signaling"
},
]
}
{
bits: "15",
name: "sense",
desc: '''
Reflects the state of the sense pin.
1 indicates that the host is providing VBUS.
Note that this bit always shows the state of the actual pin and does not take account of the override control.
'''
}
{
bits: "19:16",
name: "av_out_depth",
desc: '''
Number of buffers in the Available OUT Buffer FIFO.
These buffers are available for receiving OUT DATA packets.
'''
}
{
bits: "22:20",
name: "av_setup_depth",
desc: '''
Number of buffers in the Available SETUP Buffer FIFO.
These buffers are available for receiving SETUP DATA packets.
'''
}
{
bits: "23",
name: "av_out_full",
desc: '''
Available OUT Buffer FIFO is full.
'''
}
{
bits: "27:24",
name: "rx_depth",
desc: '''
Number of buffers in the Received Buffer FIFO.
These buffers have packets that have been received and
should be popped from the FIFO and processed.
'''
}
{
bits: "30",
name: "av_setup_full",
desc: '''
Available SETUP Buffer FIFO is full.
'''
}
{
bits: "31",
name: "rx_empty",
resval: "1",
desc: '''
Received Buffer FIFO is empty.
'''
}
]
tags: [// Updated by HW based on observed USB signals, comprises also readbacks.
// Pinmux configuration can affect at least the sense and link_state bits.
// Exclude all read checks in all tests including reset tests.
"excl:CsrAllTests:CsrExclCheck"]
}
{ name: "avoutbuffer",
desc: "Available OUT Buffer FIFO",
swaccess: "wo",
hwaccess: "hro",
hwext: "true",
hwqe: "true",
fields: [
{
bits: "4:0",
name: "buffer",
desc: '''
This field contains the buffer ID being passed to the USB receive engine.
If the Available OUT Buffer FIFO is full, any write operations are discarded.
'''
}
]
tags: [// Writing this CSR affects the ral.usbstat.av_depth field.
"excl:CsrNonInitTests:CsrExclWrite"]
}
{ name: "avsetupbuffer",
desc: "Available SETUP Buffer FIFO",
swaccess: "wo",
hwaccess: "hro",
hwext: "true",
hwqe: "true",
fields: [
{
bits: "4:0",
name: "buffer",
desc: '''
This field contains the buffer ID being passed to the USB receive engine.
If the Available SETUP Buffer FIFO is full, any write operations are discarded.
'''
}
]
tags: [// Writing this CSR affects the ral.usbstat.av_depth field.
"excl:CsrNonInitTests:CsrExclWrite"]
}
{ name: "rxfifo",
desc: "Received Buffer FIFO",
swaccess: "ro",
hwaccess: "hrw",
hwext: "true",
hwre: "true",
fields: [
{
bits: "4:0",
name: "buffer",
desc: '''
This field contains the buffer ID that data was received into.
On read the buffer ID is popped from the Received Buffer FIFO and returned to software.
'''
}
{
bits: "14:8",
name: "size",
desc: '''
This field contains the data length in bytes of the packet written to the buffer.
'''
}
{
bits: "19",
name: "setup",
desc: '''
This bit indicates if the received transaction is of type SETUP (1) or OUT (0).
'''
}
{
bits: "23:20",
name: "ep",
desc: '''
This field contains the endpoint ID to which the packet was directed.
'''
}
]
}
{ multireg: {
name: "rxenable_setup",
count: "NEndpoints"
cname: "Endpoint"
desc: "Receive SETUP transaction enable",
swaccess: "rw",
hwaccess: "hro",
fields: [
{
bits: "0",
name: "setup",
desc: '''
This bit must be set to enable SETUP transactions to be
received on the endpoint. If the bit is clear then a
SETUP packet will be ignored. The bit should be set for
control endpoints (and only control endpoints).
'''
}
]
}
}
{ multireg: {
name: "rxenable_out",
count: "NEndpoints"
cname: "Endpoint"
desc: "Receive OUT transaction enable",
swaccess: "rw",
hwaccess: "hrw",
fields: [
{
bits: "0",
name: "out",
desc: '''
This bit must be set to enable OUT transactions to be received on the endpoint.
If the bit is clear then an OUT request will be responded to with a NAK, if the endpoint is enabled.
If set_nak_out for this endpoint is set, hardware will clear this bit whenever an OUT transaction is received on this endpoint.
Software must set this bit again to receive the next OUT transaction.
Until that happens, hardware will continue to NAK any OUT transaction to this endpoint.
'''
}
]
}
}
{ multireg: {
name: "set_nak_out",
count: "NEndpoints"
cname: "Endpoint"
desc: "Set NAK after OUT transactions",
swaccess: "rw",
hwaccess: "hro",
fields: [
{
bits: "0",
name: "enable",
desc: '''
When this bit is set, hardware will clear this endpoint's rxenable_out bit whenever an OUT transaction is received on this endpoint.
This bit should not be changed while the endpoint is active.
'''
}
]
}
}
{ multireg: {
name: "in_sent",
count: "NEndpoints"
cname: "Endpoint"
desc: "IN Transaction Sent",
swaccess: "rw1c",
hwaccess: "hrw",
fields: [
{
bits: "0",
name: "sent",
desc: '''
This bit will be set when the ACK is received from
the host to indicate successful packet delivery
as part of an IN transaction.
'''
}
]
}
}
{ multireg: {
name: "out_stall",
count: "NEndpoints"
cname: "Endpoint"
desc: "OUT Endpoint STALL control",
swaccess: "rw",
hwaccess: "hrw",
fields: [
{
bits: "0",
name: "endpoint",
desc: '''
If this bit is set then an OUT transaction to this endpoint will elicit a STALL handshake, when a non-isochronous endpoint is enabled.
If the configuration has both STALL and NAK enabled, the STALL handshake will take priority.
Note that SETUP transactions are always either accepted or ignored.
For endpoints that accept SETUP transactions, a SETUP packet will clear the STALL flag on endpoints for both the IN and OUT directions.
'''
}
]
}
}
{ multireg: {
name: "in_stall",
count: "NEndpoints"
cname: "Endpoint"
desc: "IN Endpoint STALL control",
swaccess: "rw",
hwaccess: "hrw",
fields: [
{
bits: "0",
name: "endpoint",
desc: '''
If this bit is set then an IN transaction to this endpoint will elicit a STALL handshake, when a non-isochronous endpoint is enabled.
If the configuration has both STALL and NAK enabled, the STALL handshake will take priority.
Note that SETUP transactions are always either accepted or ignored.
For endpoints that accept SETUP transactions, a SETUP packet will clear the STALL flag on endpoints for both the IN and OUT directions.
'''
}
]
}
}
{ multireg: {
name: "configin",
count: "NEndpoints"
cname: "Endpoint"
desc: "Configure IN Transaction",
swaccess: "rw",
hwaccess: "hro",
fields: [
{
bits: "4:0",
name: "buffer",
desc: '''
The buffer ID containing the data to send when an IN transaction is received on the endpoint.
'''
}
{
bits: "14:8",
name: "size",
desc: '''
The number of bytes to send from the buffer.
If this is 0 then a CRC only packet is sent.
If this is greater than 64 then 64 bytes are sent.
'''
}
{
bits: "29",
name: "sending",
swaccess: "rw1c",
hwaccess: "hwo",
desc: '''
This bit indicates that the buffer is in the process of being collected by the
host. It becomes set upon the first attempt by the host to collect a buffer from
this endpoint when the rdy bit was set.
It is cleared when the packet has been collected successfully or the pending
transaction has been canceled by the hardware through detection of a
link reset or receipt of a SETUP packet.
'''
}
{
bits: "30",
name: "pend",
swaccess: "rw1c"
hwaccess: "hrw"
desc: '''
This bit indicates a pending transaction was canceled by the hardware.
The bit is set when the rdy bit is cleared by hardware because of a
SETUP packet being received or a link reset being detected.
The bit remains set until cleared by being written with a 1.
'''
}
{
bits: "31",
name: "rdy",
hwaccess: "hrw"
desc: '''
This bit should be set to indicate the buffer is ready for sending.
It will be cleared when the ACK is received indicating the host has accepted the data.
This bit will also be cleared if an enabled SETUP transaction is received on the endpoint.
This allows use of the IN channel for transfer of SETUP information.
The original buffer must be resubmitted after the SETUP sequence is complete.
A link reset also clears the bit.
In either of the cases where the hardware cancels the transaction it will also set the pend bit.
'''
}
]
tags: [// 'rdy', 'pend' and 'sending' bits interact with each other.
"excl:CsrNonInitTests:CsrExclWrite"]
}
}
{ multireg: {
name: "out_iso",
count: "NEndpoints"
cname: "Endpoint"
desc: "OUT Endpoint isochronous setting",
swaccess: "rw",
hwaccess: "hro",
fields: [
{
bits: "0",
name: "iso",
desc: '''
If this bit is set then the endpoint will be treated as an isochronous endpoint.
No handshake packet will be sent for an OUT transaction.
Note that if a rxenable_setup is set for this endpoint's number, this bit will not take effect.
Control endpoint configuration trumps isochronous endpoint configuration.
'''
}
]
}
}
{ multireg: {
name: "in_iso",
count: "NEndpoints"
cname: "Endpoint"
desc: "IN Endpoint isochronous setting",
swaccess: "rw",
hwaccess: "hro",
fields: [
{
bits: "0",
name: "iso",
desc: '''
If this bit is set then the endpoint will be treated as an isochronous endpoint.
No handshake packet will be expected for an IN transaction.
Note that if a rxenable_setup is set for this endpoint's number, this bit will not take effect.
Control endpoint configuration trumps isochronous endpoint configuration.
'''
}
]
}
}
{
name: "out_data_toggle",
desc: "OUT Endpoints Data Toggles",
swaccess: "rw",
hwaccess: "hrw",
hwext: "true",
hwqe: "true",
fields: [
{
bits: "11:0",
name: "status",
desc: '''
Reading returns the current state of the OUT endpoint Data Toggle flags.
Writing sets the Data Toggle flag for each endpoint if the corresponding mask bit
in the upper half of this register is set.
'''
}
{
bits: "27:16",
name: "mask",
desc: '''
Reads as zero.
When writing, a set bit will cause the Data Toggle flag of the corresponding
OUT endpoint to be updated. A clear bit will leave the flag for the corresponding
endpoint unchanged.
'''
}
],
tags: [// This CSR has mask bits that gate writes.
"excl:CsrNonInitTests:CsrExclWrite"]
}
{
name: "in_data_toggle",
desc: "IN Endpoints Data Toggles",
swaccess: "rw",
hwaccess: "hrw",
hwext: "true",
hwqe: "true",
fields: [
{
bits: "11:0",
name: "status",
desc: '''
Reading returns the current state of the IN endpoint Data Toggle flags.
Writing sets the Data Toggle flag for each endpoint if the corresponding mask bit
in the upper half of this register is set.
'''
}
{
bits: "27:16",
name: "mask",
desc: '''
Reads as zero.
When writing, a set bit will cause the Data Toggle flag of the corresponding
IN endpoint to be updated. A clear bit will leave the flag for the corresponding
endpoint unchanged.
'''
}
],
tags: [// This CSR has mask bits that gate writes.