Message ID | 20230919-ffa_v1-1_notif-v2-5-6f3a3ca3923c@arm.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:172:b0:3f2:4152:657d with SMTP id h50csp3570624vqi; Tue, 19 Sep 2023 10:47:54 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEbICH7mZMZQBCPq4aPoOjUEyfJ5G1p6Z6WwCF+FXUP9qOeHqmCvXZzyoyusdmYWZ5c0xxB X-Received: by 2002:a17:902:d503:b0:1c0:b8fd:9c7 with SMTP id b3-20020a170902d50300b001c0b8fd09c7mr132362plg.43.1695145673838; Tue, 19 Sep 2023 10:47:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695145673; cv=none; d=google.com; s=arc-20160816; b=OG4Hbnzo4fAhtmTufakHk8Irbo9ySdecUrg81lEYq0Sy6+FUhHV6rl1xv8wbErdP+S hUAQ6tDvzLEo3SEab8YD278zJXmRQhbmhN0hTrZ3/DdAzakwHZC9YDqgrIRH33Q8DFX4 umOsP+PeilZSfqZL51hlbC8+PkIn2bv8IfKPp9mIoYoL4/VNbzihG+r+EEkv3zWoQhtX LAmmuXKTg1E7C4wRgtXjxZtDDOWLKU0lLZ+b3OkzguNN8bVgvse4tO65bh4jdG2azygq 6Ep5pmcVWh13xDCUajnAdhZPKrQx9KLabEFM3BAqpIlIg0VcX052fMVlE4jEiFLA6anW 5i1Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from; bh=zPabK+1X/nBViT84CO/YbyZQqT4ZKko7+5wYK3Pg7Kw=; fh=vcyxKNiHD7TmKqmM0/rwqxGOTauIz60tMzPVV7I2N7Q=; b=LBHwmRofMYKfjCcc+jQSCDqV0mBvxJ4yFk3vSktrjDDRkr8FBiXaGUuedF/I5ABAtH qUuIEgMFZIVvoxnKvyq/m+vcGLvWC64jFcg4MOwU/tySf8UvLql/y+ORpeXUpfYhPVYk WcGKp9EBqL2kRbzr6RTMbMMOADvil8npBI0mtjnJ9kHi3arkxlNdyr69Wn1kwaZMKKkq HJW9qB2PsmLbO0SsfN2eaQmVVfU9e3kMQ8CKzuwP9LUl6M1UbBOPd25otqi8dP2mMALk 3NoKKF2m6Gq1mFodUMXmjhoNVVJshqzqwhYT15MYR7S9I6dkvoflDy6CNSlC8COznn6q 1DYg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id o5-20020a17090323c500b001b8b37f6b46si9755353plh.556.2023.09.19.10.47.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Sep 2023 10:47:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 77FA38023893; Tue, 19 Sep 2023 10:42:05 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232237AbjISRlm (ORCPT <rfc822;toshivichauhan@gmail.com> + 26 others); Tue, 19 Sep 2023 13:41:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55080 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232210AbjISRla (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 19 Sep 2023 13:41:30 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id AF4CCAD for <linux-kernel@vger.kernel.org>; Tue, 19 Sep 2023 10:41:24 -0700 (PDT) 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 E6D40143D; Tue, 19 Sep 2023 10:42:01 -0700 (PDT) Received: from e103737-lin.cambridge.arm.com (e103737-lin.cambridge.arm.com [10.1.197.49]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 9A08E3F5A1; Tue, 19 Sep 2023 10:41:23 -0700 (PDT) From: Sudeep Holla <sudeep.holla@arm.com> Date: Tue, 19 Sep 2023 18:40:53 +0100 Subject: [PATCH RFT v2 05/18] firmware: arm_ffa: Implement the FFA_NOTIFICATION_SET interface MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20230919-ffa_v1-1_notif-v2-5-6f3a3ca3923c@arm.com> References: <20230919-ffa_v1-1_notif-v2-0-6f3a3ca3923c@arm.com> In-Reply-To: <20230919-ffa_v1-1_notif-v2-0-6f3a3ca3923c@arm.com> To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Sudeep Holla <sudeep.holla@arm.com>, Jens Wiklander <jens.wiklander@linaro.org>, Marc Bonnici <marc.bonnici@arm.com>, Coboy Chen <coboy.chen@mediatek.com>, Lorenzo Pieralisi <lpieralisi@kernel.org>, Olivier Deprez <olivier.deprez@arm.com> X-Mailer: b4 0.12.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=1504; i=sudeep.holla@arm.com; h=from:subject:message-id; bh=PMF7W8gP08NmJpWmNAG8MEfkwerfmt6TtimmzyfxT6Q=; b=owEBbQKS/ZANAwAIAQBBurwxfuKYAcsmYgBlCd062+rtFD+44yL0Ekw5PGXXJ+O+CH2hxDgPl oo7XyQZC7+JAjMEAAEIAB0WIQS6ceUSBvMeskPdk+EAQbq8MX7imAUCZQndOgAKCRAAQbq8MX7i mMz3D/978oazRdsQBQ1CfVAgN3UMUwEFY2s+U2EOyTnNCCkLb08bn2TmY2Ul4Q8yulS8Z/d1yEF ryXH87x53jlhDFOUOoVxQWBx1ZGsYXbWr9SS4uc17T8VTQPZ/Yj2Zs7m5ErtJn7kJ3vgOvYJUY2 mko5cDfNqAzdB9dHEXdTaO3FcKFaYlTFU+W003LnYIh8Yo29I16e1YgasLGcuvalBfGOcdVedRM 66m2ZXyT+gYg0Hj4mjPR08uYczTQJgSQWVPvL818HDQP6VRABdd3SS2NqKK4B/dajuzs2Ox05yI l92A8zoQSSgjnmj8DJ84mDGx0GdX+cOaDDrUfBsYKo0E84BeCoJOctELSMOWEpwt03n07/nBW6L /h9ttmhBiv4Nq73pxfn6MhR9PswwrFy5N7VYXb4Kn2DhqcQdcAn2DHcWBgfWGVA5l16L0VzNOrF ncBqYr9daRg8RsR0RYjMju005j/a1mKUKWUEiA94M/KfwPvs7PMKu6/GL2I08ZbO+ptfevIEVC3 j4a7B6ZQBSL657Jsi3TuCDcqH5kEO9zMVI3KqciVFyfvoChioz64DaksuJWS8YTN1i4mzG2yyYq bq3dMS2llQLJnJsMyS6kB4t6bRwZHST1A/iI05lAn9t/kk8RNFkPVsCYjnvVnTTcjJ7mfR37Zx/ MKPBzzt1GqU5hqw== X-Developer-Key: i=sudeep.holla@arm.com; a=openpgp; fpr=7360A21742ADF5A11767C1C139CFD4755FE2D5B4 X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Tue, 19 Sep 2023 10:42:05 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1777489070208106270 X-GMAIL-MSGID: 1777489070208106270 |
Series |
firmware: arm_ffa: Add FF-A v1.1 support(notification + new memory descriptor format)
|
|
Commit Message
Sudeep Holla
Sept. 19, 2023, 5:40 p.m. UTC
The framework provides an interface to the sender to specify the
notification to signal to the receiver. A sender signals a notification
by requesting its partition manager to set the corresponding bit in the
notifications bitmap of the receiver invoking FFA_NOTIFICATION_SET.
Implement the FFA_NOTIFICATION_SET to enable the caller(sender) to send
the notifications for any other partitions in the system.
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
---
drivers/firmware/arm_ffa/driver.c | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
diff --git a/drivers/firmware/arm_ffa/driver.c b/drivers/firmware/arm_ffa/driver.c index ebe1ecc57099..2aae838ba46a 100644 --- a/drivers/firmware/arm_ffa/driver.c +++ b/drivers/firmware/arm_ffa/driver.c @@ -604,6 +604,26 @@ static int ffa_notification_bind_common(u16 dst_id, u64 bitmap, return 0; } +static +int ffa_notification_set(u16 src_id, u16 dst_id, u32 flags, u64 bitmap) +{ + ffa_value_t ret; + u32 src_dst_ids = PACK_TARGET_INFO(src_id, dst_id); + + invoke_ffa_fn((ffa_value_t) { + .a0 = FFA_NOTIFICATION_SET, .a1 = src_dst_ids, .a2 = flags, + .a3 = NOTIFICATION_BITMAP_LOW(bitmap), + .a4 = NOTIFICATION_BITMAP_HIGH(bitmap), + }, &ret); + + if (ret.a0 == FFA_ERROR) + return ffa_to_linux_errno((int)ret.a2); + else if (ret.a0 != FFA_SUCCESS) + return -EINVAL; + + return 0; +} + static int ffa_run(struct ffa_device *dev, u16 vcpu) { ffa_value_t ret;