Skip to contentSkip to conversation

ath11k: Add IPQ6018 support

PATCH Superseded Anilkumar Kolli 4 participants 10 messages Jun 18, 2020 – Sep 7, 2020

Subsystems (3)

v3 of 7 Superseded Latest is v7 →

lore
Share & tools
lore
#0 lore raw

v3 cover ath11k: Add IPQ6018 support

IPQ6018 has a 5G radio and 2G radio with 2x2
and shares IPQ8074 configuration.

Tested on: IPQ6018 WLAN.HK.2.2-02134-QCAHKSWPL_SILICONZ-1 Tested on: IPQ8074 WLAN.HK.2.4.0.1-00009-QCAHKSWPL_SILICONZ-1

Anilkumar Kolli (3):
dt: bindings: net: update compatible for ath11k
ath11k: copy ce service configs to hw_params
ath11k: add IPQ6018 support

V2:
- Added devicetree reviewers
V3:
- addressed dt bindinds comments
- Reworked on Kalles patches
- copied ce svc configs to hw_params

 .../bindings/net/wireless/qcom,ath11k.yaml         |   6 +-
 drivers/net/wireless/ath/ath11k/ahb.c              | 131 ++++++++++++++++++++-
 drivers/net/wireless/ath/ath11k/core.c             |  20 ++--
 drivers/net/wireless/ath/ath11k/core.h             |   2 +
 drivers/net/wireless/ath/ath11k/hw.h               |   2 +
 5 files changed, 148 insertions(+), 13 deletions(-)
Signature · 7 lines
2.7.4


_______________________________________________
ath11k mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/ath11k
#1 lore raw

PATCH v3 1/3 dt: bindings: net: update compatible for ath11k

Add IPQ6018 wireless driver support,
its based on ath11k driver.

---
V3:
- Use 'enum' rather than oneOf+const.

 Documentation/devicetree/bindings/net/wireless/qcom,ath11k.yaml | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
Documentation/devicetree/bindings/net/wireless/qcom,ath11k.yaml +5 -1
index a1717db36dba..b22cde6f3594 100644
@@ -17,7 +17,11 @@ description: |
 
 properties:
   compatible:
-    const: qcom,ipq8074-wifi
+    oneOf:
+      - items:
+          - enum:
+              - qcom,ipq8074-wifi
+              - qcom,ipq6018-wifi
 
   reg:
     maxItems: 1
Signature · 1 line
2.7.4
maintainer
#2 lore raw

Re: [PATCH v3 1/3] dt: bindings: net: update compatible for ath11k

Quoted 16 lines · Anilkumar Kolli

Add IPQ6018 wireless driver support,
its based on ath11k driver.

---
V3:
- Use 'enum' rather than oneOf+const.

 Documentation/devicetree/bindings/net/wireless/qcom,ath11k.yaml | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
Documentation/devicetree/bindings/net/wireless/qcom,ath11k.yaml +0 -0
index a1717db36dba..b22cde6f3594 100644

Documentation/devicetree/bindings/net/wireless/qcom,ath11k.yaml description: | · line 24

Quoted 9 lines
Documentation/devicetree/bindings/net/wireless/qcom,ath11k.yaml +5 -1
@@ -17,7 +17,11 @@ description: |
 
 properties:
   compatible:
-    const: qcom,ipq8074-wifi
+    oneOf:
+      - items:
+          - enum:
+              - qcom,ipq8074-wifi
+              - qcom,ipq6018-wifi

Just need:

enum:
- qcom,ipq8074-wifi
- qcom,ipq6018-wifi

Signature · 3 lines
ath11k mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/ath11k
#3 lore raw

PATCH v3 2/3 ath11k: copy ce service configs to hw_params

In reply to Anilkumar Kolli

No functional changes, added target ce service configurations to hw_params.

---
V3:
- added ce svc configs in hw_params

 drivers/net/wireless/ath/ath11k/ahb.c  | 20 +++++++++++++++-----
 drivers/net/wireless/ath/ath11k/core.c |  8 +-------
 drivers/net/wireless/ath/ath11k/core.h |  1 +
 drivers/net/wireless/ath/ath11k/hw.h   |  2 ++
 4 files changed, 19 insertions(+), 12 deletions(-)
drivers/net/wireless/ath/ath11k/ahb.c +15 -5
index 7e9bfeaaf4d2..aa74d27e5871 100644
@@ -152,7 +152,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 const struct service_to_pipe target_service_to_ce_map_wlan_ipq8074[] = {
 	{
 		.service_id = __cpu_to_le32(ATH11K_HTC_SVC_ID_WMI_DATA_VO),
 		.pipedir = __cpu_to_le32(PIPEDIR_OUT),	/* out = UL = host -> target */
@@ -644,8 +644,8 @@ static void ath11k_ahb_init_qmi_ce_config(struct ath11k_base *ab)
 
 	cfg->tgt_ce_len = ARRAY_SIZE(target_ce_config_wlan) - 1;
 	cfg->tgt_ce = target_ce_config_wlan;
-	cfg->svc_to_ce_map_len = ARRAY_SIZE(target_service_to_ce_map_wlan);
-	cfg->svc_to_ce_map = target_service_to_ce_map_wlan;
+	cfg->svc_to_ce_map_len = ab->hw_params.svc_to_ce_map_len;
+	cfg->svc_to_ce_map = ab->hw_params.svc_to_ce_map;
 }
 
 static void ath11k_ahb_free_ext_irq(struct ath11k_base *ab)
@@ -853,8 +853,8 @@ static int ath11k_ahb_map_service_to_pipe(struct ath11k_base *ab, u16 service_id
 	bool ul_set = false, dl_set = false;
 	int i;
 
-	for (i = 0; i < ARRAY_SIZE(target_service_to_ce_map_wlan); i++) {
-		entry = &target_service_to_ce_map_wlan[i];
+	for (i = 0; i < ab->hw_params.svc_to_ce_map_len; i++) {
+		entry = &ab->hw_params.svc_to_ce_map[i];
 
 		if (__le32_to_cpu(entry->service_id) != service_id)
 			continue;
@@ -950,6 +950,16 @@ static int ath11k_ahb_probe(struct platform_device *pdev)
 		goto err_hal_srng_deinit;
 	}
 
+	ret = ath11k_init_hw_params(ab);
+	if (ret) {
+		ath11k_err(ab, "failed to get hw params %d\n", ret);
+		return ret;
+	}
+
+	ab->hw_params.svc_to_ce_map_len =
+			ARRAY_SIZE(target_service_to_ce_map_wlan_ipq8074);
+	ab->hw_params.svc_to_ce_map = target_service_to_ce_map_wlan_ipq8074;
+
 	ath11k_ahb_init_qmi_ce_config(ab);
 
 	ret = ath11k_core_init(ab);
drivers/net/wireless/ath/ath11k/core.c +1 -7
index 38e830a2395b..0bf8bb1674dc 100644
@@ -703,7 +703,7 @@ static void ath11k_core_restart(struct work_struct *work)
 	complete(&ab->driver_recovery);
 }
 
-static int ath11k_init_hw_params(struct ath11k_base *ab)
+int ath11k_init_hw_params(struct ath11k_base *ab)
 {
 	const struct ath11k_hw_params *hw_params = NULL;
 	int i;
@@ -746,12 +746,6 @@ int ath11k_core_init(struct ath11k_base *ab)
 	}
 	ab->tgt_rproc = prproc;
 
-	ret = ath11k_init_hw_params(ab);
-	if (ret) {
-		ath11k_err(ab, "failed to get hw params %d\n", ret);
-		return ret;
-	}
-
 	ret = ath11k_core_soc_create(ab);
 	if (ret) {
 		ath11k_err(ab, "failed to create soc core: %d\n", ret);
drivers/net/wireless/ath/ath11k/core.h +1 -0
index b6ccd9f93853..98b994984c25 100644
@@ -852,6 +852,7 @@ struct ath11k_peer *ath11k_peer_find_by_id(struct ath11k_base *ab, int peer_id);
 int ath11k_core_qmi_firmware_ready(struct ath11k_base *ab);
 int ath11k_core_init(struct ath11k_base *ath11k);
 void ath11k_core_deinit(struct ath11k_base *ath11k);
+int ath11k_init_hw_params(struct ath11k_base *ab);
 struct ath11k_base *ath11k_core_alloc(struct device *dev, size_t priv_size,
 				      enum ath11k_bus bus);
 void ath11k_core_free(struct ath11k_base *ath11k);
drivers/net/wireless/ath/ath11k/hw.h +2 -0
index f31d53f6adb8..388cfb42ef93 100644
@@ -116,6 +116,8 @@ struct ath11k_hw_params {
 	} fw;
 
 	const struct ath11k_hw_ops *hw_ops;
+	const struct service_to_pipe *svc_to_ce_map;
+	int svc_to_ce_map_len;
 };
 
 extern const struct ath11k_hw_ops ipq8074_ops;
Signature · 7 lines
2.7.4


_______________________________________________
ath11k mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/ath11k
#4 lore raw

Re: [PATCH v3 2/3] ath11k: copy ce service configs to hw_params

Hi Anilkumar,

Quoted 53 lines · Anilkumar Kolli

No functional changes, added target ce service configurations to hw_params.

---
V3:
- added ce svc configs in hw_params

 drivers/net/wireless/ath/ath11k/ahb.c  | 20 +++++++++++++++-----
 drivers/net/wireless/ath/ath11k/core.c |  8 +-------
 drivers/net/wireless/ath/ath11k/core.h |  1 +
 drivers/net/wireless/ath/ath11k/hw.h   |  2 ++
 4 files changed, 19 insertions(+), 12 deletions(-)
drivers/net/wireless/ath/ath11k/ahb.c +5 -5
index 7e9bfeaaf4d2..aa74d27e5871 100644
@@ -152,7 +152,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 const struct service_to_pipe target_service_to_ce_map_wlan_ipq8074[] = {
        {
                .service_id = __cpu_to_le32(ATH11K_HTC_SVC_ID_WMI_DATA_VO),
                .pipedir = __cpu_to_le32(PIPEDIR_OUT),  /* out = UL = host -> target */
@@ -644,8 +644,8 @@ static void ath11k_ahb_init_qmi_ce_config(struct ath11k_base *ab)
 
        cfg->tgt_ce_len = ARRAY_SIZE(target_ce_config_wlan) - 1;
        cfg->tgt_ce = target_ce_config_wlan;
-       cfg->svc_to_ce_map_len = ARRAY_SIZE(target_service_to_ce_map_wlan);
-       cfg->svc_to_ce_map = target_service_to_ce_map_wlan;
+       cfg->svc_to_ce_map_len = ab->hw_params.svc_to_ce_map_len;
+       cfg->svc_to_ce_map = ab->hw_params.svc_to_ce_map;
 }
 
 static void ath11k_ahb_free_ext_irq(struct ath11k_base *ab)
@@ -853,8 +853,8 @@ static int ath11k_ahb_map_service_to_pipe(struct ath11k_base *ab, u16 service_id
        bool ul_set = false, dl_set = false;
        int i;
 
-       for (i = 0; i < ARRAY_SIZE(target_service_to_ce_map_wlan); i++) {
-               entry = &target_service_to_ce_map_wlan[i];
+       for (i = 0; i < ab->hw_params.svc_to_ce_map_len; i++) {
+               entry = &ab->hw_params.svc_to_ce_map[i];
 
                if (__le32_to_cpu(entry->service_id) != service_id)
                        continue;
@@ -950,6 +950,16 @@ static int ath11k_ahb_probe(struct platform_device *pdev)
                goto err_hal_srng_deinit;
        }

drivers/net/wireless/ath/ath11k/ahb.c static int ath11k_ahb_probe(struct platform_device *pdev) · line 961

Quoted 10 lines
drivers/net/wireless/ath/ath11k/ahb.c +9 -0
 
+       ret = ath11k_init_hw_params(ab);
+       if (ret) {
+               ath11k_err(ab, "failed to get hw params %d\n", ret);
+               return ret;
+       }
+
+       ab->hw_params.svc_to_ce_map_len =
+                       ARRAY_SIZE(target_service_to_ce_map_wlan_ipq8074);
+       ab->hw_params.svc_to_ce_map = target_service_to_ce_map_wlan_ipq8074;

I think you misunderstood my point about this, the point wasn't to copy the svc map to hw_params, but define it in hw_params:

+ {

+               .hw_rev = ATH11K_HW_IPQ6018,
+               .name = "ipq6018 hw1.0",
+               .fw = {
+                       .dir = "IPQ6018/hw1.0",
+                       .board_size = 256 * 1024,
+                       .cal_size = 256 * 1024,
+               },
+               .max_radios = 2,
+               .bdf_addr = 0x4ABC0000,
+               .hw_ops = &ipq6018_ops,
+               .svc_to_ce_map_len =

ARRAY_SIZE(target_service_to_ce_map_wlan_ipq6018,
+ .svc_to_ce_map = target_service_to_ce_map_wlan_ipq6018,
+ },

That completely eliminates special case code based on the hardware ID in the driver.

Thanks,

--
Julian Calaby

Email: [email protected]
Profile: http://www.google.com/profiles/julian.calaby/

_______________________________________________
ath11k mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/ath11k

#5 lore raw

Re: [PATCH v3 2/3] ath11k: copy ce service configs to hw_params

Quoted 98 lines · Julian Calaby

Hi Anilkumar,

Quoted 65 lines · Anilkumar Kolli

No functional changes, added target ce service configurations to hw_params.

---
V3:
- added ce svc configs in hw_params

 drivers/net/wireless/ath/ath11k/ahb.c  | 20 +++++++++++++++-----
 drivers/net/wireless/ath/ath11k/core.c |  8 +-------
 drivers/net/wireless/ath/ath11k/core.h |  1 +
 drivers/net/wireless/ath/ath11k/hw.h   |  2 ++
 4 files changed, 19 insertions(+), 12 deletions(-)
drivers/net/wireless/ath/ath11k/ahb.c +1 -1
index 7e9bfeaaf4d2..aa74d27e5871 100644
@@ -152,7 +152,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 const struct service_to_pipe 
 target_service_to_ce_map_wlan_ipq8074[] = {
        {
                .service_id = 
__cpu_to_le32(ATH11K_HTC_SVC_ID_WMI_DATA_VO),
                .pipedir = __cpu_to_le32(PIPEDIR_OUT),  /* out = UL = 

host -> target */

drivers/net/wireless/ath/ath11k/ahb.c +2 -2
@@ -644,8 +644,8 @@ static void ath11k_ahb_init_qmi_ce_config(struct 
 ath11k_base *ab)
 
        cfg->tgt_ce_len = ARRAY_SIZE(target_ce_config_wlan) - 1;
        cfg->tgt_ce = target_ce_config_wlan;
-       cfg->svc_to_ce_map_len = 
 ARRAY_SIZE(target_service_to_ce_map_wlan);
-       cfg->svc_to_ce_map = target_service_to_ce_map_wlan;
+       cfg->svc_to_ce_map_len = ab->hw_params.svc_to_ce_map_len;
+       cfg->svc_to_ce_map = ab->hw_params.svc_to_ce_map;
 }

static void ath11k_ahb_free_ext_irq(struct ath11k_base *ab)

drivers/net/wireless/ath/ath11k/ahb.c +0 -0
@@ -853,8 +853,8 @@ static int ath11k_ahb_map_service_to_pipe(struct 

ath11k_base *ab, u16 service_id

        bool ul_set = false, dl_set = false;
        int i;

- for (i = 0; i < ARRAY_SIZE(target_service_to_ce_map_wlan);
i++) {

drivers/net/wireless/ath/ath11k/ahb.c +3 -1
-               entry = &target_service_to_ce_map_wlan[i];
+       for (i = 0; i < ab->hw_params.svc_to_ce_map_len; i++) {
+               entry = &ab->hw_params.svc_to_ce_map[i];
 
                if (__le32_to_cpu(entry->service_id) != service_id)
                        continue;
@@ -950,6 +950,16 @@ static int ath11k_ahb_probe(struct 
 platform_device *pdev)
                goto err_hal_srng_deinit;
        }
 
+       ret = ath11k_init_hw_params(ab);

drivers/net/wireless/ath/ath11k/ahb.c static int ath11k_ahb_probe(struct · line 964

Quoted 10 lines
drivers/net/wireless/ath/ath11k/ahb.c +8 -0
+       if (ret) {
+               ath11k_err(ab, "failed to get hw params %d\n", ret);
+               return ret;
+       }
+
+       ab->hw_params.svc_to_ce_map_len =
+                       
 ARRAY_SIZE(target_service_to_ce_map_wlan_ipq8074);
+       ab->hw_params.svc_to_ce_map = 
 target_service_to_ce_map_wlan_ipq8074;

I think you misunderstood my point about this, the point wasn't to copy the svc map to hw_params, but define it in hw_params:

(quoted diff) +12 -0
+       {
+               .hw_rev = ATH11K_HW_IPQ6018,
+               .name = "ipq6018 hw1.0",
+               .fw = {
+                       .dir = "IPQ6018/hw1.0",
+                       .board_size = 256 * 1024,
+                       .cal_size = 256 * 1024,
+               },
+               .max_radios = 2,
+               .bdf_addr = 0x4ABC0000,
+               .hw_ops = &ipq6018_ops,
+               .svc_to_ce_map_len =

ARRAY_SIZE(target_service_to_ce_map_wlan_ipq6018,

(quoted diff) +2 -0
+               .svc_to_ce_map = target_service_to_ce_map_wlan_ipq6018,
+       },
Quoted 3 lines

That completely eliminates special case code based on the hardware ID in the driver.

The static array of structures target_service_to_ce_map_wlan_ipq6018[] is defined in ahb.c and hw_params are initialised in core.c, this will not work. no?

Thanks
Anil

_______________________________________________
ath11k mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/ath11k

#6 lore raw

Re: [PATCH v3 2/3] ath11k: copy ce service configs to hw_params

Hi Anilkumar,

Quoted 102 lines · On Sat, Jun 20, 2020 at 2:24 AM <[email protected]> wrote:
Quoted 100 lines · Julian Calaby

Hi Anilkumar,

Quoted 66 lines · Anilkumar Kolli

No functional changes, added target ce service configurations to hw_params.

---
V3:
- added ce svc configs in hw_params

 drivers/net/wireless/ath/ath11k/ahb.c  | 20 +++++++++++++++-----
 drivers/net/wireless/ath/ath11k/core.c |  8 +-------
 drivers/net/wireless/ath/ath11k/core.h |  1 +
 drivers/net/wireless/ath/ath11k/hw.h   |  2 ++
 4 files changed, 19 insertions(+), 12 deletions(-)
drivers/net/wireless/ath/ath11k/ahb.c +1 -1
index 7e9bfeaaf4d2..aa74d27e5871 100644
@@ -152,7 +152,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 const struct service_to_pipe
 target_service_to_ce_map_wlan_ipq8074[] = {
        {
                .service_id =
__cpu_to_le32(ATH11K_HTC_SVC_ID_WMI_DATA_VO),
                .pipedir = __cpu_to_le32(PIPEDIR_OUT),  /* out = UL =

host -> target */

drivers/net/wireless/ath/ath11k/ahb.c +2 -2
@@ -644,8 +644,8 @@ static void ath11k_ahb_init_qmi_ce_config(struct
 ath11k_base *ab)
 
        cfg->tgt_ce_len = ARRAY_SIZE(target_ce_config_wlan) - 1;
        cfg->tgt_ce = target_ce_config_wlan;
-       cfg->svc_to_ce_map_len =
 ARRAY_SIZE(target_service_to_ce_map_wlan);
-       cfg->svc_to_ce_map = target_service_to_ce_map_wlan;
+       cfg->svc_to_ce_map_len = ab->hw_params.svc_to_ce_map_len;
+       cfg->svc_to_ce_map = ab->hw_params.svc_to_ce_map;
 }

static void ath11k_ahb_free_ext_irq(struct ath11k_base *ab)

drivers/net/wireless/ath/ath11k/ahb.c +0 -0
@@ -853,8 +853,8 @@ static int ath11k_ahb_map_service_to_pipe(struct

ath11k_base *ab, u16 service_id

        bool ul_set = false, dl_set = false;
        int i;

- for (i = 0; i < ARRAY_SIZE(target_service_to_ce_map_wlan);
i++) {

drivers/net/wireless/ath/ath11k/ahb.c +3 -1
-               entry = &target_service_to_ce_map_wlan[i];
+       for (i = 0; i < ab->hw_params.svc_to_ce_map_len; i++) {
+               entry = &ab->hw_params.svc_to_ce_map[i];
 
                if (__le32_to_cpu(entry->service_id) != service_id)
                        continue;
@@ -950,6 +950,16 @@ static int ath11k_ahb_probe(struct
 platform_device *pdev)
                goto err_hal_srng_deinit;
        }
 
+       ret = ath11k_init_hw_params(ab);

drivers/net/wireless/ath/ath11k/ahb.c static int ath11k_ahb_probe(struct · line 964

Quoted 10 lines
drivers/net/wireless/ath/ath11k/ahb.c +8 -0
+       if (ret) {
+               ath11k_err(ab, "failed to get hw params %d\n", ret);
+               return ret;
+       }
+
+       ab->hw_params.svc_to_ce_map_len =
+
 ARRAY_SIZE(target_service_to_ce_map_wlan_ipq8074);
+       ab->hw_params.svc_to_ce_map =
 target_service_to_ce_map_wlan_ipq8074;

I think you misunderstood my point about this, the point wasn't to copy the svc map to hw_params, but define it in hw_params:

(quoted diff) +12 -0
+       {
+               .hw_rev = ATH11K_HW_IPQ6018,
+               .name = "ipq6018 hw1.0",
+               .fw = {
+                       .dir = "IPQ6018/hw1.0",
+                       .board_size = 256 * 1024,
+                       .cal_size = 256 * 1024,
+               },
+               .max_radios = 2,
+               .bdf_addr = 0x4ABC0000,
+               .hw_ops = &ipq6018_ops,
+               .svc_to_ce_map_len =

ARRAY_SIZE(target_service_to_ce_map_wlan_ipq6018,

(quoted diff) +2 -0
+               .svc_to_ce_map = target_service_to_ce_map_wlan_ipq6018,
+       },
Quoted 6 lines
Quoted 3 lines

That completely eliminates special case code based on the hardware ID in the driver.

The static array of structures target_service_to_ce_map_wlan_ipq6018[] is defined in ahb.c and hw_params are initialised in core.c, this will not work. no?

My understanding, and please correct me if I'm wrong, is that the service map is a property of the hardware. So why not define all the hardware properties in one place?

You could either move the hardware definitions and service maps to a new file (maybe ahb_conf.c), move those maps to ahb.c or just add them to some header file so ahb.c can reference them.

Thanks,

Signature · 4 lines
Julian Calaby

Email: [email protected]
Profile: http://www.google.com/profiles/julian.calaby/
#7 lore raw

Re: [PATCH v3 2/3] ath11k: copy ce service configs to hw_params

In reply to [email protected]
Quoted 41 lines · [email protected] writes:
Quoted 40 lines · Julian Calaby
Quoted 7 lines · Anilkumar Kolli
drivers/net/wireless/ath/ath11k/ahb.c +1 -0
@@ -950,6 +950,16 @@ static int ath11k_ahb_probe(struct
 platform_device *pdev)
                goto err_hal_srng_deinit;
        }
 
+       ret = ath11k_init_hw_params(ab);

drivers/net/wireless/ath/ath11k/ahb.c static int ath11k_ahb_probe(struct · line 964

Quoted 10 lines
drivers/net/wireless/ath/ath11k/ahb.c +8 -0
+       if (ret) {
+               ath11k_err(ab, "failed to get hw params %d\n", ret);
+               return ret;
+       }
+
+       ab->hw_params.svc_to_ce_map_len =
+
 ARRAY_SIZE(target_service_to_ce_map_wlan_ipq8074);
+       ab->hw_params.svc_to_ce_map =
 target_service_to_ce_map_wlan_ipq8074;

I think you misunderstood my point about this, the point wasn't to copy the svc map to hw_params, but define it in hw_params:

(quoted diff) +12 -0
+       {
+               .hw_rev = ATH11K_HW_IPQ6018,
+               .name = "ipq6018 hw1.0",
+               .fw = {
+                       .dir = "IPQ6018/hw1.0",
+                       .board_size = 256 * 1024,
+                       .cal_size = 256 * 1024,
+               },
+               .max_radios = 2,
+               .bdf_addr = 0x4ABC0000,
+               .hw_ops = &ipq6018_ops,
+               .svc_to_ce_map_len =

ARRAY_SIZE(target_service_to_ce_map_wlan_ipq6018,

(quoted diff) +2 -0
+               .svc_to_ce_map = target_service_to_ce_map_wlan_ipq6018,
+       },
Quoted 6 lines
Quoted 3 lines

That completely eliminates special case code based on the hardware ID in the driver.

The static array of structures target_service_to_ce_map_wlan_ipq6018[] is defined in ahb.c and hw_params are initialised in core.c, this will not work. no?

You could move the map arrays to hw.c, as an example see how ath11k_hw_ring_mask_ipq8074 is implemented. That way we don't need any new hw_rev checks.

Signature · 1 line
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
#8 lore raw

Re: [PATCH v3 2/3] ath11k: copy ce service configs to hw_params

In reply to [email protected]
Quoted 41 lines · [email protected] writes:
Quoted 40 lines · Julian Calaby
Quoted 7 lines · Anilkumar Kolli
drivers/net/wireless/ath/ath11k/ahb.c +1 -0
@@ -950,6 +950,16 @@ static int ath11k_ahb_probe(struct
 platform_device *pdev)
                goto err_hal_srng_deinit;
        }
 
+       ret = ath11k_init_hw_params(ab);

drivers/net/wireless/ath/ath11k/ahb.c static int ath11k_ahb_probe(struct · line 964

Quoted 10 lines
drivers/net/wireless/ath/ath11k/ahb.c +8 -0
+       if (ret) {
+               ath11k_err(ab, "failed to get hw params %d\n", ret);
+               return ret;
+       }
+
+       ab->hw_params.svc_to_ce_map_len =
+
 ARRAY_SIZE(target_service_to_ce_map_wlan_ipq8074);
+       ab->hw_params.svc_to_ce_map =
 target_service_to_ce_map_wlan_ipq8074;

I think you misunderstood my point about this, the point wasn't to copy the svc map to hw_params, but define it in hw_params:

(quoted diff) +12 -0
+       {
+               .hw_rev = ATH11K_HW_IPQ6018,
+               .name = "ipq6018 hw1.0",
+               .fw = {
+                       .dir = "IPQ6018/hw1.0",
+                       .board_size = 256 * 1024,
+                       .cal_size = 256 * 1024,
+               },
+               .max_radios = 2,
+               .bdf_addr = 0x4ABC0000,
+               .hw_ops = &ipq6018_ops,
+               .svc_to_ce_map_len =

ARRAY_SIZE(target_service_to_ce_map_wlan_ipq6018,

(quoted diff) +2 -0
+               .svc_to_ce_map = target_service_to_ce_map_wlan_ipq6018,
+       },
Quoted 6 lines
Quoted 3 lines

That completely eliminates special case code based on the hardware ID in the driver.

The static array of structures target_service_to_ce_map_wlan_ipq6018[] is defined in ahb.c and hw_params are initialised in core.c, this will not work. no?

You could move the map arrays to hw.c, as an example see how ath11k_hw_ring_mask_ipq8074 is implemented. That way we don't need any new hw_rev checks.

Signature · 6 lines
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches

-- 
ath11k mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/ath11k
#9 lore raw

PATCH v3 3/3 ath11k: add IPQ6018 support

In reply to Anilkumar Kolli

IPQ6018 has one 5G and one 2G radio with 2x2,
shares ipq8074 configurations.

---
V3:
- rebased on Kalles patches

 drivers/net/wireless/ath/ath11k/ahb.c  | 115 ++++++++++++++++++++++++++++++++-
 drivers/net/wireless/ath/ath11k/core.c |  12 ++++
 drivers/net/wireless/ath/ath11k/core.h |   1 +
 3 files changed, 126 insertions(+), 2 deletions(-)
drivers/net/wireless/ath/ath11k/ahb.c +113 -2
index aa74d27e5871..21f23ac75650 100644
@@ -20,6 +20,9 @@ static const struct of_device_id ath11k_ahb_of_match[] = {
 	{ .compatible = "qcom,ipq8074-wifi",
 	  .data = (void *)ATH11K_HW_IPQ8074,
 	},
+	{ .compatible = "qcom,ipq6018-wifi",
+	  .data = (void *)ATH11K_HW_IPQ6018,
+	},
 	{ }
 };
 
@@ -264,6 +267,108 @@ static const struct service_to_pipe target_service_to_ce_map_wlan_ipq8074[] = {
 	{ /* terminator entry */ }
 };
 
+static const struct service_to_pipe target_service_to_ce_map_wlan_ipq6018[] = {
+	{
+		.service_id = __cpu_to_le32(ATH11K_HTC_SVC_ID_WMI_DATA_VO),
+		.pipedir = __cpu_to_le32(PIPEDIR_OUT),	/* out = UL = host -> target */
+		.pipenum = __cpu_to_le32(3),
+	},
+	{
+		.service_id = __cpu_to_le32(ATH11K_HTC_SVC_ID_WMI_DATA_VO),
+		.pipedir = __cpu_to_le32(PIPEDIR_IN),	/* in = DL = target -> host */
+		.pipenum = __cpu_to_le32(2),
+	},
+	{
+		.service_id = __cpu_to_le32(ATH11K_HTC_SVC_ID_WMI_DATA_BK),
+		.pipedir = __cpu_to_le32(PIPEDIR_OUT),	/* out = UL = host -> target */
+		.pipenum = __cpu_to_le32(3),
+	},
+	{
+		.service_id = __cpu_to_le32(ATH11K_HTC_SVC_ID_WMI_DATA_BK),
+		.pipedir = __cpu_to_le32(PIPEDIR_IN),	/* in = DL = target -> host */
+		.pipenum = __cpu_to_le32(2),
+	},
+	{
+		.service_id = __cpu_to_le32(ATH11K_HTC_SVC_ID_WMI_DATA_BE),
+		.pipedir = __cpu_to_le32(PIPEDIR_OUT),	/* out = UL = host -> target */
+		.pipenum = __cpu_to_le32(3),
+	},
+	{
+		.service_id = __cpu_to_le32(ATH11K_HTC_SVC_ID_WMI_DATA_BE),
+		.pipedir = __cpu_to_le32(PIPEDIR_IN),	/* in = DL = target -> host */
+		.pipenum = __cpu_to_le32(2),
+	},
+	{
+		.service_id = __cpu_to_le32(ATH11K_HTC_SVC_ID_WMI_DATA_VI),
+		.pipedir = __cpu_to_le32(PIPEDIR_OUT),	/* out = UL = host -> target */
+		.pipenum = __cpu_to_le32(3),
+	},
+	{
+		.service_id = __cpu_to_le32(ATH11K_HTC_SVC_ID_WMI_DATA_VI),
+		.pipedir = __cpu_to_le32(PIPEDIR_IN),	/* in = DL = target -> host */
+		.pipenum = __cpu_to_le32(2),
+	},
+	{
+		.service_id = __cpu_to_le32(ATH11K_HTC_SVC_ID_WMI_CONTROL),
+		.pipedir = __cpu_to_le32(PIPEDIR_OUT),	/* out = UL = host -> target */
+		.pipenum = __cpu_to_le32(3),
+	},
+	{
+		.service_id = __cpu_to_le32(ATH11K_HTC_SVC_ID_WMI_CONTROL),
+		.pipedir = __cpu_to_le32(PIPEDIR_IN),	/* in = DL = target -> host */
+		.pipenum = __cpu_to_le32(2),
+	},
+	{
+		.service_id = __cpu_to_le32(ATH11K_HTC_SVC_ID_WMI_CONTROL_MAC1),
+		.pipedir = __cpu_to_le32(PIPEDIR_OUT),	/* out = UL = host -> target */
+		.pipenum = __cpu_to_le32(7),
+	},
+	{
+		.service_id = __cpu_to_le32(ATH11K_HTC_SVC_ID_WMI_CONTROL_MAC1),
+		.pipedir = __cpu_to_le32(PIPEDIR_IN),	/* in = DL = target -> host */
+		.pipenum = __cpu_to_le32(2),
+	},
+	{
+		.service_id = __cpu_to_le32(ATH11K_HTC_SVC_ID_RSVD_CTRL),
+		.pipedir = __cpu_to_le32(PIPEDIR_OUT),	/* out = UL = host -> target */
+		.pipenum = __cpu_to_le32(0),
+	},
+	{
+		.service_id = __cpu_to_le32(ATH11K_HTC_SVC_ID_RSVD_CTRL),
+		.pipedir = __cpu_to_le32(PIPEDIR_IN),	/* in = DL = target -> host */
+		.pipenum = __cpu_to_le32(1),
+	},
+	{ /* not used */
+		.service_id = __cpu_to_le32(ATH11K_HTC_SVC_ID_TEST_RAW_STREAMS),
+		.pipedir = __cpu_to_le32(PIPEDIR_OUT),	/* out = UL = host -> target */
+		.pipenum = __cpu_to_le32(0),
+	},
+	{ /* not used */
+		.service_id = __cpu_to_le32(ATH11K_HTC_SVC_ID_TEST_RAW_STREAMS),
+		.pipedir = __cpu_to_le32(PIPEDIR_IN),	/* in = DL = target -> host */
+		.pipenum = __cpu_to_le32(1),
+	},
+	{
+		.service_id = __cpu_to_le32(ATH11K_HTC_SVC_ID_HTT_DATA_MSG),
+		.pipedir = __cpu_to_le32(PIPEDIR_OUT),	/* out = UL = host -> target */
+		.pipenum = __cpu_to_le32(4),
+	},
+	{
+		.service_id = __cpu_to_le32(ATH11K_HTC_SVC_ID_HTT_DATA_MSG),
+		.pipedir = __cpu_to_le32(PIPEDIR_IN),	/* in = DL = target -> host */
+		.pipenum = __cpu_to_le32(1),
+	},
+	{
+		.service_id = __cpu_to_le32(ATH11K_HTC_SVC_ID_PKT_LOG),
+		.pipedir = __cpu_to_le32(PIPEDIR_IN),	/* in = DL = target -> host */
+		.pipenum = __cpu_to_le32(5),
+	},
+
+	/* (Additions here) */
+
+	{ /* terminator entry */ }
+};
+
 #define ATH11K_IRQ_CE0_OFFSET 4
 
 static const char *irq_name[ATH11K_IRQ_NUM_MAX] = {
@@ -956,9 +1061,15 @@ static int ath11k_ahb_probe(struct platform_device *pdev)
 		return ret;
 	}
 
-	ab->hw_params.svc_to_ce_map_len =
+	if (ab->hw_rev == ATH11K_HW_IPQ8074) {
+		ab->hw_params.svc_to_ce_map_len =
 			ARRAY_SIZE(target_service_to_ce_map_wlan_ipq8074);
-	ab->hw_params.svc_to_ce_map = target_service_to_ce_map_wlan_ipq8074;
+		ab->hw_params.svc_to_ce_map = target_service_to_ce_map_wlan_ipq8074;
+	} else if (ab->hw_rev == ATH11K_HW_IPQ6018) {
+		ab->hw_params.svc_to_ce_map_len =
+			ARRAY_SIZE(target_service_to_ce_map_wlan_ipq6018);
+		ab->hw_params.svc_to_ce_map = target_service_to_ce_map_wlan_ipq6018;
+	}
 
 	ath11k_ahb_init_qmi_ce_config(ab);
 
drivers/net/wireless/ath/ath11k/core.c +12 -0
index 0bf8bb1674dc..5f794f97d359 100644
@@ -30,6 +30,18 @@ static const struct ath11k_hw_params ath11k_hw_params[] = {
 		.bdf_addr = 0x4B0C0000,
 		.hw_ops = &ipq8074_ops,
 	},
+	{
+		.hw_rev = ATH11K_HW_IPQ6018,
+		.name = "ipq6018 hw1.0",
+		.fw = {
+			.dir = "IPQ6018/hw1.0",
+			.board_size = 256 * 1024,
+			.cal_size = 256 * 1024,
+		},
+		.max_radios = 2,
+		.bdf_addr = 0x4ABC0000,
+		.hw_ops = &ipq6018_ops,
+	},
 };
 
 static int ath11k_core_create_board_name(struct ath11k_base *ab, char *name,
drivers/net/wireless/ath/ath11k/core.h +1 -0
index 98b994984c25..fe11fcd9e914 100644
@@ -90,6 +90,7 @@ struct ath11k_skb_rxcb {
 
 enum ath11k_hw_rev {
 	ATH11K_HW_IPQ8074,
+	ATH11K_HW_IPQ6018,
 };
 
 enum ath11k_firmware_mode {
Signature · 1 line
2.7.4