From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0591FC48BE6 for ; Wed, 16 Jun 2021 13:56:06 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id C29CE6115B for ; Wed, 16 Jun 2021 13:56:05 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C29CE6115B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=cerno.tech Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Content-Type: List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: In-Reply-To:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date: Reply-To:Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date :Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=sUzCA5b6bLfZ75e91aRTHhkyDpHcJTLLnCMnGWkyZYA=; b=bAq6boiQuyqk+HGqQ3fS1/6Tt4 fKRa5fdbNxknQaUlN2m+Rqndwud1/UNP8DXvavX/eAnTwytBnqoZVH42SoDDTTprZlSSh9qM+bDaB tnQq3kFcYbIRmX7vSd+pNRvwfXckQTD70phXKqMnMQY0RZ7i31D3IG1MueICN4ba/ELR0HQ/oy+Kg caE3pvur8BisNT2o4fqcH1vxyCSx/LNbNXHqNLbgQnyhugPnKAoykK8akGJrkmZRV+BOVkYj5VD0i B2KjqZPRJVmFzfzsx8mr8jv9+V2hnS5fWzIacmx6pPd6dgk16nWhIPTYEjhLNowYDe5gEjsEOubfI InkDEuJQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ltVzW-006Z4G-Mm; Wed, 16 Jun 2021 13:54:03 +0000 Received: from new3-smtp.messagingengine.com ([66.111.4.229]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ltVtc-006Wdk-FX for linux-arm-kernel@lists.infradead.org; Wed, 16 Jun 2021 13:47:58 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailnew.nyi.internal (Postfix) with ESMTP id 00B6D580533; Wed, 16 Jun 2021 09:47:53 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Wed, 16 Jun 2021 09:47:53 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cerno.tech; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm3; bh=K7K8HmNdTN19CUzpoIecFYqJU9L x/mk0+DFc76H/lIQ=; b=mU99aKyC2cwAPsiRViyOpHWKzCdzvF6LDMZN3o16i3O gPD0dAImpbHCmJlrV29msEJ/M/l6VzjUjAjUhV9xEcZezJfXELf4R/qTNrDhTMyg /nY8RCwH7cEjn5biGY7Goy7AfNuDo6ghdoVKyDKR/sdyaQDt8djk92R7XuR7CpeF tO5z3QOJRIh37dIMCBTe8B2MEWZGrx1nF+pvD9DXKHj8/2Wbh1l1ov7GILFS7bsF kxtfx3Yvh8EaUP5f0FUXDSSDvSlgEUIR7ekaOgcjiSTsJpK+edggH+XFXSuHcsA5 NGVIVusBneiuHsrfrMOwFKaG+lqLP0LvEcSD6+7xuLQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=K7K8Hm NdTN19CUzpoIecFYqJU9Lx/mk0+DFc76H/lIQ=; b=fUMliT++5jIroIU/XwP7tr P27hGBTyp+Hng+IAYgoXoqY6awVYPoOsYd7Gqddpy2pP5aXuhrTX0mw0bQXT7B79 KfP5tR3k16mywXXM9xXZC4CS/GJ5MWwmWt08THQk89mbWCm4Ilp/+wLmq3P2VtcO ZQdSLSSKj+/syucb5W6OH36qd1l758f6plGCcyrzV8Hy/WBp2FCLyYFUlYAua8N7 fKfA7HKRqzi4mXnu5Q2l3Bh0nJiBoKLQD5wCwD75KKxvrFwNtD8Hc44mxXhzcAbI Mh5Riam2rj3g4pyE0uumVAQwvo9x4pzXGR5vU3Wszcb46B/z4thvYQNQwSpHVviQ == X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrfedvledgjedtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvffukfhfgggtuggjsehgtderredttddvnecuhfhrohhmpeforgigihhm vgcutfhiphgrrhguuceomhgrgihimhgvsegtvghrnhhordhtvggthheqnecuggftrfgrth htvghrnhepveegudetkeethfetgffgtdekkefghefhffefgeduleehgeehieeuveefgedv ieegnecuffhomhgrihhnpehgihhthhhusgdrtghomhenucevlhhushhtvghrufhiiigvpe dtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehmrgigihhmvgestggvrhhnohdrthgvtghh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 16 Jun 2021 09:47:51 -0400 (EDT) Date: Wed, 16 Jun 2021 15:47:49 +0200 From: Maxime Ripard To: Andre Przywara Cc: Chen-Yu Tsai , Jernej Skrabec , Rob Herring , Icenowy Zheng , Samuel Holland , linux-arm-kernel@lists.infradead.org, linux-sunxi@googlegroups.com, linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org, Ondrej Jirman , Alessandro Zummo , Alexandre Belloni , linux-rtc@vger.kernel.org Subject: Re: [PATCH v7 06/19] rtc: sun6i: Add support for RTCs without external LOSCs Message-ID: <20210616134749.mzp52dvbjmiabgl3@gilmour> References: <20210615110636.23403-1-andre.przywara@arm.com> <20210615110636.23403-7-andre.przywara@arm.com> <20210616091431.6tm3zdf77p2x3upc@gilmour> <20210616111452.1d7f2423@slackpad.fritz.box> MIME-Version: 1.0 In-Reply-To: <20210616111452.1d7f2423@slackpad.fritz.box> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210616_064756_870531_6F6AED72 X-CRM114-Status: GOOD ( 33.92 ) 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: , Content-Type: multipart/mixed; boundary="===============6017773890805320803==" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org --===============6017773890805320803== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="imbf7s7uxyughhg5" Content-Disposition: inline --imbf7s7uxyughhg5 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Jun 16, 2021 at 11:14:52AM +0100, Andre Przywara wrote: > On Wed, 16 Jun 2021 11:14:31 +0200 > Maxime Ripard wrote: >=20 > Hi, >=20 > > On Tue, Jun 15, 2021 at 12:06:23PM +0100, Andre Przywara wrote: > > > Some newer Allwinner RTCs (for instance the one in the H616 SoC) lack > > > a pin for an external 32768 Hz oscillator. As a consequence, this LOSC > > > can't be selected as the RTC clock source, and we must rely on the > > > internal RC oscillator. > > > To allow additions of clocks to the RTC node, add a feature bit to ig= nore > > > any provided clocks for now (the current code would think this is the > > > external LOSC). Later DTs and code can then for instance add the PLL > > > based clock input, and older kernel won't get confused. > > >=20 > > > Signed-off-by: Andre Przywara =20 > >=20 > > Honestly, I don't really know if it's worth it at this point. > >=20 > > If we sums this up: > >=20 > > - The RTC has 2 features that we use, mostly centered around 2 > > registers set plus a global one > >=20 > > - Those 2 features are programmed in a completely different way > >=20 > > - Even the common part is different, given the discussion around the > > clocks that we have. > >=20 > > What is there to share in that driver aside from the probe, and maybe > > the interrupt handling? Instead of complicating this further with more > > special case that you were (rightfully) complaining about, shouldn't we > > just acknowledge the fact that it's a completely separate design and > > should be treated as such, with a completely separate driver? >=20 > If you mean to have a separate clock driver, and one RTC driver: I > agree, and IIUC Samuel has a prototype, covering the H6 and D1 as well: > https://github.com/smaeul/linux/commit/6f8f761db1d8dd4b6abf006fb7e2427da7= 9321c2 >=20 > The only problem I see that they are sharing MMIO registers. Maybe it > works because the RTC part never touches anything below 0x10, and the > clock part just needs the first four registers? > But this means we can't easily change this for the H6, as the > existing H6 RTC code adds 0x10 to the MMIO base, and also old DTs will > have the RTC base address in their RTC reg property. >=20 > If we can somehow solve this (let the clock driver point to the RTC > node to get a regmap?) I am all in, for the reasons you mentioned. I meant having a separate RTC+clocks driver. I'm not really sure why we need to split them. Maxime --imbf7s7uxyughhg5 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQRcEzekXsqa64kGDp7j7w1vZxhRxQUCYMoBBQAKCRDj7w1vZxhR xbliAP9ffUPo3wF3pnVZcrXBLtFGjc2Rn5DdZDDyUE52eLFAjwD/VN2TJ+pjpVHW Q+5MMaBNj8qfnkPn7dLqm6i/5LaoTQw= =rIZz -----END PGP SIGNATURE----- --imbf7s7uxyughhg5-- --===============6017773890805320803== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel --===============6017773890805320803==--