All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH v3 1/4] sunxi: clock: Fix EHCI and OHCI clocks on A64
@ 2018-06-08  2:23 Vasily Khoruzhick
  2018-06-08  2:23 ` [U-Boot] [PATCH v3 2/4] usb: sunxi: ehci: get rid of ifdefs Vasily Khoruzhick
                   ` (5 more replies)
  0 siblings, 6 replies; 10+ messages in thread
From: Vasily Khoruzhick @ 2018-06-08  2:23 UTC (permalink / raw)
  To: u-boot

EHCI0 is bit 24, EHCI1 - 25, OHCI0 - 28, OHCI1 - 29

Fixes commit fef73766d9ad ("sunxi: clock: Fix OHCI clock gating for H3/H5")

Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
---
 arch/arm/include/asm/arch-sunxi/clock_sun6i.h | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/arch/arm/include/asm/arch-sunxi/clock_sun6i.h b/arch/arm/include/asm/arch-sunxi/clock_sun6i.h
index 8acf79fbba..8afeaf872e 100644
--- a/arch/arm/include/asm/arch-sunxi/clock_sun6i.h
+++ b/arch/arm/include/asm/arch-sunxi/clock_sun6i.h
@@ -280,8 +280,10 @@ struct sunxi_ccm_reg {
 #define AHB_GATE_OFFSET_USB_EHCI1	26
 #define AHB_GATE_OFFSET_USB_EHCI0	24
 #elif defined(CONFIG_MACH_SUN50I)
-#define AHB_GATE_OFFSET_USB_OHCI0	29
-#define AHB_GATE_OFFSET_USB_EHCI0	25
+#define AHB_GATE_OFFSET_USB_OHCI0	28
+#define AHB_GATE_OFFSET_USB_OHCI1	29
+#define AHB_GATE_OFFSET_USB_EHCI0	24
+#define AHB_GATE_OFFSET_USB_EHCI1	25
 #else
 #define AHB_GATE_OFFSET_USB_OHCI1	30
 #define AHB_GATE_OFFSET_USB_OHCI0	29
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [U-Boot] [PATCH v3 2/4] usb: sunxi: ehci: get rid of ifdefs
  2018-06-08  2:23 [U-Boot] [PATCH v3 1/4] sunxi: clock: Fix EHCI and OHCI clocks on A64 Vasily Khoruzhick
@ 2018-06-08  2:23 ` Vasily Khoruzhick
  2018-06-08 14:24   ` Maxime Ripard
  2018-06-08  2:23 ` [U-Boot] [PATCH v3 3/4] usb: sunxi: ohci: " Vasily Khoruzhick
                   ` (4 subsequent siblings)
  5 siblings, 1 reply; 10+ messages in thread
From: Vasily Khoruzhick @ 2018-06-08  2:23 UTC (permalink / raw)
  To: u-boot

We can use compatibles instead.

Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
---
v3: use ehci_sunxi_cfg instead of id

 drivers/usb/host/ehci-sunxi.c | 83 ++++++++++++++++++++++++++---------
 1 file changed, 63 insertions(+), 20 deletions(-)

diff --git a/drivers/usb/host/ehci-sunxi.c b/drivers/usb/host/ehci-sunxi.c
index 360efc9116..35fbe03331 100644
--- a/drivers/usb/host/ehci-sunxi.c
+++ b/drivers/usb/host/ehci-sunxi.c
@@ -22,11 +22,17 @@
 #define AHB_CLK_DIST		1
 #endif
 
+struct ehci_sunxi_cfg {
+	bool has_reset;
+	u32 extra_ahb_gate_mask;
+};
+
 struct ehci_sunxi_priv {
 	struct ehci_ctrl ehci;
 	struct sunxi_ccm_reg *ccm;
 	int ahb_gate_mask; /* Mask of ahb_gate0 clk gate bits for this hcd */
 	struct phy phy;
+	const struct ehci_sunxi_cfg *cfg;
 };
 
 static int ehci_usb_probe(struct udevice *dev)
@@ -38,6 +44,7 @@ static int ehci_usb_probe(struct udevice *dev)
 	int extra_ahb_gate_mask = 0;
 	int phys, ret;
 
+	priv->cfg = (const struct ehci_sunxi_cfg *)dev_get_driver_data(dev);
 	priv->ccm = (struct sunxi_ccm_reg *)SUNXI_CCM_BASE;
 	if (IS_ERR(priv->ccm))
 		return PTR_ERR(priv->ccm);
@@ -72,18 +79,15 @@ no_phy:
 	 * clocks resp. phys.
 	 */
 	priv->ahb_gate_mask = 1 << AHB_GATE_OFFSET_USB_EHCI0;
-#if defined(CONFIG_MACH_SUNXI_H3_H5) || defined(CONFIG_MACH_SUN50I)
-	extra_ahb_gate_mask = 1 << AHB_GATE_OFFSET_USB_OHCI0;
-#endif
+	extra_ahb_gate_mask = priv->cfg->extra_ahb_gate_mask;
 	priv->ahb_gate_mask <<= phys * AHB_CLK_DIST;
 	extra_ahb_gate_mask <<= phys * AHB_CLK_DIST;
 
 	setbits_le32(&priv->ccm->ahb_gate0,
 		     priv->ahb_gate_mask | extra_ahb_gate_mask);
-#ifdef CONFIG_SUNXI_GEN_SUN6I
-	setbits_le32(&priv->ccm->ahb_reset0_cfg,
-		     priv->ahb_gate_mask | extra_ahb_gate_mask);
-#endif
+	if (priv->cfg->has_reset)
+		setbits_le32(&priv->ccm->ahb_reset0_cfg,
+			     priv->ahb_gate_mask | extra_ahb_gate_mask);
 
 	hcor = (struct ehci_hcor *)((uintptr_t)hccr +
 				    HC_LENGTH(ehci_readl(&hccr->cr_capbase)));
@@ -108,25 +112,64 @@ static int ehci_usb_remove(struct udevice *dev)
 	if (ret)
 		return ret;
 
-#ifdef CONFIG_SUNXI_GEN_SUN6I
-	clrbits_le32(&priv->ccm->ahb_reset0_cfg, priv->ahb_gate_mask);
-#endif
+	if (priv->cfg->has_reset)
+		clrbits_le32(&priv->ccm->ahb_reset0_cfg, priv->ahb_gate_mask);
 	clrbits_le32(&priv->ccm->ahb_gate0, priv->ahb_gate_mask);
 
 	return 0;
 }
 
+static const struct ehci_sunxi_cfg sun4i_a10_cfg = {
+	.has_reset = false,
+};
+
+static const struct ehci_sunxi_cfg sun6i_a31_cfg = {
+	.has_reset = true,
+};
+
+static const struct ehci_sunxi_cfg sun8i_h3_cfg = {
+	.has_reset = true,
+	.extra_ahb_gate_mask = 1 << AHB_GATE_OFFSET_USB_OHCI0,
+};
+
 static const struct udevice_id ehci_usb_ids[] = {
-	{ .compatible = "allwinner,sun4i-a10-ehci", },
-	{ .compatible = "allwinner,sun5i-a13-ehci", },
-	{ .compatible = "allwinner,sun6i-a31-ehci", },
-	{ .compatible = "allwinner,sun7i-a20-ehci", },
-	{ .compatible = "allwinner,sun8i-a23-ehci", },
-	{ .compatible = "allwinner,sun8i-a83t-ehci", },
-	{ .compatible = "allwinner,sun8i-h3-ehci",  },
-	{ .compatible = "allwinner,sun9i-a80-ehci", },
-	{ .compatible = "allwinner,sun50i-a64-ehci", },
-	{ }
+	{
+		.compatible = "allwinner,sun4i-a10-ehci",
+		.data = (ulong)&sun4i_a10_cfg,
+	},
+	{
+		.compatible = "allwinner,sun5i-a13-ehci",
+		.data = (ulong)&sun4i_a10_cfg,
+	},
+	{
+		.compatible = "allwinner,sun6i-a31-ehci",
+		.data = (ulong)&sun6i_a31_cfg,
+	},
+	{
+		.compatible = "allwinner,sun7i-a20-ehci",
+		.data = (ulong)&sun4i_a10_cfg,
+	},
+	{
+		.compatible = "allwinner,sun8i-a23-ehci",
+		.data = (ulong)&sun6i_a31_cfg,
+	},
+	{
+		.compatible = "allwinner,sun8i-a83t-ehci",
+		.data = (ulong)&sun6i_a31_cfg,
+	},
+	{
+		.compatible = "allwinner,sun8i-h3-ehci",
+		.data = (ulong)&sun8i_h3_cfg,
+	},
+	{
+		.compatible = "allwinner,sun9i-a80-ehci",
+		.data = (ulong)&sun6i_a31_cfg,
+	},
+	{
+		.compatible = "allwinner,sun50i-a64-ehci",
+		.data = (ulong)&sun8i_h3_cfg,
+	},
+	{ /* sentinel */ }
 };
 
 U_BOOT_DRIVER(ehci_sunxi) = {
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [U-Boot] [PATCH v3 3/4] usb: sunxi: ohci: get rid of ifdefs
  2018-06-08  2:23 [U-Boot] [PATCH v3 1/4] sunxi: clock: Fix EHCI and OHCI clocks on A64 Vasily Khoruzhick
  2018-06-08  2:23 ` [U-Boot] [PATCH v3 2/4] usb: sunxi: ehci: get rid of ifdefs Vasily Khoruzhick
@ 2018-06-08  2:23 ` Vasily Khoruzhick
  2018-06-08  2:23 ` [U-Boot] [PATCH v3 4/4] usb: sunxi: sun50i: enable OHCI0 clock when OHCI1 is in use Vasily Khoruzhick
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 10+ messages in thread
From: Vasily Khoruzhick @ 2018-06-08  2:23 UTC (permalink / raw)
  To: u-boot

We can use compatibles instead.

Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
---
v3: use ohci_sunxi_cfg instead of id

 drivers/usb/host/ohci-sunxi.c | 83 ++++++++++++++++++++++++++---------
 1 file changed, 63 insertions(+), 20 deletions(-)

diff --git a/drivers/usb/host/ohci-sunxi.c b/drivers/usb/host/ohci-sunxi.c
index ce2b47a5c4..19f99adcf1 100644
--- a/drivers/usb/host/ohci-sunxi.c
+++ b/drivers/usb/host/ohci-sunxi.c
@@ -22,12 +22,18 @@
 #define AHB_CLK_DIST		1
 #endif
 
+struct ohci_sunxi_cfg {
+	bool has_reset;
+	u32 extra_ahb_gate_mask;
+};
+
 struct ohci_sunxi_priv {
 	struct sunxi_ccm_reg *ccm;
 	ohci_t ohci;
 	int ahb_gate_mask; /* Mask of ahb_gate0 clk gate bits for this hcd */
 	int usb_gate_mask; /* Mask of usb_clk_cfg clk gate bits for this hcd */
 	struct phy phy;
+	const struct ohci_sunxi_cfg *cfg;
 };
 
 static int ohci_usb_probe(struct udevice *dev)
@@ -38,6 +44,7 @@ static int ohci_usb_probe(struct udevice *dev)
 	int extra_ahb_gate_mask = 0;
 	int phys, ret;
 
+	priv->cfg = (const struct ohci_sunxi_cfg *)dev_get_driver_data(dev);
 	priv->ccm = (struct sunxi_ccm_reg *)SUNXI_CCM_BASE;
 	if (IS_ERR(priv->ccm))
 		return PTR_ERR(priv->ccm);
@@ -74,9 +81,7 @@ no_phy:
 	 * clocks resp. phys.
 	 */
 	priv->ahb_gate_mask = 1 << AHB_GATE_OFFSET_USB_OHCI0;
-#ifdef CONFIG_MACH_SUN8I_H3
-	extra_ahb_gate_mask = 1 << AHB_GATE_OFFSET_USB_EHCI0;
-#endif
+	extra_ahb_gate_mask = priv->cfg->extra_ahb_gate_mask;
 	priv->usb_gate_mask = CCM_USB_CTRL_OHCI0_CLK;
 	priv->ahb_gate_mask <<= phys * AHB_CLK_DIST;
 	extra_ahb_gate_mask <<= phys * AHB_CLK_DIST;
@@ -85,10 +90,9 @@ no_phy:
 	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);
-#ifdef CONFIG_SUNXI_GEN_SUN6I
-	setbits_le32(&priv->ccm->ahb_reset0_cfg,
-		     priv->ahb_gate_mask | extra_ahb_gate_mask);
-#endif
+	if (priv->cfg->has_reset)
+		setbits_le32(&priv->ccm->ahb_reset0_cfg,
+			     priv->ahb_gate_mask | extra_ahb_gate_mask);
 
 	return ohci_register(dev, regs);
 }
@@ -110,26 +114,65 @@ static int ohci_usb_remove(struct udevice *dev)
 	if (ret)
 		return ret;
 
-#ifdef CONFIG_SUNXI_GEN_SUN6I
-	clrbits_le32(&priv->ccm->ahb_reset0_cfg, priv->ahb_gate_mask);
-#endif
+	if (priv->cfg->has_reset)
+		clrbits_le32(&priv->ccm->ahb_reset0_cfg, priv->ahb_gate_mask);
 	clrbits_le32(&priv->ccm->usb_clk_cfg, priv->usb_gate_mask);
 	clrbits_le32(&priv->ccm->ahb_gate0, priv->ahb_gate_mask);
 
 	return 0;
 }
 
+static const struct ohci_sunxi_cfg sun4i_a10_cfg = {
+	.has_reset = false,
+};
+
+static const struct ohci_sunxi_cfg sun6i_a31_cfg = {
+	.has_reset = true,
+};
+
+static const struct ohci_sunxi_cfg sun8i_h3_cfg = {
+	.has_reset = true,
+	.extra_ahb_gate_mask = 1 << AHB_GATE_OFFSET_USB_EHCI0,
+};
+
 static const struct udevice_id ohci_usb_ids[] = {
-	{ .compatible = "allwinner,sun4i-a10-ohci", },
-	{ .compatible = "allwinner,sun5i-a13-ohci", },
-	{ .compatible = "allwinner,sun6i-a31-ohci", },
-	{ .compatible = "allwinner,sun7i-a20-ohci", },
-	{ .compatible = "allwinner,sun8i-a23-ohci", },
-	{ .compatible = "allwinner,sun8i-a83t-ohci", },
-	{ .compatible = "allwinner,sun8i-h3-ohci",  },
-	{ .compatible = "allwinner,sun9i-a80-ohci", },
-	{ .compatible = "allwinner,sun50i-a64-ohci", },
-	{ }
+	{
+		.compatible = "allwinner,sun4i-a10-ohci",
+		.data = (ulong)&sun4i_a10_cfg,
+	},
+	{
+		.compatible = "allwinner,sun5i-a13-ohci",
+		.data = (ulong)&sun4i_a10_cfg,
+	},
+	{
+		.compatible = "allwinner,sun6i-a31-ohci",
+		.data = (ulong)&sun6i_a31_cfg,
+	},
+	{
+		.compatible = "allwinner,sun7i-a20-ohci",
+		.data = (ulong)&sun4i_a10_cfg,
+	},
+	{
+		.compatible = "allwinner,sun8i-a23-ohci",
+		.data = (ulong)&sun6i_a31_cfg,
+	},
+	{
+		.compatible = "allwinner,sun8i-a83t-ohci",
+		.data = (ulong)&sun6i_a31_cfg,
+	},
+	{
+		.compatible = "allwinner,sun8i-h3-ohci",
+		.data = (ulong)&sun8i_h3_cfg,
+	},
+	{
+		.compatible = "allwinner,sun9i-a80-ohci",
+		.data = (ulong)&sun6i_a31_cfg,
+	},
+	{
+		.compatible = "allwinner,sun50i-a64-ohci",
+		.data = (ulong)&sun6i_a31_cfg,
+	},
+	{ /* sentinel */ }
 };
 
 U_BOOT_DRIVER(usb_ohci) = {
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [U-Boot] [PATCH v3 4/4] usb: sunxi: sun50i: enable OHCI0 clock when OHCI1 is in use
  2018-06-08  2:23 [U-Boot] [PATCH v3 1/4] sunxi: clock: Fix EHCI and OHCI clocks on A64 Vasily Khoruzhick
  2018-06-08  2:23 ` [U-Boot] [PATCH v3 2/4] usb: sunxi: ehci: get rid of ifdefs Vasily Khoruzhick
  2018-06-08  2:23 ` [U-Boot] [PATCH v3 3/4] usb: sunxi: ohci: " Vasily Khoruzhick
@ 2018-06-08  2:23 ` Vasily Khoruzhick
  2018-06-08  7:31 ` [U-Boot] [U-Boot, v3, 1/4] sunxi: clock: Fix EHCI and OHCI clocks on A64 Vagrant Cascadian
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 10+ messages in thread
From: Vasily Khoruzhick @ 2018-06-08  2:23 UTC (permalink / raw)
  To: u-boot

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 | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/host/ohci-sunxi.c b/drivers/usb/host/ohci-sunxi.c
index 19f99adcf1..2b99169da6 100644
--- a/drivers/usb/host/ohci-sunxi.c
+++ b/drivers/usb/host/ohci-sunxi.c
@@ -25,6 +25,7 @@
 struct ohci_sunxi_cfg {
 	bool has_reset;
 	u32 extra_ahb_gate_mask;
+	u32 extra_usb_gate_mask;
 };
 
 struct ohci_sunxi_priv {
@@ -89,7 +90,8 @@ no_phy:
 
 	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 | priv->cfg->extra_usb_gate_mask);
 	if (priv->cfg->has_reset)
 		setbits_le32(&priv->ccm->ahb_reset0_cfg,
 			     priv->ahb_gate_mask | extra_ahb_gate_mask);
@@ -135,6 +137,12 @@ static const struct ohci_sunxi_cfg sun8i_h3_cfg = {
 	.extra_ahb_gate_mask = 1 << AHB_GATE_OFFSET_USB_EHCI0,
 };
 
+static const struct ohci_sunxi_cfg sun50i_a64_cfg = {
+	.has_reset = true,
+	.extra_ahb_gate_mask = 1 << AHB_GATE_OFFSET_USB_EHCI0,
+	.extra_usb_gate_mask = CCM_USB_CTRL_OHCI0_CLK,
+};
+
 static const struct udevice_id ohci_usb_ids[] = {
 	{
 		.compatible = "allwinner,sun4i-a10-ohci",
@@ -170,7 +178,7 @@ static const struct udevice_id ohci_usb_ids[] = {
 	},
 	{
 		.compatible = "allwinner,sun50i-a64-ohci",
-		.data = (ulong)&sun6i_a31_cfg,
+		.data = (ulong)&sun50i_a64_cfg,
 	},
 	{ /* sentinel */ }
 };
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [U-Boot] [U-Boot, v3, 1/4] sunxi: clock: Fix EHCI and OHCI clocks on A64
  2018-06-08  2:23 [U-Boot] [PATCH v3 1/4] sunxi: clock: Fix EHCI and OHCI clocks on A64 Vasily Khoruzhick
                   ` (2 preceding siblings ...)
  2018-06-08  2:23 ` [U-Boot] [PATCH v3 4/4] usb: sunxi: sun50i: enable OHCI0 clock when OHCI1 is in use Vasily Khoruzhick
@ 2018-06-08  7:31 ` Vagrant Cascadian
  2018-06-13  4:51 ` [U-Boot] [PATCH v3 " Vasily Khoruzhick
  2018-06-13  5:35 ` Marek Vasut
  5 siblings, 0 replies; 10+ messages in thread
From: Vagrant Cascadian @ 2018-06-08  7:31 UTC (permalink / raw)
  To: u-boot

On 2018-06-07, Vasily Khoruzhick wrote:
> EHCI0 is bit 24, EHCI1 - 25, OHCI0 - 28, OHCI1 - 29
>
> Fixes commit fef73766d9ad ("sunxi: clock: Fix OHCI clock gating for H3/H5")
>
> Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
> ---
>  arch/arm/include/asm/arch-sunxi/clock_sun6i.h | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)

Tested on pine64+ grub EFI from USB, which then loaded kernel+initrd off
of USB, as well as using distro_bootcmd's exlinux.conf, loading
kernel+initrd+dtb from USB...

For the whole series of 4 v3 patches:

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

live well,
  vagrant

> diff --git a/arch/arm/include/asm/arch-sunxi/clock_sun6i.h b/arch/arm/include/asm/arch-sunxi/clock_sun6i.h
> index 8acf79fbba..8afeaf872e 100644
> --- a/arch/arm/include/asm/arch-sunxi/clock_sun6i.h
> +++ b/arch/arm/include/asm/arch-sunxi/clock_sun6i.h
> @@ -280,8 +280,10 @@ struct sunxi_ccm_reg {
>  #define AHB_GATE_OFFSET_USB_EHCI1	26
>  #define AHB_GATE_OFFSET_USB_EHCI0	24
>  #elif defined(CONFIG_MACH_SUN50I)
> -#define AHB_GATE_OFFSET_USB_OHCI0	29
> -#define AHB_GATE_OFFSET_USB_EHCI0	25
> +#define AHB_GATE_OFFSET_USB_OHCI0	28
> +#define AHB_GATE_OFFSET_USB_OHCI1	29
> +#define AHB_GATE_OFFSET_USB_EHCI0	24
> +#define AHB_GATE_OFFSET_USB_EHCI1	25
>  #else
>  #define AHB_GATE_OFFSET_USB_OHCI1	30
>  #define AHB_GATE_OFFSET_USB_OHCI0	29
-------------- 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/20180608/e815515e/attachment.sig>

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [U-Boot] [PATCH v3 2/4] usb: sunxi: ehci: get rid of ifdefs
  2018-06-08  2:23 ` [U-Boot] [PATCH v3 2/4] usb: sunxi: ehci: get rid of ifdefs Vasily Khoruzhick
@ 2018-06-08 14:24   ` Maxime Ripard
  2018-06-08 15:24     ` Vasily Khoruzhick
  0 siblings, 1 reply; 10+ messages in thread
From: Maxime Ripard @ 2018-06-08 14:24 UTC (permalink / raw)
  To: u-boot

On Thu, Jun 07, 2018 at 07:23:39PM -0700, Vasily Khoruzhick wrote:
> We can use compatibles instead.
> 
> Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
> ---
> v3: use ehci_sunxi_cfg instead of id
> 
>  drivers/usb/host/ehci-sunxi.c | 83 ++++++++++++++++++++++++++---------
>  1 file changed, 63 insertions(+), 20 deletions(-)
> 
> diff --git a/drivers/usb/host/ehci-sunxi.c b/drivers/usb/host/ehci-sunxi.c
> index 360efc9116..35fbe03331 100644
> --- a/drivers/usb/host/ehci-sunxi.c
> +++ b/drivers/usb/host/ehci-sunxi.c
> @@ -22,11 +22,17 @@
>  #define AHB_CLK_DIST		1
>  #endif
>  
> +struct ehci_sunxi_cfg {
> +	bool has_reset;
> +	u32 extra_ahb_gate_mask;
> +};
> +
>  struct ehci_sunxi_priv {
>  	struct ehci_ctrl ehci;
>  	struct sunxi_ccm_reg *ccm;
>  	int ahb_gate_mask; /* Mask of ahb_gate0 clk gate bits for this hcd */

Ideally this should be moved to the ehci_sunxi_cfg (and this is true
for OHCI as well) function for consistency, but that can be done in a
subsequent patch.

It looks good otherwise, thanks!
Maxime

-- 
Maxime Ripard, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [U-Boot] [PATCH v3 2/4] usb: sunxi: ehci: get rid of ifdefs
  2018-06-08 14:24   ` Maxime Ripard
@ 2018-06-08 15:24     ` Vasily Khoruzhick
  2018-06-08 15:38       ` Maxime Ripard
  0 siblings, 1 reply; 10+ messages in thread
From: Vasily Khoruzhick @ 2018-06-08 15:24 UTC (permalink / raw)
  To: u-boot

On Fri, Jun 8, 2018 at 7:24 AM, Maxime Ripard <maxime.ripard@bootlin.com> wrote:
> On Thu, Jun 07, 2018 at 07:23:39PM -0700, Vasily Khoruzhick wrote:
>> We can use compatibles instead.
>>
>> Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
>> ---
>> v3: use ehci_sunxi_cfg instead of id
>>
>>  drivers/usb/host/ehci-sunxi.c | 83 ++++++++++++++++++++++++++---------
>>  1 file changed, 63 insertions(+), 20 deletions(-)
>>
>> diff --git a/drivers/usb/host/ehci-sunxi.c b/drivers/usb/host/ehci-sunxi.c
>> index 360efc9116..35fbe03331 100644
>> --- a/drivers/usb/host/ehci-sunxi.c
>> +++ b/drivers/usb/host/ehci-sunxi.c
>> @@ -22,11 +22,17 @@
>>  #define AHB_CLK_DIST         1
>>  #endif
>>
>> +struct ehci_sunxi_cfg {
>> +     bool has_reset;
>> +     u32 extra_ahb_gate_mask;
>> +};
>> +
>>  struct ehci_sunxi_priv {
>>       struct ehci_ctrl ehci;
>>       struct sunxi_ccm_reg *ccm;
>>       int ahb_gate_mask; /* Mask of ahb_gate0 clk gate bits for this hcd */
>
> Ideally this should be moved to the ehci_sunxi_cfg (and this is true
> for OHCI as well) function for consistency, but that can be done in a
> subsequent patch.

ahb_gate_mask is per-controller, i.e. it differs for EHCI0 and EHCI1
so it can't be moved to ehci_sunxi_cfg.

> It looks good otherwise, thanks!
> Maxime
>
> --
> Maxime Ripard, Bootlin (formerly Free Electrons)
> Embedded Linux and Kernel engineering
> https://bootlin.com

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [U-Boot] [PATCH v3 2/4] usb: sunxi: ehci: get rid of ifdefs
  2018-06-08 15:24     ` Vasily Khoruzhick
@ 2018-06-08 15:38       ` Maxime Ripard
  0 siblings, 0 replies; 10+ messages in thread
From: Maxime Ripard @ 2018-06-08 15:38 UTC (permalink / raw)
  To: u-boot

On Fri, Jun 08, 2018 at 08:24:26AM -0700, Vasily Khoruzhick wrote:
> On Fri, Jun 8, 2018 at 7:24 AM, Maxime Ripard <maxime.ripard@bootlin.com> wrote:
> > On Thu, Jun 07, 2018 at 07:23:39PM -0700, Vasily Khoruzhick wrote:
> >> We can use compatibles instead.
> >>
> >> Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
> >> ---
> >> v3: use ehci_sunxi_cfg instead of id
> >>
> >>  drivers/usb/host/ehci-sunxi.c | 83 ++++++++++++++++++++++++++---------
> >>  1 file changed, 63 insertions(+), 20 deletions(-)
> >>
> >> diff --git a/drivers/usb/host/ehci-sunxi.c b/drivers/usb/host/ehci-sunxi.c
> >> index 360efc9116..35fbe03331 100644
> >> --- a/drivers/usb/host/ehci-sunxi.c
> >> +++ b/drivers/usb/host/ehci-sunxi.c
> >> @@ -22,11 +22,17 @@
> >>  #define AHB_CLK_DIST         1
> >>  #endif
> >>
> >> +struct ehci_sunxi_cfg {
> >> +     bool has_reset;
> >> +     u32 extra_ahb_gate_mask;
> >> +};
> >> +
> >>  struct ehci_sunxi_priv {
> >>       struct ehci_ctrl ehci;
> >>       struct sunxi_ccm_reg *ccm;
> >>       int ahb_gate_mask; /* Mask of ahb_gate0 clk gate bits for this hcd */
> >
> > Ideally this should be moved to the ehci_sunxi_cfg (and this is true
> > for OHCI as well) function for consistency, but that can be done in a
> > subsequent patch.
> 
> ahb_gate_mask is per-controller, i.e. it differs for EHCI0 and EHCI1
> so it can't be moved to ehci_sunxi_cfg.

Ah, right. Nevermind then :)
Maxime

-- 
Maxime Ripard, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [U-Boot] [PATCH v3 1/4] sunxi: clock: Fix EHCI and OHCI clocks on A64
  2018-06-08  2:23 [U-Boot] [PATCH v3 1/4] sunxi: clock: Fix EHCI and OHCI clocks on A64 Vasily Khoruzhick
                   ` (3 preceding siblings ...)
  2018-06-08  7:31 ` [U-Boot] [U-Boot, v3, 1/4] sunxi: clock: Fix EHCI and OHCI clocks on A64 Vagrant Cascadian
@ 2018-06-13  4:51 ` Vasily Khoruzhick
  2018-06-13  5:35 ` Marek Vasut
  5 siblings, 0 replies; 10+ messages in thread
From: Vasily Khoruzhick @ 2018-06-13  4:51 UTC (permalink / raw)
  To: u-boot

On Thu, Jun 7, 2018 at 7:23 PM, Vasily Khoruzhick <anarsoul@gmail.com> wrote:
> EHCI0 is bit 24, EHCI1 - 25, OHCI0 - 28, OHCI1 - 29
>
> Fixes commit fef73766d9ad ("sunxi: clock: Fix OHCI clock gating for H3/H5")
>
> Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>

Any feedback on this patch series?

> ---
>  arch/arm/include/asm/arch-sunxi/clock_sun6i.h | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/arch/arm/include/asm/arch-sunxi/clock_sun6i.h b/arch/arm/include/asm/arch-sunxi/clock_sun6i.h
> index 8acf79fbba..8afeaf872e 100644
> --- a/arch/arm/include/asm/arch-sunxi/clock_sun6i.h
> +++ b/arch/arm/include/asm/arch-sunxi/clock_sun6i.h
> @@ -280,8 +280,10 @@ struct sunxi_ccm_reg {
>  #define AHB_GATE_OFFSET_USB_EHCI1      26
>  #define AHB_GATE_OFFSET_USB_EHCI0      24
>  #elif defined(CONFIG_MACH_SUN50I)
> -#define AHB_GATE_OFFSET_USB_OHCI0      29
> -#define AHB_GATE_OFFSET_USB_EHCI0      25
> +#define AHB_GATE_OFFSET_USB_OHCI0      28
> +#define AHB_GATE_OFFSET_USB_OHCI1      29
> +#define AHB_GATE_OFFSET_USB_EHCI0      24
> +#define AHB_GATE_OFFSET_USB_EHCI1      25
>  #else
>  #define AHB_GATE_OFFSET_USB_OHCI1      30
>  #define AHB_GATE_OFFSET_USB_OHCI0      29
> --
> 2.17.1
>

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [U-Boot] [PATCH v3 1/4] sunxi: clock: Fix EHCI and OHCI clocks on A64
  2018-06-08  2:23 [U-Boot] [PATCH v3 1/4] sunxi: clock: Fix EHCI and OHCI clocks on A64 Vasily Khoruzhick
                   ` (4 preceding siblings ...)
  2018-06-13  4:51 ` [U-Boot] [PATCH v3 " Vasily Khoruzhick
@ 2018-06-13  5:35 ` Marek Vasut
  5 siblings, 0 replies; 10+ messages in thread
From: Marek Vasut @ 2018-06-13  5:35 UTC (permalink / raw)
  To: u-boot

On 06/08/2018 04:23 AM, Vasily Khoruzhick wrote:
> EHCI0 is bit 24, EHCI1 - 25, OHCI0 - 28, OHCI1 - 29
> 
> Fixes commit fef73766d9ad ("sunxi: clock: Fix OHCI clock gating for H3/H5")
> 
> Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
> ---
>  arch/arm/include/asm/arch-sunxi/clock_sun6i.h | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/arm/include/asm/arch-sunxi/clock_sun6i.h b/arch/arm/include/asm/arch-sunxi/clock_sun6i.h
> index 8acf79fbba..8afeaf872e 100644
> --- a/arch/arm/include/asm/arch-sunxi/clock_sun6i.h
> +++ b/arch/arm/include/asm/arch-sunxi/clock_sun6i.h
> @@ -280,8 +280,10 @@ struct sunxi_ccm_reg {
>  #define AHB_GATE_OFFSET_USB_EHCI1	26
>  #define AHB_GATE_OFFSET_USB_EHCI0	24
>  #elif defined(CONFIG_MACH_SUN50I)
> -#define AHB_GATE_OFFSET_USB_OHCI0	29
> -#define AHB_GATE_OFFSET_USB_EHCI0	25
> +#define AHB_GATE_OFFSET_USB_OHCI0	28
> +#define AHB_GATE_OFFSET_USB_OHCI1	29
> +#define AHB_GATE_OFFSET_USB_EHCI0	24
> +#define AHB_GATE_OFFSET_USB_EHCI1	25
>  #else
>  #define AHB_GATE_OFFSET_USB_OHCI1	30
>  #define AHB_GATE_OFFSET_USB_OHCI0	29
> 
Applied all 4, thanks.

-- 
Best regards,
Marek Vasut

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2018-06-13  5:35 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-08  2:23 [U-Boot] [PATCH v3 1/4] sunxi: clock: Fix EHCI and OHCI clocks on A64 Vasily Khoruzhick
2018-06-08  2:23 ` [U-Boot] [PATCH v3 2/4] usb: sunxi: ehci: get rid of ifdefs Vasily Khoruzhick
2018-06-08 14:24   ` Maxime Ripard
2018-06-08 15:24     ` Vasily Khoruzhick
2018-06-08 15:38       ` Maxime Ripard
2018-06-08  2:23 ` [U-Boot] [PATCH v3 3/4] usb: sunxi: ohci: " Vasily Khoruzhick
2018-06-08  2:23 ` [U-Boot] [PATCH v3 4/4] usb: sunxi: sun50i: enable OHCI0 clock when OHCI1 is in use Vasily Khoruzhick
2018-06-08  7:31 ` [U-Boot] [U-Boot, v3, 1/4] sunxi: clock: Fix EHCI and OHCI clocks on A64 Vagrant Cascadian
2018-06-13  4:51 ` [U-Boot] [PATCH v3 " Vasily Khoruzhick
2018-06-13  5:35 ` Marek Vasut

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.