From patchwork Sun Sep 13 13:40:04 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Chou X-Patchwork-Id: 517178 X-Patchwork-Delegate: thomas@wytron.com.tw Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id CE4DF1402A6 for ; Sun, 13 Sep 2015 23:40:33 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 64C1E4B77D; Sun, 13 Sep 2015 15:40:28 +0200 (CEST) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id PxJN6iBV0OUB; Sun, 13 Sep 2015 15:40:28 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id E92694B77E; Sun, 13 Sep 2015 15:40:22 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 3866E4B742 for ; Sun, 13 Sep 2015 15:40:17 +0200 (CEST) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id lKrM8tOSNvKq for ; Sun, 13 Sep 2015 15:40:17 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from www.wytron.com.tw (220-134-43-68.HINET-IP.hinet.net [220.134.43.68]) by theia.denx.de (Postfix) with ESMTP id 99B2D4B739 for ; Sun, 13 Sep 2015 15:40:13 +0200 (CEST) Received: from localhost.localdomain (unknown [192.168.1.250]) by www.wytron.com.tw (Postfix) with ESMTP id EEC47D0032A; Sun, 13 Sep 2015 21:40:09 +0800 (CST) From: Thomas Chou To: u-boot@lists.denx.de Date: Sun, 13 Sep 2015 21:40:04 +0800 Message-Id: <1442151606-10266-2-git-send-email-thomas@wytron.com.tw> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1442151606-10266-1-git-send-email-thomas@wytron.com.tw> References: <1442133130-11174-1-git-send-email-thomas@wytron.com.tw> <1442151606-10266-1-git-send-email-thomas@wytron.com.tw> Cc: Marek Vasut , clsee@altera.com, lftan@altera.com Subject: [U-Boot] [PATCH v2 1/3] nios2: map physical address to uncached virtual address X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Add ioremap() to map physical address to uncached virtual address. We need this to convert the reg address from the device tree. The order of headers inclusion in interrupts.c is changed because common.h will include board header that contains IO_REGION_BASE. In the future, the IO_REGION_BASE should be decided from the device tree. Signed-off-by: Thomas Chou Acked-by: Marek Vasut Reviewed-by: Simon Glass --- arch/nios2/cpu/interrupts.c | 4 ++-- arch/nios2/include/asm/io.h | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/arch/nios2/cpu/interrupts.c b/arch/nios2/cpu/interrupts.c index 9d85eb0..1599674 100644 --- a/arch/nios2/cpu/interrupts.c +++ b/arch/nios2/cpu/interrupts.c @@ -8,12 +8,12 @@ * SPDX-License-Identifier: GPL-2.0+ */ +#include +#include #include #include #include #include -#include -#include /*************************************************************************/ struct irq_action { diff --git a/arch/nios2/include/asm/io.h b/arch/nios2/include/asm/io.h index 69ab23e..b4bd20f 100644 --- a/arch/nios2/include/asm/io.h +++ b/arch/nios2/include/asm/io.h @@ -42,6 +42,11 @@ static inline phys_addr_t virt_to_phys(void * vaddr) return (phys_addr_t)(vaddr); } +static inline void *ioremap(unsigned long physaddr, unsigned long size) +{ + return (void *)(IO_REGION_BASE | physaddr); +} + extern unsigned char inb (unsigned char *port); extern unsigned short inw (unsigned short *port); extern unsigned inl (unsigned port);