From patchwork Tue Aug 27 18:24:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Fainelli X-Patchwork-Id: 13780010 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 1301DC54731 for ; Tue, 27 Aug 2024 18:26:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-Type: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=C5EhsGRigPnUckXLEiUIi4qR162a7g/SzzqPqeOe2KY=; b=DInaJNc/vI4Sky6ODcDbQ8+CCf jI3zxtVA9oWl2CYuyWZLjKWXI4azpdKkYVCXCUU7o/85EtYZ992DR3P6lUuTgArurxOaBgPaudOmJ mri3PbiWCCXdsXJJr9ZVUUEOO1tmFAhYAcZy869tI8uIgV7W7IZEHLr8FRlUsGltZbSFRtxd0FP6l YN5gjNEvXlk7fSXIZrGDz0FRJGV2PJ4fuX8OW5ahB7zdiX9Vz8NZSeOKJSgZ9HFSHf+oZ5LFmDufx AdYFozr/8mBPUp9qFnGVYxTufwIndDD8M3wiqJAHUnlm2AqBqYlMcZykzPd8AmYy5pXqRaXRLidz+ 4FkqKxKw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sj0u0-0000000CUcm-0sQ9; Tue, 27 Aug 2024 18:26:48 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sj0sI-0000000CUP9-3myy for linux-arm-kernel@bombadil.infradead.org; Tue, 27 Aug 2024 18:25:02 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Content-Transfer-Encoding:MIME-Version :Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:In-Reply-To:References; bh=C5EhsGRigPnUckXLEiUIi4qR162a7g/SzzqPqeOe2KY=; b=BxlzBorNIve+ZBMn7A4MAxLKmY i2fRlghAZWcrAduWd3SZdys81kwu4B542DQokvHp+y/Dy3ECQd3wM4oB/j9oJK3ksNuIRqTaBzHDU H6DN8hfC6Qmhf4MdflvzeYw7PIqu8OPOuOoNTJzxcCRzcST/XxoPd9YufTTR0tJWgqN6p3Pm1d2CX 8hkgnAxj2/xr4KLv7E10ivT59BipwA0lqnpPywS3EPkxgstrzOU8P3r/myPguUNft6IVWM0BDLmUK 0AWMwFkCNu0EDvBhpxJLEgun7oKt9O5Uy/Ee5bamhKWgBJfahxyPZzWneTfJ2B26GQTX/He8DfrAQ Hxn1ccQw==; Received: from relay.smtp-ext.broadcom.com ([192.19.144.208]) by desiato.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sj0sE-0000000AwIv-30cT for linux-arm-kernel@lists.infradead.org; Tue, 27 Aug 2024 18:25:01 +0000 Received: from mail-lvn-it-01.lvn.broadcom.net (mail-lvn-it-01.lvn.broadcom.net [10.36.132.253]) by relay.smtp-ext.broadcom.com (Postfix) with ESMTP id 40E0AC0000E4; Tue, 27 Aug 2024 11:24:54 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 relay.smtp-ext.broadcom.com 40E0AC0000E4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=broadcom.com; s=dkimrelay; t=1724783094; bh=1386lGTMB6WCcSqsjLJUMCrOsAbXFeBuQL4kGvdYOLQ=; h=From:To:Cc:Subject:Date:From; b=alWX8issrocCy8Fbnb6qTjBa1LKsp87QC9xvBRCelEPXvz00Fy66v0ajMCipefx+w O74Q76fWS9tmOW3wAfv94aMnF7LZ8JzsEeMPUbYLIDhBW+n9sipw8rAkpwJlKEFUcj TMIgDW/ZoQeXTBCq1itZlXWMGBlpj5YjP9tQbIFM= Received: from stbirv-lnx-1.igp.broadcom.net (stbirv-lnx-1.igp.broadcom.net [10.67.48.32]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail-lvn-it-01.lvn.broadcom.net (Postfix) with ESMTPSA id CD45118045E7C9; Tue, 27 Aug 2024 11:24:53 -0700 (PDT) From: Florian Fainelli To: linux-arm-kernel@lists.infradead.org Cc: Florian Fainelli , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Sudeep Holla , Cristian Marussi , devicetree@vger.kernel.org (open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS), linux-kernel@vger.kernel.org (open list), arm-scmi@vger.kernel.org (open list:SYSTEM CONTROL & POWER/MANAGEMENT INTERFACE), justin.chen@broadcom.com, opendmb@gmail.com, kapil.hali@broadcom.com, bcm-kernel-feedback-list@broadcom.com, Arnd Bergmann Subject: [PATCH v4 0/2] Support for I/O width within ARM SCMI SHMEM Date: Tue, 27 Aug 2024 11:24:48 -0700 Message-Id: <20240827182450.3608307-1-florian.fainelli@broadcom.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240827_192458_978656_0615571D X-CRM114-Status: GOOD ( 14.95 ) 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+linux-arm-kernel=archiver.kernel.org@lists.infradead.org We just got our hands on hardware that only supports 32-bit access width to the SRAM being used. This patch series adds support for the 'reg-io-width' property and allows us to specify the exact access width that the SRAM supports. Changes in v4: - added alignment warnings in case the source/destination/count are not a 4 bytes multiple - switched to __ioread32_copy/__iowrite32_copy per Sudeep's suggestion - dropped volatile qualifiers to permit that switch Changes in v3: - added missing documentation for the structure members being added - removed the use of a macro for the 32-bit only operation, this gets rid of a number of checkpatch warnings - added missing trailing barriers - corrected binding indentation Changes in v2: - fixed typo in the binding and added reviewed-by tag from Krzysztof - determine the correct I/O operation at the time we parse the 'reg-io-width' property rather than for each tx_prepare/fetch_response/fetch_notification call - dropped support for 1 and 2 bytes 'reg-io-width' as they do not quite make sense, if we can support such smaller access size, then we can support the larger 4 byte access width, too, and there are many places within the SCMI code where ioread32/iowrite32 are used Florian Fainelli (2): dt-bindings: sram: Document reg-io-width property firmware: arm_scmi: Support 'reg-io-width' property for shared memory .../devicetree/bindings/sram/sram.yaml | 6 ++ drivers/firmware/arm_scmi/common.h | 32 +++++++- .../arm_scmi/scmi_transport_mailbox.c | 13 +++- .../firmware/arm_scmi/scmi_transport_optee.c | 11 ++- .../firmware/arm_scmi/scmi_transport_smc.c | 11 ++- drivers/firmware/arm_scmi/shmem.c | 78 +++++++++++++++++-- 6 files changed, 130 insertions(+), 21 deletions(-)