From patchwork Mon Jan 27 21:23:18 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Marko X-Patchwork-Id: 11353253 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B8AAF1580 for ; Mon, 27 Jan 2020 21:23:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8C56C2467B for ; Mon, 27 Jan 2020 21:23:38 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=sartura-hr.20150623.gappssmtp.com header.i=@sartura-hr.20150623.gappssmtp.com header.b="dc0JpbzH" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726164AbgA0VXi (ORCPT ); Mon, 27 Jan 2020 16:23:38 -0500 Received: from mail-wr1-f67.google.com ([209.85.221.67]:41503 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725955AbgA0VXi (ORCPT ); Mon, 27 Jan 2020 16:23:38 -0500 Received: by mail-wr1-f67.google.com with SMTP id c9so13413829wrw.8 for ; Mon, 27 Jan 2020 13:23:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sartura-hr.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=EhwCmtaQ5z38Dh4LdrIcWd+8GWIRdht98z03oyUG448=; b=dc0JpbzHkLWFZLI6cymH+jYc48XC8MqFWSaxuOfQNXWOaw/J9PpQOLuFx0aPb2IO4I +ljmqyeR7r9Rl7c05fLorZjVI9Vb83AC5hY0AS8bmO1aw/sS34IA455Fqg9gh3V5hU6f l1h2XNGy9IMhjl8GSpIb0ZPOhJ5/rS4kfhIof06AIxM26MHh7ccv+B8Yz1HEH5srAmVN NTPelK406BAfNPUvt1CMrpe8o6oHYtaKc+fr5VQf4nZqjlvWfQ+UhMQ4SYJ83mwcwjtv usqWoloAAhjmVcEF8c0kslXTpiFCJ/ceFSqVZHLXl1EO9k6ezXkfk0OvdURCOD7Wtsfa P2rw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=EhwCmtaQ5z38Dh4LdrIcWd+8GWIRdht98z03oyUG448=; b=iBjpnNBZbZHyMdJabUXKfOqMuZ07s+5+CYqScgYPpR6kppHX2PyIrMEV5NnyUvVwQw xLEuU+3EP5b1imJNy8wCCjzd5+MDpEuerpwjq4NRoK/OXZaatUbO/lGt7PloAb1bRSzy /eF99oQ4uUzfcP0aU8YcllaV6ouTp1Gddz6mJoWJf4p5Go4SNnsFPdHOEGuHPwYkjSTU /k5eIMDqxUBpUu1zREZfJGHeSLGc6a5pFM0retQo7tIBOv/wtTaM/eU6FdW0lTe2IRmP O6EQ4r2ZoOJlM205sxJ/0ADQxZRHLNfDedtFBpU8bQpG+j101X3Rd/6n6ZyTUPQg8OVY /8Ow== X-Gm-Message-State: APjAAAU/52cWHSA22VhCYVBTSeH6othgns070aNLcp9jocH8aJF1EWr+ YdGdJpaK9MioXVGEAMdf/3sFsg== X-Google-Smtp-Source: APXvYqxfunh+7XkHCNhCvBuUhm/9NGIGOPJHkKISVi7t2PppMB5vSe/78PKvWMHaSgAbN0f+MX7Zmg== X-Received: by 2002:adf:9c8f:: with SMTP id d15mr25284756wre.390.1580160216081; Mon, 27 Jan 2020 13:23:36 -0800 (PST) Received: from localhost.localdomain ([188.252.202.167]) by smtp.googlemail.com with ESMTPSA id x132sm683120wmg.0.2020.01.27.13.23.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Jan 2020 13:23:35 -0800 (PST) From: Robert Marko To: john@phrozen.org, agross@kernel.org, linux-arm-msm@vger.kernel.org Cc: Robert Marko , Luka Perkov Subject: [PATCH v3 1/3] phy: add driver for Qualcomm IPQ40xx USB PHY Date: Mon, 27 Jan 2020 22:23:18 +0100 Message-Id: <20200127212319.1544222-1-robert.marko@sartura.hr> X-Mailer: git-send-email 2.24.1 MIME-Version: 1.0 Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org From: John Crispin Add a driver to setup the USB phy on Qualcom Dakota SoCs. The driver sets up HS and SS phys. Signed-off-by: John Crispin Signed-off-by: Robert Marko Cc: Luka Perkov --- Changes from v2 to v3: * Remove magic writes as they are not needed * Correct commit message drivers/phy/qualcomm/Kconfig | 7 + drivers/phy/qualcomm/Makefile | 1 + drivers/phy/qualcomm/phy-qcom-ipq4019-usb.c | 152 ++++++++++++++++++++ 3 files changed, 160 insertions(+) create mode 100644 drivers/phy/qualcomm/phy-qcom-ipq4019-usb.c diff --git a/drivers/phy/qualcomm/Kconfig b/drivers/phy/qualcomm/Kconfig index e46824da29f6..964bd5d784d2 100644 --- a/drivers/phy/qualcomm/Kconfig +++ b/drivers/phy/qualcomm/Kconfig @@ -18,6 +18,13 @@ config PHY_QCOM_APQ8064_SATA depends on OF select GENERIC_PHY +config PHY_QCOM_IPQ4019_USB + tristate "Qualcomm IPQ4019 USB PHY module" + depends on OF && ARCH_QCOM + select GENERIC_PHY + help + Support for the USB PHY on QCOM IPQ4019/Dakota chipsets. + config PHY_QCOM_IPQ806X_SATA tristate "Qualcomm IPQ806x SATA SerDes/PHY driver" depends on ARCH_QCOM diff --git a/drivers/phy/qualcomm/Makefile b/drivers/phy/qualcomm/Makefile index 283251d6a5d9..8afe6c4f5178 100644 --- a/drivers/phy/qualcomm/Makefile +++ b/drivers/phy/qualcomm/Makefile @@ -1,6 +1,7 @@ # SPDX-License-Identifier: GPL-2.0 obj-$(CONFIG_PHY_ATH79_USB) += phy-ath79-usb.o obj-$(CONFIG_PHY_QCOM_APQ8064_SATA) += phy-qcom-apq8064-sata.o +obj-$(CONFIG_PHY_QCOM_IPQ4019_USB) += phy-qcom-ipq4019-usb.o obj-$(CONFIG_PHY_QCOM_IPQ806X_SATA) += phy-qcom-ipq806x-sata.o obj-$(CONFIG_PHY_QCOM_PCIE2) += phy-qcom-pcie2.o obj-$(CONFIG_PHY_QCOM_QMP) += phy-qcom-qmp.o diff --git a/drivers/phy/qualcomm/phy-qcom-ipq4019-usb.c b/drivers/phy/qualcomm/phy-qcom-ipq4019-usb.c new file mode 100644 index 000000000000..7efebae6b6fd --- /dev/null +++ b/drivers/phy/qualcomm/phy-qcom-ipq4019-usb.c @@ -0,0 +1,152 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* + * Copyright (C) 2018 John Crispin + * + * Based on code from + * Allwinner Technology Co., Ltd. + * + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +struct ipq4019_usb_phy { + struct device *dev; + struct phy *phy; + void __iomem *base; + struct reset_control *por_rst; + struct reset_control *srif_rst; +}; + +static int ipq4019_ss_phy_power_off(struct phy *_phy) +{ + struct ipq4019_usb_phy *phy = phy_get_drvdata(_phy); + + reset_control_assert(phy->por_rst); + msleep(10); + + return 0; +} + +static int ipq4019_ss_phy_power_on(struct phy *_phy) +{ + struct ipq4019_usb_phy *phy = phy_get_drvdata(_phy); + + ipq4019_ss_phy_power_off(_phy); + + reset_control_deassert(phy->por_rst); + + return 0; +} + +static struct phy_ops ipq4019_usb_ss_phy_ops = { + .power_on = ipq4019_ss_phy_power_on, + .power_off = ipq4019_ss_phy_power_off, +}; + +static int ipq4019_hs_phy_power_off(struct phy *_phy) +{ + struct ipq4019_usb_phy *phy = phy_get_drvdata(_phy); + + reset_control_assert(phy->por_rst); + msleep(10); + + reset_control_assert(phy->srif_rst); + msleep(10); + + return 0; +} + +static int ipq4019_hs_phy_power_on(struct phy *_phy) +{ + struct ipq4019_usb_phy *phy = phy_get_drvdata(_phy); + + ipq4019_hs_phy_power_off(_phy); + + reset_control_deassert(phy->srif_rst); + msleep(10); + + reset_control_deassert(phy->por_rst); + + return 0; +} + +static struct phy_ops ipq4019_usb_hs_phy_ops = { + .power_on = ipq4019_hs_phy_power_on, + .power_off = ipq4019_hs_phy_power_off, +}; + +static const struct of_device_id ipq4019_usb_phy_of_match[] = { + { .compatible = "qcom,usb-hs-ipq4019-phy", .data = &ipq4019_usb_hs_phy_ops}, + { .compatible = "qcom,usb-ss-ipq4019-phy", .data = &ipq4019_usb_ss_phy_ops}, + { }, +}; +MODULE_DEVICE_TABLE(of, ipq4019_usb_phy_of_match); + +static int ipq4019_usb_phy_probe(struct platform_device *pdev) +{ + struct device *dev = &pdev->dev; + struct resource *res; + struct phy_provider *phy_provider; + struct ipq4019_usb_phy *phy; + const struct of_device_id *match; + + match = of_match_device(ipq4019_usb_phy_of_match, &pdev->dev); + if (!match) + return -ENODEV; + + phy = devm_kzalloc(dev, sizeof(*phy), GFP_KERNEL); + if (!phy) + return -ENOMEM; + + phy->dev = &pdev->dev; + res = platform_get_resource(pdev, IORESOURCE_MEM, 0); + phy->base = devm_ioremap_resource(&pdev->dev, res); + if (IS_ERR(phy->base)) { + dev_err(dev, "failed to remap register memory\n"); + return PTR_ERR(phy->base); + } + + phy->por_rst = devm_reset_control_get(phy->dev, "por_rst"); + if (IS_ERR(phy->por_rst)) { + if (PTR_ERR(phy->por_rst) != -EPROBE_DEFER) + dev_err(dev, "POR reset is missing\n"); + return PTR_ERR(phy->por_rst); + } + + phy->srif_rst = devm_reset_control_get_optional(phy->dev, "srif_rst"); + if (IS_ERR(phy->srif_rst)) + return PTR_ERR(phy->srif_rst); + + phy->phy = devm_phy_create(dev, NULL, match->data); + if (IS_ERR(phy->phy)) { + dev_err(dev, "failed to create PHY\n"); + return PTR_ERR(phy->phy); + } + phy_set_drvdata(phy->phy, phy); + + phy_provider = devm_of_phy_provider_register(dev, of_phy_simple_xlate); + + return PTR_ERR_OR_ZERO(phy_provider); +} + +static struct platform_driver ipq4019_usb_phy_driver = { + .probe = ipq4019_usb_phy_probe, + .driver = { + .of_match_table = ipq4019_usb_phy_of_match, + .name = "ipq4019-usb-phy", + } +}; +module_platform_driver(ipq4019_usb_phy_driver); + +MODULE_DESCRIPTION("QCOM/IPQ4019 USB phy driver"); +MODULE_AUTHOR("John Crispin "); +MODULE_LICENSE("GPL v2"); From patchwork Mon Jan 27 21:23:20 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Marko X-Patchwork-Id: 11353255 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 79BB11398 for ; Mon, 27 Jan 2020 21:23:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 589912467F for ; Mon, 27 Jan 2020 21:23:48 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=sartura-hr.20150623.gappssmtp.com header.i=@sartura-hr.20150623.gappssmtp.com header.b="xO9CFYGb" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726173AbgA0VXs (ORCPT ); Mon, 27 Jan 2020 16:23:48 -0500 Received: from mail-wm1-f41.google.com ([209.85.128.41]:53238 "EHLO mail-wm1-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725955AbgA0VXr (ORCPT ); Mon, 27 Jan 2020 16:23:47 -0500 Received: by mail-wm1-f41.google.com with SMTP id p9so142562wmc.2 for ; Mon, 27 Jan 2020 13:23:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sartura-hr.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=n+X3gDNQCPJKis4fY2ahlPVwAEpWtIPaMVSozOCGWpU=; b=xO9CFYGbuZZyMYvlUiUddDbb8X1KDdpjBLARsr6R5jwOEnG5cW2+ey+teEmhJH6jog lhWvDreXRWJDexYpsuB5d8JiRulvuWBHLGhdV0TgjO4gwh4JXcM1PnIwTPI/YTTGJ/e7 lcJthbp90SgSGEfb1al7qpMIcWTLqlD3UJlyPsOCf0gkv+47iQL2CfTcsUWeHZVvq8JO dVaHwYQ/TR5BsMOLb4N0SZKMr2Y6gHZlYpGnMo1OQswx8ad60K/r729QQR9APEbvohat aNsSft73ry80AohKqOFPB3iobxWsb8dX856PwZ5NADoqaJGb6swAjpSmnM3omBC+comX zPpA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=n+X3gDNQCPJKis4fY2ahlPVwAEpWtIPaMVSozOCGWpU=; b=hbGKbMcYFaXBvpLV2HV4HXU7uO6bqzrxbmSN7q4ecpaugD+Dyc/Nzk48h80kdD3Ia5 v7shiVAyjoH5+gVEsylNCNbUAOlSbP1ANS3bZ9wNEjtmH+RkZb56A5LlN+a7Lk56abR1 UHA3bTTR2DULLZQqkzyaMZWHZI4qSi86dWv1fch5Zb50/zgEl8WqqDNx0/E0nK96rD0Y Ym38RxVSBq5N0KqpVVbGqPeaIT4WgFjFxecQVdWYNkgXvhcwIHXlQgigo7qBrW9O8MGi 0j8fe4PFgovQOQIGI3Vpxq5II+YEIWOqex+67E0E7N23/kR5FuSOe4rcJaSLB3Z61PgS GKaw== X-Gm-Message-State: APjAAAXCEBnoSE5FFCyIpuNRjKdulSDZoTIh4mHdlq3pt8kDJipkgVOd oHUnkqSPOyyC+KbMjvbxnh0Y4w== X-Google-Smtp-Source: APXvYqyBiH5V9XHKcob40CAcp8LllVZh86U3J4kAvLuJrsEjR6W2l4N7ClVQnCd/OoKElUI0RIl8mw== X-Received: by 2002:a7b:cf2d:: with SMTP id m13mr632564wmg.163.1580160226053; Mon, 27 Jan 2020 13:23:46 -0800 (PST) Received: from localhost.localdomain ([188.252.202.167]) by smtp.googlemail.com with ESMTPSA id x132sm683120wmg.0.2020.01.27.13.23.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Jan 2020 13:23:45 -0800 (PST) From: Robert Marko To: john@phrozen.org, agross@kernel.org, linux-arm-msm@vger.kernel.org Cc: Robert Marko , Luka Perkov Subject: [PATCH v3 2/3] dt-bindings: phy-qcom-ipq4019-usb: add binding document Date: Mon, 27 Jan 2020 22:23:20 +0100 Message-Id: <20200127212319.1544222-2-robert.marko@sartura.hr> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200127212319.1544222-1-robert.marko@sartura.hr> References: <20200127212319.1544222-1-robert.marko@sartura.hr> MIME-Version: 1.0 Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org This patch adds the binding documentation for the HS/SS USB PHY found inside Qualcom Dakota SoCs. Signed-off-by: John Crispin Signed-off-by: Robert Marko Cc: Luka Perkov --- .../bindings/phy/qcom-usb-ipq4019-phy.yaml | 45 +++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 Documentation/devicetree/bindings/phy/qcom-usb-ipq4019-phy.yaml diff --git a/Documentation/devicetree/bindings/phy/qcom-usb-ipq4019-phy.yaml b/Documentation/devicetree/bindings/phy/qcom-usb-ipq4019-phy.yaml new file mode 100644 index 000000000000..6473731b07a1 --- /dev/null +++ b/Documentation/devicetree/bindings/phy/qcom-usb-ipq4019-phy.yaml @@ -0,0 +1,45 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- +$id: "http://devicetree.org/schemas/phy/qcom-usb-ipq4019-phy.yaml#" +$schema: "http://devicetree.org/meta-schemas/core.yaml#" + +title: Qualcom IPQ40xx Dakota HS/SS USB PHY + +properties: + compatible: + enum: + - qcom,usb-ss-ipq4019-phy + - qcom,usb-hs-ipq4019-phy + + reg: + maxItems: 1 + + resets: + maxItems: 2 + + reset-names: + items: + - const: por_rst + - const: srif_rst + + "#phy-cells": + const: 0 + +required: + - compatible + - reg + - resets + - reset-names + - "#phy-cells" + +examples: + - | + hsphy@a8000 { + compatible = "qcom,usb-hs-ipq4019-phy"; + phy-cells = <0>; + reg = <0xa8000 0x40>; + resets = <&gcc USB2_HSPHY_POR_ARES>, + <&gcc USB2_HSPHY_S_ARES>; + reset-names = "por_rst", "srif_rst"; + }; From patchwork Mon Jan 27 21:23:22 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Marko X-Patchwork-Id: 11353257 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 744741398 for ; Mon, 27 Jan 2020 21:24:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 527B72467B for ; Mon, 27 Jan 2020 21:24:01 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=sartura-hr.20150623.gappssmtp.com header.i=@sartura-hr.20150623.gappssmtp.com header.b="CptAM+XN" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726275AbgA0VYB (ORCPT ); Mon, 27 Jan 2020 16:24:01 -0500 Received: from mail-wr1-f66.google.com ([209.85.221.66]:36328 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725955AbgA0VYA (ORCPT ); Mon, 27 Jan 2020 16:24:00 -0500 Received: by mail-wr1-f66.google.com with SMTP id z3so13436479wru.3 for ; Mon, 27 Jan 2020 13:23:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sartura-hr.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=2FYYv2CkjElFAYjDohnfSrEmf3CiiM23ViUusDP3kSQ=; b=CptAM+XNuy5jQCYdl3GkomVlo8q6xefTyOJHHBMjnO1ps7YWDW7Yko2GqiOV2MYIOE qFwtfI3zbk9diG7uQ+YmDaIzM+DB5zvpk0/XMFsEFswCdUOGnHuxHYKfcv/9Wx0RYVl4 AKX8IDsGlyzdXINswbYCk0nwKA8wkJOvZoOaA5NmTfHppUMM1jieX/68KvBEpnMmRh8p yIw8dHc/i/tvaTF3jkumLvO2nRA0rWQL5STSuP/a/23Sy00N842mzzyCqBd2pI/J/Y+8 blbkbkzSfpd+J507slnOMIPUe9+9rD919olOhyJ8deOEcuZGlQ1dDj9DrAb/uFwB7y3A Ct7Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=2FYYv2CkjElFAYjDohnfSrEmf3CiiM23ViUusDP3kSQ=; b=bHhDzbt4JVsdnL/bYMqN68LvfqzDudhamLnUNVOyypPf0WvNtzHUZHklU6fxYh6W40 ppivfJlBplHdKZwurdL12iIH0jgGpxAZu6oNESB+sYhckNFNG4fc5tYsf6FmJGI9/Sup OTCW9LKWS5UnvaPedknG7YYGD/jnVIYcGN1F44hRrnk0OI153v/gwMTSs5s9STrJzv3y FYqIoV4AlOb/1s1PaBXnQ5JAfLmd37wCpnBPwODhWkJGSjgftO6j5JF/my1Whn0lUhrC wdCSq+kfnIDqOlaFJAEmxkXdKUk8WCSdqDp6TyJ/GjwhYGnZiQFDQgTHduvEICbOtjzu /i2g== X-Gm-Message-State: APjAAAXoBBLR/WyVUt0ABV0wamdVrxX4HjpYnC7A0A0dkzjR/XxerEdF fU6xGKPfmUcLYH9Wki/wqG3B3g== X-Google-Smtp-Source: APXvYqwkA9HSFeT4x5UkAHgWlUJgcLMVv1an6U15KNOSZmMDu6kpfJKhwWEuwaqfvTmrkKJYAKme9A== X-Received: by 2002:adf:d0c1:: with SMTP id z1mr25696522wrh.371.1580160238712; Mon, 27 Jan 2020 13:23:58 -0800 (PST) Received: from localhost.localdomain ([188.252.202.167]) by smtp.googlemail.com with ESMTPSA id x132sm683120wmg.0.2020.01.27.13.23.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Jan 2020 13:23:58 -0800 (PST) From: Robert Marko To: john@phrozen.org, agross@kernel.org, linux-arm-msm@vger.kernel.org Cc: Robert Marko , Luka Perkov Subject: [PATCH v3 3/3] ARM: dts: qcom: ipq4019: add USB devicetree nodes Date: Mon, 27 Jan 2020 22:23:22 +0100 Message-Id: <20200127212319.1544222-3-robert.marko@sartura.hr> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200127212319.1544222-1-robert.marko@sartura.hr> References: <20200127212319.1544222-1-robert.marko@sartura.hr> MIME-Version: 1.0 Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org From: John Crispin Since we now have driver for the USB PHY, lets add the necessary nodes to DTSI. Signed-off-by: John Crispin Tested-by: Robert Marko Cc: Luka Perkov --- arch/arm/boot/dts/qcom-ipq4019-ap.dk01.1.dtsi | 20 +++++ arch/arm/boot/dts/qcom-ipq4019.dtsi | 74 +++++++++++++++++++ 2 files changed, 94 insertions(+) diff --git a/arch/arm/boot/dts/qcom-ipq4019-ap.dk01.1.dtsi b/arch/arm/boot/dts/qcom-ipq4019-ap.dk01.1.dtsi index 418f9a022336..2ee5f05d5a43 100644 --- a/arch/arm/boot/dts/qcom-ipq4019-ap.dk01.1.dtsi +++ b/arch/arm/boot/dts/qcom-ipq4019-ap.dk01.1.dtsi @@ -109,5 +109,25 @@ wifi@a800000 { status = "ok"; }; + + usb3_ss_phy: ssphy@9a000 { + status = "ok"; + }; + + usb3_hs_phy: hsphy@a6000 { + status = "ok"; + }; + + usb3: usb3@8af8800 { + status = "ok"; + }; + + usb2_hs_phy: hsphy@a8000 { + status = "ok"; + }; + + usb2: usb2@60f8800 { + status = "ok"; + }; }; }; diff --git a/arch/arm/boot/dts/qcom-ipq4019.dtsi b/arch/arm/boot/dts/qcom-ipq4019.dtsi index b6e5203a210b..18e9c639514c 100644 --- a/arch/arm/boot/dts/qcom-ipq4019.dtsi +++ b/arch/arm/boot/dts/qcom-ipq4019.dtsi @@ -564,5 +564,79 @@ "legacy"; status = "disabled"; }; + + usb3_ss_phy: ssphy@9a000 { + compatible = "qcom,usb-ss-ipq4019-phy"; + #phy-cells = <0>; + reg = <0x9a000 0x800>; + reg-names = "phy_base"; + resets = <&gcc USB3_UNIPHY_PHY_ARES>; + reset-names = "por_rst"; + status = "disabled"; + }; + + usb3_hs_phy: hsphy@a6000 { + compatible = "qcom,usb-hs-ipq4019-phy"; + #phy-cells = <0>; + reg = <0xa6000 0x40>; + reg-names = "phy_base"; + resets = <&gcc USB3_HSPHY_POR_ARES>, <&gcc USB3_HSPHY_S_ARES>; + reset-names = "por_rst", "srif_rst"; + status = "disabled"; + }; + + usb3@8af8800 { + compatible = "qcom,dwc3"; + reg = <0x8af8800 0x100>; + #address-cells = <1>; + #size-cells = <1>; + clocks = <&gcc GCC_USB3_MASTER_CLK>, + <&gcc GCC_USB3_SLEEP_CLK>, + <&gcc GCC_USB3_MOCK_UTMI_CLK>; + clock-names = "master", "sleep", "mock_utmi"; + ranges; + status = "disabled"; + + dwc3@8a00000 { + compatible = "snps,dwc3"; + reg = <0x8a00000 0xf8000>; + interrupts = ; + phys = <&usb3_hs_phy>, <&usb3_ss_phy>; + phy-names = "usb2-phy", "usb3-phy"; + dr_mode = "host"; + }; + }; + + usb2_hs_phy: hsphy@a8000 { + compatible = "qcom,usb-hs-ipq4019-phy"; + #phy-cells = <0>; + reg = <0xa8000 0x40>; + reg-names = "phy_base"; + resets = <&gcc USB2_HSPHY_POR_ARES>, <&gcc USB2_HSPHY_S_ARES>; + reset-names = "por_rst", "srif_rst"; + status = "disabled"; + }; + + usb2@60f8800 { + compatible = "qcom,dwc3"; + reg = <0x60f8800 0x100>; + #address-cells = <1>; + #size-cells = <1>; + clocks = <&gcc GCC_USB2_MASTER_CLK>, + <&gcc GCC_USB2_SLEEP_CLK>, + <&gcc GCC_USB2_MOCK_UTMI_CLK>; + clock-names = "master", "sleep", "mock_utmi"; + ranges; + status = "disabled"; + + dwc3@6000000 { + compatible = "snps,dwc3"; + reg = <0x6000000 0xf8000>; + interrupts = ; + phys = <&usb2_hs_phy>; + phy-names = "usb2-phy"; + dr_mode = "host"; + }; + }; }; };