From patchwork Mon Sep 25 07:02:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacky Huang X-Patchwork-Id: 13397300 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 0016ACE7A81 for ; Mon, 25 Sep 2023 07:03:38 +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: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=cAhjWwDWNJFPzsBtWBnhLr/y8wCGibgknmPFZAKN8bQ=; b=KalLq0zNvnGQLg okNhTcxdb1K2qoM8zyj647QI0FMCgg+RMhGW1pjIhLnU0g1H/I6EogHrQmQPZni5MVgqPQ4ekYrlN aTUchUIntP66vNj5uUiofWkbmoQd+M4MSi0JM3HIMaJ7FoB3N2S4kVepp7l5m9QE3+6XmeXJ2doyY J5BnK1TWsd7tBw4tcKBM0ETARYcoolgkqu8ozBcJZjKin1/Ua8od9WoXcYxrmQ6sVzFaQE3nrU31P AFhllWvzkny7/8kg+wGuj+x+eogz19Z9FvGrexleokqX9nxSC9s0WgDFELpDfYyc2p3zgIU7i+tMR Z3fPiOyuq5ZWaB1FpTwQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qkfca-00DVnd-2u; Mon, 25 Sep 2023 07:03:08 +0000 Received: from mail-ot1-x32c.google.com ([2607:f8b0:4864:20::32c]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qkfcW-00DVmt-1i for linux-arm-kernel@lists.infradead.org; Mon, 25 Sep 2023 07:03:07 +0000 Received: by mail-ot1-x32c.google.com with SMTP id 46e09a7af769-6c0b3cea424so3648579a34.2 for ; Mon, 25 Sep 2023 00:03:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1695625381; x=1696230181; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=8aDz349SKKv9+MQGXfZ+z1/ikbG1yq6pnD7zJlqgtSM=; b=VLxOfB220Db1LHFcNkjGqSD17zciKjahNu1CvQh+S3JTt+pvq6y5L9R31aornFN6YA IhMmxDyryfKl3ZykWAOgvY3Lc+xraHM7JrfmgJin6xKLRbNJbp9N7fgif47AKhjRNDsn /lXn5BWJ4yEpeedoQEH2R62/BXZAmu6e+e7vYWvj2E2FM1YPWYbqCfW5kAFvlm2ZOcot Ov53bMpb+s2MZ0sStH6xDj9N+p9Gax8Sz5gir0PdNhGDsnuj47mFN0Bp0aT+GJpybecF TwYcUpkZsJHd87K3Xq77i9nLFQCTYIEES1iLgZPccqLTR4OsAQaKC5KgreayQ38TQsYz 6pgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695625381; x=1696230181; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=8aDz349SKKv9+MQGXfZ+z1/ikbG1yq6pnD7zJlqgtSM=; b=BOnbiaPgVNfc//O+7hK57RdbEduHbBybZT+1yvni+CrUovs5eZuDCHtTlMT1mReotz eJ1+BaAD0gIaPxZOejyZMlX00DUn3lO4E916P6qkm6piA+sh8akAHgaO6/NecFtQkp29 09DntdTwFCz1NUb7d/h8diFSTs7edG6+qGe5OuHfb7MG2UEVHx/npUY7aPMlLc95JKqK mdDovxLRLNg/OBVyT3kWvztcjZf7lu+XAZ2iQq7KlZqjAygVspJ6OXHbsBC8ueuoICgw nMi4nayLft5ff0I57C0otT2S2h+x1lhFuAH+ymGrPPrny+WWdtMGdEOx8NbWKjRViQEO G7ew== X-Gm-Message-State: AOJu0YxGAPa6URRS9ffXWgmprfheFdGHNkiQ6SyyxS45J2WxfGCHwMrS PJAmPZev1A3e4TZZ4eOVLYw= X-Google-Smtp-Source: AGHT+IFdlgHAsFON54gDD32JbB0ZiUi6gzdiPWTk7C0UUN14dZBZKnXI5ekgKJs1JogFAj7YhKfQMQ== X-Received: by 2002:a05:6830:c9:b0:6be:fe1e:c13 with SMTP id x9-20020a05683000c900b006befe1e0c13mr7754598oto.0.1695625380989; Mon, 25 Sep 2023 00:03:00 -0700 (PDT) Received: from a28aa0606c51.. (60-250-192-107.hinet-ip.hinet.net. [60.250.192.107]) by smtp.gmail.com with ESMTPSA id y5-20020a62b505000000b0068ffb8da107sm7349833pfe.212.2023.09.25.00.02.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Sep 2023 00:03:00 -0700 (PDT) From: Jacky Huang To: a.zummo@towertech.it, alexandre.belloni@bootlin.com, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org Cc: linux-rtc@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, mjchen@nuvoton.com, schung@nuvoton.com, Jacky Huang Subject: [PATCH v4 0/3] Add support for Nuvoton ma35d1 rtc controller Date: Mon, 25 Sep 2023 07:02:48 +0000 Message-Id: <20230925070251.28-1-ychuang570808@gmail.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230925_000304_590001_FCFB4F7E X-CRM114-Status: GOOD ( 15.85 ) 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: Jacky Huang This patch series adds the rtc driver for the nuvoton ma35d1 ARMv8 SoC. It includes DT binding documentation, the ma35d1 rtc driver, and device tree updates. The ma35d1 rtc controller provides real-time and calendar messaging capabilities. It supports programmable time tick and alarm match interrupts. The time and calendar messages are expressed in BCD format. This rtc driver has been tested on the ma35d1 som board with Linux 6.5-rc2. It passed the rtctest and rtc-range 2000 ~ 2099. v4: This version is actually a resend of v3. - Updated drivers/rtc/Kconfig due to this file was modified in the recent mainline update. v3: - Update ma35d1 rtc driver - Renamed "TICKIEN" to "UIEN" as their functional equivalence. - Eliminated the usage of 'struct ma35_bcd_time' and associated ma35d1 bcd functions; instead, opted to directly utilize the "bin2bcd()" function - Employed "ma35d1_alarm_irq_enable()" to accommodate the "alrm->enabled" feature - Revised the probe sequence and implemented a check to verify if the rtc was initialized - Other minor fixes v2: - Updated nuvoton,ma35d1-rtc.yaml - Modified patch title and fixed typo - Added reference to rtc.yaml - Used unevaluatedProperties instead of additionalProperties - Modified rtc driver - Used dev_err_probe() - Removed ma35d1_rtc_remove() - Made other minor fixes Jacky Huang (3): dt-bindings: rtc: Add Nuvoton ma35d1 rtc arm64: dts: nuvoton: Add rtc for ma35d1 rtc: Add driver for Nuvoton ma35d1 rtc controller .../bindings/rtc/nuvoton,ma35d1-rtc.yaml | 48 +++ .../boot/dts/nuvoton/ma35d1-iot-512m.dts | 4 + .../boot/dts/nuvoton/ma35d1-som-256m.dts | 4 + arch/arm64/boot/dts/nuvoton/ma35d1.dtsi | 8 + drivers/rtc/Kconfig | 11 + drivers/rtc/Makefile | 1 + drivers/rtc/rtc-ma35d1.c | 324 ++++++++++++++++++ 7 files changed, 400 insertions(+) create mode 100644 Documentation/devicetree/bindings/rtc/nuvoton,ma35d1-rtc.yaml create mode 100644 drivers/rtc/rtc-ma35d1.c