public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Vagrant Cascadian <vagrant@debian.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] [U-Boot, 2/2] usb: sunxi: sun50i: enable OHCI0 clock when OHCI1 is in use
Date: Thu, 07 Jun 2018 23:37:11 -0700	[thread overview]
Message-ID: <87po11bx7s.fsf@aikidev.net> (raw)
In-Reply-To: <20180606033831.20693-2-anarsoul@gmail.com>

On 2018-06-05, Vasily Khoruzhick wrote:
> On A64 OHCI1 clock source is OHCI0 clock, so we need to enable OHCI0
> clock when OHCI1 is in use.
>
> Fixes commit dd3228170ad7 ("usb: sunxi: Switch to use generic-phy")
>
> Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
> ---
>  drivers/usb/host/ohci-sunxi.c | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)

Tested loading kernel+initrd+dtb on pine64+

Tested-by: Vagrant Cascadian <vagrant@debian.org>

live well,
  vagrant


> diff --git a/drivers/usb/host/ohci-sunxi.c b/drivers/usb/host/ohci-sunxi.c
> index ce2b47a5c4..5661557a3d 100644
> --- a/drivers/usb/host/ohci-sunxi.c
> +++ b/drivers/usb/host/ohci-sunxi.c
> @@ -36,6 +36,7 @@ static int ohci_usb_probe(struct udevice *dev)
>  	struct ohci_sunxi_priv *priv = dev_get_priv(dev);
>  	struct ohci_regs *regs = (struct ohci_regs *)devfdt_get_addr(dev);
>  	int extra_ahb_gate_mask = 0;
> +	int extra_usb_gate_mask = 0;
>  	int phys, ret;
>  
>  	priv->ccm = (struct sunxi_ccm_reg *)SUNXI_CCM_BASE;
> @@ -78,13 +79,17 @@ no_phy:
>  	extra_ahb_gate_mask = 1 << AHB_GATE_OFFSET_USB_EHCI0;
>  #endif
>  	priv->usb_gate_mask = CCM_USB_CTRL_OHCI0_CLK;
> +#ifdef CONFIG_MACH_SUN50I
> +	extra_usb_gate_mask = CCM_USB_CTRL_OHCI0_CLK;
> +#endif
>  	priv->ahb_gate_mask <<= phys * AHB_CLK_DIST;
>  	extra_ahb_gate_mask <<= phys * AHB_CLK_DIST;
>  	priv->usb_gate_mask <<= phys;
>  
>  	setbits_le32(&priv->ccm->ahb_gate0,
>  		     priv->ahb_gate_mask | extra_ahb_gate_mask);
> -	setbits_le32(&priv->ccm->usb_clk_cfg, priv->usb_gate_mask);
> +	setbits_le32(&priv->ccm->usb_clk_cfg,
> +		     priv->usb_gate_mask | extra_usb_gate_mask);
>  #ifdef CONFIG_SUNXI_GEN_SUN6I
>  	setbits_le32(&priv->ccm->ahb_reset0_cfg,
>  		     priv->ahb_gate_mask | extra_ahb_gate_mask);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 832 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180607/0a28158d/attachment.sig>

  parent reply	other threads:[~2018-06-08  6:37 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-06  3:38 [U-Boot] [PATCH 1/2] sunxi: clock: Fix EHCI and OHCI clocks on A64 Vasily Khoruzhick
2018-06-06  3:38 ` [U-Boot] [PATCH 2/2] usb: sunxi: sun50i: enable OHCI0 clock when OHCI1 is in use Vasily Khoruzhick
2018-06-06  9:02   ` Marek Vasut
2018-06-06 15:12     ` Vasily Khoruzhick
2018-06-06 15:13       ` Marek Vasut
2018-06-06 16:36         ` Jagan Teki
2018-06-07  2:19           ` Vasily Khoruzhick
2018-06-06 13:56   ` Jagan Teki
2018-06-06 15:13     ` Vasily Khoruzhick
2018-06-06 16:35       ` Jagan Teki
2018-06-06 16:58         ` Vasily Khoruzhick
2018-06-08  6:37   ` Vagrant Cascadian [this message]
2018-06-08  6:35 ` [U-Boot] [U-Boot, 1/2] sunxi: clock: Fix EHCI and OHCI clocks on A64 Vagrant Cascadian

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=87po11bx7s.fsf@aikidev.net \
    --to=vagrant@debian.org \
    --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