Received: by 2002:a89:288:0:b0:1f7:eeee:6653 with SMTP id j8csp575745lqh; Tue, 7 May 2024 07:53:07 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUW/buFS43Gmf+G0/9WXR3RmKScLGSdTIw0OjHRTNG5tsFyzqdPD3klRUKl5jWragtDEeg/SvEKpzC1ls8lfm4TjoHvt1v33V0no4kneQ== X-Google-Smtp-Source: AGHT+IFCGriwQVUtV5WQaiAple8cUHZuRtJI7gWEJvFC8jEGsQ7jvmWCHiXnA5xAPWumFrEV0/67 X-Received: by 2002:a05:620a:b04:b0:792:9a4a:1c3e with SMTP id t4-20020a05620a0b0400b007929a4a1c3emr6426523qkg.42.1715093584680; Tue, 07 May 2024 07:53:04 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715093584; cv=pass; d=google.com; s=arc-20160816; b=x+WIcvprmyYWe7Xt+Xh7QMfjvNewAZAWuW9kx6a/lJpmtnAfUOY9cA0PJGsSYYoW+F 3uW10TsgLZoSfzErvn+lInaRSpuoeTStXhq94yt577gpQAY+QdnNMwh+zrkHaeuS5jPv qY+K9fNE4ZRlCVHZtTUh9vXqmhQklTnGRx2yvTRBTTvGOpl7fUSgdIuq2tDQ92z1qjbf T0RfzkVPf2q0YaenfldfGnirG7PaIpd1IwyYuR/2FZdfXSoSJDCUykIq/hbj2Ys3gc1C Vy862EtU/GaIKnaJZs4cbEE1xZf5yaQ1BSMRi46NHfykfvFsajWllvxiPPIf2JPkXwwB PViQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:references:to:cc:subject:from:message-id:date :content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:dkim-signature; bh=UGenY7YAzUwlgiT73G7TaHalCSUU2X6AFVguS+ovgFw=; fh=yfvd0vU3odYwT6RkyJDBrn5uWsf8RvRfLN3Hf2qxTT8=; b=1C+fFQHgWk9+CPj7jKx+SHxdbhshoiHhR6WtSatFyv2IcVpMrKMLFPA/g+3b6Ezsmm FG/Xxy9N68mhTgrIhalALnbklhALIqTGZbVuj8JnZugW2PBJGaX64YSTRCd9ccoI9h2q I/93eQE9CNbg7S4WNPLfjmzxrLgWWIvqrLo1JX8ZL+8pCt19TFIWTncmUGf57qoLrqQF kXjUjIizreXnHC0fnudx8d06GhFNz55RBr+Jd8mwffSW6HjzRaawM0r6X6QIFtrBEd5B xbYI9eUVnlIw38AimR7/8DLPRq85mOkMoMYU6lQaZLPy1i6YIa3OoozBhjt3XQN0bMZB Vs9Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=BWWaekmb; arc=pass (i=1 spf=pass spfdomain=bootlin.com dkim=pass dkdomain=bootlin.com dmarc=pass fromdomain=bootlin.com); spf=pass (google.com: domain of linux-kernel+bounces-171624-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-171624-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id b20-20020a05620a0f9400b0079295fc55c1si4968250qkn.336.2024.05.07.07.53.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 May 2024 07:53:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-171624-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=BWWaekmb; arc=pass (i=1 spf=pass spfdomain=bootlin.com dkim=pass dkdomain=bootlin.com dmarc=pass fromdomain=bootlin.com); spf=pass (google.com: domain of linux-kernel+bounces-171624-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-171624-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 55B001C22C5A for ; Tue, 7 May 2024 14:53:04 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id AFC53160791; Tue, 7 May 2024 14:52:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="BWWaekmb" Received: from relay6-d.mail.gandi.net (relay6-d.mail.gandi.net [217.70.183.198]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8B7EF15FCF0; Tue, 7 May 2024 14:52:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.198 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715093575; cv=none; b=skNfStd2FyDIoD85YFKGJIb30qVfmzrEGAM8zCUynS6dFqFL2eFvDBrfuo23/fyXiNXon3RY0GEu3psiSD9Mm2gcczC39ABstTlVzpZxDp16VLxUYw7Wqa1hW4HBrJdB735sEiTaLIPq0mA+1jN8NmXUu/P1FOH8rQFz2dYLNGo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715093575; c=relaxed/simple; bh=MlQMJtQlUuf6lLca3bql80rz2yBaAuTOSQM7x4CO/+E=; h=Mime-Version:Content-Type:Date:Message-Id:From:Subject:Cc:To: References:In-Reply-To; b=YEie/5xLR5KGKMqFhvia7yN02pILKObNf3TAanbAQ/cpROO3pqtMdmW798mTZHZrb8cxQB1Ezp4KjeoG4BDG+5FlTivbBy1YrmeRURaOSSl8rmkik2SdM42GIK9l7EXIyOV6GNzYf0e9wFITSPSRLTXmnSN7mse6dKve7FFDGFA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=BWWaekmb; arc=none smtp.client-ip=217.70.183.198 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Received: by mail.gandi.net (Postfix) with ESMTPSA id 5D8DBC0002; Tue, 7 May 2024 14:52:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1715093570; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=UGenY7YAzUwlgiT73G7TaHalCSUU2X6AFVguS+ovgFw=; b=BWWaekmbWtG3JQ8gcKhy7e0+HcN08YNNci5RJE5FZSeN+mPVBdOtCyww7UraBvBuBvNe4j roYAhUgVdwh+j5vWIebRHxzomUrJwZcQ/rWk189pVSdKnmtnMoUiZQnH9uyhOUzhuFQfNP LMPFRd2atO3kzm+eFRMubYigSEaCuE+BqOnl9Jc3yZtRx9YorACLWdx9KZJcOpAN0cXTK9 BpzVO+y3YCNj2AWGaxSiF8EnDdT9NWnes/ppIWSp+tMJw4iBuCmvMs2+q8ESc8VIzGX/61 KexeA06fv4ck3ADqNmciQ4qi8pZnbmmPuJ0WYduRP8DP0xw1NhkhKm3qPyDtBQ== Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Tue, 07 May 2024 16:52:49 +0200 Message-Id: From: =?utf-8?q?Th=C3=A9o_Lebrun?= Subject: Re: [PATCH v2 00/11] Add Mobileye EyeQ system controller support (clk, reset, pinctrl) Cc: , , , , , "Vladimir Kondratiev" , "Gregory CLEMENT" , "Thomas Petazzoni" , "Tawfik Bayouk" To: "Stephen Boyd" , "Conor Dooley" , "Greg Kroah-Hartman" , "Krzysztof Kozlowski" , "Lee Jones" , "Linus Walleij" , "Michael Turquette" , "Philipp Zabel" , "Rafael J. Wysocki" , "Rob Herring" , "Thomas Bogendoerfer" X-Mailer: aerc 0.17.0 References: <20240503-mbly-olb-v2-0-95ce5a1e18fe@bootlin.com> <8dcdb1422cd144128c1dc6fff1c273d3.sboyd@kernel.org> In-Reply-To: <8dcdb1422cd144128c1dc6fff1c273d3.sboyd@kernel.org> X-GND-Sasl: theo.lebrun@bootlin.com Hello, On Sat May 4, 2024 at 4:34 AM CEST, Stephen Boyd wrote: > Quoting Th=C3=A9o Lebrun (2024-05-03 07:20:45) > > This builds on previous EyeQ5 system-controller revisions[0], supportin= g > > EyeQ5, EyeQ6L and EyeQ6H. We expose a few OLB system-controller > > features here: > > - Clocks: some read-only PLLs derived from main crystal and some > > divider clocks based on PLLs. > > - Resets. > > - Pin controller, only on EyeQ5 (rest will use generic pinctrl-single)= . > >=20 > > EyeQ6H is special in that it has seven instances of this > > system-controller. Those are spread around and cannot be seen as a > > single device, hence are exposed as seven DT nodes and seven > > compatibles. > >=20 > > This revision differs from previous in that it exposes all devices as a > > single DT node. Driver-wise, a MFD registers multiple cells for each > > device. Each driver is still in isolation from one another, each in > > their respective subsystem. > > Why can't you use auxiliary device and driver APIs? Good question. Reasons I see: - I didn't know about auxdev beforehand. I discussed the rework with a few colleagues and none mentioned it either. - It feels simpler to let each device access iomem resources. From my understanding, an auxdev is supposed to make function calls to its parent without inheriting iomem access. That sounds like it will put the register logic/knowledge inside a single driver, which could or could not be a better option. Implementing a function like this feels like cheating: int olb_read(struct device *dev, u32 offset, u32 *val); With an MFD, we hand over a part of the iomem resource to each child and they deal with it however they like. - Syscon is what I picked to share parts of OLB to other devices that need it. Currently that is only for I2C speed mode but other devices have wrapping-related registers. MFD and syscon are deeply connected so an MFD felt natural. - That would require picking one device that is platform driver, the rest being all aux devices. Clock driver appears to be the one, same as two existing mpfs and starfive-jh7110 that use auxdev for clk and reset. Main reason I see for picking auxdev is that it forces devices to interact with a defined internal API. That can lead to nicer abstractions rather than inheriting resources as is being done in MFD. Are there other reasons? Thanks, -- Th=C3=A9o Lebrun, Bootlin Embedded Linux and Kernel engineering https://bootlin.com