From patchwork Thu Jan 10 15:04:29 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roger Quadros X-Patchwork-Id: 155186 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp1994754jaa; Thu, 10 Jan 2019 07:04:44 -0800 (PST) X-Google-Smtp-Source: ALg8bN7LL7pN90DRjMu00kqgor3RwZu0sICJGTylXMZaSSDze9D37t8H/uQkUlmfroxIGneQ8+Ll X-Received: by 2002:a63:f552:: with SMTP id e18mr9764309pgk.239.1547132684793; Thu, 10 Jan 2019 07:04:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547132684; cv=none; d=google.com; s=arc-20160816; b=ksX5f6jMZXufwLLQkJGxMGGwSDJzlaHUFKRhXwnEUauJlHZuPjNpjsYexwHUPuwIVU LocDAPFgkmyDsEskazwHZYmi2bLUxl4tjN/Ph7zqq5MxEeT+OEhmXMZwG1ThYQsLRjW4 RsYNY4FuIzDjwysmT/Cmx6sxkXRgZ4LpiJolATT1Dl5PvPvFN77PHahONwWQZqs5LvCb +7hv9zWK+zsKjPc+NxTfNNOXimb/ur8uTMjeM9BXWfy2rKfVyMzjSf43o3VdBX2hYJdu YoKxVcU2Ju322Zd23umkU559bqG4K3phHeYnfTqSz8fb/efLqe89JIvpbBAwJPiFKvp4 NM1g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=aP0E3G7TwFFVHxmyykcYNLKeXL6TOHP7yXqwGzacnHs=; b=08Z3CfrzGdGBW+fSlbumthr4DQ8/g3Hw8bttCfeiOG0C7HvgFQ0ZEPE/5sSCrQPqyc dlYsoF3pxwLTg46Zxdt6HFlfQrBqDo2UVNhUIqxHXKt7BphAM1j/H8gMGQ7SET2PeqDp vqybkoKSE/XTGg+JkS3QJyghohfb0ik2acgvQ30OSVxgnK/WdNmasInXNtQBiIgC0qRD YCWKHXhwLNh11n04hR3fIGPHB1xu6OgOV2w2z4nQaV9kJyoGXGLt0Z9x4CGgf6g0ztM4 N9ObABiPPhOtJWVYacUks0GRDQAEHtJ57Y7ZXltLYpcSsk7LYgsfqoz/Bey9ihN/UWNm IrdA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=utQT85j+; 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=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i69si34528009pgd.71.2019.01.10.07.04.44; Thu, 10 Jan 2019 07:04:44 -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; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=utQT85j+; 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=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729418AbfAJPEn (ORCPT + 31 others); Thu, 10 Jan 2019 10:04:43 -0500 Received: from lelv0142.ext.ti.com ([198.47.23.249]:40788 "EHLO lelv0142.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729367AbfAJPEl (ORCPT ); Thu, 10 Jan 2019 10:04:41 -0500 Received: from fllv0034.itg.ti.com ([10.64.40.246]) by lelv0142.ext.ti.com (8.15.2/8.15.2) with ESMTP id x0AF4dCs121111; Thu, 10 Jan 2019 09:04:39 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1547132679; bh=aP0E3G7TwFFVHxmyykcYNLKeXL6TOHP7yXqwGzacnHs=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=utQT85j+UL7kXrewjYtHcC23p9N/8GPgLCAMcgA2CCWDHd10Fbdxz+iPjQFg1lrJE lBBYRJS9gu0NO8kCpanbf/xW7b9UM5tJDmYIQPfnllLIxvNo+rzZRS7uqavXhZ/AOb 5EtPv9uPd4HvJpMKzEW2K43U8jzJziBESW6dQF9g= Received: from DLEE109.ent.ti.com (dlee109.ent.ti.com [157.170.170.41]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x0AF4dm4018024 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 10 Jan 2019 09:04:39 -0600 Received: from DLEE108.ent.ti.com (157.170.170.38) by DLEE109.ent.ti.com (157.170.170.41) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10; Thu, 10 Jan 2019 09:04:38 -0600 Received: from dflp33.itg.ti.com (10.64.6.16) by DLEE108.ent.ti.com (157.170.170.38) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1591.10 via Frontend Transport; Thu, 10 Jan 2019 09:04:38 -0600 Received: from localhost.localdomain (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp33.itg.ti.com (8.14.3/8.13.8) with ESMTP id x0AF4VPh006681; Thu, 10 Jan 2019 09:04:36 -0600 From: Roger Quadros To: CC: , , , , , , Roger Quadros Subject: [PATCH v2 2/3] dt-bindings: usb: keystone-usb: Add ti, am654-dwc3 support Date: Thu, 10 Jan 2019 17:04:29 +0200 Message-ID: <1547132670-5908-3-git-send-email-rogerq@ti.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1547132670-5908-1-git-send-email-rogerq@ti.com> References: <1547132670-5908-1-git-send-email-rogerq@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The AM654 SoC from TI contains a DWC3 controller. Add support for it. Signed-off-by: Roger Quadros --- Documentation/devicetree/bindings/usb/keystone-usb.txt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) -- Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki diff --git a/Documentation/devicetree/bindings/usb/keystone-usb.txt b/Documentation/devicetree/bindings/usb/keystone-usb.txt index f96e09f..77df82e 100644 --- a/Documentation/devicetree/bindings/usb/keystone-usb.txt +++ b/Documentation/devicetree/bindings/usb/keystone-usb.txt @@ -3,7 +3,9 @@ TI Keystone Soc USB Controller DWC3 GLUE Required properties: - - compatible: should be "ti,keystone-dwc3". + - compatible: should be + "ti,keystone-dwc3" for Keystone 2 SoCs + "ti,am654-dwc3" for AM654 SoC - #address-cells, #size-cells : should be '1' if the device has sub-nodes with 'reg' property. - reg : Address and length of the register set for the USB subsystem on @@ -21,7 +23,7 @@ SoCs only: - clock-names: Must be "usb". -The following are mandatory properties for Keystone 2 66AK2G SoCs only: +The following are mandatory properties for 66AK2G and AM654: - power-domains: Should contain a phandle to a PM domain provider node and an args specifier containing the USB device id From patchwork Thu Jan 10 15:04:30 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roger Quadros X-Patchwork-Id: 155187 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp1994892jaa; Thu, 10 Jan 2019 07:04:49 -0800 (PST) X-Google-Smtp-Source: ALg8bN4yw2Hrdc79VMzc/mKOkZlsU7sn9P14yJBUCwIWrmQ1holFNYgZwXxDUHfl5q4ucj4tBJw8 X-Received: by 2002:a63:6bc1:: with SMTP id g184mr9891295pgc.25.1547132689278; Thu, 10 Jan 2019 07:04:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547132689; cv=none; d=google.com; s=arc-20160816; b=KEdko/kAEOwiUdGqy93id8AzmeZto1G6p6Skl/Uvjdg3HgyjehMMe3o8ltP4UBGaRe Iny31G16ZUUA7VDGGUOBJ6kQzXz0e+dIa+brcz1BofjBCExS34INAsFLDJvQx7NYwh9W kw0kgEmc4PvdTK7PzJGBvqhDEwNGXjr/kd5dJOXqe2gHUrFMsAVxqvzfURfPj+iXRgIm GVmOPy9Pnbm1NciVb5tZgTgbMD8vtdIqaddGLcJqoG6KokmY282qEDGEt1lbhvIGI54J lDI3/dJZ1j/Pw+mTNM2LccEUy6FADOztiWbAjJAfdAJXV7CieKibWZ8DLVOMsRpOM8gL Jf3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=VC/a/gFeU6z5Hrah+NU/vSW1brF2aFfQVscOsR4uPWQ=; b=nO1dBBrED7A0id2g0Ydk9E7awr+CmYJBn3VPNv7ZmrwCd9quk8+1z5Q6ubfZXZk+kE EpD74O/maK2m/t/NhRYgFy7gt8aRwDDdvThBB4Q3TD0PHgTnq+16Z8od+eZEjZAahDQm YchR5eKuV/bbR1UMQAEnJw1l47myX7OZHB9REq6gGsyxqnQeEbjZSlUP5MfdLVy89d3r h6owp6CfNR3TcOk9MMRDINBcMeRSTdDIUND8LhTA+qN9ocTlj0Rs5OnaxEHfKSF8WAU0 6nr7ptE17SmGYPpLIc/EWIlIrEdrIYB7ybCyuvvXU9IExJJJrdGOKTLHP5dDP2YAq8h0 tjgA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=skbEk9FW; 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=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i69si34528009pgd.71.2019.01.10.07.04.48; Thu, 10 Jan 2019 07:04:49 -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; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=skbEk9FW; 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=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729433AbfAJPEs (ORCPT + 31 others); Thu, 10 Jan 2019 10:04:48 -0500 Received: from lelv0143.ext.ti.com ([198.47.23.248]:51844 "EHLO lelv0143.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729405AbfAJPEn (ORCPT ); Thu, 10 Jan 2019 10:04:43 -0500 Received: from lelv0266.itg.ti.com ([10.180.67.225]) by lelv0143.ext.ti.com (8.15.2/8.15.2) with ESMTP id x0AF4fTE108850; Thu, 10 Jan 2019 09:04:41 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1547132681; bh=VC/a/gFeU6z5Hrah+NU/vSW1brF2aFfQVscOsR4uPWQ=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=skbEk9FW1j1OBUnhPN2JBag8qUxu0zzGy9KA2yPVSHo94GQgx/DJkvUblSTt8zD03 ZA1fLbwG9xucr3YNL3ktPMRLVh72dd2UGEMRsv6dKv2EXyTNbncBNXFawUicpz6x0K 5QpL6A5LOuQzPXZ40EBTXuiufxRqV5RW3rD5oxDU= Received: from DFLE112.ent.ti.com (dfle112.ent.ti.com [10.64.6.33]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x0AF4fYK080007 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 10 Jan 2019 09:04:41 -0600 Received: from DFLE105.ent.ti.com (10.64.6.26) by DFLE112.ent.ti.com (10.64.6.33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10; Thu, 10 Jan 2019 09:04:41 -0600 Received: from dflp33.itg.ti.com (10.64.6.16) by DFLE105.ent.ti.com (10.64.6.26) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1591.10 via Frontend Transport; Thu, 10 Jan 2019 09:04:41 -0600 Received: from localhost.localdomain (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp33.itg.ti.com (8.14.3/8.13.8) with ESMTP id x0AF4VPi006681; Thu, 10 Jan 2019 09:04:39 -0600 From: Roger Quadros To: CC: , , , , , , Roger Quadros Subject: [PATCH v2 3/3] usb: dwc3: keystone: Add support for ti,am654-dwc3 Date: Thu, 10 Jan 2019 17:04:30 +0200 Message-ID: <1547132670-5908-4-git-send-email-rogerq@ti.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1547132670-5908-1-git-send-email-rogerq@ti.com> References: <1547132670-5908-1-git-send-email-rogerq@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The AM654 SoC contains a DWC3 controller with TI specific wrapper. Add support for that. Unlike the Keystone 2 case, for AM654 We don't need to process any IRQs for basic USB operation. Signed-off-by: Roger Quadros --- drivers/usb/dwc3/Kconfig | 6 +++--- drivers/usb/dwc3/dwc3-keystone.c | 11 ++++++++++- 2 files changed, 13 insertions(+), 4 deletions(-) -- Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki diff --git a/drivers/usb/dwc3/Kconfig b/drivers/usb/dwc3/Kconfig index 1a0404f..34d9ce2 100644 --- a/drivers/usb/dwc3/Kconfig +++ b/drivers/usb/dwc3/Kconfig @@ -86,11 +86,11 @@ config USB_DWC3_HAPS platform, please say 'Y' or 'M' here. config USB_DWC3_KEYSTONE - tristate "Texas Instruments Keystone2 Platforms" - depends on ARCH_KEYSTONE || COMPILE_TEST + tristate "Texas Instruments Keystone2/AM654 Platforms" + depends on ARCH_KEYSTONE || ARCH_K3 || COMPILE_TEST default USB_DWC3 help - Support of USB2/3 functionality in TI Keystone2 platforms. + Support of USB2/3 functionality in TI Keystone2 and AM654 platforms. Say 'Y' or 'M' here if you have one such device config USB_DWC3_OF_SIMPLE diff --git a/drivers/usb/dwc3/dwc3-keystone.c b/drivers/usb/dwc3/dwc3-keystone.c index 193a9a8..cbee5fb 100644 --- a/drivers/usb/dwc3/dwc3-keystone.c +++ b/drivers/usb/dwc3/dwc3-keystone.c @@ -106,6 +106,10 @@ static int kdwc3_probe(struct platform_device *pdev) goto err_irq; } + /* IRQ processing not required currently for AM65 */ + if (of_device_is_compatible(node, "ti,am654-dwc3")) + goto skip_irq; + irq = platform_get_irq(pdev, 0); if (irq < 0) { dev_err(&pdev->dev, "missing irq\n"); @@ -123,6 +127,7 @@ static int kdwc3_probe(struct platform_device *pdev) kdwc3_enable_irqs(kdwc); +skip_irq: error = of_platform_populate(node, NULL, NULL, dev); if (error) { dev_err(&pdev->dev, "failed to create dwc3 core\n"); @@ -152,8 +157,11 @@ static int kdwc3_remove_core(struct device *dev, void *c) static int kdwc3_remove(struct platform_device *pdev) { struct dwc3_keystone *kdwc = platform_get_drvdata(pdev); + struct device_node *node = pdev->dev.of_node; + + if (!of_device_is_compatible(node, "ti,am654-dwc3")) + kdwc3_disable_irqs(kdwc); - kdwc3_disable_irqs(kdwc); device_for_each_child(&pdev->dev, NULL, kdwc3_remove_core); pm_runtime_put_sync(kdwc->dev); pm_runtime_disable(kdwc->dev); @@ -165,6 +173,7 @@ static int kdwc3_remove(struct platform_device *pdev) static const struct of_device_id kdwc3_of_match[] = { { .compatible = "ti,keystone-dwc3", }, + { .compatible = "ti,am654-dwc3" }, {}, }; MODULE_DEVICE_TABLE(of, kdwc3_of_match);