From patchwork Wed Mar 29 11:42:52 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yoshihiro Shimoda X-Patchwork-Id: 9651395 X-Patchwork-Delegate: geert@linux-m68k.org Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 7D581602BE for ; Wed, 29 Mar 2017 11:45:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6C2E4281F9 for ; Wed, 29 Mar 2017 11:45:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 60E9B28472; Wed, 29 Mar 2017 11:45:34 +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=-6.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,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 B252C281F9 for ; Wed, 29 Mar 2017 11:45:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755940AbdC2Lp3 (ORCPT ); Wed, 29 Mar 2017 07:45:29 -0400 Received: from relmlor3.renesas.com ([210.160.252.173]:24792 "EHLO relmlie2.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1755926AbdC2LpM (ORCPT ); Wed, 29 Mar 2017 07:45:12 -0400 Received: from unknown (HELO relmlir4.idc.renesas.com) ([10.200.68.154]) by relmlie2.idc.renesas.com with ESMTP; 29 Mar 2017 20:45:09 +0900 Received: from relmlac2.idc.renesas.com (relmlac2.idc.renesas.com [10.200.69.22]) by relmlir4.idc.renesas.com (Postfix) with ESMTP id 5A5A466295; Wed, 29 Mar 2017 20:45:09 +0900 (JST) Received: by relmlac2.idc.renesas.com (Postfix, from userid 0) id 4290128076; Wed, 29 Mar 2017 20:45:09 +0900 (JST) Received: from relmlac2.idc.renesas.com (localhost [127.0.0.1]) by relmlac2.idc.renesas.com (Postfix) with ESMTP id 3D7D628070; Wed, 29 Mar 2017 20:45:09 +0900 (JST) Received: from relmlii2.idc.renesas.com [10.200.68.66] by relmlac2.idc.renesas.com with ESMTP id WAE05665; Wed, 29 Mar 2017 20:45:09 +0900 X-IronPort-AV: E=Sophos;i="5.36,241,1486393200"; d="scan'208";a="238967667" Received: from mail-pu1apc01lp0020.outbound.protection.outlook.com (HELO APC01-PU1-obe.outbound.protection.outlook.com) ([65.55.88.20]) by relmlii2.idc.renesas.com with ESMTP/TLS/AES256-SHA256; 29 Mar 2017 20:45:08 +0900 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=renesasgroup.onmicrosoft.com; s=selector1-renesas-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=fvm2ra79hN7WYMkswmakY0XeXpqJ7PuI2HbNjay5JEE=; b=MSP5W7gXsYzL+zf+RpFTTrwamkmgR36yAf7Viesk0GOXnHYDfck1BmQTClP4smSU07r7AZ4eIaafewFblSmdKxgts5U2eXDKbYUpM9ZDhjc2j2YNRqZO2BVIBTMwRSL9MsSHAwG00wG0hO4uiSojf55ITSB3AWpJwdgk5X+Qkk8= Authentication-Results: kernel.org; dkim=none (message not signed) header.d=none; kernel.org; dmarc=none action=none header.from=renesas.com; Received: from localhost.localdomain (211.11.155.144) by SG2PR06MB1694.apcprd06.prod.outlook.com (10.167.82.136) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.991.14; Wed, 29 Mar 2017 11:45:05 +0000 From: Yoshihiro Shimoda To: CC: , , , Yoshihiro Shimoda Subject: [PATCH v2 1/3] usb: gadget: udc: add USB ID signal monitoring Date: Wed, 29 Mar 2017 20:42:52 +0900 Message-ID: <1490787774-5796-2-git-send-email-yoshihiro.shimoda.uh@renesas.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1490787774-5796-1-git-send-email-yoshihiro.shimoda.uh@renesas.com> References: <1490787774-5796-1-git-send-email-yoshihiro.shimoda.uh@renesas.com> MIME-Version: 1.0 X-Originating-IP: [211.11.155.144] X-ClientProxiedBy: TYXPR01CA0003.jpnprd01.prod.outlook.com (10.168.40.13) To SG2PR06MB1694.apcprd06.prod.outlook.com (10.167.82.136) X-MS-Office365-Filtering-Correlation-Id: 054a1e66-771c-44c8-56a5-08d476990b8e X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(48565401081)(201703131423075)(201703031133081); SRVR:SG2PR06MB1694; X-Microsoft-Exchange-Diagnostics: 1; SG2PR06MB1694; 3:eZ3XmxQOK6xqYNY04r/bvDwskTRe8J1I/1mBI5qMX2hEt9Xbxly4zzn7gu/qRMd60PbMOPlAItcToVSWebwimqFKCDPrFzdF8REKOPI7ATAcY6I5PW+kAw7jI+NKYVFYZeNfRQiaBQ2Rj8dy85Mqu5vUBJIZ25NZD7Wh24wjblotet+XyFYcGCIE0jux7MOR45t2Sh5hhNoCDTXfqJzLU/mnw6lsB1mf7mnZZquttdUf4I5OUiDnQi4JPjNUOOGgJxkWgXpycLAVrf/GzKd35DyUc6zlpEXkAyoO9MLJOVT6sZ9sRYy+lTOuIB/LzD3ea/fkTOLZex7XIR5g8+39bJVrD012MZUm1e5wYUi56Rk=; 25:BoTnKvOuoIG0lqN4Aw0kD9Kv2MFxjFc1l7i1NCZY41lDloOmjoQVN3RwSENtYzk0pZ1bLOQ+8YfNCNUhxD+RsTRphunae9N8bEEw4La9wyLlgxPgJ7yYTStIr3kIrb80PtSetSoqFfQ4A2jKku8AG+pl/rfOgBr4CBbrZxQnGQabx9oY3+BcmzFDOQ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X-Exchange-Antispam-Report-Test: UriScan:(72170088055959); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040450)(601004)(2401047)(8121501046)(5005006)(3002001)(10201501046)(93006041)(6055026)(6041248)(20161123562025)(20161123558025)(201703131423075)(201702281528075)(201703061421075)(201703061750075)(20161123560025)(20161123564025)(20161123555025)(6072148); SRVR:SG2PR06MB1694; BCL:0; PCL:0; RULEID:; SRVR:SG2PR06MB1694; X-Microsoft-Exchange-Diagnostics: 1; SG2PR06MB1694; 4:xQtNGKo7mpGD7pcyVSvQrCU2mOrx2RFl1NSC2faSMvS3Vagu/sYftEoGP2Gk0JcXJiNMWkCwF1X2jWFVsf63vDlKJ+GmmwPnax0tcYHMzpE/xW2YlSYV4rxG91aJgBogBSNcBA+rTtAODHQHGLycBVGR4rkgJ9Jvcav2QUxJgaxAwtcsjYAF2jW+EVXYlMWx9gmOm1LwZurLIVZiuYKrt2ZJp/TbPg1Qrv5El46QuaIKyhcIGxButFJxHRhxLGptOL4Tiy8fIRwM37gKcwgpGQ3W4BPbHpnG/TCxiJqbYit8971gx/v8dz0Np4ncO9a3YbXhTwx61OkGp8/DI6YLfLK8Lq9jLRxFRO4U3hyBNnPxwlPgweGJU7IHpom3On53NrPTSXNdP1uym4QTTejdh6BoD+J/KSsMsulbNl95guoSaf+jG7A32RgrP6nxgtiULmtnW6c3ZnmLooerN7oZariprRrukSEZ8xKD46ZALdxbwUwD5+hEvgH9EwzVtjNZBWf2VWWQyQ7tcJVEYQMVhbknObuKv2L/0V3zY49b+VOKPqn6dr+Q6QRNxvR54POokINcjN/FXD4IEsYTis6dizsQ5YMfYBgvDiw+mhMcrWhM88xKZVOH1GTUwjQg/0i0qKvgkFT95uEAFx9ImmN8ZxqLoXqpe8NX4ikalLqN3fmpjpOgHNkmCNR1qRJXJhuQuXIb6zQlclamDqc193ldYF+Xk76HGIEdbb5d9oGbK7Af03sODmsJTTRyPpoXQ/kBGXFAVdTK/4Ltmu5bS/0HvmVLCpPf8Z1JNbqx1oxcIZDGVxTR5sGfTYM8RmT6SdFpy+Ew5cAvxfPF0jHJDuCO9A== X-Forefront-PRVS: 0261CCEEDF X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(4630300001)(6069001)(6009001)(39860400002)(39410400002)(39850400002)(39840400002)(39400400002)(39450400003)(6506006)(6116002)(3846002)(2906002)(53936002)(6486002)(54906002)(48376002)(2950100002)(2351001)(42882006)(6916009)(5660300001)(7736002)(189998001)(305945005)(50226002)(42186005)(6512007)(6666003)(110136004)(38730400002)(76176999)(107886003)(33646002)(36756003)(47776003)(78352004)(50466002)(66066001)(8676002)(4326008)(81166006)(5003940100001)(25786009)(50986999); DIR:OUT; SFP:1102; SCL:1; SRVR:SG2PR06MB1694; H:localhost.localdomain; FPR:; SPF:None; MLV:ovrnspm; PTR:InfoNoRecords; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; SG2PR06MB1694; 23:9OUP0rSlEn2HtTRtpQwJ98TmfwMz4zt1RpfgiL2HR?= =?us-ascii?Q?YkwPchSmUoudeIFDRldJl08NfmMevbXGW8R1pG02EtMcm9xIxA7XHvHHJDTf?= =?us-ascii?Q?WnDTwm04Ygejln9nQ5G1CBpRmthSyG3uo+ZrD7/Lqb7qG1FjsTNWQeeVJNW8?= =?us-ascii?Q?o5QVQioKCdH00Rde3vM8KKJ4ydoDbVxwejmXJacNXUkV7RSDQXZjxb6g+u+h?= =?us-ascii?Q?PRrUN5ft2gaDysSCQdwCCRGk65nGLA3Phv1Bz2eBE+3yi8u+6cXKh38lLgm5?= =?us-ascii?Q?vs2G5DAGGCiBZ88wfM22Ap8zs2g5EQ4xW7bEwlR1Em3TKWuBgk1ZCMYjWoly?= =?us-ascii?Q?jVcuisEjKfGeI5ASjUwfhLNmQVn58tm/Sfn4rAkjUthHSg0fhaqbTPfI9HBT?= =?us-ascii?Q?OJDnCIdV/bLg64dlQqRJyM25Pj+rBjQ5CJnH2AX1TkJQcw1x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CooyN0p9m9YudGYY8EuZLaBps0f1zFYWZfQGOqrByoatmyONd8= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Mar 2017 11:45:05.6519 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: SG2PR06MB1694 Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This usb 3.0 peripheral controller has a register (USB_OTG_STA) to monitor the USB ID signal. So, this patch adds the ID signal monitoring to change the mode to host (A-Device) or peripheral (B-Device). Signed-off-by: Yoshihiro Shimoda --- drivers/usb/gadget/udc/renesas_usb3.c | 53 +++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/drivers/usb/gadget/udc/renesas_usb3.c b/drivers/usb/gadget/udc/renesas_usb3.c index 2218f91..dbef4b8 100644 --- a/drivers/usb/gadget/udc/renesas_usb3.c +++ b/drivers/usb/gadget/udc/renesas_usb3.c @@ -37,6 +37,9 @@ #define USB3_USB_INT_ENA_2 0x22c #define USB3_STUP_DAT_0 0x230 #define USB3_STUP_DAT_1 0x234 +#define USB3_USB_OTG_STA 0x268 +#define USB3_USB_OTG_INT_STA 0x26c +#define USB3_USB_OTG_INT_ENA 0x270 #define USB3_P0_MOD 0x280 #define USB3_P0_CON 0x288 #define USB3_P0_STA 0x28c @@ -124,6 +127,9 @@ /* USB_INT_ENA_2 and USB_INT_STA_2 */ #define USB_INT_2_PIPE(n) BIT(n) +/* USB_OTG_STA, USB_OTG_INT_STA and USB_OTG_INT_ENA */ +#define USB_OTG_IDMON BIT(4) + /* P0_MOD */ #define P0_MOD_DIR BIT(6) @@ -538,11 +544,39 @@ static void usb3_check_vbus(struct renesas_usb3 *usb3) } } +static void usb3_mode_a_host(struct renesas_usb3 *usb3) +{ + usb3_clear_bit(usb3, DRD_CON_PERI_CON, USB3_DRD_CON); + usb3_set_bit(usb3, DRD_CON_VBOUT, USB3_DRD_CON); +} + +static void usb3_mode_b_peri(struct renesas_usb3 *usb3) +{ + usb3_set_bit(usb3, DRD_CON_PERI_CON, USB3_DRD_CON); + usb3_clear_bit(usb3, DRD_CON_VBOUT, USB3_DRD_CON); +} + +static bool usb3_is_a_device(struct renesas_usb3 *usb3) +{ + return !(usb3_read(usb3, USB3_USB_OTG_STA) & USB_OTG_IDMON); +} + +static void usb3_check_id(struct renesas_usb3 *usb3) +{ + if (usb3_is_a_device(usb3)) + usb3_mode_a_host(usb3); + else + usb3_mode_b_peri(usb3); +} + static void renesas_usb3_init_controller(struct renesas_usb3 *usb3) { usb3_init_axi_bridge(usb3); usb3_init_epc_registers(usb3); + usb3_write(usb3, USB_OTG_IDMON, USB3_USB_OTG_INT_STA); + usb3_write(usb3, USB_OTG_IDMON, USB3_USB_OTG_INT_ENA); + usb3_check_id(usb3); usb3_check_vbus(usb3); } @@ -551,6 +585,7 @@ static void renesas_usb3_stop_controller(struct renesas_usb3 *usb3) usb3_disconnect(usb3); usb3_write(usb3, 0, USB3_P0_INT_ENA); usb3_write(usb3, 0, USB3_PN_INT_ENA); + usb3_write(usb3, 0, USB3_USB_OTG_INT_ENA); usb3_write(usb3, 0, USB3_USB_INT_ENA_1); usb3_write(usb3, 0, USB3_USB_INT_ENA_2); usb3_write(usb3, 0, USB3_AXI_INT_ENA); @@ -1474,10 +1509,22 @@ static void usb3_irq_epc_int_2(struct renesas_usb3 *usb3, u32 int_sta_2) } } +static void usb3_irq_idmon_change(struct renesas_usb3 *usb3) +{ + usb3_check_id(usb3); +} + +static void usb3_irq_otg_int(struct renesas_usb3 *usb3, u32 otg_int_sta) +{ + if (otg_int_sta & USB_OTG_IDMON) + usb3_irq_idmon_change(usb3); +} + static void usb3_irq_epc(struct renesas_usb3 *usb3) { u32 int_sta_1 = usb3_read(usb3, USB3_USB_INT_STA_1); u32 int_sta_2 = usb3_read(usb3, USB3_USB_INT_STA_2); + u32 otg_int_sta = usb3_read(usb3, USB3_USB_OTG_INT_STA); int_sta_1 &= usb3_read(usb3, USB3_USB_INT_ENA_1); if (int_sta_1) { @@ -1488,6 +1535,12 @@ static void usb3_irq_epc(struct renesas_usb3 *usb3) int_sta_2 &= usb3_read(usb3, USB3_USB_INT_ENA_2); if (int_sta_2) usb3_irq_epc_int_2(usb3, int_sta_2); + + otg_int_sta &= usb3_read(usb3, USB3_USB_OTG_INT_ENA); + if (otg_int_sta) { + usb3_write(usb3, otg_int_sta, USB3_USB_OTG_INT_STA); + usb3_irq_otg_int(usb3, otg_int_sta); + } } static irqreturn_t renesas_usb3_irq(int irq, void *_usb3)