mirror of
https://github.com/Telecominfraproject/wlan-ap.git
synced 2025-12-20 10:51:27 +00:00
1269 lines
44 KiB
Diff
1269 lines
44 KiB
Diff
From 2f17d8554b1cc731b143539446791e4d6bb840ba Mon Sep 17 00:00:00 2001
|
|
From: Sriram R <srirrama@codeaurora.org>
|
|
Date: Tue, 28 Jul 2020 16:17:17 +0530
|
|
Subject: [RFC 2/6] ath11k: update hw params for IPQ5018
|
|
|
|
Add new compatible string for IPQ5018 and add
|
|
required hw params for IPQ5018. The hw descriptors size and
|
|
datapath ops are similar to QCN9000, hence they are reused.
|
|
|
|
Signed-off-by: Sriram R <srirrama@codeaurora.org>
|
|
---
|
|
drivers/net/wireless/ath/ath11k/ahb.c | 3 +++
|
|
drivers/net/wireless/ath/ath11k/core.c | 14 ++++++++++++++
|
|
drivers/net/wireless/ath/ath11k/core.h | 1 +
|
|
drivers/net/wireless/ath/ath11k/hw.h | 5 +++++
|
|
4 files changed, 23 insertions(+)
|
|
|
|
--- a/drivers/net/wireless/ath/ath11k/ahb.c
|
|
+++ b/drivers/net/wireless/ath/ath11k/ahb.c
|
|
@@ -31,6 +31,9 @@ static const struct of_device_id ath11k_
|
|
{ .compatible = "qcom,wcn6750-wifi",
|
|
.data = (void *)ATH11K_HW_WCN6750_HW10,
|
|
},
|
|
+ { .compatible = "qcom,ipq5018-wifi",
|
|
+ .data = (void *)ATH11K_HW_IPQ5018,
|
|
+ },
|
|
{ }
|
|
};
|
|
|
|
@@ -192,12 +195,22 @@ static const struct ath11k_pci_ops ath11
|
|
|
|
static inline u32 ath11k_ahb_read32(struct ath11k_base *ab, u32 offset)
|
|
{
|
|
- return ioread32(ab->mem + offset);
|
|
+ if (ab->ce_remap && (offset & HAL_CE_REMAP_REG_BASE)) {
|
|
+ offset = offset - HAL_CE_REMAP_REG_BASE;
|
|
+ return ioread32(ab->mem_ce + offset);
|
|
+ } else {
|
|
+ return ioread32(ab->mem + offset);
|
|
+ }
|
|
}
|
|
|
|
static inline void ath11k_ahb_write32(struct ath11k_base *ab, u32 offset, u32 value)
|
|
{
|
|
- iowrite32(value, ab->mem + offset);
|
|
+ if (ab->ce_remap && (offset & HAL_CE_REMAP_REG_BASE)) {
|
|
+ offset = offset - HAL_CE_REMAP_REG_BASE;
|
|
+ iowrite32(value, ab->mem_ce + offset);
|
|
+ } else {
|
|
+ iowrite32(value, ab->mem + offset);
|
|
+ }
|
|
}
|
|
|
|
static void ath11k_ahb_kill_tasklets(struct ath11k_base *ab)
|
|
@@ -266,30 +279,53 @@ static void ath11k_ahb_clearbit32(struct
|
|
static void ath11k_ahb_ce_irq_enable(struct ath11k_base *ab, u16 ce_id)
|
|
{
|
|
const struct ce_attr *ce_attr;
|
|
+ u32 ie1_reg_addr, ie2_reg_addr, ie3_reg_addr;
|
|
+
|
|
+ if (ab->hw_rev == ATH11K_HW_IPQ5018) {
|
|
+ ie1_reg_addr = CE_HOST_IPQ5018_IE_ADDRESS;
|
|
+ ie2_reg_addr = CE_HOST_IPQ5018_IE_2_ADDRESS;
|
|
+ ie3_reg_addr = CE_HOST_IPQ5018_IE_3_ADDRESS;
|
|
+ } else {
|
|
+ ie1_reg_addr = CE_HOST_IE_ADDRESS;
|
|
+ ie2_reg_addr = CE_HOST_IE_2_ADDRESS;
|
|
+ ie3_reg_addr = CE_HOST_IE_3_ADDRESS;
|
|
+ }
|
|
|
|
ce_attr = &ab->hw_params.host_ce_config[ce_id];
|
|
if (ce_attr->src_nentries)
|
|
- ath11k_ahb_setbit32(ab, ce_id, CE_HOST_IE_ADDRESS);
|
|
+ ath11k_ahb_setbit32(ab, ce_id, ie1_reg_addr);
|
|
|
|
if (ce_attr->dest_nentries) {
|
|
- ath11k_ahb_setbit32(ab, ce_id, CE_HOST_IE_2_ADDRESS);
|
|
+ ath11k_ahb_setbit32(ab, ce_id, ie2_reg_addr);
|
|
ath11k_ahb_setbit32(ab, ce_id + CE_HOST_IE_3_SHIFT,
|
|
- CE_HOST_IE_3_ADDRESS);
|
|
+ ie3_reg_addr);
|
|
}
|
|
}
|
|
|
|
static void ath11k_ahb_ce_irq_disable(struct ath11k_base *ab, u16 ce_id)
|
|
{
|
|
const struct ce_attr *ce_attr;
|
|
+ u32 ie1_reg_addr, ie2_reg_addr, ie3_reg_addr;
|
|
+
|
|
+ if (ab->hw_rev == ATH11K_HW_IPQ5018) {
|
|
+ ie1_reg_addr = CE_HOST_IPQ5018_IE_ADDRESS;
|
|
+ ie2_reg_addr = CE_HOST_IPQ5018_IE_2_ADDRESS;
|
|
+ ie3_reg_addr = CE_HOST_IPQ5018_IE_3_ADDRESS;
|
|
+ } else {
|
|
+ ie1_reg_addr = CE_HOST_IE_ADDRESS;
|
|
+ ie2_reg_addr = CE_HOST_IE_2_ADDRESS;
|
|
+ ie3_reg_addr = CE_HOST_IE_3_ADDRESS;
|
|
+ }
|
|
+
|
|
|
|
ce_attr = &ab->hw_params.host_ce_config[ce_id];
|
|
if (ce_attr->src_nentries)
|
|
- ath11k_ahb_clearbit32(ab, ce_id, CE_HOST_IE_ADDRESS);
|
|
+ ath11k_ahb_clearbit32(ab, ce_id, ie1_reg_addr);
|
|
|
|
if (ce_attr->dest_nentries) {
|
|
- ath11k_ahb_clearbit32(ab, ce_id, CE_HOST_IE_2_ADDRESS);
|
|
+ ath11k_ahb_clearbit32(ab, ce_id, ie2_reg_addr);
|
|
ath11k_ahb_clearbit32(ab, ce_id + CE_HOST_IE_3_SHIFT,
|
|
- CE_HOST_IE_3_ADDRESS);
|
|
+ ie3_reg_addr);
|
|
}
|
|
}
|
|
|
|
@@ -1006,6 +1042,7 @@ static int ath11k_ahb_probe(struct platf
|
|
switch (hw_rev) {
|
|
case ATH11K_HW_IPQ8074:
|
|
case ATH11K_HW_IPQ6018_HW10:
|
|
+ case ATH11K_HW_IPQ5018:
|
|
hif_ops = &ath11k_ahb_hif_ops_ipq8074;
|
|
pci_ops = NULL;
|
|
break;
|
|
@@ -1052,6 +1089,21 @@ static int ath11k_ahb_probe(struct platf
|
|
if (ret)
|
|
goto err_core_free;
|
|
|
|
+ ab->mem_ce = ab->mem;
|
|
+ if (ab->hw_rev == ATH11K_HW_IPQ5018) {
|
|
+ /* ce register space is moved out of wcss unlike ipq8074 or ipq6018
|
|
+ * and the space is not contiguous, hence remapping the CE registers
|
|
+ * to a new space for accessing them.
|
|
+ */
|
|
+ ab->mem_ce = ioremap_nocache(HAL_IPQ5018_CE_WFSS_REG_BASE, HAL_IPQ5018_CE_SIZE);
|
|
+ if (IS_ERR(ab->mem_ce)) {
|
|
+ dev_err(&pdev->dev, "ce ioremap error\n");
|
|
+ return -ENOMEM;
|
|
+ }
|
|
+ ab->ce_remap = true;
|
|
+ ab->ce_remap_base_addr = HAL_IPQ5018_CE_WFSS_REG_BASE;
|
|
+ }
|
|
+
|
|
ret = ath11k_ahb_fw_resources_init(ab);
|
|
if (ret)
|
|
goto err_core_free;
|
|
@@ -1142,6 +1194,10 @@ qmi_fail:
|
|
ath11k_hal_srng_deinit(ab);
|
|
ath11k_ahb_fw_resource_deinit(ab);
|
|
ath11k_ce_free_pipes(ab);
|
|
+
|
|
+ if (ab->ce_remap)
|
|
+ iounmap(ab->mem_ce);
|
|
+
|
|
ath11k_core_free(ab);
|
|
platform_set_drvdata(pdev, NULL);
|
|
|
|
--- a/drivers/net/wireless/ath/ath11k/core.h
|
|
+++ b/drivers/net/wireless/ath/ath11k/core.h
|
|
@@ -76,6 +76,10 @@ extern unsigned int ath11k_frame_mode;
|
|
|
|
#define MAX_SOCS 3
|
|
|
|
+/* Shift value to set the dest rings hash map to the dest control register */
|
|
+#define HAL_REO_DEST_RING_CTRL_HASH_RING_SHIFT 8
|
|
+#define HAL_IPQ5018_REO_DEST_RING_CTRL_HASH_RING_SHIFT 0
|
|
+
|
|
enum ath11k_supported_bw {
|
|
ATH11K_BW_20 = 0,
|
|
ATH11K_BW_40 = 1,
|
|
@@ -155,6 +159,7 @@ enum ath11k_hw_rev {
|
|
ATH11K_HW_WCN6855_HW20,
|
|
ATH11K_HW_WCN6855_HW21,
|
|
ATH11K_HW_WCN6750_HW10,
|
|
+ ATH11K_HW_IPQ5018,
|
|
};
|
|
|
|
enum ath11k_firmware_mode {
|
|
@@ -936,6 +941,7 @@ struct ath11k_base {
|
|
struct ath11k_soc_nss nss;
|
|
|
|
void __iomem *mem;
|
|
+ void __iomem *mem_ce;
|
|
dma_addr_t mem_pa;
|
|
unsigned long mem_len;
|
|
|
|
@@ -1066,6 +1072,8 @@ struct ath11k_base {
|
|
} pci;
|
|
|
|
bool fw_recovery_support;
|
|
+ bool ce_remap;
|
|
+ u32 ce_remap_base_addr;
|
|
|
|
/* must be last */
|
|
u8 drv_priv[] __aligned(sizeof(void *));
|
|
@@ -1240,6 +1248,9 @@ extern const struct service_to_pipe ath1
|
|
|
|
extern const struct ce_pipe_config ath11k_target_ce_config_wlan_qcn9074[];
|
|
extern const struct service_to_pipe ath11k_target_service_to_ce_map_wlan_qcn9074[];
|
|
+extern const struct ce_pipe_config ath11k_target_ce_config_wlan_ipq5018[];
|
|
+extern const struct service_to_pipe ath11k_target_service_to_ce_map_wlan_ipq5018[];
|
|
+
|
|
int ath11k_core_qmi_firmware_ready(struct ath11k_base *ab);
|
|
int ath11k_core_pre_init(struct ath11k_base *ab);
|
|
int ath11k_core_init(struct ath11k_base *ath11k);
|
|
--- a/drivers/net/wireless/ath/ath11k/hw.h
|
|
+++ b/drivers/net/wireless/ath/ath11k/hw.h
|
|
@@ -159,6 +159,7 @@ struct ath11k_hw_params {
|
|
bool rx_mac_buf_ring;
|
|
bool vdev_start_delay;
|
|
bool htt_peer_map_v2;
|
|
+ u8 num_dscp_tid_map_tbl;
|
|
|
|
struct {
|
|
u8 fft_sz;
|
|
@@ -188,6 +189,7 @@ struct ath11k_hw_params {
|
|
bool supports_dynamic_smps_6ghz;
|
|
bool alloc_cacheable_memory;
|
|
u32 m3_addr;
|
|
+ u8 reo_dest_ring_map_shift;
|
|
bool supports_rssi_stats;
|
|
bool fw_wmi_diag_event;
|
|
bool current_cc_support;
|
|
@@ -243,6 +245,8 @@ struct ath11k_hw_ops {
|
|
u16 (*mpdu_info_get_peerid)(u8 *tlv_data);
|
|
bool (*rx_desc_mac_addr2_valid)(struct hal_rx_desc *desc);
|
|
u8* (*rx_desc_mpdu_start_addr2)(struct hal_rx_desc *desc);
|
|
+ void (*set_rx_fragmentation_dst_ring)(struct ath11k_base *ab);
|
|
+ u32 (*get_reo_dest_remap_config)(void);
|
|
};
|
|
|
|
extern const struct ath11k_hw_ops ipq8074_ops;
|
|
@@ -251,6 +255,7 @@ extern const struct ath11k_hw_ops qca639
|
|
extern const struct ath11k_hw_ops qcn9074_ops;
|
|
extern const struct ath11k_hw_ops wcn6855_ops;
|
|
extern const struct ath11k_hw_ops wcn6750_ops;
|
|
+extern const struct ath11k_hw_ops ipq5018_ops;
|
|
|
|
extern const struct ath11k_hw_ring_mask ath11k_hw_ring_mask_ipq8074;
|
|
extern const struct ath11k_hw_ring_mask ath11k_hw_ring_mask_qca6390;
|
|
@@ -384,6 +389,7 @@ extern const struct ath11k_hw_regs qca63
|
|
extern const struct ath11k_hw_regs qcn9074_regs;
|
|
extern const struct ath11k_hw_regs wcn6855_regs;
|
|
extern const struct ath11k_hw_regs wcn6750_regs;
|
|
+extern const struct ath11k_hw_regs ipq5018_regs;
|
|
|
|
static inline const char *ath11k_bd_ie_type_str(enum ath11k_bd_ie_type type)
|
|
{
|
|
--- a/drivers/net/wireless/ath/ath11k/core.c
|
|
+++ b/drivers/net/wireless/ath/ath11k/core.c
|
|
@@ -90,6 +90,7 @@ static const struct ath11k_hw_params ath
|
|
.fft_hdr_len = 16,
|
|
.max_fft_bins = 512,
|
|
},
|
|
+ .num_dscp_tid_map_tbl = HAL_DSCP_TID_MAP_TBL_NUM_ENTRIES_MAX,
|
|
|
|
.interface_modes = BIT(NL80211_IFTYPE_STATION) |
|
|
BIT(NL80211_IFTYPE_AP) |
|
|
@@ -105,6 +106,7 @@ static const struct ath11k_hw_params ath
|
|
.num_peers = 512,
|
|
.supports_suspend = false,
|
|
.hal_desc_sz = sizeof(struct hal_rx_desc_ipq8074),
|
|
+ .reo_dest_ring_map_shift = HAL_REO_DEST_RING_CTRL_HASH_RING_SHIFT,
|
|
.supports_regdb = false,
|
|
.fix_l1ss = true,
|
|
.credit_flow = false,
|
|
@@ -154,6 +156,7 @@ static const struct ath11k_hw_params ath
|
|
.rx_mac_buf_ring = false,
|
|
.vdev_start_delay = false,
|
|
.htt_peer_map_v2 = true,
|
|
+ .num_dscp_tid_map_tbl = HAL_DSCP_TID_MAP_TBL_NUM_ENTRIES_MAX,
|
|
|
|
.spectral = {
|
|
.fft_sz = 4,
|
|
@@ -177,6 +180,7 @@ static const struct ath11k_hw_params ath
|
|
.num_peers = 512,
|
|
.supports_suspend = false,
|
|
.hal_desc_sz = sizeof(struct hal_rx_desc_ipq8074),
|
|
+ .reo_dest_ring_map_shift = HAL_REO_DEST_RING_CTRL_HASH_RING_SHIFT,
|
|
.supports_regdb = false,
|
|
.fix_l1ss = true,
|
|
.credit_flow = false,
|
|
@@ -225,6 +229,7 @@ static const struct ath11k_hw_params ath
|
|
.rx_mac_buf_ring = true,
|
|
.vdev_start_delay = true,
|
|
.htt_peer_map_v2 = false,
|
|
+ .num_dscp_tid_map_tbl = HAL_DSCP_TID_MAP_TBL_NUM_ENTRIES_MAX,
|
|
|
|
.spectral = {
|
|
.fft_sz = 0,
|
|
@@ -247,6 +252,7 @@ static const struct ath11k_hw_params ath
|
|
.num_peers = 512,
|
|
.supports_suspend = true,
|
|
.hal_desc_sz = sizeof(struct hal_rx_desc_ipq8074),
|
|
+ .reo_dest_ring_map_shift = HAL_REO_DEST_RING_CTRL_HASH_RING_SHIFT,
|
|
.supports_regdb = false,
|
|
.fix_l1ss = true,
|
|
.credit_flow = true,
|
|
@@ -294,6 +300,7 @@ static const struct ath11k_hw_params ath
|
|
.rx_mac_buf_ring = false,
|
|
.vdev_start_delay = false,
|
|
.htt_peer_map_v2 = true,
|
|
+ .num_dscp_tid_map_tbl = HAL_DSCP_TID_MAP_TBL_NUM_ENTRIES_MAX,
|
|
|
|
.spectral = {
|
|
.fft_sz = 2,
|
|
@@ -317,6 +324,7 @@ static const struct ath11k_hw_params ath
|
|
.num_peers = 128,
|
|
.supports_suspend = false,
|
|
.hal_desc_sz = sizeof(struct hal_rx_desc_qcn9074),
|
|
+ .reo_dest_ring_map_shift = HAL_REO_DEST_RING_CTRL_HASH_RING_SHIFT,
|
|
.supports_regdb = false,
|
|
.fix_l1ss = true,
|
|
.credit_flow = false,
|
|
@@ -365,6 +373,7 @@ static const struct ath11k_hw_params ath
|
|
.rx_mac_buf_ring = true,
|
|
.vdev_start_delay = true,
|
|
.htt_peer_map_v2 = false,
|
|
+ .num_dscp_tid_map_tbl = HAL_DSCP_TID_MAP_TBL_NUM_ENTRIES_MAX,
|
|
|
|
.spectral = {
|
|
.fft_sz = 0,
|
|
@@ -387,6 +396,7 @@ static const struct ath11k_hw_params ath
|
|
.num_peers = 512,
|
|
.supports_suspend = true,
|
|
.hal_desc_sz = sizeof(struct hal_rx_desc_wcn6855),
|
|
+ .reo_dest_ring_map_shift = HAL_REO_DEST_RING_CTRL_HASH_RING_SHIFT,
|
|
.supports_regdb = true,
|
|
.fix_l1ss = false,
|
|
.credit_flow = true,
|
|
@@ -435,6 +445,7 @@ static const struct ath11k_hw_params ath
|
|
.rx_mac_buf_ring = true,
|
|
.vdev_start_delay = true,
|
|
.htt_peer_map_v2 = false,
|
|
+ .num_dscp_tid_map_tbl = HAL_DSCP_TID_MAP_TBL_NUM_ENTRIES_MAX,
|
|
|
|
.spectral = {
|
|
.fft_sz = 0,
|
|
@@ -456,6 +467,7 @@ static const struct ath11k_hw_params ath
|
|
.num_peers = 512,
|
|
.supports_suspend = true,
|
|
.hal_desc_sz = sizeof(struct hal_rx_desc_wcn6855),
|
|
+ .reo_dest_ring_map_shift = HAL_REO_DEST_RING_CTRL_HASH_RING_SHIFT,
|
|
.supports_regdb = true,
|
|
.fix_l1ss = false,
|
|
.credit_flow = true,
|
|
@@ -546,6 +558,70 @@ static const struct ath11k_hw_params ath
|
|
.fixed_fw_mem = true,
|
|
.support_off_channel_tx = false,
|
|
},
|
|
+ {
|
|
+ .hw_rev = ATH11K_HW_IPQ5018,
|
|
+ .name = "ipq5018 hw1.0",
|
|
+ .fw = {
|
|
+ .dir = "IPQ5018/hw1.0",
|
|
+ .board_size = 256 * 1024,
|
|
+ .cal_offset = 128 * 1024,
|
|
+ },
|
|
+ .max_radios = 1,
|
|
+ .bdf_addr = 0x4BA00000,
|
|
+ /* hal_desc_sz is similar to qcn9074 */
|
|
+ .hal_desc_sz = sizeof(struct hal_rx_desc_qcn9074),
|
|
+ .hw_ops = &ipq5018_ops,
|
|
+ .qmi_service_ins_id = ATH11K_QMI_WLFW_SERVICE_INS_ID_V01_IPQ8074,
|
|
+ .ring_mask = &ath11k_hw_ring_mask_ipq8074,
|
|
+ .regs = &ipq5018_regs,
|
|
+ .m3_addr = ATH11K_QMI_IPQ5018_M3_DUMP_ADDRESS,
|
|
+ .credit_flow = false,
|
|
+ .num_dscp_tid_map_tbl = HAL_IPQ5018_DSCP_TID_MAP_TBL_NUM_ENTRIES_MAX,
|
|
+
|
|
+ .spectral = {
|
|
+ .fft_sz = 2,
|
|
+ .fft_pad_sz = 0,
|
|
+ .summary_pad_sz = 16,
|
|
+ .fft_hdr_len = 24,
|
|
+ .max_fft_bins = 1024,
|
|
+ },
|
|
+
|
|
+ .interface_modes = BIT(NL80211_IFTYPE_STATION) |
|
|
+ BIT(NL80211_IFTYPE_AP) |
|
|
+ BIT(NL80211_IFTYPE_MESH_POINT),
|
|
+ .supports_monitor = true,
|
|
+ .supports_shadow_regs = false,
|
|
+ .idle_ps = false,
|
|
+ .supports_suspend = false,
|
|
+ .hal_params = &ath11k_hw_hal_params_ipq8074,
|
|
+ .host_ce_config = ath11k_host_ce_config_qcn9074,
|
|
+ .reo_dest_ring_map_shift = HAL_IPQ5018_REO_DEST_RING_CTRL_HASH_RING_SHIFT,
|
|
+ .ce_count = 6,
|
|
+ .target_ce_config = ath11k_target_ce_config_wlan_ipq5018,
|
|
+ .target_ce_count = 9,
|
|
+ .svc_to_ce_map = ath11k_target_service_to_ce_map_wlan_ipq5018,
|
|
+ .svc_to_ce_map_len = 17,
|
|
+ .single_pdev_only = false,
|
|
+ .fw_mem_mode = ATH11K_QMI_TARGET_MEM_MODE_512M,
|
|
+ .cold_boot_calib = true,
|
|
+ .fix_l1ss = true,
|
|
+ .alloc_cacheable_memory = true,
|
|
+ .rxdma1_enable = true,
|
|
+ .num_rxmda_per_pdev = 1,
|
|
+ .rx_mac_buf_ring = false,
|
|
+ .vdev_start_delay = false,
|
|
+ .htt_peer_map_v2 = true,
|
|
+ .supports_sta_ps = false,
|
|
+ .dbr_debug_support = true,
|
|
+ .bios_sar_capa = NULL,
|
|
+ .m3_fw_support = false,
|
|
+ .fixed_bdf_addr = true,
|
|
+ .fixed_mem_region = true,
|
|
+ .static_window_map = false,
|
|
+ .hybrid_bus_type = false,
|
|
+ .fixed_fw_mem = false,
|
|
+ .support_off_channel_tx = false,
|
|
+ },
|
|
};
|
|
|
|
static inline struct ath11k_pdev *ath11k_core_get_single_pdev(struct ath11k_base *ab)
|
|
--- a/drivers/net/wireless/ath/ath11k/hw.c
|
|
+++ b/drivers/net/wireless/ath/ath11k/hw.c
|
|
@@ -13,6 +13,7 @@
|
|
#include "hif.h"
|
|
#include "hal.h"
|
|
#include "hw.h"
|
|
+#include "hif.h"
|
|
|
|
/* Map from pdev index to hw mac index */
|
|
static u8 ath11k_hw_ipq8074_mac_from_pdev_id(int pdev_idx)
|
|
@@ -104,9 +105,7 @@ static void ath11k_init_wmi_config_qca63
|
|
|
|
static void ath11k_hw_ipq8074_reo_setup(struct ath11k_base *ab)
|
|
{
|
|
- u8 frag_dest_ring = HAL_SRNG_RING_ID_REO2SW1;
|
|
u32 reo_base = HAL_SEQ_WCSS_UMAC_REO_REG;
|
|
- u32 val;
|
|
|
|
/* Each hash entry uses three bits to map to a particular ring. */
|
|
u32 ring_hash_map = HAL_HASH_ROUTING_RING_SW1 << 0 |
|
|
@@ -117,18 +116,9 @@ static void ath11k_hw_ipq8074_reo_setup(
|
|
HAL_HASH_ROUTING_RING_SW2 << 15 |
|
|
HAL_HASH_ROUTING_RING_SW3 << 18 |
|
|
HAL_HASH_ROUTING_RING_SW4 << 21;
|
|
+ u8 reo_dest_hash_shift = ab->hw_params.reo_dest_ring_map_shift;
|
|
|
|
- if (ab->nss.enabled)
|
|
- frag_dest_ring = HAL_SRNG_REO_ALTERNATE_SELECT;
|
|
-
|
|
- val = ath11k_hif_read32(ab, reo_base + HAL_REO1_GEN_ENABLE);
|
|
-
|
|
- val &= ~HAL_REO1_GEN_ENABLE_FRAG_DST_RING;
|
|
- val |= FIELD_PREP(HAL_REO1_GEN_ENABLE_FRAG_DST_RING,
|
|
- frag_dest_ring) |
|
|
- FIELD_PREP(HAL_REO1_GEN_ENABLE_AGING_LIST_ENABLE, 1) |
|
|
- FIELD_PREP(HAL_REO1_GEN_ENABLE_AGING_FLUSH_ENABLE, 1);
|
|
- ath11k_hif_write32(ab, reo_base + HAL_REO1_GEN_ENABLE, val);
|
|
+ ab->hw_params.hw_ops->set_rx_fragmentation_dst_ring(ab);
|
|
|
|
ath11k_hif_write32(ab, reo_base + HAL_REO1_AGING_THRESH_IX_0(ab),
|
|
HAL_DEFAULT_REO_TIMEOUT_USEC);
|
|
@@ -143,18 +133,18 @@ static void ath11k_hw_ipq8074_reo_setup(
|
|
if (ab->nss.enabled)
|
|
return;
|
|
|
|
+ /* These registers use only 24bits(3 bits x 8 hash values) for
|
|
+ * mapping the dest rings and remaining bits are reserved/not used
|
|
+ * so its safe to write them completely.
|
|
+ */
|
|
ath11k_hif_write32(ab, reo_base + HAL_REO1_DEST_RING_CTRL_IX_0,
|
|
- FIELD_PREP(HAL_REO_DEST_RING_CTRL_HASH_RING_MAP,
|
|
- ring_hash_map));
|
|
+ ring_hash_map << reo_dest_hash_shift);
|
|
ath11k_hif_write32(ab, reo_base + HAL_REO1_DEST_RING_CTRL_IX_1,
|
|
- FIELD_PREP(HAL_REO_DEST_RING_CTRL_HASH_RING_MAP,
|
|
- ring_hash_map));
|
|
+ ring_hash_map << reo_dest_hash_shift);
|
|
ath11k_hif_write32(ab, reo_base + HAL_REO1_DEST_RING_CTRL_IX_2,
|
|
- FIELD_PREP(HAL_REO_DEST_RING_CTRL_HASH_RING_MAP,
|
|
- ring_hash_map));
|
|
+ ring_hash_map << reo_dest_hash_shift);
|
|
ath11k_hif_write32(ab, reo_base + HAL_REO1_DEST_RING_CTRL_IX_3,
|
|
- FIELD_PREP(HAL_REO_DEST_RING_CTRL_HASH_RING_MAP,
|
|
- ring_hash_map));
|
|
+ ring_hash_map << reo_dest_hash_shift);
|
|
}
|
|
|
|
static void ath11k_init_wmi_config_ipq8074(struct ath11k_base *ab,
|
|
@@ -408,6 +398,50 @@ struct rx_attention *ath11k_hw_ipq8074_r
|
|
return &desc->u.ipq8074.attention;
|
|
}
|
|
|
|
+static void ath11k_hw_ipq8074_set_rx_fragmentation_dst_ring(struct ath11k_base *ab)
|
|
+{
|
|
+ u8 frag_dst_ring = HAL_SRNG_RING_ID_REO2SW1;
|
|
+ u32 reo_base = HAL_SEQ_WCSS_UMAC_REO_REG;
|
|
+ u32 val;
|
|
+
|
|
+ if (ab->nss.enabled)
|
|
+ frag_dst_ring = HAL_SRNG_REO_ALTERNATE_SELECT;
|
|
+
|
|
+ val = ath11k_hif_read32(ab, reo_base + HAL_REO1_GEN_ENABLE);
|
|
+
|
|
+ val &= ~HAL_REO1_GEN_ENABLE_FRAG_DST_RING;
|
|
+ val |= FIELD_PREP(HAL_REO1_GEN_ENABLE_FRAG_DST_RING,
|
|
+ frag_dst_ring) |
|
|
+ FIELD_PREP(HAL_REO1_GEN_ENABLE_AGING_LIST_ENABLE, 1) |
|
|
+ FIELD_PREP(HAL_REO1_GEN_ENABLE_AGING_FLUSH_ENABLE, 1);
|
|
+ ath11k_hif_write32(ab, reo_base + HAL_REO1_GEN_ENABLE, val);
|
|
+}
|
|
+
|
|
+static void ath11k_hw_wcn6855_set_rx_fragmentation_dst_ring(struct ath11k_base *ab)
|
|
+{
|
|
+ u8 frag_dst_ring = HAL_SRNG_RING_ID_REO2SW1;
|
|
+ u32 reo_base = HAL_SEQ_WCSS_UMAC_REO_REG;
|
|
+ u32 val;
|
|
+
|
|
+ if (ab->nss.enabled)
|
|
+ frag_dst_ring = HAL_SRNG_REO_ALTERNATE_SELECT;
|
|
+
|
|
+ val = ath11k_hif_read32(ab, reo_base + HAL_REO1_GEN_ENABLE);
|
|
+
|
|
+ val &= ~HAL_REO1_GEN_ENABLE_FRAG_DST_RING;
|
|
+ val |= FIELD_PREP(HAL_REO1_GEN_ENABLE_FRAG_DST_RING,
|
|
+ frag_dst_ring) |
|
|
+ FIELD_PREP(HAL_REO1_GEN_ENABLE_AGING_LIST_ENABLE, 1) |
|
|
+ FIELD_PREP(HAL_REO1_GEN_ENABLE_AGING_FLUSH_ENABLE, 1);
|
|
+ ath11k_hif_write32(ab, reo_base + HAL_REO1_GEN_ENABLE, val);
|
|
+
|
|
+ val = ath11k_hif_read32(ab, reo_base + HAL_REO1_MISC_CTL(ab));
|
|
+ val &= ~HAL_REO1_MISC_CTL_FRAGMENT_DST_RING;
|
|
+ val |= FIELD_PREP(HAL_REO1_MISC_CTL_FRAGMENT_DST_RING, frag_dst_ring);
|
|
+ ath11k_hif_write32(ab, reo_base + HAL_REO1_MISC_CTL(ab), val);
|
|
+
|
|
+}
|
|
+
|
|
static u8 *ath11k_hw_ipq8074_rx_desc_get_msdu_payload(struct hal_rx_desc *desc)
|
|
{
|
|
return &desc->u.ipq8074.msdu_payload[0];
|
|
@@ -763,9 +797,7 @@ static u8 *ath11k_hw_wcn6855_rx_desc_mpd
|
|
|
|
static void ath11k_hw_wcn6855_reo_setup(struct ath11k_base *ab)
|
|
{
|
|
- u8 frag_dest_ring = HAL_SRNG_RING_ID_REO2SW1;
|
|
u32 reo_base = HAL_SEQ_WCSS_UMAC_REO_REG;
|
|
- u32 val;
|
|
|
|
/* Each hash entry uses four bits to map to a particular ring. */
|
|
u32 ring_hash_map = HAL_HASH_ROUTING_RING_SW1 << 0 |
|
|
@@ -777,18 +809,44 @@ static void ath11k_hw_wcn6855_reo_setup(
|
|
HAL_HASH_ROUTING_RING_SW3 << 24 |
|
|
HAL_HASH_ROUTING_RING_SW4 << 28;
|
|
|
|
+ u8 reo_dest_hash_shift = ab->hw_params.reo_dest_ring_map_shift;
|
|
+ ab->hw_params.hw_ops->set_rx_fragmentation_dst_ring(ab);
|
|
+
|
|
+ ath11k_hif_write32(ab, reo_base + HAL_REO1_AGING_THRESH_IX_0(ab),
|
|
+ HAL_DEFAULT_REO_TIMEOUT_USEC);
|
|
+ ath11k_hif_write32(ab, reo_base + HAL_REO1_AGING_THRESH_IX_1(ab),
|
|
+ HAL_DEFAULT_REO_TIMEOUT_USEC);
|
|
+ ath11k_hif_write32(ab, reo_base + HAL_REO1_AGING_THRESH_IX_2(ab),
|
|
+ HAL_DEFAULT_REO_TIMEOUT_USEC);
|
|
+ ath11k_hif_write32(ab, reo_base + HAL_REO1_AGING_THRESH_IX_3(ab),
|
|
+ HAL_DEFAULT_REO_TIMEOUT_USEC);
|
|
+
|
|
+ /* REO Dest ring setup is not required in NSS offload case */
|
|
if (ab->nss.enabled)
|
|
- frag_dest_ring = HAL_SRNG_REO_ALTERNATE_SELECT;
|
|
+ return;
|
|
|
|
- val = ath11k_hif_read32(ab, reo_base + HAL_REO1_GEN_ENABLE);
|
|
- val |= FIELD_PREP(HAL_REO1_GEN_ENABLE_AGING_LIST_ENABLE, 1) |
|
|
- FIELD_PREP(HAL_REO1_GEN_ENABLE_AGING_FLUSH_ENABLE, 1);
|
|
- ath11k_hif_write32(ab, reo_base + HAL_REO1_GEN_ENABLE, val);
|
|
+ ath11k_hif_write32(ab, reo_base + HAL_REO1_DEST_RING_CTRL_IX_2,
|
|
+ ring_hash_map << reo_dest_hash_shift);
|
|
+ ath11k_hif_write32(ab, reo_base + HAL_REO1_DEST_RING_CTRL_IX_3,
|
|
+ ring_hash_map << reo_dest_hash_shift);
|
|
+}
|
|
|
|
- val = ath11k_hif_read32(ab, reo_base + HAL_REO1_MISC_CTL(ab));
|
|
- val &= ~HAL_REO1_MISC_CTL_FRAGMENT_DST_RING;
|
|
- val |= FIELD_PREP(HAL_REO1_MISC_CTL_FRAGMENT_DST_RING, frag_dest_ring);
|
|
- ath11k_hif_write32(ab, reo_base + HAL_REO1_MISC_CTL(ab), val);
|
|
+static void ath11k_hw_ipq5018_reo_setup(struct ath11k_base *ab)
|
|
+{
|
|
+ u32 reo_base = HAL_SEQ_WCSS_UMAC_REO_REG;
|
|
+ u8 reo_dest_hash_shift = ab->hw_params.reo_dest_ring_map_shift;
|
|
+
|
|
+ /* Each hash entry uses three bits to map to a particular ring. */
|
|
+ u32 ring_hash_map = HAL_HASH_ROUTING_RING_SW1 << 0 |
|
|
+ HAL_HASH_ROUTING_RING_SW2 << 4 |
|
|
+ HAL_HASH_ROUTING_RING_SW3 << 8 |
|
|
+ HAL_HASH_ROUTING_RING_SW4 << 12 |
|
|
+ HAL_HASH_ROUTING_RING_SW1 << 16 |
|
|
+ HAL_HASH_ROUTING_RING_SW2 << 20 |
|
|
+ HAL_HASH_ROUTING_RING_SW3 << 24 |
|
|
+ HAL_HASH_ROUTING_RING_SW4 << 28;
|
|
+
|
|
+ ab->hw_params.hw_ops->set_rx_fragmentation_dst_ring(ab);
|
|
|
|
ath11k_hif_write32(ab, reo_base + HAL_REO1_AGING_THRESH_IX_0(ab),
|
|
HAL_DEFAULT_REO_TIMEOUT_USEC);
|
|
@@ -803,10 +861,14 @@ static void ath11k_hw_wcn6855_reo_setup(
|
|
if (ab->nss.enabled)
|
|
return;
|
|
|
|
+ ath11k_hif_write32(ab, reo_base + HAL_REO1_DEST_RING_CTRL_IX_0,
|
|
+ ring_hash_map << reo_dest_hash_shift);
|
|
+ ath11k_hif_write32(ab, reo_base + HAL_REO1_DEST_RING_CTRL_IX_1,
|
|
+ ring_hash_map << reo_dest_hash_shift);
|
|
ath11k_hif_write32(ab, reo_base + HAL_REO1_DEST_RING_CTRL_IX_2,
|
|
- ring_hash_map);
|
|
+ ring_hash_map << reo_dest_hash_shift);
|
|
ath11k_hif_write32(ab, reo_base + HAL_REO1_DEST_RING_CTRL_IX_3,
|
|
- ring_hash_map);
|
|
+ ring_hash_map << reo_dest_hash_shift);
|
|
}
|
|
|
|
static u16 ath11k_hw_ipq8074_mpdu_info_get_peerid(u8 *tlv_data)
|
|
@@ -838,6 +900,70 @@ static bool ath11k_hw_wcn6855_rx_desc_ge
|
|
__le32_to_cpu(desc->u.wcn6855.msdu_start.info2));
|
|
}
|
|
|
|
+static void ath11k_hw_ipq5018_set_rx_fragmentation_dst_ring(struct ath11k_base *ab)
|
|
+{
|
|
+ u8 frag_dst_ring = HAL_SRNG_RING_ID_REO2SW1;
|
|
+ u32 reo_base = HAL_SEQ_WCSS_UMAC_REO_REG;
|
|
+ u32 val;
|
|
+
|
|
+ if (ab->nss.enabled)
|
|
+ frag_dst_ring = HAL_SRNG_REO_ALTERNATE_SELECT;
|
|
+
|
|
+ val = ath11k_hif_read32(ab, reo_base + HAL_REO1_GEN_ENABLE);
|
|
+
|
|
+ val &= ~HAL_REO1_GEN_ENABLE_FRAG_DST_RING;
|
|
+ val |= FIELD_PREP(HAL_REO1_GEN_ENABLE_AGING_LIST_ENABLE, 1) |
|
|
+ FIELD_PREP(HAL_REO1_GEN_ENABLE_AGING_FLUSH_ENABLE, 1);
|
|
+ ath11k_hif_write32(ab, reo_base + HAL_REO1_GEN_ENABLE, val);
|
|
+
|
|
+ val = ath11k_hif_read32(ab, reo_base + HAL_REO1_R0_MISC_CTL);
|
|
+ val &= ~HAL_IPQ5018_REO1_MISC_CTL_FRAGMENT_DEST_RING;
|
|
+ val |= FIELD_PREP(HAL_IPQ5018_REO1_MISC_CTL_FRAGMENT_DEST_RING,
|
|
+ frag_dst_ring);
|
|
+ ath11k_hif_write32(ab, reo_base + HAL_REO1_R0_MISC_CTL, val);
|
|
+}
|
|
+
|
|
+static u32 ath11k_get_reo_dest_remap_config_default(void)
|
|
+{
|
|
+ u32 ring_hash_map;
|
|
+
|
|
+ /* For IPQ8074, IPQ6018, QCN9074, the first 8 bits are
|
|
+ * are reserved/not used and the remainig 24 bits are
|
|
+ * mapped for 8 hash values with 3 bits representing the
|
|
+ * destination ring
|
|
+ */
|
|
+ ring_hash_map = HAL_HASH_ROUTING_RING_SW1 << 0 |
|
|
+ HAL_HASH_ROUTING_RING_SW2 << 3 |
|
|
+ HAL_HASH_ROUTING_RING_SW3 << 6 |
|
|
+ HAL_HASH_ROUTING_RING_SW4 << 9 |
|
|
+ HAL_HASH_ROUTING_RING_SW1 << 12 |
|
|
+ HAL_HASH_ROUTING_RING_SW2 << 15 |
|
|
+ HAL_HASH_ROUTING_RING_SW3 << 18 |
|
|
+ HAL_HASH_ROUTING_RING_SW4 << 21;
|
|
+
|
|
+ return ring_hash_map;
|
|
+}
|
|
+
|
|
+static u32 ath11k_get_reo_dest_remap_config_5018(void)
|
|
+{
|
|
+ u32 ring_hash_map;
|
|
+
|
|
+ /* For IPQ5018 4 bits x 8 hash values represent the corresponding
|
|
+ * destination rings. The 4th bit for each ring representation is
|
|
+ * currently reserved/not used.
|
|
+ */
|
|
+ ring_hash_map = HAL_HASH_ROUTING_RING_SW1 << 0 |
|
|
+ HAL_HASH_ROUTING_RING_SW2 << 4 |
|
|
+ HAL_HASH_ROUTING_RING_SW3 << 8 |
|
|
+ HAL_HASH_ROUTING_RING_SW4 << 12 |
|
|
+ HAL_HASH_ROUTING_RING_SW1 << 16 |
|
|
+ HAL_HASH_ROUTING_RING_SW2 << 20 |
|
|
+ HAL_HASH_ROUTING_RING_SW3 << 24 |
|
|
+ HAL_HASH_ROUTING_RING_SW4 << 28;
|
|
+
|
|
+ return ring_hash_map;
|
|
+}
|
|
+
|
|
const struct ath11k_hw_ops ipq8074_ops = {
|
|
.get_hw_mac_from_pdev_id = ath11k_hw_ipq8074_mac_from_pdev_id,
|
|
.wmi_init_config = ath11k_init_wmi_config_ipq8074,
|
|
@@ -875,6 +1001,8 @@ const struct ath11k_hw_ops ipq8074_ops =
|
|
.mpdu_info_get_peerid = ath11k_hw_ipq8074_mpdu_info_get_peerid,
|
|
.rx_desc_mac_addr2_valid = ath11k_hw_ipq8074_rx_desc_mac_addr2_valid,
|
|
.rx_desc_mpdu_start_addr2 = ath11k_hw_ipq8074_rx_desc_mpdu_start_addr2,
|
|
+ .set_rx_fragmentation_dst_ring = ath11k_hw_ipq8074_set_rx_fragmentation_dst_ring,
|
|
+ .get_reo_dest_remap_config = ath11k_get_reo_dest_remap_config_default,
|
|
};
|
|
|
|
const struct ath11k_hw_ops ipq6018_ops = {
|
|
@@ -914,6 +1042,8 @@ const struct ath11k_hw_ops ipq6018_ops =
|
|
.mpdu_info_get_peerid = ath11k_hw_ipq8074_mpdu_info_get_peerid,
|
|
.rx_desc_mac_addr2_valid = ath11k_hw_ipq8074_rx_desc_mac_addr2_valid,
|
|
.rx_desc_mpdu_start_addr2 = ath11k_hw_ipq8074_rx_desc_mpdu_start_addr2,
|
|
+ .set_rx_fragmentation_dst_ring = ath11k_hw_ipq8074_set_rx_fragmentation_dst_ring,
|
|
+ .get_reo_dest_remap_config = ath11k_get_reo_dest_remap_config_default,
|
|
};
|
|
|
|
const struct ath11k_hw_ops qca6390_ops = {
|
|
@@ -953,6 +1083,8 @@ const struct ath11k_hw_ops qca6390_ops =
|
|
.mpdu_info_get_peerid = ath11k_hw_ipq8074_mpdu_info_get_peerid,
|
|
.rx_desc_mac_addr2_valid = ath11k_hw_ipq8074_rx_desc_mac_addr2_valid,
|
|
.rx_desc_mpdu_start_addr2 = ath11k_hw_ipq8074_rx_desc_mpdu_start_addr2,
|
|
+ .set_rx_fragmentation_dst_ring = ath11k_hw_ipq8074_set_rx_fragmentation_dst_ring,
|
|
+ .get_reo_dest_remap_config = ath11k_get_reo_dest_remap_config_default,
|
|
};
|
|
|
|
const struct ath11k_hw_ops qcn9074_ops = {
|
|
@@ -992,6 +1124,8 @@ const struct ath11k_hw_ops qcn9074_ops =
|
|
.mpdu_info_get_peerid = ath11k_hw_ipq8074_mpdu_info_get_peerid,
|
|
.rx_desc_mac_addr2_valid = ath11k_hw_ipq9074_rx_desc_mac_addr2_valid,
|
|
.rx_desc_mpdu_start_addr2 = ath11k_hw_ipq9074_rx_desc_mpdu_start_addr2,
|
|
+ .set_rx_fragmentation_dst_ring = ath11k_hw_ipq8074_set_rx_fragmentation_dst_ring,
|
|
+ .get_reo_dest_remap_config = ath11k_get_reo_dest_remap_config_default,
|
|
};
|
|
|
|
const struct ath11k_hw_ops wcn6855_ops = {
|
|
@@ -1031,6 +1165,8 @@ const struct ath11k_hw_ops wcn6855_ops =
|
|
.mpdu_info_get_peerid = ath11k_hw_wcn6855_mpdu_info_get_peerid,
|
|
.rx_desc_mac_addr2_valid = ath11k_hw_wcn6855_rx_desc_mac_addr2_valid,
|
|
.rx_desc_mpdu_start_addr2 = ath11k_hw_wcn6855_rx_desc_mpdu_start_addr2,
|
|
+ .set_rx_fragmentation_dst_ring = ath11k_hw_wcn6855_set_rx_fragmentation_dst_ring,
|
|
+ .get_reo_dest_remap_config = ath11k_get_reo_dest_remap_config_default,
|
|
};
|
|
|
|
const struct ath11k_hw_ops wcn6750_ops = {
|
|
@@ -1072,6 +1208,47 @@ const struct ath11k_hw_ops wcn6750_ops =
|
|
.rx_desc_mpdu_start_addr2 = ath11k_hw_ipq9074_rx_desc_mpdu_start_addr2,
|
|
};
|
|
|
|
+/* IPQ5018 hw ops is similar to QCN9074 except for the dest ring remap */
|
|
+const struct ath11k_hw_ops ipq5018_ops = {
|
|
+ .get_hw_mac_from_pdev_id = ath11k_hw_ipq6018_mac_from_pdev_id,
|
|
+ .wmi_init_config = ath11k_init_wmi_config_ipq8074,
|
|
+ .mac_id_to_pdev_id = ath11k_hw_mac_id_to_pdev_id_ipq8074,
|
|
+ .mac_id_to_srng_id = ath11k_hw_mac_id_to_srng_id_ipq8074,
|
|
+ .rx_desc_mac_addr2_valid = ath11k_hw_ipq8074_rx_desc_mac_addr2_valid,
|
|
+ .rx_desc_mpdu_start_addr2 = ath11k_hw_ipq8074_rx_desc_mpdu_start_addr2,
|
|
+ .tx_mesh_enable = ath11k_hw_qcn9074_tx_mesh_enable,
|
|
+ .rx_desc_get_first_msdu = ath11k_hw_qcn9074_rx_desc_get_first_msdu,
|
|
+ .rx_desc_get_last_msdu = ath11k_hw_qcn9074_rx_desc_get_last_msdu,
|
|
+ .rx_desc_get_l3_pad_bytes = ath11k_hw_qcn9074_rx_desc_get_l3_pad_bytes,
|
|
+ .rx_desc_get_hdr_status = ath11k_hw_qcn9074_rx_desc_get_hdr_status,
|
|
+ .rx_desc_encrypt_valid = ath11k_hw_qcn9074_rx_desc_encrypt_valid,
|
|
+ .rx_desc_get_encrypt_type = ath11k_hw_qcn9074_rx_desc_get_encrypt_type,
|
|
+ .rx_desc_get_decap_type = ath11k_hw_qcn9074_rx_desc_get_decap_type,
|
|
+ .rx_desc_get_mesh_ctl = ath11k_hw_qcn9074_rx_desc_get_mesh_ctl,
|
|
+ .rx_desc_get_ldpc_support = ath11k_hw_qcn9074_rx_desc_get_ldpc_support,
|
|
+ .rx_desc_get_mpdu_seq_ctl_vld = ath11k_hw_qcn9074_rx_desc_get_mpdu_seq_ctl_vld,
|
|
+ .rx_desc_get_mpdu_fc_valid = ath11k_hw_qcn9074_rx_desc_get_mpdu_fc_valid,
|
|
+ .rx_desc_get_mpdu_start_seq_no = ath11k_hw_qcn9074_rx_desc_get_mpdu_start_seq_no,
|
|
+ .rx_desc_get_msdu_len = ath11k_hw_qcn9074_rx_desc_get_msdu_len,
|
|
+ .rx_desc_get_msdu_sgi = ath11k_hw_qcn9074_rx_desc_get_msdu_sgi,
|
|
+ .rx_desc_get_msdu_rate_mcs = ath11k_hw_qcn9074_rx_desc_get_msdu_rate_mcs,
|
|
+ .rx_desc_get_msdu_rx_bw = ath11k_hw_qcn9074_rx_desc_get_msdu_rx_bw,
|
|
+ .rx_desc_get_msdu_freq = ath11k_hw_qcn9074_rx_desc_get_msdu_freq,
|
|
+ .rx_desc_get_msdu_pkt_type = ath11k_hw_qcn9074_rx_desc_get_msdu_pkt_type,
|
|
+ .rx_desc_get_msdu_nss = ath11k_hw_qcn9074_rx_desc_get_msdu_nss,
|
|
+ .rx_desc_get_mpdu_tid = ath11k_hw_qcn9074_rx_desc_get_mpdu_tid,
|
|
+ .rx_desc_get_mpdu_peer_id = ath11k_hw_qcn9074_rx_desc_get_mpdu_peer_id,
|
|
+ .rx_desc_copy_attn_end_tlv = ath11k_hw_qcn9074_rx_desc_copy_attn_end,
|
|
+ .rx_desc_get_mpdu_start_tag = ath11k_hw_qcn9074_rx_desc_get_mpdu_start_tag,
|
|
+ .rx_desc_get_mpdu_ppdu_id = ath11k_hw_qcn9074_rx_desc_get_mpdu_ppdu_id,
|
|
+ .rx_desc_set_msdu_len = ath11k_hw_qcn9074_rx_desc_set_msdu_len,
|
|
+ .rx_desc_get_attention = ath11k_hw_qcn9074_rx_desc_get_attention,
|
|
+ .rx_desc_get_msdu_payload = ath11k_hw_qcn9074_rx_desc_get_msdu_payload,
|
|
+ .reo_setup = ath11k_hw_ipq5018_reo_setup,
|
|
+ .set_rx_fragmentation_dst_ring = ath11k_hw_ipq5018_set_rx_fragmentation_dst_ring,
|
|
+ .get_reo_dest_remap_config = ath11k_get_reo_dest_remap_config_5018,
|
|
+};
|
|
+
|
|
#define ATH11K_TX_RING_MASK_0 0x1
|
|
#define ATH11K_TX_RING_MASK_1 0x2
|
|
#define ATH11K_TX_RING_MASK_2 0x4
|
|
@@ -1880,6 +2057,197 @@ const struct service_to_pipe ath11k_targ
|
|
},
|
|
};
|
|
|
|
+/* Target firmware's Copy Engine configuration for IPQ5018 */
|
|
+const struct ce_pipe_config ath11k_target_ce_config_wlan_ipq5018[] = {
|
|
+ /* CE0: host->target HTC control and raw streams */
|
|
+ {
|
|
+ .pipenum = __cpu_to_le32(0),
|
|
+ .pipedir = __cpu_to_le32(PIPEDIR_OUT),
|
|
+ .nentries = __cpu_to_le32(32),
|
|
+ .nbytes_max = __cpu_to_le32(2048),
|
|
+ .flags = __cpu_to_le32(CE_ATTR_FLAGS),
|
|
+ .reserved = __cpu_to_le32(0),
|
|
+ },
|
|
+
|
|
+ /* CE1: target->host HTT + HTC control */
|
|
+ {
|
|
+ .pipenum = __cpu_to_le32(1),
|
|
+ .pipedir = __cpu_to_le32(PIPEDIR_IN),
|
|
+ .nentries = __cpu_to_le32(32),
|
|
+ .nbytes_max = __cpu_to_le32(2048),
|
|
+ .flags = __cpu_to_le32(CE_ATTR_FLAGS),
|
|
+ .reserved = __cpu_to_le32(0),
|
|
+ },
|
|
+
|
|
+ /* CE2: target->host WMI */
|
|
+ {
|
|
+ .pipenum = __cpu_to_le32(2),
|
|
+ .pipedir = __cpu_to_le32(PIPEDIR_IN),
|
|
+ .nentries = __cpu_to_le32(32),
|
|
+ .nbytes_max = __cpu_to_le32(2048),
|
|
+ .flags = __cpu_to_le32(CE_ATTR_FLAGS),
|
|
+ .reserved = __cpu_to_le32(0),
|
|
+ },
|
|
+
|
|
+ /* CE3: host->target WMI */
|
|
+ {
|
|
+ .pipenum = __cpu_to_le32(3),
|
|
+ .pipedir = __cpu_to_le32(PIPEDIR_OUT),
|
|
+ .nentries = __cpu_to_le32(32),
|
|
+ .nbytes_max = __cpu_to_le32(2048),
|
|
+ .flags = __cpu_to_le32(CE_ATTR_FLAGS),
|
|
+ .reserved = __cpu_to_le32(0),
|
|
+ },
|
|
+
|
|
+ /* CE4: host->target HTT */
|
|
+ {
|
|
+ .pipenum = __cpu_to_le32(4),
|
|
+ .pipedir = __cpu_to_le32(PIPEDIR_OUT),
|
|
+ .nentries = __cpu_to_le32(256),
|
|
+ .nbytes_max = __cpu_to_le32(256),
|
|
+ .flags = __cpu_to_le32(CE_ATTR_FLAGS | CE_ATTR_DIS_INTR),
|
|
+ .reserved = __cpu_to_le32(0),
|
|
+ },
|
|
+
|
|
+ /* CE5: target->host Pktlog */
|
|
+ {
|
|
+ .pipenum = __cpu_to_le32(5),
|
|
+ .pipedir = __cpu_to_le32(PIPEDIR_IN),
|
|
+ .nentries = __cpu_to_le32(32),
|
|
+ .nbytes_max = __cpu_to_le32(2048),
|
|
+ .flags = __cpu_to_le32(CE_ATTR_FLAGS),
|
|
+ .reserved = __cpu_to_le32(0),
|
|
+ },
|
|
+
|
|
+ /* CE6: Reserved for target autonomous hif_memcpy */
|
|
+ {
|
|
+ .pipenum = __cpu_to_le32(6),
|
|
+ .pipedir = __cpu_to_le32(PIPEDIR_INOUT),
|
|
+ .nentries = __cpu_to_le32(32),
|
|
+ .nbytes_max = __cpu_to_le32(16384),
|
|
+ .flags = __cpu_to_le32(CE_ATTR_FLAGS),
|
|
+ .reserved = __cpu_to_le32(0),
|
|
+ },
|
|
+
|
|
+ /* CE7 used only by Host */
|
|
+ {
|
|
+ .pipenum = __cpu_to_le32(7),
|
|
+ .pipedir = __cpu_to_le32(PIPEDIR_OUT),
|
|
+ .nentries = __cpu_to_le32(32),
|
|
+ .nbytes_max = __cpu_to_le32(2048),
|
|
+ .flags = __cpu_to_le32(0x2000),
|
|
+ .reserved = __cpu_to_le32(0),
|
|
+ },
|
|
+
|
|
+ /* CE8 target->host used only by IPA */
|
|
+ {
|
|
+ .pipenum = __cpu_to_le32(8),
|
|
+ .pipedir = __cpu_to_le32(PIPEDIR_INOUT),
|
|
+ .nentries = __cpu_to_le32(32),
|
|
+ .nbytes_max = __cpu_to_le32(16384),
|
|
+ .flags = __cpu_to_le32(CE_ATTR_FLAGS),
|
|
+ .reserved = __cpu_to_le32(0),
|
|
+ },
|
|
+};
|
|
+
|
|
+/* Map from service/endpoint to Copy Engine for IPQ5018.
|
|
+ * This table is derived from the CE TABLE, above.
|
|
+ * It is passed to the Target at startup for use by firmware.
|
|
+ */
|
|
+const struct service_to_pipe ath11k_target_service_to_ce_map_wlan_ipq5018[] = {
|
|
+ {
|
|
+ .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_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),
|
|
+ },
|
|
+
|
|
+ {
|
|
+ .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),
|
|
+ },
|
|
+ {
|
|
+ .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 */ }
|
|
+};
|
|
+
|
|
const struct ath11k_hw_ring_mask ath11k_hw_ring_mask_qcn9074 = {
|
|
.tx = {
|
|
ATH11K_TX_RING_MASK_0,
|
|
@@ -1970,6 +2338,14 @@ const struct ath11k_hw_regs ipq8074_regs
|
|
.hal_reo_cmd_ring_base_lsb = 0x00000194,
|
|
.hal_reo_cmd_ring_hp = 0x00003020,
|
|
|
|
+ /* SW2REO ring address */
|
|
+ .hal_sw2reo_ring_base_lsb = 0x000001ec,
|
|
+ .hal_sw2reo_ring_hp = 0x00003028,
|
|
+
|
|
+ /* REO CMD ring address */
|
|
+ .hal_reo_cmd_ring_base_lsb = 0x00000194,
|
|
+ .hal_reo_cmd_ring_hp = 0x00003020,
|
|
+
|
|
/* REO status address */
|
|
.hal_reo_status_ring_base_lsb = 0x00000504,
|
|
.hal_reo_status_hp = 0x00003070,
|
|
@@ -2055,6 +2431,14 @@ const struct ath11k_hw_regs qca6390_regs
|
|
.hal_reo_cmd_ring_base_lsb = 0x00000194,
|
|
.hal_reo_cmd_ring_hp = 0x00003020,
|
|
|
|
+ /* SW2REO ring address */
|
|
+ .hal_sw2reo_ring_base_lsb = 0x000001ec,
|
|
+ .hal_sw2reo_ring_hp = 0x00003028,
|
|
+
|
|
+ /* REO CMD ring address */
|
|
+ .hal_reo_cmd_ring_base_lsb = 0x00000194,
|
|
+ .hal_reo_cmd_ring_hp = 0x00003020,
|
|
+
|
|
/* REO status address */
|
|
.hal_reo_status_ring_base_lsb = 0x000004ac,
|
|
.hal_reo_status_hp = 0x00003068,
|
|
@@ -2140,6 +2524,14 @@ const struct ath11k_hw_regs qcn9074_regs
|
|
.hal_reo_cmd_ring_base_lsb = 0x00000194,
|
|
.hal_reo_cmd_ring_hp = 0x00003020,
|
|
|
|
+ /* SW2REO ring address */
|
|
+ .hal_sw2reo_ring_base_lsb = 0x000001ec,
|
|
+ .hal_sw2reo_ring_hp = 0x00003028,
|
|
+
|
|
+ /* REO CMD ring address */
|
|
+ .hal_reo_cmd_ring_base_lsb = 0x00000194,
|
|
+ .hal_reo_cmd_ring_hp = 0x00003020,
|
|
+
|
|
/* REO status address */
|
|
.hal_reo_status_ring_base_lsb = 0x00000504,
|
|
.hal_reo_status_hp = 0x00003070,
|
|
@@ -2156,6 +2548,81 @@ const struct ath11k_hw_regs qcn9074_regs
|
|
|
|
/* WBM Idle address */
|
|
.hal_wbm_idle_link_ring_base_lsb = 0x00000874,
|
|
+ .hal_wbm_idle_link_ring_misc = 0x00000884,
|
|
+
|
|
+ /* SW2WBM release address */
|
|
+ .hal_wbm_release_ring_base_lsb = 0x000001ec,
|
|
+
|
|
+ /* WBM2SW release address */
|
|
+ .hal_wbm0_release_ring_base_lsb = 0x00000924,
|
|
+ .hal_wbm1_release_ring_base_lsb = 0x0000097c,
|
|
+};
|
|
+
|
|
+const struct ath11k_hw_regs ipq5018_regs = {
|
|
+ /* SW2TCL(x) R0 ring configuration address */
|
|
+ .hal_tcl1_ring_base_lsb = 0x00000694,
|
|
+ .hal_tcl1_ring_base_msb = 0x00000698,
|
|
+ .hal_tcl1_ring_id = 0x0000069c,
|
|
+ .hal_tcl1_ring_misc = 0x000006a4,
|
|
+ .hal_tcl1_ring_tp_addr_lsb = 0x000006b0,
|
|
+ .hal_tcl1_ring_tp_addr_msb = 0x000006b4,
|
|
+ .hal_tcl1_ring_consumer_int_setup_ix0 = 0x000006c4,
|
|
+ .hal_tcl1_ring_consumer_int_setup_ix1 = 0x000006c8,
|
|
+ .hal_tcl1_ring_msi1_base_lsb = 0x000006dc,
|
|
+ .hal_tcl1_ring_msi1_base_msb = 0x000006e0,
|
|
+ .hal_tcl1_ring_msi1_data = 0x000006e4,
|
|
+ .hal_tcl2_ring_base_lsb = 0x000006ec,
|
|
+ .hal_tcl_ring_base_lsb = 0x0000079c,
|
|
+
|
|
+ /* TCL STATUS ring address */
|
|
+ .hal_tcl_status_ring_base_lsb = 0x000008a4,
|
|
+
|
|
+ /* REO2SW(x) R0 ring configuration address */
|
|
+ .hal_reo1_ring_base_lsb = 0x000001ec,
|
|
+ .hal_reo1_ring_base_msb = 0x000001f0,
|
|
+ .hal_reo1_ring_id = 0x000001f4,
|
|
+ .hal_reo1_ring_misc = 0x000001fc,
|
|
+ .hal_reo1_ring_hp_addr_lsb = 0x00000200,
|
|
+ .hal_reo1_ring_hp_addr_msb = 0x00000204,
|
|
+ .hal_reo1_ring_producer_int_setup = 0x00000210,
|
|
+ .hal_reo1_ring_msi1_base_lsb = 0x00000234,
|
|
+ .hal_reo1_ring_msi1_base_msb = 0x00000238,
|
|
+ .hal_reo1_ring_msi1_data = 0x0000023c,
|
|
+ .hal_reo2_ring_base_lsb = 0x00000244,
|
|
+ .hal_reo1_aging_thresh_ix_0 = 0x00000564,
|
|
+ .hal_reo1_aging_thresh_ix_1 = 0x00000568,
|
|
+ .hal_reo1_aging_thresh_ix_2 = 0x0000056c,
|
|
+ .hal_reo1_aging_thresh_ix_3 = 0x00000570,
|
|
+
|
|
+ /* REO2SW(x) R2 ring pointers (head/tail) address */
|
|
+ .hal_reo1_ring_hp = 0x00003028,
|
|
+ .hal_reo1_ring_tp = 0x0000302c,
|
|
+ .hal_reo2_ring_hp = 0x00003030,
|
|
+
|
|
+ /* REO2TCL R0 ring configuration address */
|
|
+ .hal_reo_tcl_ring_base_lsb = 0x000003fc,
|
|
+ .hal_reo_tcl_ring_hp = 0x00003058,
|
|
+
|
|
+ /* SW2REO ring address */
|
|
+ .hal_sw2reo_ring_base_lsb = 0x0000013c,
|
|
+ .hal_sw2reo_ring_hp = 0x00003018,
|
|
+
|
|
+ /* REO CMD ring address */
|
|
+ .hal_reo_cmd_ring_base_lsb = 0x000000e4,
|
|
+ .hal_reo_cmd_ring_hp = 0x00003010,
|
|
+
|
|
+ /* REO status address */
|
|
+ .hal_reo_status_ring_base_lsb = 0x00000504,
|
|
+ .hal_reo_status_hp = 0x00003070,
|
|
+
|
|
+ /* WCSS relative address */
|
|
+ .hal_seq_wcss_umac_ce0_src_reg = 0x08400000,
|
|
+ .hal_seq_wcss_umac_ce0_dst_reg = 0x08401000,
|
|
+ .hal_seq_wcss_umac_ce1_src_reg = 0x08402000,
|
|
+ .hal_seq_wcss_umac_ce1_dst_reg = 0x08403000,
|
|
+
|
|
+ /* WBM Idle address */
|
|
+ .hal_wbm_idle_link_ring_base_lsb = 0x00000874,
|
|
.hal_wbm_idle_link_ring_misc = 0x00000884,
|
|
|
|
/* SW2WBM release address */
|
|
--- a/drivers/net/wireless/ath/ath11k/dp.c
|
|
+++ b/drivers/net/wireless/ath/ath11k/dp.c
|
|
@@ -1112,7 +1112,7 @@ int ath11k_dp_alloc(struct ath11k_base *
|
|
}
|
|
}
|
|
|
|
- for (i = 0; i < HAL_DSCP_TID_MAP_TBL_NUM_ENTRIES_MAX; i++)
|
|
+ for (i = 0; i < ab->hw_params.num_dscp_tid_map_tbl; i++)
|
|
ath11k_hal_tx_set_dscp_tid_map(ab, i);
|
|
|
|
/* Init any SOC level resource for DP */
|
|
--- a/drivers/net/wireless/ath/ath11k/ce.h
|
|
+++ b/drivers/net/wireless/ath/ath11k/ce.h
|
|
@@ -49,6 +49,11 @@ void ath11k_ce_byte_swap(void *mem, u32
|
|
#define CE_HOST_IE_2_ADDRESS 0x00A18040
|
|
#define CE_HOST_IE_3_ADDRESS CE_HOST_IE_ADDRESS
|
|
|
|
+/* CE IE registers are different for IPQ5018 */
|
|
+#define CE_HOST_IPQ5018_IE_ADDRESS 0x0841804C
|
|
+#define CE_HOST_IPQ5018_IE_2_ADDRESS 0x08418050
|
|
+#define CE_HOST_IPQ5018_IE_3_ADDRESS CE_HOST_IPQ5018_IE_ADDRESS
|
|
+
|
|
#define CE_HOST_IE_3_SHIFT 0xC
|
|
|
|
#define CE_RING_IDX_INCR(nentries_mask, idx) (((idx) + 1) & (nentries_mask))
|
|
--- a/drivers/net/wireless/ath/ath11k/hal.c
|
|
+++ b/drivers/net/wireless/ath/ath11k/hal.c
|
|
@@ -815,8 +815,16 @@ void ath11k_hal_srng_access_begin(struct
|
|
*/
|
|
void ath11k_hal_srng_access_end(struct ath11k_base *ab, struct hal_srng *srng)
|
|
{
|
|
+ unsigned long *mem;
|
|
+
|
|
lockdep_assert_held(&srng->lock);
|
|
|
|
+ if (srng->flags & HAL_SRNG_FLAGS_REMAP_CE_RING) {
|
|
+ mem = ab->mem_ce;
|
|
+ } else {
|
|
+ mem = ab->mem;
|
|
+ }
|
|
+
|
|
/* TODO: See if we need a write memory barrier here */
|
|
if (srng->flags & HAL_SRNG_FLAGS_LMAC_RING) {
|
|
/* For LMAC rings, ring pointer updates are done through FW and
|
|
@@ -836,13 +844,13 @@ void ath11k_hal_srng_access_end(struct a
|
|
*(volatile u32 *)srng->u.src_ring.tp_addr;
|
|
ath11k_hif_write32(ab,
|
|
(unsigned long)srng->u.src_ring.hp_addr -
|
|
- (unsigned long)ab->mem,
|
|
+ (unsigned long)mem,
|
|
srng->u.src_ring.hp);
|
|
} else {
|
|
srng->u.dst_ring.last_hp = *srng->u.dst_ring.hp_addr;
|
|
ath11k_hif_write32(ab,
|
|
(unsigned long)srng->u.dst_ring.tp_addr -
|
|
- (unsigned long)ab->mem,
|
|
+ (unsigned long)mem,
|
|
srng->u.dst_ring.tp);
|
|
}
|
|
}
|
|
@@ -953,6 +961,7 @@ int ath11k_hal_srng_setup(struct ath11k_
|
|
u32 lmac_idx;
|
|
int i;
|
|
u32 reg_base;
|
|
+ unsigned long *mem;
|
|
|
|
ring_id = ath11k_hal_srng_get_ring_id(ab, type, ring_num, mac_id);
|
|
if (ring_id < 0)
|
|
@@ -982,6 +991,13 @@ int ath11k_hal_srng_setup(struct ath11k_
|
|
(ring_num * srng_config->reg_size[i]);
|
|
}
|
|
|
|
+ mem = ab->mem;
|
|
+
|
|
+ if (ab->ce_remap && (type == HAL_CE_DST || type == HAL_CE_SRC)) {
|
|
+ srng->flags |= HAL_SRNG_FLAGS_REMAP_CE_RING;
|
|
+ mem = ab->mem_ce;
|
|
+ }
|
|
+
|
|
memset(srng->ring_base_vaddr, 0,
|
|
(srng->entry_size * srng->num_entries) << 2);
|
|
|
|
@@ -1007,7 +1023,7 @@ int ath11k_hal_srng_setup(struct ath11k_
|
|
} else {
|
|
if (!ab->hw_params.supports_shadow_regs)
|
|
srng->u.src_ring.hp_addr =
|
|
- (u32 *)((unsigned long)ab->mem + reg_base);
|
|
+ (u32 *)((unsigned long)mem + reg_base);
|
|
else
|
|
ath11k_dbg(ab, ATH11k_DBG_HAL,
|
|
"hal type %d ring_num %d reg_base 0x%x shadow 0x%lx\n",
|
|
@@ -1040,7 +1056,7 @@ int ath11k_hal_srng_setup(struct ath11k_
|
|
} else {
|
|
if (!ab->hw_params.supports_shadow_regs)
|
|
srng->u.dst_ring.tp_addr =
|
|
- (u32 *)((unsigned long)ab->mem + reg_base +
|
|
+ (u32 *)((unsigned long)mem + reg_base +
|
|
(HAL_REO1_RING_TP(ab) - HAL_REO1_RING_HP(ab)));
|
|
else
|
|
ath11k_dbg(ab, ATH11k_DBG_HAL,
|
|
--- a/drivers/net/wireless/ath/ath11k/hal.h
|
|
+++ b/drivers/net/wireless/ath/ath11k/hal.h
|
|
@@ -12,6 +12,8 @@
|
|
|
|
struct ath11k_base;
|
|
|
|
+#define HAL_CE_REMAP_REG_BASE (ab->ce_remap_base_addr)
|
|
+
|
|
#define HAL_LINK_DESC_SIZE (32 << 2)
|
|
#define HAL_LINK_DESC_ALIGN 128
|
|
#define HAL_NUM_MPDUS_PER_LINK_DESC 6
|
|
@@ -28,6 +30,7 @@ struct ath11k_base;
|
|
#define HAL_WBM_IDLE_SCATTER_BUF_SIZE (HAL_WBM_IDLE_SCATTER_BUF_SIZE_MAX - \
|
|
HAL_WBM_IDLE_SCATTER_NEXT_PTR_SIZE)
|
|
|
|
+#define HAL_IPQ5018_DSCP_TID_MAP_TBL_NUM_ENTRIES_MAX 32
|
|
#define HAL_DSCP_TID_MAP_TBL_NUM_ENTRIES_MAX 48
|
|
#define HAL_DSCP_TID_TBL_SIZE 24
|
|
|
|
@@ -121,6 +124,7 @@ struct ath11k_base;
|
|
#define HAL_REO1_DEST_RING_CTRL_IX_1 0x00000008
|
|
#define HAL_REO1_DEST_RING_CTRL_IX_2 0x0000000c
|
|
#define HAL_REO1_DEST_RING_CTRL_IX_3 0x00000010
|
|
+#define HAL_REO1_R0_MISC_CTL 0x000005d8
|
|
#define HAL_REO1_MISC_CTL(ab) ab->hw_params.regs->hal_reo1_misc_ctl
|
|
#define HAL_REO1_RING_BASE_LSB(ab) ab->hw_params.regs->hal_reo1_ring_base_lsb
|
|
#define HAL_REO1_RING_BASE_MSB(ab) ab->hw_params.regs->hal_reo1_ring_base_msb
|
|
@@ -285,6 +289,7 @@ struct ath11k_base;
|
|
#define HAL_REO1_GEN_ENABLE_AGING_LIST_ENABLE BIT(2)
|
|
#define HAL_REO1_GEN_ENABLE_AGING_FLUSH_ENABLE BIT(3)
|
|
#define HAL_REO1_MISC_CTL_FRAGMENT_DST_RING GENMASK(20, 17)
|
|
+#define HAL_IPQ5018_REO1_MISC_CTL_FRAGMENT_DEST_RING GENMASK(19, 17)
|
|
|
|
/* CE ring bit field mask and shift */
|
|
#define HAL_CE_DST_R0_DEST_CTRL_MAX_LEN GENMASK(15, 0)
|
|
@@ -321,6 +326,10 @@ struct ath11k_base;
|
|
#define HAL_WBM2SW_RELEASE_RING_BASE_MSB_RING_SIZE 0x000fffff
|
|
#define HAL_RXDMA_RING_MAX_SIZE 0x0000ffff
|
|
|
|
+/* IPQ5018 ce registers */
|
|
+#define HAL_IPQ5018_CE_WFSS_REG_BASE 0x08400000
|
|
+#define HAL_IPQ5018_CE_SIZE 0x200000
|
|
+
|
|
/* Add any other errors here and return them in
|
|
* ath11k_hal_rx_desc_get_err().
|
|
*/
|
|
@@ -520,6 +529,7 @@ enum hal_srng_dir {
|
|
#define HAL_SRNG_FLAGS_MSI_INTR 0x00020000
|
|
#define HAL_SRNG_FLAGS_CACHED 0x20000000
|
|
#define HAL_SRNG_FLAGS_LMAC_RING 0x80000000
|
|
+#define HAL_SRNG_FLAGS_REMAP_CE_RING 0x10000000
|
|
|
|
#define HAL_SRNG_TLV_HDR_TAG GENMASK(9, 1)
|
|
#define HAL_SRNG_TLV_HDR_LEN GENMASK(25, 10)
|
|
--- a/drivers/net/wireless/ath/ath11k/qmi.h
|
|
+++ b/drivers/net/wireless/ath/ath11k/qmi.h
|
|
@@ -34,6 +34,7 @@
|
|
#define ATH11K_QMI_DEFAULT_QDSS_CONFIG_FILE_NAME "qdss_trace_config.bin"
|
|
#define ATH11K_QMI_IPQ8074_M3_DUMP_ADDRESS 0x51000000
|
|
#define ATH11K_QMI_IPQ6018_M3_DUMP_ADDRESS 0x50100000
|
|
+#define ATH11K_QMI_IPQ5018_M3_DUMP_ADDRESS 0x4C800000
|
|
#define ATH11K_QMI_M3_DUMP_SIZE 0x100000
|
|
|
|
#define QMI_WLFW_REQUEST_MEM_IND_V01 0x0035
|