Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp6919699yba; Thu, 2 May 2019 00:23:00 -0700 (PDT) X-Google-Smtp-Source: APXvYqwv5xpDnZOOQJY+bZ4fSA0erO+NkjjRLm9RZLWY5IJL68CDPou1y5Lp6SjZbp3t0lAY7l5q X-Received: by 2002:a17:902:820a:: with SMTP id x10mr2191727pln.316.1556781780272; Thu, 02 May 2019 00:23:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556781780; cv=none; d=google.com; s=arc-20160816; b=Y7mqH+8L5LkmYAa/cz8i00817LTvzNxjweqzUxmJIm45fChg0LW6+mSZmCl065oI7u PiTuWpZ0oMInNQnrImhawTIPFNckVCJs4bwWxc97L/hB3hU+GtwptzbH6vYsri/CLaUb Sd8QMLXDZTJVY8uaQGhZYXXvTF4JVB/95cLUORwf09ScD1/6z0KyiGRPhrNf0BVS9Ww5 eArrZVm2zcSx4UbZcoWWIfmUc0aM1jqCMR9sL2qg1KvVZ1hMY0X7nX5Z48MFXBsrbzgj beVOyamQQHc1NquG8jWchbhWJPm4v5Ett40bIxvuilxebMY34hqxcyPK9fBMibDPehJD q2CQ== 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 :organization:references:in-reply-to:message-id:subject:cc:to:from :date; bh=2nCiU2hYfhpuvVHEp5PABMS7e2p+Q/3JGEnK22/x1N0=; b=pnGsrkEhH8WihaqeyZGR1dviT4OVT7jcJAORQTP0leXxaWulJ5ZfIZR/5ntkvEGkdb VwYyW7eZmkj3n76EVed1RW0Zq5WiWL+aWkTFYgWX2KTEjZoMRzyD6yRllX2ilM6TxSZy pjlxpMJZcZwTyENVCGpYqlaOl8nJbZyRa8TYQtG7hHqa/anj1m8cpdkGtmgN2hZGpgQK ODF4X7K1ZR+6BwKyDD2zPyEvfPJx21dfQi1+DJ/t/BNwiBpy82Xv749Gjkt1p8ULPGo6 IMiUADJYwIXMFROMM7EVLWd1zA+2r5ka+BNSem1NG+1Qkbl5FwwQZ4YT7sBuVciGksOM ZiLg== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q8si10197283pls.210.2019.05.02.00.22.45; Thu, 02 May 2019 00:23:00 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726242AbfEBHVb convert rfc822-to-8bit (ORCPT + 99 others); Thu, 2 May 2019 03:21:31 -0400 Received: from bhuna.collabora.co.uk ([46.235.227.227]:38780 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726055AbfEBHVb (ORCPT ); Thu, 2 May 2019 03:21:31 -0400 Received: from localhost (unknown [IPv6:2a01:e0a:2c:6930:5cf4:84a1:2763:fe0d]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: bbrezillon) by bhuna.collabora.co.uk (Postfix) with ESMTPSA id 86C1527124E; Thu, 2 May 2019 08:21:28 +0100 (BST) Date: Thu, 2 May 2019 09:21:26 +0200 From: Boris Brezillon To: Tomasz Figa , computersforpeace@gmail.com, marek.vasut@gmail.com, Mark Rutland Cc: Rob Herring , =?UTF-8?B?UGF3ZcWC?= Chmiel , Kyungmin Park , bbrezillon@kernel.org, miquel.raynal@bootlin.com, richard@nod.at, David Woodhouse , linux-mtd@lists.infradead.org, linux-kernel , devicetree Subject: Re: [PATCH 4/5] dt-binding: mtd: onenand/samsung: Add device tree support Message-ID: <20190502092126.22f1ace5@collabora.com> In-Reply-To: References: <20190426164224.11327-1-pawel.mikolaj.chmiel@gmail.com> <20190426164224.11327-5-pawel.mikolaj.chmiel@gmail.com> <20190502015408.GA11612@bogus> <20190502083632.0ec0fb4e@collabora.com> <20190502085518.5d248167@collabora.com> Organization: Collabora X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 2 May 2019 15:58:24 +0900 Tomasz Figa wrote: > 2019年5月2日(木) 15:55 Boris Brezillon : > > > > On Thu, 2 May 2019 15:42:59 +0900 > > Tomasz Figa wrote: > > > > > 2019年5月2日(木) 15:36 Boris Brezillon : > > > > > > > > Hi Tomasz, > > > > > > > > On Thu, 2 May 2019 15:23:33 +0900 > > > > Tomasz Figa wrote: > > > > > > > > > 2019年5月2日(木) 10:54 Rob Herring : > > > > > > > > > > > > On Fri, Apr 26, 2019 at 06:42:23PM +0200, Paweł Chmiel wrote: > > > > > > > From: Tomasz Figa > > > > > > > > > > > > > > This patch adds dt-bindings for Samsung OneNAND driver. > > > > > > > > > > > > > > Signed-off-by: Tomasz Figa > > > > > > > Signed-off-by: Paweł Chmiel > > > > > > > --- > > > > > > > .../bindings/mtd/samsung-onenand.txt | 46 +++++++++++++++++++ > > > > > > > 1 file changed, 46 insertions(+) > > > > > > > create mode 100644 Documentation/devicetree/bindings/mtd/samsung-onenand.txt > > > > > > > > > > > > > > diff --git a/Documentation/devicetree/bindings/mtd/samsung-onenand.txt b/Documentation/devicetree/bindings/mtd/samsung-onenand.txt > > > > > > > new file mode 100644 > > > > > > > index 000000000000..341d97cc1513 > > > > > > > --- /dev/null > > > > > > > +++ b/Documentation/devicetree/bindings/mtd/samsung-onenand.txt > > > > > > > @@ -0,0 +1,46 @@ > > > > > > > +Device tree bindings for Samsung SoC OneNAND controller > > > > > > > + > > > > > > > +Required properties: > > > > > > > + - compatible : value should be either of the following. > > > > > > > + (a) "samsung,s3c6400-onenand" - for onenand controller compatible with > > > > > > > + S3C6400 SoC, > > > > > > > + (b) "samsung,s3c6410-onenand" - for onenand controller compatible with > > > > > > > + S3C6410 SoC, > > > > > > > + (c) "samsung,s5pc100-onenand" - for onenand controller compatible with > > > > > > > + S5PC100 SoC, > > > > > > > + (d) "samsung,s5pv210-onenand" - for onenand controller compatible with > > > > > > > + S5PC110/S5PV210 SoCs. > > > > > > > + > > > > > > > + - reg : two memory mapped register regions: > > > > > > > + - first entry: control registers. > > > > > > > + - second and next entries: memory windows of particular OneNAND chips; > > > > > > > + for variants a), b) and c) only one is allowed, in case of d) up to > > > > > > > + two chips can be supported. > > > > > > > + > > > > > > > + - interrupt-parent : phandle of interrupt controller to which the OneNAND > > > > > > > + controller is wired, > > > > > > > > > > > > This is implied and can be removed. > > > > > > > > > > > > > + - interrupts : specifier of interrupt signal to which the OneNAND controller > > > > > > > + is wired; should contain just one entry. > > > > > > > + - clock-names : should contain two entries: > > > > > > > + - "bus" - bus clock of the controller, > > > > > > > + - "onenand" - clock supplied to OneNAND memory. > > > > > > > > > > > > If the clock just goes to the OneNAND device, then it should be in the > > > > > > nand device node rather than the controller node. > > > > > > > > > > > > > > > > (Trying hard to recall the details about this hardware.) > > > > > AFAIR the clock goes to the controller and the controller then feeds > > > > > it to the memory chips. > > > > > > > > > > Also I don't think we should have any nand device nodes here, since > > > > > the memory itself is only exposed via the controller, which offers > > > > > various queries to probe the memory at runtime, so there is no need to > > > > > describe it in DT. > > > > > > > > It's probably true, though not providing this controller/device > > > > separation for NAND controller/devices has proven to be a mistake for > > > > raw NAND controllers (some props apply to the controllers and others to > > > > the NAND device, not to mention that some controllers support > > > > interacting with several chips), so, if that's a new binding, I'd > > > > recommend having this separation even if it's not strictly required. > > > > > > > > > > Note that OneNAND is a totally different thing than the typical NAND > > > memory with NAND interface. OneNAND chips have a NOR-like interface, > > > with internal controller and buffers inside, so technically they can > > > be even used without any special controller on the SoC, via a generic > > > parallel host interface and possibly some regular DMA engine for CPU > > > offload. > > > > Yes, I know that. > > > > > > > > The controller design of the SoCs in question further abstracts the > > > OneNAND's programming interface into a number of high level operations > > > and attempts to hide the details of the underlying memory, so I don't > > > see the point of describing the memory in DT here, it would actually > > > defeat the purpose of this controller. > > > > I don't see how having a subnode for the NAND chip would change > > anything on how the controller interacts with the NAND device. My point > > is, if we ever need to add props that apply to the device rather than > > the controller itself, having a single node to represent both elements > > is not that great. > > You mean, just having a very generic onenand@0 node that doesn't > really include any information, except maybe the partition table? Yes. > I > guess that wouldn't have any negative side effects indeed. > > My point was that we don't want to put things like chip vendor, size, > etc. in DT, since that's enumerable. Oh, definitely not, and that's exactly how we do it for NAND devices. Everything that's discoverable is not described in the DT, but some things can't be discovered this way (like when you want to override the ECC strength and use SW-based implem instead of the HW-based one). I know none of this applies to OneNAND yet, I'm just over-cautious about that since DT bindings changes are hard to make once the bindings are in use.