From: Kalle Valo <kvalo@kernel.org>
To: Manikanta Pubbisetty <quic_mpubbise@quicinc.com>
Cc: <ath11k@lists.infradead.org>, <linux-wireless@vger.kernel.org>,
<devicetree@vger.kernel.org>, <robh@kernel.org>,
<mka@chromium.org>
Subject: Re: [PATCH v6 4/9] ath11k: Add register access logic for WCN6750
Date: Wed, 27 Apr 2022 15:25:28 +0300 [thread overview]
Message-ID: <87pml2g1c7.fsf@kernel.org> (raw)
In-Reply-To: <20220427111848.9257-5-quic_mpubbise@quicinc.com> (Manikanta Pubbisetty's message of "Wed, 27 Apr 2022 16:48:43 +0530")
Manikanta Pubbisetty <quic_mpubbise@quicinc.com> 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 <quic_mpubbise@quicinc.com>
> ---
> 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?
--
https://patchwork.kernel.org/project/linux-wireless/list/
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
--
ath11k mailing list
ath11k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath11k
WARNING: multiple messages have this Message-ID (diff)
From: Kalle Valo <kvalo@kernel.org>
To: Manikanta Pubbisetty <quic_mpubbise@quicinc.com>
Cc: <ath11k@lists.infradead.org>, <linux-wireless@vger.kernel.org>,
<devicetree@vger.kernel.org>, <robh@kernel.org>,
<mka@chromium.org>
Subject: Re: [PATCH v6 4/9] ath11k: Add register access logic for WCN6750
Date: Wed, 27 Apr 2022 15:25:28 +0300 [thread overview]
Message-ID: <87pml2g1c7.fsf@kernel.org> (raw)
In-Reply-To: <20220427111848.9257-5-quic_mpubbise@quicinc.com> (Manikanta Pubbisetty's message of "Wed, 27 Apr 2022 16:48:43 +0530")
Manikanta Pubbisetty <quic_mpubbise@quicinc.com> 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 <quic_mpubbise@quicinc.com>
> ---
> 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?
--
https://patchwork.kernel.org/project/linux-wireless/list/
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
next prev parent reply other threads:[~2022-04-27 12:25 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-27 11:18 [PATCH v6 0/9] add support for WCN6750 Manikanta Pubbisetty
2022-04-27 11:18 ` Manikanta Pubbisetty
2022-04-27 11:18 ` [PATCH v6 1/9] dt: bindings: net: add bindings of WCN6750 for ath11k Manikanta Pubbisetty
2022-04-27 11:18 ` Manikanta Pubbisetty
2022-04-27 11:18 ` [PATCH v6 2/9] ath11k: Add HW params for WCN6750 Manikanta Pubbisetty
2022-04-27 11:18 ` Manikanta Pubbisetty
2022-04-27 11:18 ` [PATCH v6 3/9] ath11k: Add bus " Manikanta Pubbisetty
2022-04-27 11:18 ` Manikanta Pubbisetty
2022-04-27 11:18 ` [PATCH v6 4/9] ath11k: Add register access logic " Manikanta Pubbisetty
2022-04-27 11:18 ` Manikanta Pubbisetty
2022-04-27 12:25 ` Kalle Valo [this message]
2022-04-27 12:25 ` Kalle Valo
2022-04-27 12:35 ` Manikanta Pubbisetty
2022-04-27 12:35 ` Manikanta Pubbisetty
2022-04-27 13:26 ` Manikanta Pubbisetty
2022-04-27 13:26 ` Manikanta Pubbisetty
2022-04-29 9:52 ` Kalle Valo
2022-04-29 9:52 ` Kalle Valo
2022-04-29 10:17 ` Manikanta Pubbisetty
2022-04-29 10:17 ` Manikanta Pubbisetty
2022-04-27 11:18 ` [PATCH v6 5/9] ath11k: Fetch device information via QMI " Manikanta Pubbisetty
2022-04-27 11:18 ` Manikanta Pubbisetty
2022-04-27 11:18 ` [PATCH v6 6/9] ath11k: Add QMI changes " Manikanta Pubbisetty
2022-04-27 11:18 ` Manikanta Pubbisetty
2022-04-27 11:18 ` [PATCH v6 7/9] ath11k: HAL changes to support WCN6750 Manikanta Pubbisetty
2022-04-27 11:18 ` Manikanta Pubbisetty
2022-04-27 11:18 ` [PATCH v6 8/9] ath11k: Datapath " Manikanta Pubbisetty
2022-04-27 11:18 ` Manikanta Pubbisetty
2022-04-27 11:18 ` [PATCH v6 9/9] ath11k: Add support for WCN6750 device Manikanta Pubbisetty
2022-04-27 11:18 ` Manikanta Pubbisetty
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87pml2g1c7.fsf@kernel.org \
--to=kvalo@kernel.org \
--cc=ath11k@lists.infradead.org \
--cc=devicetree@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=mka@chromium.org \
--cc=quic_mpubbise@quicinc.com \
--cc=robh@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.