Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp3974000rdh; Fri, 29 Sep 2023 07:45:24 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHZELqL2yFL0CmM0Y2KAyVCk6K0DG3EgU6TI7dEGJgPtvE6GHvUi1ykiH2exOgVyPoZcozm X-Received: by 2002:a92:c26f:0:b0:351:5a77:f169 with SMTP id h15-20020a92c26f000000b003515a77f169mr5369214ild.29.1695998723767; Fri, 29 Sep 2023 07:45:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695998723; cv=none; d=google.com; s=arc-20160816; b=wAWLqzUVbAqUmr52UhZAxLwURV2hyB4C++aMWd9zKiTgoxl7UtC+IjCtH5Anp2YvlT NM0MF7R7PWNnx8kD3M1dKnu9fjbDMfACh6d7IVGRTTzm9nyjE4w+GrH1BiyZLkq5mJry VBXKaUhm024Ibuxj3KAtWX9NnC5djz7wr9tUT6Oe+DcZroXlz+d/SyLw9J/SY3jwqZ0d Vt38+RgjVXjkf6o8orP7oSgvBJpDLmAbUfq8uJylzx27ag1XFll2BbQvG4AlHK0E/HKA X4Lt8H4i8b4gZA5BT0mGyhZFW0cTVs5Df3z6NwiudEKlGSGtu/wamgagB7iCGLnmg8r/ +PmQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:message-id:content-transfer-encoding :mime-version:subject:date:from:dkim-signature; bh=zcabyV/ntBQljUCLvUhOeWEh6aipQODXnykgj24wk+U=; fh=mAkaAvjB0SXoFW6sNljxTK8epzq/Hp+7ss9k9NC2v60=; b=UYyUZ7WGcWuev8OQLxRSNVxeSArmZ4cyutuvTVfxACcDvbliyUCavCv9EgC/sabBK4 Y5KWR9L0Hk68PIMvRA/MEGKwvNJOyzqSCZXjqCRJF283ftp5UyRDjTkiqEBzYAIPfn5b 6QaJ/Ds2tj79KC/6QsUKL7MeqycK/xvXRjgFR/hcsCm3MuT99arZ/kW2JC8lQ0ki7r91 KmqESUyCQPQr3L/dHPpRTZEH6oi8Xv90fn/LBLzykUKhUCuwQ5we48FeeAaVPDX7ADQo tCfLGsJd0u/QqoFwOrgaWRwoelAtdGv0563QjjGMyiP1JshpszwXYZ1zTOLqqJj8Zjj0 tWEQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@fairphone.com header.s=fair header.b=f5AzrhcW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=fairphone.com Return-Path: Received: from groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id k68-20020a633d47000000b00578c4e244easi11298599pga.791.2023.09.29.07.45.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Sep 2023 07:45:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass header.i=@fairphone.com header.s=fair header.b=f5AzrhcW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=fairphone.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 3BE0B80DB727; Fri, 29 Sep 2023 02:53:22 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232746AbjI2JxL (ORCPT + 99 others); Fri, 29 Sep 2023 05:53:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35590 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232813AbjI2JxJ (ORCPT ); Fri, 29 Sep 2023 05:53:09 -0400 Received: from mail-ed1-x52b.google.com (mail-ed1-x52b.google.com [IPv6:2a00:1450:4864:20::52b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6EDAD1A5 for ; Fri, 29 Sep 2023 02:53:06 -0700 (PDT) Received: by mail-ed1-x52b.google.com with SMTP id 4fb4d7f45d1cf-533df112914so13038751a12.0 for ; Fri, 29 Sep 2023 02:53:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fairphone.com; s=fair; t=1695981185; x=1696585985; darn=vger.kernel.org; h=cc:to:message-id:content-transfer-encoding:mime-version:subject :date:from:from:to:cc:subject:date:message-id:reply-to; bh=zcabyV/ntBQljUCLvUhOeWEh6aipQODXnykgj24wk+U=; b=f5AzrhcWu8q2UPT/JgsQlNgE+QNKroGP/TNlZRRC0LWovDx+xhf6Fu7L5mFUou0fWH t4eq72dUMhLN/t2uCv8mTQTTNGWN1I209Gdw7LGAUiNHnocz4rSVxro5kV4g4Sm9oTS/ hcl14VHz/gFWKz6TFLTpl6jQpr9cvOIzXp9WiXV6iJb2SY2iDbBZyO7akIaYlNr4AHUR vZptdOUeH/cdOc4fTVIwb4W7Zqb9d1uaqpL0YQpT627rEmg3mNUY+AfYezZmhYGv/l1+ kB9GsdoR7/New9AGDQkzVeba8Ie+oZ3DxWvH2F5sEZNv6yEiIEqCrBBWZg9pVMKts0pG /DYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695981185; x=1696585985; h=cc:to:message-id:content-transfer-encoding:mime-version:subject :date:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=zcabyV/ntBQljUCLvUhOeWEh6aipQODXnykgj24wk+U=; b=KgyJkG59QbrzxtoUww8NUIYORvAqr5YRDS9MdX1t6Zd9XBLU7VjrLMS4KqGwzeUwtt QadEQ9eYNBoSuX2/Gp+H76P5d8gYRE4xXkMV4c1th5Rjz11wjlCczYxxoMKpTKq9t0G/ J069G+33sowTwR83ETt5ZGFEfMID4nlLTPSwyBW/7UjYnN3S2Zd+PJBGQ/c1u8uewkV3 YfYh+BomNtRqpKqB0Tj4kDFw92+YVuA0JnYL3V6QoK+/z2umI/mNMnz8YUgWWSY1By0x CqO6MfQYpuXHYtuuaTioH0ft7nj4nYgEoTpX1nXG8PX/7mWNHBYqVkBM1MwczeRDJYzd tU1Q== X-Gm-Message-State: AOJu0YySirLipxLrCiJXieMJvTzSla5z6tduVQNa1WQun5oXpivwg8wA xKMUoY745C3vgUO5fEKmIB6WPQ== X-Received: by 2002:a05:6402:14cb:b0:533:c55f:582a with SMTP id f11-20020a05640214cb00b00533c55f582amr3132986edx.27.1695981184900; Fri, 29 Sep 2023 02:53:04 -0700 (PDT) Received: from otso.luca.vpn.lucaweiss.eu (144-178-202-138.static.ef-service.nl. [144.178.202.138]) by smtp.gmail.com with ESMTPSA id cy23-20020a0564021c9700b005362c9905b2sm1967034edb.35.2023.09.29.02.53.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Sep 2023 02:53:04 -0700 (PDT) From: Luca Weiss Date: Fri, 29 Sep 2023 11:52:59 +0200 Subject: [PATCH] arm64: dts: qcom: qcm6490-fairphone-fp5: Enable UFS MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20230929-fp5-ufs-v1-1-122941e28b06@fairphone.com> X-B4-Tracking: v=1; b=H4sIAHqeFmUC/6tWKk4tykwtVrJSqFYqSi3LLM7MzwNyDHUUlJIzE vPSU3UzU4B8JSMDI2MDSyNL3bQCU93StGLdVKNkg1Qjw0QDQxMjJaDqgqLUtMwKsEnRsbW1AA7 SNQRZAAAA To: Andy Gross , Bjorn Andersson , Konrad Dybcio , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Nitin Rawat Cc: ~postmarketos/upstreaming@lists.sr.ht, phone-devel@vger.kernel.org, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Luca Weiss X-Mailer: b4 0.12.3 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Fri, 29 Sep 2023 02:53:22 -0700 (PDT) Enable the UFS phy and controller so that we can access the internal storage of the phone. At the same time we need to bump the minimum voltage used for UFS VCC, otherwise it doesn't initialize properly. The new range is taken from the vcc-voltage-level property downstream. See also the following link for more information about the VCCQ/VCCQ2: https://gerrit-public.fairphone.software/plugins/gitiles/kernel/msm-extra/devicetree/+/1590a3739e7dc29d2597307881553236d492f188/fp5/yupik-idp-pm7250b.dtsi#207 Signed-off-by: Luca Weiss --- I'm not 100% convinced about the regulator range change. For sure with the original voltage range the UFS fails to initialize, but looking at downstream kernel during runtime (debugfs) we see the VCC voltage switches between 2.4V (idle?) and 2.952V (active?). But even with this change in mainline the regulator would always stay at 2.504V which is for sure lower than the downstream operating voltage of 2.952V. Behavior wise I don't see a difference between ~2.5V and ~2.9V. Should I just constrain the regulator here to min=max=2.952V? Or just say it's okay as-is? Depends on: https://lore.kernel.org/linux-arm-msm/20230927081858.15961-1-quic_nitirawa@quicinc.com/ --- arch/arm64/boot/dts/qcom/qcm6490-fairphone-fp5.dts | 27 ++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/arch/arm64/boot/dts/qcom/qcm6490-fairphone-fp5.dts b/arch/arm64/boot/dts/qcom/qcm6490-fairphone-fp5.dts index 2de0b8c26c35..fea7639fc0bc 100644 --- a/arch/arm64/boot/dts/qcom/qcm6490-fairphone-fp5.dts +++ b/arch/arm64/boot/dts/qcom/qcm6490-fairphone-fp5.dts @@ -182,8 +182,9 @@ vreg_l6b: ldo6 { }; vreg_l7b: ldo7 { - regulator-min-microvolt = <2400000>; - regulator-max-microvolt = <3544000>; + /* Constrained for UFS VCC */ + regulator-min-microvolt = <2504000>; + regulator-max-microvolt = <2952000>; regulator-initial-mode = ; }; @@ -632,6 +633,28 @@ bluetooth: bluetooth { }; }; +&ufs_mem_hc { + reset-gpios = <&tlmm 175 GPIO_ACTIVE_LOW>; + + vcc-supply = <&vreg_l7b>; + vcc-max-microamp = <800000>; + /* + * Technically l9b enables an eLDO (supplied by s1b) which then powers + * VCCQ2 of the UFS. + */ + vccq-supply = <&vreg_l9b>; + vccq-max-microamp = <900000>; + + status = "okay"; +}; + +&ufs_mem_phy { + vdda-phy-supply = <&vreg_l10c>; + vdda-pll-supply = <&vreg_l6b>; + + status = "okay"; +}; + &usb_1 { status = "okay"; }; --- base-commit: d85348daa4407216e47198ed35a43a66883edab6 change-id: 20230929-fp5-ufs-e2c0e21a0142 Best regards, -- Luca Weiss