From patchwork Tue Nov 3 17:43:41 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sudeep Holla X-Patchwork-Id: 320437 Delivered-To: patch@linaro.org Received: by 2002:a92:7b12:0:0:0:0:0 with SMTP id w18csp4779508ilc; Tue, 3 Nov 2020 09:43:59 -0800 (PST) X-Google-Smtp-Source: ABdhPJyvxm1DYwfKwDVLtwvYNJ3yNSeJqbnCbYhUPfH7MjiFphA2F3TgfUkMY7sbECiBNKmBBw43 X-Received: by 2002:a50:dac9:: with SMTP id s9mr22044543edj.75.1604425439664; Tue, 03 Nov 2020 09:43:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604425439; cv=none; d=google.com; s=arc-20160816; b=PjGBY4eOEmPC3w92+paU467Fw6g4Qi/92+0EMFjoizjIpB5RWBnzdVjbkKyWRm1yla DPB8Iem4bWk+Ki+naBW0a8iIeRQtMz0H6dbHY/pwxS54SPzEdfaVey1qTsVmO7iDn2Jb pGPxZRa2OfaUuHSNqGC1FSFRTx9pv5CudhAYHU9NUz5Xi+rDO/H+A/3M5jhys80OsHvZ 4LYDigkrC/qD47sfZMIEBxxH7/MUICk35n4TFcEns/Wdr/ET1PpaF4ZtcS+GMivoDcM7 mHtHh0eDDJDC634O9RCExKW4ljU0TwEJ0jroA/uu7ra1/jHYC/gWx23smzhdWnZiXeoZ YBDw== 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=nGNRikwNF9UOvIbgG1S9W6q7PpooHMyU0+yLRd3aeH0=; b=0bBPIdzwk83wGfxOjvFs/a7lxeg7O4xad6J+FmyqkH/RUUWlhziBcMU4Vcx6Ahe/9A 41yXBkziivH0bqWAzExYisc9jCUEEJuFaojc1esVZrFQwg0W3ZaEPS8LSSA8ErAlK1T0 xWJc239obqgQgkz66bAEojagF1X4V80sBPDB+MRL96wzz4bjM6rV1JOw/ZimF/v1TBKI SxrS4aRlMnjYQ3e2zdzjMJXRmOP3D8z+lpCRCs3gSww3V0kBixKSyY2eLMaBFiiy9ffC 9HD5SAHhM+teJJQ4HI7d96fkLijcfDDP31yZdKxlWWxI3xb1xz0riELAaoZ3K2jtnWty EOrw== 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 n13si13469090eda.416.2020.11.03.09.43.59; Tue, 03 Nov 2020 09:43:59 -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 S1728292AbgKCRn6 (ORCPT + 6 others); Tue, 3 Nov 2020 12:43:58 -0500 Received: from foss.arm.com ([217.140.110.172]:53014 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727901AbgKCRn6 (ORCPT ); Tue, 3 Nov 2020 12:43:58 -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 F33D41474; Tue, 3 Nov 2020 09:43:57 -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 856D53F718; Tue, 3 Nov 2020 09:43:56 -0800 (PST) From: Sudeep Holla To: linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org Cc: Sudeep Holla , Trilok Soni , Trilok Soni , arve@android.com, Andrew Walbran , David Hartley , Achin Gupta , Android Kernel Team , Fuad Tabba Subject: [PATCH v2 0/9] firmware: Add initial support for Arm FF-A Date: Tue, 3 Nov 2020 17:43:41 +0000 Message-Id: <20201103174350.991593-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, Let me start stating this is just initial implementation to check on the idea of providing more in-kernel and userspace support. Lot of things are still work in progress, I am posting just to get the early feedback before building lot of things on this idea. Consider this more as RFC though not tagged explicity(just to avoid it being ignored :)) 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 partition(secure or normal world VM). If it is a partition managed by hypervisor, then we will register chardev associated with each of those partition FFA device. /dev/arm_ffa: e3a48fa5-dc54-4a8b-898b-bdc4dfeeb7b8 49f65057-d002-4ae2-b4ee-d31c7940a13d For in-kernel usage(mostly communication with secure partitions), only in-kernel APIs are accessible(no userspace). There may be a need to provide userspace access instead of in-kernel, it is not yet support in this series as we need way to identify those and I am not sure if that belong to DT. -- Regards, Sudeep [1] https://developer.arm.com/documentation/den0077/latest 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 (8): dt-bindings: Arm: Extend FF-A binding to support in-kernel usage of partitions 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: Setup and register all the KVM managed partitions firmware: arm_ffa: Add support for MEM_* interfaces Will Deacon (1): dt-bindings: Arm: Add Firmware Framework for Armv8-A (FF-A) binding .../devicetree/bindings/arm/arm,ffa-hyp.yaml | 102 +++ .../devicetree/bindings/arm/arm,ffa.yaml | 58 ++ .../reserved-memory/arm,ffa-memory.yaml | 71 ++ 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 | 199 +++++ drivers/firmware/arm_ffa/common.h | 35 + drivers/firmware/arm_ffa/driver.c | 737 ++++++++++++++++++ drivers/firmware/arm_ffa/hyp_partitions.c | 132 ++++ drivers/firmware/arm_ffa/smccc.c | 54 ++ include/linux/arm-smccc.h | 50 ++ include/linux/arm_ffa.h | 310 ++++++++ include/uapi/linux/arm_ffa.h | 67 ++ 17 files changed, 1870 insertions(+) create mode 100644 Documentation/devicetree/bindings/arm/arm,ffa-hyp.yaml create mode 100644 Documentation/devicetree/bindings/arm/arm,ffa.yaml create mode 100644 Documentation/devicetree/bindings/reserved-memory/arm,ffa-memory.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/hyp_partitions.c create mode 100644 drivers/firmware/arm_ffa/smccc.c create mode 100644 include/linux/arm_ffa.h create mode 100644 include/uapi/linux/arm_ffa.h -- 2.25.1