From patchwork Tue Jan 21 06:23:06 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Sangorrin X-Patchwork-Id: 3515501 Return-Path: X-Original-To: patchwork-ltsi-dev@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 C43469F2D6 for ; Tue, 21 Jan 2014 06:24:13 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0BD2B20155 for ; Tue, 21 Jan 2014 06:24:13 +0000 (UTC) Received: from mail.linuxfoundation.org (mail.linuxfoundation.org [140.211.169.12]) by mail.kernel.org (Postfix) with ESMTP id 2C7BC20148 for ; Tue, 21 Jan 2014 06:24:12 +0000 (UTC) Received: from mail.linux-foundation.org (localhost [IPv6:::1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 2435626; Tue, 21 Jan 2014 06:24:12 +0000 (UTC) X-Original-To: ltsi-dev@lists.linuxfoundation.org Delivered-To: ltsi-dev@mail.linuxfoundation.org Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTP id 9BDB921 for ; Tue, 21 Jan 2014 06:24:10 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from imx12.toshiba.co.jp (imx12.toshiba.co.jp [61.202.160.132]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id C73341FA85 for ; Tue, 21 Jan 2014 06:23:27 +0000 (UTC) Received: from tsbmgw-mgw01.tsbmgw-mgw01.toshiba.co.jp ([133.199.232.103]) by imx12.toshiba.co.jp with ESMTP id s0L6N9sR012942 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 21 Jan 2014 15:23:14 +0900 (JST) Received: from tsbmgw-mgw01 (localhost [127.0.0.1]) by tsbmgw-mgw01.tsbmgw-mgw01.toshiba.co.jp (8.13.8/8.14.5) with ESMTP id s0L6N85O028577; Tue, 21 Jan 2014 15:23:08 +0900 Received: from localhost ([127.0.0.1]) by tsbmgw-mgw01 (JAMES SMTP Server 2.3.1) with SMTP ID 197; Tue, 21 Jan 2014 15:23:08 +0900 (JST) Received: from arc11.toshiba.co.jp ([133.199.90.127]) by tsbmgw-mgw01.tsbmgw-mgw01.toshiba.co.jp (8.13.8/8.14.5) with ESMTP id s0L6N8lL028562; Tue, 21 Jan 2014 15:23:08 +0900 Received: (from root@localhost) by arc11.toshiba.co.jp id s0L6N81E021773; Tue, 21 Jan 2014 15:23:08 +0900 (JST) Received: from ovp11.toshiba.co.jp [133.199.90.148] by arc11.toshiba.co.jp with ESMTP id RAA21766; Tue, 21 Jan 2014 15:23:08 +0900 Received: from mx2.toshiba.co.jp (localhost [127.0.0.1]) by ovp11.toshiba.co.jp with ESMTP id s0L6N886020746; Tue, 21 Jan 2014 15:23:08 +0900 (JST) Received: from BK2211.rdc.toshiba.co.jp by toshiba.co.jp id s0L6N7mK016796; Tue, 21 Jan 2014 15:23:07 +0900 (JST) Received: from island.swc.toshiba.co.jp (localhost [127.0.0.1]) by BK2211.rdc.toshiba.co.jp (8.13.8+Sun/8.13.8) with ESMTP id s0L6MOIq024481; Tue, 21 Jan 2014 15:22:24 +0900 (JST) Received: from ubuntu.swc.toshiba.co.jp (unknown [133.196.174.184]) by island.swc.toshiba.co.jp (Postfix) with ESMTP id 4FEC040004; Tue, 21 Jan 2014 15:22:10 +0900 (JST) From: Daniel Sangorrin To: ltsi-dev@lists.linuxfoundation.org Date: Tue, 21 Jan 2014 15:23:06 +0900 Message-Id: <1390285387-30514-3-git-send-email-daniel.sangorrin@toshiba.co.jp> X-Mailer: git-send-email 1.8.5 In-Reply-To: <1390285387-30514-1-git-send-email-daniel.sangorrin@toshiba.co.jp> References: <1390285387-30514-1-git-send-email-daniel.sangorrin@toshiba.co.jp> X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org Cc: michal.simek@xilinx.com Subject: [LTSI-dev] [PATCH 1/2] Xilinx: ARM: BSP: prevent DMA into lower memory X-BeenThere: ltsi-dev@lists.linuxfoundation.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: "A list to discuss patches, development, and other things related to the LTSI project" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: ltsi-dev-bounces@lists.linuxfoundation.org Errors-To: ltsi-dev-bounces@lists.linuxfoundation.org X-Virus-Scanned: ClamAV using ClamSMTP From: John Linn The DMA zone from 2.6.39 is no longer supported such that a new method was needed. The old method was lost in the move to 3.0 and USB was seeing failures. (commit 83e198c01c381a1d90ba07e241a517d1dabf7c84 in Xilinx repository) Signed-off-by: Daniel Sangorrin Signed-off-by: Yoshitake Kobayashi --- arch/arm/mach-zynq/common.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/arch/arm/mach-zynq/common.c b/arch/arm/mach-zynq/common.c index 94a248b..5d0676c 100644 --- a/arch/arm/mach-zynq/common.c +++ b/arch/arm/mach-zynq/common.c @@ -25,7 +25,7 @@ #include #include #include - +#include #include #include #include @@ -39,6 +39,22 @@ 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. Using reserve vs remove is not totally clear yet. + */ +static void __init zynq_memory_init(void) +{ + /* + * Reserve the 0-0x4000 addresses (before page tables and kernel) + * which can't be used for DMA + */ + if (!__pa(PAGE_OFFSET)) + memblock_reserve(0, 0x4000); +} + static struct of_device_id zynq_of_bus_ids[] __initdata = { { .compatible = "simple-bus", }, {} @@ -113,5 +129,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