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=-11.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT autolearn=unavailable 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 B53BBC4320A for ; Fri, 23 Jul 2021 13:55:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9FC2560EBD for ; Fri, 23 Jul 2021 13:55:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235290AbhGWNPY (ORCPT ); Fri, 23 Jul 2021 09:15:24 -0400 Received: from relay8-d.mail.gandi.net ([217.70.183.201]:48395 "EHLO relay8-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233552AbhGWNPX (ORCPT ); Fri, 23 Jul 2021 09:15:23 -0400 Received: (Authenticated sender: clement.leger@bootlin.com) by relay8-d.mail.gandi.net (Postfix) with ESMTPSA id 4D9B11BF209; Fri, 23 Jul 2021 13:55:53 +0000 (UTC) From: =?UTF-8?q?Cl=C3=A9ment=20L=C3=A9ger?= To: Lee Jones , Rob Herring , Mark Brown , Greg Kroah-Hartman , "Rafael J. Wysocki" , Arnd Bergmann Cc: =?UTF-8?q?Cl=C3=A9ment=20L=C3=A9ger?= , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Peng Fan , Sudeep Holla , Alexandre Belloni Subject: [PATCH 0/3] add SMC based regmap driver for secure syscon access Date: Fri, 23 Jul 2021 15:52:36 +0200 Message-Id: <20210723135239.388325-1-clement.leger@bootlin.com> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When running under a secure monitor, some peripherals are setup as accessible by secure world only. When those peripherals are system controllers, they might need to be accessed by the normal world for some peripheral configuration. In order to keep the existing code working for such devices (which usually uses the regmap from a syscon), this series adds support for a regmap that uses SMCs (Secure Monitor Call) to request access to registers. The secure monitor will then catch these accesses and decide whether or not the normal world is allowed to access the requested register. As said, most drivers that needs access to registers that are shared in a system controller often uses syscon. Currently, syscon uses a regmap_mmio which allows to read and write registers using MMIO accesses. Support is added in this series to also support "syscon-smc" compatible which will use a SMC regmap instead of a MMIO one. Clément Léger (3): regmap: add regmap using ARM SMCCC syscon: add support for "syscon-smc" compatible dt-bindings: mfd: add "syscon-smc" YAML description .../devicetree/bindings/mfd/syscon-smc.yaml | 57 ++++++ drivers/base/regmap/Kconfig | 7 +- drivers/base/regmap/Makefile | 1 + drivers/base/regmap/regmap-smccc.c | 131 ++++++++++++++ drivers/mfd/syscon.c | 170 +++++++++++++++--- include/linux/regmap.h | 38 ++++ 6 files changed, 378 insertions(+), 26 deletions(-) create mode 100644 Documentation/devicetree/bindings/mfd/syscon-smc.yaml create mode 100644 drivers/base/regmap/regmap-smccc.c -- 2.32.0