Skip to content

Commit 6f5515e

Browse files
engdoreispamaury
authored andcommitted
[ot] hw/opentitan: ot_usbdev: Initial implementation of the block
Signed-off-by: Douglas Reis <[email protected]> Signed-off-by: Amaury Pouly <[email protected]>
1 parent 75d7ae2 commit 6f5515e

File tree

8 files changed

+530
-9
lines changed

8 files changed

+530
-9
lines changed

docs/opentitan/earlgrey.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,13 @@ There are two modes to handle address remapping, with different limitations:
269269
* `-device <name>,bus=<bus>,address=<address>` can be used to attach devices at a specific address
270270
to one of the three I2C buses. The buses are named `ot-i2c0`, `ot-i2c1`, and `ot-i2c2`.
271271

272+
### USBDEV
273+
274+
* `-chardev pty,id=usbdev` can be used to connect to the usbdev driver.
275+
* `-global ot-usbdev.vbus-mode=<mode>` can be used to select the VBUS mode.
276+
277+
See the [USBDEV documentation](usbdev.md)] for more details.
278+
272279
## Useful debugging options
273280

274281
### Device log traces

hw/opentitan/Kconfig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,9 @@ config OT_TIMER
191191
config OT_UART
192192
bool
193193

194+
config OT_USBDEV
195+
bool
196+
194197
config OT_UNIMP
195198
bool
196199

hw/opentitan/meson.build

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,3 +61,4 @@ system_ss.add(when: 'CONFIG_OT_UNIMP', if_true: files('ot_unimp.c'))
6161
riscv_ss.add(when: 'CONFIG_OT_VMAPPER', if_true: files('ot_vmapper.c'))
6262

6363
subdir('otbn')
64+
subdir('usbdev')

hw/opentitan/trace-events

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -629,6 +629,14 @@ ot_uart_io_read_out(const char *id, uint32_t addr, const char *regname, uint32_t
629629
ot_uart_io_write(const char *id, uint32_t addr, const char *regname, uint32_t val, uint32_t pc) "%s: addr=0x%02x (%s), val=0x%x, pc=0x%x"
630630
ot_uart_irqs(const char *id, uint32_t active, uint32_t mask, uint32_t eff) "%s: act:0x%08x msk:0x%08x eff:0x%08x"
631631

632+
# ot_usbdev.c
633+
634+
ot_usbdev_io_read_out(const char *id, uint32_t addr, const char *regname, uint32_t val, uint32_t pc) "%s: addr=0x%02x (%s), val=0x%x, pc=0x%x"
635+
ot_usbdev_io_write(const char *id, uint32_t addr, const char *regname, uint32_t val, uint32_t pc) "%s: addr=0x%02x (%s), val=0x%x, pc=0x%x"
636+
ot_usbdev_irqs(const char *id, uint32_t active, uint32_t mask, uint32_t eff) "%s: act:0x%08x msk:0x%08x eff:0x%08x"
637+
ot_usbdev_reset(const char *id, const char *stage) "%s: %s"
638+
ot_usbdev_chr_process_cmd(const char *id, const char *cmd) "%s: %s"
639+
632640
# ot_unimp.c
633641

634642
ot_unimp_irq(const char *id, unsigned ix, bool lvl) "%s: #%u = %u"

0 commit comments

Comments
 (0)