From patchwork Fri Feb 12 15:46:07 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sudeep Holla X-Patchwork-Id: 381836 Delivered-To: patch@linaro.org Received: by 2002:a02:b18a:0:0:0:0:0 with SMTP id t10csp3040960jah; Fri, 12 Feb 2021 07:48:40 -0800 (PST) X-Google-Smtp-Source: ABdhPJwxqcLWwpCHVdyGKz3pikYExOw4Fn1H4f37zlXZgsSCJKlC2+E5bakPYHaeWGfnIVC8WQtz X-Received: by 2002:aa7:d5c9:: with SMTP id d9mr4077677eds.245.1613144919999; Fri, 12 Feb 2021 07:48:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613144919; cv=none; d=google.com; s=arc-20160816; b=LPT8luBSjP+lF/b3kHHBM5sPFn7VL2nmWq41f2bYnguZfa9oP2Io9schBjGRG2uf46 92eJZVhCe8RfnEtxvbqNKZlI9EuuhHCkeACPfAtTW/H6lXQZmHmH16Wx9aBHM2mXP5Rg nN46Lvqx1Caa+/Ir2RQ/mVKgM1Mu2J+pKWfolyqHl5P3M/HU5Usi5IJt7UJE0/wrz0Y8 w1TBKnTfwry8lIvGBeTaf6BepxBmz9gWo60kfNVn664MK7jzhKklDftahk1+IrhZIH9z a3yqOChWoSzrrKPHFdJAeSejhz474S2RfaW79fVA6OBfbJRch50OUCwKcpKXQLXbuVJa 5DXw== 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=K8x6s2Ob9kGjJ/E9gZVBifdQwdsBmbCIUC9fC8VB8wQ=; b=iNEwcbkhlVBFxqTYIdYoyqj320+A2xiCKozELU+2OtU9AvvvbfC2VdK757ONcM1FjU G+BkR4B7eoYxDLDTYwQJtM7nTmkoq2tX2EmOASF94E2LGuUHXc+cw4HR2KnvA5Ox9gmT +nZaobHR6m9RjmABlSQZW3IuLlJg8KgVXJLWVW59rEaJAzUS+40O2E0kzh0q7AE/g+EB 3wDftQ6FXjpzKi0tbDhebEAcwR2PkoH+s30yzWOhSCzX5XcvrnkYIbflTERNODY44fr4 z09NW3AbQ0Wms33Fe5BxVQmCtz7YH97eRIj4MRg/ekzhtsB7Vs6UpYH+BxU7klgCqv82 yVHA== 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 40si6668662edr.233.2021.02.12.07.48.39; Fri, 12 Feb 2021 07:48:39 -0800 (PST) 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 S229917AbhBLPrS (ORCPT + 6 others); Fri, 12 Feb 2021 10:47:18 -0500 Received: from foss.arm.com ([217.140.110.172]:38956 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232027AbhBLPrK (ORCPT ); Fri, 12 Feb 2021 10:47:10 -0500 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 5672C1063; Fri, 12 Feb 2021 07:46:24 -0800 (PST) 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 DF3473F73B; Fri, 12 Feb 2021 07:46:22 -0800 (PST) From: Sudeep Holla To: linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org Cc: Sudeep Holla , Trilok Soni , arve@android.com, Andrew Walbran , David Hartley , Achin Gupta , Jens Wiklander , Arunachalam Ganapathy , Marc Bonnici Subject: [PATCH v4 0/7] firmware: Add initial support for Arm FF-A Date: Fri, 12 Feb 2021 15:46:07 +0000 Message-Id: <20210212154614.38604-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. iArm 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.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux.git v5.11/ffa 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 (7): dt-bindings: Arm: Add Firmware Framework for Armv8-A (FF-A) binding arm64: smccc: Add support for SMCCCv1.2 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 .../devicetree/bindings/arm/arm,ffa.yaml | 58 ++ arch/arm64/kernel/asm-offsets.c | 4 + arch/arm64/kernel/smccc-call.S | 22 + 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 | 181 +++++ drivers/firmware/arm_ffa/common.h | 32 + drivers/firmware/arm_ffa/driver.c | 669 ++++++++++++++++++ drivers/firmware/arm_ffa/smccc.c | 54 ++ include/linux/arm-smccc.h | 50 ++ include/linux/arm_ffa.h | 277 ++++++++ 13 files changed, 1376 insertions(+) create mode 100644 Documentation/devicetree/bindings/arm/arm,ffa.yaml 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