Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp534947ybe; Fri, 13 Sep 2019 01:53:14 -0700 (PDT) X-Google-Smtp-Source: APXvYqxhxctkhgF81zDMY/ULZIXk0U06CoP2GD5b5eJ3anZ8W8NXYs4vQ2vcouzAXRKIJUEp0mf5 X-Received: by 2002:a17:906:9383:: with SMTP id l3mr38493448ejx.140.1568364794168; Fri, 13 Sep 2019 01:53:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568364794; cv=none; d=google.com; s=arc-20160816; b=OByvi7zHOL2FY8ChzLhVogSHt4F74/z2G1apiT//o5XnfBkUzKyLyFtoSiaOInOOdo Jl4GAul9jCMDkQ67pynnylpwQiZwdx5DRzFd4aWas4eWIzKfTv4LbjNtBEG19lW1FhGv rfbAKPnXo7S9IftXW/oYWG23E89WxULrOF0TxhNRsY35nn2qkXDPkEYg0q3e9cLCilJ0 5mzj74pQTt4uRETQlQDYRjyGo180lud6h4zg6ddCCkUwU2dnLzrd1GT7jeWiv1tCj68l kVlsQpsGY7bDg+mBqvAeXfeYADWv5iHYzHqq+y92cRlCYZMIDQGTeqyJkcTyfLCABh8s k4AQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=Kf8l2KZndYGgxFpJIw5tcU/NehwSpYnSjY5n7UbqckU=; b=xdQdcA7+rt4010r1BZljJFa3hAhaDftjomknUlDewdpsqNvH1lWHj4xLHqGlBVZVaw aQ55/p3RyN6O73XcsvAwsQsKxlwHXdkVd1gv9g6+vqHnRXyKRJzIVynXQ8aNnIItrlHd TSgJaxjDnBOQAhCrxtAyeGiIUE8AmCyOeZ1p14M13RrnAZNugHW+JDbz5qSfF1s6DkDu QrdUefPQbM/Y8EgkvUQyfC+sjFe+xbMTaGzdypwNlfq2NkU6qfWuOLAAOigCvJGyLsB7 MWd6BVmScuta/IibLF9gBghIYhnkJcUbqTYKRbrrAmL/G4qtoHC8rQRxGZNR7WZbprwC jXWQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmx.net header.s=badeba3b8450 header.b=LgBrFGcK; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b25si1110904eja.198.2019.09.13.01.52.49; Fri, 13 Sep 2019 01:53:14 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmx.net header.s=badeba3b8450 header.b=LgBrFGcK; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387620AbfIMIvF (ORCPT + 99 others); Fri, 13 Sep 2019 04:51:05 -0400 Received: from mout.gmx.net ([212.227.17.20]:37027 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387557AbfIMIvE (ORCPT ); Fri, 13 Sep 2019 04:51:04 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1568364635; bh=OZqY8YEmhSzYpVNahFixu1x4zax59nBDtoBfEOKOU5s=; h=X-UI-Sender-Class:Subject:To:Cc:References:From:Date:In-Reply-To; b=LgBrFGcKw3jzMlfJOCjItxE63zvj5he1+kky9ilivtcRdrHVQsn77FeH0WFVA/7o5 fQ+BbYa36NLTKwhjgpD+JeHKXyvPiuy7tyD+lNpC8LEHM5cMglVxMA/OIalDzoRSGI n8ASzdbzVhqlhX/QhvOfCvQb7DyVFgu6o2AJUvF8= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from [192.168.1.162] ([37.4.249.90]) by mail.gmx.com (mrgmx103 [212.227.17.168]) with ESMTPSA (Nemesis) id 0Lzsf1-1iCMTA0Nu7-014yUk; Fri, 13 Sep 2019 10:50:35 +0200 Subject: Re: [PATCH v5 0/4] Raspberry Pi 4 DMA addressing support To: Matthias Brugger , catalin.marinas@arm.com, marc.zyngier@arm.com, Matthias Brugger , 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: robin.murphy@arm.com, f.fainelli@gmail.com, will@kernel.org, linux-rpi-kernel@lists.infradead.org, phill@raspberrypi.org, m.szyprowski@samsung.com, linux-kernel@vger.kernel.org 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> <2c3e1ef3-0dba-9f79-52e2-314b6b500e14@gmx.net> <4a6f965b-c988-5839-169f-9f24a0e7a567@suse.com> From: Stefan Wahren Message-ID: <48a6b72d-d554-b563-5ed6-9a79db5fb4ab@gmx.net> Date: Fri, 13 Sep 2019 10:50:32 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <4a6f965b-c988-5839-169f-9f24a0e7a567@suse.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Content-Language: en-US X-Provags-ID: V03:K1:5fDbWcniG6VsoBWaSc+GYFShgEo4REYeFeRHrSgDDglxm5sD6x2 UrWf7vgL6ch3G20ivsSWNIYWs/Bz1I+ZBgUC3eKNW5tdmxyn8E7T09758U+Tzf0wd/Wfw8R nrZhE9fM238lCEGselAea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QEE0iXQBZX5Fi85Qkf/9Orb 7ZPA0klbpejckcIoscN1Vandk0ERHH6JArUBfIAQokm/ElVeOHqF7RcfpzlarmXkaz65JFY03 4ZAxD1pCVkNsGrtcfta2mXQ97NrVDDVR6ZBwKR6IshAUVzG02FtirFYR/uvzQCiLzbzjhd2Jv hnHwsSRwRw5L/ZeWRxt5BQOx4FXI4aaq7/ANCbqqurfTzVZ+SH+M6W7oxUb51cW+JPzUAxTxt zWlhgmJD26gIhkPblPuZX6IyXK2IU/IvYLe5QIFuATMSATrzDVrMYP+IWVG4UYw4WaAdMQQf/ IzirydQqcD7FTclu9dRm0zhhepscswytTs0NfKopHHrsepk8IMYtE7M4DYk0= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Am 13.09.19 um 10:09 schrieb Matthias Brugger: > > On 12/09/2019 21:32, Stefan Wahren wrote: >> 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 follow >>>>>> 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 these >>>>>> limitations: the PCIe, V3D, GENET, and 40-bit DMA channels have a wider >>>>>> view of the address space by virtue of being hooked up trough a second >>>>>> interconnect. >>>>>> >>>>>> Part of this is solved on arm32 by setting up the machine specific >>>>>> '.dma_zone_size = SZ_1G', which takes care of reserving the coherent >>>>>> 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. Only >>>>>> ZONE_DMA32 is created which is interpreted by dma-direct and the arm64 >>>>>> arch code as if all peripherals where be able to address the first 4GB >>>>>> 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 limitations >>>>>> 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 forcing >>>>>> 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 support. >>>>>> >>>>> i like to test this series on Raspberry Pi 4 and i have some questions >>>>> 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 both 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 added: >>> >>> "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. > I'm not sure I understand what you want to say. My goal is to use the upstream > kernel with the device tree blob provided by the FW. The device tree blob you are talking is defined in this repository: https://github.com/raspberrypi/linux So the word FW is misleading to me. > If you talk about the > downstream kernel, I suppose you mean we should change this in the FW DT blob > and in the downstream kernel. That would work for me. > > Did I understand you correctly? Yes So i suggest to add the upstream compatibles into the repo mentioned above. Sorry, but in case you decided as a U-Boot developer to be compatible with a unreviewed DT, we also need to make U-Boot compatible with upstream and downstream DT blobs. > >>> 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 >>