From patchwork Tue Aug 29 12:16:23 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Matyukevich X-Patchwork-Id: 9927241 X-Patchwork-Delegate: kvalo@adurom.com 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 30F3360380 for ; Tue, 29 Aug 2017 12:17:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 316F7288C9 for ; Tue, 29 Aug 2017 12:17:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 26468288CD; Tue, 29 Aug 2017 12:17:22 +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=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0906F288C9 for ; Tue, 29 Aug 2017 12:17:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753755AbdH2MRU (ORCPT ); Tue, 29 Aug 2017 08:17:20 -0400 Received: from mail-dm3nam03on0054.outbound.protection.outlook.com ([104.47.41.54]:63111 "EHLO NAM03-DM3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753616AbdH2MRO (ORCPT ); Tue, 29 Aug 2017 08:17:14 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quantenna.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=iAVAF3me4NLC38pxb6CKoUPIcvBiIfJkli+YuhPl/rA=; b=JCXqKxWxzrhSEsTDKbY/97R8lsF5GinnQ+y+7d1ShucDe8qokrWsb4L2EX8dUN6JCaGkTIhzNTm+ao5e6G9Nlu49VCkhJSpkALt85ClqpE9et9Yt37j2IwMEhYmYO+wQBfFQd7uyJiW8pBcfg0S+jytKaCpsh5VWnt+01DEcI5M= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=sergey.matyukevich.os@quantenna.com; Received: from bars.quantenna.com (195.182.157.78) by BY2PR05MB1927.namprd05.prod.outlook.com (10.163.32.141) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.13.2; Tue, 29 Aug 2017 12:17:11 +0000 From: Sergey Matyukevich To: linux-wireless@vger.kernel.org Cc: Igor Mitsyanko , Avinash Patil , Sergey Matyukevich Subject: [PATCH 5/5] qtnfmac: implement 64-bit dma support Date: Tue, 29 Aug 2017 15:16:23 +0300 Message-Id: <20170829121623.24761-6-sergey.matyukevich.os@quantenna.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170829121623.24761-1-sergey.matyukevich.os@quantenna.com> References: <20170829121623.24761-1-sergey.matyukevich.os@quantenna.com> MIME-Version: 1.0 X-Originating-IP: [195.182.157.78] X-ClientProxiedBy: HE1PR07CA0006.eurprd07.prod.outlook.com (10.160.74.144) To BY2PR05MB1927.namprd05.prod.outlook.com (10.163.32.141) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: dfa767c9-109e-43b8-9147-08d4eed7e130 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(2017030254152)(300000503095)(300135400095)(201703131423075)(201703031133081)(201702281549075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095); SRVR:BY2PR05MB1927; X-Microsoft-Exchange-Diagnostics: 1; BY2PR05MB1927; 3:bJEASQON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4kc5DPylPWHI/9uqDWsi8Kh13Z29a/Nxg5ZI6O68eftvPjG38ZyvCch0PkJy47tseFrKQEe4ztx7ANP/GncCNYqsSEtUBGTGuT2SqmssTuvwkqjHnPLZHRl0gLHlZ5f6jFC9P+m6Wztu3ZiUrjSW17Kk4XGBfud2FPBY5UMr5nlXVKr7C42oFPgjg8r7DHzGcQzCNYfh2NGy2NgGaxF59flnqdjSXyrdwoz3HSk7wb5Gdn7KgV6ERf07zwrxPgCGJ+6kfIeKBN294q9peHggz2X/XqO1S0O8f5lz/psvmvdG9rOyR3CVid8YpMDtbXzph3H2DIMg02XmCSBNsdAY; 4:d/iJNapMn5d9tio7fQCVM2Q7YGDpCr9K8rPO7ixPRM/i7sVpVwOjORgHzmbB68YNQF8NXnaL09LKfiZETmCqVYUAPv4i8bkXebXqyKxZoOKTc7wRSxQG3ImQUYfce/1Go1rCDGWHRrxonSHpz1bDaBkySgSRkH0eZ8FNbBeJQjIOTf391/0xW58O5baD5KQE8CshgSQeWWB0hGM2vv2L0rpwq5YHGHR/SGlKZknzrah5SGdmENxa7hKFhxir7qfl X-Exchange-Antispam-Report-Test: UriScan:; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(8121501046)(5005006)(3002001)(93006095)(93001095)(10201501046)(100000703101)(100105400095)(6041248)(20161123558100)(20161123564025)(20161123560025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123562025)(20161123555025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:BY2PR05MB1927; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:BY2PR05MB1927; X-Forefront-PRVS: 0414DF926F X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(7370300001)(4630300001)(6009001)(39830400002)(189002)(199003)(2906002)(66066001)(5660300001)(6486002)(478600001)(305945005)(6116002)(3846002)(7350300001)(103116003)(33646002)(2361001)(5890100001)(106356001)(2351001)(105586002)(69596002)(86362001)(42186005)(53416004)(7736002)(47776003)(6666003)(68736007)(50226002)(48376002)(50986999)(107886003)(25786009)(110136004)(76176999)(2950100002)(97736004)(6916009)(1076002)(50466002)(54906002)(36756003)(81156014)(189998001)(53936002)(101416001)(4326008)(8676002)(81166006)(5003940100001); DIR:OUT; SFP:1101; SCL:1; SRVR:BY2PR05MB1927; H:bars.quantenna.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; Received-SPF: None (protection.outlook.com: quantenna.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BY2PR05MB1927; 23:wFHFdA7Hui/3t9Z0QtwCsTzzp/DiGYHlmPmnbrUix?= =?us-ascii?Q?byQI/nSG5erLEZdcGE+7RceNlKiLjZqNKKcoldj+tBnEC95lbhv+F6PqHSBk?= =?us-ascii?Q?C2Yf9DrstgP4SWT4fmUGBWuDS5jZa6+4p+bJUA0oIKVuVUdVLAtI4eoJeNtz?= =?us-ascii?Q?iE0llMlF4vWRMrxuD+akVpknr8xUCRe8Ouq8MNanyQu/2ME/PpX8I6C/jqtU?= =?us-ascii?Q?lAWAfK8w2WQ+zKdCnbcYfxcNemQueurFj+m6stpWRXjIu/d+M5i6gFpQuziI?= =?us-ascii?Q?IOqiZW0PNVr1ZYWBy0VosoEnvdqlLiGVO0KFLLONe6onU20jh4A51Wddq23Q?= =?us-ascii?Q?bs9tO6ftQzBl5EtdFIKdEGJRiu3gcsU7106HQEqYn6dwot6epylVArJ0BGx+?= =?us-ascii?Q?7CkvMrDmDYEbDKItOsyL88LU43b6pBfAXkn0Ypx0MJZsQCom8DRlJxid64UJ?= =?us-ascii?Q?Z9T3I3qEorF019nKpFp3l5yXZMoiRH+5/wxOPNFopmhAP8KcnzPv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HmF/ghra3MImexKZsghlK15Cg+qVuG1hMcLUyVE4gRShuQFCFjhP63eNMKjfpj4lWAKG3qVG0+TvDcLeutzTljC0omq2n0E7k/qoekfI4e9R/AeUKWpbLt6MkwlybXSQcKfQApRdTrIAQgFDopL14kRpHRVMKiDHT22+THmGsNE5MPPQH4MDCAH9MqAQr3pQy01ghpHZbcwAC7T3GMWpYy5q44Gi814FLEYZOh1zUJyeNNsRogsyvPF4A==; 5:mxwXFQjtL0RwrJ0N3eUezCF2Sc+WK0mn0EmKKYGWr3hnRrmYFKQmnpg5r1g8FqAFv2v5AVe2atwHcvJmyPiNqHq0/j6HmDk66bb19kJ3yMxlmP56MZcT+doFJkfh5qqA/gcXcr5A/YFaQ3YcZt7r9A==; 24:6uteSMVRDE8zd1TnDRd9aSuDCpwY5LdMqoN4fGwGzAG5CDY7xFCR/s6I+QCV5BV9irMMPHaqx5myxHv3Q5rTubgjSfDZON4gL9H4qXRcIm4=; 7:g6jBJ/hoqnMzPdbP3dnaudxSV/lC1wJtK/kDCjLaDNMR6ta/fodJ8GKgN2pBAMmIYKcql0HUyCDWpB4a9EfBApoH23FyGAc7sF4dtK9i1qrxKUfoxtw37IoOXOm6WrFbF1e86QiJ0AmBjeCg+qcj+UkQAbGy/m0JzmxDznmEFyIV3UvI3gnkDeikrl5aXIYvNfK7gESkqR9KuHQYR8tWPEba6lP9zLvHAutJWSKdfXQ= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: quantenna.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Aug 2017 12:17:11.6392 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY2PR05MB1927 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Use 64-bit dma for hosts with CONFIG_ARCH_DMA_ADDR_T_64BIT enabled. Signed-off-by: Sergey Matyukevich --- .../net/wireless/quantenna/qtnfmac/pearl/pcie.c | 70 ++++++++++++++++++---- .../wireless/quantenna/qtnfmac/pearl/pcie_ipc.h | 10 ++-- .../quantenna/qtnfmac/pearl/pcie_regs_pearl.h | 1 + 3 files changed, 65 insertions(+), 16 deletions(-) diff --git a/drivers/net/wireless/quantenna/qtnfmac/pearl/pcie.c b/drivers/net/wireless/quantenna/qtnfmac/pearl/pcie.c index 2921d8069bf2..502e72b7cdcc 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/pearl/pcie.c +++ b/drivers/net/wireless/quantenna/qtnfmac/pearl/pcie.c @@ -403,10 +403,12 @@ static int alloc_bd_table(struct qtnf_pcie_bus_priv *priv) priv->rx_bd_vbase = vaddr; priv->rx_bd_pbase = paddr; - writel(QTN_HOST_LO32(paddr), - PCIE_HDP_TX_HOST_Q_BASE_L(priv->pcie_reg_base)); +#ifdef CONFIG_ARCH_DMA_ADDR_T_64BIT writel(QTN_HOST_HI32(paddr), PCIE_HDP_TX_HOST_Q_BASE_H(priv->pcie_reg_base)); +#endif + writel(QTN_HOST_LO32(paddr), + PCIE_HDP_TX_HOST_Q_BASE_L(priv->pcie_reg_base)); writel(priv->rx_bd_num | (sizeof(struct qtnf_rx_bd)) << 16, PCIE_HDP_TX_HOST_Q_SZ_CTRL(priv->pcie_reg_base)); @@ -447,8 +449,10 @@ static int skb2rbd_attach(struct qtnf_pcie_bus_priv *priv, u16 index) /* sync up all descriptor updates */ wmb(); +#ifdef CONFIG_ARCH_DMA_ADDR_T_64BIT writel(QTN_HOST_HI32(paddr), PCIE_HDP_HHBM_BUF_PTR_H(priv->pcie_reg_base)); +#endif writel(QTN_HOST_LO32(paddr), PCIE_HDP_HHBM_BUF_PTR(priv->pcie_reg_base)); @@ -503,9 +507,28 @@ static void free_xfer_buffers(void *data) } } +static int qtnf_hhbm_init(struct qtnf_pcie_bus_priv *priv) +{ + u32 val; + + val = readl(PCIE_HHBM_CONFIG(priv->pcie_reg_base)); + val |= HHBM_CONFIG_SOFT_RESET; + writel(val, PCIE_HHBM_CONFIG(priv->pcie_reg_base)); + usleep_range(50, 100); + val &= ~HHBM_CONFIG_SOFT_RESET; +#ifdef CONFIG_ARCH_DMA_ADDR_T_64BIT + val |= HHBM_64BIT; +#endif + writel(val, PCIE_HHBM_CONFIG(priv->pcie_reg_base)); + writel(priv->rx_bd_num, PCIE_HHBM_Q_LIMIT_REG(priv->pcie_reg_base)); + + return 0; +} + static int qtnf_pcie_init_xfer(struct qtnf_pcie_bus_priv *priv) { int ret; + u32 val; priv->tx_bd_num = tx_bd_size_param; priv->rx_bd_num = rx_bd_size_param; @@ -518,12 +541,32 @@ static int qtnf_pcie_init_xfer(struct qtnf_pcie_bus_priv *priv) return -EINVAL; } + val = priv->tx_bd_num * sizeof(struct qtnf_tx_bd); + if (val > PCIE_HHBM_MAX_SIZE) { + pr_err("tx_bd_size_param %u is too large\n", + priv->tx_bd_num); + return -EINVAL; + } + if (!priv->rx_bd_num || !is_power_of_2(priv->rx_bd_num)) { pr_err("rx_bd_size_param %u is not power of two\n", priv->rx_bd_num); return -EINVAL; } + val = priv->rx_bd_num * sizeof(dma_addr_t); + if (val > PCIE_HHBM_MAX_SIZE) { + pr_err("rx_bd_size_param %u is too large\n", + priv->rx_bd_num); + return -EINVAL; + } + + ret = qtnf_hhbm_init(priv); + if (ret) { + pr_err("failed to init h/w queues\n"); + return ret; + } + ret = alloc_skb_array(priv); if (ret) { pr_err("failed to allocate skb array\n"); @@ -653,10 +696,13 @@ static int qtnf_pcie_data_tx(struct qtnf_bus *bus, struct sk_buff *skb) /* write new TX descriptor to PCIE_RX_FIFO on EP */ txbd_paddr = priv->tx_bd_pbase + i * sizeof(struct qtnf_tx_bd); - writel(QTN_HOST_LO32(txbd_paddr), - PCIE_HDP_HOST_WR_DESC0(priv->pcie_reg_base)); + +#ifdef CONFIG_ARCH_DMA_ADDR_T_64BIT writel(QTN_HOST_HI32(txbd_paddr), PCIE_HDP_HOST_WR_DESC0_H(priv->pcie_reg_base)); +#endif + writel(QTN_HOST_LO32(txbd_paddr), + PCIE_HDP_HOST_WR_DESC0(priv->pcie_reg_base)); if (++i >= priv->tx_bd_num) i = 0; @@ -1237,6 +1283,16 @@ static int qtnf_pcie_probe(struct pci_dev *pdev, const struct pci_device_id *id) pr_debug("successful init of PCI device %x\n", pdev->device); } +#ifdef CONFIG_ARCH_DMA_ADDR_T_64BIT + ret = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64)); +#else + ret = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32)); +#endif + if (ret) { + pr_err("PCIE DMA coherent mask init failed\n"); + goto err_base; + } + pcim_pin_device(pdev); pci_set_master(pdev); @@ -1258,12 +1314,6 @@ static int qtnf_pcie_probe(struct pci_dev *pdev, const struct pci_device_id *id) goto err_base; } - ret = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32)); - if (ret) { - pr_err("PCIE DMA mask init failed\n"); - goto err_base; - } - ret = devm_add_action(&pdev->dev, free_xfer_buffers, (void *)pcie_priv); if (ret) { pr_err("custom release callback init failed\n"); diff --git a/drivers/net/wireless/quantenna/qtnfmac/pearl/pcie_ipc.h b/drivers/net/wireless/quantenna/qtnfmac/pearl/pcie_ipc.h index 667f5ec457e3..c5a4e46d26ef 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/pearl/pcie_ipc.h +++ b/drivers/net/wireless/quantenna/qtnfmac/pearl/pcie_ipc.h @@ -57,16 +57,14 @@ | PCIE_HDP_INT_EP_RXDMA \ ) -#if BITS_PER_LONG == 64 +#ifdef CONFIG_ARCH_DMA_ADDR_T_64BIT #define QTN_HOST_HI32(a) ((u32)(((u64)a) >> 32)) #define QTN_HOST_LO32(a) ((u32)(((u64)a) & 0xffffffffUL)) #define QTN_HOST_ADDR(h, l) ((((u64)h) << 32) | ((u64)l)) -#elif BITS_PER_LONG == 32 +#else #define QTN_HOST_HI32(a) 0 #define QTN_HOST_LO32(a) ((u32)(((u32)a) & 0xffffffffUL)) #define QTN_HOST_ADDR(h, l) ((u32)l) -#else -#error Unexpected BITS_PER_LONG value #endif #define QTN_SYSCTL_BAR 0 @@ -76,7 +74,7 @@ #define QTN_PCIE_BDA_VERSION 0x1002 #define PCIE_BDA_NAMELEN 32 -#define PCIE_HHBM_MAX_SIZE 512 +#define PCIE_HHBM_MAX_SIZE 2048 #define SKB_BUF_SIZE 2048 @@ -113,7 +111,7 @@ struct qtnf_pcie_bda { __le32 bda_flashsz; u8 bda_boardname[PCIE_BDA_NAMELEN]; __le32 bda_rc_msi_enabled; - __le32 bda_hhbm_list[PCIE_HHBM_MAX_SIZE]; + u8 bda_hhbm_list[PCIE_HHBM_MAX_SIZE]; __le32 bda_dsbw_start_index; __le32 bda_dsbw_end_index; __le32 bda_dsbw_total_bytes; diff --git a/drivers/net/wireless/quantenna/qtnfmac/pearl/pcie_regs_pearl.h b/drivers/net/wireless/quantenna/qtnfmac/pearl/pcie_regs_pearl.h index 69696f118769..5b48b425fa7f 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/pearl/pcie_regs_pearl.h +++ b/drivers/net/wireless/quantenna/qtnfmac/pearl/pcie_regs_pearl.h @@ -109,6 +109,7 @@ #define HHBM_WR_REQ (BIT(0)) #define HHBM_RD_REQ (BIT(1)) #define HHBM_DONE (BIT(31)) +#define HHBM_64BIT (BIT(10)) /* offsets for dual PCIE */ #define PCIE_PORT_LINK_CTL(base) ((base) + 0x0710)