Received: by 2002:a05:6358:53a8:b0:117:f937:c515 with SMTP id z40csp4119865rwe; Mon, 17 Apr 2023 08:12:49 -0700 (PDT) X-Google-Smtp-Source: AKy350bEVJhBENMos4/Ev5rgZT9J82NUqivy2uKjYvaYC5ZzNqM4M/aAC3JLid1vkmCnNGbdnzwH X-Received: by 2002:a05:6a20:54a4:b0:ef:ddf1:54d7 with SMTP id i36-20020a056a2054a400b000efddf154d7mr4101467pzk.0.1681744369339; Mon, 17 Apr 2023 08:12:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681744369; cv=none; d=google.com; s=arc-20160816; b=ie3ZBfsXJH6U+bppSsLCz7ZmV94cyYWz2PXDysN4aO272kFxFIg2r6iKtjUsDys1KL idJwn2UD1WZc1rrk/HzCe614a0a6b+XPvDjQtKkOZaWJxTRvuAN2bMtaGGsUbPemJ/E1 no5gQ2xT55VrLJH2VnAl5usQkzYIHYC4IsFRfWmpbWTcu6gQgFCBq446QAatuAEYYa47 otMPRlwkmP8cgD4KLj7cRV9goxipEBN/fbDQW5sPeH6+r5UhSIhvC20Iqq3WpoBZzV28 aLa1vi+HKX/ZUZlLmSoGpHeQ0jB7fj0IyYImANo1/uTpwrBqfsHybmvmypzD4cdAiQP0 teaQ== 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=S5Qi7p0d0sqPYAkoqlrE21UofxzDD+PHi/9VQ6ZkIIM=; b=tajqHGhneCrj3Cw/CqDp/XEThZVfMF7jomfsXvLcYqxu3XhX34s8oFUpBkQbZymM7q uTPB9ghTliUQa9QW2O93ExSrg+qEhT1j3ByzNVYBDFwS9Izr6sgMHyiW9RXmDao5TSi8 gVwLqJsOLL4iOUSDr463c2ohMcmpMb/cenehdZOShEY4inZfLiFVg26RwK3Mc6M7LuK0 DrMwguujbca76+eq/v+LF+MXdEnvO5DB/iTZwqcPCMVXJESvH92xCatSMy84mkKhO4bK fLa2C4hfl51Kc01oJP89xTLQ38rUrakQnya+qPLQp8qlp2UR1m0PIw1lx5QEomaKda0t xH0g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=QzwA4yGX; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 144-20020a621896000000b00633d39d7b09si11506608pfy.390.2023.04.17.08.12.37; Mon, 17 Apr 2023 08:12:49 -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=QzwA4yGX; 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 S229781AbjDQPLB (ORCPT + 99 others); Mon, 17 Apr 2023 11:11:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34194 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230102AbjDQPK4 (ORCPT ); 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 57F3B7ED8; Mon, 17 Apr 2023 08:10:54 -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 33HDVbv0018515; Mon, 17 Apr 2023 15:10:43 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=S5Qi7p0d0sqPYAkoqlrE21UofxzDD+PHi/9VQ6ZkIIM=; b=QzwA4yGXJIEFGYhLcC2uYXzFeDrcwSjem/Iu1xM20S5eNhYMVj8QQUGg0SURw/nLH4hv QtouFffzD84kOWqp67dCiLswI8NF0rS7iW98fkFx/EZThsvAwrdMRJH3c6oAZqq9w99T GjUu0EhcQtPEBXGc9Qng9OiP9TvNgNXqv87ZDYE5PwiUUe2cGQd0UKRZU6f9WOCo38pX UQ3phEZA9+RJFOQLghPJMHL8SjvLrXRrTaYhArvq+0UO7Jbv8miI4rH6SDjjtoUvXYvp YYHqAZlLFIpdq+WJiJE48kT0cSjg7SsOZ/41SBxmBzI7K5TeRuKSonO0cxLvYojjM2cT 6g== Received: from nalasppmta02.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3pymneux4p-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 17 Apr 2023 15:10:43 +0000 Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA02.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 33HFAgg9009126 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 17 Apr 2023 15:10:42 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:38 -0700 From: Souradeep Chowdhury To: Andy Gross , Konrad Dybcio , Krzysztof Kozlowski , Bjorn Andersson , Rob Herring CC: , , , , Sibi Sankar , Rajendra Nayak , Souradeep Chowdhury Subject: [PATCH V4 0/3] soc: qcom: boot_stats: Add driver support for boot_stats Date: Mon, 17 Apr 2023 20:38:13 +0530 Message-ID: X-Mailer: git-send-email 2.7.4 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-ORIG-GUID: nxEkOlQWMev2bGn20t8k8KSQdHI0zniv X-Proofpoint-GUID: nxEkOlQWMev2bGn20t8k8KSQdHI0zniv 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 mlxlogscore=977 phishscore=0 lowpriorityscore=0 clxscore=1015 mlxscore=0 spamscore=0 impostorscore=0 malwarescore=0 bulkscore=0 priorityscore=1501 adultscore=0 suspectscore=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: X-Mailing-List: linux-kernel@vger.kernel.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 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/146aa6b0.boot_stats # cat abl_time 17898 ms /sys/kernel/debug/146aa6b0.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 V4 *Implemented the comments on V3 of the patch series 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 Documentation/ABI/testing/debugfs-driver-bootstat | 17 ++++ .../devicetree/bindings/sram/qcom,imem.yaml | 22 +++++ MAINTAINERS | 7 ++ drivers/soc/qcom/Kconfig | 9 ++ drivers/soc/qcom/Makefile | 1 + drivers/soc/qcom/boot_stats.c | 101 +++++++++++++++++++++ 6 files changed, 157 insertions(+) create mode 100644 Documentation/ABI/testing/debugfs-driver-bootstat create mode 100644 drivers/soc/qcom/boot_stats.c -- 2.7.4