From patchwork Thu Oct 1 16:17:37 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Saenz Julienne X-Patchwork-Id: 11811857 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id CEACA139A for ; Thu, 1 Oct 2020 16:19:35 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (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 9A5812145D for ; Thu, 1 Oct 2020 16:19:35 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="wPBMTVFx" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9A5812145D 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+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=cXHVgADbLGLPha++FV7lJr8iG2KWRg+tqhTbs23F0w4=; b=wPBMTVFxjfxBFyeIx9LiT/AXU +Zbn0FqaqwgZGWDY6R4fG/a3v8MmDuiRtrGeeU151lYq1LSgAYLQWlrc547rcj7hTWOVxIb23ooBy kE046TOSeQWMDRR58rfQPgeu1s8lZu2wpvnOH/JJAPg7t6GllYnf0J9Gt977VLUYN6Oe5NkK7UcN+ S8NW3/4E/zjDQUl5TDWcImWVRvPbxrnFgoITDOVGoxPYgAYIuVvksXqtQDXRUCj4O0re8TM27MWdA x9+RvjzFUr20gavKTtew/0J/b23Fq1PN8H3yZg2w9+Mg9fVpMwv3VQ7aLn/g2wf5TdtLF+fTIm8vu VUhJtqqtA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kO1Hb-0004XG-2d; Thu, 01 Oct 2020 16:18:15 +0000 Received: from mx2.suse.de ([195.135.220.15]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kO1HL-0004Ov-E6; Thu, 01 Oct 2020 16:18:01 +0000 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 355AFAF55; Thu, 1 Oct 2020 16:17:55 +0000 (UTC) From: Nicolas Saenz Julienne To: robh+dt@kernel.org, catalin.marinas@arm.com, hch@lst.de, robin.murphy@arm.com, devicetree@vger.kernel.org, iommu@lists.linux-foundation.org, linux-mm@kvack.org, Frank Rowand Subject: [PATCH 1/4] of/fdt: Update zone_dma_bits when running in bcm2711 Date: Thu, 1 Oct 2020 18:17:37 +0200 Message-Id: <20201001161740.29064-2-nsaenzjulienne@suse.de> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201001161740.29064-1-nsaenzjulienne@suse.de> References: <20201001161740.29064-1-nsaenzjulienne@suse.de> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201001_121759_672435_E861F21E X-CRM114-Status: GOOD ( 14.67 ) X-Spam-Score: -2.3 (--) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-2.3 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [195.135.220.15 listed in wl.mailspike.net] -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [195.135.220.15 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.0 RCVD_IN_MSPIKE_WL Mailspike good senders 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: Nicolas Saenz Julienne , will@kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rpi-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org arm64 wants to be able to set ZONE_DMA's size depending on the specific platform its being run on. Ideally this could be achieved in a smart way by parsing all dma-ranges and calculating the smaller DMA constraint in the system. Easier said than done. We compromised on a simpler solution as the only platform interested in using this is the Raspberry Pi 4. So update zone_dma_bits if the machine's compatible string matches Raspberry Pi 4's, otherwise let arm64's mm code deal with it. Signed-off-by: Nicolas Saenz Julienne Reviewed-by: Rob Herring --- drivers/of/fdt.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c index 4602e467ca8b..cd0d115ef329 100644 --- a/drivers/of/fdt.c +++ b/drivers/of/fdt.c @@ -25,6 +25,7 @@ #include #include #include +#include /* for zone_dma_bits */ #include /* for COMMAND_LINE_SIZE */ #include @@ -1198,6 +1199,14 @@ void __init early_init_dt_scan_nodes(void) of_scan_flat_dt(early_init_dt_scan_memory, NULL); } +void __init early_init_dt_update_zone_dma_bits(void) +{ + unsigned long dt_root = of_get_flat_dt_root(); + + if (of_flat_dt_is_compatible(dt_root, "brcm,bcm2711")) + zone_dma_bits = 30; +} + bool __init early_init_dt_scan(void *params) { bool status; @@ -1207,6 +1216,7 @@ bool __init early_init_dt_scan(void *params) return false; early_init_dt_scan_nodes(); + early_init_dt_update_zone_dma_bits(); return true; }