Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp6276427imu; Sun, 2 Dec 2018 14:10:15 -0800 (PST) X-Google-Smtp-Source: AFSGD/WNADbeX1hkbbts5Ov5UoR21XLawsVT38BAX1dnzs9A895YOP3LXqd156AKlhQ2eiAFfPOL X-Received: by 2002:a62:5fc4:: with SMTP id t187mr13676089pfb.66.1543788615276; Sun, 02 Dec 2018 14:10:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543788615; cv=none; d=google.com; s=arc-20160816; b=G/VkmygjgIPxrGht1FSBXI6p5WznVTL+VLx4xLHZgnARlolzz7gfrpbk/lG8w8AbOB 4BfAH3x1uaH7g6PuI7bedQSauIoWBTcTy8QjoOklCv8iW0G7cWY0IcpWqPoy5Jprlrrk 2QtyYIywdfKBujJRAMYAk3DMjWWow1Rl8YOBdtDKsbIS/AS/F544tjVw3dk93FmPThhr aaFUjezolC75Bz+4+Ji4nBsXf+VphyUekvrg++siL9NTZizPYq4U7vCU3vjeMJtv0bmx UvX7KYlltTZu8sJx0+MfT4OV9e+yhnzdQ1xllm3AVUYWmc4XN0AE0PN0pbQrbfoItwkO VYAw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=sVFm4iQFARb7LSpeEYqu6l+42fPoWzaNkx6zpzMl+0I=; b=Gu4yVtM15hzWR1BdENANRHoAIzALzqrebJQna8jszxtwAhRaqpKc/HAbyzi0NEPbZe 0WOD8UBTzAw3Gc3h7RYJ7EDWpBLBIQjEe3KeF2CZpTEQgNyYXfZ1eg1xyNJasF4pURi9 3er2RGtejTEsqgejr7vE7LBrH7Kwpgi0iSUjzwY9Kceg+6qDxwn+X8mxMpQLZF+9zewV cXnP5IPR/mek6mFYve3u3mHzOz7OdHRgmpUxxGbl4vZxyMoyVieYla0vkylh+df7d7Cd omw0cKFAnNTkG/gEHDok/FNE/7oG9acRaFqQ/1z85C/NJJdMGhKYnRjdSPwH9vR0CzVY paHg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@googlemail.com header.s=20161025 header.b=K1tWG2B4; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=googlemail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d8si9519224plo.196.2018.12.02.14.10.00; Sun, 02 Dec 2018 14:10:15 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@googlemail.com header.s=20161025 header.b=K1tWG2B4; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=googlemail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725830AbeLBWJB (ORCPT + 99 others); Sun, 2 Dec 2018 17:09:01 -0500 Received: from mail-wm1-f67.google.com ([209.85.128.67]:39226 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725780AbeLBWJB (ORCPT ); Sun, 2 Dec 2018 17:09:01 -0500 Received: by mail-wm1-f67.google.com with SMTP id f81so1396061wmd.4; Sun, 02 Dec 2018 14:08:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=sVFm4iQFARb7LSpeEYqu6l+42fPoWzaNkx6zpzMl+0I=; b=K1tWG2B4/2q6qBnbeh5tSNzG+hXAYd+XsWRhHn/ZtANd09DBEFd1fEPsPGOCBt59eO toGQGVaeV6NgFtNOUhfL2kuWZIYTGyWB+wUxwPlaW5evhav1DKjDTuiP/Jc0Kmw4l5bq Pg/gcxGBLq9351OUvlVoE0p+qqeyo7IyLzzfrMfe2XoY2xbugDzoLn5b3mnkYwoZYX0T Maff9JbGsBxY4zqKAnaCpWMPKx2dYwKhcsLxU/yMaIbSywgQwonDg7nNNoQGPm4rbvGz L3gQaHkjP2vXJanla3dz9TlTQjiJFFUNDe7TAS4BPNXPDgUAYBczBSIIhiiagAWETuMN VGng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=sVFm4iQFARb7LSpeEYqu6l+42fPoWzaNkx6zpzMl+0I=; b=J6wrWgh5YFars0AfhVRPfVVzEQCVfg9c+R5ZMwkhJvhGrDhwlXc8mJYSgpUbChg+lw eBnSAWfQ4prffHDymk/SgDvO8WmlHs8KxU1pQ0JqhQRDtopbP+WEgeP5WMo85HjS5w1u Wq4gZf0z9pO2HTbg+GptnilsH8x80yPMdH9gab+De1mbIkbnhhPXFZPU+d2B4Ia0X1SW rV84gXxXQWqgDMwAHHCATr3X0E3ZXc9bn0vJQEAhD4UGCYF/2jWOrt5OeYFFCNGfVbSC hHm0Dge6QeAmLOkWIEHLTHJa9NDDPlJ8KiWLwuDZ1PDZIbNcL6ProsplyH0ylf12Nl6K NTfQ== X-Gm-Message-State: AA+aEWbWeC3s7jvpAxwpfIlR4D4hjivPkV1Vj4bpfWm3Fkxv0311ccob 1pttMSdHadnre+IWT0Ui/xA= X-Received: by 2002:a1c:cc3:: with SMTP id 186mr437276wmm.143.1543788536654; Sun, 02 Dec 2018 14:08:56 -0800 (PST) Received: from blackbox.darklights.net (p200300DCD73FBA00B1CC0EB38CD20A4E.dip0.t-ipconnect.de. [2003:dc:d73f:ba00:b1cc:eb3:8cd2:a4e]) by smtp.googlemail.com with ESMTPSA id m15sm8503351wrr.95.2018.12.02.14.08.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 02 Dec 2018 14:08:56 -0800 (PST) From: Martin Blumenstingl To: linux-amlogic@lists.infradead.org, linux-rtc@vger.kernel.org, alexandre.belloni@bootlin.com, a.zummo@towertech.it Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, ben.dooks@codethink.co.uk, ccaione@baylibre.com, Martin Blumenstingl Subject: [PATCH v5 0/2] Amlogic Meson6/8/8b/8m2 SoC RTC driver Date: Sun, 2 Dec 2018 23:08:45 +0100 Message-Id: <20181202220847.24364-1-martin.blumenstingl@googlemail.com> X-Mailer: git-send-email 2.19.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This series adds support for the RTC on the 32-bit Amlogic Meson SoCs. The series does not have any build dependencies, but does require device-tree entries for the relevant boards. The series is tested by myself on the Meson8b EC-100 board. Earlier versions of this series were tested on an Odroid-C1 board with a battery pack attached by Ben Dooks and Kevin Hilman. I will send the DT changes in a second series so that they can be merged once the dependencies have been satisfied. Changes since v4 at [0]: - resurrected Ben's patches after 2 years: first I made it apply onto linux-next again - I decided to update the author of the patch to my own name since I made a lot of changes compared to Ben's implementation (list of changes below, the diff-stat was: 223 insertions, 163 deletions) - make the dt-bindings file name (rtc-meson.txt) match the driver name - add a Meson8m2 compatible - add the clocks and vdd-supply properties to the match the actual IP block implementation - make the resets and interrupts properties mandatory to match the actual IP block implementation - removed the status property from the dt-bindings example - fix MODULE_LICENSE to match the actual license (GPL v2) - switch to SPDX-License-Identifier - sort the Kconfig option alphabetically - use BIT() and GENMASK() macros consistenly - replace #define RTC_REG(x) with actual #defines which match the names from the public S805 datasheet - adjust existing #defines to align with the public S805 datasheet - add support for the 4x32bit NVMEM (regmem) data - implement regmap_bus to access the serial registers. this allows getting rid of the custom locking code and makes the NVMEM implementation much easier. - use regmap also for accessing the peripheral registers to make the code shorter - add support for the vdd-supply regulator - switch from devm_rtc_device_register to devm_rtc_allocate_device and rtc_register_device - set range_max to U32_MAX - use rtc_time64_to_tm and rtc_tm_to_time64 - simplify timeout handling and use shorter timeouts (the driver from the 3.10 BSP kernel uses udelay resolution (100us after the reset, 5us for the "comm delay") as well as busy-looping from 0..40000 to wait for "s_ready" - removed debug messages which are only printing register values (as these can now be seen in /regmap/c8100740.rtc-peripheral-registers/registers) [0] https://www.spinics.net/lists/devicetree/msg135413.html Martin Blumenstingl (2): dt-bindings: rtc: add device-tree bindings for the Amlogic Meson RTC rtc: support for the Amlogic Meson RTC .../devicetree/bindings/rtc/rtc-meson.txt | 32 ++ drivers/rtc/Kconfig | 11 + drivers/rtc/Makefile | 1 + drivers/rtc/rtc-meson.c | 409 ++++++++++++++++++ 4 files changed, 453 insertions(+) create mode 100644 Documentation/devicetree/bindings/rtc/rtc-meson.txt create mode 100644 drivers/rtc/rtc-meson.c -- 2.19.2