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=-1.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED 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 01B0BC4740A for ; Mon, 9 Sep 2019 19:51:07 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id CC11F207FC for ; Mon, 9 Sep 2019 19:51:06 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="NKzhUL0a" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CC11F207FC Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender:Content-Type:Cc: List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: MIME-Version:References:In-Reply-To:Date:To:From:Subject:Message-ID:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=+sKEbEO2BAqRpHRWcSKZz5JbgNqmhNaLTL5MG0TxGpE=; b=NKzhUL0aX7eITfcjVVXJ+GV9x L4kTgVpNe3NDQ2QTz29ofvziPDEi4fwrj44Salj7Askke7x5Ibo1C1Ghws7OkFkELrtebj6hMSXxv UL1MYqnqXYKPe2n1TU1R8ZORdIS+bIAl6+58ee5nki4hw9ry4oEnW0umWMr6yabWoz0/sg6G8zgCf J/O35q8wFLTQscwV6gtGCCY/Wp8z/jnmhIihMQz4rKh3tlOQYyqUb8PjQdduNRidPR7mjkKlTt/u8 eYd4Us6Cz2b5ctuaSn+tyBTLK2NkZMiVR+hbcu0KLCLAh8nG8Q74sIo/mjG4jcv+nF8YBVwh+xTlv xKNMfl98Q==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1i7Pgg-0005xR-KW; Mon, 09 Sep 2019 19:50:58 +0000 Received: from mx2.suse.de ([195.135.220.15] helo=mx1.suse.de) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1i7Pgc-0005wg-Ga; Mon, 09 Sep 2019 19:50:56 +0000 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id A1671B6D8; Mon, 9 Sep 2019 19:50:51 +0000 (UTC) Message-ID: Subject: Re: [PATCH v5 0/4] Raspberry Pi 4 DMA addressing support From: Nicolas Saenz Julienne To: Stefan Wahren , catalin.marinas@arm.com, hch@lst.de, marc.zyngier@arm.com, robh+dt@kernel.org, linux-arm-kernel@lists.infradead.org, linux-mm@kvack.org, linux-riscv@lists.infradead.org Date: Mon, 09 Sep 2019 21:50:47 +0200 In-Reply-To: <5a8af6e9-6b90-ce26-ebd7-9ee626c9fa0e@gmx.net> References: <20190909095807.18709-1-nsaenzjulienne@suse.de> <5a8af6e9-6b90-ce26-ebd7-9ee626c9fa0e@gmx.net> User-Agent: Evolution 3.32.4 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190909_125054_847539_FF9C8584 X-CRM114-Status: GOOD ( 22.35 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: f.fainelli@gmail.com, robin.murphy@arm.com, linux-kernel@vger.kernel.org, mbrugger@suse.com, linux-rpi-kernel@lists.infradead.org, phill@raspberrypi.org, will@kernel.org, m.szyprowski@samsung.com Content-Type: multipart/mixed; boundary="===============7388730019844420172==" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org --===============7388730019844420172== Content-Type: multipart/signed; micalg="pgp-sha256"; protocol="application/pgp-signature"; boundary="=-aEBb/xch/kbKDpnAu5z0" --=-aEBb/xch/kbKDpnAu5z0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, 2019-09-09 at 21:33 +0200, Stefan Wahren wrote: > Hi Nicolas, >=20 > 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 > >=20 > > 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 thes= e > > 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. > >=20 > > 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 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. > >=20 > > 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. > >=20 > > In the light of this, the series implements the following changes: > >=20 > > - 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 limitation= s > > so this hardcoded solution was deemed preferable. > >=20 > > - Properly set ARCH_ZONE_DMA_BITS. > >=20 > > - Reserve the CMA area in a place suitable for all peripherals. > >=20 > > 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: > >=20 > > - 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. > >=20 > i like to test this series on Raspberry Pi 4 and i have some questions > to get arm64 running: >=20 > Do you use U-Boot? Which tree? No, I boot directly. > Are there any config.txt tweaks necessary? I'm using the foundation's arm64 stub. Though I'm not 100% it's needed anym= ore with the latest firmware. config.txt: arm_64bit=3D1 armstub=3Darmstub8-gic.bin enable_gic=3D1 enable_uart=3D1 Apart from that the series is based on today's linux-next plus your RPi4 bringup patches. --=-aEBb/xch/kbKDpnAu5z0 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iQEzBAABCAAdFiEErOkkGDHCg2EbPcGjlfZmHno8x/4FAl12rRcACgkQlfZmHno8 x/7toQf+L/Ta9MCsjv+DyfWvjt/fl9GT60+Z9cBctuHCujlRmElfGztMgn6Nu0hh fosUsadksYqFzrdw9GLfqJj57Lmq8RXvt/glSBSN0lQZkXjn3pVklko/Wkj2UOaH SvICcPMWlbk6nRjyVzX70aenvVmV5BqYa6qNxuCxPHEkYeVd9egxB//JPjtL6tqK 4QVSoJLjfoQAlYNWDm96f77nn5doyj1ibooZxaFQe5u0+3T0ytqCZfgDsJvrIpuW 2E4fth6VMA1AOFYH+EsvU49WyLcA1ry6xEA5NbkfmZZdh1eSyW7nCcCT60+S7Zm5 kfIX5VMaPvFiHYUMyyPzrdRP1un7VA== =oHYd -----END PGP SIGNATURE----- --=-aEBb/xch/kbKDpnAu5z0-- --===============7388730019844420172== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel --===============7388730019844420172==--