Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp580590pxb; Fri, 16 Apr 2021 12:46:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxGn+yIs0GhfXb+g7OPIhu4Sx4lKGp8Qc/F9eje+wdMATQRNXiLePzAUjNWsp5W4IlC7nMf X-Received: by 2002:a50:fe81:: with SMTP id d1mr12211652edt.308.1618602413359; Fri, 16 Apr 2021 12:46:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618602413; cv=none; d=google.com; s=arc-20160816; b=Kr3wpu5Xb2hXrJmnzhHs2Hy+hsuYjQbkjyo6L5ZPETYwzlGRf0+qNAvRbeMvb4V6wo p3vcDMuhEVP/3iW4CBA9VY7ktnaWzq1ur3WkOs5LhOORWil5gxuv2w5IvSCDqi/oQRfK aNNoHfCVEH38hDwGZQSqrFaWWvhRY1jKB0YwCaTivKSH7N7N6yC7M+KJEYT1DgDxPgMY /JyZwrbzcVVkCsbsh4joZFqN9+nvrOwLytCYBZ2BkxgPwzAT5PND+nQL+3sWhmyvcaP/ Rl30ge/QO9HSEXq97N5wgbv430jkSakco3VZj96vDgNe/ad+vcOk7AqqvilHgN0ytDKC l6uQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:user-agent:references:in-reply-to :subject:cc:to:from:date:content-transfer-encoding:mime-version :dkim-signature; bh=iOKsLNHAvUNt6FOKX0n36qA6s7ZucezMgWOSW4v76s8=; b=KEM1TBo0IWWzhatA2na39GeOUdxIinRylgreo2fZrbZ2FMWLoZCZ55tXxUYMWyl8Ip G+V1Y6YA1Revhn7rh78OdaZMwhcO8PUH5wiI3AYgRpFAf3AJiq7qrJK3oXvig6U3B4yZ /slGAzBTH9+/XbSZOXwjQOZyjhyvnvlS3Fkx1jed9qpgjDl+8pFD1k55vsa7d1JmgeFq VEzZBnVu6Q+QvpXAZWz4ylUnkYe41F1uK79f6wZvnP/Rouc6caEUriGRkZyO56zwZiyt PVMV+qrUdhclHGbqxC9J22WxhImBTIgSgDDEfvzFSc0m298UxpKF60dRrYEqt8ulGFH5 /wcQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@walle.cc header.s=mail2016061301 header.b="Hb1xtI/W"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v5si5707797edi.582.2021.04.16.12.46.30; Fri, 16 Apr 2021 12:46:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@walle.cc header.s=mail2016061301 header.b="Hb1xtI/W"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243051AbhDPT0e (ORCPT + 99 others); Fri, 16 Apr 2021 15:26:34 -0400 Received: from ssl.serverraum.org ([176.9.125.105]:37575 "EHLO ssl.serverraum.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235362AbhDPT0b (ORCPT ); Fri, 16 Apr 2021 15:26:31 -0400 Received: from ssl.serverraum.org (web.serverraum.org [172.16.0.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ssl.serverraum.org (Postfix) with ESMTPSA id 01C1022253; Fri, 16 Apr 2021 21:26:03 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=walle.cc; s=mail2016061301; t=1618601164; 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=iOKsLNHAvUNt6FOKX0n36qA6s7ZucezMgWOSW4v76s8=; b=Hb1xtI/WzADiaRibdpmonxBtIdj9F1hpRIoWgSNvarzwJvNlayCeXjwOHk4k/q5vapGRy0 mZ4MWe8zwkie5eb66+W6rIaiyGkCEb3cCFQga8gMElsiMmwCxqHLmjmrU3+LW7L9M/xtGG VEhMEaxzSx5188bB+2nPXjtvkdJNma0= MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Fri, 16 Apr 2021 21:26:03 +0200 From: Michael Walle To: Rob Herring Cc: linux-mtd@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , Srinivas Kandagatla Subject: Re: [PATCH 0/5] mtd: core: OTP nvmem provider support In-Reply-To: <20210416184423.GA3715339@robh.at.kernel.org> References: <20210416114928.27758-1-michael@walle.cc> <20210416184423.GA3715339@robh.at.kernel.org> User-Agent: Roundcube Webmail/1.4.11 Message-ID: <9f33229a8fe83b49210289fc93a8554e@walle.cc> X-Sender: michael@walle.cc Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Rob, Am 2021-04-16 20:44, schrieb Rob Herring: > On Fri, Apr 16, 2021 at 01:49:23PM +0200, Michael Walle wrote: >> The goal is to fetch a (base) MAC address from the OTP region of a SPI >> NOR >> flash. >> >> This is the first part, where I try to add the nvmem provider support >> to >> the MTD core. >> >> I'm not sure about the device tree bindings. Consider the following >> two >> variants: >> >> (1) >> flash@0 { >> .. >> >> otp { >> compatible = "mtd-user-otp"; > > mtd is a linuxism. Why not just 'nvmem-cells' here or as a fallback if > we come up with a better name? There are two different compatibles: "mtd-user-otp" and "mtd-factory-otp" to differentiate what kind of OTP should be used (and both are possible at the same time). Thus nvmem-cells alone won't be enough. We could drop the "mtd-" prefix though. Is there a benefit of having the following? compatible = "user-otp", "nvmem-cells"; >> #address-cells = <1>; >> #size-cells = <1>; >> >> serial-number@0 { >> reg = <0x0 0x8>; >> }; >> }; >> }; >> >> (2) >> flash@0 { >> .. >> >> otp { >> compatible = "mtd-user-otp"; >> #address-cells = <1>; >> #size-cells = <1>; >> >> some-useful-name { >> compatible = "nvmem-cells"; >> >> serial-number@0 { >> reg = <0x0 0x8>; >> }; >> }; >> }; >> }; >> >> Both bindings use a subnode "opt[-N]". We cannot have the nvmem cells >> as >> children to the flash node because of the legacy partition binding. >> >> (1) seems to be the form which is used almost everywhere in the >> kernel. >> That is, the nvmem cells are just children of the parent node. >> >> (2) seem to be more natural, because there might also be other >> properties >> inside the otp subnode and might be more future-proof. >> >> At the moment this patch implements (1). > > I think approach (1) seems fine. ok -michael