Received: by 2002:a05:6a10:a852:0:0:0:0 with SMTP id d18csp114636pxy; Fri, 30 Apr 2021 01:24:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzk9pL9Fgqy1hR2PXhz1eEEA214+nzqcREKKpR7sAv5+O87J/2vPGab9+IHJMFFH3/StpiR X-Received: by 2002:aa7:9f1b:0:b029:27a:264a:57d8 with SMTP id g27-20020aa79f1b0000b029027a264a57d8mr4011277pfr.20.1619771050892; Fri, 30 Apr 2021 01:24:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619771050; cv=none; d=google.com; s=arc-20160816; b=bLrsLxp4stpqgJN4TSN3iZGSmUfQfHbdd7ndSM7kDKl7OipGf9YcEpb2AUkcJLKIVz PTECSvZhg96zuOoDYaArKKjNDqvQCysx+QniOipL3M1JJRk/UjKvejrASWDTdUvL0alS Kdgcpsc6Mb3/J4jfkvjD0fG5W2q1P5Pl1dPt6EKVsBMOHHgX1oUEM4aBm9Q/q2FEfZOI PduKIK0JNO9etMJBJU/2YnObMan2rfBC4OSOmvhzg47iywshaGD1dT8usoYHrjPh+crL XDAdUqmgErvNCyvN0e95aBZ65NB3ri4VXKAkKlhcBtF9L7tKlqIJEtaNJC5DPr4Lj2+o fC1g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=TqhKhka1kpl1eocMFbECBCOHDPPu7HBtiaIAo1r1HXE=; b=n1Ewd7j9WzDK/BUhNaSHCOcd/+I0UjCAXSRJTM2QTidw7tCz51JLWHngL1ezHeULfR +/6LCXozpzMK2E7SDHtqnyyuDeTVqG+n7FHYVqjQUk8V9MzjoLjZC2ET6Dbe2bLInAU6 x0Rs6434FVfhe1Sh3zq+zRyFx/1jlrQLclGL6w2kXGJ/z9CmNsSumVWt7TPJf2+/2nwd sGXrQdGyDeb2UrtT/oTtU/n8uMqHiWTnnjmhjalcZA9+vpMh6HDbcZGnIiuP2cvU0pN8 M2BHL2pkKQODTgJafIjcmVVgntJ5AJSVRywgwtBeww8yftgqcR5pwh4v94repIXh1pAF wajA== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=vaisala.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id lp2si1507831pjb.138.2021.04.30.01.23.56; Fri, 30 Apr 2021 01:24:10 -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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=vaisala.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231373AbhD3IVu (ORCPT + 99 others); Fri, 30 Apr 2021 04:21:50 -0400 Received: from hel-mailgw-01.vaisala.com ([193.143.230.17]:33010 "EHLO hel-mailgw-01.vaisala.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229553AbhD3IVu (ORCPT ); Fri, 30 Apr 2021 04:21:50 -0400 Received: from HEL-SMTP.corp.vaisala.com (HEL-SMTP.corp.vaisala.com [172.24.1.225]) by hel-mailgw-01.vaisala.com (Postfix) with ESMTP id A277A601F34D; Fri, 30 Apr 2021 11:20:55 +0300 (EEST) Received: from localhost.localdomain ([172.24.252.69]) by HEL-SMTP.corp.vaisala.com over TLS secured channel with Microsoft SMTPSVC(8.5.9600.16384); Fri, 30 Apr 2021 11:21:00 +0300 Subject: Re: [PATCH v2 1/4] dt-bindings: nvmem: Add bootcount-nvmem To: Rob Herring Cc: srinivas.kandagatla@linaro.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org References: <20210429205310.GA1729011@robh.at.kernel.org> From: Nandor Han Message-ID: <48fc2a6c-9c4d-d858-5ab5-c10c590d8345@vaisala.com> Date: Fri, 30 Apr 2021 11:21:00 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: <20210429205310.GA1729011@robh.at.kernel.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 30 Apr 2021 08:21:00.0548 (UTC) FILETIME=[C0D95C40:01D73D99] Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, Thanks for your feedback. >> + >> +properties: >> + compatible: >> + enum: >> + - linux,bootcount-nvmem > > What makes this Linux specific? IIRC, u-boot has boot counting function > too. > U-Boot has indeed the counterpart functionality of bootcount feature, however, in this particularly case is not called `u-boot,bootcount-nvmem`. If you have any suggestions I'm happy to change it. Should I remove the `linux` prefix? >> + >> + linux,bootcount-magic: >> + description: Override default mask value. >> + $ref: /schemas/types.yaml#/definitions/uint32 > > I don't understand what this is. Is it magic or a mask? It's the magic value. Seems to be a mistake in the description. I'll correct this. > >> + >> +dependencies: >> + nvmem-cell-names: [ nvmem-cells ] > > Core schema takes care of this. > Ok. I will remove it in that case. >> +examples: >> + # example with 16 bit nvram cell: >> + - | >> + bootcount { >> + compatible = "linux,bootcount-nvmem"; >> + nvmem-cells = <&bootcount_regs>; >> + nvmem-cell-names = "bootcount-regs"; >> + }; >> + >> + rtc: rtc@68 { >> + bootcount_regs: bootcount_nvmem_regs@e { >> + reg = <0x0e 0x2>; > > It would be simpler to just add a compatible here and get rid of the > 'bootcount' node here. > This is the configuration for NVMEM cell provider and is done according to bindings/nvmem.yaml document. Is here something that I'm missing? At least this method of declaring NVMEM cells providers are decoupling the code from hardware declaration resulting in a more robust code. Regards, Nandor