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 65133C7619A for ; Wed, 12 Apr 2023 11:53:14 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id A34B185F70; Wed, 12 Apr 2023 13:53:11 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=metanate.com 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=metanate.com header.i=@metanate.com header.b="1g+RrMWG"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 742AA85F9C; Wed, 12 Apr 2023 13:53:09 +0200 (CEST) Received: from metanate.com (unknown [IPv6:2001:8b0:1628:5005::111]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 120C78598A for ; Wed, 12 Apr 2023 13:53:07 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=metanate.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=john@metanate.com DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=metanate.com; s=stronger; h=Content-Transfer-Encoding:References: In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Content-Type:Reply-To: Content-ID:Content-Description; bh=vl49i0R6ZTzmgAAnAzVtfxYpJexu+ikfThNiNoq9je0=; b=1g+RrMWGm1EPEeTErjkx+MLPtd k0hiBjUAUaSJFP+vVR31o+JXOD0ewxg2nOAy3Qw9OYj2xTSwk3bSVHsAT4uPzV0QY6Jpf/zy2ediF TCJqlqv1aUBYjDUa/dbFcllsZrYTpT6Y/8XgWodKgjMLnYbKF2DQfD1Zxj8iPZDZxSv/NK3kMMTKY Jahth7/Y13YcrSnqliaRsJsJgwyVvlMxWpF25JfRUQBnnk3QYl6EYl0y8aqeWz8xzyor0jmSXy+zr Fv06WyvUn3iH/Y0/npU31m3tfkmq9+zD1ugWq9VcuLBtBnGA39sIdBNQFQqRgrHpNwvw/0KVWh0S4 UKENTlCQ==; Received: from dougal.metanate.com ([192.168.88.1] helo=donbot.metanate.com) by email.metanate.com with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1pmZ27-0000vF-5A; Wed, 12 Apr 2023 12:53:04 +0100 From: John Keeping To: u-boot@lists.denx.de Cc: John Keeping , Simon Glass , Philipp Tomsich , Kever Yang Subject: [PATCH 2/2] rockchip: handle peripheral as well as otg dr_mode Date: Wed, 12 Apr 2023 12:52:53 +0100 Message-Id: <20230412115253.1283568-2-john@metanate.com> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230412115253.1283568-1-john@metanate.com> References: <20230412115253.1283568-1-john@metanate.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Authenticated: YES 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 The OTG port is identified by inspecting the "dr_mode" property which is expected to be "otg" for this port. But it will work just as well as a device controller when dr_mode is set to "peripheral", which may be required if the mode detection pin is not set up correctly and the device controller needs to be programmed to override this. Signed-off-by: John Keeping --- arch/arm/mach-rockchip/board.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm/mach-rockchip/board.c b/arch/arm/mach-rockchip/board.c index 6d33d65780..45d9eae870 100644 --- a/arch/arm/mach-rockchip/board.c +++ b/arch/arm/mach-rockchip/board.c @@ -231,6 +231,7 @@ int board_usb_init(int index, enum usb_init_type init) while (ofnode_valid(node)) { switch (usb_get_dr_mode(node)) { case USB_DR_MODE_OTG: + case USB_DR_MODE_PERIPHERAL: matched = true; break; -- 2.40.0