From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2E19EC433E0 for ; Sun, 3 Jan 2021 16:17:57 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D5515208D5 for ; Sun, 3 Jan 2021 16:17:56 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D5515208D5 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=1FySFK1xjEsnpA6uNYUg9CPsN8A5DFQzTsGnyvnNd7k=; b=TqLW3UaY8W7si3InI9SrbMWsc uVFPp+Funo9ON4LWJfqGOGvcNL61b0Lk8TTb08xhtSzR4se26DZsfc3Ve2+57iVw53kgLJrK16RvM Ikn+4GinXL6k6G3hjZA+lMhdMrfNlJAEXljw/O38oFAwcozUy0cheMcFPyIVPxH/9M7G3/BXPsd7k WDMsOjlx2RFHK4nAlxO0VfATwUkTxq1G41bEd8hFAlmyzh3vb6OyeyBquNUEj6EFrwLG/K+6l4MKV WgKCjOPNdSfviICv0n8+Cvlf1tp5CBR8eYEHAnrlSyykz89ZOnzXbYhk2UAoR33GOzh3+crAOjeP+ vRp8qauvQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kw63d-00081P-FE; Sun, 03 Jan 2021 16:16:41 +0000 Received: from mail-io1-f45.google.com ([209.85.166.45]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kw63b-00080j-8J; Sun, 03 Jan 2021 16:16:40 +0000 Received: by mail-io1-f45.google.com with SMTP id t8so22843338iov.8; Sun, 03 Jan 2021 08:16:37 -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=AUmBOIeEwNTfu7w+PndvSi8DzfmVwytQKnRZbduBbPqHB5KeqwF0lw5MoYwLqDX3EU YAXa4WOv3HL0irhE9Rhh7vfMRkqjf4T/FRa0Qla8p77RHNf4EIKnKyM/beAZbbvMHa1k +4fHHMV+7Z27UYCrmqRqWfawPJ42ox/FZTJiuej5nstAw5Xurx8cdxdi4LDJiBYrYIxs ZIU4TGCDpW3v73XY+IZyNEmZOcUC/ufbdsaMyrSjslGpVIS988wCaaF6OH26BxfTDwLB h19gZDYQsk1Qt8QSV2DBb/OF9WimwG5iRRljdYFfZEfhbZxyPmXQBoePUiYNgtbDVIXS RrDg== X-Gm-Message-State: AOAM5323Finfjj8qdpV6Jj639leRHr4rbcZbEkDWWUG0Wyw4ABPHUHXw DWh4HlYjZR17npUh74PLVQ== X-Google-Smtp-Source: ABdhPJyc0JoUpUvR/zYc0zoCYmpZ4Vkk8wTWqUmP5uUOt5Kab8Ra0bY81Vs354t6bo5sZe5p64pKJg== 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 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-Disposition: inline In-Reply-To: <20201218154320.28368-3-nsaenzjulienne@suse.de> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210103_111639_321683_395B139E X-CRM114-Status: GOOD ( 14.44 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, tim.gover@raspberrypi.com, catalin.marinas@arm.com, linux-kernel@vger.kernel.org, linux@armlinux.org.uk, will@kernel.org, Rob Herring , srinivas.kandagatla@linaro.org, linux-rpi-kernel@lists.infradead.org, bcm-kernel-feedback-list@broadcom.com, Frank Rowand , phil@raspberrypi.com, linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.0 required=3.0 tests=BAYES_00,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 43A62C433E0 for ; Sun, 3 Jan 2021 16:17:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id F27F020B1F for ; Sun, 3 Jan 2021 16:17:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725889AbhACQRS (ORCPT ); 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-Google-Smtp-Source: ABdhPJyc0JoUpUvR/zYc0zoCYmpZ4Vkk8wTWqUmP5uUOt5Kab8Ra0bY81Vs354t6bo5sZe5p64pKJg== 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: devicetree@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