From patchwork Mon Oct 29 07:01:17 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pratyush ANAND X-Patchwork-Id: 1661431 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Original-To: patchwork-linux-pci@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 421383FCF7 for ; Mon, 29 Oct 2012 07:02:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752173Ab2J2HCN (ORCPT ); Mon, 29 Oct 2012 03:02:13 -0400 Received: from eu1sys200aog115.obsmtp.com ([207.126.144.139]:42774 "EHLO eu1sys200aog115.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751682Ab2J2HCN (ORCPT ); Mon, 29 Oct 2012 03:02:13 -0400 Received: from beta.dmz-ap.st.com ([138.198.100.35]) (using TLSv1) by eu1sys200aob115.postini.com ([207.126.147.11]) with SMTP ID DSNKUI4p625us0RPjsupmSJal3dcqAvkAo0U@postini.com; Mon, 29 Oct 2012 07:02:12 UTC Received: from zeta.dmz-ap.st.com (ns6.st.com [138.198.234.13]) by beta.dmz-ap.st.com (STMicroelectronics) with ESMTP id 040A8119; Mon, 29 Oct 2012 06:53:47 +0000 (GMT) Received: from Webmail-ap.st.com (eapex1hubcas2.st.com [10.80.176.10]) by zeta.dmz-ap.st.com (STMicroelectronics) with ESMTP id DA553988; Mon, 29 Oct 2012 07:02:00 +0000 (GMT) Received: from localhost (10.199.81.103) by Webmail-ap.st.com (10.80.176.7) with Microsoft SMTP Server (TLS) id 8.3.245.1; Mon, 29 Oct 2012 15:02:00 +0800 From: Pratyush Anand To: , , Cc: , , , , Pratyush Anand Subject: [PATCH 03/15] SPEAr13xx: Add mach/io.h Date: Mon, 29 Oct 2012 12:31:17 +0530 Message-ID: X-Mailer: git-send-email 1.7.5.4 In-Reply-To: References: MIME-Version: 1.0 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org In case of PCIe we need to have a different __io macro, which can write into PCIe address space. Signed-off-by: Pratyush Anand --- arch/arm/mach-spear13xx/include/mach/io.h | 35 +++++++++++++++++++++++++++++ 1 files changed, 35 insertions(+), 0 deletions(-) create mode 100644 arch/arm/mach-spear13xx/include/mach/io.h diff --git a/arch/arm/mach-spear13xx/include/mach/io.h b/arch/arm/mach-spear13xx/include/mach/io.h new file mode 100644 index 0000000..a0d93ca --- /dev/null +++ b/arch/arm/mach-spear13xx/include/mach/io.h @@ -0,0 +1,35 @@ +/* + * arch/arm/mach-spear13xx/include/mach/io.h + * + * spear13xx machine family generic header file + * + * Copyright (C) 2012 ST Microelectronics + * Pratyush Anand + * + * This file is licensed under the terms of the GNU General Public + * License version 2. This program is licensed "as is" without any + * warranty of any kind, whether express or implied. + */ + +#ifndef __MACH_IO_H +#define __MACH_IO_H + +#define IO_SPACE_LIMIT 0xFFFF + +#ifdef CONFIG_SPEAR13XX_PCI +extern void __iomem *spear13xx_pcie_io_base(unsigned long addr); + +static inline void __iomem *__io(unsigned long addr) +{ + return spear13xx_pcie_io_base(addr) + (addr & IO_SPACE_LIMIT); +} +#else +static inline void __iomem *__io(unsigned long addr) +{ + return (void __iomem *)addr; +} +#endif + +#define __io(a) __io(a) + +#endif /* __MACH_IO_H */