From patchwork Tue Jul 10 22:02:02 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Anderson X-Patchwork-Id: 10518113 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 365126020F for ; Tue, 10 Jul 2018 22:04:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2692228F8B for ; Tue, 10 Jul 2018 22:04:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 18C3F290C1; Tue, 10 Jul 2018 22:04:38 +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=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI autolearn=unavailable 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 B88D128F8B for ; Tue, 10 Jul 2018 22:04:37 +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-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: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=3Yknv9Nv1VYgRZ9hAmvPyvEy3iKZkNj8wXy0Ayl89jk=; b=Cz+DARuZ1iVEbiUo6nwCfH8+Wc B5ohkimM9RNQYhhvJQbNYU7n9ZRpU4yd/3IdIu6GyhF/0zKw3Xe4MrivI4GdoKo8rLf0/oKzWGarY R06VIWBreorXqKCLClneFfzziGaeDyZ8O72/C6l7HXhg6yFHeoJFw2ksJe4s9XEGWRxnt1A4o8UGO BzQQmsQ6mlPvj2ijzOnwrpsVpWTR2VVxeL+azgBlIEiQXrn0II1CcKIGcTBx18AyYUXJXwmltieAy I4UaqD6cd3L3Bcb8KRDZGYKVSH9Ox5p6zB3HerN8GFmlnBCD0xMBiKlTBem/1J3p9WG0w9aqHsg3r FaTdaG5A==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fd0kK-0005ER-NV; Tue, 10 Jul 2018 22:04:32 +0000 Received: from mail-pf0-x244.google.com ([2607:f8b0:400e:c00::244]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fd0jw-0004gJ-JO for linux-arm-kernel@lists.infradead.org; Tue, 10 Jul 2018 22:04:11 +0000 Received: by mail-pf0-x244.google.com with SMTP id b17-v6so16996081pfi.0 for ; Tue, 10 Jul 2018 15:03:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=IushQ/ZLyaPZtkjLas+JFecM/MPWlXvMRXEQXvLDlAI=; b=bUrqhTzAvqZ7dVeroUjlYDwwqVlkPARw13Np9B85fcp2+GHFdkMbFAsU+rKZjhVdVF 4WjfOtaYGqKu5i/KNO3BWENXBdRBbikDvHl7J3B0Pah4c1Gp9gVbtXo8TpOCYN1yek8Z 9Kfh0QNlZ1UwRN95RyGKUdq5kKPmaFUAkUT0E= 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=IushQ/ZLyaPZtkjLas+JFecM/MPWlXvMRXEQXvLDlAI=; b=uQeCyuLZkWzagR4bh4FG03EhkQmzzQQvMaTLR6pITS1G9TmUOm2WVlaoeeiZVnCwFm SFmPMaGUvMKV67zwD1+4oIuABx2FPTVd2gsncgxk02bLPY3nvHNPaeFpibkby6MvvX99 7IbWO4knmiprORQCp4mMxLEZa2NLEzy6lOGjvPIlVhQamRuTCD2KiSzKB9p6xdRDJ80X vUDCxbdLyvZiqr4XC4OYOIRBuYRpdKU04MkQxPYg3j8qWwB2FhJVWUkrrvq8vpn4vZfz 9s1A7o7tuXMFrL7JqH9q+iHogTMu7hryep6FCHofbFwMMzlxlUSsH10eQGVx/gKCc5nX Ab4A== X-Gm-Message-State: APt69E19xRMcz0vjBA6Dut5nKM0cQF82rNN/mEoF5ynpUYog6mOA7SAp PqWyQbTjIMiQzpwDcugVtvb9mJCYy40= X-Google-Smtp-Source: AAOMgpdD6f1Aw0an6FwAck9d+CVo/D4CCrtluE2h/rkQAe+eeHS/8kKfqkm74Z0BO9gdjmc/j/fttw== X-Received: by 2002:a63:6d8b:: with SMTP id i133-v6mr24766612pgc.215.1531260238057; Tue, 10 Jul 2018 15:03:58 -0700 (PDT) Received: from tictac2.mtv.corp.google.com ([2620:0:1000:1501:38e4:86fe:ec0c:4007]) by smtp.gmail.com with ESMTPSA id y69-v6sm34939756pfd.36.2018.07.10.15.03.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 10 Jul 2018 15:03:57 -0700 (PDT) From: Douglas Anderson To: Andy Gross Subject: [PATCH 3/3] arm64: dts: qcom: sdm845-mtp: Add nodes for USB Date: Tue, 10 Jul 2018 15:02:02 -0700 Message-Id: <20180710220202.116404-4-dianders@chromium.org> X-Mailer: git-send-email 2.18.0.203.gfac676dfb9-goog In-Reply-To: <20180710220202.116404-1-dianders@chromium.org> References: <20180710220202.116404-1-dianders@chromium.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180710_150408_794111_C6DAC746 X-CRM114-Status: GOOD ( 14.26 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , devicetree@vger.kernel.org, David Collins , David Brown , linux-arm-msm@vger.kernel.org, Will Deacon , Douglas Anderson , swboyd@chromium.org, Manu Gautam , Rob Herring , Bjorn Andersson , linux-arm-kernel@lists.infradead.org, Vivek Gautam , Catalin Marinas , tfiga@chromium.org, linux-soc@vger.kernel.org, linux-kernel@vger.kernel.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Set the various nodes to "okay" and hook up the regulators. NOTE: For now the main USB port (the one that goes out the Type C connector) is forced to host. Eventually someone will need to get the Type C detection hooked up and get this all integrated with the PMI8998 PMIC. The reason for forcing to "host" in the meantime is that this will leave us with one "host" and one "peripheral" port. In order for host mode this to work, we assume that the bootloader left things configured enough for us. Apparently the magic for that is is to do these writes on pmi8998: - pm_comm_write_byte(2, 0x1153, 0x2C, 0); - pm_comm_write_byte(2, 0x1152, 0x07, 0); - pm_comm_write_byte(2, 0x1140, 0x00, 0); - pm_comm_write_byte(2, 0x1140, 0x01, 0); Signed-off-by: Douglas Anderson --- arch/arm64/boot/dts/qcom/sdm845-mtp.dts | 61 +++++++++++++++++++++++++ 1 file changed, 61 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/sdm845-mtp.dts b/arch/arm64/boot/dts/qcom/sdm845-mtp.dts index 1db4b9735e70..4e14f5f5c2f7 100644 --- a/arch/arm64/boot/dts/qcom/sdm845-mtp.dts +++ b/arch/arm64/boot/dts/qcom/sdm845-mtp.dts @@ -481,6 +481,67 @@ status = "okay"; }; +&usb_1 { + status = "okay"; +}; + +&usb_1_dwc3 { + /* Until we have Type C hooked up we'll force this as host. */ + dr_mode = "host"; +}; + +&usb_1_hsphy { + status = "okay"; + + vdd-supply = <&vdda_usb1_ss_core>; + vdda-pll-supply = <&vdda_qusb_hs0_1p8>; + vdda-phy-dpdm-supply = <&vdda_qusb_hs0_3p1>; + + qcom,imp-res-offset-value = <8>; + qcom,hstx-trim-value = ; + qcom,preemphasis-level = ; + qcom,preemphasis-width = ; +}; + +&usb_1_qmpphy { + status = "okay"; + + vdda-phy-supply = <&vdda_usb1_ss_1p2>; + vdda-pll-supply = <&vdda_usb1_ss_core>; +}; + +&usb_2 { + status = "okay"; +}; + +&usb_2_dwc3 { + /* + * Though the USB block on SDM845 can support host, there's no vbus + * signal for this port on MTP. Thus (unless you have a non-compliant + * hub that works without vbus) the only sensible thing is to force + * peripheral mode. + */ + dr_mode = "peripheral"; +}; + +&usb_2_hsphy { + status = "okay"; + + vdd-supply = <&vdda_usb2_ss_core>; + vdda-pll-supply = <&vdda_qusb_hs0_1p8>; + vdda-phy-dpdm-supply = <&vdda_qusb_hs0_3p1>; + + qcom,imp-res-offset-value = <8>; + qcom,hstx-trim-value = ; +}; + +&usb_2_qmpphy { + status = "okay"; + + vdda-phy-supply = <&vdda_usb2_ss_1p2>; + vdda-pll-supply = <&vdda_usb2_ss_core>; +}; + /* PINCTRL - additions to nodes defined in sdm845.dtsi */ &qup_i2c10_default {