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=-6.8 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=ham 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 33E86C3A59E for ; Tue, 20 Aug 2019 17:14:32 +0000 (UTC) Received: from mail.linuxfoundation.org (mail.linuxfoundation.org [140.211.169.12]) (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 DC78A22DD3 for ; Tue, 20 Aug 2019 17:14:31 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="1yXHm0Cw" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DC78A22DD3 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=iommu-bounces@lists.linux-foundation.org Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id A1204C9E; Tue, 20 Aug 2019 17:14:31 +0000 (UTC) Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id 77BDCC6D for ; Tue, 20 Aug 2019 17:14:30 +0000 (UTC) Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 80EE912E for ; Tue, 20 Aug 2019 17:14:29 +0000 (UTC) Received: from mail-qt1-f173.google.com (mail-qt1-f173.google.com [209.85.160.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 1B1A122CE3 for ; Tue, 20 Aug 2019 17:14:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1566321269; bh=WGX3Gxv4dvM3DO7D4Aw57VijAg2RzIOgDn+ZtwXtLuA=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=1yXHm0Cw2txK8FKtm1lYL+ceKrY7DkUGFh280BlxT1m8fd1yJvGoIVx0XuwOhxQFl 3vnSgFW8lKZ5tU+8Sczz4E2yLgkfj7rC+uZiW9anhIz5JhqNZ2QuOhbB3Db0e6C+Ey r3/UkDEl7xBODkwZSZVqMzmvS/NH9009SEaBt8yY= Received: by mail-qt1-f173.google.com with SMTP id b11so6879100qtp.10 for ; Tue, 20 Aug 2019 10:14:29 -0700 (PDT) X-Gm-Message-State: APjAAAW/kSbSpIvOeHBj6O8PGIuv0hhkWnTAtKdiB0Z63kzexGfn0tUk vVlS5dCgl1QMGww8PwtzZrijdLVZ2xat47Hi0g== X-Google-Smtp-Source: APXvYqyY9ZsBecGQ3Xs5y7LG3j9BHwHgJiDVJDcbMsgosFCxqVWpdQe5Z5wA8XSvdYEItWSHAFvEDYIGvIF5NjfBNsQ= X-Received: by 2002:ac8:44c4:: with SMTP id b4mr26942067qto.224.1566321268306; Tue, 20 Aug 2019 10:14:28 -0700 (PDT) MIME-Version: 1.0 References: <20190820145821.27214-1-nsaenzjulienne@suse.de> <20190820145821.27214-5-nsaenzjulienne@suse.de> In-Reply-To: <20190820145821.27214-5-nsaenzjulienne@suse.de> From: Rob Herring Date: Tue, 20 Aug 2019 12:14:16 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2 04/11] of/fdt: add early_init_dt_get_dma_zone_size() To: Nicolas Saenz Julienne Cc: "open list:GENERIC INCLUDE/ASM HEADER FILES" , devicetree@vger.kernel.org, "moderated list:BROADCOM BCM2835 ARM ARCHITECTURE" , Florian Fainelli , Andrew Morton , Frank Rowand , Eric Anholt , Marc Zyngier , Catalin Marinas , Will Deacon , "linux-kernel@vger.kernel.org" , linux-mm@kvack.org, Linux IOMMU , Matthias Brugger , Stefan Wahren , linux-riscv@lists.infradead.org, Robin Murphy , Christoph Hellwig , "moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE" , phill@raspberryi.org X-BeenThere: iommu@lists.linux-foundation.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Development issues for Linux IOMMU support List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: iommu-bounces@lists.linux-foundation.org Errors-To: iommu-bounces@lists.linux-foundation.org On Tue, Aug 20, 2019 at 9:58 AM Nicolas Saenz Julienne wrote: > > Some devices might have weird DMA addressing limitations that only apply > to a subset of the available peripherals. For example the Raspberry Pi 4 > has two interconnects, one able to address the whole lower 4G memory > area and another one limited to the lower 1G. > > Being an uncommon situation we simply hardcode the device wide DMA > addressable memory size conditionally to the machine compatible name and > set 'dma_zone_size' accordingly. > > Signed-off-by: Nicolas Saenz Julienne > > --- > > Changes in v2: > - New approach to getting dma_zone_size, instead of parsing the dts we > hardcode it conditionally to the machine compatible name. > > drivers/of/fdt.c | 8 ++++++++ > 1 file changed, 8 insertions(+) > > diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c > index 06ffbd39d9af..f756e8c05a77 100644 > --- a/drivers/of/fdt.c > +++ b/drivers/of/fdt.c > @@ -27,6 +27,7 @@ > > #include /* for COMMAND_LINE_SIZE */ > #include > +#include /* for dma_zone_size */ > > #include "of_private.h" > > @@ -1195,6 +1196,12 @@ void __init early_init_dt_scan_nodes(void) > of_scan_flat_dt(early_init_dt_scan_memory, NULL); > } > > +void __init early_init_dt_get_dma_zone_size(void) static With that, Reviewed-by: Rob Herring > +{ > + if (of_fdt_machine_is_compatible("brcm,bcm2711")) > + dma_zone_size = 0x3c000000; > +} > + > bool __init early_init_dt_scan(void *params) > { > bool status; > @@ -1204,6 +1211,7 @@ bool __init early_init_dt_scan(void *params) > return false; > > early_init_dt_scan_nodes(); > + early_init_dt_get_dma_zone_size(); > return true; > } > > -- > 2.22.0 > _______________________________________________ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu