Received: by 2002:a05:6359:6284:b0:131:369:b2a3 with SMTP id se4csp1162041rwb; Sat, 5 Aug 2023 08:30:15 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFx8hhb2lsQYWIrQEQ6lWyCxSKKii+GEzMZWk7L4C9afNLSGJ4Wd+SgMjyJemQQXXjJzaKt X-Received: by 2002:a17:903:2310:b0:1bb:d048:3173 with SMTP id d16-20020a170903231000b001bbd0483173mr5830755plh.61.1691249415248; Sat, 05 Aug 2023 08:30:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691249415; cv=none; d=google.com; s=arc-20160816; b=W4zDS31sTPkHqL+kS5IyLTLHbBx6CTHxHSD/sZ0igHWfOmAyZ2x7VJWzwnB7PF5vvi /l0sOg7X1d02EpOQrl7X/NVghXPyOfzeftmzj2XSJ8zSMWlJ2aS6mwxPx7s/064yW0Xn XjNCuNxRwgkHTcZZS2edlts9MnXU2QX2CfLvv6pLy+XQ3yM4WmvnU68KnRwJp45d5ViM Ptwo4yqs715G3xjIO8vZJ7kayWtiQ2IVhS1XS73y/WDmI76d7Ff1bA7loDIMOunxbmRm GhqfSyzWEOoLz7NYbdYsGAjSa30vD05bEkrVRinlQ0IzgHzuULjDbO33oCdFMJatDpOO 64aA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=lSBBPIVhoXcQr9SrZmVzlFWA/oDtNDy3tg3g/Rjv0Qg=; fh=lDn0WnxEKVtxdmLZ955uXv0ga6mTYbqmJ4uplD6c4Xg=; b=xNKYYqEVrYWDOoL9Me3lqpPR+If+8mOcwIbfKlX3bdEnlGX4csZaDSFHlQujXOF10d TMnPRVAeKOlrRUQ1/D0D3FZ2iW14Wnnd5G8DY+P8GzUtR07S/ggmeCKpstdjMHmZ80or qW2XtstMr5iv+IH2DRDbYKhsrf6GgN6avrbyWu+27XxjpHQANXoOAjjkXtIGQTy1tRzp H0MFus8xnSvPL+p2Bdy3L7yWOLCi//rgbss7sn+K+pOZ6iHeozO/5XM72oyo0QCwAbQp 8uoJ2G86lpDVHUgOyOwD8darqWnFhsQahsKtefh5MKlgDzPTj8q8/z3CzWjfbiZsdKR1 oxJQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f2-20020a170902ce8200b001bc35017804si3441243plg.443.2023.08.05.08.29.51; Sat, 05 Aug 2023 08:30:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229785AbjHEOu4 (ORCPT + 99 others); Sat, 5 Aug 2023 10:50:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53246 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229527AbjHEOuz (ORCPT ); Sat, 5 Aug 2023 10:50:55 -0400 Received: from pidgin.makrotopia.org (pidgin.makrotopia.org [185.142.180.65]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 802EB1B9 for ; Sat, 5 Aug 2023 07:50:54 -0700 (PDT) Received: from local by pidgin.makrotopia.org with esmtpsa (TLS1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.96) (envelope-from ) id 1qSIcC-0000Po-2Q; Sat, 05 Aug 2023 14:50:48 +0000 Date: Sat, 5 Aug 2023 15:50:41 +0100 From: Daniel Golle To: Miquel Raynal Cc: Srinivas Kandagatla , Greg Kroah-Hartman , Thomas Petazzoni , Robert Marko , Luka Perkov , Michael Walle , linux-kernel@vger.kernel.org, Randy Dunlap , Chen-Yu Tsai , =?utf-8?B?UmFmYcWCIE1pxYJlY2tp?= Subject: Re: [PATCH v7 6/7] ABI: sysfs-nvmem-cells: Expose cells through sysfs Message-ID: References: <20230801182132.1058707-1-miquel.raynal@bootlin.com> <20230801182132.1058707-7-miquel.raynal@bootlin.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230801182132.1058707-7-miquel.raynal@bootlin.com> X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Aug 01, 2023 at 08:21:31PM +0200, Miquel Raynal wrote: > The binary content of nvmem devices is available to the user so in the > easiest cases, finding the content of a cell is rather easy as it is > just a matter of looking at a known and fixed offset. However, nvmem > layouts have been recently introduced to cope with more advanced > situations, where the offset and size of the cells is not known in > advance or is dynamic. When using layouts, more advanced parsers are > used by the kernel in order to give direct access to the content of each > cell regardless of their position/size in the underlying device, but > these information were not accessible to the user. > > By exposing the nvmem cells to the user through a dedicated cell/ folder > containing one file per cell, we provide a straightforward access to > useful user information without the need for re-writing a userland > parser. Content of nvmem cells is usually: product names, manufacturing > date, MAC addresses, etc, > > Signed-off-by: Miquel Raynal > Reviewed-by: Greg Kroah-Hartman > --- > Documentation/ABI/testing/sysfs-nvmem-cells | 21 +++++++++++++++++++++ > 1 file changed, 21 insertions(+) > create mode 100644 Documentation/ABI/testing/sysfs-nvmem-cells > > diff --git a/Documentation/ABI/testing/sysfs-nvmem-cells b/Documentation/ABI/testing/sysfs-nvmem-cells > new file mode 100644 > index 000000000000..a1d140dcbd5d > --- /dev/null > +++ b/Documentation/ABI/testing/sysfs-nvmem-cells > @@ -0,0 +1,21 @@ > +What: /sys/bus/nvmem/devices/.../cells/ > +Date: May 2023 > +KernelVersion: 6.5 > +Contact: Miquel Raynal > +Description: > + The "cells" folder contains one file per cell exposed by the > + NVMEM device. The name of the file is: @, with > + being the cell name and its location in the NVMEM > + device, in hexadecimal (without the '0x' prefix, to mimic device > + tree node names). The length of the file is the size of the cell > + (when known). The content of the file is the binary content of > + the cell (may sometimes be ASCII, likely without trailing > + character). > + Note: This file is only present if CONFIG_NVMEM_SYSFS > + is enabled. > + > + Example:: > + > + hexdump -C /sys/bus/nvmem/devices/1-00563/cells/product-name Location is missing here, should be something like hexdump -C /sys/bus/nvmem/devices/1-00563/cells/product-name@f00 > + 00000000 54 4e 34 38 4d 2d 50 2d 44 4e |TN48M-P-DN| > + 0000000a > -- > 2.34.1 >