From patchwork Wed May 5 09:38:37 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sudeep Holla X-Patchwork-Id: 431158 Delivered-To: patch@linaro.org Received: by 2002:a02:c901:0:0:0:0:0 with SMTP id t1csp334840jao; Wed, 5 May 2021 02:38:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy0gduvEjndKtoWXBV34B1RX8tSJeqAkNgX5RtLJGg4O23RPGrrlNzqpdoPqcqpVSmTo/Qb X-Received: by 2002:a62:8c05:0:b029:290:81ab:a936 with SMTP id m5-20020a628c050000b029029081aba936mr1543770pfd.69.1620207537467; Wed, 05 May 2021 02:38:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620207537; cv=none; d=google.com; s=arc-20160816; b=hw+oMDudV6Asnu0x1Pezap65OtUWbxP1zWBHjpjViAPuErswgSxkzyMsAFheQH//k8 pYMC46UoHshgXnMU/KXxpLU2x3xaLH7X0ozg8UOVhs8ea+wStClRhb3qFSU6LX2ts7T3 V/vbVYJhTWHMUAjlMesud5OKCU9JMnmp7KYjaGLCtLWf7zx/qxCmMHW9lrdJWXKPgACp lKpApE5jhl+w9UNAn2hc9jzQ0Sz6jvq/hrvZkfy6BKNZ6ML8nk2gwd5tqAL0RcqhbPVO O/l8X44A/dx5Mu0BRZ10vwz6Kyj5ZoLdVxH0lH1rqNYjQYTD7itT2KXoZAl62JDgtqJ6 nXPg== 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=R/4+38ggkdcT1XN9PFF/Ltrq8IpDhL0XLmqtQo0qJjw=; b=YBHA8ZB29J19Coa8IfQ8f1dhjNYrdbfx9fxS58Y02q0Av3RooCcd2aWNesg8PGWW/v aZn1sYV6l6tKRnMoGX+rB/MCZWpsIB0Lt6o5sem3hd1t3H0G1hNtg9Qgq0jXZI2XGwMV kjEcYKeAUeeCbgqbRjju952bA31Q/R0EAkZtT/5KTK0FeY0WoobJCW057Cs5OkMp0tNN qpZdGXVri6mKntx4CdCr+4bhctHOg+OjVk9RdUsEPKVmKIbcdrTXTbd13m/yLh6X+BI9 /aoyZabuAYu33K+yh0t6lLIXRSlUNIDL9kW0grItEMM5FwxYWrJXllFAoMAmS48aufi2 mhpw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t9si7342964plz.70.2021.05.05.02.38.57; Wed, 05 May 2021 02:38:57 -0700 (PDT) Received-SPF: pass (google.com: domain of devicetree-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 devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232036AbhEEJjw (ORCPT + 6 others); Wed, 5 May 2021 05:39:52 -0400 Received: from foss.arm.com ([217.140.110.172]:41198 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232073AbhEEJjv (ORCPT ); Wed, 5 May 2021 05:39:51 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 7CE6BD6E; Wed, 5 May 2021 02:38:55 -0700 (PDT) Received: from usa.arm.com (e103737-lin.cambridge.arm.com [10.1.197.49]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 2A3EA3F70D; Wed, 5 May 2021 02:38:54 -0700 (PDT) From: Sudeep Holla To: linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org Cc: Sudeep Holla , arve@google.com, Andrew Walbran , David Hartley , Achin Gupta , Jens Wiklander , Arunachalam Ganapathy , Marc Bonnici Subject: [PATCH v6 0/6] firmware: Add initial support for Arm FF-A Date: Wed, 5 May 2021 10:38:37 +0100 Message-Id: <20210505093843.3308691-1-sudeep.holla@arm.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Hi all, This is very basic implementation for in-kernel support for Arm FF-A specification. Arm Firmware Framework for Armv8-A specification[1] describes a software architecture that provides mechanism to utilise the virtualization extension to isolate software images and describes interfaces that standardize communication between the various software images. This includes communication between images in the Secure and Normal world. The main idea here is to create FFA device to establish any communication with a secure partition. This is currently tested with OPTEE(with changes to OPTEE driver adding FFA as transport) The series can be fetched from [2] -- Regards, Sudeep [1] https://developer.arm.com/documentation/den0077/latest [2] git://git.kerniel.org/pub/scm/linux/kernel/git/sudeep.holla/linux.git v5.13/ffa v5->v6: - Dropped DT dependecy completely and use the discovery APIs for adding FFA partitions on the bus. They is some workaround added as v1.0 doesn't provide UUID as part of the discovery APIs which is used to match the devices and driver on FFA bus. - Extended SMCCC v1.2 API to support full set of input and output registers. - Couple of minor bug fixes found as part of testing v4->v5: - Fixed couple of comments in DT bindings - Moved to use native version of RXTX_MAP call, fixed vm_id param to RXTX_UNMAP, dropped couple of unused confusingly named macros (can be added back with correct name when we need to use them) v3->v4: - Added support to allow partitions to set 32bit only mode - Addressed all the comments from Jens Wiklander v2->v3: - Dropped hypervisor partitions and userspace support as it is no longer in the list of requirements - Moved away from ioctl style interface for in-kernel users as there is no need to keep in sync with userspace anymore - Some kerneldoc fixes as pointed out in earlier reviews v1->v2: - Moved userspace code to a separate unit, will move to separate module. Still working on minimizing initcall dependencies and exported functions to reuse some of the code. - Fixed couple of minor issues pointed out - Dropped ASYNC send message as I haven't been able to test Sudeep Holla (6): arm64: smccc: Add support for SMCCCv1.2 extended input/output registers firmware: arm_ffa: Add initial FFA bus support for device enumeration firmware: arm_ffa: Add initial Arm FFA driver support firmware: arm_ffa: Add support for SMCCC as transport to FFA driver firmware: arm_ffa: Setup in-kernel users of FFA partitions firmware: arm_ffa: Add support for MEM_* interfaces MAINTAINERS | 7 + arch/arm64/kernel/asm-offsets.c | 9 + arch/arm64/kernel/smccc-call.S | 57 +++ drivers/firmware/Kconfig | 1 + drivers/firmware/Makefile | 1 + drivers/firmware/arm_ffa/Kconfig | 21 + drivers/firmware/arm_ffa/Makefile | 6 + drivers/firmware/arm_ffa/bus.c | 210 +++++++++ drivers/firmware/arm_ffa/common.h | 31 ++ drivers/firmware/arm_ffa/driver.c | 719 ++++++++++++++++++++++++++++++ drivers/firmware/arm_ffa/smccc.c | 39 ++ include/linux/arm-smccc.h | 55 +++ include/linux/arm_ffa.h | 266 +++++++++++ 13 files changed, 1422 insertions(+) create mode 100644 drivers/firmware/arm_ffa/Kconfig create mode 100644 drivers/firmware/arm_ffa/Makefile create mode 100644 drivers/firmware/arm_ffa/bus.c create mode 100644 drivers/firmware/arm_ffa/common.h create mode 100644 drivers/firmware/arm_ffa/driver.c create mode 100644 drivers/firmware/arm_ffa/smccc.c create mode 100644 include/linux/arm_ffa.h -- 2.25.1 Tested-by: Jens Wiklander