From mboxrd@z Thu Jan 1 00:00:00 1970 From: Adam Ford Subject: [RFC 3/5] ARM: OMAP2+: Add AM3517 MUSB setup to pdata quirks. Date: Sun, 24 Jun 2018 19:12:31 -0500 Message-ID: <20180625001233.9785-4-aford173@gmail.com> References: <20180625001233.9785-1-aford173@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20180625001233.9785-1-aford173@gmail.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=m.gmane.org@lists.infradead.org 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 , b-liu@ti.com, linux-arm-kernel@lists.infradead.org List-Id: devicetree@vger.kernel.org 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 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