ath11k: Add IPQ6018 support
Subsystems (3)
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 (8):
ath11k: update firmware files read path
ath11k: rename default board file
dt: bindings: net: update compatible for ath11k
ath11k: add IPQ6018 support
ath11k: define max_radios in hw_params
ath11k: add hw_ops for pdev id to hw_mac mapping
ath11k: add ce services for IPQ6018
ath11k: Add bdf-addr in hw_params
.../bindings/net/wireless/qcom,ath11k.yaml | 4 +- drivers/net/wireless/ath/ath11k/Makefile | 3 +- drivers/net/wireless/ath/ath11k/ahb.c | 151 ++++++++++++++++++--- drivers/net/wireless/ath/ath11k/core.c | 78 +++++++---- drivers/net/wireless/ath/ath11k/core.h | 2 +- drivers/net/wireless/ath/ath11k/dp_rx.c | 2 +- drivers/net/wireless/ath/ath11k/htc.c | 2 +- drivers/net/wireless/ath/ath11k/hw.c | 34 +++++ drivers/net/wireless/ath/ath11k/hw.h | 31 ++++- drivers/net/wireless/ath/ath11k/mac.c | 2 +- drivers/net/wireless/ath/ath11k/qmi.c | 6 +- drivers/net/wireless/ath/ath11k/qmi.h | 1 - drivers/net/wireless/ath/ath11k/reg.c | 2 +- drivers/net/wireless/ath/ath11k/wmi.c | 4 +- 14 files changed, 266 insertions(+), 56 deletions(-) create mode 100644 drivers/net/wireless/ath/ath11k/hw.c
Signature · 7 lines
2.7.4 _______________________________________________ ath11k mailing list [email protected] http://lists.infradead.org/mailman/listinfo/ath11k
PATCH 1/8 ath11k: update firmware files read path
We need this so that all hardware versions can coexist and it's easier to manage everything then all hardware directories are under ath11k directory.
Copy ath11k firmware files to/lib/firmware/ath11k/IPQ8074/hw2.0/
--- drivers/net/wireless/ath/ath11k/hw.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/ath/ath11k/hw.h +1 -1
@@ -69,7 +69,7 @@#define ATH11K_FW_DIR "ath11k"/* IPQ8074 definitions */ -#define IPQ8074_FW_DIR "IPQ8074" +#define IPQ8074_FW_DIR ATH11K_FW_DIR "/IPQ8074/hw2.0"#define IPQ8074_MAX_BOARD_DATA_SZ (256 * 1024)#define IPQ8074_MAX_CAL_DATA_SZ IPQ8074_MAX_BOARD_DATA_SZ
Signature · 1 line
2.7.4
PATCH 2/8 ath11k: rename default board file
In reply to Anilkumar KolliRename default BDF to make it consistent with board-2.bin naming.
--- drivers/net/wireless/ath/ath11k/hw.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/ath/ath11k/hw.h +1 -1
@@ -75,7 +75,7 @@#define ATH11K_BOARD_MAGIC "QCA-ATH11K-BOARD"#define ATH11K_BOARD_API2_FILE "board-2.bin" -#define ATH11K_DEFAULT_BOARD_FILE "bdwlan.bin" +#define ATH11K_DEFAULT_BOARD_FILE "board.bin"#define ATH11K_DEFAULT_CAL_FILE "caldata.bin"enum ath11k_hw_rate_cck {
Signature · 1 line
2.7.4
PATCH 3/8 dt: bindings: net: update compatible for ath11k
In reply to Anilkumar KolliAdd IPQ6018 wireless driver support,
its based on ath11k driver.
--- Documentation/devicetree/bindings/net/wireless/qcom,ath11k.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
Documentation/devicetree/bindings/net/wireless/qcom,ath11k.yaml +3 -1
@@ -17,7 +17,9 @@ description: | properties: compatible: - const: qcom,ipq8074-wifi + oneOf: + - const: qcom,ipq8074-wifi + - const: qcom,ipq6018-wifi reg: maxItems: 1
Signature · 1 line
2.7.4
PATCH 4/8 ath11k: add IPQ6018 support
In reply to Anilkumar KolliIPQ6018 has one 5G and one 2G radio with 2x2,
shares ipq8074 configurations.
--- drivers/net/wireless/ath/ath11k/ahb.c | 3 ++ drivers/net/wireless/ath/ath11k/core.c | 55 +++++++++++++++++++++++++++++----- drivers/net/wireless/ath/ath11k/core.h | 1 + drivers/net/wireless/ath/ath11k/hw.h | 6 ++++ 4 files changed, 58 insertions(+), 7 deletions(-)
drivers/net/wireless/ath/ath11k/ahb.c +3 -0
@@ -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, + }, { } };
drivers/net/wireless/ath/ath11k/core.c +48 -7
73 lines not on this page · raw message
drivers/net/wireless/ath/ath11k/core.h +1 -0
@@ -88,6 +88,7 @@ struct ath11k_skb_rxcb {enum ath11k_hw_rev {ATH11K_HW_IPQ8074 , +ATH11K_HW_IPQ6018 , };enum ath11k_firmware_mode {
drivers/net/wireless/ath/ath11k/hw.h +6 -0
@@ -73,6 +73,11 @@#define IPQ8074_MAX_BOARD_DATA_SZ (256 * 1024)#define IPQ8074_MAX_CAL_DATA_SZ IPQ8074_MAX_BOARD_DATA_SZ +/* IPQ6018 definitions */ +#define IPQ6018_FW_DIR ATH11K_FW_DIR "/IPQ6018/hw1.0" +#define IPQ6018_MAX_BOARD_DATA_SZ (256 * 1024) +#define IPQ6018_MAX_CAL_DATA_SZ IPQ6018_MAX_BOARD_DATA_SZ +#define ATH11K_BOARD_MAGIC "QCA-ATH11K-BOARD"#define ATH11K_BOARD_API2_FILE "board-2.bin"#define ATH11K_DEFAULT_BOARD_FILE "board.bin"
@@ -106,6 +111,7 @@ enum ath11k_bus {struct ath11k_hw_params {const char *name; +u16 dev_id;struct {const char *dir;size_t board_size;
Signature · 7 lines
2.7.4 _______________________________________________ ath11k mailing list [email protected] http://lists.infradead.org/mailman/listinfo/ath11k
PATCH 5/8 ath11k: define max_radios in hw_params
In reply to Anilkumar KolliDefine max_radios supported in hw_params.
--- drivers/net/wireless/ath/ath11k/core.c | 2 ++ drivers/net/wireless/ath/ath11k/dp_rx.c | 2 +- drivers/net/wireless/ath/ath11k/htc.c | 2 +- drivers/net/wireless/ath/ath11k/hw.h | 1 + drivers/net/wireless/ath/ath11k/reg.c | 2 +- drivers/net/wireless/ath/ath11k/wmi.c | 4 ++-- 6 files changed, 8 insertions(+), 5 deletions(-)
drivers/net/wireless/ath/ath11k/core.c +2 -0
@@ -26,6 +26,7 @@ static const struct ath11k_hw_params ath11k_hw_params_list[] = { .board_size = IPQ8074_MAX_BOARD_DATA_SZ, .cal_size = IPQ8074_MAX_CAL_DATA_SZ, }, + .max_radios = 3, }, { .dev_id = ATH11K_HW_IPQ6018,
@@ -35,6 +36,7 @@ static const struct ath11k_hw_params ath11k_hw_params_list[] = { .board_size = IPQ6018_MAX_BOARD_DATA_SZ, .cal_size = IPQ6018_MAX_CAL_DATA_SZ, }, + .max_radios = 2, }, };
drivers/net/wireless/ath/ath11k/dp_rx.c +1 -1
@@ -3792,7 +3792,7 @@ int ath11k_dp_rx_process_wbm_err(struct ath11k_base *ab,int total_num_buffs_reaped =0 ;int ret, i; -for (i =0 ; i <MAX_RADIOS ; i++) +for (i =0 ; i < ab->num_radios; i++)__skb_queue_head_init (&msdu_list[i]); srng = &ab->hal.srng_list[dp->rx_rel_ring.ring_id];
drivers/net/wireless/ath/ath11k/htc.c +1 -1
@@ -748,7 +748,7 @@ int ath11k_htc_init(struct ath11k_base *ab) htc->wmi_ep_count =3 ;break ;default : - htc->wmi_ep_count =3 ; + htc->wmi_ep_count = ab->hw_params.max_radios;break ; }
drivers/net/wireless/ath/ath11k/hw.h +1 -0
@@ -112,6 +112,7 @@ enum ath11k_bus {struct ath11k_hw_params {const char *name;u16 dev_id; +u8 max_radios;struct {const char *dir;size_t board_size;
drivers/net/wireless/ath/ath11k/reg.c +1 -1
@@ -695,7 +695,7 @@ void ath11k_reg_free(struct ath11k_base *ab) {int i; -for (i =0 ; i <MAX_RADIOS ; i++) { +for (i =0 ; i < ab->hw_params.max_radios; i++) {kfree (ab->default_regd[i]);kfree (ab->new_regd[i]); }
drivers/net/wireless/ath/ath11k/wmi.c +2 -2
@@ -6152,7 +6152,7 @@ int ath11k_wmi_connect(struct ath11k_base *ab)u8 wmi_ep_count; wmi_ep_count = ab->htc.wmi_ep_count; -if (wmi_ep_count >MAX_RADIOS ) +if (wmi_ep_count > ab->hw_params.max_radios)return -1 ;for (i =0 ; i < wmi_ep_count; i++)
@@ -6174,7 +6174,7 @@ int ath11k_wmi_pdev_attach(struct ath11k_base *ab, {struct ath11k_pdev_wmi *wmi_handle; -if (pdev_id >=MAX_RADIOS ) +if (pdev_id >= ab->hw_params.max_radios)return -EINVAL ; wmi_handle = &ab->wmi_ab.wmi[pdev_id];
Signature · 7 lines
2.7.4 _______________________________________________ ath11k mailing list [email protected] http://lists.infradead.org/mailman/listinfo/ath11k
PATCH 6/8 ath11k: add hw_ops for pdev id to hw_mac mapping
In reply to Anilkumar Kollipdev_id to hw_mac is different for ipq8074 and ipq6018 Below table has the mapping
pdev_id ipq8074 ipq6018
------- ------- -------
0 0 0
1 2 1
2 1 Not applicable
Also this patch has moved ath11k_core_init() before ath11k_ahb_config_irq(), to init .max_radios in hw_params and Configure external interrupts for available pdev_ids.
--- drivers/net/wireless/ath/ath11k/Makefile | 3 ++- drivers/net/wireless/ath/ath11k/ahb.c | 26 +++++++++++++----------- drivers/net/wireless/ath/ath11k/core.c | 19 ++---------------- drivers/net/wireless/ath/ath11k/core.h | 1 - drivers/net/wireless/ath/ath11k/hw.c | 34 ++++++++++++++++++++++++++++++++ drivers/net/wireless/ath/ath11k/hw.h | 19 ++++++++++++++++++ drivers/net/wireless/ath/ath11k/mac.c | 2 +- 7 files changed, 72 insertions(+), 32 deletions(-) create mode 100644 drivers/net/wireless/ath/ath11k/hw.c
drivers/net/wireless/ath/ath11k/Makefile +2 -1
@@ -15,7 +15,8 @@ ath11k-y += core.o \ dp_rx.o \ debug.o \ ce.o \ - peer.o + peer.o \ + hw.o ath11k-$(CONFIG_ATH11K_DEBUGFS) += debug_htt_stats.o debugfs_sta.o ath11k-$(CONFIG_NL80211_TESTMODE) += testmode.o
drivers/net/wireless/ath/ath11k/ahb.c +14 -12
@@ -737,6 +737,7 @@ static irqreturn_t ath11k_ahb_ext_interrupt_handler(int irq, void *arg)static int ath11k_ahb_ext_irq_config (struct ath11k_base *ab) { +struct ath11k_hw_params *hw = &ab->hw_params;int i, j;int irq;int ret;
@@ -771,26 +772,26 @@ static int ath11k_ahb_ext_irq_config(struct ath11k_base *ab)if (ath11k_reo_status_ring_mask[i] &BIT (j)) irq_grp->irqs[num_irq++] = reo2host_status; -if (j <MAX_RADIOS ) { +if (j < ab->hw_params.max_radios) {if (ath11k_rxdma2host_ring_mask[i] &BIT (j)) { irq_grp->irqs[num_irq++] = - rxdma2host_destination_ring_mac1 - -ath11k_core_get_hw_mac_id (ab, j); + rxdma2host_destination_ring_mac1 - +ath11k_hw_get_mac_from_pdev_id (hw, j); }if (ath11k_host2rxdma_ring_mask[i] &BIT (j)) { irq_grp->irqs[num_irq++] = - host2rxdma_host_buf_ring_mac1 - -ath11k_core_get_hw_mac_id (ab, j); + host2rxdma_host_buf_ring_mac1 - +ath11k_hw_get_mac_from_pdev_id (hw, j); }if (rx_mon_status_ring_mask[i] &BIT (j)) { irq_grp->irqs[num_irq++] = ppdu_end_interrupts_mac1 - -ath11k_core_get_hw_mac_id (ab, j); +ath11k_hw_get_mac_from_pdev_id (hw, j); irq_grp->irqs[num_irq++] = rxdma2host_monitor_status_ring_mac1 - -ath11k_core_get_hw_mac_id (ab, j); +ath11k_hw_get_mac_from_pdev_id (hw, j); } } }
@@ -952,17 +953,18 @@ static int ath11k_ahb_probe(struct platform_device *pdev) goto err_hal_srng_deinit; } -ath11k_ahb_init_qmi_ce_config (ab); + ret =ath11k_core_init (ab); - ret =ath11k_ahb_config_irq (ab);if (ret) { -ath11k_err (ab,"failed to configure irq: %d\n" , ret); +ath11k_err (ab,"failed to init core: %d\n" , ret); goto err_ce_free; } - ret =ath11k_core_init (ab); +ath11k_ahb_init_qmi_ce_config (ab); + + ret =ath11k_ahb_config_irq (ab);if (ret) { -ath11k_err (ab,"failed to init core: %d\n" , ret); +ath11k_err (ab,"failed to configure irq: %d\n" , ret); goto err_ce_free; }
drivers/net/wireless/ath/ath11k/core.c +2 -17
@@ -27,6 +27,7 @@ static const struct ath11k_hw_params ath11k_hw_params_list[] = { .cal_size = IPQ8074_MAX_CAL_DATA_SZ, }, .max_radios = 3, + .hw_ops = &ipq8074_ops, }, { .dev_id = ATH11K_HW_IPQ6018,
@@ -37,26 +38,10 @@ static const struct ath11k_hw_params ath11k_hw_params_list[] = { .cal_size = IPQ6018_MAX_CAL_DATA_SZ, }, .max_radios = 2, + .hw_ops = &ipq6018_ops, }, }; -/* Map from pdev index to hw mac index */ -u8 ath11k_core_get_hw_mac_id (struct ath11k_base *ab,int pdev_idx) -{ -switch (pdev_idx) { -case 0 : -return 0 ; -case 1 : -return 2 ; -case 2 : -return 1 ; -default : -ath11k_warn (ab,"Invalid pdev idx %d\n" , pdev_idx); -return ATH11K_INVALID_HW_MAC_ID ; - } -} -EXPORT_SYMBOL (ath11k_core_get_hw_mac_id); -static int ath11k_core_create_board_name (struct ath11k_base *ab,char *name,size_t name_len) {
drivers/net/wireless/ath/ath11k/core.h +0 -1
@@ -815,7 +815,6 @@ int ath11k_core_fetch_bdf(struct ath11k_base *ath11k,void ath11k_core_free_bdf (struct ath11k_base *ab,struct ath11k_board_data *bd);void ath11k_core_halt (struct ath11k *ar); -u8 ath11k_core_get_hw_mac_id (struct ath11k_base *ab,int pdev_idx);static inline const char *ath11k_scan_state_str (enum ath11k_scan_state state) {
drivers/net/wireless/ath/ath11k/hw.c new file +34 -0
@@ -0,0 +1,34 @@ +// SPDX-License-Identifier: BSD-3-Clause-Clear +/* +* Copyright (c) 2018-2020 The Linux Foundation. All rights reserved. +*/ + +#include "core.h" + +/* Map from pdev index to hw mac index */ +static u8 ath11k_hw_ipq8074_mac_from_pdev_id (int pdev_idx) +{ +switch (pdev_idx) { +case 0 : +return 0 ; +case 1 : +return 2 ; +case 2 : +return 1 ; +default : +return ATH11K_INVALID_HW_MAC_ID ; + } +} + +static u8 ath11k_hw_ipq6018_mac_from_pdev_id (int pdev_idx) +{ +return pdev_idx; +} + +const struct ath11k_hw_ops ipq8074_ops = { + .get_hw_mac_from_pdev_id = ath11k_hw_ipq8074_mac_from_pdev_id, +}; + +const struct ath11k_hw_ops ipq6018_ops = { + .get_hw_mac_from_pdev_id = ath11k_hw_ipq6018_mac_from_pdev_id, +};
drivers/net/wireless/ath/ath11k/hw.h +19 -0
@@ -109,6 +109,10 @@ enum ath11k_bus { ATH11K_BUS_PCI, }; +struct ath11k_hw_ops { +u8 (*get_hw_mac_from_pdev_id)(int pdev_id); +}; +struct ath11k_hw_params {const char *name;u16 dev_id;
@@ -118,8 +122,23 @@ struct ath11k_hw_params {size_t board_size;size_t cal_size; } fw; + +const struct ath11k_hw_ops *hw_ops; }; +extern const struct ath11k_hw_ops ipq8074_ops; +extern const struct ath11k_hw_ops ipq6018_ops; + +static inline +int ath11k_hw_get_mac_from_pdev_id (struct ath11k_hw_params *hw, +int pdev_idx) +{ +if (hw->hw_ops->get_hw_mac_from_pdev_id) +return hw->hw_ops->get_hw_mac_from_pdev_id (pdev_idx); + +return 0 ; +} +struct ath11k_fw_ie {__le32 id;__le32 len;
drivers/net/wireless/ath/ath11k/mac.c +1 -1
@@ -6012,7 +6012,7 @@ int ath11k_mac_allocate(struct ath11k_base *ab) ar->ab = ab; ar->pdev = pdev; ar->pdev_idx = i; - ar->lmac_id =ath11k_core_get_hw_mac_id (ab, i); + ar->lmac_id =ath11k_hw_get_mac_from_pdev_id (&ab->hw_params, i); ar->wmi = &ab->wmi_ab.wmi[i];/* FIXME wmi[0] is already initialized during attach,
Signature · 7 lines
2.7.4 _______________________________________________ ath11k mailing list [email protected] http://lists.infradead.org/mailman/listinfo/ath11k
PATCH 7/8 ath11k: add ce services for IPQ6018
In reply to Anilkumar KolliIPQ6018 does not support mac2, add a new ce service map.
--- drivers/net/wireless/ath/ath11k/ahb.c | 122 ++++++++++++++++++++++++++++++++-- 1 file changed, 117 insertions(+), 5 deletions(-)
drivers/net/wireless/ath/ath11k/ahb.c +117 -5
@@ -155,7 +155,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 */
@@ -267,6 +267,108 @@ static const struct service_to_pipe target_service_to_ce_map_wlan[] = { {/* 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 4static const char *irq_name[ATH11K_IRQ_NUM_MAX ] = {
@@ -647,8 +749,15 @@ 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; +if (ab->hw_params.dev_id ==ATH11K_HW_IPQ6018 ) { + cfg->svc_to_ce_map_len = +ARRAY_SIZE (target_service_to_ce_map_wlan_ipq6018); + cfg->svc_to_ce_map = target_service_to_ce_map_wlan_ipq6018; + }else { + cfg->svc_to_ce_map_len = +ARRAY_SIZE (target_service_to_ce_map_wlan_ipq8074); + cfg->svc_to_ce_map = target_service_to_ce_map_wlan_ipq8074; + } }static void ath11k_ahb_free_ext_irq (struct ath11k_base *ab)
@@ -856,8 +965,11 @@ static int ath11k_ahb_map_service_to_pipe(struct ath11k_base *ab, u16 service_idbool 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->qmi.ce_cfg.svc_to_ce_map_len; i++) { +if (ab->hw_params.dev_id ==ATH11K_HW_IPQ6018 ) + entry = &target_service_to_ce_map_wlan_ipq6018[i]; +else + entry = &target_service_to_ce_map_wlan_ipq8074[i];if (__le32_to_cpu (entry->service_id) != service_id)continue ;
Signature · 1 line
2.7.4
Re: [PATCH 7/8] ath11k: add ce services for IPQ6018
Hi Anilkumar,
Quoted 17 lines · Anilkumar Kolli
IPQ6018 does not support mac2, add a new ce service map.
Signed-off-by Anilkumar Kolli <[email protected]>--- drivers/net/wireless/ath/ath11k/ahb.c | 122 ++++++++++++++++++++++++++++++++-- 1 file changed, 117 insertions(+), 5 deletions(-)drivers/net/wireless/ath/ath11k/ahb.c +0
-1@@ -647,8 +749,15 @@ 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);
drivers/net/wireless/ath/ath11k/ahb.c static void ath11k_ahb_init_qmi_ce_config(struct ath11k_base *ab) · line 760
Quoted 10 lines
drivers/net/wireless/ath/ath11k/ahb.c +9
-1- cfg->svc_to_ce_map = target_service_to_ce_map_wlan; +if (ab->hw_params.dev_id ==ATH11K_HW_IPQ6018 ) { + cfg->svc_to_ce_map_len = +ARRAY_SIZE (target_service_to_ce_map_wlan_ipq6018); + cfg->svc_to_ce_map = target_service_to_ce_map_wlan_ipq6018; + }else { + cfg->svc_to_ce_map_len = +ARRAY_SIZE (target_service_to_ce_map_wlan_ipq8074); + cfg->svc_to_ce_map = target_service_to_ce_map_wlan_ipq8074; + }
You could just have a pointer to this array in the "hw_params" structure which would reduce this to something like:
cfg->svc_to_ce_map_len = ARRAY_SIZE(ab->hw_params.service_to_ce_map); cfg->svc_to_ce_map = ab->hw_params.service_to_ce_map;
and make adding future hardware easier.
drivers/net/wireless/ath/ath11k/ahb.c static int ath11k_ahb_map_service_to_pipe(struct ath11k_base *ab, u16 service_id · line 968
Quoted 10 lines
drivers/net/wireless/ath/ath11k/ahb.c +1
-2}static void ath11k_ahb_free_ext_irq (struct ath11k_base *ab)@@ -856,8 +965,11 @@ static int ath11k_ahb_map_service_to_pipe(struct ath11k_base *ab, u16 service_idbool 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->qmi.ce_cfg.svc_to_ce_map_len; i++) {
Is this the same "svc_to_ce_map_len" as in the hunk above?
If so the code below could just be:
entry = &ab->qmi.ce_cfg.svc_to_ce_map[i];
Quoted 10 lines
drivers/net/wireless/ath/ath11k/ahb.c +4
-1+if (ab->hw_params.dev_id ==ATH11K_HW_IPQ6018 ) + entry = &target_service_to_ce_map_wlan_ipq6018[i]; +else + entry = &target_service_to_ce_map_wlan_ipq8074[i];if (__le32_to_cpu (entry->service_id) != service_id)continue ; --2.7.4
Thanks,
Signature · 4 lines
Julian Calaby Email: [email protected] Profile: http://www.google.com/profiles/julian.calaby/
Re: [PATCH 7/8] ath11k: add ce services for IPQ6018
Quoted 32 lines · Julian Calaby
Quoted 17 lines · Anilkumar Kolli
IPQ6018 does not support mac2, add a new ce service map.
Signed-off-by Anilkumar Kolli <[email protected]>--- drivers/net/wireless/ath/ath11k/ahb.c | 122 ++++++++++++++++++++++++++++++++-- 1 file changed, 117 insertions(+), 5 deletions(-)drivers/net/wireless/ath/ath11k/ahb.c +0
-1@@ -647,8 +749,15 @@ 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);drivers/net/wireless/ath/ath11k/ahb.c static void ath11k_ahb_init_qmi_ce_config(struct ath11k_base *ab) · line 760
Quoted 10 lines
drivers/net/wireless/ath/ath11k/ahb.c +9
-1- cfg->svc_to_ce_map = target_service_to_ce_map_wlan; +if (ab->hw_params.dev_id ==ATH11K_HW_IPQ6018 ) { + cfg->svc_to_ce_map_len = +ARRAY_SIZE (target_service_to_ce_map_wlan_ipq6018); + cfg->svc_to_ce_map = target_service_to_ce_map_wlan_ipq6018; + }else { + cfg->svc_to_ce_map_len = +ARRAY_SIZE (target_service_to_ce_map_wlan_ipq8074); + cfg->svc_to_ce_map = target_service_to_ce_map_wlan_ipq8074; + }You could just have a pointer to this array in the "
hw_params" structure which would reduce this to something like:
Quoted 4 lines
cfg->svc_to_ce_map_len=ARRAY_SIZE(ab->hw_params.service_to_ce_map);cfg->svc_to_ce_map=ab->hw_params.service_to_ce_map;and make adding future hardware easier.
Yeah, that's a good idea.
Signature · 6 lines
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches _______________________________________________ ath11k mailing list [email protected] http://lists.infradead.org/mailman/listinfo/ath11k
PATCH 8/8 ath11k: Add bdf-addr in hw_params
In reply to Anilkumar Kollibdf-addr is different for IPQ8074 and IPQ6018
--- drivers/net/wireless/ath/ath11k/core.c | 2 ++ drivers/net/wireless/ath/ath11k/hw.h | 1 + drivers/net/wireless/ath/ath11k/qmi.c | 6 +++--- drivers/net/wireless/ath/ath11k/qmi.h | 1 - 4 files changed, 6 insertions(+), 4 deletions(-)
drivers/net/wireless/ath/ath11k/core.c +2 -0
@@ -27,6 +27,7 @@ static const struct ath11k_hw_params ath11k_hw_params_list[] = { .cal_size = IPQ8074_MAX_CAL_DATA_SZ, }, .max_radios = 3, + .bdf_addr = 0x4B0C0000, .hw_ops = &ipq8074_ops, }, {
@@ -38,6 +39,7 @@ static const struct ath11k_hw_params ath11k_hw_params_list[] = { .cal_size = IPQ6018_MAX_CAL_DATA_SZ, }, .max_radios = 2, + .bdf_addr = 0x4ABC0000, .hw_ops = &ipq6018_ops, }, };
drivers/net/wireless/ath/ath11k/hw.h +1 -0
@@ -115,6 +115,7 @@ struct ath11k_hw_ops {struct ath11k_hw_params {const char *name; +u32 bdf_addr;u16 dev_id;u8 max_radios;struct {
drivers/net/wireless/ath/ath11k/qmi.c +3 -3
@@ -1681,8 +1681,8 @@ static int ath11k_qmi_alloc_target_mem_chunk(struct ath11k_base *ab)for (i =0 , idx =0 ; i < ab->qmi.mem_seg_count; i++) {switch (ab->qmi.target_mem[i].type) {case BDF_MEM_REGION_TYPE : - ab->qmi.target_mem[idx].paddr =ATH11K_QMI_BDF_ADDRESS ; - ab->qmi.target_mem[idx].vaddr =ATH11K_QMI_BDF_ADDRESS ; + ab->qmi.target_mem[idx].paddr = ab->hw_params.bdf_addr; + ab->qmi.target_mem[idx].vaddr = ab->hw_params.bdf_addr; ab->qmi.target_mem[idx].size = ab->qmi.target_mem[i].size; ab->qmi.target_mem[idx].type = ab->qmi.target_mem[i].type; idx++;
@@ -1854,7 +1854,7 @@ static int ath11k_qmi_load_bdf(struct ath11k_base *ab)return -ENOMEM ;memset (&resp,0 ,sizeof (resp)); - bdf_addr =ioremap (ATH11K_QMI_BDF_ADDRESS ,ATH11K_QMI_BDF_MAX_SIZE ); + bdf_addr =ioremap (ab->hw_params.bdf_addr,ATH11K_QMI_BDF_MAX_SIZE );if (!bdf_addr) {ath11k_warn (ab,"qmi ioremap error for BDF\n" ); ret = -EIO ;
drivers/net/wireless/ath/ath11k/qmi.h +0 -1
@@ -12,7 +12,6 @@#define ATH11K_HOST_VERSION_STRING "WIN"#define ATH11K_QMI_WLANFW_TIMEOUT_MS 5000#define ATH11K_QMI_MAX_BDF_FILE_NAME_SIZE 64 -#define ATH11K_QMI_BDF_ADDRESS 0x4B0C0000#define ATH11K_QMI_BDF_MAX_SIZE (256 * 1024)#define ATH11K_QMI_CALDATA_OFFSET (128 * 1024)#define ATH11K_QMI_WLANFW_MAX_BUILD_ID_LEN_V01 128
Signature · 7 lines
2.7.4 _______________________________________________ ath11k mailing list [email protected] http://lists.infradead.org/mailman/listinfo/ath11k
Quoted 6 lines · Anilkumar Kolli
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
Quoted 9 lines
Anilkumar Kolli (8):
ath11k: update firmware files read path
ath11k: rename default board file
dt: bindings: net: update compatible for ath11k
ath11k: add IPQ6018 support
ath11k: definemax_radiosinhw_params
ath11k: addhw_opsfor pdev id tohw_macmapping
ath11k: add ce services for IPQ6018
ath11k: Add bdf-addr inhw_params
You need to CC the device tree list, so please resubmit as v2. And to make their review easier please move the binding doc update as the first patch.
Signature · 6 lines
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches _______________________________________________ ath11k mailing list [email protected] http://lists.infradead.org/mailman/listinfo/ath11k