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: 13944687 Received: from EUR02-AM0-obe.outbound.protection.outlook.com (mail-am0eur02on2044.outbound.protection.outlook.com [40.107.247.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id ED0F88F6B for ; Mon, 20 Jan 2025 02:26:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.247.44 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737339991; cv=fail; b=PRHzWqVZOsNxTbp3B4UX/h21HIx5jkEXB6+EvhE/5lkdYEOfVdPUAxCQjoYeS02vN6Y+lqsFWpCl7bowSbZcbBKPZ+H9HpAwmrxf09D3kwACTbskMNDdeuuE5it9sk+MIjYAmcUUgUaRaP5lCsLV3wOp0P0lNfhUW3+WmGETdyY= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737339991; c=relaxed/simple; bh=uYUIvAjqkNvoZ7SYr2J7cI2jkmAHJYRr+h7tx4zRSQY=; h=From:Subject:Date:Message-Id:Content-Type:To:Cc:MIME-Version; b=NA6V69r7vt8v1G+V2n8Mz9DDXwIoXJzDvuWB9lGkEqMD4ARPasLdlTdGwGwWkRnGyklyVP+dkFIthxJs5b6WcYTG4+F6ePUvC4MM4K3Yl/vKJaQTBVgIPSndMlDqq+yoqJJt76fM+98NS65bxu1An1AixHYPHqQ1b2vcrKPRjhM= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=oss.nxp.com; spf=pass smtp.mailfrom=oss.nxp.com; dkim=pass (2048-bit key) header.d=NXP1.onmicrosoft.com header.i=@NXP1.onmicrosoft.com header.b=WTLHWuCX; arc=fail smtp.client-ip=40.107.247.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=oss.nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=NXP1.onmicrosoft.com header.i=@NXP1.onmicrosoft.com header.b="WTLHWuCX" 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) Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: 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-Exchange-AntiSpam-MessageData-0: =?utf-8?q?zATnQLVL49UH3kmvSOD+CsFgZnBm?= =?utf-8?q?CkZgmIwNm0G8KJ8e4f2zliKPkBDH+wVCCW98v6qIDyMXvRPlxZEvmo9LTqJ3s01xh?= =?utf-8?q?2uMBaYUfLskMLGWSqYOcfuE9Gmyg9M2W2cCJ/SAQmB17jrLNCv+/5UoIsPXCdGr/1?= =?utf-8?q?1hsYQ9g+z+/KrEHwlXPnp9a25HNb3Wpcad0fJzZAbdxOLSVtdu65ASIPvYj1cxdgR?= =?utf-8?q?si5kEwpzRpU78h3zLx6sx2RUQUf5bE7wqeQkk6fxxwcdVPVZuOEK4gK4nu2gHmZHC?= =?utf-8?q?gKix45LkN3OYAKzzaCc85KoudkR/PCTc5YqPzYdSPzvx2zxtlWy6mDEONwH0Y1PB0?= =?utf-8?q?Zozq39hTx4NjQI1KTFtJoz1GSWMe63iPF7MN8ZZSCy5TvXQZ5l98gwwBkQanEIEw/?= =?utf-8?q?jsrOuiTrTef7M/qxpp/ED0u7A7QOaS7j6J/oeSVC+mcJjeanXqB9t5p8CQssSER2Z?= =?utf-8?q?27ARx3Me2Ct9+eACbBfEJAqNuJv1ITunWFULZDVUvXIZgCo2vyKXGlC9EvDensa1B?= =?utf-8?q?yhrPru3y7jXhHlFK+08XZmv9uqguyjTB4vP920sFw5C/+pEAIgtC5uy6OcxsWs1YN?= =?utf-8?q?T0p/2y55T47u6+S2HVapLsWRfojZS0hS6gFWU2Zh4t22wVHqiVsYMKDRzUvsfTQPL?= =?utf-8?q?hW9MeiHo8Bx/VzecInITOxLpo8+QcBiJUkyg1VogggOR3ACeyKHprTT+tICix+9Lq?= =?utf-8?q?gjbOuj2gLfGVLl060CReRYv8GohEKSQYMHKy6ISXOrSAwpAFNe0t5rveoSo6Q7pE6?= =?utf-8?q?V3DnnmQI39wbrRywk8XwMd9DlwAthfoFFOmFwlRRSvkiIZlDwxfF3bAp19tsyln9C?= =?utf-8?q?PgoQ8jUHaLW1qEs5AgHL3O9xm9Izvlivc8mfftWgzlVesT9+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 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,