From patchwork Wed Dec 7 06:08:29 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Ungerer X-Patchwork-Id: 9463983 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 6D3FE60459 for ; Wed, 7 Dec 2016 06:11:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5214F28448 for ; Wed, 7 Dec 2016 06:11:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 44456284B3; Wed, 7 Dec 2016 06:11:34 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id AB3C128448 for ; Wed, 7 Dec 2016 06:11:33 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1cEVQb-0004KE-Sn; Wed, 07 Dec 2016 06:10:05 +0000 Received: from icp-osb-irony-out2.external.iinet.net.au ([203.59.1.155]) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1cEVQL-000417-8L for linux-arm-kernel@lists.infradead.org; Wed, 07 Dec 2016 06:09:49 +0000 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2DwBABqpkdY/zXSMGdeHAEBBAEBCgEBgzkBAQEBAR+BYKM0BpQMgg+CBxmGCQKCJEATAQIBAQEBAQEBYiiEaQZ5EBgnElcZiG6rNCoCixEBMIV0ijmFFQWaZpEaiieGFpIRIAE1eBMOg1wcgW8sNIlGAQEB X-IPAS-Result: A2DwBABqpkdY/zXSMGdeHAEBBAEBCgEBgzkBAQEBAR+BYKM0BpQMgg+CBxmGCQKCJEATAQIBAQEBAQEBYiiEaQZ5EBgnElcZiG6rNCoCixEBMIV0ijmFFQWaZpEaiieGFpIRIAE1eBMOg1wcgW8sNIlGAQEB X-IronPort-AV: E=Sophos;i="5.33,310,1477929600"; d="scan'208";a="581573884" Received: from unknown (HELO goober.accelecon.com) ([103.48.210.53]) by icp-osb-irony-out2.iinet.net.au with ESMTP; 07 Dec 2016 14:09:21 +0800 From: Greg Ungerer To: linux-arm-kernel@lists.infradead.org Subject: [PATCH 1/4] ARM: versatile: support no-MMU mode addressing Date: Wed, 7 Dec 2016 16:08:29 +1000 Message-Id: <1481090912-29835-2-git-send-email-gerg@uclinux.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1481090912-29835-1-git-send-email-gerg@uclinux.org> References: <1481090912-29835-1-git-send-email-gerg@uclinux.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20161206_220949_545289_2FCE2069 X-CRM114-Status: UNSURE ( 6.27 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: wangkefeng.wang@huawei.com, arnd@arndb.de, linus.walleij@linaro.org, nicolas.ferre@atmel.com, linux@armlinux.org.uk, Greg Ungerer MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Currently for the versatile boards the IO_ADDRESS() macro applies static virtual address mapping for built-in IO devices. When operating without the MMU enabled IO devices are accessed at their physical address, no address translation is required. For the !CONFIG_MMU case then define the IO_ADDRESS() macro to return the physical address. Signed-off-by: Greg Ungerer --- arch/arm/mach-versatile/versatile_dt.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/arch/arm/mach-versatile/versatile_dt.c b/arch/arm/mach-versatile/versatile_dt.c index 3c8d39c..8cfa05a 100644 --- a/arch/arm/mach-versatile/versatile_dt.c +++ b/arch/arm/mach-versatile/versatile_dt.c @@ -37,7 +37,11 @@ #include /* macro to get at MMIO space when running virtually */ +#ifdef CONFIG_MMU #define IO_ADDRESS(x) (((x) & 0x0fffffff) + (((x) >> 4) & 0x0f000000) + 0xf0000000) +#else +#define IO_ADDRESS(x) (x) +#endif #define __io_address(n) ((void __iomem __force *)IO_ADDRESS(n)) /*