linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: peter.chen@freescale.com (Peter Chen)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v3 06/10] usb: chipidea: add ahb burst configuration interface
Date: Fri, 7 Aug 2015 15:15:43 +0800	[thread overview]
Message-ID: <1438931747-25209-7-git-send-email-peter.chen@freescale.com> (raw)
In-Reply-To: <1438931747-25209-1-git-send-email-peter.chen@freescale.com>

The users can change it through dts or platform data if they
want to change the default value.

Signed-off-by: Peter Chen <peter.chen@freescale.com>
---
 drivers/usb/chipidea/bits.h  |  3 +++
 drivers/usb/chipidea/core.c  | 14 ++++++++++++++
 include/linux/usb/chipidea.h |  2 ++
 3 files changed, 19 insertions(+)

diff --git a/drivers/usb/chipidea/bits.h b/drivers/usb/chipidea/bits.h
index 831a8f6..462ad02 100644
--- a/drivers/usb/chipidea/bits.h
+++ b/drivers/usb/chipidea/bits.h
@@ -25,6 +25,9 @@
 #define VERSION		      (0xF << 25)
 #define CIVERSION	      (0x7 << 29)
 
+/* SBUSCFG */
+#define AHBBRST_MASK		0x7
+
 /* HCCPARAMS */
 #define HCCPARAMS_LEN         BIT(17)
 
diff --git a/drivers/usb/chipidea/core.c b/drivers/usb/chipidea/core.c
index 97f937f..bde49f3 100644
--- a/drivers/usb/chipidea/core.c
+++ b/drivers/usb/chipidea/core.c
@@ -438,6 +438,9 @@ void ci_platform_configure(struct ci_hdrc *ci)
 
 	hw_write(ci, OP_USBCMD, 0xff0000, ci->platdata->itc_setting << 16);
 
+	if (ci->platdata->flags & CI_HDRC_OVERRIDE_AHB_BURST)
+		hw_write_id_reg(ci, ID_SBUSCFG, AHBBRST_MASK,
+			ci->platdata->ahb_burst_config);
 }
 
 /**
@@ -646,6 +649,17 @@ static int ci_get_platdata(struct device *dev,
 		}
 	}
 
+	if (of_find_property(dev->of_node, "ahb-burst-config", NULL)) {
+		ret = of_property_read_u32(dev->of_node, "ahb-burst-config",
+			&platdata->ahb_burst_config);
+		if (ret) {
+			dev_err(dev,
+				"failed to get ahb-burst-config\n");
+			return ret;
+		}
+		platdata->flags |= CI_HDRC_OVERRIDE_AHB_BURST;
+	}
+
 	return 0;
 }
 
diff --git a/include/linux/usb/chipidea.h b/include/linux/usb/chipidea.h
index 034f7e1..fe3c8eb 100644
--- a/include/linux/usb/chipidea.h
+++ b/include/linux/usb/chipidea.h
@@ -33,6 +33,7 @@ struct ci_hdrc_platform_data {
 #define CI_HDRC_FORCE_FULLSPEED		BIT(6)
 #define CI_HDRC_TURN_VBUS_EARLY_ON	BIT(7)
 #define CI_HDRC_SET_NON_ZERO_TTHA	BIT(8)
+#define CI_HDRC_OVERRIDE_AHB_BURST	BIT(9)
 	enum usb_dr_mode	dr_mode;
 #define CI_HDRC_CONTROLLER_RESET_EVENT		0
 #define CI_HDRC_CONTROLLER_STOPPED_EVENT	1
@@ -42,6 +43,7 @@ struct ci_hdrc_platform_data {
 	bool			tpl_support;
 	/* interrupt threshold setting */
 	u32			itc_setting;
+	u32			ahb_burst_config;
 };
 
 /* Default offset of capability registers */
-- 
1.9.1

  parent reply	other threads:[~2015-08-07  7:15 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-07  7:15 [PATCH v3 00/10] USB: chipidea misc patches Peter Chen
2015-08-07  7:15 ` [PATCH v3 01/10] usb: chipidea: udc: zero-length packet is only needed for TX Peter Chen
2015-08-07  7:15 ` [PATCH v3 02/10] usb: chipidea: define stream mode disable for both roles Peter Chen
2015-08-07  7:15 ` [PATCH v3 03/10] usb: chipidea: imx: add stream mode enable for device mode at imx6sl/imx6sx Peter Chen
2015-08-07  7:15 ` [PATCH v3 04/10] Doc: usb: ci-hdrc-usb2: add ahb-burst-config for binding doc Peter Chen
2015-08-07  7:15 ` [PATCH v3 05/10] ARM: imx6: set ahb-burst-config as 0 for USB Peter Chen
2015-08-07  7:15 ` Peter Chen [this message]
2015-08-07  7:15 ` [PATCH v3 07/10] usb: chipidea: usbmisc_imx: add non-burst setting for imx6 Peter Chen
2015-08-07  7:15 ` [PATCH v3 08/10] Doc: usb: ci-hdrc-usb2: add tx(rx)-burst-config-dword for binding doc Peter Chen
2015-08-14  8:37   ` Lucas Stach
2015-08-14  8:40     ` Peter Chen
2015-08-14 10:02       ` Lucas Stach
2015-10-08  6:26         ` Peter Chen
2015-08-07  7:15 ` [PATCH v3 09/10] ARM: imx6: change default burst size for USB Peter Chen
2015-08-07  7:15 ` [PATCH v3 10/10] usb: chipidea: add tx/rx burst size configuration interface Peter Chen
2015-08-14  3:13 ` [PATCH v3 00/10] USB: chipidea misc patches Peter Chen

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=1438931747-25209-7-git-send-email-peter.chen@freescale.com \
    --to=peter.chen@freescale.com \
    --cc=linux-arm-kernel@lists.infradead.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;
as well as URLs for NNTP newsgroup(s).