public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Lukasz Majewski <lukma@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2 2/7] usb: introduce a separate config option for DM USB device
Date: Fri, 1 Jun 2018 14:12:01 +0200	[thread overview]
Message-ID: <20180601141201.1dbfbdb5@jawa> (raw)
In-Reply-To: <1527597407-27991-3-git-send-email-jjhiblot@ti.com>

Hi Jean-Jacques,

> Using CONFIG_DM_USB for this purpose prevents using DM_USB for host
> and not for device.
> 
> Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
> 
> ---
> 
> Changes in v2:
> - select DM_USB_DEV by default for zynqmp platforms
> 
>  arch/arm/Kconfig                | 2 ++
>  drivers/usb/Kconfig             | 6 ++++++
>  drivers/usb/dwc3/core.c         | 2 +-
>  drivers/usb/dwc3/dwc3-generic.c | 4 +++-
>  4 files changed, 12 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
> index 0d1802b..caf7053 100644
> --- a/arch/arm/Kconfig
> +++ b/arch/arm/Kconfig
> @@ -841,6 +841,7 @@ config ARCH_ZYNQMP_R5
>  	select DM
>  	select DM_SERIAL
>  	select CLK
> +	imply DM_USB_DEV
>  
>  config ARCH_ZYNQMP
>  	bool "Xilinx ZynqMP based platform"
> @@ -855,6 +856,7 @@ config ARCH_ZYNQMP
>  	select SPL_CLK if SPL
>  	select DM_USB if USB
>  	imply FAT_WRITE
> +	imply DM_USB_DEV
>  
>  config TEGRA
>  	bool "NVIDIA Tegra"
> diff --git a/drivers/usb/Kconfig b/drivers/usb/Kconfig
> index 4fbe172..3587ba4 100644
> --- a/drivers/usb/Kconfig
> +++ b/drivers/usb/Kconfig
> @@ -47,6 +47,12 @@ config DM_USB
>  	  declared with the U_BOOT_USB_DEVICE() macro and will be
>  	  automatically probed when found on the bus.
>  
> +config DM_USB_DEV
> +	bool "Enable driver model for USB (Peripheral mode)"
> +	depends on DM_USB
> +	help
> +	  Enable driver model for USB (Peripheral mode).
> +
>  source "drivers/usb/host/Kconfig"
>  
>  source "drivers/usb/dwc3/Kconfig"
> diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c
> index 1ab5cee..d5ee6d9 100644
> --- a/drivers/usb/dwc3/core.c
> +++ b/drivers/usb/dwc3/core.c
> @@ -789,7 +789,7 @@ MODULE_AUTHOR("Felipe Balbi <balbi@ti.com>");
>  MODULE_LICENSE("GPL v2");
>  MODULE_DESCRIPTION("DesignWare USB3 DRD Controller Driver");
>  
> -#ifdef CONFIG_DM_USB
> +#ifdef CONFIG_DM_USB_DEV
>  
>  int dwc3_init(struct dwc3 *dwc)
>  {
> diff --git a/drivers/usb/dwc3/dwc3-generic.c
> b/drivers/usb/dwc3/dwc3-generic.c index ca63eac..2c1e696 100644
> --- a/drivers/usb/dwc3/dwc3-generic.c
> +++ b/drivers/usb/dwc3/dwc3-generic.c
> @@ -21,7 +21,7 @@
>  #include "gadget.h"
>  #include "linux-compat.h"
>  
> -DECLARE_GLOBAL_DATA_PTR;
> +#ifdef CONFIG_DM_USB_DEV
>  
>  int usb_gadget_handle_interrupts(int index)
>  {
> @@ -98,6 +98,8 @@ U_BOOT_DRIVER(dwc3_generic_peripheral) = {
>  	.flags	= DM_FLAG_ALLOC_PRIV_DMA,
>  };
>  
> +#endif
> +
>  static int dwc3_generic_bind(struct udevice *parent)
>  {
>  	const void *fdt = gd->fdt_blob;

Reviewed-by: Lukasz Majewski <lukma@denx.de>


Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180601/a4b2925d/attachment.sig>

  reply	other threads:[~2018-06-01 12:12 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-29 12:36 [U-Boot] [PATCH v2 0/7] Improvements for the dwc3_generic driver Jean-Jacques Hiblot
2018-05-29 12:36 ` [U-Boot] [PATCH v2 1/7] usb: gadget: Do not call board_usb_xxx() directly in USB gadget drivers Jean-Jacques Hiblot
2018-06-01 12:12   ` Lukasz Majewski
2018-05-29 12:36 ` [U-Boot] [PATCH v2 2/7] usb: introduce a separate config option for DM USB device Jean-Jacques Hiblot
2018-06-01 12:12   ` Lukasz Majewski [this message]
2018-05-29 12:36 ` [U-Boot] [PATCH v2 3/7] usb: udc: implement DM versions of usb_gadget_initialize()/_release()/_handle_interrupt() Jean-Jacques Hiblot
2018-05-29 12:36 ` [U-Boot] [PATCH v2 4/7] dwc3_generic: do not probe the USB device driver when it's bound Jean-Jacques Hiblot
2018-05-29 12:36 ` [U-Boot] [PATCH v2 5/7] dwc3: move phy operation to core.c Jean-Jacques Hiblot
2018-05-29 12:36 ` [U-Boot] [PATCH v2 6/7] dwc3-generic: Handle the PHYs, the clocks and the reset lines Jean-Jacques Hiblot
2018-05-29 12:36 ` [U-Boot] [PATCH v2 7/7] dwc3-generic: Add select_dr_mode operation Jean-Jacques Hiblot
2018-06-01 13:19 ` [U-Boot] [PATCH v2 0/7] Improvements for the dwc3_generic driver Michal Simek
2018-06-12  9:36 ` Jean-Jacques Hiblot
  -- strict thread matches above, loose matches on Subject: below --
2018-09-04 13:42 [U-Boot] [PATCH v2 0/7] [RESEND] " Jean-Jacques Hiblot
2018-09-04 13:42 ` [U-Boot] [PATCH v2 2/7] usb: introduce a separate config option for DM USB device Jean-Jacques Hiblot

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=20180601141201.1dbfbdb5@jawa \
    --to=lukma@denx.de \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox