Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp3102086pxb; Tue, 12 Jan 2021 06:28:32 -0800 (PST) X-Google-Smtp-Source: ABdhPJxnPy28Yza15jDzl8MzYl8aU8GjFWEoNM5a/4sI8rkUAooBmPHvm5ddQRbnKPkcewsm4ZJ2 X-Received: by 2002:a17:906:3b4d:: with SMTP id h13mr3396834ejf.289.1610461712492; Tue, 12 Jan 2021 06:28:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610461712; cv=none; d=google.com; s=arc-20160816; b=ZI3v8uHb8cIj43n6Gvz8N5Y5GkehDSgtORdcKjKorrvS/OgBCkxqSASixONzAjZYyb 5TjeGhZ7d5xeO+gEmZurYjJS4PV57p5+nq/vqillsW/Rfrx7qvzxRS2yhxg2NiHjukeZ i1p9kALzUX0Q8ruMPuyKt0AYctS1ZjCx2vxK8vSi5sMBBH4X7DzzLnO8y01nRkk3/4CS 0L7v18fSKeqqBG3YUXch6YhwK8qiUt0txGgf/FuJ73GwOMzeWrb7bgj9SuiYtcs08xNC v0xd3vMImBksX/UK3qAO3jgfmP152fg44IeD6PbajqASXD1av8BCYL+WxiLHS8/mk0v0 XpoA== 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=sNzP2ReD9Nzv/uNjo6hHA+SWTcihhej3LbltxFrVFtI=; b=fqAUzJpyIJtRzUnoQjKKChEJAS9KXB7wESm0eFF8aUf4WXiffVpWsAqllkY6/v+5o3 EugChwS/Nj7CZcxkV1cVfjKOVF9vq9B55I81u/qrfTWKuPMbFvE4hS5AQMqiazrUVWFT QafsonBdaZwuND9dHFQVlHko6T1CwBvcFaicufZ3D2E2gd24iSigrd4/5lbrVmcaj3v+ cFVJOHjrokUHmn6kifMp2dUPT0JILJz4RcyG0+ogneENK0BT3N/xTSakfHONLqihJhNT hQQAsq/zt+z71hsAir+9b8IsMSz6EoqRN4cW5d66+TE7NsJY0OA7hfcA5tVQ3TOF8uk6 EJrQ== 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 y15si1542451edv.392.2021.01.12.06.28.08; Tue, 12 Jan 2021 06:28:32 -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 S1730433AbhALOYj (ORCPT + 99 others); Tue, 12 Jan 2021 09:24:39 -0500 Received: from mx2.suse.de ([195.135.220.15]:57992 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725901AbhALOYi (ORCPT ); Tue, 12 Jan 2021 09:24:38 -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 EEA34AC8F; Tue, 12 Jan 2021 14:23:56 +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 v3 0/5] Expose RPi4's bootloader configuration Date: Tue, 12 Jan 2021 15:23:37 +0100 Message-Id: <20210112142342.7290-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 v2: - Fix DT bingins 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