All of lore.kernel.org
 help / color / mirror / Atom feed
From: Adam Ford <aford173@gmail.com>
To: adam.ford@logicpd.com
Cc: mark.rutland@arm.com, devicetree@vger.kernel.org,
	tony@atomide.com, gregkh@linuxfoundation.org,
	linux-usb@vger.kernel.org, linux@armlinux.org.uk,
	robh+dt@kernel.org, bcousson@baylibre.com,
	linux-omap@vger.kernel.org, Adam Ford <aford173@gmail.com>,
	b-liu@ti.com, linux-arm-kernel@lists.infradead.org
Subject: [RFC 3/5] ARM: OMAP2+: Add AM3517 MUSB setup to pdata quirks.
Date: Sun, 24 Jun 2018 19:12:31 -0500	[thread overview]
Message-ID: <20180625001233.9785-4-aford173@gmail.com> (raw)
In-Reply-To: <20180625001233.9785-1-aford173@gmail.com>

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

WARNING: multiple messages have this Message-ID (diff)
From: aford173@gmail.com
To: adam.ford@logicpd.com
Cc: bcousson@baylibre.com, tony@atomide.com, robh+dt@kernel.org,
	mark.rutland@arm.com, linux@armlinux.org.uk, b-liu@ti.com,
	gregkh@linuxfoundation.org, linux-omap@vger.kernel.org,
	devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	linux-usb@vger.kernel.org, Adam Ford <aford173@gmail.com>
Subject: [RFC,3/5] ARM: OMAP2+: Add AM3517 MUSB setup to pdata quirks.
Date: Sun, 24 Jun 2018 19:12:31 -0500	[thread overview]
Message-ID: <20180625001233.9785-4-aford173@gmail.com> (raw)

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 = {

WARNING: multiple messages have this Message-ID (diff)
From: aford173@gmail.com (Adam Ford)
To: linux-arm-kernel@lists.infradead.org
Subject: [RFC 3/5] ARM: OMAP2+: Add AM3517 MUSB setup to pdata quirks.
Date: Sun, 24 Jun 2018 19:12:31 -0500	[thread overview]
Message-ID: <20180625001233.9785-4-aford173@gmail.com> (raw)
In-Reply-To: <20180625001233.9785-1-aford173@gmail.com>

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

  parent reply	other threads:[~2018-06-25  0:12 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 ` Adam Ford [this message]
2018-06-25  0:12   ` [RFC 3/5] ARM: OMAP2+: Add AM3517 MUSB setup to pdata quirks 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

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=20180625001233.9785-4-aford173@gmail.com \
    --to=aford173@gmail.com \
    --cc=adam.ford@logicpd.com \
    --cc=b-liu@ti.com \
    --cc=bcousson@baylibre.com \
    --cc=devicetree@vger.kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=mark.rutland@arm.com \
    --cc=robh+dt@kernel.org \
    --cc=tony@atomide.com \
    /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 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.