Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp5832563ybp; Tue, 8 Oct 2019 08:58:34 -0700 (PDT) X-Google-Smtp-Source: APXvYqy3JlhW9TIGhqmoFeBJnFezaBHSrXVcxA0sN9cM89Wrs9VYXa2FOUheV6cPi5CCtjeOx2hP X-Received: by 2002:a50:934c:: with SMTP id n12mr35143533eda.12.1570550314806; Tue, 08 Oct 2019 08:58:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570550314; cv=none; d=google.com; s=arc-20160816; b=F4h4KMiw27QVctPYtopEpn36iU+uesjxCcldbJTXCHQTKRvT5T1Gga3uGMwKy75Lsr Df9M7sMyBQM57stK15Kqj7twZAqXzuilJEAoRmF8SNpiTyTe0I4k3Q1PKBliHIdoF+Ng bPkCIXabnJehkhvlfqWFpUDcdHoLdv2wJ4YPZmjyEwtLVhA9edMLt/r0ctiDZ7i1vbOs zvxDvgy1nR0ISevksRCqMxX/sgUAZZu0GRSvMq26s+CS+fGavvTZmxfkTVHoilvJo6KJ KH44eFLams5kFPpmLS66ec0DTWdB9Yy2q112P32ySaaJqSUk71n2j4YZS2tp4CH6uuxS 7Z4g== 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 :references:in-reply-to:date:cc:to:from:subject:message-id; bh=cA6leibO2K2eEnltHJGoQNi/N/dpGfk4H3zShnw0zOY=; b=uVWVg8pL1ACqCBpfhxpRJdTF2gZwXQmjt/+vi/oHEjhNn7J87OO2GY456dvd0ySZm5 VVCknxpv+dRa4L+wEiz71YKXxbT4U+OR/Ykw7fGlDGH7AJ5bzCLSaf6z8uBQ4xxJeu7r SthdSwO4MNTmio2Y+MsH7x3NUDrHYetVrmsHnxNSJzVsqgG8ibv06xCnKNhU6EF9RUey l9QKLPap19VOJM70Hm7E0QLc5Gq0V1iAjaKoVEuR9HX838GgqwAKF8GQb+nyFMPAzKvW 17sMXMsgCBx9prx6vzQ5v0tDoN0n0BA3GQ3w63S6uiSpbEOyQA4s7zjMOPElb96Pk280 U3HA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y50si11814201edd.237.2019.10.08.08.58.09; Tue, 08 Oct 2019 08:58:34 -0700 (PDT) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726439AbfJHP4R (ORCPT + 99 others); Tue, 8 Oct 2019 11:56:17 -0400 Received: from metis.ext.pengutronix.de ([85.220.165.71]:41115 "EHLO metis.ext.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725939AbfJHP4R (ORCPT ); Tue, 8 Oct 2019 11:56:17 -0400 Received: from lupine.hi.pengutronix.de ([2001:67c:670:100:3ad5:47ff:feaf:1a17] helo=lupine) by metis.ext.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1iHrqK-0001K2-Nn; Tue, 08 Oct 2019 17:56:08 +0200 Message-ID: <1570550166.18914.12.camel@pengutronix.de> Subject: Re: [PATCH v2 2/2] reset: Reset controller driver for Intel LGM SoC From: Philipp Zabel To: Martin Blumenstingl , Philipp Zabel Cc: Dilip Kota , "Chuan Hua, Lei" , cheol.yong.kim@intel.com, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, qi-ming.wu@intel.com, robh@kernel.org, Hauke Mehrtens Date: Tue, 08 Oct 2019 17:56:06 +0200 In-Reply-To: References: <34336c9a-8e87-8f84-2ae8-032b7967928f@linux.intel.com> <657d796d-cb1b-472d-fe67-f7b9bf12fd79@linux.intel.com> <389f360a-a993-b9a8-4b50-ad87bcfec767@linux.intel.com> <20191003141955.zi5wqjqf4wa7lhv7@pengutronix.de> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.22.6-1+deb9u2 Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-SA-Exim-Connect-IP: 2001:67c:670:100:3ad5:47ff:feaf:1a17 X-SA-Exim-Mail-From: p.zabel@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Martin, On Mon, 2019-10-07 at 21:53 +0200, Martin Blumenstingl wrote: > Hi Philipp, > > On Thu, Oct 3, 2019 at 4:19 PM Philipp Zabel wrote: > [...] > > > because the register layout was greatly simplified for the newer SoCs > > > (for which there is reset-intel) compared to the older ones > > > (reset-lantiq). > > > Dilip's suggestion (in my own words) is that you take his new > > > reset-intel driver, then we will work on porting reset-lantiq over to > > > that so in the end we can drop the reset-lantiq driver. > > > > Just to be sure, you are suggesting to add support for the current > > lantiq,reset binding to the reset-intel driver at a later point? I > > see no reason not to do that, but I'm also not quite sure what the > > benefit will be over just keeping reset-lantiq as is? > > according to Chuan and Dilip the current reset-lantiq implementation > is wrong [0]. The only issue seems to be the .reset callback, which doesn't have any users anway. > my understanding is that the Lantiq and Intel LGM reset controllers > are identical except: > - the Lantiq variant uses a weird register layout (reset and status > registers not at consecutive offsets) > - the bits of the reset and status registers sometimes don't match on > the Lantiq variant Thank you, so these are a good explanation for why the DT bindings should be different. > - the Intel variant has a dedicated registers area for the reset > controller registers, while the Lantiq variant mixes them with various > other functionality (for example: USB2 PHYs) I'm not quite sure I understand why the intel driver is using syscon, then. Either way, it shouldn't make a big difference if regmap is used anyway. > > > This approach means more work for me (as I am probably the one who > > > then has to do the work to port reset-lantiq over to reset-intel). > > > > More work than what alternative? > > compared to "fixing" the existing reset-lantiq driver (reset callback) That is still something you could do, or just drop the .reset callback because there are no reset consumers using it anyway. One correct thing to do would be to identify those self-clearing reset bits and to disallow calling assert/deassert on them. > and then (instead of adding a new driver) integrating Intel LGM > support into reset-lantiq Since at this point I'm not even sure whether merging the two at all is better than keeping them separate, I have no opinion on whether merging intel support into the lantiq driver or the other way around is preferable. > > > I'm happy to do that work if you think that it's worth following this > > > approach. So I want your opinion on this before I spend any effort on > > > porting reset-lantiq over to reset-intel. > > > > Reset drivers are typically so simple, I'm not quite sure whether it is > > worth to integrate multiple drivers if it complicates matters too much. > > In this case though I expect it would just be adding support for a > > custom .of_xlate and lantiq specific register property parsing? > > yes, that's how I understand the Lantiq and Intel reset controllers: > - reset/status/assert/deassert callbacks would be shared across all variants > - register parsing and of_xlate are SoC specific Ok. If that turns out to be less rather than more boilerplate than two separate drivers, that should be fine. regards Philipp