From patchwork Tue Oct 15 10:51:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ciprian Marian Costea X-Patchwork-Id: 13836165 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 518DCCFC288 for ; Tue, 15 Oct 2024 10:53:28 +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: Content-Transfer-Encoding:Content-Type: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:In-Reply-To:References:List-Owner; bh=MAbVjfYPNH1PEbrhDLFp6S/TVH0fgKHM0kj7tscVCUM=; b=iGrE5kf4HiAEhpOhiXTAZ9AA17 KzjCWTVcb2BLn22lT+p1t/i3TXrzC/RyCiSdsKJSxIqPJlGOxfyf8FCZ5kfoq+SUTa2iPQKiMdHrf 6kFIjp0YtPTtVI6h21IEqoc2SLEcq3GOyJuJ2j/TG9QYhp+jy36r4EWHTNrQfRRZr/Z2yMxrU5mo+ +ZOcClV02uDZG4pyNFAYFCojiLVJO6dqEnfcoH1Rf8HWN0Hz6OYsVbMecWJffgmTwhbBWX8OlC+ae ydCFRwqo0FpUisYjzKpEZOCj9oy41++Whgetg3opRqdzjdAPYItFUT8bVTr+t2dQyo3LibCcLO6a1 H08AktaA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t0fAy-00000007umQ-2qkM; Tue, 15 Oct 2024 10:53:16 +0000 Received: from mail-db5eur02on2060e.outbound.protection.outlook.com ([2a01:111:f403:2608::60e] helo=EUR02-DB5-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1t0f9U-00000007uLv-3MUE for linux-arm-kernel@lists.infradead.org; Tue, 15 Oct 2024 10:51:46 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=MhTF1V33Ieg2xcbdXZpz/5cPGEuXq5v6WyiiA6eVOLjKsmLmGd3kyVRmtuW+yLr5ZjOGXW12Wq0uu7Vva0/lH88TE9/iRniU/miNrFouqh+XtdifybTH/jnMvQH8SQPZuHD1tWn7pHOq7kseNS8ChHinYiGFcGP3RAYTF+BvO+ZC4uysUX30lUNMgjn9MdgU4oGXuQOKsWfGaSSBdS8sWOAwE3LtFNdULWEtvSU+afRlaP9UlXlJv90ekt6SpeOsV3r28ExDtUbWrsJI5fjxqwsZyC2CV7LG/GZLpEbmzdv0ZZuRhWpimOwDK7p9Yzy8Zsu8W0nkA5nkKDMZAgsseQ== 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=MAbVjfYPNH1PEbrhDLFp6S/TVH0fgKHM0kj7tscVCUM=; b=LXx3VflFRo1klPcfySKYLebkYTEGFuBldbNnfJ9NuLqOjLIEXVGdPgwi/dphZzRmGHE8zngbBYXw/ZbOdKz2m7qK7Pd48+SXhzGKmJ0wFH6c1OKnqbAk2GWYtXOnY1DYtbhF4RoNIFRu24TrgJJfKXBk8LT1LDiAtd0DP4YpUYa6+ogXegK3UBF9paeGOsE1lPUpE7l/QNsVZwuvgaYdMun2/3jkDiZDyE5wSjL25u6EjzmOP4/pkeACyrMJR1LGFOR4UrB171SQYK2f401K3cMPxC12qOGYhAlkfz7eORm184BWd5palX2lMB0ov0K+QsJdsefRNQ197LwcFNZtCw== 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=MAbVjfYPNH1PEbrhDLFp6S/TVH0fgKHM0kj7tscVCUM=; b=SwQ353ah7KnBSQ4Z8cKNq4+bnZz63o+wQ5oYEr+3eVzRde0qZSxWgVoMRyUuuRw/LPlLhGUW3c9AmFNnaArhVyHMFZWKiMghSLdTly2we7KgFKxoMVTfiwq5Br5qu5AMoIJDyjBnPJO9C1xLHYV8ELsMG0oAn+qBnLvUfKg4oK2JTgJG+dcq6O3y/vUG64Q/qQ/2H9J97n2336prMMWpKcRmZTify6Dy5FB00AqQmduMdtVT2SUi5OPIpS15sla8MOZ+c/uhQh820EPpC5N7YtaHYjPuvOJvK55TJZEdx4X6mPtgobrSk4IelBe9TqEuCLxfgSfSArEmzWwrPe8kvw== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=oss.nxp.com; Received: from DU0PR04MB9251.eurprd04.prod.outlook.com (2603:10a6:10:352::15) by AS1PR04MB9238.eurprd04.prod.outlook.com (2603:10a6:20b:4c6::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8048.26; Tue, 15 Oct 2024 10:51:38 +0000 Received: from DU0PR04MB9251.eurprd04.prod.outlook.com ([fe80::708f:69ee:15df:6ebd]) by DU0PR04MB9251.eurprd04.prod.outlook.com ([fe80::708f:69ee:15df:6ebd%5]) with mapi id 15.20.8048.020; Tue, 15 Oct 2024 10:51:38 +0000 From: Ciprian Costea To: Alexandre Belloni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Catalin Marinas , Will Deacon Cc: linux-rtc@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, NXP S32 Linux Team , Christophe Lizzi , Alberto Ruiz , Enric Balletbo , Ciprian Marian Costea Subject: [PATCH v2 0/4] add NXP RTC driver support for S32G2/S32G3 SoCs Date: Tue, 15 Oct 2024 13:51:29 +0300 Message-ID: <20241015105133.656360-1-ciprianmarian.costea@oss.nxp.com> X-Mailer: git-send-email 2.45.2 X-ClientProxiedBy: AM9P193CA0011.EURP193.PROD.OUTLOOK.COM (2603:10a6:20b:21e::16) To DU0PR04MB9251.eurprd04.prod.outlook.com (2603:10a6:10:352::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU0PR04MB9251:EE_|AS1PR04MB9238:EE_ X-MS-Office365-Filtering-Correlation-Id: f21502d0-ad4b-4149-4695-08dced075806 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|366016|7416014|1800799024; X-Microsoft-Antispam-Message-Info: =?utf-8?q?Mwcz//t6u9HJGOwe+V6aSgoNdT7xOsE?= =?utf-8?q?xdVIkhjlVZNGpoVqBqg6lgSj8tGl8TljGaWpHCm6M2a4Wm+7vYGjAY93Wojofhucu?= =?utf-8?q?xSUzbYkWZCbr8zTEAsB42b0fns/G0ZTVDubQHdBcgu0FKvLdt87rel3eFuqJVrMo4?= =?utf-8?q?E/eM1RNMFEuO4+O7+ZJA/wNrp6HUjCV9KER9H/TI210/8RkYIHQ3M6QNPbf0Fa8US?= =?utf-8?q?YPGLq/2AKn7wUp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cl1RlQNX0Au8t0wIoygKbls3s9gYeju4/xFsf?= =?utf-8?q?EHUiMWNl4SyAaRqZ3B7hTBj8vLwcxecPVO3/7CM7TepSTcBejiXwJZpZL3VltJxkB?= =?utf-8?q?x68TO4UcRp8uCcXiaWXUpsZ/vIMC1DSHclJg=3D=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU0PR04MB9251.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(376014)(366016)(7416014)(1800799024);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?gYI0m7n+OZvPNiOq9xQsyu/dfK0M?= =?utf-8?q?zELLorF+6GU01VCrFGRV5Dmpdt0FAQ9XEB9zXJl7aZsJQbKGqQn7Ejbj+R6ZGSFMM?= =?utf-8?q?6Y3oom4wXKG6C09/BNpftTnlcGmPjq22hidlBn7DcTEtkOJ2cp0HOPehEJuLkQL0j?= =?utf-8?q?QcGQw/q3QjkpP99GT/yRUcaDts/LVUJRu/V96Jo6A77P7+tZ4/6WEkHPk/zZ3gXRP?= =?utf-8?q?bBh30tqEqUv14kBcOIn1zE3gOGNXtayDNXZVipCURT55X2y7OGmZ+A6PScWutaVyv?= =?utf-8?q?Yi8AodamL/m5aisglRdHuI5rLx51eaNQ55ysRSE9kA/UADKraH70bGVjSMQY++iwK?= =?utf-8?q?JDfDgr+OtBKxPjDcNP7xuBuFINaL777V/q0nhn2UAdvLOhZjbQx6QS08RwBeVS7KR?= =?utf-8?q?tzVe9lRjibtHozMaE6596P9yumgq+nr1F6qfedzazdTrs28jKqSf/Hb/xZcA1f3lN?= =?utf-8?q?g/QGjO+A74YpsxvNAjWdxj8YvEoXS6w3hx5TZU3iLhaiBKl0qVC9nSI5Qg3+jL9Rv?= =?utf-8?q?fOwwpIoNTFPVPvixMzGkx8K/VzvixBt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Pp3X2F3MNUPtQXVQMke9qKBo/ph8VP?= =?utf-8?q?G6KLPAXYU9honYj0y7bPvARRplPXOC6Twbgdq435/aQ7Q1nlcfyDqzJdgGs4BHxng?= =?utf-8?q?5yxgCQ8cImyeZEOWCOxpcojW0uLLdzjMsQ=3D=3D?= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: f21502d0-ad4b-4149-4695-08dced075806 X-MS-Exchange-CrossTenant-AuthSource: DU0PR04MB9251.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Oct 2024 10:51:37.9885 (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: F0o5NqcS9ie8BIbanMpGq+StZ4M/RlrqAaYdwMPQ3j0RAhjyqibI7qQLNgD5/Fk70hsupbAHyKwfr3gsy23m/almZGb1PXifsha48waK3Bw= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS1PR04MB9238 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241015_035144_878510_A5262916 X-CRM114-Status: GOOD ( 13.90 ) 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: Ciprian Marian Costea This patch series add support for the NXP RTC hardware module present on S32G2/S32G3 SoCs. The RTC module is used to enable Suspend to RAM (STR) support. RTC tracks clock time during system suspend. It represents a time-based wakeup source for the S32G2/S32G3 SoCs. RTC is not battery-powered and it is not kept alive during system reset. Following is an example of Suspend to RAM trigger on S32G2/S32G3 SoCs, using userspace tools such as rtcwake: # rtcwake -s 2 -m mem # rtcwake: assuming RTC uses UTC ... # rtcwake: wakeup from "mem" using /dev/rtc0 at Wed Feb 6 06:28:36 2036 # Changes in V2: - Removed 'clksel' support from dts bindings. Used clock parents support from CCF to better illustrate the RTC hardware IP from S32G2/S32G3. - Removed frequency dividers support from dts bindings. Used assigned clock frequencies support from CCF instead. - Reduced the interval while RTC is voluntarily disabled to a simple register write in order to avoid any race condition between a possbile rollover and 'suspend' callback execution flow. - Updated bindings documentation with respect to clocking support. - Fixed a potential unused variable warning reported by kernel test robot. - Updated to usage of 'devm_rtc_allocate_device' and 'devm_rtc_register_device' instead of deprecated 'devm_rtc_device_register'. Ciprian Marian Costea (4): dt-bindings: rtc: add schema for NXP S32G2/S32G3 SoCs rtc: s32g: add NXP S32G2/S32G3 SoC support arm64: defconfig: add S32G RTC module support MAINTAINERS: add NXP S32G RTC driver .../devicetree/bindings/rtc/nxp,s32g-rtc.yaml | 102 +++ MAINTAINERS | 2 + arch/arm64/configs/defconfig | 1 + drivers/rtc/Kconfig | 11 + drivers/rtc/Makefile | 1 + drivers/rtc/rtc-s32g.c | 778 ++++++++++++++++++ 6 files changed, 895 insertions(+) create mode 100644 Documentation/devicetree/bindings/rtc/nxp,s32g-rtc.yaml create mode 100644 drivers/rtc/rtc-s32g.c