Received: by 2002:ab2:710b:0:b0:1ef:a325:1205 with SMTP id z11csp1744550lql; Wed, 13 Mar 2024 07:09:21 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCU2mBWuJZ+1/N2lNI8zUi82oEHDc7aA9bP7KnkJ9kcLhvgU5bj/HrTISgYXHzPrEUqK9Y4g5sZC018uEIoZoQDAt/j8Rzu8NOTm4isJCA== X-Google-Smtp-Source: AGHT+IEzwOgcMlLXFS28OtkQsk1gytknzpG3ixrDmAE95Rqj1MMeTSMXn6rnlWAmsNJSUIj3K6Hc X-Received: by 2002:a17:90b:3b4c:b0:29c:7023:1f15 with SMTP id ot12-20020a17090b3b4c00b0029c70231f15mr519926pjb.18.1710338960648; Wed, 13 Mar 2024 07:09:20 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710338960; cv=pass; d=google.com; s=arc-20160816; b=Ff0NU6Z6PwAw67pRSYSzvNj8pz/0fhX9g5h+8YeQf7Ozi0VUjToG6TvNkMkH5UDq66 ehCqQbgiu2AELamkLUVfS0JX6rIuCakFnOwCCGsaKJjsdZZATGBZKSkX65JlE2jpbKIA f87H3HVCSPzXwt4IedclG+ieXR4pVxEM8eubEzy1x3otd0YkQZe0Ju/JsRTpiL/p/ZA7 b3Y5XkbsfLKU1DFGsi9S4bw7TMiY8SUBsJ4ZbF1TyKdLXSZv6FMuzomO/UPxsadD4QAN bYm5TFTs59ZYQWexofBZKsEQhO+dlX9emjdd7DclpxRPR50J5vB2UoeCIEoW90ZO9hS+ /0cA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=7L2vUwfipr2gKOB26ZSV+Vf7Bi2o+2MhICmn4R7KPa0=; fh=5Tmb8/xvAippK505eQdKZkRi8AbT1cVm4WOPcnOeIMY=; b=xWcPmgK53nzBpNDjIyIMBGu59jfRuMtsm8uydi2Np0yccOLKKmNekR/ErpkqXTNxZs 4iFbhkCN+g4KWUbnHOJERpPGABSUCR8nCHxj4oH5eO6laRB2y7yiWRFG47IZxmviuLdE XtGdUtJm2fJcMewCCu5XRhdAyrsPJ5+/4XdEBVFqRXqrIFT29n7u4RQXBzEr1K6kOBzC iw+3F9mxDPJg21FhciGm6uJAEX7uqOynCENoSJhP3ldW5bQJUqM015a7uDoi476CZhdF n5AZHMjaTzOh+7gLHgodpOZESUAeAjQEBp8Z7Y8QLLH44LiKCN13rt5SvWyk9aIy4mW0 Q3fg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@suse.com header.s=google header.b=ClGAc5JM; arc=pass (i=1 spf=pass spfdomain=suse.com dkim=pass dkdomain=suse.com dmarc=pass fromdomain=suse.com); spf=pass (google.com: domain of linux-kernel+bounces-101590-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-101590-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id n93-20020a17090a2ce600b0029c4586e8a5si1501304pjd.111.2024.03.13.07.09.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Mar 2024 07:09:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-101590-linux.lists.archive=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=@suse.com header.s=google header.b=ClGAc5JM; arc=pass (i=1 spf=pass spfdomain=suse.com dkim=pass dkdomain=suse.com dmarc=pass fromdomain=suse.com); spf=pass (google.com: domain of linux-kernel+bounces-101590-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-101590-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com 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 4A471286CCA for ; Wed, 13 Mar 2024 14:09:20 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B237347A70; Wed, 13 Mar 2024 14:08:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b="ClGAc5JM" Received: from mail-ej1-f50.google.com (mail-ej1-f50.google.com [209.85.218.50]) (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 A86B545022 for ; Wed, 13 Mar 2024 14:08:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.50 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710338934; cv=none; b=MI+Db50UXlQfwF4p47rJh6KTctnqAc3QqJ8b8mYQgegg3cH+kvCNHOR9T/Qlq8mYQ9AxSh8HJ3YUAIbf+wORqELBlqSus03XJ75rZOYIMYART4xN+SUUmpoksvRLp0SsSx+eeaQ3GIBmql2ynIxbq5g4k2aJeMlpg6IJBoTTgKY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710338934; c=relaxed/simple; bh=VoefusMX7Ytod/wgz/c8WF/mjN+oMfRNOX8FE9P8irY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=UlbRmdOemLiAzZckFHJ/oYXtv1ZayDvLUC97exzoA3uJjXU/KbpW1BmEbWu5Fmilyf3dnQlwWBNmt8uw/ENcXVBbzYqYemu9BaPof+p5BIhOeYfbUPHqDelcVWn/jP4gG1pN7azl3M/B1S3GBlsNe+pyZZoCqNWoA3Edq9Bq8k8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b=ClGAc5JM; arc=none smtp.client-ip=209.85.218.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Received: by mail-ej1-f50.google.com with SMTP id a640c23a62f3a-a45ecef71deso632327466b.2 for ; Wed, 13 Mar 2024 07:08:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1710338931; x=1710943731; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=7L2vUwfipr2gKOB26ZSV+Vf7Bi2o+2MhICmn4R7KPa0=; b=ClGAc5JMtY+aNJ6AxXFoanQBROAcg5+EYNSdibz3tFRSsRX1eyWyKcr+Fdp6HvxaXA a4Cyw5tVrzOlNXHvOQ8dv0z2gcF2/TRyMXSNE5HItLqwN6eF4wLz1Z+iY+1aY2NQh3bm S2q2I4Vjd06r4cP5Dp3zVVan+9AFJL6ZBLph8iXl+ZUlf07c1U4Dkn/yKmgHQLoh5HFk caFnJ07eZqF3DnAMAv54oFYvx7fGijrqgjEOBw7RPUoJPiwVlRyE+Gn1zv/sh1NZ9L2D SbrpliJnU2u8Y2AM/bae/9pXWmWnCLZq3JecfQfHSViV8g6En4MsnjW2Y6b8D4Lpcufd D7Kg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710338931; x=1710943731; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=7L2vUwfipr2gKOB26ZSV+Vf7Bi2o+2MhICmn4R7KPa0=; b=dHspXB1Jdbjo7AqI5D0Z3Twkom+nVGxZY/TPqxWEnPMZLlhBIMAUYM9X4V13Uhzrud jhnT3omzyoEaoyq7d2jTOxwDsahZJP+mfB6KY4xyyNbjO5QVg3U3BYJWAWKi3p7FsD/G oTvAdE3rtXX9Wjhux81tErQw+694Wc8QQh6lHd5fVvId+iY4aLMNfq9JqVPSb3D3Wa5G MTB2UJ2kZauRsRsrECQnjpXpXS7oiObTVRqyX1DjLh3U8NBhAGYgG2qa4gvkLVEbGQeV qWVtz4MEOr9BhQP2pCPDNHk6PrVYwq3yLZbwKHWYt9M7AGdd9qZErg59DvockTZeFS5z hLDQ== X-Forwarded-Encrypted: i=1; AJvYcCXN5d3wSN4r8IlHgqPht7A9V6DkTIdEZQKbcrXbFsnKEWc98O1cOSxoIGdTMgXwAg+vFYfv7CFGHnq8qrHc+RCGCn6Esl17iMdyQjcm X-Gm-Message-State: AOJu0YzhbVU5wwsF38zJmxQqxSflZ/5800WkRs9ordSNv3K8yuYIa/Nt SYrc5RnIUb9dtqMnMxjTdoL5vDC8DI+E6Ut2xBqb/L2diNoNhMSvXz7S35tOO3E= X-Received: by 2002:a17:906:c784:b0:a46:61ef:2846 with SMTP id cw4-20020a170906c78400b00a4661ef2846mr871027ejb.66.1710338931040; Wed, 13 Mar 2024 07:08:51 -0700 (PDT) Received: from localhost (host-82-56-173-172.retail.telecomitalia.it. [82.56.173.172]) by smtp.gmail.com with ESMTPSA id a21-20020a170906469500b00a4667190a35sm88005ejr.37.2024.03.13.07.08.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Mar 2024 07:08:50 -0700 (PDT) From: Andrea della Porta To: Vinod Koul , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Florian Fainelli , Ray Jui , Scott Branden , Broadcom internal kernel review list , Saenz Julienne , dmaengine@vger.kernel.org, devicetree@vger.kernel.org, linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, dave.stevenson@raspberrypi.com Cc: Phil Elwell , Maxime Ripard , Stefan Wahren , Dom Cobley , Phil Elwell , Andrea della Porta Subject: [PATCH v2 03/15] dmaengine: bcm2835: Add NO_WAIT_RESP, DMA_WIDE_SOURCE and DMA_WIDE_DEST flag Date: Wed, 13 Mar 2024 15:08:28 +0100 Message-ID: X-Mailer: git-send-email 2.44.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Phil Elwell Use bit 27 of the dreq value (the second cell of the DT DMA descriptor) to request that the WAIT_RESP bit is not set. Use (reserved) bits 24 and 25 of the dreq value (the second cell of the DT DMA descriptor) to request that wide source reads or wide dest writes are required Originally-by: Dom Cobley Originally-by: Phil Elwell Signed-off-by: Andrea della Porta --- drivers/dma/bcm2835-dma.c | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/drivers/dma/bcm2835-dma.c b/drivers/dma/bcm2835-dma.c index 3d9973dd041d..69a77caf78cc 100644 --- a/drivers/dma/bcm2835-dma.c +++ b/drivers/dma/bcm2835-dma.c @@ -145,6 +145,21 @@ struct bcm2835_desc { #define BCM2835_DMA_WAIT(x) (((x) & 31) << 21) /* add DMA-wait cycles */ #define BCM2835_DMA_NO_WIDE_BURSTS BIT(26) /* no 2 beat write bursts */ +/* A fake bit to request that the driver doesn't set the WAIT_RESP bit. */ +#define BCM2835_DMA_NO_WAIT_RESP BIT(27) +#define WAIT_RESP(x) (((x) & BCM2835_DMA_NO_WAIT_RESP) ? \ + 0 : BCM2835_DMA_WAIT_RESP) + +/* A fake bit to request that the driver requires wide reads */ +#define BCM2835_DMA_WIDE_SOURCE BIT(24) +#define WIDE_SOURCE(x) (((x) & BCM2835_DMA_WIDE_SOURCE) ? \ + BCM2835_DMA_S_WIDTH : 0) + +/* A fake bit to request that the driver requires wide writes */ +#define BCM2835_DMA_WIDE_DEST BIT(25) +#define WIDE_DEST(x) (((x) & BCM2835_DMA_WIDE_DEST) ? \ + BCM2835_DMA_D_WIDTH : 0) + /* debug register bits */ #define BCM2835_DMA_DEBUG_LAST_NOT_SET_ERR BIT(0) #define BCM2835_DMA_DEBUG_FIFO_ERR BIT(1) @@ -621,8 +636,9 @@ static struct dma_async_tx_descriptor *bcm2835_dma_prep_dma_memcpy( { struct bcm2835_chan *c = to_bcm2835_dma_chan(chan); struct bcm2835_desc *d; - u32 info = BCM2835_DMA_D_INC | BCM2835_DMA_S_INC; - u32 extra = BCM2835_DMA_INT_EN | BCM2835_DMA_WAIT_RESP; + u32 info = BCM2835_DMA_D_INC | BCM2835_DMA_S_INC | + WAIT_RESP(c->dreq) | WIDE_SOURCE(c->dreq) | WIDE_DEST(c->dreq); + u32 extra = BCM2835_DMA_INT_EN; size_t max_len = bcm2835_dma_max_frame_length(c); size_t frames; @@ -652,7 +668,8 @@ static struct dma_async_tx_descriptor *bcm2835_dma_prep_slave_sg( struct bcm2835_chan *c = to_bcm2835_dma_chan(chan); struct bcm2835_desc *d; dma_addr_t src = 0, dst = 0; - u32 info = BCM2835_DMA_WAIT_RESP; + u32 info = WAIT_RESP(c->dreq) | + WIDE_SOURCE(c->dreq) | WIDE_DEST(c->dreq); u32 extra = BCM2835_DMA_INT_EN; size_t frames; @@ -704,7 +721,7 @@ static struct dma_async_tx_descriptor *bcm2835_dma_prep_dma_cyclic( struct bcm2835_chan *c = to_bcm2835_dma_chan(chan); struct bcm2835_desc *d; dma_addr_t src, dst; - u32 info = BCM2835_DMA_WAIT_RESP; + u32 info = WAIT_RESP(c->dreq) | WIDE_SOURCE(c->dreq) | WIDE_DEST(c->dreq); u32 extra = 0; size_t max_len = bcm2835_dma_max_frame_length(c); size_t frames; -- 2.35.3