From patchwork Tue May 9 10:52:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Souradeep Chowdhury X-Patchwork-Id: 9077 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp2794899vqo; Tue, 9 May 2023 04:13:28 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6SSqocDVjzoSR+eEWRUof2uBDeAyt5s2s8ex4t7L6tqvh5Yh1UHZSx9r3DzdUpafoF9mST X-Received: by 2002:a17:902:d2c4:b0:1ac:71a7:a1fb with SMTP id n4-20020a170902d2c400b001ac71a7a1fbmr9278970plc.18.1683630807694; Tue, 09 May 2023 04:13:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683630807; cv=none; d=google.com; s=arc-20160816; b=Md48P65I5OTOwaOq02ceCkDQdxBKIqIUmfS1XNeFyFtfXb4tbf48OHNWuDh5MM9Qqa mTxkBU3EuSvwGPq51veUIwZ2XsZLY9c5+/PZW5ZtNKOnIq+zVo5n5rOHbBk3loPA7I8X edrDFv+WxwB3eZ7FZL19oCPC4wgqtC2pj66HIcZGq3nAp1t0KpZop88hUMWY0Lppvz2p PD4bm6Zo2GZ52VFGE+RY/1dSpG7uPgYn0eX7GvbaNoDYfZ50InLkxqFVY+uhUop1LQdT HrgmcGu3d7qTkQo/V3rvLrScZ+Rn/gUhGk5qZhmEgIrBsnGa8kcerbQnRiah+QjFNjm+ Zikw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from :dkim-signature; bh=imTFoMbEbV8QAXicdsE9c4KO2oktsb6s1YI3AMZ8m5I=; b=X/wRIW4HVpE7VVeRdCHgsybLn9vwj8Q4CDewo1QvkLOTMjf71gZDdhA5mqFeITw08e ZOVnb2WpVsTFvu2+wt4k8Bh3p9ynVNpLjPt8ZL00Sn6ltRIvtieutraFHyaLLtZGal2X qZigpiNig2AuRnKCsZhPhFMtUdys9ABnJcdJudV1ehpN0zC4Oh4YFIaI20JA45UeUx6S YVb9fvrMldgZBokWjZxnyUi2qDFCxmJC+f7mtEZYuZA2MCJKXU0FIAi4MOBT0mlq/GLz Gip87U3YN8d1khDZ/ZegqMnWE0Co/vVSAq8RnoeyM3Ck4x+sZdLPUs/ZLXhZp8U6nIyl SjNQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=DgjqZPd9; 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 nl16-20020a17090b385000b002502b3fa445si9309441pjb.14.2023.05.09.04.13.12; Tue, 09 May 2023 04:13:27 -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=DgjqZPd9; 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 S235395AbjEIKxT (ORCPT + 99 others); Tue, 9 May 2023 06:53:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46078 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234821AbjEIKxN (ORCPT ); Tue, 9 May 2023 06:53:13 -0400 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AD9473A98; Tue, 9 May 2023 03:53:12 -0700 (PDT) Received: from pps.filterd (m0279866.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3498KAos023478; Tue, 9 May 2023 10:53:03 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=from : to : cc : subject : date : message-id : mime-version : content-type; s=qcppdkim1; bh=imTFoMbEbV8QAXicdsE9c4KO2oktsb6s1YI3AMZ8m5I=; b=DgjqZPd9yzuKQ0QfjeHlDBDjPiiGb2av6HQ8FTWlmgwscqVCaw4hdWwC7lrCChZkNno2 lBcKrqjIyfMexwdtDRVIZCs1Av0mBdjraIcQnhczzmFZhopWsl83yEhdmgy34u6lnzCp WgMYSFnJ73zSQFsohvRaAxlPDLxig3yVoi5YDEHro5EZZqZ1qFX72qaGqsuBn9cyFDnj 2AIWmEi+M5G1euVmC0/JsgZoaqLfkSRmpm3CYJdv5JA2csIAVcEMrj7pP4zr7GTIn/k/ VNfcu1rhch/33wLAW3ThwXqTR+pann4pzKskGEFD1Ct9vfxL/RcAJFytqxBJNA1mzh9H PQ== Received: from nalasppmta05.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3qf77f1g7k-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 349Ar2OT026670 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 9 May 2023 10:53:02 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 To: Andy Gross , Konrad Dybcio , Krzysztof Kozlowski , Bjorn Andersson , Rob Herring CC: , , , , Sibi Sankar , Rajendra Nayak , Souradeep Chowdhury Subject: [PATCH V6 0/3] soc: qcom: boot_stats: Add driver support for boot_stats Date: Tue, 9 May 2023 03:52:20 -0700 Message-ID: X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 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-ORIG-GUID: 8l59SEyQ6FYiENZXHJzb0b_p5aIBZ6pF X-Proofpoint-GUID: 8l59SEyQ6FYiENZXHJzb0b_p5aIBZ6pF 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 bulkscore=0 mlxscore=0 lowpriorityscore=0 priorityscore=1501 spamscore=0 phishscore=0 mlxlogscore=987 suspectscore=0 malwarescore=0 adultscore=0 impostorscore=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: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1765414857976121732?= X-GMAIL-MSGID: =?utf-8?q?1765414857976121732?= Qualcomm's proprietary Android boot-loaders capture boot time stats, like the time when the bootloader started execution and at what point the bootloader handed over control to the kernel etc. in the IMEM region. This information is captured in a specific format by this driver by mapping a structure to the IMEM memory region and then accessing the members of the structure to log the information in a debugfs file. This information is useful in verifying if existing boot KPIs have regressed or not. A sample log in SM8450(waipio) device is as follows:- /sys/kernel/debug/qcom_boot_stats # cat abl_time 17898 ms /sys/kernel/debug/qcom_boot_stats # cat pre_abl_time 2879 ms The Module Power Manager(MPM) sleep counter starts ticking at the PBL stage and the timestamp generated by the sleep counter is logged by the Qualcomm proprietary bootloader(ABL) at two points-> First when it starts execution which is logged here as "pre_abl_time" and the second when it is about to load the kernel logged as "abl_time". Both these values are read up by the driver from IMEM region and printed as above. Changes in V6 *Implemented the comments on V4 and V5 of the patch Souradeep Chowdhury (3): dt-bindings: sram: qcom,imem: Add Boot Stat region within IMEM soc: qcom: boot_stat: Add Driver Support for Boot Stats MAINTAINERS: Add the entry for boot_stats driver support .../ABI/testing/debugfs-driver-bootstat | 17 +++ .../devicetree/bindings/sram/qcom,imem.yaml | 22 ++++ MAINTAINERS | 7 ++ drivers/soc/qcom/Kconfig | 10 ++ drivers/soc/qcom/Makefile | 1 + drivers/soc/qcom/boot_stats.c | 100 ++++++++++++++++++ 6 files changed, 157 insertions(+) create mode 100644 Documentation/ABI/testing/debugfs-driver-bootstat create mode 100644 drivers/soc/qcom/boot_stats.c