Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp692993lqp; Thu, 21 Mar 2024 12:33:24 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVOnSLrl7KMT4MptqhZhXxSwFAyYFdwpQU/fBzut/T9/BguDGzpwGhoWcpxHUz408gKrTSCs9mzok82H0k5QjhcvC5UJVLOOtHbViskIg== X-Google-Smtp-Source: AGHT+IGLnz/FWqcTRH/JQ01ScBc9k19WuVOnvEPT8yEKxDQw9jPz+Qntx8FuqWnS/bw9atAYvh+o X-Received: by 2002:a05:6a20:9150:b0:1a3:6954:77d2 with SMTP id x16-20020a056a20915000b001a3695477d2mr635300pzc.31.1711049604165; Thu, 21 Mar 2024 12:33:24 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711049604; cv=pass; d=google.com; s=arc-20160816; b=LccqRFOPTkXvi6559FaS7F4Oe35b3tcgDFcUgsxdig6HZo/FJD6bQyOrNaUstDum4g fsT6B7LJWEGJUQ57Yh7PgM1t1Xwd7Bz8x9fFP5dm8F+Ya2C5TLpVPfI3jKm7/nMJ1NZo XgOKuqNZiDVg+rmnRSKUA59JI1jWwHAr+wupoWgzITOfBYqyjH0F4XQGztJKvn28OCAb 6l6nWWMt11T5VvT6qC1pWcN8samqfogVpfvHvF3/3k6lMceWjz5XPRsSFxiKIiHWcnzt Pn1NTaidTHN068v/k0iUBdGL0XSdja9JuiNn04n343Mn2XlCJL5a8JS6mHCAICGwryw8 SJ4A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-disposition:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:message-id:subject:to:from:date; bh=37toe54xUi+EmXz1mefy19Cw2lO5jIUlC2ans4zVroE=; fh=3Ay0fG3swzXuvpLryN6GcJlSn7kOqPZ2vxPz4z4ZjiM=; b=jtbDqkdZcvsNqg27xI2bISqFa001lD/qqm9hXiDgTCIJCxb8vk3jeB4I0bAMrmQE2Q weDzaFnJyTkse2JhCOxQuTfZoZ/5TuIQTpcHSQbKirCez7Z5wr+qK01wzjRWStQurRLW 9uGwsCD8wvaL5IqVvqsElcIcguAhrjYGgM+jxso0nnfjQxfuQUOgjNu+dObRwQ1JzEyR CuKwWQcbDk/gzy2mya1iY0ivoBSLBsQWTlp2mWjfdmLBgYb5gYmu2PvMrVi8NU3YIYKs RW19vsUUqm5LMrbLeRyLWR6vb0VVPBOOnnMdYvrSOvT+qZcBCIxRUUNVGK8pEehML+qV Usxw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=makrotopia.org); spf=pass (google.com: domain of linux-kernel+bounces-110590-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-110590-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id g23-20020aa78757000000b006e6fdb8f0b5si306811pfo.265.2024.03.21.12.33.23 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Mar 2024 12:33:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-110590-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=makrotopia.org); spf=pass (google.com: domain of linux-kernel+bounces-110590-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-110590-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 916E3283F1F for ; Thu, 21 Mar 2024 19:33:23 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id F0503134430; Thu, 21 Mar 2024 19:33:14 +0000 (UTC) Received: from pidgin.makrotopia.org (pidgin.makrotopia.org [185.142.180.65]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 53A58133422; Thu, 21 Mar 2024 19:33:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.142.180.65 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711049594; cv=none; b=ryITxzUdfJx3jeZCe/RC6Kck6UZqYgN+XucNGrEIWcMmlS6sWxhcmB30e+la5gtnDx+o8+ahCBDkpQypaX8cccQddqiXJghs+RhumizlI84ycFbmIQFO/4jAEXVfGwM+p8dXaaXuOQkeMy50SfQFDuZ5i/u2I802ex9mDiEqjIc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711049594; c=relaxed/simple; bh=xXa4FF7nQG3CwW6ptYwxB1tD6/Yh0AKEy2Pi0Dfq8GU=; h=Date:From:To:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition; b=ANwf1zngs/Np/yvc7/UYXQjVhFuisgFIbZ+AVgckrIixMgkQsDmQ9pj860Ma0DuRMPzkkxjhF4uvAnOXfbkyJstOP5YmDc1fC6mTTjuHVB2CZqxiGfZGtXBgKVDwhCaPCIojrQVeC1t+5qpcJMqbvNwh2TkgjDG5C2/3W+/1U+Y= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=makrotopia.org; spf=pass smtp.mailfrom=makrotopia.org; arc=none smtp.client-ip=185.142.180.65 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=makrotopia.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=makrotopia.org Received: from local by pidgin.makrotopia.org with esmtpsa (TLS1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.96.2) (envelope-from ) id 1rnO9R-0000Cf-2Z; Thu, 21 Mar 2024 19:32:33 +0000 Date: Thu, 21 Mar 2024 19:31:48 +0000 From: Daniel Golle To: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Ulf Hansson , Jens Axboe , Daniel Golle , Dave Chinner , Jan Kara , Thomas =?iso-8859-1?Q?Wei=DFschuh?= , Damien Le Moal , Li Lingfeng , Christian Brauner , Christian Heusel , Min Li , Adrian Hunter , Avri Altman , Hannes Reinecke , Christian Loehle , Bean Huo , Yeqi Fu , Victor Shih , Christophe JAILLET , Dominique Martinet , "Ricardo B. Marliere" , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mmc@vger.kernel.org, linux-block@vger.kernel.org Subject: [PATCH 0/8] block: implement NVMEM provider Message-ID: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On embedded devices using an eMMC it is common that one or more (hw/sw) partitions on the eMMC are used to store MAC addresses and Wi-Fi calibration EEPROM data. Implement an NVMEM provider backed by a block device as typically the NVMEM framework is used to have kernel drivers read and use binary data from EEPROMs, efuses, flash memory (MTD), ... In order to be able to reference hardware partitions on an eMMC, add code to bind each hardware partition to a specific firmware subnode. Overall, this enables uniform handling across practially all flash storage types used for this purpose (MTD, UBI, and now also MMC). As part of this series it was necessary to define a device tree schema for block devices and partitions on them, which (similar to how it now works also for UBI volumes) can be matched by one or more properties. --- This series has previously been submitted as RFC on July 19th 2023[1] and most of the basic idea did not change since. Another round of RFC was submitted on March 5th 2024[2] which has received overall positive feedback and only minor corrections have been done since (see changelog below). [1]: https://patchwork.kernel.org/project/linux-block/list/?series=767565 [2]: https://patchwork.kernel.org/project/linux-block/list/?series=832705 Changes since RFC: * Use 'partuuid' instead of reserved 'uuid' keyword to match against PARTUUID. * Simplify blk_nvmem_init(void) function. Daniel Golle (8): dt-bindings: block: add basic bindings for block devices block: partitions: populate fwnode block: add new genhd flag GENHD_FL_NVMEM block: implement NVMEM provider dt-bindings: mmc: mmc-card: add block device nodes mmc: core: set card fwnode_handle mmc: block: set fwnode of disk devices mmc: block: set GENHD_FL_NVMEM .../bindings/block/block-device.yaml | 22 +++ .../devicetree/bindings/block/partition.yaml | 51 ++++++ .../devicetree/bindings/block/partitions.yaml | 20 +++ .../devicetree/bindings/mmc/mmc-card.yaml | 45 +++++ MAINTAINERS | 5 + block/Kconfig | 9 + block/Makefile | 1 + block/blk-nvmem.c | 169 ++++++++++++++++++ block/partitions/core.c | 41 +++++ drivers/mmc/core/block.c | 8 + drivers/mmc/core/bus.c | 2 + include/linux/blkdev.h | 2 + 12 files changed, 375 insertions(+) create mode 100644 Documentation/devicetree/bindings/block/block-device.yaml create mode 100644 Documentation/devicetree/bindings/block/partition.yaml create mode 100644 Documentation/devicetree/bindings/block/partitions.yaml create mode 100644 block/blk-nvmem.c -- 2.44.0