Received: by 2002:a05:6602:2086:0:0:0:0 with SMTP id a6csp4532771ioa; Wed, 27 Apr 2022 06:01:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxIML2YmILn8yCJSMjnuoFHONu2qRyA0icO3CCaSyLtOE7Obmb8mOMRUScXMAAaxtgXeuL9 X-Received: by 2002:a05:6808:3b8:b0:322:a783:8fc8 with SMTP id n24-20020a05680803b800b00322a7838fc8mr17162467oie.189.1651064470415; Wed, 27 Apr 2022 06:01:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651064470; cv=none; d=google.com; s=arc-20160816; b=LKBdxnOgNWEbITCgh3pXPlR1QpI2PlVag1UnJSwxLqj4GA29FqVH0ECybUq5f4vQCu onoqWRu+v786P3MLK9gUW3PEoV5Z/w9lmz3G2PsEjWreL4m+c69bmhEbKkGN2OFDSxlH 1RTZu4UWwfQ71l48tKFEW87q91ot6d7sTlGSHlPV2NjRWQG3WYC75JCefC1OP/u/aWNd gpbBBY2DhHdlg1sCZ6RtwJEgFD0S6a4ZK2St202Wxj2ZZb8hYeeugGkG65riz6Crwejg OzCcTuYMB7GwkSPynhAqjtyPT6UZKX117JSf3PDxFJt8WR3YI7P5i6eswnVlZdBCBFvZ 67rw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=wabwfxq2ea3ScsaUrS8rkQH3XWlo//81jSwv8ow+8jU=; b=KRw2H+AXvLMCtch0ZU077rN1V/i79+o1or8dEqqe/SEePYaFDRfVRPdpAMqjrCl2S0 RIwfoPP0qGpVJ7MgjEClwj9/y7iGmDu3ALVL1/YzNPDGEt58KbLajneGcGyLW6GB+F2p IPi3M0XoESEUUqeuwioBr+CgsdIfgai0U/hZDqHE7fM0IQSMU/ZAXYvz9ZjD0hJ/Iivx MBvZKhCPDefJSkeRG7nJSdPTq40IXMFR1eQ71Osew2xx/Cg8nZLul7ZtsNAycnbwkHcn hO0ln6sJWXO9uVOVRMq+wh1+CX6sAK4t0i/AulUga/EJb5v7QxeQcL6lrM7NkI2TSpjc EXiA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcdkim header.b=r2kbkJRK; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id o8-20020a0568080bc800b003252a839d99si844495oik.291.2022.04.27.06.01.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Apr 2022 06:01:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcdkim header.b=r2kbkJRK; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id DE0CC527FA; Wed, 27 Apr 2022 05:35:17 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234378AbiD0MiZ (ORCPT + 67 others); Wed, 27 Apr 2022 08:38:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39242 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234177AbiD0MiY (ORCPT ); Wed, 27 Apr 2022 08:38:24 -0400 Received: from alexa-out.qualcomm.com (alexa-out.qualcomm.com [129.46.98.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BD3DB52E57; Wed, 27 Apr 2022 05:35:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1651062911; x=1682598911; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=wabwfxq2ea3ScsaUrS8rkQH3XWlo//81jSwv8ow+8jU=; b=r2kbkJRKz8HFzOeF8WxDXR4LZW/2+zgaVtS2fBJHU0voZAWkLfzUjNvB v9PWHEw/A8dLZ4n9k2+nklDdblnbR/+NJVEN8dNQQLaAgXVK2dU7ew7I8 +3b1YbzNzqA6dOjUEdwY6IyixFXWAMSwORFXCOBQk+whXSZlItHmCLGp5 k=; Received: from ironmsg09-lv.qualcomm.com ([10.47.202.153]) by alexa-out.qualcomm.com with ESMTP; 27 Apr 2022 05:35:10 -0700 X-QCInternal: smtphost Received: from nasanex01c.na.qualcomm.com ([10.47.97.222]) by ironmsg09-lv.qualcomm.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Apr 2022 05:35:10 -0700 Received: from nalasex01a.na.qualcomm.com (10.47.209.196) by nasanex01c.na.qualcomm.com (10.47.97.222) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Wed, 27 Apr 2022 05:35:09 -0700 Received: from [10.50.15.218] (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Wed, 27 Apr 2022 05:35:07 -0700 Message-ID: <86da868b-c1d5-0494-ba43-45067c436904@quicinc.com> Date: Wed, 27 Apr 2022 18:05:03 +0530 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.8.1 Subject: Re: [PATCH v6 4/9] ath11k: Add register access logic for WCN6750 Content-Language: en-US To: Kalle Valo CC: , , , , References: <20220427111848.9257-1-quic_mpubbise@quicinc.com> <20220427111848.9257-5-quic_mpubbise@quicinc.com> <87pml2g1c7.fsf@kernel.org> From: Manikanta Pubbisetty In-Reply-To: <87pml2g1c7.fsf@kernel.org> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nalasex01a.na.qualcomm.com (10.47.209.196) X-Spam-Status: No, score=-3.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,RDNS_NONE,SPF_HELO_NONE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org On 4/27/2022 5:55 PM, Kalle Valo wrote: > Manikanta Pubbisetty writes: > >> WCN6750 uses static window mapping to access the HW registers. >> Unlike QCN9074 which uses 2nd window for CE and 3rd window >> for UMAC register accesses, WCN6750 uses 1st window for UMAC >> and 2nd window for CE registers. >> >> Code is refactored so that WCN6750 can use the existing >> ath11k_pci_read/write() APIs for accessing the registers. >> >> Tested-on: WCN6750 hw1.0 AHB WLAN.MSL.1.0.1-00887-QCAMSLSWPLZ-1 >> Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-01720.1-QCAHSPSWPL_V1_V2_SILICONZ_LITE-1 >> Tested-on: QCN9074 hw1.0 PCI WLAN.HK.2.5.0.1-01100-QCAHKSWPL_SILICONZ-1 >> Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.4.0.1-00192-QCAHKSWPL_SILICONZ-1 >> >> Signed-off-by: Manikanta Pubbisetty >> --- >> drivers/net/wireless/ath/ath11k/ahb.c | 6 +++ >> drivers/net/wireless/ath/ath11k/core.h | 2 + >> drivers/net/wireless/ath/ath11k/pci.c | 34 ++++++++++++++-- >> drivers/net/wireless/ath/ath11k/pcic.c | 54 +++++++++----------------- >> 4 files changed, 58 insertions(+), 38 deletions(-) >> >> diff --git a/drivers/net/wireless/ath/ath11k/ahb.c b/drivers/net/wireless/ath/ath11k/ahb.c >> index cfdd415f0203..fa12e50f32f4 100644 >> --- a/drivers/net/wireless/ath/ath11k/ahb.c >> +++ b/drivers/net/wireless/ath/ath11k/ahb.c >> @@ -34,7 +34,10 @@ static const struct ath11k_bus_params ath11k_ahb_bus_params = { >> .m3_fw_support = false, >> .fixed_bdf_addr = true, >> .fixed_mem_region = true, >> + .static_window_map = false, >> .hybrid_bus_type = false, >> + .dp_window_idx = 0, >> + .ce_window_idx = 0, >> }; >> >> const struct ath11k_bus_params ath11k_ahb_hybrid_bus_params = { >> @@ -42,7 +45,10 @@ const struct ath11k_bus_params ath11k_ahb_hybrid_bus_params = { >> .m3_fw_support = false, >> .fixed_bdf_addr = false, >> .fixed_mem_region = false, >> + .static_window_map = true, >> .hybrid_bus_type = true, >> + .dp_window_idx = 1, >> + .ce_window_idx = 2, >> }; >> >> #define ATH11K_IRQ_CE0_OFFSET 4 >> diff --git a/drivers/net/wireless/ath/ath11k/core.h b/drivers/net/wireless/ath/ath11k/core.h >> index 51f313dd7f26..ee0ad93d5843 100644 >> --- a/drivers/net/wireless/ath/ath11k/core.h >> +++ b/drivers/net/wireless/ath/ath11k/core.h >> @@ -756,6 +756,8 @@ struct ath11k_bus_params { >> bool fixed_mem_region; >> bool static_window_map; >> bool hybrid_bus_type; >> + u8 dp_window_idx; >> + u8 ce_window_idx; >> }; >> >> struct ath11k_pci_ops { >> diff --git a/drivers/net/wireless/ath/ath11k/pci.c b/drivers/net/wireless/ath/ath11k/pci.c >> index ddd1e2de6a2e..9184cb893bd4 100644 >> --- a/drivers/net/wireless/ath/ath11k/pci.c >> +++ b/drivers/net/wireless/ath/ath11k/pci.c >> @@ -115,12 +115,26 @@ static const struct ath11k_pci_ops ath11k_pci_ops_qcn9074 = { >> .window_read32 = ath11k_pci_window_read32, >> }; >> >> -static const struct ath11k_bus_params ath11k_pci_bus_params = { >> +static const struct ath11k_bus_params ath11k_pci_bus_params_qca6390 = { >> .mhi_support = true, >> .m3_fw_support = true, >> .fixed_bdf_addr = false, >> .fixed_mem_region = false, >> + .static_window_map = false, >> .hybrid_bus_type = false, >> + .dp_window_idx = 0, >> + .ce_window_idx = 0, >> +}; >> + >> +static const struct ath11k_bus_params ath11k_pci_bus_params_qcn9074 = { >> + .mhi_support = true, >> + .m3_fw_support = true, >> + .fixed_bdf_addr = false, >> + .fixed_mem_region = false, >> + .static_window_map = true, >> + .hybrid_bus_type = false, >> + .dp_window_idx = 3, >> + .ce_window_idx = 2, >> }; >> >> static const struct ath11k_msi_config msi_config_one_msi = { >> @@ -704,11 +718,26 @@ static int ath11k_pci_probe(struct pci_dev *pdev, >> { >> struct ath11k_base *ab; >> struct ath11k_pci *ab_pci; >> + const struct ath11k_bus_params *bus_params; >> u32 soc_hw_version_major, soc_hw_version_minor, addr; >> int ret; >> >> + switch (pci_dev->device) { >> + case QCA6390_DEVICE_ID: >> + case WCN6855_DEVICE_ID: >> + bus_params = &ath11k_pci_bus_params_qca6390; >> + break; >> + case QCN9074_DEVICE_ID: >> + bus_params = &ath11k_pci_bus_params_qcn9074; >> + break; > > Now you are making bus_params device specific, that's not really the > point of bus params. They are supposed to be _bus_ specific parameters. > > Can't you use hw_params like I mentioned in the review? > I'm totally confused now, CE & DP window indices are specifics that come in to play when we access the bus registers and they are closely tied to static_window_map variable which is already in bus_params, I'm not sure if it is a good to have them in hw_params. If at all we decide to move them to hw_params, then we can move pretty much everything to hw_params and remove bus_params completely. I prefer to keep them in bus_params and make bus_params device specific, If you feel it otherwise, then I can move it to hw_params. Thanks, Manikanta