Received: by 2002:ab2:710b:0:b0:1ef:a325:1205 with SMTP id z11csp1219341lql; Tue, 12 Mar 2024 10:26:39 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXB30YO4QI67etzOvH9oWgmSFksVROLO+9MoOnWTUOcTwLwXqrw3iclhbSy6gS3KamxiEBkvdXvEXTK7UntaR+Ci5NecBflxzVv7wo6KA== X-Google-Smtp-Source: AGHT+IETocxn3nfIcWUiLwNt4fz8JqwMIoWFCq3wtY4ohESPFsDTzCk3EQ8+9iHKGqbRE7S+WU80 X-Received: by 2002:a17:903:11c3:b0:1dc:fc84:edaa with SMTP id q3-20020a17090311c300b001dcfc84edaamr13099911plh.29.1710264398944; Tue, 12 Mar 2024 10:26:38 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710264398; cv=pass; d=google.com; s=arc-20160816; b=YUMGIT4B2TLbRuNs7aM4FVYT+RJg7pI0plnqxq2o528S3uLkNfPfSWBTgSpdalkoOX g4fTR4byauffFBTlIG0FEKQ31K9oCXL2VTKwE9EAc4EfZPMkdtJcWK4ldkeeQD3/lj2n 2nPCercQ/+o14ZfflGinz+LbLy2O1XygaI9DG6D1b5/k9IBX9e6nhEDBORmr/FSVqotS CzI1ARr0efr1vFoeFeWWhh/6/7nXrVjnsmYKMwscJqpDP7wfCALBTizb6UuabMfmsWs/ C5FjXTyVqfmiBPDZWnWDfiNoyO5Io8JgF4hSW7qOpBMWIC7VWoe6qjc+baMBMUlc6a2X SRpg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :dkim-signature; bh=rII1IKE/cKHA5fIIIZqL0Y1Zv3aUlIm70c4nt3V1iEg=; fh=W6FyYwzujyISCx/xtIP9BHhttRZMJAyF/iAVqLTfZLk=; b=YAMlwn64TwBdpOhNh1DOzcx9T0ca9qtJ8iRpSgAeiPM/iI1DrW0Hu0uPR36bcZ42JQ 7VJ40z2WuCjFnZv676Mmz5PZU0lZ2Tx4/SGphF1864MjjaVdfADaaRjUzutB2hG3unua /FnMRfxdFSYvUtzRrL6T8RMJ2AnDPOvVkFrwXDYyTLE2IJJIqLStRNhxrptzwD12DG9V Jm5HsfoBjtuudcxPXEDXrLhTTZfwkPsFlXKQrQNWU1ZGJXwRpWGgCINSMP5LhqQ+JBe/ 7swukjm50CGd3eAmXO/d2luJJTW0ibeII2woCFcQv7gebOfoI0Ln3piI4qrd5iivzGWO Ckpw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@raspberrypi.com header.s=google header.b=SQjMNBqD; arc=pass (i=1 spf=pass spfdomain=raspberrypi.com dkim=pass dkdomain=raspberrypi.com dmarc=pass fromdomain=raspberrypi.com); spf=pass (google.com: domain of linux-kernel+bounces-100588-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-100588-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=raspberrypi.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id y12-20020a170902e18c00b001d96401fbfcsi6921913pla.521.2024.03.12.10.26.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Mar 2024 10:26:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-100588-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@raspberrypi.com header.s=google header.b=SQjMNBqD; arc=pass (i=1 spf=pass spfdomain=raspberrypi.com dkim=pass dkdomain=raspberrypi.com dmarc=pass fromdomain=raspberrypi.com); spf=pass (google.com: domain of linux-kernel+bounces-100588-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-100588-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=raspberrypi.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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 3054EB24234 for ; Tue, 12 Mar 2024 17:17:23 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id EBC6B139568; Tue, 12 Mar 2024 17:16:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="SQjMNBqD" Received: from mail-yw1-f174.google.com (mail-yw1-f174.google.com [209.85.128.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 1ADAB1386CD for ; Tue, 12 Mar 2024 17:16:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.174 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710263810; cv=none; b=jyqrb2MwqveO8BmBMZIrS49T2fcunwZmTxc94r9FtWVvquXBtYnTI51kEivigAb9smhrhZ2DSa0EnZQ096fKKUd0VV2hkftwntDDitVgWxMNv7SeqT8ju+o8xATTPMrM9wbMBCUw9grXoc003WWXWwMbuNu4tHaxB+ZORtGwah4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710263810; c=relaxed/simple; bh=QlsrG0Ev+JX2ByEVuh2NX2tX3x6JjPtrtcIj6hDRD4w=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=K7f6bqFhiatVSSBIRxOcHpaNeSMdOCTGOaOiC+WbG9h/KWDp3wIpDY7oXmVGIQT8MqYuCELgMgC7jgeK0vafGLvyd47oAmQr4OGaWyywbU3PeQs3o3/Cclgo9EYSXkUA6VlvxKoRZHh4zSTr/bi8uKa7gZ0h1DE8fAOt1h3R5pQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=raspberrypi.com; spf=pass smtp.mailfrom=raspberrypi.com; dkim=pass (2048-bit key) header.d=raspberrypi.com header.i=@raspberrypi.com header.b=SQjMNBqD; arc=none smtp.client-ip=209.85.128.174 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=raspberrypi.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=raspberrypi.com Received: by mail-yw1-f174.google.com with SMTP id 00721157ae682-60a046c5262so40267327b3.2 for ; Tue, 12 Mar 2024 10:16:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; t=1710263808; x=1710868608; darn=vger.kernel.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=rII1IKE/cKHA5fIIIZqL0Y1Zv3aUlIm70c4nt3V1iEg=; b=SQjMNBqD4Zt+biI0XpBwQ4bbKDZHlLeE5ID7vB3t8HH7mPMH6E+MP+v7tGh6KZc3hK QdbxoP1zfDjIBDTHaLY7Hn2GZZJnXNDrbf38IYl6R5Y9NjbVSU+9j9bMYW59MRwjOL7I B/0wIVUo0WiaSSp3agu8pB2ArIaKJ10GFR6mwiYUbG2SfYESn8Zdem2YtHMW+pX2gzSq xRFNCRWDNZZ6PWT/hMVzK8ccNrD9koCJRhDNQ539E+KGdvLB18kgCQsLQNoVEW1fOb20 g0MdZDk0soQlZ+0tJcYFqlA1V4YDaF2vvLZRYlDMmNaF8ayXTgRYKf+HKpB2cZeY77NL FRzA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710263808; x=1710868608; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=rII1IKE/cKHA5fIIIZqL0Y1Zv3aUlIm70c4nt3V1iEg=; b=G+Zm8Ok/uyLxm6tkyWH6xWiXu4ZcqlkLHcmhObL0IfXjNidVvaUaqzAg2hZ7fJusZ8 GSNM8HY1DKRPWjgyJpfgKruzEMeFSJXNerL7ZgEq+QRQqls+CawaNtWrm1xUWwOjbpVJ lh0IAO1pd4/EIExJksP+aqzdO46Ks5OgvF3RRLv92z3KjQDZycUV9tMpqhHp5yn/7BA5 TjaFCzowd0IyEJB70ig0SlBcPTPTOpG6zIxmNBJyncMazepP3Sy+ToQzfgwSrPTELefB aKo/KYKYGqmNsv5UkyGRQWosVqIVnX1BFI4YtSIf0oti0e8fLvY0G8bqD0ekin4EkC2u 4jow== X-Forwarded-Encrypted: i=1; AJvYcCWLF1PaEagO9nb0GJiuXuylbPHQT7UkBjbwfTinWgAIxDjUt/GdzywKMdbxODCjW+uvI7SEOUDbpbNzXIHFJStekuiNRxD5iwtJ7scF X-Gm-Message-State: AOJu0Yy2LKiGoOhYOQlkakvS5YToQTvA607x9pzoTE7AvMFw0njTvgUQ eYSKknU56X7NYCuamIXsRBddK9fl+NVWRCjsrH0/Vqb7xAcqFFVL3FymFLQjlycnFKODZR8pB5Y yoxzO4M7k1XznqXfcrG9SWunJGtxrvrFq7jYQSw== X-Received: by 2002:a25:2d25:0:b0:dcc:744d:b485 with SMTP id t37-20020a252d25000000b00dcc744db485mr102839ybt.33.1710263808011; Tue, 12 Mar 2024 10:16:48 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: In-Reply-To: From: Dave Stevenson Date: Tue, 12 Mar 2024 17:16:32 +0000 Message-ID: Subject: Re: [PATCH v2 00/15] dmaengine: bcm2835: add BCM2711 40-bit DMA support To: Andrea della Porta Cc: 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 Content-Type: text/plain; charset="UTF-8" Hi Andrea On Tue, 12 Mar 2024 at 09:12, Andrea della Porta wrote: > > * Spam * > The BCM2711 has 4 DMA channels with a 40-bit address range, allowing them > to access the full 4GB of memory on a Pi 4. > This patchset aims to update the dma engine for BCM* chipset with respect > to current advancements in downstream vendor tree. In particular, it > supports the BCM2711 DMA engine in terms of extended DMA addressing to 40 bit. > > Changes with respect to the first version (see [1]) of this patchset: > > * dropped support of the new BCM2712. It will be the focus of a subsequent > patch. > > * merged patchset from Stefan Wahren [2] to support newer chipset with a > platform agnostic design, while also retaining the new features added > from downstream [1], as follows: > > - patches from 1 to 5 are preparatory, adding some features and bugfix > common to all chipsets. > - patches from 6 to 12 add hw abstraction > - patches 13 to 15 eventually add 40 bit and BCM2711 support > > * fixed a couple of bugs from [2] relative to address shifting on 40 bit > support specific code > > * added the relevant entries in the dts and DT binding that was missing > in the first patch > > * used FIELD_PREP() wherever appropriate as advised in [3] > > * of_match_node() has been replaced by the more generic device_get_match_data(), > as per [4] > > * fixed several errors and warnings from checkpatch > > > Please note that there is still a pending discussion around here [5]: > this patch still use the current approach (used in both downstream > code and in Stefan's redesigned patchset) of getting the address as it is > (dma_addr_t) and just add the relevant offset when needed (on 40 bit > channel, see .addr_offset in struct bcm2835_dma_cfg). This is not > optimal but still deemed as less hacky than using DMA internals (see > [6]). As soon as there will be guidelines for [5] or dma_map_resource() > will take care of dma_ranges, a subsequent patch will adjust accordingly. > > Since there is an ongoing effort from Dave Stevenson to upstream a > patchset with similar goals, I'm adding him to the email loop in order > seek for collaboration. Please hold fire on these patches until we resolve the dma-ranges question. If the dma-ranges are defined correctly, then the cb_offset is not required as the mapping deals with it. At present we have a mess with the 32bit DMA controllers, and need to clean it up whilst still having old DT files work. Fixing it up also requires fixing the DMA users (primarily MMC, SPI, and vc4 HDMI audio), so will need some care over patch ordering to avoid regressions. If at all possible then I would like to avoid the same mess on the 40 bit controllers too. Thanks Dave FWIW my work in progress branch is currently https://github.com/6by9/linux/tree/mainline_2712_rp1_dma_vc4_rc5, which includes my fixed up set of Stefan's patches, as well as all the other patches that need working on for Pi5 support upstream. > Many thanks, > > Andrea > > Links: > [1] https://lore.kernel.org/linux-arm-kernel/cover.1706948717.git.andrea.porta@suse.com/ > [2] https://lore.kernel.org/linux-arm-kernel/13ec386b-2305-27da-9765-8fa3ad71146c@i2se.com/T/ > [3] https://lore.kernel.org/linux-arm-kernel/YguMW8n1q0ZV5tKH@matsya/ > [4] https://lore.kernel.org/linux-arm-kernel/1e71c153-e482-409c-b229-9b9c0662b67e@arm.com/ > [5] https://lore.kernel.org/all/CAPY8ntByJYzSv0kTAc1kY0Dp=vwrzcA0oWiPpyg7x7_BQwGSnA@mail.gmail.com/ > [6] https://lkml.org/lkml/2024/2/5/1161 > > Andrea della Porta (11): > dmaengine: bcm2835: Fix several spellos > dmaengine: bcm2835: Support common dma-channel-mask > dmaengine: bcm2835: move CB info generation into separate function > dmaengine: bcm2835: move CB final extra info generation into function > dmaengine: bcm2835: make address increment platform independent > dmaengine: bcm2385: drop info parameters > dmaengine: bcm2835: pass dma_chan to generic functions > dmaengine: bcm2835: introduce multi platform support > dt-bindings: dma: Added bcm2711-dma > dmaengine: bcm2835: Add BCM2711 40-bit DMA support > ARM: dts: bcm2711: add bcm2711-dma node > > Dom Cobley (2): > dmaengine: bcm2835: Support dma flags for multi-beat burst > dmaengine: bcm2835: Fixes for dma_abort > > Phil Elwell (2): > dmaengine: bcm2835: Add support for per-channel flags > dmaengine: bcm2835: Add NO_WAIT_RESP, DMA_WIDE_SOURCE and > DMA_WIDE_DEST flag > > .../bindings/dma/brcm,bcm2835-dma.yaml | 4 +- > arch/arm/boot/dts/broadcom/bcm2711.dtsi | 16 + > drivers/dma/bcm2835-dma.c | 1084 +++++++++++++---- > 3 files changed, 892 insertions(+), 212 deletions(-) > > -- > 2.35.3 > >