Message ID | bd3350e3b0b02669cffa4bdaf9a0a1d8ae9072d1.1681742910.git.quic_schowdhu@quicinc.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp2199059vqo; Mon, 17 Apr 2023 08:13:11 -0700 (PDT) X-Google-Smtp-Source: AKy350ahcjBXI3GcB/jwwgOLt/yjBT2y5vJtOQHyVx9i/ygS6j85KofsGIbCQiHLOd3At6JXqdsT X-Received: by 2002:a05:6a20:2907:b0:e6:f7e8:1e4d with SMTP id t7-20020a056a20290700b000e6f7e81e4dmr14195208pzf.33.1681744391025; Mon, 17 Apr 2023 08:13:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681744391; cv=none; d=google.com; s=arc-20160816; b=RwTMV9g2FHazV47q7VjKNOR552COm1lTPkF1QGGN2KvA5aeQtamB2UWodb2BP8SLLd 5Q8YJDF14UjnrkiqUo/jDZDXmboLp8EJ3Ct7Z1j78J07Dly8EReT2JyMJGwyaKlu90Vd AjYX8rsXnyZkpLWgYtHYvSUtGDFCThLXKB7vawz4UwIv0+kZevD3HXM+m6QsWfnIT6Nx 5gqWT+VReFYlWPxRcsmEEdA9kPLM2PiEQ+JBD6QI4ssLJEIOhNgX3NcscpwGPQ23amlf i+9Nuwc7ubPxWjhAcSQLy3aqbE1kKH/VPxC/rPWVCIGW6ECs+9FMaAUY6/EP2haf0tkl Flrw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=ylu9sT18CzYuxKR77gvxM8O+qT0i9HJxTtsyYBFM95Y=; b=rxeXDgzb5RkH+fkQl585sIEOAZ5pbn46pKedPTQjGim5C2ay1tfkeyTKrlvo0Na0xS XbDBUGR8hESK4coUlUfrpH81YvYk42stO2KM9NbpMY1muOOvEwj/XgmfgXK0l1Mpfofu APAjbc6vGoR1RszfzFrEbJeZJfSC6yBXqUpCt43vO53MMD2wjSyQYCP9mtevPuQ3UAAU f4bIX79WJ3CgVm9bWWYJxku8hC/IQFnqhyOF0vHp7rN/9vfgRQlj1tWWZdzhHbIBPsVk 7ByVGdsZN1RnDSB/fFxh2JRSXW358aoEOrAm6tH8oIZBwaXS3m23WWDM9Vccv6RfJ0D0 C4SQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=j4Hs9Oq1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w3-20020a655343000000b00517f0c53076si12198783pgr.463.2023.04.17.08.12.58; Mon, 17 Apr 2023 08:13:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=j4Hs9Oq1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230102AbjDQPLE (ORCPT <rfc822;yuanzuo1009@gmail.com> + 99 others); Mon, 17 Apr 2023 11:11:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34198 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230283AbjDQPK4 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 17 Apr 2023 11:10:56 -0400 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AEF577EEB; Mon, 17 Apr 2023 08:10:54 -0700 (PDT) Received: from pps.filterd (m0279864.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 33HCvTM3005790; Mon, 17 Apr 2023 15:10:47 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=qcppdkim1; bh=ylu9sT18CzYuxKR77gvxM8O+qT0i9HJxTtsyYBFM95Y=; b=j4Hs9Oq1Rq2ofdybO1u0WGauqBUPpJ8YnYxh7o0gDydyodlJGxagmfcHJDs6XAg2R8pW pnzBCA4k5hg5fJZXagO6uW+vNTnrMf+yYLhZuI9iYtQ1G3Gb940ibFPr99EaBZKmhHYv urOnnoKnpjNbI4QOwRNj+RtX3IAojk0XW7j5GPsDNQvtjfzddoMMKySmMXieLUVmL1gx m459CqjE0YoEHklTjbCSeTgp5+57xN8x5lSUoBdyd2g8H6TDerJVdJzjWjpdFh6TWIL/ xMYQvpIaKWWeMgIT62GEKmoz154xBU8eXVN3Uatf6Nbmf9VOvCcbYsq4u9izJhf0J8ml jg== Received: from nalasppmta05.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3q12strxg2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 17 Apr 2023 15:10:47 +0000 Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA05.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 33HFAkxg002153 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 17 Apr 2023 15:10:46 GMT Received: from blr-ubuntu-525.qualcomm.com (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.42; Mon, 17 Apr 2023 08:10:42 -0700 From: Souradeep Chowdhury <quic_schowdhu@quicinc.com> To: Andy Gross <agross@kernel.org>, Konrad Dybcio <konrad.dybcio@somainline.org>, Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>, Bjorn Andersson <andersson@kernel.org>, Rob Herring <robh+dt@kernel.org> CC: <linux-arm-kernel@lists.infradead.org>, <linux-kernel@vger.kernel.org>, <linux-arm-msm@vger.kernel.org>, <devicetree@vger.kernel.org>, Sibi Sankar <quic_sibis@quicinc.com>, Rajendra Nayak <quic_rjendra@quicinc.com>, Souradeep Chowdhury <quic_schowdhu@quicinc.com> Subject: [PATCH V4 1/3] dt-bindings: sram: qcom,imem: Add Boot Stat region within IMEM Date: Mon, 17 Apr 2023 20:38:14 +0530 Message-ID: <bd3350e3b0b02669cffa4bdaf9a0a1d8ae9072d1.1681742910.git.quic_schowdhu@quicinc.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <cover.1681742910.git.quic_schowdhu@quicinc.com> References: <cover.1681742910.git.quic_schowdhu@quicinc.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nalasex01a.na.qualcomm.com (10.47.209.196) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: tO0o0Zf1dx0fE6hfD_qLTtYwB7-SKw1o X-Proofpoint-ORIG-GUID: tO0o0Zf1dx0fE6hfD_qLTtYwB7-SKw1o X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-04-17_10,2023-04-17_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 suspectscore=0 mlxscore=0 impostorscore=0 adultscore=0 bulkscore=0 mlxlogscore=999 phishscore=0 clxscore=1015 spamscore=0 malwarescore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2303200000 definitions=main-2304170136 X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1763436806213361933?= X-GMAIL-MSGID: =?utf-8?q?1763436806213361933?= |
Series |
soc: qcom: boot_stats: Add driver support for boot_stats
|
|
Commit Message
Souradeep Chowdhury
April 17, 2023, 3:08 p.m. UTC
All Qualcomm bootloaders log useful timestamp information related
to bootloader stats in the IMEM region. Add the child node within
IMEM for the boot stat region containing register address and
compatible string.
Signed-off-by: Souradeep Chowdhury <quic_schowdhu@quicinc.com>
---
.../devicetree/bindings/sram/qcom,imem.yaml | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)
Comments
On 17/04/2023 17:08, Souradeep Chowdhury wrote: > All Qualcomm bootloaders log useful timestamp information related > to bootloader stats in the IMEM region. Add the child node within > IMEM for the boot stat region containing register address and > compatible string. > > Signed-off-by: Souradeep Chowdhury <quic_schowdhu@quicinc.com> Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Best regards, Krzysztof
On 17/04/2023 16:08, Souradeep Chowdhury wrote: > All Qualcomm bootloaders log useful timestamp information related > to bootloader stats in the IMEM region. Add the child node within > IMEM for the boot stat region containing register address and > compatible string. > > Signed-off-by: Souradeep Chowdhury <quic_schowdhu@quicinc.com> > --- > .../devicetree/bindings/sram/qcom,imem.yaml | 22 ++++++++++++++++++++++ > 1 file changed, 22 insertions(+) > > diff --git a/Documentation/devicetree/bindings/sram/qcom,imem.yaml b/Documentation/devicetree/bindings/sram/qcom,imem.yaml > index ba694ce..d028bed 100644 > --- a/Documentation/devicetree/bindings/sram/qcom,imem.yaml > +++ b/Documentation/devicetree/bindings/sram/qcom,imem.yaml > @@ -49,6 +49,28 @@ patternProperties: > $ref: /schemas/remoteproc/qcom,pil-info.yaml# > description: Peripheral image loader relocation region > > + "^stats@[0-9a-f]+$": > + type: object > + description: > + Imem region dedicated for storing timestamps related > + information regarding bootstats. > + > + additionalProperties: false > + > + properties: > + compatible: > + items: > + - enum: > + - qcom,sm8450-bootstats This region isn't exclusive to sm8450, it exists also on sdm845 and presumably other platforms. Is there any need for an SoC specific compatible? > + - const: qcom,imem-bootstats > + > + reg: > + maxItems: 1 > + > + required: > + - compatible > + - reg > + > required: > - compatible > - reg > -- > 2.7.4 >
On 5/4/2023 3:40 AM, Caleb Connolly wrote: > > > On 17/04/2023 16:08, Souradeep Chowdhury wrote: >> All Qualcomm bootloaders log useful timestamp information related >> to bootloader stats in the IMEM region. Add the child node within >> IMEM for the boot stat region containing register address and >> compatible string. >> >> Signed-off-by: Souradeep Chowdhury <quic_schowdhu@quicinc.com> >> --- >> .../devicetree/bindings/sram/qcom,imem.yaml | 22 ++++++++++++++++++++++ >> 1 file changed, 22 insertions(+) >> >> diff --git a/Documentation/devicetree/bindings/sram/qcom,imem.yaml b/Documentation/devicetree/bindings/sram/qcom,imem.yaml >> index ba694ce..d028bed 100644 >> --- a/Documentation/devicetree/bindings/sram/qcom,imem.yaml >> +++ b/Documentation/devicetree/bindings/sram/qcom,imem.yaml >> @@ -49,6 +49,28 @@ patternProperties: >> $ref: /schemas/remoteproc/qcom,pil-info.yaml# >> description: Peripheral image loader relocation region >> >> + "^stats@[0-9a-f]+$": >> + type: object >> + description: >> + Imem region dedicated for storing timestamps related >> + information regarding bootstats. >> + >> + additionalProperties: false >> + >> + properties: >> + compatible: >> + items: >> + - enum: >> + - qcom,sm8450-bootstats > > This region isn't exclusive to sm8450, it exists also on sdm845 and > presumably other platforms. Is there any need for an SoC specific > compatible? Yes SOC specific compatibles are needed for device tree nodes. This has been clarified as per prior discussion on this patch series. https://lore.kernel.org/lkml/e1d53083-82b6-d193-517e-02af281a066a@linaro.org/ > >> + - const: qcom,imem-bootstats >> + >> + reg: >> + maxItems: 1 >> + >> + required: >> + - compatible >> + - reg >> + >> required: >> - compatible >> - reg >> -- >> 2.7.4 >> >
On 04/05/2023 00:10, Caleb Connolly wrote: > > > On 17/04/2023 16:08, Souradeep Chowdhury wrote: >> All Qualcomm bootloaders log useful timestamp information related >> to bootloader stats in the IMEM region. Add the child node within >> IMEM for the boot stat region containing register address and >> compatible string. >> >> Signed-off-by: Souradeep Chowdhury <quic_schowdhu@quicinc.com> >> --- >> .../devicetree/bindings/sram/qcom,imem.yaml | 22 ++++++++++++++++++++++ >> 1 file changed, 22 insertions(+) >> >> diff --git a/Documentation/devicetree/bindings/sram/qcom,imem.yaml b/Documentation/devicetree/bindings/sram/qcom,imem.yaml >> index ba694ce..d028bed 100644 >> --- a/Documentation/devicetree/bindings/sram/qcom,imem.yaml >> +++ b/Documentation/devicetree/bindings/sram/qcom,imem.yaml >> @@ -49,6 +49,28 @@ patternProperties: >> $ref: /schemas/remoteproc/qcom,pil-info.yaml# >> description: Peripheral image loader relocation region >> >> + "^stats@[0-9a-f]+$": >> + type: object >> + description: >> + Imem region dedicated for storing timestamps related >> + information regarding bootstats. >> + >> + additionalProperties: false >> + >> + properties: >> + compatible: >> + items: >> + - enum: >> + - qcom,sm8450-bootstats > > This region isn't exclusive to sm8450, it exists also on sdm845 and > presumably other platforms. Is there any need for an SoC specific > compatible? Yes. https://elixir.bootlin.com/linux/v6.1-rc1/source/Documentation/devicetree/bindings/writing-bindings.rst#L42 Also see many discussions on LKML about this. Best regards, Krzysztof
On 04/05/2023 09:26, Krzysztof Kozlowski wrote: > On 04/05/2023 00:10, Caleb Connolly wrote: >> >> >> On 17/04/2023 16:08, Souradeep Chowdhury wrote: >>> All Qualcomm bootloaders log useful timestamp information related >>> to bootloader stats in the IMEM region. Add the child node within >>> IMEM for the boot stat region containing register address and >>> compatible string. >>> >>> Signed-off-by: Souradeep Chowdhury <quic_schowdhu@quicinc.com> >>> --- >>> .../devicetree/bindings/sram/qcom,imem.yaml | 22 ++++++++++++++++++++++ >>> 1 file changed, 22 insertions(+) >>> >>> diff --git a/Documentation/devicetree/bindings/sram/qcom,imem.yaml b/Documentation/devicetree/bindings/sram/qcom,imem.yaml >>> index ba694ce..d028bed 100644 >>> --- a/Documentation/devicetree/bindings/sram/qcom,imem.yaml >>> +++ b/Documentation/devicetree/bindings/sram/qcom,imem.yaml >>> @@ -49,6 +49,28 @@ patternProperties: >>> $ref: /schemas/remoteproc/qcom,pil-info.yaml# >>> description: Peripheral image loader relocation region >>> >>> + "^stats@[0-9a-f]+$": >>> + type: object >>> + description: >>> + Imem region dedicated for storing timestamps related >>> + information regarding bootstats. >>> + >>> + additionalProperties: false >>> + >>> + properties: >>> + compatible: >>> + items: >>> + - enum: >>> + - qcom,sm8450-bootstats >> >> This region isn't exclusive to sm8450, it exists also on sdm845 and >> presumably other platforms. Is there any need for an SoC specific >> compatible? > > Yes. > https://elixir.bootlin.com/linux/v6.1-rc1/source/Documentation/devicetree/bindings/writing-bindings.rst#L42 > > Also see many discussions on LKML about this. I checked the closest relative: qcom_stats.c driver. It defines several platform-specific overrides and also a generic "qcom,rpm-stats" / "qcom,rpmh-stats" drivers.
On 04/05/2023 09:26, Krzysztof Kozlowski wrote: > On 04/05/2023 00:10, Caleb Connolly wrote: >> >> >> On 17/04/2023 16:08, Souradeep Chowdhury wrote: >>> All Qualcomm bootloaders log useful timestamp information related >>> to bootloader stats in the IMEM region. Add the child node within >>> IMEM for the boot stat region containing register address and >>> compatible string. >>> >>> Signed-off-by: Souradeep Chowdhury <quic_schowdhu@quicinc.com> >>> --- >>> .../devicetree/bindings/sram/qcom,imem.yaml | 22 ++++++++++++++++++++++ >>> 1 file changed, 22 insertions(+) >>> >>> diff --git a/Documentation/devicetree/bindings/sram/qcom,imem.yaml b/Documentation/devicetree/bindings/sram/qcom,imem.yaml >>> index ba694ce..d028bed 100644 >>> --- a/Documentation/devicetree/bindings/sram/qcom,imem.yaml >>> +++ b/Documentation/devicetree/bindings/sram/qcom,imem.yaml >>> @@ -49,6 +49,28 @@ patternProperties: >>> $ref: /schemas/remoteproc/qcom,pil-info.yaml# >>> description: Peripheral image loader relocation region >>> >>> + "^stats@[0-9a-f]+$": >>> + type: object >>> + description: >>> + Imem region dedicated for storing timestamps related >>> + information regarding bootstats. >>> + >>> + additionalProperties: false >>> + >>> + properties: >>> + compatible: >>> + items: >>> + - enum: >>> + - qcom,sm8450-bootstats >> >> This region isn't exclusive to sm8450, it exists also on sdm845 and >> presumably other platforms. Is there any need for an SoC specific >> compatible? > > Yes. > https://elixir.bootlin.com/linux/v6.1-rc1/source/Documentation/devicetree/bindings/writing-bindings.rst#L42 > > Also see many discussions on LKML about this. After taking another glance at the parent device (IMEM), I start to think that we should not be defining the device at all. The imem has the SoC name in it. So I think there should be a proper driver for IMEM. Then it will instantiate the ABL stats platform device depending on the SoC compat. Also this would allow us to rewrite qcom_pil_info_init() in a way to query IMEM instead of poking into DT directly.
On 04/05/2023 17:26, Dmitry Baryshkov wrote: > On 04/05/2023 09:26, Krzysztof Kozlowski wrote: >> On 04/05/2023 00:10, Caleb Connolly wrote: >>> >>> >>> On 17/04/2023 16:08, Souradeep Chowdhury wrote: >>>> + >>>> + properties: >>>> + compatible: >>>> + items: >>>> + - enum: >>>> + - qcom,sm8450-bootstats >>> >>> This region isn't exclusive to sm8450, it exists also on sdm845 and >>> presumably other platforms. Is there any need for an SoC specific >>> compatible? >> >> Yes. >> https://elixir.bootlin.com/linux/v6.1-rc1/source/Documentation/devicetree/bindings/writing-bindings.rst#L42 >> >> Also see many discussions on LKML about this. Ah, thanks both for the clarification and apologies for the confusion. My main concern is that this binding and the associated driver work just fine on sdm845 with no additional changes. Is it acceptable then to use the qcom,sm8450-bootstats compatible there? If not, then for someone to enable this driver on sdm845 would require not just a patch to add the DT node, but also a patch to dt-bindings to add a compatible AND a patch to the driver to use it. Based on Dmitry's response on the driver patch [1], perhaps adding the catch-all "qcom,imem-bootstats" compatible to the driver would be suitable. If there are SoC specific parts in the future then match data or gating with of_device_is_compatible() can be used with the SoC specific compatible. This is how the qcom_stats driver handles things, would this be an OK solution for everyone? > > After taking another glance at the parent device (IMEM), I start to > think that we should not be defining the device at all. The imem has the > SoC name in it. So I think there should be a proper driver for IMEM. > Then it will instantiate the ABL stats platform device depending on the > SoC compat. Also this would allow us to rewrite qcom_pil_info_init() in > a way to query IMEM instead of poking into DT directly. +1 for handling this automagically in driver code, I'd be happy to look into this in the future. [1] https://lore.kernel.org/linux-arm-msm/35ac64ab-512d-1425-7a1b-6e8d3806c8a8@linaro.org/ >
diff --git a/Documentation/devicetree/bindings/sram/qcom,imem.yaml b/Documentation/devicetree/bindings/sram/qcom,imem.yaml index ba694ce..d028bed 100644 --- a/Documentation/devicetree/bindings/sram/qcom,imem.yaml +++ b/Documentation/devicetree/bindings/sram/qcom,imem.yaml @@ -49,6 +49,28 @@ patternProperties: $ref: /schemas/remoteproc/qcom,pil-info.yaml# description: Peripheral image loader relocation region + "^stats@[0-9a-f]+$": + type: object + description: + Imem region dedicated for storing timestamps related + information regarding bootstats. + + additionalProperties: false + + properties: + compatible: + items: + - enum: + - qcom,sm8450-bootstats + - const: qcom,imem-bootstats + + reg: + maxItems: 1 + + required: + - compatible + - reg + required: - compatible - reg