/openbmc/linux/drivers/usb/gadget/udc/aspeed-vhub/ |
H A D | ep0.c | 5 * ep0.c - Endpoint 0 handling 31 struct usb_request *req = &ep->ep0.req.req; in ast_vhub_reply() 36 if (WARN_ON(!ep->ep0.dir_in)) in ast_vhub_reply() 92 memcpy_fromio(&crq, ep->ep0.setup, sizeof(crq)); in ast_vhub_ep0_handle_setup() 100 ep->ep0.state); in ast_vhub_ep0_handle_setup() 112 if (ep->ep0.state != ep0_state_token && in ast_vhub_ep0_handle_setup() 113 ep->ep0.state != ep0_state_stall) { in ast_vhub_ep0_handle_setup() 118 /* Calculate next state for EP0 */ in ast_vhub_ep0_handle_setup() 119 ep->ep0.state = ep0_state_data; in ast_vhub_ep0_handle_setup() 120 ep->ep0.dir_in = !!(crq.bRequestType & USB_DIR_IN); in ast_vhub_ep0_handle_setup() [all …]
|
H A D | vhub.h | 93 /* HUB EP0 control */ 136 * matching corresponding vHub EP0 control bits 215 #define AST_VHUB_EP0_MAX_PACKET 64 /* EP0's max packet size */ 243 * mode (or ep0), any >= 0 value means "last packet" 255 /* Current state of an EP0 */ 264 * An endpoint, either generic, ep0, actual gadget EP 265 * or internal use vhub EP0. vhub EP1 doesn't have an 274 /* EP index in the device, 0 means this is an EP0 */ 277 /* Dev pointer or NULL for vHub EP0 */ 284 * DMA buffer for EP0, fallback DMA buffer for misaligned [all …]
|
H A D | core.c | 50 * If this isn't an internal EP0 request, call the core in ast_vhub_done() 139 /* Handle top-level vHub EP0 interrupts */ in ast_vhub_irq() 144 ast_vhub_ep0_handle_ack(&vhub->ep0, true); in ast_vhub_irq() 146 ast_vhub_ep0_handle_ack(&vhub->ep0, false); in ast_vhub_irq() 148 ast_vhub_ep0_handle_setup(&vhub->ep0); in ast_vhub_irq() 225 /* Default settings for EP0, enable HW hub EP1 */ in ast_vhub_init_hw() 232 /* Configure EP0 DMA buffer */ in ast_vhub_init_hw() 233 writel(vhub->ep0.buf_dma, vhub->regs + AST_VHUB_EP0_DATA); in ast_vhub_init_hw() 382 dev_err(&pdev->dev, "Failed to allocate EP0 DMA buffers\n"); in ast_vhub_probe() 386 UDCVDBG(vhub, "EP0 DMA buffers @%p (DMA 0x%08x)\n", in ast_vhub_probe() [all …]
|
H A D | dev.c | 38 ast_vhub_ep0_handle_ack(&d->ep0, true); in ast_vhub_dev_irq() 40 ast_vhub_ep0_handle_ack(&d->ep0, false); in ast_vhub_dev_irq() 42 ast_vhub_ep0_handle_setup(&d->ep0); in ast_vhub_dev_irq() 52 /* Cleanup EP0 state */ in ast_vhub_dev_enable() 55 /* Enable device and its EP0 interrupts */ in ast_vhub_dev_enable() 70 /* Set EP0 DMA buffer address */ in ast_vhub_dev_enable() 71 writel(d->ep0.buf_dma, d->regs + AST_VHUB_DEV_EP0_DATA); in ast_vhub_dev_enable() 177 return ast_vhub_simple_reply(&d->ep0, st0, 0); in ast_vhub_dev_status() 202 return ast_vhub_simple_reply(&d->ep0, st0, 0); in ast_vhub_ep_status() 391 /* Only EP0 can be a control endpoint */ in ast_vhub_udc_match_ep() [all …]
|
/openbmc/linux/drivers/usb/gadget/udc/ |
H A D | renesas_usbf.c | 75 /* EP0 registers offsets from Base + USBF_BASE_EP0 (EP0 regs area) */ 313 /* for EP0 control messages */ 344 /* ep0: buf @0x0000 64 bytes, fixed 32 words */ 345 [0] = USBF_EP_INFO("ep0-ctrl", 547 static void usbf_ep0_send_null(struct usbf_ep *ep0, bool is_data1) in usbf_ep0_send_null() argument 555 usbf_ep_reg_bitset(ep0, USBF_REG_EP0_CONTROL, set); in usbf_ep0_send_null() 558 static int usbf_ep0_pio_in(struct usbf_ep *ep0, struct usbf_req *req) in usbf_ep0_pio_in() argument 571 dev_dbg(ep0->udc->dev, "ep0 send null\n"); in usbf_ep0_pio_in() 572 usbf_ep0_send_null(ep0, false); in usbf_ep0_pio_in() 576 if ((req->req.actual % ep0->ep.maxpacket) == 0) { in usbf_ep0_pio_in() [all …]
|
H A D | udc-xilinx.c | 28 #define XUSB_EP0_CONFIG_OFFSET 0x0000 /* EP0 Config Reg Offset */ 202 static const char ep0name[] = "ep0"; 261 struct xusb_ep *ep0 = &udc->ep[XUSB_EP_NUMBER_ZERO]; in xudc_wrstatus() local 264 epcfgreg = udc->read_fn(udc->addr + ep0->offset)| in xudc_wrstatus() 266 udc->write_fn(udc->addr, ep0->offset, epcfgreg); in xudc_wrstatus() 267 udc->write_fn(udc->addr, ep0->offset + XUSB_EP_BUF0COUNT_OFFSET, 0); in xudc_wrstatus() 996 * @ep0: pointer to the xusb endpoint 0 structure. 1001 static int __xudc_ep0_queue(struct xusb_ep *ep0, struct xusb_req *req) in __xudc_ep0_queue() argument 1003 struct xusb_udc *udc = ep0->udc; in __xudc_ep0_queue() 1011 if (!list_empty(&ep0->queue)) { in __xudc_ep0_queue() [all …]
|
H A D | lpc32xx_udc.c | 76 /* EP0 states */ 1027 /* Disable all device interrupts (including EP0) */ in udc_disable() 1073 /* Only enable EP0 in and out for now, EP0 only works in FIFO mode */ in udc_enable() 1199 * as EP0) that don't use DMA. This function should only be called if a packet 1304 * as EP0) that don't use DMA. Note that the endpoint must be selected in the 1330 /* USB device reset - resets USB to a default state with just EP0 1335 /* Re-init device controller and EP0 */ in uda_usb_reset() 1345 /* Send a ZLP on EP0 */ 1381 INIT_LIST_HEAD(&udc->gadget.ep0->ep_list); in udc_reinit() 1443 struct lpc32xx_ep *ep0 = &udc->ep[0]; in udc_ep0_in_req() local [all …]
|
H A D | bcm63xx_udc.c | 42 static const char bcm63xx_ep0name[] = "ep0"; 189 * @ep_num: USB endpoint number. -1 for ep0 RX. 193 * @bep: Pointer to the associated endpoint. NULL for ep0 RX. 203 * ep0 has two IUDMA channels (IUDMA_EP0_RXCHAN and IUDMA_EP0_TXCHAN), as it is 204 * bidirectional. The "struct usb_ep" associated with ep0 is for TX (IN) 274 * @bep: Array of endpoints, including ep0. 279 * @ep0_ctrl_req: Request object for bcm63xx_udc-initiated ep0 transactions. 281 * @ep0state: Current state of the ep0 state machine. 282 * @ep0_wq: Workqueue struct used to wake up the ep0 state machine. 287 * @ep0_req_shutdown: Driver is shutting down; requesting ep0 to halt activity. [all …]
|
/openbmc/linux/tools/usb/ffs-aio-example/simple/device_app/ |
H A D | aio_simple.c | 182 static void handle_ep0(int ep0, bool *ready) in handle_ep0() argument 188 pfds[0].fd = ep0; in handle_ep0() 194 ret = read(ep0, &event, sizeof(event)); in handle_ep0() 196 perror("unable to read event from ep0"); in handle_ep0() 203 write(ep0, NULL, 0); in handle_ep0() 205 read(ep0, NULL, 0); in handle_ep0() 227 int ep0; in main() local 252 sprintf(ep_path, "%s/ep0", argv[1]); in main() 253 ep0 = open(ep_path, O_RDWR); in main() 254 if (ep0 < 0) { in main() [all …]
|
/openbmc/linux/tools/usb/ffs-aio-example/multibuff/device_app/ |
H A D | aio_multibuff.c | 176 static void handle_ep0(int ep0, bool *ready) in handle_ep0() argument 181 ret = read(ep0, &event, sizeof(event)); in handle_ep0() 183 perror("unable to read event from ep0"); in handle_ep0() 190 write(ep0, NULL, 0); in handle_ep0() 192 read(ep0, NULL, 0); in handle_ep0() 240 int ep0, ep1; in main() local 263 sprintf(ep_path, "%s/ep0", argv[1]); in main() 264 ep0 = open(ep_path, O_RDWR); in main() 265 if (ep0 < 0) { in main() 266 perror("unable to open ep0"); in main() [all …]
|
/openbmc/linux/drivers/usb/gadget/function/ |
H A D | u_fs.h | 96 * are refused. All epfiles, except ep0, are deleted so there 102 * ep0 is opened again. In the second case functionfs state will 120 * In this state no open(2), read(2) or write(2) (both on ep0 122 * unlinked and all closed so this is not a problem; ep0 is 123 * also closed but ep0 file exists and so open(2) on ep0 must 134 * there. The next read/write on ep0 will handle the 141 * setup. If this state is set read/write on ep0 return 178 /* how many files are opened (EP0 and others) */ 181 /* EP0 state */ 187 * happens only in ep0 read which is P: mutex [all …]
|
/openbmc/u-boot/drivers/usb/musb/ |
H A D | musb_udc.c | 43 #include "../gadget/ep0.h" 116 w = readw(&musbr->ep[0].ep0.csr0); in musb_db_regs() 122 b = readb(&musbr->ep[0].ep0.configdata); in musb_db_regs() 209 csr0 = readw(&musbr->ep[0].ep0.csr0); in musb_peri_ep0_stall() 211 writew(csr0, &musbr->ep[0].ep0.csr0); in musb_peri_ep0_stall() 220 csr0 = readw(&musbr->ep[0].ep0.csr0); in musb_peri_ep0_ack_req() 222 writew(csr0, &musbr->ep[0].ep0.csr0); in musb_peri_ep0_ack_req() 229 csr0 = readw(&musbr->ep[0].ep0.csr0); in musb_ep0_tx_ready() 231 writew(csr0, &musbr->ep[0].ep0.csr0); in musb_ep0_tx_ready() 238 csr0 = readw(&musbr->ep[0].ep0.csr0); in musb_ep0_tx_ready_and_last() [all …]
|
H A D | musb_core.h | 17 /* EP0 */ 110 * ep0 elements are valid when array index is 0 114 struct musb_ep0_regs ep0; member 213 #define MUSB_TYPE_PROTO 0x30 /* Implicitly zero for ep0 */ 215 #define MUSB_TYPE_REMOTE_END 0xf /* Implicitly zero for ep0 */
|
/openbmc/linux/drivers/usb/mtu3/ |
H A D | mtu3_gadget_ep0.c | 3 * mtu3_gadget_ep0.c - MediaTek USB3 DRD peripheral driver ep0 handling 17 /* ep0 is always mtu3->in_eps[0] */ 18 #define next_ep0_request(mtu) next_request((mtu)->ep0) 59 mtu3_req_complete(mtu->ep0, req, 0); in ep0_req_giveback() 123 * because the length of test packet is less than max packet of HS ep0, in ep0_load_test_packet() 126 ep0_write_fifo(mtu->ep0, mtu3_test_packet, sizeof(mtu3_test_packet)); in ep0_load_test_packet() 152 dev_dbg(mtu->dev, "ep0: %s STALL, ep0_state: %s\n", in ep0_stall_set() 196 mtu->ep0_req.mep = mtu->ep0; in ep0_set_sel() 200 ret = ep0_queue(mtu->ep0, &mtu->ep0_req); in ep0_set_sel() 265 mtu->ep0_req.mep = mtu->ep0; in ep0_get_status() [all …]
|
H A D | mtu3_core.c | 180 /* Clear EP0 and Tx/Rx EPn interrupts status */ in mtu3_intr_status_clear() 307 /* set/clear the stall and toggle bits for non-ep0 */ 403 /* for non-ep0 */ 505 /* for non-ep0 */ 531 * 1. when device IP supports SS, the fifo of EP0, TX EPs, RX EPs 535 * the total fifo size of non-ep0, and ep0's is fixed to 64B, 537 * Due to the first 64B should be reserved for EP0, non-ep0's fifo 582 u32 maxpacket = mtu->g.ep0->maxpacket; in mtu3_ep0_setup() 593 /* Enable EP0 interrupt */ in mtu3_ep0_setup() 614 /* one for ep0, another is reserved */ in mtu3_mem_alloc() [all …]
|
/openbmc/linux/include/uapi/linux/usb/ |
H A D | gadgetfs.h | 5 * Other than ep0 operations, most things are done by read() and write() 8 * i/o requests. When ep0 is configured, the device can enumerate; 10 * ep0 require ioctl() operations. 28 * Events are delivered on the ep0 file descriptor, when the user mode driver
|
/openbmc/linux/drivers/usb/gadget/legacy/ |
H A D | inode.c | 45 * are two types of files. One type is for the device, implementing ep0. 83 /* /dev/gadget/$CHIP represents ep0 and the whole device */ 89 * ep0/device i/o modes and binding to the controller. Driver 95 /* From then on, ep0 fd is in either of two basic modes: 104 /* UNBOUND means the driver closed ep0, so the device won't be 125 /* drivers reading ep0 MUST handle control requests (SETUP) 148 /* except this scratch i/o buffer for ep0 */ 237 * at the end of ep0 configuration, or after unbind. 840 /* EP0 IMPLEMENTATION can be partly in userspace. 893 DBG (dev, "ep0 request busy!\n"); in setup_req() [all …]
|
/openbmc/linux/drivers/staging/emxx_udc/ |
H A D | emxx_udc.h | 149 /*------- (0x0028) EP0 Control Register */ 168 /*------- (0x002C) EP0 Status Register */ 191 /*------- (0x0030) EP0 Interrupt Enable Register */ 209 /*------- (0x0034) EP0 Length Register */ 212 /*------- (0x0038) EP0 Read Register */ 213 /*------- (0x003C) EP0 Write Register */ 427 u32 EP0_CONTROL; /* (0x0028) EP0 Control */ 428 u32 EP0_STATUS; /* (0x002C) EP0 Status */ 429 u32 EP0_INT_ENA; /* (0x0030) EP0 Interrupt Enable */ 430 u32 EP0_LENGTH; /* (0x0034) EP0 Length */ [all …]
|
/openbmc/linux/drivers/usb/gadget/udc/bdc/ |
H A D | bdc_ep.c | 383 /* Setup the first bd for ep0 transfer */ 400 (req_len % bdc->gadget.ep0->maxpacket == 0)) { in setup_first_bd_ep0() 403 bdc->gadget.ep0->maxpacket); in setup_first_bd_ep0() 416 "Unknown ep0 state for queueing bd ep0_state:%s\n", in setup_first_bd_ep0() 455 /* format of first bd for ep0 is different than other */ in setup_bd_list_xfr() 587 /* ep0 memory is not freed, but reused on next connect sr */ in bdc_ep_disable() 617 /* only for ep0: config ep is called for ep0 from connect event */ in bdc_ep_enable() 635 /* EP0 related code */ 655 /* Queue xfr on ep0 */ 915 /* ep0 is not in this gadget list */ in bdc_free_ep() [all …]
|
H A D | bdc_udc.c | 50 /* EP0 initial descripror */ 86 bdc->gadget.ep0->maxpacket = EP0_MAX_PKT_SIZE; in bdc_uspc_connected() 98 bdc->gadget.ep0->maxpacket = 64; in bdc_uspc_connected() 104 bdc->gadget.ep0->maxpacket = 64; in bdc_uspc_connected() 110 bdc->gadget.ep0->maxpacket = 8; in bdc_uspc_connected() 118 /* Now we know the speed, configure ep0 */ in bdc_uspc_connected() 122 dev_err(bdc->dev, "EP0 config failed\n"); in bdc_uspc_connected() 135 * Only stop ep0 from here, rest of the endpoints will be disabled in bdc_uspc_disconnected() 556 * Allocate bd list for ep0 only, ep0 will be enabled on connect in bdc_udc_init()
|
/openbmc/linux/drivers/usb/musb/ |
H A D | musb_regs.h | 113 #define MUSB_TYPE_PROTO 0x30 /* Implicitly zero for ep0 */ 115 #define MUSB_TYPE_REMOTE_END 0xf /* Implicitly zero for ep0 */ 249 #define MUSB_CSR0 MUSB_TXCSR /* Re-used for EP0 */ 253 #define MUSB_COUNT0 MUSB_RXCOUNT /* Re-used for EP0 */ 255 #define MUSB_TYPE0 MUSB_TXTYPE /* Re-used for EP0 */ 257 #define MUSB_NAKLIMIT0 MUSB_TXINTERVAL /* Re-used for EP0 */ 261 #define MUSB_CONFIGDATA MUSB_FIFOSIZE /* Re-used for EP0 */
|
/openbmc/u-boot/drivers/usb/gadget/ |
H A D | ci_udc.c | 115 .name = "ep0", 568 * The flipping of ep0 between IN and OUT relies on in ci_ep_queue() 577 printf("%s: ep0 transaction already in progress\n", __func__); in ci_ep_queue() 598 DBG("%s: Flipping ep0 to OUT\n", __func__); in flip_ep0_direction() 601 DBG("%s: Flipping ep0 to IN\n", __func__); in flip_ep0_direction() 649 * Data Stage is complete, so flip ep0 dir for Status Stage, in handle_ep_complete() 652 DBG("%s: flip ep0 dir for Status Stage\n", __func__); in handle_ep_complete() 676 head = ci_get_qh(0, 0); /* EP0 OUT */ in handle_setup() 689 /* Set EP0 dir for Data Stage based on Setup Stage data */ in handle_setup() 691 DBG("%s: Set ep0 to IN for Data Stage\n", __func__); in handle_setup() [all …]
|
H A D | at91_udc.c | 52 "ep0", 89 /* ep0 is always ready; other endpoints need a non-empty queue */ in done() 483 PACKET("ep0 in/status\n"); in at91_ep_queue() 638 INIT_LIST_HEAD(&udc->gadget.ep0->ep_list); in udc_reinit() 1067 PACKET("ep0 in/status\n"); in handle_setup() 1076 struct at91_ep *ep0 = &udc->ep[0]; in handle_ep0() local 1077 u32 __iomem *creg = ep0->creg; in handle_ep0() 1082 nuke(ep0, -EPROTO); in handle_ep0() 1087 VDBG("ep0 stalled\n"); in handle_ep0() 1091 nuke(ep0, 0); in handle_ep0() [all …]
|
/openbmc/u-boot/drivers/usb/musb-new/ |
H A D | musb_regs.h | 107 #define MUSB_TYPE_PROTO 0x30 /* Implicitly zero for ep0 */ 109 #define MUSB_TYPE_REMOTE_END 0xf /* Implicitly zero for ep0 */ 253 #define MUSB_CSR0 MUSB_TXCSR /* Re-used for EP0 */ 257 #define MUSB_COUNT0 MUSB_RXCOUNT /* Re-used for EP0 */ 259 #define MUSB_TYPE0 MUSB_TXTYPE /* Re-used for EP0 */ 261 #define MUSB_NAKLIMIT0 MUSB_TXINTERVAL /* Re-used for EP0 */ 265 #define MUSB_CONFIGDATA MUSB_FIFOSIZE /* Re-used for EP0 */ 277 /* TUSB6010 EP0 configuration register is special */
|
/openbmc/linux/Documentation/usb/ |
H A D | functionfs.rst | 16 mounted provides an "ep0" file. User space driver need to 30 configuration changes to (say) endpoint 2)). "ep0" is used 65 have been written to their ep0's.
|