Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp4180469rdh; Fri, 29 Sep 2023 13:49:55 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFgDDKlpAisj+yapf0H/b+WSNvwteKzpxATbu2a4DMWI62wS7mHt0UX4pMcAuQ3E8xdhDwi X-Received: by 2002:a05:6a21:32a1:b0:13a:6bca:7a84 with SMTP id yt33-20020a056a2132a100b0013a6bca7a84mr6431378pzb.44.1696020595405; Fri, 29 Sep 2023 13:49:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696020595; cv=none; d=google.com; s=arc-20160816; b=DjC7iptF+1uMJZJWQVslQHqhDhZQZVGI6B8Jbzqw9X5XQzVwMcbucq8KVuhv9t/PYa XhR8SjL9aHRe0BYiV2RjH0JCDv8xDWpENPWNai4CUQSZg+w8vti8wIQ02Ss0Huq+XBSY 5Gw1k7ZFADLqTa4aU3ZHu8VgEJjBzeYuZJhq9n230OKmr8dOTsvcdF/COGJoAyeY6lOs OOYoD0edc2B/9eCkn3vs9/Zs6QQu/7Lnar1SoKi4Yuo354n2GpLtLzmVw9BNViSAx6mr bFtk+Ptc5z46+WX2ar31ZqTyouEkRJAhELxQKA6SG0xtSvQxvSw1R0wyjuzwnPYz8HhT DGrw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:autocrypt :from:references:cc:to:content-language:subject:user-agent :mime-version:date:message-id:dkim-signature; bh=BRjRxESnxGZ8aiamezaiD8zKeBhrLQcAQ0nK38FQ9LE=; fh=yr+Vl7cqNvZ39m8V5SqLI9ANrMkfONtXrwFR7A/ANKY=; b=F/x4YHlp0YfcQfsQU0sj0KzU9i3S8q5v433CkjH2i2qykQGoBWLeItuP7c1rqOzr0T q2KC53WZ1BV1ScDVoEnP9KKCCI/8AT7mxFmP8Ksm7qIWnxNoS4EmbTtQfLZSe5ZXZmt0 lfHu94ZNgU9EFHVBoHPSbLtnuuKyBpA3FUlv4OFu2po5gZLMrlhEjPItsLnDSLH54SHb 9l8iDpZZbSA1BNqIJq3bBHPkIedzOTalMgIXAAToSXq9PX/eY85NDKX/Dt1A0uyIOnS/ aWVUZ5eksRVKtOb4Oaaqh4LfZAHSwYxPkPHWDJoyRqR2blmUTaCHxEA8SEIZN/bZbNQk Z+gA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Rd1gHtLY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id w4-20020a634744000000b0057763d820d7si21757314pgk.835.2023.09.29.13.49.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Sep 2023 13:49:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Rd1gHtLY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 42C1E81B93F0; Fri, 29 Sep 2023 08:26:17 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233687AbjI2P0M (ORCPT + 99 others); Fri, 29 Sep 2023 11:26:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53202 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233665AbjI2P0I (ORCPT ); Fri, 29 Sep 2023 11:26:08 -0400 Received: from mail-ej1-x62a.google.com (mail-ej1-x62a.google.com [IPv6:2a00:1450:4864:20::62a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AC6541AE for ; Fri, 29 Sep 2023 08:26:02 -0700 (PDT) Received: by mail-ej1-x62a.google.com with SMTP id a640c23a62f3a-9b281a2aa94so1310442066b.2 for ; Fri, 29 Sep 2023 08:26:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1696001161; x=1696605961; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:autocrypt:from:references:cc :to:content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=BRjRxESnxGZ8aiamezaiD8zKeBhrLQcAQ0nK38FQ9LE=; b=Rd1gHtLYa8ab5kQ3+qLWS91uGfAZlX5aHBuXajBLq84UMocKXtDgwgAL5mqB68TQyh AXuawrULy5RTRMnrjTGel5y+PR75k4j8ph+edShzxzmn0TRTG6YZ6F6zhtzWitlzN9pP 7Qq1lb8NaIfZ8d0kgzWUnn+Rpd3YB/aG69a2RFEChpwTbo8E4CQgqLfzj0uDOwSb49/N vWlnOXsiqU6UvawXRF61LHsbjaeX92Q0VAfo7kaVMUU94wFqLBLKx8Dcx+09JlgjpJc8 7Ue9MjmWhhRCP0Hb/AFyz479rzceSQGgzK8pgO59OFkXOrgCGPP+leO6OaUd29oPO1qa bdDg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696001161; x=1696605961; h=content-transfer-encoding:in-reply-to:autocrypt:from:references:cc :to:content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=BRjRxESnxGZ8aiamezaiD8zKeBhrLQcAQ0nK38FQ9LE=; b=ZRvA07aHTJraLENJZETHGkh87EFvR5A6rtbH/pApk2FcIYGXsXlRBpF0kbAKTJckK9 8cKbG4AvZCRPc+TMzTiICEXPwoovhyLoc+B0e8fVj5Jr2mcRdG/RkuXoP+ktU+DeKcA+ 2yN3SekgTpAfJ52jdJ/58+x6vl/m0AmBdZL58MAT5C7USNMYJjLl3tKvKfJCa3PqFVCx jLe+jLcCgNW2auy30OnI8Ch3FehCKQ3XgxeiUa3TsHTcDTyTi6HItoKVXIgMa9lQ624/ wxW1l9g5Gnnk7NXeK4O1qRPj+0tKOHE174J1sdY3GI7VRtA3EAUAkwJA8pgflL5f3rJd WFPQ== X-Gm-Message-State: AOJu0YyGx9CFxvyYn1t2plslmlf30SIwnEU915TL1SgT6FAPh5anWMfY wEHIxDekIcNsZByF/VgUvL6kmw== X-Received: by 2002:a17:906:8455:b0:9ae:6a8b:f8aa with SMTP id e21-20020a170906845500b009ae6a8bf8aamr4269613ejy.26.1696001160804; Fri, 29 Sep 2023 08:26:00 -0700 (PDT) Received: from [192.168.33.189] (178235177217.dynamic-4-waw-k-1-1-0.vectranet.pl. [178.235.177.217]) by smtp.gmail.com with ESMTPSA id y22-20020a170906449600b009adc77fe165sm12388062ejo.118.2023.09.29.08.25.58 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 29 Sep 2023 08:26:00 -0700 (PDT) Message-ID: Date: Fri, 29 Sep 2023 17:25:57 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 2/3] arm64: dts: qcom: sc7280: Add Camera Control Interface busses Content-Language: en-US To: Bryan O'Donoghue , Luca Weiss , Andy Gross , Bjorn Andersson , Loic Poulain , Robert Foss , Andi Shyti , Rob Herring , Krzysztof Kozlowski , Conor Dooley , cros-qcom-dts-watchers@chromium.org Cc: ~postmarketos/upstreaming@lists.sr.ht, phone-devel@vger.kernel.org, linux-i2c@vger.kernel.org, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org References: <20230929-sc7280-cci-v1-0-16c7d386f062@fairphone.com> <20230929-sc7280-cci-v1-2-16c7d386f062@fairphone.com> <8dd470e5-ce33-3d33-98f1-e66935ca7b56@linaro.org> <1b5bd391-4bb0-44ac-88d1-e326bec4dd7d@nexus-software.ie> From: Konrad Dybcio Autocrypt: addr=konrad.dybcio@linaro.org; keydata= xsFNBF9ALYUBEADWAhxdTBWrwAgDQQzc1O/bJ5O7b6cXYxwbBd9xKP7MICh5YA0DcCjJSOum BB/OmIWU6X+LZW6P88ZmHe+KeyABLMP5s1tJNK1j4ntT7mECcWZDzafPWF4F6m4WJOG27kTJ HGWdmtO+RvadOVi6CoUDqALsmfS3MUG5Pj2Ne9+0jRg4hEnB92AyF9rW2G3qisFcwPgvatt7 TXD5E38mLyOPOUyXNj9XpDbt1hNwKQfiidmPh5e7VNAWRnW1iCMMoKqzM1Anzq7e5Afyeifz zRcQPLaqrPjnKqZGL2BKQSZDh6NkI5ZLRhhHQf61fkWcUpTp1oDC6jWVfT7hwRVIQLrrNj9G MpPzrlN4YuAqKeIer1FMt8cq64ifgTzxHzXsMcUdclzq2LTk2RXaPl6Jg/IXWqUClJHbamSk t1bfif3SnmhA6TiNvEpDKPiT3IDs42THU6ygslrBxyROQPWLI9IL1y8S6RtEh8H+NZQWZNzm UQ3imZirlPjxZtvz1BtnnBWS06e7x/UEAguj7VHCuymVgpl2Za17d1jj81YN5Rp5L9GXxkV1 aUEwONM3eCI3qcYm5JNc5X+JthZOWsbIPSC1Rhxz3JmWIwP1udr5E3oNRe9u2LIEq+wH/toH kpPDhTeMkvt4KfE5m5ercid9+ZXAqoaYLUL4HCEw+HW0DXcKDwARAQABzShLb25yYWQgRHli Y2lvIDxrb25yYWQuZHliY2lvQGxpbmFyby5vcmc+wsGOBBMBCAA4FiEEU24if9oCL2zdAAQV R4cBcg5dfFgFAmQ5bqwCGwMFCwkIBwIGFQoJCAsCBBYCAwECHgEC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SaK14JIH/DoYRfn jfFQSC8bffFjat7BQGFz4ZpRavkMUFuDirn5Tf28oc5ebe2cIHp4/kajTx/7JOxWZ80U70mA cBgEeYSrYYnX+UJsSxpzLc/0sT1eRJDEhI4XIQM4ClIzpsCIN5HnVF76UQXh3a9zpwh3dk8i bhN/URmCOTH+LHNJYN/MxY8wuukq877DWB7k86pBs5IDLAXmW8v3gIDWyIcgYqb2v8QO2Mqx YMqL7UZxVLul4/JbllsQB8F/fNI8AfttmAQL9cwo6C8yDTXKdho920W4WUR9k8NT/OBqWSyk bGqMHex48FVZhexNPYOd58EY9/7mL5u0sJmo+jTeb4JBgIbFPJCFyng4HwbniWgQJZ1WqaUC nas9J77uICis2WH7N8Bs9jy0wQYezNzqS+FxoNXmDQg2jetX8en4bO2Di7Pmx0jXA4TOb9TM izWDgYvmBE8= In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, 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 lindbergh.monkeyblade.net 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 (snail.vger.email [0.0.0.0]); Fri, 29 Sep 2023 08:26:17 -0700 (PDT) On 29.09.2023 17:22, Bryan O'Donoghue wrote: > On 29/09/2023 15:18, Konrad Dybcio wrote: >> On 29.09.2023 16:15, Bryan O'Donoghue wrote: >>> On 29/09/2023 14:35, Konrad Dybcio wrote: >>>> >>>> >>>> On 9/29/23 10:01, Luca Weiss wrote: >>>>> Add the CCI busses found on sc7280 and their pinctrl states. >>>>> >>>>> Signed-off-by: Luca Weiss >>>>> --- >>>>>    arch/arm64/boot/dts/qcom/sc7280.dtsi | 136 +++++++++++++++++++++++++++++++++++ >>>>>    1 file changed, 136 insertions(+) >>>>> >>>>> diff --git a/arch/arm64/boot/dts/qcom/sc7280.dtsi b/arch/arm64/boot/dts/qcom/sc7280.dtsi >>>>> index 66f1eb83cca7..65550de2e4ff 100644 >>>>> --- a/arch/arm64/boot/dts/qcom/sc7280.dtsi >>>>> +++ b/arch/arm64/boot/dts/qcom/sc7280.dtsi >>>>> @@ -3793,6 +3793,86 @@ videocc: clock-controller@aaf0000 { >>>>>                #power-domain-cells = <1>; >>>>>            }; >>>>> +        cci0: cci@ac4a000 { >>>>> +            compatible = "qcom,sc7280-cci", "qcom,msm8996-cci"; >>>>> +            reg = <0 0x0ac4a000 0 0x1000>; >>>>> +            interrupts = ; >>>>> +            power-domains = <&camcc CAM_CC_TITAN_TOP_GDSC>; >>>>> + >>>>> +            clocks = <&camcc CAM_CC_CAMNOC_AXI_CLK>, >>>>> +                 <&camcc CAM_CC_SLOW_AHB_CLK_SRC>, >>>>> +                 <&camcc CAM_CC_CPAS_AHB_CLK>, >>>>> +                 <&camcc CAM_CC_CCI_0_CLK>, >>>>> +                 <&camcc CAM_CC_CCI_0_CLK_SRC>; >>>>> +            clock-names = "camnoc_axi", >>>>> +                      "slow_ahb_src", >>>>> +                      "cpas_ahb", >>>>> +                      "cci", >>>>> +                      "cci_src"; >>>> I guess this is more of a question to e.g. Bryan, but are all of these clocks actually necessary? >>>> >>>> Konrad >>> Hmm its a good question, we generally take the approach of adopting all of the downstream clocks for these camera interfaces verbatim. >>> >>> The clock plan for this part only calls out cci_X_clk and cci_x_clk_src for the CCI however we know that to be incomplete since we *absolutely* need to have the AXI for the block clocked to access those registers, same deal with the AHB bus. >>> >>> AXI: registers >>> AHB: data >>> >>> In the above list the only clock you might conceivably not need is CPAS_AHB_CLK. >>> >>> Let me zap that clock from sdm845 since I have an rb3 right in front of me and see what happens. >>> >>> Crash and reset >>> >>> --- a/arch/arm64/boot/dts/qcom/sdm845.dtsi >>> +++ b/arch/arm64/boot/dts/qcom/sdm845.dtsi >>> @@ -4402,13 +4402,11 @@ cci: cci@ac4a000 { >>>                          clocks = <&clock_camcc CAM_CC_CAMNOC_AXI_CLK>, >>>                                  <&clock_camcc CAM_CC_SOC_AHB_CLK>, >>>                                  <&clock_camcc CAM_CC_SLOW_AHB_CLK_SRC>, >>> -                               <&clock_camcc CAM_CC_CPAS_AHB_CLK>, >>>                                  <&clock_camcc CAM_CC_CCI_CLK>, >>>                                  <&clock_camcc CAM_CC_CCI_CLK_SRC>; >>>                          clock-names = "camnoc_axi", >>>                                  "soc_ahb", >>>                                  "slow_ahb_src", >>> -                               "cpas_ahb", >>>                                  "cci", >>>                                  "cci_src"; >>> >>> >>> I think the list is good tbh >> WDYT about camcc consuming ahb, like dispcc does? >> AXI, hmm.. not quite sure what to do with it >> >> Konrad > > Hmm on which platform, camcc clock depds on sdm845 looks very sparse to me. > > 8550 OTOH > > dispcc: clock-controller@af00000 { >        compatible = "qcom,sm8550-dispcc"; >        reg = <0 0x0af00000 0 0x20000>; >        clocks = <&bi_tcxo_div2>, >                 <&bi_tcxo_ao_div2>, >                 <&gcc GCC_DISP_AHB_CLK>, > > videocc: clock-controller@aaf0000 { >        compatible = "qcom,sm8550-videocc"; >        reg = <0 0x0aaf0000 0 0x10000>; >        clocks = <&bi_tcxo_div2>, >                 <&gcc GCC_VIDEO_AHB_CLK>; > > sm8250 > > camcc: clock-controller@ad00000 { >         compatible = "qcom,sm8250-camcc"; >         reg = <0 0x0ad00000 0 0x10000>; >         clocks = <&gcc GCC_CAMERA_AHB_CLK>, > > I think those DISP_AHB, VIDEO_AHB_CLK, CAMERA_AHB_CLKs should live in the display, video and camss blocks i.e. they are not clocks that you require to access the clock controller registers themselves... > > I'm seeing for the most part these MEDIAIPBLOCK_AHB_CLKs don't come from the GCC AHB clock but from another root clock generator. > > bi_tcxo -> > cam_cc_pll0_out_main -> > cam_cc_pll0_out_even -> > cam_cc_pll0_out_odd -> > cam_cc_pll2_out_main -> >                         cam_cc_slow_ahb_clk_src -> >                                    camcc_bps_ahb_clk >                                    camcc_ipe_0_ahb_clk >                                    ... >                                    camcc_core_ahb_clk > > Lets see what happens to sm8250 if we remove CAMERA_AHB_CLK from the camera clock controller @ camcc: clock-controller@ad00000 {} I don't believe that is required. > > ... > > Yep.. does SFA > > diff --git a/arch/arm64/boot/dts/qcom/sm8250.dtsi b/arch/arm64/boot/dts/qcom/sm8250.dtsi > index 1efa07f2caff4..1e7d9ee25eeae 100644 > --- a/arch/arm64/boot/dts/qcom/sm8250.dtsi > +++ b/arch/arm64/boot/dts/qcom/sm8250.dtsi > @@ -4172,11 +4172,10 @@ port@5 { >                 camcc: clock-controller@ad00000 { >                         compatible = "qcom,sm8250-camcc"; >                         reg = <0 0x0ad00000 0 0x10000>; > -                       clocks = <&gcc GCC_CAMERA_AHB_CLK>, > -                                <&rpmhcc RPMH_CXO_CLK>, > +                       clocks = <&rpmhcc RPMH_CXO_CLK>, >                                  <&rpmhcc RPMH_CXO_CLK_A>, >                                  <&sleep_clk>; > -                       clock-names = "iface", "bi_tcxo", "bi_tcxo_ao", "sleep_clk"; > +                       clock-names = "bi_tcxo", "bi_tcxo_ao", "sleep_clk"; >                         power-domains = <&rpmhpd SM8250_MMCX>; >                         required-opps = <&rpmhpd_opp_low_svs>; >                         status = "disabled"; > > Not actually a required clock for the clock controller. > > I suspect the same is true for dispcc and videocc though it would also mean the respective drivers would need to switch on <&gcc DISPx_CAMERA_AHB_CLK> or <&gcc GCC_VIDEO_AHB_CLK> prior to accessing registers inside the ip blocks which may not currently be the case. > > Feels like a bit of a contrary answer but my reading is the GCC_IPBLOCK_AHB_CLK clocks belong in the drivers not the clock controllers..  or at least that's true for sm8250/camcc I believe the idea here would be that registering GCC_IP_AHB_CLK as a pm_clk for the clock controller would make that clock turn on when IPBLOCK_CC is accessed (e.g. when we turn on IPBLOCK_CORE_CLK), so that it doesn't need to be duplicated in each and every end device. Konrad