FreeBSD kernel usb device Code
|
#include <sys/stdint.h>
#include <sys/stddef.h>
#include <sys/param.h>
#include <sys/queue.h>
#include <sys/types.h>
#include <sys/systm.h>
#include <sys/kernel.h>
#include <sys/bus.h>
#include <sys/module.h>
#include <sys/lock.h>
#include <sys/mutex.h>
#include <sys/condvar.h>
#include <sys/sysctl.h>
#include <sys/sx.h>
#include <sys/unistd.h>
#include <sys/callout.h>
#include <sys/malloc.h>
#include <sys/priv.h>
#include <sys/rman.h>
#include <dev/usb/usb.h>
#include <dev/usb/usbdi.h>
#include <dev/usb/usb_core.h>
#include <dev/usb/usb_debug.h>
#include <dev/usb/usb_busdma.h>
#include <dev/usb/usb_process.h>
#include <dev/usb/usb_transfer.h>
#include <dev/usb/usb_device.h>
#include <dev/usb/usb_hub.h>
#include <dev/usb/usb_util.h>
#include <dev/usb/usb_controller.h>
#include <dev/usb/usb_bus.h>
#include <dev/usb/controller/dwc_otg.h>
#include <dev/usb/controller/dwc_otgreg.h>
Go to the source code of this file.
Macros | |
#define | USB_DEBUG_VAR dwc_otg_debug |
#define | DWC_OTG_BUS2SC(bus) __containerof(bus, struct dwc_otg_softc, sc_bus) |
#define | DWC_OTG_PC2UDEV(pc) (USB_DMATAG_TO_XROOT((pc)->tag_parent)->udev) |
#define | DWC_OTG_MSK_GINT_THREAD_IRQ |
#define | DWC_OTG_PHY_DEFAULT DWC_OTG_PHY_ULPI |
#define | DWC_OTG_INTR_ENDPT 1 |
#define | HSETW(ptr, val) ptr = { (uint8_t)(val), (uint8_t)((val) >> 8) } |
#define | STRING_VENDOR "D\0W\0C\0O\0T\0G" |
#define | STRING_PRODUCT "O\0T\0G\0 \0R\0o\0o\0t\0 \0H\0U\0B" |
Functions | |
static | SYSCTL_NODE (_hw_usb, OID_AUTO, dwc_otg, CTLFLAG_RW|CTLFLAG_MPSAFE, 0, "USB DWC OTG") |
SYSCTL_INT (_hw_usb_dwc_otg, OID_AUTO, phy_type, CTLFLAG_RDTUN, &dwc_otg_phy_type, 0, "DWC OTG PHY TYPE - 0/1/2/3 - ULPI/HSIC/INTERNAL/UTMI+") | |
static void | dwc_otg_device_done (struct usb_xfer *, usb_error_t) |
static void | dwc_otg_do_poll (struct usb_bus *) |
static void | dwc_otg_standard_done (struct usb_xfer *) |
static void | dwc_otg_root_intr (struct dwc_otg_softc *) |
static void | dwc_otg_interrupt_poll_locked (struct dwc_otg_softc *) |
static void | dwc_otg_get_hw_ep_profile (struct usb_device *udev, const struct usb_hw_ep_profile **ppf, uint8_t ep_addr) |
static void | dwc_otg_write_fifo (struct dwc_otg_softc *sc, struct usb_page_cache *pc, uint32_t offset, uint32_t fifo, uint32_t count) |
static void | dwc_otg_read_fifo (struct dwc_otg_softc *sc, struct usb_page_cache *pc, uint32_t offset, uint32_t count) |
static void | dwc_otg_tx_fifo_reset (struct dwc_otg_softc *sc, uint32_t value) |
static int | dwc_otg_init_fifo (struct dwc_otg_softc *sc, uint8_t mode) |
static uint8_t | dwc_otg_uses_split (struct usb_device *udev) |
static void | dwc_otg_update_host_frame_interval (struct dwc_otg_softc *sc) |
static void | dwc_otg_clocks_on (struct dwc_otg_softc *sc) |
static void | dwc_otg_clocks_off (struct dwc_otg_softc *sc) |
static void | dwc_otg_pull_up (struct dwc_otg_softc *sc) |
static void | dwc_otg_pull_down (struct dwc_otg_softc *sc) |
static void | dwc_otg_enable_sof_irq (struct dwc_otg_softc *sc) |
static void | dwc_otg_resume_irq (struct dwc_otg_softc *sc) |
static void | dwc_otg_suspend_irq (struct dwc_otg_softc *sc) |
static void | dwc_otg_wakeup_peer (struct dwc_otg_softc *sc) |
static void | dwc_otg_set_address (struct dwc_otg_softc *sc, uint8_t addr) |
static void | dwc_otg_common_rx_ack (struct dwc_otg_softc *sc) |
static void | dwc_otg_clear_hcint (struct dwc_otg_softc *sc, uint8_t x) |
static uint8_t | dwc_otg_host_check_tx_fifo_empty (struct dwc_otg_softc *sc, struct dwc_otg_td *td) |
static uint8_t | dwc_otg_host_channel_alloc (struct dwc_otg_softc *sc, struct dwc_otg_td *td, uint8_t is_out) |
static void | dwc_otg_host_channel_free_sub (struct dwc_otg_softc *sc, struct dwc_otg_td *td, uint8_t index) |
static void | dwc_otg_host_channel_free (struct dwc_otg_softc *sc, struct dwc_otg_td *td) |
static void | dwc_otg_host_dump_rx (struct dwc_otg_softc *sc, struct dwc_otg_td *td) |
static uint8_t | dwc_otg_host_setup_tx (struct dwc_otg_softc *sc, struct dwc_otg_td *td) |
static uint8_t | dwc_otg_setup_rx (struct dwc_otg_softc *sc, struct dwc_otg_td *td) |
static uint8_t | dwc_otg_host_rate_check_interrupt (struct dwc_otg_softc *sc, struct dwc_otg_td *td) |
static uint8_t | dwc_otg_host_rate_check (struct dwc_otg_softc *sc, struct dwc_otg_td *td) |
static uint8_t | dwc_otg_host_data_rx_sub (struct dwc_otg_softc *sc, struct dwc_otg_td *td, uint8_t channel) |
static uint8_t | dwc_otg_host_data_rx (struct dwc_otg_softc *sc, struct dwc_otg_td *td) |
static uint8_t | dwc_otg_data_rx (struct dwc_otg_softc *sc, struct dwc_otg_td *td) |
static uint8_t | dwc_otg_host_data_tx (struct dwc_otg_softc *sc, struct dwc_otg_td *td) |
static uint8_t | dwc_otg_data_tx (struct dwc_otg_softc *sc, struct dwc_otg_td *td) |
static uint8_t | dwc_otg_data_tx_sync (struct dwc_otg_softc *sc, struct dwc_otg_td *td) |
static void | dwc_otg_xfer_do_fifo (struct dwc_otg_softc *sc, struct usb_xfer *xfer) |
static uint8_t | dwc_otg_xfer_do_complete_locked (struct dwc_otg_softc *sc, struct usb_xfer *xfer) |
static void | dwc_otg_timer (void *_sc) |
static void | dwc_otg_timer_start (struct dwc_otg_softc *sc) |
static void | dwc_otg_timer_stop (struct dwc_otg_softc *sc) |
static uint16_t | dwc_otg_compute_isoc_rx_tt_slot (struct dwc_otg_tt_info *pinfo) |
static uint8_t | dwc_otg_update_host_transfer_schedule_locked (struct dwc_otg_softc *sc) |
static void | dwc_otg_interrupt_complete_locked (struct dwc_otg_softc *sc) |
static void | dwc_otg_vbus_interrupt (struct dwc_otg_softc *sc, uint8_t is_on) |
int | dwc_otg_filter_interrupt (void *arg) |
void | dwc_otg_interrupt (void *arg) |
static void | dwc_otg_setup_standard_chain_sub (struct dwc_otg_std_temp *temp) |
static void | dwc_otg_setup_standard_chain (struct usb_xfer *xfer) |
static void | dwc_otg_timeout (void *arg) |
static void | dwc_otg_start_standard_chain (struct usb_xfer *xfer) |
static usb_error_t | dwc_otg_standard_done_sub (struct usb_xfer *xfer) |
static void | dwc_otg_xfer_stall (struct usb_xfer *xfer) |
static void | dwc_otg_set_stall (struct usb_device *udev, struct usb_endpoint *ep, uint8_t *did_stall) |
static void | dwc_otg_clear_stall_sub_locked (struct dwc_otg_softc *sc, uint32_t mps, uint8_t ep_no, uint8_t ep_type, uint8_t ep_dir) |
static void | dwc_otg_clear_stall (struct usb_device *udev, struct usb_endpoint *ep) |
static void | dwc_otg_device_state_change (struct usb_device *udev) |
int | dwc_otg_init (struct dwc_otg_softc *sc) |
void | dwc_otg_uninit (struct dwc_otg_softc *sc) |
static void | dwc_otg_suspend (struct dwc_otg_softc *sc) |
static void | dwc_otg_resume (struct dwc_otg_softc *sc) |
static void | dwc_otg_device_non_isoc_open (struct usb_xfer *xfer) |
static void | dwc_otg_device_non_isoc_close (struct usb_xfer *xfer) |
static void | dwc_otg_device_non_isoc_enter (struct usb_xfer *xfer) |
static void | dwc_otg_device_non_isoc_start (struct usb_xfer *xfer) |
static void | dwc_otg_device_isoc_open (struct usb_xfer *xfer) |
static void | dwc_otg_device_isoc_close (struct usb_xfer *xfer) |
static void | dwc_otg_device_isoc_enter (struct usb_xfer *xfer) |
static void | dwc_otg_device_isoc_start (struct usb_xfer *xfer) |
USB_MAKE_STRING_DESC (STRING_VENDOR, dwc_otg_vendor) | |
USB_MAKE_STRING_DESC (STRING_PRODUCT, dwc_otg_product) | |
static usb_error_t | dwc_otg_roothub_exec (struct usb_device *udev, struct usb_device_request *req, const void **pptr, uint16_t *plength) |
static void | dwc_otg_xfer_setup (struct usb_setup_params *parm) |
static void | dwc_otg_xfer_unsetup (struct usb_xfer *xfer) |
static void | dwc_otg_ep_init (struct usb_device *udev, struct usb_endpoint_descriptor *edesc, struct usb_endpoint *ep) |
static void | dwc_otg_set_hw_power_sleep (struct usb_bus *bus, uint32_t state) |
static void | dwc_otg_get_dma_delay (struct usb_device *udev, uint32_t *pus) |
static void | dwc_otg_device_resume (struct usb_device *udev) |
static void | dwc_otg_device_suspend (struct usb_device *udev) |
Variables | |
static int | dwc_otg_phy_type = DWC_OTG_PHY_DEFAULT |
static const struct usb_bus_methods | dwc_otg_bus_methods |
static const struct usb_pipe_methods | dwc_otg_device_non_isoc_methods |
static const struct usb_pipe_methods | dwc_otg_device_isoc_methods |
static dwc_otg_cmd_t | dwc_otg_setup_rx |
static dwc_otg_cmd_t | dwc_otg_data_rx |
static dwc_otg_cmd_t | dwc_otg_data_tx |
static dwc_otg_cmd_t | dwc_otg_data_tx_sync |
static dwc_otg_cmd_t | dwc_otg_host_setup_tx |
static dwc_otg_cmd_t | dwc_otg_host_data_tx |
static dwc_otg_cmd_t | dwc_otg_host_data_rx |
static const struct usb_hw_ep_profile | dwc_otg_ep_profile [1] |
static const struct usb_device_descriptor | dwc_otg_devd |
static const struct dwc_otg_config_desc | dwc_otg_confd |
static const struct usb_hub_descriptor_min | dwc_otg_hubd |
#define DWC_OTG_BUS2SC | ( | bus | ) | __containerof(bus, struct dwc_otg_softc, sc_bus) |
#define DWC_OTG_MSK_GINT_THREAD_IRQ |
#define DWC_OTG_PC2UDEV | ( | pc | ) | (USB_DMATAG_TO_XROOT((pc)->tag_parent)->udev) |
#define DWC_OTG_PHY_DEFAULT DWC_OTG_PHY_ULPI |
#define STRING_PRODUCT "O\0T\0G\0 \0R\0o\0o\0t\0 \0H\0U\0B" |
|
static |
Definition at line 703 of file dwc_otg.c.
References DOTG_HCINT, DWC_OTG_READ_4, DWC_OTG_WRITE_4, dwc_otg_chan_state::hcint, and dwc_otg_softc::sc_chan_state.
Referenced by dwc_otg_host_channel_alloc().
|
static |
Definition at line 3768 of file dwc_otg.c.
References usb_endpoint_descriptor::bEndpointAddress, usb_endpoint_descriptor::bmAttributes, usb_device::bus, DWC_OTG_BUS2SC, dwc_otg_clear_stall_sub_locked(), usb_endpoint::edesc, usb_device::flags, dwc_otg_softc::sc_bus, UE_ADDR, UE_DIR_IN, UE_DIR_OUT, UE_XFERTYPE, UGETW, USB_BUS_LOCK_ASSERT, USB_BUS_SPIN_LOCK, USB_BUS_SPIN_UNLOCK, usb_device_flags::usb_mode, USB_MODE_DEVICE, and usb_endpoint_descriptor::wMaxPacketSize.
|
static |
Definition at line 3705 of file dwc_otg.c.
References DIEPCTL_EPTYPE_BULK, DIEPCTL_EPTYPE_INTERRUPT, DIEPCTL_EPTYPE_ISOC, DIEPCTL_EPTYPE_SET, DIEPCTL_MPS_SET, DIEPCTL_SNAK, DIEPCTL_TXFNUM_SET, DIEPCTL_USBACTEP, DOEPCTL_EPDIS, DOEPCTL_SETD0PID, DOTG_DIEPCTL, DOTG_DIEPTSIZ, DOTG_DOEPCTL, dwc_otg_interrupt_complete_locked(), dwc_otg_interrupt_poll_locked(), dwc_otg_tx_fifo_reset(), DWC_OTG_WRITE_4, GRSTCTL_TXFFLSH, GRSTCTL_TXFIFO, reg, dwc_otg_softc::sc_active_rx_ep, dwc_otg_softc::sc_in_ctl, dwc_otg_softc::sc_out_ctl, UE_BULK, UE_CONTROL, and UE_INTERRUPT.
Referenced by dwc_otg_clear_stall().
|
static |
Definition at line 516 of file dwc_otg.c.
References dwc_otg_flags::clocks_off, and dwc_otg_softc::sc_flags.
Referenced by dwc_otg_init(), dwc_otg_roothub_exec(), and dwc_otg_uninit().
|
static |
Definition at line 503 of file dwc_otg.c.
References dwc_otg_flags::clocks_off, dwc_otg_flags::port_powered, and dwc_otg_softc::sc_flags.
Referenced by dwc_otg_init(), and dwc_otg_roothub_exec().
|
static |
Definition at line 682 of file dwc_otg.c.
References DOTG_GINTMSK, DWC_OTG_WRITE_4, GINTMSK_RXFLVLMSK, dwc_otg_softc::sc_bounce_buffer, dwc_otg_softc::sc_current_rx_bytes, dwc_otg_softc::sc_current_rx_fifo, dwc_otg_softc::sc_io_hdl, dwc_otg_softc::sc_io_tag, dwc_otg_softc::sc_irq_mask, and dwc_otg_softc::sc_last_rx_status.
Referenced by dwc_otg_data_rx(), dwc_otg_data_tx(), dwc_otg_data_tx_sync(), dwc_otg_host_channel_free_sub(), dwc_otg_host_data_rx_sub(), dwc_otg_host_dump_rx(), dwc_otg_interrupt_poll_locked(), dwc_otg_set_stall(), and dwc_otg_setup_rx().
|
static |
Definition at line 2481 of file dwc_otg.c.
References DWC_OTG_TT_SLOT_MAX, and dwc_otg_tt_info::slot_index.
Referenced by dwc_otg_update_host_transfer_schedule_locked().
|
static |
Definition at line 1662 of file dwc_otg.c.
References count, DIEPCTL_EPTYPE_ISOC, DIEPCTL_EPTYPE_MASK, DIEPCTL_EPTYPE_SHIFT, DIEPCTL_SETD0PID, DIEPCTL_SETD1PID, DOEPCTL_CNAK, DOEPCTL_EPENA, DOTG_DOEPCTL, DOTG_DOEPTSIZ, dwc_otg_common_rx_ack(), dwc_otg_read_fifo(), DWC_OTG_WRITE_4, DXEPTSIZ_SET_MULTI, DXEPTSIZ_SET_NBYTES, DXEPTSIZ_SET_NPKT, dwc_otg_td::ep_no, dwc_otg_td::error_any, GRXSTSRD_BCNT_GET, GRXSTSRD_CHNUM_GET, GRXSTSRD_OUT_DATA, GRXSTSRD_PKTSTS_MASK, GRXSTSRD_STP_COMPLETE, GRXSTSRD_STP_DATA, dwc_otg_td::max_packet_size, dwc_otg_td::offset, dwc_otg_td::pc, dwc_otg_td::remainder, dwc_otg_softc::sc_last_rx_status, dwc_otg_softc::sc_out_ctl, and dwc_otg_td::short_pkt.
|
static |
Definition at line 2128 of file dwc_otg.c.
References count, DIEPCTL_CNAK, DIEPCTL_EPENA, DIEPCTL_EPTYPE_ISOC, DIEPCTL_EPTYPE_MASK, DIEPCTL_EPTYPE_SHIFT, DIEPCTL_SETD0PID, DIEPCTL_SETD1PID, DOTG_DFIFO, DOTG_DIEPCTL, DOTG_DIEPTSIZ, dwc_otg_common_rx_ack(), DWC_OTG_READ_4, DWC_OTG_WRITE_4, dwc_otg_write_fifo(), DXEPTSIZ_GET_NPKT, DXEPTSIZ_SET_MULTI, DXEPTSIZ_SET_NBYTES, DXEPTSIZ_SET_NPKT, dwc_otg_td::ep_no, dwc_otg_td::error_any, GRXSTSRD_CHNUM_GET, GRXSTSRD_PKTSTS_MASK, GRXSTSRD_STP_COMPLETE, GRXSTSRD_STP_DATA, dwc_otg_profile::max_buffer, dwc_otg_td::max_packet_size, dwc_otg_td::npkt, dwc_otg_td::offset, dwc_otg_td::pc, dwc_otg_td::remainder, dwc_otg_softc::sc_hw_ep_profile, dwc_otg_softc::sc_in_ctl, dwc_otg_softc::sc_last_rx_status, dwc_otg_td::short_pkt, and dwc_otg_td::tx_bytes.
|
static |
Definition at line 2317 of file dwc_otg.c.
References DOTG_DIEPTSIZ, dwc_otg_common_rx_ack(), DWC_OTG_READ_4, DXEPTSIZ_GET_NPKT, dwc_otg_td::ep_no, GRXSTSRD_CHNUM_GET, GRXSTSRD_PKTSTS_MASK, GRXSTSRD_STP_COMPLETE, GRXSTSRD_STP_DATA, and dwc_otg_softc::sc_last_rx_status.
|
static |
Definition at line 3619 of file dwc_otg.c.
References usb_xfer_root::bus, DWC_OTG_BUS2SC, dwc_otg_host_channel_free(), usb_xfer::endpoint, error, usb_xfer::flags_int, dwc_otg_softc::sc_bus, usb_xfer::td_transfer_cache, USB_BUS_SPIN_LOCK, USB_BUS_SPIN_UNLOCK, usb_xfer_flags_int::usb_mode, USB_MODE_DEVICE, usbd_transfer_done(), and usb_xfer::xroot.
Referenced by dwc_otg_device_isoc_close(), dwc_otg_device_non_isoc_close(), dwc_otg_standard_done(), dwc_otg_timeout(), and dwc_otg_xfer_stall().
|
static |
Definition at line 4176 of file dwc_otg.c.
References dwc_otg_device_done(), and USB_ERR_CANCELLED.
|
static |
|
static |
|
static |
Definition at line 4187 of file dwc_otg.c.
References usb_xfer_root::bus, DOTG_DSTS, DOTG_HFNUM, DSTS_SOFFN_GET, DWC_OTG_BUS2SC, DWC_OTG_FRAME_MASK, DWC_OTG_READ_4, dwc_otg_setup_standard_chain(), dwc_otg_start_standard_chain(), usb_xfer::endpoint, usb_device::flags, HFNUM_FRNUM_MASK, usb_endpoint::isoc_next, usb_xfer::nframes, dwc_otg_softc::sc_flags, dwc_otg_flags::status_high_speed, usb_xfer_root::udev, usb_device_flags::usb_mode, USB_MODE_HOST, usbd_xfer_get_isochronous_start_frame(), and usb_xfer::xroot.
|
static |
Definition at line 4141 of file dwc_otg.c.
References dwc_otg_device_done(), and USB_ERR_CANCELLED.
|
static |
|
static |
|
static |
Definition at line 4152 of file dwc_otg.c.
References dwc_otg_setup_standard_chain(), and dwc_otg_start_standard_chain().
|
static |
Definition at line 4941 of file dwc_otg.c.
References usb_device::bus, DPRINTF, and dwc_otg_do_poll().
|
static |
Definition at line 3801 of file dwc_otg.c.
References usb_device::bus, DIEPCTL_EPDIS, DOEPCTL_EPDIS, DOTG_DIEPCTL, DOTG_DOEPCTL, DWC_OTG_BUS2SC, DWC_OTG_WRITE_4, usb_device::flags, dwc_otg_softc::sc_bus, dwc_otg_softc::sc_dev_ep_max, dwc_otg_softc::sc_dev_in_ep_max, usb_device::state, USB_BUS_LOCK, USB_BUS_UNLOCK, usb_device_flags::usb_mode, USB_MODE_DEVICE, USB_STATE_ADDRESSED, and USB_STATE_CONFIGURED.
|
static |
|
static |
Definition at line 4118 of file dwc_otg.c.
References bus, DWC_OTG_BUS2SC, dwc_otg_interrupt_complete_locked(), dwc_otg_interrupt_poll_locked(), dwc_otg_softc::sc_bus, USB_BUS_LOCK, USB_BUS_SPIN_LOCK, USB_BUS_SPIN_UNLOCK, and USB_BUS_UNLOCK.
Referenced by dwc_otg_device_resume(), and dwc_otg_init().
|
static |
Definition at line 561 of file dwc_otg.c.
References DOTG_GINTMSK, DWC_OTG_WRITE_4, GINTMSK_SOFMSK, dwc_otg_softc::sc_flags, dwc_otg_softc::sc_irq_mask, dwc_otg_softc::sc_needsof, and dwc_otg_flags::status_device_mode.
Referenced by dwc_otg_host_channel_alloc(), dwc_otg_host_rate_check(), dwc_otg_start_standard_chain(), and dwc_otg_timer().
|
static |
Definition at line 4879 of file dwc_otg.c.
References usb_device::address, usb_endpoint_descriptor::bEndpointAddress, usb_endpoint_descriptor::bmAttributes, usb_device::bus, usb_device::device_index, DWC_OTG_BUS2SC, dwc_otg_device_isoc_methods, dwc_otg_device_non_isoc_methods, usb_device::flags, usb_endpoint::methods, dwc_otg_softc::sc_rt_addr, usb_device::speed, UE_ISOCHRONOUS, UE_XFERTYPE, usb_device_flags::usb_mode, USB_MODE_DEVICE, USB_SPEED_FULL, USB_SPEED_HIGH, and usb_endpoint_descriptor::wMaxPacketSize.
int dwc_otg_filter_interrupt | ( | void * | arg | ) |
Definition at line 2850 of file dwc_otg.c.
References DOTG_DIEPINT, DOTG_GINTMSK, DOTG_GINTSTS, dwc_otg_interrupt_poll_locked(), DWC_OTG_MSK_GINT_THREAD_IRQ, DWC_OTG_READ_4, DWC_OTG_WRITE_4, GINTSTS_IEPINT, GINTSTS_NPTXFEMP, GINTSTS_PTXFEMP, dwc_otg_softc::sc_bus, dwc_otg_softc::sc_dev_in_ep_max, dwc_otg_softc::sc_irq_mask, dwc_otg_softc::sc_xfer_complete, status, USB_BUS_SPIN_LOCK, and USB_BUS_SPIN_UNLOCK.
Referenced by dwc_otg_init().
|
static |
|
static |
Definition at line 157 of file dwc_otg.c.
References usb_device::bus, DWC_OTG_BUS2SC, dwc_otg_softc::sc_dev_ep_max, dwc_otg_softc::sc_hw_ep_profile, and dwc_otg_profile::usb.
Referenced by dwc_otg_xfer_setup().
|
static |
Definition at line 750 of file dwc_otg.c.
References dwc_otg_chan_state::allocated, dwc_otg_td::channel, DPRINTF, dwc_otg_clear_hcint(), dwc_otg_enable_sof_irq(), dwc_otg_host_check_tx_fifo_empty(), DWC_OTG_MAX_CHANNELS, DWC_OTG_PC2UDEV, dwc_otg_td::hcchar, dwc_otg_td::hcsplt, dwc_otg_td::max_packet_count, dwc_otg_td::pc, dwc_otg_softc::sc_active_rx_ep, dwc_otg_softc::sc_chan_state, dwc_otg_softc::sc_host_ch_max, and dwc_otg_chan_state::wait_halted.
Referenced by dwc_otg_host_data_rx(), dwc_otg_host_data_tx(), and dwc_otg_host_setup_tx().
|
static |
Definition at line 861 of file dwc_otg.c.
References dwc_otg_host_channel_free_sub(), and dwc_otg_td::max_packet_count.
Referenced by dwc_otg_device_done(), dwc_otg_host_data_rx(), dwc_otg_host_data_tx(), and dwc_otg_host_setup_tx().
|
static |
Definition at line 815 of file dwc_otg.c.
References dwc_otg_chan_state::allocated, dwc_otg_td::channel, DOTG_HCCHAR, DPRINTF, dwc_otg_common_rx_ack(), DWC_OTG_MAX_CHANNELS, DWC_OTG_READ_4, DWC_OTG_WRITE_4, GRXSTSRD_CHNUM_GET, HCCHAR_CHDIS, HCCHAR_CHENA, index, dwc_otg_softc::sc_active_rx_ep, dwc_otg_softc::sc_chan_state, dwc_otg_softc::sc_last_rx_status, and dwc_otg_chan_state::wait_halted.
Referenced by dwc_otg_host_channel_free().
|
static |
Definition at line 716 of file dwc_otg.c.
References DOTG_GINTMSK, DOTG_GINTSTS, DPRINTF, DWC_OTG_READ_4, DWC_OTG_WRITE_4, dwc_otg_td::ep_type, GINTMSK_NPTXFEMPMSK, GINTMSK_PTXFEMPMSK, GINTSTS_NPTXFEMP, GINTSTS_PTXFEMP, dwc_otg_softc::sc_irq_mask, and UE_ISOCHRONOUS.
Referenced by dwc_otg_host_channel_alloc().
|
static |
Definition at line 1352 of file dwc_otg.c.
References dwc_otg_td::channel, dwc_otg_td::did_nak, DOTG_HCCHAR, DOTG_HCSPLT, DOTG_HCTSIZ, DPRINTF, DWC_CHAN_ST_START, DWC_CHAN_ST_WAIT_ANE, DWC_CHAN_ST_WAIT_C_PKT, DWC_CHAN_ST_WAIT_S_ANE, dwc_otg_host_channel_alloc(), dwc_otg_host_channel_free(), dwc_otg_host_data_rx_sub(), dwc_otg_host_rate_check(), DWC_OTG_MAX_CHANNELS, DWC_OTG_READ_4, DWC_OTG_TT_SLOT_MAX, DWC_OTG_WRITE_4, dwc_otg_td::ep_type, dwc_otg_td::errcnt, dwc_otg_td::error_any, dwc_otg_td::error_stall, dwc_otg_td::got_short, dwc_otg_td::hcchar, HCCHAR_EPDIR_IN, HCCHAR_ODDFRM, dwc_otg_chan_state::hcint, HCINT_ACK, HCINT_DATATGLERR, HCINT_ERRORS, HCINT_NYET, HCINT_RETRY, HCINT_SOFTWARE_ONLY, HCINT_STALL, dwc_otg_td::hcsplt, HCSPLT_COMPSPLT, HCSPLT_XACTPOS_BEGIN, HCTSIZ_PID_DATA0, HCTSIZ_PID_DATA1, HCTSIZ_PID_SHIFT, HCTSIZ_PKTCNT_SHIFT, HCTSIZ_XFERSIZE_SHIFT, dwc_otg_td::max_packet_count, dwc_otg_td::max_packet_size, dwc_otg_td::remainder, dwc_otg_softc::sc_chan_state, dwc_otg_softc::sc_last_frame_num, dwc_otg_td::set_toggle, dwc_otg_td::short_pkt, dwc_otg_td::state, dwc_otg_td::toggle, dwc_otg_td::tt_complete_slot, dwc_otg_td::tt_scheduled, dwc_otg_td::tt_start_slot, dwc_otg_td::tt_xactpos, UE_INTERRUPT, and UE_ISOCHRONOUS.
|
static |
Definition at line 1254 of file dwc_otg.c.
References count, DPRINTF, dwc_otg_common_rx_ack(), DWC_OTG_MAX_CHANNELS, dwc_otg_read_fifo(), dwc_otg_td::ep_type, dwc_otg_td::error_any, dwc_otg_td::got_short, GRXSTSRD_BCNT_GET, GRXSTSRD_CHNUM_GET, GRXSTSRD_DPID_DATA0, GRXSTSRD_DPID_MASK, GRXSTSRD_PKTSTS_MASK, GRXSTSRH_IN_DATA, dwc_otg_chan_state::hcint, HCINT_SOFTWARE_ONLY, HCSPLT_XACTPOS_BEGIN, HCSPLT_XACTPOS_MIDDLE, dwc_otg_td::max_packet_size, dwc_otg_td::offset, dwc_otg_td::pc, dwc_otg_td::remainder, dwc_otg_softc::sc_chan_state, dwc_otg_softc::sc_last_rx_status, dwc_otg_td::short_pkt, dwc_otg_td::state, dwc_otg_td::toggle, dwc_otg_td::tt_scheduled, dwc_otg_td::tt_xactpos, and UE_ISOCHRONOUS.
Referenced by dwc_otg_host_data_rx().
|
static |
Definition at line 1790 of file dwc_otg.c.
References dwc_otg_td::channel, count, dwc_otg_td::did_nak, DOTG_DFIFO, DOTG_HCCHAR, DOTG_HCSPLT, DOTG_HCTSIZ, DPRINTF, DWC_CHAN_ST_START, DWC_CHAN_ST_TX_WAIT_ISOC, DWC_CHAN_ST_WAIT_ANE, DWC_CHAN_ST_WAIT_C_ANE, DWC_CHAN_ST_WAIT_C_PKT, DWC_CHAN_ST_WAIT_S_ANE, dwc_otg_host_channel_alloc(), dwc_otg_host_channel_free(), dwc_otg_host_dump_rx(), dwc_otg_host_rate_check(), DWC_OTG_MAX_CHANNELS, DWC_OTG_READ_4, DWC_OTG_TT_SLOT_MAX, DWC_OTG_WRITE_4, dwc_otg_write_fifo(), dwc_otg_td::ep_type, dwc_otg_td::errcnt, dwc_otg_td::error_any, dwc_otg_td::error_stall, dwc_otg_td::hcchar, HCCHAR_ODDFRM, dwc_otg_chan_state::hcint, HCINT_ACK, HCINT_ERRORS, HCINT_HCH_DONE_MASK, HCINT_NYET, HCINT_RETRY, HCINT_STALL, dwc_otg_td::hcsplt, HCSPLT_COMPSPLT, HCSPLT_XACTLEN_BURST, HCSPLT_XACTPOS_ALL, HCSPLT_XACTPOS_SHIFT, HCTSIZ_PID_DATA0, HCTSIZ_PID_DATA1, HCTSIZ_PID_DATA2, HCTSIZ_PID_MDATA, HCTSIZ_PID_SHIFT, HCTSIZ_PKTCNT_SHIFT, HCTSIZ_XFERSIZE_SHIFT, dwc_otg_td::max_packet_count, dwc_otg_td::max_packet_size, dwc_otg_td::npkt, dwc_otg_td::offset, dwc_otg_td::pc, dwc_otg_td::remainder, dwc_otg_softc::sc_chan_state, dwc_otg_softc::sc_last_frame_num, dwc_otg_td::set_toggle, dwc_otg_td::short_pkt, dwc_otg_td::state, dwc_otg_td::toggle, dwc_otg_td::tt_complete_slot, dwc_otg_td::tt_scheduled, dwc_otg_td::tt_start_slot, dwc_otg_td::tx_bytes, and UE_ISOCHRONOUS.
|
static |
Definition at line 869 of file dwc_otg.c.
References dwc_otg_td::channel, dwc_otg_common_rx_ack(), DWC_OTG_MAX_CHANNELS, GRXSTSRD_CHNUM_GET, dwc_otg_td::max_packet_count, and dwc_otg_softc::sc_last_rx_status.
Referenced by dwc_otg_host_data_tx(), and dwc_otg_host_setup_tx().
|
static |
Definition at line 1216 of file dwc_otg.c.
References dwc_otg_td::did_nak, dwc_otg_enable_sof_irq(), dwc_otg_td::ep_type, dwc_otg_softc::sc_last_frame_num, dwc_otg_td::set_toggle, dwc_otg_td::tmr_res, dwc_otg_td::tmr_val, dwc_otg_td::toggle, dwc_otg_td::tt_scheduled, UE_INTERRUPT, and UE_ISOCHRONOUS.
Referenced by dwc_otg_host_data_rx(), and dwc_otg_host_data_tx().
|
static |
Definition at line 1197 of file dwc_otg.c.
References dwc_otg_softc::sc_tmr_val, dwc_otg_td::set_toggle, dwc_otg_td::tmr_res, dwc_otg_td::tmr_val, and dwc_otg_td::toggle.
Referenced by dwc_otg_update_host_transfer_schedule_locked().
|
static |
Definition at line 885 of file dwc_otg.c.
References __aligned, dwc_otg_td::channel, dwc_otg_td::did_nak, DOTG_DFIFO, DOTG_HCCHAR, DOTG_HCSPLT, DOTG_HCTSIZ, DPRINTF, DWC_CHAN_ST_START, DWC_CHAN_ST_WAIT_ANE, DWC_CHAN_ST_WAIT_C_ANE, DWC_CHAN_ST_WAIT_C_PKT, DWC_CHAN_ST_WAIT_S_ANE, dwc_otg_host_channel_alloc(), dwc_otg_host_channel_free(), dwc_otg_host_dump_rx(), DWC_OTG_MAX_CHANNELS, DWC_OTG_READ_4, DWC_OTG_TT_SLOT_MAX, DWC_OTG_WRITE_4, dwc_otg_td::ep_type, dwc_otg_td::errcnt, dwc_otg_td::error_any, dwc_otg_td::error_stall, dwc_otg_td::hcchar, HCCHAR_EPDIR_IN, HCCHAR_EPTYPE_MASK, HCCHAR_EPTYPE_SHIFT, dwc_otg_chan_state::hcint, HCINT_ACK, HCINT_ERRORS, HCINT_NYET, HCINT_RETRY, HCINT_STALL, dwc_otg_td::hcsplt, HCSPLT_COMPSPLT, HCTSIZ_PID_SETUP, HCTSIZ_PID_SHIFT, HCTSIZ_PKTCNT_SHIFT, HCTSIZ_XFERSIZE_SHIFT, dwc_otg_td::offset, dwc_otg_td::pc, dwc_otg_td::remainder, req, dwc_otg_softc::sc_chan_state, dwc_otg_softc::sc_io_hdl, dwc_otg_softc::sc_io_tag, dwc_otg_softc::sc_last_frame_num, dwc_otg_td::state, dwc_otg_td::toggle, dwc_otg_td::tt_complete_slot, dwc_otg_td::tt_scheduled, dwc_otg_td::tt_start_slot, dwc_otg_td::tx_bytes, UE_CONTROL, UE_ISOCHRONOUS, and usbd_copy_out().
int dwc_otg_init | ( | struct dwc_otg_softc * | sc | ) |
Definition at line 3836 of file dwc_otg.c.
References usb_bus::bdev, usb_bus::bus_mtx, DCTL_CGNPINNAK, DCTL_CGOUTNAK, DCTL_SFTDISCON, usb_bus::devices, usb_bus::devices_max, DIEPMSK_XFERCOMPLMSK, usb_bus::dma_bits, DOTG_DAINTMSK, DOTG_DCTL, DOTG_DEACHINTMSK, DOTG_DIEPEACHINTMSK, DOTG_DIEPMSK, DOTG_DOEPEACHINTMSK, DOTG_DOEPMSK, DOTG_GAHBCFG, DOTG_GGPIO, DOTG_GGPIO_I2CPADEN, DOTG_GGPIO_NOVBUSSENS, DOTG_GGPIO_PWRDWN, DOTG_GGPIO_VBUSASEN, DOTG_GGPIO_VBUSBSEN, DOTG_GHWCFG2, DOTG_GHWCFG3, DOTG_GHWCFG4, DOTG_GINTMSK, DOTG_GLPMCFG, DOTG_GOTGCTL, DOTG_GRSTCTL, DOTG_GSNPSID, DOTG_GUSBCFG, DOTG_HCFG, DOTG_PCGCCTL, DPRINTF, DWC_MODE_DEVICE, DWC_MODE_HOST, DWC_MODE_OTG, dwc_otg_bus_methods, dwc_otg_clocks_off(), dwc_otg_clocks_on(), dwc_otg_do_poll(), dwc_otg_filter_interrupt(), dwc_otg_init_fifo(), dwc_otg_interrupt(), DWC_OTG_MAX_CHANNELS, DWC_OTG_MAX_DEVICES, DWC_OTG_MAX_ENDPOINTS, DWC_OTG_MSK_GINT_THREAD_IRQ, DWC_OTG_PHY_HSIC, DWC_OTG_PHY_INTERNAL, dwc_otg_phy_type, DWC_OTG_PHY_ULPI, DWC_OTG_PHY_UTMI, DWC_OTG_READ_4, dwc_otg_vbus_interrupt(), DWC_OTG_WRITE_4, GAHBCFG_GLBLINTRMSK, GHWCFG2_MPI, GHWCFG2_NUMDEVEPS_GET, GHWCFG2_NUMHSTCHNL_GET, GHWCFG3_DFIFODEPTH_GET, GHWCFG4_NUM_IN_EP_GET, GLPMCFG_HSIC_CONN, GOTGCTL_ASESVLD, GOTGCTL_BSESVLD, GRSTCTL_CSFTRST, GUSBCFG_FORCEDEVMODE, GUSBCFG_FORCEHOSTMODE, GUSBCFG_PHYIF, GUSBCFG_PHYSEL, GUSBCFG_TRD_TIM_SET, GUSBCFG_ULPI_UTMI_SEL, HCFG_FSLSPCLKSEL_MASK, HCFG_FSLSPCLKSEL_SHIFT, HCFG_FSLSSUPP, usb_bus::methods, usb_bus::parent, dwc_otg_softc::sc_bus, dwc_otg_softc::sc_dev_ep_max, dwc_otg_softc::sc_dev_in_ep_max, dwc_otg_softc::sc_devices, dwc_otg_softc::sc_fifo_size, dwc_otg_softc::sc_host_ch_max, dwc_otg_softc::sc_intr_hdl, dwc_otg_softc::sc_io_hdl, dwc_otg_softc::sc_io_res, dwc_otg_softc::sc_io_size, dwc_otg_softc::sc_io_tag, dwc_otg_softc::sc_irq_mask, dwc_otg_softc::sc_irq_res, dwc_otg_softc::sc_mode, dwc_otg_softc::sc_phy_bits, dwc_otg_softc::sc_phy_type, dwc_otg_softc::sc_timer, USB_BUS_LOCK, usb_bus_mem_alloc_all(), USB_BUS_UNLOCK, usb_callout_init_mtx, USB_GET_DMA_TAG, usb_pause_mtx(), USB_REV_2_0, and usb_bus::usbrev.
Referenced by dwc_otg_attach().
|
static |
Definition at line 291 of file dwc_otg.c.
References DOTG_DIEPTXF, DOTG_GINTMSK, DOTG_GNPTXFSIZ, DOTG_GRXFSIZ, DOTG_HAINTMSK, DOTG_HCINTMSK, DOTG_HPTXFSIZ, DPRINTF, DWC_MODE_DEVICE, DWC_MODE_HOST, DWC_MODE_OTG, dwc_otg_ep_profile, DWC_OTG_MAX_TXN, dwc_otg_tx_fifo_reset(), DWC_OTG_TX_MAX_FIFO_SIZE, DWC_OTG_WRITE_4, GINTMSK_HCHINTMSK, GINTMSK_IEPINTMSK, GRSTCTL_RXFFLSH, GRSTCTL_TXFFLSH, GRSTCTL_TXFIFO, HCINT_DEFAULT_MASK, pf, dwc_otg_softc::sc_active_rx_ep, dwc_otg_softc::sc_chan_state, dwc_otg_softc::sc_dev_ep_max, dwc_otg_softc::sc_fifo_size, dwc_otg_softc::sc_host_ch_max, dwc_otg_softc::sc_hw_ep_profile, dwc_otg_softc::sc_irq_mask, and dwc_otg_profile::usb.
Referenced by dwc_otg_init(), dwc_otg_interrupt(), and dwc_otg_roothub_exec().
void dwc_otg_interrupt | ( | void * | arg | ) |
Definition at line 2903 of file dwc_otg.c.
References dwc_otg_flags::change_connect, dwc_otg_flags::change_enabled, dwc_otg_flags::change_over_current, dwc_otg_flags::change_suspend, DOTG_DSTS, DOTG_GINTMSK, DOTG_GINTSTS, DOTG_GOTGCTL, DOTG_HAINT, DOTG_HFNUM, DOTG_HPRT, DSTS_ENUMSPD_GET, DSTS_ENUMSPD_HI, DWC_MODE_DEVICE, dwc_otg_init_fifo(), dwc_otg_interrupt_complete_locked(), DWC_OTG_MSK_GINT_THREAD_IRQ, DWC_OTG_READ_4, dwc_otg_resume_irq(), dwc_otg_root_intr(), dwc_otg_set_address(), dwc_otg_suspend_irq(), dwc_otg_update_host_frame_interval(), dwc_otg_vbus_interrupt(), DWC_OTG_WRITE_4, GINTMSK_OTGINTMSK, GINTMSK_SOFMSK, GINTMSK_USBSUSPMSK, GINTMSK_WKUPINTMSK, GINTSTS_ENUMDONE, GINTSTS_PRTINT, GINTSTS_SESSREQINT, GINTSTS_USBRST, GINTSTS_USBSUSP, GINTSTS_WKUPINT, GOTGCTL_ASESVLD, GOTGCTL_BSESVLD, HPRT_PRTCONNDET, HPRT_PRTCONNSTS, HPRT_PRTENA, HPRT_PRTENCHNG, HPRT_PRTOVRCURRACT, HPRT_PRTOVRCURRCHNG, HPRT_PRTPWR, HPRT_PRTSPD_HIGH, HPRT_PRTSPD_LOW, HPRT_PRTSPD_MASK, HPRT_PRTSPD_SHIFT, HPRT_PRTSUSP, dwc_otg_flags::port_enabled, dwc_otg_flags::port_over_current, dwc_otg_flags::port_powered, dwc_otg_softc::sc_bus, dwc_otg_softc::sc_flags, dwc_otg_softc::sc_hprt_val, dwc_otg_softc::sc_irq_mask, dwc_otg_softc::sc_xfer_complete, status, dwc_otg_flags::status_bus_reset, dwc_otg_flags::status_device_mode, dwc_otg_flags::status_high_speed, dwc_otg_flags::status_low_speed, dwc_otg_flags::status_suspend, USB_BUS_LOCK, USB_BUS_SPIN_LOCK, USB_BUS_SPIN_UNLOCK, and USB_BUS_UNLOCK.
Referenced by dwc_otg_init().
|
static |
Definition at line 2806 of file dwc_otg.c.
References dwc_otg_xfer_do_complete_locked(), usb_bus::intr_q, and dwc_otg_softc::sc_bus.
Referenced by dwc_otg_clear_stall_sub_locked(), dwc_otg_do_poll(), dwc_otg_interrupt(), and dwc_otg_set_stall().
|
static |
Definition at line 2678 of file dwc_otg.c.
References count, DOTG_DFIFO, DOTG_GINTMSK, DOTG_GINTSTS, DOTG_GRXSTSPD, DOTG_HAINT, DOTG_HCINT, DPRINTF, dwc_otg_common_rx_ack(), DWC_OTG_READ_4, dwc_otg_update_host_transfer_schedule_locked(), DWC_OTG_WRITE_4, dwc_otg_xfer_do_fifo(), GINTSTS_RXFLVL, GRXSTSRD_BCNT_GET, GRXSTSRD_CHNUM_GET, GRXSTSRD_OUT_DATA, GRXSTSRD_PKTSTS_MASK, GRXSTSRD_STP_COMPLETE, GRXSTSRD_STP_DATA, GRXSTSRH_HALTED, dwc_otg_chan_state::hcint, usb_bus::intr_q, dwc_otg_softc::sc_active_rx_ep, dwc_otg_softc::sc_bus, dwc_otg_softc::sc_chan_state, dwc_otg_softc::sc_current_rx_bytes, dwc_otg_softc::sc_current_rx_fifo, dwc_otg_softc::sc_flags, dwc_otg_softc::sc_host_ch_max, dwc_otg_softc::sc_irq_mask, dwc_otg_softc::sc_last_rx_status, dwc_otg_flags::status_device_mode, and dwc_otg_chan_state::wait_halted.
Referenced by dwc_otg_clear_stall_sub_locked(), dwc_otg_do_poll(), dwc_otg_filter_interrupt(), and dwc_otg_set_stall().
|
static |
Definition at line 545 of file dwc_otg.c.
References dwc_otg_flags::d_pulled_up, DCTL_SFTDISCON, DOTG_DCTL, DWC_OTG_READ_4, DWC_OTG_WRITE_4, and dwc_otg_softc::sc_flags.
Referenced by dwc_otg_roothub_exec(), and dwc_otg_uninit().
|
static |
Definition at line 528 of file dwc_otg.c.
References dwc_otg_flags::d_pulled_up, DOTG_DCTL, DWC_OTG_READ_4, DWC_OTG_WRITE_4, dwc_otg_flags::port_powered, and dwc_otg_softc::sc_flags.
Referenced by dwc_otg_roothub_exec().
|
static |
Definition at line 221 of file dwc_otg.c.
References usb_page_search::buffer, count, usb_page_search::length, offset, dwc_otg_softc::sc_bounce_buffer, dwc_otg_softc::sc_current_rx_bytes, dwc_otg_softc::sc_current_rx_fifo, dwc_otg_softc::sc_io_hdl, dwc_otg_softc::sc_io_tag, usb_pc_buffer_is_aligned(), usbd_copy_in(), and usbd_get_page().
Referenced by dwc_otg_data_rx(), dwc_otg_host_data_rx_sub(), and dwc_otg_setup_rx().
|
static |
Definition at line 4112 of file dwc_otg.c.
Referenced by dwc_otg_set_hw_power_sleep().
|
static |
Definition at line 576 of file dwc_otg.c.
References dwc_otg_flags::change_suspend, DOTG_GINTMSK, dwc_otg_root_intr(), DWC_OTG_WRITE_4, GINTMSK_USBSUSPMSK, dwc_otg_softc::sc_flags, dwc_otg_softc::sc_irq_mask, dwc_otg_flags::status_device_mode, and dwc_otg_flags::status_suspend.
Referenced by dwc_otg_interrupt(), and dwc_otg_wakeup_peer().
|
static |
Definition at line 3492 of file dwc_otg.c.
References dwc_otg_softc::sc_bus, dwc_otg_softc::sc_hub_idata, uhub_root_intr(), and USB_BUS_LOCK_ASSERT.
Referenced by dwc_otg_interrupt(), dwc_otg_resume_irq(), dwc_otg_suspend_irq(), and dwc_otg_vbus_interrupt().
|
static |
Definition at line 4303 of file dwc_otg.c.
References usb_device::bus, usb_bus::bus_mtx, dwc_otg_flags::change_connect, dwc_otg_flags::change_enabled, dwc_otg_flags::change_over_current, dwc_otg_flags::change_reset, dwc_otg_flags::change_suspend, DOTG_HPRT, DPRINTF, DWC_MODE_DEVICE, DWC_MODE_HOST, DWC_MODE_OTG, DWC_OTG_BUS2SC, dwc_otg_clocks_off(), dwc_otg_clocks_on(), dwc_otg_confd, dwc_otg_devd, dwc_otg_hubd, dwc_otg_init_fifo(), dwc_otg_pull_down(), dwc_otg_pull_up(), dwc_otg_suspend_irq(), dwc_otg_timer_start(), dwc_otg_timer_stop(), dwc_otg_wakeup_peer(), DWC_OTG_WRITE_4, HPRT_PRTENA, HPRT_PRTPWR, HPRT_PRTRST, HPRT_PRTSUSP, index, len, dwc_otg_flags::port_enabled, dwc_otg_flags::port_over_current, dwc_otg_flags::port_powered, pptr, dwc_otg_hub_temp::ps, req, dwc_otg_softc::sc_bus, dwc_otg_softc::sc_conf, dwc_otg_softc::sc_flags, dwc_otg_softc::sc_hprt_val, dwc_otg_softc::sc_hub_temp, dwc_otg_softc::sc_mode, dwc_otg_softc::sc_rt_addr, dwc_otg_flags::status_bus_reset, dwc_otg_flags::status_device_mode, dwc_otg_flags::status_high_speed, dwc_otg_flags::status_low_speed, dwc_otg_flags::status_suspend, dwc_otg_flags::status_vbus, UDESC_CONFIG, UDESC_DEVICE, UDESC_STRING, UDS_SELF_POWERED, UF_DEVICE_REMOTE_WAKEUP, UF_ENDPOINT_HALT, UGETW, UHF_C_PORT_CONNECTION, UHF_C_PORT_ENABLE, UHF_C_PORT_OVER_CURRENT, UHF_C_PORT_RESET, UHF_C_PORT_SUSPEND, UHF_PORT_ENABLE, UHF_PORT_INDICATOR, UHF_PORT_POWER, UHF_PORT_RESET, UHF_PORT_SUSPEND, UHF_PORT_TEST, UPS_C_CONNECT_STATUS, UPS_C_OVERCURRENT_INDICATOR, UPS_C_PORT_ENABLED, UPS_C_PORT_RESET, UPS_C_SUSPEND, UPS_CURRENT_CONNECT_STATUS, UPS_HIGH_SPEED, UPS_LOW_SPEED, UPS_OVERCURRENT_INDICATOR, UPS_PORT_ENABLED, UPS_PORT_MODE_DEVICE, UPS_PORT_POWER, UPS_SUSPEND, UR_CLEAR_FEATURE, UR_CLEAR_TT_BUFFER, UR_GET_CONFIG, UR_GET_DESCRIPTOR, UR_GET_INTERFACE, UR_GET_STATUS, UR_GET_TT_STATE, UR_RESET_TT, UR_SET_ADDRESS, UR_SET_CONFIG, UR_SET_DESCRIPTOR, UR_SET_FEATURE, UR_SET_INTERFACE, UR_STOP_TT, UR_SYNCH_FRAME, USB_BUS_LOCK_ASSERT, USB_ERR_IOERROR, USB_ERR_STALLED, usb_pause_mtx(), usb_string_lang_en, USETW, UT_READ_CLASS_DEVICE, UT_READ_CLASS_INTERFACE, UT_READ_CLASS_OTHER, UT_READ_DEVICE, UT_READ_ENDPOINT, UT_READ_INTERFACE, UT_READ_VENDOR_INTERFACE, UT_WRITE_CLASS_DEVICE, UT_WRITE_CLASS_INTERFACE, UT_WRITE_CLASS_OTHER, UT_WRITE_DEVICE, UT_WRITE_ENDPOINT, UT_WRITE_INTERFACE, UT_WRITE_VENDOR_INTERFACE, value, usb_port_status::wPortChange, usb_port_status::wPortStatus, and dwc_otg_hub_temp::wValue.
|
static |
Definition at line 669 of file dwc_otg.c.
References addr, DCFG_DEVADDR_SET, DOTG_DCFG, DWC_OTG_READ_4, and DWC_OTG_WRITE_4.
Referenced by dwc_otg_interrupt(), and dwc_otg_setup_rx().
|
static |
Definition at line 4914 of file dwc_otg.c.
References bus, DWC_OTG_BUS2SC, dwc_otg_resume(), dwc_otg_suspend(), dwc_otg_uninit(), state, USB_HW_POWER_RESUME, USB_HW_POWER_SHUTDOWN, and USB_HW_POWER_SUSPEND.
|
static |
Definition at line 3650 of file dwc_otg.c.
References usb_endpoint_descriptor::bEndpointAddress, usb_device::bus, DOEPCTL_EPDIS, DOEPCTL_STALL, DOTG_DIEPCTL, DOTG_DOEPCTL, DWC_OTG_BUS2SC, dwc_otg_common_rx_ack(), dwc_otg_interrupt_complete_locked(), dwc_otg_interrupt_poll_locked(), DWC_OTG_WRITE_4, usb_endpoint::edesc, usb_device::flags, GRXSTSRD_CHNUM_GET, reg, dwc_otg_softc::sc_active_rx_ep, dwc_otg_softc::sc_bus, dwc_otg_softc::sc_in_ctl, dwc_otg_softc::sc_last_rx_status, dwc_otg_softc::sc_out_ctl, UE_ADDR, UE_DIR_IN, USB_BUS_LOCK_ASSERT, USB_BUS_SPIN_LOCK, USB_BUS_SPIN_UNLOCK, usb_device_flags::usb_mode, and USB_MODE_DEVICE.
|
static |
Definition at line 1095 of file dwc_otg.c.
References __aligned, count, dwc_otg_td::did_stall, DIEPCTL_EPDIS, DIEPCTL_STALL, DOEPCTL_EPDIS, DOEPCTL_STALL, DOTG_DIEPCTL, DOTG_DIEPTSIZ, DOTG_DOEPCTL, DOTG_DOEPTSIZ, dwc_otg_common_rx_ack(), dwc_otg_read_fifo(), dwc_otg_set_address(), dwc_otg_tx_fifo_reset(), DWC_OTG_WRITE_4, GRSTCTL_TXFFLSH, GRSTCTL_TXFIFO, GRXSTSRD_BCNT_GET, GRXSTSRD_CHNUM_GET, GRXSTSRD_DPID_DATA0, GRXSTSRD_DPID_MASK, GRXSTSRD_PKTSTS_MASK, GRXSTSRD_STP_COMPLETE, GRXSTSRD_STP_DATA, dwc_otg_td::offset, dwc_otg_td::pc, dwc_otg_td::remainder, req, dwc_otg_softc::sc_in_ctl, dwc_otg_softc::sc_last_rx_status, dwc_otg_softc::sc_out_ctl, UR_SET_ADDRESS, usbd_copy_out(), and UT_WRITE_DEVICE.
|
static |
Definition at line 3123 of file dwc_otg.c.
References usb_xfer::address, usb_xfer_root::bus, usb_xfer_flags_int::control_act, usb_xfer_flags_int::control_hdr, usb_xfer_flags_int::control_stall, usb_xfer_flags_int::control_xfr, dwc_otg_std_temp::did_stall, DWC_OTG_BUS2SC, dwc_otg_data_rx, dwc_otg_data_tx, dwc_otg_data_tx_sync, dwc_otg_host_data_rx, dwc_otg_host_data_tx, dwc_otg_host_setup_tx, DWC_OTG_HOST_TIMER_RATE, dwc_otg_setup_rx, dwc_otg_setup_standard_chain_sub(), dwc_otg_uses_split(), usb_xfer::endpoint, usb_xfer::endpointno, dwc_otg_td::ep_type, usb_xfer::flags, usb_device::flags, usb_xfer::flags_int, usb_xfer_flags::force_short_xfer, usb_xfer::frbuffers, usb_xfer::frlengths, dwc_otg_std_temp::func, dwc_otg_td::hcchar, HCCHAR_CHENA, HCCHAR_DEVADDR_SHIFT, HCCHAR_EPDIR_IN, HCCHAR_EPNUM_SHIFT, HCCHAR_EPTYPE_SHIFT, HCCHAR_LSPDDEV, HCCHAR_MC_SHIFT, HCCHAR_MPS_SHIFT, dwc_otg_td::hcsplt, HCSPLT_HUBADDR_SHIFT, HCSPLT_PRTADDR_SHIFT, HCSPLT_SPLTENA, usb_device::hs_hub_addr, usb_device::hs_port_no, usb_xfer::interval, usb_xfer_flags_int::isochronous_xfr, dwc_otg_std_temp::len, dwc_otg_std_temp::max_frame_size, usb_xfer::max_frame_size, usb_xfer::max_packet_count, usb_xfer::max_packet_size, usb_xfer::nframes, dwc_otg_std_temp::offset, dwc_otg_std_temp::pc, dwc_otg_softc::sc_last_frame_num, dwc_otg_softc::sc_tmr_val, dwc_otg_td::set_toggle, dwc_otg_std_temp::setup_alt_next, usb_xfer_flags_int::short_frames_ok, dwc_otg_std_temp::short_pkt, usb_device::speed, usb_xfer::sumlen, dwc_otg_std_temp::td, dwc_otg_std_temp::td_next, usb_xfer::td_start, usb_xfer::td_transfer_cache, usb_xfer::td_transfer_first, usb_xfer::td_transfer_last, dwc_otg_td::tmr_res, dwc_otg_td::tmr_val, dwc_otg_td::toggle, usb_endpoint::toggle_next, usb_xfer_root::udev, UE_ADDR, UE_CONTROL, UE_DIR_IN, UE_GET_ADDR, UE_GET_DIR, UE_INTERRUPT, UE_ISOCHRONOUS, usb_device_flags::usb_mode, USB_MODE_HOST, USB_SPEED_FULL, USB_SPEED_HIGH, USB_SPEED_LOW, usbd_get_speed(), usbd_xfer_get_fps_shift(), and usb_xfer::xroot.
Referenced by dwc_otg_device_isoc_start(), and dwc_otg_device_non_isoc_start().
|
static |
Definition at line 3087 of file dwc_otg.c.
References dwc_otg_td::alt_next, dwc_otg_td::channel, dwc_otg_td::did_nak, dwc_otg_td::did_stall, dwc_otg_std_temp::did_stall, DWC_OTG_MAX_CHANNELS, dwc_otg_td::errcnt, dwc_otg_td::error_any, dwc_otg_td::error_stall, dwc_otg_td::func, dwc_otg_std_temp::func, dwc_otg_td::got_short, HCSPLT_XACTPOS_BEGIN, dwc_otg_std_temp::len, dwc_otg_td::npkt, dwc_otg_td::obj_next, dwc_otg_td::offset, dwc_otg_std_temp::offset, dwc_otg_td::pc, dwc_otg_std_temp::pc, dwc_otg_td::remainder, dwc_otg_td::set_toggle, dwc_otg_std_temp::setup_alt_next, dwc_otg_td::short_pkt, dwc_otg_std_temp::short_pkt, dwc_otg_td::state, dwc_otg_std_temp::td, dwc_otg_std_temp::td_next, dwc_otg_td::tt_scheduled, dwc_otg_td::tt_xactpos, and dwc_otg_td::tx_bytes.
Referenced by dwc_otg_setup_standard_chain().
|
static |
Definition at line 3574 of file dwc_otg.c.
References usb_xfer::aframes, usb_xfer_flags_int::control_act, usb_xfer_flags_int::control_hdr, usb_xfer_flags_int::control_xfr, dwc_otg_device_done(), dwc_otg_standard_done_sub(), usb_xfer::endpoint, usb_xfer::flags_int, usb_xfer::nframes, usb_xfer::td_transfer_cache, and usb_xfer::td_transfer_first.
Referenced by dwc_otg_xfer_do_complete_locked().
|
static |
Definition at line 3506 of file dwc_otg.c.
References usb_xfer::aframes, dwc_otg_td::alt_next, usb_xfer::endpoint, error, dwc_otg_td::error_any, dwc_otg_td::error_stall, usb_xfer::flags_int, usb_xfer::frlengths, usb_xfer_flags_int::isochronous_xfr, len, usb_xfer::nframes, dwc_otg_td::obj_next, dwc_otg_td::remainder, usb_xfer_flags_int::short_frames_ok, usb_xfer::td_transfer_cache, dwc_otg_td::toggle, usb_endpoint::toggle_next, USB_ERR_IOERROR, and USB_ERR_STALLED.
Referenced by dwc_otg_standard_done().
|
static |
Definition at line 3441 of file dwc_otg.c.
References usb_xfer_root::bus, DWC_OTG_BUS2SC, dwc_otg_enable_sof_irq(), dwc_otg_timeout(), dwc_otg_xfer_do_complete_locked(), dwc_otg_xfer_do_fifo(), dwc_otg_td::ep_type, dwc_otg_td::hcchar, HCCHAR_EPDIR_IN, usb_bus::intr_q, dwc_otg_softc::sc_bus, dwc_otg_softc::sc_flags, dwc_otg_flags::status_device_mode, usb_xfer::td_transfer_cache, usb_xfer::timeout, UE_ISOCHRONOUS, USB_BUS_SPIN_LOCK, USB_BUS_SPIN_UNLOCK, usbd_transfer_enqueue(), usbd_transfer_timeout_ms(), and usb_xfer::xroot.
Referenced by dwc_otg_device_isoc_start(), and dwc_otg_device_non_isoc_start().
|
static |
Definition at line 4106 of file dwc_otg.c.
Referenced by dwc_otg_set_hw_power_sleep().
|
static |
Definition at line 599 of file dwc_otg.c.
References dwc_otg_flags::change_suspend, DOTG_GINTMSK, dwc_otg_root_intr(), DWC_OTG_WRITE_4, GINTMSK_WKUPINTMSK, dwc_otg_softc::sc_flags, dwc_otg_softc::sc_irq_mask, dwc_otg_flags::status_device_mode, and dwc_otg_flags::status_suspend.
Referenced by dwc_otg_interrupt(), and dwc_otg_roothub_exec().
|
static |
Definition at line 3428 of file dwc_otg.c.
References usb_xfer_root::bus, DPRINTF, dwc_otg_device_done(), USB_BUS_LOCK_ASSERT, USB_ERR_TIMEOUT, and usb_xfer::xroot.
Referenced by dwc_otg_start_standard_chain().
|
static |
Definition at line 2428 of file dwc_otg.c.
References DPRINTF, dwc_otg_enable_sof_irq(), DWC_OTG_HOST_TIMER_RATE, dwc_otg_timer(), dwc_otg_softc::sc_bus, dwc_otg_softc::sc_timer, dwc_otg_softc::sc_timer_active, dwc_otg_softc::sc_tmr_val, USB_BUS_LOCK_ASSERT, USB_BUS_SPIN_LOCK, USB_BUS_SPIN_UNLOCK, and usb_callout_reset.
Referenced by dwc_otg_timer(), and dwc_otg_timer_start().
|
static |
Definition at line 2455 of file dwc_otg.c.
References DWC_OTG_HOST_TIMER_RATE, dwc_otg_timer(), dwc_otg_softc::sc_timer, dwc_otg_softc::sc_timer_active, and usb_callout_reset.
Referenced by dwc_otg_roothub_exec().
|
static |
Definition at line 2469 of file dwc_otg.c.
References dwc_otg_softc::sc_timer, dwc_otg_softc::sc_timer_active, and usb_callout_stop.
Referenced by dwc_otg_roothub_exec(), and dwc_otg_uninit().
|
static |
Definition at line 275 of file dwc_otg.c.
References DOTG_GRSTCTL, DWC_OTG_READ_4, DWC_OTG_WRITE_4, GRSTCTL_RXFFLSH, GRSTCTL_TXFFLSH, and value.
Referenced by dwc_otg_clear_stall_sub_locked(), dwc_otg_init_fifo(), and dwc_otg_setup_rx().
void dwc_otg_uninit | ( | struct dwc_otg_softc * | sc | ) |
Definition at line 4075 of file dwc_otg.c.
References dwc_otg_flags::change_connect, dwc_otg_flags::change_suspend, DCTL_SFTDISCON, DOTG_DCTL, DOTG_GAHBCFG, dwc_otg_clocks_off(), dwc_otg_pull_down(), dwc_otg_timer_stop(), DWC_OTG_WRITE_4, dwc_otg_flags::port_enabled, dwc_otg_flags::port_powered, dwc_otg_softc::sc_bus, dwc_otg_softc::sc_flags, dwc_otg_softc::sc_timer, dwc_otg_flags::status_bus_reset, dwc_otg_flags::status_suspend, dwc_otg_flags::status_vbus, USB_BUS_LOCK, USB_BUS_UNLOCK, and usb_callout_drain.
Referenced by dwc_otg_detach(), and dwc_otg_set_hw_power_sleep().
|
static |
Definition at line 466 of file dwc_otg.c.
References DOTG_HFIR, DPRINTF, DWC_OTG_READ_4, DWC_OTG_WRITE_4, HFIR_FRINT_MASK, dwc_otg_softc::sc_flags, and dwc_otg_flags::status_high_speed.
Referenced by dwc_otg_interrupt().
|
static |
Definition at line 2489 of file dwc_otg.c.
References DOTG_GINTMSK, DOTG_HFNUM, dwc_otg_compute_isoc_rx_tt_slot(), DWC_OTG_FRAME_MASK, dwc_otg_host_rate_check_interrupt(), DWC_OTG_READ_4, DWC_OTG_WRITE_4, dwc_otg_td::ep_type, GINTMSK_SOFMSK, dwc_otg_td::hcchar, HCCHAR_EPDIR_IN, dwc_otg_td::hcsplt, usb_bus::intr_q, dwc_otg_softc::sc_bus, dwc_otg_softc::sc_irq_mask, dwc_otg_softc::sc_last_frame_num, dwc_otg_softc::sc_needsof, dwc_otg_softc::sc_tt_info, slot, TAILQ_HEAD(), usb_xfer::td_transfer_cache, dwc_otg_td::tt_index, dwc_otg_td::tt_scheduled, dwc_otg_td::tt_start_slot, UE_BULK, UE_CONTROL, UE_INTERRUPT, and UE_ISOCHRONOUS.
Referenced by dwc_otg_interrupt_poll_locked().
|
static |
Definition at line 454 of file dwc_otg.c.
References usb_device::parent_hs_hub, usb_device::parent_hub, usb_device::speed, and USB_SPEED_HIGH.
Referenced by dwc_otg_setup_standard_chain(), and dwc_otg_xfer_setup().
|
static |
Definition at line 2818 of file dwc_otg.c.
References dwc_otg_flags::change_connect, dwc_otg_flags::change_suspend, DWC_MODE_HOST, dwc_otg_root_intr(), dwc_otg_softc::sc_flags, dwc_otg_softc::sc_mode, dwc_otg_flags::status_bus_reset, dwc_otg_flags::status_suspend, and dwc_otg_flags::status_vbus.
Referenced by dwc_otg_init(), and dwc_otg_interrupt().
|
static |
Definition at line 622 of file dwc_otg.c.
References usb_bus::bus_mtx, DCTL_RMTWKUPSIG, DOTG_DCTL, DOTG_HPRT, DOTG_PCGCCTL, DWC_OTG_READ_4, dwc_otg_resume_irq(), DWC_OTG_WRITE_4, HPRT_PRTRES, HPRT_PRTSUSP, dwc_otg_softc::sc_bus, dwc_otg_softc::sc_flags, dwc_otg_softc::sc_hprt_val, dwc_otg_flags::status_device_mode, dwc_otg_flags::status_suspend, and usb_pause_mtx().
Referenced by dwc_otg_roothub_exec().
|
static |
Definition at line 171 of file dwc_otg.c.
References usb_page_search::buffer, count, usb_page_search::length, offset, dwc_otg_softc::sc_bounce_buffer, dwc_otg_softc::sc_io_hdl, dwc_otg_softc::sc_io_tag, usb_pc_buffer_is_aligned(), usbd_copy_out(), and usbd_get_page().
Referenced by dwc_otg_data_tx(), and dwc_otg_host_data_tx().
|
static |
Definition at line 2412 of file dwc_otg.c.
References dwc_otg_standard_done(), and usb_xfer::td_transfer_cache.
Referenced by dwc_otg_interrupt_complete_locked(), and dwc_otg_start_standard_chain().
|
static |
Definition at line 2359 of file dwc_otg.c.
References dwc_otg_td::func, dwc_otg_softc::sc_xfer_complete, usb_xfer::td_transfer_cache, usb_xfer::td_transfer_last, dwc_otg_td::tmr_res, dwc_otg_td::tmr_val, and dwc_otg_td::toggle.
Referenced by dwc_otg_interrupt_poll_locked(), and dwc_otg_start_standard_chain().
|
static |
Definition at line 4773 of file dwc_otg.c.
References usb_device_descriptor::bDeviceProtocol, usb_endpoint_descriptor::bmAttributes, usb_setup_params::buf, usb_setup_params::curr_xfer, usb_device::ddesc, usb_device::device_index, dwc_otg_get_hw_ep_profile(), dwc_otg_uses_split(), usb_endpoint::edesc, usb_xfer::endpoint, usb_xfer::endpointno, dwc_otg_td::ep_no, dwc_otg_td::ep_type, usb_setup_params::err, usb_xfer::flags_int, usb_setup_params::hc_max_frame_size, usb_setup_params::hc_max_packet_count, usb_setup_params::hc_max_packet_size, dwc_otg_td::max_packet_count, usb_xfer::max_packet_count, dwc_otg_td::max_packet_size, usb_xfer::max_packet_size, n, usb_xfer::nframes, dwc_otg_td::obj_next, usb_device::parent_hs_hub, pf, usb_setup_params::size, usb_xfer::td_start, dwc_otg_td::tt_index, usb_setup_params::udev, UDPROTO_HSHUBMTT, UE_ADDR, UE_CONTROL, UE_XFERTYPE, USB_ADD_BYTES, USB_ERR_INVAL, USB_HOST_ALIGN, usb_xfer_flags_int::usb_mode, USB_MODE_DEVICE, and usbd_transfer_setup_sub().
|
static |
Definition at line 3644 of file dwc_otg.c.
References dwc_otg_device_done(), and USB_ERR_STALLED.
|
static |
SYSCTL_INT | ( | _hw_usb_dwc_otg | , |
OID_AUTO | , | ||
phy_type | , | ||
CTLFLAG_RDTUN | , | ||
& | dwc_otg_phy_type, | ||
0 | , | ||
"DWC OTG PHY TYPE - 0/1/2/3 - ULPI/HSIC/INTERNAL/UTMI+" | |||
) |
|
static |
USB_MAKE_STRING_DESC | ( | STRING_PRODUCT | , |
dwc_otg_product | |||
) |
USB_MAKE_STRING_DESC | ( | STRING_VENDOR | , |
dwc_otg_vendor | |||
) |
|
static |
Definition at line 125 of file dwc_otg.c.
Referenced by dwc_otg_init().
|
static |
Definition at line 4253 of file dwc_otg.c.
Referenced by dwc_otg_roothub_exec().
|
static |
Definition at line 130 of file dwc_otg.c.
Referenced by dwc_otg_setup_standard_chain().
|
static |
Definition at line 131 of file dwc_otg.c.
Referenced by dwc_otg_setup_standard_chain().
|
static |
Definition at line 132 of file dwc_otg.c.
Referenced by dwc_otg_setup_standard_chain().
|
static |
Definition at line 4239 of file dwc_otg.c.
Referenced by dwc_otg_roothub_exec().
|
static |
Definition at line 127 of file dwc_otg.c.
Referenced by dwc_otg_ep_init().
|
static |
Definition at line 126 of file dwc_otg.c.
Referenced by dwc_otg_ep_init().
|
static |
Definition at line 147 of file dwc_otg.c.
Referenced by dwc_otg_init_fifo().
|
static |
Definition at line 136 of file dwc_otg.c.
Referenced by dwc_otg_setup_standard_chain().
|
static |
Definition at line 135 of file dwc_otg.c.
Referenced by dwc_otg_setup_standard_chain().
|
static |
Definition at line 134 of file dwc_otg.c.
Referenced by dwc_otg_setup_standard_chain().
|
static |
Definition at line 4283 of file dwc_otg.c.
Referenced by dwc_otg_roothub_exec().
|
static |
Definition at line 107 of file dwc_otg.c.
Referenced by dwc_otg_init().
|
static |
Definition at line 129 of file dwc_otg.c.
Referenced by dwc_otg_setup_standard_chain().