From patchwork Thu Feb 27 23:05:01 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tao Ren X-Patchwork-Id: 204093 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0DF63C3F2C6 for ; Thu, 27 Feb 2020 23:05:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C417A2469D for ; Thu, 27 Feb 2020 23:05:49 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="DWvdFySm" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730118AbgB0XFU (ORCPT ); Thu, 27 Feb 2020 18:05:20 -0500 Received: from mail-pg1-f196.google.com ([209.85.215.196]:38564 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729656AbgB0XFT (ORCPT ); Thu, 27 Feb 2020 18:05:19 -0500 Received: by mail-pg1-f196.google.com with SMTP id d6so458796pgn.5; Thu, 27 Feb 2020 15:05:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=/6/5Jq8OX92b4HSNwKuaLqEuRxrbSYjBA5MrEijDT54=; b=DWvdFySm5O/Ij3fF20zWJZu4mrx+xEVpJuYsMloOUbcldQzIzUT8i21Py7kj3YqH9r h6C/hF+q841FVqXqlu81HDHicuIl5CEr7Y9MARaw8yf1AvTVKknjnt/5f4UsG1We8dh9 MiHGsVL/f+KYu2U7JUECo+Y7KrsSZbPG2Lvkz2W4QeDzOM2ZnpIgNjRtVOYLBrZU4Fsc Ufjj7nCsUkhW75vAEZClRrMO48Lm+cVJT5cVLCMP0SF9uCHvgcC4vNIk1SOOXcShNCK6 z5PdJplVKv8y4Bmxsxv5ewzjVnaPEr5QriP358ruaykqeObyYyIXCOPeYl+xj0EgfL4v yhRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=/6/5Jq8OX92b4HSNwKuaLqEuRxrbSYjBA5MrEijDT54=; b=W1AcmW+r3O00miM9Pk4OLcUtsoUWYWzxiu+rXUyXF9ZgriDy49WWLCV/U1AS+gOSpd ke7MyzY8+o563Nga1pvSeYnaZJOXHtV86eYxCVYEZ3JJS5gdls3W/1xhSUNe2yNGC2c7 unIvMtBS2gOT7iWisSsPGmNccudEYuF4M+sJzItp6a3T7bhcIOmQsNXzlNOMsXOqp/S8 nHU3TUo5OL5UQe3l328bYRQ/J6i6ibxNFAKmwxQ9Xl7yWsvzlaqhccHo6tGf4DuaSHU5 GlzdeFKcIvScGiHOuTS8Ma6wyZHR02ngxzvR/TUyH0YQOt4rUmpacKxWKL9EElAconPN Hzjw== X-Gm-Message-State: APjAAAXDwC0VWu2e8lfI5946XRDangdkAuC9F8OK0cDK5iAuDNJ7zrrk BzXW/mFRGBpCD6MNL39TuLA= X-Google-Smtp-Source: APXvYqz3DVM3OnkDUThhWnwP4pN5ZxKaxQKl7l+u0ECD+5kom/QMNC8W67pYN7UsiWXKk0UtP7t2Iw== X-Received: by 2002:a62:1883:: with SMTP id 125mr1342541pfy.166.1582844717409; Thu, 27 Feb 2020 15:05:17 -0800 (PST) Received: from taoren-ubuntu-R90MNF91.thefacebook.com ([2620:10d:c090:500::4:d8f5]) by smtp.gmail.com with ESMTPSA id w2sm8275975pfw.43.2020.02.27.15.05.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Feb 2020 15:05:17 -0800 (PST) From: rentao.bupt@gmail.com To: Felipe Balbi , Greg Kroah-Hartman , Joel Stanley , Andrew Jeffery , Benjamin Herrenschmidt , Chunfeng Yun , Colin Ian King , Stephen Boyd , Rob Herring , Mark Rutland , linux-usb@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-aspeed@lists.ozlabs.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, openbmc@lists.ozlabs.org, taoren@fb.com Cc: Tao Ren Subject: [PATCH v5 1/7] usb: gadget: aspeed: support per-vhub usb descriptors Date: Thu, 27 Feb 2020 15:05:01 -0800 Message-Id: <20200227230507.8682-2-rentao.bupt@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200227230507.8682-1-rentao.bupt@gmail.com> References: <20200227230507.8682-1-rentao.bupt@gmail.com> Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org From: Tao Ren This patch store vhub's standard usb descriptors in struct "ast_vhub" so it's more convenient to customize descriptors and potentially support multiple vhub instances in the future. Signed-off-by: Tao Ren Acked-by: Benjamin Herrenschmidt --- No change in v2/v3/v4/v5: - the patch is added to the patch series since v4. drivers/usb/gadget/udc/aspeed-vhub/hub.c | 43 ++++++++++++++++------- drivers/usb/gadget/udc/aspeed-vhub/vhub.h | 15 ++++++++ 2 files changed, 46 insertions(+), 12 deletions(-) diff --git a/drivers/usb/gadget/udc/aspeed-vhub/hub.c b/drivers/usb/gadget/udc/aspeed-vhub/hub.c index 19b3517e04c0..9c3027306b15 100644 --- a/drivers/usb/gadget/udc/aspeed-vhub/hub.c +++ b/drivers/usb/gadget/udc/aspeed-vhub/hub.c @@ -93,11 +93,7 @@ static void ast_vhub_patch_dev_desc_usb1(struct usb_device_descriptor *desc) USB_DT_INTERFACE_SIZE + \ USB_DT_ENDPOINT_SIZE) -static const struct ast_vhub_full_cdesc { - struct usb_config_descriptor cfg; - struct usb_interface_descriptor intf; - struct usb_endpoint_descriptor ep; -} __attribute__ ((packed)) ast_vhub_conf_desc = { +static const struct ast_vhub_full_cdesc ast_vhub_conf_desc = { .cfg = { .bLength = USB_DT_CONFIG_SIZE, .bDescriptorType = USB_DT_CONFIG, @@ -266,6 +262,7 @@ static int ast_vhub_rep_desc(struct ast_vhub_ep *ep, u8 desc_type, u16 len) { size_t dsize; + struct ast_vhub *vhub = ep->vhub; EPDBG(ep, "GET_DESCRIPTOR(type:%d)\n", desc_type); @@ -281,20 +278,20 @@ static int ast_vhub_rep_desc(struct ast_vhub_ep *ep, switch(desc_type) { case USB_DT_DEVICE: dsize = USB_DT_DEVICE_SIZE; - memcpy(ep->buf, &ast_vhub_dev_desc, dsize); - BUILD_BUG_ON(dsize > sizeof(ast_vhub_dev_desc)); + memcpy(ep->buf, &vhub->vhub_dev_desc, dsize); + BUILD_BUG_ON(dsize > sizeof(vhub->vhub_dev_desc)); BUILD_BUG_ON(USB_DT_DEVICE_SIZE >= AST_VHUB_EP0_MAX_PACKET); break; case USB_DT_CONFIG: dsize = AST_VHUB_CONF_DESC_SIZE; - memcpy(ep->buf, &ast_vhub_conf_desc, dsize); - BUILD_BUG_ON(dsize > sizeof(ast_vhub_conf_desc)); + memcpy(ep->buf, &vhub->vhub_conf_desc, dsize); + BUILD_BUG_ON(dsize > sizeof(vhub->vhub_conf_desc)); BUILD_BUG_ON(AST_VHUB_CONF_DESC_SIZE >= AST_VHUB_EP0_MAX_PACKET); break; case USB_DT_HUB: dsize = AST_VHUB_HUB_DESC_SIZE; - memcpy(ep->buf, &ast_vhub_hub_desc, dsize); - BUILD_BUG_ON(dsize > sizeof(ast_vhub_hub_desc)); + memcpy(ep->buf, &vhub->vhub_hub_desc, dsize); + BUILD_BUG_ON(dsize > sizeof(vhub->vhub_hub_desc)); BUILD_BUG_ON(AST_VHUB_HUB_DESC_SIZE >= AST_VHUB_EP0_MAX_PACKET); break; default: @@ -317,7 +314,8 @@ static int ast_vhub_rep_string(struct ast_vhub_ep *ep, u8 string_id, u16 lang_id, u16 len) { - int rc = usb_gadget_get_string (&ast_vhub_strings, string_id, ep->buf); + int rc = usb_gadget_get_string(&ep->vhub->vhub_str_desc, + string_id, ep->buf); /* * This should never happen unless we put too big strings in @@ -834,9 +832,30 @@ void ast_vhub_hub_reset(struct ast_vhub *vhub) writel(0, vhub->regs + AST_VHUB_EP1_STS_CHG); } +static void ast_vhub_init_desc(struct ast_vhub *vhub) +{ + /* Initialize vhub Device Descriptor. */ + memcpy(&vhub->vhub_dev_desc, &ast_vhub_dev_desc, + sizeof(vhub->vhub_dev_desc)); + + /* Initialize vhub Configuration Descriptor. */ + memcpy(&vhub->vhub_conf_desc, &ast_vhub_conf_desc, + sizeof(vhub->vhub_conf_desc)); + + /* Initialize vhub Hub Descriptor. */ + memcpy(&vhub->vhub_hub_desc, &ast_vhub_hub_desc, + sizeof(vhub->vhub_hub_desc)); + + /* Initialize vhub String Descriptors. */ + memcpy(&vhub->vhub_str_desc, &ast_vhub_strings, + sizeof(vhub->vhub_str_desc)); +} + void ast_vhub_init_hub(struct ast_vhub *vhub) { vhub->speed = USB_SPEED_UNKNOWN; INIT_WORK(&vhub->wake_work, ast_vhub_wake_work); + + ast_vhub_init_desc(vhub); } diff --git a/drivers/usb/gadget/udc/aspeed-vhub/vhub.h b/drivers/usb/gadget/udc/aspeed-vhub/vhub.h index 761919e220d3..191f9fae7420 100644 --- a/drivers/usb/gadget/udc/aspeed-vhub/vhub.h +++ b/drivers/usb/gadget/udc/aspeed-vhub/vhub.h @@ -2,6 +2,9 @@ #ifndef __ASPEED_VHUB_H #define __ASPEED_VHUB_H +#include +#include + /***************************** * * * VHUB register definitions * @@ -373,6 +376,12 @@ struct ast_vhub_port { struct ast_vhub_dev dev; }; +struct ast_vhub_full_cdesc { + struct usb_config_descriptor cfg; + struct usb_interface_descriptor intf; + struct usb_endpoint_descriptor ep; +} __packed; + /* Global vhub structure */ struct ast_vhub { struct platform_device *pdev; @@ -409,6 +418,12 @@ struct ast_vhub { /* Upstream bus speed captured at bus reset */ unsigned int speed; + + /* Standard USB Descriptors of the vhub. */ + struct usb_device_descriptor vhub_dev_desc; + struct ast_vhub_full_cdesc vhub_conf_desc; + struct usb_hub_descriptor vhub_hub_desc; + struct usb_gadget_strings vhub_str_desc; }; /* Standard request handlers result codes */ From patchwork Thu Feb 27 23:05:04 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tao Ren X-Patchwork-Id: 204094 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 57E88C3F2CB for ; Thu, 27 Feb 2020 23:05:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2D6DC24699 for ; Thu, 27 Feb 2020 23:05:46 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="HYWmfDre" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730435AbgB0XFl (ORCPT ); Thu, 27 Feb 2020 18:05:41 -0500 Received: from mail-pl1-f193.google.com ([209.85.214.193]:40826 "EHLO mail-pl1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729786AbgB0XFY (ORCPT ); Thu, 27 Feb 2020 18:05:24 -0500 Received: by mail-pl1-f193.google.com with SMTP id y1so415371plp.7; Thu, 27 Feb 2020 15:05:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=19Xkcz/2H7qw7NdRum+txTMYsSNMU8ssTmnGDdLyQzE=; b=HYWmfDreKAagDtTfzCvCE3tlM9ZiFz4+YpaXXD77EylMhM03FMpcAbda6nXMVkjrrU pz9GlPrziB2LoEQ6s73O3c/gJvIFHayLB0mragbmpeKRXQTlBPLsEdYQOkmZtg6SuPPW ZVC8lhzo+T/nAWVU4AQQnEp0Lmb8RfXMilfBpvkBZUCC7eAsN113YKs7JGc5amm0fiju n1PM/0Qmb8weImH0r+Pqch3Nqk39vWdCL1oOTqbYiVU7V64vh79ViP07yEc5J7WJjw8Q Md8oq1UUY0tA0wxW19mpFlWkqnx0CtrIhWFq5Jouu3vNp4BU5utZ9MqSeTg3MTOffxD/ 42WA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=19Xkcz/2H7qw7NdRum+txTMYsSNMU8ssTmnGDdLyQzE=; b=uYe3YMdG1WdgupiT3cQu4j+bdIzKg0MPq6+33Varl9CB0MZsMELXLuzswgrvMo9rAz k4KWjs3oije6vHHfVQtO/oFlzmafiPOoYuyprz7eQOAIL7hx/sc+nvR4FbCojJCrUg3B OfvGuQhbQBXyVm2eDRrTOKBqdS1GHTIu6c8/A1V7zc9dcvp928Ca3anxHj0Pksn+tbwP q9+UVt9NDpC2LhcK0ikxo7WxJYeKGel4Cl6FDwk1HrLLwvJ9Ed2n91lYuoUw1yu92hR1 bgeU1e2i7q2kyWZ/R4oEfxpkSRV9aMzByAQkPBqOPgMKT5g++srlWIIe6Iw1IJQlLfIh tBeQ== X-Gm-Message-State: APjAAAXMDVUiHtnYW9f+K8+d53c4RZVyQoR2HI7lWyjq3DPVJLf7lKl3 aBAi3LyZs6X2s81nQL4hl4Y= X-Google-Smtp-Source: APXvYqwaMyyWZohLLJCgnVR1nzQc5p/L96oyA99s9NZ7i/vWyQiAg0V2mpU/TCWnBSkf3jPwZ39cFA== X-Received: by 2002:a17:90a:8915:: with SMTP id u21mr1367639pjn.87.1582844722784; Thu, 27 Feb 2020 15:05:22 -0800 (PST) Received: from taoren-ubuntu-R90MNF91.thefacebook.com ([2620:10d:c090:500::4:d8f5]) by smtp.gmail.com with ESMTPSA id w2sm8275975pfw.43.2020.02.27.15.05.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Feb 2020 15:05:22 -0800 (PST) From: rentao.bupt@gmail.com To: Felipe Balbi , Greg Kroah-Hartman , Joel Stanley , Andrew Jeffery , Benjamin Herrenschmidt , Chunfeng Yun , Colin Ian King , Stephen Boyd , Rob Herring , Mark Rutland , linux-usb@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-aspeed@lists.ozlabs.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, openbmc@lists.ozlabs.org, taoren@fb.com Cc: Tao Ren Subject: [PATCH v5 4/7] ARM: dts: aspeed-g6: add usb functions Date: Thu, 27 Feb 2020 15:05:04 -0800 Message-Id: <20200227230507.8682-5-rentao.bupt@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200227230507.8682-1-rentao.bupt@gmail.com> References: <20200227230507.8682-1-rentao.bupt@gmail.com> Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org From: Tao Ren Add USB components and according pin groups in aspeed-g6 dtsi. Signed-off-by: Tao Ren Reviewed-by: Andrew Jeffery Acked-by: Benjamin Herrenschmidt Reviewed-by: Joel Stanley --- No change in v3/v4/v5. Changes in v2: - added port/endpoint properties for vhub dt node. arch/arm/boot/dts/aspeed-g6-pinctrl.dtsi | 25 +++++++++++++ arch/arm/boot/dts/aspeed-g6.dtsi | 45 ++++++++++++++++++++++++ 2 files changed, 70 insertions(+) diff --git a/arch/arm/boot/dts/aspeed-g6-pinctrl.dtsi b/arch/arm/boot/dts/aspeed-g6-pinctrl.dtsi index 045ce66ca876..7028e21bdd98 100644 --- a/arch/arm/boot/dts/aspeed-g6-pinctrl.dtsi +++ b/arch/arm/boot/dts/aspeed-g6-pinctrl.dtsi @@ -1112,6 +1112,31 @@ groups = "UART9"; }; + pinctrl_usb2ah_default: usb2ah_default { + function = "USB2AH"; + groups = "USBA"; + }; + + pinctrl_usb2ad_default: usb2ad_default { + function = "USB2AD"; + groups = "USBA"; + }; + + pinctrl_usb2bh_default: usb2bh_default { + function = "USB2BH"; + groups = "USBB"; + }; + + pinctrl_usb2bd_default: usb2bd_default { + function = "USB2BD"; + groups = "USBB"; + }; + + pinctrl_usb11bhid_default: usb11bhid_default { + function = "USB11BHID"; + groups = "USBB"; + }; + pinctrl_vb_default: vb_default { function = "VB"; groups = "VB"; diff --git a/arch/arm/boot/dts/aspeed-g6.dtsi b/arch/arm/boot/dts/aspeed-g6.dtsi index 796976d275e1..0a29b3b57a9d 100644 --- a/arch/arm/boot/dts/aspeed-g6.dtsi +++ b/arch/arm/boot/dts/aspeed-g6.dtsi @@ -245,6 +245,51 @@ status = "disabled"; }; + ehci0: usb@1e6a1000 { + compatible = "aspeed,ast2600-ehci", "generic-ehci"; + reg = <0x1e6a1000 0x100>; + interrupts = ; + clocks = <&syscon ASPEED_CLK_GATE_USBPORT1CLK>; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_usb2ah_default>; + status = "disabled"; + }; + + ehci1: usb@1e6a3000 { + compatible = "aspeed,ast2600-ehci", "generic-ehci"; + reg = <0x1e6a3000 0x100>; + interrupts = ; + clocks = <&syscon ASPEED_CLK_GATE_USBPORT2CLK>; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_usb2bh_default>; + status = "disabled"; + }; + + uhci: usb@1e6b0000 { + compatible = "aspeed,ast2600-uhci", "generic-uhci"; + reg = <0x1e6b0000 0x100>; + interrupts = ; + #ports = <2>; + clocks = <&syscon ASPEED_CLK_GATE_USBUHCICLK>; + status = "disabled"; + /* + * No default pinmux, it will follow EHCI, use an + * explicit pinmux override if EHCI is not enabled. + */ + }; + + vhub: usb-vhub@1e6a0000 { + compatible = "aspeed,ast2600-usb-vhub"; + reg = <0x1e6a0000 0x350>; + interrupts = ; + clocks = <&syscon ASPEED_CLK_GATE_USBPORT1CLK>; + aspeed,vhub-downstream-ports = <7>; + aspeed,vhub-generic-endpoints = <21>; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_usb2ad_default>; + status = "disabled"; + }; + apb { compatible = "simple-bus"; #address-cells = <1>; From patchwork Thu Feb 27 23:05:05 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tao Ren X-Patchwork-Id: 204095 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7FA08C3F2CB for ; Thu, 27 Feb 2020 23:05:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4E37C24699 for ; Thu, 27 Feb 2020 23:05:39 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="kXDz9qkp" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730330AbgB0XF0 (ORCPT ); Thu, 27 Feb 2020 18:05:26 -0500 Received: from mail-pl1-f196.google.com ([209.85.214.196]:40830 "EHLO mail-pl1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730324AbgB0XFZ (ORCPT ); Thu, 27 Feb 2020 18:05:25 -0500 Received: by mail-pl1-f196.google.com with SMTP id y1so415401plp.7; Thu, 27 Feb 2020 15:05:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=6ZPTBc16gsRgOtb4TnzocOZ8irwL4eMbyH66vQS/GYA=; b=kXDz9qkp6qs92/X6p/L9WmMF6gPd5XAV+dtAGFDrOEy9BrsrFN3gdjeWoMBAfSsN5g rFjD+rXGU//RVwilhjvoVKaVw54OFUEJb7vPoeVeogqSnFtpo14Mv2FwW/tr3Kc4QhiS qSA3dkK+gn0cpIFRXeBqpQ+o7QpUbDFF8LsPg0Soyp+KeL+A88eeyOQ/Ejc1KQX/7zqA mxmWOTjyjEO+LbGyQjJqZ13AZ6cP0bg9vT5qU4RS+eBHIeGoaFSyJefheYkfWA+GC9o7 k4bFt2X8UIKF8YA1FVZW5L+qk+LtfbA3dYqMKbp4XCcQuVNolALVXTSvDZYsMcqmNNrt 574Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=6ZPTBc16gsRgOtb4TnzocOZ8irwL4eMbyH66vQS/GYA=; b=mPfzlkIGzy0DGqke2F6caKcNTRfT+8JzmS/sL31QcPLH2bTPcl9i9u+/MzaS7A+nJX Omwa6cuTUZF46D1I8VnulffqXiZfnaqGucVwIQ653rQjm7ouo2qZ5o4ulRLL4wFy5ZuK Xmlet9YvmHEbVNeSub6v1yfpSObi0TeHLT4G93denOrGIlCBbChFS+saFMaZQcJ2jXR8 aEjkhaZeFAmewIMB4PBSSe1wvVI4415KPChHqjdUf/1Udszz3i+113U0V3xizt9+Zmdw hnmisy1TjlPsjbYqiuN1eu11uEUUG7dwPwEHa+/1Rk87G0J9DaUg5+lkBwCfBVrOzpXy oWDQ== X-Gm-Message-State: APjAAAVc96UHsGJ5NhlkUpOYpmT8vLI8v+MmO4py5FLH4+2sQ+r9YOzR ZVv2p/Doy+LgjgPuypxg9GA= X-Google-Smtp-Source: APXvYqwaQgE0kh+k6ox6GjNUfuX9eBxyJlL/7uMbDKwkNIQDzt5x2XGvHBsGHIJPgCu9HrHuIlE2Sw== X-Received: by 2002:a17:90a:8b82:: with SMTP id z2mr1395149pjn.59.1582844724422; Thu, 27 Feb 2020 15:05:24 -0800 (PST) Received: from taoren-ubuntu-R90MNF91.thefacebook.com ([2620:10d:c090:500::4:d8f5]) by smtp.gmail.com with ESMTPSA id w2sm8275975pfw.43.2020.02.27.15.05.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Feb 2020 15:05:24 -0800 (PST) From: rentao.bupt@gmail.com To: Felipe Balbi , Greg Kroah-Hartman , Joel Stanley , Andrew Jeffery , Benjamin Herrenschmidt , Chunfeng Yun , Colin Ian King , Stephen Boyd , Rob Herring , Mark Rutland , linux-usb@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-aspeed@lists.ozlabs.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, openbmc@lists.ozlabs.org, taoren@fb.com Cc: Tao Ren Subject: [PATCH v5 5/7] ARM: dts: aspeed-g5: add vhub port and endpoint properties Date: Thu, 27 Feb 2020 15:05:05 -0800 Message-Id: <20200227230507.8682-6-rentao.bupt@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200227230507.8682-1-rentao.bupt@gmail.com> References: <20200227230507.8682-1-rentao.bupt@gmail.com> Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org From: Tao Ren Add "aspeed,vhub-downstream-ports" and "aspeed,vhub-generic-endpoints" properties to describe supported number of vhub ports and endpoints. Signed-off-by: Tao Ren Acked-by: Benjamin Herrenschmidt Reviewed-by: Joel Stanley --- No change in v2/v3/v4/v5. - It's given v5 to align with the version of the patch series. arch/arm/boot/dts/aspeed-g5.dtsi | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/arm/boot/dts/aspeed-g5.dtsi b/arch/arm/boot/dts/aspeed-g5.dtsi index ebec0fa8baa7..f12ec04d3cbc 100644 --- a/arch/arm/boot/dts/aspeed-g5.dtsi +++ b/arch/arm/boot/dts/aspeed-g5.dtsi @@ -195,6 +195,8 @@ reg = <0x1e6a0000 0x300>; interrupts = <5>; clocks = <&syscon ASPEED_CLK_GATE_USBPORT1CLK>; + aspeed,vhub-downstream-ports = <5>; + aspeed,vhub-generic-endpoints = <15>; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_usb2ad_default>; status = "disabled"; From patchwork Thu Feb 27 23:05:07 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tao Ren X-Patchwork-Id: 204096 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7B9D9C3F2C6 for ; Thu, 27 Feb 2020 23:05:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4EBF324699 for ; Thu, 27 Feb 2020 23:05:30 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="bO5AUqx1" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730385AbgB0XF3 (ORCPT ); Thu, 27 Feb 2020 18:05:29 -0500 Received: from mail-pj1-f67.google.com ([209.85.216.67]:51586 "EHLO mail-pj1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730374AbgB0XF3 (ORCPT ); Thu, 27 Feb 2020 18:05:29 -0500 Received: by mail-pj1-f67.google.com with SMTP id fa20so433373pjb.1; Thu, 27 Feb 2020 15:05:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=FOie+PWiSZiMJEo9veE/haA09vAP/gyvQzP/mDUUeLo=; b=bO5AUqx1exL98VPqoOr9m2rBzqwx+JG6jnpcqWyILDxgpHRf9ZyyeJMEyJ9U1ayxHn 9juw1tR+uimsqKeNkLWZuoxdjCnRpdAjgKZfrwPUgSd+sxyGs9W67TF9JHGJgL//k3e+ i6kdkjOemNfRQI0DiVYX0rtXpXnRdhkChqzzyZQjz+Oa4TfRtJ05kgvekhiUc8x5n4Rf Rqckjln5HiyBQJ66PntsPedMg052N+nOwUDKD1ormFdLCA3PxkXbNymHnJOmuxF7mNit JKAN2R4bzJqsRyGmZ3366Dy0WF9zIUmbqXuEVJd5eQ7OHKECLEktI90Rd1v/zXQQHffG TUew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=FOie+PWiSZiMJEo9veE/haA09vAP/gyvQzP/mDUUeLo=; b=c91UwM9rsyGlIpv59BFhOmtm2+/KNnV5i3+lBwfuouKDwON659umgPckK5qPdSLEmq 73PvbpcOwVb6iFzBVZUlu007/oX1aUVZ6h5jRMnS0L4tSHB65PVWEmN3wzvd833ejU/q DvL1REABlSOrsgPcQJG2TLDSh1ffWtxHbntiRXDSce6K7C/I1h3McH5WnfPlorOIWuHl QC7Dw3BldznmwGfOROPXD+7kY0grq51vlCTmXsFk0j3MgLaYXWcZ/Gt2E5s/AClUttRr AbZX5tt6fyznUEGzNgU4RB7uhX4H5K5lUjr8tXCzo1q3lTHzRInDpx3UoLd1g7krZEsO I4uA== X-Gm-Message-State: APjAAAU+/Pn56syFKDXZ5bWjfSNyERvC4GtBDxq0raeqDh9YGBsH4NzB 0e7nxE3B7VuJXVcwJfGEMv8= X-Google-Smtp-Source: APXvYqxiM0Y8rvFyRXJfym2JxQVAYv9iF3d+OIytDy03RQI9STBUoMnSgqGcf++mM8Q/F4ywJd9n0Q== X-Received: by 2002:a17:902:6504:: with SMTP id b4mr1072914plk.291.1582844727819; Thu, 27 Feb 2020 15:05:27 -0800 (PST) Received: from taoren-ubuntu-R90MNF91.thefacebook.com ([2620:10d:c090:500::4:d8f5]) by smtp.gmail.com with ESMTPSA id w2sm8275975pfw.43.2020.02.27.15.05.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Feb 2020 15:05:27 -0800 (PST) From: rentao.bupt@gmail.com To: Felipe Balbi , Greg Kroah-Hartman , Joel Stanley , Andrew Jeffery , Benjamin Herrenschmidt , Chunfeng Yun , Colin Ian King , Stephen Boyd , Rob Herring , Mark Rutland , linux-usb@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-aspeed@lists.ozlabs.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, openbmc@lists.ozlabs.org, taoren@fb.com Cc: Tao Ren Subject: [PATCH v5 7/7] dt-bindings: usb: add documentation for aspeed usb-vhub Date: Thu, 27 Feb 2020 15:05:07 -0800 Message-Id: <20200227230507.8682-8-rentao.bupt@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200227230507.8682-1-rentao.bupt@gmail.com> References: <20200227230507.8682-1-rentao.bupt@gmail.com> Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org From: Tao Ren Add device tree binding documentation for the Aspeed USB 2.0 Virtual HUb Controller. Signed-off-by: Tao Ren Reviewed-by: Joel Stanley --- Changes in v5: - updated maintainer to Ben. - refined patch description per Joel's suggestion. No change in v2/v3/v4: - the patch is added to the patch series since v4. .../bindings/usb/aspeed,usb-vhub.yaml | 71 +++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 Documentation/devicetree/bindings/usb/aspeed,usb-vhub.yaml diff --git a/Documentation/devicetree/bindings/usb/aspeed,usb-vhub.yaml b/Documentation/devicetree/bindings/usb/aspeed,usb-vhub.yaml new file mode 100644 index 000000000000..b8b1700c2423 --- /dev/null +++ b/Documentation/devicetree/bindings/usb/aspeed,usb-vhub.yaml @@ -0,0 +1,71 @@ +# SPDX-License-Identifier: GPL-2.0-or-later +# Copyright (c) 2020 Facebook Inc. +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/usb/aspeed,usb-vhub.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: ASPEED USB 2.0 Virtual Hub Controller + +maintainers: + - Benjamin Herrenschmidt + +description: |+ + The ASPEED USB 2.0 Virtual Hub Controller implements 1 set of USB Hub + register and several sets of Device and Endpoint registers to support + the Virtual Hub's downstream USB devices. + + Supported number of devices and endpoints vary depending on hardware + revisions. AST2400 and AST2500 Virtual Hub supports 5 downstream devices + and 15 generic endpoints, while AST2600 Virtual Hub supports 7 downstream + devices and 21 generic endpoints. + +properties: + compatible: + enum: + - aspeed,ast2400-usb-vhub + - aspeed,ast2500-usb-vhub + - aspeed,ast2600-usb-vhub + + reg: + maxItems: 1 + description: Common configuration registers + + clocks: + maxItems: 1 + description: The Virtual Hub Controller clock gate + + interrupts: + maxItems: 1 + + aspeed,vhub-downstream-ports: + description: Number of downstream ports supported by the Virtual Hub + allOf: + - $ref: /schemas/types.yaml#/definitions/uint32 + + aspeed,vhub-generic-endpoints: + description: Number of generic endpoints supported by the Virtual Hub + allOf: + - $ref: /schemas/types.yaml#/definitions/uint32 + +required: + - compatible + - reg + - clocks + - interrupts + - aspeed,vhub-downstream-ports + - aspeed,vhub-generic-endpoints + +additionalProperties: false + +examples: + - | + #include + vhub: usb-vhub@1e6a0000 { + compatible = "aspeed,ast2500-usb-vhub"; + reg = <0x1e6a0000 0x300>; + interrupts = <5>; + clocks = <&syscon ASPEED_CLK_GATE_USBPORT1CLK>; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_usb2ad_default>; + };