Lines Matching refs:mep

23 static int ep_fifo_alloc(struct mtu3_ep *mep, u32 seg_size)  in ep_fifo_alloc()  argument
25 struct mtu3_fifo_info *fifo = mep->fifo; in ep_fifo_alloc()
34 mep->fifo_seg_size = num_bits * MTU3_EP_FIFO_UNIT; in ep_fifo_alloc()
35 num_bits = num_bits * (mep->slot + 1); in ep_fifo_alloc()
42 mep->fifo_size = num_bits * MTU3_EP_FIFO_UNIT; in ep_fifo_alloc()
43 mep->fifo_addr = fifo->base + MTU3_EP_FIFO_UNIT * start_bit; in ep_fifo_alloc()
45 dev_dbg(mep->mtu->dev, "%s fifo:%#x/%#x, start_bit: %d\n", in ep_fifo_alloc()
46 __func__, mep->fifo_seg_size, mep->fifo_size, start_bit); in ep_fifo_alloc()
48 return mep->fifo_addr; in ep_fifo_alloc()
51 static void ep_fifo_free(struct mtu3_ep *mep) in ep_fifo_free() argument
53 struct mtu3_fifo_info *fifo = mep->fifo; in ep_fifo_free()
54 u32 addr = mep->fifo_addr; in ep_fifo_free()
55 u32 bits = mep->fifo_size / MTU3_EP_FIFO_UNIT; in ep_fifo_free()
63 mep->fifo_size = 0; in ep_fifo_free()
64 mep->fifo_seg_size = 0; in ep_fifo_free()
66 dev_dbg(mep->mtu->dev, "%s size:%#x/%#x, start_bit: %d\n", in ep_fifo_free()
67 __func__, mep->fifo_seg_size, mep->fifo_size, start_bit); in ep_fifo_free()
298 static void mtu3_ep_reset(struct mtu3_ep *mep) in mtu3_ep_reset() argument
300 struct mtu3 *mtu = mep->mtu; in mtu3_ep_reset()
301 u32 rst_bit = EP_RST(mep->is_in, mep->epnum); in mtu3_ep_reset()
308 void mtu3_ep_stall_set(struct mtu3_ep *mep, bool set) in mtu3_ep_stall_set() argument
310 struct mtu3 *mtu = mep->mtu; in mtu3_ep_stall_set()
312 u8 epnum = mep->epnum; in mtu3_ep_stall_set()
315 if (mep->is_in) { /* TX */ in mtu3_ep_stall_set()
332 mtu3_ep_reset(mep); in mtu3_ep_stall_set()
333 mep->flags &= ~MTU3_EP_STALL; in mtu3_ep_stall_set()
335 mep->flags |= MTU3_EP_STALL; in mtu3_ep_stall_set()
338 dev_dbg(mtu->dev, "%s: %s\n", mep->name, in mtu3_ep_stall_set()
404 int mtu3_config_ep(struct mtu3 *mtu, struct mtu3_ep *mep, in mtu3_config_ep() argument
409 int epnum = mep->epnum; in mtu3_config_ep()
414 fifo_addr = ep_fifo_alloc(mep, mep->maxp); in mtu3_config_ep()
416 dev_err(mtu->dev, "alloc ep fifo failed(%d)\n", mep->maxp); in mtu3_config_ep()
419 fifo_sgsz = ilog2(mep->fifo_seg_size); in mtu3_config_ep()
421 mep->fifo_seg_size, mep->fifo_size); in mtu3_config_ep()
423 if (mep->is_in) { in mtu3_config_ep()
424 csr0 = TX_TXMAXPKTSZ(mep->maxp); in mtu3_config_ep()
428 csr1 = TX_SS_BURST(burst) | TX_SLOT(mep->slot); in mtu3_config_ep()
434 switch (mep->type) { in mtu3_config_ep()
460 csr0 = RX_RXMAXPKTSZ(mep->maxp); in mtu3_config_ep()
464 csr1 = RX_SS_BURST(burst) | RX_SLOT(mep->slot); in mtu3_config_ep()
470 switch (mep->type) { in mtu3_config_ep()
499 __func__, mep->name, mep->fifo_addr, mep->fifo_size, in mtu3_config_ep()
500 fifo_sgsz, mep->fifo_seg_size); in mtu3_config_ep()
506 void mtu3_deconfig_ep(struct mtu3 *mtu, struct mtu3_ep *mep) in mtu3_deconfig_ep() argument
509 int epnum = mep->epnum; in mtu3_deconfig_ep()
511 if (mep->is_in) { in mtu3_deconfig_ep()
523 mtu3_ep_reset(mep); in mtu3_deconfig_ep()
524 ep_fifo_free(mep); in mtu3_deconfig_ep()
526 dev_dbg(mtu->dev, "%s: %s\n", __func__, mep->name); in mtu3_deconfig_ep()
629 struct mtu3_ep *mep = mtu->in_eps + i; in mtu3_mem_alloc() local
631 mep->fifo = &mtu->tx_fifo; in mtu3_mem_alloc()
632 mep = mtu->out_eps + i; in mtu3_mem_alloc()
633 mep->fifo = &mtu->rx_fifo; in mtu3_mem_alloc()