All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chunfeng Yun <chunfeng.yun@mediatek.com>
To: u-boot@lists.denx.de
Subject: [PATCH next v7 05/10] usb: add MediaTek USB3 DRD driver
Date: Wed, 14 Oct 2020 11:15:37 +0800	[thread overview]
Message-ID: <1602645337.29336.76.camel@mhfsdcap03> (raw)
In-Reply-To: <CAEUhbmVhQMwT4K9mQqOoPEtMkutG2Nt-MSYuwUj70ZDYKrKCuQ@mail.gmail.com>

On Tue, 2020-10-13 at 22:26 +0800, Bin Meng wrote:
> On Fri, Sep 18, 2020 at 5:12 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>
> 
> I can only comment some generic stuff, since I have no access to the
> controller datasheet.
It's good enough, I and my workmate will test the function

> 
> > ---
> > v7:
> >     1. use xhci quirk flag XHCI_MTK_HOST
> >
> > v6: no changes
> >
> > v5:
> >     1. 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           |  45 ++
> >  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, 4556 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
> >
> > diff --git a/Makefile b/Makefile
> > index 7a05fc7..2dcc41a 100644
> > --- a/Makefile
> > +++ b/Makefile
> > @@ -795,6 +795,7 @@ libs-y += drivers/usb/eth/
> >  libs-$(CONFIG_USB_GADGET) += drivers/usb/gadget/
> >  libs-$(CONFIG_USB_GADGET) += drivers/usb/gadget/udc/
> >  libs-y += drivers/usb/host/
> > +libs-y += drivers/usb/mtu3/
> >  libs-y += drivers/usb/musb/
> >  libs-y += drivers/usb/musb-new/
> >  libs-y += drivers/usb/phy/
> > diff --git a/drivers/usb/Kconfig b/drivers/usb/Kconfig
> > index 34881a1..fedc013 100644
> > --- a/drivers/usb/Kconfig
> > +++ b/drivers/usb/Kconfig
> > @@ -72,6 +72,8 @@ source "drivers/usb/cdns3/Kconfig"
> >
> >  source "drivers/usb/dwc3/Kconfig"
> >
> > +source "drivers/usb/mtu3/Kconfig"
> > +
> >  source "drivers/usb/musb/Kconfig"
> >
> >  source "drivers/usb/musb-new/Kconfig"
> > diff --git a/drivers/usb/mtu3/Kconfig b/drivers/usb/mtu3/Kconfig
> > new file mode 100644
> > index 0000000..66651ad
> > --- /dev/null
> > +++ b/drivers/usb/mtu3/Kconfig
> > @@ -0,0 +1,45 @@
> > +# SPDX-License-Identifier: GPL-2.0
> > +#
> > +# For MTK USB3.0 IP
> > +
> > +config USB_MTU3
> > +       bool "MediaTek USB3 Dual Role controller"
> > +       depends on USB || USB_GADGET
> > +       depends on ARCH_MEDIATEK
> > +       help
> > +         Say Y here if your system runs on MediaTek SoCs with
> > +         Dual Role SuperSpeed USB controller. You can select usb
> > +         mode as peripheral role or host role.
> > +
> > +         If you don't know what this is, please say N.
> > +
> > +if USB_MTU3
> > +choice
> > +       bool "MTU3 Mode Selection"
> > +       default USB_MTU3_GADGET if USB_GADGET
> > +       default USB_MTU3_HOST if (USB && !USB_GADGET)
> > +
> > +config USB_MTU3_HOST
> > +       bool "Host only mode"
> > +       depends on USB=y || USB=USB_MTU3
> 
> Is this Kconfig grammer supported by U-Boot?
Yes, no error happens when use menuconfig, but can be simplified,
I modify it.

Thanks a lot

> 
> > +       select USB_XHCI_HCD
> > +       help
> > +         Select this when you want to use MTU3 in host mode only,
> > +         thereby the gadget feature will be regressed.
> > +
> > +config USB_MTU3_GADGET
> > +       bool "Gadget only mode"
> > +       depends on USB_GADGET=y || USB_GADGET=USB_MTU3
> > +       select USB_GADGET_DUALSPEED
> > +       help
> > +         Select this when you want to use MTU3 in gadget mode only,
> > +         thereby the host feature will be regressed.
> > +
> > +endchoice
> > +
> > +config USB_MTU3_DEBUG
> > +       bool "Enable Debugging Messages"
> > +       help
> > +         Say Y here to enable debugging messages in the MTU3 Driver.
> > +
> > +endif
> > diff --git a/drivers/usb/mtu3/Makefile b/drivers/usb/mtu3/Makefile
> > new file mode 100644
> > index 0000000..234f3a3
> > --- /dev/null
> > +++ b/drivers/usb/mtu3/Makefile
> > @@ -0,0 +1,11 @@
> > +# SPDX-License-Identifier: GPL-2.0
> > +
> > +ccflags-$(CONFIG_USB_MTU3_DEBUG)       += -DDEBUG
> > +
> > +obj-$(CONFIG_USB_MTU3) += mtu3.o
> > +
> > +mtu3-y := mtu3_plat.o
> > +
> > +obj-$(CONFIG_USB_MTU3_GADGET)  += mtu3_core.o mtu3_gadget_ep0.o mtu3_gadget.o
> > +obj-$(CONFIG_USB_MTU3_GADGET)  += mtu3_qmu.o
> > +obj-$(CONFIG_USB_MTU3_HOST)    += mtu3_host.o
> 
> [snip]
> 
> Regards,
> Bin

  reply	other threads:[~2020-10-14  3:15 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-18  9:10 [PATCH next v7 00/10] Add support MediaTek USB3 DRD driver Chunfeng Yun
2020-09-18  9:10 ` [PATCH next v7 01/10] dt-binding: usb: add bindings for some common properties Chunfeng Yun
2020-10-13 14:15   ` Bin Meng
2020-09-18  9:10 ` [PATCH next v7 02/10] dt-bindings: usb: mtu3: add bindings for MediaTek USB3 DRD Chunfeng Yun
2020-10-13 14:18   ` Bin Meng
2020-10-14  2:46     ` Chunfeng Yun
2020-09-18  9:10 ` [PATCH next v7 03/10] usb: add USB_SPEED_SUPER_PLUS Chunfeng Yun
2020-10-13 14:19   ` Bin Meng
2020-10-14  2:50     ` Chunfeng Yun
2020-09-18  9:10 ` [PATCH next v7 04/10] usb: common: add define of usb_speed_string() Chunfeng Yun
2020-10-13 14:21   ` Bin Meng
2020-09-18  9:10 ` [PATCH next v7 05/10] usb: add MediaTek USB3 DRD driver Chunfeng Yun
2020-10-13 14:26   ` Bin Meng
2020-10-14  3:15     ` Chunfeng Yun [this message]
2020-09-18  9:10 ` [PATCH next v7 06/10] usb: gadget: Add bcdDevice for the MTU3 USB Gadget Controller Chunfeng Yun
2020-10-13 14:28   ` Bin Meng
2020-09-18  9:10 ` [PATCH next v7 07/10] arm: dts: mt8512: add usb related nodes Chunfeng Yun
2020-10-13 14:32   ` Bin Meng
2020-09-18  9:10 ` [PATCH next v7 08/10] configs: mt8512: enable fastboot Chunfeng Yun
2020-09-18  9:10 ` [PATCH next v7 09/10] configs: mt8512: add USB host related configs Chunfeng Yun
2020-10-13 14:34   ` Bin Meng
2020-10-14  3:40     ` Chunfeng Yun
2020-09-18  9:10 ` [PATCH next v7 10/10] MAINTAINERS: add USB driver to ARM MEDIATEK Chunfeng Yun
2020-10-13 14:35   ` Bin Meng
2020-09-28  2:01 ` [PATCH next v7 00/10] Add support MediaTek USB3 DRD driver Chunfeng Yun
2020-09-28  2:12   ` Marek Vasut
2020-09-28  2:20     ` Chunfeng Yun
2020-10-13  7:26     ` Chunfeng Yun
2020-10-13 10:27       ` Bin Meng

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1602645337.29336.76.camel@mhfsdcap03 \
    --to=chunfeng.yun@mediatek.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.