From patchwork Mon Oct 5 12:06:30 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yoshihiro Shimoda X-Patchwork-Id: 7327011 X-Patchwork-Delegate: geert@linux-m68k.org Return-Path: X-Original-To: patchwork-linux-sh@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 03C2ABEEA4 for ; Mon, 5 Oct 2015 12:07:09 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 13CD020680 for ; Mon, 5 Oct 2015 12:07:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id EBDCE20675 for ; Mon, 5 Oct 2015 12:07:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751770AbbJEMHG (ORCPT ); Mon, 5 Oct 2015 08:07:06 -0400 Received: from relmlor4.renesas.com ([210.160.252.174]:12969 "EHLO relmlie3.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751391AbbJEMHD (ORCPT ); Mon, 5 Oct 2015 08:07:03 -0400 Received: from unknown (HELO relmlir4.idc.renesas.com) ([10.200.68.154]) by relmlie3.idc.renesas.com with ESMTP; 05 Oct 2015 21:07:02 +0900 Received: from relmlac3.idc.renesas.com (relmlac3.idc.renesas.com [10.200.69.23]) by relmlir4.idc.renesas.com (Postfix) with ESMTP id AB3CD4AA3D; Mon, 5 Oct 2015 21:07:02 +0900 (JST) Received: by relmlac3.idc.renesas.com (Postfix, from userid 0) id A69D51806F; Mon, 5 Oct 2015 21:07:02 +0900 (JST) Received: from relmlac3.idc.renesas.com (localhost [127.0.0.1]) by relmlac3.idc.renesas.com (Postfix) with ESMTP id 9C5911800A; Mon, 5 Oct 2015 21:07:02 +0900 (JST) Received: from relmlii2.idc.renesas.com [10.200.68.66] by relmlac3.idc.renesas.com with ESMTP id XAA11753; Mon, 5 Oct 2015 21:07:02 +0900 X-IronPort-AV: E=Sophos;i="5.17,638,1437404400"; d="scan'208";a="196978004" Received: from mail-hk2apc01lp0216.outbound.protection.outlook.com (HELO APC01-HK2-obe.outbound.protection.outlook.com) ([65.55.88.216]) by relmlii2.idc.renesas.com with ESMTP/TLS/AES256-SHA; 05 Oct 2015 21:07:01 +0900 Received: from SG2PR06MB0919.apcprd06.prod.outlook.com (10.162.204.152) by SG2PR06MB1087.apcprd06.prod.outlook.com (10.169.58.21) with Microsoft SMTP Server (TLS) id 15.1.286.20; Mon, 5 Oct 2015 12:07:01 +0000 Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=<>; Received: from localhost (211.11.155.144) by SG2PR06MB0919.apcprd06.prod.outlook.com (10.162.204.152) with Microsoft SMTP Server (TLS) id 15.1.280.20; Mon, 5 Oct 2015 12:07:00 +0000 From: Yoshihiro Shimoda To: , CC: , , Yoshihiro Shimoda Subject: [PATCH 4/4] usb: host: xhci-plat: add support for the R-Car H3 xHCI controllers Date: Mon, 5 Oct 2015 21:06:30 +0900 Message-ID: <1444046790-5804-5-git-send-email-yoshihiro.shimoda.uh@renesas.com> X-Mailer: git-send-email 1.9.4.msysgit.1 In-Reply-To: <1444046790-5804-1-git-send-email-yoshihiro.shimoda.uh@renesas.com> References: <1444046790-5804-1-git-send-email-yoshihiro.shimoda.uh@renesas.com> MIME-Version: 1.0 X-Originating-IP: [211.11.155.144] X-ClientProxiedBy: TY1PR0201CA0028.apcprd02.prod.outlook.com (25.164.90.166) To SG2PR06MB0919.apcprd06.prod.outlook.com (25.162.204.152) X-Microsoft-Exchange-Diagnostics: 1; SG2PR06MB0919; 2:R/nsL/Qd2rZgfgJhVdeIx9B9kVc3ychH9GkRzLTE38ZZPyPDvl8Fv8XDD6SnclrjkZjORI0EYRwNxp75LR3K4nzJGvKad8bpR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yOGvwslQ+hys9cCci8BMilxFjdshh+7aASLDSstyt3FY1w1R; 4:ilJjJch3lm8twg0fSq2lsY9oKKGgNZ2q5i4nwrM7LbWUt6wnO67O/wCWXQPDYl8ZoR6blFeoo2CX1XFmhcs2spacNBt7fE3ZgO//WOMMzse3UK8lb+Q0F7grc3LZD5cY87u8rVWFmDEbJF9FxGNkIxGZ/7RB0knhN37EwlHCZUmpjSiMNU2mEYfbrOkzM1KjLmLroC8xNRS7I5tZbtwApsZKPJGI2nm6sAE9kn/Q1Z96o6gZ18E+u+Brzf1cYf8dQ4z8WEiXmVhaBeWbHSS797QKHTsqmQJX+LkCD30iftQpQittffwgtBCl2ggDsEmhBbTGRi9rfAcG7Z2SNSCKkM8CoD+IkUcge4B8qS83t7A= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(520078)(8121501046)(5005006)(3002001); SRVR:SG2PR06MB0919; BCL:0; PCL:0; RULEID:; SRVR:SG2PR06MB0919; X-Forefront-PRVS: 07200C0526 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(6069001)(6009001)(199003)(189002)(40100003)(81156007)(105586002)(87976001)(78352002)(2950100001)(5001860100001)(50226001)(42186005)(107886002)(19580405001)(189998001)(122386002)(5007970100001)(97736004)(5004730100002)(5001770100001)(76506005)(48376002)(77156002)(50986999)(42382002)(46102003)(36756003)(92566002)(101416001)(5001960100002)(106356001)(50466002)(19580395003)(5003940100001)(4001540100001)(68736005)(33646002)(5001830100001)(47776003)(76176999)(64706001)(77096005)(5008740100001)(66066001)(62966003)(229853001)(4001430100001); DIR:OUT; SFP:1102; SCL:1; SRVR:SG2PR06MB0919; H:localhost; FPR:; SPF:None; PTR:InfoNoRecords; A:0; MX:0; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; SG2PR06MB0919; 23:lxakUNR/jZCyXRAw/yQMdfHIFK5d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vEtHPeK/FnzYQ4q7myxNDhnLydhMm5+WvZ/fhQ?= =?us-ascii?Q?mI+IfThfmkp5f2QTOy00cUeW35Yq/9E7JktN2ZIeHOm3+6ReVY1zIxPW8g9t?= =?us-ascii?Q?C80Y/nvekOJ6MwqXRdCEBRP0pc59KmefQHrtASniQvjDqThB24IZqzejBcpI?= =?us-ascii?Q?/QFsZNwSnJVaSR+8+74HbiAp2kFOggr0uXu8IRwdbRUvh9dIA6M9/sZwWQat?= =?us-ascii?Q?BlLHtg0ctzP2n+D1uxHmA3ZsXOLrRPIOjH3f31PNSmykznhI8pAxiz61yYuj?= =?us-ascii?Q?EVQNvfd+KxQKvy++GPIMt5bDzeDZ/OlQb0W2cOzkOkhKLbYdB1wIkLv3kbrm?= =?us-ascii?Q?hOX3+my/zG7kX3vNwPmM2/9UfMkwRmb3BP4dlKehnqThWkqj5W3L7/eXuNP6?= =?us-ascii?Q?H+i4/JaKGVDwZTELv/oBQw=3D?= X-Microsoft-Exchange-Diagnostics: 1; SG2PR06MB0919; 5:dMvMwFZdF7eGq54RxUSXZt0w6mpdwjrnw9RUo/t6ZlcqnthdurFbN244BwwOSn2XQLphiy192Ru1sT/hK7lDiV6zhg0vhocOsuggyBYwrnsrO0JtcdQgXr51UwN7E1w0CplgRUysRnpveGpHl/U+Pg==; 24:ME6Sou1789XC/68fBmXjUL9BEMLa3TtSAyp87Wln13F3ZdajBy6eURsOaBaczJm9aoKAWhBQJ3ryECumlb8IXAZUJNQZhqp/lNPGeyzjfxk=; 20:6+nN9Wzqq1RX5x8TfiLvAiTXPFkHJrGZR2nCiKPXanyfzaNxg0Ee3/gsSeJ+7FJd7SVu+vELJp6bvjyj+zzTUO6svc/qFsljesBD7nVh2C4PhYyVLcvD17Hiz0T4tmVs1Ok7b9z6elBFUvjFc+g9CQOy6oiti8LeFv7xFJKzaTM= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Oct 2015 12:07:00.0171 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: SG2PR06MB0919 X-Microsoft-Exchange-Diagnostics: 1; SG2PR06MB1087; 2:b7gIML3BSaT8vYN/BQsbVb+C0eXlDDCjPJj+i5hR/3XecLECzFo2AX1yEblXT0hyNRlaYpljrcEALKcrsApkZyVDU77bv9zvwwu0vnIKVL/itVrTHY5GIHXn49H37Gt4TZVKk8YBabMm9LJXBgbvy4JZdIUfkJcw4Ay+0TFI4Jc=; 23:riMWnxrRPELMzcYtEb7Qi0nXRDRemnpXggENMt5mp8YTGqcwNuOQSB+blCD5f26kdl6opRMuVfPJv2M0HFFMNmvCPgx/nrxYo5Dn1lFgkvzM/49ShBzDXk+ZJN1zaq5KSbvL1gJJF8ica6dis8CnB9jMB8qG1LsAE3ABzcTszKXB3WEeRw1OlQNfBaDHkhRf X-OriginatorOrg: renesas.com Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Spam-Status: No, score=-4.2 required=5.0 tests=AXB_X_OUTLOOKPROT_ENVSDR, BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham 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 R-Car H3 has two xHCI controllers. This SoC is compatible with R-Car Gen2 SoCs, however this SoC doesn't need some specific registers setting, and need a new firmware. Signed-off-by: Yoshihiro Shimoda --- Documentation/devicetree/bindings/usb/usb-xhci.txt | 4 ++-- drivers/usb/host/xhci-plat.c | 1 + drivers/usb/host/xhci-rcar.c | 23 +++++++++++++++++++++- 3 files changed, 25 insertions(+), 3 deletions(-) diff --git a/Documentation/devicetree/bindings/usb/usb-xhci.txt b/Documentation/devicetree/bindings/usb/usb-xhci.txt index 106299a..0825732 100644 --- a/Documentation/devicetree/bindings/usb/usb-xhci.txt +++ b/Documentation/devicetree/bindings/usb/usb-xhci.txt @@ -3,8 +3,8 @@ USB xHCI controllers Required properties: - compatible: should be one of "generic-xhci", "marvell,armada-375-xhci", "marvell,armada-380-xhci", - "renesas,xhci-r8a7790", "renesas,xhci-r8a7791", "renesas,xhci-r8a7793" - (deprecated: "xhci-platform"). + "renesas,xhci-r8a7790", "renesas,xhci-r8a7791", "renesas,xhci-r8a7793", + "renesas,xhci-r8a7795" (deprecated: "xhci-platform"). - reg: should contain address and length of the standard XHCI register set for the device. - interrupts: one XHCI interrupt should be described here. diff --git a/drivers/usb/host/xhci-plat.c b/drivers/usb/host/xhci-plat.c index 401110f..358febb 100644 --- a/drivers/usb/host/xhci-plat.c +++ b/drivers/usb/host/xhci-plat.c @@ -253,6 +253,7 @@ static const struct of_device_id usb_xhci_of_match[] = { { .compatible = "renesas,xhci-r8a7790"}, { .compatible = "renesas,xhci-r8a7791"}, { .compatible = "renesas,xhci-r8a7793"}, + { .compatible = "renesas,xhci-r8a7795"}, { }, }; MODULE_DEVICE_TABLE(of, usb_xhci_of_match); diff --git a/drivers/usb/host/xhci-rcar.c b/drivers/usb/host/xhci-rcar.c index acfa03a..eb1aed0 100644 --- a/drivers/usb/host/xhci-rcar.c +++ b/drivers/usb/host/xhci-rcar.c @@ -17,8 +17,16 @@ #include "xhci.h" #include "xhci-rcar.h" +/* + * - The V2 firmware is possible to use on R-Car Gen2. However, the V2 causes + * performance degradation. So, this driver continues to use the V1 if R-Car + * Gen2. + * - The V1 firmware is impossible to use on R-Car Gen3. + */ #define FIRMWARE_NAME_V1 "r8a779x_usb3_v1.dlmem" +#define FIRMWARE_NAME_V2 "r8a779x_usb3_v2.dlmem" MODULE_FIRMWARE(FIRMWARE_NAME_V1); +MODULE_FIRMWARE(FIRMWARE_NAME_V2); /*** Register Offset ***/ #define RCAR_USB3_INT_ENA 0x224 /* Interrupt Enable */ @@ -69,9 +77,20 @@ static bool xhci_rcar_is_compatible_with_gen2(struct usb_hcd *hcd) return false; } +static bool xhci_rcar_is_compatible_with_gen3(struct usb_hcd *hcd) +{ + struct device_node *of_node = hcd->self.controller->of_node; + + if (of_device_is_compatible(of_node, "renesas,xhci-r8a7795")) + return true; + + return false; +} + bool xhci_rcar_is_compatible(struct usb_hcd *hcd) { - if (xhci_rcar_is_compatible_with_gen2(hcd)) + if (xhci_rcar_is_compatible_with_gen2(hcd) || + xhci_rcar_is_compatible_with_gen3(hcd)) return true; return false; @@ -176,6 +195,8 @@ int xhci_rcar_init_quirk(struct usb_hcd *hcd) if (xhci_rcar_is_compatible_with_gen2(hcd)) firmware_name = FIRMWARE_NAME_V1; + if (xhci_rcar_is_compatible_with_gen3(hcd)) + firmware_name = FIRMWARE_NAME_V2; return xhci_rcar_download_firmware(hcd->self.controller, hcd->regs, firmware_name);