From patchwork Thu Apr 13 08:30:05 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kalle Valo X-Patchwork-Id: 9678973 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 12C2C601C3 for ; Thu, 13 Apr 2017 08:30:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0512A28642 for ; Thu, 13 Apr 2017 08:30:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EE46428652; Thu, 13 Apr 2017 08:30:24 +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 A5EE628642 for ; Thu, 13 Apr 2017 08:30:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751678AbdDMIaX (ORCPT ); Thu, 13 Apr 2017 04:30:23 -0400 Received: from wolverine01.qualcomm.com ([199.106.114.254]:29923 "EHLO wolverine01.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751382AbdDMIaU (ORCPT ); Thu, 13 Apr 2017 04:30:20 -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=1492072220; x=1523608220; h=subject:from:to:cc:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=IiwGhVbyN2PMskpILG4E1NO3kZuWC7fFwXGoboaJDFg=; b=kTky5MRP3wqmB3kn7qKILX2SUUC2hfuaCcE+DNmBiJxilhkLqjJlq00s QCV1ZozWZnZK1YaJ6fmwIASdWG7r4QhLS2C0UmHNtUZJbOmzxONwNx/K1 xYn+QKMsLJv3BGsdC3yJi8gv0+rEfjjtB+iDv+oPf0pSVH6W3zjd3JRf9 o=; X-IronPort-AV: E=Sophos;i="5.37,194,1488873600"; d="scan'208";a="278400790" Received: from unknown (HELO ironmsg02-L.qualcomm.com) ([10.53.140.109]) by wolverine01.qualcomm.com with ESMTP; 13 Apr 2017 01:30:15 -0700 X-IronPort-AV: E=McAfee;i="5800,7501,8496"; a="904845250" X-MGA-submission: =?us-ascii?q?MDHgYb8RhKoxSDp61xpnsgFqciFbxpOcBVTm8f?= =?us-ascii?q?PMMnynAIB5v3M9GPdF42hEY1p1F0g2/WB5lvpvzUpZv5QFOZteiLbGow?= =?us-ascii?q?qCV0JdmY1L4BstEsQHXzeeAQxeZkPSZ/4tr7N/PSJcFBx41wzSZX4fjt?= =?us-ascii?q?m2?= Received: from nasanexm01e.na.qualcomm.com ([10.85.0.31]) by ironmsg02-L.qualcomm.com with ESMTP/TLS/RC4-SHA; 13 Apr 2017 01:30:15 -0700 Received: from euamsexm01a.eu.qualcomm.com (10.251.127.40) by NASANEXM01E.na.qualcomm.com (10.85.0.31) with Microsoft SMTP Server (TLS) id 15.0.1178.4; Thu, 13 Apr 2017 01:30:14 -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; Thu, 13 Apr 2017 10:30:09 +0200 Subject: [PATCH v7 06/10] ath10k: add sdio extra initializations From: Kalle Valo To: CC: Date: Thu, 13 Apr 2017 11:30:05 +0300 Message-ID: <149207220550.4590.5420612965578988206.stgit@potku.adurom.net> In-Reply-To: <149207201649.4590.5821794186383265138.stgit@potku.adurom.net> References: <149207201649.4590.5821794186383265138.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: NASANEXM01B.na.qualcomm.com (10.85.0.82) 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 | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/drivers/net/wireless/ath/ath10k/core.c b/drivers/net/wireless/ath/ath10k/core.c index 1b4c08b5eaa9..15a9549aad07 100644 --- a/drivers/net/wireless/ath/ath10k/core.c +++ b/drivers/net/wireless/ath/ath10k/core.c @@ -377,6 +377,21 @@ static void ath10k_send_suspend_complete(struct ath10k *ar) complete(&ar->target_suspend); } +static void ath10k_init_sdio(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_configure_target(struct ath10k *ar) { u32 param_host; @@ -1941,6 +1956,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_init_sdio(ar); + ar->htc.htc_ops.target_send_suspend_complete = ath10k_send_suspend_complete;