All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC 0/5] Migrate AM35xx MUSB glue to device tree and enable MUSB
@ 2018-06-25  0:12 ` Adam Ford
  0 siblings, 0 replies; 22+ messages in thread
From: Adam Ford @ 2018-06-25  0:12 UTC (permalink / raw)
  To: adam.ford
  Cc: mark.rutland, devicetree, tony, gregkh, linux-usb, linux,
	robh+dt, bcousson, linux-omap, Adam Ford, b-liu,
	linux-arm-kernel

Currently, the AM3517.dtsi uses the omap2430 glue to connect
the MUSB controller when it should use the AM35x glue.  This
series attempts to convert the AM35x glue to device tree,
fix the clock references to the AM35X can enable/disable
them correctly, and then use pdata-quirks.c to enable the
register that isn't yet available using device tree to enable
MSUB, then finally modifies the AM3517 and AM3517-EVM to use
the updated AM35x glue to support MUSB.

It currently doesnt' work, but I am looking for ideas on
what I may have missed or done incorrectly.  

Adam Ford (5):
  usb: musb: am35x: Add device tree support
  usb: musb: am35x: Match clock assignements to hwmods
  ARM: OMAP2+: Add AM3517 MUSB setup to pdata quirks.
  ARM: dts: AM35x: Change MUSB from omap2430 to am35xx
  ARM: dts: am3517-evm: Enable MUSB on AM3517-evm

 arch/arm/boot/dts/am3517-evm.dts   | 12 ++++++++++++
 arch/arm/boot/dts/am3517.dtsi      |  2 +-
 arch/arm/mach-omap2/pdata-quirks.c | 19 +++++++++++++++++++
 drivers/usb/musb/am35x.c           | 15 +++++++++++++--
 4 files changed, 45 insertions(+), 3 deletions(-)

-- 
2.17.1

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

* [RFC 0/5] Migrate AM35xx MUSB glue to device tree and enable MUSB
@ 2018-06-25  0:12 ` Adam Ford
  0 siblings, 0 replies; 22+ messages in thread
From: Adam Ford @ 2018-06-25  0:12 UTC (permalink / raw)
  To: linux-arm-kernel

Currently, the AM3517.dtsi uses the omap2430 glue to connect
the MUSB controller when it should use the AM35x glue.  This
series attempts to convert the AM35x glue to device tree,
fix the clock references to the AM35X can enable/disable
them correctly, and then use pdata-quirks.c to enable the
register that isn't yet available using device tree to enable
MSUB, then finally modifies the AM3517 and AM3517-EVM to use
the updated AM35x glue to support MUSB.

It currently doesnt' work, but I am looking for ideas on
what I may have missed or done incorrectly.  

Adam Ford (5):
  usb: musb: am35x: Add device tree support
  usb: musb: am35x: Match clock assignements to hwmods
  ARM: OMAP2+: Add AM3517 MUSB setup to pdata quirks.
  ARM: dts: AM35x: Change MUSB from omap2430 to am35xx
  ARM: dts: am3517-evm: Enable MUSB on AM3517-evm

 arch/arm/boot/dts/am3517-evm.dts   | 12 ++++++++++++
 arch/arm/boot/dts/am3517.dtsi      |  2 +-
 arch/arm/mach-omap2/pdata-quirks.c | 19 +++++++++++++++++++
 drivers/usb/musb/am35x.c           | 15 +++++++++++++--
 4 files changed, 45 insertions(+), 3 deletions(-)

-- 
2.17.1

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

* [RFC 1/5] usb: musb: am35x: Add device tree support
@ 2018-06-25  0:12   ` aford173
  0 siblings, 0 replies; 22+ messages in thread
From: Adam Ford @ 2018-06-25  0:12 UTC (permalink / raw)
  To: adam.ford
  Cc: mark.rutland, devicetree, tony, gregkh, linux-usb, linux,
	robh+dt, bcousson, linux-omap, Adam Ford, b-liu,
	linux-arm-kernel

The AM35x glue doesn't yet support device tree, so this patch
adds the basics hooks so it doesn't haven't use pdata-quirks.c

Signed-off-by: Adam Ford <aford173@gmail.com>

diff --git a/drivers/usb/musb/am35x.c b/drivers/usb/musb/am35x.c
index 660641ab1545..a55db15a8457 100644
--- a/drivers/usb/musb/am35x.c
+++ b/drivers/usb/musb/am35x.c
@@ -591,6 +591,16 @@ static int am35x_resume(struct device *dev)
 }
 #endif
 
+#ifdef CONFIG_OF
+static const struct of_device_id am35xx_id_table[] = {
+	{
+		.compatible = "ti,am35xx-musb"
+	},
+	{},
+};
+MODULE_DEVICE_TABLE(of, am35xx_id_table);
+#endif
+
 static SIMPLE_DEV_PM_OPS(am35x_pm_ops, am35x_suspend, am35x_resume);
 
 static struct platform_driver am35x_driver = {
@@ -599,6 +609,7 @@ static struct platform_driver am35x_driver = {
 	.driver		= {
 		.name	= "musb-am35x",
 		.pm	= &am35x_pm_ops,
+		.of_match_table = of_match_ptr(am35xx_id_table),
 	},
 };
 
-- 
2.17.1

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

* [RFC,1/5] usb: musb: am35x: Add device tree support
@ 2018-06-25  0:12   ` aford173
  0 siblings, 0 replies; 22+ messages in thread
From: aford173 @ 2018-06-25  0:12 UTC (permalink / raw)
  To: adam.ford
  Cc: bcousson, tony, robh+dt, mark.rutland, linux, b-liu, gregkh,
	linux-omap, devicetree, linux-arm-kernel, linux-usb, Adam Ford

The AM35x glue doesn't yet support device tree, so this patch
adds the basics hooks so it doesn't haven't use pdata-quirks.c

Signed-off-by: Adam Ford <aford173@gmail.com>

diff --git a/drivers/usb/musb/am35x.c b/drivers/usb/musb/am35x.c
index 660641ab1545..a55db15a8457 100644
--- a/drivers/usb/musb/am35x.c
+++ b/drivers/usb/musb/am35x.c
@@ -591,6 +591,16 @@ static int am35x_resume(struct device *dev)
 }
 #endif
 
+#ifdef CONFIG_OF
+static const struct of_device_id am35xx_id_table[] = {
+	{
+		.compatible = "ti,am35xx-musb"
+	},
+	{},
+};
+MODULE_DEVICE_TABLE(of, am35xx_id_table);
+#endif
+
 static SIMPLE_DEV_PM_OPS(am35x_pm_ops, am35x_suspend, am35x_resume);
 
 static struct platform_driver am35x_driver = {
@@ -599,6 +609,7 @@ static struct platform_driver am35x_driver = {
 	.driver		= {
 		.name	= "musb-am35x",
 		.pm	= &am35x_pm_ops,
+		.of_match_table = of_match_ptr(am35xx_id_table),
 	},
 };
 

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

* [RFC 1/5] usb: musb: am35x: Add device tree support
@ 2018-06-25  0:12   ` aford173
  0 siblings, 0 replies; 22+ messages in thread
From: Adam Ford @ 2018-06-25  0:12 UTC (permalink / raw)
  To: linux-arm-kernel

The AM35x glue doesn't yet support device tree, so this patch
adds the basics hooks so it doesn't haven't use pdata-quirks.c

Signed-off-by: Adam Ford <aford173@gmail.com>

diff --git a/drivers/usb/musb/am35x.c b/drivers/usb/musb/am35x.c
index 660641ab1545..a55db15a8457 100644
--- a/drivers/usb/musb/am35x.c
+++ b/drivers/usb/musb/am35x.c
@@ -591,6 +591,16 @@ static int am35x_resume(struct device *dev)
 }
 #endif
 
+#ifdef CONFIG_OF
+static const struct of_device_id am35xx_id_table[] = {
+	{
+		.compatible = "ti,am35xx-musb"
+	},
+	{},
+};
+MODULE_DEVICE_TABLE(of, am35xx_id_table);
+#endif
+
 static SIMPLE_DEV_PM_OPS(am35x_pm_ops, am35x_suspend, am35x_resume);
 
 static struct platform_driver am35x_driver = {
@@ -599,6 +609,7 @@ static struct platform_driver am35x_driver = {
 	.driver		= {
 		.name	= "musb-am35x",
 		.pm	= &am35x_pm_ops,
+		.of_match_table = of_match_ptr(am35xx_id_table),
 	},
 };
 
-- 
2.17.1

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

* [RFC 2/5] usb: musb: am35x: Match clock assignements to hwmods
@ 2018-06-25  0:12   ` aford173
  0 siblings, 0 replies; 22+ messages in thread
From: Adam Ford @ 2018-06-25  0:12 UTC (permalink / raw)
  To: adam.ford
  Cc: mark.rutland, devicetree, tony, gregkh, linux-usb, linux,
	robh+dt, bcousson, linux-omap, Adam Ford, b-liu,
	linux-arm-kernel

There are two clocks that fail when attempting to use them.  This
patch patches the clock names to match those in hwmods.

Signed-off-by: Adam Ford <aford173@gmail.com>

diff --git a/drivers/usb/musb/am35x.c b/drivers/usb/musb/am35x.c
index a55db15a8457..56f8e13f4c1b 100644
--- a/drivers/usb/musb/am35x.c
+++ b/drivers/usb/musb/am35x.c
@@ -455,14 +455,14 @@ static int am35x_probe(struct platform_device *pdev)
 	if (!glue)
 		goto err0;
 
-	phy_clk = clk_get(&pdev->dev, "fck");
+	phy_clk = clk_get(&pdev->dev, "hsotgusb_fck");
 	if (IS_ERR(phy_clk)) {
 		dev_err(&pdev->dev, "failed to get PHY clock\n");
 		ret = PTR_ERR(phy_clk);
 		goto err3;
 	}
 
-	clk = clk_get(&pdev->dev, "ick");
+	clk = clk_get(&pdev->dev, "hsotgusb_ick");
 	if (IS_ERR(clk)) {
 		dev_err(&pdev->dev, "failed to get clock\n");
 		ret = PTR_ERR(clk);
-- 
2.17.1

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

* [RFC,2/5] usb: musb: am35x: Match clock assignements to hwmods
@ 2018-06-25  0:12   ` aford173
  0 siblings, 0 replies; 22+ messages in thread
From: aford173 @ 2018-06-25  0:12 UTC (permalink / raw)
  To: adam.ford
  Cc: bcousson, tony, robh+dt, mark.rutland, linux, b-liu, gregkh,
	linux-omap, devicetree, linux-arm-kernel, linux-usb, Adam Ford

There are two clocks that fail when attempting to use them.  This
patch patches the clock names to match those in hwmods.

Signed-off-by: Adam Ford <aford173@gmail.com>

diff --git a/drivers/usb/musb/am35x.c b/drivers/usb/musb/am35x.c
index a55db15a8457..56f8e13f4c1b 100644
--- a/drivers/usb/musb/am35x.c
+++ b/drivers/usb/musb/am35x.c
@@ -455,14 +455,14 @@ static int am35x_probe(struct platform_device *pdev)
 	if (!glue)
 		goto err0;
 
-	phy_clk = clk_get(&pdev->dev, "fck");
+	phy_clk = clk_get(&pdev->dev, "hsotgusb_fck");
 	if (IS_ERR(phy_clk)) {
 		dev_err(&pdev->dev, "failed to get PHY clock\n");
 		ret = PTR_ERR(phy_clk);
 		goto err3;
 	}
 
-	clk = clk_get(&pdev->dev, "ick");
+	clk = clk_get(&pdev->dev, "hsotgusb_ick");
 	if (IS_ERR(clk)) {
 		dev_err(&pdev->dev, "failed to get clock\n");
 		ret = PTR_ERR(clk);

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

* [RFC 2/5] usb: musb: am35x: Match clock assignements to hwmods
@ 2018-06-25  0:12   ` aford173
  0 siblings, 0 replies; 22+ messages in thread
From: Adam Ford @ 2018-06-25  0:12 UTC (permalink / raw)
  To: linux-arm-kernel

There are two clocks that fail when attempting to use them.  This
patch patches the clock names to match those in hwmods.

Signed-off-by: Adam Ford <aford173@gmail.com>

diff --git a/drivers/usb/musb/am35x.c b/drivers/usb/musb/am35x.c
index a55db15a8457..56f8e13f4c1b 100644
--- a/drivers/usb/musb/am35x.c
+++ b/drivers/usb/musb/am35x.c
@@ -455,14 +455,14 @@ static int am35x_probe(struct platform_device *pdev)
 	if (!glue)
 		goto err0;
 
-	phy_clk = clk_get(&pdev->dev, "fck");
+	phy_clk = clk_get(&pdev->dev, "hsotgusb_fck");
 	if (IS_ERR(phy_clk)) {
 		dev_err(&pdev->dev, "failed to get PHY clock\n");
 		ret = PTR_ERR(phy_clk);
 		goto err3;
 	}
 
-	clk = clk_get(&pdev->dev, "ick");
+	clk = clk_get(&pdev->dev, "hsotgusb_ick");
 	if (IS_ERR(clk)) {
 		dev_err(&pdev->dev, "failed to get clock\n");
 		ret = PTR_ERR(clk);
-- 
2.17.1

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

* [RFC 3/5] ARM: OMAP2+: Add AM3517 MUSB setup to pdata quirks.
@ 2018-06-25  0:12   ` aford173
  0 siblings, 0 replies; 22+ messages in thread
From: Adam Ford @ 2018-06-25  0:12 UTC (permalink / raw)
  To: adam.ford
  Cc: mark.rutland, devicetree, tony, gregkh, linux-usb, linux,
	robh+dt, bcousson, linux-omap, Adam Ford, b-liu,
	linux-arm-kernel

The pin muxing and clock definitions for the MUSB controller are
not done through the same registers/pin mux options, so this
explicitly configures the registers and pin-mux options for MUSB
on AM3517-EVM

Signed-off-by: Adam Ford <aford173@gmail.com>

diff --git a/arch/arm/mach-omap2/pdata-quirks.c b/arch/arm/mach-omap2/pdata-quirks.c
index 7f02743edbe4..e0c7ac2c87c1 100644
--- a/arch/arm/mach-omap2/pdata-quirks.c
+++ b/arch/arm/mach-omap2/pdata-quirks.c
@@ -258,9 +258,28 @@ static void __init omap3_sbc_t3517_legacy_init(void)
 	omap3_sbc_t3517_wifi_init();
 }
 
+/* The pin muxing for AM3517 OTG isn't done through the normal means */
+static __init void am3517_evm_musb_init(void)
+{
+	u32 devconf2;
+
+	/*
+	 * Set up USB clock/mode in the DEVCONF2 register.
+	 */
+	devconf2 = omap_ctrl_readl(AM35XX_CONTROL_DEVCONF2);
+
+	/* USB2.0 PHY reference clock is 13 MHz */
+	devconf2 &= ~(CONF2_REFFREQ | CONF2_OTGMODE | CONF2_PHY_GPIOMODE);
+	devconf2 |=  CONF2_REFFREQ_13MHZ | CONF2_SESENDEN | CONF2_VBDTCTEN
+			| CONF2_DATPOL;
+
+	omap_ctrl_writel(devconf2, AM35XX_CONTROL_DEVCONF2);
+}
+
 static void __init am3517_evm_legacy_init(void)
 {
 	am35xx_emac_reset();
+	am3517_evm_musb_init();
 }
 
 static struct platform_device omap3_rom_rng_device = {
-- 
2.17.1

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

* [RFC,3/5] ARM: OMAP2+: Add AM3517 MUSB setup to pdata quirks.
@ 2018-06-25  0:12   ` aford173
  0 siblings, 0 replies; 22+ messages in thread
From: aford173 @ 2018-06-25  0:12 UTC (permalink / raw)
  To: adam.ford
  Cc: bcousson, tony, robh+dt, mark.rutland, linux, b-liu, gregkh,
	linux-omap, devicetree, linux-arm-kernel, linux-usb, Adam Ford

The pin muxing and clock definitions for the MUSB controller are
not done through the same registers/pin mux options, so this
explicitly configures the registers and pin-mux options for MUSB
on AM3517-EVM

Signed-off-by: Adam Ford <aford173@gmail.com>

diff --git a/arch/arm/mach-omap2/pdata-quirks.c b/arch/arm/mach-omap2/pdata-quirks.c
index 7f02743edbe4..e0c7ac2c87c1 100644
--- a/arch/arm/mach-omap2/pdata-quirks.c
+++ b/arch/arm/mach-omap2/pdata-quirks.c
@@ -258,9 +258,28 @@ static void __init omap3_sbc_t3517_legacy_init(void)
 	omap3_sbc_t3517_wifi_init();
 }
 
+/* The pin muxing for AM3517 OTG isn't done through the normal means */
+static __init void am3517_evm_musb_init(void)
+{
+	u32 devconf2;
+
+	/*
+	 * Set up USB clock/mode in the DEVCONF2 register.
+	 */
+	devconf2 = omap_ctrl_readl(AM35XX_CONTROL_DEVCONF2);
+
+	/* USB2.0 PHY reference clock is 13 MHz */
+	devconf2 &= ~(CONF2_REFFREQ | CONF2_OTGMODE | CONF2_PHY_GPIOMODE);
+	devconf2 |=  CONF2_REFFREQ_13MHZ | CONF2_SESENDEN | CONF2_VBDTCTEN
+			| CONF2_DATPOL;
+
+	omap_ctrl_writel(devconf2, AM35XX_CONTROL_DEVCONF2);
+}
+
 static void __init am3517_evm_legacy_init(void)
 {
 	am35xx_emac_reset();
+	am3517_evm_musb_init();
 }
 
 static struct platform_device omap3_rom_rng_device = {

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

* [RFC 3/5] ARM: OMAP2+: Add AM3517 MUSB setup to pdata quirks.
@ 2018-06-25  0:12   ` aford173
  0 siblings, 0 replies; 22+ messages in thread
From: Adam Ford @ 2018-06-25  0:12 UTC (permalink / raw)
  To: linux-arm-kernel

The pin muxing and clock definitions for the MUSB controller are
not done through the same registers/pin mux options, so this
explicitly configures the registers and pin-mux options for MUSB
on AM3517-EVM

Signed-off-by: Adam Ford <aford173@gmail.com>

diff --git a/arch/arm/mach-omap2/pdata-quirks.c b/arch/arm/mach-omap2/pdata-quirks.c
index 7f02743edbe4..e0c7ac2c87c1 100644
--- a/arch/arm/mach-omap2/pdata-quirks.c
+++ b/arch/arm/mach-omap2/pdata-quirks.c
@@ -258,9 +258,28 @@ static void __init omap3_sbc_t3517_legacy_init(void)
 	omap3_sbc_t3517_wifi_init();
 }
 
+/* The pin muxing for AM3517 OTG isn't done through the normal means */
+static __init void am3517_evm_musb_init(void)
+{
+	u32 devconf2;
+
+	/*
+	 * Set up USB clock/mode in the DEVCONF2 register.
+	 */
+	devconf2 = omap_ctrl_readl(AM35XX_CONTROL_DEVCONF2);
+
+	/* USB2.0 PHY reference clock is 13 MHz */
+	devconf2 &= ~(CONF2_REFFREQ | CONF2_OTGMODE | CONF2_PHY_GPIOMODE);
+	devconf2 |=  CONF2_REFFREQ_13MHZ | CONF2_SESENDEN | CONF2_VBDTCTEN
+			| CONF2_DATPOL;
+
+	omap_ctrl_writel(devconf2, AM35XX_CONTROL_DEVCONF2);
+}
+
 static void __init am3517_evm_legacy_init(void)
 {
 	am35xx_emac_reset();
+	am3517_evm_musb_init();
 }
 
 static struct platform_device omap3_rom_rng_device = {
-- 
2.17.1

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

* [RFC 4/5] ARM: dts: AM35x: Change MUSB from omap2430 to am35xx
@ 2018-06-25  0:12   ` aford173
  0 siblings, 0 replies; 22+ messages in thread
From: Adam Ford @ 2018-06-25  0:12 UTC (permalink / raw)
  To: adam.ford
  Cc: mark.rutland, devicetree, tony, gregkh, linux-usb, linux,
	robh+dt, bcousson, linux-omap, Adam Ford, b-liu,
	linux-arm-kernel

The glue that connects the AM35xx is not the same as the OMAP3.
With the AM35xx-MUSB now available in device tree, point to that
glue instead of omap3.

Signed-off-by: Adam Ford <aford173@gmail.com>

diff --git a/arch/arm/boot/dts/am3517.dtsi b/arch/arm/boot/dts/am3517.dtsi
index ca294914bbb1..c17cfe6a2132 100644
--- a/arch/arm/boot/dts/am3517.dtsi
+++ b/arch/arm/boot/dts/am3517.dtsi
@@ -18,7 +18,7 @@
 
 	ocp@68000000 {
 		am35x_otg_hs: am35x_otg_hs@5c040000 {
-			compatible = "ti,omap3-musb";
+			compatible = "ti,am35xx-musb";
 			ti,hwmods = "am35x_otg_hs";
 			status = "disabled";
 			reg = <0x5c040000 0x1000>;
-- 
2.17.1

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

* [RFC,4/5] ARM: dts: AM35x: Change MUSB from omap2430 to am35xx
@ 2018-06-25  0:12   ` aford173
  0 siblings, 0 replies; 22+ messages in thread
From: aford173 @ 2018-06-25  0:12 UTC (permalink / raw)
  To: adam.ford
  Cc: bcousson, tony, robh+dt, mark.rutland, linux, b-liu, gregkh,
	linux-omap, devicetree, linux-arm-kernel, linux-usb, Adam Ford

The glue that connects the AM35xx is not the same as the OMAP3.
With the AM35xx-MUSB now available in device tree, point to that
glue instead of omap3.

Signed-off-by: Adam Ford <aford173@gmail.com>

diff --git a/arch/arm/boot/dts/am3517.dtsi b/arch/arm/boot/dts/am3517.dtsi
index ca294914bbb1..c17cfe6a2132 100644
--- a/arch/arm/boot/dts/am3517.dtsi
+++ b/arch/arm/boot/dts/am3517.dtsi
@@ -18,7 +18,7 @@
 
 	ocp@68000000 {
 		am35x_otg_hs: am35x_otg_hs@5c040000 {
-			compatible = "ti,omap3-musb";
+			compatible = "ti,am35xx-musb";
 			ti,hwmods = "am35x_otg_hs";
 			status = "disabled";
 			reg = <0x5c040000 0x1000>;

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

* [RFC 4/5] ARM: dts: AM35x: Change MUSB from omap2430 to am35xx
@ 2018-06-25  0:12   ` aford173
  0 siblings, 0 replies; 22+ messages in thread
From: Adam Ford @ 2018-06-25  0:12 UTC (permalink / raw)
  To: linux-arm-kernel

The glue that connects the AM35xx is not the same as the OMAP3.
With the AM35xx-MUSB now available in device tree, point to that
glue instead of omap3.

Signed-off-by: Adam Ford <aford173@gmail.com>

diff --git a/arch/arm/boot/dts/am3517.dtsi b/arch/arm/boot/dts/am3517.dtsi
index ca294914bbb1..c17cfe6a2132 100644
--- a/arch/arm/boot/dts/am3517.dtsi
+++ b/arch/arm/boot/dts/am3517.dtsi
@@ -18,7 +18,7 @@
 
 	ocp at 68000000 {
 		am35x_otg_hs: am35x_otg_hs at 5c040000 {
-			compatible = "ti,omap3-musb";
+			compatible = "ti,am35xx-musb";
 			ti,hwmods = "am35x_otg_hs";
 			status = "disabled";
 			reg = <0x5c040000 0x1000>;
-- 
2.17.1

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

* [RFC 5/5] ARM: dts: am3517-evm: Enable MUSB on AM3517-evm
@ 2018-06-25  0:12   ` aford173
  0 siblings, 0 replies; 22+ messages in thread
From: Adam Ford @ 2018-06-25  0:12 UTC (permalink / raw)
  To: adam.ford
  Cc: mark.rutland, devicetree, tony, gregkh, linux-usb, linux,
	robh+dt, bcousson, linux-omap, Adam Ford, b-liu,
	linux-arm-kernel

With AM35x now supported in device tree and the pdata-quirks
configuring the AM3517 clocks and some of the pin-mux,
this patch enables the MUSB and configures the rest of the pin-
mux options

Signed-off-by: Adam Ford <aford173@gmail.com>

diff --git a/arch/arm/boot/dts/am3517-evm.dts b/arch/arm/boot/dts/am3517-evm.dts
index 56fdec33afc1..4aeadaca915f 100644
--- a/arch/arm/boot/dts/am3517-evm.dts
+++ b/arch/arm/boot/dts/am3517-evm.dts
@@ -243,6 +243,12 @@
 	phys = <&hsusb1_phy>;
 };
 
+&am35x_otg_hs {
+        status = "okay";
+        pinctrl-names = "default";
+        pinctrl-0 = <&otg_drv_vbus>;
+};
+
 &omap3_pmx_core {
 	pinctrl-names = "default";
 	pinctrl-0 = <&hsusb1_rst_pins>;
@@ -273,6 +279,12 @@
 		>;
 	};
 
+	otg_drv_vbus: pinmux_otg_drv_vbus {
+		pinctrl-single,pins = <
+			OMAP3_CORE1_IOPAD(0x2210, PIN_INPUT_PULLDOWN | MUX_MODE0) /* rmii_50MHz_clk.usb0_drvvbus */
+		>;
+	};
+
 	backlight_pins: pinmux_backlight_pins {
 		pinctrl-single,pins = <
 			OMAP3_CORE1_IOPAD(0x21de, PIN_OUTPUT | MUX_MODE4)       /* mcspi2_cs1.gpio_182 */
-- 
2.17.1

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

* [RFC,5/5] ARM: dts: am3517-evm: Enable MUSB on AM3517-evm
@ 2018-06-25  0:12   ` aford173
  0 siblings, 0 replies; 22+ messages in thread
From: aford173 @ 2018-06-25  0:12 UTC (permalink / raw)
  To: adam.ford
  Cc: bcousson, tony, robh+dt, mark.rutland, linux, b-liu, gregkh,
	linux-omap, devicetree, linux-arm-kernel, linux-usb, Adam Ford

With AM35x now supported in device tree and the pdata-quirks
configuring the AM3517 clocks and some of the pin-mux,
this patch enables the MUSB and configures the rest of the pin-
mux options

Signed-off-by: Adam Ford <aford173@gmail.com>

diff --git a/arch/arm/boot/dts/am3517-evm.dts b/arch/arm/boot/dts/am3517-evm.dts
index 56fdec33afc1..4aeadaca915f 100644
--- a/arch/arm/boot/dts/am3517-evm.dts
+++ b/arch/arm/boot/dts/am3517-evm.dts
@@ -243,6 +243,12 @@
 	phys = <&hsusb1_phy>;
 };
 
+&am35x_otg_hs {
+        status = "okay";
+        pinctrl-names = "default";
+        pinctrl-0 = <&otg_drv_vbus>;
+};
+
 &omap3_pmx_core {
 	pinctrl-names = "default";
 	pinctrl-0 = <&hsusb1_rst_pins>;
@@ -273,6 +279,12 @@
 		>;
 	};
 
+	otg_drv_vbus: pinmux_otg_drv_vbus {
+		pinctrl-single,pins = <
+			OMAP3_CORE1_IOPAD(0x2210, PIN_INPUT_PULLDOWN | MUX_MODE0) /* rmii_50MHz_clk.usb0_drvvbus */
+		>;
+	};
+
 	backlight_pins: pinmux_backlight_pins {
 		pinctrl-single,pins = <
 			OMAP3_CORE1_IOPAD(0x21de, PIN_OUTPUT | MUX_MODE4)       /* mcspi2_cs1.gpio_182 */

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

* [RFC 5/5] ARM: dts: am3517-evm: Enable MUSB on AM3517-evm
@ 2018-06-25  0:12   ` aford173
  0 siblings, 0 replies; 22+ messages in thread
From: Adam Ford @ 2018-06-25  0:12 UTC (permalink / raw)
  To: linux-arm-kernel

With AM35x now supported in device tree and the pdata-quirks
configuring the AM3517 clocks and some of the pin-mux,
this patch enables the MUSB and configures the rest of the pin-
mux options

Signed-off-by: Adam Ford <aford173@gmail.com>

diff --git a/arch/arm/boot/dts/am3517-evm.dts b/arch/arm/boot/dts/am3517-evm.dts
index 56fdec33afc1..4aeadaca915f 100644
--- a/arch/arm/boot/dts/am3517-evm.dts
+++ b/arch/arm/boot/dts/am3517-evm.dts
@@ -243,6 +243,12 @@
 	phys = <&hsusb1_phy>;
 };
 
+&am35x_otg_hs {
+        status = "okay";
+        pinctrl-names = "default";
+        pinctrl-0 = <&otg_drv_vbus>;
+};
+
 &omap3_pmx_core {
 	pinctrl-names = "default";
 	pinctrl-0 = <&hsusb1_rst_pins>;
@@ -273,6 +279,12 @@
 		>;
 	};
 
+	otg_drv_vbus: pinmux_otg_drv_vbus {
+		pinctrl-single,pins = <
+			OMAP3_CORE1_IOPAD(0x2210, PIN_INPUT_PULLDOWN | MUX_MODE0) /* rmii_50MHz_clk.usb0_drvvbus */
+		>;
+	};
+
 	backlight_pins: pinmux_backlight_pins {
 		pinctrl-single,pins = <
 			OMAP3_CORE1_IOPAD(0x21de, PIN_OUTPUT | MUX_MODE4)       /* mcspi2_cs1.gpio_182 */
-- 
2.17.1

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

* Re: [RFC 3/5] ARM: OMAP2+: Add AM3517 MUSB setup to pdata quirks.
@ 2018-07-03  7:36     ` Tony Lindgren
  0 siblings, 0 replies; 22+ messages in thread
From: Tony Lindgren @ 2018-07-03  7:36 UTC (permalink / raw)
  To: Adam Ford
  Cc: mark.rutland, devicetree, gregkh, linux-usb, linux, robh+dt,
	bcousson, linux-omap, adam.ford, b-liu, linux-arm-kernel

* Adam Ford <aford173@gmail.com> [180625 00:15]:
> The pin muxing and clock definitions for the MUSB controller are
> not done through the same registers/pin mux options, so this
> explicitly configures the registers and pin-mux options for MUSB
> on AM3517-EVM
> 
> Signed-off-by: Adam Ford <aford173@gmail.com>
> 
> diff --git a/arch/arm/mach-omap2/pdata-quirks.c b/arch/arm/mach-omap2/pdata-quirks.c
> index 7f02743edbe4..e0c7ac2c87c1 100644
> --- a/arch/arm/mach-omap2/pdata-quirks.c
> +++ b/arch/arm/mach-omap2/pdata-quirks.c
> @@ -258,9 +258,28 @@ static void __init omap3_sbc_t3517_legacy_init(void)
>  	omap3_sbc_t3517_wifi_init();
>  }
>  
> +/* The pin muxing for AM3517 OTG isn't done through the normal means */
> +static __init void am3517_evm_musb_init(void)
> +{
> +	u32 devconf2;
> +
> +	/*
> +	 * Set up USB clock/mode in the DEVCONF2 register.
> +	 */
> +	devconf2 = omap_ctrl_readl(AM35XX_CONTROL_DEVCONF2);
> +
> +	/* USB2.0 PHY reference clock is 13 MHz */
> +	devconf2 &= ~(CONF2_REFFREQ | CONF2_OTGMODE | CONF2_PHY_GPIOMODE);
> +	devconf2 |=  CONF2_REFFREQ_13MHZ | CONF2_SESENDEN | CONF2_VBDTCTEN
> +			| CONF2_DATPOL;
> +
> +	omap_ctrl_writel(devconf2, AM35XX_CONTROL_DEVCONF2);
> +}
> +
>  static void __init am3517_evm_legacy_init(void)
>  {
>  	am35xx_emac_reset();
> +	am3517_evm_musb_init();
>  }

To me it seems you should do this with a simple drivers/phy driver.
There might be already something similar that you can use, see the
da and dm related drivers under drivers/phy/ti.

Regards,

Tony

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

* [RFC,3/5] ARM: OMAP2+: Add AM3517 MUSB setup to pdata quirks.
@ 2018-07-03  7:36     ` Tony Lindgren
  0 siblings, 0 replies; 22+ messages in thread
From: Tony Lindgren @ 2018-07-03  7:36 UTC (permalink / raw)
  To: Adam Ford
  Cc: adam.ford, bcousson, robh+dt, mark.rutland, linux, b-liu, gregkh,
	linux-omap, devicetree, linux-arm-kernel, linux-usb

* Adam Ford <aford173@gmail.com> [180625 00:15]:
> The pin muxing and clock definitions for the MUSB controller are
> not done through the same registers/pin mux options, so this
> explicitly configures the registers and pin-mux options for MUSB
> on AM3517-EVM
> 
> Signed-off-by: Adam Ford <aford173@gmail.com>
> 
> diff --git a/arch/arm/mach-omap2/pdata-quirks.c b/arch/arm/mach-omap2/pdata-quirks.c
> index 7f02743edbe4..e0c7ac2c87c1 100644
> --- a/arch/arm/mach-omap2/pdata-quirks.c
> +++ b/arch/arm/mach-omap2/pdata-quirks.c
> @@ -258,9 +258,28 @@ static void __init omap3_sbc_t3517_legacy_init(void)
>  	omap3_sbc_t3517_wifi_init();
>  }
>  
> +/* The pin muxing for AM3517 OTG isn't done through the normal means */
> +static __init void am3517_evm_musb_init(void)
> +{
> +	u32 devconf2;
> +
> +	/*
> +	 * Set up USB clock/mode in the DEVCONF2 register.
> +	 */
> +	devconf2 = omap_ctrl_readl(AM35XX_CONTROL_DEVCONF2);
> +
> +	/* USB2.0 PHY reference clock is 13 MHz */
> +	devconf2 &= ~(CONF2_REFFREQ | CONF2_OTGMODE | CONF2_PHY_GPIOMODE);
> +	devconf2 |=  CONF2_REFFREQ_13MHZ | CONF2_SESENDEN | CONF2_VBDTCTEN
> +			| CONF2_DATPOL;
> +
> +	omap_ctrl_writel(devconf2, AM35XX_CONTROL_DEVCONF2);
> +}
> +
>  static void __init am3517_evm_legacy_init(void)
>  {
>  	am35xx_emac_reset();
> +	am3517_evm_musb_init();
>  }

To me it seems you should do this with a simple drivers/phy driver.
There might be already something similar that you can use, see the
da and dm related drivers under drivers/phy/ti.

Regards,

Tony
---
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* [RFC 3/5] ARM: OMAP2+: Add AM3517 MUSB setup to pdata quirks.
@ 2018-07-03  7:36     ` Tony Lindgren
  0 siblings, 0 replies; 22+ messages in thread
From: Tony Lindgren @ 2018-07-03  7:36 UTC (permalink / raw)
  To: linux-arm-kernel

* Adam Ford <aford173@gmail.com> [180625 00:15]:
> The pin muxing and clock definitions for the MUSB controller are
> not done through the same registers/pin mux options, so this
> explicitly configures the registers and pin-mux options for MUSB
> on AM3517-EVM
> 
> Signed-off-by: Adam Ford <aford173@gmail.com>
> 
> diff --git a/arch/arm/mach-omap2/pdata-quirks.c b/arch/arm/mach-omap2/pdata-quirks.c
> index 7f02743edbe4..e0c7ac2c87c1 100644
> --- a/arch/arm/mach-omap2/pdata-quirks.c
> +++ b/arch/arm/mach-omap2/pdata-quirks.c
> @@ -258,9 +258,28 @@ static void __init omap3_sbc_t3517_legacy_init(void)
>  	omap3_sbc_t3517_wifi_init();
>  }
>  
> +/* The pin muxing for AM3517 OTG isn't done through the normal means */
> +static __init void am3517_evm_musb_init(void)
> +{
> +	u32 devconf2;
> +
> +	/*
> +	 * Set up USB clock/mode in the DEVCONF2 register.
> +	 */
> +	devconf2 = omap_ctrl_readl(AM35XX_CONTROL_DEVCONF2);
> +
> +	/* USB2.0 PHY reference clock is 13 MHz */
> +	devconf2 &= ~(CONF2_REFFREQ | CONF2_OTGMODE | CONF2_PHY_GPIOMODE);
> +	devconf2 |=  CONF2_REFFREQ_13MHZ | CONF2_SESENDEN | CONF2_VBDTCTEN
> +			| CONF2_DATPOL;
> +
> +	omap_ctrl_writel(devconf2, AM35XX_CONTROL_DEVCONF2);
> +}
> +
>  static void __init am3517_evm_legacy_init(void)
>  {
>  	am35xx_emac_reset();
> +	am3517_evm_musb_init();
>  }

To me it seems you should do this with a simple drivers/phy driver.
There might be already something similar that you can use, see the
da and dm related drivers under drivers/phy/ti.

Regards,

Tony

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

* Re: [RFC 0/5] Migrate AM35xx MUSB glue to device tree and enable MUSB
  2018-06-25  0:12 ` Adam Ford
@ 2018-07-03  7:37   ` Tony Lindgren
  -1 siblings, 0 replies; 22+ messages in thread
From: Tony Lindgren @ 2018-07-03  7:37 UTC (permalink / raw)
  To: Adam Ford
  Cc: mark.rutland, devicetree, gregkh, linux-usb, linux, robh+dt,
	bcousson, linux-omap, adam.ford, b-liu, linux-arm-kernel

* Adam Ford <aford173@gmail.com> [180624 17:15]:
> 
> It currently doesnt' work, but I am looking for ideas on
> what I may have missed or done incorrectly.  

Check the drivers/phy/ti driver part and make sure that
works and has pins and clocks configured.

The rest should be pretty much generic stuff for musb
as long as the SoC glue layer can deal with the module,
clocks and pins.

Regards,

Tony

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

* [RFC 0/5] Migrate AM35xx MUSB glue to device tree and enable MUSB
@ 2018-07-03  7:37   ` Tony Lindgren
  0 siblings, 0 replies; 22+ messages in thread
From: Tony Lindgren @ 2018-07-03  7:37 UTC (permalink / raw)
  To: linux-arm-kernel

* Adam Ford <aford173@gmail.com> [180624 17:15]:
> 
> It currently doesnt' work, but I am looking for ideas on
> what I may have missed or done incorrectly.  

Check the drivers/phy/ti driver part and make sure that
works and has pins and clocks configured.

The rest should be pretty much generic stuff for musb
as long as the SoC glue layer can deal with the module,
clocks and pins.

Regards,

Tony

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

end of thread, other threads:[~2018-07-03  7:37 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-25  0:12 [RFC 0/5] Migrate AM35xx MUSB glue to device tree and enable MUSB Adam Ford
2018-06-25  0:12 ` Adam Ford
2018-06-25  0:12 ` [RFC 1/5] usb: musb: am35x: Add device tree support Adam Ford
2018-06-25  0:12   ` Adam Ford
2018-06-25  0:12   ` [RFC,1/5] " aford173
2018-06-25  0:12 ` [RFC 2/5] usb: musb: am35x: Match clock assignements to hwmods Adam Ford
2018-06-25  0:12   ` Adam Ford
2018-06-25  0:12   ` [RFC,2/5] " aford173
2018-06-25  0:12 ` [RFC 3/5] ARM: OMAP2+: Add AM3517 MUSB setup to pdata quirks Adam Ford
2018-06-25  0:12   ` Adam Ford
2018-06-25  0:12   ` [RFC,3/5] " aford173
2018-07-03  7:36   ` [RFC 3/5] " Tony Lindgren
2018-07-03  7:36     ` Tony Lindgren
2018-07-03  7:36     ` [RFC,3/5] " Tony Lindgren
2018-06-25  0:12 ` [RFC 4/5] ARM: dts: AM35x: Change MUSB from omap2430 to am35xx Adam Ford
2018-06-25  0:12   ` Adam Ford
2018-06-25  0:12   ` [RFC,4/5] " aford173
2018-06-25  0:12 ` [RFC 5/5] ARM: dts: am3517-evm: Enable MUSB on AM3517-evm Adam Ford
2018-06-25  0:12   ` Adam Ford
2018-06-25  0:12   ` [RFC,5/5] " aford173
2018-07-03  7:37 ` [RFC 0/5] Migrate AM35xx MUSB glue to device tree and enable MUSB Tony Lindgren
2018-07-03  7:37   ` Tony Lindgren

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.