From patchwork Thu Jul 23 18:48:57 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cristian Birsan X-Patchwork-Id: 11681537 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 61234138A for ; Thu, 23 Jul 2020 18:50:52 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 39600206D8 for ; Thu, 23 Jul 2020 18:50:52 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="AdZvzC+w"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=microchip.com header.i=@microchip.com header.b="SbxBnxPN" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 39600206D8 Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=microchip.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-ID:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=gNtq+nHJvKKuxDaS4FVZsyePupgrLH1+B396U3qvUvA=; b=AdZvzC+w0jYKBajucOLXIDwvm 03+3TCY46ziKFNYECYG8I54sduo78lCdVoUJaJtn0V1PD9R1uq0XS3R2eqRPogr8/kfbHCjqK2DbZ P/DCC6BfpSwe7s7pPZtjLvhJgElcC+nzo4oh+Dtd8kJa4x+H47waovU0rKgeVZVC8/MmeUai/6AM1 mJzqppiSuxZwMrvYOlkDXH95Y7/Exd6g4a34Ce6qlbelH8aBZygYr/mA62WKvqo+iXYlxjRkWl0VN c/pbyBXAmB+FhZwzITo+U54xS44wBGNldtoQ7s0AiTCdgEiR6TPkuHQJOsKAgcAu+ts9jboyTJsgO E4NbqxRvQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jygHT-0007yK-4E; Thu, 23 Jul 2020 18:49:23 +0000 Received: from esa6.microchip.iphmx.com ([216.71.154.253]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jygHM-0007vk-JE for linux-arm-kernel@lists.infradead.org; Thu, 23 Jul 2020 18:49:17 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1595530156; x=1627066156; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=OP/6x1FWBOWYFD0Vizy3q/OtdHKjms+2XnvxpxgJNsU=; b=SbxBnxPNnKV/t2rITq8C9/Ua3GFA9TPJtayg9xHnSV4SgFEl2ELPnA5S wrV9QfDmE6GXX+PE5NB31sPF32wYOhhB+vuQTKtI1B9FEgrxcMrjzd9O8 VcMvJv7IGAnnsMe9yAv54lCa4GSAipu9zLSxp5tGhezhCZ65pxdhc1rMz yBAyBMDDQZFbT2lfo+45kp/bXL99EYdaFDYUID8UKVm3QyPRrMnsRcPBp eb8TOfvu+SQs/zdJnIMwB+0Oz0e5P48+iXbuJxM8lAis3UMAAalOH7pVC AzWdktlp7mnrHhlHXAI7EbXfAa43RAoVXd/dL4Of5iJUX2KFmzgcHWJg4 A==; IronPort-SDR: sapuqCwlsZIVzl004MwFqSN4O56pfFH31ChOcjpIggQrPyfV+d2c9nkyaNlp3kYvggHpVRuIHu 4mIAUUnt2NJUWCgYvmyU3ibOiN+na9VLgnLWkeLIPSh2YfFyZYFcQ3mpgdfLCYFBDZWx+4zdCf WBJnohVFfP8J2QgWK57owwaqCoHnkaXPDJF9BTqCWbRRucYv2tValNG0KmMiWckxG3zvlmMytK dn9zF0GeUDxN4CFh5bpP9Dyd6cZC24DzFhV7XKwOWQ848RtlqT8GY0uLxM+wXZvuZTq0aNX8qU vjo= X-IronPort-AV: E=Sophos;i="5.75,387,1589266800"; d="scan'208";a="20343895" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa6.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 23 Jul 2020 11:49:14 -0700 Received: from chn-vm-ex01.mchp-main.com (10.10.85.143) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1979.3; Thu, 23 Jul 2020 11:49:15 -0700 Received: from cristi-P53.lan (10.10.115.15) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server id 15.1.1979.3 via Frontend Transport; Thu, 23 Jul 2020 11:48:32 -0700 From: To: , , , , , , , , , , Subject: [PATCH v4 1/6] usb: gadget: udc: atmel: use of_find_matching_node_and_match Date: Thu, 23 Jul 2020 21:48:57 +0300 Message-ID: <20200723184902.416705-2-cristian.birsan@microchip.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200723184902.416705-1-cristian.birsan@microchip.com> References: <20200723184902.416705-1-cristian.birsan@microchip.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200723_144916_811332_717D696F X-CRM114-Status: GOOD ( 10.50 ) X-Spam-Score: -2.5 (--) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-2.5 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [216.71.154.253 listed in wl.mailspike.net] -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [216.71.154.253 listed in list.dnswl.org] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Claudiu Beznea Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org From: Claudiu Beznea Instead of trying to match every possible compatible use of_find_matching_node_and_match() and pass the compatible array. Signed-off-by: Claudiu Beznea Signed-off-by: Cristian Birsan --- drivers/usb/gadget/udc/atmel_usba_udc.c | 26 ++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/drivers/usb/gadget/udc/atmel_usba_udc.c b/drivers/usb/gadget/udc/atmel_usba_udc.c index fa6793065c7c..4281242b5f9a 100644 --- a/drivers/usb/gadget/udc/atmel_usba_udc.c +++ b/drivers/usb/gadget/udc/atmel_usba_udc.c @@ -2112,11 +2112,19 @@ static const struct of_device_id atmel_udc_dt_ids[] = { MODULE_DEVICE_TABLE(of, atmel_udc_dt_ids); +static const struct of_device_id atmel_pmc_dt_ids[] = { + { .compatible = "atmel,at91sam9g45-pmc" }, + { .compatible = "atmel,at91sam9rl-pmc" }, + { .compatible = "atmel,at91sam9x5-pmc" }, + { /* sentinel */ } +}; + static struct usba_ep * atmel_udc_of_init(struct platform_device *pdev, struct usba_udc *udc) { struct device_node *np = pdev->dev.of_node; const struct of_device_id *match; + struct device_node *pp; int i, ret; struct usba_ep *eps, *ep; const struct usba_udc_config *udc_config; @@ -2127,13 +2135,17 @@ static struct usba_ep * atmel_udc_of_init(struct platform_device *pdev, udc_config = match->data; udc->errata = udc_config->errata; - udc->pmc = syscon_regmap_lookup_by_compatible("atmel,at91sam9g45-pmc"); - if (IS_ERR(udc->pmc)) - udc->pmc = syscon_regmap_lookup_by_compatible("atmel,at91sam9rl-pmc"); - if (IS_ERR(udc->pmc)) - udc->pmc = syscon_regmap_lookup_by_compatible("atmel,at91sam9x5-pmc"); - if (udc->errata && IS_ERR(udc->pmc)) - return ERR_CAST(udc->pmc); + if (udc->errata) { + pp = of_find_matching_node_and_match(NULL, atmel_pmc_dt_ids, + NULL); + if (!pp) + return ERR_PTR(-ENODEV); + + udc->pmc = syscon_node_to_regmap(pp); + of_node_put(pp); + if (IS_ERR(udc->pmc)) + return ERR_CAST(udc->pmc); + } udc->num_ep = 0; From patchwork Thu Jul 23 18:48:58 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cristian Birsan X-Patchwork-Id: 11681541 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 70D5F722 for ; Thu, 23 Jul 2020 18:51:04 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 47B0E20737 for ; Thu, 23 Jul 2020 18:51:04 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="k0Z0xn8J"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=microchip.com header.i=@microchip.com header.b="S2l+sa+q" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 47B0E20737 Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=microchip.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-ID:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=sspU/BcsLqtAskL2SyuGx2xOMbljOpSkX6acXGRMKz0=; b=k0Z0xn8JkWfvj/rKTHXsAchLE 3MWiNOjO4rdHl6sYY1O851X+Zjdcrv53VhMt9UI1iowJbRirag74Z46nb2INqgPhno+7RC8at0Xox m9WO4MRke3OBiIODW0QOjjk3j4lCxC0ddyuXk5+wi8i4XXKLKcYB7aTfBtW9/LsR+IZA91Q3+3i9t yBQh2NS3+v9ZSnj/jaZsgD6hU1nss0U/MdWaggeV1dsCSSiD+OwAzdrU/BP7riWZoLGkM1d65akCh yoHNIXxhW1ETw85Gg6bAOqplgBk6dX5gD/Miai2L64XIyuMS4FGLh6pgN7sEYZW0c4anXkep/I1Gl u1BFTvR4A==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jygHY-00080O-Hi; Thu, 23 Jul 2020 18:49:28 +0000 Received: from esa2.microchip.iphmx.com ([68.232.149.84]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jygHQ-0007xO-JR for linux-arm-kernel@lists.infradead.org; Thu, 23 Jul 2020 18:49:21 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1595530160; x=1627066160; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=JFzmp3IpT2/vSAdFB2tkC7kXSDjHPZkrYg58Jnu3Ns4=; b=S2l+sa+qOrSzci08fxILsheFp6a5E6PwxbP0DhPK9seITG+HH7KQ2P7X i9IFwGAc8mGrswcEHH8+GxPfXFyJZJyivbYob/xWLGOQ1IgJHVcyFfVQh YDbRt+ex5pxpwT2Ab7W4bdSP4I4GrXoqHDf8yIyu/Rx4l7nHQdXMhhMqT r8KGoO1LECCC8ikn+a5xufXQFO0TcvKTUkgAv+2tWi/w/eo0bq4jfBGw2 OSE2vWuhEt12cEyBUzu1eiCeR3XfzEe4WWLrAWiHT2sOr4ZQE/8t7lRVU +NXMgUR0YcpGU3rpBGxbsbFuciIELSnOrFJAZ+JoyKesm1ZsvLKIq0yRu Q==; IronPort-SDR: A+az9Wx44VjLI17HbHOrlcPhNWLu6gYHg9TdM5dwHpEc2DVyWnovX+RWQ92p3DHISlm6T/vm0g 5SObzmxXxew6cyoG+F9XIGumAj+lYuMfVJl2f3NawD5288htptFlX8+UT3y6pWdgCsNJ9j5sbw DnJYXCW01SlHvJxcXgYCD/I5+Awb87UjaTYU2wDj097rWOfLXgZ0n30WuKApurXMmM7coqHEYZ TK2a5HUz4LpqD2uBIeiPYrkLoMTDvqT3swCWwiA+52b1OhL1SVIsScMQjeB2mSIDL3qO1SkClE dpk= X-IronPort-AV: E=Sophos;i="5.75,387,1589266800"; d="scan'208";a="83047904" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa2.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 23 Jul 2020 11:49:18 -0700 Received: from chn-vm-ex01.mchp-main.com (10.10.85.143) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1979.3; Thu, 23 Jul 2020 11:49:18 -0700 Received: from cristi-P53.lan (10.10.115.15) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server id 15.1.1979.3 via Frontend Transport; Thu, 23 Jul 2020 11:48:35 -0700 From: To: , , , , , , , , , , Subject: [PATCH v4 2/6] dt-bindings: usb: atmel: Update DT bindings documentation for sam9x60 Date: Thu, 23 Jul 2020 21:48:58 +0300 Message-ID: <20200723184902.416705-3-cristian.birsan@microchip.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200723184902.416705-1-cristian.birsan@microchip.com> References: <20200723184902.416705-1-cristian.birsan@microchip.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200723_144920_816982_9F0E315C X-CRM114-Status: UNSURE ( 7.39 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.5 (--) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-2.5 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [68.232.149.84 listed in list.dnswl.org] 0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [68.232.149.84 listed in wl.mailspike.net] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.0 RCVD_IN_MSPIKE_WL Mailspike good senders X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Rob Herring , Cristian Birsan Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org From: Cristian Birsan Add sam9x60 binding. Signed-off-by: Cristian Birsan Acked-by: Rob Herring --- Documentation/devicetree/bindings/usb/atmel-usb.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/usb/atmel-usb.txt b/Documentation/devicetree/bindings/usb/atmel-usb.txt index 423b99a8fd97..a4002624ba14 100644 --- a/Documentation/devicetree/bindings/usb/atmel-usb.txt +++ b/Documentation/devicetree/bindings/usb/atmel-usb.txt @@ -82,6 +82,7 @@ Required properties: "atmel,at91sam9rl-udc" "atmel,at91sam9g45-udc" "atmel,sama5d3-udc" + "microchip,sam9x60-udc" - reg: Address and length of the register set for the device - interrupts: Should contain usba interrupt - clocks: Should reference the peripheral and host clocks From patchwork Thu Jul 23 18:48:59 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cristian Birsan X-Patchwork-Id: 11681543 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id EFA2C138A for ; Thu, 23 Jul 2020 18:51:06 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C61C720737 for ; Thu, 23 Jul 2020 18:51:06 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="jxJslPY8"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=microchip.com header.i=@microchip.com header.b="PNgaix/s" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C61C720737 Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=microchip.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-ID:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=n3sFDr4kAl/mH0LQWb3SLMYXG1vWd+xABvPuZgW4IGA=; b=jxJslPY8AKQbu9ZgCKMfICAK3 mrdEOpX1DB8GGUx+Sb2b77942gxYZYj3PDvmxqvxiduvYTXdYydhaeObwLwvC/ASUGMWUZZQAyRwE iQsvEWmSG5t3LDIpL5qQ97OrdJS1nrgYJcAo4FQjpxoVstCgQZ4p1IYQGZu8bAJuZzCjtb0TvOR3c 2rdLaPPMJ+gBSFVh+aceHTV77XfQtjAEACZc5y/azHRHjY9B5yOezjZEGDwqnB2O+nptOsF9KKz57 m0k6kbzE8EuC+oZBYYRQtwtrI+A4kqPQYAr3O7wiu3+aADtx6ijmoZgE4pfvk6wz9ch7f/BQZ2Gpc md7uIPhWw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jygHj-00084o-Pi; Thu, 23 Jul 2020 18:49:39 +0000 Received: from esa3.microchip.iphmx.com ([68.232.153.233]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jygHS-0007yB-MD for linux-arm-kernel@lists.infradead.org; Thu, 23 Jul 2020 18:49:23 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1595530162; x=1627066162; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=SFBqPVx3z2oefl/XszBXa42k1QB4gR4AFJGweDDyRZ0=; b=PNgaix/sqTetFu2PMYWHEr/ktHbwKu3bJChBG9jmwPy9X+VZDhO75b/I zqoNrHixlEApL8ACnH7H9SGtb0FQ7N1b2sUwBB/pUnk3CqJUtnyvDtT65 0tP2xaibisO5ue7Hkoeo+kq3Hj6RNPgyD1SCxBJ7gDif22rCnMF+QcnCH zwaHReu2E1eXLH2q5oSePl6RXRs8bIkf3C3n7raE1V7qTuYzSHqnNjq6W PkDisoh69Q9OxGfvv5+coWiNs9WJBDDm6aJg2Ch92uH8fvleL1hZNMss/ SMSG/WuJbFHn5YqCtdl6+WvZvNrLo5Z71r0YRiU2HI57xXXLoatZEFamU g==; IronPort-SDR: W3j+fOlYux1bqqgrwfYwhz1kYn2Sd2JfkKlwG5KMDpof5RbRS6EhGImHAbTeUWXccO/l+cTdYk XGuWJw0FVGfczDgX372ZzMnN9yiENJL4qdr/XpfsfAisTfpwIde2aObMJbTzFIf9mwyuAehDrI +Wpj3xXLUsswBL1coCCIh+f8Y2c3FAEyhk5WFY37ziqhJsYd6Y9jweUhhglpA0C4CbIQVjlOE5 8Nzx6VwyNN8QotfEaKc2ffHSwjBAJpNA+F21oY1JAbz6L5XdAIafCyRnfYsNs5QqAvxqdUQFlR lSA= X-IronPort-AV: E=Sophos;i="5.75,387,1589266800"; d="scan'208";a="85153682" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa3.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 23 Jul 2020 11:49:21 -0700 Received: from chn-vm-ex01.mchp-main.com (10.10.85.143) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1979.3; Thu, 23 Jul 2020 11:48:41 -0700 Received: from cristi-P53.lan (10.10.115.15) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server id 15.1.1979.3 via Frontend Transport; Thu, 23 Jul 2020 11:48:38 -0700 From: To: , , , , , , , , , , Subject: [PATCH v4 3/6] usb: gadget: udc: atmel: simplify endpoint allocation Date: Thu, 23 Jul 2020 21:48:59 +0300 Message-ID: <20200723184902.416705-4-cristian.birsan@microchip.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200723184902.416705-1-cristian.birsan@microchip.com> References: <20200723184902.416705-1-cristian.birsan@microchip.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200723_144922_920625_6A838A22 X-CRM114-Status: GOOD ( 10.40 ) X-Spam-Score: -2.5 (--) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-2.5 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 RCVD_IN_MSPIKE_H4 RBL: Very Good reputation (+4) [68.232.153.233 listed in wl.mailspike.net] -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [68.232.153.233 listed in list.dnswl.org] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.0 RCVD_IN_MSPIKE_WL Mailspike good senders X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Cristian Birsan Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org From: Cristian Birsan Simplify the endpoint allocation and cleanup the code. Signed-off-by: Cristian Birsan --- drivers/usb/gadget/udc/atmel_usba_udc.c | 21 ++++++++------------- drivers/usb/gadget/udc/atmel_usba_udc.h | 1 - 2 files changed, 8 insertions(+), 14 deletions(-) diff --git a/drivers/usb/gadget/udc/atmel_usba_udc.c b/drivers/usb/gadget/udc/atmel_usba_udc.c index 4281242b5f9a..10fa72ec8b79 100644 --- a/drivers/usb/gadget/udc/atmel_usba_udc.c +++ b/drivers/usb/gadget/udc/atmel_usba_udc.c @@ -1091,8 +1091,6 @@ static struct usb_ep *atmel_usba_match_ep(struct usb_gadget *gadget, USBA_BF(EPT_SIZE, fls(ep->fifo_size - 1) - 3); ep->ept_cfg |= USBA_BF(BK_NUMBER, ep->nr_banks); - - ep->udc->configured_ep++; } return _ep; @@ -1786,7 +1784,7 @@ static irqreturn_t usba_udc_irq(int irq, void *devid) if (status & USBA_END_OF_RESET) { struct usba_ep *ep0, *ep; - int i, n; + int i; usba_writel(udc, INT_CLR, USBA_END_OF_RESET|USBA_END_OF_RESUME @@ -1834,13 +1832,14 @@ static irqreturn_t usba_udc_irq(int irq, void *devid) "ODD: EP0 configuration is invalid!\n"); /* Preallocate other endpoints */ - n = fifo_mode ? udc->num_ep : udc->configured_ep; - for (i = 1; i < n; i++) { + for (i = 1; i < udc->num_ep; i++) { ep = &udc->usba_ep[i]; - usba_ep_writel(ep, CFG, ep->ept_cfg); - if (!(usba_ep_readl(ep, CFG) & USBA_EPT_MAPPED)) - dev_err(&udc->pdev->dev, - "ODD: EP%d configuration is invalid!\n", i); + if (ep->ep.claimed) { + usba_ep_writel(ep, CFG, ep->ept_cfg); + if (!(usba_ep_readl(ep, CFG) & USBA_EPT_MAPPED)) + dev_err(&udc->pdev->dev, + "ODD: EP%d configuration is invalid!\n", i); + } } } @@ -2025,9 +2024,6 @@ static int atmel_usba_stop(struct usb_gadget *gadget) if (udc->vbus_pin) disable_irq(gpiod_to_irq(udc->vbus_pin)); - if (fifo_mode == 0) - udc->configured_ep = 1; - udc->suspended = false; usba_stop(udc); @@ -2154,7 +2150,6 @@ static struct usba_ep * atmel_udc_of_init(struct platform_device *pdev, if (fifo_mode == 0) { udc->num_ep = udc_config->num_ep; - udc->configured_ep = 1; } else { udc->num_ep = usba_config_fifo_table(udc); } diff --git a/drivers/usb/gadget/udc/atmel_usba_udc.h b/drivers/usb/gadget/udc/atmel_usba_udc.h index 48e332439ed5..a9bf655eb513 100644 --- a/drivers/usb/gadget/udc/atmel_usba_udc.h +++ b/drivers/usb/gadget/udc/atmel_usba_udc.h @@ -336,7 +336,6 @@ struct usba_udc { int irq; struct gpio_desc *vbus_pin; int num_ep; - int configured_ep; struct usba_fifo_cfg *fifo_cfg; struct clk *pclk; struct clk *hclk; From patchwork Thu Jul 23 18:49:00 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cristian Birsan X-Patchwork-Id: 11681545 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D280F722 for ; Thu, 23 Jul 2020 18:51:17 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A968B206D8 for ; Thu, 23 Jul 2020 18:51:17 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="3QcQpTCJ"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=microchip.com header.i=@microchip.com header.b="YhcoKZnx" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A968B206D8 Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=microchip.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-ID:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=mRN40POO9bm88lDZQ5HjHA++XbmmYrpBGVgoUNyQycE=; b=3QcQpTCJz2WWDxdg8PkYH+Py8 7jGHDYDFHnz9C1nldXel97F+9leUsrPOf3yr2Z58XtzQk55MpDYK3sMchnvJUglLr8SnDI8Ciwnv4 6uFmK9BgAIRAwWftQPpSfqIxMDdzFvB/jifIZxtGoAwPRqPhljCer27LoyZX8NLmOqr4JoraE/ADU LWOWpO8Xey0DGjSQ69bcTVFvDEht2A8uX2bLBGtPp1E0rm7Q+Olj4ImlnKD5GV/asuIUyhJ9E0atu dZkDphfGMj61w1tPrFnMmiXwYjChjY+5Tls03HiKje+hwBu1e0jOQ1w/vw/5UNqi2Iz0gcPXmFoDi c41W+6WLQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jygHq-00086z-VS; Thu, 23 Jul 2020 18:49:47 +0000 Received: from esa3.microchip.iphmx.com ([68.232.153.233]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jygHV-0007yB-Mi for linux-arm-kernel@lists.infradead.org; Thu, 23 Jul 2020 18:49:26 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1595530165; x=1627066165; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=MnRMwgeR1VP4Ff/VfkHXb0v/p9CjQoRUD0iRNqINwto=; b=YhcoKZnx/5LUFpqFoWpbhM9gdNYpTb1yzKzxGOs/vczzirIzWcYOHSWR kR3847jVgcEf+9sc/KFEzjxL2gcjc0DZuZLA6QRQPUtPq0u51FZEbk9BB tTkKZT0cu9Q5a4v/zNKDdqhbDnLoGd1eQqyfjzWRcdWosbFUhlw77Rvqm Nya2kpJRmfIEXmuczFk9nXP2HGJVoAFLiIW/rmxnsSwkeyKEFgv5GFxWB zv3uSQgUC2BUdwTcAg5uJka9rgSUqevii6uDJ3GqiR9KdzIUIclvmerp+ t/FQjYLdvA5lUDEKdaLQqqFFST1fBL0omdq2rqP8/WPAUYGKdv2KcqK84 g==; IronPort-SDR: FHDKERzMy/NtMaEsyYOzB8X7FTf07smKJe9p31CtIMtWE3yULkLer6qhpO/N9on6vsdVT+NEII FAv+LGITudw6oTM7Lj7oWX0CALiv9JDBMvUKibOqXzIw8LodE/B44QYQaDGJylXi1ZYI6C6nXf YXIey+X2qeC9GnQoNudrhTRrLZ3gFXply83Cf2Yz/iS/slpQujv9H9q3/sPFYjZy/9vtCjAr3F Bfr7rFxx9ZS1m0x1UAvVTdPKTl5i8Z//UTW5Qc5NRGsCVhLAW5fPn8N3ordja2bwV3YwjYgYub A7A= X-IronPort-AV: E=Sophos;i="5.75,387,1589266800"; d="scan'208";a="85153693" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa3.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 23 Jul 2020 11:49:25 -0700 Received: from chn-vm-ex01.mchp-main.com (10.10.85.143) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1979.3; Thu, 23 Jul 2020 11:48:45 -0700 Received: from cristi-P53.lan (10.10.115.15) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server id 15.1.1979.3 via Frontend Transport; Thu, 23 Jul 2020 11:48:41 -0700 From: To: , , , , , , , , , , Subject: [PATCH v4 4/6] usb: gadget: udc: atmel: use 1 bank endpoints for control transfers Date: Thu, 23 Jul 2020 21:49:00 +0300 Message-ID: <20200723184902.416705-5-cristian.birsan@microchip.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200723184902.416705-1-cristian.birsan@microchip.com> References: <20200723184902.416705-1-cristian.birsan@microchip.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200723_144925_936545_F907DB90 X-CRM114-Status: UNSURE ( 7.13 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.5 (--) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-2.5 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 RCVD_IN_MSPIKE_H4 RBL: Very Good reputation (+4) [68.232.153.233 listed in wl.mailspike.net] -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [68.232.153.233 listed in list.dnswl.org] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.0 RCVD_IN_MSPIKE_WL Mailspike good senders X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Cristian Birsan Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org From: Cristian Birsan Use 1 bank endpoints for control transfers Signed-off-by: Cristian Birsan --- drivers/usb/gadget/udc/atmel_usba_udc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/usb/gadget/udc/atmel_usba_udc.c b/drivers/usb/gadget/udc/atmel_usba_udc.c index 10fa72ec8b79..59b200e32784 100644 --- a/drivers/usb/gadget/udc/atmel_usba_udc.c +++ b/drivers/usb/gadget/udc/atmel_usba_udc.c @@ -1056,6 +1056,7 @@ static struct usb_ep *atmel_usba_match_ep(struct usb_gadget *gadget, switch (usb_endpoint_type(desc)) { case USB_ENDPOINT_XFER_CONTROL: + ep->nr_banks = 1; break; case USB_ENDPOINT_XFER_ISOC: From patchwork Thu Jul 23 18:49:01 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cristian Birsan X-Patchwork-Id: 11681547 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7ACBD138A for ; Thu, 23 Jul 2020 18:51:20 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 52ACD206D8 for ; Thu, 23 Jul 2020 18:51:20 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="BriQJE+D"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=microchip.com header.i=@microchip.com header.b="jrldu8gH" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 52ACD206D8 Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=microchip.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-ID:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=9VBHpFy+X5iHVBO7rlk7UKX4ZN73zcHphNWgOG42Izg=; b=BriQJE+Dg12YfnrHcb7EMIvnr 6vtsvKF2Kls9dOQBUisXE2zQLOTXgZe1QmppmjYoa1HuEAc52l9rjudvvPN0fh0f+QoijD6EV4x8K HLmwwxQNVCcx6VyfcL1tHILJFyYsQJoTUflXC2vF+MB/Rgj3qdN/KaNgvLC6lYwqR4o6jrjrhPwUX dLQkmPhSEZyW67Bx+yVnm7jm/WpxNBs59S9aNKrJB30sYFjwKf7u2JzTytsKqFvBpt5gkNZskWXOO WNYTsX6xqaksWFg9DMdkp+z0roT5pEqha+ZTL5A0hDRrr3AM7nN5rwex/PT7eTpiWvrpR8hfxK64C EB00unvNA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jygHw-00088r-M7; Thu, 23 Jul 2020 18:49:52 +0000 Received: from esa1.microchip.iphmx.com ([68.232.147.91]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jygHa-00081C-2z for linux-arm-kernel@lists.infradead.org; Thu, 23 Jul 2020 18:49:31 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1595530169; x=1627066169; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=hVDaVBYeK4hiHue2uCcOKHrWDPhrT7DNvz7pYE1XNno=; b=jrldu8gHKA9CTIfh9dWSaz0xOPW/B1D8yoeUWjShPkYc3rRlfb/jcQBg 177BTUGX4WGAAqWB0JmSRmpXAkGGmJz/5vAV0p4eo5Hgk8eb9jN8wK0bJ 7SCX54UJFnkc5KsS3Ga/8ngqheVMiZ+NrsTE7umZRu7Qk9iIkbqM3ZUqf Um+KG5h5znBROqd5DzPFKnhvMoRpdFf5tOc+pwij8Mgu3FgO77Dxt8ctz S12TCo/j2rPtvhIgTSntVyG81+hHYAphbMEAEzrxb2R04F1KscTo7WUP1 MVLi21mWR5/a2MlceqOMbFvDR90U8RE98K3ftkE82uhddANSUg9p0W2Md g==; IronPort-SDR: oLhhq9/CjdGL6l9gEaoiY1XHoOk0y2MSqqKLK6rukFlW4lBYIrSX4pfHQh8Za2OLGrwjx1anZn bk1dj2HGkmNughqykXxVSlksTFUqwhOSvxzhNtaCeVBJ7gfpzgXuGRuvuPJbWwf9wctpQTpHIk TdSucH5S9fnnWTdk38GPAe08WB1isOjBj+lrdIUac/nvjCPROHAA5Aytov9rBMFKvsr1mEiev8 kTyynnlKdiruNAEjzMMOktUk/UD7ZAzWPJNL/WA5MKo2n9o9NCjIJAzpCVeP8bZBcP8UZsk5Jg qpc= X-IronPort-AV: E=Sophos;i="5.75,387,1589266800"; d="scan'208";a="88872127" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa1.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 23 Jul 2020 11:49:27 -0700 Received: from chn-vm-ex01.mchp-main.com (10.10.85.143) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1979.3; Thu, 23 Jul 2020 11:49:28 -0700 Received: from cristi-P53.lan (10.10.115.15) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server id 15.1.1979.3 via Frontend Transport; Thu, 23 Jul 2020 11:48:45 -0700 From: To: , , , , , , , , , , Subject: [PATCH v4 5/6] usb: gadget: udc: atmel: update endpoint allocation for sam9x60 Date: Thu, 23 Jul 2020 21:49:01 +0300 Message-ID: <20200723184902.416705-6-cristian.birsan@microchip.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200723184902.416705-1-cristian.birsan@microchip.com> References: <20200723184902.416705-1-cristian.birsan@microchip.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200723_144930_660716_C5B4190C X-CRM114-Status: GOOD ( 11.99 ) X-Spam-Score: -2.5 (--) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-2.5 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [68.232.147.91 listed in list.dnswl.org] 0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [68.232.147.91 listed in wl.mailspike.net] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.0 RCVD_IN_MSPIKE_WL Mailspike good senders X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Cristian Birsan Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org From: Cristian Birsan The DPRAM memory from the USB High Speed Device Port (UDPHS) hardware block was increased. This patch updates the endpoint allocation for sam9x60 to take advantage of this larger memory. At the same time the constraint to allocate the endpoints in order was lifted. To handle old and new hardware in the same driver the ep_prealloc was added. Signed-off-by: Cristian Birsan --- drivers/usb/gadget/udc/atmel_usba_udc.c | 20 +++++++++++++++++--- drivers/usb/gadget/udc/atmel_usba_udc.h | 2 ++ 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/drivers/usb/gadget/udc/atmel_usba_udc.c b/drivers/usb/gadget/udc/atmel_usba_udc.c index 59b200e32784..80a96aceb219 100644 --- a/drivers/usb/gadget/udc/atmel_usba_udc.c +++ b/drivers/usb/gadget/udc/atmel_usba_udc.c @@ -1061,12 +1061,14 @@ static struct usb_ep *atmel_usba_match_ep(struct usb_gadget *gadget, case USB_ENDPOINT_XFER_ISOC: ep->fifo_size = 1024; - ep->nr_banks = 2; + if (ep->udc->ep_prealloc) + ep->nr_banks = 2; break; case USB_ENDPOINT_XFER_BULK: ep->fifo_size = 512; - ep->nr_banks = 1; + if (ep->udc->ep_prealloc) + ep->nr_banks = 1; break; case USB_ENDPOINT_XFER_INT: @@ -1076,7 +1078,8 @@ static struct usb_ep *atmel_usba_match_ep(struct usb_gadget *gadget, else ep->fifo_size = roundup_pow_of_two(le16_to_cpu(desc->wMaxPacketSize)); - ep->nr_banks = 1; + if (ep->udc->ep_prealloc) + ep->nr_banks = 1; break; } @@ -2087,23 +2090,33 @@ static const struct usba_udc_config udc_at91sam9rl_cfg = { .errata = &at91sam9rl_errata, .config = ep_config_sam9, .num_ep = ARRAY_SIZE(ep_config_sam9), + .ep_prealloc = true, }; static const struct usba_udc_config udc_at91sam9g45_cfg = { .errata = &at91sam9g45_errata, .config = ep_config_sam9, .num_ep = ARRAY_SIZE(ep_config_sam9), + .ep_prealloc = true, }; static const struct usba_udc_config udc_sama5d3_cfg = { .config = ep_config_sama5, .num_ep = ARRAY_SIZE(ep_config_sama5), + .ep_prealloc = true, +}; + +static const struct usba_udc_config udc_sam9x60_cfg = { + .num_ep = ARRAY_SIZE(ep_config_sam9), + .config = ep_config_sam9, + .ep_prealloc = false, }; static const struct of_device_id atmel_udc_dt_ids[] = { { .compatible = "atmel,at91sam9rl-udc", .data = &udc_at91sam9rl_cfg }, { .compatible = "atmel,at91sam9g45-udc", .data = &udc_at91sam9g45_cfg }, { .compatible = "atmel,sama5d3-udc", .data = &udc_sama5d3_cfg }, + { .compatible = "microchip,sam9x60-udc", .data = &udc_sam9x60_cfg }, { /* sentinel */ } }; @@ -2131,6 +2144,7 @@ static struct usba_ep * atmel_udc_of_init(struct platform_device *pdev, return ERR_PTR(-EINVAL); udc_config = match->data; + udc->ep_prealloc = udc_config->ep_prealloc; udc->errata = udc_config->errata; if (udc->errata) { pp = of_find_matching_node_and_match(NULL, atmel_pmc_dt_ids, diff --git a/drivers/usb/gadget/udc/atmel_usba_udc.h b/drivers/usb/gadget/udc/atmel_usba_udc.h index a9bf655eb513..620472f218bc 100644 --- a/drivers/usb/gadget/udc/atmel_usba_udc.h +++ b/drivers/usb/gadget/udc/atmel_usba_udc.h @@ -317,6 +317,7 @@ struct usba_udc_config { const struct usba_udc_errata *errata; const struct usba_ep_config *config; const int num_ep; + const bool ep_prealloc; }; struct usba_udc { @@ -343,6 +344,7 @@ struct usba_udc { bool bias_pulse_needed; bool clocked; bool suspended; + bool ep_prealloc; u16 devstatus; From patchwork Thu Jul 23 18:49:02 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cristian Birsan X-Patchwork-Id: 11681549 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B08CA722 for ; Thu, 23 Jul 2020 18:51:23 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7D5F0206D8 for ; Thu, 23 Jul 2020 18:51:23 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="SGvsfsVW"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=microchip.com header.i=@microchip.com header.b="u0xrfn/F" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7D5F0206D8 Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=microchip.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-ID:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=FNgrVkPYSG/M+a83BQD69l21vxBocBJAht9BfvbDNoQ=; b=SGvsfsVWl7GNeFUSvRaxyC+aZ 4yuOED9xymYWIhHi1xtDsBT6x34/Yvxsc69Dt4IMeimP+1tIDh5iAWANBDjlkRgdor9X1aookXN9I pZxrGnUsY97GJ+TbQ26va1hOvVo2N+JL34wD/xcvMv8Q20XLIiamn60LIcceL8MWkb/JSXfZDfJl6 BVD6AemyoR2QajCtYrALJny4rj+Zg+4xnB1bPf6ue+Idgxd2O0xLWIFWSZ6sxODJO7VgD020utHhT N51Jv2XrbhqpVKaMEO/5crF7Cas1ocATFtliblVudOF6UDxEmbOeD2gJ3FdShMYgVCyFd9Yq9ISZa tpVwKhJ1A==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jygI7-0008BM-Qc; Thu, 23 Jul 2020 18:50:03 +0000 Received: from esa6.microchip.iphmx.com ([216.71.154.253]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jygHc-000826-DA for linux-arm-kernel@lists.infradead.org; Thu, 23 Jul 2020 18:49:34 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1595530172; x=1627066172; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=AQ4wWOdIKVge/cPSYMb3D9ty6S2PPK3wNKVv4CCqRH8=; b=u0xrfn/FCR9HKE6mdDwhYp+Qy3aHUpkwL5jP/0wK8KvdaWobLarY5PlT eBio3Xk5zosf15H3C/roMjJEEihCCJxMYZjv6Hoiz3Fz394KMtm7I9G6M XGIB/k9lgyTyS3Aww4U8gR7ewk1DENp9WuJTk7dRFr5L1Y/MJS0v8AYX/ 5Z0rFLwSaLUjvEJ7xynSDfx4TMhSIR6qTJWDOxr237vZxxKmmYAGhWbwb lYt9JYL13PaDMalL9gfz3QwuO6fGTJJodfMiUz7T/2NGsp5H1iEEAV3US CygoKAN06TmZn3Z7vqCuScidHrRVLjHSj8TaaFHk1dPIEMDx99pQcs7cb A==; IronPort-SDR: AknoA4nJgGPw2/qOV9+YdphM4AjkYFphUHb4J3gNAxDTvR9kOJtGqKbPbDe5R9/Z5F/t1xlSoM Ot4gecwg9aLUaTNOGYRyvKgxAcaXBb6o/zzDq8s0FNEKjADYrxZvH0rXqg/G9Y19txZSDnrfRr HPFhGM/oupWzH7pYUKVQKLwnArBtvF81bYJc1pEycPguJltK9lA4ksmaT7fuW+wMYJijY8oesP nMPMvoLoLPuoDf5JUium4AmA4LJXTWQK43t1mQsbOU1pVb8ydEruOyVlvswXcbYHAbCc9+F1Wg xcg= X-IronPort-AV: E=Sophos;i="5.75,387,1589266800"; d="scan'208";a="20343958" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa6.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 23 Jul 2020 11:49:31 -0700 Received: from chn-vm-ex01.mchp-main.com (10.10.85.143) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1979.3; Thu, 23 Jul 2020 11:49:31 -0700 Received: from cristi-P53.lan (10.10.115.15) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server id 15.1.1979.3 via Frontend Transport; Thu, 23 Jul 2020 11:48:48 -0700 From: To: , , , , , , , , , , Subject: [PATCH v4 6/6] ARM: dts: at91: sam9x60ek: enable usb device Date: Thu, 23 Jul 2020 21:49:02 +0300 Message-ID: <20200723184902.416705-7-cristian.birsan@microchip.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200723184902.416705-1-cristian.birsan@microchip.com> References: <20200723184902.416705-1-cristian.birsan@microchip.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200723_144932_716863_9DC71B44 X-CRM114-Status: UNSURE ( 7.20 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.5 (--) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-2.5 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [216.71.154.253 listed in wl.mailspike.net] -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [216.71.154.253 listed in list.dnswl.org] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Cristian Birsan Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org From: Cristian Birsan Enable usb device for sam9x60ek board. Signed-off-by: Cristian Birsan --- arch/arm/boot/dts/at91-sam9x60ek.dts | 13 +++++++++++++ arch/arm/boot/dts/sam9x60.dtsi | 14 ++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/arch/arm/boot/dts/at91-sam9x60ek.dts b/arch/arm/boot/dts/at91-sam9x60ek.dts index a5f5718c711a..984cf596dfe9 100644 --- a/arch/arm/boot/dts/at91-sam9x60ek.dts +++ b/arch/arm/boot/dts/at91-sam9x60ek.dts @@ -559,6 +559,12 @@ pinctrl_key_gpio_default: pinctrl_key_gpio { atmel,pins = ; }; }; + + usb0 { + pinctrl_usba_vbus: usba_vbus { + atmel,pins = ; + }; + }; }; /* pinctrl */ &pmc { @@ -657,6 +663,13 @@ timer1: timer@1 { }; }; +&usb0 { + atmel,vbus-gpio = <&pioB 16 GPIO_ACTIVE_HIGH>; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_usba_vbus>; + status = "okay"; +}; + &usb1 { num-ports = <3>; atmel,vbus-gpio = <0 diff --git a/arch/arm/boot/dts/sam9x60.dtsi b/arch/arm/boot/dts/sam9x60.dtsi index 6763423d64b8..ef0ef8625f25 100644 --- a/arch/arm/boot/dts/sam9x60.dtsi +++ b/arch/arm/boot/dts/sam9x60.dtsi @@ -69,6 +69,20 @@ ahb { #size-cells = <1>; ranges; + usb0: gadget@500000 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "microchip,sam9x60-udc"; + reg = <0x00500000 0x100000 + 0xf803c000 0x400>; + interrupts = <23 IRQ_TYPE_LEVEL_HIGH 2>; + clocks = <&pmc PMC_TYPE_PERIPHERAL 23>, <&pmc PMC_TYPE_CORE PMC_UTMI>; + clock-names = "pclk", "hclk"; + assigned-clocks = <&pmc PMC_TYPE_CORE PMC_UTMI>; + assigned-clock-rates = <480000000>; + status = "disabled"; + }; + usb1: ohci@600000 { compatible = "atmel,at91rm9200-ohci", "usb-ohci"; reg = <0x00600000 0x100000>;