From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A26ECC433EF for ; Mon, 13 Sep 2021 08:42:22 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 6F55060F58 for ; Mon, 13 Sep 2021 08:42:22 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 6F55060F58 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=xilinx.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org 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:References:In-Reply-To: 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: List-Owner; bh=i3g7mgNURyUqNj58LD3MAHp8/SnfNjGiAia+CxbDcc0=; b=45xjpRePAPI4JY +1/QPyYy7s/L1tBmiAn9ZZFv0ZhxVxNV8QHsA1O2YGB5jqetNvwhNKUKj8mtUW65j5hU2oP/8b6Eg C421r7NOJWse3DSp/U+y3SebCkhHL5/KUJB5x+paUgFbKt2NFKovfJEVghMgRa1vl+4VANFD1xg99 +ZQTJyZDd8Kqzarr0XV0lZejg7O+x4a4x5G5KuyKW6ON0N+sXobXObdoS1F0ulFKL9g+Gw2poXvtK qShUAQldXe/HrOdJSRW/nBawy67pc7/7BVd/QhETbE7Mt7ORYL9eY6T0+1Prw//QUY0TB82q+NdaW gaqkh2ssQsu4oJT7Y+Uw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mPhW2-000pR1-8L; Mon, 13 Sep 2021 08:40:38 +0000 Received: from mail-dm6nam12on2044.outbound.protection.outlook.com ([40.107.243.44] helo=NAM12-DM6-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mPhVd-000pMd-IO for linux-arm-kernel@lists.infradead.org; Mon, 13 Sep 2021 08:40:15 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YInMwCt73jAvs1xOUVnGbzagAy+EIftqoG/TZFB0rpaEzVcJ+KQyJR02jfqkHMpjX00KZp+GAbU2E6UwmuvLhjbUFmFFpmScVNHhAME3QHU6zw7WUajTSk7pgI4NFYQ1CKQHk4ycUWgRuToRBGcicRtLVcCTXh0+TRUXxAp7Iuxers7eNTbCPHuAK/z0jMzqMVYL1Z6z+P1yyg5udCJvkWOcQIpeGiHVexqBCz5n5MMnWUnSMYBrqhGN8XohEAK49NwmXLAqWIwOt6wUpWXanHqhTOr4EsvO0142/7MWobx9wICXrtUbvz3qADOZFP/1P7H36NYvA8lmyQWwgBx9Bg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=JioRz3POfK62mbHI4yl/Tw7szNZ2xYq6Etn46MFIoT4=; b=e/wuAggV0bY+lnWo2E/hsX5jZ2BSpWuROBgAyZgz1BsfXGRiB9Gx2WFE6tMwDRrGoqI/WbL47vQ9TtUJnpZ1ZzI5UL9CgF99P+c93JMK/rxjwMxTEktNtCAyKqcDELYN+PKRzeq5o3tEH0UY/2wqhNYf8rTA08/2PmuTc20Qz0uZ8asZhB9V//RDwsxWL5b2Jk0vYIxID0ZSylv1cwLk0YDAX0/UW1x3/a87nrtu/SftFCZHnxjwZmU6c+IZ/RPIuQAyJiDwGKcQejWz5heo4GHL2MfRttr9iSYjaVla9JHiJAeiO3okfP73XVr9v3Go8gEwa43OCQnoWN8md32UCg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.62.198) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=xilinx.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=xilinx.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector2-xilinx-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=JioRz3POfK62mbHI4yl/Tw7szNZ2xYq6Etn46MFIoT4=; b=nknKqTNmeOoqAt52NcPbdPpOsi7OTcl/3U1A4jVYgS+GQ7mbPyf/1BW3jV/ufNyMbsg/8w7iRNmYzqE+4h8XTwJqhNvtxc3w+pRDsDVp4tTVxdmDXBvpJUnlMu+XZp4eBT8M161Zb5EIsjPmGhP2Cg8yb60G8TGBvpSUk7LRH9M= Received: from BN9PR03CA0099.namprd03.prod.outlook.com (2603:10b6:408:fd::14) by DM6PR02MB6542.namprd02.prod.outlook.com (2603:10b6:5:1bf::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4500.14; Mon, 13 Sep 2021 08:40:09 +0000 Received: from BN1NAM02FT040.eop-nam02.prod.protection.outlook.com (2603:10b6:408:fd:cafe::4f) by BN9PR03CA0099.outlook.office365.com (2603:10b6:408:fd::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4500.16 via Frontend Transport; Mon, 13 Sep 2021 08:40:09 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 149.199.62.198) smtp.mailfrom=xilinx.com; vger.kernel.org; dkim=none (message not signed) header.d=none; vger.kernel.org; dmarc=pass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.62.198 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.62.198; helo=xsj-pvapexch02.xlnx.xilinx.com; Received: from xsj-pvapexch02.xlnx.xilinx.com (149.199.62.198) by BN1NAM02FT040.mail.protection.outlook.com (10.13.2.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4500.14 via Frontend Transport; Mon, 13 Sep 2021 08:40:09 +0000 Received: from xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) by xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.14; Mon, 13 Sep 2021 01:40:04 -0700 Received: from smtp.xilinx.com (172.19.127.95) by xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) with Microsoft SMTP Server id 15.1.2176.14 via Frontend Transport; Mon, 13 Sep 2021 01:40:04 -0700 Received: from [172.19.2.91] (port=36668 helo=xsjjollys50.xilinx.com) by smtp.xilinx.com with esmtp (Exim 4.90) (envelope-from ) id 1mPhVU-000Cg1-D5; Mon, 13 Sep 2021 01:40:04 -0700 From: Ronak Jain To: , CC: , , , , , , Ronak Jain Subject: [PATCH v2 2/3] firmware: zynqmp: Add sysfs entry for runtime features Date: Mon, 13 Sep 2021 01:39:54 -0700 Message-ID: <20210913083955.27146-3-ronak.jain@xilinx.com> X-Mailer: git-send-email 2.32.0.93.g670b81a In-Reply-To: <20210913083955.27146-1-ronak.jain@xilinx.com> References: <20210913083955.27146-1-ronak.jain@xilinx.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: ee773ea6-653a-4491-be77-08d976921874 X-MS-TrafficTypeDiagnostic: DM6PR02MB6542: X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Oob-TLC-OOBClassifiers: OLM:1751; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: SfBwxnfgAkPYYKCIdsSPEEnDx/YBhppf3p2ZZ4rJkGi+cY7KZ5IDbxQt+8Oq8LkggNyqkF0T3RxRlLO0cW8tQKo6ZAIgmNF6eD4oUW2x/mqM/hb/D9CSkJZ/X1NE6YTeXOFEIkNc366uUlWPwhOLE1bi4S4lc3qgvOkrqKDtOWbBFEEmpOXWvKwBKYDI5tqv2fWhk/MEhlV6ClHqxyA6+jcCfus59EWn0BMoqU36LW66u//Owv1I9HaoXsN4xNmWt+2v0k/oEtqhNOWGnrHg/nBhtrctFPZuULhvKmZ2bQl+Sf84gEhp/XJ6P463qzjPYEKf7SObyDMVGZHQc+seFMvybZL/R/uINxqnmwafo/cdcLiD/J4pEhvtr7A9ecQA3yiAK9uQYoHSx/RmetLnQ/PTV/Z5VUtfr+uHgJm2NZKMCEPEhvHxlYNVDHcEVm6cgq+lEelw/dejZazNF1hafUPdcsgeqkvZT+HJpWVscSIfXC0dBkhAoEfwhMioz9geoMkFkQZCl/HwmIY2ny2rPUvbHQYApO/g+mVtEQonsQ+HRCu10wo6ediA91w88TzkZLWzkcbjnUphuEniL/fOWl67TH2cWy8udYFaT1tKS3+V35sgMlp1atjQPH7Tk6UudcNnzvQRRSMZ5nW+z7BTw86xEdeEb5wvAT6vmiK0VIQKXTWgfPRR85gEEoZWOHLmZCA940YI8kfGQno8JFpAVU1rTT3d88JIzr1VHPvHZzY= X-Forefront-Antispam-Report: CIP:149.199.62.198; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:xsj-pvapexch02.xlnx.xilinx.com; PTR:unknown-62-198.xilinx.com; CAT:NONE; SFS:(4636009)(46966006)(36840700001)(82310400003)(5660300002)(36756003)(1076003)(83380400001)(426003)(336012)(8936002)(508600001)(2616005)(70586007)(186003)(70206006)(7696005)(47076005)(6666004)(36906005)(8676002)(316002)(44832011)(4326008)(7636003)(356005)(36860700001)(26005)(54906003)(107886003)(2906002)(9786002)(110136005)(102446001); DIR:OUT; SFP:1101; X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Sep 2021 08:40:09.5763 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ee773ea6-653a-4491-be77-08d976921874 X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.62.198]; Helo=[xsj-pvapexch02.xlnx.xilinx.com] X-MS-Exchange-CrossTenant-AuthSource: BN1NAM02FT040.eop-nam02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR02MB6542 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210913_014013_698037_F7218A62 X-CRM114-Status: GOOD ( 14.63 ) 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Create sysfs entry for runtime feature configuration. The support is added for an over temperature and external watchdog feature. The below listed files are used for runtime features configuration: /sys/devices/platform/firmware\:zynqmp-firmware/feature_config_id /sys/devices/platform/firmware\:zynqmp-firmware/feature_config_value In order to configure an over temperature or external watchdog features, first the user need to select the valid config id and then the user can configure the value for selected feature config id. Signed-off-by: Ronak Jain --- Changes in v2: - Update commit message --- .../ABI/stable/sysfs-driver-firmware-zynqmp | 84 +++++++++++++++++++ 1 file changed, 84 insertions(+) diff --git a/Documentation/ABI/stable/sysfs-driver-firmware-zynqmp b/Documentation/ABI/stable/sysfs-driver-firmware-zynqmp index f5724bb5b462..2fde354715a5 100644 --- a/Documentation/ABI/stable/sysfs-driver-firmware-zynqmp +++ b/Documentation/ABI/stable/sysfs-driver-firmware-zynqmp @@ -113,3 +113,87 @@ Description: # echo 0 > /sys/devices/platform/firmware\:zynqmp-firmware/health_status Users: Xilinx + +What: /sys/devices/platform/firmware\:zynqmp-firmware/feature_config_* +Date: Aug 2021 +KernelVersion: 5.14 +Contact: "Ronak Jain" +Description: + This sysfs interface allows to configure features at runtime. + The user can enable or disable features running at firmware. + Also, the user can configure the parameters of the features + at runtime. The supported features are over temperature and + external watchdog. Here, the external watchdog is completely + different than the /dev/watchdog as the external watchdog is + running on the firmware and it is used to monitor the health + of firmware not APU(Linux). Also, the external watchdog is + interfaced outside of the zynqmp soc. + + By default the features are disabled in the firmware. The user + can enable features by querying appropriate config id of the + features. + + The default limit for the over temperature is 90 Degree Celsius. + The default timer interval for the external watchdog is 570ms. + + The supported config ids are for the feature configuration is, + 1. PM_FEATURE_OVERTEMP_STATUS = 1, the user can enable or + disable the over temperature feature. + 2. PM_FEATURE_OVERTEMP_VALUE = 2, the user can configure the + over temperature limit in Degree Celsius. + 3. PM_FEATURE_EXTWDT_STATUS = 3, the user can enable or disable + the external watchdog feature. + 4. PM_FEATURE_EXTWDT_VALUE = 4, the user can configure the + external watchdog feature. + + Usage: + + Enable over temperature feature + # echo 1 > /sys/devices/platform/firmware\:zynqmp-firmware/feature_config_id + # echo 1 > /sys/devices/platform/firmware\:zynqmp-firmware/feature_config_value + + Check whether the over temperature feature is enabled or not + # cat /sys/devices/platform/firmware\:zynqmp-firmware/feature_config_value + The expected result is 1. + + Disable over temperature feature + # echo 1 > /sys/devices/platform/firmware\:zynqmp-firmware/feature_config_id + # echo 0 > /sys/devices/platform/firmware\:zynqmp-firmware/feature_config_value + + Check whether the over temperature feature is disabled or not + # cat /sys/devices/platform/firmware\:zynqmp-firmware/feature_config_value + The expected result is 0. + + Configure over temperature limit to 50 Degree Celsius + # echo 2 > /sys/devices/platform/firmware\:zynqmp-firmware/feature_config_id + # echo 50 > /sys/devices/platform/firmware\:zynqmp-firmware/feature_config_value + + Check whether the over temperature limit is configured or not + # cat /sys/devices/platform/firmware\:zynqmp-firmware/feature_config_value + The expected result is 50. + + Enable external watchdog feature + # echo 3 > /sys/devices/platform/firmware\:zynqmp-firmware/feature_config_id + # echo 1 > /sys/devices/platform/firmware\:zynqmp-firmware/feature_config_value + + Check whether the external watchdog feature is enabled or not + # cat /sys/devices/platform/firmware\:zynqmp-firmware/feature_config_value + The expected result is 1. + + Disable external watchdog feature + # echo 3 > /sys/devices/platform/firmware\:zynqmp-firmware/feature_config_id + # echo 0 > /sys/devices/platform/firmware\:zynqmp-firmware/feature_config_value + + Check whether the external watchdog feature is disabled or not + # cat /sys/devices/platform/firmware\:zynqmp-firmware/feature_config_value + The expected result is 0. + + Configure external watchdog timer interval to 500ms + # echo 4 > /sys/devices/platform/firmware\:zynqmp-firmware/feature_config_id + # echo 500 > /sys/devices/platform/firmware\:zynqmp-firmware/feature_config_value + + Check whether the external watchdog timer interval is configured or not + # cat /sys/devices/platform/firmware\:zynqmp-firmware/feature_config_value + The expected result is 500. + +Users: Xilinx -- 2.32.0.93.g670b81a _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel