From patchwork Mon Aug 28 19:24:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 13368241 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 2E181C83F14 for ; Mon, 28 Aug 2023 19:28:11 +0000 (UTC) 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:References:In-Reply-To: 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: List-Owner; bh=rw8wUJUep1/XagfAaj701sE6oXxoky5H5st/3s2KUKY=; b=O8ZL22Uw06Uaw+ KkqGpmKtm7VU8HTQ+5EoioAG+FWigXpxBcAakfXZWqEW8xKzKqYvsaNuKrCSlPLoAhkQpUobb/TxR 1Gj5Ab4iByNKQ0CLob1Z2NGImteHxLyaFNuAmwXxvz7mIJqfxlgWHTQ6L/aWNcJnk/DmmMvyRS+hO p0idmsXyjHYtWcUyJqZTxWofv4h3zj6D5/Z6TLMPQXA6f21IHMd2K1ihCRnicZwVJ8X/VXZTLLQXH OUuf0lSM/gyS+7KU9QbjIA0bR8WODhUzPJcxE5LSqwNIAaeuKY4na5Atstu/F6Epm4EnUiHHRqNbK 3nYCaX4AmCF9z5atG0bQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qahte-00A969-0j; Mon, 28 Aug 2023 19:27:34 +0000 Received: from mail-wr1-x434.google.com ([2a00:1450:4864:20::434]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qahtI-00A8xW-2L for linux-arm-kernel@lists.infradead.org; Mon, 28 Aug 2023 19:27:15 +0000 Received: by mail-wr1-x434.google.com with SMTP id ffacd0b85a97d-31c615eb6feso2938217f8f.3 for ; Mon, 28 Aug 2023 12:27:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1693250823; x=1693855623; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=wD/cr04vsZ/9/IOH8u0P4R4N+JejbyXPUXltlkLTn0E=; b=M1YCfAkjhG7d0Ax1dScy8AVLJXABarbwhC5Mlo0zc9Ew3M2VGhafoaNLCteOa/m3yD a51pY+t6Juattc/dWgCcW5nI0pvqguxlPp5FJ5vGaAgvMjH1KJoO9MGqXY1f0LbEVuI7 dJKjPfwyZAUduK1/So0X8teePZ51EJP1GYGb9KQA055/SgoaFN3Z3Q8eDsSODuQVesfi g0wRYh8KooCB5ZAbAUhIOIXfrHkPDuslgoYMfLAr3MefJGv3an8ZasW5fR8A78XVetVA euyZ0Es9Hjfyda8lIn2WMO4xWS1bmAZlTwxN+rxdnLC+ZZe9RX5vQ8mxd9qJ/kOV5sCJ rijw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693250823; x=1693855623; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=wD/cr04vsZ/9/IOH8u0P4R4N+JejbyXPUXltlkLTn0E=; b=jrS483jIiRT32p+7Jwwtu7aNqE25VpqBKA+AlKaoWI3pBEjoVeOkRH6bgMgBlp3KH4 Wf2pcXwIvrGUVciljhGRVZrpTi01qrsb0KKvdoSiJJceZcGwSl4Tj+tAd86t3YNMJ09Q A/RuhJXHH/4aS+SDVadqnnqC8fYSp6ae9ZVC8b5hl6Ks38N5G5yjQjpVViJF0cNFCbF3 HuaQXd/f1viHnLCBAL8lTRTQhea0sN3zL6wrDlIzbmZUSgbVaeNYoh/7ODhYfRHTE1td fTg5wpjMJquIx2j/+Hhh+kWcqjUyWb9LmDO47aAT7FESoa7MLsc+rbQ+icsxkOf20Lru mLWg== X-Gm-Message-State: AOJu0YyWiSzuBUsAJZUePbHtF/0ihjJPmOqRdHMpndk3PG2hpCpI7GIC CMNA7UeSvpdg/e7OUObFFmDQNA== X-Google-Smtp-Source: AGHT+IG2DjUhqTBQfx117neGDoGHgAk3CElFSNDlYxMkA8BW06/aoRj0xIELzMxoR+5xz/rb1iL0LQ== X-Received: by 2002:adf:e4c9:0:b0:31a:dbd8:95d4 with SMTP id v9-20020adfe4c9000000b0031adbd895d4mr19219586wrm.12.1693250823568; Mon, 28 Aug 2023 12:27:03 -0700 (PDT) Received: from brgl-uxlite.home ([2a01:cb1d:334:ac00:8bd:7f16:d368:115f]) by smtp.gmail.com with ESMTPSA id i20-20020a5d5234000000b003141f96ed36sm11435319wra.0.2023.08.28.12.27.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Aug 2023 12:27:03 -0700 (PDT) From: Bartosz Golaszewski To: Andy Gross , Bjorn Andersson , Konrad Dybcio , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Catalin Marinas , Will Deacon , Arnd Bergmann , Alex Elder , Srini Kandagatla Cc: kernel@quicinc.com, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Bartosz Golaszewski Subject: [PATCH 01/11] firmware: qcom-scm: drop unneeded 'extern' specifiers Date: Mon, 28 Aug 2023 21:24:57 +0200 Message-Id: <20230828192507.117334-2-bartosz.golaszewski@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230828192507.117334-1-bartosz.golaszewski@linaro.org> References: <20230828192507.117334-1-bartosz.golaszewski@linaro.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230828_122712_765562_ED48E018 X-CRM114-Status: GOOD ( 10.74 ) 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 The 'extern' specifier in front of a function declaration has no effect. Remove all of them from the qcom-scm header. Signed-off-by: Bartosz Golaszewski Reviewed-by: Krzysztof Kozlowski Reviewed-by: Bjorn Andersson --- include/linux/firmware/qcom/qcom_scm.h | 101 ++++++++++++------------- 1 file changed, 48 insertions(+), 53 deletions(-) diff --git a/include/linux/firmware/qcom/qcom_scm.h b/include/linux/firmware/qcom/qcom_scm.h index 250ea4efb7cb..0187fc54249e 100644 --- a/include/linux/firmware/qcom/qcom_scm.h +++ b/include/linux/firmware/qcom/qcom_scm.h @@ -59,12 +59,12 @@ enum qcom_scm_ice_cipher { #define QCOM_SCM_PERM_RW (QCOM_SCM_PERM_READ | QCOM_SCM_PERM_WRITE) #define QCOM_SCM_PERM_RWX (QCOM_SCM_PERM_RW | QCOM_SCM_PERM_EXEC) -extern bool qcom_scm_is_available(void); +bool qcom_scm_is_available(void); -extern int qcom_scm_set_cold_boot_addr(void *entry); -extern int qcom_scm_set_warm_boot_addr(void *entry); -extern void qcom_scm_cpu_power_down(u32 flags); -extern int qcom_scm_set_remote_state(u32 state, u32 id); +int qcom_scm_set_cold_boot_addr(void *entry); +int qcom_scm_set_warm_boot_addr(void *entry); +void qcom_scm_cpu_power_down(u32 flags); +int qcom_scm_set_remote_state(u32 state, u32 id); struct qcom_scm_pas_metadata { void *ptr; @@ -72,54 +72,49 @@ struct qcom_scm_pas_metadata { ssize_t size; }; -extern int qcom_scm_pas_init_image(u32 peripheral, const void *metadata, - size_t size, - struct qcom_scm_pas_metadata *ctx); +int qcom_scm_pas_init_image(u32 peripheral, const void *metadata, size_t size, + struct qcom_scm_pas_metadata *ctx); void qcom_scm_pas_metadata_release(struct qcom_scm_pas_metadata *ctx); -extern int qcom_scm_pas_mem_setup(u32 peripheral, phys_addr_t addr, - phys_addr_t size); -extern int qcom_scm_pas_auth_and_reset(u32 peripheral); -extern int qcom_scm_pas_shutdown(u32 peripheral); -extern bool qcom_scm_pas_supported(u32 peripheral); - -extern int qcom_scm_io_readl(phys_addr_t addr, unsigned int *val); -extern int qcom_scm_io_writel(phys_addr_t addr, unsigned int val); - -extern bool qcom_scm_restore_sec_cfg_available(void); -extern int qcom_scm_restore_sec_cfg(u32 device_id, u32 spare); -extern int qcom_scm_iommu_secure_ptbl_size(u32 spare, size_t *size); -extern int qcom_scm_iommu_secure_ptbl_init(u64 addr, u32 size, u32 spare); -extern int qcom_scm_iommu_set_cp_pool_size(u32 spare, u32 size); -extern int qcom_scm_mem_protect_video_var(u32 cp_start, u32 cp_size, - u32 cp_nonpixel_start, - u32 cp_nonpixel_size); -extern int qcom_scm_assign_mem(phys_addr_t mem_addr, size_t mem_sz, - u64 *src, - const struct qcom_scm_vmperm *newvm, - unsigned int dest_cnt); - -extern bool qcom_scm_ocmem_lock_available(void); -extern int qcom_scm_ocmem_lock(enum qcom_scm_ocmem_client id, u32 offset, - u32 size, u32 mode); -extern int qcom_scm_ocmem_unlock(enum qcom_scm_ocmem_client id, u32 offset, - u32 size); - -extern bool qcom_scm_ice_available(void); -extern int qcom_scm_ice_invalidate_key(u32 index); -extern int qcom_scm_ice_set_key(u32 index, const u8 *key, u32 key_size, - enum qcom_scm_ice_cipher cipher, - u32 data_unit_size); - -extern bool qcom_scm_hdcp_available(void); -extern int qcom_scm_hdcp_req(struct qcom_scm_hdcp_req *req, u32 req_cnt, - u32 *resp); - -extern int qcom_scm_iommu_set_pt_format(u32 sec_id, u32 ctx_num, u32 pt_fmt); -extern int qcom_scm_qsmmu500_wait_safe_toggle(bool en); - -extern int qcom_scm_lmh_dcvsh(u32 payload_fn, u32 payload_reg, u32 payload_val, - u64 limit_node, u32 node_id, u64 version); -extern int qcom_scm_lmh_profile_change(u32 profile_id); -extern bool qcom_scm_lmh_dcvsh_available(void); +int qcom_scm_pas_mem_setup(u32 peripheral, phys_addr_t addr, phys_addr_t size); +int qcom_scm_pas_auth_and_reset(u32 peripheral); +int qcom_scm_pas_shutdown(u32 peripheral); +bool qcom_scm_pas_supported(u32 peripheral); + +int qcom_scm_io_readl(phys_addr_t addr, unsigned int *val); +int qcom_scm_io_writel(phys_addr_t addr, unsigned int val); + +bool qcom_scm_restore_sec_cfg_available(void); +int qcom_scm_restore_sec_cfg(u32 device_id, u32 spare); +int qcom_scm_iommu_secure_ptbl_size(u32 spare, size_t *size); +int qcom_scm_iommu_secure_ptbl_init(u64 addr, u32 size, u32 spare); +int qcom_scm_iommu_set_cp_pool_size(u32 spare, u32 size); +int qcom_scm_mem_protect_video_var(u32 cp_start, u32 cp_size, + u32 cp_nonpixel_start, + u32 cp_nonpixel_size); +int qcom_scm_assign_mem(phys_addr_t mem_addr, size_t mem_sz, u64 *src, + const struct qcom_scm_vmperm *newvm, + unsigned int dest_cnt); + +bool qcom_scm_ocmem_lock_available(void); +int qcom_scm_ocmem_lock(enum qcom_scm_ocmem_client id, u32 offset, + u32 size, u32 mode); +int qcom_scm_ocmem_unlock(enum qcom_scm_ocmem_client id, u32 offset, u32 size); + +bool qcom_scm_ice_available(void); +int qcom_scm_ice_invalidate_key(u32 index); +int qcom_scm_ice_set_key(u32 index, const u8 *key, u32 key_size, + enum qcom_scm_ice_cipher cipher, + u32 data_unit_size); + +bool qcom_scm_hdcp_available(void); +int qcom_scm_hdcp_req(struct qcom_scm_hdcp_req *req, u32 req_cnt, u32 *resp); + +int qcom_scm_iommu_set_pt_format(u32 sec_id, u32 ctx_num, u32 pt_fmt); +int qcom_scm_qsmmu500_wait_safe_toggle(bool en); + +int qcom_scm_lmh_dcvsh(u32 payload_fn, u32 payload_reg, u32 payload_val, + u64 limit_node, u32 node_id, u64 version); +int qcom_scm_lmh_profile_change(u32 profile_id); +bool qcom_scm_lmh_dcvsh_available(void); #endif From patchwork Mon Aug 28 19:24:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 13368231 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 10A73C83F12 for ; Mon, 28 Aug 2023 19:27:49 +0000 (UTC) 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:References:In-Reply-To: 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: List-Owner; bh=Atlveu5r4VX0wBWi/t55VG547J6BK43bpRY/9Tfqpok=; b=snqDBy2or+axhl HaDmGN5UUIM/p1rj8Ac7GvG/asywZlkbhGhXzHtnOlZRCQJ7kQTZwTg2LmINlSYZoS+9nJcyNOc05 2yQH0DfFa4Alf23sEP/JAe9odT3fcaVi+8VzMbTK8OqaOKv18PMzLQMGFXodEwFc2Dl4d667xxBFY KakmHcVpFFZPAMQg4Ph0APbvPcV7K9CK0+CDpGaDf2XFgpp07oA2ZWn6eiq0+wtRgrKd/hAJgiCyV gzZuBqEDFwwVW8/hPU3i/3ee+xctrkHn+iUee6BiY6LaFjXWy+3NRtNbC4+Zfi5ea5uVRk4BK0fkv ZL7i9XyOUA+41gDttKcA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qahtM-00A918-1Y; Mon, 28 Aug 2023 19:27:16 +0000 Received: from mail-wr1-x42d.google.com ([2a00:1450:4864:20::42d]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qahtI-00A8xb-2M for linux-arm-kernel@lists.infradead.org; Mon, 28 Aug 2023 19:27:14 +0000 Received: by mail-wr1-x42d.google.com with SMTP id ffacd0b85a97d-31aeee69de0so3031606f8f.2 for ; Mon, 28 Aug 2023 12:27:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1693250824; x=1693855624; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ZNNFEJol507fnnll/GiCNMd/EJ+bjC8uSrL8Nl+Ny9g=; b=j7RA/+VrPOlZBQ5ZrjTCRD88rvjaQzRCprr3Fjo2CBkgJh8MqVG4MImUUWi2SxaHxj vKqPWnPvy1l29LUin6CtTOosVFYO1ChAQcdMnhJMFlUU9sIjzsy6KGcuxrnkMkQGrENq aBsoy+/EDStX/CnqvBQ+lZyrkExXfg46rvK1y8eqeXbs1v2c1bHeaJKgG1tgirOJeAdc aynPcSXjqdoi1+x+/Ir489fr5QoC5W776XPcdBTDMlRxrPZG2HbvtzD5D9Pl+g1LrOz7 1NyD0axOq9zYjRBiPjgAuMAsv2JtfqVxZ5xCRzGAryJj7qlAxIVARgyPCmrgWdvUVoAP U76w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693250824; x=1693855624; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ZNNFEJol507fnnll/GiCNMd/EJ+bjC8uSrL8Nl+Ny9g=; b=Uv6BGbvZP1lIq+3rVvXG62uOfSudHav2ww8PuwGnXNo1Z/LRCczHeopbFdXzi3TyPH k81E3ohjFQ0sQn8a7boWzLMPiEmbScGZUjR1ioHaArL/rmWU7ywC+UwUxHXZI29HAOGw 6PKUFHatKX2eWoTCiLxJ5QjxKQ6iVLp112BV8KkLlDDKXi/uWwPZ2dnmxmLkg2cnPSxJ g0gPjFcT/R+HbZK0jTw9IWSeIz++BW2PTTV6cXO5xgN2mx65vZMzwzEhmULAeoEQZ4fd GuXYyPgnIDXhodQNhkYbGF2D1JWAQz2NYYxgrAjAr+QjmCaP1tgTvIlYEeo4XwkXzZR/ +S0g== X-Gm-Message-State: AOJu0YwX7H1/b44KVUlDLPErRI1dnshe/yx/SoBBto0CryZ9j7AdqEI2 oghlB2lyM8tSGvyRy8XdXbrZLg== X-Google-Smtp-Source: AGHT+IFuspge895OlO/pS7GkSpr8Z2Vw74TPV8e/HYmtxE5aA4G5rRHHYITyGt3xIizf7aHsvM3LoQ== X-Received: by 2002:adf:f011:0:b0:317:6965:ef4d with SMTP id j17-20020adff011000000b003176965ef4dmr20205597wro.56.1693250824733; Mon, 28 Aug 2023 12:27:04 -0700 (PDT) Received: from brgl-uxlite.home ([2a01:cb1d:334:ac00:8bd:7f16:d368:115f]) by smtp.gmail.com with ESMTPSA id i20-20020a5d5234000000b003141f96ed36sm11435319wra.0.2023.08.28.12.27.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Aug 2023 12:27:04 -0700 (PDT) From: Bartosz Golaszewski To: Andy Gross , Bjorn Andersson , Konrad Dybcio , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Catalin Marinas , Will Deacon , Arnd Bergmann , Alex Elder , Srini Kandagatla Cc: kernel@quicinc.com, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Bartosz Golaszewski Subject: [PATCH 02/11] firmware: qcom-scm: order includes alphabetically Date: Mon, 28 Aug 2023 21:24:58 +0200 Message-Id: <20230828192507.117334-3-bartosz.golaszewski@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230828192507.117334-1-bartosz.golaszewski@linaro.org> References: <20230828192507.117334-1-bartosz.golaszewski@linaro.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230828_122712_767754_C4B4D9F4 X-CRM114-Status: GOOD ( 10.18 ) 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 For easier maintenance order the included headers in qcom_scm.c alphabetically. Signed-off-by: Bartosz Golaszewski Reviewed-by: Krzysztof Kozlowski --- drivers/firmware/qcom_scm.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/drivers/firmware/qcom_scm.c b/drivers/firmware/qcom_scm.c index fde33acd46b7..980fcfa20b9f 100644 --- a/drivers/firmware/qcom_scm.c +++ b/drivers/firmware/qcom_scm.c @@ -2,24 +2,25 @@ /* Copyright (c) 2010,2015,2019 The Linux Foundation. All rights reserved. * Copyright (C) 2015 Linaro Ltd. */ -#include -#include -#include + +#include +#include #include #include -#include #include +#include +#include +#include #include +#include #include -#include -#include #include #include #include #include -#include +#include #include -#include +#include #include "qcom_scm.h" From patchwork Mon Aug 28 19:24:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 13368233 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 415AFC71153 for ; Mon, 28 Aug 2023 19:28:02 +0000 (UTC) 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:References:In-Reply-To: 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: List-Owner; bh=J/LMfInkrEpo9OiFEDCJj7CzRDdJi/TRdB4yTjmgMn4=; b=U+yOmQGoibUHaa lKatKGIzj3EasyfQmgyamSAM7QETpc3E8TRSdgIR7uIZWmWJclZp/vHpvZB1AZZD6rc1KxHfY1yxO L+wNnYSXfBLSYKoR6AlkglItYi8Zw+toGj5FxP4NMUmmYRIbAmcZSimD3meoXU0ITdm46lEikWJUt XTWSa2M9DRFt6hMjWp9zfcv2ZK7kyRLvvvBPCFTftZsJMJR7NC3YDc1V1DmGBtbDdAVy5J9E+CnsP GDlcGzRpXdAYiLWcj5yuR+/mlFQUpKzsHgO6nLnvjXiHCZ4Jj8ba781cJvBYHGQ1KQfWPAQDuYXxV dHt57rAr20w7oSekkOww==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qahtd-00A95K-0R; Mon, 28 Aug 2023 19:27:33 +0000 Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qahtJ-00A8xi-1L for linux-arm-kernel@lists.infradead.org; Mon, 28 Aug 2023 19:27:15 +0000 Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-401d2e11dacso1808565e9.0 for ; Mon, 28 Aug 2023 12:27:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1693250826; x=1693855626; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=713tM2MtTN06BKtmpTKPtHYKAypTeU06f4AnOlNhYD4=; b=CSqa+pEoDUW2H0ZlraiWwUc3xrWOrJ1YaHmkjhFa1p/azSB734HWr7cU7e+myIPnxY qDsDy9RJtc6PWOZi806K/E6XsRbqhVy78B/oFwKTyW+g05lo+dhP4G62hGqrlQ641ZRU P8VP6sbAPFh7XXebDCKtOJ70udNb6SwiNfDapAw4WM4QHiBs1L6MYTO4T/+WXxLsQzk0 zIDoQGuZovksV9kVbawJ4xMgU2RlWI4uFaqB0yceUpKqZgcbSbYm5R1v8e88gGNG0KjH a5g9KaWoA3XNQ1D9zdItbOL4waj9PwpuPKgLNZQMhF8maGHr7j0ai4dCzdIUHby5GJf2 Rccg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693250826; x=1693855626; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=713tM2MtTN06BKtmpTKPtHYKAypTeU06f4AnOlNhYD4=; b=Bnxg0wtIuEZI3LXlFMushvVJV/3jtPueJVhBFquc29ktFx8/HKBCzy/oxDiyxuFV3l 8gKAptR17qERuAXR9jIQFltd6J1UGkwQfCPuE8DEFMA5p7lnbFrxcrAEr6w9nzhePBOk 2+Gz7CYWnXFOGzqJ5NHe1NRrigLhipJEyvMF7WYHDWWmkq0jRdB7988N+5qmeEo0qRFD nDQeQTEkpTbdHlaZcK0zvf16pSmqah7wSL0/v+MUCOG4livEDnSxZE3T8IkPHcLinqZS 7Xg4y/Qi5ljsTE2wa81VXjiwv5u4PgCu8ZJ4aTrX7OIUlBD8zJ3N+2XGW+PrtMQf/N90 tzZA== X-Gm-Message-State: AOJu0Yz1lh45dQNLx3tldYd6424pKicT6+kXLDw+aFP8rkaCl3CE2ojF cHr7h7WX47iPSkcEg4Foa62sGA== X-Google-Smtp-Source: AGHT+IFP03AKHAfr/hAQD0gGF3wtYUFTciEZ8PKvTMJRFIBUMmxXBs7iwRUVJNseZQVqoKpOwBLzaw== X-Received: by 2002:adf:e682:0:b0:319:8c99:989a with SMTP id r2-20020adfe682000000b003198c99989amr369735wrm.8.1693250825898; Mon, 28 Aug 2023 12:27:05 -0700 (PDT) Received: from brgl-uxlite.home ([2a01:cb1d:334:ac00:8bd:7f16:d368:115f]) by smtp.gmail.com with ESMTPSA id i20-20020a5d5234000000b003141f96ed36sm11435319wra.0.2023.08.28.12.27.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Aug 2023 12:27:05 -0700 (PDT) From: Bartosz Golaszewski To: Andy Gross , Bjorn Andersson , Konrad Dybcio , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Catalin Marinas , Will Deacon , Arnd Bergmann , Alex Elder , Srini Kandagatla Cc: kernel@quicinc.com, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Bartosz Golaszewski Subject: [PATCH 03/11] firmware: qcom-scm: atomically assign and read the global __scm pointer Date: Mon, 28 Aug 2023 21:24:59 +0200 Message-Id: <20230828192507.117334-4-bartosz.golaszewski@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230828192507.117334-1-bartosz.golaszewski@linaro.org> References: <20230828192507.117334-1-bartosz.golaszewski@linaro.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230828_122713_453679_102E12A1 X-CRM114-Status: GOOD ( 14.18 ) 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 Checking for the availability of SCM bridge can happen from any context. It's only by chance that we haven't run into concurrency issues but with the upcoming SHM Bridge driver that will be initiated at the same initcall level, we need to assure the assignment and readback of the __scm pointer is atomic. Signed-off-by: Bartosz Golaszewski --- drivers/firmware/qcom_scm.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/firmware/qcom_scm.c b/drivers/firmware/qcom_scm.c index 980fcfa20b9f..422de70faff8 100644 --- a/drivers/firmware/qcom_scm.c +++ b/drivers/firmware/qcom_scm.c @@ -1331,7 +1331,7 @@ static int qcom_scm_find_dload_address(struct device *dev, u64 *addr) */ bool qcom_scm_is_available(void) { - return !!__scm; + return !!READ_ONCE(__scm); } EXPORT_SYMBOL(qcom_scm_is_available); @@ -1477,8 +1477,8 @@ static int qcom_scm_probe(struct platform_device *pdev) if (ret) return ret; - __scm = scm; - __scm->dev = &pdev->dev; + scm->dev = &pdev->dev; + WRITE_ONCE(__scm, scm); init_completion(&__scm->waitq_comp); From patchwork Mon Aug 28 19:25:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 13368232 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 6DC7EC83F12 for ; Mon, 28 Aug 2023 19:28:01 +0000 (UTC) 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:References:In-Reply-To: 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: List-Owner; bh=DkF6NzC+9Opm40dHZkv8/Lk9A8H8MaD7CGw9Nu88Ex4=; b=mR5vfDCuUqP7Zg 8QHSrtEp7NYe4925dtdi3O5/e9u6TV5Wb5MfrpqsyBLTGNk8lXj+7imrY5DkmIiJ4+G1/2cVrRFfG gmS5TSZXvHbgXauROc6IqqQAf0JHYSnh64hrHmD/Nt7aktuE2gKkgKDZ5aK9CzBrntAU9Vufsuo4H QJWB6BYerDWsvIdEGcrH3wuNzkOS3HNQjY+lC2Dvev31pn+naDoJ6YUT4BHTT9BTbbgtgrG0RfyPg 6zcZECzATSi5eaAzPqNZQdTX8ksG1WhAtBeKz1/KpnUi9enYWqRBhlKXyLL/ZrW87KLarVTOeFvc/ JMYPsCKtB0BBV2RYTQEg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qahtd-00A95g-26; Mon, 28 Aug 2023 19:27:33 +0000 Received: from mail-wr1-x431.google.com ([2a00:1450:4864:20::431]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qahtJ-00A8xp-0B for linux-arm-kernel@lists.infradead.org; Mon, 28 Aug 2023 19:27:16 +0000 Received: by mail-wr1-x431.google.com with SMTP id ffacd0b85a97d-31c7912416bso3207504f8f.1 for ; Mon, 28 Aug 2023 12:27:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1693250827; x=1693855627; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=q9IIbmqeXUEZrQQd9nJYDsQR20cl+CEuhTdfBNfLqNk=; b=U2c+D7W/DluCXF1TF7FZqcriMIZUK3c7RhavvfomxvpcFpDf8yDsO+W/TNBct8qfUV gAJqZGyE7rdbDYxbl+y3xmAYAP1l257zDnWa04rZZMlTwQzTGJeeHwfTeAXpSFVA+AoO +7vOphBP2vq2jqyVzTaaKWpF7XaUvqQ1RG5GY3jK5npXW2NnI31oKQ6YbZoo2gpbUgE0 d+GkWEDpPGi15djFRVH1GJCygrAE9ylq89zKIvKuq3sEDbMUIHE7SvcIS94/xP15JIzb PTB1TS6WF8wDllBXS0UfrL0VF7d1YHoMz6RGHU+H7XThrSmFLeITvkAen7ZEQ2ERJtFI YmNQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693250827; x=1693855627; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=q9IIbmqeXUEZrQQd9nJYDsQR20cl+CEuhTdfBNfLqNk=; b=XUDo9Qr+n4k/sHC/ccqULgKPQdHwA+gefu1ZEX8LhB6MkaGZZvVSCYRLQ3FSlFkap8 Cb1YqrW0g7Oa215FL9lT3M7+gaNAX5gw7X57lDqqzaedKAoqURQZ9VIL9LLbUCraGNLu yepwGEvfgp8iu6TgGDf9rWmv/Eu+nnBjNXwBux4JLJmhe76gKzFn+3ToqY3hcQbbNtYp aqjQWsbvOszTiZbw2l9Su5S5+Fw3QXmTsnEhUlqiAYPBvfATpQWlHcVW2wENrWRjmNnR khyxlbbRd3pqTWaEUFu8r3IkJWSa4ZhQsA8t+zvSiwkmlKcfOvYX0sNwY62sjZejdPt+ VhFg== X-Gm-Message-State: AOJu0YxwI5R34vQwksKdTFNOyuzMi37YT8Olf7VR3MFod14Z5rPSMTOV e6rDlZ7SqBWD/AWZ2fC16oQluw== X-Google-Smtp-Source: AGHT+IGELnRw3OVm+F5lO+SlIxnQc7iifWQmxaW6b93Q/z2oVixC1dvmEOehQrkSCMkjDmlRE7oFiA== X-Received: by 2002:adf:ea10:0:b0:31a:ed75:75e9 with SMTP id q16-20020adfea10000000b0031aed7575e9mr20375035wrm.13.1693250827195; Mon, 28 Aug 2023 12:27:07 -0700 (PDT) Received: from brgl-uxlite.home ([2a01:cb1d:334:ac00:8bd:7f16:d368:115f]) by smtp.gmail.com with ESMTPSA id i20-20020a5d5234000000b003141f96ed36sm11435319wra.0.2023.08.28.12.27.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Aug 2023 12:27:06 -0700 (PDT) From: Bartosz Golaszewski To: Andy Gross , Bjorn Andersson , Konrad Dybcio , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Catalin Marinas , Will Deacon , Arnd Bergmann , Alex Elder , Srini Kandagatla Cc: kernel@quicinc.com, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Bartosz Golaszewski Subject: [PATCH 04/11] firmware: qcom-scm: add support for SHM bridge operations Date: Mon, 28 Aug 2023 21:25:00 +0200 Message-Id: <20230828192507.117334-5-bartosz.golaszewski@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230828192507.117334-1-bartosz.golaszewski@linaro.org> References: <20230828192507.117334-1-bartosz.golaszewski@linaro.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230828_122713_373520_024D2352 X-CRM114-Status: GOOD ( 15.78 ) 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 low-level primitives for enabling SHM bridge support, creating SHM bridge pools and testing the availability of SHM bridges to qcom-scm. We don't yet provide a way to destroy the bridges as the first user will not require it. Signed-off-by: Bartosz Golaszewski --- drivers/firmware/qcom_scm.c | 83 ++++++++++++++++++++++++++ drivers/firmware/qcom_scm.h | 3 + include/linux/firmware/qcom/qcom_scm.h | 8 +++ 3 files changed, 94 insertions(+) diff --git a/drivers/firmware/qcom_scm.c b/drivers/firmware/qcom_scm.c index 422de70faff8..f45d5a424424 100644 --- a/drivers/firmware/qcom_scm.c +++ b/drivers/firmware/qcom_scm.c @@ -31,6 +31,8 @@ module_param(download_mode, bool, 0); #define SCM_HAS_IFACE_CLK BIT(1) #define SCM_HAS_BUS_CLK BIT(2) +#define SCM_SHM_BRIDGE_NOTSUPP 4 + struct qcom_scm { struct device *dev; struct clk *core_clk; @@ -45,6 +47,8 @@ struct qcom_scm { int scm_vote_count; u64 dload_mode_addr; + + bool shm_bridge_enabled; }; struct qcom_scm_current_perm_info { @@ -1248,6 +1252,85 @@ bool qcom_scm_lmh_dcvsh_available(void) } EXPORT_SYMBOL(qcom_scm_lmh_dcvsh_available); +bool qcom_scm_shm_bridge_available(void) +{ + if (!qcom_scm_is_available()) + return false; + + return READ_ONCE(__scm->shm_bridge_enabled); +} +EXPORT_SYMBOL_GPL(qcom_scm_shm_bridge_available); + +/* + * Must not be called unless qcom_scm_shm_bridge_available() returned true + * first. + */ +int qcom_scm_enable_shm_bridge(void) +{ + struct qcom_scm_desc desc = { + .svc = QCOM_SCM_SVC_MP, + .cmd = QCOM_SCM_MP_SHM_BRIDGE_ENABLE, + .owner = ARM_SMCCC_OWNER_SIP + }; + + struct qcom_scm_res res; + int ret; + + ret = qcom_scm_call(__scm->dev, &desc, &res); + if (!ret && !res.result[0]) + WRITE_ONCE(__scm->shm_bridge_enabled, true); + + if (res.result[0] == SCM_SHM_BRIDGE_NOTSUPP) + ret = -EOPNOTSUPP; + + return ret ?: res.result[0]; +} +EXPORT_SYMBOL_GPL(qcom_scm_enable_shm_bridge); + +int qcom_scm_create_shm_bridge(struct device *dev, u64 pfn_and_ns_perm_flags, + u64 ipfn_and_s_perm_flags, u64 size_and_flags, + u64 ns_vmids, u64 *handle) +{ + struct qcom_scm_desc desc = { + .svc = QCOM_SCM_SVC_MP, + .cmd = QCOM_SCM_MP_SHM_BRDIGE_CREATE, + .owner = ARM_SMCCC_OWNER_SIP + }; + + struct qcom_scm_res res; + int ret; + + desc.args[0] = pfn_and_ns_perm_flags; + desc.args[1] = ipfn_and_s_perm_flags; + desc.args[2] = size_and_flags; + desc.args[3] = ns_vmids; + + desc.arginfo = QCOM_SCM_ARGS(4, QCOM_SCM_VAL, QCOM_SCM_VAL, + QCOM_SCM_VAL, QCOM_SCM_VAL); + + ret = qcom_scm_call(dev ?: __scm->dev, &desc, &res); + + if (handle && !ret) + *handle = res.result[1]; + + return ret ?: res.result[0]; +} +EXPORT_SYMBOL_GPL(qcom_scm_create_shm_bridge); + +int qcom_scm_delete_shm_bridge(struct device *dev, u64 handle) +{ + struct qcom_scm_desc desc = { + .svc = QCOM_SCM_SVC_MP, + .cmd = QCOM_SCM_MP_SHM_BRIDGE_DELETE, + .owner = ARM_SMCCC_OWNER_SIP, + .args[0] = handle, + .arginfo = QCOM_SCM_ARGS(1, QCOM_SCM_VAL), + }; + + return qcom_scm_call(dev ?: __scm->dev, &desc, NULL); +} +EXPORT_SYMBOL_GPL(qcom_scm_delete_shm_bridge); + int qcom_scm_lmh_profile_change(u32 profile_id) { struct qcom_scm_desc desc = { diff --git a/drivers/firmware/qcom_scm.h b/drivers/firmware/qcom_scm.h index e6e512bd57d1..44d60d06344b 100644 --- a/drivers/firmware/qcom_scm.h +++ b/drivers/firmware/qcom_scm.h @@ -111,6 +111,9 @@ extern int scm_legacy_call(struct device *dev, const struct qcom_scm_desc *desc, #define QCOM_SCM_MP_IOMMU_SET_CP_POOL_SIZE 0x05 #define QCOM_SCM_MP_VIDEO_VAR 0x08 #define QCOM_SCM_MP_ASSIGN 0x16 +#define QCOM_SCM_MP_SHM_BRIDGE_ENABLE 0x1c +#define QCOM_SCM_MP_SHM_BRIDGE_DELETE 0x1d +#define QCOM_SCM_MP_SHM_BRDIGE_CREATE 0x1e #define QCOM_SCM_SVC_OCMEM 0x0f #define QCOM_SCM_OCMEM_LOCK_CMD 0x01 diff --git a/include/linux/firmware/qcom/qcom_scm.h b/include/linux/firmware/qcom/qcom_scm.h index 0187fc54249e..100770380d97 100644 --- a/include/linux/firmware/qcom/qcom_scm.h +++ b/include/linux/firmware/qcom/qcom_scm.h @@ -5,6 +5,7 @@ #ifndef __QCOM_SCM_H #define __QCOM_SCM_H +#include #include #include #include @@ -117,4 +118,11 @@ int qcom_scm_lmh_dcvsh(u32 payload_fn, u32 payload_reg, u32 payload_val, int qcom_scm_lmh_profile_change(u32 profile_id); bool qcom_scm_lmh_dcvsh_available(void); +bool qcom_scm_shm_bridge_available(void); +int qcom_scm_enable_shm_bridge(void); +int qcom_scm_create_shm_bridge(struct device *dev, u64 pfn_and_ns_perm_flags, + u64 ipfn_and_s_perm_flags, u64 size_and_flags, + u64 ns_vmids, u64 *handle); +int qcom_scm_delete_shm_bridge(struct device *dev, u64 handle); + #endif From patchwork Mon Aug 28 19:25:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 13368238 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 65427C83F14 for ; Mon, 28 Aug 2023 19:28:08 +0000 (UTC) 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:References:In-Reply-To: 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: List-Owner; bh=gkw6rrRrr7PJYLDzJ9HiKuX+fZQxYcJOBw+KNoWn7eQ=; b=nVP1OvgZ4Wz0Ca cCzcxxMAC+a6Copk9agqwRaE6rv8aEaQX9rKvcEFHACPK5QL4135kyvoccaFfTmhrWeTsrfsrYDpS uawMc+eIVa5JlJsFBeuWhE8nPznBF1eRSAVdh/cXeWo31AxJ0fFnK9IIvqqJwqPYsKrWhd33L/76g 3g0U5Op00xVXqvzrZ3mHGgWc7IqTW/FUMgavT1fts5i4TRjhIJGb/fdrNekEyoBa95wpPFo3iR8HH eVOMFaoTvLXw7As5KD9L5jbycyShhxxSb1MfwdOOdAGQ/rShTwH58/TYkfWC8o5s8peX+Df2wjmCz DRJh7mHwMR7J/w2Qh8fw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qahtb-00A94j-3C; Mon, 28 Aug 2023 19:27:31 +0000 Received: from mail-wr1-x42e.google.com ([2a00:1450:4864:20::42e]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qahtJ-00A8xz-17 for linux-arm-kernel@lists.infradead.org; Mon, 28 Aug 2023 19:27:15 +0000 Received: by mail-wr1-x42e.google.com with SMTP id ffacd0b85a97d-3110ab7110aso3016649f8f.3 for ; Mon, 28 Aug 2023 12:27:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1693250828; x=1693855628; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=3ZrHrixjJTfHp+8KzhmU3pank8Phapb7i2mtd1W6FyY=; b=puIo2IYmdzRkxcG9l3U/HA/Sg/bMR7ddZh06USIZ8WWAxcqxmQ3oXvKlCP1rIvo/1f EJ+FfF2G9TuE01YI3u4K0goBfEGO4WTdfb+2f21LZakHyuWjX/6VqShPJ8dv5TbKaW6h +eon8GiAyTPeBWj61BPnSyg3okN1d+yOceB2dcNbiTDfwyzU5svZPhMqP2g6DGMkykhY Dr8qevmDAmw7xuM3bXc0Rrg40p7Kk8oU8BmjAaapE/Qe3HvwBgAlz7bLVEzNK7KzpQyF q3220k3N5ul3HDieX1NCJ2xahnND6ArBMyPGv7F1w0OcHiBRbW9EuewTofxa4kgryipL tztw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693250828; x=1693855628; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=3ZrHrixjJTfHp+8KzhmU3pank8Phapb7i2mtd1W6FyY=; b=JcUP/IpFkedBbDLBGussjdvoJeCiIsB16L+MzIHuhI0mmsbsERAQC7AdBDihwNVCpc XU/bB1wfmV98ar6a73Jx8tZhTGcw7zBU+fY8cZiScb8WOqmBSADQeJwhHv+GPkQyTQIi qgm5WhkmQw0brRRR9XcwWQQlprHvVGhdDm6IXvQy0WcOcFDDhaOBKe9HtXF9KAWwymWr eFub2OEt2R2rAQDkZLWx6f7fUJ7QJkyGM2NGB/Pdvs4+BRLScai5EXMIAnp3Pkh0VK4S c4a8cBBYbj6tBvnJgfreh2WaLkOd9PBhVmHhIZJAQKXJ01kSV/cHBXJye3imB2+WRCoG jHiQ== X-Gm-Message-State: AOJu0YwOcbJnR5TDQHs6Hldrm37esL5cjYn42QJcPTzkF03AJCZvzyj5 QfM4SDWlKTIXLhc5228jXmqgjA== X-Google-Smtp-Source: AGHT+IEEGru84SUHFfCkbyGAXl1BVPJ1qKlE94RFGVLiLHe9WynVK7WBIN5FA+kPUAZAITnY+rRsNQ== X-Received: by 2002:adf:ec11:0:b0:313:f4e2:901d with SMTP id x17-20020adfec11000000b00313f4e2901dmr20276102wrn.22.1693250828356; Mon, 28 Aug 2023 12:27:08 -0700 (PDT) Received: from brgl-uxlite.home ([2a01:cb1d:334:ac00:8bd:7f16:d368:115f]) by smtp.gmail.com with ESMTPSA id i20-20020a5d5234000000b003141f96ed36sm11435319wra.0.2023.08.28.12.27.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Aug 2023 12:27:07 -0700 (PDT) From: Bartosz Golaszewski To: Andy Gross , Bjorn Andersson , Konrad Dybcio , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Catalin Marinas , Will Deacon , Arnd Bergmann , Alex Elder , Srini Kandagatla Cc: kernel@quicinc.com, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Bartosz Golaszewski Subject: [PATCH 05/11] dt-bindings: document the Qualcomm TEE Shared Memory Bridge Date: Mon, 28 Aug 2023 21:25:01 +0200 Message-Id: <20230828192507.117334-6-bartosz.golaszewski@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230828192507.117334-1-bartosz.golaszewski@linaro.org> References: <20230828192507.117334-1-bartosz.golaszewski@linaro.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230828_122713_380868_C9C252C9 X-CRM114-Status: GOOD ( 14.15 ) 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 Device Tree bindings for Qualcomm TEE Shared Memory Brige - a mechanism that allows sharing memory buffers between trustzone and the kernel. Signed-off-by: Bartosz Golaszewski --- .../bindings/firmware/qcom,shm-bridge.yaml | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 Documentation/devicetree/bindings/firmware/qcom,shm-bridge.yaml diff --git a/Documentation/devicetree/bindings/firmware/qcom,shm-bridge.yaml b/Documentation/devicetree/bindings/firmware/qcom,shm-bridge.yaml new file mode 100644 index 000000000000..f660962b7b86 --- /dev/null +++ b/Documentation/devicetree/bindings/firmware/qcom,shm-bridge.yaml @@ -0,0 +1,36 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/firmware/qcom,shm-bridge.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: QCOM Shared Memory Bridge + +description: | + Qualcomm TEE Shared Memory Bridge allows sharing limited areas of kernel's + virtual memory with the trustzone in order to avoid mapping the entire RAM. + +maintainers: + - Bjorn Andersson + - Konrad Dybcio + - Bartosz Golaszewski + +properties: + compatible: + items: + - enum: + - qcom,shm-bridge-sa8775p + - qcom,shm-bridge-sm8150 + - qcom,shm-bridge-sm8450 + - const: qcom,shm-bridge + +required: + - compatible + +additionalProperties: false + +examples: + - | + firmware { + compatible = "qcom,shm-bridge-sa8775p", "qcom,shm-bridge"; + }; From patchwork Mon Aug 28 19:25:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 13368240 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 C737EC83F15 for ; Mon, 28 Aug 2023 19:28:09 +0000 (UTC) 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:References:In-Reply-To: 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: List-Owner; bh=b9uOfcBz+RW+GhUvSW64GT9T+bC4464Fi12TkUcHlqg=; b=Z1mADlTAL6T4ik /Y33eHE9GiY6QJFuvFEr9alUejeTpVGUjDo9rfmTJOKiVdeRaCQjQdusoAJL3/+miBcW34jcqfxtx 5U4rw2s7EFQqD8HojJbvbhjF0tFyG/JZRJgDM4SG2qRWzwHxGXZsEv75Q4PJ96HhDC/GnAF6QbLgl ZYXKhqmkCgS94c3V4e2lgB80usfpP5tw388QJsxHLEKC768tkkQt8E+GOXGkRPp6uv1DjcSliFuV4 tv+jbW/6fMPKAt0bLJwNzvim3yK6e7manhOlCamT7TVSwDtn0nmZj+RchzONY8wINyOGQvA3ybWlJ bYUfoDBOa4h0R85I4umA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qahte-00A96X-2P; Mon, 28 Aug 2023 19:27:34 +0000 Received: from mail-wr1-x434.google.com ([2a00:1450:4864:20::434]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qahtI-00A8y4-2Z for linux-arm-kernel@lists.infradead.org; Mon, 28 Aug 2023 19:27:16 +0000 Received: by mail-wr1-x434.google.com with SMTP id ffacd0b85a97d-31aeef88a55so2938413f8f.2 for ; Mon, 28 Aug 2023 12:27:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1693250829; x=1693855629; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=K1CxvFy6DjQ2QqPARFppzzJEHGmRIN9sA1kFw52YtqA=; b=dSl0E+ca6ei+p+BhvXukag03UwmW73FD3fXR3l4q6mrKsLoSjQr/AjmGqhJwOOrnwz 6DneWKK5bwzG7lNo/lmmsPSph84oRJbOPCDWwNaQUKeBgeedw7CedxQwNxOaCB9Saoiq rSlCo0LMzDY/dOTbGmZrZo5tQjWO2dPKBg3GrQfJpibul1NqLTVHrzjz+opNfYpODqHf cpaDtSkACON9MIFiWANyztDVK/Ztz30A5EP0R2s+Q1I6FVq0XLhMjF/8du7AbxBHVKJh OyR5tLgwGWpBO8lqhMAqZPcPP+B9Ix+67Sm51SjGTMVb9HfXWHyz7BSDK3vg8YhgQ+fQ A0Kw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693250829; x=1693855629; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=K1CxvFy6DjQ2QqPARFppzzJEHGmRIN9sA1kFw52YtqA=; b=ZM6vf//okMQruP+GLy4dUb3IEUV4ZFbA6VyEey9iOp7wo4tTOGvrkg6w2Fm9A5Aa35 3w89jN88RhRQ+BW0kb3JgTpPPbzk4A8nxOmOe4nJNIbcBLswqfHIMKSQStNGqr679x+a YzrLbD0jkSndjbrS36ZkUv2MUyIbmrG6pxADFCe0DgD656lrIzd8HpM2ErNnkhhRGy/o jKbrujKZpNgpoI2A8szR5X0ekH7n4Bv+KEs9828XKArNSFjiZT9xs49qzDxLK5ooTRVt ymoKXpkiu6l77Q0Vy5qCQKimu6A2lzsAkzLHhVGQ2OmSF1TyBbFvQ1ANtkY/oxLKPZnE IH7w== X-Gm-Message-State: AOJu0Yyo/3kbP3WAZazyiMmN8EnbyUk0wH+l86SrIPSbPRp+dDX7P8qs 0nZ88NZcrNVayHEjt04gA1wgfw== X-Google-Smtp-Source: AGHT+IG16plrLwVWNVWNBmzzaYPUetvSFyD0SYBWHQ0Uei/kQgG98t5cUvWtgeVCvbBRPGeUe+jycw== X-Received: by 2002:a5d:62cd:0:b0:319:785a:fce0 with SMTP id o13-20020a5d62cd000000b00319785afce0mr20142048wrv.26.1693250829565; Mon, 28 Aug 2023 12:27:09 -0700 (PDT) Received: from brgl-uxlite.home ([2a01:cb1d:334:ac00:8bd:7f16:d368:115f]) by smtp.gmail.com with ESMTPSA id i20-20020a5d5234000000b003141f96ed36sm11435319wra.0.2023.08.28.12.27.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Aug 2023 12:27:09 -0700 (PDT) From: Bartosz Golaszewski To: Andy Gross , Bjorn Andersson , Konrad Dybcio , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Catalin Marinas , Will Deacon , Arnd Bergmann , Alex Elder , Srini Kandagatla Cc: kernel@quicinc.com, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Bartosz Golaszewski Subject: [PATCH 06/11] firmware: qcom-shm-bridge: new driver Date: Mon, 28 Aug 2023 21:25:02 +0200 Message-Id: <20230828192507.117334-7-bartosz.golaszewski@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230828192507.117334-1-bartosz.golaszewski@linaro.org> References: <20230828192507.117334-1-bartosz.golaszewski@linaro.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230828_122712_838387_EABB09A6 X-CRM114-Status: GOOD ( 26.81 ) 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 This module is a platform driver that also exposes an interface for kernel users to allocate blocks of memory shared with the trustzone. Signed-off-by: Bartosz Golaszewski --- drivers/firmware/Kconfig | 8 + drivers/firmware/Makefile | 1 + drivers/firmware/qcom-shm-bridge.c | 452 +++++++++++++++++++++++ include/linux/firmware/qcom/shm-bridge.h | 32 ++ 4 files changed, 493 insertions(+) create mode 100644 drivers/firmware/qcom-shm-bridge.c create mode 100644 include/linux/firmware/qcom/shm-bridge.h diff --git a/drivers/firmware/Kconfig b/drivers/firmware/Kconfig index b59e3041fd62..39f35ba18779 100644 --- a/drivers/firmware/Kconfig +++ b/drivers/firmware/Kconfig @@ -226,6 +226,14 @@ config QCOM_SCM_DOWNLOAD_MODE_DEFAULT Say Y here to enable "download mode" by default. +config QCOM_SHM_BRIDGE + bool "Qualcomm SHM bridge driver" + depends on QCOM_SCM + help + Say yes here to enable support for Qualcomm TEE Shared Memory Bridge. + This module exposes interfaces that allow kernel users to allocate + blocks of memory shared with the trustzone. + config SYSFB bool select BOOT_VESA_SUPPORT diff --git a/drivers/firmware/Makefile b/drivers/firmware/Makefile index 28fcddcd688f..ba1590cf959c 100644 --- a/drivers/firmware/Makefile +++ b/drivers/firmware/Makefile @@ -20,6 +20,7 @@ obj-$(CONFIG_RASPBERRYPI_FIRMWARE) += raspberrypi.o obj-$(CONFIG_FW_CFG_SYSFS) += qemu_fw_cfg.o obj-$(CONFIG_QCOM_SCM) += qcom-scm.o qcom-scm-objs += qcom_scm.o qcom_scm-smc.o qcom_scm-legacy.o +obj-$(CONFIG_QCOM_SHM_BRIDGE) += qcom-shm-bridge.o obj-$(CONFIG_SYSFB) += sysfb.o obj-$(CONFIG_SYSFB_SIMPLEFB) += sysfb_simplefb.o obj-$(CONFIG_TI_SCI_PROTOCOL) += ti_sci.o diff --git a/drivers/firmware/qcom-shm-bridge.c b/drivers/firmware/qcom-shm-bridge.c new file mode 100644 index 000000000000..db76c5c5061d --- /dev/null +++ b/drivers/firmware/qcom-shm-bridge.c @@ -0,0 +1,452 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* + * Copyright (C) 2023 Linaro Limited + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define QCOM_SHM_BRIDGE_NUM_VM_SHIFT 9 + +DEFINE_FREE(qcom_shm_bridge_pool, struct qcom_shm_bridge_pool *, + if (_T) qcom_shm_bridge_pool_unref(_T)) + +/* + * Size of the global fall-back pool can be adjusted using this param. Use 4M + * as a sane default. + */ +static unsigned int qcom_shm_bridge_default_pool_size = SZ_4M; +module_param_named(default_pool_size, qcom_shm_bridge_default_pool_size, + uint, 0644); + +struct qcom_shm_bridge_pool { + struct device *dev; + void *vaddr; + phys_addr_t paddr; + size_t size; + uint64_t handle; + struct gen_pool *genpool; + struct list_head chunks; + spinlock_t lock; + struct kref refcount; +}; + +struct qcom_shm_bridge_chunk { + void *vaddr; + size_t size; + struct qcom_shm_bridge_pool *parent; + struct list_head siblings; +}; + +/* This is the global fall-back pool, used if user doesn't supply their own. */ +static struct qcom_shm_bridge_pool *qcom_shm_bridge_default_pool; + +static RADIX_TREE(qcom_shm_bridge_chunks, GFP_ATOMIC); +static DEFINE_SPINLOCK(qcom_shm_bridge_chunks_lock); + +static void qcom_shm_bridge_pool_release(struct kref *kref) +{ + struct qcom_shm_bridge_pool *pool = + container_of(kref, struct qcom_shm_bridge_pool, refcount); + + if (pool->handle) + qcom_scm_delete_shm_bridge(pool->dev, pool->handle); + + if (pool->genpool) + gen_pool_destroy(pool->genpool); + + if (pool->paddr) + dma_unmap_single(pool->dev, pool->paddr, pool->size, + DMA_TO_DEVICE); + + if (pool->vaddr) + free_pages((unsigned long)pool->vaddr, get_order(pool->size)); + + put_device(pool->dev); + kfree(pool); +} + +static int qcom_shm_bridge_create(struct qcom_shm_bridge_pool *pool) +{ + uint64_t pfn_and_ns_perm, ipfn_and_s_perm, size_and_flags, ns_vmids, + ns_perms, handle; + int ret; + + ns_perms = (QCOM_SCM_PERM_WRITE | QCOM_SCM_PERM_READ); + ns_vmids = QCOM_SCM_VMID_HLOS; + pfn_and_ns_perm = (u64)pool->paddr | ns_perms; + ipfn_and_s_perm = (u64)pool->paddr | ns_perms; + size_and_flags = pool->size | (1 << QCOM_SHM_BRIDGE_NUM_VM_SHIFT); + + ret = qcom_scm_create_shm_bridge(pool->dev, pfn_and_ns_perm, + ipfn_and_s_perm, size_and_flags, + ns_vmids, &handle); + if (!ret) + pool->handle = handle; + + return ret; +} + +static struct qcom_shm_bridge_pool * +qcom_shm_bridge_pool_new_for_dev(struct device *dev, size_t size) +{ + struct qcom_shm_bridge_pool *pool __free(qcom_shm_bridge_pool) = NULL; + int ret; + + if (!qcom_scm_shm_bridge_available()) + return ERR_PTR(-ENODEV); + + if (!size) + return ERR_PTR(-EINVAL); + + pool = kzalloc(sizeof(*pool), GFP_KERNEL); + if (!pool) + return ERR_PTR(-ENOMEM); + + pool->dev = get_device(dev); + pool->size = size; + INIT_LIST_HEAD(&pool->chunks); + spin_lock_init(&pool->lock); + kref_init(&pool->refcount); + + pool->vaddr = (void *)__get_free_pages(GFP_KERNEL | GFP_DMA, + get_order(pool->size)); + if (!pool->vaddr) + return ERR_PTR(-ENOMEM); + + pool->paddr = dma_map_single(pool->dev, pool->vaddr, pool->size, + DMA_TO_DEVICE); + if (dma_mapping_error(dev, pool->paddr)) + return ERR_PTR(-ENOMEM); + + pool->genpool = gen_pool_create(PAGE_SHIFT, -1); + if (!pool->genpool) + return ERR_PTR(-ENOMEM); + + gen_pool_set_algo(pool->genpool, gen_pool_best_fit, NULL); + + ret = gen_pool_add_virt(pool->genpool, (unsigned long)pool->vaddr, + pool->paddr, pool->size, -1); + if (ret) + return ERR_PTR(ret); + + ret = qcom_shm_bridge_create(pool); + if (ret) + return ERR_PTR(ret); + + return no_free_ptr(pool); +} + +/** + * qcom_shm_bridge_pool_new - Create a new SHM Bridge memory pool. + * + * @size: Size of the pool. + * + * Creates a new Shared Memory Bridge pool from which users can allocate memory + * chunks. Must be called from process context. + * + * Return: + * Pointer to the newly created SHM Bridge pool with reference count set to 1 + * or ERR_PTR(). + */ +struct qcom_shm_bridge_pool *qcom_shm_bridge_pool_new(size_t size) +{ + struct device *dev; + + dev = bus_find_device_by_name(&platform_bus_type, NULL, + "qcom-shm-bridge"); + if (!dev) + return ERR_PTR(-ENODEV); + + return qcom_shm_bridge_pool_new_for_dev(dev, size); +} +EXPORT_SYMBOL_GPL(qcom_shm_bridge_pool_new); + +/** + * qcom_shm_bridge_pool_ref - Increate the refcount of an SHM Bridge pool. + * + * @pool: SHM Bridge pool of which the reference count to increase. + * + * Return: + * Pointer to the same pool object. + */ +struct qcom_shm_bridge_pool * +qcom_shm_bridge_pool_ref(struct qcom_shm_bridge_pool *pool) +{ + kref_get(&pool->refcount); + + return pool; +} +EXPORT_SYMBOL_GPL(qcom_shm_bridge_pool_ref); + +/** + * qcom_shm_bridge_pool_unref - Decrease the refcount of an SHM Bridge pool. + * + * @pool: SHM Bridge pool of which the reference count to decrease. + * + * Once the reference count reaches 0, the pool is released. + */ +void qcom_shm_bridge_pool_unref(struct qcom_shm_bridge_pool *pool) +{ + kref_put(&pool->refcount, qcom_shm_bridge_pool_release); +} +EXPORT_SYMBOL_GPL(qcom_shm_bridge_pool_unref); + +static void devm_qcom_shm_bridge_pool_unref(void *data) +{ + struct qcom_shm_bridge_pool *pool = data; + + qcom_shm_bridge_pool_unref(pool); +} + +/** + * devm_qcom_shm_bridge_pool_new - Managed variant of qcom_shm_bridge_pool_new. + * + * @dev: Device for which to map memory and which will manage this pool. + * @size: Size of the pool. + * + * Return: + * Pointer to the newly created SHM Bridge pool with reference count set to 1 + * or ERR_PTR(). + */ +struct qcom_shm_bridge_pool * +devm_qcom_shm_bridge_pool_new(struct device *dev, size_t size) +{ + struct qcom_shm_bridge_pool *pool; + int ret; + + pool = qcom_shm_bridge_pool_new(size); + if (IS_ERR(pool)) + return pool; + + ret = devm_add_action_or_reset(dev, devm_qcom_shm_bridge_pool_unref, + pool); + if (ret) + return ERR_PTR(ret); + + return pool; +} +EXPORT_SYMBOL_GPL(devm_qcom_shm_bridge_pool_new); + +/** + * qcom_shm_bridge_alloc - Allocate a chunk of memory from an SHM Bridge pool. + * + * @pool: Pool to allocate memory from. May be NULL. + * @size: Number of bytes to allocate. + * @gfp: Allocation flags. + * + * If pool is NULL then the global fall-back pool is used. + * + * Return: + * Virtual address of the allocated memory or ERR_PTR(). Must be freed using + * qcom_shm_bridge_free(). + */ +void *qcom_shm_bridge_alloc(struct qcom_shm_bridge_pool *pool, + size_t size, gfp_t gfp) +{ + struct qcom_shm_bridge_chunk *chunk __free(kfree) = NULL; + unsigned long vaddr; + int ret; + + if (!pool) { + pool = READ_ONCE(qcom_shm_bridge_default_pool); + if (!pool) + return ERR_PTR(-ENODEV); + } + + if (!size || size > pool->size) + return ERR_PTR(-EINVAL); + + size = roundup(size, 1 << PAGE_SHIFT); + + chunk = kzalloc(sizeof(*chunk), gfp); + if (!chunk) + return ERR_PTR(-ENOMEM); + + guard(spinlock_irqsave)(&pool->lock); + + vaddr = gen_pool_alloc(pool->genpool, size); + if (!vaddr) + return ERR_PTR(-ENOMEM); + + chunk->vaddr = (void *)vaddr; + chunk->size = size; + chunk->parent = pool; + list_add_tail(&chunk->siblings, &pool->chunks); + qcom_shm_bridge_pool_ref(pool); + + guard(spinlock_irqsave)(&qcom_shm_bridge_chunks_lock); + + ret = radix_tree_insert(&qcom_shm_bridge_chunks, vaddr, chunk); + if (ret) { + gen_pool_free(pool->genpool, vaddr, chunk->size); + return ERR_PTR(ret); + } + + return no_free_ptr(chunk)->vaddr; +} +EXPORT_SYMBOL_GPL(qcom_shm_bridge_alloc); + +/** + * qcom_shm_bridge_free - Free SHM Bridge memory allocated from the pool. + * + * @vaddr: Virtual address of the allocated memory to free. + */ +void qcom_shm_bridge_free(void *vaddr) +{ + struct qcom_shm_bridge_chunk *chunk; + struct qcom_shm_bridge_pool *pool; + + scoped_guard(spinlock_irqsave, &qcom_shm_bridge_chunks_lock) + chunk = radix_tree_delete_item(&qcom_shm_bridge_chunks, + (unsigned long)vaddr, NULL); + if (!chunk) + goto out_warn; + + pool = chunk->parent; + + guard(spinlock_irqsave)(&pool->lock); + + list_for_each_entry(chunk, &pool->chunks, siblings) { + if (vaddr != chunk->vaddr) + continue; + + gen_pool_free(pool->genpool, (unsigned long)chunk->vaddr, + chunk->size); + list_del(&chunk->siblings); + qcom_shm_bridge_pool_unref(pool); + kfree(chunk); + return; + } + +out_warn: + WARN(1, "Virtual address %p not allocated for SHM bridge", vaddr); +} +EXPORT_SYMBOL_GPL(qcom_shm_bridge_free); + +/** + * devm_qcom_shm_bridge_alloc - Managed variant of qcom_shm_bridge_alloc. + * + * @dev: Managing device. + * @pool: Pool to allocate memory from. + * @size: Number of bytes to allocate. + * @gfp: Allocation flags. + * + * Return: + * Virtual address of the allocated memory or ERR_PTR(). + */ +void *devm_qcom_shm_bridge_alloc(struct device *dev, + struct qcom_shm_bridge_pool *pool, + size_t size, gfp_t gfp) +{ + void *vaddr; + int ret; + + vaddr = qcom_shm_bridge_alloc(pool, size, gfp); + if (IS_ERR(vaddr)) + return vaddr; + + ret = devm_add_action_or_reset(dev, qcom_shm_bridge_free, vaddr); + if (ret) + return ERR_PTR(ret); + + return vaddr; +} +EXPORT_SYMBOL_GPL(devm_qcom_shm_bridge_alloc); + +/** + * qcom_shm_bridge_to_phys_addr - Translate address from virtual to physical. + * + * @vaddr: Virtual address to translate. + * + * Return: + * Physical address corresponding to 'vaddr'. + */ +phys_addr_t qcom_shm_bridge_to_phys_addr(void *vaddr) +{ + struct qcom_shm_bridge_chunk *chunk; + struct qcom_shm_bridge_pool *pool; + + guard(spinlock_irqsave)(&qcom_shm_bridge_chunks_lock); + + chunk = radix_tree_lookup(&qcom_shm_bridge_chunks, + (unsigned long)vaddr); + if (!chunk) + return 0; + + pool = chunk->parent; + + guard(spinlock_irqsave)(&pool->lock); + + return gen_pool_virt_to_phys(pool->genpool, (unsigned long)vaddr); +} +EXPORT_SYMBOL_GPL(qcom_shm_bridge_to_phys_addr); + +static int qcom_shm_bridge_probe(struct platform_device *pdev) +{ + struct qcom_shm_bridge_pool *default_pool; + struct device *dev = &pdev->dev; + int ret; + + /* + * We need to wait for the SCM device to be created and bound to the + * SCM driver. + */ + if (!qcom_scm_is_available()) + return -EPROBE_DEFER; + + ret = qcom_scm_enable_shm_bridge(); + if (ret) + return dev_err_probe(dev, ret, + "Failed to enable the SHM bridge\n"); + + default_pool = qcom_shm_bridge_pool_new_for_dev( + dev, qcom_shm_bridge_default_pool_size); + if (IS_ERR(default_pool)) + return dev_err_probe(dev, PTR_ERR(default_pool), + "Failed to create the default SHM Bridge pool\n"); + + WRITE_ONCE(qcom_shm_bridge_default_pool, default_pool); + + return 0; +} + +static const struct of_device_id qcom_shm_bridge_of_match[] = { + { .compatible = "qcom,shm-bridge", }, + { } +}; + +static struct platform_driver qcom_shm_bridge_driver = { + .driver = { + .name = "qcom-shm-bridge", + .of_match_table = qcom_shm_bridge_of_match, + /* + * Once enabled, the SHM Bridge feature cannot be disabled so + * there's no reason to ever unbind the driver. + */ + .suppress_bind_attrs = true, + }, + .probe = qcom_shm_bridge_probe, +}; + +static int __init qcom_shm_bridge_init(void) +{ + return platform_driver_register(&qcom_shm_bridge_driver); +} +subsys_initcall(qcom_shm_bridge_init); diff --git a/include/linux/firmware/qcom/shm-bridge.h b/include/linux/firmware/qcom/shm-bridge.h new file mode 100644 index 000000000000..df066a2f6d91 --- /dev/null +++ b/include/linux/firmware/qcom/shm-bridge.h @@ -0,0 +1,32 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * Copyright (C) 2023 Linaro Limited + */ + +#ifndef _LINUX_QCOM_SHM_BRIDGE +#define _LINUX_QCOM_SHM_BRIDGE + +#include +#include +#include +#include + +struct qcom_shm_bridge_pool; + +struct qcom_shm_bridge_pool *qcom_shm_bridge_pool_new(size_t size); +struct qcom_shm_bridge_pool * +qcom_shm_bridge_pool_ref(struct qcom_shm_bridge_pool *pool); +void qcom_shm_bridge_pool_unref(struct qcom_shm_bridge_pool *pool); +struct qcom_shm_bridge_pool * +devm_qcom_shm_bridge_pool_new(struct device *dev, size_t size); + +void *qcom_shm_bridge_alloc(struct qcom_shm_bridge_pool *pool, + size_t size, gfp_t gfp); +void qcom_shm_bridge_free(void *vaddr); +void *devm_qcom_shm_bridge_alloc(struct device *dev, + struct qcom_shm_bridge_pool *pool, + size_t size, gfp_t gfp); + +phys_addr_t qcom_shm_bridge_to_phys_addr(void *vaddr); + +#endif /* _LINUX_QCOM_SHM_BRIDGE */ From patchwork Mon Aug 28 19:25:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 13368237 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 B149AC71153 for ; Mon, 28 Aug 2023 19:28:05 +0000 (UTC) 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:References:In-Reply-To: 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: List-Owner; bh=LliNLA8Tpkge0eLJL0jMxLcRKFd9O3K72fzs1fpw+tU=; b=PriMEO4W1rKNxB o4IF/DSBlG+u1pCMaAjQEZkO03h+CjfunWaD/vjxwXVP4GbJQJL4ZjxQDoZ1F2QhU7LxkP8K5NJh6 0BxP8Kkx3kaoqoAGJnjECkhL9f6JtFpKXXD/u7+D5hNFvtXRwB0CupC2gjpsG/hUVsU6MEuDwfkqc paUWqgmIJmHSHPlnA7zAC7i8U/NmwgZKqYShtcqMis4v0YDODKZiOesrxcDTHUBQg9h9VRyTd74W8 k1FbI4Mgp0W0yjTODOdx/3nAyGkDPhr0ef3+Rtm5bsTaLb9cnIkwgKd5Lwofsu+78xn8O/2YyieQI S1PDrs6Z64ZCQKX5f6BQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qahtf-00A97R-2b; Mon, 28 Aug 2023 19:27:35 +0000 Received: from mail-wr1-x430.google.com ([2a00:1450:4864:20::430]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qahtK-00A8y9-1C for linux-arm-kernel@lists.infradead.org; Mon, 28 Aug 2023 19:27:17 +0000 Received: by mail-wr1-x430.google.com with SMTP id ffacd0b85a97d-31c8a710545so1865301f8f.3 for ; Mon, 28 Aug 2023 12:27:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1693250831; x=1693855631; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=5cFxADGOERyNFN7lTVtP33aE4fUtIdh4yla5Ms0ctiE=; b=EoXzrnanHjxRlCVdFNR3jEL/xRmfXMhI4RzAOrNmLf3G2biAWlM7vvmO7zLkPHT4iK 5Le0KJNfMSWSAwMlhFthLroTME9MfrlZuNQF5utevteIrmy0/Av5ZCo33of6uVD6MzZw A1KumZvLrH7LkMecujD0FPIYUstS5WpuDS37Ojb2nzciYE9Xh5rv0wqiVRJgNyR/eYOw epjjDQD+dBqlNcb4kQb7Sa60JXJvr7soJSrAuFyOkgWHC0Dit3u6CO0PaVO6+PsJ0nTy zKUet+A0wII8xV9lzUXPhMgXlFMm113iHCOpFEQhZhKXxSt/ZxNZqwZ+GN5YszttspJ7 Ks9Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693250831; x=1693855631; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=5cFxADGOERyNFN7lTVtP33aE4fUtIdh4yla5Ms0ctiE=; b=l+LsMpCqAWl3GqdZjBWVSBaKfrGojpX1E+D1HJ/kjaT47uMilBAsKigMAqlQe70NgR /sCA98qMk4HHivozHRJDC822r4urCA5wos1E1hjcLsBpshAHkSnF1T5Tjcw0ZW7oIhS/ 5OAweia1sY96XIFDKUQxouD3cdMnYAUMRkEefOfOnYpIQR/oVB7kVvK5hnN4dG0PmM2y 9nabeMgy+zdQwqaDMPJYc1WfVnzouqGmHvkQ8P+3hXBSjdQR/gAr8M4p0N913b2RE/2k woYmKZ6iqeOEWXZY2EzOLkTH/jNuZ22TkRSeHr/Lw6or8jxHWlAKynOA2nejjnJmI2K+ 9bXA== X-Gm-Message-State: AOJu0YwWxA2nitcsZ7XiG6rrEpZ0Blr3nbcbWbQJ4gFH9gauKTBlHgjB 0bxsLxNp8Jct1kny9iVKvVeueA== X-Google-Smtp-Source: AGHT+IFTdl/tQdMkT1arHw9DxZMr0l64zUqWz+qHpOkaOVV+i2xMx+CKkBv3fHfRzh8d+Cw4kcZ+EQ== X-Received: by 2002:a5d:4d02:0:b0:317:5a9b:fcec with SMTP id z2-20020a5d4d02000000b003175a9bfcecmr19670541wrt.14.1693250830785; Mon, 28 Aug 2023 12:27:10 -0700 (PDT) Received: from brgl-uxlite.home ([2a01:cb1d:334:ac00:8bd:7f16:d368:115f]) by smtp.gmail.com with ESMTPSA id i20-20020a5d5234000000b003141f96ed36sm11435319wra.0.2023.08.28.12.27.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Aug 2023 12:27:10 -0700 (PDT) From: Bartosz Golaszewski To: Andy Gross , Bjorn Andersson , Konrad Dybcio , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Catalin Marinas , Will Deacon , Arnd Bergmann , Alex Elder , Srini Kandagatla Cc: kernel@quicinc.com, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Bartosz Golaszewski Subject: [PATCH 07/11] firmware: qcom-scm: use SHM bridge if available Date: Mon, 28 Aug 2023 21:25:03 +0200 Message-Id: <20230828192507.117334-8-bartosz.golaszewski@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230828192507.117334-1-bartosz.golaszewski@linaro.org> References: <20230828192507.117334-1-bartosz.golaszewski@linaro.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230828_122714_424446_CA072F9E X-CRM114-Status: GOOD ( 13.82 ) 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 Allocate the memory for SCM call arguments from the Shared Memory Bridge if it's available. Signed-off-by: Bartosz Golaszewski --- drivers/firmware/qcom_scm-smc.c | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/drivers/firmware/qcom_scm-smc.c b/drivers/firmware/qcom_scm-smc.c index 16cf88acfa8e..6045be600c2a 100644 --- a/drivers/firmware/qcom_scm-smc.c +++ b/drivers/firmware/qcom_scm-smc.c @@ -11,6 +11,7 @@ #include #include #include +#include #include "qcom_scm.h" @@ -161,6 +162,7 @@ int __scm_smc_call(struct device *dev, const struct qcom_scm_desc *desc, ARM_SMCCC_SMC_32 : ARM_SMCCC_SMC_64; struct arm_smccc_res smc_res; struct arm_smccc_args smc = {0}; + bool using_shm_bridge = qcom_scm_shm_bridge_available(); smc.args[0] = ARM_SMCCC_CALL_VAL( smccc_call_type, @@ -173,8 +175,12 @@ int __scm_smc_call(struct device *dev, const struct qcom_scm_desc *desc, if (unlikely(arglen > SCM_SMC_N_REG_ARGS)) { alloc_len = SCM_SMC_N_EXT_ARGS * sizeof(u64); - args_virt = kzalloc(PAGE_ALIGN(alloc_len), flag); - + if (using_shm_bridge) + args_virt = qcom_shm_bridge_alloc(NULL, + PAGE_ALIGN(alloc_len), + flag); + else + args_virt = kzalloc(PAGE_ALIGN(alloc_len), flag); if (!args_virt) return -ENOMEM; @@ -196,7 +202,10 @@ int __scm_smc_call(struct device *dev, const struct qcom_scm_desc *desc, DMA_TO_DEVICE); if (dma_mapping_error(dev, args_phys)) { - kfree(args_virt); + if (using_shm_bridge) + qcom_shm_bridge_free(args_virt); + else + kfree(args_virt); return -ENOMEM; } @@ -208,7 +217,10 @@ int __scm_smc_call(struct device *dev, const struct qcom_scm_desc *desc, if (args_virt) { dma_unmap_single(dev, args_phys, alloc_len, DMA_TO_DEVICE); - kfree(args_virt); + if (using_shm_bridge) + qcom_shm_bridge_free(args_virt); + else + kfree(args_virt); } if (ret) From patchwork Mon Aug 28 19:25:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 13368236 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 B5068C83F17 for ; Mon, 28 Aug 2023 19:28:05 +0000 (UTC) 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:References:In-Reply-To: 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: List-Owner; bh=2aIeH8RuDysxIeTHHtnuf5b/xN1IsA51C0tGDVVPYUA=; b=Y2e5+LEME0RReQ P2kygM6IE1Os2jwLGmFgJg9Ytu1OlML3MlbO5IwOfWJfU8Qj/OQqMuq48fhtShdJ6b0aQ+G5iX9T3 5WI2UCOoJoPY+V8Qs/4vKauwiXcY1cjJULsDlBwhPV9ITAIfkEYQPqpLh0crF7KlgTvBlqnqsuLJU FHGMdmAB3u6IwWuHaZcnDseNqSlJnKIY0CAkcxFp8/x4uNW6zg6gwC8amn3+M2vBFAk7WQtfANZdN l4pJ5lSGLKIIbkvI9qb72V9LWjgrBZ71HA199UbWk1LVrh1c4Q0e04vYzXAI5hWukGFjiLqxm2YHz Uh35aHxSBQZSxDtw5Dcw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qahtg-00A97r-14; Mon, 28 Aug 2023 19:27:36 +0000 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qahtM-00A8yG-0t for linux-arm-kernel@lists.infradead.org; Mon, 28 Aug 2023 19:27:17 +0000 Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-3fee5ddc23eso33855905e9.1 for ; Mon, 28 Aug 2023 12:27:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1693250832; x=1693855632; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=G5UUEotKM3KPlt75iPa8nyLWoLcrw4bhDYA2GP/3CkM=; b=Lp3+/vZEdk1adx7vtq1BnepUYuSHIxLzsE7TOETlCJv+KHKzzWc/PEKZK3dimcfIsN bN7K01zSTB+hfS2i3EsL9JQsvaIpTI1e8v3N5W26Y+FtkAoTUSG/xxLNB/pSzmmZp0oH xc8EZK9Pijy4WDWTNPvoqY7pPJhXZZ3PH/Q3RZn/YCVrLwEd1HX8x6POdo0Ibs5ZhFJH XxBawl9w5Ha2by7sr+qGcoDYI+rUFRdixvecdQ2+XPlM7V9GWEnJgIOcY6kkqsvEUkml Xgbz4lnheXMjGyxSS+M5BHDwcRRC3r/RZkZHESd6/3EACCw2B2K4jE1HCU/5G+jvyiNp 87SA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693250832; x=1693855632; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=G5UUEotKM3KPlt75iPa8nyLWoLcrw4bhDYA2GP/3CkM=; b=I+VM8EfYRWkveaKl099dZGwDWe0VgzU9ubHqWRzJO8GhHOwH8V9e92V3EHJJrHdbRa J9APeR5jtCRW0968LXI03YBR0KErvm/T+qs2A29d9KxqWDSAXWUMKPQq9Fa8OS6qMsou FtdHmLXg/N+MnKsDb962NkNNRSTl5csEF1oFP1zD0HCUa3+dEwj6u44l8MHzn7SpmGjw OdUAMiYlBJJzOtS1JY8kJSnQXLLYyUfy5flnVJe3ji/tG1CViZN/YXoPSGyXBqfeHSvZ mOzOfGvem4X2ety4PdAjfDsZuo0mvW9+eBxVfyrBgpuampsiPsRd0WiC0HE7QoUk6qEt fa1g== X-Gm-Message-State: AOJu0YwRu++gRMIW7k8q3k+ydjcz8Cb8x/SNLD0IejaxdSpPWGyYJHQg LEEsY2/h9whZ937F8xyZZKKpwg== X-Google-Smtp-Source: AGHT+IGjgJy2rlEGsYdV6I6xyuANjKsdskic1BzqqdpwjuKQOjfX2n/VBEmdO4XGEgxS+FxXRwG0pA== X-Received: by 2002:adf:ce82:0:b0:317:43de:4c0a with SMTP id r2-20020adfce82000000b0031743de4c0amr18604895wrn.20.1693250831938; Mon, 28 Aug 2023 12:27:11 -0700 (PDT) Received: from brgl-uxlite.home ([2a01:cb1d:334:ac00:8bd:7f16:d368:115f]) by smtp.gmail.com with ESMTPSA id i20-20020a5d5234000000b003141f96ed36sm11435319wra.0.2023.08.28.12.27.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Aug 2023 12:27:11 -0700 (PDT) From: Bartosz Golaszewski To: Andy Gross , Bjorn Andersson , Konrad Dybcio , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Catalin Marinas , Will Deacon , Arnd Bergmann , Alex Elder , Srini Kandagatla Cc: kernel@quicinc.com, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Bartosz Golaszewski Subject: [PATCH 08/11] arm64: defconfig: enable Qualcomm SHM bridge module Date: Mon, 28 Aug 2023 21:25:04 +0200 Message-Id: <20230828192507.117334-9-bartosz.golaszewski@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230828192507.117334-1-bartosz.golaszewski@linaro.org> References: <20230828192507.117334-1-bartosz.golaszewski@linaro.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230828_122716_330707_FBC62B67 X-CRM114-Status: GOOD ( 10.17 ) 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 Most Qualcomm architectures support SHM bridge. Enable it as a built-in module in arm64 defconfig. Signed-off-by: Bartosz Golaszewski --- arch/arm64/configs/defconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm64/configs/defconfig b/arch/arm64/configs/defconfig index a25d783dfb95..7f982d9966e3 100644 --- a/arch/arm64/configs/defconfig +++ b/arch/arm64/configs/defconfig @@ -248,6 +248,7 @@ CONFIG_ARM_SCPI_PROTOCOL=y CONFIG_RASPBERRYPI_FIRMWARE=y CONFIG_INTEL_STRATIX10_SERVICE=y CONFIG_INTEL_STRATIX10_RSU=m +CONFIG_QCOM_SHM_BRIDGE=y CONFIG_EFI_CAPSULE_LOADER=y CONFIG_IMX_SCU=y CONFIG_IMX_SCU_PD=y From patchwork Mon Aug 28 19:25:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 13368234 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 A7B26C83F14 for ; Mon, 28 Aug 2023 19:28:02 +0000 (UTC) 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:References:In-Reply-To: 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: List-Owner; bh=Gkdosd9pdCrOlkERb3+PJWhvx6/76bhtmwKHdG9FnYM=; b=th/SP+1BH8tz4D AJ8KpJiTkS3G9UD53d9akZGmzsdJQANi+PfcoROPuzQuM1zNeuxgq7lmby4DDt7DDe+Tford1r03o Imj3eHPTJacWqu6scZlsvhzqog6JY70V8I1tHce2K1hS/4gK3S87kqZ1aSwseQyU21er6IFmjco9N m6BaMA3ZY8KtXWp0dJfsYILrPHGj5RI0IlYZzH+8LKks5PcT4sTUsiWxqaNUQbte7X6lEZ1uX+/Ki NfsaGuwnd9WIZsR3IHF8sCHGbV5lS37VeKmjAWCoIcBiY7G0XXUOE8o+8geLJZAg4is2rspffye3D 4jXCjRrV0S7iHibm9CAg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qahth-00A98u-1P; Mon, 28 Aug 2023 19:27:37 +0000 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qahtN-00A8zq-2B for linux-arm-kernel@lists.infradead.org; Mon, 28 Aug 2023 19:27:18 +0000 Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-3fef56f7222so34820515e9.2 for ; Mon, 28 Aug 2023 12:27:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1693250833; x=1693855633; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=BAFaAAYoXtYBwsZEB5803CfYwT2H5kOVyLG4imLw9Ng=; b=sbvAYBnYvMtQ5zHvNb+ucyUQxsfswVBcZM/ar2F0dRfS4ewDAUJjw03AVtS1PWnf/G cqu+nYSS1d4AXk2m0hv8+daSi8iZwzboeUAqMjANlPobyJ4Ql3UmF0YL32U3XIiFpyA8 1DIW9fQFJ5Ip/1DW8HInCGLwdtV4tkc7IRqHHz6jtRn3J21+kMY4qQm/ggf61IbB6uPl oVX11YhXXQLkqHs7C5sR4eZEYLCZMXwEv/mW4idSCkyic1oUUc/H8kIO/YY4dw+mKkah Cs9YlbV6RRiwIYMsXxTH5lNlOFWngcE9JgNT68DaeWEY1CNd2XFQW+FNQxmWbmelwyTK E/IA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693250833; x=1693855633; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=BAFaAAYoXtYBwsZEB5803CfYwT2H5kOVyLG4imLw9Ng=; b=QyMcOu3gt75bN0jPYEN+hbb8bmQijaBCAvrj5oF4lDzGjvhy5D5K9wG9aZzDzycJTG Zksnts750VHHDv+pcIY4MVvZx3J61C7qCOWjl5r3sZPGUZyrr493Pk2SEY7DKLiiGTAJ ORQkU1IJVcO2dkJvG9CoI77HbF13BYX6sxFCAkDwktTKERaFb88tk3dlc+7N/SB9uNK1 furIC0e4xf1waA3EBBlIa2OgCvg4bI/Vu6jaSuwjxnDJ0KvlpVMDw0kkbiig915yk4+F uJZZ7odaSwUdexmyj4L473UWgbVReq5xsI2I1MFOf5hCysu1EljlkKpSg1mtWbdnGigy JI3g== X-Gm-Message-State: AOJu0YwS6g+/Q5V5Ynb+z7kvOlLrOb1rwJAsq6+tPU0DPdvEmOI9lMMe igVaSIm0+iktRhPRS4IpCQ4r1A== X-Google-Smtp-Source: AGHT+IERZ8Tk7ITAPI5IRbPu9geaRPRqJ6/1sXAiQvTPNpFfS2XTgFIfNp/PGkXNe/7dmFA1ZZGAcg== X-Received: by 2002:a1c:7908:0:b0:3fe:22a9:907 with SMTP id l8-20020a1c7908000000b003fe22a90907mr19589642wme.20.1693250833266; Mon, 28 Aug 2023 12:27:13 -0700 (PDT) Received: from brgl-uxlite.home ([2a01:cb1d:334:ac00:8bd:7f16:d368:115f]) by smtp.gmail.com with ESMTPSA id i20-20020a5d5234000000b003141f96ed36sm11435319wra.0.2023.08.28.12.27.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Aug 2023 12:27:12 -0700 (PDT) From: Bartosz Golaszewski To: Andy Gross , Bjorn Andersson , Konrad Dybcio , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Catalin Marinas , Will Deacon , Arnd Bergmann , Alex Elder , Srini Kandagatla Cc: kernel@quicinc.com, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Bartosz Golaszewski Subject: [PATCH 09/11] arm64: dts: qcom: sm8450: enable SHM bridge Date: Mon, 28 Aug 2023 21:25:05 +0200 Message-Id: <20230828192507.117334-10-bartosz.golaszewski@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230828192507.117334-1-bartosz.golaszewski@linaro.org> References: <20230828192507.117334-1-bartosz.golaszewski@linaro.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230828_122717_717978_E69D44BC X-CRM114-Status: GOOD ( 10.93 ) 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 Enable SHM bridge on sm8450 platforms. Signed-off-by: Bartosz Golaszewski --- arch/arm64/boot/dts/qcom/sm8450.dtsi | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/sm8450.dtsi b/arch/arm64/boot/dts/qcom/sm8450.dtsi index 5cd7296c7660..eacb2658e3ec 100644 --- a/arch/arm64/boot/dts/qcom/sm8450.dtsi +++ b/arch/arm64/boot/dts/qcom/sm8450.dtsi @@ -289,6 +289,10 @@ scm: scm { interconnects = <&aggre2_noc MASTER_CRYPTO 0 &mc_virt SLAVE_EBI1 0>; #reset-cells = <1>; }; + + shm-bridge { + compatible = "qcom,shm-bridge-sm8450", "qcom,shm-bridge"; + }; }; clk_virt: interconnect-0 { From patchwork Mon Aug 28 19:25:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 13368235 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 74852C83F12 for ; Mon, 28 Aug 2023 19:28:05 +0000 (UTC) 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:References:In-Reply-To: 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: List-Owner; bh=1d+wbQQjXnQvxNF1XMDL9uKngwhOy8nfqNzZzKaBK1I=; b=ZPRGQIE8VAu0lW 64fpNpMGURBRRJJ4TfTl0bc1OlLITqtdbCBDgCmNeH0tQIZpXLSm3y0qBtdMI8GwCRLUPDa2gTcQJ geKi3hhESGkNgWZcxjdDF1npPkz/7n1czYzp5iHpXl9s1AeizsscUcC9oy4Je1Vrk7OIzCL89WmqQ JzqticiNVEYs52mhvzArZ6f2Pq+tiXaHODxhTkVWgISvb2fXfaE+wpEP0LqGarpcVLeVLFhu7E3I4 drUG2nsYmBPtKN+NuqHmLsdgx14pDmttG97L3QGTfAl/182pG6UfV8heOefgTGqureewnHvZOEyD3 w7JuoWvXfDXe4P+jfZjA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qahtf-00A973-0p; Mon, 28 Aug 2023 19:27:35 +0000 Received: from mail-wr1-x431.google.com ([2a00:1450:4864:20::431]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qahtL-00A90L-2U for linux-arm-kernel@lists.infradead.org; Mon, 28 Aug 2023 19:27:17 +0000 Received: by mail-wr1-x431.google.com with SMTP id ffacd0b85a97d-31dca134c83so1169426f8f.3 for ; Mon, 28 Aug 2023 12:27:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1693250834; x=1693855634; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=LCx6rX9XwkuTbZO5oGRhSEBk5e7OaZJRubi6F2ucuO0=; b=kbalgKaBhIdUuKiRYkEoB9PjGYYgWzArZwbNwkwnDpDl2p8QWr0ZHt7WAyE7J9OEVS qOKK+GJCEwqq7V8OTL4qtinpwf74jAJjquHEn6PNN4/WJQxRpQDVmu+fRkkZG9JqCpkZ whLI1B+OhxOabfnsiYrTZPyZaVOdcl2qknkH0MfRSHE7+KHqdC8U9WmWLdNm7HDU02Ov 0bvmWDhy9DMP6lq7X2xzwiPm4Vr9MBkhtIsj3Uu2Qb4ko8nk3PTXPSW/falJDJRPq/Cl 3ud4CiLp3RUSsy9QVbIkVoFL5gMf6QdBrna+VPjN+RpVQnivOz/0mAw4PnlbRy04IAVV 5YmA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693250834; x=1693855634; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=LCx6rX9XwkuTbZO5oGRhSEBk5e7OaZJRubi6F2ucuO0=; b=O7Fi2pVKXL4keyf2m5yT0Tq45ot0IAb1SwuHIt9k612kq/feSNWeTlECwpEkswDAoP arUqoUzSF0m+InhithpxJqRKEDr+c2aziDrbmw57fF8qnC8n8qhCYLOGHMw2gewrhCCE iBvDffkvzyemIEp8RTYIXsXb8Jj0gSWZCUq/oPZO7FlZrYmDvMGz1KGldCzQGvI/o/zS PN2NCw1Iale7J7z4dH8RAe6LY4/E+AVPcmKadZeBGF2HfNg2GJG7JihBa0JVv89a+/KV sNWuafxZ+9sJnrArDIdvjLOkc/YKZA8Xf5F2FV8RAFZxdKi65sl4ih2cyHFVn1DzDEel gcVw== X-Gm-Message-State: AOJu0Yyu+cC6QuW37tPRzABwWQZP4C77tWNHBHe6r2HbQJ243xBebtVf ej1wqeb5nk4ZcmrL0WoPZk6cqg== X-Google-Smtp-Source: AGHT+IGonPCG2HR4mwHMevXIU/ybI7JuPnQYVr3ZJNLHR2Fi7PQuFZCK98LCZMFUwA5tvpeKIA0xJA== X-Received: by 2002:adf:ef91:0:b0:318:f7a:e3c8 with SMTP id d17-20020adfef91000000b003180f7ae3c8mr20535179wro.57.1693250834586; Mon, 28 Aug 2023 12:27:14 -0700 (PDT) Received: from brgl-uxlite.home ([2a01:cb1d:334:ac00:8bd:7f16:d368:115f]) by smtp.gmail.com with ESMTPSA id i20-20020a5d5234000000b003141f96ed36sm11435319wra.0.2023.08.28.12.27.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Aug 2023 12:27:14 -0700 (PDT) From: Bartosz Golaszewski To: Andy Gross , Bjorn Andersson , Konrad Dybcio , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Catalin Marinas , Will Deacon , Arnd Bergmann , Alex Elder , Srini Kandagatla Cc: kernel@quicinc.com, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Bartosz Golaszewski Subject: [PATCH 10/11] arm64: dts: qcom: sa8775p: enable SHM bridge Date: Mon, 28 Aug 2023 21:25:06 +0200 Message-Id: <20230828192507.117334-11-bartosz.golaszewski@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230828192507.117334-1-bartosz.golaszewski@linaro.org> References: <20230828192507.117334-1-bartosz.golaszewski@linaro.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230828_122715_841322_AA2511E9 X-CRM114-Status: GOOD ( 10.76 ) 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 Enable SHM bridge on sa8775p platforms. Signed-off-by: Bartosz Golaszewski --- arch/arm64/boot/dts/qcom/sa8775p.dtsi | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/sa8775p.dtsi b/arch/arm64/boot/dts/qcom/sa8775p.dtsi index b130136acffe..d8614d15750e 100644 --- a/arch/arm64/boot/dts/qcom/sa8775p.dtsi +++ b/arch/arm64/boot/dts/qcom/sa8775p.dtsi @@ -209,6 +209,10 @@ firmware { scm { compatible = "qcom,scm-sa8775p", "qcom,scm"; }; + + shm-bridge { + compatible = "qcom,shm-bridge-sa8775p", "qcom,shm-bridge"; + }; }; aggre1_noc: interconnect-aggre1-noc { From patchwork Mon Aug 28 19:25:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 13368239 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 0EDD1C71153 for ; Mon, 28 Aug 2023 19:28:09 +0000 (UTC) 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:References:In-Reply-To: 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: List-Owner; bh=8jktH5ZHngejgRFt9KQzugpKPxoakCZNGP9p1OEI/1E=; b=h56NDClHVx7+Wa 3znqjRW/TnBl0MwQqlEmW5M37S6mESc8kMuihp22I+5ek7l0cO5t/Ic+bOFM76yffvdpo52Wl+aSX NRhJreg0Rt0wa6Uky3TVf82Dq/Ir1Zj0T0ie6q2K6QUlLkAn+WRA7rsgufLyXeG9BQFPpKyck8UWB c2e17yY+A5U+Xr4M0HQPi/KvABNnMuazQST35SGYrlB6LFTQCtFXjx434OtjJPeVj9StPt0yZ5F2d i83+yXE0gNWFo0LZqhia0Ka7J0x3qEF5h3hRGJB1zzm8TnfSJZyCtYseqfKF5aVpQc8fDnmyB35S0 xIWvzrov05o13ZCGzrKg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qahtg-00A98Q-2y; Mon, 28 Aug 2023 19:27:36 +0000 Received: from mail-wr1-x42d.google.com ([2a00:1450:4864:20::42d]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qahtM-00A90w-3D for linux-arm-kernel@lists.infradead.org; Mon, 28 Aug 2023 19:27:18 +0000 Received: by mail-wr1-x42d.google.com with SMTP id ffacd0b85a97d-31c615eb6feso2938339f8f.3 for ; Mon, 28 Aug 2023 12:27:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1693250835; x=1693855635; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=TMIOWWSdqeSoUAfHcjIOH1OC+hMNlEb1paPS+tEaJKg=; b=BCjoeEUS/FckunA7BjsPbj5RT/CgPggSegR9WzbBOoQWtgPXY39sFmaEIE9kfJhJ7j 2zROPjmvS+BGD9EvL5JgTngaatkJ3F77HlSYV6kxCn815OjUP+eP/AO73EyxCRErLTZw G3Mi/2pk0RCWlfDwldSJ/CEtiWSI5MZlNnrrmGibUrL8AyZYetCatMIdEPMu2i9Zpy/H mJ+EPJm4AnLYht0y9tLr/SC1ChgtsaM/N2lu2EoyS9TIZVR60RHwz9eUkjePNntEK65y D6u9+Rt/AbLg15sCE03YMu110ANPN+zdJMBJ8qCvHcKFHWlRZwifdZzCiYtOXka6Dbve BSJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693250835; x=1693855635; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=TMIOWWSdqeSoUAfHcjIOH1OC+hMNlEb1paPS+tEaJKg=; b=KxW+zdbA1ORbtgFa5E4loo/iTjJCP/UgdYuQmwTB0XRjpsVJfbIjEBRc6UQjVgHDOa IDcQ0lJJ7eFBUznZRjXR6mDsOD06aE2hzjEizL4pUdHV2nkEevbGbAz75uCj9raQxsPK KbtZNj3jdd1cf8h23ezkF6Lf1ymQXdFuH88ZpkBwyYHEEOvl2cHPOljopfqrLnMTjPSK ozlPnI9FUIaG0mw5tIHTvCa0b7oPFyMzdmC8MhDMd3yCu1NglQXThb8HcJSUaMlGvQGF ANE5FsZMyZ9F9RBBrsSvbt40g83wL+YvTR0R+BsT7Ey96oROucRBrVhVBXU1Go5InW+x etlg== X-Gm-Message-State: AOJu0YxssuxnENKvhTdqhChYqupVqj6ePx96lvYisZMceDGAa0igl/h6 iE7pwXy4I6GKi7wSRplyKqSQaA== X-Google-Smtp-Source: AGHT+IGwSg/n9slu02mhVXrK3uD2f2TSMnRa4Rgqq9mKJ/qMfRRSzAIiIAyq0Qe05qJxlrLQgd/K1Q== X-Received: by 2002:a5d:414f:0:b0:314:17cc:31d0 with SMTP id c15-20020a5d414f000000b0031417cc31d0mr20153261wrq.34.1693250835788; Mon, 28 Aug 2023 12:27:15 -0700 (PDT) Received: from brgl-uxlite.home ([2a01:cb1d:334:ac00:8bd:7f16:d368:115f]) by smtp.gmail.com with ESMTPSA id i20-20020a5d5234000000b003141f96ed36sm11435319wra.0.2023.08.28.12.27.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Aug 2023 12:27:15 -0700 (PDT) From: Bartosz Golaszewski To: Andy Gross , Bjorn Andersson , Konrad Dybcio , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Catalin Marinas , Will Deacon , Arnd Bergmann , Alex Elder , Srini Kandagatla Cc: kernel@quicinc.com, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Bartosz Golaszewski Subject: [PATCH 11/11] arm64: dts: qcom: sm8150: enable SHM bridge Date: Mon, 28 Aug 2023 21:25:07 +0200 Message-Id: <20230828192507.117334-12-bartosz.golaszewski@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230828192507.117334-1-bartosz.golaszewski@linaro.org> References: <20230828192507.117334-1-bartosz.golaszewski@linaro.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230828_122717_034452_2C80BB4A X-CRM114-Status: GOOD ( 10.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 Enable SHM bridge on sm8150 platforms. Signed-off-by: Bartosz Golaszewski --- arch/arm64/boot/dts/qcom/sm8150.dtsi | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/sm8150.dtsi b/arch/arm64/boot/dts/qcom/sm8150.dtsi index b46e55bb8bde..ffb0b9d82bea 100644 --- a/arch/arm64/boot/dts/qcom/sm8150.dtsi +++ b/arch/arm64/boot/dts/qcom/sm8150.dtsi @@ -607,6 +607,10 @@ scm: scm { compatible = "qcom,scm-sm8150", "qcom,scm"; #reset-cells = <1>; }; + + shm-bridge { + compatible = "qcom,shm-bridge-sm8150", "qcom,shm-bridge"; + }; }; memory@80000000 {