From patchwork Fri Dec 18 15:43:15 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Saenz Julienne X-Patchwork-Id: 11982555 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=-11.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT 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 0C50EC4361B for ; Fri, 18 Dec 2020 17:19:22 +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 BF54523B53 for ; Fri, 18 Dec 2020 17:19:21 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BF54523B53 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de 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:MIME-Version:Message-Id:Date:Subject:To:From: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=XBIzUqM6PnFlqED2bNrLZwd+kdmNVt4bsltm7Y8lHwc=; b=KF1NYXD3lQT1BcfFiswaKEUy1O W7Udz+KQQRmwA4kh7udw8j6Z3/BnRbkeT0NGC3Qup5VeNzWZnvF6qowNiNd6HQd9MwF5n8i8w0/2J UaXrFV2SYHR8voKNb55tE3oH00kbWk2KrMINMXgigeiz47erifmMAxm0FegAJGfIVp76Nbp43kDED rBIDseyrdmRrsaujveJwke7WLPAnAPf8RxFo2bbci3WLE2xDtN2J84eso0FPM+tgIDhyldGCZrHcB Bl6kEotpvxjkoPNaIR7Oz/fvBkjfCcN+uIUMvC/VN6iQf5P9PTNA8KBnmR/mo8LZ8JikK9w5Vfmza 2+r8Xk5g==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kqJH6-0002kb-Aj; Fri, 18 Dec 2020 17:10:49 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kqJ54-0001CJ-Hd; Fri, 18 Dec 2020 16:58:24 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:In-Reply-To:References; bh=kOMOkK7qxw6jnM1tmnn/sRkGhdjpSi8dC+PnIDEqy/0=; b=MLOArqkoIVEqxs3cesFMQ8kWUv /XvC0tpikkPkTgeBVqTeq2gvjdPRNIRRAfMShIZRL7XBrTpbQIiEmIyq0y/2cAPNSTM/g+nJpO0Oa J6/fxqEUf5eBr29Ix9ZvaXPUq79JMnNSyioY8I3zjb2Xyh33oBBltQOiT4XgnOlZkweFcqnKWn9yw huXp6Gi+2kqd8y86SqCn45ljEYLyjjKMqwrX3geWsYipbsPHlX90UoizJeujJl5HUPxDFySrZgZoY dIWWKBJJr503JOyRmAvG2rjkkAeSQ0lKDppPO36eQ8VEjGbhciP3sN2HHTfd5oHKhEJzUa8PkeMeA /DHp/r2Q==; Received: from mx2.suse.de ([195.135.220.15]) by casper.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kqHus-00023Y-4D; Fri, 18 Dec 2020 15:43:42 +0000 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 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201218_154338_358058_5DAE8400 X-CRM114-Status: GOOD ( 10.69 ) 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@armlinux.org.uk, robh+dt@kernel.org, bcm-kernel-feedback-list@broadcom.com, linux-arm-kernel@lists.infradead.org, will@kernel.org, phil@raspberrypi.com, nsaenzjulienne@suse.de, linux-rpi-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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