From patchwork Fri Apr 7 14:04:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Souradeep Chowdhury X-Patchwork-Id: 13204940 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 432F1C77B61 for ; Fri, 7 Apr 2023 14:07:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:CC :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=PhaEjfjC7J2K0SzT0f6pA6Zk/a50G+1EpL2R7pdWf+M=; b=wnvnV5myKAqGgU Y0ekhbnGfrN50GbYCrOvz0h4VYAoWO7yaHplXKiKU8C+XnRjebCQpBzE+rRfUgVBw0XtexsLj0n2Y wfXiVQduqAAAosMwy23oVR47ovQEuEHWs5aHBaBaJ/V6P/J/xz26/tY7xm+W0j/zZH01rSiaTf837 /hv4VA9qmOm3jLm7SLOKMAGz7VOCQdCKHUADAKLgV+VWvBYOpPSy2LJCYEmoyiKg288PEj9Z51Dyu g1tzV6fCIJzNE90txhJ673mrZbKqvnz8BECgQsEqb0NMCFi4kQCLDmXjFAsMmlCqFrdAPEPUyq51M Ta/kzTPjXb4yzkk/th6g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pkmjr-00ASrV-2o; Fri, 07 Apr 2023 14:06:51 +0000 Received: from mx0a-0031df01.pphosted.com ([205.220.168.131]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pkmjg-00ASm7-2e for linux-arm-kernel@lists.infradead.org; Fri, 07 Apr 2023 14:06:43 +0000 Received: from pps.filterd (m0279867.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 337DO2nN022516; Fri, 7 Apr 2023 14:06:33 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=dgzja32tSZAozj9BTnV0hjMIc33oPjZpYMlOPC+EW3w=; b=h30meFpCInX4qEpoZB8pDr+iE6fa0w+SjccVj/dqNDQs7gotP7vArzLi8dqLSuDebPGh RHxuqcGiQdcaM8i2LK+8k3YwLAimSSDKLOrwDN8+09+YrMwJcwGHJtWn0dU3olTtRIKV RtQ7RGAe2migZ3xDMREutH2+C6lCjaKSQr1x16IYRVqJlgsPotmmSueAHUQzjxhJ+eJu 0IIe19VCe4WkYiD1HanZz9VdPkPIk3RucbMfq0UGiW6CAtQPc6FKcS3f8Y5J7DsA5O7w YQ88kJCFTGyzNOfslSWs/jybnBnEwBAZwXUE+sG0m3++rmMkUCW/SIpALDBmq6tZr9uY +g== Received: from nalasppmta03.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3pt8t59anp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 07 Apr 2023 14:06:33 +0000 Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA03.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 337E6WfV019689 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 7 Apr 2023 14:06:32 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; Fri, 7 Apr 2023 07:06:28 -0700 From: Souradeep Chowdhury To: Andy Gross , Konrad Dybcio , Krzysztof Kozlowski , Bjorn Andersson , Rob Herring CC: , , , , Sibi Sankar , Rajendra Nayak , Souradeep Chowdhury Subject: [PATCH V2 0/3] soc: qcom: boot_stats: Add driver support for boot_stats Date: Fri, 7 Apr 2023 19:34:34 +0530 Message-ID: X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 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-ORIG-GUID: K4HGntmr4X5Vov_0mgNBH3T664OGby-I X-Proofpoint-GUID: K4HGntmr4X5Vov_0mgNBH3T664OGby-I 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-07_08,2023-04-06_03,2023-02-09_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 spamscore=0 clxscore=1011 phishscore=0 adultscore=0 priorityscore=1501 mlxlogscore=999 suspectscore=0 malwarescore=0 mlxscore=0 impostorscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2303200000 definitions=main-2304070129 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230407_070640_925834_3B13E897 X-CRM114-Status: GOOD ( 21.76 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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 print the information. This information is useful in verifying if existing boot KPIs have regressed or not. A sample log in SM8450(waipio) device is as follows:- KPI: Pre ABL Time = 3s KPI: ABL Time = 14s KPI: Kernel MPM timestamp = 890206 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. The current sleep counter timestamp is also logged by the driver. Changes in V2 *Implemented comments on version 1 of the patch *Changed the boot_stats driver to module_platform_driver *Dropped the DT binding for mpm sleep counter 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 .../devicetree/bindings/sram/qcom,imem.yaml | 21 +++++ MAINTAINERS | 6 ++ drivers/soc/qcom/Kconfig | 7 ++ drivers/soc/qcom/Makefile | 1 + drivers/soc/qcom/boot_stats.c | 95 ++++++++++++++++++++++ 5 files changed, 130 insertions(+) create mode 100644 drivers/soc/qcom/boot_stats.c