Received: by 10.223.176.46 with SMTP id f43csp1013419wra; Wed, 24 Jan 2018 09:15:28 -0800 (PST) X-Google-Smtp-Source: AH8x226lTsNW2oEBsXEd8hCCzPsd7onBLqorRuNvRQKbkRmI4xmv7+lamZ7a5G86c0EJOjmQRwDt X-Received: by 10.101.67.193 with SMTP id n1mr11216342pgp.116.1516814128770; Wed, 24 Jan 2018 09:15:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516814128; cv=none; d=google.com; s=arc-20160816; b=tM9TKnFK58VoAT7YhKlE1TVsIZEb7n6Z1vGYzWsFnvvNDAXnLpxITP4V9UWTHU/GXV lp1L4spdJDcykvsC57RltJ5heBlQ+hAqiUaePRGHW8aiCaDsBB2LvMMopdDM2A3Huana BT28PDe8ipmwLBLRVJdL8PhHiD0+LIbo+lDVEYuAEQTQE1wDlHd1dduBiQ4pCHgE3/y4 OdytCLEcKER4ejbVnqcaGoZKhuz7Pm/zwkM3kWnk8F/3ilC5eyUGzmNoVAKq2eA78ITB 9pJxvt0UWD/l1SNkXZ3c+pJsHBI/SWg0ssUPXNee5BCLHlPyflUtdsL/szRiFJX2jiW4 sA9g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=YBwxaL0DP7KQOIRVIWKVwG6NwNr5/qnezw9mIwliHLE=; b=FUA4gvX95XJRWloJx1o+4hJASmiovPYUCUlZi6kbHNfdHRbjNsT/ft7nxHZlJ+jM31 1M7/V1EoUaR6Mry3J9SnbbkAvu0kXZv0QhWXitH9XWItwjRB26uVh+CQMUrf1Aw1cxwN N8R7TQDQOwA0BL389JMXkpRewTNpvjkc1GuF23SIzFm/YF8Vn20cUhzA4pZP2pr74Eli kurbiJJN2sCJB7GrxMZb2kxgJsg1WHSnFRpu1kGp9tAeAOXO1XDxTHoBaiK8S+LxvsoJ mJ7VZ/UjbMccSrtxwh4aXLAxsWeM26XTD1g4Q1cK4P2Uv2YGdaUNbsyIy8hAbDxBlFoJ 46MQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.co.uk Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p24si3114509pff.76.2018.01.24.09.15.14; Wed, 24 Jan 2018 09:15:28 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.co.uk Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964890AbeAXROr (ORCPT + 99 others); Wed, 24 Jan 2018 12:14:47 -0500 Received: from bhuna.collabora.co.uk ([46.235.227.227]:50516 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S964850AbeAXROp (ORCPT ); Wed, 24 Jan 2018 12:14:45 -0500 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: sre) with ESMTPSA id 5C14F26CB2A From: Sebastian Reichel To: Peter Chen , Greg Kroah-Hartman Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Ian Ray , Nandor Han , Fabien Lahoudere , kernel@lists.collabora.co.uk, Sebastian Reichel Subject: [PATCH 2/2] usb: chipidea: imx: Fix ULPI on imx53 Date: Wed, 24 Jan 2018 18:14:39 +0100 Message-Id: <20180124171439.10721-2-sebastian.reichel@collabora.co.uk> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180124171439.10721-1-sebastian.reichel@collabora.co.uk> References: <20180124171439.10721-1-sebastian.reichel@collabora.co.uk> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Traditionally, PORTSC should be set before initializing ULPI phys. But setting PORTSC before powering on the phy results in a kernel freeze on imx53 based GE PPD. As a workaround this initializes the phy early in the imx platform code and disables phy power management from the core. Signed-off-by: Fabien Lahoudere Signed-off-by: Sebastian Reichel --- drivers/usb/chipidea/ci_hdrc_imx.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/usb/chipidea/ci_hdrc_imx.c b/drivers/usb/chipidea/ci_hdrc_imx.c index de155c80eb70..e431c5aafe35 100644 --- a/drivers/usb/chipidea/ci_hdrc_imx.c +++ b/drivers/usb/chipidea/ci_hdrc_imx.c @@ -83,6 +83,7 @@ struct ci_hdrc_imx_data { struct clk *clk; struct imx_usbmisc_data *usbmisc_data; bool supports_runtime_pm; + bool override_phy_control; bool in_lpm; /* SoC before i.mx6 (except imx23/imx28) needs three clks */ bool need_three_clks; @@ -254,6 +255,7 @@ static int ci_hdrc_imx_probe(struct platform_device *pdev) int ret; const struct of_device_id *of_id; const struct ci_hdrc_imx_platform_flag *imx_platform_flag; + struct device_node *np = pdev->dev.of_node; of_id = of_match_device(ci_hdrc_imx_dt_ids, &pdev->dev); if (!of_id) @@ -288,6 +290,14 @@ static int ci_hdrc_imx_probe(struct platform_device *pdev) } pdata.usb_phy = data->phy; + + if (of_device_is_compatible(np, "fsl,imx53-usb") && pdata.usb_phy && + of_usb_get_phy_mode(np) == USBPHY_INTERFACE_MODE_ULPI) { + pdata.flags |= CI_HDRC_OVERRIDE_PHY_CONTROL; + data->override_phy_control = true; + usb_phy_init(pdata.usb_phy); + } + pdata.flags |= imx_platform_flag->flags; if (pdata.flags & CI_HDRC_SUPPORTS_RUNTIME_PM) data->supports_runtime_pm = true; @@ -341,6 +351,8 @@ static int ci_hdrc_imx_remove(struct platform_device *pdev) pm_runtime_put_noidle(&pdev->dev); } ci_hdrc_remove_device(data->ci_pdev); + if (data->override_phy_control) + usb_phy_shutdown(data->phy); imx_disable_unprepare_clks(&pdev->dev); return 0; -- 2.15.1