From patchwork Fri Jun 18 14:18:37 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vinod Koul X-Patchwork-Id: 463058 Delivered-To: patch@linaro.org Received: by 2002:a02:735a:0:0:0:0:0 with SMTP id a26csp1518967jae; Fri, 18 Jun 2021 07:18:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxlYV+YJ7KGLK0ayTwjvn+eID4aw7C14dtqJuUrrl5vqf2uR81mebAtsE7cbkICz0RNKGsL X-Received: by 2002:a17:906:6bd8:: with SMTP id t24mr11473362ejs.501.1624025936971; Fri, 18 Jun 2021 07:18:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624025936; cv=none; d=google.com; s=arc-20160816; b=m4Oev+cNdLUODk96F7eD+dm/CH+ERg9rj7fby7lM1SNwi1t7/l3F5QDMSaA2+MT9bB njcbWpPJXX8gOiGX9yHW4Ru5QL/rTSUBHTN2iTLgB12F1UVFj/gnYf5i7uMpIymUIfJe vIJKDtfskldpsTAvLZlKLUA8jwzAaDiSRbeF0NAfNdc3NDR25l7+XP08GwacBjaymFVs FrNN9aoytJ2yYGfhuOEJoeyL10MRGKJt2uwX7hi+EkgDlcXIxvU6z5kV4dqYXjdDM4xM yTDAndKXyIyOkEvoY59qR2C7UkDRtMUFeVxXef/JU4PVfnoN8lXgXgxTozNFQu0trlhw HYpw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=6AeLT2Q0JFDidzI/l24L/m5xco3Bn2pJW1gR61nstSM=; b=Z4Ns0Fs8lob51A8cFaKsLSf3VnjqbDtnBqq5nRjaiG8sYBM9/5l9y9adJxkuOX3+2d EQrMQk3q32u6aftc48/T12GOG9wBWi3ItBZ++wOCHos7yBXLWMzKATxR1/mR93amZHCI jS+fvqUqNqqMUhaqcBSZiwYyoRtsPVVghX3Aw8Naso+JRJLhr74m1nmRB7IvnbdHPKnm Af6WFxc+WVU/HnqyrQDxA3ra1Ge713NUTsjvyb1IR5nxbygLeWUV00yLCjxI5PEhfzA9 s/bxjcpMqU4av06n55J1aDDKASoiIkt/aMjTSe6lvFIdN+HZmeP2plSlxhf+682Qfjyf LFJQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="UAjF/7OM"; spf=pass (google.com: domain of linux-arm-msm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id yc17si1376809ejb.627.2021.06.18.07.18.56; Fri, 18 Jun 2021 07:18:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-arm-msm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="UAjF/7OM"; spf=pass (google.com: domain of linux-arm-msm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234400AbhFROVE (ORCPT + 17 others); Fri, 18 Jun 2021 10:21:04 -0400 Received: from mail.kernel.org ([198.145.29.99]:58610 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234385AbhFROVD (ORCPT ); Fri, 18 Jun 2021 10:21:03 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 29DA061222; Fri, 18 Jun 2021 14:18:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1624025933; bh=6a9wcBqh2xCp1n07Nk+C27uAXtGZHswKD0RQYiHlEpk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UAjF/7OMb9oUg2UVHy3HEXnU3+GaAxIeW3wMuhSE5ZP0RK57jTJkaoAmlRR7kqTLl kCTgXHpFxU6zraMaQxp86IPWrQYLSxu+09CTdp3t7hDu4t+70gXp5Ammn09xEVzyBT tMsKj2ujBz3unjCx+5dSjBhIgVyJkh1yQ6yOA9xqcNEwotLkJXyLswfsHjEkAf/SjD hcn1fJ+XGQkDlT6hCUVM2Cw4uXSq2cEVFrB38vRifRpv6Vfd3ukqBO1PuP68Iecf+l YUSXsuoaPJsHZ0BLyHCYBryONt4QFQyHyyeUvUS2qOZkRgZPc8DFXj0NeWSAg2HHtC SAiZ6FkLhAWgw== From: Vinod Koul To: Bjorn Andersson Cc: linux-arm-msm@vger.kernel.org, Vinod Koul , Andy Gross , Matthias Kaehlcke , Douglas Anderson , Sumit Semwal , linux-kernel@vger.kernel.org Subject: [PATCH v2 1/3] soc: qcom: geni: move GENI_IF_DISABLE_RO to common header Date: Fri, 18 Jun 2021 19:48:37 +0530 Message-Id: <20210618141839.3777270-2-vkoul@kernel.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210618141839.3777270-1-vkoul@kernel.org> References: <20210618141839.3777270-1-vkoul@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org GENI_IF_DISABLE_RO is used by geni spi driver as well to check the status if GENI, so move this to common header qcom-geni-se.h Also, add FIFO_IF_DISABLE define. Reviewed-by: Bjorn Andersson Signed-off-by: Vinod Koul --- drivers/soc/qcom/qcom-geni-se.c | 1 - include/linux/qcom-geni-se.h | 4 ++++ 2 files changed, 4 insertions(+), 1 deletion(-) -- 2.31.1 diff --git a/drivers/soc/qcom/qcom-geni-se.c b/drivers/soc/qcom/qcom-geni-se.c index 5bdfb1565c14..fe666ea0c487 100644 --- a/drivers/soc/qcom/qcom-geni-se.c +++ b/drivers/soc/qcom/qcom-geni-se.c @@ -104,7 +104,6 @@ static const char * const icc_path_names[] = {"qup-core", "qup-config", #define GENI_OUTPUT_CTRL 0x24 #define GENI_CGC_CTRL 0x28 #define GENI_CLK_CTRL_RO 0x60 -#define GENI_IF_DISABLE_RO 0x64 #define GENI_FW_S_REVISION_RO 0x6c #define SE_GENI_BYTE_GRAN 0x254 #define SE_GENI_TX_PACKING_CFG0 0x260 diff --git a/include/linux/qcom-geni-se.h b/include/linux/qcom-geni-se.h index 7c811eebcaab..5114e2144b17 100644 --- a/include/linux/qcom-geni-se.h +++ b/include/linux/qcom-geni-se.h @@ -63,6 +63,7 @@ struct geni_se { #define SE_GENI_STATUS 0x40 #define GENI_SER_M_CLK_CFG 0x48 #define GENI_SER_S_CLK_CFG 0x4c +#define GENI_IF_DISABLE_RO 0x64 #define GENI_FW_REVISION_RO 0x68 #define SE_GENI_CLK_SEL 0x7c #define SE_GENI_DMA_MODE_EN 0x258 @@ -105,6 +106,9 @@ struct geni_se { #define CLK_DIV_MSK GENMASK(15, 4) #define CLK_DIV_SHFT 4 +/* GENI_IF_DISABLE_RO fields */ +#define FIFO_IF_DISABLE (BIT(0)) + /* GENI_FW_REVISION_RO fields */ #define FW_REV_PROTOCOL_MSK GENMASK(15, 8) #define FW_REV_PROTOCOL_SHFT 8 From patchwork Fri Jun 18 14:18:38 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vinod Koul X-Patchwork-Id: 463059 Delivered-To: patch@linaro.org Received: by 2002:a02:735a:0:0:0:0:0 with SMTP id a26csp1519006jae; Fri, 18 Jun 2021 07:19:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyh5A866HrCFalzTo7wVAZuTF3kbyLUUaBo8xsBJ9Y+UhA5g90eF8MsKThUexB4RG6p0J0K X-Received: by 2002:a17:906:90c5:: with SMTP id v5mr119604ejw.52.1624025939853; Fri, 18 Jun 2021 07:18:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624025939; cv=none; d=google.com; s=arc-20160816; b=mhX5JbhfzKdrLjOuk/QGj+pIF9SbI+BPp8jtQF5qdeD8cdJSHkBSBZPXoDcKAV7h9F ruISnNXttajNNBcjmJ+N3+20KJ0/SItA+SoWEM8+E11VpRchrkDcIsXG30m3lU1jL/1V t+omunU2vT7vgd3RRdrVLNY8UwnCoUqvluBOJLBzxMyMzlGn97a0uWI2Ks88OJD5SMe5 ccBS2ySRfpaAEqhQ1RL5MYgIo/FwY/qxyZd2azh00fDSD3UhWk9BH2Vxd/hNXksbEAtn pNvIpwu9xkizjJtqHiBjPzMF/lXgDhebeYf6ouVRWT5aCjduxo0fA6SPnt/eBnYKhrJe AwPg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=yTSSC0cuJd5GhWkXihkCLg0ZfeMZDCJXww+h5jD8TKg=; b=zwgwYXoo7BpowWKABgYE0D++0UDv/+oxcOWWOP//9bBZbpqWvmqHclIleDSuJoXRsd qih4P0Pr+DTYWK0G6o9lHVF+F9HyZUgfo3lxNgDI8TGZXYD8gV5pGSHiSH0nyrLVsbOX xM5p4H+XZ57O2HNniNPridMjG0vroxtac8r2PATuTTXMySZ+SkohbFF6V8nj8qJ0rLCc VmXjN2kg+vgnz6yR121E5SsIaDbuAtlxOqICKtQR9t4qGTIo5IYt5SfhuCdQ3WytBlpp WZ5geQAqiwAL2bBPtAn6XD5FU280cPKovG5nvJeeb0/+iyUcRqz7Fsz57V+UKk457n0W BYPg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="b7qp/NcZ"; spf=pass (google.com: domain of linux-arm-msm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id yc17si1376809ejb.627.2021.06.18.07.18.59; Fri, 18 Jun 2021 07:18:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-arm-msm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="b7qp/NcZ"; spf=pass (google.com: domain of linux-arm-msm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234476AbhFROVH (ORCPT + 17 others); Fri, 18 Jun 2021 10:21:07 -0400 Received: from mail.kernel.org ([198.145.29.99]:58654 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234469AbhFROVG (ORCPT ); Fri, 18 Jun 2021 10:21:06 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 7AB9E6120A; Fri, 18 Jun 2021 14:18:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1624025937; bh=+Fh0ldymQFISgV5PqHN/8VE9z+BKB9DrGyd8hRYlQyI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=b7qp/NcZDhsMeF5ws43GgAKBY/CXprdCuBcle1uJYFDMOnpHh6ORDIILyMd9xRpZL +zt9ZwPMW/Zzlkdwh2Ki82oBBZWk6IYPpya1NgH9pgtUUcX5+AdZ1tutgozd0wKAof HZQ4p34r8YNW9QiPrOIGONNauajPbAXn89R1VN2PeEG5z0ND1d7X3cmRsIrTnomalG 5IWDHrjPKlZaybeOFW/yZTbxnPgHm8zuWxIjDA5XppsEGxU8isPQeAbYsgtoF1l1A6 p8ZjfIMFnVp6d3KJumIxr3aV/IzkN3uyALEpLJi4d1S5oVillbrHDiUiA2UK4Rsxbu GFBsao2PcnOkg== From: Vinod Koul To: Bjorn Andersson Cc: linux-arm-msm@vger.kernel.org, Vinod Koul , Andy Gross , Matthias Kaehlcke , Douglas Anderson , Sumit Semwal , linux-kernel@vger.kernel.org Subject: [PATCH v2 2/3] soc: qcom: geni: move struct geni_wrapper to header Date: Fri, 18 Jun 2021 19:48:38 +0530 Message-Id: <20210618141839.3777270-3-vkoul@kernel.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210618141839.3777270-1-vkoul@kernel.org> References: <20210618141839.3777270-1-vkoul@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org SPI & I2C geni driver needs to access struct geni_wrapper, so move it to header. The drivers needs this header to find the geni device and use it in dma mapping. Using this method works for both DT and ACPI systems Signed-off-by: Vinod Koul --- drivers/soc/qcom/qcom-geni-se.c | 14 -------------- include/linux/qcom-geni-se.h | 14 ++++++++++++++ 2 files changed, 14 insertions(+), 14 deletions(-) -- 2.31.1 diff --git a/drivers/soc/qcom/qcom-geni-se.c b/drivers/soc/qcom/qcom-geni-se.c index fe666ea0c487..08d645b90ed3 100644 --- a/drivers/soc/qcom/qcom-geni-se.c +++ b/drivers/soc/qcom/qcom-geni-se.c @@ -78,20 +78,6 @@ */ #define MAX_CLK_PERF_LEVEL 32 -#define NUM_AHB_CLKS 2 - -/** - * struct geni_wrapper - Data structure to represent the QUP Wrapper Core - * @dev: Device pointer of the QUP wrapper core - * @base: Base address of this instance of QUP wrapper core - * @ahb_clks: Handle to the primary & secondary AHB clocks - * @to_core: Core ICC path - */ -struct geni_wrapper { - struct device *dev; - void __iomem *base; - struct clk_bulk_data ahb_clks[NUM_AHB_CLKS]; -}; static const char * const icc_path_names[] = {"qup-core", "qup-config", "qup-memory"}; diff --git a/include/linux/qcom-geni-se.h b/include/linux/qcom-geni-se.h index 5114e2144b17..5fda675c5cfe 100644 --- a/include/linux/qcom-geni-se.h +++ b/include/linux/qcom-geni-se.h @@ -38,6 +38,20 @@ struct geni_icc_path { unsigned int avg_bw; }; +#define NUM_AHB_CLKS 2 + +/** + * @struct geni_wrapper - Data structure to represent the QUP Wrapper Core + * @dev: Device pointer of the QUP wrapper core + * @base: Base address of this instance of QUP wrapper core + * @ahb_clks: Handle to the primary & secondary AHB clocks + */ +struct geni_wrapper { + struct device *dev; + void __iomem *base; + struct clk_bulk_data ahb_clks[NUM_AHB_CLKS]; +}; + /** * struct geni_se - GENI Serial Engine * @base: Base Address of the Serial Engine's register block From patchwork Fri Jun 18 14:18:39 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vinod Koul X-Patchwork-Id: 463060 Delivered-To: patch@linaro.org Received: by 2002:a02:735a:0:0:0:0:0 with SMTP id a26csp1519036jae; Fri, 18 Jun 2021 07:19:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy29pBPYAXsJzrF/oA69BHHOfogamTX3ACD2PrstilJyt7o2vsEJhe/dlOUTk4MjRIXhuGH X-Received: by 2002:a17:907:c87:: with SMTP id gi7mr11141590ejc.452.1624025943277; Fri, 18 Jun 2021 07:19:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624025943; cv=none; d=google.com; s=arc-20160816; b=GipnC/MznvlMyX1eHCEkBOFHh/KbywHVtAoTZzqHIL5A5rbsStOIlu4mcKc2dS2xfX i1pnvAuGakSpRnskBIQ2KulnLCERDsKELYF+mtD08s6SGmwooEX0P4ZzrFCL2qrmDrmV TFp/i33DLv2TxAzQADTkVK3CTLiKx+tivoLIjfdiPzM9jZunwsNPPKaW9T5/Z7SPJ2xt JPOcQFz1zX1ovOTkXvx5WiHay61hAomC0Jdt6C9HqYzzla3DkeTRJJPzJrJqVZT9frcf meV1UI0jBSPtOO6MlczYs57ugkmz/5dhUmYv1zHqknDMy+90zwxg55VyTuJw5vFJhwc+ 7ELA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=JhsfoQW7tFSKKWeSz3162BpEMHwXh43OLHfbAnJpPyw=; b=I4Ezep/8mlM9291iBUWNZpmj++Ipqy8SAxOhUjsFipzxmfm1ry4XYkrHT2TEg5v/KF +hnuBpL7pxOBCLSnS8qPd0wYGs7mLch9EPOWB8KDL7S4FurZy6Gc6hFKqqvpYt7LlavM 6jF2/P1hVFLZoTZLNaiPwLUTzgDsng5XIqo+PpGTU9uPuxYWn4b71B++SsAYg/tJFqO2 x7kj1gwk0d1d4aTu6s7tCSQHWm6TKu/DD2IDLBSqISGKiEEWWrj1ZMOX+0Y3KeS6fRBs cRl6zFNFQ9rywNPJHiw/ou25cGxaMoD4XCurwOtYrsa5N4XlAF+8DLB2nu9RgXjjnlzn /rbA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=k8lqdYl7; spf=pass (google.com: domain of linux-arm-msm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id hx21si1811382ejc.112.2021.06.18.07.19.03; Fri, 18 Jun 2021 07:19:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-arm-msm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=k8lqdYl7; spf=pass (google.com: domain of linux-arm-msm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234469AbhFROVL (ORCPT + 17 others); Fri, 18 Jun 2021 10:21:11 -0400 Received: from mail.kernel.org ([198.145.29.99]:58750 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234472AbhFROVJ (ORCPT ); Fri, 18 Jun 2021 10:21:09 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id CB5C861222; Fri, 18 Jun 2021 14:18:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1624025940; bh=6Us+RX3nl4iAlpEY6I+lqz2fIEguQp5Np4nXwZxMqZw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=k8lqdYl7MvypBonkaG8UM1gOUkoU1UNs3JJ5Hfa37GsqZlHnv9JCLLd7nKnnwr6G3 LZn/aUz5+2rmAmBH3MLtjzXSQtXyArQhLEYs6iCaYzXoTBqjDRSfHNaHr0eTHCT4RJ zUh79kIiR8F62Cbo8sQrPYIVH8p4YeEFVx2ghp/DB2+AKsfzXoGNGi5ototVKxPMRc YHLtJln4Z491PHpHWbV4S6wKwfv4ol5OWR3fWgIhuxEk7w4iyFX0Q4UuNeokXMnQb5 FdAnfwZs3BFW7QRU0r7Hi8nTi2j6ZeG3Nl93VtCirvQ3+68w6FHqZcNcZj3d1xy43A kYIMxu63ft8IA== From: Vinod Koul To: Bjorn Andersson Cc: linux-arm-msm@vger.kernel.org, Vinod Koul , Andy Gross , Matthias Kaehlcke , Douglas Anderson , Sumit Semwal , linux-kernel@vger.kernel.org Subject: [PATCH v2 3/3] soc: qcom: geni: Add support for gpi dma Date: Fri, 18 Jun 2021 19:48:39 +0530 Message-Id: <20210618141839.3777270-4-vkoul@kernel.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210618141839.3777270-1-vkoul@kernel.org> References: <20210618141839.3777270-1-vkoul@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org GPI DMA is one of the DMA modes supported on geni, this adds support to enable that mode Signed-off-by: Vinod Koul --- drivers/soc/qcom/qcom-geni-se.c | 32 +++++++++++++++++++++++++++++++- include/linux/qcom-geni-se.h | 5 +++-- 2 files changed, 34 insertions(+), 3 deletions(-) -- 2.31.1 diff --git a/drivers/soc/qcom/qcom-geni-se.c b/drivers/soc/qcom/qcom-geni-se.c index 08d645b90ed3..40a0a1f88070 100644 --- a/drivers/soc/qcom/qcom-geni-se.c +++ b/drivers/soc/qcom/qcom-geni-se.c @@ -307,6 +307,32 @@ static void geni_se_select_dma_mode(struct geni_se *se) writel_relaxed(val, se->base + SE_GENI_DMA_MODE_EN); } +static void geni_se_select_gpi_mode(struct geni_se *se) +{ + unsigned int gpi_event_en; + unsigned int m_irq_en; + unsigned int s_irq_en; + + geni_se_irq_clear(se); + writel(0, se->base + SE_IRQ_EN); + + s_irq_en = readl_relaxed(se->base + SE_GENI_S_IRQ_EN); + s_irq_en &= ~S_CMD_DONE_EN; + writel(s_irq_en, se->base + SE_GENI_S_IRQ_EN); + + m_irq_en = readl(se->base + SE_GENI_M_IRQ_EN); + m_irq_en &= ~(M_CMD_DONE_EN | M_TX_FIFO_WATERMARK_EN | + M_RX_FIFO_WATERMARK_EN | M_RX_FIFO_LAST_EN); + writel(m_irq_en, se->base + SE_GENI_M_IRQ_EN); + + writel(GENI_DMA_MODE_EN, se->base + SE_GENI_DMA_MODE_EN); + + gpi_event_en = readl(se->base + SE_GSI_EVENT_EN); + gpi_event_en |= (DMA_RX_EVENT_EN | DMA_TX_EVENT_EN | + GENI_M_EVENT_EN | GENI_S_EVENT_EN); + writel(gpi_event_en, se->base + SE_GSI_EVENT_EN); +} + /** * geni_se_select_mode() - Select the serial engine transfer mode * @se: Pointer to the concerned serial engine. @@ -314,7 +340,8 @@ static void geni_se_select_dma_mode(struct geni_se *se) */ void geni_se_select_mode(struct geni_se *se, enum geni_se_xfer_mode mode) { - WARN_ON(mode != GENI_SE_FIFO && mode != GENI_SE_DMA); + WARN_ON(mode != GENI_SE_FIFO && mode != GENI_SE_DMA && + mode != GENI_GPI_DMA); switch (mode) { case GENI_SE_FIFO: @@ -323,6 +350,9 @@ void geni_se_select_mode(struct geni_se *se, enum geni_se_xfer_mode mode) case GENI_SE_DMA: geni_se_select_dma_mode(se); break; + case GENI_GPI_DMA: + geni_se_select_gpi_mode(se); + break; case GENI_SE_INVALID: default: break; diff --git a/include/linux/qcom-geni-se.h b/include/linux/qcom-geni-se.h index 5fda675c5cfe..336b682392b1 100644 --- a/include/linux/qcom-geni-se.h +++ b/include/linux/qcom-geni-se.h @@ -11,8 +11,9 @@ /* Transfer mode supported by GENI Serial Engines */ enum geni_se_xfer_mode { GENI_SE_INVALID, - GENI_SE_FIFO, - GENI_SE_DMA, + GENI_SE_FIFO, /* FIFO mode */ + GENI_GPI_DMA, /* GSI aka GPI DMA mode */ + GENI_SE_DMA, /* SE DMA mode */ }; /* Protocols supported by GENI Serial Engines */