From patchwork Tue Jun 28 01:48:42 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 70969 Delivered-To: patch@linaro.org Received: by 10.140.28.4 with SMTP id 4csp1341231qgy; Mon, 27 Jun 2016 18:48:05 -0700 (PDT) X-Received: by 10.28.181.146 with SMTP id e140mr662887wmf.38.1467078485536; Mon, 27 Jun 2016 18:48:05 -0700 (PDT) Return-Path: Received: from theia.denx.de (theia.denx.de. [85.214.87.163]) by mx.google.com with ESMTP id m1si30812570wjd.141.2016.06.27.18.48.05; Mon, 27 Jun 2016 18:48:05 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 85.214.87.163 as permitted sender) client-ip=85.214.87.163; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@nifty.com; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 85.214.87.163 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 010E0A750E; Tue, 28 Jun 2016 03:48:03 +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 VVK-grLTpj-m; Tue, 28 Jun 2016 03:48:03 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 83309A74E3; Tue, 28 Jun 2016 03:48:03 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id DB333A74F1 for ; Tue, 28 Jun 2016 03:47:59 +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 0ldiyfo3HHDC for ; Tue, 28 Jun 2016 03:47:59 +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 conuserg-12.nifty.com (conuserg-12.nifty.com [210.131.2.79]) by theia.denx.de (Postfix) with ESMTPS id 20176A74D2 for ; Tue, 28 Jun 2016 03:47:55 +0200 (CEST) Received: from beagle.diag.org (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-12.nifty.com with ESMTP id u5S1lFlL005408; Tue, 28 Jun 2016 10:47:20 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-12.nifty.com u5S1lFlL005408 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1467078441; bh=En26C7PVStdTaGel/5fqF58g0vOJWpaUaTvk0k9r4JE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=d9rVJQXMOm4ObqRUi//Cv0qu+wpUyvxEaAythZcHFoXRifofpMvgXjYYiakIAwUfW y0Pvur9ljAk6RBV+qkImBqq5mT8pSMzIkUPFNkXcgAKRCpe0tGk0OGtgX+0ZdDypiA t/aU611Yu+iud/uj+fm1LI9BUgiuz/WNGNSz5HopBPPOQb7xKacBTcBCV74UQwbXUi BfzpgF8Xk5zRqfX95vzOHi+As3q/8U3IGHFKZ3A35HcfuPxy0iGZ80oT8nXfUQwqOr Qd2DjO8bpBkbfWPD5jl3Xqyyzu9/6WjTGMGTT1NJQvmgUXu6Z74EgIcuur1wbs217w mcNurPUUzJrkw== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: u-boot@lists.denx.de Date: Tue, 28 Jun 2016 10:48:42 +0900 Message-Id: <1467078522-24431-4-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1467078522-24431-1-git-send-email-yamada.masahiro@socionext.com> References: <1467078522-24431-1-git-send-email-yamada.masahiro@socionext.com> Cc: "angelo@sysam.it" , Purna Chandra Mandal , Kun-Hua Huang Subject: [U-Boot] [PATCH v2 3/3] linux/io.h: add generic ioremap()/iounmap() defines 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" For most of architectures in U-Boot, virtual address is straight mapped to physical address. So, it makes sense to have generic defines of ioremap and friends in . All of them are just empty and will disappear at compile time, but they will be helpful to implement drivers which are counterparts of Linux ones. I notice MIPS already has its own implementation, so I added a Kconfig symbol CONFIG_HAVE_ARCH_IOREMAP which MIPS (and maybe Sandbox as well) can select. Signed-off-by: Masahiro Yamada --- Changes in v2: - Use #ifndef CONFIG_HAVE_ARCH_IOREMAP instead of #ifndef CONFIG_MIPS arch/Kconfig | 4 ++++ include/linux/io.h | 16 ++++++++++++++++ 2 files changed, 20 insertions(+) -- 1.9.1 _______________________________________________ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot diff --git a/arch/Kconfig b/arch/Kconfig index 566f044..8090a45 100644 --- a/arch/Kconfig +++ b/arch/Kconfig @@ -1,6 +1,9 @@ config CREATE_ARCH_SYMLINK bool +config HAVE_ARCH_IOREMAP + bool + choice prompt "Architecture select" default SANDBOX @@ -33,6 +36,7 @@ config MICROBLAZE config MIPS bool "MIPS architecture" + select HAVE_ARCH_IOREMAP select HAVE_PRIVATE_LIBGCC select SUPPORT_OF_CONTROL diff --git a/include/linux/io.h b/include/linux/io.h index 1b36a22..a104b7e 100644 --- a/include/linux/io.h +++ b/include/linux/io.h @@ -5,6 +5,22 @@ #ifndef _LINUX_IO_H #define _LINUX_IO_H +#include +#include #include +#ifndef CONFIG_HAVE_ARCH_IOREMAP +static inline void __iomem *ioremap(resource_size_t offset, + resource_size_t size) +{ + return (void __iomem *)(unsigned long)offset; +} + +static inline void iounmap(void __iomem *addr) +{ +} + +#define devm_ioremap(dev, offset, size) ioremap(offset, size) +#endif + #endif /* _LINUX_IO_H */