Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp13366770pxu; Sun, 3 Jan 2021 11:57:39 -0800 (PST) X-Google-Smtp-Source: ABdhPJyr0OFIzjToo7OFB8i9eEhgqCvpuk51No3h76sWGg5+/V9p4zTtdVT4iO213Lvb9/N8rKKM X-Received: by 2002:a05:6402:1386:: with SMTP id b6mr14667685edv.42.1609703859571; Sun, 03 Jan 2021 11:57:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609703859; cv=none; d=google.com; s=arc-20160816; b=iR7137XsHB5Nhu/wqmQRnLAF2b5SdHJb85zNR1nt1cZiQhtLna6CjMfP939KK5CQ4G wAQWKGP3l6GsrCYKznWzo0aMmc1bnPqL2CuzrSycuo8Sv6p9+mRdcQqV3ngsyY0/kmQi lf//EAl73yj7o42srWsLupvzZDx3uZHi23kNr5ET3/BQMMT7WCnTR0r1hU8tBqAKSI26 ukQNSuNaPKrZQCSE2brk7V2j0BMKnMRmkboj+rhUXOwyrXeJFwnXKw2vwQeMkdZ9PGJt k5MBigDKwDoj2mHBTRJuV/rcWYWGqdgWL5vyOo+rS7UzibKa91rp5OIo/gYldrb8GAzI Rj/w== 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=MLD+EZewrLbaWCLExHGTczXjOb1vPGkfTuYMAwGL1ik=; b=sbdmCqsZEiTSSyx8X4iO9x1vq5t5XuaDtv01XYLIQCBos/BcmCDAgmnJ7DgB5yqirQ 26tBWahO7IccF+rvB9yYA8s9eAxT8W8xanuEPstytxzaTnCOBo7P5GTeaPzuSWMS1hAC 6vRv1jQlfFzt3wts3i4psPg0EBY+eo2yO8/3To/2yWtfTQkY4EqPtfxXtmnxW5KfskiI RkGFs6p47ky/637Yi+/OsxaZQz28tJzdMSQ+lMXhclNtJWV9zzMGWrJXI+VFlZ19RWzi BnmI6C+CqcW362X5sWKz0S385dBojkgPXhfeZT0tS0DxrRu1xl/ZXLFEnBPWI2W/NWGq YJgw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c6si14014471ejb.666.2021.01.03.11.57.16; Sun, 03 Jan 2021 11:57:39 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726163AbhACQRS (ORCPT + 99 others); Sun, 3 Jan 2021 11:17:18 -0500 Received: from mail-io1-f44.google.com ([209.85.166.44]:36612 "EHLO mail-io1-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726008AbhACQRR (ORCPT ); Sun, 3 Jan 2021 11:17:17 -0500 Received: by mail-io1-f44.google.com with SMTP id u26so20150783iof.3; Sun, 03 Jan 2021 08:17:02 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=MLD+EZewrLbaWCLExHGTczXjOb1vPGkfTuYMAwGL1ik=; b=ZOahjPbmJ0byghcRAsrXNFU7adn5H/Hf0dgOhGOBKlwPVCUUj8Pa7pkyX4hu1hs3Yh Ckso3uXxHKUJ6nV43CVnI2ZspTX9Tjg6yok6dle1+7t9/98jiasA05Tb0uGg58+JLjn0 +17wba2grRjlgUfkcm8B1Tag6qva2bUPrrT2jMQfHtzq0hLirt1UZOiHNqZdMuUiN+Fx bPY7KZlvOck9USWyXkV6gEGM840MOff1p5a3DYynYtcvs9d3H0IHQCGYCjg8kUBtnUaL lreXYKSsw/9T3ajNQhKEna5u3gLy9ahRRKCZb/cDA8cZXOq4rK8TRqmYg7xAVOqTYDx2 MK9w== X-Gm-Message-State: AOAM531jRO0wXLe4OdcnTEUhHNM8/T4+hciep2SesqQvefhPP1hgSn/D 3I633NJhfKZvUewcdd7iUg== X-Received: by 2002:a02:ce2c:: with SMTP id v12mr58941999jar.60.1609690596661; Sun, 03 Jan 2021 08:16:36 -0800 (PST) Received: from robh.at.kernel.org ([64.188.179.253]) by smtp.gmail.com with ESMTPSA id e1sm41109004iod.17.2021.01.03.08.16.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 03 Jan 2021 08:16:35 -0800 (PST) Received: (nullmailer pid 3960611 invoked by uid 1000); Sun, 03 Jan 2021 16:16:32 -0000 Date: Sun, 3 Jan 2021 09:16:32 -0700 From: Rob Herring To: Nicolas Saenz Julienne Cc: linux-kernel@vger.kernel.org, phil@raspberrypi.com, tim.gover@raspberrypi.com, catalin.marinas@arm.com, srinivas.kandagatla@linaro.org, devicetree@vger.kernel.org, linux-rpi-kernel@lists.infradead.org, Frank Rowand , linux@armlinux.org.uk, bcm-kernel-feedback-list@broadcom.com, linux-arm-kernel@lists.infradead.org, Rob Herring , will@kernel.org Subject: Re: [PATCH v2 2/5] nvmem: Add driver to expose reserved memory as nvmem Message-ID: <20210103161632.GA3960550@robh.at.kernel.org> References: <20201218154320.28368-1-nsaenzjulienne@suse.de> <20201218154320.28368-3-nsaenzjulienne@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201218154320.28368-3-nsaenzjulienne@suse.de> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 18 Dec 2020 16:43:17 +0100, Nicolas Saenz Julienne wrote: > Firmware/co-processors might use reserved memory areas in order to pass > data stemming from an nvmem device otherwise non accessible to Linux. > For example an EEPROM memory only physically accessible to firmware, or > data only accessible early at boot time. > > In order to expose this data to other drivers and user-space, the driver > models the reserved memory area as an nvmem device. > > Signed-off-by: Nicolas Saenz Julienne > > --- > > Changes since v1: > - Remove reserved memory phandle indirection by directly creating a > platform device from the reserved memory DT node > - Only map memory upon reading it to avoid corruption > - Small cosmetic cleanups > > drivers/nvmem/Kconfig | 8 ++++ > drivers/nvmem/Makefile | 2 + > drivers/nvmem/rmem.c | 97 ++++++++++++++++++++++++++++++++++++++++++ > drivers/of/platform.c | 1 + > 4 files changed, 108 insertions(+) > create mode 100644 drivers/nvmem/rmem.c > Reviewed-by: Rob Herring