From patchwork Fri Feb 14 10:29:31 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 3651721 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 264DF9F382 for ; Fri, 14 Feb 2014 10:34:09 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 737212020F for ; Fri, 14 Feb 2014 10:34:04 +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 62CAF201C7 for ; Fri, 14 Feb 2014 10:34:03 +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 1WEG3S-000804-L7; Fri, 14 Feb 2014 10:31:35 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1WEG37-0004kJ-KF; Fri, 14 Feb 2014 10:31:13 +0000 Received: from mail-wi0-f174.google.com ([209.85.212.174]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WEG2V-0004c6-8H for linux-arm-kernel@lists.infradead.org; Fri, 14 Feb 2014 10:30:38 +0000 Received: by mail-wi0-f174.google.com with SMTP id f8so309777wiw.13 for ; Fri, 14 Feb 2014 02:30:12 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=aqfaUav6VeV4FC9gnvzOYOueaNhcjxZHuzd2MoG+SnQ=; b=g16VQcyOUgS0ck/rc8jE6RdYh6gJGR2gdu7btvOUIHvOcOxZfM4kb4P6J4ouF3urKg js2ne836Xwq2lfPj/8Vvwvmcn0rSvZVK8AZJ7yTfMTc5HdHbQUOagpSCnEAlHMMEJ43d t6Zs8RAkSyzXb740bfubZP9onE4YF3Ie9e6PrKGJHzPIhKN9093O0qHzvaWPRztd7rhf mZ6W6Bry463XEJSOIqNs0bCF5PGhVBUyPPgqSgq3YoN0gUOggF5y4U5erB0VYROCNfS5 HMt8D4skVD0uewgerQsfDuyPmEMwHn1SzJDSPvyregRp9yuGSLEfum1UwT+CxUhZTvpq 7Vtw== X-Gm-Message-State: ALoCoQlcGIoL3xVuas4BQUmENk7+ZRRk0oj8hasYyVupwe2jbjx1urrlWbUW2zbjJKQKVXvW6FR4 X-Received: by 10.180.72.195 with SMTP id f3mr1470502wiv.61.1392373812051; Fri, 14 Feb 2014 02:30:12 -0800 (PST) Received: from localhost.localdomain ([85.235.11.236]) by mx.google.com with ESMTPSA id t6sm3227388wix.4.2014.02.14.02.30.10 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 14 Feb 2014 02:30:11 -0800 (PST) From: Linus Walleij To: linux-arm-kernel@lists.infradead.org, Will Deacon , Jonathan Austin Subject: [PATCH 6/6] RFC: ARM: integrator: get rid of Date: Fri, 14 Feb 2014 11:29:31 +0100 Message-Id: <1392373771-17303-7-git-send-email-linus.walleij@linaro.org> X-Mailer: git-send-email 1.8.5.3 In-Reply-To: <1392373771-17303-1-git-send-email-linus.walleij@linaro.org> References: <1392373771-17303-1-git-send-email-linus.walleij@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140214_053035_489436_C3DE704F X-CRM114-Status: GOOD ( 20.55 ) X-Spam-Score: -2.6 (--) Cc: Linus Walleij , Russell King , Arnd Bergmann 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, 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 The Integrator has a custom header defining the BUS_OFFSET for *_to_bus and bus_to_* operations as offset from 0x80000000. I have searched the documentation and cannot find any clue to this set-up. The Integrators have no intrinsic DMA engine(s) that need to perform any bus translations. The only thing I can think of is the PCIv3 host found in the Integrator/AP. After searching its documentation I cannot find any hint whatsoever saying that it would perform DMA operations to memory offset to 0x80000000. The PCIv3 driver does not configure anything for DMA, and the hardware contains registers to configure the local (CPU) side address translation. When I dump the default values of these registers (the Linux driver does not touch them) they contain zeroes meaning a 1-to-1 mapping to the bus. So patch the mapping to use the kernel default. Cc: Will Deacon Cc: Jonathan Austin Cc: Russell King Signed-off-by: Linus Walleij --- Admittedly I'm not certain about how DMA works in PCI scenarios (only experienced with DMA engines) so some input here would be appreciated. Like if DMA support is compulory for PCI hosts or if it's somehow even unused on the PCIv3. And if someone has ever tested some DMA:ing PCI card on this machine. --- arch/arm/Kconfig | 1 - arch/arm/mach-integrator/include/mach/memory.h | 34 -------------------------- 2 files changed, 35 deletions(-) delete mode 100644 arch/arm/mach-integrator/include/mach/memory.h diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index e25419817791..c4094131314e 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -325,7 +325,6 @@ config ARCH_INTEGRATOR select HAVE_TCM select ICST select MULTI_IRQ_HANDLER - select NEED_MACH_MEMORY_H select PLAT_VERSATILE select SPARSE_IRQ select USE_OF diff --git a/arch/arm/mach-integrator/include/mach/memory.h b/arch/arm/mach-integrator/include/mach/memory.h deleted file mode 100644 index 334d5e271889..000000000000 --- a/arch/arm/mach-integrator/include/mach/memory.h +++ /dev/null @@ -1,34 +0,0 @@ -/* - * arch/arm/mach-integrator/include/mach/memory.h - * - * Copyright (C) 1999 ARM Limited - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ -#ifndef __ASM_ARCH_MEMORY_H -#define __ASM_ARCH_MEMORY_H - -/* - * Physical DRAM offset. - */ -#define PLAT_PHYS_OFFSET UL(0x00000000) - -#define BUS_OFFSET UL(0x80000000) -#define __virt_to_bus(x) ((x) - PAGE_OFFSET + BUS_OFFSET) -#define __bus_to_virt(x) ((x) - BUS_OFFSET + PAGE_OFFSET) -#define __pfn_to_bus(x) (__pfn_to_phys(x) + (BUS_OFFSET - PHYS_OFFSET)) -#define __bus_to_pfn(x) __phys_to_pfn((x) - (BUS_OFFSET - PHYS_OFFSET)) - -#endif