diff mbox

[v6,06/10] ath10k: add sdio extra initializations

Message ID 148959276143.31432.4108050733445067980.stgit@potku.adurom.net (mailing list archive)
State Changes Requested
Delegated to: Kalle Valo
Headers show

Commit Message

Kalle Valo March 15, 2017, 3:46 p.m. UTC
From: Erik Stromdahl <erik.stromdahl@gmail.com>

Extra initializations needed by all sdio boards.
Derived from qcacld.

Signed-off-by: Erik Stromdahl <erik.stromdahl@gmail.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
---
 drivers/net/wireless/ath/ath10k/core.c |   22 ++++++++++++++++++++--
 1 file changed, 20 insertions(+), 2 deletions(-)

Comments

Ryan Hsu March 16, 2017, 1:18 a.m. UTC | #1
On 03/15/2017 08:46 AM, Kalle Valo wrote:

> From: Erik Stromdahl <erik.stromdahl@gmail.com>
>
> Extra initializations needed by all sdio boards.
> Derived from qcacld.
>
> Signed-off-by: Erik Stromdahl <erik.stromdahl@gmail.com>
> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
> ---
>  drivers/net/wireless/ath/ath10k/core.c |   22 ++++++++++++++++++++--
>  1 file changed, 20 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/wireless/ath/ath10k/core.c b/drivers/net/wireless/ath/ath10k/core.c
> index f450ebbb28d5..6b6ea8a571fa 100644
> --- a/drivers/net/wireless/ath/ath10k/core.c
> +++ b/drivers/net/wireless/ath/ath10k/core.c
> @@ -377,7 +377,22 @@ static void ath10k_send_suspend_complete(struct ath10k *ar)
>  	complete(&ar->target_suspend);
>  }
>  
> -static int ath10k_init_configure_target(struct ath10k *ar)
> +static void ath10k_sdio_extra_initialization(struct ath10k *ar)
> +{
> +	u32 param = 0;
> +
> +	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, &param);
> +
> +	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_sdio(struct ath10k *ar)

Shouldn't we just keep the ath10k_init_configure_target() and move the sdio specific to ath10k_sdio_extra_initialization()?
instead of renaming this to ath10k_init_sdio()? not sure if this is just a local hack that didn't revert?

>  {
>  	u32 param_host;
>  	int ret;
> @@ -1900,7 +1915,7 @@ int ath10k_core_start(struct ath10k *ar, enum ath10k_firmware_mode mode,
>  
>  	ath10k_bmi_start(ar);
>  
> -	if (ath10k_init_configure_target(ar)) {
> +	if (ath10k_init_sdio(ar)) {
>  		status = -EINVAL;
>  		goto err;
>  	}
> @@ -1933,6 +1948,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;
>  

Ryan
Kalle Valo March 23, 2017, 3:59 p.m. UTC | #2
Ryan Hsu <ryanhsu@qca.qualcomm.com> writes:

> On 03/15/2017 08:46 AM, Kalle Valo wrote:
>
>> From: Erik Stromdahl <erik.stromdahl@gmail.com>
>>
>> Extra initializations needed by all sdio boards.
>> Derived from qcacld.
>>
>> Signed-off-by: Erik Stromdahl <erik.stromdahl@gmail.com>
>> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
>> ---
>>  drivers/net/wireless/ath/ath10k/core.c |   22 ++++++++++++++++++++--
>>  1 file changed, 20 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/net/wireless/ath/ath10k/core.c b/drivers/net/wireless/ath/ath10k/core.c
>> index f450ebbb28d5..6b6ea8a571fa 100644
>> --- a/drivers/net/wireless/ath/ath10k/core.c
>> +++ b/drivers/net/wireless/ath/ath10k/core.c
>> @@ -377,7 +377,22 @@ static void ath10k_send_suspend_complete(struct ath10k *ar)
>>  	complete(&ar->target_suspend);
>>  }
>>  
>> -static int ath10k_init_configure_target(struct ath10k *ar)
>> +static void ath10k_sdio_extra_initialization(struct ath10k *ar)
>> +{
>> +	u32 param = 0;
>> +
>> +	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, &param);
>> +
>> +	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_sdio(struct ath10k *ar)
>
> Shouldn't we just keep the ath10k_init_configure_target() and move the
> sdio specific to ath10k_sdio_extra_initialization()?
> instead of renaming this to ath10k_init_sdio()? not sure if this is
> just a local hack that didn't revert?

Ouch, I was supposed to rename ath10k_sdio_extra_initialization() to
ath10k_init_sdio() but accidentally renamed the wrong function. Will fix
in v7.

Thanks for catching this!
diff mbox

Patch

diff --git a/drivers/net/wireless/ath/ath10k/core.c b/drivers/net/wireless/ath/ath10k/core.c
index f450ebbb28d5..6b6ea8a571fa 100644
--- a/drivers/net/wireless/ath/ath10k/core.c
+++ b/drivers/net/wireless/ath/ath10k/core.c
@@ -377,7 +377,22 @@  static void ath10k_send_suspend_complete(struct ath10k *ar)
 	complete(&ar->target_suspend);
 }
 
-static int ath10k_init_configure_target(struct ath10k *ar)
+static void ath10k_sdio_extra_initialization(struct ath10k *ar)
+{
+	u32 param = 0;
+
+	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, &param);
+
+	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_sdio(struct ath10k *ar)
 {
 	u32 param_host;
 	int ret;
@@ -1900,7 +1915,7 @@  int ath10k_core_start(struct ath10k *ar, enum ath10k_firmware_mode mode,
 
 	ath10k_bmi_start(ar);
 
-	if (ath10k_init_configure_target(ar)) {
+	if (ath10k_init_sdio(ar)) {
 		status = -EINVAL;
 		goto err;
 	}
@@ -1933,6 +1948,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;