From patchwork Mon Jun 20 06:19:46 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Andersson X-Patchwork-Id: 70407 Delivered-To: patch@linaro.org Received: by 10.140.28.4 with SMTP id 4csp1359898qgy; Sun, 19 Jun 2016 23:20:27 -0700 (PDT) X-Received: by 10.107.53.5 with SMTP id c5mr19677555ioa.2.1466403624011; Sun, 19 Jun 2016 23:20:24 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g4si31267246pfj.47.2016.06.19.23.20.23; Sun, 19 Jun 2016 23:20:23 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=fail (p=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752442AbcFTGUL (ORCPT + 1 other); Mon, 20 Jun 2016 02:20:11 -0400 Received: from mail-pa0-f46.google.com ([209.85.220.46]:35913 "EHLO mail-pa0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752443AbcFTGTz (ORCPT ); Mon, 20 Jun 2016 02:19:55 -0400 Received: by mail-pa0-f46.google.com with SMTP id wo6so11346331pac.3 for ; Sun, 19 Jun 2016 23:19:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=OyKRpVD9IugGhBwjwPdOmRW3Uu0vYkM4kSBU+c07eVg=; b=JvGcMlM6400Xp6zyAvhP2Yc3mv0ahH1jCr8TXAhgcCi4jWkP57VA6Q2FX20zE8c5xa vmrBu7fhrC9bLdgmKkD44e0thj4bzkN+jZU2quEe3+vYJnfLgEL0ExBePF928JoV+X/u DyL0SPzHjST8GhEr6Mj+qnZQVy3sH/7JRNkUA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=OyKRpVD9IugGhBwjwPdOmRW3Uu0vYkM4kSBU+c07eVg=; b=JMUrs6a3wTf6LPX2Bz3dvv1LdJRouuDu6ODRzZSLXa4DIe/GNSw9Y/L90TY7+U9wxZ +DV5LbKegDpXeB1czDLmDMNgdmshft1sWG1VnsktDsaJ34d6qC6e961IizhREwiWOzDs VQYDhYDRsAnuwc73Wa9cci/NNTbkvTdU4YA/mfX0jyx4t4D4Dmao6SNqxrgeexpyL535 Aa/+QT+ZLc+mfVaeEeCOn9DP3f4JcTHzghio5erTwTDkEsebhtFw3tYHbl91lq08q0ob SWfAEOSkqGz0XguB3ies6sVjOcKIsqMO5cIiJATsanlLQ/r+5U1/Ph/C2dR/ai8XcBO7 wuAg== X-Gm-Message-State: ALyK8tLzsPjr9c29dbRt4TN9NrxZz2ZuVX/X1Dj5D5KPBNRf3p98ASul4T2jpa7QwdzQZ8+T X-Received: by 10.66.148.105 with SMTP id tr9mr19971277pab.72.1466403594386; Sun, 19 Jun 2016 23:19:54 -0700 (PDT) Received: from localhost.localdomain (ip68-111-223-48.sd.sd.cox.net. [68.111.223.48]) by smtp.gmail.com with ESMTPSA id o64sm84948683pfb.76.2016.06.19.23.19.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 19 Jun 2016 23:19:53 -0700 (PDT) From: Bjorn Andersson To: Eugene Krasnikov , Kalle Valo Cc: wcn36xx@lists.infradead.org, linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org Subject: [PATCH 4/6] wcn36xx: Correct DXE chip version differentiation Date: Sun, 19 Jun 2016 23:19:46 -0700 Message-Id: <1466403588-7041-4-git-send-email-bjorn.andersson@linaro.org> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1466403588-7041-1-git-send-email-bjorn.andersson@linaro.org> References: <1466403588-7041-1-git-send-email-bjorn.andersson@linaro.org> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org The CCU block in WCNSS is configured for appropriate routing of interrupts from the DXE to the application cpu, this is not dependant on the iris version (wcn3660 vs wcn3680), but rather if the SoC has a riva or pronto built in. Signed-off-by: Bjorn Andersson --- drivers/net/wireless/ath/wcn36xx/dxe.c | 11 ++++++----- drivers/net/wireless/ath/wcn36xx/dxe.h | 5 ++--- drivers/net/wireless/ath/wcn36xx/main.c | 16 ++-------------- drivers/net/wireless/ath/wcn36xx/wcn36xx.h | 5 +---- 4 files changed, 11 insertions(+), 26 deletions(-) -- 2.5.0 -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/net/wireless/ath/wcn36xx/dxe.c b/drivers/net/wireless/ath/wcn36xx/dxe.c index a8ff45400982..231fd022f0f5 100644 --- a/drivers/net/wireless/ath/wcn36xx/dxe.c +++ b/drivers/net/wireless/ath/wcn36xx/dxe.c @@ -702,12 +702,13 @@ int wcn36xx_dxe_init(struct wcn36xx *wcn) reg_data = WCN36XX_DXE_REG_RESET; wcn36xx_dxe_write_register(wcn, WCN36XX_DXE_REG_CSR_RESET, reg_data); - /* Setting interrupt path */ - reg_data = WCN36XX_DXE_CCU_INT; - if (wcn->chip_version == WCN36XX_CHIP_3680) - wcn36xx_ccu_write_register(wcn, WCN36XX_DXE_REG_CCU_INT_3680, reg_data); + /* Select channels for rx avail and xfer done interrupts... */ + reg_data = (WCN36XX_DXE_INT_CH3_MASK | WCN36XX_DXE_INT_CH1_MASK) << 16 | + WCN36XX_DXE_INT_CH0_MASK | WCN36XX_DXE_INT_CH4_MASK; + if (wcn->is_pronto) + wcn36xx_ccu_write_register(wcn, WCN36XX_CCU_DXE_INT_SELECT_PRONTO, reg_data); else - wcn36xx_ccu_write_register(wcn, WCN36XX_DXE_REG_CCU_INT_3660, reg_data); + wcn36xx_ccu_write_register(wcn, WCN36XX_CCU_DXE_INT_SELECT_RIVA, reg_data); /***************************************/ /* Init descriptors for TX LOW channel */ diff --git a/drivers/net/wireless/ath/wcn36xx/dxe.h b/drivers/net/wireless/ath/wcn36xx/dxe.h index 012b59f4f91b..c012e807753b 100644 --- a/drivers/net/wireless/ath/wcn36xx/dxe.h +++ b/drivers/net/wireless/ath/wcn36xx/dxe.h @@ -30,9 +30,8 @@ H2H_TEST_RX_TX = DMA2 /* DXE registers */ #define WCN36XX_DXE_MEM_REG 0 -#define WCN36XX_DXE_CCU_INT 0xA0011 -#define WCN36XX_DXE_REG_CCU_INT_3660 0x310 -#define WCN36XX_DXE_REG_CCU_INT_3680 0x10dc +#define WCN36XX_CCU_DXE_INT_SELECT_RIVA 0x310 +#define WCN36XX_CCU_DXE_INT_SELECT_PRONTO 0x10dc /* TODO This must calculated properly but not hardcoded */ #define WCN36XX_DXE_CTRL_TX_L 0x328a44 diff --git a/drivers/net/wireless/ath/wcn36xx/main.c b/drivers/net/wireless/ath/wcn36xx/main.c index 8146eeba4458..e1d59da2ad20 100644 --- a/drivers/net/wireless/ath/wcn36xx/main.c +++ b/drivers/net/wireless/ath/wcn36xx/main.c @@ -261,17 +261,6 @@ static void wcn36xx_feat_caps_info(struct wcn36xx *wcn) } } -static void wcn36xx_detect_chip_version(struct wcn36xx *wcn) -{ - if (get_feat_caps(wcn->fw_feat_caps, DOT11AC)) { - wcn36xx_info("Chip is 3680\n"); - wcn->chip_version = WCN36XX_CHIP_3680; - } else { - wcn36xx_info("Chip is 3660\n"); - wcn->chip_version = WCN36XX_CHIP_3660; - } -} - static int wcn36xx_start(struct ieee80211_hw *hw) { struct wcn36xx *wcn = hw->priv; @@ -326,9 +315,6 @@ static int wcn36xx_start(struct ieee80211_hw *hw) wcn36xx_feat_caps_info(wcn); } - wcn36xx_detect_chip_version(wcn); - wcn36xx_smd_update_cfg(wcn, WCN36XX_HAL_CFG_ENABLE_MC_ADDR_LIST, 1); - /* DMA channel initialization */ ret = wcn36xx_dxe_init(wcn); if (ret) { @@ -1095,6 +1081,8 @@ static int wcn36xx_platform_get_resources(struct wcn36xx *wcn, return -EINVAL; } + wcn->is_pronto = !!of_device_is_compatible(mmio_node, "qcom,pronto"); + /* Map the CCU memory */ index = of_property_match_string(mmio_node, "reg-names", "ccu"); wcn->ccu_base = of_iomap(mmio_node, index); diff --git a/drivers/net/wireless/ath/wcn36xx/wcn36xx.h b/drivers/net/wireless/ath/wcn36xx/wcn36xx.h index 845f2446a1b5..22242d18e1fe 100644 --- a/drivers/net/wireless/ath/wcn36xx/wcn36xx.h +++ b/drivers/net/wireless/ath/wcn36xx/wcn36xx.h @@ -193,7 +193,7 @@ struct wcn36xx { u8 fw_minor; u8 fw_major; u32 fw_feat_caps[WCN36XX_HAL_CAPS_SIZE]; - u32 chip_version; + bool is_pronto; /* extra byte for the NULL termination */ u8 crm_version[WCN36XX_HAL_VERSION_LENGTH + 1]; @@ -242,9 +242,6 @@ struct wcn36xx { }; -#define WCN36XX_CHIP_3660 0 -#define WCN36XX_CHIP_3680 1 - static inline bool wcn36xx_is_fw_version(struct wcn36xx *wcn, u8 major, u8 minor,