Received: by 10.223.176.46 with SMTP id f43csp653577wra; Fri, 26 Jan 2018 04:54:21 -0800 (PST) X-Google-Smtp-Source: AH8x227cweBo3yTj7xtiOOGwVV9ZuafbTK5vF/haDmBy/xroOhbP1Lpw9ipLu9+ZoyXXyIe9Hz7I X-Received: by 2002:a17:902:42c3:: with SMTP id h61-v6mr14275575pld.269.1516971261175; Fri, 26 Jan 2018 04:54:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516971261; cv=none; d=google.com; s=arc-20160816; b=ROXlcAwdFss20VtKOWa6YBAPkSG+CfeLQNvFvu7Rs+EJE+a7flhY1cNIUl+2WWoLXM 3sWKbqFMsVqxwhzV5wt6u5isIgKIB6ARs0vwf0uG6W4snU/fMMCdSLVGtQvNKGHIzfuH vJTrt+kfM5T4OPnyjjPk318jlGRPnrNiT+V4jvCDZdEQ+8WsFdC/bMtlxR0YfnXlyTM9 Gx4PrwKC2/q92SowPQtNrVKY7dv+rsNa8WoYqfTNYMJvnytX0lQ78TxOv/QXI8pbHB/5 9lo/p6T76ps6LOYx/NY1FudDuSpZdlMar9taH7Zq12F98vxw5oB4lRuBnlK9+hirYBzA omvQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:spamdiagnosticmetadata :spamdiagnosticoutput:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature:arc-authentication-results; bh=sMRGFjRPXJddBb6nw3NDdxsykPpUN3H/4nlW2cJg3xk=; b=aveoTUnUKgejLByz80qjXruVDpAcN7sGjNsWHsxABvqnIRHv0CW3DNEgn6/mHZ0vMk Mq2zIhz9L+OWEjzR+1MAG1bGA+D/1NATKc81xxOZ1L+vxq9Qwr3/uU9CmwwXDSF3jK1Y w0qhFmQhTvK7h//z0Ax3UgUEyvCqZjlV5ehLQHR/wLS4w5x1k2+wlHOBbQN4UtEUlJ2A Qe+UT94waJhTcUIzT7i3mLWWW0wLpBZ8coiqrwj+vcUjUu6wwzggvjmIwR9DzIorfGns BlhbvjnTDMZ7Vg7eFGCNW9i3akG6adWgbh3bds2wkAwYwNfNRGcsgUV67oJC8e+VVXAU 2Dcg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector1 header.b=ShHYfOLx; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g11si6326231pfd.1.2018.01.26.04.54.07; Fri, 26 Jan 2018 04:54:21 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@nxp.com header.s=selector1 header.b=ShHYfOLx; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752143AbeAZMwU (ORCPT + 99 others); Fri, 26 Jan 2018 07:52:20 -0500 Received: from mail-db5eur01on0075.outbound.protection.outlook.com ([104.47.2.75]:61072 "EHLO EUR01-DB5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751850AbeAZMwS (ORCPT ); Fri, 26 Jan 2018 07:52:18 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=sMRGFjRPXJddBb6nw3NDdxsykPpUN3H/4nlW2cJg3xk=; b=ShHYfOLxNoUtm5jjLKoAeMO3tF+wtkpMCzBkraR7Hvmgz2+z3+FcAysB5pi/v+Z2R6MSwbDnxK7V6AFkTU7lvjxN7FxIVvwIpUI4AV3xJLorRj8jpex0BhmcJIES40Zbasdg4j+zlkX+9YWLcyaJ9g2J9rr49nbynJjJH3AUphA= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=bogdan.purcareata@nxp.com; Received: from rhuath.am.freescale.net (192.88.168.1) by VI1PR0402MB3661.eurprd04.prod.outlook.com (2603:10a6:803:1d::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.428.17; Fri, 26 Jan 2018 12:52:11 +0000 From: Bogdan Purcareata To: gregkh@linuxfoundation.org, laurentiu.tudor@nxp.com, ruxandra.radulescu@nxp.com Cc: stuyoder@gmail.com, arnd@arndb.de, robh@kernel.org, ioana.ciornei@nxp.com, nipun.gupta@nxp.com, roy.pledge@nxp.com, horia.geanta@nxp.com, marc.zyngier@arm.com, tglx@linutronix.de, jason@lakedaemon.net, bogdan.purcareata@nxp.com, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v5 2/2] staging: fsl-mc: Move irqchip code out of staging Date: Fri, 26 Jan 2018 06:51:27 -0600 Message-Id: <20180126125127.26439-3-bogdan.purcareata@nxp.com> X-Mailer: git-send-email 2.8.3 In-Reply-To: <20180126125127.26439-1-bogdan.purcareata@nxp.com> References: <20180126125127.26439-1-bogdan.purcareata@nxp.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [192.88.168.1] X-ClientProxiedBy: BN6PR08CA0052.namprd08.prod.outlook.com (2603:10b6:404:b9::14) To VI1PR0402MB3661.eurprd04.prod.outlook.com (2603:10a6:803:1d::25) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 3fb4a147-af4e-4956-2476-08d564bb9fcd X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(4534165)(4627221)(201703031133081)(201702281549075)(48565401081)(5600026)(4604075)(2017052603307)(7153060)(7193020);SRVR:VI1PR0402MB3661; X-Microsoft-Exchange-Diagnostics: 1;VI1PR0402MB3661;3:fKkJGqK7WUzC3dhXm/lIkddPan1LjQwxy6NbJYzFTCGqSAqH9eM9OqWMrYSMjkeAKVqvcrd7Z8l014BAoto8KzRFNVNuNgv5+IogD3OTcWfD+uWykLfYRrhxSInejn22n0jomXIsv1zBdjtwmqsn95U28o4bAxx3TbsyfxCWHhcaNZgNsu2y0wkw5TZtjit0LLAT1B0MDNsykWOXWOZySzB4uebvpzpHNC4s2rkm6hGNy8FE1jSD0Ks3IO44Q3nx;25:DTVjJ8Nohl9Xaxc76ec9FgoOdm4QAQjIFgBrR6agUJMt0QE18HP2uDCJCfw6QxHEdPmc2s+yvKFSmG/liZ5I1SvlcEHVQJUf4qVPiO2JjMs0oFdM6/1s0ryzhZP8rjhThPvWFkmuo1LCRxBwnYoSJqjW7csFwuOlZ1LmcXEvVp7TSpidO6eUU6MWoYFDy2MZoPR/RIDXuegUnvsg1UUeKPmdwPve56Oj+Ur0pZCpPx3NFw6oVNaIZ7v6LrODjPWOb/i0TDoZ5HyUac4bkcs9fHQSwUMDDmW7mNomtu6FU901AhB1klbfK5P95EL8oyvXBl+rAEj8jiIY8Pwna6Gokw==;31:ioabapsab7Ou6ae/h/PggNEDZeJHkEZwXvzz2uyzrNCB4poBR85HX51LzEQu/sG+da5anu9mPVCkHD/4/RnHVqKsauQfLaMfztPr5+/x4rUwHtFQfe6t2RpzkUCPVbKa8Ga8xRuUfUDjpRkm6fKEjBI7k79rSd+eAI9dnNVUo88a2fOhHTSvjZkbbg38t1Hwy4n9LxcukO5ssI6utk/ilteGLZBg7XWO35DQFRzPFt8= X-MS-TrafficTypeDiagnostic: VI1PR0402MB3661: X-Microsoft-Exchange-Diagnostics: 1;VI1PR0402MB3661;20:C9/wnx6vEJHXb2dveYDmqjE2MdpxZ6fpyS1shXv+8IBKyCSSQcDUZPzeSi14/8aydFXjOeTBXyi34nGJSOlizvLPZsMCsfbBIkdQbcnkqS07UtNbWajfCKhioTC0dwtMD/jvAk8ufZPYhMoJnUH4jucVqskcRwmUt1xu2YrAkx3ofeNNa+PZmQadaAfTGpiVQfZVedHNrkTXP0v7fi+Rxy9MHfOpz3hGupraoqFEI1bzNKMZJZ14HICc7eKTGmR5bDcqHhyMTKxLRj4XI8xKupSX7s1bkrlsFHUneZt3trfJBoNeOBWRB1XczULgumw6TolKZCm0g7DXVL5gxWXWP0PoB+8jzvokdpzMexwebsWtgojNNrS/D2zzKcQVuAmpszCX51A9JAyjaEbGv/zva2dHl867vxN3wnGpYiMLx4eLIZ4WUf1PpSFCHnNRHh93J9vqTU7b8jjEG6zkmOhq4HwjMhhTDu8Ydbd0bH9/aRW5h5kbMQV7qkkOs2Py6Jqm;4:VaobtOPHBtuJojUesuaHSlnbMFkk3xC6mLdnFL0KZodcALGlfh5YLufoPqiKyMACyu9odW/NIXY2NkUbPqBEWjLXHfKGbrux5eHZ6eaZMQEbv5Vvh0H8Mn8k0wohlWiQeQu1ExkSKqKS4oa5uVCaeZU/XoQrXy3l2qbnKzh0vPlIh7v1wGpiwxyqMnQqWV46sw4Mty7KtrpfCDCqh6ZC4c090pgaY7sN+sMEjQFVZV+JpeMSZbMRFM7EdIMwmxRXnc/pEQrmbDxlgox6mSpcc5YwgxrMdraU+2jWcfh7v0sccpYoTtgk4vSkyDgbUEroswsBIeXAo/3rL4Gal4FiEEtvY0QwQ8pFbDHiXe6/pe1ceBpZuozrwG459k6fWZap3IdWHmzi49VdBdzyH5AkOyNlJJtr9KTvN8JNWITi36E= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(180628864354917)(185117386973197)(85827821059158)(101931422205132); X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040501)(2401047)(5005006)(8121501046)(3231023)(2400081)(944501161)(93006095)(93001095)(10201501046)(3002001)(6055026)(6041288)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123564045)(20161123558120)(20161123562045)(6072148)(201708071742011);SRVR:VI1PR0402MB3661;BCL:0;PCL:0;RULEID:;SRVR:VI1PR0402MB3661; X-Forefront-PRVS: 05641FD966 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(396003)(39860400002)(39380400002)(366004)(376002)(346002)(199004)(189003)(59450400001)(76176011)(386003)(6506007)(50226002)(68736007)(6636002)(52116002)(86362001)(81156014)(8676002)(81166006)(6512007)(8936002)(7736002)(53936002)(66066001)(7416002)(47776003)(51416003)(6486002)(305945005)(2950100002)(5660300001)(4326008)(6666003)(6116002)(3846002)(186003)(97736004)(2906002)(36756003)(39060400002)(26005)(316002)(48376002)(106356001)(16586007)(25786009)(50466002)(1076002)(478600001)(105586002)(16526019);DIR:OUT;SFP:1101;SCL:1;SRVR:VI1PR0402MB3661;H:rhuath.am.freescale.net;FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; Received-SPF: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;VI1PR0402MB3661;23:JpsZS6PGRwmnCeUG0ZsT+wSDC+SW7YMug7kbQ0f?= =?us-ascii?Q?J61CFiAgC3/43o3cOMUH6hbS3fz/lpbOrVxGPNaQGzbaMpNj0ZWFAypsKMYj?= =?us-ascii?Q?Zm/qfVwQBjRGm4ul5z19ejXlpnFzbYfyovBB0yOx+mH/3VgK+vyWwmFrCWQa?= =?us-ascii?Q?ho2nbP7vxQ+OJyReRrDE6T/KqavDJ3488+Pz2K3EkJqy4RoH7UJOGTEvLnK8?= =?us-ascii?Q?7AQhMYEU52vWCmTxvTGOjP64TXbbPoJstDXTBNXEltPqFVSqh89RgO4kiI9m?= =?us-ascii?Q?9drA5ALN+oNtumstXkihCxan3DD8dUcB7d82tiyyKOQquzpJLaggED2aZyBv?= =?us-ascii?Q?/U3B8j0XzAZgno1yJf94/sE+7k1wKHsNRpJWshTVVfuCmZmzSJAfStpoBIk9?= =?us-ascii?Q?XT8wLxU5vf4/UEiHSK0Up2yOBRgfTpkRdXLpcwXYDLyxGJ7FOn7TaWqDJRo5?= =?us-ascii?Q?RTkzlxyETsK5F+el0hb7aJvQAlL9PM+nepiNrJD1K4kc46D7AdFh5IuMDXoO?= =?us-ascii?Q?cXiq1mjcTrvoslOWoy20F879ylaT3zX94PPrIZT93UqCiRUPCbjYz07RHwJA?= =?us-ascii?Q?j1yTh6mrjOnKNago2UA9lRBKQHOo1Gv6QILle0YtznCm8Z62PMgZPh2qp5RP?= =?us-ascii?Q?g166+bfHhz1/bq0TC1GlFXwSBbxKLQR2oUqG4YDkbB6gwKmQezfGmg5yEHIB?= =?us-ascii?Q?Wi99Ps0l/wYPrnQG1QUvM63HCuUuQjjQ4NbNh1FchzWFMO8Q7/iruYAGBtkq?= =?us-ascii?Q?nK74gz2swZvaktcnJZAFi2PitfT00+N2w7lsfngxQEzzed6fxIrAudeGu6Fm?= =?us-ascii?Q?j+shyr7qcFiTzFnhzHdri6U/rTcp92M/wrRdhfBhINyHoQY0dH+BbZksv79u?= =?us-ascii?Q?vcWip7EGf03++IX5fwASF8n7fDbhFHZRnBBAGDTXIFpFSvWo2zRGLMGAWc+g?= =?us-ascii?Q?CCT9t4XVPydiLJH1b+Tuzrrh7gfYUr1TVSOG2gra6f/bLuIoFgJ19y6BcB/y?= =?us-ascii?Q?boIR4hWRFtLHd7z/hqtwIkLKtq57SHaPnJovRFj0XoLdozvpituN4pVDAMH/?= =?us-ascii?Q?Wi3RQTkqoFPlLn2VTuDtSsEYMnbJCViOw7o5udrQ5QSSeraZaUmHyOMywNzf?= =?us-ascii?Q?DHVCSRroF90JZGSdfer5IRYPt1jeViPJXSILMkeuzlLoOiueqvM2CYcERpBL?= =?us-ascii?Q?JHydjzmqssvrW6eQ=3D?= X-Microsoft-Exchange-Diagnostics: 1;VI1PR0402MB3661;6:COxzO0ezaWQrnvNaeRXKeu5pxIj8pQW3ZDiYNewQsxI07r5b3XF0etuUpfVG4j/aZbX93JrlpJPknkKCdHzuL2LZVz7gvglxQlbvxi9DHvJDhe5Wp4R/VebMLzdrFlLQhM3zN5miydG5Uc8q1KsaEZjJDdMWXT8RVFbvIKLx1Ik32EYmE9MzWylA5fWBi3/VW3xoBLH6evmojg+SZUiKdw3C8eFAferKtAEdXT0LiM+H/fGbQRAj34gRngyZJsKOFgo5gDbhk0i9OmCVRzqPNoFHLMmXS19396hRGYCcaQqF0PlU3gJgxBpdchX+agmqzmWHhdgIqdcSvcEuHWL8yTd7BClsGyBCwHrUJpembAc=;5:h8ji4Fm/+ppwyPWwwIH403nCDSvdeQ5KDzdhRcvQobRhVZURO7SZGxWswuVRNGorPEwlz6hOvcnAmbGRtAzgqMPjURiqPGVFlygg7evhlpjpuW+0vswlp9FVAj0PHfSd7y65yb4FfkXXp5VEp5qwjmO+8FUMLzPoQ6lPaOmK11c=;24:cHhaoczjNvZs+Rq2j0Ta/LRK2yzn38hzzp+bksy73mIw0/PpS4je858BJwstJV0NbgvgTpu+Z93aRMFSw+jwAHuGJ/zIyxbQM+G11oVe2pQ=;7:ZGSYARBt15nxeeku5H2Sr2IXeKcwdkXYXpAIkBFZf7OPBFiYhUl6XxYj2cTOPwv17G2kubDWIy1tIgriBb/PifLH1YJ5fy7AJgcHlff9KI+a5flTsVu9+M2tKKMaFY35ADkQafQn56AOZH9AVZJ19rj7BBY8UTqNmc0Ysmca68TSImmZKJmmR1yi2De8nlEqK0d5t6yPS2rEJNFh2GqLo8lrycuyQaljomDGBt4l5D/iRXhpKQnOrMVFBHmoWQoO SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jan 2018 12:52:11.5476 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 3fb4a147-af4e-4956-2476-08d564bb9fcd X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0402MB3661 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Now that the fsl-mc bus core infrastructure is out of staging, the remaining irqchip glue code used (irq-gic-v3-its-fsl-mc-msi.c) goes to drivers/irqchip. Signed-off-by: Stuart Yoder [rebased, add dpaa2_eth and dpio #include updates] Signed-off-by: Laurentiu Tudor [rebased, split irqchip to separate patch] Signed-off-by: Bogdan Purcareata Cc: Thomas Gleixner Cc: Jason Cooper Cc: Marc Zyngier --- Notes: -v5: - split irqchip glue code to separate patch (GregKH) -v4 - v1: - no change drivers/irqchip/Makefile | 1 + drivers/irqchip/irq-gic-v3-its-fsl-mc-msi.c | 100 +++++++++++++++++++++ drivers/staging/fsl-mc/bus/Makefile | 3 +- .../staging/fsl-mc/bus/irq-gic-v3-its-fsl-mc-msi.c | 100 --------------------- 4 files changed, 102 insertions(+), 102 deletions(-) create mode 100644 drivers/irqchip/irq-gic-v3-its-fsl-mc-msi.c delete mode 100644 drivers/staging/fsl-mc/bus/irq-gic-v3-its-fsl-mc-msi.c diff --git a/drivers/irqchip/Makefile b/drivers/irqchip/Makefile index d2df34a..641d8a4 100644 --- a/drivers/irqchip/Makefile +++ b/drivers/irqchip/Makefile @@ -32,6 +32,7 @@ obj-$(CONFIG_ARM_GIC_V2M) += irq-gic-v2m.o obj-$(CONFIG_ARM_GIC_V3) += irq-gic-v3.o irq-gic-common.o obj-$(CONFIG_ARM_GIC_V3_ITS) += irq-gic-v3-its.o irq-gic-v3-its-platform-msi.o irq-gic-v4.o obj-$(CONFIG_ARM_GIC_V3_ITS_PCI) += irq-gic-v3-its-pci-msi.o +obj-$(CONFIG_FSL_MC_BUS) += irq-gic-v3-its-fsl-mc-msi.o obj-$(CONFIG_PARTITION_PERCPU) += irq-partition-percpu.o obj-$(CONFIG_HISILICON_IRQ_MBIGEN) += irq-mbigen.o obj-$(CONFIG_ARM_NVIC) += irq-nvic.o diff --git a/drivers/irqchip/irq-gic-v3-its-fsl-mc-msi.c b/drivers/irqchip/irq-gic-v3-its-fsl-mc-msi.c new file mode 100644 index 0000000..b365fbb --- /dev/null +++ b/drivers/irqchip/irq-gic-v3-its-fsl-mc-msi.c @@ -0,0 +1,100 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Freescale Management Complex (MC) bus driver MSI support + * + * Copyright (C) 2015-2016 Freescale Semiconductor, Inc. + * Author: German Rivera + * + */ + +#include +#include +#include +#include +#include +#include +#include + +static struct irq_chip its_msi_irq_chip = { + .name = "ITS-fMSI", + .irq_mask = irq_chip_mask_parent, + .irq_unmask = irq_chip_unmask_parent, + .irq_eoi = irq_chip_eoi_parent, + .irq_set_affinity = msi_domain_set_affinity +}; + +static int its_fsl_mc_msi_prepare(struct irq_domain *msi_domain, + struct device *dev, + int nvec, msi_alloc_info_t *info) +{ + struct fsl_mc_device *mc_bus_dev; + struct msi_domain_info *msi_info; + + if (!dev_is_fsl_mc(dev)) + return -EINVAL; + + mc_bus_dev = to_fsl_mc_device(dev); + if (!(mc_bus_dev->flags & FSL_MC_IS_DPRC)) + return -EINVAL; + + /* + * Set the device Id to be passed to the GIC-ITS: + * + * NOTE: This device id corresponds to the IOMMU stream ID + * associated with the DPRC object (ICID). + */ +#ifdef GENERIC_MSI_DOMAIN_OPS + info->scratchpad[0].ul = mc_bus_dev->icid; +#endif + msi_info = msi_get_domain_info(msi_domain->parent); + return msi_info->ops->msi_prepare(msi_domain->parent, dev, nvec, info); +} + +static struct msi_domain_ops its_fsl_mc_msi_ops __ro_after_init = { + .msi_prepare = its_fsl_mc_msi_prepare, +}; + +static struct msi_domain_info its_fsl_mc_msi_domain_info = { + .flags = (MSI_FLAG_USE_DEF_DOM_OPS | MSI_FLAG_USE_DEF_CHIP_OPS), + .ops = &its_fsl_mc_msi_ops, + .chip = &its_msi_irq_chip, +}; + +static const struct of_device_id its_device_id[] = { + { .compatible = "arm,gic-v3-its", }, + {}, +}; + +static int __init its_fsl_mc_msi_init(void) +{ + struct device_node *np; + struct irq_domain *parent; + struct irq_domain *mc_msi_domain; + + for (np = of_find_matching_node(NULL, its_device_id); np; + np = of_find_matching_node(np, its_device_id)) { + if (!of_property_read_bool(np, "msi-controller")) + continue; + + parent = irq_find_matching_host(np, DOMAIN_BUS_NEXUS); + if (!parent || !msi_get_domain_info(parent)) { + pr_err("%pOF: unable to locate ITS domain\n", np); + continue; + } + + mc_msi_domain = fsl_mc_msi_create_irq_domain( + of_node_to_fwnode(np), + &its_fsl_mc_msi_domain_info, + parent); + if (!mc_msi_domain) { + pr_err("%pOF: unable to create fsl-mc domain\n", np); + continue; + } + + pr_info("fsl-mc MSI: %pOF domain created\n", np); + } + + return 0; +} + +early_initcall(its_fsl_mc_msi_init); diff --git a/drivers/staging/fsl-mc/bus/Makefile b/drivers/staging/fsl-mc/bus/Makefile index 18b1b5f..b67889e 100644 --- a/drivers/staging/fsl-mc/bus/Makefile +++ b/drivers/staging/fsl-mc/bus/Makefile @@ -4,8 +4,7 @@ # # Copyright (C) 2014 Freescale Semiconductor, Inc. # -obj-$(CONFIG_FSL_MC_BUS) += irq-gic-v3-its-fsl-mc-msi.o \ - dpbp.o \ +obj-$(CONFIG_FSL_MC_BUS) += dpbp.o \ dpcon.o # MC DPIO driver diff --git a/drivers/staging/fsl-mc/bus/irq-gic-v3-its-fsl-mc-msi.c b/drivers/staging/fsl-mc/bus/irq-gic-v3-its-fsl-mc-msi.c deleted file mode 100644 index b365fbb..0000000 --- a/drivers/staging/fsl-mc/bus/irq-gic-v3-its-fsl-mc-msi.c +++ /dev/null @@ -1,100 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0 -/* - * Freescale Management Complex (MC) bus driver MSI support - * - * Copyright (C) 2015-2016 Freescale Semiconductor, Inc. - * Author: German Rivera - * - */ - -#include -#include -#include -#include -#include -#include -#include - -static struct irq_chip its_msi_irq_chip = { - .name = "ITS-fMSI", - .irq_mask = irq_chip_mask_parent, - .irq_unmask = irq_chip_unmask_parent, - .irq_eoi = irq_chip_eoi_parent, - .irq_set_affinity = msi_domain_set_affinity -}; - -static int its_fsl_mc_msi_prepare(struct irq_domain *msi_domain, - struct device *dev, - int nvec, msi_alloc_info_t *info) -{ - struct fsl_mc_device *mc_bus_dev; - struct msi_domain_info *msi_info; - - if (!dev_is_fsl_mc(dev)) - return -EINVAL; - - mc_bus_dev = to_fsl_mc_device(dev); - if (!(mc_bus_dev->flags & FSL_MC_IS_DPRC)) - return -EINVAL; - - /* - * Set the device Id to be passed to the GIC-ITS: - * - * NOTE: This device id corresponds to the IOMMU stream ID - * associated with the DPRC object (ICID). - */ -#ifdef GENERIC_MSI_DOMAIN_OPS - info->scratchpad[0].ul = mc_bus_dev->icid; -#endif - msi_info = msi_get_domain_info(msi_domain->parent); - return msi_info->ops->msi_prepare(msi_domain->parent, dev, nvec, info); -} - -static struct msi_domain_ops its_fsl_mc_msi_ops __ro_after_init = { - .msi_prepare = its_fsl_mc_msi_prepare, -}; - -static struct msi_domain_info its_fsl_mc_msi_domain_info = { - .flags = (MSI_FLAG_USE_DEF_DOM_OPS | MSI_FLAG_USE_DEF_CHIP_OPS), - .ops = &its_fsl_mc_msi_ops, - .chip = &its_msi_irq_chip, -}; - -static const struct of_device_id its_device_id[] = { - { .compatible = "arm,gic-v3-its", }, - {}, -}; - -static int __init its_fsl_mc_msi_init(void) -{ - struct device_node *np; - struct irq_domain *parent; - struct irq_domain *mc_msi_domain; - - for (np = of_find_matching_node(NULL, its_device_id); np; - np = of_find_matching_node(np, its_device_id)) { - if (!of_property_read_bool(np, "msi-controller")) - continue; - - parent = irq_find_matching_host(np, DOMAIN_BUS_NEXUS); - if (!parent || !msi_get_domain_info(parent)) { - pr_err("%pOF: unable to locate ITS domain\n", np); - continue; - } - - mc_msi_domain = fsl_mc_msi_create_irq_domain( - of_node_to_fwnode(np), - &its_fsl_mc_msi_domain_info, - parent); - if (!mc_msi_domain) { - pr_err("%pOF: unable to create fsl-mc domain\n", np); - continue; - } - - pr_info("fsl-mc MSI: %pOF domain created\n", np); - } - - return 0; -} - -early_initcall(its_fsl_mc_msi_init); -- 2.7.4