From: Tom Rini <trini@konsulko.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 08/14] usb: dwc3: Add helper functions to enable snooping and burst settings
Date: Tue, 16 May 2017 15:32:32 -0400 [thread overview]
Message-ID: <20170516193232.GM5701@bill-the-cat> (raw)
In-Reply-To: <1494936994-20026-9-git-send-email-yinbo.zhu@nxp.com>
On Tue, May 16, 2017 at 08:16:28PM +0800, yinbo.zhu wrote:
> From: Rajat Srivastava <rajat.srivastava@nxp.com>
>
> Adds helper functions to enable snooping and outstanding burst beat
> settings.
>
> Signed-off-by: Rajat Srivastava <rajat.srivastava@nxp.com>
> Signed-off-by: Rajesh Bhagat <rajesh.bhagat@nxp.com>
> ---
> drivers/usb/dwc3/core.c | 45 +++++++++++++++++++++++++++++++++++++++++++++
> drivers/usb/dwc3/core.h | 7 +++++++
> 2 files changed, 52 insertions(+)
>
> diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c
> index 85cc96a..4ac599a 100644
> --- a/drivers/usb/dwc3/core.c
> +++ b/drivers/usb/dwc3/core.c
> @@ -599,6 +599,51 @@ static void dwc3_core_exit_mode(struct dwc3 *dwc)
>
> #define DWC3_ALIGN_MASK (16 - 1)
>
> +void dwc3_core_incr_burst_enable(int index, int btype_incr_val,
> + int breq_limit)
> +{
> + struct dwc3 *dwc;
> + u32 reg;
> +
> + list_for_each_entry(dwc, &dwc3_list, list) {
> + if (dwc->index != index)
> + continue;
> +
> + /*
> + * Change burst beat and outstanding pipelined
> + * transfers requests
> + */
> + reg = dwc3_readl(dwc->regs, DWC3_GSBUSCFG0);
> + reg = (reg & ~DWC3_INCR_BTYPE_MASK) | btype_incr_val;
> + dwc3_writel(dwc->regs, DWC3_GSBUSCFG0, reg);
> +
> + reg = dwc3_readl(dwc->regs, DWC3_GSBUSCFG1);
> + reg = (reg & ~DWC3_BREQ_LIMIT_MASK) | (breq_limit << 8);
> + dwc3_writel(dwc->regs, DWC3_GSBUSCFG1, reg);
> + break;
> + }
> +}
> +
> +void dwc3_core_set_snooping(int index, bool snoop)
> +{
> + struct dwc3 *dwc;
> + u32 reg;
> +
> + list_for_each_entry(dwc, &dwc3_list, list) {
> + if (dwc->index != index)
> + continue;
> +
> + /* Enable/Disable snooping */
> + reg = dwc3_readl(dwc->regs, DWC3_GSBUSCFG0);
> + if (snoop)
> + reg |= DWC3_SNOOP_ENABLE;
> + else
> + reg &= ~DWC3_SNOOP_ENABLE;
> + dwc3_writel(dwc->regs, DWC3_GSBUSCFG0, reg);
> + break;
> + }
> +}
> +
> /**
> * dwc3_uboot_init - dwc3 core uboot initialization code
> * @dwc3_dev: struct dwc3_device containing initialization data
> diff --git a/drivers/usb/dwc3/core.h b/drivers/usb/dwc3/core.h
> index 72d2fcd..455e7fa 100644
> --- a/drivers/usb/dwc3/core.h
> +++ b/drivers/usb/dwc3/core.h
> @@ -593,6 +593,13 @@ struct dwc3_hwparams {
> /* HWPARAMS7 */
> #define DWC3_RAM1_DEPTH(n) ((n) & 0xffff)
>
> +/* GSBUSCFG0 */
> +#define DWC3_SNOOP_ENABLE (0x22220000)
> +#define DWC3_INCR_BTYPE_MASK (0xff)
> +
> +/* GSBUSCFG1 */
> +#define DWC3_BREQ_LIMIT_MASK (0xf00)
> +
> struct dwc3_request {
> struct usb_request request;
> struct list_head list;
Marek?
--
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170516/a00a1a74/attachment.sig>
next prev parent reply other threads:[~2017-05-16 19:32 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-16 12:16 [U-Boot] [PATCH 01/14] armv7: Add workaround for USB erratum A-009008 yinbo.zhu
2017-05-16 12:16 ` [U-Boot] [PATCH] uboot: Kconfig: add ERRATUM config to Kconfig for solve compile issue yinbo.zhu
2017-05-16 12:16 ` [U-Boot] [PATCH 02/14] armv7: Add workaround for USB erratum A-009798 yinbo.zhu
2017-05-16 19:33 ` Tom Rini
2017-05-16 12:16 ` [U-Boot] [PATCH 03/14] armv7: Add workaround for USB erratum A-008997 yinbo.zhu
2017-05-16 19:33 ` Tom Rini
2017-05-16 12:16 ` [U-Boot] [PATCH 04/14] armv7: Add workaround for USB erratum A-009007 yinbo.zhu
2017-05-16 19:33 ` Tom Rini
2017-05-16 12:16 ` [U-Boot] [PATCH 05/14] armv8: Add workaround for USB erratum A-009798 yinbo.zhu
2017-05-16 19:33 ` Tom Rini
2017-05-16 12:16 ` [U-Boot] [PATCH 06/14] armv8: Add workaround for USB erratum A-008997 yinbo.zhu
2017-05-16 19:33 ` Tom Rini
2017-05-16 12:16 ` [U-Boot] [PATCH 07/14] armv8: Add workaround for USB erratum A-009007 yinbo.zhu
2017-05-16 19:33 ` Tom Rini
2017-05-16 12:16 ` [U-Boot] [PATCH 08/14] usb: dwc3: Add helper functions to enable snooping and burst settings yinbo.zhu
2017-05-16 19:32 ` Tom Rini [this message]
2017-05-18 9:20 ` Marek Vasut
2017-05-16 12:16 ` [U-Boot] [PATCH 09/14] usb: ums: support multiple controllers using controller_index yinbo.zhu
2017-05-16 19:31 ` Tom Rini
2017-05-16 21:00 ` Lukasz Majewski
2017-05-16 21:07 ` Tom Rini
2017-05-16 12:16 ` [U-Boot] [PATCH 10/14] config: ls1012aqds: Add USB EHCI support for ls1012aqds yinbo.zhu
2017-05-16 12:16 ` [U-Boot] [PATCH 11/14] armv8: Add workaround for USB erratum A-009008 yinbo.zhu
2017-05-16 19:33 ` Tom Rini
2017-05-16 12:16 ` [U-Boot] [PATCH 12/14] armv8/fsl-layerscape: add dwc3 gadget driver support yinbo.zhu
2017-05-16 19:33 ` Tom Rini
2017-05-16 12:16 ` [U-Boot] [PATCH 13/14] drivers:usb:xhci:fsl: Implement Erratum A-010151 for FSL USB3 controller yinbo.zhu
2017-05-16 19:30 ` Tom Rini
2017-05-16 12:16 ` [U-Boot] [PATCH 14/14] uboot: Kconfig: add ERRATUM config to Kconfig for solve compile issue yinbo.zhu
2017-05-16 19:33 ` [U-Boot] [PATCH 01/14] armv7: Add workaround for USB erratum A-009008 Tom Rini
-- strict thread matches above, loose matches on Subject: below --
2017-05-17 11:06 yinbo.zhu
2017-05-17 11:06 ` [U-Boot] [PATCH 08/14] usb: dwc3: Add helper functions to enable snooping and burst settings yinbo.zhu
2017-05-17 12:04 [U-Boot] [PATCH 01/14] armv7: Add workaround for USB erratum A-009008 yinbo.zhu
2017-05-17 12:05 ` [U-Boot] [PATCH 08/14] usb: dwc3: Add helper functions to enable snooping and burst settings yinbo.zhu
2017-05-25 17:53 ` york sun
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=20170516193232.GM5701@bill-the-cat \
--to=trini@konsulko.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox