From patchwork Mon Jan 20 02:25:32 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Peng Fan (OSS)" X-Patchwork-Id: 13944692 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 57102C02187 for ; Mon, 20 Jan 2025 02:28:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:MIME-Version:Cc:To: Content-Transfer-Encoding:Content-Type:Message-Id:Date:Subject: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=yF0uQNgFw5Yy34x1AZuSpDopMmpLae2IP7dLDRAH6XE=; b=kFNIDAqlR3Odhfs0WxZE2NYWAG nT9XgJmTfCBZBWLavR/gIPXaiEkl0FLXlRSYMtUtbBTbk8F+wmXX3INNKDSy6VpeZt1u6IncCxoSd wPbntBmDTI5N5fvoA1dM3vuUT4xNyCamt5M+NNDe8FiAmMoed2aeiQqkuFjghohDgzzzZYLgUxwGF WNmk/kJJ/m5naNtLS0aU0um9xoVJCG8Z1KL40f3auxGGB28/I8n8RMQLRazx5B0lSJG+1M1cmoHLb k2RoOdpUjHH8KpBwYzMVZrzDrP66FwVwo/5wyo1Z8taNKV23lGrQTXj5ShvUZ4rVCl3KKag0vE1QB joVwb0MA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tZhW5-00000004aJD-2Emj; Mon, 20 Jan 2025 02:27:53 +0000 Received: from mail-vi1eur02on2061d.outbound.protection.outlook.com ([2a01:111:f403:2607::61d] helo=EUR02-VI1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tZhUn-00000004a4J-35Qr for linux-arm-kernel@lists.infradead.org; Mon, 20 Jan 2025 02:26:35 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=f/qRP8pOU6pcSkFmfd7jdy3FxRcXb9P3jPOTGEQUZ8X99G4ujNrTOVf8Dk6/rEko9pDR2IZexjztJBLIAmHHEAteakwL4c0j2jJBAmEv7N4FFMrVXTwkkOSfwzgbFI2ThcP2H39TEQXZ2eZtBkOpqmyYJZ9xTzYWDb4TLSNTN0jid8XwAYB0fdsMFnstJp872H22dk47s4XEJGYMEyXnne6UFmp44O51Sdl1yAbBjV4MqD7EN60nzcg/GZcJzyzm3LelBTARHA+JPZbEW2jB5eMdN6aSpnJpjzDIpGkKwqWzcgVbaLpwxKnZVssdy9hdq5oPRixAXdbTKUf/F0GQrQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=yF0uQNgFw5Yy34x1AZuSpDopMmpLae2IP7dLDRAH6XE=; b=Hmr1nSu8B4XLgKfKz1XXhMQkzr3wTuxqWrSsTv1ZmHk9w/GfH/5ZZJ8EhZ+wr/IqHW+231G95UN1n3nPNMCa58WO3f9Jqozmi0u0Lf4ZsqPMnEXQ3S0WPPd1CJzLIPIHWeBcZEjnQHRzbiY19QZD2vdlqY8vg6HnSGqCWD/YZrm1KdtSiXOyXl7uxkKDKdaWc6rvIEDA8+6TjPrxXLs5ap8MaWAHe1O9Sye0O5d7g41hXH7mWkF8FL0B74kPkyuTNsus63WCNMliT4jTZs4zuI2cmHbAEPrdhPRcJMmpftkC+ARYnnF5oKk/yeWl6li1L62fOyOzvnQWW+mHRuY1pA== 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=selector1-NXP1-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=yF0uQNgFw5Yy34x1AZuSpDopMmpLae2IP7dLDRAH6XE=; b=WTLHWuCXLkuTQkwaK90/v4LViBDRqhYOkSy/lg0jSZpjknycOfQh1rMj7+npdSDKopvBgDvtyxU3X2i2iNXK8bcQq7gumHYjurrr6975UHeGQUD5XIO4DZDeKs5yGpmMVmRPVu+l0VFQpnbpPs1m/2zLnSDIFCC/4LY3gKOXbjHCpapKtQo7BVQUnbLq7ScMqvCl3+3yY4Kyz+kcUYkQa1876x8+ZQEHaLnEy8I7+2pTK1BKX4ObQAglyCRlGgtBJeZnzpQvNhEbWMh9BXyN1ce9LdgqXoDyzf5uZ6c86saJePUQuO5lCK+uwSir0pdyrjPrM0Cx8eOEHbhPKzVnEw== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=oss.nxp.com; Received: from PAXPR04MB8459.eurprd04.prod.outlook.com (2603:10a6:102:1da::15) by AS8PR04MB8690.eurprd04.prod.outlook.com (2603:10a6:20b:429::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8356.17; Mon, 20 Jan 2025 02:26:25 +0000 Received: from PAXPR04MB8459.eurprd04.prod.outlook.com ([fe80::165a:30a2:5835:9630]) by PAXPR04MB8459.eurprd04.prod.outlook.com ([fe80::165a:30a2:5835:9630%5]) with mapi id 15.20.8356.020; Mon, 20 Jan 2025 02:26:25 +0000 From: "Peng Fan (OSS)" Subject: [PATCH 0/4] rtc/scmi: Support multiple RTCs Date: Mon, 20 Jan 2025 10:25:32 +0800 Message-Id: <20250120-rtc-v1-0-08c50830bac9@nxp.com> X-B4-Tracking: v=1; b=H4sIABy0jWcC/6tWKk4tykwtVrJSqFYqSi3LLM7MzwNyDHUUlJIzE vPSU3UzU4B8JSMDI1MDQ0Mz3aKSZF1jC2OTVANDcwuzRAsloMqCotS0zAqwKdGxtbUAmXWPo1U AAAA= X-Change-ID: 20250116-rtc-3834e01786a8 To: Sudeep Holla , Cristian Marussi , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Alexandre Belloni Cc: arm-scmi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, imx@lists.linux.dev, linux-kernel@vger.kernel.org, linux-rtc@vger.kernel.org, Peng Fan X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1737339953; l=1510; i=peng.fan@nxp.com; s=20230812; h=from:subject:message-id; bh=uYUIvAjqkNvoZ7SYr2J7cI2jkmAHJYRr+h7tx4zRSQY=; b=BbeN+KbmD69TsK3AjSr52fQhvFcYwRcV2RbvGdTVS0gy/CKiKSPM+Vw68TWlfqlxBaRzfIZMN 3MABsJtZzZeAnHsHIF7Vxy0F+xwDvBBbA/BD0tCnPtB0jEQU9CExYHG X-Developer-Key: i=peng.fan@nxp.com; a=ed25519; pk=I4sJg7atIT1g63H7bb5lDRGR2gJW14RKDD0wFL8TT1g= X-ClientProxiedBy: SG2P153CA0038.APCP153.PROD.OUTLOOK.COM (2603:1096:4:c6::7) To PAXPR04MB8459.eurprd04.prod.outlook.com (2603:10a6:102:1da::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB8459:EE_|AS8PR04MB8690:EE_ X-MS-Office365-Filtering-Correlation-Id: a72c6aee-8321-4e57-97d5-08dd38f9d66a X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|7416014|52116014|366016|1800799024|38350700014; X-Microsoft-Antispam-Message-Info: =?utf-8?q?QEeJwB/NfguPtSCkiHhsl1H7eB+KNq/?= =?utf-8?q?F0uDoezP6TkNw+nk2Fvth10jUgkjwj8cAFeqoh7qoMRovgUBHEpOMN0XqYon5g5L/?= =?utf-8?q?cs7izCxU8Ag+jhYB7HF9LJevd2oET3BIS1KCW7mLRkK+ZoGQj5FIl77F9+UclCNdy?= =?utf-8?q?5zem0H6ohgPogrsgUfm2GQUVXkpam2H2A6SZffeOtj1Zd/7fockWts3GpsYYI5xlg?= =?utf-8?q?quTVdRClD12ghFwY1CDrv9mccRaEBKkXQaHzTWQTAc0YUKKapHfX2HWC8paZPuMZa?= =?utf-8?q?3dy56FsGsxa0eRP3cpkxYDT2Ev984D4hYoC5bN3PzOpXd612dTYql1VSym8HEC8gb?= =?utf-8?q?HyD0HymJnzqWXvewiqe9HD0B7BwXdj2nLx49JwEsnInw3nWJph0lPA8eGOhDomwit?= =?utf-8?q?em5cPZaSIhg1uPljyunNGjjeXI/sJjLKgvDZbuh5WxDlFxLF1HUpJR13FpErDTLjX?= =?utf-8?q?gPaeDqPCkw+4CEb1LDc1LH9iAjNABRihVYAjcVxrlVp2HNUy3ytTB6B0XQQit3RUY?= =?utf-8?q?MBvKRVKpY+HtJQ/jIJeLC0l+MBkFzFpSnphfgY6PvRW3SvBpQ1llrOI9WBuvv1HZg?= =?utf-8?q?A4KabnXTH4DUPQjsTbZmP9hC6Rt6zhAWbYxybumw0EzDGssL3u8mwxoxguF0xaxSr?= =?utf-8?q?kU7JKbqBsx4vwhWmL048sbVktbOxVisiROMBagSs6LGC8T++S6EvYEeDYUvhWN9mR?= =?utf-8?q?JCpTBUUxcSvXJXrewwjw+PQzhQSkc5RNqJKhIAiA15Hk8pUc3kwKpOZAnFRCccNli?= =?utf-8?q?BiqqxBM+A9x5Kx5rwm5MaIy+P/HNKo7UpyCqKOgQSFpGh8yePnbkusKdVI8LBTKuy?= =?utf-8?q?XWE20WqbV+8TKq/R4lNDGFfrNrdEZPNwqT8dVYlc1QAq2sVfOgH6Jf3nAJaMQM7Zi?= =?utf-8?q?PjPKosRZhYMwyc7xquXZ2nvNbj6jfHIATRqWnyvXfPxXAHmDW8E6CzYsmZoPABDZF?= =?utf-8?q?P35mtXjiB7QopPZ8pa34kHD4onsnCSmgeXapKtBGmvMzSi/40gEqvNSQ5paB+IvpE?= =?utf-8?q?sU8DxatR/jxU+tQiMHqvGm5zIMFzyv5JLlOUHlYDZJLnVW14FWPjNp1nc0hySEpZG?= =?utf-8?q?QaMt4UhiFFY1PsTe4ryeUitf4SsMfQbyYijqFWvS8XsrWSHtPOniMn6vwj1tdfJCc?= =?utf-8?q?QzhCk1BOVxZNTwgVCRSuNF4FEruo8iHBWIhK0QLiw78HOvG3C4GbOUXdS1Cwosl0j?= =?utf-8?q?NpvkOSoBHLSdbFuCbIyNlSBAECBMMGaSsZMWaeg+l9Y33X7toffZ5nSPdPvW5eQuB?= =?utf-8?q?C0qLZNwahHvdXUUyIVQpFhe9ZpZcDvPF7wdnbCmXwiCP10ar0RqAg2BWu/UU2HsNE?= =?utf-8?q?657C6u1fVG5Oh7Tvk1i+/0VNnCEvcyEuf3JRN91YgCWR8L/SCFO0fGlBVj9P+pJgm?= =?utf-8?q?vKMeIeu0iUR?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PAXPR04MB8459.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(376014)(7416014)(52116014)(366016)(1800799024)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exch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5AgHL3O9xm9Izvlivc8mfftWgzlVesT9+YKZOpKuuPv4Ay8cm9?= =?utf-8?q?HBMLihUVMyIeHMijaVpVxnkbAD+2MRCgoPcpyMpWYVwh99NuArEi7iKXRnk5T8t1S?= =?utf-8?q?DZCpKu2eaoWXTLUz44KL4FrBSTyvRnAgwz1k+vO2TShb/7022FZFNBpo1elzn7sB4?= =?utf-8?q?pTJXVx6YKwuCSL8nZhpmRoFuJR3nCzwKF5YDSNrCXrU3KcmTOxrsQpJzmoG7IzW4a?= =?utf-8?q?mMqO8q3flqcw0M8QQHbm8wc78R4Nm9DmMeGKFBcEFqi49N2n8GZbUswtBs/HiJbLU?= =?utf-8?q?OvrI2xfCYwbTZt/AR3cZL3O1sXpz2QVm95DJhj4hFcx2nTS6MZ6p2s2K20CYkXjOm?= =?utf-8?q?frBDZVVt+dEXnN8VYJor4ljjICPCEgclsGu4DrYLLg1NSF8/iFdvOyAFIlFXOfznA?= =?utf-8?q?Aj9x4zJXSUbzYCnpivhvU4KjeEEDhXCnDxWd+bF8QAt+nHVLQC46zVPgxnSd0ENyX?= =?utf-8?q?1RN/FJq8nHJq+BT/C8o2J7SW1VM/pdXAHVYyNRRp0BeSvnRbzmVmJZgjECqNhCXvT?= =?utf-8?q?vql/JDgfKWQ0DMy7yQZB29VdvZv/9QGYEg+f2oU1f+ofb4m9Oxtiw1lsfG3xQ6Tvj?= =?utf-8?q?hHlx9R6eQEmFT8fEB73iyT5naSdd7ItqQqdjsD0A1eUbSc+ryj+UhHjhFPhBMnHe1?= =?utf-8?q?X66eeZdzcpmo?= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: a72c6aee-8321-4e57-97d5-08dd38f9d66a X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB8459.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Jan 2025 02:26:25.3640 (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: Ngp77sjrSVJZoyG5qwTg1ZDA7OA/2Ojrwp4ZTqHTpTviSkIG+l7Pmzu2RI1qwZAe+wOuBef3r0L1uPZ8CHZK1g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB8690 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250119_182633_894930_8488F083 X-CRM114-Status: UNSURE ( 8.44 ) X-CRM114-Notice: Please train this message. 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 i.MX95 System Manager(SM) BBM protocol exports two RTCs for EVK board. one RTC is SoC internal RTC, the other is board RTC. The current driver only use the 1st RTC. With this patchset, both RTCs could be used in Linux. To achieve this: 1. Support more event sources for BBM protocol 2. Add bbm_info hook to let users could query the number of RTCs 3. Introduce devm_rtc_allocate_device_priv to support setting rtc device private information 4. Update rtc-imx-sm-bbm.c to register both RTCs Signed-off-by: Peng Fan --- Peng Fan (4): firmware: arm_scmi: imx: Support more event sources firmware: arm_scmi: imx: Introduce bbm_info hook rtc: Introduce devm_rtc_allocate_device_priv rtc: imx-sm-bbm: Support multiple RTCs drivers/firmware/arm_scmi/vendors/imx/imx-sm-bbm.c | 33 ++++++++++- drivers/rtc/class.c | 9 ++- drivers/rtc/dev.c | 8 ++- drivers/rtc/interface.c | 16 ++--- drivers/rtc/proc.c | 2 +- drivers/rtc/rtc-imx-sm-bbm.c | 69 ++++++++++++++-------- include/linux/rtc.h | 2 + include/linux/scmi_imx_protocol.h | 2 + 8 files changed, 100 insertions(+), 41 deletions(-) --- base-commit: e7bb221a638962d487231ac45a6699fb9bb8f9fa change-id: 20250116-rtc-3834e01786a8 Best regards,