Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions boards/nxp/frdm_k22f/frdm_k22f.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,7 @@ supported:
- pwm
- spi
- usb_device
- usbd
- usbh
- watchdog
vendor: nxp
2 changes: 2 additions & 0 deletions boards/nxp/lpcxpresso55s28/lpcxpresso55s28.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ supported:
- i2c
- spi
- usb_device
- usbd
- usbh
- watchdog
- gint
vendor: nxp
2 changes: 2 additions & 0 deletions boards/nxp/lpcxpresso55s69/lpcxpresso55s69_lpc55s69_cpu0.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ supported:
- spi
- sdhc
- usb_device
- usbd
- usbh
- watchdog
- rtc
- gint
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ supported:
- spi
- usb_device
- usbd
- usbh
- watchdog
- rtc
vendor: nxp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ supported:
- spi
- usb_device
- usbd
- usbh
- watchdog
- rtc
vendor: nxp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ supported:
- spi
- usb_device
- usbd
- usbh
- watchdog
- rtc
vendor: nxp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ supported:
- spi
- usb_device
- usbd
- usbh
- watchdog
- rtc
vendor: nxp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ supported:
- sdhc
- spi
- usbd
- usbh
- watchdog
- rtc
vendor: nxp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ supported:
- sdhc
- spi
- usbd
- usbh
- watchdog
- rtc
vendor: nxp
3 changes: 2 additions & 1 deletion boards/nxp/rd_rw612_bga/rd_rw612_bga.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ supported:
- pwm
- spi
- usb_device
- usb_host
- usbd
- usbh
- watchdog
- netif:eth
- netif:openthread
Expand Down
2 changes: 2 additions & 0 deletions boards/qemu/riscv32/board.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,6 @@ set(QEMU_FLAGS_${ARCH}
-cpu ${qemu_riscv_cpu}
)

set(QEMU_PCI_OHCI_FLAGS addr=2.0)

include(${ZEPHYR_BASE}/boards/common/qemu.board.cmake)
14 changes: 14 additions & 0 deletions boards/qemu/riscv32/qemu_riscv32.dts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* SPDX-License-Identifier: Apache-2.0 */

Check warning on line 1 in boards/qemu/riscv32/qemu_riscv32.dts

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

Copyright missing

boards/qemu/riscv32/qemu_riscv32.dts:1 File has no SPDX-FileCopyrightText header, consider adding one. Check SPDX headers and copyright lines with the reuse Python API.

/dts-v1/;

Expand All @@ -15,3 +15,17 @@
&uart0 {
status = "okay";
};

&pcie {
zephyr_uhc0: pcie@2,0 {
compatible = "generic-ohci";
reg = <0x1000 0 0 0 0>;
vendor-id = <0x106b>;
device-id = <0x003f>;
interrupts = <1>;
interrupt-parent = <&pcie>;
maximum-speed = "full-speed";
dma-coherent;
status = "okay";
};
};
1 change: 1 addition & 0 deletions boards/qemu/riscv32/qemu_riscv32.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ toolchain:
- zephyr
supported:
- netif
- usbh
ram: 262144
flash: 32768
testing:
Expand Down
14 changes: 14 additions & 0 deletions boards/qemu/riscv32/qemu_riscv32_qemu_virt_riscv32_smp.dts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* SPDX-License-Identifier: Apache-2.0 */

Check warning on line 1 in boards/qemu/riscv32/qemu_riscv32_qemu_virt_riscv32_smp.dts

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

Copyright missing

boards/qemu/riscv32/qemu_riscv32_qemu_virt_riscv32_smp.dts:1 File has no SPDX-FileCopyrightText header, consider adding one. Check SPDX headers and copyright lines with the reuse Python API.

/dts-v1/;

Expand All @@ -15,3 +15,17 @@
&uart0 {
status = "okay";
};

&pcie {
zephyr_uhc0: pcie@2,0 {
compatible = "generic-ohci";
reg = <0x1000 0 0 0 0>;
vendor-id = <0x106b>;
device-id = <0x003f>;
interrupts = <1>;
interrupt-parent = <&pcie>;
maximum-speed = "full-speed";
dma-coherent;
status = "okay";
};
};
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ toolchain:
supported:
- netif
- smp
- usbh
ram: 262144
flash: 32768
testing:
Expand Down
6 changes: 6 additions & 0 deletions cmake/emu/qemu.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,12 @@ else()
add_custom_target(qemu_nvme_disk)
endif()

if(CONFIG_UHC_OHCI_PCI)
list(APPEND QEMU_EXTRA_FLAGS
-device pci-ohci,${QEMU_PCI_OHCI_FLAGS}
)
endif()

if(NOT QEMU_PIPE)
set(QEMU_PIPE_COMMENT "\nTo exit from QEMU enter: 'CTRL+a, x'\n")
endif()
Expand Down
1 change: 1 addition & 0 deletions drivers/usb/uhc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ zephyr_library()

zephyr_library_sources(uhc_common.c)
zephyr_library_sources_ifdef(CONFIG_UHC_MAX3421E uhc_max3421e.c)
zephyr_library_sources_ifdef(CONFIG_UHC_OHCI uhc_ohci.c)
zephyr_library_sources_ifdef(CONFIG_UHC_VIRTUAL uhc_virtual.c)
zephyr_library_sources_ifdef(CONFIG_UHC_NXP_EHCI uhc_mcux_common.c uhc_mcux_ehci.c)
zephyr_library_sources_ifdef(CONFIG_UHC_NXP_KHCI uhc_mcux_common.c uhc_mcux_khci.c)
Expand Down
1 change: 1 addition & 0 deletions drivers/usb/uhc/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ module-str = uhc drv
source "subsys/logging/Kconfig.template.log_config"

source "drivers/usb/uhc/Kconfig.max3421e"
source "drivers/usb/uhc/Kconfig.ohci"
source "drivers/usb/uhc/Kconfig.virtual"
source "drivers/usb/uhc/Kconfig.mcux"

Expand Down
44 changes: 44 additions & 0 deletions drivers/usb/uhc/Kconfig.ohci
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# SPDX-FileCopyrightText: Copyright The Zephyr Project Contributors
# SPDX-License-Identifier: Apache-2.0

config UHC_OHCI
bool "Generic OHCI USB host controller driver"
default y
depends on DT_HAS_GENERIC_OHCI_ENABLED
depends on !64BIT
help
Generic OHCI USB host controller driver for any OHCI
controller (OpenHCI 1.0a compatible). Only supported on
32 bit, as OHCI only uses 32 bit registers for addresses.

if UHC_OHCI

config UHC_OHCI_PCI
bool
default y
depends on $(dt_compat_on_bus,$(DT_COMPAT_GENERIC_OHCI),pcie)
select PCIE
select DYNAMIC_INTERRUPTS if !PCIE_CONTROLLER

config UHC_OHCI_BULK_SLOTS
int "Number of concurrent bulk/interrupt transfer slots"
range 1 8
default 4
help
Number of concurrently active bulk/interrupt transfer slots. One slot
is always reserved for control transfers. Each additional slot allows
one more bulk or interrupt endpoint to stay posted simultaneously
(e.g. both IN and OUT for CDC-ECM data plus the interrupt notification
endpoint). Memory cost is one ED plus UHC_OHCI_MAX_TDS transfer
descriptors per slot.

config UHC_OHCI_MAX_TDS
int "Maximum TDs per transfer slot"
range 4 128
default 64
help
Maximum number of OHCI transfer descriptors per slot. The driver
allocates one pool of this size for the control slot and for each
bulk/interrupt slot (see UHC_OHCI_BULK_SLOTS).

endif # UHC_OHCI
Loading
Loading