Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp2680921ybe; Thu, 12 Sep 2019 13:10:14 -0700 (PDT) X-Google-Smtp-Source: APXvYqyamYpMKognmZJuvmZH8a7cSPmyFJAhVxbCpjlsa00XNBvrEUDJ+LCyEPaHy9rxiRZFLH9R X-Received: by 2002:a17:906:3485:: with SMTP id g5mr34584751ejb.76.1568319014001; Thu, 12 Sep 2019 13:10:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568319013; cv=none; d=google.com; s=arc-20160816; b=Nbr/vQnCl/W1kzGVy15K8WpHGr1jyhLIM8sAqpOEZyLPPuUC3MY8FJGK+uQfeaAChZ jv7SGIfAdUE/oSDcSpDpWhlSydTHSB/EYwjFZOS/CbyDa6pVSCipOrnek9aJgwl9H+MZ Y4B494kN54Re7v2IyDraFvPtfIaV3z3gnUwmT84F5jk7zr4xWXf0EsrdU8xuFK1iytnj KOpQQPVrOoOCyz0y0qVBCzLqkQSh9uxHVHytC3Sn4qCngRWFuP/b+Fh43fnsXaUK0lo9 XRViA0N01OZfNngT4h41D/pIR3R+oUWnAG9gNTFvyPWaQXOylUzRif2iDrPgRrUHm4xo DjGg== 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:autocrypt:openpgp:from:references:cc:to:subject :dkim-signature; bh=ltWdEP34COMhrQW/J2I5EPld2GTcGvzO6UYpktHcqGc=; b=Xy5747+0vweNwNFTFAuGtPOXU/czIsTxK6Xr0PDmA5BzV6b99mh7fiogKUkqYCru3R MTrK8U4PqeYjS91D6EExmpKhqevkaDWi7mveeq8SgJ5Va5vhJRHGljIZmHfQn5SCXffW SAY5Hnm18wzf0BwOerY0ndxGW/48QAuqw1EZnfrGtBjeIGqxgcLngmL0c2CZgFw+S/zo XNJKNX8ZlLBPEpW9l3FVhuoiM0Hv4CeNEjqe8+U1jV5HvYzgVZySVJp+qe5tWbbU5pgo Z3aE3SwOyXTt47Cna6P1S7qVG3f76EaopLTFTRFAcNFvdeXq+ujsCNSYbGZW0NI8kcia XH1A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmx.net header.s=badeba3b8450 header.b="jI/Y4TBz"; 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 u21si13356273ejz.328.2019.09.12.13.09.50; Thu, 12 Sep 2019 13:10:13 -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="jI/Y4TBz"; 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 S1727782AbfILTdE (ORCPT + 99 others); Thu, 12 Sep 2019 15:33:04 -0400 Received: from mout.gmx.net ([212.227.15.19]:50801 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726203AbfILTdD (ORCPT ); Thu, 12 Sep 2019 15:33:03 -0400 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/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x7+p9xziu8ZfVX+iKBCc+He+EDEdGIDhvNZ/IQHfOB2PUXWGS+s9FNTxr/A6nLGXnA9Y6w 93iPdYIwxS7KXLoKJee10DjlzsYsRflFOW0ZOiSihICXiQV1uqM6tzFG9gtRcius5UAthWaO 1OwUSCQmfCOm4fvMIJIA9rxtoS6OqRQciF3crmo0rJCtN2awZfgi8XEif7d6hjv0EKM9XZoi AZYZD+/iLm5TaKWN6oGIti0VjJv8ZZOZOfCb6vqFIkJW+aOu4orTLFMz28aoU3QyWpNC8FFm dYsVua8s6gN1NIa6y3qa/ZB8bA/iky59AEz4iDIRrgUzMEg8Ak7Tfm1KiYeiTtBDCo25BvXj bqsyxkQD1nkRm6FAVzEuOPIe8JuqW2xD9ixGYvjU5hkRgJp3gP5b+cnG3LPqquQ2E6goKUML AQ== Message-ID: <2c3e1ef3-0dba-9f79-52e2-314b6b500e14@gmx.net> Date: Thu, 12 Sep 2019 21:32:16 +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: <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-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:99alYRTSDPY=:xHYjMtKVyHWQ/iK2Vbu/zw hbtkt2FcY47/Q2qHFp3EW1Hh6wmlof1QFS2VO2S3TWU1nKcpaknXTejUIWOQXegczemvl+sbo Hr3OJFJFYbrbO1SxCoj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uucsg5UxGOd2vcStwgckss5fTHQnXoXBnr2/SJSgcHAHguVSLC9G/kG5PY5dkvt/3EoEThO ivKLUwHvFHMNOH8XnoDfdP19+SgEJRdl3WbORqgSTMzvGGtvUDrCNWxdmZFM= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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