Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp28115rdb; Fri, 29 Sep 2023 15:27:42 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEPi40lkeqzG88pd1P0cvwtsQYi5/vDMKAwWmOBUBeevez+c2GyJcbjRIWiWi+FUf668Ztx X-Received: by 2002:a17:90a:5217:b0:274:566a:3477 with SMTP id v23-20020a17090a521700b00274566a3477mr5153908pjh.39.1696026462507; Fri, 29 Sep 2023 15:27:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696026462; cv=none; d=google.com; s=arc-20160816; b=FMUDPPYbRZWwTicdEPWwhy8la+7xjumUTLa6ZXb91oXBobXnGC5ay6i8gDEr6P0n08 UvoEDxLZQEjDRS0Od3MAH8SM3VWImyE/J5nh8wsRW647A9QUkaqkIhXx+dMWgXeli/b+ ux18CdF11ssHkawUbiVkCvPnPE7fTMARae1HSJ5h9KldHpNkm962ikNfTLbpmGZhM9Ez Oy/l01VnIFZYI8VLjttNic5enoOUpuFt0wZmWrQ1wlLu4ITH6KmIKlk8NopMXvwskBv+ PJL6bTckhdUOf4fiJpDmOwrQCO9+2pWYcEi9Armn7dT79F0rCcWDNDuImfRB/gEFmSO1 xcbA== 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:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=+JnHwM58QYMx5KAYuIRR4soj4Wvym3trDgG+7yy7IYc=; fh=txWW7KzDndCkAlunZ/ZKYIognu8zx/YgRrkhsO5LEOs=; b=MPkcIcbqFFautCLk0EyMmlfvWnzd+L0AxaDxHnBPIvgEj5XJnHHVPFT9ZKbjvQ1ohe 5ta2md2WB33C0xNp18Ew+BNzxqGTNQ32ZqjpDfILggPOhMnJHQFZMNRaOO3eUtEOrrsg L2dvM5eBbL3phgQeOjYP0P5YH9cAD9LLMo6X3xvuBDcAjE6cM0OiTru3ci42VfzAAp6d j0iYl7YUU1FabBW+AqvdglQjmqethAW3bvVAzEls5UINnUVZ5Gop6iNfcXG+rzK3xJlF +gvQeHL+vd7Tfybvx/vb2sBk9Ch+PdFs/CwpRIQ5p53yYEmRKxLQNjGl5jAbbMqhkRzU bVTQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="Tgj/FJmf"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 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 howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id q6-20020a17090a2dc600b00274681ee3adsi2314127pjm.8.2023.09.29.15.27.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Sep 2023 15:27:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="Tgj/FJmf"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 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 howler.vger.email (Postfix) with ESMTP id 8310C8026BA2; Fri, 29 Sep 2023 08:22:29 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233637AbjI2PWS (ORCPT + 99 others); Fri, 29 Sep 2023 11:22:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58388 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233592AbjI2PWN (ORCPT ); Fri, 29 Sep 2023 11:22:13 -0400 Received: from mail-wm1-x32d.google.com (mail-wm1-x32d.google.com [IPv6:2a00:1450:4864:20::32d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 207A21BB for ; Fri, 29 Sep 2023 08:22:10 -0700 (PDT) Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-406618d0992so3864895e9.0 for ; Fri, 29 Sep 2023 08:22:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1696000928; x=1696605728; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=+JnHwM58QYMx5KAYuIRR4soj4Wvym3trDgG+7yy7IYc=; b=Tgj/FJmfNgjHixtlKW+mSV/eTr2w9kabcGE6ECigKjfGAcdR4FX9qXfJpTqm96teMR ckk4ap1wOFE7lGgjDPDlX+55SN+botgwAvzUZrtbWhDK2NuA7b/wORcyWmxSqUSlpz9h fOxc3MOPeFAVP0ZSne0NKFaSzoQQsnv8XYkFFQ81T0BF7wcZ7D1RiNcbje9R7HK85thy zi5Pc83MOis3NoNzHUYRWbiCAWW36vsWY0qkBfGRYd87rV2RFOV6fcQ+k0lGySlCJgTv cmN+hSNsGSqnAscUKDHmeVbAl9E3NmbKLvXlRXfHUQ5Sy8sf/Rhe2R3UVliuBqCmljpY wdag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696000928; x=1696605728; h=content-transfer-encoding:in-reply-to: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=+JnHwM58QYMx5KAYuIRR4soj4Wvym3trDgG+7yy7IYc=; b=meXzKabfLTHbigRl4ReJg/IDLZjRsH6AaRH+SbEUWd/BBVyLwDa0LeISH3KjtEn0ov x5CQ+2pux1ZBhwLuv5XRN7g/6PJuFT+ayzzI+KrQVAJhKXEDpnXZhGmOmxm4RUWm9uk3 eVaA+a7SPC/XSOb02fv+rIi+uWzlkKrxMGy8cXyswJYRCj0bxtXWoZs9TCp/km4D806S mcG/PycBVPLnNSr8TE7fNkmgtfNn2CQC35o5ca1BjYbytwVXq7Y4Eutb9JCtt2kb7X22 fSNdrUTwdOAP0ZlAcRf3rQDVnURMsXFPEjjuoU5bWJYqtjUnPsRtjlbrnfI7aF74vABe 5c1g== X-Gm-Message-State: AOJu0YyuFIoZjIHMndcI6OmwTLEFtBW3CMurGiB+rzwPVEJwToKVwbHC Do3RjqWwXKVJpIrvi7avryZFsA== X-Received: by 2002:a05:600c:1d17:b0:406:545a:f8fe with SMTP id l23-20020a05600c1d1700b00406545af8femr4001499wms.29.1696000928477; Fri, 29 Sep 2023 08:22:08 -0700 (PDT) Received: from [192.168.0.162] (188-141-3-169.dynamic.upc.ie. [188.141.3.169]) by smtp.gmail.com with ESMTPSA id f7-20020a7bcc07000000b004053a2138bfsm1637486wmh.12.2023.09.29.08.22.07 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 29 Sep 2023 08:22:08 -0700 (PDT) Message-ID: Date: Fri, 29 Sep 2023 16:22:06 +0100 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: Konrad Dybcio , Luca Weiss , Andy Gross , Bjorn Andersson , Loic Poulain , Robert Foss , Andi Shyti , Rob Herring , Krzysztof Kozlowski , Conor Dooley , cros-qcom-dts-watchers@chromium.org, Bryan O'Donoghue 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: Bryan O'Donoghue In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed 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 (howler.vger.email [0.0.0.0]); Fri, 29 Sep 2023 08:22:29 -0700 (PDT) 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 ymmv --- bod