Search Linux Wireless

Re: [PATCH v6 4/9] ath11k: Add register access logic for WCN6750

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Manikanta Pubbisetty <quic_mpubbise@xxxxxxxxxxx> 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@xxxxxxxxxxx>
> ---
>  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



[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Wireless Regulations]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux