From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.6 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0ED7CC4CEC7 for ; Thu, 12 Sep 2019 19:32:41 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 7E05320684 for ; Thu, 12 Sep 2019 19:32:40 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=gmx.net header.i=@gmx.net header.b="jI/Y4TBz" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7E05320684 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=gmx.net Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id E97F36B0007; Thu, 12 Sep 2019 15:32:39 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E47B46B0008; Thu, 12 Sep 2019 15:32:39 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D37836B000A; Thu, 12 Sep 2019 15:32:39 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0109.hostedemail.com [216.40.44.109]) by kanga.kvack.org (Postfix) with ESMTP id C93DB6B0007 for ; Thu, 12 Sep 2019 15:32:39 -0400 (EDT) Received: from smtpin07.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with SMTP id 816748243768 for ; Thu, 12 Sep 2019 19:32:38 +0000 (UTC) X-FDA: 75927265596.07.spoon44_6e0f22591f963 X-HE-Tag: spoon44_6e0f22591f963 X-Filterd-Recvd-Size: 11522 Received: from mout.gmx.net (mout.gmx.net [212.227.15.19]) by imf06.hostedemail.com (Postfix) with ESMTP for ; Thu, 12 Sep 2019 19:32:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1568316739; bh=ZhGcmu0FL7c6CsiOe5ntOYdJs2XJ0IHkdvvQp/czUYc=; h=X-UI-Sender-Class:Subject:To:Cc:References:From:Date:In-Reply-To; b=jI/Y4TBztwVnqxuv+S8X1nIvO3JWvu6xOm0pD4/HkZbfMYcB1i4ZRBY2CpnhwFtSD MVf26VPugeMbU0t2q63k1bBGfYYYBiYP9rkuDcOgSE6Khd5ZDEJsgAycpFxldWWYTX MMspO5ja5XwNZ4hV3FIGIdsXOZTDFOWuD/yIiPHE= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from [192.168.1.162] ([37.4.249.90]) by mail.gmx.com (mrgmx002 [212.227.17.190]) with ESMTPSA (Nemesis) id 0MIu7d-1i6Yt02Gr3-002Xj2; Thu, 12 Sep 2019 21:32:19 +0200 Subject: Re: [PATCH v5 0/4] Raspberry Pi 4 DMA addressing support To: Matthias Brugger , Matthias Brugger , Stefan Wahren , catalin.marinas@arm.com, marc.zyngier@arm.com, robh+dt@kernel.org, linux-mm@kvack.org, linux-arm-kernel@lists.infradead.org, linux-riscv@lists.infradead.org, hch@lst.de, Nicolas Saenz Julienne Cc: f.fainelli@gmail.com, robin.murphy@arm.com, linux-kernel@vger.kernel.org, linux-rpi-kernel@lists.infradead.org, phill@raspberrypi.org, will@kernel.org, m.szyprowski@samsung.com References: <20190909095807.18709-1-nsaenzjulienne@suse.de> <5a8af6e9-6b90-ce26-ebd7-9ee626c9fa0e@gmx.net> <3f9af46e-2e1a-771f-57f2-86a53caaf94a@suse.com> <09f82f88-a13a-b441-b723-7bb061a2f1e3@gmail.com> From: Stefan Wahren Openpgp: preference=signencrypt Autocrypt: addr=stefan.wahren@i2se.com; keydata= xsFNBFt6gBMBEACub/pBevHxbvJefyZG32JINmn2bsEPX25V6fejmyYwmCGKjFtL/DoUMEVH DxCJ47BMXo344fHV1C3AnudgN1BehLoBtLHxmneCzgH3KcPtWW7ptj4GtJv9CQDZy27SKoEP xyaI8CF0ygRxJc72M9I9wmsPZ5bUHsLuYWMqQ7JcRmPs6D8gBkk+8/yngEyNExwxJpR1ylj5 bjxWDHyYQvuJ5LzZKuO9LB3lXVsc4bqXEjc6VFuZFCCk/syio/Yhse8N+Qsx7MQagz4wKUkQ QbfXg1VqkTnAivXs42VnIkmu5gzIw/0tRJv50FRhHhxpyKAI8B8nhN8Qvx7MVkPc5vDfd3uG YW47JPhVQBcUwJwNk/49F9eAvg2mtMPFnFORkWURvP+G6FJfm6+CvOv7YfP1uewAi4ln+JO1 g+gjVIWl/WJpy0nTipdfeH9dHkgSifQunYcucisMyoRbF955tCgkEY9EMEdY1t8iGDiCgX6s 50LHbi3k453uacpxfQXSaAwPksl8MkCOsv2eEr4INCHYQDyZiclBuuCg8ENbR6AGVtZSPcQb enzSzKRZoO9CaqID+favLiB/dhzmHA+9bgIhmXfvXRLDZze8po1dyt3E1shXiddZPA8NuJVz EIt2lmI6V8pZDpn221rfKjivRQiaos54TgZjjMYI7nnJ7e6xzwARAQABzSlTdGVmYW4gV2Fo cmVuIDxzdGVmYW4ud2FocmVuQGluLXRlY2guY29tPsLBdwQTAQgAIQUCXIdehwIbAwULCQgH AgYVCAkKCwIEFgIDAQIeAQIXgAAKCRCUgewPEZDy2yHTD/9UF7QlDkGxzQ7AaCI6N95iQf8/ 1oSUaDNu2Y6IK+DzQpb1TbTOr3VJwwY8a3OWz5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Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <09f82f88-a13a-b441-b723-7bb061a2f1e3@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Content-Language: en-US X-Provags-ID: V03:K1:4xpyVTkM7mBHwer0vBdnpZAda7DcFxOoW0+WuRy4TkEKxMiMlmN M+SKLGRk2tS9dYViahToGsAuTzugZA1kANQsReD+i5epvMF5yCJKTQnEpw161Du5A22hjJO /tPCYSGWzP7L5usVqaK9StT43B9Ji6UAg/HbKQ24E5JuE7RjnynMaQWo4Vq2/RJHXtK+2sQ FDI27EU/NTWzAuJnzDXCA== X-UI-Out-Filterresults: notjunk:1;V03:K0:99alYRTSDPY=:xHYjMtKVyHWQ/iK2Vbu/zw hbtkt2FcY47/Q2qHFp3EW1Hh6wmlof1QFS2VO2S3TWU1nKcpaknXTejUIWOQXegczemvl+sbo Hr3OJFJFYbrbO1SxCojU4TCiLJFe5ClVGsB5+aeG2le/iKMupt/KviOzMsV1rbZXeFwHgAR9a VegIQ9fXuiJlxEwTzAkwV1fRpEFK5qw1vu0boThat2McPQsl2GmItBG6dWKieW1JknS3aHW8i xQFMyZcFdYZA0GJjhvj36gSWz4X6p5kw7EfBCaPOYNGEGOoHhIhwmBb4P/Tf0voFe5fSLgwXb jYt4/CIPkzNyMwtP3DjfFcwjBSGrzLsS8zim3WBRB11kHl9wKOZlWS0kMPy/3UY4/i9nwDyVA wh0sPuaspOGNxpfmTyY4J2Nk7+5noqTYF9Y9r8skAezjEFrLccovsFfa/gdK8oHYJjFHnMalP Dj0ceQ3H3cPrgVyW6//xklvzAId6fTUxBsRh+SkYV8wA2OxUPR05ZlYYZygXuaZYAraiPKzPO YteprH6CnN6oo3RKR09URufySBcOcxDDf+VBtlG0GwP8Ifnw5GMxjGandMBm/4jdiHI4UmxVs MnbGytoGcfAVYTZyWgFzmg4GU+nRmJBguuUDqfau8Iih4zsQcBc6ySp2p7PiMICTqXy29eZyK 3l3vMk6+eOW/TCsmpFhlAjAtFpDQsKpughAxlhLweBt5+3NGpDjU2zwQ+w435Aqeqy2Vy//wV 2m9dYSQvO3GuvkxT0aKWK5bt2hV8Lp/rCXcmSVse8QhvngaNPStUm69bsWHyORO5NZnSXUVyy w/PEE51aE7SaTsd+E1l4JV1thpT3is5mLfHpgKizK8gBxBgyogSyJx9iAp/Dc3C1on2II7YVK MJDhokXTYA4bMoZ0KO4OpatAb9dUODb7r/kf+rVSxP0J5VG4oxhxYYJRWvzFElHSJRKPIy9eA 3ji6pSf5iyh2rRCgIjbvG1MFqxuc2Q3GsnR7Pkb7+chasvMpRTLxzngUVT9dYAzyLRx30bgzt n0tgtEOpanEDqP/qxLY1olj7AB9NU09c4ZfWjX7i/U0yk+iHme1Vc8l+KJA9wb+oAI3b/TohN hK+CBEAfSSh1TehAgMucCIhIVaaA/s2OzgAmtICldlxfHpzqAMblTxqxO9zqgzGoPjnKX/1hF 7Iuucsg5UxGOd2vcStwgckss5fTHQnXoXBnr2/SJSgcHAHguVSLC9G/kG5PY5dkvt/3EoEThO ivKLUwHvFHMNOH8XnoDfdP19+SgEJRdl3WbORqgSTMzvGGtvUDrCNWxdmZFM= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Am 12.09.19 um 19:18 schrieb Matthias Brugger: > > On 10/09/2019 11:27, Matthias Brugger wrote: >> >> On 09/09/2019 21:33, Stefan Wahren wrote: >>> Hi Nicolas, >>> >>> Am 09.09.19 um 11:58 schrieb Nicolas Saenz Julienne: >>>> Hi all, >>>> this series attempts to address some issues we found while bringing = up >>>> the new Raspberry Pi 4 in arm64 and it's intended to serve as a foll= ow >>>> up of these discussions: >>>> v4: https://lkml.org/lkml/2019/9/6/352 >>>> v3: https://lkml.org/lkml/2019/9/2/589 >>>> v2: https://lkml.org/lkml/2019/8/20/767 >>>> v1: https://lkml.org/lkml/2019/7/31/922 >>>> RFC: https://lkml.org/lkml/2019/7/17/476 >>>> >>>> The new Raspberry Pi 4 has up to 4GB of memory but most peripherals = can >>>> only address the first GB: their DMA address range is >>>> 0xc0000000-0xfc000000 which is aliased to the first GB of physical >>>> memory 0x00000000-0x3c000000. Note that only some peripherals have t= hese >>>> limitations: the PCIe, V3D, GENET, and 40-bit DMA channels have a wi= der >>>> view of the address space by virtue of being hooked up trough a seco= nd >>>> interconnect. >>>> >>>> Part of this is solved on arm32 by setting up the machine specific >>>> '.dma_zone_size =3D SZ_1G', which takes care of reserving the cohere= nt >>>> memory area at the right spot. That said no buffer bouncing (needed = for >>>> dma streaming) is available at the moment, but that's a story for >>>> another series. >>>> >>>> Unfortunately there is no such thing as 'dma_zone_size' in arm64. On= ly >>>> ZONE_DMA32 is created which is interpreted by dma-direct and the arm= 64 >>>> arch code as if all peripherals where be able to address the first 4= GB >>>> of memory. >>>> >>>> In the light of this, the series implements the following changes: >>>> >>>> - Create both DMA zones in arm64, ZONE_DMA will contain the first 1G= >>>> area and ZONE_DMA32 the rest of the 32 bit addressable memory. So = far >>>> the RPi4 is the only arm64 device with such DMA addressing limitat= ions >>>> so this hardcoded solution was deemed preferable. >>>> >>>> - Properly set ARCH_ZONE_DMA_BITS. >>>> >>>> - Reserve the CMA area in a place suitable for all peripherals. >>>> >>>> This series has been tested on multiple devices both by checking the= >>>> zones setup matches the expectations and by double-checking physical= >>>> addresses on pages allocated on the three relevant areas GFP_DMA, >>>> GFP_DMA32, GFP_KERNEL: >>>> >>>> - On an RPi4 with variations on the ram memory size. But also forcin= g >>>> the situation where all three memory zones are nonempty by setting= a 3G >>>> ZONE_DMA32 ceiling on a 4G setup. Both with and without NUMA suppo= rt. >>>> >>> i like to test this series on Raspberry Pi 4 and i have some question= s >>> to get arm64 running: >>> >>> Do you use U-Boot? Which tree? >> If you want to use U-Boot, try v2019.10-rc4, it should have everything= you need >> to boot your kernel. >> > Ok, here is a thing. In the linux kernel we now use bcm2711 as SoC name= , but the > RPi4 devicetree provided by the FW uses mostly bcm2838. Do you mean the DTB provided at runtime? You mean the merged U-Boot changes, doesn't work with my Raspberry Pi series? > U-Boot in its default > config uses the devicetree provided by the FW, mostly because this way = you don't > have to do anything to find out how many RAM you really have. Secondly = because > this will allow us, in the near future, to have one U-boot binary for b= oth RPi3 > and RPi4 (and as a side effect one binary for RPi1 and RPi2). > > Anyway, I found at least, that the following compatibles need to be add= ed: > > "brcm,bcm2838-cprman" > "brcm,bcm2838-gpio" > > Without at least the cprman driver update, you won't see anything. > > "brcm,bcm2838-rng200" is also a candidate. > > I also suppose we will need to add "brcm,bcm2838" to > arch/arm/mach-bcm/bcm2711.c, but I haven't verified this. How about changing this in the downstream kernel? Which is much easier. > > Regards, > Matthias > >> Regards, >> Matthias >> >>> Are there any config.txt tweaks necessary? >>> >>> >> _______________________________________________ >> linux-arm-kernel mailing list >> linux-arm-kernel@lists.infradead.org >> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel >> > _______________________________________________ > linux-arm-kernel mailing list > linux-arm-kernel@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-arm-kernel