From patchwork Tue Oct 29 11:27:40 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bharat Bhushan X-Patchwork-Id: 286803 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from ozlabs.org (localhost [IPv6:::1]) by ozlabs.org (Postfix) with ESMTP id 09F262C0491 for ; Tue, 29 Oct 2013 22:37:00 +1100 (EST) Received: from db8outboundpool.messaging.microsoft.com (mail-db8lp0186.outbound.messaging.microsoft.com [213.199.154.186]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (Client CN "mail.global.frontbridge.com", Issuer "MSIT Machine Auth CA 2" (not verified)) by ozlabs.org (Postfix) with ESMTPS id EE38C2C0383 for ; Tue, 29 Oct 2013 22:34:42 +1100 (EST) Received: from mail79-db8-R.bigfish.com (10.174.8.236) by DB8EHSOBE035.bigfish.com (10.174.4.98) with Microsoft SMTP Server id 14.1.225.22; Tue, 29 Oct 2013 11:34:34 +0000 Received: from mail79-db8 (localhost [127.0.0.1]) by mail79-db8-R.bigfish.com (Postfix) with ESMTP id D32F95A00F8; Tue, 29 Oct 2013 11:34:33 +0000 (UTC) X-Forefront-Antispam-Report: CIP:70.37.183.190; KIP:(null); UIP:(null); IPV:NLI; H:mail.freescale.net; RD:none; EFVD:NLI X-SpamScore: 4 X-BigFish: VS4(zzzz1f42h208ch1ee6h1de0h1fdah2073h1202h1e76h1d1ah1d2ah1fc6h1082kzd2iz1de098h8275bh1de097hz2dh2a8h839he5bhf0ah107ah1288h12a5h12a9h12bdh12e5h137ah139eh13b6h1441h1504h1537h162dh1631h1758h1898h18e1h1946h19b5h1ad9h1b0ah1b2fh1fb3h1d0ch1d2eh1d3fh1dfeh1dffh1e1dh1e23h1fe8h1ff5h2218h2216h1155h) Received: from mail79-db8 (localhost.localdomain [127.0.0.1]) by mail79-db8 (MessageSwitch) id 1383046472524696_23557; Tue, 29 Oct 2013 11:34:32 +0000 (UTC) Received: from DB8EHSMHS022.bigfish.com (unknown [10.174.8.251]) by mail79-db8.bigfish.com (Postfix) with ESMTP id 70B0538004F; Tue, 29 Oct 2013 11:34:32 +0000 (UTC) Received: from mail.freescale.net (70.37.183.190) by DB8EHSMHS022.bigfish.com (10.174.4.32) with Microsoft SMTP Server (TLS) id 14.16.227.3; Tue, 29 Oct 2013 11:34:32 +0000 Received: from tx30smr01.am.freescale.net (10.81.153.31) by 039-SN1MMR1-003.039d.mgd.msft.net (10.84.1.16) with Microsoft SMTP Server (TLS) id 14.3.158.2; Tue, 29 Oct 2013 11:34:30 +0000 Received: from freescale.com ([10.232.15.72]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with SMTP id r9TBYOwX018743; Tue, 29 Oct 2013 04:34:25 -0700 Received: by freescale.com (sSMTP sendmail emulation); Tue, 29 Oct 2013 16:58:06 +0530 From: Bharat Bhushan To: , , , , , , , , Subject: [PATCH 2/5 RFC] powerpc: pci: Add arch specific msi region interface Date: Tue, 29 Oct 2013 16:57:40 +0530 Message-ID: <1383046062-16520-4-git-send-email-Bharat.Bhushan@freescale.com> X-Mailer: git-send-email 1.7.0.4 In-Reply-To: <1383046062-16520-1-git-send-email-Bharat.Bhushan@freescale.com> References: <1383046062-16520-1-git-send-email-Bharat.Bhushan@freescale.com> MIME-Version: 1.0 X-OriginatorOrg: freescale.com X-FOPE-CONNECTOR: Id%0$Dn%*$RO%0$TLS%0$FQDN%$TlsDn% Cc: Bharat Bhushan X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.16rc2 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" This patch adds the interface to get the msi region information from arch specific code. The machine spicific code is not yet defined. Signed-off-by: Bharat Bhushan --- arch/powerpc/include/asm/machdep.h | 8 ++++++++ arch/powerpc/kernel/msi.c | 18 ++++++++++++++++++ 2 files changed, 26 insertions(+), 0 deletions(-) diff --git a/arch/powerpc/include/asm/machdep.h b/arch/powerpc/include/asm/machdep.h index 8b48090..8d1b787 100644 --- a/arch/powerpc/include/asm/machdep.h +++ b/arch/powerpc/include/asm/machdep.h @@ -30,6 +30,7 @@ struct file; struct pci_controller; struct kimage; struct pci_host_bridge; +struct msi_region; struct machdep_calls { char *name; @@ -124,6 +125,13 @@ struct machdep_calls { int (*setup_msi_irqs)(struct pci_dev *dev, int nvec, int type); void (*teardown_msi_irqs)(struct pci_dev *dev); + + /* Returns the number of MSI regions (banks) */ + int (*msi_get_region_count)(void); + + /* Returns the requested region's address and size */ + int (*msi_get_region)(int region_num, + struct msi_region *region); #endif void (*restart)(char *cmd); diff --git a/arch/powerpc/kernel/msi.c b/arch/powerpc/kernel/msi.c index 8bbc12d..1a67787 100644 --- a/arch/powerpc/kernel/msi.c +++ b/arch/powerpc/kernel/msi.c @@ -13,6 +13,24 @@ #include +int arch_msi_get_region_count(void) +{ + if (ppc_md.msi_get_region_count) { + pr_debug("msi: Using platform get_region_count routine.\n"); + return ppc_md.msi_get_region_count(); + } + return 0; +} + +int arch_msi_get_region(int region_num, struct msi_region *region) +{ + if (ppc_md.msi_get_region) { + pr_debug("msi: Using platform get_region routine.\n"); + return ppc_md.msi_get_region(region_num, region); + } + return 0; +} + int arch_msi_check_device(struct pci_dev* dev, int nvec, int type) { if (!ppc_md.setup_msi_irqs || !ppc_md.teardown_msi_irqs) {