From: Jean-Jacques Hiblot <jjhiblot@ti.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v3 2/8] usb: introduce a separate config option for DM USB device
Date: Tue, 25 Sep 2018 11:03:17 +0200 [thread overview]
Message-ID: <1537866203-7717-3-git-send-email-jjhiblot@ti.com> (raw)
In-Reply-To: <1537866203-7717-1-git-send-email-jjhiblot@ti.com>
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>
Reviewed-by: Lukasz Majewski <lukma@denx.de>
---
Changes in v3: None
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 0f8dd32..cc515e3 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -894,6 +894,7 @@ config ARCH_ZYNQMP_R5
select DM_SERIAL
select OF_CONTROL
imply CMD_DM
+ imply DM_USB_DEV
config ARCH_ZYNQMP
bool "Xilinx ZynqMP based platform"
@@ -909,6 +910,7 @@ config ARCH_ZYNQMP
select SUPPORT_SPL
imply CMD_DM
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;
--
2.7.4
next prev parent reply other threads:[~2018-09-25 9:03 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-25 9:03 [U-Boot] [PATCH v3 0/8] Improvements for the dwc3_generic driver Jean-Jacques Hiblot
2018-09-25 9:03 ` [U-Boot] [PATCH v3 1/8] usb: gadget: Do not call board_usb_xxx() directly in USB gadget drivers Jean-Jacques Hiblot
2018-09-25 9:03 ` Jean-Jacques Hiblot [this message]
2018-09-25 9:03 ` [U-Boot] [PATCH v3 3/8] usb: udc: implement DM versions of usb_gadget_initialize()/_release()/_handle_interrupt() Jean-Jacques Hiblot
2018-09-25 9:03 ` [U-Boot] [PATCH v3 4/8] dwc3_generic: do not probe the USB device driver when it's bound Jean-Jacques Hiblot
2018-09-25 9:03 ` [U-Boot] [PATCH v3 5/8] dwc3: move phy operation to core.c Jean-Jacques Hiblot
2018-09-25 9:03 ` [U-Boot] [PATCH v3 6/8] configs: evb-rk3328: Enable CONFIG_USB_DWC3 Jean-Jacques Hiblot
2018-09-25 9:03 ` [U-Boot] [PATCH v3 7/8] dwc3-generic: Handle the PHYs, the clocks and the reset lines Jean-Jacques Hiblot
2018-09-25 9:03 ` [U-Boot] [PATCH v3 8/8] dwc3-generic: Add select_dr_mode operation Jean-Jacques Hiblot
2018-09-25 11:28 ` [U-Boot] [PATCH v3 0/8] Improvements for the dwc3_generic driver Lukasz Majewski
2018-10-01 12:51 ` Lukasz Majewski
2018-10-01 13:26 ` Philipp Tomsich
2018-10-08 2:07 ` Kever Yang
2018-10-22 10:45 ` Jean-Jacques Hiblot
2018-10-09 14:29 ` Loic Devulder
2018-10-22 15:55 ` Jean-Jacques Hiblot
2018-10-22 16:16 ` Lukasz Majewski
2018-10-22 16:24 ` Jean-Jacques Hiblot
2018-10-26 10:25 ` Jean-Jacques Hiblot
2018-10-28 20:50 ` Lukasz Majewski
2018-11-01 9:27 ` Michal Simek
2018-11-01 15:56 ` Lukasz Majewski
2018-11-01 16:06 ` Tom Rini
2018-11-01 16:55 ` Lukasz Majewski
2018-11-16 14:49 ` 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=1537866203-7717-3-git-send-email-jjhiblot@ti.com \
--to=jjhiblot@ti.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.