summaryrefslogtreecommitdiffstats
path: root/sys/dev/usb/controller/dwc_otg.h
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev/usb/controller/dwc_otg.h')
-rw-r--r--sys/dev/usb/controller/dwc_otg.h40
1 files changed, 34 insertions, 6 deletions
diff --git a/sys/dev/usb/controller/dwc_otg.h b/sys/dev/usb/controller/dwc_otg.h
index 8d8b3e4..6e262da 100644
--- a/sys/dev/usb/controller/dwc_otg.h
+++ b/sys/dev/usb/controller/dwc_otg.h
@@ -27,10 +27,12 @@
#ifndef _DWC_OTG_H_
#define _DWC_OTG_H_
-#define DWC_OTG_MAX_DEVICES (USB_MIN_DEVICES + 1)
+#define DWC_OTG_MAX_DEVICES MIN(USB_MAX_DEVICES, 32)
#define DWC_OTG_FRAME_MASK 0x7FF
#define DWC_OTG_MAX_TXP 4
#define DWC_OTG_MAX_TXN (0x200 * DWC_OTG_MAX_TXP)
+#define DWC_OTG_MAX_CHANNELS 16
+#define DWC_OTG_MAX_ENDPOINTS 16
#define DWC_OTG_READ_4(sc, reg) \
bus_space_read_4((sc)->sc_io_tag, (sc)->sc_io_hdl, reg)
@@ -50,13 +52,23 @@ struct dwc_otg_td {
uint32_t tx_bytes;
uint32_t offset;
uint32_t remainder;
+ uint32_t hcchar; /* HOST CFG */
+ uint32_t hcsplt; /* HOST CFG */
uint16_t max_packet_size; /* packet_size */
uint16_t npkt;
+ uint8_t sof_res;
+ uint8_t sof_val;
uint8_t ep_no;
+ uint8_t channel;
uint8_t error:1;
+ uint8_t error_any:1;
+ uint8_t error_stall:1;
uint8_t alt_next:1;
uint8_t short_pkt:1;
uint8_t did_stall:1;
+ uint8_t did_ping:1;
+ uint8_t toggle:1;
+ uint8_t set_toggle:1;
};
struct dwc_otg_std_temp {
@@ -68,6 +80,7 @@ struct dwc_otg_std_temp {
uint32_t offset;
uint16_t max_frame_size;
uint8_t short_pkt;
+
/*
* short_pkt = 0: transfer should be short terminated
* short_pkt = 1: transfer should not be short terminated
@@ -91,15 +104,20 @@ union dwc_otg_hub_temp {
struct dwc_otg_flags {
uint8_t change_connect:1;
uint8_t change_suspend:1;
+ uint8_t change_reset:1;
+ uint8_t change_enabled:1;
+ uint8_t change_over_current:1;
uint8_t status_suspend:1; /* set if suspended */
uint8_t status_vbus:1; /* set if present */
uint8_t status_bus_reset:1; /* set if reset complete */
uint8_t status_high_speed:1; /* set if High Speed is selected */
- uint8_t remote_wakeup:1;
+ uint8_t status_low_speed:1; /* set if Low Speed is selected */
+ uint8_t status_device_mode:1; /* set if device mode */
uint8_t self_powered:1;
uint8_t clocks_off:1;
uint8_t port_powered:1;
uint8_t port_enabled:1;
+ uint8_t port_over_current:1;
uint8_t d_pulled_up:1;
};
@@ -111,7 +129,7 @@ struct dwc_otg_profile {
struct dwc_otg_softc {
struct usb_bus sc_bus;
union dwc_otg_hub_temp sc_hub_temp;
- struct dwc_otg_profile sc_hw_ep_profile[16];
+ struct dwc_otg_profile sc_hw_ep_profile[DWC_OTG_MAX_ENDPOINTS];
struct usb_device *sc_devices[DWC_OTG_MAX_DEVICES];
struct resource *sc_io_res;
@@ -127,15 +145,25 @@ struct dwc_otg_softc {
uint32_t sc_fifo_size;
uint32_t sc_irq_mask;
uint32_t sc_last_rx_status;
- uint32_t sc_out_ctl[16];
- uint32_t sc_in_ctl[16];
+ uint32_t sc_out_ctl[DWC_OTG_MAX_ENDPOINTS];
+ uint32_t sc_in_ctl[DWC_OTG_MAX_ENDPOINTS];
+ uint32_t sc_hcchar[DWC_OTG_MAX_CHANNELS];
+ uint32_t sc_sof_refs;
+ uint32_t sc_sof_val;
+ uint32_t sc_hprt_val;
+ uint32_t sc_haint_mask;
- uint16_t sc_active_out_ep;
+ uint16_t sc_active_rx_ep;
uint8_t sc_dev_ep_max;
uint8_t sc_dev_in_ep_max;
+ uint8_t sc_host_ch_max;
uint8_t sc_rt_addr; /* root HUB address */
uint8_t sc_conf; /* root HUB config */
+ uint8_t sc_mode; /* mode of operation */
+#define DWC_MODE_OTG 0 /* both modes */
+#define DWC_MODE_DEVICE 1 /* device only */
+#define DWC_MODE_HOST 2 /* host only */
uint8_t sc_hub_idata[1];
OpenPOWER on IntegriCloud