From patchwork Tue Oct 27 01:18: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: 7492961 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 924D6BEEA4 for ; Tue, 27 Oct 2015 01:19:24 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 966B6208EB for ; Tue, 27 Oct 2015 01:19:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 81BC6208E7 for ; Tue, 27 Oct 2015 01:19:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752491AbbJ0BTW (ORCPT ); Mon, 26 Oct 2015 21:19:22 -0400 Received: from relmlor2.renesas.com ([210.160.252.172]:18453 "EHLO relmlie1.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752101AbbJ0BTU (ORCPT ); Mon, 26 Oct 2015 21:19:20 -0400 Received: from unknown (HELO relmlir4.idc.renesas.com) ([10.200.68.154]) by relmlie1.idc.renesas.com with ESMTP; 27 Oct 2015 10:19:19 +0900 Received: from relmlac4.idc.renesas.com (relmlac4.idc.renesas.com [10.200.69.24]) by relmlir4.idc.renesas.com (Postfix) with ESMTP id 9E8073E788; Tue, 27 Oct 2015 10:19:19 +0900 (JST) Received: by relmlac4.idc.renesas.com (Postfix, from userid 0) id 99AF2480A3; Tue, 27 Oct 2015 10:19:19 +0900 (JST) Received: from relmlac4.idc.renesas.com (localhost [127.0.0.1]) by relmlac4.idc.renesas.com (Postfix) with ESMTP id 9493848014; Tue, 27 Oct 2015 10:19:19 +0900 (JST) Received: from relmlii1.idc.renesas.com [10.200.68.65] by relmlac4.idc.renesas.com with ESMTP id LAN12501; Tue, 27 Oct 2015 10:19:19 +0900 X-IronPort-AV: E=Sophos;i="5.20,202,1444662000"; d="scan'208";a="197274753" Received: from mail-sg2apc01lp0243.outbound.protection.outlook.com (HELO APC01-SG2-obe.outbound.protection.outlook.com) ([65.55.88.243]) by relmlii1.idc.renesas.com with ESMTP/TLS/AES256-SHA; 27 Oct 2015 10:19:17 +0900 Received: from TY1PR06MB0928.apcprd06.prod.outlook.com (10.164.99.154) by TY1PR06MB0989.apcprd06.prod.outlook.com (10.164.99.23) with Microsoft SMTP Server (TLS) id 15.1.306.13; Tue, 27 Oct 2015 01:19:15 +0000 Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=<>; Received: from localhost (211.11.155.144) by TY1PR06MB0928.apcprd06.prod.outlook.com (10.164.99.154) with Microsoft SMTP Server (TLS) id 15.1.306.13; Tue, 27 Oct 2015 01:19:13 +0000 From: Yoshihiro Shimoda To: , , , , , , CC: , , Yoshihiro Shimoda Subject: [PATCH v4 7/7] usb: host: xhci-plat: add support for the R-Car H3 xHCI controllers Date: Tue, 27 Oct 2015 10:18:30 +0900 Message-ID: <1445908710-5812-8-git-send-email-yoshihiro.shimoda.uh@renesas.com> X-Mailer: git-send-email 1.9.4.msysgit.1 In-Reply-To: <1445908710-5812-1-git-send-email-yoshihiro.shimoda.uh@renesas.com> References: <1445908710-5812-1-git-send-email-yoshihiro.shimoda.uh@renesas.com> MIME-Version: 1.0 X-Originating-IP: [211.11.155.144] X-ClientProxiedBy: OS1PR01CA0010.jpnprd01.prod.outlook.com (25.161.225.148) To TY1PR06MB0928.apcprd06.prod.outlook.com (25.164.99.154) X-Microsoft-Exchange-Diagnostics: 1; TY1PR06MB0928; 2:1Yd2Rgk9Dcna5NQu6Zkc7Ds1ZJAOXwbIDdJb363okUsyjEAyUjg3lgmIQJ01QW08A69lohbVDe0r5Cay6ot1//ZhAS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izfyrafnWnp/EyHA0zHyI7iQkkb0vt8vWnPSQL; 4:H16R5ITwfshG054c+4kfwBoOy7RR6pBHacY4gzJsDUpi3Olq9pka8VYAtkvJRPoWfaITN0A/yaC8v4DiyaAKSLKJsR9KrQvD1YcrPtMuoH2hCklQojKpwEoKZEgg3XOBur7EkfPTYbHUCN+4488aEOoX5oU7CP0AEBVdRDWSY1ttUHrNYaLeiLgMyJLpEYzR1Vco98Wo0tGvhpKds82Zvmdfq5xuJlNqLlL6wuK4c5+BOg//ngxYAN3ssTu3+hzmvDPAHtuBMXWbUz+oGDrHyMn0/SFpsFngsGvszg8SfSIOPPK92sLkePKdz4jX0PSZ7wH+aOvt+Jp3QhOJD8f+boGW18UrVKzfYUURPRszd1IfweRUa9vOWfw66jTV4Zjq X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(85106069007906); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(520078)(5005006)(8121501046)(3002001)(102215026); SRVR:TY1PR06MB0928; BCL:0; PCL:0; RULEID:; SRVR:TY1PR06MB0928; X-Forefront-PRVS: 0742443479 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(6069001)(6009001)(199003)(189002)(5003940100001)(19580405001)(66066001)(33646002)(19580395003)(106356001)(4001430100002)(2950100001)(105586002)(92566002)(40100003)(229853001)(50226001)(101416001)(81156007)(42382002)(5001960100002)(5001770100001)(97736004)(107886002)(77096005)(122386002)(189998001)(5008740100001)(78352002)(87976001)(5004730100002)(5007970100001)(50466002)(42186005)(50986999)(36756003)(47776003)(48376002)(76506005)(76176999); DIR:OUT; SFP:1102; SCL:1; SRVR:TY1PR06MB0928; H:localhost; FPR:; SPF:None; PTR:InfoNoRecords; A:0; MX:0; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; TY1PR06MB0928; 23:J//xDczjaYpHx+syQ//ZkULNn76Dxr4HuE2bZikty?= =?us-ascii?Q?TH7YJY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Anu9up9C/T?= =?us-ascii?Q?rH/56gm6MOpnHrf8WD42L1hSO/ouzdaqeCc2En9nYeYpsszQkKjsjUgGEK6Q?= =?us-ascii?Q?drfpqMVIpN86d2Z32GgGlzhzz33kt/p9UJFLRCxMdZQ9e2ogFHkZ2v9WMhPD?= =?us-ascii?Q?vJKR/8G6OwhFQ42Wx1/c5l95wH5rdPGxJ1D9jT+hcgMEDPsBw=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1; TY1PR06MB0928; 5:Kl+gQxsOS2wblZ5BwOJJvFK7HxJ6Giisc4RL1/KiSDl9WSjMOpMjG0u9oKzy7ZJF7XsJfd7tyQZc1jq/Nle5btUCapyq5vj7sP5XIfmtDLq62qXPQZnivf9TWXTEWbJAXIo2w8v8gFzABVCLiFbIGw==; 24:fY9DO0E98lLr9P6GzX3c4+ZTlhuH/7u920kJFGoxIczbJeKtP1oT+f69tIO4GGMBr8dryN+Od4DhPhLzx2jJntTsw06MibtfjeqCSgMDScw=; 20:ubaIqU7JCDn7/ghZ4dP6GS6oB7rzpPoRGLqV8SsSC7+kbpDT4+KhodKrTms4P8vphvr5Mqnt6Xn9NNDMUX8FlVSphMawEQ3JAMbh3JOoDbVTbxSdhfVjfDa3V2sfNXjKOV5uQi1GSVe+ssfUHv/PT0/u2jOjqB/l4dl591VjSFE= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Oct 2015 01:19:13.9326 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: TY1PR06MB0928 X-Microsoft-Exchange-Diagnostics: 1; TY1PR06MB0989; 2:3b20lBeL3qCebyMS447npfKokd7JSXTBP7Gksisx31MVJm6i7RZY8elLkCvkjMUrZoxy7E/GJjWDAfyZOxJMpC0TG1yJ47Vhw7N96FIkfURItSekSxlNfZGqyL8KGIuMWkpEWWSPC0aNvpJ+HKE5eaattH6lUXqHloLRevGRZgw=; 23:4R4fdNzdV2fg5OZl2oEqYqJLY2Dnln5Z62Y5ZrysvFW1IyfA2bZgohwk5Kv2KIP4CVmYZK3MTCyErI5AmTgbmSKkJiibt+UEDArl7N6TzjAci2/usRudJWBlZPy7NOOGB/UmPW2m38zcGFyF+3hElmoBC81d3HXSl3eFKsNmFw9HQNNUoqx0uX4E73sybnbc 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);