From patchwork Sat Mar 21 01:04:15 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Scott Wood X-Patchwork-Id: 452856 X-Patchwork-Delegate: scottwood@freescale.com Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [103.22.144.68]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 53AC61402D6 for ; Sat, 21 Mar 2015 12:05:30 +1100 (AEDT) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 33DB11A2AA2 for ; Sat, 21 Mar 2015 12:05:30 +1100 (AEDT) X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Received: from na01-bn1-obe.outbound.protection.outlook.com (mail-bn1on0145.outbound.protection.outlook.com [157.56.110.145]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 62CEA1A005A for ; Sat, 21 Mar 2015 12:04:34 +1100 (AEDT) Received: from snotra.am.freescale.net (192.88.168.50) by BLUPR03MB1476.namprd03.prod.outlook.com (25.163.81.18) with Microsoft SMTP Server (TLS) id 15.1.118.21; Sat, 21 Mar 2015 01:04:25 +0000 From: Scott Wood To: Subject: [PATCH] powerpc/mpic: Add get_version API both for internal and external use Date: Fri, 20 Mar 2015 20:04:15 -0500 Message-ID: <1426899855-4897-1-git-send-email-scottwood@freescale.com> X-Mailer: git-send-email 2.1.0 MIME-Version: 1.0 X-Originating-IP: [192.88.168.50] X-ClientProxiedBy: BL2PR01CA0023.prod.exchangelabs.com (10.141.66.23) To BLUPR03MB1476.namprd03.prod.outlook.com (25.163.81.18) Authentication-Results: lists.ozlabs.org; dkim=none (message not signed) header.d=none; X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BLUPR03MB1476; X-Microsoft-Antispam-PRVS: X-Forefront-Antispam-Report: BMV:1; SFV:NSPM; SFS:(10019020)(6009001)(54534003)(110136001)(62966003)(40100003)(77156002)(122386002)(15975445007)(92566002)(42186005)(4477795004)(229853001)(2351001)(33646002)(36756003)(50226001)(66066001)(19580405001)(47776003)(87976001)(48376002)(50986999)(86362001)(19580395003)(50466002)(46102003); DIR:OUT; SFP:1102; SCL:1; SRVR:BLUPR03MB1476; H:snotra.am.freescale.net; FPR:; SPF:None; MLV:nov; PTR:InfoNoRecords; LANG:en; X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(5005006)(5002010); SRVR:BLUPR03MB1476; BCL:0; PCL:0; RULEID:; SRVR:BLUPR03MB1476; X-Forefront-PRVS: 05220145DE X-OriginatorOrg: freescale.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Mar 2015 01:04:25.4147 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR03MB1476 Cc: Scott Wood , Arseny Solokha , Hongtao Jia X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.18 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" From: Hongtao Jia MPIC version is useful information for both mpic_alloc() and mpic_init(). The patch provide an API to get MPIC version for reusing the code. Also, some other IP block may need MPIC version for their own use. The API for external use is also provided. This function had been previously added but was removed by commit 5e86bfde9cd93f2 ("powerpc/mpic: remove unused functions") due to the lack of a user. This function will be used by "powerpc/mpic: Add get_version API both for internal and external use". Signed-off-by: Jia Hongtao Signed-off-by: Li Yang [scottwood@freescale.com: changelog update] Signed-off-by: Scott Wood Cc: Arseny Solokha Cc: Michael Ellerman --- I plan to push this patch and the patch that depends on it (http://patchwork.ozlabs.org/patch/443826/) for this merge window. arch/powerpc/include/asm/mpic.h | 3 +++ arch/powerpc/sysdev/mpic.c | 10 ++++++++++ 2 files changed, 13 insertions(+) diff --git a/arch/powerpc/include/asm/mpic.h b/arch/powerpc/include/asm/mpic.h index 6ce63a7..9869761 100644 --- a/arch/powerpc/include/asm/mpic.h +++ b/arch/powerpc/include/asm/mpic.h @@ -391,6 +391,9 @@ extern struct bus_type mpic_subsys; #define MPIC_REGSET_STANDARD MPIC_REGSET(0) /* Original MPIC */ #define MPIC_REGSET_TSI108 MPIC_REGSET(1) /* Tsi108/109 PIC */ +/* Get the version of primary MPIC */ +extern u32 fsl_mpic_primary_get_version(void); + /* Allocate the controller structure and setup the linux irq descs * for the range if interrupts passed in. No HW initialization is * actually performed. diff --git a/arch/powerpc/sysdev/mpic.c b/arch/powerpc/sysdev/mpic.c index f72b592..2c817a7 100644 --- a/arch/powerpc/sysdev/mpic.c +++ b/arch/powerpc/sysdev/mpic.c @@ -1219,6 +1219,16 @@ static u32 fsl_mpic_get_version(struct mpic *mpic) * Exported functions */ +u32 fsl_mpic_primary_get_version(void) +{ + struct mpic *mpic = mpic_primary; + + if (mpic) + return fsl_mpic_get_version(mpic); + + return 0; +} + struct mpic * __init mpic_alloc(struct device_node *node, phys_addr_t phys_addr, unsigned int flags,