From patchwork Thu Jan 25 11:09:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Peng Fan (OSS)" X-Patchwork-Id: 13530848 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 EE655C48260 for ; Thu, 25 Jan 2024 13:52:58 +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:Cc:To:In-Reply-To: References:Message-Id:Subject:Date:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=Xe9mUDO25lwv3ajBKXVVJjnN0UQUOiCPoeJek3n0dSQ=; b=RXOjEhneD3K90cyVSvCVotYRPq Cd1lAxZjydZ3Qfp590JgEhz13Oxu0yM4ybm0GX9mEU/bxiyELogbOGLbbbbZpG5zSQOXYhEYR+PDY ecl1l4jCXJnpZIyv7seWLtkrHG+P5fhjElC9Yhs89aKyqrwZsyCEwNrO1rzUML8XXtxrFdb17awmr cxKLZtEL3ZzkFrvfQqM7Szf1/RAzUBNxQLtkVXL+fSzQtYSw0VPBlwPVYo7sFpnCkElfoH8wo6t8M y7ZwnPSFQ7/zHs8brA/qmV+O3bbAj/QtQLUtxmlGuH86AydcG57ewTy9XtHSgzTg6rn0Sfc0LCm9c TEZYv/sQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rT09x-000000009Ln-0gf5; Thu, 25 Jan 2024 13:52:49 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rT09v-000000009L5-0GXI for linux-arm-kernel@bombadil.infradead.org; Thu, 25 Jan 2024 13:52:47 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=MIME-Version:Cc:To:In-Reply-To: References:Message-Id:Content-Transfer-Encoding:Content-Type:Subject:Date: From:Sender:Reply-To:Content-ID:Content-Description; bh=d21s6puYPV21ZPiPfHbW09PbXzAEYFeEqQEeMC6XFUA=; b=bXNGeiAKh1+ev+/PZtNpCustle 9nWhuPaFbdzZV+yp2ET+PXIRgzJt5nJzbDVI0Ju83arpS3HCpUlwGpkpTSod50WGTYhcvPH24mn0g 1YY2vlVfvy7yWIsF8Kz+Xm9zj7P4GdH0hifC8IwXwnqo26/H9pGIEbAZX8e5A/51RJ6Db5LveQSbA JucsSynTOt43w6OQP6hHUyERGhfpP/NSvtnIVmCVfe5i1oRpjzw+SbZbjzLf02HUX4z+G8kQmw256 RLhYauFGw4s2FGCRNsp2U95boZfFT377EDQ2cIM52EDHFXfGUsR8xjsFmaiRozOXcSIzlATw+kt7V t0Y3xadg==; Received: from mail-he1eur04on20600.outbound.protection.outlook.com ([2a01:111:f403:260f::600] helo=EUR04-HE1-obe.outbound.protection.outlook.com) by desiato.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rSxo0-00000005B8Z-1aBa for linux-arm-kernel@lists.infradead.org; Thu, 25 Jan 2024 11:22:02 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UsGqZzEsMQ6b4U50KNqwbyRGNxEhTPxv3XsA/khdx8raoLMcN3S70pFd3pDIVplM9J244v4+Kg6sWO6cpB2ph055kUnUdiWFYTGT7U6nJgiddQkvhAM4zhjifmGNdYmq/lJpZhyObZhro7GWcHQQjZ/Vi5iXM+w4e2WkoMlbK/rrwMrbpveRGHGPxIHBfW+QKQclYRW95UzWyO+QYP8rJY239nJbimGFomT7AJBd0Ci02HUyFWFaZEUkB5GaLIVad3/5haHExBiut+79SVIitlw6xC4EJsEKkZJa+WM5oLLQzL3EHrcpxXSxqsukAPiS1x9iwhozHZytr5jmv8t8Qw== 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:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=d21s6puYPV21ZPiPfHbW09PbXzAEYFeEqQEeMC6XFUA=; b=egywIdqpiDhD1T34swqcJdVYUu91s4vhAMwZ+rDDOme5vN55XmqLFrds94B1WLi6Q5pWJeUvpc0D4LTyRF1jsl6yxYOUHQ6AadvN7TobViLdcO6sec6yZ1tXUQOSO9gVjm5pxbovcXlrBgoY3Akjj5SkHq+zfvsmU8TtxU+i0dl/dNxmlHJYxkL2LwvBp0OXDZ6e1NsqeIA4oDppJ/2tBNDdLQdmk1hF5UOQKKlgM4Ib6JSNbqOPcIzreafwMyZosEyXsNR9+4FcCCOa7F7UQ/zS2dpgn2Xibd1TMdBNqX2MC/DfEZq6omK/NV+wn9PkbhvWvs5wL94VudXaoM/o+Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NXP1.onmicrosoft.com; s=selector2-NXP1-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=d21s6puYPV21ZPiPfHbW09PbXzAEYFeEqQEeMC6XFUA=; b=ix+vlhrlPt+bcNghk10kX34ev1/QEVmsxMPJAYnTcVozXqb+8OW/lq+ISM8I+TxU11RdCoP68ACz9tkx5eTdM/cdECKuzsOQ+FqKhjxvXahN06M4aDMjcJAQfXyh2vQ6SzCpdEaL+HwF0marhNj+JmbhJjpWAO4jnxzn2bCZCZE= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=oss.nxp.com; Received: from DU0PR04MB9417.eurprd04.prod.outlook.com (2603:10a6:10:358::11) by PA4PR04MB8013.eurprd04.prod.outlook.com (2603:10a6:102:c4::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7228.22; Thu, 25 Jan 2024 11:05:37 +0000 Received: from DU0PR04MB9417.eurprd04.prod.outlook.com ([fe80::c499:8cef:9bb1:ced6]) by DU0PR04MB9417.eurprd04.prod.outlook.com ([fe80::c499:8cef:9bb1:ced6%3]) with mapi id 15.20.7228.022; Thu, 25 Jan 2024 11:05:37 +0000 From: "Peng Fan (OSS)" Date: Thu, 25 Jan 2024 19:09:47 +0800 Subject: [PATCH v2 1/3] dt-bindings: timer: nxp,sysctr-timer: support i.MX95 Message-Id: <20240125-imx-sysctr-v2-1-7332470cd7ae@nxp.com> References: <20240125-imx-sysctr-v2-0-7332470cd7ae@nxp.com> In-Reply-To: <20240125-imx-sysctr-v2-0-7332470cd7ae@nxp.com> To: Daniel Lezcano , Thomas Gleixner , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Bai Ping , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , Marco Felsch Cc: linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Peng Fan X-Mailer: b4 0.12.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1706180999; l=893; i=peng.fan@nxp.com; s=20230812; h=from:subject:message-id; bh=eOWUoZq6cbt5HpoeRdEI86Gf0YTn+DquGD02bwDCsp0=; b=BIoJJ51nDDjnxEMZ4fxfSf9qu+guxZ4Wuor6C6sM2+FEGPtXPooZKzpRYcsbNRGb6D04H/QKs NJXeH0FVGqFD16JS1TiH4n8c+3fiyJ7HbkV+WVWJnMm5cHko9UMNot4 X-Developer-Key: i=peng.fan@nxp.com; a=ed25519; pk=I4sJg7atIT1g63H7bb5lDRGR2gJW14RKDD0wFL8TT1g= X-ClientProxiedBy: SG3P274CA0022.SGPP274.PROD.OUTLOOK.COM (2603:1096:4:be::34) To DU0PR04MB9417.eurprd04.prod.outlook.com (2603:10a6:10:358::11) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU0PR04MB9417:EE_|PA4PR04MB8013:EE_ X-MS-Office365-Filtering-Correlation-Id: e35b56e5-f0b2-4921-f5d9-08dc1d958f49 X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: m/xsJYJBMIMzGOZtLKJllMpYFYYon8zEXEfAShNOmez5pBS6ExjjzC3bJHUB+UqAZ7SoGm7N+oosZDmWFgm9MqsHQd0xcK3vG5B6CYVbbF/5b1yOoBv0SkYfL4ndjcT5XUkJqrrRY7EGDKt0VgjCrWvP6UyRBbITl3GMwn0HzTePKUqFDCNKpvpqCxWGaUfHFIzF6MmJHZ+C6b5uhN2xX1+ddpj8tbI9n8tNX/ZQ4/CNyrn0gvrqMuEu9T79x+ztlcOCQcbmcq1aneVEgdjGZxf+4eRzZNu+s6d0qZZC6FIHTxmEhKTawsvlJo4nkqwDEkRQaukA5gH/9ZJhTC9hHfRLGrNE5J3yRVdMtxySVNFV4jxBvNDX6s41s03CiyyBmQQCex3J5vVtyUfVgGP+ZBsJVO3iI1x70wpfAeEHB9oSuBwRWkjjXzRRemAu9FbkVtzFqXzGdKqS4rMGOAY6kv80CAbcphB2sKP+Yo6VgP/JxjbKR2JkTkLOvmlx3sB/IIoik8z6UWAxHwrGO70YVTYSahAE/QRQaEGuqxDAAriXgYOoMqBWJn/dwyh5Y3DyuZ/5KE3377mwd79hE1wFyV6TWX2zfgwBiGVIJLcSoDxeNB01gZkYRMxhVbPNhHKQ X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU0PR04MB9417.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(396003)(136003)(39860400002)(366004)(376002)(346002)(230922051799003)(1800799012)(64100799003)(186009)(451199024)(4326008)(2906002)(4744005)(8936002)(110136005)(7416002)(66476007)(8676002)(5660300002)(66946007)(83380400001)(26005)(38350700005)(86362001)(36756003)(66556008)(316002)(921011)(52116002)(6486002)(9686003)(6512007)(6506007)(478600001)(6666004)(41300700001)(38100700002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?1kPs7v9lAEIlFraQ+cJ4B2G+ke86?= =?utf-8?q?rbUefLoCN2KOfP+/kBlqZhY330DPC0TJPvZNUGR4/NG796qVal10HPoUdoxpDALtL?= =?utf-8?q?+YwFX48KVOOIsjoFwvPcHSvVG0TsU4gCPezcfIgiB7UpZt8EjseCR70kt3pTW3J+w?= =?utf-8?q?usqIm9T0gt89szL1I7yEJia0Wb9qyq3mfPI9SmiQpPPyKsz547YC/0qdH/mYPiaFf?= =?utf-8?q?qrz068NUCmGLPcQJfwl76TLlB2foUiQRV6edF5nf+0CHMWlyCghWk+BZouGZgQ3IC?= =?utf-8?q?EziT0VOrRChmeIXYWp6AzMtipT8vUvy002pKzIEGowMqmZoL30wfIJfNeJfl5Hp0/?= =?utf-8?q?sFx/R+KWBeghv0xGiYBQzHjEr5Ddi3xTvsn7WMOIjbvg2HkFKLxsw0AtaLWp/kM7P?=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?q?6Az6HpJPwyGK7BahiuMV4WzqCFHU9V/SP4Uo3wkCxvjFyoVC/0p6Nrt5tELiZp9N0?= =?utf-8?q?PTBDxsv40HOnIfLi5UmZdCiOkQjwb5IGhCUTHDfSIafMJh2td9bxsrd/zZF9qZqnl?= =?utf-8?q?1GNKC2JkV40mcVsNJr5IRNcc4ASlg5nPeRO5BpXUY/pN8GJvJBWUG41pmHT4504hg?= =?utf-8?q?XGa4AvVY2QOK9wqNFu2MaLv+duRwQ4CzbVrnwDytQ8Au3alsWCF2O29OEjudWMGvr?= =?utf-8?q?KBTMHwWszFWn?= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: e35b56e5-f0b2-4921-f5d9-08dc1d958f49 X-MS-Exchange-CrossTenant-AuthSource: DU0PR04MB9417.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Jan 2024 11:05:37.2177 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: a8tzZYAul/KoAws/aWQIx1A8yk9gy5jiUkWs7Ghgn7I8+mNfrgw/ZKEt/kx7gZW1elU5JLQAKpocso1dsTGzyw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR04MB8013 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240125_112200_477628_B6255716 X-CRM114-Status: GOOD ( 11.22 ) 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 From: Peng Fan Add i.MX95 System counter module compatible string, the SCMI firmware blocks access to control register, so should not add "nxp,sysctr-timer" as fallback. Signed-off-by: Peng Fan --- Documentation/devicetree/bindings/timer/nxp,sysctr-timer.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/timer/nxp,sysctr-timer.yaml b/Documentation/devicetree/bindings/timer/nxp,sysctr-timer.yaml index 2b9653dafab8..161c09d9e2c3 100644 --- a/Documentation/devicetree/bindings/timer/nxp,sysctr-timer.yaml +++ b/Documentation/devicetree/bindings/timer/nxp,sysctr-timer.yaml @@ -18,7 +18,10 @@ description: | properties: compatible: - const: nxp,sysctr-timer + items: + - enum: + - nxp,imx95-sysctr-timer + - nxp,sysctr-timer reg: maxItems: 1 From patchwork Thu Jan 25 11:09:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Peng Fan (OSS)" X-Patchwork-Id: 13530916 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 84522C47258 for ; Thu, 25 Jan 2024 14:14:00 +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:Cc:To:In-Reply-To: References:Message-Id:Subject:Date:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=W9v7uVxDrhX1Xfeo+Eq/4dQBtG2MQ+MTwcLNq2xUJ78=; b=sOBKgUiSqRBtbaDYVXnFWBkt/Z iMwdHgF6I8udeOv1c5jPJUmLefMQtqHSJ8NutayMG+xjx9kFpTg60JN9eVhMlpRmaNlI+XG03Tu6v ZFK4rD8DJHB1gduGlvd+6nW/3lY5nWCs34MB3ydaTHRqQiFm9C8B5LmI0875QXONN1wrVFISZCgrZ IoHBqXgW7WlzTil3+RWnF9OsBGpnQcFl9qAg6VpKzsj/IHN7tkwZQOWr+LoKMsAr03RChAR7dUdW0 epONttzpLEKAbD/xjx/9ABqsFJmlnxMwSbmjKPWQUvRiUWQjf2fhJeasX0yde4q/0i7hOwJncwdjR bwAVpXMA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rT0UH-00000000IdF-0q37; Thu, 25 Jan 2024 14:13:49 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rT0TL-00000000ICy-2VUl for linux-arm-kernel@bombadil.infradead.org; Thu, 25 Jan 2024 14:12:51 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=MIME-Version:Cc:To:In-Reply-To: References:Message-Id:Content-Transfer-Encoding:Content-Type:Subject:Date: From:Sender:Reply-To:Content-ID:Content-Description; bh=GWwGLQogleAHAp03QiCYcNmz77yayBGa4AxJXmlI5Q0=; b=LU2wn4u/XaXr4Vq6WB9D4halpW jqp1JWYIKVfbPVL0CkekvInlN2zFKXZ1cEfdbAzIiOdeXrzXwuLDAjqadqRKBaBJD5mVZwkzDHYR0 oEgp3pk+vzgVTjkqB27d81XcZDE1R7gBbg1LAvHjO8ElJ8YLl6DJg1I3UyJZFbTBidemkDnv9+1o5 fsXfiDe2bhWoiZylrf8Jowg0sRKS4uI76clEJBybeWLAMVsxIMDZyB06E36fs2KVtqjWO7Ao6Vic5 MzmNR5VVrZxsH9bV3TJtUO7ksZ96Omht2OjQeQcVrhxb2r+lbPXKfF7Np2xXDVxzP7dYx1tomGKBs 9tDt2+1g==; Received: from mail-he1eur04on20601.outbound.protection.outlook.com ([2a01:111:f403:260f::601] helo=EUR04-HE1-obe.outbound.protection.outlook.com) by desiato.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rSxnF-00000005B5w-1FHB for linux-arm-kernel@lists.infradead.org; Thu, 25 Jan 2024 11:21:15 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=C84lg08fhkgsO5OeRHzjtAOxv7ov4HyuY8TlFDDhDSJTtmfHJxBMiSARI6jmfZq9Iy0xVPefPvKDxAB1oHCSBqOFJr+sODbVydZCGJSOgPPJwL9/wpOyYL78HnElOyxsjrkLe0HQbnS6P56geBUVwVttcL6hzgXlWaZcLSWmGoD9UUy2XKt5wc5gK2FKuUaa7YvX2T9/rqByYl1cqJ00xvWSebVMdSiFPkKJ19aQjJL6gO5xrBurjFLP1KKL+e7yJmkiTa19UtXl3sRxXFu61XABqN3SYX01rO6aMdJaDcnJ/U4m5Dki64sY4aM++KhoArvBu6SAesw0sV8pP178pQ== 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:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=GWwGLQogleAHAp03QiCYcNmz77yayBGa4AxJXmlI5Q0=; b=jby5FDyblc/RcfRS2m0vdQQxr9AJbNQMy8jNelYVnhZ72f7hoRKxfGOP8Y/IyFvKmiHYhkzM36FVTGuYIC5W6v4b8k8elloNtAD5f0/ZqFIABArnB43Vil+gbR6m29YB6bIPw7EEgpOxx9P8QrtFAUoNcfNZ4QStmiAjZbMoXbkZEG4T5zJranPyHYfGby78Vl9IFBTSObP0xqa2DITLe1Qlo+AD1WQBccpSJDE2JsKjdik1CT1hynYhaJZHYVcHR89bNGJfN06ngk7aYv7/zaNtUOgSichV5PKeMuuCZ9yT5acml5T44YiHx56WJDbOtHxAC7jaCFEZqRk15RT3sA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NXP1.onmicrosoft.com; s=selector2-NXP1-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=GWwGLQogleAHAp03QiCYcNmz77yayBGa4AxJXmlI5Q0=; b=XZN0xj34dtqLvx7kvNic3IyDIeCAh0qqg6/8sBuKbXKzjekI9kbFE7EUWUeXOXmoojewpax+xNgCF6TY3TjyZ30qY/yBWu7H259jzvs9QTCGOiyIwkGxJO/uM3Egb4/Kb+j0rWBeFAPeseCQwV/8zJncR73Uknol/AONFYfwR70= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=oss.nxp.com; Received: from DU0PR04MB9417.eurprd04.prod.outlook.com (2603:10a6:10:358::11) by PA4PR04MB8013.eurprd04.prod.outlook.com (2603:10a6:102:c4::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7228.22; Thu, 25 Jan 2024 11:05:42 +0000 Received: from DU0PR04MB9417.eurprd04.prod.outlook.com ([fe80::c499:8cef:9bb1:ced6]) by DU0PR04MB9417.eurprd04.prod.outlook.com ([fe80::c499:8cef:9bb1:ced6%3]) with mapi id 15.20.7228.022; Thu, 25 Jan 2024 11:05:42 +0000 From: "Peng Fan (OSS)" Date: Thu, 25 Jan 2024 19:09:48 +0800 Subject: [PATCH v2 2/3] clocksource/drivers/imx-sysctr: drop use global variables Message-Id: <20240125-imx-sysctr-v2-2-7332470cd7ae@nxp.com> References: <20240125-imx-sysctr-v2-0-7332470cd7ae@nxp.com> In-Reply-To: <20240125-imx-sysctr-v2-0-7332470cd7ae@nxp.com> To: Daniel Lezcano , Thomas Gleixner , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Bai Ping , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , Marco Felsch Cc: linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Peng Fan X-Mailer: b4 0.12.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1706180999; l=4759; i=peng.fan@nxp.com; s=20230812; h=from:subject:message-id; bh=GNd7nn9IlMWOE6EtgMoRLuOvy3mCu2EVYjx6qUvMpbo=; b=dn1TEThnSRcjvftsi3iJdbkAzSukqL/cb2uLA4ObGSO5pOv0YwGAnL9daYSCbheeUkvEwZSU+ JkrmfMb7E2VBcDGumZp1EuD/hye0V1ixPi7PHZ3lohRT7Hl0nzgVndf X-Developer-Key: i=peng.fan@nxp.com; a=ed25519; pk=I4sJg7atIT1g63H7bb5lDRGR2gJW14RKDD0wFL8TT1g= X-ClientProxiedBy: SG3P274CA0022.SGPP274.PROD.OUTLOOK.COM (2603:1096:4:be::34) To DU0PR04MB9417.eurprd04.prod.outlook.com (2603:10a6:10:358::11) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU0PR04MB9417:EE_|PA4PR04MB8013:EE_ X-MS-Office365-Filtering-Correlation-Id: 56f1e9df-12a3-4207-9563-08dc1d959213 X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 65D27arOJpganCZP8lOdCqJHgYNh/iPFiU43cEXcQdachQpNQ4uNCRsgyFZyFAJNemPiGGAOOOaLiJYW0Gwz+ps73MrBXYDry4fLekMmx7SNyZyQwOGjmzOyntBzFRKg8Ztxduv8LQ+0pFcOSMmNZKdiYBuHsAqKo5fJCeDj7mmkL40SsVjn3iFDXsiqnx+fWeM+xdBVsJva5JH29INwPFB2QyoILoZfFwJOyVSbZcnVhCc3iAOPzffA/MUiYaroGkxqSj+fEdchNm4RW7y0ouIiuWXin6iayDVufSK2C4FJSJBVn1jlFhYZZ07fIF4YSbnVApzDEBSsdzswpQwT/FKwfqCmdBFoJc1ngtSY0leu8POo5y55XBfJMzY0tKsq+jPPNvg7WKbhwbzKKS4/dbP8L9K8YcFgdjve8q02efdN9Jm91NU+KLdnQnsNA9nrjRgBhFgkbrp+4vrs2msNJ/TTlEoAKbbpqkp0fNR0OXvm8Uscs7WUVRgaAieC4ANsuFmhPfuhwVS8vFCNMKYx0Q9q+wu8x0uts2kAfBLl7hvhVbv2UTYHONkknjRVItivqtasxw32hJvj0pFo8T653OwJ6AVBzRp+b84H4u8of6Jklv+dx8IVyP7jb0cSVA4ap07xfh3BbuIJQRgfCvAGjQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU0PR04MB9417.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(396003)(136003)(39860400002)(366004)(376002)(346002)(230922051799003)(1800799012)(64100799003)(186009)(451199024)(4326008)(2906002)(8936002)(110136005)(7416002)(66476007)(8676002)(5660300002)(66946007)(83380400001)(26005)(38350700005)(86362001)(36756003)(66556008)(316002)(921011)(52116002)(6486002)(9686003)(6512007)(6506007)(478600001)(41300700001)(38100700002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?TNnjcdy3CSd2GlsHwM8VxBs+aDQo?= =?utf-8?q?1XKZBcG+4rFkyJQBeAZMrLVu6ziLg6xVnbN/+R42FR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KFGSRv59ziS2qu06eJzMM4X2JPubzxkV4?= =?utf-8?q?6nDtfrBGJCgEybytm7fvgMLQJXSWRVvMuRfWuDO7T/lMI+Y6JXzuqFfKSqyL8DIr0?= =?utf-8?q?2N4C3AVooNdOAElnHYsfSztLg0M+TnGdb8jH5mgvrHdRHl3IZKUjEu4GRPiOCfJWd?= =?utf-8?q?l8GBgclRz9BR/BE15Ffh57EhMyUduwG+J1Zw7qM6vqe47xr+uuFrwISfJ3JKD3qZW?= =?utf-8?q?HTCr2cF9MNgjG3ql50qIsZpcD7IhYplrs0T0jtnfewkDgrppKNGB6QZFQU53O4fiR?= =?utf-8?q?Japl3hMiBrVzTYo1I5yp0ekDUeTTbsrw+a4oBmn5r3FKcr7XfyHTdA3cX38cR39KV?= =?utf-8?q?kLo1ULMFVwHU1Xo8v/GK3yKOkBFSJXGVgrbPzgK0co/IU2A1E67g8xAeHnCL05cPT?= =?utf-8?q?QNsSfE5nk0Me9nRSuCVn1gmyOUZ2BynxbnRODGN9KE6rjJA4XQmzyBTxC69G9bMNo?= =?utf-8?q?5z8F+mysxbhDH4l2kHYYfVWFGWWeFzwmKlGSY1RWIK0nBFfMNtXZf47RAsZwoS4Bx?= =?utf-8?q?tiC9xdCFkAHxLm1P7nJ6bPR1Emc+DuAzVY7PuuZlA3zhNqbwHCFHI+Gc/9xKmUTLJ?= =?utf-8?q?gTYFx3s1HlzO?= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 56f1e9df-12a3-4207-9563-08dc1d959213 X-MS-Exchange-CrossTenant-AuthSource: DU0PR04MB9417.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Jan 2024 11:05:41.9789 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: /eLFqH0X0w3OKLt/iTYTvnVEYP3KxZVXELKiAb2URe0j7qYyg/jgKPeoG5BNrghEbAG3xzAct6ZOpi9t1o3DrQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR04MB8013 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240125_112113_411030_C0CCF2A8 X-CRM114-Status: GOOD ( 18.28 ) 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 From: Peng Fan Clean up code to not use global variables and introduce sysctr_private structure to prepare the support for i.MX95. Signed-off-by: Peng Fan --- drivers/clocksource/timer-imx-sysctr.c | 75 +++++++++++++++++++--------------- 1 file changed, 43 insertions(+), 32 deletions(-) diff --git a/drivers/clocksource/timer-imx-sysctr.c b/drivers/clocksource/timer-imx-sysctr.c index 5a7a951c4efc..8d5bfb8470fb 100644 --- a/drivers/clocksource/timer-imx-sysctr.c +++ b/drivers/clocksource/timer-imx-sysctr.c @@ -20,32 +20,39 @@ #define SYS_CTR_CLK_DIV 0x3 -static void __iomem *sys_ctr_base __ro_after_init; -static u32 cmpcr __ro_after_init; +struct sysctr_private { + u32 cmpcr; +}; -static void sysctr_timer_enable(bool enable) +static void sysctr_timer_enable(struct clock_event_device *evt, bool enable) { - writel(enable ? cmpcr | SYS_CTR_EN : cmpcr, sys_ctr_base + CMPCR); + struct timer_of *to = to_timer_of(evt); + struct sysctr_private *priv = to->private_data; + void __iomem *base = timer_of_base(to); + + writel(enable ? priv->cmpcr | SYS_CTR_EN : priv->cmpcr, base + CMPCR); } -static void sysctr_irq_acknowledge(void) +static void sysctr_irq_acknowledge(struct clock_event_device *evt) { /* * clear the enable bit(EN =0) will clear * the status bit(ISTAT = 0), then the interrupt * signal will be negated(acknowledged). */ - sysctr_timer_enable(false); + sysctr_timer_enable(evt, false); } -static inline u64 sysctr_read_counter(void) +static inline u64 sysctr_read_counter(struct clock_event_device *evt) { + struct timer_of *to = to_timer_of(evt); + void __iomem *base = timer_of_base(to); u32 cnt_hi, tmp_hi, cnt_lo; do { - cnt_hi = readl_relaxed(sys_ctr_base + CNTCV_HI); - cnt_lo = readl_relaxed(sys_ctr_base + CNTCV_LO); - tmp_hi = readl_relaxed(sys_ctr_base + CNTCV_HI); + cnt_hi = readl_relaxed(base + CNTCV_HI); + cnt_lo = readl_relaxed(base + CNTCV_LO); + tmp_hi = readl_relaxed(base + CNTCV_HI); } while (tmp_hi != cnt_hi); return ((u64) cnt_hi << 32) | cnt_lo; @@ -54,22 +61,24 @@ static inline u64 sysctr_read_counter(void) static int sysctr_set_next_event(unsigned long delta, struct clock_event_device *evt) { + struct timer_of *to = to_timer_of(evt); + void __iomem *base = timer_of_base(to); u32 cmp_hi, cmp_lo; u64 next; - sysctr_timer_enable(false); + sysctr_timer_enable(evt, false); - next = sysctr_read_counter(); + next = sysctr_read_counter(evt); next += delta; cmp_hi = (next >> 32) & 0x00fffff; cmp_lo = next & 0xffffffff; - writel_relaxed(cmp_hi, sys_ctr_base + CMPCV_HI); - writel_relaxed(cmp_lo, sys_ctr_base + CMPCV_LO); + writel_relaxed(cmp_hi, base + CMPCV_HI); + writel_relaxed(cmp_lo, base + CMPCV_LO); - sysctr_timer_enable(true); + sysctr_timer_enable(evt, true); return 0; } @@ -81,7 +90,7 @@ static int sysctr_set_state_oneshot(struct clock_event_device *evt) static int sysctr_set_state_shutdown(struct clock_event_device *evt) { - sysctr_timer_enable(false); + sysctr_timer_enable(evt, false); return 0; } @@ -90,7 +99,7 @@ static irqreturn_t sysctr_timer_interrupt(int irq, void *dev_id) { struct clock_event_device *evt = dev_id; - sysctr_irq_acknowledge(); + sysctr_irq_acknowledge(evt); evt->event_handler(evt); @@ -117,34 +126,36 @@ static struct timer_of to_sysctr = { }, }; -static void __init sysctr_clockevent_init(void) -{ - to_sysctr.clkevt.cpumask = cpu_possible_mask; - - clockevents_config_and_register(&to_sysctr.clkevt, - timer_of_rate(&to_sysctr), - 0xff, 0x7fffffff); -} - static int __init sysctr_timer_init(struct device_node *np) { - int ret = 0; + struct sysctr_private *priv; + void __iomem *base; + int ret; + + priv = kzalloc(sizeof(struct sysctr_private), GFP_KERNEL); + if (!priv) + return -ENOMEM; ret = timer_of_init(np, &to_sysctr); - if (ret) + if (ret) { + kfree(priv); return ret; + } if (!of_property_read_bool(np, "nxp,no-divider")) { /* system counter clock is divided by 3 internally */ to_sysctr.of_clk.rate /= SYS_CTR_CLK_DIV; } - sys_ctr_base = timer_of_base(&to_sysctr); - cmpcr = readl(sys_ctr_base + CMPCR); - cmpcr &= ~SYS_CTR_EN; + to_sysctr.clkevt.cpumask = cpu_possible_mask; + to_sysctr.private_data = priv; - sysctr_clockevent_init(); + base = timer_of_base(&to_sysctr); + priv->cmpcr = readl(base + CMPCR) & ~SYS_CTR_EN; + clockevents_config_and_register(&to_sysctr.clkevt, + timer_of_rate(&to_sysctr), + 0xff, 0x7fffffff); return 0; } TIMER_OF_DECLARE(sysctr_timer, "nxp,sysctr-timer", sysctr_timer_init); From patchwork Thu Jan 25 11:09:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Peng Fan (OSS)" X-Patchwork-Id: 13530852 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 8129FC48260 for ; Thu, 25 Jan 2024 13:56:12 +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:Cc:To:In-Reply-To: References:Message-Id:Subject:Date:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=fFzgdnf+tYVGv6d3kV33wPHdsrzdtj7cBauSu+VRxdU=; b=OtWIjbHK8xwhgjWni+vyjC0JY8 zkCi53CMu+kPVFRsjTlGSc43sqPZzUvdT0GpMYJwOI6RTshE0U0IWmrWJP23bMT8t5vfdeK929t5r aH/qiy7TRozxY8NRW2sxxmrOQCVDqr7COpkzeOdIzyA5Lxr4ffw+GhQYRlKZ+sRV6gSZCYn1qSVMN v5gT3E4E6/vWK6W0mu4/6gPetmIZs0FOXXYeWvBXeahViOCzhSgkymP89vUxQ842cwy6dWEC5P4Dh imuN5RA4ZCWSM0Pa8zY45MlFQl3kS4c/9P04bcbvV8hlED7OSrzDuNOD7jkOY5RKTIkoyfdGYQgis 0lGO1Dvg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rT0D3-00000000AAh-2R7B; Thu, 25 Jan 2024 13:56:01 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rT0D1-00000000A8z-35UK for linux-arm-kernel@bombadil.infradead.org; Thu, 25 Jan 2024 13:55:59 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=MIME-Version:Cc:To:In-Reply-To: References:Message-Id:Content-Transfer-Encoding:Content-Type:Subject:Date: From:Sender:Reply-To:Content-ID:Content-Description; bh=F1lUtjwppp5r6I2j8GSA70ZjQecm5QrSH07ZZ+SCFs0=; b=G3JC+fEtiBC//xXtcecwPtOVsK bXfXu9iiCXXe8xl2j0QZHYgCVdoy9tKr1JSyHKsS5Lphdk6uGj4liiz1WY8CaRbtaBakSxZkoAuaM y0XifzOJegL6dAufyHxSGXoP1oQLhAjR8+x4iIBZJMYNR0wUDjQhEv6TwjhfTn+UEzYPT0q2Csh7g jg6M9MHoseOEITCLFBsDWYo9je/liUFNlK4xsq3kYkEdb1/poezyTUllkUfSu3sCWLxv8MZf8C25/ 8WYxE0lpeLjSbF1dL1l6dxVViXtgu+jHotwiYkzzLFNj1hw5lOy+5YoYz3AhwlvenTrW36fvq/gio NcOsopcA==; Received: from mail-he1eur04on20601.outbound.protection.outlook.com ([2a01:111:f403:260f::601] helo=EUR04-HE1-obe.outbound.protection.outlook.com) by desiato.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rSxnD-00000005B5w-0Dpg for linux-arm-kernel@lists.infradead.org; Thu, 25 Jan 2024 11:21:13 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gjaL1MFP0yWY+pIJEBDbzL1GApwU5CcOoaTfQbIF9ufEPf1xN0/jajxJphRTf62ownFwGpIKttwedpR8Rr8iLMLdyEuFe8zJesOBrkl2mYBVYNU95lmew2Asr7z3g+2w+owYJDX/qX1PNSF4l0JDorUzNPIPKKl1XVYZ/RjDFKaDJ56C1/VStV4C/1aMiZBnLIAU+nw+UMwPh76W6ai3udT/VJ7LaT71Lb/UQKUbkSqgDbgd6wC8q6O71MoPyZ5ZS2ei3p/l9nrhucS0l9UBTDwCAMvn1JWZV9PmSkR1sqwz5gv6UcyqUp4nF2/tnvnMumvwj2+vwL2rEKBInt9dQw== 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:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=F1lUtjwppp5r6I2j8GSA70ZjQecm5QrSH07ZZ+SCFs0=; b=VyGqE+WakaylFiWkBjv6XQXFsWwx6B18S+Huausu2Dqo6gIdFztOlQdIxVXQpjEjDxHOdNCSZntpebQQJ//tDA4tszS9CsqKvV13aAEzUwlT3DesVyM/+67fQshgpzHf8BoQiUSCEoJgr7oCFCqmPHJy2GVPVR0FFBYNyy53Ogjqd/0M23jcksvux0/3OO3vGbTRwWWnHG90D0Er3pWU6DsNIUlUwfcIjQ917zUAyeU29nUU0jOgBZ5f/EIpuHKVDdhgeZ6p+c4HgdsHNhgIvZliC4wqEN+vhBg9l+Q5demiAQOfjEVJDOysM4RGmXxPdF6zCj6ALXlKCZMa2MQVPQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NXP1.onmicrosoft.com; s=selector2-NXP1-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=F1lUtjwppp5r6I2j8GSA70ZjQecm5QrSH07ZZ+SCFs0=; b=HzlLWHdE6FugOl5BFS96TJQvYxr/awsvhqvtn13SjVC5YANOc+R0qv5b3W0Uykn75ukIyOG362pPAGEYPXVKVUqH9rdwa0LmCgwKy8KQdikibQt5dA9mSynjIuren6LRtUR0nnFF8CBlSeYlN4x69fPUZ445XAEMbBVds7cldYI= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=oss.nxp.com; Received: from DU0PR04MB9417.eurprd04.prod.outlook.com (2603:10a6:10:358::11) by PA4PR04MB8013.eurprd04.prod.outlook.com (2603:10a6:102:c4::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7228.22; Thu, 25 Jan 2024 11:05:46 +0000 Received: from DU0PR04MB9417.eurprd04.prod.outlook.com ([fe80::c499:8cef:9bb1:ced6]) by DU0PR04MB9417.eurprd04.prod.outlook.com ([fe80::c499:8cef:9bb1:ced6%3]) with mapi id 15.20.7228.022; Thu, 25 Jan 2024 11:05:46 +0000 From: "Peng Fan (OSS)" Date: Thu, 25 Jan 2024 19:09:49 +0800 Subject: [PATCH v2 3/3] clocksource/drivers/imx-sysctr: support i.MX95 Message-Id: <20240125-imx-sysctr-v2-3-7332470cd7ae@nxp.com> References: <20240125-imx-sysctr-v2-0-7332470cd7ae@nxp.com> In-Reply-To: <20240125-imx-sysctr-v2-0-7332470cd7ae@nxp.com> To: Daniel Lezcano , Thomas Gleixner , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Bai Ping , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , Marco Felsch Cc: linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Peng Fan X-Mailer: b4 0.12.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1706180999; l=3432; i=peng.fan@nxp.com; s=20230812; h=from:subject:message-id; bh=o5T5BQKnKVPTSdGEy9mYdRRrgmMK7+tO3UEptrQOgLk=; b=FEsy12o6ILGS1hX1lH8QsgAY5uedRZp2M1mmWP6+s3XkZhWbMKRC/s3w+AGnYPWrxGGNgImFy nj0ChHfVJ90DlQyaU76EBMK7qvmBvi0wNTZGDYhafQwiUnlb4mQnaMg X-Developer-Key: i=peng.fan@nxp.com; a=ed25519; pk=I4sJg7atIT1g63H7bb5lDRGR2gJW14RKDD0wFL8TT1g= X-ClientProxiedBy: SG3P274CA0022.SGPP274.PROD.OUTLOOK.COM (2603:1096:4:be::34) To DU0PR04MB9417.eurprd04.prod.outlook.com (2603:10a6:10:358::11) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU0PR04MB9417:EE_|PA4PR04MB8013:EE_ X-MS-Office365-Filtering-Correlation-Id: 6dbe8eb3-51b2-4523-cb2e-08dc1d9594ec X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Ji3JYLCtVMTgvY7umRPh4Dy+TTsIbbfG+MBkIyddiS6KCXtmn3zaMxBH9cV7VdZVa2nSd0QiacVvFzCpFEZ55oPW+XfFq7CEWFUAcEKB0NFk1qgqyloLGN5Z5J/ypAoX/6sZByB+jV+voQLeWNK2+vV2XhU4bSbi0oF6bpdAZoZruILrSbRaZMsMvaCkFXcbP/g+8TAgjXL6zXXMmK42BMbv01RlVcgRarAQZmBulxWXfK22N/OnBy6dUKbB6EfhnDAkZuaOm+bOd617hDZ5n2r8yUrlt/yeA+sjYBSOwm4QhUFmmR37+Qb+LaG00Hndgbwyv1Yx2NIvrzoeaUL/8PXBQHh9OwzmA/4x0xxQz7e8d59NlsfaR6KXjfF4v1DQQ0NfyQlmeCCzgc/UAbGM8LwApF944tL2UaLZ+PCiJ90+OZXQF+dxlj+/ow/xtzlJJWNRuxn+9ZWP31eIAGY/vrHPEH2Fl0QTeqsm4xg1sUW5jQYzvpXqEGwxTbTHS+k23DyB4Ab1ff6xPU+Wg+CCNOPsilf37lAC4P38+eQ2Q7ygB4lG4v/vUlzxUfd5Jw4rlG8nMd9pp2pYHCRINh+8Mws+lrtAk0nuAzT64VW7ux/G8NixWS/8ojf7aKJHTdnWvTvazyvOLU514mqL7+MHmQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU0PR04MB9417.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(396003)(136003)(39860400002)(366004)(376002)(346002)(230922051799003)(1800799012)(64100799003)(186009)(451199024)(4326008)(2906002)(8936002)(110136005)(7416002)(66476007)(8676002)(5660300002)(66946007)(83380400001)(26005)(38350700005)(86362001)(36756003)(66556008)(316002)(921011)(52116002)(6486002)(9686003)(6512007)(6506007)(478600001)(41300700001)(38100700002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?qtQNDmoPi+OQ9X9bOKsJQi1Xedrc?= =?utf-8?q?JMkm5udcharWoUONlft4pzUmsk8mEu1Jy1oQOjFIOK8Rm2I1dq3VBumSpwDn8U2KW?= =?utf-8?q?o3zitI+65/SqniiGEXUEXkGL/++o66ybevZOiH09qbrZa6ln8pDCw7lUCcZhNZbiG?= =?utf-8?q?FmQop34jwxH/eX9BKX66PLv5qM1AYsmVJlDxyapls4eibHUUp7cTti2He+sgcv8w0?= =?utf-8?q?sanv6D8toDdpDJTJPYjBeQOO/7m6UGDUI4HP1XmjoS0pwQOUFx4nleRmwZTk5W34i?= =?utf-8?q?Ip0vhMXvW4OoLpMS6k6KP9R/cknwndpPGupVlyaRYFImQ1XiIQFwBCsWCO31H1eEy?= =?utf-8?q?U+tJ8iWt0BUXcI8nge7ZLwRHFQKHZong97KF8C0Ekska1gDyD2ydNlAU0iEUcAQcB?= =?utf-8?q?A0ZXtImBJrLJjY9NFvxkNYypPZ0t1EX8dH154MpgcI4fMYCLN0raCUJqOviRsH7Db?= =?utf-8?q?cjfxqStpF5B8H3HAe5VpF/fNyYT0MoYir+h/9nGMeNwLrbA7bMe1FKcmXtyPLybRH?= =?utf-8?q?wnRSqwUxN9TfyGYiHmCd05SY/SsKxfqiPaV6MrFyypdEfht7d94Fr6SRD7vFdL14o?= =?utf-8?q?A4NBfYjLhu5UTnXw6OoqO+Oo7f7jpIHmkHmIJ3Keh6l/oQAXgNfbJrlGjctcLUWZf?= =?utf-8?q?sq9bQT1XMuNmXDqgKqf5+pNA95J4vxfLYrKC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ossTenant-Network-Message-Id: 6dbe8eb3-51b2-4523-cb2e-08dc1d9594ec X-MS-Exchange-CrossTenant-AuthSource: DU0PR04MB9417.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Jan 2024 11:05:46.6599 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: VsNe3H2XsZWR5yYB/im+o7UN+HXlCXIH2DuIDCkQfuLoTaOujpysbPVbDu6SqmTL12GJY5SYGynAkzekBkaFbg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR04MB8013 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240125_112111_193251_A0F4D1F8 X-CRM114-Status: GOOD ( 15.93 ) 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 From: Peng Fan To i.MX95 System counter module, we use Read register space to get the counter, not the Control register space to get the counter, because System Manager firmware not allow Linux to read Control register space, so add a new TIMER_OF_DECLARE entry for i.MX95. Signed-off-by: Peng Fan --- drivers/clocksource/timer-imx-sysctr.c | 53 +++++++++++++++++++++++++++++++--- 1 file changed, 49 insertions(+), 4 deletions(-) diff --git a/drivers/clocksource/timer-imx-sysctr.c b/drivers/clocksource/timer-imx-sysctr.c index 8d5bfb8470fb..9b7c021c3b46 100644 --- a/drivers/clocksource/timer-imx-sysctr.c +++ b/drivers/clocksource/timer-imx-sysctr.c @@ -8,12 +8,15 @@ #include "timer-of.h" #define CMP_OFFSET 0x10000 +#define RD_OFFSET 0x20000 #define CNTCV_LO 0x8 #define CNTCV_HI 0xc #define CMPCV_LO (CMP_OFFSET + 0x20) #define CMPCV_HI (CMP_OFFSET + 0x24) #define CMPCR (CMP_OFFSET + 0x2c) +#define CNTCV_LO_IMX95 (RD_OFFSET + 0x8) +#define CNTCV_HI_IMX95 (RD_OFFSET + 0xc) #define SYS_CTR_EN 0x1 #define SYS_CTR_IRQ_MASK 0x2 @@ -22,6 +25,8 @@ struct sysctr_private { u32 cmpcr; + u32 lo_off; + u32 hi_off; }; static void sysctr_timer_enable(struct clock_event_device *evt, bool enable) @@ -46,13 +51,14 @@ static void sysctr_irq_acknowledge(struct clock_event_device *evt) static inline u64 sysctr_read_counter(struct clock_event_device *evt) { struct timer_of *to = to_timer_of(evt); + struct sysctr_private *priv = to->private_data; void __iomem *base = timer_of_base(to); u32 cnt_hi, tmp_hi, cnt_lo; do { - cnt_hi = readl_relaxed(base + CNTCV_HI); - cnt_lo = readl_relaxed(base + CNTCV_LO); - tmp_hi = readl_relaxed(base + CNTCV_HI); + cnt_hi = readl_relaxed(base + priv->hi_off); + cnt_lo = readl_relaxed(base + priv->lo_off); + tmp_hi = readl_relaxed(base + priv->hi_off); } while (tmp_hi != cnt_hi); return ((u64) cnt_hi << 32) | cnt_lo; @@ -126,7 +132,7 @@ static struct timer_of to_sysctr = { }, }; -static int __init sysctr_timer_init(struct device_node *np) +static int __init __sysctr_timer_init(struct device_node *np) { struct sysctr_private *priv; void __iomem *base; @@ -153,9 +159,48 @@ static int __init sysctr_timer_init(struct device_node *np) base = timer_of_base(&to_sysctr); priv->cmpcr = readl(base + CMPCR) & ~SYS_CTR_EN; + return 0; +} + +static int __init sysctr_timer_init(struct device_node *np) +{ + struct sysctr_private *priv; + int ret; + + ret = __sysctr_timer_init(np); + if (ret) + return ret; + + priv = to_sysctr.private_data; + priv->lo_off = CNTCV_LO; + priv->hi_off = CNTCV_HI; + clockevents_config_and_register(&to_sysctr.clkevt, timer_of_rate(&to_sysctr), 0xff, 0x7fffffff); + return 0; } + +static int __init sysctr_timer_imx95_init(struct device_node *np) +{ + struct sysctr_private *priv; + int ret; + + ret = __sysctr_timer_init(np); + if (ret) + return ret; + + priv = to_sysctr.private_data; + priv->lo_off = CNTCV_LO_IMX95; + priv->hi_off = CNTCV_HI_IMX95; + + clockevents_config_and_register(&to_sysctr.clkevt, + timer_of_rate(&to_sysctr), + 0xff, 0x7fffffff); + + return 0; +} + TIMER_OF_DECLARE(sysctr_timer, "nxp,sysctr-timer", sysctr_timer_init); +TIMER_OF_DECLARE(sysctr_timer_imx95, "nxp,imx95-sysctr-timer", sysctr_timer_imx95_init);