From patchwork Tue Feb 21 16:15:27 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Erik Stromdahl X-Patchwork-Id: 9585059 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 47E7A6042F for ; Tue, 21 Feb 2017 16:17:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 365C226E54 for ; Tue, 21 Feb 2017 16:17:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2B43E27DA4; Tue, 21 Feb 2017 16:17:23 +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_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FROM 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 E4E6826E54 for ; Tue, 21 Feb 2017 16:17:22 +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:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=3yioXye5ZKU+7dRst/IeQxgsKyIccqN1xv2LMI4ymM4=; b=n95uLQdA7C3yNiKbF1QsZlao6K kNwYid0LyXA/ykHPYkv9LBt+z7oMP1Cat3K5UjzpEv5naFdmqkVvWFuN1gtMlAFSFr7/jSNE/3Io4 OecSXG0Qr6nofCQDSfib3alaQ4etfriroBYq6gKXHUgUqtl5y1WXhwu3JL6ndnDztITeLfwoFRX47 2s5itTaOU1wQgeKhFzCp27fcUUEPx+FmbGmN35r5DDRhfx+w1Zeht/sVThHdPNK/qJidv5LhNAkjO Mq+8GZs0y0a3Eoakc2e/wVBxXNHkPPQdVPa2x8dHCx9XOyVlfMkVCtOoCJ4u1REaKdePlgtBVQInS S265PCnw==; 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 1cgD7s-0007LI-Np; Tue, 21 Feb 2017 16:17:16 +0000 Received: from mail-lf0-x244.google.com ([2a00:1450:4010:c07::244]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cgD7H-0006gn-4R for ath10k@lists.infradead.org; Tue, 21 Feb 2017 16:16:44 +0000 Received: by mail-lf0-x244.google.com with SMTP id 86so5300130lfv.0 for ; Tue, 21 Feb 2017 08:16:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=pf2a63dsPjP+eRzWL1rUENTmJYjx3gIPt87Id5tH0TQ=; b=HIJLmspGjKn/v3LxCC4MkQKGejRZ5KzNf+DlBE4OUBA4pQcDdJfemuq0mkn8AmxQ9H oEaCuUDtd+vrnCRLV089aO7xAvtGkZxoJP4suZOSH2iZ7YKyAx5jURGFmSb0VKs02RKw qWDi6SRhYXC3bElQ7m/R4IXewHAgfF8sZAQh2zimx+UK5QilfmzGmgbbYp/LJRD19+xP GErBNzF/rXOkmvbCJ3haEg3qQbkoGhk9cOlUkLydTQse/jTqSn6TAjEcCs0E3rdOa2qw yIH9rk4848DeJPKYivIpyuY6eBolRS0eNbatDwHUfMWGEvVMmHLGvY4AtAejln6GDRt2 Awig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=pf2a63dsPjP+eRzWL1rUENTmJYjx3gIPt87Id5tH0TQ=; b=uasYgl6KdkK0QCciFW+BMoeVgVXj93WvHWhhWZ6ApX8eGGSAcg1AvFr6VgglIlvP5t ast1gNQWi4Rs00WvyTRvy4NQ8FQV6eyv7iWEeiLqgC/elIFmFpHFDskmdlA2KtTXRcoz KRhQjGZ30ezcb9pO9+/+wi5itRbNvq9WFjmMWRre2mLtGS+G60tI7KFY9DV/dkLAjejj zrrMGUg6/N7VoOIEFUnJj5LyNAefF4z4rYD5DyxUfcQIf1mO4vckEGMDfezKNjckln// 6F1pLC3adsjLM+pNkVEymtYKz99lySvXX6TYSBtRdujJz/3SoGa6y8s72gjCVzpYYML8 CGvQ== X-Gm-Message-State: AMke39l6a0fYPEu9Pivg1sKWl8bx1AvLfKQegMULXh7PXktcvzpc6/JGEuYo1i2uenrVFA== X-Received: by 10.46.83.66 with SMTP id t2mr7555378ljd.82.1487693779088; Tue, 21 Feb 2017 08:16:19 -0800 (PST) Received: from erik-mate-1604.lan (90-227-62-61-no75.tbcn.telia.com. [90.227.62.61]) by smtp.gmail.com with ESMTPSA id t29sm6336069ljd.39.2017.02.21.08.16.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 21 Feb 2017 08:16:18 -0800 (PST) From: Erik Stromdahl To: kvalo@qca.qualcomm.com, linux-wireless@vger.kernel.org, ath10k@lists.infradead.org Subject: [RFC v4 07/21] ath10k: add sdio extra initializations Date: Tue, 21 Feb 2017 17:15:27 +0100 Message-Id: <1487693741-10042-8-git-send-email-erik.stromdahl@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1487693741-10042-1-git-send-email-erik.stromdahl@gmail.com> References: <1487693741-10042-1-git-send-email-erik.stromdahl@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170221_081639_548642_AB873271 X-CRM114-Status: UNSURE ( 7.97 ) 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: Erik Stromdahl MIME-Version: 1.0 Sender: "ath10k" Errors-To: ath10k-bounces+patchwork-ath10k=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Extra initializations needed by all sdio boards. Derived from qcacld. Signed-off-by: Erik Stromdahl --- drivers/net/wireless/ath/ath10k/core.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/drivers/net/wireless/ath/ath10k/core.c b/drivers/net/wireless/ath/ath10k/core.c index 83ab651..eae502e 100644 --- a/drivers/net/wireless/ath/ath10k/core.c +++ b/drivers/net/wireless/ath/ath10k/core.c @@ -377,6 +377,27 @@ static void ath10k_send_suspend_complete(struct ath10k *ar) complete(&ar->target_suspend); } +static void ath10k_sdio_extra_initialization(struct ath10k *ar) +{ + u32 param = 0; + + /* Turn on fwlog. + */ + ath10k_bmi_read32(ar, hi_option_flag, ¶m); + param &= ~(HI_OPTION_DISABLE_DBGLOG); + ath10k_bmi_write32(ar, hi_option_flag, param); + + 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; @@ -1916,6 +1937,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;