From patchwork Wed Mar 15 15:46:01 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kalle Valo X-Patchwork-Id: 9625993 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 78950604A9 for ; Wed, 15 Mar 2017 15:46:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6B66728652 for ; Wed, 15 Mar 2017 15:46:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5FEDD2865A; Wed, 15 Mar 2017 15:46:41 +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=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 F2DBA28654 for ; Wed, 15 Mar 2017 15:46:40 +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:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:To:From:Subject:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=3sIdX7c3xzXgZ6eV3urHfReRdPG4hU8oQPlNcriQpAU=; b=rHuTYAHOZqykoN pOTTnAj7zDsRNL0hKGf7PGY7NXWmw45WoByO5rdE7j2VqvzqK+gviQS3fez9USssw5KL6MZRLDSby gUl1wEoclxdmVy9l/M+6Q/4/0mGbhywbF8vkRf5blLCAUHC9sXCW2rFB4aCEg99/c0GZVviCaWkm5 pTfB/1kLg7QdcQA5R+MsVXpstbOqJLE86IvSAP4V4IHUFHufnPz+ZT2qziNCVYe1OyRTfSw+Oo6PC DR5Vm5RzRQ2EEiZ+gF8xQAV3CJZCaSvPT4CQqQgdrE6svTpzi5SV9x9drU0SM2oa17zhBp24NsLU/ 29VIEIuhsEohJt7rekQw==; 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 1coB8F-0006jP-Sz; Wed, 15 Mar 2017 15:46:35 +0000 Received: from wolverine02.qualcomm.com ([199.106.114.251]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1coB8C-0006fY-Hr for ath10k@lists.infradead.org; Wed, 15 Mar 2017 15:46:34 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=qca.qualcomm.com; i=@qca.qualcomm.com; q=dns/txt; s=qcdkim; t=1489592792; x=1521128792; h=subject:from:to:cc:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=9TuOf5k2PFsMuyMKQoL3trMpAYruqR4uVP13/I/m9bY=; b=QDSgyOJQ9vFZdD3AwU1YPURG4sTn+5zCSBZYobm4Ckbs3Zc3xR9DLU2R uXIwejL0/r3wL6YfYKl71PWAiXyJbPcdQ5cTsRhCNq1vBE9Utn1zILK/N GxveBJKuLtDwnxlyG8EYIFhmAfqSiy+F+bdMTjqWrLhh2DP5JYOCZW+IX s=; X-IronPort-AV: E=Sophos;i="5.36,169,1486454400"; d="scan'208";a="366196042" Received: from unknown (HELO Ironmsg04-R.qualcomm.com) ([10.53.140.108]) by wolverine02.qualcomm.com with ESMTP; 15 Mar 2017 08:46:12 -0700 X-IronPort-AV: E=McAfee;i="5800,7501,8467"; a="1381934421" X-MGA-submission: =?us-ascii?q?MDG10WZ5W974OcGWLygYKIaW7DBNVhf/UrotmL?= =?us-ascii?q?1txjiLe4v4pEFXt3YLCo9VytAa/oOYM/TkhDu2Xq4l8voR+YM8BV24h6?= =?us-ascii?q?TXC1MBLehz4dK+DfaXH6iUJTfB+ML5aD+nOf7h2R30MJr4FWEXKP9xex?= =?us-ascii?q?7l?= Received: from nasanexm02d.na.qualcomm.com ([10.85.0.44]) by Ironmsg04-R.qualcomm.com with ESMTP/TLS/RC4-SHA; 15 Mar 2017 08:46:11 -0700 Received: from euamsexm01a.eu.qualcomm.com (10.251.127.40) by NASANEXM02D.na.qualcomm.com (10.85.0.44) with Microsoft SMTP Server (TLS) id 15.0.1178.4; Wed, 15 Mar 2017 08:46:11 -0700 Received: from potku.adurom.net (10.80.80.8) by euamsexm01a.eu.qualcomm.com (10.251.127.40) with Microsoft SMTP Server (TLS) id 15.0.1178.4; Wed, 15 Mar 2017 16:46:06 +0100 Subject: [PATCH v6 06/10] ath10k: add sdio extra initializations From: Kalle Valo To: Date: Wed, 15 Mar 2017 17:46:01 +0200 Message-ID: <148959276143.31432.4108050733445067980.stgit@potku.adurom.net> In-Reply-To: <148959263520.31432.8488419244476213373.stgit@potku.adurom.net> References: <148959263520.31432.8488419244476213373.stgit@potku.adurom.net> User-Agent: StGit/0.17.1-17-ge4e0 MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: NASANEXM01F.na.qualcomm.com (10.85.0.32) To euamsexm01a.eu.qualcomm.com (10.251.127.40) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170315_084632_963750_0E3281FD X-CRM114-Status: UNSURE ( 7.67 ) X-CRM114-Notice: Please train this message. X-BeenThere: ath10k@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-wireless@vger.kernel.org Sender: "ath10k" Errors-To: ath10k-bounces+patchwork-ath10k=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Erik Stromdahl Extra initializations needed by all sdio boards. Derived from qcacld. Signed-off-by: Erik Stromdahl Signed-off-by: Kalle Valo --- drivers/net/wireless/ath/ath10k/core.c | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/ath/ath10k/core.c b/drivers/net/wireless/ath/ath10k/core.c index f450ebbb28d5..6b6ea8a571fa 100644 --- a/drivers/net/wireless/ath/ath10k/core.c +++ b/drivers/net/wireless/ath/ath10k/core.c @@ -377,7 +377,22 @@ static void ath10k_send_suspend_complete(struct ath10k *ar) complete(&ar->target_suspend); } -static int ath10k_init_configure_target(struct ath10k *ar) +static void ath10k_sdio_extra_initialization(struct ath10k *ar) +{ + u32 param = 0; + + ath10k_bmi_write32(ar, hi_mbox_io_block_sz, 256); + ath10k_bmi_write32(ar, hi_mbox_isr_yield_limit, 99); + ath10k_bmi_read32(ar, hi_acs_flags, ¶m); + + param |= (HI_ACS_FLAGS_SDIO_SWAP_MAILBOX_SET | + HI_ACS_FLAGS_SDIO_REDUCE_TX_COMPL_SET | + HI_ACS_FLAGS_ALT_DATA_CREDIT_SIZE); + + ath10k_bmi_write32(ar, hi_acs_flags, param); +} + +static int ath10k_init_sdio(struct ath10k *ar) { u32 param_host; int ret; @@ -1900,7 +1915,7 @@ int ath10k_core_start(struct ath10k *ar, enum ath10k_firmware_mode mode, ath10k_bmi_start(ar); - if (ath10k_init_configure_target(ar)) { + if (ath10k_init_sdio(ar)) { status = -EINVAL; goto err; } @@ -1933,6 +1948,9 @@ int ath10k_core_start(struct ath10k *ar, enum ath10k_firmware_mode mode, if (status) goto err; + if (ar->hif.bus == ATH10K_BUS_SDIO) + ath10k_sdio_extra_initialization(ar); + ar->htc.htc_ops.target_send_suspend_complete = ath10k_send_suspend_complete;