From patchwork Fri Feb 16 17:34:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Manivannan Sadhasivam X-Patchwork-Id: 202264 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:c619:b0:108:e6aa:91d0 with SMTP id hn25csp670884dyb; Fri, 16 Feb 2024 09:36:19 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCU1jgrwafQfu/+vkj3KlpQyixNd8QdHtsrZAP0NWshpKo6GnqzOXoQwqOncUVI8EWVTjJ79TqQ2OOtr//6KVSmHAG71Jw== X-Google-Smtp-Source: AGHT+IFwMztW1tkfY2D+CvXlkPrqH5z8q0kjHPJj05Hk0b4AwAlL4QauSfvPgiyhSpR7FdUPTPXC X-Received: by 2002:a17:90b:a44:b0:299:2434:e4b3 with SMTP id gw4-20020a17090b0a4400b002992434e4b3mr4043182pjb.39.1708104979588; Fri, 16 Feb 2024 09:36:19 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708104979; cv=pass; d=google.com; s=arc-20160816; b=bIWpNfXPSrJplYcaVbvjIxuzb32Jh9XPDAEeNt2cQ5j0DmabpSB5L38kB1Pf7vN7PF CkZ/QSdX5Qqf2rJWsMvgf+BEGPHuRkJHB9Oct4JL+nn3gUSaBK927PqOrxQCjXDgvkOC DlttYUw/k2sQXv88jeEMzU6JW7CvV7eKdieodZ+pxHLG03MfoZgMUE36FXx87OEKcraY BYTkTYTp/KS2rwCQAdZs6HJAyhAaX/ysShG0nuZVC+oywSQsCJql1G1kma8jDy6cKakA nD/f24ENmgsaa5Urisu17TwWme8p8WtyzG3iAxF/EWFmwSmxEGMqJN/SYWR8bQMoBU1+ 3mRA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=8efIfXj3EDiKaREh1NVON3UM6rTKzHGcjeds+XSN7t8=; fh=dSUjDLRsY9CETqtLU6PxaSzKE4FyUextaYcOEc5KSBg=; b=O9+/xohQ/sefYbtJbo7r35aWy377wpXsAX6cUk41lCwzPE9x/KYjH5AqvboS9Kizl1 Cg84bqVkrOR4C4qNC3QehCjSiB3mzwHg+pKSH5nX6K8KjMlozMVVTWZ1jrEKX3RfjQoK E9ww4489LWFW65xPxuwjsjgVCbEP1rdGrGNzZPb7f5dlFW1epYvHQLylrpM9TyTQmX0u n10e0CoOU+r/De4WivuLXgt4zgV/pV7qn9cA4eKigR+9+hRDMd/zFp3Ae6kbQponnLtk L8iUtq68DdsZ2lcNTFzHLt06IEN+0fhGDg806IdNk3nj0f8SpI0dZnGd+TfZo/BRGLkt Ffwg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=FBHDoMzD; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-69075-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-69075-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id ls12-20020a17090b350c00b00299360b011csi282044pjb.37.2024.02.16.09.36.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Feb 2024 09:36:19 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-69075-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=FBHDoMzD; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-69075-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-69075-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id AC35B285DE1 for ; Fri, 16 Feb 2024 17:35:30 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 856961332B0; Fri, 16 Feb 2024 17:35:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="FBHDoMzD" Received: from mail-pl1-f177.google.com (mail-pl1-f177.google.com [209.85.214.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 062FF131E52 for ; Fri, 16 Feb 2024 17:35:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.177 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708104905; cv=none; b=MBrO9bf2CLLa9TnSi5kotDLfm6PlpXcUtm8x6ZeYBORxjHFwP1HtAXpDDxFZCF9nJyyeSnNcn1omjawlo87QtHeRT2RPmt5rY1OXG1HaP9ojq86xpB+EnXZHUpYuswlMM8bNlIvq4SHZQ93r1Jq7SnN+9lTFONDh7/P7DlG9weY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708104905; c=relaxed/simple; bh=m8AOqRiSHCcO5mZcayvtN8wItwmC4U+br9OIM450sVs=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=V7DKRJJ1KV6UauA4TMMjulxZDll+uSReIiEkAd8XIkKajCJ38w705L1j+JhRLzBuVLJ0vvdo2T3rk06gocAEGIICHc16jdTFINQyFFRiG75mAG54tuTWyjUxl9YvAwSnCu1tETvGxhEP4WAuJDTOkpA7AhVtx2iSzD+ZJvam3PI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=FBHDoMzD; arc=none smtp.client-ip=209.85.214.177 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-pl1-f177.google.com with SMTP id d9443c01a7336-1d934c8f8f7so23977925ad.2 for ; Fri, 16 Feb 2024 09:35:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1708104903; x=1708709703; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=8efIfXj3EDiKaREh1NVON3UM6rTKzHGcjeds+XSN7t8=; b=FBHDoMzDAD1CPsX06sBmXhCQksFkKDaNL9zLIJ2JQUp3lUC8uDGLgS2b+o4/e2/d7P BeTqaY9WxVMS3q1Uhc4ORJLZTnNKUGYyC7+SM4eYQg6m4SRvgX89IpDhR5WuU+NciKM9 nmJ6xwfFlpjVe4GJaoEdj3IGpJi9nqE2xgt9RWSQrw1BUrMmLfKH1Wu90D05TLU7fWEQ 3yWzEr+ts59nsgdR5BTbcjHeuk6p4mBL96gsFy2dn5h6JT/zINBSLmXxhqvrpSqkKWZ/ F6inbWCC9mcEeYwrLTAB3A8AbcpHkw8Sj8Y8RJNH5ii/fCxONg59tAXCWFnNj6tgBdbw aoZw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708104903; x=1708709703; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=8efIfXj3EDiKaREh1NVON3UM6rTKzHGcjeds+XSN7t8=; b=lHZqAL//eIBmRR89XnNldbsVb7UzrCdTIXKcduU+RepI7CCbQJCxcG+zDWQu5VohaE m+RuFvymRLVf4P+1CvWGOklEhmW7k2wCeV8SwrLtGiUVSTixx4w5ipVHNadPUPxBWaHM lfzgzxxbjTZs084b21UZtsugrU2zrWLTXtwVO4wKU1Xw5xYb4J4I1GKoaqazWOob8IBo wsgPcBMDI8qlG28BgP6VS2Y33APxiFQSR3BdCITn3JCijEy2biMNRsUP+F7py9JGaFq6 zvL8t8F9F+3WOuJaR6ILFF2dSUMl3UK+/QOlab0IFTx30qKb+KICUEajdo6AOkPIneDW nS9g== X-Forwarded-Encrypted: i=1; AJvYcCWji2mEfMMLWpUeC3evO83+aoc5PZUv1bImGNDtQ7KQmMQjt2l/HccFfz8IgQE0dOHXo43jIxtl3rG26ozVikBO6B1QLF5vatGfZyUy X-Gm-Message-State: AOJu0YxPzbsPzTVgea9t4irniuLa+meqWCjss3yeOSB/eERDtDbIPjPP cstIpL4JU0dO0TAMF3Nn21aRGzNsIH9FgbSR6GPQM/PU0e4i4/T1Qsdqt0TOosHaKEvV+0r3WeQ = X-Received: by 2002:a17:902:784e:b0:1d8:cbca:8fdd with SMTP id e14-20020a170902784e00b001d8cbca8fddmr4808375pln.67.1708104903225; Fri, 16 Feb 2024 09:35:03 -0800 (PST) Received: from [127.0.1.1] ([120.138.12.48]) by smtp.gmail.com with ESMTPSA id v9-20020a170902b7c900b001db5241100fsm118592plz.183.2024.02.16.09.34.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Feb 2024 09:35:02 -0800 (PST) From: Manivannan Sadhasivam Date: Fri, 16 Feb 2024 23:04:40 +0530 Subject: [PATCH v2 1/5] PCI: dwc: Refactor dw_pcie_edma_find_chip() API Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240216-dw-hdma-v2-1-b42329003f43@linaro.org> References: <20240216-dw-hdma-v2-0-b42329003f43@linaro.org> In-Reply-To: <20240216-dw-hdma-v2-0-b42329003f43@linaro.org> To: Jingoo Han , Gustavo Pimentel , Lorenzo Pieralisi , =?utf-8?q?Krzysztof_Wilczy=C5=84?= =?utf-8?q?ski?= , Rob Herring , Bjorn Helgaas , Marek Vasut , Yoshihiro Shimoda , Kishon Vijay Abraham I Cc: Serge Semin , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-arm-msm@vger.kernel.org, mhi@lists.linux.dev, Manivannan Sadhasivam X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=openpgp-sha256; l=2569; i=manivannan.sadhasivam@linaro.org; h=from:subject:message-id; bh=m8AOqRiSHCcO5mZcayvtN8wItwmC4U+br9OIM450sVs=; b=owEBbQGS/pANAwAKAVWfEeb+kc71AcsmYgBlz5y9jEZ2MRbDlRIXAc5qpjEUTe25c9uY3Tc10 XimLXNNSDmJATMEAAEKAB0WIQRnpUMqgUjL2KRYJ5dVnxHm/pHO9QUCZc+cvQAKCRBVnxHm/pHO 9WCIB/4h1XrbJ1DWyjTcM1TdQqqfBBN+Z+xZG3crirTEU5kZDMjdNtqocFqZeRGAFIt5i/hlpZu kplHDhsJEkzg+SX5kiNzDxQi31ohbsHNuSAE6w9rq5cFHUnskEGVaZQe2m4swo/DoQth1mmkBTf va7X+7V/pMxdJngff46zw/cTgD7ijo07T1OWTh7GHHZfZVmLYDfrBmkIIaaxI44hWkiAlfs9AFr NdeJA1V/r3iVv1n/NiXmyEq8B+v5Kiv5m5HwXkyKP0qEA7BLGRtuydpaNt3guQ/LHGBNY12g3V2 T4U32kGOxzkpF2ZjXdBGm0K5kjhldjuVtsVNMhYsJoJdEWoL X-Developer-Key: i=manivannan.sadhasivam@linaro.org; a=openpgp; fpr=C668AEC3C3188E4C611465E7488550E901166008 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791077887371509864 X-GMAIL-MSGID: 1791077887371509864 In order to add support for Hyper DMA (HDMA), let's refactor the existing dw_pcie_edma_find_chip() API by moving the common code to separate functions. No functional change. Suggested-by: Serge Semin Signed-off-by: Manivannan Sadhasivam --- drivers/pci/controller/dwc/pcie-designware.c | 40 +++++++++++++++++++++++----- 1 file changed, 33 insertions(+), 7 deletions(-) diff --git a/drivers/pci/controller/dwc/pcie-designware.c b/drivers/pci/controller/dwc/pcie-designware.c index 250cf7f40b85..3a26dfc5368f 100644 --- a/drivers/pci/controller/dwc/pcie-designware.c +++ b/drivers/pci/controller/dwc/pcie-designware.c @@ -880,7 +880,17 @@ static struct dw_edma_plat_ops dw_pcie_edma_ops = { .irq_vector = dw_pcie_edma_irq_vector, }; -static int dw_pcie_edma_find_chip(struct dw_pcie *pci) +static void dw_pcie_edma_init_data(struct dw_pcie *pci) +{ + pci->edma.dev = pci->dev; + + if (!pci->edma.ops) + pci->edma.ops = &dw_pcie_edma_ops; + + pci->edma.flags |= DW_EDMA_CHIP_LOCAL; +} + +static int dw_pcie_edma_find_mf(struct dw_pcie *pci) { u32 val; @@ -902,8 +912,6 @@ static int dw_pcie_edma_find_chip(struct dw_pcie *pci) if (val == 0xFFFFFFFF && pci->edma.reg_base) { pci->edma.mf = EDMA_MF_EDMA_UNROLL; - - val = dw_pcie_readl_dma(pci, PCIE_DMA_CTRL); } else if (val != 0xFFFFFFFF) { pci->edma.mf = EDMA_MF_EDMA_LEGACY; @@ -912,12 +920,17 @@ static int dw_pcie_edma_find_chip(struct dw_pcie *pci) return -ENODEV; } - pci->edma.dev = pci->dev; + return 0; +} - if (!pci->edma.ops) - pci->edma.ops = &dw_pcie_edma_ops; +static int dw_pcie_edma_find_channels(struct dw_pcie *pci) +{ + u32 val; - pci->edma.flags |= DW_EDMA_CHIP_LOCAL; + if (pci->edma.mf == EDMA_MF_EDMA_LEGACY) + val = dw_pcie_readl_dbi(pci, PCIE_DMA_VIEWPORT_BASE + PCIE_DMA_CTRL); + else + val = dw_pcie_readl_dma(pci, PCIE_DMA_CTRL); pci->edma.ll_wr_cnt = FIELD_GET(PCIE_DMA_NUM_WR_CHAN, val); pci->edma.ll_rd_cnt = FIELD_GET(PCIE_DMA_NUM_RD_CHAN, val); @@ -930,6 +943,19 @@ static int dw_pcie_edma_find_chip(struct dw_pcie *pci) return 0; } +static int dw_pcie_edma_find_chip(struct dw_pcie *pci) +{ + int ret; + + dw_pcie_edma_init_data(pci); + + ret = dw_pcie_edma_find_mf(pci); + if (ret) + return ret; + + return dw_pcie_edma_find_channels(pci); +} + static int dw_pcie_edma_irq_verify(struct dw_pcie *pci) { struct platform_device *pdev = to_platform_device(pci->dev); From patchwork Fri Feb 16 17:34:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Manivannan Sadhasivam X-Patchwork-Id: 202263 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:c619:b0:108:e6aa:91d0 with SMTP id hn25csp670852dyb; Fri, 16 Feb 2024 09:36:16 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWL2r3B03SKdwZUkeU6ZRnvKGDbBfA1wTP/Lw8h5jqpAwHGfDk7DS7jv89HLZZGQLvFbiVPXVzyC4aUFdS5nPbJ/XHTjA== X-Google-Smtp-Source: AGHT+IGtsjgzc+6mQg9iHycZyHjgoYxYW6au0fJEEMfZnF8pKlHCM2Zfwx6ibugKxe4UUfuSRZwU X-Received: by 2002:a05:620a:e08:b0:785:c298:3eec with SMTP id y8-20020a05620a0e0800b00785c2983eecmr8165249qkm.14.1708104976441; Fri, 16 Feb 2024 09:36:16 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708104976; cv=pass; d=google.com; s=arc-20160816; b=LXw/PGiu62cSZ8dNo5AKKEfcJ5sha9nXXkz9x283f1NYb5M4Pmvd9uVDMNEOIdGPWU PO87nn5aAlZLtD/URqL/0i/4wDpXcpeaKPzVg3vRG3nwC+B8yaRuC0HtBma4ssolephz 7Zr+wqOiEVg+nJqC5+BM5DtMn5aHHznWAGFmpnwoAFKjbA2ouERAthrVyFTh7vUDxXVG SLIAaj8OJIUqlOH0kNMqe+ff2L2MLQvfGkNWQ3EAwGahYj/nsFW3eyPXWtOt7Y/idVJc cvPe55TlFdYJ1qyyrv1jPa3YbfTzBNrhaoYkDwiN7RMPj/ShhhKIME5i4d86c3nUVRxb qQvg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=xammFEIqB1ELfrS5tvbq4AnuR2HTos7f1tV8KUMgLV4=; fh=VL106fhOzXMPH0G0Uwhwc/MT1qMEFIp0lhqQzrgc72E=; b=CdAZ07Av9JHcjx0Z6ElD1NzSpwXxkPC+hYaFWnc7v+oT7isoFW5JbBLI8QNiLOjVBE Yga+6b1mDb11Jh0PEZxM00IYuEx83X36zCrtsyVRhgFIbZaZ2eOAuHGU22GfqJnr9dPA WBa92joWiRipQfLdN/qzo40G+1B038WRkHjgRC2HHGwBqFgGPK+eKU9WvVaYZ+nYS8sL veUMpuFs/EO0/Un9Xqk6Pr+P9ps50OGFE/jlDLbWBT+9ZZ23Rg3NUf2Qh5ii8CdUA4g/ TCMPO9yxzarGRlOlxz7whdPbc1iYOBBvinhJ885kd8hu3vQ6hWMI2IqlyPRwT6b6wIaa inrw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=SnTC8DHi; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-69076-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-69076-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id wa26-20020a05620a4d1a00b00785d4e586fdsi321927qkn.399.2024.02.16.09.36.16 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Feb 2024 09:36:16 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-69076-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=SnTC8DHi; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-69076-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-69076-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id BCDE11C237E0 for ; Fri, 16 Feb 2024 17:35:45 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A1E58133411; Fri, 16 Feb 2024 17:35:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="SnTC8DHi" Received: from mail-pg1-f182.google.com (mail-pg1-f182.google.com [209.85.215.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 611271332A9 for ; Fri, 16 Feb 2024 17:35:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.182 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708104909; cv=none; b=oXjt/w0hf2R9dF4hSPD7pYRvAsxD4VzBoqKkKdxUFqSztB2MiFWNnX/oini3p244Orotsnxmx5z5hqg3OXddf5bumJlQyPDZ8Y5svt+oR+hedZLuk1ttoLFUkkxPu+dE+3AxorZdhFmqzl4l2qAuVV7xOumknv+5iYleCay+sng= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708104909; c=relaxed/simple; bh=RekqSZtiSMFVKlk/3EkQASVDRUVZ9OTERPK+baLtHhE=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=f2BjFD6RhvQQVY9N4BHm+fFavkcl3LXsMQU7402lJWIziNLrzhzvMAogQQYjuRylEddVbDdPSqtkJNeZdmMq/G6Hyp/zi3DOoEVwsm3iweW2WbQ7/UpzAbvQzEvrGk9Eiwv/ioL/kr85K+n2Vos2c2U6UczkmNK0ezsCdineM5Q= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=SnTC8DHi; arc=none smtp.client-ip=209.85.215.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-pg1-f182.google.com with SMTP id 41be03b00d2f7-5dc20645871so1540846a12.1 for ; Fri, 16 Feb 2024 09:35:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1708104908; x=1708709708; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=xammFEIqB1ELfrS5tvbq4AnuR2HTos7f1tV8KUMgLV4=; b=SnTC8DHi8I71gGjcwEPoaKrPkZvZAWtmV6i8NjTj9MOAnu+mnaWWtG0Zq2ZWdxxzO/ Dm3aEwaCFM1yUWzpyDt5RweJEL0u/QwYfTw9YWjvHV/jaVvGlnhJzqnw+WqmcBqC7Xjp /czWeScNYfXLg5nMFE+YyXlej2plo9iNBbHNol3XpEwFjbj+VTGWIp7HZS8BdOOiIOwa 1Ut6Hpxi0Xcg6TZnLEofymXPksrWMMbEn7qy9BzJ/P9AIVDHuwXOrrjC72S/h7sKB/Ya Cl0pY3Cq2/P3z5ld4y7x/WhyHPH1AeiE7v+GuN2IqmMalpugDHjT3R5MZESEgx8MF0T4 3tbA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708104908; x=1708709708; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=xammFEIqB1ELfrS5tvbq4AnuR2HTos7f1tV8KUMgLV4=; b=qh8TmrAnJmM0mtobh2wlKJlUknjY5AYdfdQNQCV/12BVXLdpnY9gYybNcfaMT3fCQN Qsy5YPQziCZZrcfQlaYILmUG8SO1U9Vq4hgQOuCL1OoyHxk+RJ0oWIfijn6cF5gC7yt3 0OGY6xHksbsafdeAJWMuDvk9ZlStKQ5jPdDBKwFZhvFUmdzfhwU9t6XFcyEGPETB08xt SkhVH2Z/dtn/SuL8JpNf3foC7D9W9srU4b/8Wpv4X/fDaMewHBtWGdcWxG/q5U5R7b0e UCXPe+2z/fuIJ/CnFRpdGaiKnrqLoNvbL7mQAT2U/g5VTOnWm0Ru3ExXuCKCvkwLPpFP JpdQ== X-Forwarded-Encrypted: i=1; AJvYcCXzm7omKMID8Fxzt93QlcqeuAHc+WTCsjKtdXOpCVywd3p5akRJXwdS00koEq1EXdgVDzar7ACY8GngpKpKA0EqHt4RGcH6gb8ZOuRk X-Gm-Message-State: AOJu0Yw6Zuf6/Io64lgoWcXOV2OnIGbOUj9WsiRCb73PEvB97oi+jSKK k4pOW0MuFtL8i6LWhcTEg0TfOqrF1rlmfeBk4WAftgJo7IfDR3rp2wfVv5Bg/Q== X-Received: by 2002:a17:902:dacc:b0:1db:b8dc:a016 with SMTP id q12-20020a170902dacc00b001dbb8dca016mr1379120plx.7.1708104907726; Fri, 16 Feb 2024 09:35:07 -0800 (PST) Received: from [127.0.1.1] ([120.138.12.48]) by smtp.gmail.com with ESMTPSA id v9-20020a170902b7c900b001db5241100fsm118592plz.183.2024.02.16.09.35.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Feb 2024 09:35:07 -0800 (PST) From: Manivannan Sadhasivam Date: Fri, 16 Feb 2024 23:04:41 +0530 Subject: [PATCH v2 2/5] PCI: dwc: Skip finding eDMA channels count if glue drivers have passed them Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240216-dw-hdma-v2-2-b42329003f43@linaro.org> References: <20240216-dw-hdma-v2-0-b42329003f43@linaro.org> In-Reply-To: <20240216-dw-hdma-v2-0-b42329003f43@linaro.org> To: Jingoo Han , Gustavo Pimentel , Lorenzo Pieralisi , =?utf-8?q?Krzysztof_Wilczy=C5=84?= =?utf-8?q?ski?= , Rob Herring , Bjorn Helgaas , Marek Vasut , Yoshihiro Shimoda , Kishon Vijay Abraham I Cc: Serge Semin , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-arm-msm@vger.kernel.org, mhi@lists.linux.dev, Manivannan Sadhasivam X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=openpgp-sha256; l=1927; i=manivannan.sadhasivam@linaro.org; h=from:subject:message-id; bh=RekqSZtiSMFVKlk/3EkQASVDRUVZ9OTERPK+baLtHhE=; b=owEBbQGS/pANAwAKAVWfEeb+kc71AcsmYgBlz5y9/dWOuITX0EUn0FvBzx7o7bYPq2sZ8rd6q kD80Y0LWmeJATMEAAEKAB0WIQRnpUMqgUjL2KRYJ5dVnxHm/pHO9QUCZc+cvQAKCRBVnxHm/pHO 9fm+CACfgHz+JvCH4MmxxLzx+X9AeL4F72MbLIqnXLvjCirHbczvAebR7r+yhtXRUQZrW8pABKb dEEbsW9yeC4uZGj8aeX9HLzfyUS1eCLIefMV2CTm+K/OiV0HlsY9xvWwxuxmqfEb/71eo1hnSXU d4QqxAFnw+JMN6csdpz6mood7odPKeTbAlxDnbdSuYw9lHzACeDXsVMjyANSnLAwd+B6LK9JWAV +ClaAClq6lmt67AY+JMZ5yOjztGgnPBYaRarTTfAUa9rY8zVpjrh3UbcO01JVFb69+DQ4wmKgIl HI/URt8Q7o0QamMyaBg2ZyFodnp5SjhvSt8jJg/Vg47Tej2w X-Developer-Key: i=manivannan.sadhasivam@linaro.org; a=openpgp; fpr=C668AEC3C3188E4C611465E7488550E901166008 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791077884013147711 X-GMAIL-MSGID: 1791077884013147711 In the case of Hyper DMA (HDMA) present in DWC controllers, there is no way the drivers can auto detect the number of read/write channels as like its predecessor embedded DMA (eDMA). So the glue drivers making use of HDMA have to pass the channels count during probe. To accommodate that, let's skip finding the channels if the channels count were already passed by glue drivers. If the channels count passed were wrong in any form, then the existing sanity check will catch it. Suggested-by: Serge Semin Signed-off-by: Manivannan Sadhasivam Reviewed-by: Siddharth Vadapalli --- drivers/pci/controller/dwc/pcie-designware.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/drivers/pci/controller/dwc/pcie-designware.c b/drivers/pci/controller/dwc/pcie-designware.c index 3a26dfc5368f..d07747b75947 100644 --- a/drivers/pci/controller/dwc/pcie-designware.c +++ b/drivers/pci/controller/dwc/pcie-designware.c @@ -927,13 +927,15 @@ static int dw_pcie_edma_find_channels(struct dw_pcie *pci) { u32 val; - if (pci->edma.mf == EDMA_MF_EDMA_LEGACY) - val = dw_pcie_readl_dbi(pci, PCIE_DMA_VIEWPORT_BASE + PCIE_DMA_CTRL); - else - val = dw_pcie_readl_dma(pci, PCIE_DMA_CTRL); - - pci->edma.ll_wr_cnt = FIELD_GET(PCIE_DMA_NUM_WR_CHAN, val); - pci->edma.ll_rd_cnt = FIELD_GET(PCIE_DMA_NUM_RD_CHAN, val); + if (!pci->edma.ll_wr_cnt || !pci->edma.ll_rd_cnt) { + if (pci->edma.mf == EDMA_MF_EDMA_LEGACY) + val = dw_pcie_readl_dbi(pci, PCIE_DMA_VIEWPORT_BASE + PCIE_DMA_CTRL); + else + val = dw_pcie_readl_dma(pci, PCIE_DMA_CTRL); + + pci->edma.ll_wr_cnt = FIELD_GET(PCIE_DMA_NUM_WR_CHAN, val); + pci->edma.ll_rd_cnt = FIELD_GET(PCIE_DMA_NUM_RD_CHAN, val); + } /* Sanity check the channels count if the mapping was incorrect */ if (!pci->edma.ll_wr_cnt || pci->edma.ll_wr_cnt > EDMA_MAX_WR_CH || From patchwork Fri Feb 16 17:34:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Manivannan Sadhasivam X-Patchwork-Id: 202265 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:c619:b0:108:e6aa:91d0 with SMTP id hn25csp671102dyb; Fri, 16 Feb 2024 09:36:46 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCW7ZvlrM4ZzobzxhXXGBPbRvDrKS/2ZuVd5SDRY++ZyxcBD63Bce11XdVCn7nXSL9P5EotEETLV51738Uap3CD64QqLoA== X-Google-Smtp-Source: AGHT+IGqZ/G0mQ5CzniIQrGNVQe1UjoV6eD9eKs6FAu8+N5Ow9aIfS0BN0+76A90wo0sUwJMcE1R X-Received: by 2002:a05:6a20:c90a:b0:19c:ad6b:e1c2 with SMTP id gx10-20020a056a20c90a00b0019cad6be1c2mr6146641pzb.12.1708105006017; Fri, 16 Feb 2024 09:36:46 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708105006; cv=pass; d=google.com; s=arc-20160816; b=svT4yPfd5TBSByg0nDLuTDJ3Z4xGBYxvxXbP7wPzOEdrPX6EUBIop1B2Ato9VHudih hEA//bJp6hg3gK7AxnO07HFWoqAyQ2Ij5rBULbHCikX6IarSVtq4PTKNBVX9P9SxD4bL hSGx/9/AOXpFAEBw/Hz7WyDfkh9Nf+7DD9OMAKNBkaTsru4Vghd2LTyKD2Oi1xwU7+Ad i94sG3grOTgj3YkL/yrFiqq4ypqWJ3cJowT0ALE360fMhj7k+4ed+eoeq8ctArbsUyzV NeMmiS6c55QQsnkRiksWlEIScJNmJQn0qkUbMx2iVo6CHwrI1PplFEK0TLRYR0mkspv8 58xQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=RDNeyW6m4BTGEiUVj7puFwGWPFjKwT7Zu5mdH9vjNlo=; fh=G7Le1SUDoPHxm4QE8QG7wmc4X453KopsmEMuvnHe/kw=; b=tjJ8xCV7NXhCAzJsPUO9EVc+fNEN6mIet1hyhqb0vBXXl99lM6Ix9d0yjn4ffWxSfS Ir7jD8kFHYq+P0gtw4YglgI+qXjK33T0doDrKXTnWwGoXbXV3l+duOjHYKIyI5BUb8eN WFASak9+l5I8fe2PKXc3uchLQicdpHrkdYLOGOFVHF/BEPuzScO/KwSPd6MUbOKAgcPt 1Ad1xfLqeHcHtye2xe4+hDrNJLQSUhxIC3hc2fhau3SeKfnH6TEnSHH8x4yKNFZ2fn5F 4ZzsY+0CIo/E1ZL0StGHBQ7QIadb5D8w5grhxI8s9hBvpVJmjR7fHPuiSfNUPY5hezkD 9tMQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=XdMP6QGo; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-69077-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-69077-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id p25-20020a637419000000b005dc87643ccdsi192883pgc.79.2024.02.16.09.36.45 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Feb 2024 09:36:46 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-69077-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=XdMP6QGo; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-69077-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-69077-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 70880283C58 for ; Fri, 16 Feb 2024 17:36:00 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E035C133995; Fri, 16 Feb 2024 17:35:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="XdMP6QGo" Received: from mail-pl1-f173.google.com (mail-pl1-f173.google.com [209.85.214.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CAF7113341C for ; Fri, 16 Feb 2024 17:35:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.173 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708104916; cv=none; b=hoxxqEI80G0pryVY1CFlxMapPwXTkb1ijY4P+ZCPjjKCzSKC2hgmnw/PpF4dDUZ0nkEq5I8A06nj7mbjQUXZ83FlvQvOzRJ7YCfnMgGTeMCzHHdx2WlHQxoeie6cGJ3syvt6abBKZai87W0mcW6QV/2mGG3UrFjHCPMAl53+TKs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708104916; c=relaxed/simple; bh=bNnVXR6L3kcnzQ1W5qCDxOjLhMtpGjDiA8ja4nbUZBM=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=lsUisnBYIS8XyDe1VHG0obDtm95hbrWG8VJm5PioAbMhww4CDpZMfHxwEh/iSh2kTE6389pqN7XcNgAbjhfskoMMHBtDiFY8gk+WqYlh+/f50AXeYIH/9l/la5wxqAiP1oWbhUjH/PfhiDABMWHF7N80wFc5PUM5tD8oTIsm/Vk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=XdMP6QGo; arc=none smtp.client-ip=209.85.214.173 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-pl1-f173.google.com with SMTP id d9443c01a7336-1d72f71f222so8045905ad.1 for ; Fri, 16 Feb 2024 09:35:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1708104913; x=1708709713; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=RDNeyW6m4BTGEiUVj7puFwGWPFjKwT7Zu5mdH9vjNlo=; b=XdMP6QGoGj8bVU6PIJ/5+6SBe1gvx9ktMO+T9Zde+84ei5owXlvr+rT3nFgAzbQ5+z hYtqUtPhj1sfpBP1vkNlE6WZ/pBq+n/1LvM8mFFTWYf9A8cqmTsHtBMZCZAotpfI1i1x 4pnqIkXDyEHQ+ztp91XvhP/4u2QwCJJd2GxG3nXuACD5/sj7ClodP5grxdhCJ+ZrG6Lk uStIWQsITr2JydmLGVTxoCoOzOXTF5o7c3NK6uvsP/5LTRULIPOWJNRFpTuQxM01SfQN EnfP9oAjlNeC7sxB17e/VHf41ZaUfrcBWMPlhoRWNecKh5IRZscpxE/4nLO2W4DofC5+ 0z/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708104913; x=1708709713; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=RDNeyW6m4BTGEiUVj7puFwGWPFjKwT7Zu5mdH9vjNlo=; b=mtzBFEZhu+ZzLDbs1YEdF7nMU5KwheQ428QWpg5XS6dkZ/l3Q0crSWivMOyaZcnSai fz1rxCQtFHWccGt9etfUBd1/Hbu5GXEJVYQuYJCb1Nc1jG/0zT6kgxY0UExO/tswh5Xu JJemmhJgeUjk9Qt/fhnKoGrAbVaaJEpHQXezR5F4kbljFFCVPAiMnBFGnVlaW6TBdEv2 IfyJ97psEHsT1VUCCan9KrC3moKA6PM5NmW0BJ/iVXaGg1PPDhm2thFdL4zzZH7TCtql LTjbIhL+zGSv2w/3wTgKMCxlZADnBdf3dFqKnSdWi4ZS+LpVOi2z6NsX8GmR/qIsXqLo TCcg== X-Forwarded-Encrypted: i=1; AJvYcCWHJ2UvADFv9cNxYtt/se1zXShv4m9V9Tbfm6Q92iKgpmx7Kb/Kc3tN6ya4Mz0ItBYSd3tqnkKuKygPgOW0gp3E6mFhjFnuUEEac0u+ X-Gm-Message-State: AOJu0YxpYyULiuB9emRJAS74D0K8JLfrU7WFei8lBdoJXStwSFgzEcqY 4yKf+lM42Z55Ee9KBi9MnoOK+7wgGEGOwuEGsw4MEswcY9tml6GETfOlLqD+bA== X-Received: by 2002:a17:902:784b:b0:1db:4b29:9b21 with SMTP id e11-20020a170902784b00b001db4b299b21mr5227700pln.23.1708104913087; Fri, 16 Feb 2024 09:35:13 -0800 (PST) Received: from [127.0.1.1] ([120.138.12.48]) by smtp.gmail.com with ESMTPSA id v9-20020a170902b7c900b001db5241100fsm118592plz.183.2024.02.16.09.35.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Feb 2024 09:35:12 -0800 (PST) From: Manivannan Sadhasivam Date: Fri, 16 Feb 2024 23:04:42 +0530 Subject: [PATCH v2 3/5] PCI: dwc: Pass the eDMA mapping format flag directly from glue drivers Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240216-dw-hdma-v2-3-b42329003f43@linaro.org> References: <20240216-dw-hdma-v2-0-b42329003f43@linaro.org> In-Reply-To: <20240216-dw-hdma-v2-0-b42329003f43@linaro.org> To: Jingoo Han , Gustavo Pimentel , Lorenzo Pieralisi , =?utf-8?q?Krzysztof_Wilczy=C5=84?= =?utf-8?q?ski?= , Rob Herring , Bjorn Helgaas , Marek Vasut , Yoshihiro Shimoda , Kishon Vijay Abraham I Cc: Serge Semin , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-arm-msm@vger.kernel.org, mhi@lists.linux.dev, Manivannan Sadhasivam X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=openpgp-sha256; l=3317; i=manivannan.sadhasivam@linaro.org; h=from:subject:message-id; bh=bNnVXR6L3kcnzQ1W5qCDxOjLhMtpGjDiA8ja4nbUZBM=; b=owEBbQGS/pANAwAKAVWfEeb+kc71AcsmYgBlz5y9ST0H2R6ShbbqEzDuD117Tis4bX9tke/qy ZDo5Q/SdWKJATMEAAEKAB0WIQRnpUMqgUjL2KRYJ5dVnxHm/pHO9QUCZc+cvQAKCRBVnxHm/pHO 9Zk+B/wK63dSxW1bW2CzlTD3p4svLzBTxAAADKqa5609ZLV2lzA5c+F1+wWIaGjeORKNzMdbMSJ f6z7IcaFqqwvDrScULenCSF6eunG88xP41wIg1EF/p21hcTwjh1eVvXy2LtnTizeXQSMzp9PgRQ qokAbMVPf2XINZMTsYjYLxLQyjTw6V4DPMC087YNu0W/S6ABi3kLAZFYIobL+byp6f/gXeJmzzT fXl4XLkjnJ2POiJR+xFmY4IoVJeqRc6p4Y6Q+rwxM3yf3ihyDxI8l1levR/Qy93poZH9lVI8WNR qkkH950uk6qnrTrEuhXF1nxP3kFlbgDj3TLIBYgNy5vdLVC1 X-Developer-Key: i=manivannan.sadhasivam@linaro.org; a=openpgp; fpr=C668AEC3C3188E4C611465E7488550E901166008 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791077914848416436 X-GMAIL-MSGID: 1791077914848416436 Instead of maintaining a separate capability for glue drivers that cannot support auto detection of the eDMA mapping format, let's pass the mapping format directly from them. This will simplify the code and also allow adding HDMA support that also doesn't support auto detection of mapping format. Suggested-by: Serge Semin Signed-off-by: Manivannan Sadhasivam Reviewed-by: Siddharth Vadapalli --- drivers/pci/controller/dwc/pcie-designware.c | 16 +++++++++------- drivers/pci/controller/dwc/pcie-designware.h | 5 ++--- drivers/pci/controller/dwc/pcie-rcar-gen4.c | 2 +- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/drivers/pci/controller/dwc/pcie-designware.c b/drivers/pci/controller/dwc/pcie-designware.c index d07747b75947..54ecd536756d 100644 --- a/drivers/pci/controller/dwc/pcie-designware.c +++ b/drivers/pci/controller/dwc/pcie-designware.c @@ -894,18 +894,20 @@ static int dw_pcie_edma_find_mf(struct dw_pcie *pci) { u32 val; + /* + * Bail out finding the mapping format if it is already set by the glue + * driver. Also ensure that the edma.reg_base is pointing to a valid + * memory region. + */ + if (pci->edma.mf != EDMA_MF_EDMA_LEGACY) + return pci->edma.reg_base ? 0 : -ENODEV; + /* * Indirect eDMA CSRs access has been completely removed since v5.40a * thus no space is now reserved for the eDMA channels viewport and * former DMA CTRL register is no longer fixed to FFs. - * - * Note that Renesas R-Car S4-8's PCIe controllers for unknown reason - * have zeros in the eDMA CTRL register even though the HW-manual - * explicitly states there must FFs if the unrolled mapping is enabled. - * For such cases the low-level drivers are supposed to manually - * activate the unrolled mapping to bypass the auto-detection procedure. */ - if (dw_pcie_ver_is_ge(pci, 540A) || dw_pcie_cap_is(pci, EDMA_UNROLL)) + if (dw_pcie_ver_is_ge(pci, 540A)) val = 0xFFFFFFFF; else val = dw_pcie_readl_dbi(pci, PCIE_DMA_VIEWPORT_BASE + PCIE_DMA_CTRL); diff --git a/drivers/pci/controller/dwc/pcie-designware.h b/drivers/pci/controller/dwc/pcie-designware.h index 26dae4837462..995805279021 100644 --- a/drivers/pci/controller/dwc/pcie-designware.h +++ b/drivers/pci/controller/dwc/pcie-designware.h @@ -51,9 +51,8 @@ /* DWC PCIe controller capabilities */ #define DW_PCIE_CAP_REQ_RES 0 -#define DW_PCIE_CAP_EDMA_UNROLL 1 -#define DW_PCIE_CAP_IATU_UNROLL 2 -#define DW_PCIE_CAP_CDM_CHECK 3 +#define DW_PCIE_CAP_IATU_UNROLL 1 +#define DW_PCIE_CAP_CDM_CHECK 2 #define dw_pcie_cap_is(_pci, _cap) \ test_bit(DW_PCIE_CAP_ ## _cap, &(_pci)->caps) diff --git a/drivers/pci/controller/dwc/pcie-rcar-gen4.c b/drivers/pci/controller/dwc/pcie-rcar-gen4.c index e9166619b1f9..3c535ef5ea91 100644 --- a/drivers/pci/controller/dwc/pcie-rcar-gen4.c +++ b/drivers/pci/controller/dwc/pcie-rcar-gen4.c @@ -255,7 +255,7 @@ static struct rcar_gen4_pcie *rcar_gen4_pcie_alloc(struct platform_device *pdev) rcar->dw.ops = &dw_pcie_ops; rcar->dw.dev = dev; rcar->pdev = pdev; - dw_pcie_cap_set(&rcar->dw, EDMA_UNROLL); + rcar->dw.edma.mf = EDMA_MF_EDMA_UNROLL; dw_pcie_cap_set(&rcar->dw, REQ_RES); platform_set_drvdata(pdev, rcar); From patchwork Fri Feb 16 17:34:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Manivannan Sadhasivam X-Patchwork-Id: 202266 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:c619:b0:108:e6aa:91d0 with SMTP id hn25csp671207dyb; Fri, 16 Feb 2024 09:36:59 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWhvdRRNx4whcW2yjvLjB16jq2u55fuZmOucni3jhTsv/tyEibr/TGI8fOobfx2zYL2eC0NTY6w49PFy0UEYvQJbqulAg== X-Google-Smtp-Source: AGHT+IHFIRdHX6u+QaCLaewvzW92ysvX8zpkQyZcpsXY9oUhcL0A0gF2MIHcs2X3GeQupDFmSVhA X-Received: by 2002:a05:6a20:c704:b0:19f:2df0:1410 with SMTP id hi4-20020a056a20c70400b0019f2df01410mr6228163pzb.53.1708105019474; Fri, 16 Feb 2024 09:36:59 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708105019; cv=pass; d=google.com; s=arc-20160816; b=tUyAYRAE5rbA8JiG+9whVMGMXx4Eyq9w/1M4Gl1UWAa1k1zOSnYOr64H7YCyxH30n4 SnUv4vQ2qmQZFvLh7uinLEujuBV2wvlVISHh4C/8+te1jAymPcY3/xJZHNw0Nc4qHQUG 66MzTnUhnSY/UtkNtQefU1DPWDWdthDUAwV5fJTn5t5vgVAYZArGURJtz1duqkBObMfm dlZx1s1uXEoYl5hASLI0Daa6/z24cpen4PHEfvVdWIaD26cA8Rdswsg64w8c3jq9SnNT fDiIRil/pSEZ+wqMhFPo99EplcgEOB7qKcbYbDHm+lzs4F/4LmRWai2EugzE0e6t0ZOG j6UA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=9kFPVoSK/l1EKd3QuuZ6hI9QCf7bK4UCQY42PAKZeRc=; fh=v0k7jqoLdif+C4//b+mJnWTrzCgVImQBEYTXApo5cy0=; b=wOQzsc1C99RqWwz6320v2OFEGJR3g8LHmX/kDHjDa5FzMQBxHWY3UrKWraQ3qhnZTV mGdZOEIU9FnkVps3iZWmvaC1LLNXtGYK2BKorvDKPEV38MbWV6IU4Aaespkn2HxuyRFo wvVyVpNlj1Q2/uUOSzDEDBLOaQ6Tuu7xat6bAx6OmLQ3tZPIXHDnzVyPoQjEeOKeMKFa QZLS+5CrDdHY0tNv8s6zAEnTtZFjomDVOw6mJ89PzRo/S75Q14P1vEPa4c369tSg5e+1 O42a9Ik8spNY0T83lT8LlLE+cHame/ZlCG+kFZr3tfooL0cLOUN4AS7ByORnwfulJY7e XR7Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=p1qnpJaR; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-69078-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-69078-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id p25-20020a637419000000b005dc87643ccdsi192883pgc.79.2024.02.16.09.36.59 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Feb 2024 09:36:59 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-69078-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=p1qnpJaR; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-69078-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-69078-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 9A4F0285C0F for ; Fri, 16 Feb 2024 17:36:16 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D34D0134CCC; Fri, 16 Feb 2024 17:35:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="p1qnpJaR" Received: from mail-pl1-f174.google.com (mail-pl1-f174.google.com [209.85.214.174]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 331BD133983 for ; Fri, 16 Feb 2024 17:35:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.174 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708104922; cv=none; b=Q56SjkfvAIdfq/I3ahGT3TlG/EuGqac/sYytHKn62yABx7gh67WVcystSbyl8t9UepEiT76vCNIQPrxgQfIBWfD4Oy1+zFKDNNFVGn0LFyAI/5rH2Gj88+b6IEy/DBe6J5Wnp/9oBf5/jjh17Uf6hbv1Pp+i5Ja6upOBOBZCHlE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708104922; c=relaxed/simple; bh=pzWcmugC4yuzGeeLyph9W3eFmKO8edZqY8GSJP6QBwk=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=t8jlpZfDffjOa1RE9J9ktJn8YYtKDWoiMpPDPmHHL0+R0/PrvBSA9gu+ia1Pg9TnRva7WVCUyj4WKF0ikZo3y1vFgocQUefm8LzkDSNH2Ht9MqeS/mntEgei0b/1fGVLp7CynW/uBjkAl5+LsvBgJmAay3TUx0a4z/RTNBChITs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=p1qnpJaR; arc=none smtp.client-ip=209.85.214.174 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-pl1-f174.google.com with SMTP id d9443c01a7336-1d73066880eso22157355ad.3 for ; Fri, 16 Feb 2024 09:35:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1708104918; x=1708709718; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=9kFPVoSK/l1EKd3QuuZ6hI9QCf7bK4UCQY42PAKZeRc=; b=p1qnpJaR0pQvAa2Da//5KSsoAu/YOrgI8LXZK6R72WDqbTtkGndDFxxUWn6NM2rdJC EkKtH49FNFOcxM5VWfxQ33qcuVfQiQhR6XR42s1ZCOCq002qJ5k8TirVdh9ajy4oBi0Z aEYpcqVcLvnNhu6KZk2i4bxY+af+CADX+4f72p7cE/+fRcBhSkcXHfiXf1aUNIt26uF9 RBahA7PlG+b7u3NPVs3j93zJGwpTalQcEmvbFIOwGAMC1ixC7Mwz+rdbcQ4MW4OOBuBz diD1cOUrjeT26Slw8ZFl+m3WKe67lJyISmX/IiifgV0GjRCRyPeylvZTWQGHlpPvzfzY XSnQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708104918; x=1708709718; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=9kFPVoSK/l1EKd3QuuZ6hI9QCf7bK4UCQY42PAKZeRc=; b=ovOanu11oyYcL5qfLPqVZJyym8UNzaMig3HNzgeiAoNXX4CBQBxDs7G63d8nI5XG5I ut5873+5Yt4BnzxmuayTrksuJLShJv5oCECpV9ZMWBnW+rehsmc+KFps4JdWv1oOjcj6 JHvjyVk7kXuW0GWlIwGGJSnb5xKua9Om1Zs+ySZfmU/RT2qo2kYIC62osaoXb1+h8m3g Pt9W1nJaoGgPUFB3WS+ppW1Ma5qdyBL/u/20laIHPDMtbQHExf7O9vPe7E2V7jWXFSNv DXOBecdBtZ/2b4ZNSJRigggT9e0YEiuPFrZx5O//8v3l6IkYR/t0ycU3T6arTs776gLQ OO6g== X-Forwarded-Encrypted: i=1; AJvYcCUjCY9f/ald77q32sV+Kmc4BBp7eGbFw1OKmFhiOlQiB+UomnJlayy6vmhOFf4XhJaGsLN7GIrt5VxzKBEscPG3LabBk6Ap7EXmcGme X-Gm-Message-State: AOJu0YzxdrccdAEgGJmbm88sCmaAfHanVd3497I1LS0+VxrSCyUVPL/u T4vRq+qf2EmJpa88jl56Qq+NvUAYD6siyNF0FB7f3Npsq6D4bQTdn59KBvTzsg== X-Received: by 2002:a17:902:c947:b0:1db:4b08:fbe8 with SMTP id i7-20020a170902c94700b001db4b08fbe8mr6559964pla.44.1708104918589; Fri, 16 Feb 2024 09:35:18 -0800 (PST) Received: from [127.0.1.1] ([120.138.12.48]) by smtp.gmail.com with ESMTPSA id v9-20020a170902b7c900b001db5241100fsm118592plz.183.2024.02.16.09.35.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Feb 2024 09:35:18 -0800 (PST) From: Manivannan Sadhasivam Date: Fri, 16 Feb 2024 23:04:43 +0530 Subject: [PATCH v2 4/5] PCI: qcom-ep: Add HDMA support for SA8775P SoC Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240216-dw-hdma-v2-4-b42329003f43@linaro.org> References: <20240216-dw-hdma-v2-0-b42329003f43@linaro.org> In-Reply-To: <20240216-dw-hdma-v2-0-b42329003f43@linaro.org> To: Jingoo Han , Gustavo Pimentel , Lorenzo Pieralisi , =?utf-8?q?Krzysztof_Wilczy=C5=84?= =?utf-8?q?ski?= , Rob Herring , Bjorn Helgaas , Marek Vasut , Yoshihiro Shimoda , Kishon Vijay Abraham I Cc: Serge Semin , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-arm-msm@vger.kernel.org, mhi@lists.linux.dev, Manivannan Sadhasivam , Mrinmay Sarkar X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=openpgp-sha256; l=2739; i=manivannan.sadhasivam@linaro.org; h=from:subject:message-id; bh=nXwtjZgaLVb1yQW3aqg87REEZqq+9dwelHeQLVIhVBw=; b=owEBbQGS/pANAwAKAVWfEeb+kc71AcsmYgBlz5y9nALO/R45p88goO+jxnDd/1jR9FIj1mQZv 56FeDJI+YSJATMEAAEKAB0WIQRnpUMqgUjL2KRYJ5dVnxHm/pHO9QUCZc+cvQAKCRBVnxHm/pHO 9Y9PB/4sM5xn3fpFHVSMmeBrJPxp6PToCC+fAVwgs7YTxlPeCCDB2V+Cas8Ftechwl69m6ZcDH5 eBOpdSzVLLWdSebMsuzIZaHwt01C2Qt6LQHGl9xmJZ0N+eGX2Ie44RfJCixHbT0h+7kR7BtHw1N K+/mTkp4Quv976/RPfPC5XY9cRiwFEul7X5VGumL0IUtWdSe5vjMg2obgSxA3EMP4C5WHFvtytC KNbCh+z9zWaj3liVek9GvASZG8KkUjllO2vLUGJbRwmNwiN+cUIHBZ5ZoheAO5D7/5fbksCbDYo 69P0ckD8LtImRu3yr182nKfki+n2fC4HrdQLsaC35nN9PUWY X-Developer-Key: i=manivannan.sadhasivam@linaro.org; a=openpgp; fpr=C668AEC3C3188E4C611465E7488550E901166008 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791077929197497974 X-GMAIL-MSGID: 1791077929197497974 From: Mrinmay Sarkar SA8775P SoC supports the new Hyper DMA (HDMA) DMA Engine inside the DWC IP. Let's add support for it by passing the mapping format and the number of read/write channels count. The PCIe EP controller used on this SoC is of version 1.34.0, so a separate config struct is introduced for the sake of enabling HDMA conditionally. It should be noted that for the eDMA support (predecessor of HDMA), there are no mapping format and channels count specified. That is because eDMA supports auto detection of both parameters, whereas HDMA doesn't. Signed-off-by: Mrinmay Sarkar [mani: Reworded commit message, added kdoc, and minor cleanups] Signed-off-by: Manivannan Sadhasivam Reviewed-by: Siddharth Vadapalli --- drivers/pci/controller/dwc/pcie-qcom-ep.c | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/drivers/pci/controller/dwc/pcie-qcom-ep.c b/drivers/pci/controller/dwc/pcie-qcom-ep.c index 45008e054e31..89d06a3e6e06 100644 --- a/drivers/pci/controller/dwc/pcie-qcom-ep.c +++ b/drivers/pci/controller/dwc/pcie-qcom-ep.c @@ -149,6 +149,14 @@ enum qcom_pcie_ep_link_status { QCOM_PCIE_EP_LINK_DOWN, }; +/** + * struct qcom_pcie_ep_cfg - Per SoC config struct + * @hdma_support: HDMA support on this SoC + */ +struct qcom_pcie_ep_cfg { + bool hdma_support; +}; + /** * struct qcom_pcie_ep - Qualcomm PCIe Endpoint Controller * @pci: Designware PCIe controller struct @@ -803,6 +811,7 @@ static const struct dw_pcie_ep_ops pci_ep_ops = { static int qcom_pcie_ep_probe(struct platform_device *pdev) { + const struct qcom_pcie_ep_cfg *cfg; struct device *dev = &pdev->dev; struct qcom_pcie_ep *pcie_ep; char *name; @@ -816,6 +825,14 @@ static int qcom_pcie_ep_probe(struct platform_device *pdev) pcie_ep->pci.ops = &pci_ops; pcie_ep->pci.ep.ops = &pci_ep_ops; pcie_ep->pci.edma.nr_irqs = 1; + + cfg = of_device_get_match_data(dev); + if (cfg && cfg->hdma_support) { + pcie_ep->pci.edma.ll_wr_cnt = 8; + pcie_ep->pci.edma.ll_rd_cnt = 8; + pcie_ep->pci.edma.mf = EDMA_MF_HDMA_NATIVE; + } + platform_set_drvdata(pdev, pcie_ep); ret = qcom_pcie_ep_get_resources(pdev, pcie_ep); @@ -874,8 +891,12 @@ static void qcom_pcie_ep_remove(struct platform_device *pdev) qcom_pcie_disable_resources(pcie_ep); } +static const struct qcom_pcie_ep_cfg cfg_1_34_0 = { + .hdma_support = true, +}; + static const struct of_device_id qcom_pcie_ep_match[] = { - { .compatible = "qcom,sa8775p-pcie-ep", }, + { .compatible = "qcom,sa8775p-pcie-ep", .data = &cfg_1_34_0}, { .compatible = "qcom,sdx55-pcie-ep", }, { .compatible = "qcom,sm8450-pcie-ep", }, { } From patchwork Fri Feb 16 17:34:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Manivannan Sadhasivam X-Patchwork-Id: 202267 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:c619:b0:108:e6aa:91d0 with SMTP id hn25csp671321dyb; Fri, 16 Feb 2024 09:37:11 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCX1V1l2ICdZaJelukhUTR2mSvxlKF+NkIVsjycl0bif4zEN4ZJUhJUstuUiFO0Q0lQ1+YPab2Drsft4ChnISaadQWjn+Q== X-Google-Smtp-Source: AGHT+IHmyN7xEl3Vi/wgeCDVJaJwwyKqwUXJ5ld1Wk+15x3BNY+8joHN9Rf3tVdxHqTOIO0NEtcJ X-Received: by 2002:a17:903:2307:b0:1db:6047:ede6 with SMTP id d7-20020a170903230700b001db6047ede6mr6059467plh.34.1708105030907; Fri, 16 Feb 2024 09:37:10 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708105030; cv=pass; d=google.com; s=arc-20160816; b=pX0mpfZ/p8/akx95g4jVuoMp9StqAxYvnH9qiS89tqBvAMFlRZrmOiMnPkH+JFvzLt gAgoV7fsG63BTk8ZNd/eSopxjAdA4/UIWrsWszI0aSfPM24fMo8DyKQ0qaMR/AHmbkkD evmFu7YXKJZ4H/YrfZI6HTVjfIHWpmQcXMy+/wntFiRY7tuj2HhZZartoD2sfhdV7adR LCb9yuxQITUxhCy+oTePbFDjYY4nAlPQ1tkkapqmHmSWhzdyWpVjXN4bw9ISOteVZwRP moSIW187rdD/IXvEbaad3U44OfEaPhsYGqKE/VlJN9LJpojLq+YCZDT7XxjzwT0RIuzg 6akQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=kWuu4IaCb+ecu+2X4FcUxgf2SPat8siMwG6Oun2YK2w=; fh=ezkTUJemM/V5AnjpAefkuT3/4kuuG5OcouKUou4vnGg=; b=s/OBFVK6LB66FOyms5LFi036KE4D5Df/qg4ZLchVknyyldJC68qyjzylt40UGjXsgu wmbPFlwQxgvWO6UkDjRGEvW61g4frb8yOGsaHu/z6S2YsxFWNyvQHZKRfxrs/FaVXjjr kujYQZpLCkTi9NeQXrxS+vJ3rL07AZQqXYIpNyGA4iDyuGwR9b1NU0NCkHPAM3DZw30K 0U//Uz2onOT78t/ONecUsdNMWwDL0oKDJP8Tr9R/o8w0oTTyCY9HvgcS5IplLPjhaydy UiGUKuKj/+HBurDj9pcVnHr7/JMYpiXLrFPR+bvlJqxf+Y52XW3xGFo9Z9MJoF+rBMoB 7egA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=KPrPgQZM; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-69079-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-69079-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id h7-20020a170902f54700b001db2ad29d18si175553plf.145.2024.02.16.09.37.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Feb 2024 09:37:10 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-69079-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=KPrPgQZM; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-69079-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-69079-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 5FAD9285D9A for ; Fri, 16 Feb 2024 17:36:29 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 32676134CEF; Fri, 16 Feb 2024 17:35:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="KPrPgQZM" Received: from mail-pl1-f171.google.com (mail-pl1-f171.google.com [209.85.214.171]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E107A13475F for ; Fri, 16 Feb 2024 17:35:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.171 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708104926; cv=none; b=hYB3k3IhKLHDyLzlI+PlgzzKUwIhNhhXtjotKtP4BEErwQ8Ea8QKZn5WmcLgks3PZ0tWlnlcSzmUCNwRPkB64cTfGnMA99+uUAZWYqlQbDhka8S9YpOTAPkaiwdX7s58MmSuR9Gck+O3FJEpoo2/ilnup5WTU4ruZC6l4LDQnW4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708104926; c=relaxed/simple; bh=R1GLPwlYfMEGgtPbyaSg7QFWg/JNBX3HH10DnKKcCK4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=gvwPDV/jp5Sdqapww8ws1Km6HkIsYXt4OJue8AkrGYDpN9+ld/9CZwwdGfI45CuTzn+o+FlkaM+DWuB5zICMJ2/ApGy6WloDGldBK2z38m4XSqTHiqzPOyQlZqQU7qH6Uxxfqf+ymWwBPOVqplLzoZJhiNv6+L5+CQ+NWZ41QBA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=KPrPgQZM; arc=none smtp.client-ip=209.85.214.171 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-pl1-f171.google.com with SMTP id d9443c01a7336-1d71cb97937so23933615ad.3 for ; Fri, 16 Feb 2024 09:35:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1708104923; x=1708709723; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=kWuu4IaCb+ecu+2X4FcUxgf2SPat8siMwG6Oun2YK2w=; b=KPrPgQZMwL1HCPXC7wBU5oYFvj++78+R55108VsQBi9jWS3x1PBHwgZBUJwMGjt/Xv WVjSaOp7tOYhLOP8O6I0ZLqJ4/Wu4fg/CkBFN8IyfO5ycTtacmT9czYIuhMMhjPKJVia 4h95pCe9D530v3bQIKJ+XaL0xamOufrpXZUtpbssjW+t8I1RHatNGdiudZkqkMjtW9q6 VfT7l2oCkFqsAJEa9U1KrPRxjlj+O9vPKqtcpRA58/2JEf5wlDoF0ry+Opw7fH6EmOin 32bAYoR8TAcbdnquUDA6xZeNuJnknd9ZgmUAebdqOR29ir+Rdega9Q9mrcqdCcXQatGd QPVg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708104923; x=1708709723; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=kWuu4IaCb+ecu+2X4FcUxgf2SPat8siMwG6Oun2YK2w=; b=PKd7iE81YRydd3QoABZTL/Ru2LmPS994YjTiekwIHGcGHQ4Rj2g+hGYWTo5UtM8NW2 /w0eoiVU2EA1VymEGdghokfeVCsD1CpNvC98Eb9kK9QPfVtmmHTCwLVpj9+Zbsuh2C8I ibAFg4n94ul4226pAKQEw62b1y/t3yE5z6OlPIh9aDxMU5SjpZg297EdtqR/PpF+oJEs mygBUutiMR7afet/z3yQPgP8Sww4DCbL/NeoSDIbVsdcXmqoVHqwwerQltevPDVlu1W3 /gKTV8q5dIdNVQv5xpbeO18VSuZnHVTSTfFJ7hviYvj5KteECXEuEAQPSA5DRv+haB04 L3FA== X-Forwarded-Encrypted: i=1; AJvYcCWaqoe3dHulJotWxVREaqNgm+19SWwmqZ/I0gQSIX45R6I1kC6Gt8KSPfFI1zgcf8ZOC/rPIgq3Ytrc0sORg5ou3hhUWmGvwvlpO+CF X-Gm-Message-State: AOJu0Yx+z39vD15pBdyrDl3dMr6KhA3xHzo2J4qwWQvXEFNgWtog8XUT uHAuWgZF4H4WlX9bg7hFUXDE8MKiZUeF87dIw4MqQq1IWItMNCPa9JbdBfvuYg== X-Received: by 2002:a17:902:ea12:b0:1db:ae5f:a38d with SMTP id s18-20020a170902ea1200b001dbae5fa38dmr2114924plg.5.1708104923231; Fri, 16 Feb 2024 09:35:23 -0800 (PST) Received: from [127.0.1.1] ([120.138.12.48]) by smtp.gmail.com with ESMTPSA id v9-20020a170902b7c900b001db5241100fsm118592plz.183.2024.02.16.09.35.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Feb 2024 09:35:22 -0800 (PST) From: Manivannan Sadhasivam Date: Fri, 16 Feb 2024 23:04:44 +0530 Subject: [PATCH v2 5/5] PCI: epf-mhi: Enable HDMA for SA8775P SoC Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240216-dw-hdma-v2-5-b42329003f43@linaro.org> References: <20240216-dw-hdma-v2-0-b42329003f43@linaro.org> In-Reply-To: <20240216-dw-hdma-v2-0-b42329003f43@linaro.org> To: Jingoo Han , Gustavo Pimentel , Lorenzo Pieralisi , =?utf-8?q?Krzysztof_Wilczy=C5=84?= =?utf-8?q?ski?= , Rob Herring , Bjorn Helgaas , Marek Vasut , Yoshihiro Shimoda , Kishon Vijay Abraham I Cc: Serge Semin , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-arm-msm@vger.kernel.org, mhi@lists.linux.dev, Manivannan Sadhasivam , Mrinmay Sarkar X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=openpgp-sha256; l=919; i=manivannan.sadhasivam@linaro.org; h=from:subject:message-id; bh=l9TZl5f3ruMfAhDvync60x+vuqThCg8E95q3H1HbSYw=; b=owEBbQGS/pANAwAKAVWfEeb+kc71AcsmYgBlz5y+NwBcDBvMsgLY/9ArhUeU4RtpAOkSNOPA0 cL+6HT1tTCJATMEAAEKAB0WIQRnpUMqgUjL2KRYJ5dVnxHm/pHO9QUCZc+cvgAKCRBVnxHm/pHO 9YdiB/9TA+DKLXxIZYpi/4hnMyIkUsM2WJIWyQ6w7vRVyPe9xkvRVouAEDo3kakdlZprxiUhdRE RVaU7JFkgelmHQuyS7am0hGDZJpDmEmPrmuGigJlrygDliRLE85n5WP2vnnN7WKQuYN+W8HQnv0 l0f9zuR0+G+HEp9D1og10j/2BOueS6fmgssxK8rtfpi2VW+6FgY0KiiqpsWdUq7od5/Ucw2nR1F NbjzPj1POiJNg12Bi3HrhcTLZjvb0KwfS/lV5Mj1NKvbtl2anyrbqaqqbejjAuqCSzx91cCovSW ddbe/L2NDfdpqcgHjOuBkoP+92IIH3SP4KN6C52nTmQjmNqV X-Developer-Key: i=manivannan.sadhasivam@linaro.org; a=openpgp; fpr=C668AEC3C3188E4C611465E7488550E901166008 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791077940924545355 X-GMAIL-MSGID: 1791077940924545355 From: Mrinmay Sarkar SA8775P SoC supports Hyper DMA (HDMA) DMA Engine present in the DWC IP. So, let's enable it in the EPF driver so that the DMA Engine APIs can be used for data transfer. Signed-off-by: Mrinmay Sarkar [mani: reworded commit message] Signed-off-by: Manivannan Sadhasivam Reviewed-by: Siddharth Vadapalli --- drivers/pci/endpoint/functions/pci-epf-mhi.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/pci/endpoint/functions/pci-epf-mhi.c b/drivers/pci/endpoint/functions/pci-epf-mhi.c index 2c54d80107cf..570c1d1fb12e 100644 --- a/drivers/pci/endpoint/functions/pci-epf-mhi.c +++ b/drivers/pci/endpoint/functions/pci-epf-mhi.c @@ -137,6 +137,7 @@ static const struct pci_epf_mhi_ep_info sa8775p_info = { .epf_flags = PCI_BASE_ADDRESS_MEM_TYPE_32, .msi_count = 32, .mru = 0x8000, + .flags = MHI_EPF_USE_DMA, }; struct pci_epf_mhi {