All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3] ath10k: Override CE5 configuration for QCA6147 device
@ 2015-11-06  2:44 ` Ryan Hsu
  0 siblings, 0 replies; 10+ messages in thread
From: Ryan Hsu @ 2015-11-06  2:44 UTC (permalink / raw)
  To: ath10k; +Cc: linux-wireless, ryanhsu

'Commit a70587b3389a ("ath10k: configure copy engine 5 for HTT messages")'
Introduces to use the unused CE5 for target to host message.

For the device like QCA6174, CE5 already assigned for other feature.
So for QCA6174, override the CE5 configuration and use the CE1 instead.

This patch is based on Rajkumar's earlier patch.

Fixes: a70587b3389a ("ath10k: configure copy engine 5 for HTT messages")
Signed-off-by: Rajkumar Manoharan <rmanohar@qti.qualcomm.com>
Signed-off-by: Ryan Hsu <ryanhsu@qca.qualcomm.com>
---
 drivers/net/wireless/ath/ath10k/pci.c | 32 +++++++++++++++++++++++++++++---
 1 file changed, 29 insertions(+), 3 deletions(-)

diff --git a/drivers/net/wireless/ath/ath10k/pci.c b/drivers/net/wireless/ath/ath10k/pci.c
index 5c91a67..2a48376 100644
--- a/drivers/net/wireless/ath/ath10k/pci.c
+++ b/drivers/net/wireless/ath/ath10k/pci.c
@@ -113,7 +113,7 @@ static void ath10k_pci_htt_tx_cb(struct ath10k_ce_pipe *ce_state);
 static void ath10k_pci_htt_rx_cb(struct ath10k_ce_pipe *ce_state);
 static void ath10k_pci_pktlog_rx_cb(struct ath10k_ce_pipe *ce_state);
 
-static const struct ce_attr host_ce_config_wlan[] = {
+static struct ce_attr host_ce_config_wlan[] = {
 	/* CE0: host->target HTC control and raw streams */
 	{
 		.flags = CE_ATTR_FLAGS,
@@ -219,7 +219,7 @@ static const struct ce_attr host_ce_config_wlan[] = {
 };
 
 /* Target firmware's Copy Engine configuration. */
-static const struct ce_pipe_config target_ce_config_wlan[] = {
+static struct ce_pipe_config target_ce_config_wlan[] = {
 	/* CE0: host->target HTC control and raw streams */
 	{
 		.pipenum = __cpu_to_le32(0),
@@ -332,7 +332,7 @@ static const struct ce_pipe_config target_ce_config_wlan[] = {
  * This table is derived from the CE_PCI TABLE, above.
  * It is passed to the Target at startup for use by firmware.
  */
-static const struct service_to_pipe target_service_to_ce_map_wlan[] = {
+static struct service_to_pipe target_service_to_ce_map_wlan[] = {
 	{
 		__cpu_to_le32(ATH10K_HTC_SVC_ID_WMI_DATA_VO),
 		__cpu_to_le32(PIPEDIR_OUT),	/* out = UL = host -> target */
@@ -2038,6 +2038,29 @@ static int ath10k_pci_init_config(struct ath10k *ar)
 	return 0;
 }
 
+static void ath10k_pci_override_ce_config(struct ath10k *ar)
+{
+	struct ce_attr *attr;
+	struct ce_pipe_config *config;
+
+	/* For QCA6174 we're overriding the Copy Engine 5 configuration,
+	 * since it is currently used for other feature.
+	 */
+
+	/* Override Host's Copy Engine 5 configuration */
+	attr = &host_ce_config_wlan[5];
+	attr->src_sz_max = 0;
+	attr->dest_nentries = 0;
+
+	/* Override Target firmware's Copy Engine configuration */
+	config = &target_ce_config_wlan[5];
+	config->pipedir = __cpu_to_le32(PIPEDIR_OUT);
+	config->nbytes_max = __cpu_to_le32(2048);
+
+	/* Map from service/endpoint to Copy Engine */
+	target_service_to_ce_map_wlan[15].pipenum = __cpu_to_le32(1);
+}
+
 static int ath10k_pci_alloc_pipes(struct ath10k *ar)
 {
 	struct ath10k_pci *ar_pci = ath10k_pci_priv(ar);
@@ -3031,6 +3054,9 @@ static int ath10k_pci_probe(struct pci_dev *pdev,
 		goto err_core_destroy;
 	}
 
+	if (QCA_REV_6174(ar))
+		ath10k_pci_override_ce_config(ar);
+
 	ret = ath10k_pci_alloc_pipes(ar);
 	if (ret) {
 		ath10k_err(ar, "failed to allocate copy engine pipes: %d\n",
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH v3] ath10k: Override CE5 configuration for QCA6147 device
@ 2015-11-06  2:44 ` Ryan Hsu
  0 siblings, 0 replies; 10+ messages in thread
From: Ryan Hsu @ 2015-11-06  2:44 UTC (permalink / raw)
  To: ath10k; +Cc: linux-wireless, ryanhsu

'Commit a70587b3389a ("ath10k: configure copy engine 5 for HTT messages")'
Introduces to use the unused CE5 for target to host message.

For the device like QCA6174, CE5 already assigned for other feature.
So for QCA6174, override the CE5 configuration and use the CE1 instead.

This patch is based on Rajkumar's earlier patch.

Fixes: a70587b3389a ("ath10k: configure copy engine 5 for HTT messages")
Signed-off-by: Rajkumar Manoharan <rmanohar@qti.qualcomm.com>
Signed-off-by: Ryan Hsu <ryanhsu@qca.qualcomm.com>
---
 drivers/net/wireless/ath/ath10k/pci.c | 32 +++++++++++++++++++++++++++++---
 1 file changed, 29 insertions(+), 3 deletions(-)

diff --git a/drivers/net/wireless/ath/ath10k/pci.c b/drivers/net/wireless/ath/ath10k/pci.c
index 5c91a67..2a48376 100644
--- a/drivers/net/wireless/ath/ath10k/pci.c
+++ b/drivers/net/wireless/ath/ath10k/pci.c
@@ -113,7 +113,7 @@ static void ath10k_pci_htt_tx_cb(struct ath10k_ce_pipe *ce_state);
 static void ath10k_pci_htt_rx_cb(struct ath10k_ce_pipe *ce_state);
 static void ath10k_pci_pktlog_rx_cb(struct ath10k_ce_pipe *ce_state);
 
-static const struct ce_attr host_ce_config_wlan[] = {
+static struct ce_attr host_ce_config_wlan[] = {
 	/* CE0: host->target HTC control and raw streams */
 	{
 		.flags = CE_ATTR_FLAGS,
@@ -219,7 +219,7 @@ static const struct ce_attr host_ce_config_wlan[] = {
 };
 
 /* Target firmware's Copy Engine configuration. */
-static const struct ce_pipe_config target_ce_config_wlan[] = {
+static struct ce_pipe_config target_ce_config_wlan[] = {
 	/* CE0: host->target HTC control and raw streams */
 	{
 		.pipenum = __cpu_to_le32(0),
@@ -332,7 +332,7 @@ static const struct ce_pipe_config target_ce_config_wlan[] = {
  * This table is derived from the CE_PCI TABLE, above.
  * It is passed to the Target at startup for use by firmware.
  */
-static const struct service_to_pipe target_service_to_ce_map_wlan[] = {
+static struct service_to_pipe target_service_to_ce_map_wlan[] = {
 	{
 		__cpu_to_le32(ATH10K_HTC_SVC_ID_WMI_DATA_VO),
 		__cpu_to_le32(PIPEDIR_OUT),	/* out = UL = host -> target */
@@ -2038,6 +2038,29 @@ static int ath10k_pci_init_config(struct ath10k *ar)
 	return 0;
 }
 
+static void ath10k_pci_override_ce_config(struct ath10k *ar)
+{
+	struct ce_attr *attr;
+	struct ce_pipe_config *config;
+
+	/* For QCA6174 we're overriding the Copy Engine 5 configuration,
+	 * since it is currently used for other feature.
+	 */
+
+	/* Override Host's Copy Engine 5 configuration */
+	attr = &host_ce_config_wlan[5];
+	attr->src_sz_max = 0;
+	attr->dest_nentries = 0;
+
+	/* Override Target firmware's Copy Engine configuration */
+	config = &target_ce_config_wlan[5];
+	config->pipedir = __cpu_to_le32(PIPEDIR_OUT);
+	config->nbytes_max = __cpu_to_le32(2048);
+
+	/* Map from service/endpoint to Copy Engine */
+	target_service_to_ce_map_wlan[15].pipenum = __cpu_to_le32(1);
+}
+
 static int ath10k_pci_alloc_pipes(struct ath10k *ar)
 {
 	struct ath10k_pci *ar_pci = ath10k_pci_priv(ar);
@@ -3031,6 +3054,9 @@ static int ath10k_pci_probe(struct pci_dev *pdev,
 		goto err_core_destroy;
 	}
 
+	if (QCA_REV_6174(ar))
+		ath10k_pci_override_ce_config(ar);
+
 	ret = ath10k_pci_alloc_pipes(ar);
 	if (ret) {
 		ath10k_err(ar, "failed to allocate copy engine pipes: %d\n",
-- 
1.9.1


_______________________________________________
ath10k mailing list
ath10k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath10k

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH v3] ath10k: Override CE5 configuration for QCA6147 device
  2015-11-06  2:44 ` Ryan Hsu
@ 2015-11-12 19:07   ` Kalle Valo
  -1 siblings, 0 replies; 10+ messages in thread
From: Kalle Valo @ 2015-11-12 19:07 UTC (permalink / raw)
  To: Ryan Hsu; +Cc: ath10k, linux-wireless

Ryan Hsu <ryanhsu@qca.qualcomm.com> writes:

> 'Commit a70587b3389a ("ath10k: configure copy engine 5 for HTT messages")'
> Introduces to use the unused CE5 for target to host message.
>
> For the device like QCA6174, CE5 already assigned for other feature.
> So for QCA6174, override the CE5 configuration and use the CE1 instead.
>
> This patch is based on Rajkumar's earlier patch.
>
> Fixes: a70587b3389a ("ath10k: configure copy engine 5 for HTT messages")
> Signed-off-by: Rajkumar Manoharan <rmanohar@qti.qualcomm.com>
> Signed-off-by: Ryan Hsu <ryanhsu@qca.qualcomm.com>

Applied to ath-current, thanks.

-- 
Kalle Valo

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v3] ath10k: Override CE5 configuration for QCA6147 device
@ 2015-11-12 19:07   ` Kalle Valo
  0 siblings, 0 replies; 10+ messages in thread
From: Kalle Valo @ 2015-11-12 19:07 UTC (permalink / raw)
  To: Ryan Hsu; +Cc: linux-wireless, ath10k

Ryan Hsu <ryanhsu@qca.qualcomm.com> writes:

> 'Commit a70587b3389a ("ath10k: configure copy engine 5 for HTT messages")'
> Introduces to use the unused CE5 for target to host message.
>
> For the device like QCA6174, CE5 already assigned for other feature.
> So for QCA6174, override the CE5 configuration and use the CE1 instead.
>
> This patch is based on Rajkumar's earlier patch.
>
> Fixes: a70587b3389a ("ath10k: configure copy engine 5 for HTT messages")
> Signed-off-by: Rajkumar Manoharan <rmanohar@qti.qualcomm.com>
> Signed-off-by: Ryan Hsu <ryanhsu@qca.qualcomm.com>

Applied to ath-current, thanks.

-- 
Kalle Valo

_______________________________________________
ath10k mailing list
ath10k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath10k

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v3] ath10k: Override CE5 configuration for QCA6147 device
  2015-11-12 10:47   ` Julian Calaby
@ 2015-11-12 14:53     ` Kalle Valo
  -1 siblings, 0 replies; 10+ messages in thread
From: Kalle Valo @ 2015-11-12 14:53 UTC (permalink / raw)
  To: Julian Calaby; +Cc: Ryan Hsu, linux-wireless, ath10k

Julian Calaby <julian.calaby@gmail.com> writes:

>> +static void ath10k_pci_override_ce_config(struct ath10k *ar)
>> +{
>> +       struct ce_attr *attr;
>> +       struct ce_pipe_config *config;
>> +
>> +       /* For QCA6174 we're overriding the Copy Engine 5 configuration,
>> +        * since it is currently used for other feature.
>> +        */
>> +
>> +       /* Override Host's Copy Engine 5 configuration */
>> +       attr = &host_ce_config_wlan[5];
>> +       attr->src_sz_max = 0;
>> +       attr->dest_nentries = 0;
>> +
>> +       /* Override Target firmware's Copy Engine configuration */
>> +       config = &target_ce_config_wlan[5];
>> +       config->pipedir = __cpu_to_le32(PIPEDIR_OUT);
>> +       config->nbytes_max = __cpu_to_le32(2048);
>> +
>> +       /* Map from service/endpoint to Copy Engine */
>> +       target_service_to_ce_map_wlan[15].pipenum = __cpu_to_le32(1);
>> +}
>> +
>
> Stupid question: Why not have two different versions of each struct?
> One for QCA6174 and one for everyone else, and choose the appropriate
> one when they're uploaded to the firmware / used?

That's duplicate work when you change something in common CEs and
chances of missing something increases.

-- 
Kalle Valo

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v3] ath10k: Override CE5 configuration for QCA6147 device
@ 2015-11-12 14:53     ` Kalle Valo
  0 siblings, 0 replies; 10+ messages in thread
From: Kalle Valo @ 2015-11-12 14:53 UTC (permalink / raw)
  To: Julian Calaby; +Cc: linux-wireless, ath10k, Ryan Hsu

Julian Calaby <julian.calaby@gmail.com> writes:

>> +static void ath10k_pci_override_ce_config(struct ath10k *ar)
>> +{
>> +       struct ce_attr *attr;
>> +       struct ce_pipe_config *config;
>> +
>> +       /* For QCA6174 we're overriding the Copy Engine 5 configuration,
>> +        * since it is currently used for other feature.
>> +        */
>> +
>> +       /* Override Host's Copy Engine 5 configuration */
>> +       attr = &host_ce_config_wlan[5];
>> +       attr->src_sz_max = 0;
>> +       attr->dest_nentries = 0;
>> +
>> +       /* Override Target firmware's Copy Engine configuration */
>> +       config = &target_ce_config_wlan[5];
>> +       config->pipedir = __cpu_to_le32(PIPEDIR_OUT);
>> +       config->nbytes_max = __cpu_to_le32(2048);
>> +
>> +       /* Map from service/endpoint to Copy Engine */
>> +       target_service_to_ce_map_wlan[15].pipenum = __cpu_to_le32(1);
>> +}
>> +
>
> Stupid question: Why not have two different versions of each struct?
> One for QCA6174 and one for everyone else, and choose the appropriate
> one when they're uploaded to the firmware / used?

That's duplicate work when you change something in common CEs and
chances of missing something increases.

-- 
Kalle Valo

_______________________________________________
ath10k mailing list
ath10k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath10k

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v3] ath10k: Override CE5 configuration for QCA6147 device
  2015-11-11 18:21 ` Ryan Hsu
@ 2015-11-12 10:47   ` Julian Calaby
  -1 siblings, 0 replies; 10+ messages in thread
From: Julian Calaby @ 2015-11-12 10:47 UTC (permalink / raw)
  To: Ryan Hsu; +Cc: ath10k, linux-wireless

Hi Ryan,

On Thu, Nov 12, 2015 at 5:21 AM, Ryan Hsu <ryanhsu@qca.qualcomm.com> wrote:
> 'Commit a70587b3389a ("ath10k: configure copy engine 5 for HTT messages")'
> Introduces to use the unused CE5 for target to host message.
>
> For the device like QCA6174, CE5 already assigned for other feature.
> So for QCA6174, override the CE5 configuration and use the CE1 instead.
>
> This patch is based on Rajkumar's earlier patch.
>
> Fixes: a70587b3389a ("ath10k: configure copy engine 5 for HTT messages")
> Signed-off-by: Rajkumar Manoharan <rmanohar@qti.qualcomm.com>
> Signed-off-by: Ryan Hsu <ryanhsu@qca.qualcomm.com>
> ---
>  drivers/net/wireless/ath/ath10k/pci.c | 32 +++++++++++++++++++++++++++++---
>  1 file changed, 29 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/net/wireless/ath/ath10k/pci.c b/drivers/net/wireless/ath/ath10k/pci.c
> index 5c91a67..2a48376 100644
> --- a/drivers/net/wireless/ath/ath10k/pci.c
> +++ b/drivers/net/wireless/ath/ath10k/pci.c
> @@ -113,7 +113,7 @@ static void ath10k_pci_htt_tx_cb(struct ath10k_ce_pipe *ce_state);
>  static void ath10k_pci_htt_rx_cb(struct ath10k_ce_pipe *ce_state);
>  static void ath10k_pci_pktlog_rx_cb(struct ath10k_ce_pipe *ce_state);
>
> -static const struct ce_attr host_ce_config_wlan[] = {
> +static struct ce_attr host_ce_config_wlan[] = {
>         /* CE0: host->target HTC control and raw streams */
>         {
>                 .flags = CE_ATTR_FLAGS,
> @@ -219,7 +219,7 @@ static const struct ce_attr host_ce_config_wlan[] = {
>  };
>
>  /* Target firmware's Copy Engine configuration. */
> -static const struct ce_pipe_config target_ce_config_wlan[] = {
> +static struct ce_pipe_config target_ce_config_wlan[] = {
>         /* CE0: host->target HTC control and raw streams */
>         {
>                 .pipenum = __cpu_to_le32(0),
> @@ -332,7 +332,7 @@ static const struct ce_pipe_config target_ce_config_wlan[] = {
>   * This table is derived from the CE_PCI TABLE, above.
>   * It is passed to the Target at startup for use by firmware.
>   */
> -static const struct service_to_pipe target_service_to_ce_map_wlan[] = {
> +static struct service_to_pipe target_service_to_ce_map_wlan[] = {
>         {
>                 __cpu_to_le32(ATH10K_HTC_SVC_ID_WMI_DATA_VO),
>                 __cpu_to_le32(PIPEDIR_OUT),     /* out = UL = host -> target */
> @@ -2038,6 +2038,29 @@ static int ath10k_pci_init_config(struct ath10k *ar)
>         return 0;
>  }
>
> +static void ath10k_pci_override_ce_config(struct ath10k *ar)
> +{
> +       struct ce_attr *attr;
> +       struct ce_pipe_config *config;
> +
> +       /* For QCA6174 we're overriding the Copy Engine 5 configuration,
> +        * since it is currently used for other feature.
> +        */
> +
> +       /* Override Host's Copy Engine 5 configuration */
> +       attr = &host_ce_config_wlan[5];
> +       attr->src_sz_max = 0;
> +       attr->dest_nentries = 0;
> +
> +       /* Override Target firmware's Copy Engine configuration */
> +       config = &target_ce_config_wlan[5];
> +       config->pipedir = __cpu_to_le32(PIPEDIR_OUT);
> +       config->nbytes_max = __cpu_to_le32(2048);
> +
> +       /* Map from service/endpoint to Copy Engine */
> +       target_service_to_ce_map_wlan[15].pipenum = __cpu_to_le32(1);
> +}
> +

Stupid question: Why not have two different versions of each struct?
One for QCA6174 and one for everyone else, and choose the appropriate
one when they're uploaded to the firmware / used?

I believe there's a struct full of part specific data, it could
potentially go in there.

Thanks,

-- 
Julian Calaby

Email: julian.calaby@gmail.com
Profile: http://www.google.com/profiles/julian.calaby/

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v3] ath10k: Override CE5 configuration for QCA6147 device
@ 2015-11-12 10:47   ` Julian Calaby
  0 siblings, 0 replies; 10+ messages in thread
From: Julian Calaby @ 2015-11-12 10:47 UTC (permalink / raw)
  To: Ryan Hsu; +Cc: linux-wireless, ath10k

Hi Ryan,

On Thu, Nov 12, 2015 at 5:21 AM, Ryan Hsu <ryanhsu@qca.qualcomm.com> wrote:
> 'Commit a70587b3389a ("ath10k: configure copy engine 5 for HTT messages")'
> Introduces to use the unused CE5 for target to host message.
>
> For the device like QCA6174, CE5 already assigned for other feature.
> So for QCA6174, override the CE5 configuration and use the CE1 instead.
>
> This patch is based on Rajkumar's earlier patch.
>
> Fixes: a70587b3389a ("ath10k: configure copy engine 5 for HTT messages")
> Signed-off-by: Rajkumar Manoharan <rmanohar@qti.qualcomm.com>
> Signed-off-by: Ryan Hsu <ryanhsu@qca.qualcomm.com>
> ---
>  drivers/net/wireless/ath/ath10k/pci.c | 32 +++++++++++++++++++++++++++++---
>  1 file changed, 29 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/net/wireless/ath/ath10k/pci.c b/drivers/net/wireless/ath/ath10k/pci.c
> index 5c91a67..2a48376 100644
> --- a/drivers/net/wireless/ath/ath10k/pci.c
> +++ b/drivers/net/wireless/ath/ath10k/pci.c
> @@ -113,7 +113,7 @@ static void ath10k_pci_htt_tx_cb(struct ath10k_ce_pipe *ce_state);
>  static void ath10k_pci_htt_rx_cb(struct ath10k_ce_pipe *ce_state);
>  static void ath10k_pci_pktlog_rx_cb(struct ath10k_ce_pipe *ce_state);
>
> -static const struct ce_attr host_ce_config_wlan[] = {
> +static struct ce_attr host_ce_config_wlan[] = {
>         /* CE0: host->target HTC control and raw streams */
>         {
>                 .flags = CE_ATTR_FLAGS,
> @@ -219,7 +219,7 @@ static const struct ce_attr host_ce_config_wlan[] = {
>  };
>
>  /* Target firmware's Copy Engine configuration. */
> -static const struct ce_pipe_config target_ce_config_wlan[] = {
> +static struct ce_pipe_config target_ce_config_wlan[] = {
>         /* CE0: host->target HTC control and raw streams */
>         {
>                 .pipenum = __cpu_to_le32(0),
> @@ -332,7 +332,7 @@ static const struct ce_pipe_config target_ce_config_wlan[] = {
>   * This table is derived from the CE_PCI TABLE, above.
>   * It is passed to the Target at startup for use by firmware.
>   */
> -static const struct service_to_pipe target_service_to_ce_map_wlan[] = {
> +static struct service_to_pipe target_service_to_ce_map_wlan[] = {
>         {
>                 __cpu_to_le32(ATH10K_HTC_SVC_ID_WMI_DATA_VO),
>                 __cpu_to_le32(PIPEDIR_OUT),     /* out = UL = host -> target */
> @@ -2038,6 +2038,29 @@ static int ath10k_pci_init_config(struct ath10k *ar)
>         return 0;
>  }
>
> +static void ath10k_pci_override_ce_config(struct ath10k *ar)
> +{
> +       struct ce_attr *attr;
> +       struct ce_pipe_config *config;
> +
> +       /* For QCA6174 we're overriding the Copy Engine 5 configuration,
> +        * since it is currently used for other feature.
> +        */
> +
> +       /* Override Host's Copy Engine 5 configuration */
> +       attr = &host_ce_config_wlan[5];
> +       attr->src_sz_max = 0;
> +       attr->dest_nentries = 0;
> +
> +       /* Override Target firmware's Copy Engine configuration */
> +       config = &target_ce_config_wlan[5];
> +       config->pipedir = __cpu_to_le32(PIPEDIR_OUT);
> +       config->nbytes_max = __cpu_to_le32(2048);
> +
> +       /* Map from service/endpoint to Copy Engine */
> +       target_service_to_ce_map_wlan[15].pipenum = __cpu_to_le32(1);
> +}
> +

Stupid question: Why not have two different versions of each struct?
One for QCA6174 and one for everyone else, and choose the appropriate
one when they're uploaded to the firmware / used?

I believe there's a struct full of part specific data, it could
potentially go in there.

Thanks,

-- 
Julian Calaby

Email: julian.calaby@gmail.com
Profile: http://www.google.com/profiles/julian.calaby/

_______________________________________________
ath10k mailing list
ath10k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath10k

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH v3] ath10k: Override CE5 configuration for QCA6147 device
@ 2015-11-11 18:21 ` Ryan Hsu
  0 siblings, 0 replies; 10+ messages in thread
From: Ryan Hsu @ 2015-11-11 18:21 UTC (permalink / raw)
  To: ath10k; +Cc: linux-wireless, ryanhsu

'Commit a70587b3389a ("ath10k: configure copy engine 5 for HTT messages")'
Introduces to use the unused CE5 for target to host message.

For the device like QCA6174, CE5 already assigned for other feature.
So for QCA6174, override the CE5 configuration and use the CE1 instead.

This patch is based on Rajkumar's earlier patch.

Fixes: a70587b3389a ("ath10k: configure copy engine 5 for HTT messages")
Signed-off-by: Rajkumar Manoharan <rmanohar@qti.qualcomm.com>
Signed-off-by: Ryan Hsu <ryanhsu@qca.qualcomm.com>
---
 drivers/net/wireless/ath/ath10k/pci.c | 32 +++++++++++++++++++++++++++++---
 1 file changed, 29 insertions(+), 3 deletions(-)

diff --git a/drivers/net/wireless/ath/ath10k/pci.c b/drivers/net/wireless/ath/ath10k/pci.c
index 5c91a67..2a48376 100644
--- a/drivers/net/wireless/ath/ath10k/pci.c
+++ b/drivers/net/wireless/ath/ath10k/pci.c
@@ -113,7 +113,7 @@ static void ath10k_pci_htt_tx_cb(struct ath10k_ce_pipe *ce_state);
 static void ath10k_pci_htt_rx_cb(struct ath10k_ce_pipe *ce_state);
 static void ath10k_pci_pktlog_rx_cb(struct ath10k_ce_pipe *ce_state);
 
-static const struct ce_attr host_ce_config_wlan[] = {
+static struct ce_attr host_ce_config_wlan[] = {
 	/* CE0: host->target HTC control and raw streams */
 	{
 		.flags = CE_ATTR_FLAGS,
@@ -219,7 +219,7 @@ static const struct ce_attr host_ce_config_wlan[] = {
 };
 
 /* Target firmware's Copy Engine configuration. */
-static const struct ce_pipe_config target_ce_config_wlan[] = {
+static struct ce_pipe_config target_ce_config_wlan[] = {
 	/* CE0: host->target HTC control and raw streams */
 	{
 		.pipenum = __cpu_to_le32(0),
@@ -332,7 +332,7 @@ static const struct ce_pipe_config target_ce_config_wlan[] = {
  * This table is derived from the CE_PCI TABLE, above.
  * It is passed to the Target at startup for use by firmware.
  */
-static const struct service_to_pipe target_service_to_ce_map_wlan[] = {
+static struct service_to_pipe target_service_to_ce_map_wlan[] = {
 	{
 		__cpu_to_le32(ATH10K_HTC_SVC_ID_WMI_DATA_VO),
 		__cpu_to_le32(PIPEDIR_OUT),	/* out = UL = host -> target */
@@ -2038,6 +2038,29 @@ static int ath10k_pci_init_config(struct ath10k *ar)
 	return 0;
 }
 
+static void ath10k_pci_override_ce_config(struct ath10k *ar)
+{
+	struct ce_attr *attr;
+	struct ce_pipe_config *config;
+
+	/* For QCA6174 we're overriding the Copy Engine 5 configuration,
+	 * since it is currently used for other feature.
+	 */
+
+	/* Override Host's Copy Engine 5 configuration */
+	attr = &host_ce_config_wlan[5];
+	attr->src_sz_max = 0;
+	attr->dest_nentries = 0;
+
+	/* Override Target firmware's Copy Engine configuration */
+	config = &target_ce_config_wlan[5];
+	config->pipedir = __cpu_to_le32(PIPEDIR_OUT);
+	config->nbytes_max = __cpu_to_le32(2048);
+
+	/* Map from service/endpoint to Copy Engine */
+	target_service_to_ce_map_wlan[15].pipenum = __cpu_to_le32(1);
+}
+
 static int ath10k_pci_alloc_pipes(struct ath10k *ar)
 {
 	struct ath10k_pci *ar_pci = ath10k_pci_priv(ar);
@@ -3031,6 +3054,9 @@ static int ath10k_pci_probe(struct pci_dev *pdev,
 		goto err_core_destroy;
 	}
 
+	if (QCA_REV_6174(ar))
+		ath10k_pci_override_ce_config(ar);
+
 	ret = ath10k_pci_alloc_pipes(ar);
 	if (ret) {
 		ath10k_err(ar, "failed to allocate copy engine pipes: %d\n",
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH v3] ath10k: Override CE5 configuration for QCA6147 device
@ 2015-11-11 18:21 ` Ryan Hsu
  0 siblings, 0 replies; 10+ messages in thread
From: Ryan Hsu @ 2015-11-11 18:21 UTC (permalink / raw)
  To: ath10k; +Cc: linux-wireless, ryanhsu

'Commit a70587b3389a ("ath10k: configure copy engine 5 for HTT messages")'
Introduces to use the unused CE5 for target to host message.

For the device like QCA6174, CE5 already assigned for other feature.
So for QCA6174, override the CE5 configuration and use the CE1 instead.

This patch is based on Rajkumar's earlier patch.

Fixes: a70587b3389a ("ath10k: configure copy engine 5 for HTT messages")
Signed-off-by: Rajkumar Manoharan <rmanohar@qti.qualcomm.com>
Signed-off-by: Ryan Hsu <ryanhsu@qca.qualcomm.com>
---
 drivers/net/wireless/ath/ath10k/pci.c | 32 +++++++++++++++++++++++++++++---
 1 file changed, 29 insertions(+), 3 deletions(-)

diff --git a/drivers/net/wireless/ath/ath10k/pci.c b/drivers/net/wireless/ath/ath10k/pci.c
index 5c91a67..2a48376 100644
--- a/drivers/net/wireless/ath/ath10k/pci.c
+++ b/drivers/net/wireless/ath/ath10k/pci.c
@@ -113,7 +113,7 @@ static void ath10k_pci_htt_tx_cb(struct ath10k_ce_pipe *ce_state);
 static void ath10k_pci_htt_rx_cb(struct ath10k_ce_pipe *ce_state);
 static void ath10k_pci_pktlog_rx_cb(struct ath10k_ce_pipe *ce_state);
 
-static const struct ce_attr host_ce_config_wlan[] = {
+static struct ce_attr host_ce_config_wlan[] = {
 	/* CE0: host->target HTC control and raw streams */
 	{
 		.flags = CE_ATTR_FLAGS,
@@ -219,7 +219,7 @@ static const struct ce_attr host_ce_config_wlan[] = {
 };
 
 /* Target firmware's Copy Engine configuration. */
-static const struct ce_pipe_config target_ce_config_wlan[] = {
+static struct ce_pipe_config target_ce_config_wlan[] = {
 	/* CE0: host->target HTC control and raw streams */
 	{
 		.pipenum = __cpu_to_le32(0),
@@ -332,7 +332,7 @@ static const struct ce_pipe_config target_ce_config_wlan[] = {
  * This table is derived from the CE_PCI TABLE, above.
  * It is passed to the Target at startup for use by firmware.
  */
-static const struct service_to_pipe target_service_to_ce_map_wlan[] = {
+static struct service_to_pipe target_service_to_ce_map_wlan[] = {
 	{
 		__cpu_to_le32(ATH10K_HTC_SVC_ID_WMI_DATA_VO),
 		__cpu_to_le32(PIPEDIR_OUT),	/* out = UL = host -> target */
@@ -2038,6 +2038,29 @@ static int ath10k_pci_init_config(struct ath10k *ar)
 	return 0;
 }
 
+static void ath10k_pci_override_ce_config(struct ath10k *ar)
+{
+	struct ce_attr *attr;
+	struct ce_pipe_config *config;
+
+	/* For QCA6174 we're overriding the Copy Engine 5 configuration,
+	 * since it is currently used for other feature.
+	 */
+
+	/* Override Host's Copy Engine 5 configuration */
+	attr = &host_ce_config_wlan[5];
+	attr->src_sz_max = 0;
+	attr->dest_nentries = 0;
+
+	/* Override Target firmware's Copy Engine configuration */
+	config = &target_ce_config_wlan[5];
+	config->pipedir = __cpu_to_le32(PIPEDIR_OUT);
+	config->nbytes_max = __cpu_to_le32(2048);
+
+	/* Map from service/endpoint to Copy Engine */
+	target_service_to_ce_map_wlan[15].pipenum = __cpu_to_le32(1);
+}
+
 static int ath10k_pci_alloc_pipes(struct ath10k *ar)
 {
 	struct ath10k_pci *ar_pci = ath10k_pci_priv(ar);
@@ -3031,6 +3054,9 @@ static int ath10k_pci_probe(struct pci_dev *pdev,
 		goto err_core_destroy;
 	}
 
+	if (QCA_REV_6174(ar))
+		ath10k_pci_override_ce_config(ar);
+
 	ret = ath10k_pci_alloc_pipes(ar);
 	if (ret) {
 		ath10k_err(ar, "failed to allocate copy engine pipes: %d\n",
-- 
1.9.1


_______________________________________________
ath10k mailing list
ath10k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath10k

^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2015-11-12 19:07 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-06  2:44 [PATCH v3] ath10k: Override CE5 configuration for QCA6147 device Ryan Hsu
2015-11-06  2:44 ` Ryan Hsu
2015-11-12 19:07 ` Kalle Valo
2015-11-12 19:07   ` Kalle Valo
2015-11-11 18:21 Ryan Hsu
2015-11-11 18:21 ` Ryan Hsu
2015-11-12 10:47 ` Julian Calaby
2015-11-12 10:47   ` Julian Calaby
2015-11-12 14:53   ` Kalle Valo
2015-11-12 14:53     ` Kalle Valo

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.