From patchwork Thu Nov 8 03:51:09 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thinh Nguyen X-Patchwork-Id: 10673429 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 91F8714E2 for ; Thu, 8 Nov 2018 03:51:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 824392C661 for ; Thu, 8 Nov 2018 03:51:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 76E982C67A; Thu, 8 Nov 2018 03:51:12 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1408A2C6E9 for ; Thu, 8 Nov 2018 03:51:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728702AbeKHNYh (ORCPT ); Thu, 8 Nov 2018 08:24:37 -0500 Received: from smtprelay.synopsys.com ([198.182.60.111]:34284 "EHLO smtprelay.synopsys.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728499AbeKHNYh (ORCPT ); Thu, 8 Nov 2018 08:24:37 -0500 Received: from mailhost.synopsys.com (mailhost3.synopsys.com [10.12.238.238]) by smtprelay.synopsys.com (Postfix) with ESMTP id C366310C06BA; Wed, 7 Nov 2018 19:51:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=synopsys.com; s=mail; t=1541649070; bh=Re2MOjyyqKAPg+jWRqb7Os+gYfNBt3BVuoQYAIlv/sE=; h=Date:In-Reply-To:References:From:Subject:To:CC:From; b=NhzSndEzrAocwHsQlIakacsFFWvEld1/UQNok2krNkzSvY7+B31ZdPODxfYKJxerF m1gqTghgyG6IOHNXtHudMcOBAeBeDkRlGL9vdUOKcxGk//8IZfi4iOSce6mav/fYui 3uNb/+BXBYtjn34o7bp3Fkv7ULqNv1zP3QzIA/MMnwui1Vu3R+8tt7+Jk9ocqhcuEW oSNW3tjYTSmRYV2mzfTj5zAW3qougrAUcmDs6hmw+8v3Xu6ZO5UVKa9e8zysABEm7P 8rAtW6aetuwmkGETRrv0myzywj3Cpd28veFrUi6zKrurhpHz7Xw3Q54slmIjLtGWdB 73HOC7X9WsE3g== Received: from US01WEHTC2.internal.synopsys.com (us01wehtc2-vip.internal.synopsys.com [10.12.239.238]) by mailhost.synopsys.com (Postfix) with ESMTP id B279E3EF2; Wed, 7 Nov 2018 19:51:10 -0800 (PST) Received: from US01WEHTC1.internal.synopsys.com (10.12.239.236) by US01WEHTC2.internal.synopsys.com (10.12.239.237) with Microsoft SMTP Server (TLS) id 14.3.408.0; Wed, 7 Nov 2018 19:51:10 -0800 Received: from te-lab16 (10.13.184.20) by us01wehtc1.internal.synopsys.com (10.12.239.236) with Microsoft SMTP Server (TLS) id 14.3.408.0; Wed, 7 Nov 2018 19:51:09 -0800 Received: by te-lab16 (sSMTP sendmail emulation); Wed, 07 Nov 2018 19:51:09 -0800 Date: Wed, 7 Nov 2018 19:51:09 -0800 Message-ID: <622262de3da148ecccbed5a82406421b213c997e.1541648784.git.thinhn@synopsys.com> In-Reply-To: References: From: Thinh Nguyen Subject: [PATCH v5 1/3] usb: dwc3: Track DWC_usb31 VERSIONTYPE To: Felipe Balbi , CC: John Youn MIME-Version: 1.0 X-Originating-IP: [10.13.184.20] Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Add a new field to dwc3 structure to track VERSIONTYPE. The VERSIONTYPE is represented in ASCII in the 32-bit VERSIONTYPE register. In DWC_usb31, sub releases for each version are tracked with VERSIONTYPE such as "ea01" and "ea02". Signed-off-by: Thinh Nguyen --- drivers/usb/dwc3/core.c | 1 + drivers/usb/dwc3/core.h | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c index becfbb87f791..437816ff8860 100644 --- a/drivers/usb/dwc3/core.c +++ b/drivers/usb/dwc3/core.c @@ -702,6 +702,7 @@ static bool dwc3_core_is_valid(struct dwc3 *dwc) /* Detected DWC_usb31 IP */ dwc->revision = dwc3_readl(dwc->regs, DWC3_VER_NUMBER); dwc->revision |= DWC3_REVISION_IS_DWC31; + dwc->version_type = dwc3_readl(dwc->regs, DWC3_VER_TYPE); } else { return false; } diff --git a/drivers/usb/dwc3/core.h b/drivers/usb/dwc3/core.h index 5bfb62533e0f..4573e1bfd56e 100644 --- a/drivers/usb/dwc3/core.h +++ b/drivers/usb/dwc3/core.h @@ -918,6 +918,7 @@ struct dwc3_scratchpad_array { * @u1u2: only used on revisions <1.83a for workaround * @maximum_speed: maximum speed requested (mainly for testing purposes) * @revision: revision register contents + * @version_type: VERSIONTYPE register contents, a sub release of a revision * @dr_mode: requested mode of operation * @current_dr_role: current role of operation when in dual-role mode * @desired_dr_role: desired role of operation when in dual-role mode @@ -1104,6 +1105,10 @@ struct dwc3 { #define DWC3_USB31_REVISION_110A (0x3131302a | DWC3_REVISION_IS_DWC31) #define DWC3_USB31_REVISION_120A (0x3132302a | DWC3_REVISION_IS_DWC31) + u32 version_type; + +#define DWC31_VERSIONTYPE_EA01 0x65613031 + enum dwc3_ep0_next ep0_next_event; enum dwc3_ep0_state ep0state; enum dwc3_link_state link_state;