From patchwork Thu Oct 31 08:35:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ciprian Costea X-Patchwork-Id: 13857714 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 DE565E6895D for ; Thu, 31 Oct 2024 08:38:08 +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=4UpZIh1gPSxHArsqgu9rqmEHI0j2L8Brcr5WHrGno/k=; b=uqxy0JHv/o6rwEHORSkU1PFvPz TEG8H2c10PLulTXLoqLAdFtgABfQdWZ4a50R5hsWU0g34HYPRhr+5Uk+NYhW9JCmOsSpQYWShev14 Td3sKRyitaFNKYnFgX5pwbKxFj1fAFrAQLChmcX8rUmAJSg+GnwSh5ARBrglZAz2d1XllGZI5Mc36 4zI78j38Bq01mrk9jY8l55bVMgJ0BaD+3Ofe9NrDvE20K9iFmWr+xbbpkiuMh3u0b7vnBx6lUPD3h LgnnjpNTh5K4byTZh0shpEdLAumbPsAxvFTmafR93h6rDTf0Iec7HcZze0nMeh6cAhlW3yfR0PnMc V80inoYA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t6Qgk-00000002xvQ-2MHP; Thu, 31 Oct 2024 08:37:54 +0000 Received: from mail-am0eur02on20601.outbound.protection.outlook.com ([2a01:111:f403:2606::601] helo=EUR02-AM0-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1t6Qf4-00000002xUe-0HcX for linux-arm-kernel@lists.infradead.org; Thu, 31 Oct 2024 08:36:11 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=W8W4n7TKZ5IwTjotZpnmCyzWPWYwqcSzzt0M40570jthjHUL9Yi+rlywlipCI8likNlrXfIJwSLlP3F1CjNfOZcb1nDPCH65zl+SJc0kPncOzO/pA9ab/cr+39ROTtchC+GSTJNdU4zTHbxeTYZcwXXz9rdahdsNgH6oLGRJnCZbajtJbeXF3jjjzTpn6HM9XhIINWVl+PNyShiFsjlPnP16AknMPGnO0PSGL8tECPPhGOrqCTGGM8n6drfcLxZ6a3ecGppFE5Avg6of6bcdwAhzi+/1qFgXJ+FBz7lJUcHzkdhDRzVHA/WBWsdRjOveMGq631xTwi4g9TfnbSbGAQ== 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=4UpZIh1gPSxHArsqgu9rqmEHI0j2L8Brcr5WHrGno/k=; b=d/e/v/qt0zy8rQUVV9ZtOwcZT2sNkycttLdQV1TCQYeXvOB4nuJCB/+7W/8JYeU4LjeBDlxie9maAO3LeYrom+mYvjC8erMUBiADP40kDk9SNayd67Hz3JqkSHQbmZLYQ942Cun6j0o2YqOr2EVf5/1JIe/ZHRLS9lo7sGXcbFMYLCJ/KsT9TtQjYposSDUaBhexTku23eYel9fNfUh6upM6E8DS5zPPLUdaDrfDAmQsxM7HF6EJ0b+bBGHi7z25sqCIxAsBUjFYTvOE+PodolKn8u8WzC/XS0KeHoYCe7HR7eq1V41q0OJz7lH8YZLKMarnQ2aDOFwNibwRgInyQA== 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=4UpZIh1gPSxHArsqgu9rqmEHI0j2L8Brcr5WHrGno/k=; b=T88yZQsQ1WMWuHE7dmqwx0AoPqI7DXNFwTQ2mSM/f47V1faQozhGjxH9R1co2scK0TJ1d7wXL2MWfJ3OY9XfxetlEtVjJE3u3YJ4ev85cvU/j+v/JEts6ImFEYI4vwx4+ser/Byvp5rUSkZO9K8FH0xTI1HHyrqgc/qn8B7nC/N02Cjl7BrpBh1utOkH6s/S87Xn1KjXeELT39zFXVUzmP5rYCo2f+oLM+t2wXI+OY+1vteaogJlFAlkSPRL5r3ZgJb8uLJSM0Ak01ekBhtCvwlwGzX7ttfJk82KUdhFsEKOhahJsMlFEAABuJq345od21I+LXG+7SmCINTQp0cYtQ== 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 VI1PR04MB7199.eurprd04.prod.outlook.com (2603:10a6:800:11d::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8093.32; Thu, 31 Oct 2024 08:36:01 +0000 Received: from DU0PR04MB9251.eurprd04.prod.outlook.com ([fe80::708f:69ee:15df:6ebd]) by DU0PR04MB9251.eurprd04.prod.outlook.com ([fe80::708f:69ee:15df:6ebd%6]) with mapi id 15.20.8093.025; Thu, 31 Oct 2024 08:36:00 +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 v3 0/4] add NXP RTC driver support for S32G2/S32G3 SoCs Date: Thu, 31 Oct 2024 10:35:53 +0200 Message-ID: <20241031083557.2156751-1-ciprianmarian.costea@oss.nxp.com> X-Mailer: git-send-email 2.45.2 X-ClientProxiedBy: AM0PR04CA0131.eurprd04.prod.outlook.com (2603:10a6:208:55::36) 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_|VI1PR04MB7199:EE_ X-MS-Office365-Filtering-Correlation-Id: 5a902aa9-8310-455e-6dd7-08dcf9870c9a 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|7416014|376014|366016|1800799024; X-Microsoft-Antispam-Message-Info: =?utf-8?q?vY8UZnW/95GlTVwuwseNWYI9VJz3Lt3?= =?utf-8?q?OhtqQ7EK3D0tBtTjgZKFkk/81e4VbimPVZ2dKEUQvcxpv0gK/itSPBVy/mwowCDTA?= =?utf-8?q?rZyKMZDrGXdBXG/uQJgvGuurjtXJzlJyUrzzmv3P5eKLlqtr25+p/OgSYOVCIwGU0?= =?utf-8?q?TNqLcn2Y2Qi8dl9M3kvPrHzN9zygjSdLwe7lqDKc0YJCffqYm1No5qNcVXaDq85xT?= =?utf-8?q?+3dsW46Ya54lXTxloqodpStxuN57cFv2sjDApHWV+jTO6hG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r6Srqi8t1X?= =?utf-8?q?QXlwBziIu1z6Yt7H02c3C4ud+qdHI0WLhVroc+iSo87BA2+2CIA0t4mW6TNyphC5V?= =?utf-8?q?s++S4orIFOR6+Ik6gWqDrvqyovdhkoHfZubnM3/tlM+p2hj3zLI94SPqccxNmqVZN?= =?utf-8?q?HePTfiUwvsYGK?= 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)(7416014)(376014)(366016)(1800799024);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?OBitWgLZqCCx7JDMBr+QX1Doa0gY?= =?utf-8?q?8cnjLYBwikAuRkIJpd73jUvgZi7rDwUusYGncHlTvOGc4vQoz5xj5NLKuprsi66lO?= =?utf-8?q?7JXySwOzQl1cWbx40n+PoRWpqSmVab+sLVNXMDiWmAjEkJuUjgT4YBapVS55qgy3i?= =?utf-8?q?8ahivV3w2jKyd5EIqKOIOK2/FRgBK9RkwHmfXyLMIR4RyBBSmViAOnA8G+ai/3SIB?= =?utf-8?q?1OOvEip9kME+ongsvKJA19X30sWgHwo9hFfb8SiaP2HzM5SBx6/sSfcL5Ku6zaduD?= =?utf-8?q?hEbrSz/C+nR6RjIw5xgJa2ZwL+/fdLbUG8Cfum03AeHAAaAGwvDZvIWpja4l4P0Ff?= =?utf-8?q?8w7tfYGmPxLjXMzCI2W1Zx7WfZt0tRRpIIEUV03OL2cNXRA5YjVgWzojcoIC4t5GA?= =?utf-8?q?VmP0GBtMbPl5Ia52IaXu0ZrZ9Z+FQD/t4yAbnRoYFtaidjZl/6z//fzL9tLXwNnn9?= =?utf-8?q?zHqJNVJkrHcMLZ2N2fIMncQkV+miQjUpCVYQOEW7PKDG9i5BalGqpTLAs7nschqDE?= =?utf-8?q?1VqL2I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8?q?EmxT2LhsA9a9ZB/05nZk8BhbHB1U4bRfwboacpTDYCKZtiKQZ/jlrL4IGWCM47/Kn?= =?utf-8?q?qbPSqpzgyb+H6O6rCj+svahwph+Fooeuvxl3PehWzYpN0912HqBzoPFBj1RwuMu4+?= =?utf-8?q?9aNatMdqk9p9xZ0deCGCPfVaDhtgtXbeBw=3D=3D?= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5a902aa9-8310-455e-6dd7-08dcf9870c9a X-MS-Exchange-CrossTenant-AuthSource: DU0PR04MB9251.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Oct 2024 08:36:00.9043 (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: IjpA9O6RLnlAdXVivZ6Q6RVHEnBck8dNqkz6szjcV5UxztZxkkt5Bzrs7U0KhsaKFj24uDuIj4C+mMUFrcKMK4nG5aBQPIleCS0GikS0rak= X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB7199 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241031_013610_147009_B7932C62 X-CRM114-Status: GOOD ( 15.26 ) 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 V3: - Removed 'nxp,s32g3-rtc' compatible string - Change to 'remove' callback from 'remove_new' - Used 'dev.parent' from 'struct rtc_device' instead of defining a specific 'struct device' in driver data - Fixed several errors reported by kernel test robot - Removed 'assigned-clocks', 'assigned-clock-parents' and 'assigned-clock-rates' from required properties in the binding documentation. - Refactored S32G RTC driver such that a default clock source and divisors configuration will be applied in case 'assigned-clocks' and 'assigned-clock-parents' properties are missing. 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 | 99 +++ MAINTAINERS | 2 + arch/arm64/configs/defconfig | 1 + drivers/rtc/Kconfig | 11 + drivers/rtc/Makefile | 1 + drivers/rtc/rtc-s32g.c | 803 ++++++++++++++++++ 6 files changed, 917 insertions(+) create mode 100644 Documentation/devicetree/bindings/rtc/nxp,s32g-rtc.yaml create mode 100644 drivers/rtc/rtc-s32g.c