From: Vasily Khoruzhick Date: Wed, 13 Jun 2018 20:04:41 -0700 Subject: [U-Boot] [PATCH] usb: sunxi: don't touch reset bits in ccm if CONFIG_SUNXI_GEN_SUN6I is not defined Message-ID: <20180614030441.2771-1-anarsoul@gmail.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de CCM in sun4i and sun5i doesn't have reset. Fixes commit 1ed9c1118 ("usb: sunxi: ehci: get rid of ifdefs") and commit 56830cee3 ("usb: sunxi: ohci: get rid of ifdefs") Signed-off-by: Vasily Khoruzhick --- drivers/usb/host/ehci-sunxi.c | 10 ++++++++-- drivers/usb/host/ohci-sunxi.c | 10 ++++++++-- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/drivers/usb/host/ehci-sunxi.c b/drivers/usb/host/ehci-sunxi.c index 35fbe03331..f5b661ef12 100644 --- a/drivers/usb/host/ehci-sunxi.c +++ b/drivers/usb/host/ehci-sunxi.c @@ -85,9 +85,12 @@ no_phy: setbits_le32(&priv->ccm->ahb_gate0, priv->ahb_gate_mask | extra_ahb_gate_mask); - if (priv->cfg->has_reset) + if (priv->cfg->has_reset) { +#ifdef CONFIG_SUNXI_GEN_SUN6I setbits_le32(&priv->ccm->ahb_reset0_cfg, priv->ahb_gate_mask | extra_ahb_gate_mask); +#endif + } hcor = (struct ehci_hcor *)((uintptr_t)hccr + HC_LENGTH(ehci_readl(&hccr->cr_capbase))); @@ -112,8 +115,11 @@ static int ehci_usb_remove(struct udevice *dev) if (ret) return ret; - if (priv->cfg->has_reset) + if (priv->cfg->has_reset) { +#ifdef CONFIG_SUNXI_GEN_SUN6I clrbits_le32(&priv->ccm->ahb_reset0_cfg, priv->ahb_gate_mask); +#endif + } clrbits_le32(&priv->ccm->ahb_gate0, priv->ahb_gate_mask); return 0; diff --git a/drivers/usb/host/ohci-sunxi.c b/drivers/usb/host/ohci-sunxi.c index 2b99169da6..c8c9e1d2fe 100644 --- a/drivers/usb/host/ohci-sunxi.c +++ b/drivers/usb/host/ohci-sunxi.c @@ -92,9 +92,12 @@ no_phy: priv->ahb_gate_mask | extra_ahb_gate_mask); setbits_le32(&priv->ccm->usb_clk_cfg, priv->usb_gate_mask | priv->cfg->extra_usb_gate_mask); - if (priv->cfg->has_reset) + if (priv->cfg->has_reset) { +#ifdef CONFIG_SUNXI_GEN_SUN6I setbits_le32(&priv->ccm->ahb_reset0_cfg, priv->ahb_gate_mask | extra_ahb_gate_mask); +#endif + } return ohci_register(dev, regs); } @@ -116,8 +119,11 @@ static int ohci_usb_remove(struct udevice *dev) if (ret) return ret; - if (priv->cfg->has_reset) + if (priv->cfg->has_reset) { +#ifdef CONFIG_SUNXI_GEN_SUN6I clrbits_le32(&priv->ccm->ahb_reset0_cfg, priv->ahb_gate_mask); +#endif + } clrbits_le32(&priv->ccm->usb_clk_cfg, priv->usb_gate_mask); clrbits_le32(&priv->ccm->ahb_gate0, priv->ahb_gate_mask); -- 2.17.1