Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp2200040pxu; Fri, 18 Dec 2020 07:45:14 -0800 (PST) X-Google-Smtp-Source: ABdhPJzMMN3QA3vbC6E0z54+HJxwh4GvfQ2+56V5WWmSPjekqDjqqPoCbL04pWGSvfugZhi1hqLB X-Received: by 2002:a17:906:22c7:: with SMTP id q7mr4685181eja.486.1608306313849; Fri, 18 Dec 2020 07:45:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608306313; cv=none; d=google.com; s=arc-20160816; b=Y9bcUjhDNfUxBEewWPCeuYYedIBW5i8J7BuTWFnaassCAHfbSwNk0DgqQc6cRJsnKj rXs6sJJTs6YzJz/Kv9qbrsl1UrpPAZeV1P1MvQTCxFQDmOGuHstLJwh7i1kbu1V8zTsJ 1K+KamVt9bhxXLNqaxZoU5AYRQoTlNEDopJrAEV29S9PuXzHkg9sXSHECy4faD9SpyIF I3Ms3WrmtwPtDyb2A18dwWzOPrCNKxuiuNFsOUwx8ABWgrWUAOovO1vKai12aWS5UjRW uQI1DMQi1Z5LvpxvU8upS5hm5Udexte3PuMD62LyO6UzDVLWKa5g7AO5lblVwmfGhEpU 1Yww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=kOMOkK7qxw6jnM1tmnn/sRkGhdjpSi8dC+PnIDEqy/0=; b=aX0QpZ5P/f2359YXolkFNMPymOag3QrHyRGS0VFckOu8qoQzJc08+M7pRk50Z+nbDB 6W9vUHirSb9psqNrwqTIugepR12ppHM11Sk77hA595m9Z12K6RSRof3kVveogTAfata/ 1Xam7WjzZp7iTAXzwL9Rraaj0bQVF+1XfBMFSmM7tMHO4XBdw+9pLpzJKFzuWpR9ByVF SUr8YKojZyRS+BforXf8ZMubvFENqC+0BJ+ev7eogjAdkyiYfTHY6iZDhynPuo7PE1o/ hBd15PEC7UIzzy95/H96OHO8qAXv5MqKHxOJ1OhR2HR2wPzGFrO8h8QeMArVrbkkS7eJ ap5A== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i12si6263438edr.321.2020.12.18.07.44.50; Fri, 18 Dec 2020 07:45:13 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728272AbgLRPoS (ORCPT + 99 others); Fri, 18 Dec 2020 10:44:18 -0500 Received: from mx2.suse.de ([195.135.220.15]:43010 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726264AbgLRPoS (ORCPT ); Fri, 18 Dec 2020 10:44:18 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 81E22AD09; Fri, 18 Dec 2020 15:43:35 +0000 (UTC) From: Nicolas Saenz Julienne To: srinivas.kandagatla@linaro.org, linux-kernel@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org, linux@armlinux.org.uk, nsaenzjulienne@suse.de, catalin.marinas@arm.com, will@kernel.org, devicetree@vger.kernel.org, linux-rpi-kernel@lists.infradead.org, robh+dt@kernel.org, bcm-kernel-feedback-list@broadcom.com, tim.gover@raspberrypi.com, phil@raspberrypi.com Subject: [PATCH v2 0/5] Expose RPi4's bootloader configuration Date: Fri, 18 Dec 2020 16:43:15 +0100 Message-Id: <20201218154320.28368-1-nsaenzjulienne@suse.de> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Soon to be released versions of RPi4's firmware will take of care passing their bootloader's configuration[1] to the OS by copying it into memory and creating a reserved memory node in the board's DT. By modeling this reserved memory node as an nvmem device using 'nvmem-rmem', which this series introduces, user-space applications will be able to query this information through nvmem's sysfs interface. An alternative approach, less nice IMO, would be to create a platform-specific 'soc' driver. Regards, Nicolas [1] https://www.raspberrypi.org/documentation/hardware/raspberrypi/bcm2711_bootloader_config.md --- Changes since v1: - Avoid the reserved-memory indirection by integrating the nvmem driver into the reserved memory node. Nicolas Saenz Julienne (5): dt-bindings: nvmem: Add bindings for rmem driver nvmem: Add driver to expose reserved memory as nvmem ARM: dts: bcm2711: Add reserved memory template to hold firmware configuration arm64: defconfig: Enable nvmem's rmem driver ARM: multi_v7_defconfig: Enable nvmem's rmem driver .../devicetree/bindings/nvmem/rmem.yaml | 49 ++++++++++ arch/arm/boot/dts/bcm2711-rpi-4-b.dts | 17 ++++ arch/arm/configs/multi_v7_defconfig | 1 + arch/arm64/configs/defconfig | 1 + drivers/nvmem/Kconfig | 8 ++ drivers/nvmem/Makefile | 2 + drivers/nvmem/rmem.c | 97 +++++++++++++++++++ drivers/of/platform.c | 1 + 8 files changed, 176 insertions(+) create mode 100644 Documentation/devicetree/bindings/nvmem/rmem.yaml create mode 100644 drivers/nvmem/rmem.c -- 2.29.2