Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 49B02C7EE23 for ; Tue, 30 May 2023 10:27:16 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 6B22A85F01; Tue, 30 May 2023 12:26:40 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=reject dis=none) header.from=kwiboo.se Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=kwiboo.se header.i=@kwiboo.se header.b="EN0zFHn9"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 732888215F; Tue, 30 May 2023 12:26:30 +0200 (CEST) Received: from s.wrqvtbkv.outbound-mail.sendgrid.net (s.wrqvtbkv.outbound-mail.sendgrid.net [149.72.123.24]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 43B5C85F22 for ; Tue, 30 May 2023 12:26:25 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=reject dis=none) header.from=kwiboo.se Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=bounces+31435339-7456-u-boot=lists.denx.de@em2124.kwiboo.se DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kwiboo.se; h=from:subject:in-reply-to:references:mime-version:to:cc: content-transfer-encoding:content-type:cc:content-type:from:subject:to; s=s1; bh=yMz3bduzWZb13QF3zmEeYawnGwkyzbs5S0iQXKHe5t4=; b=EN0zFHn9k31u9KYm7MJJ32yzmRioBGTKPdeo22w9UHf9xImwSjtZbl39SUDTdOuBWHr2 SFSw6tKSIMXXMxWg59QAjMX6hvkvf6gvwlozXwVlMX160T+K+JQCzV37V3/nryS26nXyMH 6Sxtn8guz6EqjMozZ7+lPFNMn4RkMc/2w3CK6vg9LZJND+CRRUet0BCpOYdnD0dJ+UVc6A 41DtL8RLcHQjSQJOO60ZSjyR62ZcYI7FrULVW4DRLtcGqGY27Yz7Bn/2ar0jdLe4Y2YdWu MsIiR1YvYR0gs3rEbQuadsymnM1cbebVKrb9DHA/YAc5M85RkojxYopPkTbfZqNQ== Received: by filterdrecv-d7bbbc8bf-zf9x9 with SMTP id filterdrecv-d7bbbc8bf-zf9x9-1-6475CF4F-17 2023-05-30 10:26:23.614353893 +0000 UTC m=+1680391.412183606 Received: from bionic.localdomain (unknown) by geopod-ismtpd-4 (SG) with ESMTP id -9zDdwXmTcyQ6l65vAHNfQ Tue, 30 May 2023 10:26:23.376 +0000 (UTC) From: Jonas Karlman Subject: [PATCH 3/5] usb: dwc3-generic: Relax unsupported dr_mode check Date: Tue, 30 May 2023 10:26:23 +0000 (UTC) Message-Id: <20230530102617.3413183-4-jonas@kwiboo.se> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230530102617.3413183-1-jonas@kwiboo.se> References: <20230530102617.3413183-1-jonas@kwiboo.se> MIME-Version: 1.0 X-SG-EID: =?us-ascii?Q?TdbjyGynYnRZWhH+7lKUQJL+ZxmxpowvO2O9SQF5CwCVrYgcwUXgU5DKUU3QxA?= =?us-ascii?Q?fZekEeQsTe+RrMu3cja6a0h6t=2FGTn5umONNXK7b?= =?us-ascii?Q?oNtGkQMWS4GB4N33Nz6oCTbOg9D+1WaEFoOj8QN?= =?us-ascii?Q?WGAxWiBurlD31IMb0WtyPw4nhs73lOXfvJJL3bQ?= =?us-ascii?Q?CPRJFcGpn2KWih5jDZYGzXy2o6dNN0XXxQtrxhp?= =?us-ascii?Q?ZrMDXtRxkPfo8OOlwnschgxh9tSA4Py7Cd51i+?= To: Kever Yang , Simon Glass , Philipp Tomsich , Marek Vasut Cc: Jonas Karlman , Akash Gajjar , Jagan Teki , FUKAUMI Naoki , u-boot@lists.denx.de X-Entity-ID: P7KYpSJvGCELWjBME/J5tg== Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean When dr_mode is peripheral or otg and U-Boot has not been built with DM_USB_GADGET support, booting such device may end up with: dwc3_glue_bind_common: subnode name: usb@fcc00000 Error binding driver 'dwc3-generic-wrapper': -6 Some drivers failed to bind initcall sequence 00000000effbca08 failed at call 0000000000a217c8 (err=-6) ### ERROR ### Please RESET the board ### Instead fail gracfully with ENODEV to allow board continue booting. dwc3_glue_bind_common: subnode name: usb@fcc00000 dwc3_glue_bind_common: unsupported dr_mode Signed-off-by: Jonas Karlman --- drivers/usb/dwc3/dwc3-generic.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/usb/dwc3/dwc3-generic.c b/drivers/usb/dwc3/dwc3-generic.c index c28ad47bddd8..f7859a530280 100644 --- a/drivers/usb/dwc3/dwc3-generic.c +++ b/drivers/usb/dwc3/dwc3-generic.c @@ -422,13 +422,13 @@ static int dwc3_glue_bind_common(struct udevice *parent, ofnode node) dr_mode = usb_get_dr_mode(node); switch (dr_mode) { +#if CONFIG_IS_ENABLED(DM_USB_GADGET) case USB_DR_MODE_PERIPHERAL: case USB_DR_MODE_OTG: -#if CONFIG_IS_ENABLED(DM_USB_GADGET) debug("%s: dr_mode: OTG or Peripheral\n", __func__); driver = "dwc3-generic-peripheral"; -#endif break; +#endif #if defined(CONFIG_SPL_USB_HOST) || !defined(CONFIG_SPL_BUILD) case USB_DR_MODE_HOST: debug("%s: dr_mode: HOST\n", __func__); -- 2.40.1