Message ID | 20190820145821.27214-8-nsaenzjulienne@suse.de (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <SRS0=T644=WQ=lists.infradead.org=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@kernel.org> 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 D3C3514DB for <patchwork-linux-arm@patchwork.kernel.org>; Tue, 20 Aug 2019 15:01:01 +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 B14AC22DA9 for <patchwork-linux-arm@patchwork.kernel.org>; Tue, 20 Aug 2019 15:01:01 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="A/N4Jt/H" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B14AC22DA9 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=bombadil.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=whs7Wnx5p6y/wzbhPAmeKl9+J0TGGu5QnkXfBi4OHbc=; b=A/N4Jt/HGStx4s sRq/IEJWVDF+OlA+WuSmUxHAMtCUMgLMqhXwB+idBSOwFpfnnLQOn5WRbDTvvYKDtfop1m6EI6mb2 g/j6RAI2hkrlr33NggDwpzpHfnVEoSCitlYR0tT1xc+dkYqm1Z3djae0LKqIPO5DgnaXXLMlMZBuU B9H2RZ1KmZ0+TlJbH5nCYDaBtDV1gt50D3Hc9hCG7lEZdxB7odrWPOHAV4AXf7URCVikEoIkXTVlq Z/LAhYQ/FXkehBe/9//IwRfAf98H4C+h75O/P3F6cJXV3QKuPpsLG9pw2X61czdH9Qz40akA/lRoz O1egTSG0REbRVxeOO3Ag==; 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 1i05d6-0008Os-T5; Tue, 20 Aug 2019 15:01:01 +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 1i05ap-00053k-KY; Tue, 20 Aug 2019 14:58:41 +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 31A5AAFA5; Tue, 20 Aug 2019 14:58:38 +0000 (UTC) From: Nicolas Saenz Julienne <nsaenzjulienne@suse.de> To: catalin.marinas@arm.com, hch@lst.de, wahrenst@gmx.net, marc.zyngier@arm.com, robh+dt@kernel.org, Robin Murphy <robin.murphy@arm.com>, 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, linux-kernel@vger.kernel.org Subject: [PATCH v2 07/11] arm64: re-introduce max_zone_dma_phys() Date: Tue, 20 Aug 2019 16:58:15 +0200 Message-Id: <20190820145821.27214-8-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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190820_075839_919103_A4B5A0A4 X-CRM114-Status: UNSURE ( 7.81 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.3 (--) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-2.3 points) pts rule name description ---- ---------------------- -------------------------------------------------- -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_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: <linux-arm-kernel.lists.infradead.org> List-Unsubscribe: <http://lists.infradead.org/mailman/options/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=unsubscribe> List-Archive: <http://lists.infradead.org/pipermail/linux-arm-kernel/> List-Post: <mailto:linux-arm-kernel@lists.infradead.org> List-Help: <mailto:linux-arm-kernel-request@lists.infradead.org?subject=help> List-Subscribe: <http://lists.infradead.org/mailman/listinfo/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=subscribe> Cc: phill@raspberryi.org, f.fainelli@gmail.com, frowand.list@gmail.com, eric@anholt.net, mbrugger@suse.com, linux-rpi-kernel@lists.infradead.org, akpm@linux-foundation.org, will@kernel.org, nsaenzjulienne@suse.de, m.szyprowski@samsung.com Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" <linux-arm-kernel-bounces@lists.infradead.org> Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org |
Series |
Raspberry Pi 4 DMA addressing support
|
expand
|
diff --git a/arch/arm64/mm/init.c b/arch/arm64/mm/init.c index 8956c22634dd..bc7999020c71 100644 --- a/arch/arm64/mm/init.c +++ b/arch/arm64/mm/init.c @@ -174,6 +174,17 @@ static phys_addr_t __init max_zone_dma32_phys(void) return min(offset + (1ULL << 32), memblock_end_of_DRAM()); } +static phys_addr_t __init max_zone_dma_phys(void) + +{ + phys_addr_t offset = memblock_start_of_DRAM() & GENMASK_ULL(63, 32); + + if (dma_zone_size) + return min(offset + dma_zone_size, memblock_end_of_DRAM()); + else + return max_zone_dma32_phys(); +} + #ifdef CONFIG_NUMA static void __init zone_sizes_init(unsigned long min, unsigned long max)
Some devices might have multiple interconnects with different DMA addressing limitations. This function provides the higher physical address accessible by all peripherals on the SoC. If such limitation doesn't exist it'll return the maximum physical address of the 32 bit addressable area. Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de> --- Changes in v2: - Update function's behavior to fit new dma zones split - Use dma_zone_size - Take into account devices with a hardcoded DMA offset arch/arm64/mm/init.c | 11 +++++++++++ 1 file changed, 11 insertions(+)