From patchwork Wed Mar 29 21:13:53 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roy Pledge X-Patchwork-Id: 9652611 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 12391602C8 for ; Wed, 29 Mar 2017 21:14:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 03DD42855D for ; Wed, 29 Mar 2017 21:14:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EC30D28564; Wed, 29 Mar 2017 21:14:38 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED,DKIM_VALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 624082855D for ; Wed, 29 Mar 2017 21:14:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:Reply-To:List-Subscribe:List-Help: List-Post:List-Archive:List-Unsubscribe:List-Id:MIME-Version:References: In-Reply-To:Message-ID:Date:Subject:To:From:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=3TNdh/p5R7lFpLmFBiMnlcqjDsiFOHt+vuy0TOiJh6s=; b=RCTt/y6lSFnios /T5HKeP9i6ytBd/mxE9f/7xMSnWHfFM5wSlKHdkmEAQAhcmOXc0/So7bR30expyY1ETn5PxIxY2Rm D5i9lzu+Op8o0br0O2CPgavM1Z0tQjkSj27FMIYNsYgbmxkfMGphizjYR/UZoQGWfy4gkK+t2vzf7 UzEcN6iUUeTCui8HPD+hY2bJJlIdMoADlWVfuxRrTxBScxcofHfhwofDpRjtci4OSAB21E4JeDQmb c8YcuMVK8hz2c57GjbCfY49BUtSOu66CwPdtH39UVv3BpFWuj9LFOA4yWPpYE+GfB4BgpBdQ5U6PI 0SYEyU5eJWtsjKv3y66w==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1ctKvN-0003jz-9X; Wed, 29 Mar 2017 21:14:37 +0000 Received: from mail-by2nam01on0045.outbound.protection.outlook.com ([104.47.34.45] helo=NAM01-BY2-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1ctKv9-0003Kj-8z for linux-arm-kernel@lists.infradead.org; Wed, 29 Mar 2017 21:14:25 +0000 Received: from BN6PR03CA0054.namprd03.prod.outlook.com (10.173.137.16) by SN1PR0301MB1967.namprd03.prod.outlook.com (10.163.224.29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.991.14; Wed, 29 Mar 2017 21:14:01 +0000 Received: from BL2FFO11FD006.protection.gbl (2a01:111:f400:7c09::188) by BN6PR03CA0054.outlook.office365.com (2603:10b6:404:4c::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1005.10 via Frontend Transport; Wed, 29 Mar 2017 21:14:01 +0000 Authentication-Results: spf=fail (sender IP is 192.88.158.2) smtp.mailfrom=nxp.com; nxp.com; dkim=none (message not signed) header.d=none;nxp.com; dmarc=fail action=none header.from=nxp.com; Received-SPF: Fail (protection.outlook.com: domain of nxp.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; Received: from az84smr01.freescale.net (192.88.158.2) by BL2FFO11FD006.mail.protection.outlook.com (10.173.161.2) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.977.7 via Frontend Transport; Wed, 29 Mar 2017 21:14:01 +0000 Received: from otc-sw1.am.freescale.net (otc-sw1.am.freescale.net [10.29.200.182]) by az84smr01.freescale.net (8.14.3/8.14.0) with ESMTP id v2TLDwW3032154; Wed, 29 Mar 2017 14:14:00 -0700 From: Roy Pledge To: , , , , Subject: [RFC PATCH 1/5] soc/fsl/qbman: Use shared-dma-pool for BMan private memory allocations Date: Wed, 29 Mar 2017 17:13:53 -0400 Message-ID: <1490822037-6752-2-git-send-email-roy.pledge@nxp.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1490822037-6752-1-git-send-email-roy.pledge@nxp.com> References: <1490822037-6752-1-git-send-email-roy.pledge@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131352956415471185; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.158.2; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(336005)(39450400003)(39380400002)(39400400002)(39850400002)(39860400002)(39840400002)(39410400002)(2980300002)(1109001)(1110001)(339900001)(199003)(189002)(9170700003)(86362001)(3450700001)(105606002)(2906002)(36756003)(6666003)(5003940100001)(43066003)(38730400002)(2201001)(53936002)(2950100002)(305945005)(106466001)(8936002)(54906002)(4720700003)(8676002)(50226002)(33646002)(81156014)(356003)(77096006)(5660300001)(81166006)(8656002)(189998001)(4326008)(104016004)(50466002)(48376002)(230783001)(76176999)(50986999)(47776003)(85426001)(217873001); DIR:OUT; SFP:1101; SCL:1; SRVR:SN1PR0301MB1967; H:az84smr01.freescale.net; FPR:; SPF:Fail; MLV:ovrnspm; A:1; MX:1; PTR:InfoDomainNonexistent; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11FD006; 1:qcU8Z9WSSOyDnvRy1rPQVPGDg4UyT8SI2bEELuvMx0PF+J92Zh3FB2T71Ls+EI1q2nywA8i3OU++8+hTycvoHccbVeIds6msDzFxsQUSkpZAKvlSixfLm3JE1k6WiSnQiM1cT8LjFrrgSBnmV8pMP6P9wC5RWSNFJUP+3kzXATzORr7wnPAhg+14mSyLwKAuctHnaGwbyMj07q9IAu5mAM0jPufD+9TbqjCt1/O33Sbywt+0BhzvZO+EIIjXOvDkK8CR38mVpNMN0KBxUkbmtKUMZMO4Ich7mIz2oW9J7epIYiB1HYoo8jBPVegcE+2eEBxcAhBJ+6o48dLIS1958kzRM9KNbptaDyFWu76tPTwCE1/ggQGsEgKRcV2FUEUEzLIlf+Ti5ZLaEV7JS5H8idYT5CYNPL0XgX0zpWvCXJEhj7E1JgmYTwAs3xGmdZMV3LD38ODQwetHJzXb6hCEphA51SRUbijUFQ8HNAJAZ/nw5sbr0NCfxPq9sH86Sb7AmMYJ/wiPbiv0uS9bQvgXj09S0gCSF8O9EqsMVhvIy9lNxIRZ4vDujqf+0K66HFxUjx3/T7EkTIplSs7k/S+Wp2rQB0NEDGZYOxeRhchSxFP9FDgfuflRq2kcLz4IdVUTJtL0Ai37u7o0NHrdddMYbSfkPUUbzqe14Vv6/EcxMjdD4TnEIv92iBy1gktkhko5Kfavd68c0gId7LemLx+qiqBkJf3sTroy6cIzB5E2ipM= MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: 7ce7d1bc-1af6-4e9d-6e51-08d476e885ce X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030255075)(201703131430075)(201703131517081); SRVR:SN1PR0301MB1967; X-Microsoft-Exchange-Diagnostics: 1; SN1PR0301MB1967; 3:BSuPI8gja9OK3gZwdp5rnOfITUkvAtqidiubgAQ2L7WsZiCvNLkONzJmbSgqPNoH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dpg+74Y5zwdCJbLlVzsuu97PZWsUwwHrPvMMYK/TzGPsPMV4C7ku1JdcF9xT0Vdp+5Cxcgvy5m4WTGwHrLJ/OAGesWMvQBGxB1gWXGXiXziTrj5GLMGOADaes+yCYeUU3XU39IiUcD9bJCQkBMfA+YkEDXNzo0= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197)(275809806118684); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6095135)(601004)(2401047)(8121501046)(13015025)(13024025)(5005006)(13017025)(13018025)(13023025)(10201501046)(3002001)(6055026)(6096035)(20161123561025)(20161123563025)(20161123565025)(20161123556025)(20161123559025)(201703131430075)(201703131441075)(201703131448075)(201703131433075)(201703161259075); SRVR:SN1PR0301MB1967; BCL:0; PCL:0; RULEID:(400006); SRVR:SN1PR0301MB1967; X-Microsoft-Exchange-Diagnostics: 1; SN1PR0301MB1967; 4:OMMJUfM520DiSuGdsRdYILQJyMtILNYTjAms/KZVMNEbikI6o5IFgCafVBngrMZff3uUB82BF627+P9IqKBRuOFsaOn+YGa4LPLCI/vwrTdbYdXcj/6t1mniuoPKY3HWtosCuJj8onysMqgsFao4QXHq3SZg7JNy7EL53XLcQeenY4MxAd6PsaeR3thBlrn5maSrU/K1FoZWmFGQSbHmTwfxgPIuBHE+4rwaLz2ZjTnq86jJJeChXrAjiOkDaBvDf0+s/or5udw0VrxbxOV6Bv0knCaI31lMa6a2+SSLhnjWuq8/e4pN2LxoNAYrmgpK40WT4U0SR7N2IFJVEMNqs7o5Ww0ia9JK1S5rdjuqydeYQP3/ohfecLZ84bk2/whff2H7mOom2wbj0oGRXWFbKPZtWZTkaNfGTPttt2IcjYiR5vH4mRPh3VSChvZqfmOoLAwzIToS7+Ji5+Zw03763aCKL4wcRSyk2txRwyrh2Wp7ZU+bF4Nt2QAlQAOiAmlrea6paFO+vZP3ibQpEcNWW8REVd1Zc1n5RnKNUuRffFJbBUHaE7SHwHOfZoYi4Y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y7NxpzgYjlPRSxBn?= =?us-ascii?Q?AncXIfJUiCoPghqfwZP3ijmgHWUmoV9bouEriEctGqTVHveDupy/kIzFwoQp?= =?us-ascii?Q?9tGXW7hlpvrN8LpX130ENy4ydLMQN9s7h2byh/T6Kx/4d98UmaehcyWybyd/?= =?us-ascii?Q?p8Kd1GTvaXK08AvT4TdhKLw7S3Mpxywf/PwAR7o7NU7THSjajbEQZCmmxE9o?= =?us-ascii?Q?S6ZT+3rrrr+zXFKCsmTj1ZhvabosMA4vU58noGiiw7JzlqS11KOsyj2GMIXX?= =?us-ascii?Q?3LrX8TdEFLh8jdwisPni1b6tbhAo3pNBfQeOfdSr5IMOmnyMrY4GRTiuWtAL?= =?us-ascii?Q?dCijKxLNGZ8F5SpG14ais5NC3bBHA73k/f2DiU1wj52iyM3WPNCCiMY67yEg?= =?us-ascii?Q?eWhu2MAqzFejoy3JaEvy+v8Y/mehqAoGBEnzXqZvaUyb0AWoLdPXnAK013OJ?= =?us-ascii?Q?OErazdFnpB8r4hgfOGv9I0PgfIdZLF1uISvA6CEELJxwVC7ZQC0JU5M3FFOR?= =?us-ascii?Q?TETHDScsVFfOHWYScM79fleG9aZTf8aS05LIEByFL7krq2m0wLfbjZSM0vbO?= =?us-ascii?Q?hTIFjzIk1KhKX9oUhe29zHUMq2cqf5Ir2amB2q87oMo7S9TrzL/T8dxhb3HZ?= =?us-ascii?Q?jRo0olymdABqSqxsAyCus/y45AcvZDjEdM6Xdw8uv39RI1/C025zQt9E8J0a?= =?us-ascii?Q?EIUPxGBnywacA83W9Y4TjhMT1mwnvUCNHNEacxV5jwATi5FNX60RTShsrxHG?= =?us-ascii?Q?3iI5AFYJKFznr7C74B4Uo12o0CTaGLe0BEZogeA2ga2sONkkMrcxOWyXOcyO?= =?us-ascii?Q?9tM6wjRMKuACIZkbZO9n07ZU=3D?= X-Microsoft-Exchange-Diagnostics: 1; SN1PR0301MB1967; 6:qtJafry2m8QXb2ZnqKCI+vab38ihqqutHgryZKnj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bFB9SBywWG9HMbxw== X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Mar 2017 21:14:01.3287 (UTC) X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e; Ip=[192.88.158.2]; Helo=[az84smr01.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1PR0301MB1967 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170329_141423_417336_7C9C8F26 X-CRM114-Status: UNSURE ( 9.47 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: roy.pledge@nxp.com Cc: Roy Pledge , madalin.bucur@nxp.com Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Use the shared-memory-pool mechanism for free buffer proxy record area allocation. Signed-off-by: Roy Pledge --- drivers/soc/fsl/qbman/bman_ccsr.c | 27 ++++++++++++++++++++++++++- drivers/soc/fsl/qbman/bman_priv.h | 3 +++ 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/drivers/soc/fsl/qbman/bman_ccsr.c b/drivers/soc/fsl/qbman/bman_ccsr.c index a8e8389..5485c3c 100644 --- a/drivers/soc/fsl/qbman/bman_ccsr.c +++ b/drivers/soc/fsl/qbman/bman_ccsr.c @@ -170,10 +170,11 @@ static int fsl_bman_probe(struct platform_device *pdev) { int ret, err_irq; struct device *dev = &pdev->dev; - struct device_node *node = dev->of_node; + struct device_node *mem_node, *node = dev->of_node; struct resource *res; u16 id, bm_pool_cnt; u8 major, minor; + u64 size; res = platform_get_resource(pdev, IORESOURCE_MEM, 0); if (!res) { @@ -201,6 +202,30 @@ static int fsl_bman_probe(struct platform_device *pdev) return -ENODEV; } + ret = of_reserved_mem_device_init(dev); + if (ret) { + dev_err(dev, "of_reserved_mem_device_init() failed 0x%x\n", ret); + return -ENODEV; + } + mem_node = of_parse_phandle(dev->of_node, "memory-region", 0); + if (mem_node) { + ret = of_property_read_u64(mem_node, "size", &size); + if (ret) { + dev_err(dev, "FBPR: of_address_to_resource fails 0x%x\n", ret); + return -ENODEV; + } + fbpr_sz = size; + } else { + dev_err(dev, "No memory-region found for FBPR\n"); + return -ENODEV; + } + if (!dma_zalloc_coherent(dev, fbpr_sz, &fbpr_a, 0)) { + dev_err(dev, "Alloc FBPR memory failed\n"); + return -ENODEV; + } + + dev_info(dev, "Allocated FBPR 0x%llx 0x%zx\n", fbpr_a, fbpr_sz); + bm_set_memory(fbpr_a, fbpr_sz); err_irq = platform_get_irq(pdev, 0); diff --git a/drivers/soc/fsl/qbman/bman_priv.h b/drivers/soc/fsl/qbman/bman_priv.h index f6896a2..765a4bf 100644 --- a/drivers/soc/fsl/qbman/bman_priv.h +++ b/drivers/soc/fsl/qbman/bman_priv.h @@ -33,6 +33,9 @@ #include "dpaa_sys.h" #include +#include +#include +#include /* Portal processing (interrupt) sources */ #define BM_PIRQ_RCRI 0x00000002 /* RCR Ring (below threshold) */