From patchwork Thu Mar 10 19:24:56 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 12776883 X-Patchwork-Delegate: lorenzo.pieralisi@arm.com 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 A18DEC433F5 for ; Thu, 10 Mar 2022 19:25:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343555AbiCJT0w (ORCPT ); Thu, 10 Mar 2022 14:26:52 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33048 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343549AbiCJT0v (ORCPT ); Thu, 10 Mar 2022 14:26:51 -0500 Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2085.outbound.protection.outlook.com [40.107.22.85]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 173A913FAEA; Thu, 10 Mar 2022 11:25:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=k9KZJ8UG2yLGjtsWeHJDVMor16tkNFmh6/Ta8O8deRmaWJ849I2azMZ1qmmW1nWsNYIRSFe1O+trdotBTUR2U+R5CbvJNeXvpmpaS/MvvDzNxRu8Xxz5FVllLjyU9STCTsb8+VP/Q4Xbk9bDUoyaZjsf/WSlzL3Vl6XVVURfPAX+OZd16l8bb7U6KzMkvwIVgZS15TsTbT4m+MtJgSgnzpIAj+MzoK7fM4/oCSRvMtGm1PWdr/ci7c69a86y0iCS/VL+mRyTv6LZDIzXM/AkbxuDsUueMs2ANZxXWpOM/SkpZfqEpYPiokkepX5ChYqN4V106lb0gV89tInDCEFbQg== 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=MlVD9Tyh91tkr2rqYUEdNCSzxssBGww7nDgILoKvLKw=; b=Fl7AGeTsT1jLsM9ymeDAJj/2xeq/Qwpfs8MOMP3+ZpBsUmISq8nsAc69TfAams0DOw2/7UAnzDLnSBkI1cLeVgSnHg5DvYrn8b8uUGWa074Jee5+NoUSiAq6wao4lkxlmbKQ11/k8Ysf8Re4SRITPeWzXECyQpPORwu3gvG4P+LLL5vEwsFnu+90JwxWOJIPBacsQLvus5wumGzMMmXpkvvQEU5KD6sLNb2pg6XYOXO60N50jGEYa9N2UhlUcagIU242tbTmUyLY12hOxBETtWmc6Iapbcfoz/UTW0Z+UkZaMim5BWF8ykZr90nN5x0uYWeBhh2GYsdMfW6x/pO52Q== 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=MlVD9Tyh91tkr2rqYUEdNCSzxssBGww7nDgILoKvLKw=; b=UQIBOpn0QnvUsdQFrnoRKTDj3MDI0zw8RrcoK1zTlw6/GWOjMNMCjxGxMv/D+T9j8LElGs8YMppGCyU2FG+wOwQN/JbQpzE4IMXyVY8QBHtB2RpsvPjMroBTmf2EJQEsdCTVmFFG4Z77ymE3XNEr6aiC6mrUssD5+UZUHtTho00= 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 DB7PR04MB4858.eurprd04.prod.outlook.com (2603:10a6:10:1b::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5061.22; Thu, 10 Mar 2022 19:25:47 +0000 Received: from PAXPR04MB9186.eurprd04.prod.outlook.com ([fe80::c897:1bdf:e643:aef8]) by PAXPR04MB9186.eurprd04.prod.outlook.com ([fe80::c897:1bdf:e643:aef8%7]) with mapi id 15.20.5038.027; Thu, 10 Mar 2022 19:25:47 +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 Cc: vkoul@kernel.org, lorenzo.pieralisi@arm.com, robh@kernel.org, kw@linux.com, bhelgaas@google.com, shawnguo@kernel.org, manivannan.sadhasivam@linaro.org Subject: [PATCH v5 8/9] dmaengine: dw-edma: Add DW_EDMA_CHIP_32BIT_DBI for chip specific flags Date: Thu, 10 Mar 2022 13:24:56 -0600 Message-Id: <20220310192457.3090-9-Frank.Li@nxp.com> X-Mailer: git-send-email 2.24.0.rc1 In-Reply-To: <20220310192457.3090-1-Frank.Li@nxp.com> References: <20220310192457.3090-1-Frank.Li@nxp.com> X-ClientProxiedBy: SJ0PR05CA0051.namprd05.prod.outlook.com (2603:10b6:a03:33f::26) 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: d09d442e-d634-4589-63da-08da02cbc785 X-MS-TrafficTypeDiagnostic: DB7PR04MB4858: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: wjhH2ln/rmHBBfe+2QXo00a4IeoHk9m3f8vz/u3NbzE/uM1PeVFyxxwN4tfP3irOkc9xtcI/MjF3RyDSCXNMZoBICqXsEoqVxEhbviL2PNk9i03N/5POkpnOvmQ/D6z4f3Y1iakyl2WQ5p78aP0EVydWN/+pZCTVBgp+DGpAS/43BocNuINJ6cRVkMqAfQyt5ZaNSWvHq/JiwGshxfi4aJX5Y9/3ctivJULj3/4q3iyiQX7ri/Hf2AbD4dHEEqcQzQ1xjPDxI1y3OqUES40t/tQEGbE4DHN7/UonrQVUgeOU2qag9IZ21XBBuIu52lm6HG0g2SsZylRsX+b+1P6ucPTJKxROf62wmuiGCdn2/Olda0XZF0qBuxuMDDVN66fg97HTaz38T+245my9lIbWY9qAgJNMZJRvg5iGfCg4pvvGCskKtfjEY4ZZOi66uo1RxIFjQwQtZVnbI4c6n2PvUEk36V4FntxmYazHM+RyWfQzJOxwZinDp8mdKrNqXDx72NkUQw5YganAVQAjpfRh5cxD8aUSbmncqRi9M5iLUmwKeTl4qbIBMWhQCuwRL1bgWIRVzD/pkW8uHhEozoqgbB7az2a7LszAZJwZ1IxUnDeC66CtRn7chBX6MJuNABV9LqdtdNqasygMSe2sNCvzOgUpVT59c74Bjnzw33raIhtqBk6PRD/I7gSaT/wZBC4F 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)(1076003)(7416002)(6506007)(6512007)(36756003)(186003)(5660300002)(66476007)(52116002)(6666004)(2906002)(2616005)(86362001)(4326008)(8676002)(66556008)(83380400001)(26005)(66946007)(8936002)(38350700002)(6486002)(498600001)(38100700002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 3t7VxpG/FEdsIlEjXovMisiJmap5wIqkuw7JlRRdXvaIO7ECeL+VkxsMDkHjV0a4dJaKychgsGSm/EpgQCrEFUgD1bA8XTB1XrMZ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ECT/wmbXqtbqUdAShAARnYgB2siy3MMrZ7+2JFBYmBvrzl4bnqMVGHqcgqvA/juMZ9L+Bc9CEh/6SWoZryTtO1uIkdNSnMaFhBdwHG8aBzhMMop7zk5929EFVT4IcvgMksgK5c2pPHoR7IZANm9R9bDFXQGCsZjcUOw1NRIVD9AA3tF599dm9Ypib/iM46mDefqKJF3Gp9/x+KwMtXuOUWi5UmsCR+D//8JwWBibMJ6DbJ+ub2ctuD18/s7dk4SAjKVTZ+kFR2WkzAhRQkyjKc+7L7E/ae8nV7sK5 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: d09d442e-d634-4589-63da-08da02cbc785 X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB9186.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Mar 2022 19:25:47.6776 (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: truE+xvouu6XUQrZIBsIz9feCscm629v+E9O+0kF/J/CMSDzd9uJzaioYtteqtfPecFodzX+jOo8I7a0ENRHRA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR04MB4858 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 --- 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 | 4 ++++ 2 files changed, 12 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 30686bfe1790c..013d9a9cb991e 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 5816c8bdf9a64..8897f8a79b521 100644 --- a/include/linux/dma/edma.h +++ b/include/linux/dma/edma.h @@ -36,6 +36,9 @@ enum dw_edma_map_format { /* Probe EDMA engine locally and prevent generate MSI to host side*/ #define DW_EDMA_CHIP_LOCAL BIT(0) +/* Only support 32bit DBI register access */ +#define DW_EDMA_CHIP_32BIT_DBI BIT(1) + /** * struct dw_edma_chip - representation of DesignWare eDMA controller hardware * @dev: struct device of the eDMA controller @@ -43,6 +46,7 @@ enum dw_edma_map_format { * @nr_irqs: total dma irq number * @ops DMA channel to IRQ number mapping * @flags - DW_EDMA_CHIP_LOCAL + * - DW_EDMA_CHIP_32BIT_DBI * @reg_base DMA register base address * @ll_wr_cnt DMA write link list number * @ll_rd_cnt DMA read link list number