From patchwork Fri Dec 20 14:32:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tudor Ambarus X-Patchwork-Id: 13916838 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 563DEE77188 for ; Fri, 20 Dec 2024 14:34:25 +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:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=S2r054HjWrz6SG4prpVPiiYe71n6RO8+qtINI2M8+4Y=; b=FfzxhY/4BJlTKgB6cYIq2pyjWs Qfjo2GQ6yvKv6c7b+RiS15ZfjB1hQ+ORr1JhuLNDHrDOMPm6G56bPya40PVhYwJRB9toAHqXZpeYF SemdoKwP4qR9oQ6yENI1TxyLPl46lzXYlxYme4P0w0dHPf/e6wwIuiI85POOnv4xgChWUjt1XWfYe Mgsg51zSoGoxWsh+vCn6Fk1D2w5w8sNQfIVhY1tQzyIgF4dDzlJ4yeM3Es9VRkrIblx7oJdnvS6JO uvZFjd7t15iSdVB4iZbPhytKFN2/G24jmJU8L867kpye0WI7YEsV04l0yxPXfAS6Wyof5s/Y8/SI1 lY8uXrRw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tOe4y-000000059cM-1QUB; Fri, 20 Dec 2024 14:34:12 +0000 Received: from mail-wr1-x435.google.com ([2a00:1450:4864:20::435]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tOe3n-000000059RU-31f0 for linux-arm-kernel@lists.infradead.org; Fri, 20 Dec 2024 14:33:01 +0000 Received: by mail-wr1-x435.google.com with SMTP id ffacd0b85a97d-385e1fcb0e1so1156810f8f.2 for ; Fri, 20 Dec 2024 06:32:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734705178; x=1735309978; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=S2r054HjWrz6SG4prpVPiiYe71n6RO8+qtINI2M8+4Y=; b=NM4YUnmVMZ0evi44yVw+HgD2og2d2bK1KVUuJhfQ+gYr+9icPphVIilZxGmZ2GUhtj JMudHz8HoS2vY3TQxSuaVJ0ATttEDf4J84lTS7Hz85iTj7qO7a9k/gsMlwmC6+hIuFqf UoOUdzl97q59uUFKL577hp+5yonOUj2eAvZYobC594YZftMEmWrO+r+YR2ifONWd3Etq OLbMag9TCRRSdMy5yX8ax9Oycx76Mir8RYOTOsc9Va2yLHH1NqV1yfXH+2bw3EZbxIrj OIXRqf6eCaqpLJ3dmcvWl0O9f/8Eg+0rLuDUHGVsZNWEUengg5CU1TG+Qpw837AbSA2V OLxw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734705178; x=1735309978; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=S2r054HjWrz6SG4prpVPiiYe71n6RO8+qtINI2M8+4Y=; b=onsB1GW//GS5tpzQWxA+q5tSGF+gn03GNe/c/vQOb5Aik1eN5bBth4xXHrPdGIkbq3 clfmPmBGXbbpS+rj0CfsHTWAwFqknSp/4d1VBU5dpHIlJvT+/9nziMW0PWH3DsvGR9Ci BTwVm6LBM8uIBHpoednTmPzH9XXWyzCbwHtUdCIffk5P0ZTyDqsUyEA/wT4XfT4zzlib iAq9kIh3SyCoynz4tc4OxyCDuxNTUYGBpv7D8AK5ICYMZ7X03J3VS2524qvdPddw7ucj iAPyAEiDydWd2ZSm/NMCNyXWjWnZGYJuDPv10xhKOtpP6ZxUM0vJYoQORMtHtLTWlamy z7ng== X-Forwarded-Encrypted: i=1; AJvYcCUiaZJzVGaRnIRBLv7m+7T+Q8IxMajY1CEoTENjKu7kvjShtNJc2T4WPU/rw11eHkfffI60SStAK2vxIepz1S1O@lists.infradead.org X-Gm-Message-State: AOJu0YwntUtPT8jiR6vDbPwD2YTs6beL+2oQKC81R1f8p3kVjyQdrqn9 Rgqc59V0U+ciR8T9w/dEHB/yKkOdBSb9kVmsGptuHJuM0pGzlf5EftvTKQZpVP8= X-Gm-Gg: ASbGncsnJ2xDMn5puYLuZdZuBH3f20gNgb/1hr0I5CL6siuZYDpxKiik9E6C6O+fN1O QaH1CIrewnY9lboQLAlhtK4IyAXhAFd8ZwCEvob8YQmK5nOKxTmQ/urLBu81vvIh4N5NLN6Q3EK ugD4stpktkumjjsh+nLTPmst3nvdXKEp/dDu/mv/H9h8c9fOmYv6WTX5gWCx6TXKDJY/iIwAg44 1pwKstDTs4KQIhipksCEhGd2c7EkxV4tJCbcVwVwTZ28OTq5ubaDXU4sWXiNqhUuLwcuyO5Y7vq zaoYgIIvEznl9pAZ3yP9XYFAwQGk0k+pAz5W X-Google-Smtp-Source: AGHT+IFWUL89s9MPTN9RXW3xpCsH1N6q7qhnMGREc6l90xzRqvJXMu91tZEs3D1ocnJ+h0j+U7pNvA== X-Received: by 2002:a5d:64e5:0:b0:385:fb56:fb73 with SMTP id ffacd0b85a97d-38a221f9bfcmr3230824f8f.15.1734705178353; Fri, 20 Dec 2024 06:32:58 -0800 (PST) Received: from ta2.c.googlers.com (130.173.34.34.bc.googleusercontent.com. [34.34.173.130]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38a1c829235sm4140321f8f.15.2024.12.20.06.32.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Dec 2024 06:32:57 -0800 (PST) From: Tudor Ambarus Date: Fri, 20 Dec 2024 14:32:51 +0000 Subject: [PATCH v5 1/3] dt-bindings: firmware: add google,gs101-acpm-ipc MIME-Version: 1.0 Message-Id: <20241220-gs101-acpm-v5-1-4f26b7fb3f5f@linaro.org> References: <20241220-gs101-acpm-v5-0-4f26b7fb3f5f@linaro.org> In-Reply-To: <20241220-gs101-acpm-v5-0-4f26b7fb3f5f@linaro.org> To: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Krzysztof Kozlowski , Alim Akhtar , Jassi Brar Cc: linux-kernel@vger.kernel.org, linux-samsung-soc@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, andre.draszik@linaro.org, kernel-team@android.com, willmcvicker@google.com, peter.griffin@linaro.org, daniel.lezcano@linaro.org, vincent.guittot@linaro.org, ulf.hansson@linaro.org, arnd@arndb.de, Tudor Ambarus X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1734705176; l=2055; i=tudor.ambarus@linaro.org; s=20241212; h=from:subject:message-id; bh=qcWsBmv/JznSww/eNk8qMIS4BDY5s6ZxLb3tuX2AP68=; b=k6t57kS4DnX5YnkmyuPdrCI2QT0B4i9671oVZXLt08rpfaAoStKPubIknxG27HXNIJcuocPwW r5wzeZ3Vv2kCHbe66cWirfqLNqM9gGXrPXXr5KLwnP4ewEGFR4M+tUN X-Developer-Key: i=tudor.ambarus@linaro.org; a=ed25519; pk=uQzE0NXo3dIjeowMTOPCpIiPHEz12IA/MbyzrZVh9WI= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241220_063259_767502_F6E2C6AA X-CRM114-Status: GOOD ( 13.07 ) 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 Add bindings for the Samsung Exynos ACPM mailbox protocol. Signed-off-by: Tudor Ambarus --- .../bindings/firmware/google,gs101-acpm-ipc.yaml | 50 ++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/Documentation/devicetree/bindings/firmware/google,gs101-acpm-ipc.yaml b/Documentation/devicetree/bindings/firmware/google,gs101-acpm-ipc.yaml new file mode 100644 index 000000000000..982cb8d62011 --- /dev/null +++ b/Documentation/devicetree/bindings/firmware/google,gs101-acpm-ipc.yaml @@ -0,0 +1,50 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +# Copyright 2024 Linaro Ltd. +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/firmware/google,gs101-acpm-ipc.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Samsung Exynos ACPM mailbox protocol + +maintainers: + - Tudor Ambarus + +description: | + ACPM (Alive Clock and Power Manager) is a firmware that operates on the + APM (Active Power Management) module that handles overall power management + activities. ACPM and masters regard each other as independent hardware + component and communicate with each other using mailbox messages and + shared memory. + + This binding is intended to define the interface the firmware implementing + ACPM provides for OSPM in the device tree. + +properties: + compatible: + const: google,gs101-acpm-ipc + + mboxes: + maxItems: 1 + + shmem: + description: + List of phandle pointing to the shared memory (SHM) area. The memory + contains channels configuration data and the TX/RX ring buffers that + are used for passing messages to/from the ACPM firmware. + maxItems: 1 + +required: + - compatible + - mboxes + - shmem + +additionalProperties: false + +examples: + - | + power-management { + compatible = "google,gs101-acpm-ipc"; + mboxes = <&ap2apm_mailbox>; + shmem = <&apm_sram>; + }; From patchwork Fri Dec 20 14:32:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tudor Ambarus X-Patchwork-Id: 13916849 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 37D27E77188 for ; Fri, 20 Dec 2024 14:37:55 +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:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=SZNs2hSn6BKw3ghFulQaiVbJ7Zje09ejzg3SkCZoHOI=; b=Kx8H8svZH4E1pCdzp20ELCXd0B DYca1AUVWeD/ZiAKywofLKWRIaOZxhb1ynTfOhy+LxBei+HstVOHX40g3NeRE0vy98B91BHOW6bsT BdCxDZbhjW3YMKYJZ7J5E/SFY+mH8iV2OZOtq9yvaIENr+oresTbsZo49gumt9AiHjLQQDGvnGByX /dzhlb3ok4U6E+/y3tfWibGidOhlx/QugtXy0egoSYnuIv1FzHGdlzZJRW+pHIMJ+iXAM+F5exGiV D12p8kHg+/TGRm7/3HgGIyMp2UGiRAyAFm3vt6gwPQkCW2jOh/47ZS5Rf1Jj/5hfdFG5cBcZaEaWL 1AxYSRcw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tOe8L-00000005AHb-28tz; Fri, 20 Dec 2024 14:37:41 +0000 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tOe3p-000000059S1-3MdO for linux-arm-kernel@lists.infradead.org; Fri, 20 Dec 2024 14:33:03 +0000 Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-4361f796586so21076385e9.3 for ; Fri, 20 Dec 2024 06:33:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734705180; x=1735309980; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=SZNs2hSn6BKw3ghFulQaiVbJ7Zje09ejzg3SkCZoHOI=; b=ErWAlWIKmo/T9H0YJ++2wGhCPe6yCTNOqDEgPlUF5CIq3SWWTQpg0yCjYYkfOkYDGN otnwXKzI4zyAF4BdvW7QPUfun1gYDNpVLcHoMCvM/xffrsKwB7aElV1PP9D63om7GcO/ OLef8LUJrdHWuvlxFZiSZzKjH1xFsXZX09euj2yhCqS3lmgu6BaKVx4eDZHnnPHTgGug Htw+s1qaide2hUUKoej0waosFQ1R9nl/yZ9jlIiE4QYvfxPodg2ks96je03vDk+jBhY4 TJVuxBv5z4m7FPfurZxNsCYbFUvEb+5LWxNblzSmaXdS5e+pdD4KKg+nraYZTpbWYd6r o0yg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734705180; x=1735309980; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=SZNs2hSn6BKw3ghFulQaiVbJ7Zje09ejzg3SkCZoHOI=; b=MDwH2/pHzWdmLAsRh5sckhm1Fet92FqCbuf2elu4R7YdElHLSDWA8MjeBquuOn/X2D AYFWnq/LTxSc2I+P/a/sPLpkOPKNFw3nBAPNM0HlG7VC0+7ECMBDq3Ycn7iUv+bvEIsl nKwiWOX2eFWXW8XfbEnK+Q3+/UNc61my+WYjbs9K3vROFBP4Pt/Ir/Q6W7cT/aNoAXT0 0iE2R6hFyLVBagL60ncG91WLpSq14XDqVulPv/af0h21UgdNMkLD3SxaSeQGylIkfiTM f8XYq3tvF1/LodEEWzzxcTdjOKXN1MfhPgRP2piVJ5DQAs9e5PjuuVbLcpnu/nKCLYfo S4OA== X-Forwarded-Encrypted: i=1; AJvYcCU5yo15mdlxzwS+6epqpJ9ZCLh5hwwTad9/1mOM1F6aYufixA8h9nMEdJwteqt54RDQmUvfAsPEkQZURs09ReUz@lists.infradead.org X-Gm-Message-State: AOJu0YwncLGsJfNj62tKcuQ3w6NKhITTwyR5/85ZBAK3kahS9OJ+1j07 ir3VgmAYDpscTXdKwap4Ek6UCjzONj0pVqp8BLxpkR1aR1kjXABIRF+PXVcDrhA= X-Gm-Gg: ASbGnctDzQ04P7InLkJcqSN7gp0CMrzqGT0UcjY+RYZdNghva8jXH9geoL5mWqNJA4/ mZXJKXg9e6jhFYf7vxb3XxFbAbEbSrXxp9eT+tD3vkoViLjo7CEvdZmEZsdcM1Ay6VzzKeDqmMP lCvbEdRyNCnQ5n9WQPZHr1YbUSc1XZR085eUmG+GV7fPOQaK787VTdiCIdy2U/84W355AG3uu2t sQeIdgPYCxr9jd9eEDkUuvj7M4LwdA+Ehgr41/jmHu0g2r1a+vGfnH4JgtjbQhAIJL6PfNvWBrz y4/julW5oWYNnS+Ezu1pEE92RE/C2NBlf3Nl X-Google-Smtp-Source: AGHT+IEbE4arN+p4i8oFF/GgLGgyFfZhVn1Sr1M6KaZ9hDhtKgfWceKi2d9ugSe/8/N5/F55/lR9jQ== X-Received: by 2002:a05:600c:4709:b0:436:1ac2:1acf with SMTP id 5b1f17b1804b1-43668a3a35dmr25872945e9.20.1734705179465; Fri, 20 Dec 2024 06:32:59 -0800 (PST) Received: from ta2.c.googlers.com (130.173.34.34.bc.googleusercontent.com. [34.34.173.130]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38a1c829235sm4140321f8f.15.2024.12.20.06.32.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Dec 2024 06:32:58 -0800 (PST) From: Tudor Ambarus Date: Fri, 20 Dec 2024 14:32:52 +0000 Subject: [PATCH v5 2/3] firmware: add Exynos ACPM protocol driver MIME-Version: 1.0 Message-Id: <20241220-gs101-acpm-v5-2-4f26b7fb3f5f@linaro.org> References: <20241220-gs101-acpm-v5-0-4f26b7fb3f5f@linaro.org> In-Reply-To: <20241220-gs101-acpm-v5-0-4f26b7fb3f5f@linaro.org> To: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Krzysztof Kozlowski , Alim Akhtar , Jassi Brar Cc: linux-kernel@vger.kernel.org, linux-samsung-soc@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, andre.draszik@linaro.org, kernel-team@android.com, willmcvicker@google.com, peter.griffin@linaro.org, daniel.lezcano@linaro.org, vincent.guittot@linaro.org, ulf.hansson@linaro.org, arnd@arndb.de, Tudor Ambarus X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1734705176; l=35837; i=tudor.ambarus@linaro.org; s=20241212; h=from:subject:message-id; bh=d29LiEBOLMRI2HEiIKuJImY5WKn20hMf7j0jyleqRr8=; b=FzQigztOIkvuCOoacbjs0GduzuZ/m2nglH76FVL7MGsPYq3tNRHteD6zsK5qK/Yyp++0j/QL+ qwoqHZmFem/B2w+SBZxDNqhlmlbgcTldmrjxsx2XjlNaOEmi64M2lEe X-Developer-Key: i=tudor.ambarus@linaro.org; a=ed25519; pk=uQzE0NXo3dIjeowMTOPCpIiPHEz12IA/MbyzrZVh9WI= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241220_063301_870485_66C0D2C3 X-CRM114-Status: GOOD ( 19.73 ) 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 Alive Clock and Power Manager (ACPM) Message Protocol is defined for the purpose of communication between the ACPM firmware and masters (AP, AOC, ...). ACPM firmware operates on the Active Power Management (APM) module that handles overall power activities. ACPM and masters regard each other as independent hardware component and communicate with each other using mailbox messages and shared memory. This protocol driver provides the interface for all the client drivers making use of the features offered by the APM. Add ACPM protocol support. Signed-off-by: Tudor Ambarus --- drivers/firmware/Kconfig | 1 + drivers/firmware/Makefile | 1 + drivers/firmware/samsung/Kconfig | 14 + drivers/firmware/samsung/Makefile | 4 + drivers/firmware/samsung/exynos-acpm-pmic.c | 224 ++++++ drivers/firmware/samsung/exynos-acpm-pmic.h | 24 + drivers/firmware/samsung/exynos-acpm.c | 805 +++++++++++++++++++++ drivers/firmware/samsung/exynos-acpm.h | 15 + .../linux/firmware/samsung/exynos-acpm-protocol.h | 55 ++ 9 files changed, 1143 insertions(+) diff --git a/drivers/firmware/Kconfig b/drivers/firmware/Kconfig index 71d8b26c4103..24edb956831b 100644 --- a/drivers/firmware/Kconfig +++ b/drivers/firmware/Kconfig @@ -267,6 +267,7 @@ source "drivers/firmware/meson/Kconfig" source "drivers/firmware/microchip/Kconfig" source "drivers/firmware/psci/Kconfig" source "drivers/firmware/qcom/Kconfig" +source "drivers/firmware/samsung/Kconfig" source "drivers/firmware/smccc/Kconfig" source "drivers/firmware/tegra/Kconfig" source "drivers/firmware/xilinx/Kconfig" diff --git a/drivers/firmware/Makefile b/drivers/firmware/Makefile index 7a8d486e718f..91efcc868a05 100644 --- a/drivers/firmware/Makefile +++ b/drivers/firmware/Makefile @@ -33,6 +33,7 @@ obj-y += efi/ obj-y += imx/ obj-y += psci/ obj-y += qcom/ +obj-y += samsung/ obj-y += smccc/ obj-y += tegra/ obj-y += xilinx/ diff --git a/drivers/firmware/samsung/Kconfig b/drivers/firmware/samsung/Kconfig new file mode 100644 index 000000000000..750b41342174 --- /dev/null +++ b/drivers/firmware/samsung/Kconfig @@ -0,0 +1,14 @@ +# SPDX-License-Identifier: GPL-2.0-only + +config EXYNOS_ACPM_PROTOCOL + tristate "Exynos Alive Clock and Power Manager (ACPM) Message Protocol" + depends on ARCH_EXYNOS || COMPILE_TEST + depends on EXYNOS_MBOX + help + Alive Clock and Power Manager (ACPM) Message Protocol is defined for + the purpose of communication between the ACPM firmware and masters + (AP, AOC, ...). ACPM firmware operates on the Active Power Management + (APM) module that handles overall power activities. + + This protocol driver provides interface for all the client drivers + making use of the features offered by the APM. diff --git a/drivers/firmware/samsung/Makefile b/drivers/firmware/samsung/Makefile new file mode 100644 index 000000000000..7b4c9f6f34f5 --- /dev/null +++ b/drivers/firmware/samsung/Makefile @@ -0,0 +1,4 @@ +# SPDX-License-Identifier: GPL-2.0-only + +acpm-protocol-objs := exynos-acpm.o exynos-acpm-pmic.o +obj-$(CONFIG_EXYNOS_ACPM_PROTOCOL) += acpm-protocol.o diff --git a/drivers/firmware/samsung/exynos-acpm-pmic.c b/drivers/firmware/samsung/exynos-acpm-pmic.c new file mode 100644 index 000000000000..d698e5a03630 --- /dev/null +++ b/drivers/firmware/samsung/exynos-acpm-pmic.c @@ -0,0 +1,224 @@ +// SPDX-License-Identifier: GPL-2.0-only +/* + * Copyright 2020 Samsung Electronics Co., Ltd. + * Copyright 2020 Google LLC. + * Copyright 2024 Linaro Ltd. + */ +#include +#include +#include +#include +#include + +#include "exynos-acpm.h" +#include "exynos-acpm-pmic.h" + +#define ACPM_PMIC_CHANNEL GENMASK(15, 12) +#define ACPM_PMIC_TYPE GENMASK(11, 8) +#define ACPM_PMIC_REG GENMASK(7, 0) + +#define ACPM_PMIC_RETURN GENMASK(31, 24) +#define ACPM_PMIC_MASK GENMASK(23, 16) +#define ACPM_PMIC_VALUE GENMASK(15, 8) +#define ACPM_PMIC_FUNC GENMASK(7, 0) + +#define ACPM_PMIC_BULK_SHIFT 8 +#define ACPM_PMIC_BULK_MASK GENMASK(7, 0) +#define ACPM_PMIC_BULK_MAX_COUNT 8 + +enum exynos_acpm_pmic_func { + ACPM_PMIC_READ, + ACPM_PMIC_WRITE, + ACPM_PMIC_UPDATE, + ACPM_PMIC_BULK_READ, + ACPM_PMIC_BULK_WRITE, +}; + +static inline u32 acpm_pmic_set_bulk(u32 data, unsigned int i) +{ + return (data & ACPM_PMIC_BULK_MASK) << (ACPM_PMIC_BULK_SHIFT * i); +} + +static inline u32 acpm_pmic_get_bulk(u32 data, unsigned int i) +{ + return (data >> (ACPM_PMIC_BULK_SHIFT * i)) & ACPM_PMIC_BULK_MASK; +} + +static void acpm_dvfs_set_xfer(struct acpm_xfer *xfer, u32 *cmd, + int acpm_chan_id) +{ + xfer->tx.cmd = cmd; + xfer->tx.len = sizeof(cmd); + xfer->rx.cmd = cmd; + xfer->rx.len = sizeof(cmd); + xfer->acpm_chan_id = acpm_chan_id; +} + +static void acpm_pmic_init_read_cmd(u32 *cmd, u8 type, u8 reg, u8 chan) +{ + cmd[0] = FIELD_PREP(ACPM_PMIC_TYPE, type) | + FIELD_PREP(ACPM_PMIC_REG, reg) | + FIELD_PREP(ACPM_PMIC_CHANNEL, chan); + cmd[1] = FIELD_PREP(ACPM_PMIC_FUNC, ACPM_PMIC_READ); + cmd[3] = ktime_to_ms(ktime_get()); +} + +int acpm_pmic_read_reg(const struct acpm_handle *handle, int acpm_chan_id, + u8 type, u8 reg, u8 chan, u8 *dest) +{ + struct acpm_xfer xfer; + u32 cmd[4] = {0}; + int ret; + + acpm_pmic_init_read_cmd(cmd, type, reg, chan); + acpm_dvfs_set_xfer(&xfer, cmd, acpm_chan_id); + + ret = acpm_do_xfer(handle, &xfer); + if (ret) + return ret; + + *dest = FIELD_GET(ACPM_PMIC_VALUE, xfer.rx.cmd[1]); + + return FIELD_GET(ACPM_PMIC_RETURN, xfer.rx.cmd[1]); +} + +static void acpm_pmic_init_bulk_read_cmd(u32 *cmd, u8 type, u8 reg, u8 chan, + u8 count) +{ + cmd[0] = FIELD_PREP(ACPM_PMIC_TYPE, type) | + FIELD_PREP(ACPM_PMIC_REG, reg) | + FIELD_PREP(ACPM_PMIC_CHANNEL, chan); + cmd[1] = FIELD_PREP(ACPM_PMIC_FUNC, ACPM_PMIC_BULK_READ) | + FIELD_PREP(ACPM_PMIC_VALUE, count); +} + +int acpm_pmic_bulk_read(const struct acpm_handle *handle, int acpm_chan_id, + u8 type, u8 reg, u8 chan, u8 count, u8 *buf) +{ + struct acpm_xfer xfer; + u32 cmd[4] = {0}; + int i, ret; + + if (count > ACPM_PMIC_BULK_MAX_COUNT) + return -EINVAL; + + acpm_pmic_init_bulk_read_cmd(cmd, type, reg, chan, count); + acpm_dvfs_set_xfer(&xfer, cmd, acpm_chan_id); + + ret = acpm_do_xfer(handle, &xfer); + if (ret) + return ret; + + ret = FIELD_GET(ACPM_PMIC_RETURN, xfer.rx.cmd[1]); + if (ret) + return ret; + + for (i = 0; i < count; i++) { + if (i < 4) + buf[i] = acpm_pmic_get_bulk(xfer.rx.cmd[2], i); + else + buf[i] = acpm_pmic_get_bulk(xfer.rx.cmd[3], i - 4); + } + + return 0; +} + +static void acpm_pmic_init_write_cmd(u32 *cmd, u8 type, u8 reg, u8 chan, + u8 value) +{ + cmd[0] = FIELD_PREP(ACPM_PMIC_TYPE, type) | + FIELD_PREP(ACPM_PMIC_REG, reg) | + FIELD_PREP(ACPM_PMIC_CHANNEL, chan); + cmd[1] = FIELD_PREP(ACPM_PMIC_FUNC, ACPM_PMIC_WRITE) | + FIELD_PREP(ACPM_PMIC_VALUE, value); + cmd[3] = ktime_to_ms(ktime_get()); +} + +int acpm_pmic_write_reg(const struct acpm_handle *handle, int acpm_chan_id, + u8 type, u8 reg, u8 chan, u8 value) +{ + struct acpm_xfer xfer; + u32 cmd[4] = {0}; + int ret; + + acpm_pmic_init_write_cmd(cmd, type, reg, chan, value); + acpm_dvfs_set_xfer(&xfer, cmd, acpm_chan_id); + + ret = acpm_do_xfer(handle, &xfer); + if (ret) + return ret; + + return FIELD_GET(ACPM_PMIC_RETURN, xfer.rx.cmd[1]); +} + +static void acpm_pmic_init_bulk_write_cmd(u32 *cmd, u8 type, u8 reg, u8 chan, + u8 count, u8 *buf) +{ + int i; + + cmd[0] = FIELD_PREP(ACPM_PMIC_TYPE, type) | + FIELD_PREP(ACPM_PMIC_REG, reg) | + FIELD_PREP(ACPM_PMIC_CHANNEL, chan); + cmd[1] = FIELD_PREP(ACPM_PMIC_FUNC, ACPM_PMIC_BULK_WRITE) | + FIELD_PREP(ACPM_PMIC_VALUE, count); + + for (i = 0; i < count; i++) { + if (i < 4) + cmd[2] |= acpm_pmic_set_bulk(buf[i], i); + else + cmd[3] |= acpm_pmic_set_bulk(buf[i], i - 4); + } +} + +int acpm_pmic_bulk_write(const struct acpm_handle *handle, int acpm_chan_id, + u8 type, u8 reg, u8 chan, u8 count, u8 *buf) +{ + struct acpm_xfer xfer; + u32 cmd[4] = {0}; + int ret; + + if (count > ACPM_PMIC_BULK_MAX_COUNT) + return -EINVAL; + + acpm_pmic_init_bulk_write_cmd(cmd, type, reg, chan, count, buf); + acpm_dvfs_set_xfer(&xfer, cmd, acpm_chan_id); + + ret = acpm_do_xfer(handle, &xfer); + if (ret) + return ret; + + return FIELD_GET(ACPM_PMIC_RETURN, xfer.rx.cmd[1]); +} + +static void acpm_pmic_init_update_cmd(u32 *cmd, u8 type, u8 reg, u8 chan, + u8 value, u8 mask) +{ + cmd[0] = FIELD_PREP(ACPM_PMIC_TYPE, type) | + FIELD_PREP(ACPM_PMIC_REG, reg) | + FIELD_PREP(ACPM_PMIC_CHANNEL, chan); + cmd[1] = FIELD_PREP(ACPM_PMIC_FUNC, ACPM_PMIC_UPDATE) | + FIELD_PREP(ACPM_PMIC_VALUE, value) | + FIELD_PREP(ACPM_PMIC_MASK, mask); + cmd[3] = ktime_to_ms(ktime_get()); +} + +int acpm_pmic_update_reg(const struct acpm_handle *handle, int acpm_chan_id, + u8 type, u8 reg, u8 chan, u8 value, u8 mask) +{ + struct acpm_xfer xfer; + u32 cmd[4] = {0}; + int ret; + + acpm_pmic_init_update_cmd(cmd, type, reg, chan, value, mask); + acpm_dvfs_set_xfer(&xfer, cmd, acpm_chan_id); + + ret = acpm_do_xfer(handle, &xfer); + if (ret) + return ret; + + return FIELD_GET(ACPM_PMIC_RETURN, xfer.rx.cmd[1]); +} + +MODULE_AUTHOR("Tudor Ambarus "); +MODULE_DESCRIPTION("Samsung Exynos ACPM mailbox PMIC protocol driver"); +MODULE_LICENSE("GPL"); diff --git a/drivers/firmware/samsung/exynos-acpm-pmic.h b/drivers/firmware/samsung/exynos-acpm-pmic.h new file mode 100644 index 000000000000..92b1997d9933 --- /dev/null +++ b/drivers/firmware/samsung/exynos-acpm-pmic.h @@ -0,0 +1,24 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +/* + * Copyright 2020 Samsung Electronics Co., Ltd. + * Copyright 2020 Google LLC. + * Copyright 2024 Linaro Ltd. + */ +#ifndef __EXYNOS_ACPM_PMIC_H__ +#define __EXYNOS_ACPM_PMIC_H__ + +#include + +struct acpm_handle; + +int acpm_pmic_read_reg(const struct acpm_handle *handle, int acpm_chan_id, + u8 type, u8 reg, u8 chan, u8 *dest); +int acpm_pmic_bulk_read(const struct acpm_handle *handle, int acpm_chan_id, + u8 type, u8 reg, u8 chan, u8 count, u8 *buf); +int acpm_pmic_write_reg(const struct acpm_handle *handle, int acpm_chan_id, + u8 type, u8 reg, u8 chan, u8 value); +int acpm_pmic_bulk_write(const struct acpm_handle *handle, int acpm_chan_id, + u8 type, u8 reg, u8 chan, u8 count, u8 *buf); +int acpm_pmic_update_reg(const struct acpm_handle *handle, int acpm_chan_id, + u8 type, u8 reg, u8 chan, u8 value, u8 mask); +#endif /* __EXYNOS_ACPM_PMIC_H__ */ diff --git a/drivers/firmware/samsung/exynos-acpm.c b/drivers/firmware/samsung/exynos-acpm.c new file mode 100644 index 000000000000..2f98306f8325 --- /dev/null +++ b/drivers/firmware/samsung/exynos-acpm.c @@ -0,0 +1,805 @@ +// SPDX-License-Identifier: GPL-2.0-only +/* + * Copyright 2020 Samsung Electronics Co., Ltd. + * Copyright 2020 Google LLC. + * Copyright 2024 Linaro Ltd. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "exynos-acpm.h" +#include "exynos-acpm-pmic.h" + +#define ACPM_PROTOCOL_SEQNUM GENMASK(21, 16) + +/* The unit of counter is 20 us. 5000 * 20 = 100 ms */ +#define ACPM_POLL_TIMEOUT 5000 +#define ACPM_TX_TIMEOUT_US 500000 + +#define ACPM_GS101_INITDATA_BASE 0xa000 + +/** + * struct acpm_shmem - shared memory configuration information. + * @reserved: unused fields. + * @chans: offset to array of struct acpm_chan_shmem. + * @reserved1: unused fields. + * @num_chans: number of channels. + */ +struct acpm_shmem { + u32 reserved[2]; + u32 chans; + u32 reserved1[3]; + u32 num_chans; +}; + +/** + * struct acpm_chan_shmem - descriptor of a shared memory channel. + * + * @id: channel ID. + * @reserved: unused fields. + * @rx_rear: rear pointer of APM RX queue (TX for AP). + * @rx_front: front pointer of APM RX queue (TX for AP). + * @rx_base: base address of APM RX queue (TX for AP). + * @reserved1: unused fields. + * @tx_rear: rear pointer of APM TX queue (RX for AP). + * @tx_front: front pointer of APM TX queue (RX for AP). + * @tx_base: base address of APM TX queue (RX for AP). + * @qlen: queue length. Applies to both TX/RX queues. + * @mlen: message length. Applies to both TX/RX queues. + * @reserved2: unused fields. + * @poll_completion: true when the channel works on polling. + */ +struct acpm_chan_shmem { + u32 id; + u32 reserved[3]; + u32 rx_rear; + u32 rx_front; + u32 rx_base; + u32 reserved1[3]; + u32 tx_rear; + u32 tx_front; + u32 tx_base; + u32 qlen; + u32 mlen; + u32 reserved2[2]; + u32 poll_completion; +}; + +/** + * struct acpm_queue - exynos acpm queue. + * + * @rear: rear address of the queue. + * @front: front address of the queue. + * @base: base address of the queue. + */ +struct acpm_queue { + void __iomem *rear; + void __iomem *front; + void __iomem *base; +}; + +/** + * struct acpm_rx_data - RX queue data. + * + * @cmd: pointer to where the data shall be saved. + * @n_cmd: number of 32-bit commands. + * @response: true if the client expects the RX data. + */ +struct acpm_rx_data { + u32 *cmd; + size_t n_cmd; + bool response; +}; + +#define ACPM_SEQNUM_MAX 64 + +/** + * struct acpm_chan - driver internal representation of a channel. + * @cl: mailbox client. + * @chan: mailbox channel. + * @acpm: pointer to driver private data. + * @tx: TX queue. The enqueue is done by the host. + * - front index is written by the host. + * - rear index is written by the firmware. + * + * @rx: RX queue. The enqueue is done by the firmware. + * - front index is written by the firmware. + * - rear index is written by the host. + * @tx_lock: protects TX queue. + * @rx_lock: protects RX queue. + * @qlen: queue length. Applies to both TX/RX queues. + * @mlen: message length. Applies to both TX/RX queues. + * @seqnum: sequence number of the last message enqueued on TX queue. + * @id: channel ID. + * @poll_completion: indicates if the transfer needs to be polled for + * completion or interrupt mode is used. + * @bitmap_seqnum: bitmap that tracks the messages on the TX/RX queues. + * @rx_data: internal buffer used to drain the RX queue. + */ +struct acpm_chan { + struct mbox_client cl; + struct mbox_chan *chan; + struct acpm_info *acpm; + struct acpm_queue tx; + struct acpm_queue rx; + struct mutex tx_lock; + struct mutex rx_lock; + + unsigned int qlen; + unsigned int mlen; + u8 seqnum; + u8 id; + bool poll_completion; + + DECLARE_BITMAP(bitmap_seqnum, ACPM_SEQNUM_MAX - 1); + struct acpm_rx_data rx_data[ACPM_SEQNUM_MAX]; +}; + +/** + * struct acpm_info - driver's private data. + * @shmem: pointer to the SRAM configuration data. + * @sram_base: base address of SRAM. + * @chans: pointer to the ACPM channel parameters retrieved from SRAM. + * @dev: pointer to the exynos-acpm device. + * @handle: instance of acpm_handle to send to clients. + * @node: list head + * @num_chans: number of channels available for this controller. + * @users: number of users of this instance. + */ +struct acpm_info { + struct acpm_shmem __iomem *shmem; + void __iomem *sram_base; + struct acpm_chan *chans; + struct device *dev; + struct acpm_handle handle; + struct list_head node; + u32 num_chans; + /* protected by acpm_list_mutex */ + int users; +}; + +/** + * struct acpm_match_data - of_device_id data. + * @initdata_base: offset in SRAM where the channels configuration resides. + */ +struct acpm_match_data { + loff_t initdata_base; +}; + +#define client_to_acpm_chan(c) container_of(c, struct acpm_chan, cl) +#define handle_to_acpm_info(h) container_of(h, struct acpm_info, handle) + +/* List of all ACPM devices active in system */ +static LIST_HEAD(acpm_list); +/* Protection for the entire list */ +static DEFINE_MUTEX(acpm_list_mutex); + +static inline void acpm_memcpy_fromio32(void *to, const void __iomem *from, + size_t count) +{ + WARN_ON(!IS_ALIGNED((unsigned long)from, 4) || + !IS_ALIGNED((unsigned long)to, 4) || + count % 4); + + __ioread32_copy(to, from, count / 4); +} + +static inline void acpm_memcpy_toio32(void __iomem *to, const void *from, + size_t count) +{ + WARN_ON(!IS_ALIGNED((unsigned long)to, 4) || + !IS_ALIGNED((unsigned long)from, 4) || + count % 4); + + __iowrite32_copy(to, from, count / 4); +} + +/** + * acpm_get_rx() - get response from RX queue. + * @achan: ACPM channel info. + * @xfer: reference to the transfer to get response for. + * + * Return: 0 on success, -errno otherwise. + */ +static int acpm_get_rx(struct acpm_chan *achan, struct acpm_xfer *xfer) +{ + struct acpm_msg *tx = &xfer->tx; + struct acpm_msg *rx = &xfer->rx; + struct acpm_rx_data *rx_data; + const void __iomem *base, *addr; + u32 rx_front, rx_seqnum, tx_seqnum, seqnum; + u32 i, val, mlen; + bool rx_set = false; + + rx_front = readl(achan->rx.front); + i = readl(achan->rx.rear); + + /* Bail out if RX is empty. */ + if (i == rx_front) + return 0; + + base = achan->rx.base; + mlen = achan->mlen; + + tx_seqnum = FIELD_GET(ACPM_PROTOCOL_SEQNUM, tx->cmd[0]); + + /* Drain RX queue. */ + do { + /* Read RX seqnum. */ + addr = base + mlen * i; + val = readl(addr); + + rx_seqnum = FIELD_GET(ACPM_PROTOCOL_SEQNUM, val); + if (!rx_seqnum) + return -EIO; + /* + * mssg seqnum starts with value 1, whereas the driver considers + * the first mssg at index 0. + */ + seqnum = rx_seqnum - 1; + rx_data = &achan->rx_data[seqnum]; + + if (rx_data->response) { + if (rx_seqnum == tx_seqnum) { + acpm_memcpy_fromio32(rx->cmd, addr, rx->len); + rx_set = true; + clear_bit(seqnum, achan->bitmap_seqnum); + } else { + /* + * The RX data corresponds to another request. + * Save the data to drain the queue, but don't + * clear yet the bitmap. It will be cleared + * after the response is copied to the request. + */ + acpm_memcpy_fromio32(rx_data->cmd, addr, + rx->len); + } + } else { + clear_bit(seqnum, achan->bitmap_seqnum); + } + + i = (i + 1) % achan->qlen; + } while (i != rx_front); + + /* We saved all responses, mark RX empty. */ + writel(rx_front, achan->rx.rear); + + /* + * If the response was not in this iteration of the queue, check if the + * RX data was previously saved. + */ + rx_data = &achan->rx_data[tx_seqnum - 1]; + if (!rx_set && rx_data->response) { + rx_seqnum = FIELD_GET(ACPM_PROTOCOL_SEQNUM, + rx_data->cmd[0]); + + if (rx_seqnum == tx_seqnum) { + memcpy(rx->cmd, rx_data->cmd, rx->len); + clear_bit(rx_seqnum - 1, achan->bitmap_seqnum); + } + } + + return 0; +} + +/** + * acpm_dequeue_by_polling() - RX dequeue by polling. + * @achan: ACPM channel info. + * @xfer: reference to the transfer being waited for. + * + * Return: 0 on success, -errno otherwise. + */ +static int acpm_dequeue_by_polling(struct acpm_chan *achan, + struct acpm_xfer *xfer) +{ + struct device *dev = achan->acpm->dev; + struct acpm_msg *tx = &xfer->tx; + unsigned int cnt_20us = 0; + u32 seqnum; + int ret; + + seqnum = FIELD_GET(ACPM_PROTOCOL_SEQNUM, tx->cmd[0]); + + do { + mutex_lock(&achan->rx_lock); + ret = acpm_get_rx(achan, xfer); + mutex_unlock(&achan->rx_lock); + if (ret) + return ret; + + if (!test_bit(seqnum - 1, achan->bitmap_seqnum)) + return 0; + + /* Determined experimentally. */ + usleep_range(20, 30); + cnt_20us++; + } while (cnt_20us < ACPM_POLL_TIMEOUT); + + dev_err(dev, "Timeout! ch:%u s:%u bitmap:%lx, cnt_20us = %d.\n", + achan->id, seqnum, achan->bitmap_seqnum[0], cnt_20us); + + return -ETIME; +} + +/** + * acpm_wait_for_queue_slots() - wait for queue slots. + * + * @achan: ACPM channel info. + * @next_tx_front: next front index of the TX queue. + * + * Return: 0 on success, -errno otherwise. + */ +static int acpm_wait_for_queue_slots(struct acpm_chan *achan, u32 next_tx_front) +{ + u32 val, ret; + + /* + * Wait for RX front to keep up with TX front. Make sure there's at + * least one element between them. + */ + ret = readl_poll_timeout(achan->rx.front, val, next_tx_front != val, 0, + ACPM_TX_TIMEOUT_US); + if (ret) { + dev_err(achan->acpm->dev, "RX front can not keep up with TX front.\n"); + return ret; + } + + ret = readl_poll_timeout(achan->tx.rear, val, next_tx_front != val, 0, + ACPM_TX_TIMEOUT_US); + if (ret) + dev_err(achan->acpm->dev, "TX queue is full.\n"); + + return ret; +} + +/** + * acpm_prepare_xfer() - prepare a transfer before writing the message to the + * TX queue. + * @achan: ACPM channel info. + * @xfer: reference to the transfer being prepared. + */ +static void acpm_prepare_xfer(struct acpm_chan *achan, struct acpm_xfer *xfer) +{ + struct acpm_msg *tx = &xfer->tx; + struct acpm_rx_data *rx_data; + + /* Prevent chan->seqnum from being re-used */ + do { + if (++achan->seqnum == ACPM_SEQNUM_MAX) + achan->seqnum = 1; + } while (test_bit(achan->seqnum - 1, achan->bitmap_seqnum)); + + tx->cmd[0] |= FIELD_PREP(ACPM_PROTOCOL_SEQNUM, achan->seqnum); + + /* Clear data for upcoming responses */ + rx_data = &achan->rx_data[achan->seqnum - 1]; + memset(rx_data->cmd, 0, sizeof(*rx_data->cmd) * rx_data->n_cmd); + if (xfer->rx.cmd) + rx_data->response = true; + + /* Flag the index based on seqnum. (seqnum: 1~63, bitmap: 0~62) */ + set_bit(achan->seqnum - 1, achan->bitmap_seqnum); +} + +/** + * acpm_wait_for_message_response - an helper to group all possible ways of + * waiting for a synchronous message response. + * + * @achan: ACPM channel info. + * @xfer: reference to the transfer being waited for. + * + * Return: 0 on success, -errno otherwise. + */ +static int acpm_wait_for_message_response(struct acpm_chan *achan, + struct acpm_xfer *xfer) +{ + /* Just polling mode supported for now. */ + return acpm_dequeue_by_polling(achan, xfer); +} + +/** + * acpm_do_xfer() - do one transfer. + * @handle: pointer to the acpm handle. + * @xfer: transfer to initiate and wait for response. + * + * Return: 0 on success, -errno otherwise. + */ +int acpm_do_xfer(const struct acpm_handle *handle, struct acpm_xfer *xfer) +{ + struct acpm_info *acpm = handle_to_acpm_info(handle); + struct acpm_chan *achan = &acpm->chans[xfer->acpm_chan_id]; + struct acpm_msg *tx = &xfer->tx; + u32 idx, tx_front; + int ret; + + if (!tx->cmd || tx->len > achan->mlen || xfer->rx.len > achan->mlen) + return -EINVAL; + + if (!achan->poll_completion) { + dev_err(achan->acpm->dev, "Interrupt mode not supported\n"); + return -EOPNOTSUPP; + } + + mutex_lock(&achan->tx_lock); + + tx_front = readl(achan->tx.front); + idx = (tx_front + 1) % achan->qlen; + + ret = acpm_wait_for_queue_slots(achan, idx); + if (ret) { + mutex_unlock(&achan->tx_lock); + return ret; + } + + acpm_prepare_xfer(achan, xfer); + + /* Write TX command. */ + acpm_memcpy_toio32(achan->tx.base + achan->mlen * tx_front, tx->cmd, + tx->len); + + /* Advance TX front. */ + writel(idx, achan->tx.front); + + mutex_unlock(&achan->tx_lock); + + ret = mbox_send_message(achan->chan, xfer); + if (ret < 0) + return ret; + + ret = acpm_wait_for_message_response(achan, xfer); + + /* + * NOTE: we might prefer not to need the mailbox ticker to manage the + * transfer queueing since the protocol layer queues things by itself. + * Unfortunately, we have to kick the mailbox framework after we have + * received our message. + */ + mbox_client_txdone(achan->chan, ret); + + return ret; +} + +/** + * acpm_put_handle() - release the handle acquired by acpm_get_by_phandle. + * @handle: Handle acquired by acpm_get_by_phandle. + * + * Return: 0 on success, -errno otherwise. + */ +static int acpm_put_handle(const struct acpm_handle *handle) +{ + struct acpm_info *acpm; + + if (IS_ERR(handle)) + return PTR_ERR(handle); + if (!handle) + return -EINVAL; + + acpm = handle_to_acpm_info(handle); + mutex_lock(&acpm_list_mutex); + if (!WARN_ON(!acpm->users)) + acpm->users--; + mutex_unlock(&acpm_list_mutex); + + return 0; +} + +/** + * devm_acpm_release() - devres release method. + * @dev: pointer to device. + * @res: pointer to resource. + */ +static void devm_acpm_release(struct device *dev, void *res) +{ + const struct acpm_handle **ptr = res; + const struct acpm_handle *handle = *ptr; + int ret; + + ret = acpm_put_handle(handle); + if (ret) + dev_err(dev, "failed to put handle %d\n", ret); +} + +/** + * acpm_get_by_phandle() - get the ACPM handle using DT phandle. + * @np: device node. + * @property: property name containing phandle on ACPM node. + * + * Return: pointer to handle on success, ERR_PTR(-errno) otherwise. + */ +static const struct acpm_handle *acpm_get_by_phandle(struct device_node *np, + const char *property) +{ + struct acpm_handle *handle = NULL; + struct device_node *acpm_np; + struct acpm_info *info; + + if (!np) { + pr_err("I need a device pointer\n"); + return ERR_PTR(-EINVAL); + } + + acpm_np = of_parse_phandle(np, property, 0); + if (!acpm_np) + return ERR_PTR(-ENODEV); + + mutex_lock(&acpm_list_mutex); + list_for_each_entry(info, &acpm_list, node) { + if (acpm_np == info->dev->of_node) { + handle = &info->handle; + info->users++; + break; + } + } + mutex_unlock(&acpm_list_mutex); + of_node_put(acpm_np); + + if (!handle) + return ERR_PTR(-EPROBE_DEFER); + + return handle; +} + +/** + * devm_acpm_get_by_phandle() - managed get handle using phandle. + * @dev: device pointer requesting ACPM handle. + * @property: property name containing phandle on ACPM node. + * + * Return: pointer to handle on success, ERR_PTR(-errno) otherwise. + */ +const struct acpm_handle *devm_acpm_get_by_phandle(struct device *dev, + const char *property) +{ + const struct acpm_handle *handle; + const struct acpm_handle **ptr; + + ptr = devres_alloc(devm_acpm_release, sizeof(*ptr), GFP_KERNEL); + if (!ptr) + return ERR_PTR(-ENOMEM); + handle = acpm_get_by_phandle(dev_of_node(dev), property); + + if (!IS_ERR(handle)) { + *ptr = handle; + devres_add(dev, ptr); + } else { + devres_free(ptr); + } + + return handle; +} + +/** + * acpm_chan_shmem_get_params() - get channel parameters and addresses of the + * TX/RX queues. + * @achan: ACPM channel info. + * @chan_shmem: __iomem pointer to a channel described in shared memory. + */ +static void acpm_chan_shmem_get_params(struct acpm_chan *achan, + struct acpm_chan_shmem __iomem *chan_shmem) +{ + void __iomem *base = achan->acpm->sram_base; + struct acpm_queue *rx = &achan->rx; + struct acpm_queue *tx = &achan->tx; + + achan->mlen = readl(&chan_shmem->mlen); + achan->poll_completion = readl(&chan_shmem->poll_completion); + achan->id = readl(&chan_shmem->id); + achan->qlen = readl(&chan_shmem->qlen); + + tx->base = base + readl(&chan_shmem->rx_base); + tx->rear = base + readl(&chan_shmem->rx_rear); + tx->front = base + readl(&chan_shmem->rx_front); + + rx->base = base + readl(&chan_shmem->tx_base); + rx->rear = base + readl(&chan_shmem->tx_rear); + rx->front = base + readl(&chan_shmem->tx_front); + + dev_vdbg(achan->acpm->dev, "ID = %d poll = %d, mlen = %d, qlen = %d\n", + achan->id, achan->poll_completion, achan->mlen, achan->qlen); +} + +/** + * acpm_achan_alloc_cmds() - allocate buffers for retrieving data from the ACPM + * firmware. + * @achan: ACPM channel info. + * + * Return: 0 on success, -errno otherwise. + */ +static int acpm_achan_alloc_cmds(struct acpm_chan *achan) +{ + struct device *dev = achan->acpm->dev; + struct acpm_rx_data *rx_data; + size_t cmd_size, n_cmd; + int i; + + if (achan->mlen == 0) + return 0; + + cmd_size = sizeof(*(achan->rx_data[0].cmd)); + n_cmd = DIV_ROUND_UP_ULL(achan->mlen, cmd_size); + + for (i = 0; i < ACPM_SEQNUM_MAX; i++) { + rx_data = &achan->rx_data[i]; + rx_data->n_cmd = n_cmd; + rx_data->cmd = devm_kcalloc(dev, n_cmd, cmd_size, GFP_KERNEL); + if (!rx_data->cmd) + return -ENOMEM; + } + + return 0; +} + +/** + * acpm_free_mbox_chans() - free mailbox channels. + * @acpm: pointer to driver data. + */ +static void acpm_free_mbox_chans(struct acpm_info *acpm) +{ + int i; + + for (i = 0; i < acpm->num_chans; i++) + if (!IS_ERR_OR_NULL(acpm->chans[i].chan)) + mbox_free_channel(acpm->chans[i].chan); +} + +/** + * acpm_channels_init() - initialize channels based on the configuration data in + * the shared memory. + * @acpm: pointer to driver data. + * + * Return: 0 on success, -errno otherwise. + */ +static int acpm_channels_init(struct acpm_info *acpm) +{ + struct acpm_shmem __iomem *shmem = acpm->shmem; + struct acpm_chan_shmem __iomem *chans_shmem; + struct device *dev = acpm->dev; + int i, ret; + + acpm->num_chans = readl(&shmem->num_chans); + acpm->chans = devm_kcalloc(dev, acpm->num_chans, sizeof(*acpm->chans), + GFP_KERNEL); + if (!acpm->chans) + return -ENOMEM; + + chans_shmem = acpm->sram_base + readl(&shmem->chans); + + for (i = 0; i < acpm->num_chans; i++) { + struct acpm_chan_shmem __iomem *chan_shmem = &chans_shmem[i]; + struct acpm_chan *achan = &acpm->chans[i]; + struct mbox_client *cl = &achan->cl; + struct mbox_xlate_args spec; + + achan->acpm = acpm; + + acpm_chan_shmem_get_params(achan, chan_shmem); + + ret = acpm_achan_alloc_cmds(achan); + if (ret) + return ret; + + mutex_init(&achan->rx_lock); + mutex_init(&achan->tx_lock); + + cl->dev = dev; + + spec.args[0] = achan->id; + spec.args[1] = 0; /* DOORBELL */ + spec.args_count = 2; + + achan->chan = mbox_request_channel_by_args(cl, 0, &spec); + if (IS_ERR(achan->chan)) { + acpm_free_mbox_chans(acpm); + return PTR_ERR(achan->chan); + } + } + + return 0; +} + +/** + * acpm_setup_ops() - setup the operations structures. + * @acpm: pointer to the driver data. + */ +static void acpm_setup_ops(struct acpm_info *acpm) +{ + struct acpm_pmic_ops *pmic_ops = &acpm->handle.ops.pmic_ops; + + pmic_ops->read_reg = acpm_pmic_read_reg; + pmic_ops->bulk_read = acpm_pmic_bulk_read; + pmic_ops->write_reg = acpm_pmic_write_reg; + pmic_ops->bulk_write = acpm_pmic_bulk_write; + pmic_ops->update_reg = acpm_pmic_update_reg; +} + +static int acpm_probe(struct platform_device *pdev) +{ + const struct acpm_match_data *match_data; + struct device *dev = &pdev->dev; + struct device_node *shmem; + struct acpm_info *acpm; + resource_size_t size; + struct resource res; + int ret; + + acpm = devm_kzalloc(dev, sizeof(*acpm), GFP_KERNEL); + if (!acpm) + return -ENOMEM; + + shmem = of_parse_phandle(dev->of_node, "shmem", 0); + ret = of_address_to_resource(shmem, 0, &res); + of_node_put(shmem); + if (ret) + return dev_err_probe(dev, ret, + "Failed to get shared memory.\n"); + + size = resource_size(&res); + acpm->sram_base = devm_ioremap(dev, res.start, size); + if (!acpm->sram_base) + return dev_err_probe(dev, -ENOMEM, + "Failed to ioremap shared memory.\n"); + + match_data = of_device_get_match_data(dev); + if (!match_data) + return dev_err_probe(dev, -EINVAL, + "Faile to get match data.\n"); + + acpm->shmem = acpm->sram_base + match_data->initdata_base; + acpm->dev = dev; + + ret = acpm_channels_init(acpm); + if (ret) + return ret; + + acpm_setup_ops(acpm); + + INIT_LIST_HEAD(&acpm->node); + mutex_lock(&acpm_list_mutex); + list_add_tail(&acpm->node, &acpm_list); + mutex_unlock(&acpm_list_mutex); + + platform_set_drvdata(pdev, acpm); + + return 0; +} + +static const struct acpm_match_data acpm_gs101 = { + .initdata_base = ACPM_GS101_INITDATA_BASE, +}; + +static const struct of_device_id acpm_match[] = { + { + .compatible = "google,gs101-acpm-ipc", + .data = &acpm_gs101, + }, + {}, +}; +MODULE_DEVICE_TABLE(of, acpm_match); + +static struct platform_driver acpm_driver = { + .probe = acpm_probe, + .driver = { + .name = "exynos-acpm-protocol", + .of_match_table = acpm_match, + }, +}; +module_platform_driver(acpm_driver); + +MODULE_AUTHOR("Tudor Ambarus "); +MODULE_DESCRIPTION("Samsung Exynos ACPM mailbox protocol driver"); +MODULE_LICENSE("GPL"); diff --git a/drivers/firmware/samsung/exynos-acpm.h b/drivers/firmware/samsung/exynos-acpm.h new file mode 100644 index 000000000000..a03adcd260f5 --- /dev/null +++ b/drivers/firmware/samsung/exynos-acpm.h @@ -0,0 +1,15 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +/* + * Copyright 2020 Samsung Electronics Co., Ltd. + * Copyright 2020 Google LLC. + * Copyright 2024 Linaro Ltd. + */ +#ifndef __EXYNOS_ACPM_H__ +#define __EXYNOS_ACPM_H__ + +struct acpm_handle; +struct acpm_xfer; + +int acpm_do_xfer(const struct acpm_handle *handle, struct acpm_xfer *xfer); + +#endif /* __EXYNOS_ACPM_H__ */ diff --git a/include/linux/firmware/samsung/exynos-acpm-protocol.h b/include/linux/firmware/samsung/exynos-acpm-protocol.h new file mode 100644 index 000000000000..f834af20cef8 --- /dev/null +++ b/include/linux/firmware/samsung/exynos-acpm-protocol.h @@ -0,0 +1,55 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * Copyright 2020 Samsung Electronics Co., Ltd. + * Copyright 2020 Google LLC. + * Copyright 2024 Linaro Ltd. + */ + +#ifndef __EXYNOS_ACPM_PROTOCOL_H +#define __EXYNOS_ACPM_PROTOCOL_H + +#include + +struct acpm_msg { + u32 *cmd; + size_t len; +}; + +struct acpm_xfer { + struct acpm_msg tx; + struct acpm_msg rx; + int acpm_chan_id; +}; + +struct acpm_handle; + +struct acpm_pmic_ops { + int (*read_reg)(const struct acpm_handle *handle, int acpm_chan_id, + u8 type, u8 reg, u8 chan, u8 *dest); + int (*bulk_read)(const struct acpm_handle *handle, int acpm_chan_id, + u8 type, u8 reg, u8 chan, u8 count, u8 *buf); + int (*write_reg)(const struct acpm_handle *handle, int acpm_chan_id, + u8 type, u8 reg, u8 chan, u8 value); + int (*bulk_write)(const struct acpm_handle *handle, int acpm_chan_id, + u8 type, u8 reg, u8 chan, u8 count, u8 *buf); + int (*update_reg)(const struct acpm_handle *handle, int acpm_chan_id, + u8 type, u8 reg, u8 chan, u8 value, u8 mask); +}; + +struct acpm_ops { + struct acpm_pmic_ops pmic_ops; +}; + +/** + * struct acpm_handle - Reference to an initialized protocol instance + * @ops: + */ +struct acpm_handle { + struct acpm_ops ops; +}; + +struct device; + +const struct acpm_handle *devm_acpm_get_by_phandle(struct device *dev, + const char *property); +#endif /* __EXYNOS_ACPM_PROTOCOL_H */ From patchwork Fri Dec 20 14:32:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tudor Ambarus X-Patchwork-Id: 13916848 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 1FF13E77188 for ; Fri, 20 Dec 2024 14:36:41 +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:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=1mYnhokjNt0uDzSYYfMK2GDmQyVt4apt3y0nj5Xm9bw=; b=qiKRXpI1jtmzP1+IgSgA81/xX4 bLwcFiiRssov2VPH/yaAhww0RSq+yPYKlhMRL5tSZAUdknQQiIWdzU1G+xrw+qlfpc7uWWiQFBb46 WHC2t+DdcmimbsZB8zLQ1LBw3USw/VWviaEhOXytwDMg76YFsD1dQBigwdalwoJ43GQ1Cy4WN3JKk DQdJ54IfK/7ySd9mKcjbScJqgHci+yijjAgY4iyFoPzFld0rVh/Ec/RdRXMzDPMzOeMEwTUETXoXY WoN2vEoPif1e4PdtAVsg059jXbB1u3AUUjnPalsREE8Wzu+MZYvzKNnZfaxskNrhskZ2YQHU5G3VS cJNWtHmg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tOe7D-00000005A3v-3ATh; Fri, 20 Dec 2024 14:36:31 +0000 Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tOe3q-000000059S6-0i9t for linux-arm-kernel@lists.infradead.org; Fri, 20 Dec 2024 14:33:03 +0000 Received: by mail-wm1-x32e.google.com with SMTP id 5b1f17b1804b1-43625c4a50dso13693445e9.0 for ; Fri, 20 Dec 2024 06:33:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734705180; x=1735309980; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=1mYnhokjNt0uDzSYYfMK2GDmQyVt4apt3y0nj5Xm9bw=; b=SEVgAYS3AarNSK5d/okA80jdVniC8gWkWdFsnlNIKwVZDaP0xkNwjG/EKJLgoT89AV Mrh5ZkXBUxeQiGifbF9W6unoYM5Dkm7OumgbMxLgI6utvC9N4vLOSlZnd0kfWc9E+VNm Hb8ceV5ugHe4URIATkb8o8NvaBaEk6vvp8+9XjrZNgp4xtgZN5OIgaJmgph5n9ze3iEc UxDJ7mfbBpVw4yRbkoagnNX8kpOExdLP73pbWKDfiqbaKBNuPlLkqrJ06r0bPwkiqG9E QTIlIM/zK7YGO2xMPS9Y7rbkBztEcge7zsQvmZVdR2VER60VPlUoajHq8ri+Cx2g/eEr b1zQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734705180; x=1735309980; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=1mYnhokjNt0uDzSYYfMK2GDmQyVt4apt3y0nj5Xm9bw=; b=p0u7ZUS+Sy5m8NjFNVyr1HFL0nPLMY+QUcVdSiFx354mfbcv7ZlfVVJNaiipbS0Wrx Tn3HXnZgMFRro43B/T6oadwEE4ALaoMFzYLzeSGa/Ab7zJyR7mLD5xU9q4QCsCMVsxQD ORr9z0vSPv8ZQ8CZhtM95jJx1LG1Rm9PreGbEjPV5mS2nyhxkwye6zi0riXB8YjSqV4s VfIheRU13IOOBzhWuI2UpszaswjPGvFfs75Bas8q2BoXO5+248RFmX0zYk0RL+u7aVLK 85lVc45g8kOm7LoiV8wz+p9UoAzPX2k5as7W36VYC2xMwZ4Zhf5hVmLRjmYT0YlvpBDZ hNqg== X-Forwarded-Encrypted: i=1; AJvYcCWGvsCF4ym3D9122LA0UXs6oVUjk7Q937kJaUugYEB3renyFmp3HFqCFzRnOLtdsWUe5n4Yg1q2yQNWFdpn+9Kk@lists.infradead.org X-Gm-Message-State: AOJu0Yxzb/MzSVEMTOZnyk7TyzeQp8H2jj9+kTBrUezP8KxhGcm/no8u 3hQ6CMb4xaW+WRZ75dRVhGZsZkz8mp7tEXBgSm9NZxIUdgqOJVtiPYTgKmhANDk= X-Gm-Gg: ASbGncs9Ksj+807zQ1JZs4/yblKnGJNlvgoPrflb7q/2/jUOqeLYI+Z/y1JpUOZ+wsM EtUQtBUUfMym6Wyo2deePWF30IgF7F5nLOI71CoCcuKGDP78uekaPe8njblNphXaULJu/qTPUlA ZNodpTiuOkYxUS7uLNJUTbMMvyWzeQ4gyPyyK3DQt/vjvjP1ZdZaRDb74AW8Bb6TW2RnYzRGyJR mWF7LWEOpFouIMsp3L/esXZFkwA+nUi/ZjxoGrtKjCxkRk7YFae/HljvLAHqo1iQEEO/CJHt5pK XArDvRjnaORdBRntjumgoW+NKKqoPr+cxinh X-Google-Smtp-Source: AGHT+IEySYUHs5Msg3dUau73lIpORU8/P7Ekp5SpHvtYJlD2/+BIvX/q40CI3mk0cfTV9g2X9nmu9Q== X-Received: by 2002:a05:6000:1fae:b0:385:dea3:6059 with SMTP id ffacd0b85a97d-38a223fd3e5mr2354097f8f.49.1734705180210; Fri, 20 Dec 2024 06:33:00 -0800 (PST) Received: from ta2.c.googlers.com (130.173.34.34.bc.googleusercontent.com. [34.34.173.130]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38a1c829235sm4140321f8f.15.2024.12.20.06.32.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Dec 2024 06:32:59 -0800 (PST) From: Tudor Ambarus Date: Fri, 20 Dec 2024 14:32:53 +0000 Subject: [PATCH v5 3/3] MAINTAINERS: add entry for the Samsung Exynos ACPM mailbox protocol MIME-Version: 1.0 Message-Id: <20241220-gs101-acpm-v5-3-4f26b7fb3f5f@linaro.org> References: <20241220-gs101-acpm-v5-0-4f26b7fb3f5f@linaro.org> In-Reply-To: <20241220-gs101-acpm-v5-0-4f26b7fb3f5f@linaro.org> To: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Krzysztof Kozlowski , Alim Akhtar , Jassi Brar Cc: linux-kernel@vger.kernel.org, linux-samsung-soc@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, andre.draszik@linaro.org, kernel-team@android.com, willmcvicker@google.com, peter.griffin@linaro.org, daniel.lezcano@linaro.org, vincent.guittot@linaro.org, ulf.hansson@linaro.org, arnd@arndb.de, Tudor Ambarus X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1734705176; l=1244; i=tudor.ambarus@linaro.org; s=20241212; h=from:subject:message-id; bh=eSZdwYGKTRLMLKjhMwehJVR3CZn1udCQMKHYP9Vi+QM=; b=7GpgLiWRUZQf2xjdHsJ+TT73a5wVceNgNw3meXcEv0/TbaflXZPWfg6NcpISW+QoinH5dAbYr zPhMUOl56SyBjUEhDYjCcNqbdOqEE21RAuDAUJ4U3f+gkEjNZnJmEJ1 X-Developer-Key: i=tudor.ambarus@linaro.org; a=ed25519; pk=uQzE0NXo3dIjeowMTOPCpIiPHEz12IA/MbyzrZVh9WI= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241220_063302_217274_A9D0EAF8 X-CRM114-Status: UNSURE ( 9.01 ) X-CRM114-Notice: Please train this message. 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 Add entry for the Samsung Exynos ACPM mailbox protocol. Signed-off-by: Tudor Ambarus --- MAINTAINERS | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index baf0eeb9a355..5cfec7cac9eb 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -3023,6 +3023,7 @@ F: drivers/*/*s3c24* F: drivers/*/*s3c64xx* F: drivers/*/*s5pv210* F: drivers/clocksource/samsung_pwm_timer.c +F: drivers/firmware/samsung/ F: drivers/memory/samsung/ F: drivers/pwm/pwm-samsung.c F: drivers/soc/samsung/ @@ -20717,6 +20718,15 @@ F: arch/arm64/boot/dts/exynos/exynos850* F: drivers/clk/samsung/clk-exynos850.c F: include/dt-bindings/clock/exynos850.h +SAMSUNG EXYNOS ACPM MAILBOX PROTOCOL +M: Tudor Ambarus +L: linux-kernel@vger.kernel.org +L: linux-samsung-soc@vger.kernel.org +S: Supported +F: Documentation/devicetree/bindings/firmware/google,gs101-acpm-ipc.yaml +F: drivers/firmware/samsung/exynos-acpm* +F: include/linux/firmware/samsung/exynos-acpm-protocol.h + SAMSUNG EXYNOS PSEUDO RANDOM NUMBER GENERATOR (RNG) DRIVER M: Krzysztof Kozlowski L: linux-crypto@vger.kernel.org