Message ID | 343182748e12b6a4ac57d336405c50e36fc5520c.1683628357.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 b10csp2786806vqo; Tue, 9 May 2023 04:02:00 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4nn2zXrhBk6tUWEP454/PW9bJ7DlWcZD2+ohhrPvQb5JdgaD/ulmWsU7j9ZmgY6oaiI/F7 X-Received: by 2002:aca:f054:0:b0:38c:a32:e195 with SMTP id o81-20020acaf054000000b0038c0a32e195mr1061394oih.17.1683630119944; Tue, 09 May 2023 04:01:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683630119; cv=none; d=google.com; s=arc-20160816; b=S+VIMr9zU9RLeTgxmiBFidkYkmqrLFvmPiiynK1hkl1aZm4XHFdJUg51iOCgzQIdDF IBbO3vT5m1aAujGHLRBt27bpb2hG01Fhd16pGZEFZ3jxrS90jhVKGJI3Wa3WlnIbFpFB IRGw/AQ5TdDnEcIacEe299UCPEBWNXQhoo2Pp7EDJ75SDFNUwBPvRTkiH4Sikk2Y2Poa sKRKnPrfBemacFcywZsh49gu1fqhSZ3cByqfpTZx/gdeU2vPyAyjs8XSExheJyVlXKWl 0T+MEcQrMte0QjcvOoaZ+lGNzD+RfPCKNeXgHz5Hf5UGmJpkpnFhwbNhQSnbQ+ooV6QA mxCA== 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=HQy7LZTEoXVIP8ZLz5hi/u5H3GlffVJ2WaKKK+gTzrw=; b=c2e9DMISsIkVjhRV3GoHkj2o2Ez7yiyuAFV/PxNllwA93uaYPWEqec8cVR2OBLA/fJ GifaGxRBmgFAmq32EBZ9ipztRSq7JxygReZSU2u2iKYSEEVKwUs3/IfEjQSGNvjGpcJ0 osqQhetixCD8QI5Hd9c4ilkkTwTuk0wSBV8qvMUIkbPtx/EcUzK/rPbO7iS8wV5f0kh8 YIL206qxC6X6o+TamuERjmfMYFfLkiFf6EjFLI8dVtt3UkJfixOaVBZrrZ0r9k9DC47F gCfZCEqiHmPmHbcNeHmni405f7lDXvWiSPxK0Bk94WeJY/SabX2tdKOXLiGVQLe8B2en 9RIA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=ccE7DYLg; 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 c15-20020a056808138f00b003907dc8c5ebsi1453085oiw.164.2023.05.09.04.01.45; Tue, 09 May 2023 04:01:59 -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=ccE7DYLg; 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 S235393AbjEIKxV (ORCPT <rfc822;baris.duru.linux@gmail.com> + 99 others); Tue, 9 May 2023 06:53:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46082 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235118AbjEIKxO (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 9 May 2023 06:53:14 -0400 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E53BA46A8; Tue, 9 May 2023 03:53:12 -0700 (PDT) Received: from pps.filterd (m0279863.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3496Oveh028208; Tue, 9 May 2023 10:53:04 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=HQy7LZTEoXVIP8ZLz5hi/u5H3GlffVJ2WaKKK+gTzrw=; b=ccE7DYLgeJCsFYL3P5OqNpOpWB43qQ0wzf+F+fZr617B7a0O59o0OKc/mII6xhllOwiR NnnW9q0G00kMVy+BlGcYsCTW4eOWztw+OEagwmg8iZQJ3cVqKiGLRrDEToNChr1DJy+V /tjmSpe2tEy4tPG3FFBEolfuVgYNXu/pBZjqF5dMaFH4p+R8Uu/b9eIiIOYH/jCLFJKi ZjW6Ryrj/lNnGSxddlqp0Dsc8wv8tG+oiZzUXcWZpk72c+WaA3GdIHNu3SlXbfnPhuGF cBcidKtCucxQFuoVgH7sKwWI4ZrnyyHcL/OAC2x4z9jljhhDub4kxj5nIzAwkslRwTJf mg== Received: from nalasppmta05.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3qf77h9fyv-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 09 May 2023 10:53:03 +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 349Ar3n0026676 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 9 May 2023 10:53:03 GMT Received: from hu-schowdhu-lv.qualcomm.com (10.49.16.6) 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; Tue, 9 May 2023 03:53:02 -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 V6 1/3] dt-bindings: sram: qcom,imem: Add Boot Stat region within IMEM Date: Tue, 9 May 2023 03:52:21 -0700 Message-ID: <343182748e12b6a4ac57d336405c50e36fc5520c.1683628357.git.quic_schowdhu@quicinc.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <cover.1683628357.git.quic_schowdhu@quicinc.com> References: <cover.1683628357.git.quic_schowdhu@quicinc.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.49.16.6] X-ClientProxiedBy: nalasex01a.na.qualcomm.com (10.47.209.196) 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: qCtCKY5yOViBOcNDFqwhsAegcoN-6aKC X-Proofpoint-ORIG-GUID: qCtCKY5yOViBOcNDFqwhsAegcoN-6aKC 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-05-09_06,2023-05-05_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 mlxscore=0 bulkscore=0 impostorscore=0 lowpriorityscore=0 malwarescore=0 priorityscore=1501 suspectscore=0 phishscore=0 mlxlogscore=999 adultscore=0 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2304280000 definitions=main-2305090086 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,URIBL_BLOCKED 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?1765414136394672814?= X-GMAIL-MSGID: =?utf-8?q?1765414136394672814?= |
Series |
soc: qcom: boot_stats: Add driver support for boot_stats
|
|
Commit Message
Souradeep Chowdhury
May 9, 2023, 10:52 a.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> Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> --- .../devicetree/bindings/sram/qcom,imem.yaml | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+)
Comments
On Tue, 9 May 2023 at 13:53, Souradeep Chowdhury <quic_schowdhu@quicinc.com> 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. I might have a minor vote here. Is there any reason why you have to instantiate the device from DT? It looks like a software interface. Ideally software should not be described in DT (e.g. this can be instantiated from imem driver-to-be). Or we can follow the RPM master-stats approach, where the device is a top-level device, having handle pointers to the sram regions. > > Signed-off-by: Souradeep Chowdhury <quic_schowdhu@quicinc.com> > Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> > --- > .../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 0548e8e0d30b..bb884c5c8952 100644 > --- a/Documentation/devicetree/bindings/sram/qcom,imem.yaml > +++ b/Documentation/devicetree/bindings/sram/qcom,imem.yaml > @@ -50,6 +50,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 > -- > 2.17.1 >
On 5/9/2023 5:05 PM, Dmitry Baryshkov wrote: > On Tue, 9 May 2023 at 13:53, Souradeep Chowdhury > <quic_schowdhu@quicinc.com> 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. > > I might have a minor vote here. Is there any reason why you have to > instantiate the device from DT? > It looks like a software interface. Ideally software should not be > described in DT (e.g. this can be instantiated from imem > driver-to-be). > Or we can follow the RPM master-stats approach, where the device is a > top-level device, having handle pointers to the sram regions. This is a dedicated region of IMEM reserved for storing stats related information. So it is represented as a child of IMEM, please refer to Documentation/devicetree/bindings/sram/sram.yaml which follows a similar philosophy. Also since this is a child of IMEM with a specific purpose, does it not warrant a dedicated driver? > >> >> Signed-off-by: Souradeep Chowdhury <quic_schowdhu@quicinc.com> >> Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> >> --- >> .../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 0548e8e0d30b..bb884c5c8952 100644 >> --- a/Documentation/devicetree/bindings/sram/qcom,imem.yaml >> +++ b/Documentation/devicetree/bindings/sram/qcom,imem.yaml >> @@ -50,6 +50,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 >> -- >> 2.17.1 >> > >
On Tue, 9 May 2023 at 15:21, Souradeep Chowdhury <quic_schowdhu@quicinc.com> wrote: > > > > On 5/9/2023 5:05 PM, Dmitry Baryshkov wrote: > > On Tue, 9 May 2023 at 13:53, Souradeep Chowdhury > > <quic_schowdhu@quicinc.com> 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. > > > > I might have a minor vote here. Is there any reason why you have to > > instantiate the device from DT? > > It looks like a software interface. Ideally software should not be > > described in DT (e.g. this can be instantiated from imem > > driver-to-be). > > Or we can follow the RPM master-stats approach, where the device is a > > top-level device, having handle pointers to the sram regions. > > This is a dedicated region of IMEM reserved for storing stats related > information. So it is represented as a child of IMEM, please > refer to Documentation/devicetree/bindings/sram/sram.yaml which > follows a similar philosophy. Also since this is a child of IMEM with > a specific purpose, does it not warrant a dedicated driver? I do not question a dedicated driver. I was asking about the DT node. Even the mentioned bindings file describes the SRAM regions inside the SRAM, rather than a proper device to be instantiated in the SRAM node. I'd point to the boot_stats discussions (present on the list in the last several months). > > > > >> > >> Signed-off-by: Souradeep Chowdhury <quic_schowdhu@quicinc.com> > >> Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> > >> --- > >> .../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 0548e8e0d30b..bb884c5c8952 100644 > >> --- a/Documentation/devicetree/bindings/sram/qcom,imem.yaml > >> +++ b/Documentation/devicetree/bindings/sram/qcom,imem.yaml > >> @@ -50,6 +50,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 > >> -- > >> 2.17.1 > >> > > > >
On 5/9/2023 6:35 PM, Dmitry Baryshkov wrote: > On Tue, 9 May 2023 at 15:21, Souradeep Chowdhury > <quic_schowdhu@quicinc.com> wrote: >> >> >> >> On 5/9/2023 5:05 PM, Dmitry Baryshkov wrote: >>> On Tue, 9 May 2023 at 13:53, Souradeep Chowdhury >>> <quic_schowdhu@quicinc.com> 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. >>> >>> I might have a minor vote here. Is there any reason why you have to >>> instantiate the device from DT? >>> It looks like a software interface. Ideally software should not be >>> described in DT (e.g. this can be instantiated from imem >>> driver-to-be). >>> Or we can follow the RPM master-stats approach, where the device is a >>> top-level device, having handle pointers to the sram regions. >> >> This is a dedicated region of IMEM reserved for storing stats related >> information. So it is represented as a child of IMEM, please >> refer to Documentation/devicetree/bindings/sram/sram.yaml which >> follows a similar philosophy. Also since this is a child of IMEM with >> a specific purpose, does it not warrant a dedicated driver? > > I do not question a dedicated driver. I was asking about the DT node. > Even the mentioned bindings file describes the SRAM regions inside the > SRAM, rather than a proper device to be instantiated in the SRAM node. > I'd point to the boot_stats discussions (present on the list in the > last several months). > Ack. Will instantiate the device from the parent node in the driver and access the stats region to print the boot_stats information. >> >>> >>>> >>>> Signed-off-by: Souradeep Chowdhury <quic_schowdhu@quicinc.com> >>>> Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> >>>> --- >>>> .../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 0548e8e0d30b..bb884c5c8952 100644 >>>> --- a/Documentation/devicetree/bindings/sram/qcom,imem.yaml >>>> +++ b/Documentation/devicetree/bindings/sram/qcom,imem.yaml >>>> @@ -50,6 +50,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 >>>> -- >>>> 2.17.1 >>>> >>> >>> > > >
On Tue, May 9, 2023, at 13:35, Dmitry Baryshkov wrote: > On Tue, 9 May 2023 at 13:53, Souradeep Chowdhury > <quic_schowdhu@quicinc.com> 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. > > I might have a minor vote here. Is there any reason why you have to > instantiate the device from DT? > It looks like a software interface. Ideally software should not be > described in DT (e.g. this can be instantiated from imem > driver-to-be). There is nothing wrong with describing firmware in DT, if that firmware is part of the platform, we do that for a lot of other bits of firmware. However, in this specific case, many things are wrong with the implementation, and neither the DT binding nor the driver makes sense to me in its current state. >> + "^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 If I understand this right, this "qcom,imem-bootstats" device serves as an indirection to store additional properties of the system in a memory area, but the description of that area is more complex than its contents, which makes no sense to me. Just create a binding for a firmware node in the devicetree itself, and put the values in properties of that. The first stage firmware can still use the same interface, but the actual loader that assembles the DT can get it out of that and store it in the properties. With that done, there is also no need for a kernel driver, as userspace can just get the values from /sys/firmware/devicetree/ directly. Arnd
On 5/16/2023 1:16 AM, Arnd Bergmann wrote: > On Tue, May 9, 2023, at 13:35, Dmitry Baryshkov wrote: >> On Tue, 9 May 2023 at 13:53, Souradeep Chowdhury >> <quic_schowdhu@quicinc.com> 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. >> >> I might have a minor vote here. Is there any reason why you have to >> instantiate the device from DT? >> It looks like a software interface. Ideally software should not be >> described in DT (e.g. this can be instantiated from imem >> driver-to-be). > > There is nothing wrong with describing firmware in DT, if that > firmware is part of the platform, we do that for a lot of > other bits of firmware. > > However, in this specific case, many things are wrong with the > implementation, and neither the DT binding nor the driver > makes sense to me in its current state. > >>> + "^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 > > If I understand this right, this "qcom,imem-bootstats" > device serves as an indirection to store additional > properties of the system in a memory area, but the description > of that area is more complex than its contents, which > makes no sense to me. > > Just create a binding for a firmware node in the devicetree > itself, and put the values in properties of that. The first > stage firmware can still use the same interface, but the > actual loader that assembles the DT can get it out of that > and store it in the properties. With that done, there is also > no need for a kernel driver, as userspace can just get the > values from /sys/firmware/devicetree/ directly. > To understand bit better here, what you are suggesting here that application bootloader (e.g., UEFI app for Linux) can read these boot values from the IMEM and encode them into the devicetree properties which can be later retrieved directly from the userspace. I am fine with this approach as well and in this case we just need to submit the bindings document, right? ---Trilok Soni
On Tue, May 16, 2023, at 20:34, Trilok Soni wrote: > On 5/16/2023 1:16 AM, Arnd Bergmann wrote: > > To understand bit better here, what you are suggesting here that > application bootloader (e.g., UEFI app for Linux) can read these > boot values from the IMEM and encode them into the devicetree properties > which can be later retrieved directly from the userspace. I'm not entirely sure I understand the concept of "application bootloader", but in principle this can be anything that runs before the devicetree is handed off from the final boot loader to the kernel. > I am fine with this approach as well and in this case we just > need to submit the bindings document, right? Yes, exactly. Arnd
On Tue, 16 May 2023 at 11:16, Arnd Bergmann <arnd@arndb.de> wrote: > > On Tue, May 9, 2023, at 13:35, Dmitry Baryshkov wrote: > > On Tue, 9 May 2023 at 13:53, Souradeep Chowdhury > > <quic_schowdhu@quicinc.com> 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. > > > > I might have a minor vote here. Is there any reason why you have to > > instantiate the device from DT? > > It looks like a software interface. Ideally software should not be > > described in DT (e.g. this can be instantiated from imem > > driver-to-be). > > There is nothing wrong with describing firmware in DT, if that > firmware is part of the platform, we do that for a lot of > other bits of firmware. > > However, in this specific case, many things are wrong with the > implementation, and neither the DT binding nor the driver > makes sense to me in its current state. > > >> + "^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 > > If I understand this right, this "qcom,imem-bootstats" > device serves as an indirection to store additional > properties of the system in a memory area, but the description > of that area is more complex than its contents, which > makes no sense to me. > > Just create a binding for a firmware node in the devicetree > itself, and put the values in properties of that. The first > stage firmware can still use the same interface, but the > actual loader that assembles the DT can get it out of that > and store it in the properties. With that done, there is also > no need for a kernel driver, as userspace can just get the > values from /sys/firmware/devicetree/ directly. This sounds good, except the always-present issue of the devices which have already been released. Usually we can not expect a bootloader update for these devices.
On 5/16/2023 12:17 PM, Dmitry Baryshkov wrote: > On Tue, 16 May 2023 at 11:16, Arnd Bergmann <arnd@arndb.de> wrote: >> >> On Tue, May 9, 2023, at 13:35, Dmitry Baryshkov wrote: >>> On Tue, 9 May 2023 at 13:53, Souradeep Chowdhury >>> <quic_schowdhu@quicinc.com> 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. >>> >>> I might have a minor vote here. Is there any reason why you have to >>> instantiate the device from DT? >>> It looks like a software interface. Ideally software should not be >>> described in DT (e.g. this can be instantiated from imem >>> driver-to-be). >> >> There is nothing wrong with describing firmware in DT, if that >> firmware is part of the platform, we do that for a lot of >> other bits of firmware. >> >> However, in this specific case, many things are wrong with the >> implementation, and neither the DT binding nor the driver >> makes sense to me in its current state. >> >>>> + "^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 >> >> If I understand this right, this "qcom,imem-bootstats" >> device serves as an indirection to store additional >> properties of the system in a memory area, but the description >> of that area is more complex than its contents, which >> makes no sense to me. >> >> Just create a binding for a firmware node in the devicetree >> itself, and put the values in properties of that. The first >> stage firmware can still use the same interface, but the >> actual loader that assembles the DT can get it out of that >> and store it in the properties. With that done, there is also >> no need for a kernel driver, as userspace can just get the >> values from /sys/firmware/devicetree/ directly. > > This sounds good, except the always-present issue of the devices which > have already been released. Usually we can not expect a bootloader > update for these devices. Valid point. I don't expect current SOCs supported at upstream to update with the newer bootloader having this feature done through bootloader. ---Trilok Soni
diff --git a/Documentation/devicetree/bindings/sram/qcom,imem.yaml b/Documentation/devicetree/bindings/sram/qcom,imem.yaml index 0548e8e0d30b..bb884c5c8952 100644 --- a/Documentation/devicetree/bindings/sram/qcom,imem.yaml +++ b/Documentation/devicetree/bindings/sram/qcom,imem.yaml @@ -50,6 +50,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