Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp4169907ybl; Tue, 20 Aug 2019 07:59:49 -0700 (PDT) X-Google-Smtp-Source: APXvYqxPgw4HC45kLVw+Bj4qNMEkwd10cJ81kP4UOCZcv9B8fx3gR06ynSId8o5G5vZQmzw6LC04 X-Received: by 2002:a63:460c:: with SMTP id t12mr24825079pga.69.1566313189409; Tue, 20 Aug 2019 07:59:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566313189; cv=none; d=google.com; s=arc-20160816; b=OfnVuEg8MqH2ayzVllRyAozy7GElSZ+EllO6jUwM4daa1ZLDcbMwfWu35JtMir1yjC RDXdhyUT2HmxRka10xPHRLUkRzuWII1GiOULsp96XcgtgVAuhDM2iMNcfW9CmCWbIFA3 GyMj+V8w2DEtQW0DsBAu/UuUQXfUTNgID9+GkwNhwWwYEyOtBChSmK7r7bye4Tf1HV33 sR/9cwsXCU1+uUhoxRyj9+wEh8ZNLYHHhjRxab36HAfp8k1AkX7GLptTjTXwK0N9vb70 nmD7FkS1i3VtXki3lNCVnrLeWtCcWeocADEbRm+4zbTghHmHxNiV1J7K0888qakNAI7d d4Xg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=Xh4FC6lwHL6qWTOVo2G5xrQfW9u4vFeJCBNUxfuZF0g=; b=daxbEWQMqhpI+y0LkPWZuqp0wXMCa8pg56C22pTilCXzwTGov66U9V+4qCPaWOYtt/ 481fISLc/TjXUEtZwGccM670U6Z+yngw4fqUVW+FQKuG2Rt0Fg/P3Y7u88KJvyktY//e ijMxPzeBNOqopBHkpnURziisefYgQOTm1IjYj4f7mcFBeUT59llhs1ptng/nh3cATfv/ X298nXBNqZmcHxPDlF+7I5OGzE/C7Xxy5lcsC+WpE4cJvEkjjE45SF6SuwwpufLBeyFi h8PFVJaUMyAw57oinfe3jbHLxLsR3kQkBh3duZue8j1J7gXHSD2O2xCOSbnmpf01Tfyz HI2Q== ARC-Authentication-Results: i=1; mx.google.com; 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 y5si140799pjv.25.2019.08.20.07.59.34; Tue, 20 Aug 2019 07:59:49 -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; 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 S1730389AbfHTO6k (ORCPT + 99 others); Tue, 20 Aug 2019 10:58:40 -0400 Received: from mx2.suse.de ([195.135.220.15]:59720 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726345AbfHTO6f (ORCPT ); Tue, 20 Aug 2019 10:58:35 -0400 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 292BEAFCB; Tue, 20 Aug 2019 14:58:34 +0000 (UTC) From: Nicolas Saenz Julienne To: catalin.marinas@arm.com, hch@lst.de, wahrenst@gmx.net, marc.zyngier@arm.com, robh+dt@kernel.org, Robin Murphy , linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-arch@vger.kernel.org, iommu@lists.linux-foundation.org, linux-mm@kvack.org, linux-riscv@lists.infradead.org, Frank Rowand Cc: phill@raspberryi.org, f.fainelli@gmail.com, will@kernel.org, nsaenzjulienne@suse.de, linux-kernel@vger.kernel.org, eric@anholt.net, mbrugger@suse.com, linux-rpi-kernel@lists.infradead.org, akpm@linux-foundation.org, m.szyprowski@samsung.com Subject: [PATCH v2 04/11] of/fdt: add early_init_dt_get_dma_zone_size() Date: Tue, 20 Aug 2019 16:58:12 +0200 Message-Id: <20190820145821.27214-5-nsaenzjulienne@suse.de> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190820145821.27214-1-nsaenzjulienne@suse.de> References: <20190820145821.27214-1-nsaenzjulienne@suse.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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) +{ + 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