From patchwork Tue Jan 30 19:42:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 768229 Received: from mail-lf1-f41.google.com (mail-lf1-f41.google.com [209.85.167.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B5EDE1E539 for ; Tue, 30 Jan 2024 19:42:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.41 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706643781; cv=none; b=HovlgQWOf4PyFfc2b0cToZAjK3yUKntcHqWRZ/l1ljBCqyBzc+/mQ3mjqY1sTnLPK1GwrZ+xZkbapKD1YOeJG9SMzENOk9UShBR4WF2CqbA0rfvlkm3I4MAJghDEZ5xmTZVGAjjyuebAdUb53amy5aSaJfMtXlGNlIBRk34cMqA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706643781; c=relaxed/simple; bh=SD6UUFtI+FrYWwRFXzuabrqwuSDciUQyW6zeuGZeagc=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=kQBr80muqKMG+aJokWZ7Nh1/cPQRM1cGnjTx2DwWfUNVEuz5UjmnynUT7QZ9laeMo9cxkt396E2EyOx/2XMDi4MIzZFSb9QThITbV71rg3GDyW+xDYKNpM6QEC3yTHiVKn/ZjpHArqnxUChUMRU6JAoRUl37YvjJFX1Rr/7uKmE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=B5zmhHiG; arc=none smtp.client-ip=209.85.167.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="B5zmhHiG" Received: by mail-lf1-f41.google.com with SMTP id 2adb3069b0e04-51032e62171so4741935e87.3 for ; Tue, 30 Jan 2024 11:42:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706643778; x=1707248578; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=MfLAPid7VDK1PAEPiQCRMcHMVr/os/p3blKtpfELzqM=; b=B5zmhHiGC5WfcpUD3UAxzV85JurDNRsmWCPa/2GarcYZuSG7wx1y+GH8CeyPbakayf PbE1uS3xUCC/A2VbgFEujCneF9EtH2nz7h1KiX1RPbbjXVjIPsOG6v8Q8mIRNPvifly8 csHCHdB2pKopyAGe5XpVXhM9NZHHS+or7mFYKrqTUm2zWw8nM2dqu01H09PrqmojkMFz LarQ5TTQRB3ewhrfPQ+dlhQ+rqKiW4AJ3VFhnxYMhqnIeIZKfCnGzc3hOVOftMnU52EN OlatVluv1fi34vi3w9LhDLyP/Pg5T5IxqdVVrxetmz+8t0Y1qQiB/8jcC1kD+OkYAc3q W0mA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706643778; x=1707248578; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=MfLAPid7VDK1PAEPiQCRMcHMVr/os/p3blKtpfELzqM=; b=uj0SZ3h4CdN5XclPu0el7EvPmyf3cnH6qR5byp2GyWmLtrXyJK9BjEUJGqAINwhpkk YK+xDcGJ/IZQEFPFZ4TQMg8xsqLdynxFjrikv66Vc0xrdbFMU8RwHzhJwmBiEHoryNBT DMxZAVL/lh0kP2ZeKOw8vXroanT/p3FaDJLgROIpFIC+PwQPeLKbDcVGlBMOM7fYMdUP BmphlGLNxuu5NGY/JUhltq5esAIzigV7e8vK+UElYEyyjbsMmosrZvggjTUbkHj20Z5y Rm8Tq/TD+BAcikfmu6I1alTFNxk9ESRhEJKb+VlSjfiXIm8stiSx/drAKHLTeD3dgP8g TA1g== X-Gm-Message-State: AOJu0YwJ7wW0tdvZ5CcsyBj41yDQRML/1i1cDQ1ojE90W2dsEVO+ak3o irN/33WlbBv3E7pdmWK5krPF9qx73YoimblzSrgwhETn3dNg4LyXXS7Zkei32s6MY2ukUK5xGKC C X-Google-Smtp-Source: AGHT+IHeoIXaYNBsUUv+fe79H1KB6EJw8xDWRHxgZDs441eUwoCCek8zCVtawcdZToqN9UH2MCXD/w== X-Received: by 2002:a05:6512:2315:b0:511:e76:6f1f with SMTP id o21-20020a056512231500b005110e766f1fmr5688546lfu.43.1706643777864; Tue, 30 Jan 2024 11:42:57 -0800 (PST) X-Forwarded-Encrypted: i=0; AJvYcCWPQmzdu8fdjl96ajOCNfaoF6z4qGiTS/hWiaZlRAfWNUYtfURGCC7A6rQN5yZ9dw1lnhgrQAKQQIWbFMQYp/zI7YvOWI8PpWatt6wZENysU351hhBxOAWPlCnLNq9W033YOUiZL0kn1MdlfAg4705tbQS/Hlep2dwVwAZ6cqmfzVnyUicCyzyZeAhdTbsP/YfrRDtg6CrEswdm+2DIR/ckiF5/5OLzDVJKaHTxBAhjuH13bzTuNPIOk8aHRzBZIkuX4NICKQMHrzN2EdGoNJM3DP3w7MjTeegTa58BG5QEIr97h4ILQjX1eYOLiJZ3bKasRP/fkWurYfcmSD5LgFci9hqwChHeqza1HT3F5NtSy13cyCmEplHwaOn/7gY9WJvXZhXwa1pQgzK/xgoDM5SeUAzMxjVuUI7wvRtZuszxLqVH3p3U Received: from umbar.lan ([192.130.178.91]) by smtp.gmail.com with ESMTPSA id j16-20020ac253b0000000b0051021a9febdsm1552145lfh.153.2024.01.30.11.42.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jan 2024 11:42:57 -0800 (PST) From: Dmitry Baryshkov Date: Tue, 30 Jan 2024 21:42:55 +0200 Subject: [PATCH 4/4] arm64: dts: qcom: qrb2210-rb1: enable USB-C port handling Precedence: bulk X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240130-pm4125-typec-v1-4-e8d0097e2991@linaro.org> References: <20240130-pm4125-typec-v1-0-e8d0097e2991@linaro.org> In-Reply-To: <20240130-pm4125-typec-v1-0-e8d0097e2991@linaro.org> To: Bjorn Andersson , Konrad Dybcio , Liam Girdwood , Mark Brown , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Wesley Cheng , Bryan O'Donoghue , Greg Kroah-Hartman Cc: linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-usb@vger.kernel.org X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=openpgp-sha256; l=3313; i=dmitry.baryshkov@linaro.org; h=from:subject:message-id; bh=SD6UUFtI+FrYWwRFXzuabrqwuSDciUQyW6zeuGZeagc=; b=owEBbQGS/pANAwAKAYs8ij4CKSjVAcsmYgBluVE9kkqMLKfbaX1ipK08gr3+CK2Afcwvm1voG zQGc+8nooGJATMEAAEKAB0WIQRMcISVXLJjVvC4lX+LPIo+Aiko1QUCZblRPQAKCRCLPIo+Aiko 1ff3B/4yWQ3f+JTyg8s/rzYHNW9PjzotYy7Z7EzIFh7SdM/3RhRZ8dG1IqkFtroo1bIsXXQoEJ8 RBk5ehNcHGFJi+fGaNN07thCsbxThc5aundRGXtdjn3g0oTQvIvPW+8ir8WsBdZ0VyW/N72RrfD ugJRbarapPGJN2dpLJLSvZlYVgwA7n8KGdIY9a+Yc3IHEkuJhZG5QoPczljTef5C46yguRykZ3e DIQqYIc4NJChLQzw0XgdkzlAyjSk1lmp2WBfN1dpoqxr1kJm2W7pV5dkA9tARy8yjsV4rCqIOiI N/RwfWLRVJPHxtKxi5gMkIjTt7IjRGZfaqXMgg/OOnayF6CB X-Developer-Key: i=dmitry.baryshkov@linaro.org; a=openpgp; fpr=8F88381DD5C873E4AE487DA5199BF1243632046A Plug in USB-C related bits and pieces to enable USB role switching and USB-C orientation handling for the Qualcomm RB1 board. Signed-off-by: Dmitry Baryshkov --- arch/arm64/boot/dts/qcom/qcm2290.dtsi | 42 ++++++++++++++++++++++ arch/arm64/boot/dts/qcom/qrb2210-rb1.dts | 60 +++++++++++++++++++++++++++----- 2 files changed, 94 insertions(+), 8 deletions(-) diff --git a/arch/arm64/boot/dts/qcom/qcm2290.dtsi b/arch/arm64/boot/dts/qcom/qcm2290.dtsi index 0911fb08ed63..6e9a92556423 100644 --- a/arch/arm64/boot/dts/qcom/qcm2290.dtsi +++ b/arch/arm64/boot/dts/qcom/qcm2290.dtsi @@ -689,8 +689,29 @@ usb_qmpphy: phy@1615000 { clock-output-names = "usb3_phy_pipe_clk_src"; #phy-cells = <0>; + orientation-switch; status = "disabled"; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + + usb_qmpphy_out: endpoint { + }; + }; + + port@1 { + reg = <1>; + + usb_qmpphy_usb_ss_in: endpoint { + remote-endpoint = <&usb_dwc3_ss>; + }; + }; + }; }; system_noc: interconnect@1880000 { @@ -1373,6 +1394,27 @@ usb_dwc3: usb@4e00000 { snps,usb3_lpm_capable; maximum-speed = "super-speed"; dr_mode = "otg"; + usb-role-switch; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + + usb_dwc3_hs: endpoint { + }; + }; + + port@1 { + reg = <1>; + + usb_dwc3_ss: endpoint { + remote-endpoint = <&usb_qmpphy_usb_ss_in>; + }; + }; + }; }; }; diff --git a/arch/arm64/boot/dts/qcom/qrb2210-rb1.dts b/arch/arm64/boot/dts/qcom/qrb2210-rb1.dts index 64b2ab286279..00fcc01326ff 100644 --- a/arch/arm64/boot/dts/qcom/qrb2210-rb1.dts +++ b/arch/arm64/boot/dts/qcom/qrb2210-rb1.dts @@ -244,6 +244,46 @@ &pm4125_resin { status = "okay"; }; +&pm4125_typec { + status = "okay"; + + connector { + compatible = "usb-c-connector"; + + power-role = "dual"; + data-role = "dual"; + self-powered; + + typec-power-opmode = "default"; + pd-disable; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + pm4125_hs_in: endpoint { + remote-endpoint = <&usb_dwc3_hs>; + }; + }; + + port@1 { + reg = <1>; + pm4125_ss_in: endpoint { + remote-endpoint = <&usb_qmpphy_out>; + }; + }; + }; + }; +}; + +&pm4125_vbus { + regulator-min-microamp = <500000>; + regulator-max-microamp = <500000>; + status = "okay"; +}; + &qupv3_id_0 { status = "okay"; }; @@ -517,14 +557,8 @@ &usb { status = "okay"; }; -&usb_qmpphy { - vdda-phy-supply = <&pm4125_l12>; - vdda-pll-supply = <&pm4125_l13>; - status = "okay"; -}; - -&usb_dwc3 { - dr_mode = "host"; +&usb_dwc3_hs { + remote-endpoint = <&pm4125_hs_in>; }; &usb_hsphy { @@ -534,6 +568,16 @@ &usb_hsphy { status = "okay"; }; +&usb_qmpphy { + vdda-phy-supply = <&pm4125_l12>; + vdda-pll-supply = <&pm4125_l13>; + status = "okay"; +}; + +&usb_qmpphy_out { + remote-endpoint = <&pm4125_ss_in>; +}; + &wifi { vdd-0.8-cx-mx-supply = <&pm4125_l7>; vdd-1.8-xo-supply = <&pm4125_l13>;