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: 9626005 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 67BEF604A9 for ; Wed, 15 Mar 2017 15:49:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5A47821E5A for ; Wed, 15 Mar 2017 15:49:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4F5902810E; Wed, 15 Mar 2017 15:49:28 +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=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID 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 CEBD621E5A for ; Wed, 15 Mar 2017 15:49:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753985AbdCOPrw (ORCPT ); Wed, 15 Mar 2017 11:47:52 -0400 Received: from wolverine01.qualcomm.com ([199.106.114.254]:49143 "EHLO wolverine01.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753293AbdCOPqN (ORCPT ); Wed, 15 Mar 2017 11:46:13 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=qca.qualcomm.com; i=@qca.qualcomm.com; q=dns/txt; s=qcdkim; t=1489592772; x=1521128772; h=subject:from:to:cc:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=9TuOf5k2PFsMuyMKQoL3trMpAYruqR4uVP13/I/m9bY=; b=MbVinlMkgebTpIiqFps4ONPyw9E+hQ6+2p7nA5hZDAF8N7dRbQLJ7ijM K8332N0siqr00OKUgUAoEwIQTeXQvEoPRA6Pa7zGKlLseSgJEZcFuqAj9 cGhY49W2/TU/TszbCwEj1mINpcgVq1RO3xuWYrI/O4RIyRpziIQj37YRI Q=; X-IronPort-AV: E=Sophos;i="5.36,169,1486454400"; d="scan'208";a="270785844" Received: from unknown (HELO Ironmsg04-R.qualcomm.com) ([10.53.140.108]) by wolverine01.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: CC: 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) 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 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;