From patchwork Fri Jan 31 12:08:05 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Simek X-Patchwork-Id: 3561401 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id DDA339F2E9 for ; Fri, 31 Jan 2014 12:08:51 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1275A2020E for ; Fri, 31 Jan 2014 12:08:51 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C9FAE20200 for ; Fri, 31 Jan 2014 12:08:49 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1W9Ctp-0000cQ-6t; Fri, 31 Jan 2014 12:08:45 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1W9Ctm-0006AU-PC; Fri, 31 Jan 2014 12:08:42 +0000 Received: from mail-ee0-f48.google.com ([74.125.83.48]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1W9Ctj-00069r-4p for linux-arm-kernel@lists.infradead.org; Fri, 31 Jan 2014 12:08:40 +0000 Received: by mail-ee0-f48.google.com with SMTP id t10so2201920eei.7 for ; Fri, 31 Jan 2014 04:08:15 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :content-type; bh=u4i9kZC4M/JfESN4qRRyWVJb5pD2T2AKdOEFd/d1bao=; b=mUAJo2ANy3jYru0NZ9jUbaxZde3wuEAqJcc0BtCXAQsz8heMhlu4g7mR+AJ0jucbex pXhHFCGs0HSCU27+e9S+w4HC2YxsAvlmflfoZeImZFJZezptbJHvU53kpTF1AV0O/pZ1 zqL8g39guZ1dGkU/8HUHadOLWvMG3YNDOItQUG/Gzm20cK8UR4cRfctoLvEnEWXw+No4 9dHY4naZBtBoFs/nRW6hsweGfwlOiXWPukMWSzummLYTsCTdCCHR8puuPdPjfAXUlBFb DU6opiaACjVeMQVUz/rY+ri/G4pVIZdishRm3JB9eo08080n0mVgiVYU/QK6qf6MTdXx teOQ== X-Gm-Message-State: ALoCoQmUdQdpbHo8Agu7HUy4URdx5pBli/SWKEEJ1aOyRLuQ3OkJ2dJMQyyWl7vCtNXBy6c9rRSm X-Received: by 10.15.75.67 with SMTP id k43mr17517841eey.59.1391170095665; Fri, 31 Jan 2014 04:08:15 -0800 (PST) Received: from localhost (nat-63.starnet.cz. [178.255.168.63]) by mx.google.com with ESMTPSA id g1sm35478426eet.6.2014.01.31.04.08.14 for (version=TLSv1.1 cipher=RC4-SHA bits=128/128); Fri, 31 Jan 2014 04:08:14 -0800 (PST) From: Michal Simek To: Jason Gunthorpe , Guennadi Liakhovetski , Russell King - ARM Linux Subject: [PATCH] ARM: zynq: Reserve not DMAable space in front of the kernel Date: Fri, 31 Jan 2014 13:08:05 +0100 Message-Id: <780bb8c8fd752eeace2fd2fbe1d8ed8572dc0d76.1391170073.git.michal.simek@xilinx.com> X-Mailer: git-send-email 1.8.2.3 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140131_070839_299315_A1405D00 X-CRM114-Status: GOOD ( 18.55 ) X-Spam-Score: -1.9 (-) Cc: Josh Cartwright , monstr@monstr.eu, Peter Crosthwaite , linux-kernel@vger.kernel.org, Steffen Trumtrar , linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.8 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_TVD_MIME_NO_HEADERS, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Reserve space from 0x0 - __pa(swapper_pg_dir), if kernel is loaded from 0, which is not DMAable. It is causing problem with MMC driver and others which want to add dma buffers to this space. Signed-off-by: Michal Simek --- Jason: I don't think it is worth to bring 0x8000 magic value and count minimum from it and phys_addr of swapper_pg_dir. Full 512k of memory shouldn't be used by DMA. --- arch/arm/mach-zynq/common.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) -- 1.8.2.3 diff --git a/arch/arm/mach-zynq/common.c b/arch/arm/mach-zynq/common.c index 1db2a5ca..8c09a83 100644 --- a/arch/arm/mach-zynq/common.c +++ b/arch/arm/mach-zynq/common.c @@ -25,6 +25,7 @@ #include #include #include +#include #include #include @@ -41,6 +42,18 @@ void __iomem *zynq_scu_base; +/** + * zynq_memory_init - Initialize special memory + * + * We need to stop things allocating the low memory as DMA can't work in + * the 1st 512K of memory. + */ +static void __init zynq_memory_init(void) +{ + if (!__pa(PAGE_OFFSET)) + memblock_reserve(__pa(PAGE_OFFSET), __pa(swapper_pg_dir)); +} + static struct platform_device zynq_cpuidle_device = { .name = "cpuidle-zynq", }; @@ -117,5 +130,6 @@ DT_MACHINE_START(XILINX_EP107, "Xilinx Zynq Platform") .init_machine = zynq_init_machine, .init_time = zynq_timer_init, .dt_compat = zynq_dt_match, + .reserve = zynq_memory_init, .restart = zynq_system_reset, MACHINE_END