Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp561556rwb; Thu, 22 Sep 2022 03:35:48 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4PbI8TerTwi1lW6+NbIN57MPlU+TCYDeiW0dKBZGVmcWUX0ARe3f46AhX3upyoalfyU+Oj X-Received: by 2002:a05:6402:50cc:b0:451:bf26:8c51 with SMTP id h12-20020a05640250cc00b00451bf268c51mr2596613edb.336.1663842947768; Thu, 22 Sep 2022 03:35:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663842947; cv=none; d=google.com; s=arc-20160816; b=cEpt0SBRy2zWqzkuTqRtJVtJsSICwrpPCqykJZOzFUZJOlVORPP9gihy7L6OTi5Vkp rBObP8ZbM2X0JJoBk7QzGlsFl61x1Ba/bewOZSAAghVgzsmB3rJldw/B+z3aL6R2bHEH NGg/Ftj0CClYzApTceM1SWFr5VVshRDc8Vc69zbIaMQFahcVDkxh9Iju3LGyJTo6aF5W KHduTH3RnUoRkx/p11BXTA7r1vaspg5QdZAuRr/lxVcY1w0rOSsdmrC/v+uS42JSq2Ba lJoatjE9CFQH20FSjDBgbMZz3mTEGE3sYS4VbF9Gyq8lmdnoyvKIV7QKCTZUj8P+BpUP R9xA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :organization:message-id:subject:cc:to:from:date:dkim-signature; bh=InFQ8JobN+jZxAMn4KRH46pdNp7Ua6Sz712kAiGUGC8=; b=kHFKpPBnehraCCmp5MxqFgRnWwAmK1va9gMS/cMpN2StWqmtZ77Xmb6Kpf5rsKTM1w xomifDFsE9NaFSLbx0UPZ1tBz9+CeboUWSgGzvNAO7AZ9Cf8tJkwbCVwsHWafe5dY7Fa ThDas4OC90rECvZbdnOZiD3hcloHQRkFB6WI3ywne4EoaQXKOouUvFNPaFRMTkwa1z16 xCmu2AfaTaWVbH9j/RGoz3exNigNsfkMcZfiV0xi1IOzaMY9+YVCt2GHRC+3uow2WhPV /JqK3ucr3bucOfCfHl9DuuKxhOebqOdXvncKebncCCtwdw8J/wRByKmGOPcXaGJYRSdA ICKg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=HktSsHAO; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ht17-20020a170907609100b00780da079e16si4825290ejc.746.2022.09.22.03.35.22; Thu, 22 Sep 2022 03:35:47 -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; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=HktSsHAO; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231487AbiIVKX6 (ORCPT + 99 others); Thu, 22 Sep 2022 06:23:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43280 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231573AbiIVKXv (ORCPT ); Thu, 22 Sep 2022 06:23:51 -0400 Received: from relay4-d.mail.gandi.net (relay4-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::224]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 80746D8244 for ; Thu, 22 Sep 2022 03:23:50 -0700 (PDT) Received: (Authenticated sender: miquel.raynal@bootlin.com) by mail.gandi.net (Postfix) with ESMTPSA id A95E1E0003; Thu, 22 Sep 2022 10:23:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1663842229; 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; bh=InFQ8JobN+jZxAMn4KRH46pdNp7Ua6Sz712kAiGUGC8=; b=HktSsHAOPoihX/YcXqHRaPDhjFZcD/AI918vIgxruFYEtWpFB5C8nRxU5isZWLkoktc0gj K8jyLDHxgjO9+ctQ26Ea+z1Ex+bGFQtrXQg70yllsYWt+iCCeSX0tiUFTL1IX51lmEHQ/U 2PlxeOM68TEhwXRStkCZg9oQJuBKPqpZ/aO44LNL6eMqMBhX9HKbI8bwmyiTDfwrnmxekb FjDxlR9SpQ7oE9xVoVarrMqAq+xYft0/x3BjwNcN8BUwo/ZTDirbjHFPyUJF8XrbYJggXs g3mjcwF2ybe3Ejsvsc5z2nVNrtqDxK9wK7R/cfCQNgUoSybifiXJsq3SyTHXiQ== Date: Thu, 22 Sep 2022 12:23:47 +0200 From: Miquel Raynal To: Srinivas Kandagatla Cc: Robert Marko , Thomas Petazzoni , linux-kernel@vger.kernel.org Subject: Exposing nvmem cells to userspace? Message-ID: <20220922122347.1866f758@xps-13> Organization: Bootlin X-Mailer: Claws Mail 4.0.0 (GTK+ 3.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,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 Hello Srinivas, I am currently looking at the Open Compute Project ONIE Tlv tables in modern networking hardware. Thanks to the specification being available for many years and rather easy to implement, those tables are already present in many switches. Manufacturers just have to provide a small storage medium exposing factory-related information (manufacturer, date, serial#, mac addresses, etc) in Type-Length-Value fields, as well as their own extensions if they want. These tables are common, but there is currently no shared decoding logic, each provider maintaining its own internally. I am currently looking for upstreaming an nvmem layout driver for exposing the standard nvmem cells. This way, Ethernet drivers might eg. take the base MAC address from there. But I feel like there is something missing, because the vendor name, the device version, the serial number or any other information available in these tables might also very well be used by the userspace rather than the kernel drivers only. Thus, I was wondering if there was some ongoing work to make these cells available to userspace (in /sys maybe?) or if this had already been discussed somewhere. Otherwise, would you be open to such a contribution? I guess it would also be a useful debug tool anyway (and might very well be moved somewhere else than in /sys). Thanks for your time, Miqu=C3=A8l