[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAL_Jsq+Nr88Nvd_ZA8eJGm4xLwssv7CnDJLsnZyFqiM=EQWYxg@mail.gmail.com>
Date: Tue, 20 Aug 2019 12:14:16 -0500
From: Rob Herring <robh+dt@...nel.org>
To: Nicolas Saenz Julienne <nsaenzjulienne@...e.de>
Cc: Catalin Marinas <catalin.marinas@....com>,
Christoph Hellwig <hch@....de>,
Stefan Wahren <wahrenst@....net>,
Marc Zyngier <marc.zyngier@....com>,
Robin Murphy <robin.murphy@....com>,
"moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE"
<linux-arm-kernel@...ts.infradead.org>, devicetree@...r.kernel.org,
"open list:GENERIC INCLUDE/ASM HEADER FILES"
<linux-arch@...r.kernel.org>,
Linux IOMMU <iommu@...ts.linux-foundation.org>,
linux-mm@...ck.org, linux-riscv@...ts.infradead.org,
Frank Rowand <frowand.list@...il.com>, phill@...pberryi.org,
Florian Fainelli <f.fainelli@...il.com>,
Will Deacon <will@...nel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Eric Anholt <eric@...olt.net>,
Matthias Brugger <mbrugger@...e.com>,
"moderated list:BROADCOM BCM2835 ARM ARCHITECTURE"
<linux-rpi-kernel@...ts.infradead.org>,
Andrew Morton <akpm@...ux-foundation.org>,
Marek Szyprowski <m.szyprowski@...sung.com>
Subject: Re: [PATCH v2 04/11] of/fdt: add early_init_dt_get_dma_zone_size()
On Tue, Aug 20, 2019 at 9:58 AM Nicolas Saenz Julienne
<nsaenzjulienne@...e.de> 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 <nsaenzjulienne@...e.de>
>
> ---
>
> 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 <asm/setup.h> /* for COMMAND_LINE_SIZE */
> #include <asm/page.h>
> +#include <asm/dma.h> /* 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 <robh@...nel.org>
> +{
> + 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
>
Powered by blists - more mailing lists