From patchwork Fri Jan 20 16:21:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sudeep Holla X-Patchwork-Id: 1729701 Return-Path: X-Original-To: incoming-imx@patchwork.ozlabs.org Delivered-To: patchwork-incoming-imx@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=tvntd/u6; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Nz4XJ01mBz23gM for ; Sat, 21 Jan 2023 03:22:23 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :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=fNZZskCcKJDa24HZoATFVBQACyVNMnc7rc8H0S+JyVc=; b=tvntd/u6WYxfZA oYkL6KRYdC9307knLQILWFW0gA4CzlAnqYSxSLFnmV1n65TwKVUIS2d7Ip/zpNQzawb1b/OeKz1Kv avD372uh21mBSKjVgSUSXoDg2A1R1sgUKE9XzZmkppEIbibU3XCxyfXQ3y/qdiiCIu6eqGwHGLrMR KzFadClwjsBRMeg0Rr4ezHECcXySQp2QzghJtCqSQa6BUwxqJnPiRRZg9YmH9CNzEDex4bbMX8Brc i2rJm9x+irjg7RZC8bWcz/OCVQJDBqhS8EVP+ZSt9Nn6TuchNVmFecVikwLBgrIBjvBVuasyYsoyo w/85bWHpenSqi4+RLkOw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pIu9V-00BD7w-F9; Fri, 20 Jan 2023 16:22:05 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pIu9S-00BD6H-1X for linux-arm-kernel@lists.infradead.org; Fri, 20 Jan 2023 16:22:04 +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 B2D4314BF; Fri, 20 Jan 2023 08:22:38 -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 23F203F67D; Fri, 20 Jan 2023 08:21:56 -0800 (PST) From: Sudeep Holla To: ARM SoC Team , SoC Team , ALKML Cc: Sudeep Holla , Arnd Bergmann , Cristian Marussi , Olof Johansson Subject: [GIT PULL] firmware: arm_scmi: Updates for v6.3 Date: Fri, 20 Jan 2023 16:21:52 +0000 Message-Id: <20230120162152.1438456-1-sudeep.holla@arm.com> X-Mailer: git-send-email 2.39.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230120_082202_216521_AAF04ED6 X-CRM114-Status: GOOD ( 16.40 ) X-Spam-Score: -2.3 (--) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Hi ARM SoC Team, Please pull ! The majority of the changes are in -next for a week now and all the reported build related issues are fixed. Content analysis details: (-2.3 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [217.140.110.172 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 SPF_NONE SPF: sender does not publish an SPF Record X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org Hi ARM SoC Team, Please pull ! The majority of the changes are in -next for a week now and all the reported build related issues are fixed. Regards, Sudeep -->8 The following changes since commit 1b929c02afd37871d5afb9d498426f83432e71c2: Linux 6.2-rc1 (2022-12-25 13:41:39 -0800) are available in the Git repository at: git://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux.git tags/scmi-updates-6.3 for you to fetch changes up to 32a55bbdd74e2bb76a76979bc4f37e7e7ebe620d: firmware: arm_scmi: Clarify raw per-channel ABI documentation (2023-01-20 14:11:38 +0000) ---------------------------------------------------------------- Arm SCMI updates for v6.3 The main addition is a unified userspace interface for SCMI irrespective of the underlying transport and along with some changed to refactor the SCMI stack probing sequence. 1. SCMI unified userspace interface This is to have a unified way of testing an SCMI platform firmware implementation for compliance, fuzzing etc., from the perspective of the non-secure OSPM irrespective of the underlying transport supporting SCMI. It is just for testing/development and not a feature intended fo use in production. Currently an SCMI Compliance Suite[1] can only work by injecting SCMI messages using the mailbox test driver only which makes it transport specific and can't be used with any other transport like virtio, smc/hvc, optee, etc. Also the shared memory can be transport specific and it is better to even abstract/hide those details while providing the userspace access. So in order to scale with any transport, we need a unified interface for the same. In order to achieve that, SCMI "raw mode support" is being added through debugfs which is more configurable as well. A userspace application can inject bare SCMI binary messages into the SCMI core stack; such messages will be routed by the SCMI regular kernel stack to the backend platform firmware using the configured transport transparently. This eliminates the to know about the specific underlying transport internals that will be taken care of by the SCMI core stack itself. Further no additional changes needed in the device tree like in the mailbox-test driver. [1] https://gitlab.arm.com/tests/scmi-tests 2. Refactoring of the SCMI stack probing sequence On some platforms, SCMI transport can be provide by OPTEE/TEE which introduces certain dependency in the probe ordering. In order to address the same, the SCMI bus is split into its own module which continues to be initialized at subsys_initcall, while the SCMI core stack, including its various transport backends (like optee, mailbox, virtio, smc), is now moved into a separate module at module_init level. This allows the other possibly dependent subsystems to register and/or access SCMI bus well before the core SCMI stack and its dependent transport backends. ---------------------------------------------------------------- Cristian Marussi (31): firmware: arm_scmi: Clear stale xfer->hdr.status firmware: arm_scmi: Harden shared memory access in fetch_response firmware: arm_scmi: Harden shared memory access in fetch_notification firmware: arm_scmi: Fix virtio channels cleanup on shutdown firmware: arm_scmi: Simplify chan_available transport operation firmware: arm_scmi: Use dedicated devices to initialize channels firmware: arm_scmi: Move protocol registration helpers firmware: arm_scmi: Add common notifier helpers firmware: arm_scmi: Refactor protocol device creation firmware: arm_scmi: Move handle get/set helpers firmware: arm_scmi: Refactor device create/destroy helpers firmware: arm_scmi: Introduce a new lifecycle for protocol devices firmware: arm_scmi: Split bus and driver into distinct modules firmware: arm_scmi: Refactor xfer in-flight registration routines firmware: arm_scmi: Refactor polling helpers firmware: arm_scmi: Refactor scmi_wait_for_message_response firmware: arm_scmi: Add flags field to xfer firmware: arm_scmi: Add xfer helpers to provide raw access firmware: arm_scmi: Move errors defs and code to common.h firmware: arm_scmi: Add internal platform/channel identifiers include: trace: Add platform and channel instance references debugfs: Export debugfs_create_str symbol firmware: arm_scmi: Populate a common SCMI debugfs root firmware: arm_scmi: Add debugfs ABI documentation for common entries firmware: arm_scmi: Add core raw transmission support firmware: arm_scmi: Add debugfs ABI documentation for raw mode firmware: arm_scmi: Reject SCMI drivers when configured in raw mode firmware: arm_scmi: Call raw mode hooks from the core stack firmware: arm_scmi: Add the raw mode co-existence support firmware: arm_scmi: Add per-channel raw injection support firmware: arm_scmi: Clarify raw per-channel ABI documentation Documentation/ABI/testing/debugfs-scmi | 70 ++ Documentation/ABI/testing/debugfs-scmi-raw | 117 +++ drivers/firmware/arm_scmi/Kconfig | 32 + drivers/firmware/arm_scmi/Makefile | 9 +- drivers/firmware/arm_scmi/bus.c | 395 ++++++-- drivers/firmware/arm_scmi/common.h | 100 +- drivers/firmware/arm_scmi/driver.c | 1225 ++++++++++++++--------- drivers/firmware/arm_scmi/mailbox.c | 6 +- drivers/firmware/arm_scmi/optee.c | 6 +- drivers/firmware/arm_scmi/protocols.h | 7 + drivers/firmware/arm_scmi/raw_mode.c | 1443 ++++++++++++++++++++++++++++ drivers/firmware/arm_scmi/raw_mode.h | 31 + drivers/firmware/arm_scmi/shmem.c | 9 +- drivers/firmware/arm_scmi/smc.c | 6 +- drivers/firmware/arm_scmi/virtio.c | 11 +- fs/debugfs/file.c | 1 + include/linux/scmi_protocol.h | 5 - include/trace/events/scmi.h | 18 +- 18 files changed, 2917 insertions(+), 574 deletions(-) create mode 100644 Documentation/ABI/testing/debugfs-scmi create mode 100644 Documentation/ABI/testing/debugfs-scmi-raw create mode 100644 drivers/firmware/arm_scmi/raw_mode.c create mode 100644 drivers/firmware/arm_scmi/raw_mode.h