From patchwork Wed Sep 16 12:56:56 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peng Fan X-Patchwork-Id: 312383 Delivered-To: patch@linaro.org Received: by 2002:a92:5ad1:0:0:0:0:0 with SMTP id b78csp413482ilg; Wed, 16 Sep 2020 05:32:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw6ExSKTorko2j1gZKkdYhDzEw3mPT5yvHE/pB8i5G1WQTQ/XXHhoSOypHPS+Xv/OvkHMYN X-Received: by 2002:a17:906:d9c3:: with SMTP id qk3mr13250065ejb.207.1600259532146; Wed, 16 Sep 2020 05:32:12 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1600259532; cv=pass; d=google.com; s=arc-20160816; b=H1YH9SXTCCarlR2Dp2qUMYBkytWcrgizxhQ2t7XvApRAEkhVNZfZi2izrwCYrij3b/ 8omjumQ5K6t5FMSCBYUAW4gaTldnC7UgivwD9Jm7cSo049Gfa68kMeAM4c6i9tdVeknJ ultu9jsa7nXYCs67Ir7gc+P8QrK5fUlwU5SwPhrCKQCNTGytTe/M8VEw4E8Q3BNieJgC o+gb1C1F65buoAIwD6zNKa+NqIgXZLb7QnTd41InJCt4V5kjmLRIAc9uzB4frv+bwh72 ZInAuMrs8aHh+9+DaxqcwBYQ/JsX1P/dHF22Z9RK+OwxAhF07Gbw3N+NB5hFCXS3wUdS akRA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:mime-version :content-transfer-encoding:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=WJz5GLMp/iH8XmlEmbQLs300oShWfNYYmle86uH3yI0=; b=ADQnPKE11GZ2YB6o8lKS9aQFYsxMqZNk4u6RI3O2wyBSgQ2fO47D3HON7qc6ZDK2R4 zKMsrQt5lzEh6JRZHYhzf/2WjKbyGxvH8smaMC2ejIz5QT5Vr6xlNRLA2bmOmpA9qWJK eoFYj/4GSM5qZma3Ias/VzHwTC76cykV/NPHQ137Ozh26ZwklqcMdx80BJkV1yHdpE/P 7z25oTBqh3lyfd9AtIWG4+8Q72XrhQGFmFXu4X0Th3R+fC3miR3QTDgBDnswXTHT6+K6 DQ+QKBKn/KbSknm+qT4FipzgcSggMKQopbyWYX98DyzlNuZAsttftT06smVC/lPsXbyy +mXw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=fSRSkMT9; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from phobos.denx.de (phobos.denx.de. [2a01:238:438b:c500:173d:9f52:ddab:ee01]) by mx.google.com with ESMTPS id jz19si13088685ejb.241.2020.09.16.05.32.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Sep 2020 05:32:12 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; Authentication-Results: mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=fSRSkMT9; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id BD3F982338; Wed, 16 Sep 2020 14:31:27 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=nxp.com header.i=@nxp.com header.b="fSRSkMT9"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 2D8748232F; Wed, 16 Sep 2020 14:31:20 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FORGED_SPF_HELO,MSGID_FROM_MTA_HEADER, SPF_HELO_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.2 Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-db5eur01on0613.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe02::613]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 57F228231E for ; Wed, 16 Sep 2020 14:31:17 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=peng.fan@nxp.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=eR8ZK5njND8Y1I0fP6/7t3WC4v+SZvx57ELHZHEWHVUDPvMOpJ3kLGqnUKmgbfLHUIZYm9u1BCx0Y2k1T/EmXF4tXccIqYX6h3Yyw8OuTrFkCSSsvxuqwDvRlk5Bqfl3Zqc75SsF9xUkihQx1midwL5sOSxbKseFVfLNWCnLWl/Ua5xI/QIZEMV9FXC1bQQ1JTUOxlOo+W5uZNAfxMPdt7cDz4etvzhfD/DhIY1NEakVLekEoz4dXL9J5XzquEIGZUUys014DmSRLvbRItiWGW30sOLqW/n+fXNgA4bEd/983wQMK2KW0yXDCJI2B4BDzk1j0CieVA3tLmQgM/ge2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=WJz5GLMp/iH8XmlEmbQLs300oShWfNYYmle86uH3yI0=; b=TU2erRjV6ODciIoODz98Zi4ttLlyHuiV43PDqD5HNWDLfmxXrkIZuHCHS97DADNLNk+JLZ6oGMyvPjyo1k3U5kIQxQH3YXualOUy4w7GyMccA+cv3BtT3oNSZ0iozyqzSocO5oMsHNsaFZQVwYqiEhoxc9xSRcA9Apbxh01FBmQul65LHPUled70N8lVQYj0SzAI9C2Z7TzYznHiQ9EKsL+mFLy3NhaVJS+iRpH96Sbr3/T1YNuGhXBZFOPc4dcjFj6A8zubNzMD6QANpdaxtJSjoo36Jv6yr2YpAyt9tMDcvldrpiY/IJDG4fJE8TrAEShP3PINlG1THMpPZczlKg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=WJz5GLMp/iH8XmlEmbQLs300oShWfNYYmle86uH3yI0=; b=fSRSkMT90O+OZsDWe+8qJrDrFLf07uJdzpNNYEV2Scv4mO21q32/bq0BkmurYvTGe4AbPb2ODjyNyyvdV7QRw09y5zMsRMiaXfeggAuAOhKQM6Ta8yM2OPAO0B8s0cdYHken8YhRCQUxc4pjHe/yBCN+LrfaaG4pe/khdc2Z4z0= Authentication-Results: denx.de; dkim=none (message not signed) header.d=none;denx.de; dmarc=none action=none header.from=nxp.com; Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com (2603:10a6:4:a1::14) by DB3PR0402MB3915.eurprd04.prod.outlook.com (2603:10a6:8:e::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3370.17; Wed, 16 Sep 2020 12:31:15 +0000 Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::39ff:13b4:4f28:1413]) by DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::39ff:13b4:4f28:1413%10]) with mapi id 15.20.3370.019; Wed, 16 Sep 2020 12:31:15 +0000 From: peng.fan@nxp.com To: sbabic@denx.de, marex@denx.de Cc: uboot-imx@nxp.com, u-boot@lists.denx.de, Ye Li , Peng Fan Subject: [PATCH 04/13] usb: ehci-mx6: Turn on the power domain of USB PHY Date: Wed, 16 Sep 2020 20:56:56 +0800 Message-Id: <20200916125705.4341-5-peng.fan@nxp.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200916125705.4341-1-peng.fan@nxp.com> References: <20200916125705.4341-1-peng.fan@nxp.com> X-ClientProxiedBy: SGBP274CA0023.SGPP274.PROD.OUTLOOK.COM (2603:1096:4:b0::35) To DB6PR0402MB2760.eurprd04.prod.outlook.com (2603:10a6:4:a1::14) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from linux-1xn6.ap.freescale.net (119.31.174.71) by SGBP274CA0023.SGPP274.PROD.OUTLOOK.COM (2603:1096:4:b0::35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3391.13 via Frontend Transport; Wed, 16 Sep 2020 12:31:13 +0000 X-Mailer: git-send-email 2.28.0 X-Originating-IP: [119.31.174.71] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: b64f517d-6b14-484b-90f3-08d85a3c679e X-MS-TrafficTypeDiagnostic: DB3PR0402MB3915: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6430; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Le/ZwQSlQI+uPcI/hljZpwF+Ip9OxLXg7C1wLX16c7OI3Oqhna2vrWdrVgE1kkLeNJMvjgGP0iQw+e258aznt/sntD5bHixjQHQKROULm0dWvkxAMjpttrYNygBUYgsCgsD3GAVmFpUsbqYkH+f4P7lI02Jl0PKFWPA/03OWJMAJ2dxgrVPAS2vybKvzORHO0kvXvZ2Hfs4HCCEVlJIwtQFJHjhhjz2VqoKbEgIqDQlWJgJuI7pQTiPL53GqBPLY/Ccbx9BO0CiYsUxEpDdyzazzBFJGNO6IcCFRnTDowgSu9uj/krOfkYBQSsVsi7nT9JGRwMQwLY/jPBnmNtcIdQ== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DB6PR0402MB2760.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(396003)(39860400002)(346002)(136003)(376002)(366004)(4326008)(66946007)(66556008)(9686003)(26005)(8676002)(66476007)(8936002)(54906003)(36756003)(6486002)(6506007)(478600001)(1076003)(2906002)(186003)(16526019)(6512007)(52116002)(316002)(86362001)(83380400001)(2616005)(5660300002)(6666004)(956004); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: hfT3czIq/2NNisD+ttKfk8AJNkLxEGzS3qgAyrU4BI6/kNjLs/yZBztJKZuK/eUzsO3yT0p05WOphaiJU61qnzQuqvPFkSMOG+XBCYtjxL3RkuMC8GSj4ZdXhIujLgyX8uOMxDnn6XGr18PmEYLsI0nC+bakMYnBZGh0MB78QoNtPHyqKO/9QCOFa3kiw6+OkrjNFCHVUgPq007FKF9Wi2z6bBdFw4a16d5o/343saE3jqM6wBFyeYcbimwky43uoxigqqVpoKFb+8rnkeIzRh9lkD+7SqjrkGQm5F0+t98wjiar8l5BY+Kh/Ns8BtH96r/8YZh7YIEhIPIXymiIGTYp/dCvFI8Elc1o2sHRJi9wGtGU05A52d1nUHKK1LyTt+cTGPANyVGgw3bdPaC/L9NKJ2IKJ3QQbrsT3yPWDNrtzmBQeLJx2OfIS6hqPkKyZ+VO0bIpnfbvHeJYUws6mWBhDN8Df7K4avA6rlipBqOTG4p1oDKaMPqA+54m90WTefixSyockNvC0doI0LV+qsmO/K9kEBVlp+LWIQZgbiPf3IxNOX2KE52/zODE+bc9Xlv+aiquOXHbdlivrU6xKdggF5nN+daRzEVbalZuOwX4K6DI06klk36yZdoZaTvvIbwup+v90OEA4jkbfjpKhQ== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: b64f517d-6b14-484b-90f3-08d85a3c679e X-MS-Exchange-CrossTenant-AuthSource: DB6PR0402MB2760.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Sep 2020 12:31:15.8486 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: +TGlilXsXjB1XLzpELkXBJztEdkinK/vqD4AZfcsGGIyKTuMWi+hfP0YJxtagaIZcxDBJ4t35euiBxj7ykYvhQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB3PR0402MB3915 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.3 at phobos.denx.de X-Virus-Status: Clean From: Ye Li Since there is no uclass for USB PHY. The device won't be setup for the USB PHY node in DTB. And its associated power domain device won't be turned on neither by DM framework. This patch modifies the ehci-mx6 driver to enable the power domain device before access the USB PHY. This is only for DM driver. For non-DM part, users still need to power on the USB PHY in boards/SoC codes. Reviewed-by: Peng Fan Signed-off-by: Ye Li Signed-off-by: Peng Fan --- drivers/usb/host/ehci-mx6.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) -- 2.28.0 diff --git a/drivers/usb/host/ehci-mx6.c b/drivers/usb/host/ehci-mx6.c index b1721cd915..0727aafc92 100644 --- a/drivers/usb/host/ehci-mx6.c +++ b/drivers/usb/host/ehci-mx6.c @@ -2,6 +2,7 @@ /* * Copyright (c) 2009 Daniel Mack * Copyright (C) 2010 Freescale Semiconductor, Inc. + * */ #include @@ -19,6 +20,7 @@ #include #include #include +#include #include #include #include @@ -569,6 +571,20 @@ static int ehci_usb_phy_mode(struct udevice *dev) if ((fdt_addr_t)addr == FDT_ADDR_T_NONE) return -EINVAL; + /* Need to power on the PHY before access it */ +#if CONFIG_IS_ENABLED(POWER_DOMAIN) + struct udevice phy_dev; + struct power_domain pd; + int ret; + + phy_dev.node = offset_to_ofnode(phy_off); + if (!power_domain_get(&phy_dev, &pd)) { + ret = power_domain_on(&pd); + if (ret) + return ret; + } +#endif + phy_ctrl = (void __iomem *)(addr + USBPHY_CTRL); val = readl(phy_ctrl);