From patchwork Fri Oct 28 09:23:32 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Miquel Raynal X-Patchwork-Id: 13023246 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 27FDEFA3744 for ; Fri, 28 Oct 2022 09:23:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229786AbiJ1JXp (ORCPT ); Fri, 28 Oct 2022 05:23:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34982 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229665AbiJ1JXo (ORCPT ); Fri, 28 Oct 2022 05:23:44 -0400 Received: from relay11.mail.gandi.net (relay11.mail.gandi.net [IPv6:2001:4b98:dc4:8::231]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 883D11C5A44; Fri, 28 Oct 2022 02:23:41 -0700 (PDT) Received: (Authenticated sender: miquel.raynal@bootlin.com) by mail.gandi.net (Postfix) with ESMTPSA id C85B6100002; Fri, 28 Oct 2022 09:23:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1666949020; 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=Jww1jZHfX37j9j9H8HluQYHHsI/avrLn3u/se6AG/Gc=; b=oejV7wmBrFRUuBlrdDVx4138UjHAHRkm/brCmKzw+/i++jYWUv0oaU3C6oQr4l49+Q9+gA RGwqml+sRlTfQ5CFPb75SNz+tITOGVfSknavoJ8BHUHAEynoYIiFfXnBh2woug+Q4R/Fpw RvQCVDnr2OReCrT8OnBqMVaXuqLu8d+R1BfJa1EfhY3xW4eRUg83+X4bx/rTlvr+HZttMr /R0ndw844/qpgphcLtJpdnycVJ3fb4TemK2qYFkbY4L8QZ24UdU77JoldelLwfS3eNI7oF qx6q+rLhRx0atS7QJBr74ATmcJoAOYFH7tLsiRwG5hSvrX2pdLjkV9xFhQpclA== From: Miquel Raynal To: Srinivas Kandagatla , , Rob Herring , Krzysztof Kozlowski , devicetree@vger.kernel.org Cc: Marcin Wojtas , Russell King , Maxime Chevallier , "David S. Miller" , Jakub Kicinski , Paolo Abeni , Eric Dumazet , netdev@vger.kernel.org, Robert Marko , Thomas Petazzoni , Michael Walle , Miquel Raynal Subject: [PATCH 0/5] ONIE tlv nvmem layout support Date: Fri, 28 Oct 2022 11:23:32 +0200 Message-Id: <20221028092337.822840-1-miquel.raynal@bootlin.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Hello, Here is a series bringing support for an NVMEM layout parser. The table that will get processed has been standardized by the ONIE project [1] and its content is highly dependent on the manufacturer choices. There is a dedicated process to read it, but in no case we can define the nvmem cells location/length statically in the DT like other NVMEM cells. Instead, we need what the "layout" abstraction proposed here [2] brings: a dynamic way to find and export NVMEM cells. So this series is actually dependent on [2] and cannot be merged without it. The mvpp2 patch is an example of use which was useful to me during my test runs, so I figured out it might make sense to upstream it. I am not 100% convinced this is the right way so reviews there are welcome. [1] https://opencomputeproject.github.io/onie/design-spec/hw_requirements.html [2] https://lore.kernel.org/linux-arm-kernel/20220921115813.208ff789@xps-13/T/ Cheers, Miquèl Miquel Raynal (5): dt-bindings: vendor-prefixes: Add ONIE dt-bindings: nvmem: add YAML schema for the ONIE tlv layout nvmem: layouts: Add ONIE tlv layout driver MAINTAINERS: Add myself as ONIE tlv NVMEM layout maintainer net: mvpp2: Consider NVMEM cells as possible MAC address source .../nvmem/layouts/onie,tlv-layout.yaml | 96 +++++++ .../devicetree/bindings/vendor-prefixes.yaml | 2 + MAINTAINERS | 6 + .../net/ethernet/marvell/mvpp2/mvpp2_main.c | 6 + drivers/nvmem/layouts/Kconfig | 9 + drivers/nvmem/layouts/Makefile | 1 + drivers/nvmem/layouts/onie-tlv.c | 240 ++++++++++++++++++ 7 files changed, 360 insertions(+) create mode 100644 Documentation/devicetree/bindings/nvmem/layouts/onie,tlv-layout.yaml create mode 100644 drivers/nvmem/layouts/onie-tlv.c