From patchwork Fri Oct 10 06:48:45 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhao Qiang X-Patchwork-Id: 398469 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 C9D37140092 for ; Fri, 10 Oct 2014 17:50:07 +1100 (EST) Received: from ozlabs.org (ozlabs.org [103.22.144.67]) by lists.ozlabs.org (Postfix) with ESMTP id AD8181A1BBE for ; Fri, 10 Oct 2014 17:50:07 +1100 (EST) 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-bn1bon0137.outbound.protection.outlook.com [157.56.111.137]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id C1A531A01E4 for ; Fri, 10 Oct 2014 17:49:27 +1100 (EST) Received: from BL2PR03MB340.namprd03.prod.outlook.com (10.141.68.24) by BL2PR03MB339.namprd03.prod.outlook.com (10.141.68.23) with Microsoft SMTP Server (TLS) id 15.0.1054.10; Fri, 10 Oct 2014 06:49:19 +0000 Received: from BN3PR0301CA0056.namprd03.prod.outlook.com (25.160.152.152) by BL2PR03MB340.namprd03.prod.outlook.com (10.141.68.24) with Microsoft SMTP Server (TLS) id 15.0.1054.10; Fri, 10 Oct 2014 06:49:18 +0000 Received: from BL2FFO11FD040.protection.gbl (2a01:111:f400:7c09::104) by BN3PR0301CA0056.outlook.office365.com (2a01:111:e400:401e::24) with Microsoft SMTP Server (TLS) id 15.0.1049.19 via Frontend Transport; Fri, 10 Oct 2014 06:49:18 +0000 Received: from az84smr01.freescale.net (192.88.158.2) by BL2FFO11FD040.mail.protection.outlook.com (10.173.161.136) with Microsoft SMTP Server (TLS) id 15.0.1039.16 via Frontend Transport; Fri, 10 Oct 2014 06:49:17 +0000 Received: from titan.ap.freescale.net ([10.192.208.233]) by az84smr01.freescale.net (8.14.3/8.14.0) with ESMTP id s9A6nEsB013587; Thu, 9 Oct 2014 23:49:15 -0700 From: Zhao Qiang To: , , Subject: [PATCH 2/3] qe: run qe_init and qe_ic_init Date: Fri, 10 Oct 2014 14:48:45 +0800 Message-ID: <1412923725-9611-1-git-send-email-B45475@freescale.com> X-Mailer: git-send-email 2.1.0.27.g96db324 X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:192.88.158.2; CTRY:US; IPV:CAL; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(199003)(189002)(99396003)(85306004)(97736003)(85852003)(62966002)(48376002)(87936001)(88136002)(87286001)(89996001)(107046002)(95666004)(31966008)(81156004)(105606002)(229853001)(106466001)(104016003)(50226001)(4396001)(36756003)(80022003)(46102003)(68736004)(44976005)(69596002)(64706001)(104166001)(21056001)(19580405001)(77156001)(19580395003)(84676001)(47776003)(20776003)(6806004)(2201001)(92566001)(93916002)(92726001)(575784001)(50466002)(26826002)(102836001)(50986999)(120916001)(76482002)(2101003)(42262002); DIR:OUT; SFP:1102; SCL:1; SRVR:BL2PR03MB340; H:az84smr01.freescale.net; FPR:; MLV:ovrnspm; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; MIME-Version: 1.0 X-Microsoft-Antispam: UriScan:;UriScan:; X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:;SRVR:BL2PR03MB340; X-Exchange-Antispam-Report-Test: UriScan:; X-Forefront-PRVS: 03607C04F0 Received-SPF: Fail (protection.outlook.com: domain of freescale.com does not designate 192.88.158.2 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.158.2; helo=az84smr01.freescale.net; Authentication-Results: spf=fail (sender IP is 192.88.158.2) smtp.mailfrom=qiang.zhao@freescale.com; X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:;SRVR:BL2PR03MB339; X-OriginatorOrg: freescale.com Cc: Zhao Qiang , R63061@freescale.com 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" qe and qe_ic need to be initialized before the qe app drivers, using subsys_initcall to run qe_init and qe_ic_init Signed-off-by: Zhao Qiang --- drivers/soc/qe/qe.c | 15 +++++++++++++++ drivers/soc/qe/qe_ic.c | 15 +++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/drivers/soc/qe/qe.c b/drivers/soc/qe/qe.c index 2aaa5b2..bfea0f8 100644 --- a/drivers/soc/qe/qe.c +++ b/drivers/soc/qe/qe.c @@ -683,6 +683,21 @@ unsigned int qe_get_num_of_snums(void) } EXPORT_SYMBOL(qe_get_num_of_snums); +static int __init qe_init(void) +{ + struct device_node *np; + + np = of_find_compatible_node(NULL, NULL, "fsl,qe"); + if (!np) { + pr_err("%s: Could not find Quicc Engine node\n", __func__); + return -ENODEV; + } + qe_reset(); + of_node_put(np); + return 0; +} +subsys_initcall(qe_init); + #if defined(CONFIG_SUSPEND) && defined(CONFIG_PPC_85xx) static int qe_resume(struct platform_device *ofdev) { diff --git a/drivers/soc/qe/qe_ic.c b/drivers/soc/qe/qe_ic.c index cc1b8d5..11fe98c 100644 --- a/drivers/soc/qe/qe_ic.c +++ b/drivers/soc/qe/qe_ic.c @@ -34,6 +34,7 @@ #include #include "qe_ic.h" +#include "../../irqchip/irqchip.h" static DEFINE_RAW_SPINLOCK(qe_ic_lock); @@ -501,4 +502,18 @@ static int __init init_qe_ic_sysfs(void) return 0; } +static int __init qeic_of_init(void) +{ + struct device_node *np; + + np = of_find_compatible_node(NULL, NULL, "fsl,qe-ic"); + if (np) { + qe_ic_init(np, 0, qe_ic_cascade_low_mpic, + qe_ic_cascade_high_mpic); + of_node_put(np); + } + return 0; +} +subsys_initcall(qeic_of_init); + subsys_initcall(init_qe_ic_sysfs);