Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp8756645rwp; Wed, 19 Jul 2023 15:05:03 -0700 (PDT) X-Google-Smtp-Source: APBJJlGqe9Va8DGcLvMwwmsGURfPOyAX1Vv0nlp+NSAfobkKhwW9nRql3fZnQJMf+uh6ZeD0t1yH X-Received: by 2002:a17:90b:4b92:b0:25e:a1ae:16c6 with SMTP id lr18-20020a17090b4b9200b0025ea1ae16c6mr4694779pjb.27.1689804303086; Wed, 19 Jul 2023 15:05:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689804303; cv=none; d=google.com; s=arc-20160816; b=kFt8u0Olm11oSnthk/CLNKEXm5M0mv4qSKjcNTccM/aOmxHdtK9TCg424fVrscttvC MaH/U0yuDLH/28s0NCVEUTNfdogb+xYY55/dGtSG9O3fjIvWuW3CNvQJ50kZ/cOWTnO6 VaxUWjx/ILBf1Z/dUS1jagkt0xC6t9beEX9yjawxJa49si3UOKnfIv7KpWx6Iz2+SBPT ZYcg71XITxu/HJLTunZYhtvoKb54u17vZxYWN/+xXECbjc71b7sci0sPf8KPcQsr4Jah mnQYLbjkoF2znRLubWN5PnyldCUSY07FTtbODRwa4sW9NkRkm+fwH55CuNnUscQr5Xc/ euCQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-disposition:mime-version:message-id :subject:to:from:date; bh=1jHoPKWH5183iKhqDoCc8IV5GoV/VP6WA3RdCVqakic=; fh=O/hjEvlM0nIN8LC6WbIQ4s0L6nmnRMOzajXXMF81As0=; b=Qw5J/2+LRksXFNGqnkE8xrkzwA13fsNmXNaJzT8zs6PXr/lWuIGUPx97cp6ysWWyJo r+UCNaEJNy2pj/fFbLvUECZQa3U3nem0MLtYyFTbwlzrH4KX0Q5aLqMpgDkFTen9Ulel 0nU9R4cznoSgzBsGdxRzHaaming3vfsXn6vSdJBD1hleSrS65s0k2377ZdGWtMJclZOb gHFzoMDr3CV76xrV/BoNLoBtFoJm2y5u05/40hfMpoAFrnw2uNm9gUAxYlJcotEPcRyX vr7abTDvd8a6LJhoMA7nImpkKqQpwhM86bntLeKMK4WmqQMDHZbiBjMdB7R9Oi/Lsz1/ UVBQ== 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 fw1-20020a17090b128100b0025c1af5672fsi2092967pjb.112.2023.07.19.15.04.45; Wed, 19 Jul 2023 15:05:03 -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 S230013AbjGSWCr (ORCPT + 99 others); Wed, 19 Jul 2023 18:02:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42326 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229503AbjGSWCq (ORCPT ); Wed, 19 Jul 2023 18:02:46 -0400 Received: from pidgin.makrotopia.org (pidgin.makrotopia.org [185.142.180.65]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 86AFB199A; Wed, 19 Jul 2023 15:02:43 -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 1qMFEZ-0008I7-1O; Wed, 19 Jul 2023 22:01:23 +0000 Date: Wed, 19 Jul 2023 23:01:14 +0100 From: Daniel Golle To: Jens Axboe , Ulf Hansson , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , Dave Chinner , Matthew Wilcox , Thomas =?iso-8859-1?Q?Wei=DFschuh?= , Jan Kara , Daniel Golle , Damien Le Moal , Ming Lei , Min Li , Christian Loehle , Adrian Hunter , Hannes Reinecke , Jack Wang , Florian Fainelli , Yeqi Fu , Avri Altman , Hans de Goede , Ye Bin , Greg Kroah-Hartman , =?utf-8?B?UmFmYcWCIE1pxYJlY2tp?= , linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mmc@vger.kernel.org, linux-mtd@lists.infradead.org Subject: [RFC PATCH 0/6] nvmem: add block device NVMEM provider Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 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 block devices 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. This series is meant to open the discussion on how exactly the device tree schema for block devices and partitions may look like, and even if using the block layer to back the NVMEM device is at all the way to go -- to me it seemed to be a good solution because it will be reuable e.g. for NVMe. Daniel Golle (6): mmc: core: set card fwnode_handle mmc: block: set fwnode of disk devices block: add new genhd flag GENHD_FL_NO_NVMEM mtd: blkdevs: set GENHD_FL_NO_NVMEM mtd: ubi: block: set GENHD_FL_NO_NVMEM block: implement NVMEM provider block/Kconfig | 8 ++ block/Makefile | 1 + block/blk-nvmem.c | 187 ++++++++++++++++++++++++++++++++++++++ block/blk.h | 13 +++ block/genhd.c | 2 + block/partitions/core.c | 2 + drivers/mmc/core/block.c | 8 ++ drivers/mmc/core/bus.c | 2 + drivers/mtd/mtd_blkdevs.c | 1 + drivers/mtd/ubi/block.c | 2 +- include/linux/blkdev.h | 3 + 11 files changed, 228 insertions(+), 1 deletion(-) create mode 100644 block/blk-nvmem.c -- 2.41.0