Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp1374706pxv; Fri, 23 Jul 2021 06:56:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzwkPg13U1L3AAaFr0njW7HYTIGUgP+o0GENUISumXd0Lz7uUSg2dzgnjikbFlDZeHbClIs X-Received: by 2002:a05:6602:3404:: with SMTP id n4mr4208914ioz.31.1627048609485; Fri, 23 Jul 2021 06:56:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627048609; cv=none; d=google.com; s=arc-20160816; b=Gk2xOPuv9+CamGyngx3OcPIi3bIE+MweKoZESEFgaCkeMapVfLc2zPxk90+WQt0++c 1YC+GXQvDbWadt1idEybhEbL3xNM9tpl8FJEmqMMCMRDWQF+At0sARqUDfq4u3BZO1EY ZrI9lCjId36ZVmUI2IwBUk0+nadZ1StfWUE87yV+8efabDN8QnQOlDMUn0fbRHcdWyd0 yGoTRVuPnLaIFpE/IT6CsH60DEzOHcpB6FR+InHbF/Uk37R+vjmjAz09CUW1AE7tus5D 0YgUGS4wrH/kRIKnnf/eTu9SLl5KFTRjg28FP++VzVCWB1Hug1vj50cuawbJg9Xt06lz jSjg== 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=4HKRP+1g/Uz5qG/OYGLABxe2PXM9qTkZaP8j9Bjz030=; b=fqb4pjNeFvffliWkWAqM2U6XVGZXn4rsCc4y1ct6OTZOeLQaNEZ74Gnv6wbf1dCU+i eaYV03iLadYwXTGpe1AETBkHZQOORselBTiwVBbrKpLA2Rs9P69bcPb67A5i1VbHymnv k+lWqtxkiqLCmki9Cq19znppDHZoDuTmZuaexF/UmQSONvIe6mGkbDcayVQdqDx5Dwjr QmPwLjOCS6ezhkWUyc3cuYNeXC5NMl5CMZe2w0E+YB5wtDzrgaWmPCxF4C4tjMygekM+ 8ymc7MyYYh0zyMnHCbGNAERA70Ib8kfgt5P0AvJZsuVCayxsQHMBwAfg3ZVRwThKYkD0 wdSw== 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 w12si6639915iox.55.2021.07.23.06.56.37; Fri, 23 Jul 2021 06:56:49 -0700 (PDT) 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 S235127AbhGWNPX (ORCPT + 99 others); Fri, 23 Jul 2021 09:15:23 -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