/* NOTE: otg and peripheral-only state machines start at B_IDLE. * OTG or host-only go to A_IDLE when ID is sensed.
*/ #define is_peripheral_active(m) (!(m)->is_host) #define is_host_active(m) ((m)->is_host)
/* host side ep0 states */ enum musb_h_ep0_state {
MUSB_EP0_IDLE,
MUSB_EP0_START, /* expect ack of setup */
MUSB_EP0_IN, /* expect IN DATA */
MUSB_EP0_OUT, /* expect ack of OUT DATA */
MUSB_EP0_STATUS, /* expect ack of STATUS */
} __attribute__ ((packed));
/* peripheral side ep0 states */ enum musb_g_ep0_state {
MUSB_EP0_STAGE_IDLE, /* idle, waiting for SETUP */
MUSB_EP0_STAGE_SETUP, /* received SETUP */
MUSB_EP0_STAGE_TX, /* IN data */
MUSB_EP0_STAGE_RX, /* OUT data */
MUSB_EP0_STAGE_STATUSIN, /* (after OUT data) */
MUSB_EP0_STAGE_STATUSOUT, /* (after IN data) */
MUSB_EP0_STAGE_ACKWAIT, /* after zlp, before statusin */
} __attribute__ ((packed));
/* * OTG protocol constants. See USB OTG 1.3 spec, * sections 5.5 "Device Timings" and 6.6.5 "Timers".
*/ #define OTG_TIME_A_WAIT_VRISE 100 /* msec (max) */ #define OTG_TIME_A_WAIT_BCON 1100 /* min 1 second */ #define OTG_TIME_A_AIDL_BDIS 200 /* min 200 msec */ #define OTG_TIME_B_ASE0_BRST 100 /* min 3.125 ms */
/** * struct musb_platform_ops - Operations passed to musb_core by HW glue layer * @quirks: flags for platform specific quirks * @enable: enable device * @disable: disable device * @ep_offset: returns the end point offset * @ep_select: selects the specified end point * @fifo_mode: sets the fifo mode * @fifo_offset: returns the fifo offset * @readb: read 8 bits * @writeb: write 8 bits * @clearb: could be clear-on-readb or W1C * @readw: read 16 bits * @writew: write 16 bits * @clearw: could be clear-on-readw or W1C * @read_fifo: reads the fifo * @write_fifo: writes to fifo * @get_toggle: platform specific get toggle function * @set_toggle: platform specific set toggle function * @dma_init: platform specific dma init function * @dma_exit: platform specific dma exit function * @init: turns on clocks, sets up platform-specific registers, etc * @exit: undoes @init * @set_mode: forcefully changes operating mode * @try_idle: tries to idle the IP * @recover: platform-specific babble recovery * @vbus_status: returns vbus status if possible * @set_vbus: forces vbus status * @pre_root_reset_end: called before the root usb port reset flag gets cleared * @post_root_reset_end: called after the root usb port reset flag gets cleared * @phy_callback: optional callback function for the phy to call
*/ struct musb_platform_ops {
u16 intrrxe;
u16 intrtxe; /* this hub status bit is reserved by USB 2.0 and not seen by usbcore */ #define MUSB_PORT_STAT_RESUME (1 << 31)
u32 port1_status;
unsignedlong rh_timer;
enum musb_h_ep0_state ep0_stage;
/* bulk traffic normally dedicates endpoint hardware, and each * direction has its own ring of host side endpoints. * we try to progress the transfer at the head of each endpoint's * queue until it completes or NAKs too much; then we try the next * endpoint.
*/ struct musb_hw_ep *bulk_ep;
struct list_head control; /* of musb_qh */ struct list_head in_bulk; /* of musb_qh */ struct list_head out_bulk; /* of musb_qh */ struct list_head pending_list; /* pending work list */
/* is_suspended means USB B_PERIPHERAL suspend */ unsigned is_suspended:1;
/* may_wakeup means remote wakeup is enabled */ unsigned may_wakeup:1;
/* is_self_powered is reported in device status and the * config descriptor. is_bus_powered means B_PERIPHERAL * draws some VBUS current; both can be true.
*/ unsigned is_self_powered:1; unsigned is_bus_powered:1;
switch (type) { case USB_ENDPOINT_XFER_CONTROL:
s = "ctrl"; break; case USB_ENDPOINT_XFER_ISOC:
s = "iso"; break; case USB_ENDPOINT_XFER_BULK:
s = "bulk"; break; case USB_ENDPOINT_XFER_INT:
s = "int"; break; default:
s = ""; break;
} return s;
}
/* read from core using indexed model */
reg = musb_readb(mbase, musb->io.ep_offset(epnum, MUSB_FIFOSIZE)); /* 0's returned when no more endpoints */ if (!reg) return -ENODEV;
/* * gets the "dr_mode" property from DT and converts it into musb_mode * if the property is not found or not recognized returns MUSB_OTG
*/ externenum musb_mode musb_get_mode(struct device *dev);
#endif/* __MUSB_CORE_H__ */
Messung V0.5
¤ Dauer der Verarbeitung: 0.28 Sekunden
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.