From patchwork Mon May 1 21:30:03 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roy Pledge X-Patchwork-Id: 9706915 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 EE43A602B5 for ; Mon, 1 May 2017 21:30:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DD2361FFB9 for ; Mon, 1 May 2017 21:30:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D152F28307; Mon, 1 May 2017 21:30:57 +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 4AF421FFB9 for ; Mon, 1 May 2017 21:30:57 +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=516uIThCW8uk3Y33hB5APVAy4z9Uzwjv8LlbuVrQUKQ=; b=TWGRQYmRNhQ/O6 4uhbPPHt39aawyeNkaj1NfTjEIjXOKI2KGoDCBguMl/w4isVqV5z5gnZcIVcRgZAby8chYZv++7Mm kCUnKPNcR3x+gFi70scFRucyaNemzFgt06/SxCmOD2cZKcOupS+anD197xI8jnfT3S8ZE0kCPXEje 2MP8JzI3qIrJsHDs5GqtxeyTOn8G13xeuRWcnSO4J3H7qU3xl9n3Lhuki+ptSX0zYXaDo1+c7R79q 8s5k6Gybt+xJfIFeDSwxBkqx8Gsmbk/IkFzaQ5lr5jC1dPcRp62Z/y0cfGoy4JVaMxvYc+Op/Fzir 8rcZ5mNTrYaYo+COXmzQ==; 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 1d5IuG-0001nz-GX; Mon, 01 May 2017 21:30:56 +0000 Received: from mail-co1nam03on0080.outbound.protection.outlook.com ([104.47.40.80] helo=NAM03-CO1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1d5Iu2-0001X1-AV for linux-arm-kernel@lists.infradead.org; Mon, 01 May 2017 21:30:44 +0000 Received: from DM5PR03CA0053.namprd03.prod.outlook.com (10.174.189.170) by BN6PR03MB2786.namprd03.prod.outlook.com (10.173.144.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1047.13; Mon, 1 May 2017 21:30:19 +0000 Received: from BL2FFO11OLC013.protection.gbl (2a01:111:f400:7c09::183) by DM5PR03CA0053.outlook.office365.com (2603:10b6:4:3b::42) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1061.12 via Frontend Transport; Mon, 1 May 2017 21:30:20 +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 BL2FFO11OLC013.mail.protection.outlook.com (10.173.160.161) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1047.9 via Frontend Transport; Mon, 1 May 2017 21:30:19 +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 v41LUGrX009537; Mon, 1 May 2017 14:30:17 -0700 From: Roy Pledge To: , , , , Subject: [PATCH v3 01/11] soc/fsl/qbman: Use shared-dma-pool for BMan private memory allocations Date: Mon, 1 May 2017 17:30:03 -0400 Message-ID: <1493674213-963-2-git-send-email-roy.pledge@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1493674213-963-1-git-send-email-roy.pledge@nxp.com> References: <1493674213-963-1-git-send-email-roy.pledge@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131381478195212370; (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)(39840400002)(39450400003)(39860400002)(39850400002)(39400400002)(39380400002)(39410400002)(2980300002)(1110001)(1109001)(339900001)(189002)(199003)(9170700003)(230783001)(43066003)(5660300001)(305945005)(81166006)(8936002)(76176999)(50226002)(36756003)(47776003)(189998001)(50986999)(4326008)(81156014)(105606002)(33646002)(3450700001)(85426001)(498600001)(48376002)(38730400002)(50466002)(54906002)(8656002)(104016004)(53936002)(2906002)(77096006)(5003940100001)(356003)(8676002)(6666003)(86362001)(106466001)(2201001)(2950100002)(2101003); DIR:OUT; SFP:1101; SCL:1; SRVR:BN6PR03MB2786; H:az84smr01.freescale.net; FPR:; SPF:Fail; MLV:ovrnspm; MX:1; A:1; PTR:InfoDomainNonexistent; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11OLC013; 1:bADbGP7KIFHJhnUQXr6ymaOXCrhTaEWgFJycb7CnicBCs69XAoQshKjO5Sm55ySD03E9m0/hVenlBCXok3REVjS9W5pwqgucWxuoOe0xzrkHt7oBBUd2+grv0fF0NAH4a+IFL3kT8vrJd8V3US5uY0u8/6xP7L8OQ0ie0UfmgRYARlcWyn3lJEvzVcmTaQpj8ssa4P1IWDAi8BuEvEKGnJH7hE7jDUqqespPHf237O75o8RI7m1Cyz2iGA/5JDYcpD8L1+4Rsx51jZpvVMf/xYYpZt1Y6mC29uOOw2FTCh81Q5eQ0go/QmFmOfe2IqXb5qdFbf8zltYhWrEJUbfPpsxnv6Y3aENgdEB3VFl6jkSdwVtNU0TFLf/XIl5rpAYCNd5bQzzy8kjAfWLH3KDv0H8MyCTlz0wGkwq18ccJjCIksSE00qaiQ64mDgHkm+keWG0GmlTi/N7lLL0kkF0EVdRczLCoJzpz+ljY9644n3XRFC4Ss4koYFT1kkeI4AJtAahtHHu71dTY19UG9Z9ADuU7j/kdtEW4V2/ajXKkMx4tvh5t19w5Sk21VDmEjvO2+7F5dCK5LcnTUTpb90AeS9e7FBt8L03/tPMVB6GYhdF9AI4SEong6SjXOlQLz5pguyh1pRK/ZoXBvamZ+XhHtehKK3WteMG1IkjYAxqTPjOEGTe1zXch80+coX7GGKVMV014x2LKdqk1khT4QyH56nFS9FVxN5dXWhcxH7d55XOJFb09ucBkiOzSmZKlrVOe MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: da4d747b-7e22-4a2a-cef5-08d490d94458 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(201703131430075)(201703131517081); SRVR:BN6PR03MB2786; X-Microsoft-Exchange-Diagnostics: 1; BN6PR03MB2786; 3:5akqXuk74a6pB26LLZWx1VrP5BMmxqmhVnEbQ++XWTzBQKhIcPnaUp9twHPhcFHf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nXegoMnBFWPmCxV75E1o5Xl2F9y/zWAahcrAkB9mH9x5+foWlx+uPXgJ/eZgEUxWgZzDlpan7eCk7biAmepotXdaSJ+Sq+eNAePhSV6g3s83il+Fme9ACDdIc= 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)(13024025)(13018025)(13023025)(13017025)(13015025)(8121501046)(5005006)(93006095)(93001095)(3002001)(10201501046)(6055026)(6096035)(201703131430075)(201703131433075)(201703131448075)(201703161259150)(20161123565025)(20161123556025)(20161123561025)(20161123563025); SRVR:BN6PR03MB2786; BCL:0; PCL:0; RULEID:(400006); SRVR:BN6PR03MB2786; X-Microsoft-Exchange-Diagnostics: 1; BN6PR03MB2786; 4:pvJp1O2Sl70wCeViid2smdDV1WRZ8RTmcnSLxjzTMSoA21Fpz6Eyx++nEUO44RfRqplRGIum77Fb3sliroSrg6MW12tPNHUa7D5CM5ECuZDO+/VhysJH9GC7UsyAi7oza3INmDU5UDmEu0Bi5W+h+hK+DwZ6kqDQLdldrBZDDkMLo0xipEwROF56DDxQFtTpGwFBZe42AVNzzewXdLmkbTEeGU52oLJjI1WC5MQLtSO0qWDyiv+cJIuIHPr/CThlkZUHOc8LfVVW9aPd9LrSX/tjt5y2jMJanJIkKlCAsMF7vYNbHUzrD7xciGZGXulTFwsBCYA8shbM459lmqpBQSys9F0U/3jH2MkA4jSkWlg8BLcregDizKQ92ni3+KKvQN8p6fyZIwjnhXwwDjhZ4jo3U5KMOcA6K544y36bSMyuO3zIGJuZBDd+7yZOoZv8Msxgxfouu3u5FNb3MbSwvf+nOmRdftH+zZ1oA/JuuY9S3MYN8PqPsFwGlPTyG5MKb3vYFpMd8RVcvnJTQoSqX/9omVbkQiVPRsQ+pX6yhlveI6DQnb0UOxVQcwNVGa3f57npSQlJpazeyUh14ZdLaW4UMGjeakSsuIMTqh01kRZNN+MkX22JUFeaLwz3rUop5WixnL1vEMtcpy8U50FlBwTBYvTw8wUJAu3XikRyeC5u7kPBXTSuxiXGNEhhXIWrOcVF7CGZZoNvdnjSETA9+TVix8wUHMnO1uoTj0QAZi21mrMDvPFWGAbIpwTKjpwEBcEOWo5j3HzzScwsy4Wn2T6aHzX/jW7ri1nxyKdTQEWt77j4SPPcQTAV7JWHXXRb6fFO95wmTu8oyX+MV+dDr1K0vuQvlGSgBSsRVE1sNyffPMAfjv7jofGb7s4cko8/YROsSkY+tK3I6GDQunitWAA9L1izSZnZvAp+uFZqSF8= X-Forefront-PRVS: 02945962BD X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN6PR03MB2786; 23:/JJ5oSycFbvqZmDEkXtTK8arrqwxL/vty5bgS+40v?= =?us-ascii?Q?hPgbgae4inRTsFxoVxoNj7jT/37rzmZgPJlOAun5UhQ0MbP6RWYUY/d3luZW?= =?us-ascii?Q?L0+cV4ahLpT3fPH2CKhSYlA0pCOLPYL2Xd41yKfmyyyvSx5kyQ5P6CA5BArf?= =?us-ascii?Q?ROgNBmdIHU5Z1lVAF9ov6952GddtkZu9sfMMEDJqU2CFdUGoa2KPfTxzIT5L?= =?us-ascii?Q?egfApowm7DkW+FRaY2HGVk/Jo8smWh2BR/Fqye3ZP3Y2HftYbi10s/ZIwZHk?= =?us-ascii?Q?kkX7o/xcB4/JsulM0Twq0bHKvg2FPFgL1t+vabZNrN9stiufXcTGTBHTzz9t?= =?us-ascii?Q?759a4YrgE/q7po5rpB+9iZt8SwhlFpDGzHEG/UPvP7GToYGDDPnhRDE7C5yy?= =?us-ascii?Q?oRfmAAo5k1BbU5Sv/r+Y7gdSufVa+JuRCX0P3xlG+XOCRH34W8FJYHt0bPuJ?= =?us-ascii?Q?IEET59Pjli8wUk+ObMAjaYXc/Wv1IRiAksImLcgXh5yhGJhejTypFqqeCxwW?= =?us-ascii?Q?mD/RtNFR5SCLj4yXd3rjY5tWWW19idtq0UyGOREDlRSOM8iR5QNn24Wt3u/8?= =?us-ascii?Q?H8AMY8WmzNUzjE9kApJqaqdMhe5QdJeXVeLzHQ5mrAuSkwf6cmxY7lTPHY54?= =?us-ascii?Q?VT/4b4GcZQsOjYuZSK//oCd8VvQvk8OVhylf0IBcdfFF/Sk9dGWJG66eswHo?= =?us-ascii?Q?vd4pCFMa13aGu5vHyvFIo4u8XcI2ieNzGV4jhaW9fn1w/9rEbZGFJvFGS8FF?= =?us-ascii?Q?8EwJQCENgJUWS7TDhWvuJzPPdCFyFbkfk1DvxviPaKZeei/9kvygLGRSvS2H?= =?us-ascii?Q?0NbCDcMlY3NyCijIWUH/N6le2uH7FHSSLWIHQ5s8r9EuT3FbppdMVGLBi7S4?= =?us-ascii?Q?dhWPn9I9P+fEh5tX4VRV68Zuf6ApDM7YU5wx1gNTXLdIMDaTQ54bqwXyzbSk?= =?us-ascii?Q?GiBNCDuBZ524MkM/je7JZoC19ZfbTkrq209YHNLx0eHfbAat1y2oS74//djM?= =?us-ascii?Q?GPdSQBSDyo+c++1Mtps+SN3xL8ZFA+AsmJ/7sFUrj+DCQ0WTwI2wo7LLSFfz?= =?us-ascii?Q?YZmwjxZFceaMunZ9dvYYt/R2/c6ycHvL3NiCkNm/EikGador3my/9LX3h4Ql?= =?us-ascii?Q?raZvt5oymY7DyV0BGk83I5k/w78ySM8874zGMOIdpNMngbyEFnsmoaVnqMR2?= =?us-ascii?Q?PvH4t6joGI7PnQVUxPI5b1g0xfdjSX3lllwbRP0jj/O1md5q+tlUTEXjv5YF?= =?us-ascii?Q?FN/uhppbEsPye5kJDrz2U8j/au1fesvh0UHFYS/46JPynXf2c1xt+96ixel3?= =?us-ascii?Q?tTEKfgCvsZByQy6h5WNcD4=3D?= X-Microsoft-Exchange-Diagnostics: 1; BN6PR03MB2786; 6:st18xjPyAO0cWGs4JbkBXjgBYOc3sEU2wrVxqPwxsiDcd78MpwlEbnyG0Oh044tcL4giN0AP3zfsNvmSqfBUGShHTMphHJma9N+M2oZt5pwp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F+qrE0Uz/ttjv+vi6fFuoEklQT1FHrMa1oANx/3ffSJZ3n1jeaMSHYA== X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 May 2017 21:30:19.2872 (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: BN6PR03MB2786 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170501_143042_544486_B23875F9 X-CRM114-Status: GOOD ( 11.21 ) 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@nxp.com, 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 | 35 ++++++++++++++++++++++++++++++++++- drivers/soc/fsl/qbman/bman_priv.h | 3 +++ 2 files changed, 37 insertions(+), 1 deletion(-) diff --git a/drivers/soc/fsl/qbman/bman_ccsr.c b/drivers/soc/fsl/qbman/bman_ccsr.c index a8e8389..f126dbd 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,38 @@ static int fsl_bman_probe(struct platform_device *pdev) return -ENODEV; } + /* + * If FBPR memory wasn't defined using the qbman compatiable string + * try using the of_reserved_mem_device method + */ + if (!fbpr_a) { + 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_dbg(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) */