From patchwork Thu Mar 7 17:32:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 13586083 Received: from EUR02-DB5-obe.outbound.protection.outlook.com (mail-db5eur02on2046.outbound.protection.outlook.com [40.107.249.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1C594130E4B for ; Thu, 7 Mar 2024 17:33:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.249.46 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709832809; cv=fail; b=HWWZxlHxs9FGoCDrTLo1cdqiDEjA2R1RYZa+PaYgABgunacbDYA4N0jSeGJ3iWg//dlHdGfhyl14h2SlIeqkKgbssZKFcUW6feSxg069EGOIIpAG0wi0B8LcuYp/HsCXCgBs/WsI0j9ViuSB6jYDA4/A5t9ji33lA90k7QuNupo= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709832809; c=relaxed/simple; bh=PAauSkVd257q5YDs50he+CnIKgSErr2vkRkT1d4FKJM=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=NOA4oPgzYQo1TzcNdcvFH6Mglh+lKeGTn5aua4DwQZ1rKtgkAANX1F69Zds+qx6onP06BS8ao/O55JY3DhsZq45H6SEMQkqVcOsyDKh+KmRU5or/C/WLB3FmdpOKS6CTe2iB+15Hm550dwuyij/tExLrZIsIIB4T6FXNheMxs9w= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com; spf=pass smtp.mailfrom=nxp.com; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b=rZuLk+kU; arc=fail smtp.client-ip=40.107.249.46 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="rZuLk+kU" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jBtTTVLndbCQ1nywRTblYhAi7/RyhSvPUD/qk2vf5hTCgPXN1HUEzyb9wBF8lYo16+pn2ESZh/C4AWxckKSrhSzHcpc3nN0aQ/r4Buo0G5EBPzgU59CW8oD8jGrodni8z/a7K7bWXbu2WjCD+EagU9v3z+UOXKjzi0D/i2fD/Nou3kRKuKZgO9MPYO6j3o+ZZifUynf53bHKNVTa0ZUAu/PV327HH+VNeQtpJ+np1fpYiJDOWyoILjrfsX9vdhD67vrf4zDMAqLQDmFwo+e/TNPRbaZd51yXABHrqpJLvyaMu98abpivRGU8K0QvYQHuanG/nO9h/sdHehgFHroxvw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=fr2LO0h9CyoaMXE2T45nE8psg5Uj5g7MRpr4k8U/A9Q=; b=iRXHd1pyWmLhbzRNItNFl8BwcfOsQYjnc6dzqV8qkP7mDukYVbMnC03rqK/IEnN/Q3EBQfC8pwvLnZJ4VF1lvvyJVdA7bUh1IL1j5dkysVqzqyQsQ1ZFMHy/dg6touz5X4PJxGfPBK+TixqO2gomj00+1C66Xokl/99fg8QPFuGxPeNxM5qYo6lCTTFvKgBka0OEl9XofrMaIYC5d+sDH4HTmMrnvgHFRM7aXIDsz19GLat5QhvQQCV8YqYSlh4+1amio4/lM1gDCBGIU2fxh54i9M/rt0I0YzI86S/Y2/Qw9PlW+2Q3Zdyiv40TXvaLk79oF8LFVj60QDShDxlKdw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=fr2LO0h9CyoaMXE2T45nE8psg5Uj5g7MRpr4k8U/A9Q=; b=rZuLk+kU6+A8m01UeTaqOR9kWo1JDE/RZI8htyiZD1rWx8naHiTTAZJdhoaF4wZB7K3pDEtGR7g9K53FnV0na/1Od+B0Vsg3N2Ht86EHRxv7Ua3NRgN43OP0OtzmgHgp/m9g51z5qtCpSAGASPNblKiucNtoQXvxOyPhGRxJJhM= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from PAXPR04MB9642.eurprd04.prod.outlook.com (2603:10a6:102:240::14) by AM8PR04MB7794.eurprd04.prod.outlook.com (2603:10a6:20b:247::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7362.24; Thu, 7 Mar 2024 17:33:25 +0000 Received: from PAXPR04MB9642.eurprd04.prod.outlook.com ([fe80::3168:91:27c6:edf6]) by PAXPR04MB9642.eurprd04.prod.outlook.com ([fe80::3168:91:27c6:edf6%3]) with mapi id 15.20.7362.024; Thu, 7 Mar 2024 17:33:25 +0000 From: Frank Li Date: Thu, 07 Mar 2024 12:32:44 -0500 Subject: [PATCH v2 4/4] dmaengine: imx-sdma: Add i2c dma support Message-Id: <20240307-sdma_upstream-v2-4-e97305a43cf5@nxp.com> References: <20240307-sdma_upstream-v2-0-e97305a43cf5@nxp.com> In-Reply-To: <20240307-sdma_upstream-v2-0-e97305a43cf5@nxp.com> To: Vinod Koul , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team Cc: dmaengine@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, imx@lists.linux.dev, Frank Li , Robin Gong , Clark Wang , Joy Zou , Daniel Baluta X-Mailer: b4 0.13-dev-c87ef X-Developer-Signature: v=1; a=ed25519-sha256; t=1709832785; l=1789; i=Frank.Li@nxp.com; s=20240130; h=from:subject:message-id; bh=Z+znoASHkKmDKADwkU6SjZopn98mnwO1hpFlpJAh3Ck=; b=Ku4e7caUq85Jh4+K9NjD5IwJYrhG35Of3csh8qwVRO2dvgCKoLBzbN1E5FLznRxEDtzgAsyGx Fm0vq4z5N7CDdrsUEVC34uZLXjhaPtHVH/jp1fkT7zglOoc3GoVQPlK X-Developer-Key: i=Frank.Li@nxp.com; a=ed25519; pk=I0L1sDUfPxpAkRvPKy7MdauTuSENRq+DnA+G4qcS94Q= X-ClientProxiedBy: SJ0PR13CA0065.namprd13.prod.outlook.com (2603:10b6:a03:2c4::10) To PAXPR04MB9642.eurprd04.prod.outlook.com (2603:10a6:102:240::14) Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB9642:EE_|AM8PR04MB7794:EE_ X-MS-Office365-Filtering-Correlation-Id: 9d647bcc-44d4-4a77-72a6-08dc3eccb195 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: YqMY75DjpBUXZYd/J8INl3kjQ/NxNBrFBPrdq47aykXdYkUAxmQ29/X1pQCev4aADLeuADuz1TFLzUGzs6xyGDUiccusdDr8mC9Hqr7kuQ95BjAZ39SMve9WXDvfOnm4kvDEknWL11dCbBLYtm8IgPFeJjqNFSclYR1zNL++fH9GzrNSBHzWchk+VufLWxf2KUeszuR5572/8+UGfYZU08nNSjtQB5DcVTWcxHW7X2VvygEgHQGQESBJq4hjPZmGHf4GBZL/SJ51/vbr0TChNJYNf+GL7OVaIZkCvTN2k2ECE3hToO9qDf7YI2SxgzOrk8eDqN3XNjWaN0wLvUlGpCkD9FN55CBV/CQA5pMty+bAJHt0JV2j91HTo9BwENMzmEYn0beVKXuYIOsRIDWuWHV65QbMWJE7Hkh24vmFuCBgdkni6JsEUKfxx4jyxHpNWYzOc2FaXtIz9H5vWsWsetsjt1J0c7hvOQvPSmWoPxAbe8DYiP8xY1kak9HCPpzICrj2j2vvmdgUAHSDDzUDa4lYnRB01nxXUeRqSz/X+/aP+H/wFA9bcCbR82kpw4SS6NM1v8hLhenxN/+jkx3VsZ9DionRNO5DxY8FSD0TWE7FOnQdEZSuDotLfVjnA/bFl2iwq3buQ6M7j5rbcIIrbd5lS1bQqGTLbmFlr+3OXwPPGPSAo+QSecUotHydfus8xwrDW3nkm8lqabozVSSLBi+JqTyPI0QNBoevpUAEzcw= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PAXPR04MB9642.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(376005)(38350700005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?OdfVWxxKj5vyPD284genYVUaUaoM?= =?utf-8?q?9qEK3MTMssndV42AnbbctdjcbaVzWaOQ3A//5xPFDbZB25ilAwbAwts7CfEON0yMF?= =?utf-8?q?M6UOeFG8OT66F1P7WaB9hatzu/FE7e/YW3hO4UTGZYXPfQq1ntMRZKSLcBvc/oBWy?= =?utf-8?q?fS6OprWLOPLMAFgw1be9Trohm9F9iA5v8LRSjC8WJCp4+u8P914htpP0SZEj1S7km?= =?utf-8?q?MwLFk2b19AgXdXXGRuLAlP9Kwj07z7tGuIEjXpCgl0FcbITu2svamq4imqoUZ+3Gb?= =?utf-8?q?pqYYNCvSizVMxk41CI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aHIpbbx/hSXx/O3LYUMtjUi3WgbhTYY7L0SVv1Ma8yNDLqy?= =?utf-8?q?ErSbQhVdRMWj1uML2urGh73WHiuuVzJ+r35Pny8XVnhJJUaxWZn9KzYKrvN9wyGtP?= =?utf-8?q?T7xc+UiV0LIZrFxpjIGAwBc3YOab9zu93AqhRfcY2iwCjtmsi1HOJN1UkXiqv3+Z+?= =?utf-8?q?SxWtJUpgsHt+C1r4Tp4h7domR0AB2wD/lYBC3zxfL+3RbkPDo5TsWbinNesAKveVW?= =?utf-8?q?1F+LN/AaiR4lgg4wEIPlsVbpeVtKa6sfCnUoBeW4EyNrDvri/UCsfQGaAcE20tWsj?= =?utf-8?q?FzyeL9rVb+WGrCJ37LRvi4Szr8vDACRK0lwHVlUMUXAENj6b6pcvVWn2rkX4Ezgc8?= =?utf-8?q?hRV4u/vyPs9K?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9d647bcc-44d4-4a77-72a6-08dc3eccb195 X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB9642.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Mar 2024 17:33:25.4485 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: D4PPHxQe7Nekx9mGfy8g54GL7IekbC19Lq49y/sO9kGuGZdm67GCqYhWtYhni4ffy7XO/tmwSS9BkS8HY4Em0w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM8PR04MB7794 From: Robin Gong New sdma script (sdma-6q: v3.5, sdma-7d: v4.5) support i2c at imx8mp and imx6ull. So add I2C dma support. Signed-off-by: Robin Gong Acked-by: Clark Wang Reviewed-by: Joy Zou Reviewed-by: Daniel Baluta Signed-off-by: Frank Li --- drivers/dma/imx-sdma.c | 7 +++++++ include/linux/dma/imx-dma.h | 1 + 2 files changed, 8 insertions(+) diff --git a/drivers/dma/imx-sdma.c b/drivers/dma/imx-sdma.c index 35fb69a84a8da..5bc4419fd45f3 100644 --- a/drivers/dma/imx-sdma.c +++ b/drivers/dma/imx-sdma.c @@ -247,6 +247,8 @@ struct sdma_script_start_addrs { s32 sai_2_mcu_addr; s32 uart_2_mcu_rom_addr; s32 uartsh_2_mcu_rom_addr; + s32 i2c_2_mcu_addr; + s32 mcu_2_i2c_addr; /* End of v3 array */ s32 mcu_2_zqspi_addr; /* End of v4 array */ @@ -1077,6 +1079,11 @@ static int sdma_get_pc(struct sdma_channel *sdmac, per_2_emi = sdma->script_addrs->sai_2_mcu_addr; emi_2_per = sdma->script_addrs->mcu_2_sai_addr; break; + case IMX_DMATYPE_I2C: + per_2_emi = sdma->script_addrs->i2c_2_mcu_addr; + emi_2_per = sdma->script_addrs->mcu_2_i2c_addr; + sdmac->is_ram_script = true; + break; case IMX_DMATYPE_HDMI: emi_2_per = sdma->script_addrs->hdmi_dma_addr; sdmac->is_ram_script = true; diff --git a/include/linux/dma/imx-dma.h b/include/linux/dma/imx-dma.h index cfec5f946e237..76a8de9ae1517 100644 --- a/include/linux/dma/imx-dma.h +++ b/include/linux/dma/imx-dma.h @@ -41,6 +41,7 @@ enum sdma_peripheral_type { IMX_DMATYPE_SAI, /* SAI */ IMX_DMATYPE_MULTI_SAI, /* MULTI FIFOs For Audio */ IMX_DMATYPE_HDMI, /* HDMI Audio */ + IMX_DMATYPE_I2C, /* I2C */ }; enum imx_dma_prio {