From patchwork Sat Jun 15 00:31:01 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Vicente Bergas X-Patchwork-Id: 10996913 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3237B112C for ; Sat, 15 Jun 2019 00:31:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 22413286F3 for ; Sat, 15 Jun 2019 00:31:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 162B228701; Sat, 15 Jun 2019 00:31:15 +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=-5.2 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 2A93E287AA for ; Sat, 15 Jun 2019 00:31:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender:Content-Type: Content-Transfer-Encoding:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:Message-ID:MIME-Version:Date:Subject:To:From: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=rc/vQ7X/VEKaAfJ2S5aDFwnhqBrMwzDILk8j55EbYoI=; b=Vb51+d6N9mxPl3qyan+uCriDjC 1AV49q7DHwz1Le0Zc//IRFUIHG+jXPWzS8REn68wjmb/czDfwhcuKUupAI3XsC5QvqyrEXM78fZ/P znjRaVUokxhq1cnJIv+KJ0rI3Uy50eBXWkamYQ69ZtVedvxWehblpvUISQpvIoZZEbY+XNXGyG9Ra NCRrKJMuMD2gKs+iTuqwv0SlxHKCi35RBgJNoXUwqI2U5S8ojnxAjZMRmUB32MTG1Je/F57IGAI+5 48oi8jGjgoJcRje9mxs1H1RkBO9Gmn5kR0A3CPgwQsVUrl/Bg0MZAFIxu2QN4520CC3snX481hCUz Icl5Kc8w==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hbwb8-000277-62; Sat, 15 Jun 2019 00:31:10 +0000 Received: from mail-wm1-x343.google.com ([2a00:1450:4864:20::343]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hbwb3-000228-Pk for linux-rockchip@lists.infradead.org; Sat, 15 Jun 2019 00:31:08 +0000 Received: by mail-wm1-x343.google.com with SMTP id 207so3966125wma.1 for ; Fri, 14 Jun 2019 17:31:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:mime-version:message-id:user-agent :content-transfer-encoding; bh=NpDGdmoOjtyBXDr5y0skDODDDj2CVbD6fMVnEe7Jo4A=; b=FZfjN6yYLzSuymB6H5jINR+EpgLL5+Zuh8/rAZTefUsOEnQySeYimSWokfn27dtNCU oMbHZtVoaVEUP5CiG3IfjLF4jCn7lw04xc/iHCzFO7Y7JpPhVocHE9yDSb/ZnFbQQXEU PUSUM83kP2XIsziAhaMdkHZ4LUn8oy4L7G0qK0DYy57vG8FPbvqVOIwK3lTObBdKcMvZ GD4PCNhlSx2PIkgtTXgtICQQ8DxKW15j0Q712AQMX4QEHS/eJzBdkbZEdkU3Lb8PKTxG XYsRYXURThTzQFtxQmhxzS9UZYk/jwhouWIMLH+snHkqKu6akC0A+dmk79Dt8L++tP3d 7rZA== 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:mime-version:message-id :user-agent:content-transfer-encoding; bh=NpDGdmoOjtyBXDr5y0skDODDDj2CVbD6fMVnEe7Jo4A=; b=mpEiS1MwxCH4mlJUUS9fome0QWG9KuHzP8+eR9UwN69ODADZ2s6PYQpYS2b/0g0yjK EtqsKdNzNshY3rUZEnDqYkNsSjoCsKFQfYekx4rvkFkoIiIIlBLQPPeelCKscE56DIkZ RGqK7TYMdGloRftH1R2/kNu5qm3ynexU47/KPajvX0jlNv9OOacmiaSn8z1WOqdoqa7p ODhbB9Fl6GshUKtv3rh7XRrMf3ARYVpfpeElMr2WBkZe2OhyhYNuxlHBRMhpyoyPpArm 6G/efuYMlFzGTQvxGutyNnsorpkXUbRPaGmNid4ssID34gUoZ3RShEzSJPzoKDT48S0u AkGQ== X-Gm-Message-State: APjAAAWvEkbhRhdeuu6o0f1MkHP2wEVkXfOc8vANU99a6w6S/3YeejVR 9T/2x5zr/BTNBbTnY5NOjsM= X-Google-Smtp-Source: APXvYqzIjjjN0kRh2JzcySUyDN8xBIB9FWAVySz4W0C865hyHcRN1vWlUJTxezrjhV8UNLSPfW8ABg== X-Received: by 2002:a05:600c:118a:: with SMTP id i10mr4270109wmf.162.1560558663612; Fri, 14 Jun 2019 17:31:03 -0700 (PDT) Received: from localhost ([92.59.185.54]) by smtp.gmail.com with ESMTPSA id b2sm5438787wrp.72.2019.06.14.17.31.01 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Fri, 14 Jun 2019 17:31:02 -0700 (PDT) From: Vicente Bergas To: Heiko Stuebner Subject: [PATCH v2] arm64: rockchip: dts: sapphire: Fix USB3 Type-C. Date: Sat, 15 Jun 2019 02:31:01 +0200 MIME-Version: 1.0 Message-ID: <4b759fa0-8fe9-4686-b5a7-b7a4e4564419@gmail.com> User-Agent: Trojita X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190614_173105_900666_639F9B83 X-CRM114-Status: UNSURE ( 6.64 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Enric Balletbo i Serra , William wu , linux-rockchip@lists.infradead.org Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Before this patch, the Type-C port on the Sapphire board is dead. If setting the 'regulator-always-on' property to 'vcc5v0_typec0' then the port works for about 4 seconds at start-up. This is a sample trace with a memory stick plugged in: 1.- The memory stick LED lights on and kernel reports: [ 4.782999] scsi 0:0:0:0: Direct-Access USB DISK PMAP PQ: 0 ANSI: 4 [ 5.904580] sd 0:0:0:0: [sdb] 3913344 512-byte logical blocks: (2.00 GB/1.87 GiB) [ 5.906860] sd 0:0:0:0: [sdb] Write Protect is off [ 5.908973] sd 0:0:0:0: [sdb] Mode Sense: 23 00 00 00 [ 5.909122] sd 0:0:0:0: [sdb] No Caching mode page found [ 5.911214] sd 0:0:0:0: [sdb] Assuming drive cache: write through [ 5.951585] sdb: sdb1 [ 5.954816] sd 0:0:0:0: [sdb] Attached SCSI removable disk 2.- 4 seconds later the memory stick LED lights off and kernel reports: [ 9.082822] phy phy-ff770000.syscon:usb2-phy@e450.2: charger = USB_DCP_CHARGER 3.- After a minute the kernel reports: [ 71.666761] usb 5-1: USB disconnect, device number 2 It has been checked that, although the LED is off, VBUS is present. If, instead, the dr_mode is changed to host and the phy-supply changed accordingly, then it works. It has only been tested in host mode. Signed-off-by: Vicente Bergas --- Hi Heiko, before i did test: a.- applying only the first part of the patch: reg-always-on b.- applying the full patch but did not test: c.- applying only the last part of the patch, as you suggest Now i have tested (c) and it also works, so, here is v2. Thanks for reviewing! Regards, Vicenç. diff --git a/arch/arm64/boot/dts/rockchip/rk3399-sapphire.dtsi b/arch/arm64/boot/dts/rockchip/rk3399-sapphire.dtsi index 04623e52ac5d..72000a7b666f 100644 --- a/arch/arm64/boot/dts/rockchip/rk3399-sapphire.dtsi +++ b/arch/arm64/boot/dts/rockchip/rk3399-sapphire.dtsi @@ -565,12 +566,11 @@ status = "okay"; u2phy0_otg: otg-port { - phy-supply = <&vcc5v0_typec0>; status = "okay"; }; u2phy0_host: host-port { - phy-supply = <&vcc5v0_host>; + phy-supply = <&vcc5v0_typec0>; status = "okay"; }; }; @@ -620,7 +620,7 @@ &usbdrd_dwc3_0 { status = "okay"; - dr_mode = "otg"; + dr_mode = "host"; }; &usbdrd3_1 {