Linux Tegra architecture development
 help / color / mirror / Atom feed
From: Dmitry Osipenko <digetx-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: Thierry Reding
	<thierry.reding-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	Felipe Balbi <balbi-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	Greg Kroah-Hartman
	<gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org>,
	Peter Chen <Peter.Chen-3arQi8VN3Tc@public.gmane.org>,
	Jonathan Hunter
	<jonathanh-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>,
	Stephen Warren <swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
Cc: Marc Dietrich <marvin24-Mmb7MZpHnFY@public.gmane.org>,
	Nicolas Chauvet <kwizart-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: [PATCH v2 2/8] usb: chipidea: udc: Support SKB alignment quirk
Date: Thu, 27 Jul 2017 19:46:06 +0300	[thread overview]
Message-ID: <7a7e32cafb3c77f4fb7a94de2c543f0dc4afd252.1501173271.git.digetx@gmail.com> (raw)
In-Reply-To: <cover.1501173271.git.digetx-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
In-Reply-To: <cover.1501173271.git.digetx-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>

NVIDIA Tegra20 UDC can't cope with unaligned DMA and require a USB gadget
quirk that avoids SKB buffer alignment to be set in order to make Ethernet
Gadget working. Later Tegra generations do not require that quirk. Let's
add a new platform data flag that allows to enable USB gadget quirk for
platforms that require it.

Signed-off-by: Dmitry Osipenko <digetx-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Acked-by: Peter Chen <peter.chen-3arQi8VN3Tc@public.gmane.org>
---
 drivers/usb/chipidea/udc.c   | 3 +++
 include/linux/usb/chipidea.h | 1 +
 2 files changed, 4 insertions(+)

diff --git a/drivers/usb/chipidea/udc.c b/drivers/usb/chipidea/udc.c
index 6502c13331e8..fe8a90543ea3 100644
--- a/drivers/usb/chipidea/udc.c
+++ b/drivers/usb/chipidea/udc.c
@@ -1896,6 +1896,9 @@ static int udc_start(struct ci_hdrc *ci)
 	ci->gadget.name         = ci->platdata->name;
 	ci->gadget.otg_caps	= otg_caps;
 
+	if (ci->platdata->flags & CI_HDRC_REQUIRES_ALIGNED_DMA)
+		ci->gadget.quirk_avoids_skb_reserve = 1;
+
 	if (ci->is_otg && (otg_caps->hnp_support || otg_caps->srp_support ||
 						otg_caps->adp_support))
 		ci->gadget.is_otg = 1;
diff --git a/include/linux/usb/chipidea.h b/include/linux/usb/chipidea.h
index c5fdfcf99828..d725cff7268d 100644
--- a/include/linux/usb/chipidea.h
+++ b/include/linux/usb/chipidea.h
@@ -58,6 +58,7 @@ struct ci_hdrc_platform_data {
 #define CI_HDRC_OVERRIDE_TX_BURST	BIT(10)
 #define CI_HDRC_OVERRIDE_RX_BURST	BIT(11)
 #define CI_HDRC_OVERRIDE_PHY_CONTROL	BIT(12) /* Glue layer manages phy */
+#define CI_HDRC_REQUIRES_ALIGNED_DMA	BIT(13)
 	enum usb_dr_mode	dr_mode;
 #define CI_HDRC_CONTROLLER_RESET_EVENT		0
 #define CI_HDRC_CONTROLLER_STOPPED_EVENT	1
-- 
2.13.3

  parent reply	other threads:[~2017-07-27 16:46 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-27 16:46 [PATCH v2 0/8] Support UDC on Tegra 20/30/114/124 Dmitry Osipenko
     [not found] ` <cover.1501173271.git.digetx-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-07-27 16:46   ` [PATCH v2 1/8] usb: gadget: f_ecm/f_eem/f_rndis: Setup quirk_avoids_skb_reserve Dmitry Osipenko
2017-07-27 16:46   ` Dmitry Osipenko [this message]
2017-07-27 16:46   ` [PATCH v2 3/8] usb: chipidea: Add support for Tegra20/30/114/124 Dmitry Osipenko
     [not found]     ` <f103baa439a64b517e6c8cb51c30e81987dfedb3.1501173271.git.digetx-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-07-27 22:32       ` Michał Mirosław
     [not found]         ` <20170727223223.ezyzvmum7c773vel-cHozx32mtrEEUmgCuDUIdw@public.gmane.org>
2017-07-28 10:00           ` Dmitry Osipenko
     [not found]             ` <832adea3-b5f2-a28c-6be4-0f572052821b-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-07-28 15:51               ` Michał Mirosław
     [not found]                 ` <20170728155115.kn2o7iei5yhzmpdq-cHozx32mtrEEUmgCuDUIdw@public.gmane.org>
2017-07-31  1:14                   ` Peter Chen
2017-07-31 10:13                     ` Dmitry Osipenko
2017-07-27 16:46   ` [PATCH v2 4/8] ARM: defconfig: tegra: Enable ChipIdea UDC driver Dmitry Osipenko
2017-07-27 16:46   ` [PATCH v2 5/8] ARM: tegra: Enable UDC on Beaver Dmitry Osipenko
2017-07-27 16:46   ` [PATCH v2 6/8] ARM: tegra: Enable UDC on Dalmore Dmitry Osipenko
2017-07-27 16:46   ` [PATCH v2 7/8] ARM: tegra: Enable UDC on Jetson TK1 Dmitry Osipenko
2017-07-27 16:46   ` [PATCH v2 8/8] ARM: tegra: Enable UDC on AC100 Dmitry Osipenko

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=7a7e32cafb3c77f4fb7a94de2c543f0dc4afd252.1501173271.git.digetx@gmail.com \
    --to=digetx-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=Peter.Chen-3arQi8VN3Tc@public.gmane.org \
    --cc=balbi-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org \
    --cc=jonathanh-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org \
    --cc=kwizart-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=marvin24-Mmb7MZpHnFY@public.gmane.org \
    --cc=swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org \
    --cc=thierry.reding-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    /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