From patchwork Mon Oct 26 08:12:35 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yoshihiro Shimoda X-Patchwork-Id: 7486071 X-Patchwork-Delegate: geert@linux-m68k.org Return-Path: X-Original-To: patchwork-linux-sh@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 4A4899F36A for ; Mon, 26 Oct 2015 08:13:36 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4A7F620651 for ; Mon, 26 Oct 2015 08:13:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 35B8D2064C for ; Mon, 26 Oct 2015 08:13:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753369AbbJZINd (ORCPT ); Mon, 26 Oct 2015 04:13:33 -0400 Received: from relmlor3.renesas.com ([210.160.252.173]:65032 "EHLO relmlie2.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753284AbbJZINb (ORCPT ); Mon, 26 Oct 2015 04:13:31 -0400 Received: from unknown (HELO relmlir1.idc.renesas.com) ([10.200.68.151]) by relmlie2.idc.renesas.com with ESMTP; 26 Oct 2015 17:13:29 +0900 Received: from relmlac2.idc.renesas.com (relmlac2.idc.renesas.com [10.200.69.22]) by relmlir1.idc.renesas.com (Postfix) with ESMTP id C5D5B4803B; Mon, 26 Oct 2015 17:13:29 +0900 (JST) Received: by relmlac2.idc.renesas.com (Postfix, from userid 0) id C4BE92806E; Mon, 26 Oct 2015 17:13:29 +0900 (JST) Received: from relmlac2.idc.renesas.com (localhost [127.0.0.1]) by relmlac2.idc.renesas.com (Postfix) with ESMTP id BFB052806D; Mon, 26 Oct 2015 17:13:29 +0900 (JST) Received: from relmlii1.idc.renesas.com [10.200.68.65] by relmlac2.idc.renesas.com with ESMTP id TAL09673; Mon, 26 Oct 2015 17:13:29 +0900 X-IronPort-AV: E=Sophos;i="5.20,200,1444662000"; d="scan'208";a="197223038" Received: from mail-pu1apc01lp0022.outbound.protection.outlook.com (HELO APC01-PU1-obe.outbound.protection.outlook.com) ([65.55.88.22]) by relmlii1.idc.renesas.com with ESMTP/TLS/AES256-SHA; 26 Oct 2015 17:13:28 +0900 Received: from SG2PR06MB0919.apcprd06.prod.outlook.com (10.162.204.152) by SG2PR06MB0984.apcprd06.prod.outlook.com (10.162.204.26) with Microsoft SMTP Server (TLS) id 15.1.306.13; Mon, 26 Oct 2015 08:13:27 +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.306.13; Mon, 26 Oct 2015 08:13:26 +0000 From: Yoshihiro Shimoda To: , , , , , , CC: , , Yoshihiro Shimoda Subject: [PATCH v3 7/7] usb: host: xhci-plat: add support for the R-Car H3 xHCI controllers Date: Mon, 26 Oct 2015 17:12:35 +0900 Message-ID: <1445847155-5468-8-git-send-email-yoshihiro.shimoda.uh@renesas.com> X-Mailer: git-send-email 1.9.4.msysgit.1 In-Reply-To: <1445847155-5468-1-git-send-email-yoshihiro.shimoda.uh@renesas.com> References: <1445847155-5468-1-git-send-email-yoshihiro.shimoda.uh@renesas.com> MIME-Version: 1.0 X-Originating-IP: [211.11.155.144] X-ClientProxiedBy: HKXPR03CA0039.apcprd03.prod.outlook.com (10.141.129.29) To SG2PR06MB0919.apcprd06.prod.outlook.com (25.162.204.152) X-Microsoft-Exchange-Diagnostics: 1; SG2PR06MB0919; 2:zn+mCGS6T3twhlebEhKs4fW7xWFintVGT5/cGIc80jK3H/O/NjPNadCpE/I6RR+jSi5mlwlmq0kWVWvYG3I31CW5ZMCZVoGPNvP4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twcEbDcwdgcQltwQ6IYf/woCE54w; 4:kKsVNIXCi84a0rwXclDX4f5k20ycQ2zewewcGZp/0LfAtr9ZfSYc4vbk7sNz3MTsFvJkUtcPVy57YkyCsWC2baNXJUiAzktH9E8Afzoj8NIUD6VrMgPyKU5n5ZV+Bx7P/QmSGYsUpsgYPQETGO90z9iMarfoqlSlM/g7WdWAsi3cZ+PIWLb1XpLwMlWDY52lP07d8VGDdh1dqn6kbxnIFVfOfKgs6wzS6wrDkHaaXb/Xk3Zw9Kag90Z24Bwb1JfcWICuPfVKaAyA/WusmPClwgSegJWDynsSM2xsrglpdO5s8fws6MnfJiHcDmnG0SrG+HWCfS36jhxtK05sXNAE92EPV0PpzM3EffM6M9G/96lxIthJrlYJDqjzoqUy7myc X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(85106069007906); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(5005006)(520078)(8121501046)(3002001)(102215026); SRVR:SG2PR06MB0919; BCL:0; PCL:0; RULEID:; SRVR:SG2PR06MB0919; X-Forefront-PRVS: 0741C77572 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(6009001)(6069001)(199003)(189002)(40100003)(50986999)(101416001)(87976001)(33646002)(189998001)(47776003)(66066001)(78352002)(42382002)(50226001)(105586002)(5001960100002)(229853001)(107886002)(106356001)(76176999)(36756003)(42186005)(50466002)(5008740100001)(76506005)(81156007)(4001430100002)(122386002)(77096005)(5003940100001)(5001920100001)(97736004)(5001770100001)(92566002)(2950100001)(48376002)(19580405001)(5004730100002)(19580395003)(5007970100001); 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:8ZE6v0/suKhSJBNkUup0mQb3PGhasQdIlUL6fPCpq?= =?us-ascii?Q?/3eS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u?= =?us-ascii?Q?9/sW9evtcpbOFnA2+J2lujzJ5c3sBnz3k5XfNEdPwD7EFTrGCPFrs1nZqatW?= =?us-ascii?Q?Ow6hEhiKyXFwj1HznONoqcGuRgZ60ew412JhBN79H7HNSmUDsXlIegwzK8ga?= =?us-ascii?Q?1a8PTYgQmutG6F0zToyQc9EiYqBB6IM5EXD0BvFhYre7rBGE73PMTXi6tSoJ?= =?us-ascii?Q?nc0jktdHoVbsw8OkAtL3GkZxoOGJOgd?= X-Microsoft-Exchange-Diagnostics: 1; SG2PR06MB0919; 5:iKcTnCoCIyf5h9ai9/c7b+myhvaBN6bVg5bYSvsak8ZTiXy+74GovRqjRQ8US77X+H8XGouRzUqEjc0fsurCt3ZGZTAYHvS2dTFlAfIUW2+WdH70S1DtVq7Yu1ibQtRgfhvWeRkoV8o4S+DdIcVl2g==; 24:aRIDUwie1exFZcC34qfwOQarWkxocCfxVzLhy7527LbKZllSlXBK0KOh2vhD1ca776fJWvtiLFxl2FuWXx9C/jRdsUS8jVYM1MANFEV+ggo=; 20:fi0+Y3TSdLOgsVJDNGbtm4wgfSm2BReGrYAA9j32VjWdYtsbV1fALEkeyrVV8fjkROrTXSzdbwK2cxQcT9pEsBTDdQAvGj8IWSJvFZ/N/mrnGJP10w48PWOa6Nz4XxAqHiaHciPTZeIZubA0/FHqkl8knOtAPIBoX0UfUnbP4TE= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Oct 2015 08:13:26.2769 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: SG2PR06MB0919 X-Microsoft-Exchange-Diagnostics: 1; SG2PR06MB0984; 2:igoLjghbO2EeUFTTrWTG0IvFIiXxGJLc2zVAXpVbYCE2Ge6Iq1bWiHBOUmCBpSid6lvtdIWJcdyeNvwb6CY+wDTouDn+BW/xlCgsj10DvAPA+2wkkPXcuxGGP5GEynvvR42tZEeWWQgp4QDDvpMJg+QuW6E/NSaNHJt+NmgG4DU=; 23:Mhr/xfR5hpB16YmFAnODYYt8+/cCENlDXWapB3LL9Rj2pE+RlP8cspYU/Nzu4JgSZzzy1I0q5U3aT5w4+bUIUrnKAh92gdVMM9epNeOsk0o4NQq063A8RYpw5RjhWt4CJRDKMrTPKLabhiZCTvk7pe2Ly7hmaylQ3h54f+3EBECGH1qOCwDmS8yvpVHEwkWb 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.9 required=5.0 tests=AXB_X_OUTLOOKPROT_ENVSDR, BAYES_00, RCVD_IN_DNSWL_HI, 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 | 14 ++++++++++++-- drivers/usb/host/xhci-plat.h | 1 + drivers/usb/host/xhci-rcar.c | 7 +++++++ drivers/usb/host/xhci-rcar.h | 1 + 5 files changed, 23 insertions(+), 4 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 0113e79..770b6b0 100644 --- a/drivers/usb/host/xhci-plat.c +++ b/drivers/usb/host/xhci-plat.c @@ -52,7 +52,8 @@ static int xhci_plat_setup(struct usb_hcd *hcd) { int ret; - if (xhci_plat_type_is(hcd, XHCI_PLAT_TYPE_RENESAS_RCAR_GEN2)) { + if (xhci_plat_type_is(hcd, XHCI_PLAT_TYPE_RENESAS_RCAR_GEN2) || + xhci_plat_type_is(hcd, XHCI_PLAT_TYPE_RENESAS_RCAR_GEN3)) { ret = xhci_rcar_init_quirk(hcd); if (ret) return ret; @@ -63,7 +64,8 @@ static int xhci_plat_setup(struct usb_hcd *hcd) static int xhci_plat_start(struct usb_hcd *hcd) { - if (xhci_plat_type_is(hcd, XHCI_PLAT_TYPE_RENESAS_RCAR_GEN2)) + if (xhci_plat_type_is(hcd, XHCI_PLAT_TYPE_RENESAS_RCAR_GEN2) || + xhci_plat_type_is(hcd, XHCI_PLAT_TYPE_RENESAS_RCAR_GEN3)) xhci_rcar_start(hcd); return xhci_run(hcd); @@ -79,6 +81,11 @@ static const struct xhci_plat_priv xhci_plat_renesas_rcar_gen2 = { .firmware_name = XHCI_RCAR_FIRMWARE_NAME_V1, }; +static const struct xhci_plat_priv xhci_plat_renesas_rcar_gen3 = { + .type = XHCI_PLAT_TYPE_RENESAS_RCAR_GEN3, + .firmware_name = XHCI_RCAR_FIRMWARE_NAME_V2, +}; + static const struct of_device_id usb_xhci_of_match[] = { { .compatible = "generic-xhci", @@ -100,6 +107,9 @@ static const struct of_device_id usb_xhci_of_match[] = { .compatible = "renesas,xhci-r8a7793", .data = &xhci_plat_renesas_rcar_gen2, }, { + .compatible = "renesas,xhci-r8a7795", + .data = &xhci_plat_renesas_rcar_gen3, + }, { }, }; MODULE_DEVICE_TABLE(of, usb_xhci_of_match); diff --git a/drivers/usb/host/xhci-plat.h b/drivers/usb/host/xhci-plat.h index 20b32a7..5a2e2e3 100644 --- a/drivers/usb/host/xhci-plat.h +++ b/drivers/usb/host/xhci-plat.h @@ -16,6 +16,7 @@ enum xhci_plat_type { XHCI_PLAT_TYPE_MARVELL_ARMADA, XHCI_PLAT_TYPE_RENESAS_RCAR_GEN2, + XHCI_PLAT_TYPE_RENESAS_RCAR_GEN3, }; struct xhci_plat_priv { diff --git a/drivers/usb/host/xhci-rcar.c b/drivers/usb/host/xhci-rcar.c index 010a24f..623100e 100644 --- a/drivers/usb/host/xhci-rcar.c +++ b/drivers/usb/host/xhci-rcar.c @@ -17,7 +17,14 @@ #include "xhci-plat.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. +*/ MODULE_FIRMWARE(XHCI_RCAR_FIRMWARE_NAME_V1); +MODULE_FIRMWARE(XHCI_RCAR_FIRMWARE_NAME_V2); /*** Register Offset ***/ #define RCAR_USB3_INT_ENA 0x224 /* Interrupt Enable */ diff --git a/drivers/usb/host/xhci-rcar.h b/drivers/usb/host/xhci-rcar.h index ba3ad31..2941a25 100644 --- a/drivers/usb/host/xhci-rcar.h +++ b/drivers/usb/host/xhci-rcar.h @@ -12,6 +12,7 @@ #define _XHCI_RCAR_H #define XHCI_RCAR_FIRMWARE_NAME_V1 "r8a779x_usb3_v1.dlmem" +#define XHCI_RCAR_FIRMWARE_NAME_V2 "r8a779x_usb3_v2.dlmem" #if IS_ENABLED(CONFIG_USB_XHCI_RCAR) void xhci_rcar_start(struct usb_hcd *hcd);