From patchwork Mon Oct 12 17:33:52 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Dooks X-Patchwork-Id: 7378101 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 30161BEEA4 for ; Mon, 12 Oct 2015 17:34:04 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 55D5A208DB for ; Mon, 12 Oct 2015 17:34:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 59F52208D4 for ; Mon, 12 Oct 2015 17:34:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751668AbbJLReA (ORCPT ); Mon, 12 Oct 2015 13:34:00 -0400 Received: from ducie-dc1.codethink.co.uk ([185.25.241.215]:36221 "EHLO ducie-dc1.codethink.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751585AbbJLRd7 (ORCPT ); Mon, 12 Oct 2015 13:33:59 -0400 Received: from localhost (localhost [127.0.0.1]) by ducie-dc1.codethink.co.uk (Postfix) with ESMTP id 1D8A54618D0; Mon, 12 Oct 2015 18:33:58 +0100 (BST) X-Virus-Scanned: Debian amavisd-new at ducie-dc1.codethink.co.uk Received: from ducie-dc1.codethink.co.uk ([127.0.0.1]) by localhost (ducie-dc1.codethink.co.uk [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id r9k6DaO38qd3; Mon, 12 Oct 2015 18:33:56 +0100 (BST) Received: from rainbowdash.ducie.codethink.co.uk (rainbowdash.dyn.ducie.codethink.co.uk [10.24.1.119]) by ducie-dc1.codethink.co.uk (Postfix) with ESMTPS id 16BCA460224; Mon, 12 Oct 2015 18:33:56 +0100 (BST) Received: from ben by rainbowdash.ducie.codethink.co.uk with local (Exim 4.86) (envelope-from ) id 1Zlgyx-0002g1-SU; Mon, 12 Oct 2015 18:33:55 +0100 From: Ben Dooks To: devicetree@vger.kernel.org, linux-omap@vger.kernel.org, tony@atomide.com, sameo@linux.intel.com, lee.jones@linaro.org Cc: linux-kernel@lists.codethink.co.uk, Ben Dooks Subject: [PATCH] mfd: omap-usb-host: AM3715 OHCI needs 120m functional clock Date: Mon, 12 Oct 2015 18:33:52 +0100 Message-Id: <1444671232-10253-1-git-send-email-ben.dooks@codethink.co.uk> X-Mailer: git-send-email 2.6.1 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The AM3715 OHCI controller will not function without the EHCI unit's 120m fclk being enabled. If all the ports in the system are set to OHCI then the 120m_fclk will not get enabled and no devices are detected. Add a new (optional) property to signal the system must enable the 120m_fck for OHCI so that if no EHCI ports are signalled then the 120m_fclk should be enabled. We have found no information about why this is necessary, but it is suspected the EHCI controller does not complete the initial reset sequence and therefore does not hand control of the USB port back. Signed-off-by: Ben Dooks --- Documentation/devicetree/bindings/usb/omap-usb.txt | 3 +++ drivers/mfd/omap-usb-host.c | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/Documentation/devicetree/bindings/usb/omap-usb.txt b/Documentation/devicetree/bindings/usb/omap-usb.txt index 38d9bb8..fb5fea5 100644 --- a/Documentation/devicetree/bindings/usb/omap-usb.txt +++ b/Documentation/devicetree/bindings/usb/omap-usb.txt @@ -23,6 +23,9 @@ OMAP MUSB GLUE Optional properties: - ctrl-module : phandle of the control module this glue uses to write to mailbox + - ti,ohci-needs-120m-fck : bool, enable the 120m ehci clock even if just + using ohci. Needed for AM3517 in OHCI only mode. + SOC specific device node entry usb_otg_hs: usb_otg_hs@4a0ab000 { diff --git a/drivers/mfd/omap-usb-host.c b/drivers/mfd/omap-usb-host.c index 1d924d1..13880cf 100644 --- a/drivers/mfd/omap-usb-host.c +++ b/drivers/mfd/omap-usb-host.c @@ -680,6 +680,10 @@ static int usbhs_omap_probe(struct platform_device *pdev) need_logic_fck |= true; } + /* The AM3517 requries the 120m-fck active to allow the OHCI to work */ + if (of_property_read_bool(dev->of_node, "ti,ohci-needs-120m-fck")) + need_logic_fck |= true; + if (need_logic_fck) { omap->ehci_logic_fck = devm_clk_get(dev, "usbhost_120m_fck");