Skip to content

Commit 5b365af

Browse files
author
Kalle Valo
committed
Merge ath-next from git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git
ath.git patches for v5.10. Major changes: wcn36xx * add support wcn3680 Wi-Fi 5 devices ath11k * spectral scan support for ipq6018
2 parents 225060c + 6a95075 commit 5b365af

File tree

32 files changed

+2247
-1758
lines changed

32 files changed

+2247
-1758
lines changed

drivers/net/wireless/ath/ath10k/core.c

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1022,7 +1022,7 @@ static int ath10k_core_check_smbios(struct ath10k *ar)
10221022
return 0;
10231023
}
10241024

1025-
static int ath10k_core_check_dt(struct ath10k *ar)
1025+
int ath10k_core_check_dt(struct ath10k *ar)
10261026
{
10271027
struct device_node *node;
10281028
const char *variant = NULL;
@@ -1043,6 +1043,7 @@ static int ath10k_core_check_dt(struct ath10k *ar)
10431043

10441044
return 0;
10451045
}
1046+
EXPORT_SYMBOL(ath10k_core_check_dt);
10461047

10471048
static int ath10k_download_fw(struct ath10k *ar)
10481049
{
@@ -1437,10 +1438,17 @@ static int ath10k_core_create_board_name(struct ath10k *ar, char *name,
14371438
}
14381439

14391440
if (ar->id.qmi_ids_valid) {
1440-
scnprintf(name, name_len,
1441-
"bus=%s,qmi-board-id=%x",
1442-
ath10k_bus_str(ar->hif.bus),
1443-
ar->id.qmi_board_id);
1441+
if (with_variant && ar->id.bdf_ext[0] != '\0')
1442+
scnprintf(name, name_len,
1443+
"bus=%s,qmi-board-id=%x,qmi-chip-id=%x%s",
1444+
ath10k_bus_str(ar->hif.bus),
1445+
ar->id.qmi_board_id, ar->id.qmi_chip_id,
1446+
variant);
1447+
else
1448+
scnprintf(name, name_len,
1449+
"bus=%s,qmi-board-id=%x",
1450+
ath10k_bus_str(ar->hif.bus),
1451+
ar->id.qmi_board_id);
14441452
goto out;
14451453
}
14461454

drivers/net/wireless/ath/ath10k/core.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1076,6 +1076,7 @@ struct ath10k {
10761076
bool bmi_ids_valid;
10771077
bool qmi_ids_valid;
10781078
u32 qmi_board_id;
1079+
u32 qmi_chip_id;
10791080
u8 bmi_board_id;
10801081
u8 bmi_eboard_id;
10811082
u8 bmi_chip_id;
@@ -1315,6 +1316,7 @@ int ath10k_core_register(struct ath10k *ar,
13151316
const struct ath10k_bus_params *bus_params);
13161317
void ath10k_core_unregister(struct ath10k *ar);
13171318
int ath10k_core_fetch_board_file(struct ath10k *ar, int bd_ie_type);
1319+
int ath10k_core_check_dt(struct ath10k *ar);
13181320
void ath10k_core_free_board_files(struct ath10k *ar);
13191321

13201322
#endif /* _CORE_H_ */

drivers/net/wireless/ath/ath10k/qmi.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -576,6 +576,8 @@ static int ath10k_qmi_cap_send_sync_msg(struct ath10k_qmi *qmi)
576576
if (resp->chip_info_valid) {
577577
qmi->chip_info.chip_id = resp->chip_info.chip_id;
578578
qmi->chip_info.chip_family = resp->chip_info.chip_family;
579+
} else {
580+
qmi->chip_info.chip_id = 0xFF;
579581
}
580582

581583
if (resp->board_info_valid)
@@ -817,12 +819,18 @@ static void ath10k_qmi_event_server_arrive(struct ath10k_qmi *qmi)
817819
static int ath10k_qmi_fetch_board_file(struct ath10k_qmi *qmi)
818820
{
819821
struct ath10k *ar = qmi->ar;
822+
int ret;
820823

821824
ar->hif.bus = ATH10K_BUS_SNOC;
822825
ar->id.qmi_ids_valid = true;
823826
ar->id.qmi_board_id = qmi->board_info.board_id;
827+
ar->id.qmi_chip_id = qmi->chip_info.chip_id;
824828
ar->hw_params.fw.dir = WCN3990_HW_1_0_FW_DIR;
825829

830+
ret = ath10k_core_check_dt(ar);
831+
if (ret)
832+
ath10k_dbg(ar, ATH10K_DBG_QMI, "DT bdf variant name not set.\n");
833+
826834
return ath10k_core_fetch_board_file(qmi->ar, ATH10K_BD_IE_BOARD);
827835
}
828836

drivers/net/wireless/ath/ath11k/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ ath11k-y += core.o \
1818
dbring.o \
1919
hw.o
2020

21-
ath11k-$(CONFIG_ATH11K_DEBUGFS) += debug_htt_stats.o debugfs_sta.o
21+
ath11k-$(CONFIG_ATH11K_DEBUGFS) += debugfs.o debugfs_htt_stats.o debugfs_sta.o
2222
ath11k-$(CONFIG_NL80211_TESTMODE) += testmode.o
2323
ath11k-$(CONFIG_ATH11K_TRACING) += trace.o
2424
ath11k-$(CONFIG_THERMAL) += thermal.o

drivers/net/wireless/ath/ath11k/ahb.c

Lines changed: 43 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -323,9 +323,10 @@ static void ath11k_ahb_stop(struct ath11k_base *ab)
323323

324324
static int ath11k_ahb_power_up(struct ath11k_base *ab)
325325
{
326+
struct ath11k_ahb *ab_ahb = ath11k_ahb_priv(ab);
326327
int ret;
327328

328-
ret = rproc_boot(ab->tgt_rproc);
329+
ret = rproc_boot(ab_ahb->tgt_rproc);
329330
if (ret)
330331
ath11k_err(ab, "failed to boot the remote processor Q6\n");
331332

@@ -334,7 +335,9 @@ static int ath11k_ahb_power_up(struct ath11k_base *ab)
334335

335336
static void ath11k_ahb_power_down(struct ath11k_base *ab)
336337
{
337-
rproc_shutdown(ab->tgt_rproc);
338+
struct ath11k_ahb *ab_ahb = ath11k_ahb_priv(ab);
339+
340+
rproc_shutdown(ab_ahb->tgt_rproc);
338341
}
339342

340343
static void ath11k_ahb_init_qmi_ce_config(struct ath11k_base *ab)
@@ -600,6 +603,28 @@ static const struct ath11k_hif_ops ath11k_ahb_hif_ops = {
600603
.power_up = ath11k_ahb_power_up,
601604
};
602605

606+
static int ath11k_core_get_rproc(struct ath11k_base *ab)
607+
{
608+
struct ath11k_ahb *ab_ahb = ath11k_ahb_priv(ab);
609+
struct device *dev = ab->dev;
610+
struct rproc *prproc;
611+
phandle rproc_phandle;
612+
613+
if (of_property_read_u32(dev->of_node, "qcom,rproc", &rproc_phandle)) {
614+
ath11k_err(ab, "failed to get q6_rproc handle\n");
615+
return -ENOENT;
616+
}
617+
618+
prproc = rproc_get_by_phandle(rproc_phandle);
619+
if (!prproc) {
620+
ath11k_err(ab, "failed to get rproc\n");
621+
return -EINVAL;
622+
}
623+
ab_ahb->tgt_rproc = prproc;
624+
625+
return 0;
626+
}
627+
603628
static int ath11k_ahb_probe(struct platform_device *pdev)
604629
{
605630
struct ath11k_base *ab;
@@ -626,7 +651,9 @@ static int ath11k_ahb_probe(struct platform_device *pdev)
626651
return ret;
627652
}
628653

629-
ab = ath11k_core_alloc(&pdev->dev, 0, ATH11K_BUS_AHB, &ath11k_ahb_bus_params);
654+
ab = ath11k_core_alloc(&pdev->dev, sizeof(struct ath11k_ahb),
655+
ATH11K_BUS_AHB,
656+
&ath11k_ahb_bus_params);
630657
if (!ab) {
631658
dev_err(&pdev->dev, "failed to allocate ath11k base\n");
632659
return -ENOMEM;
@@ -655,6 +682,12 @@ static int ath11k_ahb_probe(struct platform_device *pdev)
655682

656683
ath11k_ahb_init_qmi_ce_config(ab);
657684

685+
ret = ath11k_core_get_rproc(ab);
686+
if (ret) {
687+
ath11k_err(ab, "failed to get rproc: %d\n", ret);
688+
goto err_ce_free;
689+
}
690+
658691
ret = ath11k_core_init(ab);
659692
if (ret) {
660693
ath11k_err(ab, "failed to init core: %d\n", ret);
@@ -685,12 +718,16 @@ static int ath11k_ahb_probe(struct platform_device *pdev)
685718
static int ath11k_ahb_remove(struct platform_device *pdev)
686719
{
687720
struct ath11k_base *ab = platform_get_drvdata(pdev);
721+
unsigned long left;
688722

689723
reinit_completion(&ab->driver_recovery);
690724

691-
if (test_bit(ATH11K_FLAG_RECOVERY, &ab->dev_flags))
692-
wait_for_completion_timeout(&ab->driver_recovery,
693-
ATH11K_AHB_RECOVERY_TIMEOUT);
725+
if (test_bit(ATH11K_FLAG_RECOVERY, &ab->dev_flags)) {
726+
left = wait_for_completion_timeout(&ab->driver_recovery,
727+
ATH11K_AHB_RECOVERY_TIMEOUT);
728+
if (!left)
729+
ath11k_warn(ab, "failed to receive recovery response completion\n");
730+
}
694731

695732
set_bit(ATH11K_FLAG_UNREGISTERING, &ab->dev_flags);
696733
cancel_work_sync(&ab->restart_work);

drivers/net/wireless/ath/ath11k/ahb.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,12 @@
1010
#define ATH11K_AHB_RECOVERY_TIMEOUT (3 * HZ)
1111
struct ath11k_base;
1212

13+
struct ath11k_ahb {
14+
struct rproc *tgt_rproc;
15+
};
16+
17+
static inline struct ath11k_ahb *ath11k_ahb_priv(struct ath11k_base *ab)
18+
{
19+
return (struct ath11k_ahb *)ab->drv_priv;
20+
}
1321
#endif

drivers/net/wireless/ath/ath11k/core.c

Lines changed: 9 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ static const struct ath11k_hw_params ath11k_hw_params[] = {
5757
.vdev_start_delay = false,
5858
.htt_peer_map_v2 = true,
5959
.tcl_0_only = false,
60+
.spectral_fft_sz = 2,
6061
},
6162
{
6263
.hw_rev = ATH11K_HW_IPQ6018_HW10,
@@ -86,6 +87,7 @@ static const struct ath11k_hw_params ath11k_hw_params[] = {
8687
.vdev_start_delay = false,
8788
.htt_peer_map_v2 = true,
8889
.tcl_0_only = false,
90+
.spectral_fft_sz = 4,
8991
},
9092
{
9193
.name = "qca6390 hw2.0",
@@ -115,6 +117,7 @@ static const struct ath11k_hw_params ath11k_hw_params[] = {
115117
.vdev_start_delay = true,
116118
.htt_peer_map_v2 = false,
117119
.tcl_0_only = true,
120+
.spectral_fft_sz = 0,
118121
},
119122
};
120123

@@ -412,7 +415,7 @@ static int ath11k_core_soc_create(struct ath11k_base *ab)
412415
return ret;
413416
}
414417

415-
ret = ath11k_debug_soc_create(ab);
418+
ret = ath11k_debugfs_soc_create(ab);
416419
if (ret) {
417420
ath11k_err(ab, "failed to create ath11k debugfs\n");
418421
goto err_qmi_deinit;
@@ -427,15 +430,15 @@ static int ath11k_core_soc_create(struct ath11k_base *ab)
427430
return 0;
428431

429432
err_debugfs_reg:
430-
ath11k_debug_soc_destroy(ab);
433+
ath11k_debugfs_soc_destroy(ab);
431434
err_qmi_deinit:
432435
ath11k_qmi_deinit_service(ab);
433436
return ret;
434437
}
435438

436439
static void ath11k_core_soc_destroy(struct ath11k_base *ab)
437440
{
438-
ath11k_debug_soc_destroy(ab);
441+
ath11k_debugfs_soc_destroy(ab);
439442
ath11k_dp_free(ab);
440443
ath11k_reg_free(ab);
441444
ath11k_qmi_deinit_service(ab);
@@ -445,7 +448,7 @@ static int ath11k_core_pdev_create(struct ath11k_base *ab)
445448
{
446449
int ret;
447450

448-
ret = ath11k_debug_pdev_create(ab);
451+
ret = ath11k_debugfs_pdev_create(ab);
449452
if (ret) {
450453
ath11k_err(ab, "failed to create core pdev debugfs: %d\n", ret);
451454
return ret;
@@ -485,7 +488,7 @@ static int ath11k_core_pdev_create(struct ath11k_base *ab)
485488
err_mac_unregister:
486489
ath11k_mac_unregister(ab);
487490
err_pdev_debug:
488-
ath11k_debug_pdev_destroy(ab);
491+
ath11k_debugfs_pdev_destroy(ab);
489492

490493
return ret;
491494
}
@@ -497,7 +500,7 @@ static void ath11k_core_pdev_destroy(struct ath11k_base *ab)
497500
ath11k_mac_unregister(ab);
498501
ath11k_hif_irq_disable(ab);
499502
ath11k_dp_pdev_free(ab);
500-
ath11k_debug_pdev_destroy(ab);
503+
ath11k_debugfs_pdev_destroy(ab);
501504
}
502505

503506
static int ath11k_core_start(struct ath11k_base *ab,
@@ -842,43 +845,10 @@ int ath11k_core_pre_init(struct ath11k_base *ab)
842845
}
843846
EXPORT_SYMBOL(ath11k_core_pre_init);
844847

845-
static int ath11k_core_get_rproc(struct ath11k_base *ab)
846-
{
847-
struct device *dev = ab->dev;
848-
struct rproc *prproc;
849-
phandle rproc_phandle;
850-
851-
if (!IS_ENABLED(CONFIG_REMOTEPROC))
852-
return 0;
853-
854-
if (ab->bus_params.mhi_support)
855-
return 0;
856-
857-
if (of_property_read_u32(dev->of_node, "qcom,rproc", &rproc_phandle)) {
858-
ath11k_err(ab, "failed to get q6_rproc handle\n");
859-
return -ENOENT;
860-
}
861-
862-
prproc = rproc_get_by_phandle(rproc_phandle);
863-
if (!prproc) {
864-
ath11k_err(ab, "failed to get rproc\n");
865-
return -EINVAL;
866-
}
867-
ab->tgt_rproc = prproc;
868-
869-
return 0;
870-
}
871-
872848
int ath11k_core_init(struct ath11k_base *ab)
873849
{
874850
int ret;
875851

876-
ret = ath11k_core_get_rproc(ab);
877-
if (ret) {
878-
ath11k_err(ab, "failed to get rproc: %d\n", ret);
879-
return ret;
880-
}
881-
882852
ret = ath11k_core_soc_create(ab);
883853
if (ret) {
884854
ath11k_err(ab, "failed to create soc core: %d\n", ret);

drivers/net/wireless/ath/ath11k/core.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -648,7 +648,6 @@ struct ath11k_base {
648648
struct ath11k_qmi qmi;
649649
struct ath11k_wmi_base wmi_ab;
650650
struct completion fw_ready;
651-
struct rproc *tgt_rproc;
652651
int num_radios;
653652
/* HW channel counters frequency value in hertz common to all MACs */
654653
u32 cc_freq_hz;

0 commit comments

Comments
 (0)