From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ej1-f47.google.com (mail-ej1-f47.google.com [209.85.218.47]) (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 9F5A33009F7 for ; Mon, 25 Aug 2025 16:40:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.47 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756140047; cv=none; b=cbURNgJIU5nY6qqp84dfqTqNdacGLHTZU7iL8Imo0p7R21beP4Pa8HXWN08O5dITPdf4KhyqcXlFh0O64J8Assm//B11zEv3PKzfzAT20dyzgT+xbcgFpcThVumVhQzKNK7VyKKkTP5zzA1wIBLh+V16YPNAr7i/CH/MtPR3Wcw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756140047; c=relaxed/simple; bh=4prFTVsDmktsxECVHpJDZoTv8Pciq628dyvSUG8lB50=; h=Mime-Version:Content-Type:Date:Message-Id:Subject:From:To:Cc: References:In-Reply-To; b=p/EbJiIZhmE23VDqd4cKiWde+B0zKGbHjvAsyJGXmKSOqwBpXQDyPgI8GgOetHLtVKVyxq2iY4sEKEXeNh6jgGQ4teA6CCVScBjRcnkwX6J5OUkW0aw5MGPTaLXaczCi50Q5HQqNP1eXD98PGCQiq1Rh9pHdwalzCKL8LeLciYQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=fairphone.com; spf=pass smtp.mailfrom=fairphone.com; dkim=pass (2048-bit key) header.d=fairphone.com header.i=@fairphone.com header.b=1VXKRipO; arc=none smtp.client-ip=209.85.218.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=fairphone.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=fairphone.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=fairphone.com header.i=@fairphone.com header.b="1VXKRipO" Received: by mail-ej1-f47.google.com with SMTP id a640c23a62f3a-afe6fe7c89bso242390666b.0 for ; Mon, 25 Aug 2025 09:40:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fairphone.com; s=fair; t=1756140043; x=1756744843; darn=vger.kernel.org; h=in-reply-to:references:cc:to:from:subject:message-id:date :content-transfer-encoding:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=FG91uI45uUKeGliVzdh96+GHkDD0Of8ZnOcLCRVdh4U=; b=1VXKRipO7WEgLUDn403b2/beI6fZaWvLg1VAh096wZTbkQIXfjWaqNzIwv63eRXjiA zTs16GWTffLbmd7NK2kqxb21tT7jkuq2yYjvhKOVVeBfkWq7cUytKpjMDl3FJY5XMHv2 LwMd4upjxurprqIFcEc7S/Vcv1Be6MaSIMpcDpaldrBeNsSX6W6FpxMBjNjvC85iZBz1 3wr95KYYCmM9Sw87SQ9+6K2J0fN4v7BIXvEeLujKojJZsCPCHJjjyoLpIsU4uQDQzNWD ebdGtQhAvdHB9XimprT/mShlzkikIoHxbtn8KccgJhMum/hxsUuQYakpLT4VimCJ2OIr AKzA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756140043; x=1756744843; h=in-reply-to:references:cc:to:from:subject:message-id:date :content-transfer-encoding:mime-version:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=FG91uI45uUKeGliVzdh96+GHkDD0Of8ZnOcLCRVdh4U=; b=siN2nWAHnmPbLwa24TM8vZlqBuZeXAW6BljHm0go0H2gE2q1NAMH2SoozmSCVJ99ad tFPITFqpOufIEE4v1NqfHMwiiurE/Pu1AyRcmMLsL6znb99xVmB34OebL5NEj/6NlEdo xWftS4tVkc6tSuBnDGcxwFAwMqFN7trAopMxHko3Tu/Y63x/7YPUrPWQSGJV4Bw9yMOP arPn+21XDkXpFqZYRhhiKv5jGRT+yWoRO+6qyEFp32ObDWz1fELhcq2U7Q8o17CoiiVV ZDmJjikklCCOn4DjePRbfbnP590gh4rFdL2g6mhfC18yKEQZg5wwb7mOHqAy574veidj 6IPw== X-Forwarded-Encrypted: i=1; AJvYcCUX+pD3IRlw84MJoAAzXOZX7o/gimEbfLZ1K/Ni+Nel5kAbMc0sP0YUvy4WUNqZHVGrq4dsG13O95K+s5U=@vger.kernel.org X-Gm-Message-State: AOJu0YwHS2UpJxgf8jaqHTf4ig/mX4ZU9xxy53veJhAofqaOMgjsXjRF 01RMKKlFxvwecMACnwKtyrYyXd8L/UE7PLjmjoxu6k5O5ReWygD6q3kSnHRuYQnnwiQ= X-Gm-Gg: ASbGncuGOGazavJWiEjDV0HYHMDMy7cOh3Ldl6RjaSJv2qHVyNbl71KKduAWQBfDeyi aSB53vRGIVzdUNG6hwVqyc2qkys1f7yQqmFuMLMyswctGll39p1BxPBvjnIIRGVAN0ZlKj0hk+h /Cw2uhHbULDoY0MC9rnt5z2QLrzpCAVkWH2fkRftqFnP4pSmRglqQM8A8JGzVseta1oW5QR3XeD O+O+XRd1GcvHEsiXxW3DTBNzh6sY07P9dg3BHb6kz/zeU90Wyj6RHL4radmEcBIKFu7OdPcAPep XFpnYcC0kHo8JHIXsyrLGVYik5OGf7nQBdi5d/B42pEaHc6Fn/Ej/PLCGhUT6y02JLSAlifJSuH 67yJfbiCGniUPucLjvhbGr5k3tSfcfxkCwtpDh5UBH4xAZurvYDJFnd0oCKJSgGvYi+7AHG+CdY qa6Is= X-Google-Smtp-Source: AGHT+IFV4UU2TtRx1l7OIqQ1JFPaW34gENjDAO9Ve5xixYInhHmsQvVFhIsO1C/Qynf9MIpQCOZJoA== X-Received: by 2002:a17:907:d8a:b0:afe:6648:a243 with SMTP id a640c23a62f3a-afe9cb1b5e3mr24664366b.3.1756140042823; Mon, 25 Aug 2025 09:40:42 -0700 (PDT) Received: from localhost (83-97-14-181.biz.kpn.net. [83.97.14.181]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-afe9c908431sm11361366b.92.2025.08.25.09.40.41 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 25 Aug 2025 09:40:42 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Mon, 25 Aug 2025 18:40:41 +0200 Message-Id: Subject: Re: [PATCH v2 14/15] arm64: dts: qcom: Add initial Milos dtsi From: "Luca Weiss" To: "Dmitry Baryshkov" Cc: "Konrad Dybcio" , "Will Deacon" , "Robin Murphy" , "Joerg Roedel" , "Rob Herring" , "Krzysztof Kozlowski" , "Conor Dooley" , "Rafael J. Wysocki" , "Viresh Kumar" , "Manivannan Sadhasivam" , "Herbert Xu" , "David S. Miller" , "Vinod Koul" , "Bjorn Andersson" , "Konrad Dybcio" , "Robert Marko" , "Das Srinagesh" , "Thomas Gleixner" , "Jassi Brar" , "Amit Kucheria" , "Thara Gopinath" , "Daniel Lezcano" , "Zhang Rui" , "Lukasz Luba" , "Ulf Hansson" , <~postmarketos/upstreaming@lists.sr.ht>, , , , , , , , , , X-Mailer: aerc 0.20.1-0-g2ecb8770224a-dirty References: <20250713-sm7635-fp6-initial-v2-0-e8f9a789505b@fairphone.com> <20250713-sm7635-fp6-initial-v2-14-e8f9a789505b@fairphone.com> <3e0299ad-766a-4876-912e-438fe2cc856d@oss.qualcomm.com> <55420d89-fcd4-4cb5-a918-d8bbe2a03d19@oss.qualcomm.com> <2hv4yuc7rgtglihc2um2lr5ix4dfqxd4abb2bqb445zkhpjpsi@rozikfwrdtlk> <2bk7s43nrkmhhgsqq65mxhbmrapyjejyjugnae7wfbttqjmtbf@dk2fe64qrmwx> In-Reply-To: <2bk7s43nrkmhhgsqq65mxhbmrapyjejyjugnae7wfbttqjmtbf@dk2fe64qrmwx> On Mon Aug 25, 2025 at 6:36 PM CEST, Dmitry Baryshkov wrote: > On Mon, Aug 25, 2025 at 05:53:53PM +0200, Luca Weiss wrote: >> Hi Dmitry, >>=20 >> On Wed Aug 20, 2025 at 1:52 PM CEST, Dmitry Baryshkov wrote: >> > On Wed, Aug 20, 2025 at 10:42:09AM +0200, Luca Weiss wrote: >> >> Hi Konrad, >> >>=20 >> >> On Sat Aug 2, 2025 at 2:04 PM CEST, Konrad Dybcio wrote: >> >> > On 7/29/25 8:49 AM, Luca Weiss wrote: >> >> >> Hi Konrad, >> >> >>=20 >> >> >> On Thu Jul 17, 2025 at 11:46 AM CEST, Luca Weiss wrote: >> >> >>> Hi Konrad, >> >> >>> >> >> >>> On Thu Jul 17, 2025 at 10:29 AM CEST, Luca Weiss wrote: >> >> >>>> On Mon Jul 14, 2025 at 1:06 PM CEST, Konrad Dybcio wrote: >> >> >>>>> On 7/13/25 10:05 AM, Luca Weiss wrote: >> >> >>>>>> Add a devicetree description for the Milos SoC, which is for e= xample >> >> >>>>>> Snapdragon 7s Gen 3 (SM7635). >> >> >>>>>> >> >> >>>>>> Signed-off-by: Luca Weiss >> >> >>>>>> --- >> >> >>>>> >> >> >>>>> [...] >> >> >>>>>> + >> >> >>>>>> + spmi_bus: spmi@c400000 { >> >> >>>>>> + compatible =3D "qcom,spmi-pmic-arb"; >> >> >>>>> >> >> >>>>> There's two bus instances on this platform, check out the x1e b= inding >> >> >>>> >> >> >>>> Will do >> >> >>> >> >> >>> One problem: If we make the labels spmi_bus0 and spmi_bus1 then w= e can't >> >> >>> reuse the existing PMIC dtsi files since they all reference &spmi= _bus. >> >> >>> >> >> >>> On FP6 everything's connected to PMIC_SPMI0_*, and PMIC_SPMI1_* i= s not >> >> >>> connected to anything so just adding the label spmi_bus on spmi_b= us0 >> >> >>> would be fine. >> >> >>> >> >> >>> Can I add this to the device dts? Not going to be pretty though..= . >> >> >>> >> >> >>> diff --git a/arch/arm64/boot/dts/qcom/milos-fairphone-fp6.dts b/a= rch/arm64/boot/dts/qcom/milos-fairphone-fp6.dts >> >> >>> index d12eaa585b31..69605c9ed344 100644 >> >> >>> --- a/arch/arm64/boot/dts/qcom/milos-fairphone-fp6.dts >> >> >>> +++ b/arch/arm64/boot/dts/qcom/milos-fairphone-fp6.dts >> >> >>> @@ -11,6 +11,9 @@ >> >> >>> #include >> >> >>> #include >> >> >>> #include "milos.dtsi" >> >> >>> + >> >> >>> +spmi_bus: &spmi_bus0 {}; >> >> >>> + >> >> >>> #include "pm7550.dtsi" >> >> >>> #include "pm8550vs.dtsi" >> >> >>> #include "pmiv0104.dtsi" /* PMIV0108 */ >> >> >>> >> >> >>> Or I can add a second label for the spmi_bus0 as 'spmi_bus'. Not = sure >> >> >>> other designs than SM7635 recommend using spmi_bus1 for some stuf= f. >> >> >>> >> >> >>> But I guess longer term we'd need to figure out a solution to thi= s, how >> >> >>> to place a PMIC on a given SPMI bus, if reference designs start t= o >> >> >>> recommend putting different PMIC on the separate busses. >> >> >>=20 >> >> >> Any feedback on this regarding the spmi_bus label? >> >> > >> >> > I had an offline chat with Bjorn and we only came up with janky >> >> > solutions :) >> >> > >> >> > What you propose works well if the PMICs are all on bus0, which is >> >> > not the case for the newest platforms. If some instances are on bus= 0 >> >> > and others are on bus1, things get ugly really quick and we're goin= g >> >> > to drown in #ifdefs. >> >> > >> >> > >> >> > An alternative that I've seen downstream is to define PMIC nodes in >> >> > the root of a dtsi file (not in the root of DT, i.e. NOT under / { = }) >> >> > and do the following: >> >> > >> >> > &spmi_busN { >> >> > #include "pmABCDX.dtsi" >> >> > }; >> >> > >> >> > Which is "okay", but has the visible downside of having to define t= he >> >> > temp alarm thermal zone in each board's DT separately (and doing >> >> > mid-file includes which is.. fine I guess, but also something we av= oided >> >> > upstream for the longest time) >> >> > >> >> > >> >> > Both are less than ideal when it comes to altering the SID under >> >> > "interrupts", fixing that would help immensely. We were hoping to >> >> > leverage something like Johan's work on drivers/mfd/qcom-pm8008.c, >> >> > but that seems like a longer term project. >> >> > >> >> > Please voice your opinions >> >>=20 >> >> Since nobody else jumped in, how can we continue? >> >>=20 >> >> One janky solution in my mind is somewhat similar to the PMxxxx_SID >> >> defines, doing something like "#define PM7550_SPMI spmi_bus0" and the= n >> >> using "&PM7550_SPMI {}" in the dtsi. I didn't try it so not sure that >> >> actually works but something like this should I imagine. >> >>=20 >> >> But fortunately my Milos device doesn't have the problem that it >> >> actually uses both SPMI busses for different PMICs, so similar to oth= er >> >> SoCs that already have two SPMI busses, I could somewhat ignore the >> >> problem and let someone else figure out how to actually place PMICs o= n >> >> spmi_bus0 and spmi_bus1 if they have such a hardware. >> > >> > I'd say, ignore it for now. >>=20 >> You mean ignoring that there's a second SPMI bus on this SoC, and just >> modelling one with the label "spmi_bus"? Or something else? >>=20 >>=20 >> I have also actually tried out the C define solution that I was writing >> about in my previous email and this is actually working, see diff below. >> In my opinion it just expands on what we have with the SID defines, so >> shouldn't be tooo unacceptable :) > > I think we tried previously using C preprocessor to rework SID handling > and it wasn't accepted by DT maintainers. I don't know anything about that, but yeah... > > I'd say, ignore the second bus for now, unless it gets actually used for > major PMICs. The only 'problem' with this is once we do figure out a solution, the SoC bindings will change, so both dt-bindings and dtsi needs to be updated. But that's the case also for sm8550 and friends that currently ignore the second SPMI bus upstream. On FP6 again, it's definitely not a problem since everything's just on the first SPMI bus anyways. So then I'll revert the change to compatible =3D "qcom,milos-spmi-pmic-arb"= , "qcom,x1e80100-spmi-pmic-arb"; plus associated subnodes for the next revision. Regards Luca