From patchwork Thu Apr 21 14:43:48 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 12821782 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 40C19C433FE for ; Thu, 21 Apr 2022 14:45:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1389616AbiDUOrx (ORCPT ); Thu, 21 Apr 2022 10:47:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52980 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1389686AbiDUOrk (ORCPT ); Thu, 21 Apr 2022 10:47:40 -0400 Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2073.outbound.protection.outlook.com [40.107.20.73]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A08514092D; Thu, 21 Apr 2022 07:44:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=c8nRugIy9xnEVvuE94tRvC64ner+iqhjkTXo6IH5U5eSFO1Ec71N0EMGBeEL1j1nnaXxMpGyfv5yzmw0Abs2sV0C+13TQmgZ8fvmGVoBIY4WP8mLwFqmAkxk31u0aYFGbUdiDrzbsYPuGn83RJMzGV47DCnupXlXCLAHq+oiokhOV3rkaUxiVJ9VvNvlFVErD7Q25+wFhwm3HVlgQQrtZVNnSfBgBulwealC9yYMLuBdah8KzQVs9DV87Jr3GB5F2Yp/OJoBjJYM7wRoH4pXoC7JQgOztAo9OSj+5tq8R72AGWJS7BpDhpohDRmPCi12j4HWsfbS9qaRAnynmeY+Iw== 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=PkjgbQ4rONBBxaqeu7k7MNzsLVbp6fcJxxASe5/sQNc=; b=ci2pikD9CpiOmROGOG5oNYIpXxjRDrGmxmIC/JhMgw1o+vGPgfRiyIbh+wSyjvdsifrX+vQ/B5d9D8eKFiwKNN5NU11fzDH8xyk5tqjcIJDIsxyR7ZJiXqN7AfxRpv88Xf2Uvy2p4LK1wPShYg8hC7IDLqTACiuYwdkLrpcY4Mpl40nZUyY6HOQ8TwpQPV6mncoTFlNwzTTqErvvTQHmmpEGdxJlhOyxqnKFQb/p9V9WpARpIlQMX/Vc3jiKVsfpyvYU18mlkQP3gLbuc3mrXlHYDKZlBv0rgHmXkb9ZeU8zH5D9vWjnFmBDk+2mfULV7aa2cbjLcTuXj5cg0fbEoA== 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=PkjgbQ4rONBBxaqeu7k7MNzsLVbp6fcJxxASe5/sQNc=; b=elaa/8zWxCytwoeUsxtw2ZiUMkTzumF0p4X/QytZeGBVIJXqe0eS7PQ40C+4EoZKIIZbbsNqlYCMGF1ch05sNe4f0bSFq1v7IdfVSlqnHtjavD2JL74mYZttgcESSKIYZPurZqS4dv5Ti2+2COAz/xiRoI9yBkt0dSh0vnMpx0w= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from PAXPR04MB9186.eurprd04.prod.outlook.com (2603:10a6:102:232::18) by AS8PR04MB8689.eurprd04.prod.outlook.com (2603:10a6:20b:428::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5186.13; Thu, 21 Apr 2022 14:44:48 +0000 Received: from PAXPR04MB9186.eurprd04.prod.outlook.com ([fe80::adc5:45f8:fa40:1b8a]) by PAXPR04MB9186.eurprd04.prod.outlook.com ([fe80::adc5:45f8:fa40:1b8a%7]) with mapi id 15.20.5186.014; Thu, 21 Apr 2022 14:44:48 +0000 From: Frank Li To: gustavo.pimentel@synopsys.com, hongxing.zhu@nxp.com, l.stach@pengutronix.de, linux-imx@nxp.com, linux-pci@vger.kernel.org, dmaengine@vger.kernel.org, fancer.lancer@gmail.com, lznuaa@gmail.com, helgaas@kernel.org Cc: vkoul@kernel.org, lorenzo.pieralisi@arm.com, robh@kernel.org, kw@linux.com, bhelgaas@google.com, manivannan.sadhasivam@linaro.org, Sergey.Semin@baikalelectronics.ru Subject: [PATCH v8 8/9] dmaengine: dw-edma: Add DW_EDMA_CHIP_32BIT_DBI for chip specific flags Date: Thu, 21 Apr 2022 09:43:48 -0500 Message-Id: <20220421144349.690115-9-Frank.Li@nxp.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220421144349.690115-1-Frank.Li@nxp.com> References: <20220421144349.690115-1-Frank.Li@nxp.com> X-ClientProxiedBy: SJ0PR13CA0048.namprd13.prod.outlook.com (2603:10b6:a03:2c2::23) To PAXPR04MB9186.eurprd04.prod.outlook.com (2603:10a6:102:232::18) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 10ccebba-1d57-4dd5-ce8e-08da23a57bf7 X-MS-TrafficTypeDiagnostic: AS8PR04MB8689:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: siaRafxn4CeE0nfo8J+w/W74DnL4+7tfAFl6ph6GY6nVadAJ+C2MsB/iY4F/bwxqpK+axEd+q+8cx/u7txUWdY0jFwFdLtIf3xeArDyGQdSAjJ8j0PkJKYHsxu3+qMi4pSbGZmVgDiII6X/TMgTKmtIorwbVoYJvfoJFyD8WuJR38vT3+/EOEQmR4I1Q/Po4YBg7tgfq8hmN5iW3VQnYw9PI0YGfmrnVffjy40nd41kZI5M7TtEPcbQtBttNETu7BE7sidYeeM1vmZpTkhL1qUUYdOEIPsgysUlE8dJmEc8EiubDyxy+AJTHn+5Kud7lgW7iTsVFAQEZLtF6tKnVx669SLotNnuT8Cat5Cdg90aplof72DWyZj5SmhethBN0fD3iXrJp4zWIEQJuSfKS86Bzjr9JZQAlEqOOpntIedVTuAbqbmDSNDNVj+o116lQ1W0DqkPWgnQmJnq+jCt/qQgvC2Q2zqooELlQ/hwZBnoFOjoz9yBMo0OvVL5zC6ob7RUFQagjB/i9ewaNQcyeeBnPrBGAIGZGbJoWEAEweHcsYQSD2clOtdK3N6Z3OQlBeaRtwRjahwB3qpzonGhOtr93mLnbbep/5tCLCVb8Ch/0iX3XJA7KkNP3luxfp6bqmhgigM+fZ+gEXcB1nYPqDQ7NHjxL9bGTXNTFw6Vw791DHvGHE8SKekaRfO33KbdfYWaQht86vTNmvQf5GZ3BJw== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PAXPR04MB9186.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(4636009)(366004)(38100700002)(38350700002)(186003)(86362001)(7416002)(2616005)(36756003)(5660300002)(1076003)(8936002)(2906002)(8676002)(26005)(66556008)(52116002)(6512007)(508600001)(66946007)(66476007)(316002)(4326008)(83380400001)(6506007)(6486002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 6GbNA8wpUe3dSCMtRwlgwL0yCGcxEf9xZykCR1/EaUnNJgzjGF7GIWFv6T/B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2PL10OFJSjbO0EX0NXCAGcqWdh5XhuejtMTYBqwfoGTnbJ1R1xebV9XlCnFqAYo6WNvwip5uMj8hsioLEUnnHiEvCzk4UAW6Gn8tWe0zX5lLH5LJ69eE2BnxkuWtsp8XuoZsZQhQQmDTxSE3DbVFHWC+vmxEZ8xBxIoWkuvYz84Djme2BXIDhjo0QSLO8BAEgdzMUzXOPFnpPWiXV4w4uU0sTS2YHgfeXeCkCUKA39H2WLhxpbA21tOvC0m7M+UCMMBb6hfhGlcNFdFOwP67MnVrATCdQDA22XIZON0AN/rrOMTKDSkcoUPRUT/Jmcy34CpCw8A4lziABpUvPB5J99qfqiEjr8y1V9HEMBP7RF2pFN5CjAerxEPgMU+fSiO32HYz6PKTIUEMP89jKNM+eDaTcqaIUjMkXL9UB5bPMjwat4NVC/4C59x3Zds3mDyVILxyoIa049ibfgeDfNxx6ObZPvOx7IAR4WoozjY3Wu4C/u9onoGyVya0SsLfI/GoBrHTlnK2a2E4KbZt5LFEd0X3Ijb35FsY2q+9lyu3so4RGGVAkXS/6YRndlA2uFMwe0KdjaP1SwJ7ak45vGR+BZU0w== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 10ccebba-1d57-4dd5-ce8e-08da23a57bf7 X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB9186.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Apr 2022 14:44:48.4634 (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: a4/pI8s9AKzNP+q/wMzrGBX+8Spvhxp2/znzgNYUOm2TXaL3rSpy7BStE9VGBMybqYTQNTMLJ310BFsWQyle7g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB8689 Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org DW_EDMA_CHIP_32BIT_DBI was used by the controller drivers like i.MX8 that allows only 32bit access to the DBI region. Signed-off-by: Frank Li Reviewed-by: Serge Semin --- Change from v6 to v8 - none Change from v5 to v6 - use enum instead of define New patch at v5 - fix kernel test robot build error drivers/dma/dw-edma/dw-edma-v0-core.c | 13 ++++++++----- include/linux/dma/edma.h | 2 ++ 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/drivers/dma/dw-edma/dw-edma-v0-core.c b/drivers/dma/dw-edma/dw-edma-v0-core.c index 2ab1059a3de1e..2d3f74ccc340a 100644 --- a/drivers/dma/dw-edma/dw-edma-v0-core.c +++ b/drivers/dma/dw-edma/dw-edma-v0-core.c @@ -417,15 +417,18 @@ void dw_edma_v0_core_start(struct dw_edma_chunk *chunk, bool first) SET_CH_32(dw, chan->dir, chan->id, ch_control1, (DW_EDMA_V0_CCS | DW_EDMA_V0_LLE)); /* Linked list */ - #ifdef CONFIG_64BIT - SET_CH_64(dw, chan->dir, chan->id, llp.reg, - chunk->ll_region.paddr); - #else /* CONFIG_64BIT */ + if ((chan->dw->chip->flags & DW_EDMA_CHIP_32BIT_DBI) || + !IS_ENABLED(CONFIG_64BIT)) { SET_CH_32(dw, chan->dir, chan->id, llp.lsb, lower_32_bits(chunk->ll_region.paddr)); SET_CH_32(dw, chan->dir, chan->id, llp.msb, upper_32_bits(chunk->ll_region.paddr)); - #endif /* CONFIG_64BIT */ + } else { + #ifdef CONFIG_64BIT + SET_CH_64(dw, chan->dir, chan->id, llp.reg, + chunk->ll_region.paddr); + #endif + } } /* Doorbell */ SET_RW_32(dw, chan->dir, doorbell, diff --git a/include/linux/dma/edma.h b/include/linux/dma/edma.h index fbd05a7284934..8b134896c9edb 100644 --- a/include/linux/dma/edma.h +++ b/include/linux/dma/edma.h @@ -36,9 +36,11 @@ enum dw_edma_map_format { /** * enum dw_edma_chip_flags - Flags specific to an eDMA chip * @DW_EDMA_CHIP_LOCAL: eDMA is used locally by an endpoint + * @DW_EDMA_CHIP_32BIT_DBI Only support 32bit DBI register access */ enum dw_edma_chip_flags { DW_EDMA_CHIP_LOCAL = BIT(0), + DW_EDMA_CHIP_32BIT_DBI = BIT(1), }; /**