Message ID | 1602659313-15391-1-git-send-email-chunfeng.yun@mediatek.com |
---|---|
Headers | show |
Series | Add support MediaTek USB3 DRD driver | expand |
On Wed, Oct 14, 2020 at 3:08 PM Chunfeng Yun <chunfeng.yun@mediatek.com> wrote: > > This patch adds support for the MediaTek USB3 DRD controller, > its host side is based on xHCI, this driver supports device mode > and host mode. > > Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com> > --- > v8: Simplify Kconfig suggested by Bin > > v7: use xhci quirk flag XHCI_MTK_HOST > > v6: no changes > > v5: change condition of readl_poll_timeout() when check clocks > > v4: > 1. remove unused member @busy and @wedged, use their flags instead > 2. support force_vbus mode > 3. add a glue driver using UCLASS_NOP > 4. add host driver, and rebuild host flow > > v3 changes > 1. add ->udc_set_speed() > 2. simplify some code flow > > v2: simplify QMU operations > --- > Makefile | 1 + > drivers/usb/Kconfig | 2 + > drivers/usb/mtu3/Kconfig | 44 ++ > drivers/usb/mtu3/Makefile | 11 + > drivers/usb/mtu3/mtu3.h | 423 +++++++++++++ > drivers/usb/mtu3/mtu3_core.c | 838 ++++++++++++++++++++++++++ > drivers/usb/mtu3/mtu3_dr.h | 52 ++ > drivers/usb/mtu3/mtu3_gadget.c | 686 +++++++++++++++++++++ > drivers/usb/mtu3/mtu3_gadget_ep0.c | 933 +++++++++++++++++++++++++++++ > drivers/usb/mtu3/mtu3_host.c | 141 +++++ > drivers/usb/mtu3/mtu3_hw_regs.h | 515 ++++++++++++++++ > drivers/usb/mtu3/mtu3_plat.c | 368 ++++++++++++ > drivers/usb/mtu3/mtu3_qmu.c | 504 ++++++++++++++++ > drivers/usb/mtu3/mtu3_qmu.h | 37 ++ > 14 files changed, 4555 insertions(+) > create mode 100644 drivers/usb/mtu3/Kconfig > create mode 100644 drivers/usb/mtu3/Makefile > create mode 100644 drivers/usb/mtu3/mtu3.h > create mode 100644 drivers/usb/mtu3/mtu3_core.c > create mode 100644 drivers/usb/mtu3/mtu3_dr.h > create mode 100644 drivers/usb/mtu3/mtu3_gadget.c > create mode 100644 drivers/usb/mtu3/mtu3_gadget_ep0.c > create mode 100644 drivers/usb/mtu3/mtu3_host.c > create mode 100644 drivers/usb/mtu3/mtu3_hw_regs.h > create mode 100644 drivers/usb/mtu3/mtu3_plat.c > create mode 100644 drivers/usb/mtu3/mtu3_qmu.c > create mode 100644 drivers/usb/mtu3/mtu3_qmu.h > Acked-by: Bin Meng <bmeng.cn@gmail.com>
On 10/14/20 9:08 AM, Chunfeng Yun wrote: > This patch adds support for the MediaTek USB3 DRD controller, > its host side is based on xHCI, this driver supports device mode > and host mode. This one does not apply, can you rebase just this one on top of usb/next and resend ? I picked the other patches into there already, so you don't have to resend the whole series. [...] > +#define MU3D_EP_TXCR0(epnum) (U3D_TX1CSR0 + (((epnum) - 1) * 0x10)) > +#define MU3D_EP_TXCR1(epnum) (U3D_TX1CSR1 + (((epnum) - 1) * 0x10)) > +#define MU3D_EP_TXCR2(epnum) (U3D_TX1CSR2 + (((epnum) - 1) * 0x10)) > + > +#define MU3D_EP_RXCR0(epnum) (U3D_RX1CSR0 + (((epnum) - 1) * 0x10)) > +#define MU3D_EP_RXCR1(epnum) (U3D_RX1CSR1 + (((epnum) - 1) * 0x10)) > +#define MU3D_EP_RXCR2(epnum) (U3D_RX1CSR2 + (((epnum) - 1) * 0x10)) #define[space] please, use consistently. > +#define USB_QMU_RQCSR(epnum) (U3D_RXQCSR1 + (((epnum) - 1) * 0x10)) > +#define USB_QMU_RQSAR(epnum) (U3D_RXQSAR1 + (((epnum) - 1) * 0x10)) > +#define USB_QMU_RQCPR(epnum) (U3D_RXQCPR1 + (((epnum) - 1) * 0x10)) [...]
On Wed, 2020-10-14 at 10:22 +0200, Marek Vasut wrote: > On 10/14/20 9:08 AM, Chunfeng Yun wrote: > > This patch adds support for the MediaTek USB3 DRD controller, > > its host side is based on xHCI, this driver supports device mode > > and host mode. > > This one does not apply, can you rebase just this one on top of usb/next > and resend ? I picked the other patches into there already, so you don't > have to resend the whole series. Ok > > [...] > > > +#define MU3D_EP_TXCR0(epnum) (U3D_TX1CSR0 + (((epnum) - 1) * 0x10)) > > +#define MU3D_EP_TXCR1(epnum) (U3D_TX1CSR1 + (((epnum) - 1) * 0x10)) > > +#define MU3D_EP_TXCR2(epnum) (U3D_TX1CSR2 + (((epnum) - 1) * 0x10)) > > + > > +#define MU3D_EP_RXCR0(epnum) (U3D_RX1CSR0 + (((epnum) - 1) * 0x10)) > > +#define MU3D_EP_RXCR1(epnum) (U3D_RX1CSR1 + (((epnum) - 1) * 0x10)) > > +#define MU3D_EP_RXCR2(epnum) (U3D_RX1CSR2 + (((epnum) - 1) * 0x10)) > > #define[space] please, use consistently. Will fix it Thanks > > > +#define USB_QMU_RQCSR(epnum) (U3D_RXQCSR1 + (((epnum) - 1) * 0x10)) > > +#define USB_QMU_RQSAR(epnum) (U3D_RXQSAR1 + (((epnum) - 1) * 0x10)) > > +#define USB_QMU_RQCPR(epnum) (U3D_RXQCPR1 + (((epnum) - 1) * 0x10)) > > [...]