From patchwork Fri Dec 4 12:11:30 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sudeep Holla X-Patchwork-Id: 11951607 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=-13.2 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=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 E46E3C433FE for ; Fri, 4 Dec 2020 12:13:29 +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 83E96225A9 for ; Fri, 4 Dec 2020 12:13:29 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 83E96225A9 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com 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=CGEcq0wDQzxsUP1t5WB3bLHr0uoYRr2uqvhOvI2mNss=; b=XWr3SCD5NxpEy2ywNjbJ+MjzXM KucsFEcJggjIHGKmYTy7enDo7Jw+J+tQ2cLLRhwKUZLy4FBRqDvdS4deSBK9EEJ1VquPBpG0f+W3g kd8SuAum8eiDTjByiNPleECx19G8fLOakMC2p5EJAltyCbg19+2ZAygKrp6k9oOzyCuKv8Y16ypEx /nytmRWoD7oKv4p5rVpk2g4Cs4uKpHd/wmGVHH62E/Ok2zeR+rcP8A388ni1KDGA67NUGV8Esf3Qy l8mQqX/51nYYPRrVuIDE6Lylh7Pj0eDQ3qWQwbqWgi7mViqM5M72iYkBJXLDlTMJNw/R2S1/MaJ1i VBPCPhBg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kl9wg-0004D8-6K; Fri, 04 Dec 2020 12:12:18 +0000 Received: from foss.arm.com ([217.140.110.172]) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kl9wO-00042b-Qc for linux-arm-kernel@lists.infradead.org; Fri, 04 Dec 2020 12:12:02 +0000 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 B402611FB; Fri, 4 Dec 2020 04:11:44 -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 602AE3F575; Fri, 4 Dec 2020 04:11:43 -0800 (PST) From: Sudeep Holla To: linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org Subject: [PATCH v3 0/7] firmware: Add initial support for Arm FF-A Date: Fri, 4 Dec 2020 12:11:30 +0000 Message-Id: <20201204121137.2966778-1-sudeep.holla@arm.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201204_071201_013082_D963CD4C X-CRM114-Status: GOOD ( 18.41 ) 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: Trilok Soni , David Hartley , Andrew Walbran , Achin Gupta , arve@android.com, Sudeep Holla , Arunachalam Ganapathy , Jens Wiklander Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi all, This is just initial implementation to check on the idea of providing in-kernel support for Arm FF-A specification. Complete driver support is still work in progress, I am posting to early feedback and merge basic support ASAP. 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. --- Regards, Sudeep [1] https://developer.arm.com/documentation/den0077/latest 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 | 179 +++++ drivers/firmware/arm_ffa/common.h | 32 + drivers/firmware/arm_ffa/driver.c | 660 ++++++++++++++++++ drivers/firmware/arm_ffa/smccc.c | 54 ++ include/linux/arm-smccc.h | 50 ++ include/linux/arm_ffa.h | 270 +++++++ 13 files changed, 1358 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