|
@@ -1118,12 +1118,128 @@ ce_per_engine_handler_adjust_legacy(struct CE_state *CE_state,
|
|
Q_TARGET_ACCESS_END(scn);
|
|
Q_TARGET_ACCESS_END(scn);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+#ifdef QCA_WIFI_WCN6450
|
|
|
|
+static void ce_legacy_msi_param_setup(struct hif_softc *scn, uint32_t ctrl_addr,
|
|
|
|
+ uint32_t ce_id, struct CE_attr *attr)
|
|
|
|
+{
|
|
|
|
+ uint32_t addr_low;
|
|
|
|
+ uint32_t addr_high;
|
|
|
|
+ uint32_t msi_data_start;
|
|
|
|
+ uint32_t msi_data_count;
|
|
|
|
+ uint32_t msi_irq_start;
|
|
|
|
+ uint32_t tmp;
|
|
|
|
+ int ret;
|
|
|
|
+ int irq_id;
|
|
|
|
+
|
|
|
|
+ ret = pld_get_user_msi_assignment(scn->qdf_dev->dev, "CE",
|
|
|
|
+ &msi_data_count, &msi_data_start,
|
|
|
|
+ &msi_irq_start);
|
|
|
|
+
|
|
|
|
+ /* msi config not found */
|
|
|
|
+ if (ret) {
|
|
|
|
+ hif_debug("%s: failed to get user msi assignment ret %d",
|
|
|
|
+ __func__, ret);
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ irq_id = scn->int_assignment->msi_idx[ce_id];
|
|
|
|
+ pld_get_msi_address(scn->qdf_dev->dev, &addr_low, &addr_high);
|
|
|
|
+
|
|
|
|
+ CE_MSI_ADDR_LOW_SET(scn, ctrl_addr, addr_low);
|
|
|
|
+ tmp = CE_MSI_ADDR_HIGH_GET(scn, ctrl_addr);
|
|
|
|
+ tmp &= ~CE_RING_BASE_ADDR_HIGH_MASK;
|
|
|
|
+ tmp |= (addr_high & CE_RING_BASE_ADDR_HIGH_MASK);
|
|
|
|
+ CE_MSI_ADDR_HIGH_SET(scn, ctrl_addr, tmp);
|
|
|
|
+ CE_MSI_DATA_SET(scn, ctrl_addr, irq_id + msi_data_start);
|
|
|
|
+ CE_MSI_EN_SET(scn, ctrl_addr);
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+static void ce_legacy_src_intr_thres_setup(struct hif_softc *scn,
|
|
|
|
+ uint32_t ctrl_addr,
|
|
|
|
+ struct CE_attr *attr,
|
|
|
|
+ uint32_t timer_thrs,
|
|
|
|
+ uint32_t count_thrs)
|
|
|
|
+{
|
|
|
|
+ uint32_t tmp;
|
|
|
|
+
|
|
|
|
+ tmp = CE_CHANNEL_SRC_BATCH_TIMER_INT_SETUP_GET(scn, ctrl_addr);
|
|
|
|
+
|
|
|
|
+ if (count_thrs) {
|
|
|
|
+ tmp &= ~(CE_SRC_BATCH_COUNTER_THRESH_MASK <<
|
|
|
|
+ CE_SRC_BATCH_COUNTER_THRESH_LSB);
|
|
|
|
+ tmp |= ((count_thrs & CE_SRC_BATCH_COUNTER_THRESH_MASK) <<
|
|
|
|
+ CE_SRC_BATCH_COUNTER_THRESH_LSB);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (timer_thrs) {
|
|
|
|
+ tmp &= ~(CE_SRC_BATCH_TIMER_THRESH_MASK <<
|
|
|
|
+ CE_SRC_BATCH_TIMER_THRESH_LSB);
|
|
|
|
+ tmp |= ((timer_thrs & CE_SRC_BATCH_TIMER_THRESH_MASK) <<
|
|
|
|
+ CE_SRC_BATCH_TIMER_THRESH_LSB);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ CE_CHANNEL_SRC_BATCH_TIMER_INT_SETUP(scn, ctrl_addr, tmp);
|
|
|
|
+ CE_CHANNEL_SRC_TIMER_BATCH_INT_EN(scn, ctrl_addr);
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+static void ce_legacy_dest_intr_thres_setup(struct hif_softc *scn,
|
|
|
|
+ uint32_t ctrl_addr,
|
|
|
|
+ struct CE_attr *attr,
|
|
|
|
+ uint32_t timer_thrs,
|
|
|
|
+ uint32_t count_thrs)
|
|
|
|
+{
|
|
|
|
+ uint32_t tmp;
|
|
|
|
+
|
|
|
|
+ tmp = CE_CHANNEL_DST_BATCH_TIMER_INT_SETUP_GET(scn, ctrl_addr);
|
|
|
|
+
|
|
|
|
+ if (count_thrs) {
|
|
|
|
+ tmp &= ~(CE_DST_BATCH_COUNTER_THRESH_MASK <<
|
|
|
|
+ CE_DST_BATCH_COUNTER_THRESH_LSB);
|
|
|
|
+ tmp |= ((count_thrs & CE_DST_BATCH_COUNTER_THRESH_MASK) <<
|
|
|
|
+ CE_DST_BATCH_COUNTER_THRESH_LSB);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (timer_thrs) {
|
|
|
|
+ tmp &= ~(CE_DST_BATCH_TIMER_THRESH_MASK <<
|
|
|
|
+ CE_DST_BATCH_TIMER_THRESH_LSB);
|
|
|
|
+ tmp |= ((timer_thrs & CE_DST_BATCH_TIMER_THRESH_MASK) <<
|
|
|
|
+ CE_DST_BATCH_TIMER_THRESH_LSB);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ CE_CHANNEL_DST_BATCH_TIMER_INT_SETUP(scn, ctrl_addr, tmp);
|
|
|
|
+ CE_CHANNEL_DST_TIMER_BATCH_INT_EN(scn, ctrl_addr);
|
|
|
|
+}
|
|
|
|
+#else
|
|
|
|
+static void ce_legacy_msi_param_setup(struct hif_softc *scn, uint32_t ctrl_addr,
|
|
|
|
+ uint32_t ce_id, struct CE_attr *attr)
|
|
|
|
+{
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+static void ce_legacy_src_intr_thres_setup(struct hif_softc *scn,
|
|
|
|
+ uint32_t ctrl_addr,
|
|
|
|
+ struct CE_attr *attr,
|
|
|
|
+ uint32_t timer_thrs,
|
|
|
|
+ uint32_t count_thrs)
|
|
|
|
+{
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+static void ce_legacy_dest_intr_thres_setup(struct hif_softc *scn,
|
|
|
|
+ uint32_t ctrl_addr,
|
|
|
|
+ struct CE_attr *attr,
|
|
|
|
+ uint32_t timer_thrs,
|
|
|
|
+ uint32_t count_thrs)
|
|
|
|
+{
|
|
|
|
+}
|
|
|
|
+#endif /* QCA_WIFI_WCN6450 */
|
|
|
|
+
|
|
static void ce_legacy_src_ring_setup(struct hif_softc *scn, uint32_t ce_id,
|
|
static void ce_legacy_src_ring_setup(struct hif_softc *scn, uint32_t ce_id,
|
|
struct CE_ring_state *src_ring,
|
|
struct CE_ring_state *src_ring,
|
|
struct CE_attr *attr)
|
|
struct CE_attr *attr)
|
|
{
|
|
{
|
|
uint32_t ctrl_addr;
|
|
uint32_t ctrl_addr;
|
|
uint64_t dma_addr;
|
|
uint64_t dma_addr;
|
|
|
|
+ uint32_t timer_thrs;
|
|
|
|
+ uint32_t count_thrs;
|
|
|
|
|
|
QDF_ASSERT(ce_id < scn->ce_count);
|
|
QDF_ASSERT(ce_id < scn->ce_count);
|
|
ctrl_addr = CE_BASE_ADDRESS(ce_id);
|
|
ctrl_addr = CE_BASE_ADDRESS(ce_id);
|
|
@@ -1157,6 +1273,17 @@ static void ce_legacy_src_ring_setup(struct hif_softc *scn, uint32_t ce_id,
|
|
#endif
|
|
#endif
|
|
CE_SRC_RING_LOWMARK_SET(scn, ctrl_addr, 0);
|
|
CE_SRC_RING_LOWMARK_SET(scn, ctrl_addr, 0);
|
|
CE_SRC_RING_HIGHMARK_SET(scn, ctrl_addr, src_ring->nentries);
|
|
CE_SRC_RING_HIGHMARK_SET(scn, ctrl_addr, src_ring->nentries);
|
|
|
|
+
|
|
|
|
+ if (!(CE_ATTR_DISABLE_INTR & attr->flags)) {
|
|
|
|
+ /* In 8us units */
|
|
|
|
+ timer_thrs = CE_SRC_BATCH_TIMER_THRESHOLD >> 3;
|
|
|
|
+ /* Batch counter threshold 1 in Dwrod units */
|
|
|
|
+ count_thrs = (CE_SRC_BATCH_COUNTER_THRESHOLD *
|
|
|
|
+ (sizeof(struct CE_src_desc) >> 2));
|
|
|
|
+ ce_legacy_msi_param_setup(scn, ctrl_addr, ce_id, attr);
|
|
|
|
+ ce_legacy_src_intr_thres_setup(scn, ctrl_addr, attr,
|
|
|
|
+ timer_thrs, count_thrs);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
static void ce_legacy_dest_ring_setup(struct hif_softc *scn, uint32_t ce_id,
|
|
static void ce_legacy_dest_ring_setup(struct hif_softc *scn, uint32_t ce_id,
|
|
@@ -1165,6 +1292,8 @@ static void ce_legacy_dest_ring_setup(struct hif_softc *scn, uint32_t ce_id,
|
|
{
|
|
{
|
|
uint32_t ctrl_addr;
|
|
uint32_t ctrl_addr;
|
|
uint64_t dma_addr;
|
|
uint64_t dma_addr;
|
|
|
|
+ uint32_t timer_thrs;
|
|
|
|
+ uint32_t count_thrs;
|
|
|
|
|
|
QDF_ASSERT(ce_id < scn->ce_count);
|
|
QDF_ASSERT(ce_id < scn->ce_count);
|
|
ctrl_addr = CE_BASE_ADDRESS(ce_id);
|
|
ctrl_addr = CE_BASE_ADDRESS(ce_id);
|
|
@@ -1196,6 +1325,17 @@ static void ce_legacy_dest_ring_setup(struct hif_softc *scn, uint32_t ce_id,
|
|
#endif
|
|
#endif
|
|
CE_DEST_RING_LOWMARK_SET(scn, ctrl_addr, 0);
|
|
CE_DEST_RING_LOWMARK_SET(scn, ctrl_addr, 0);
|
|
CE_DEST_RING_HIGHMARK_SET(scn, ctrl_addr, dest_ring->nentries);
|
|
CE_DEST_RING_HIGHMARK_SET(scn, ctrl_addr, dest_ring->nentries);
|
|
|
|
+
|
|
|
|
+ if (!(CE_ATTR_DISABLE_INTR & attr->flags)) {
|
|
|
|
+ /* In 8us units */
|
|
|
|
+ timer_thrs = CE_DST_BATCH_TIMER_THRESHOLD >> 3;
|
|
|
|
+ /* Batch counter threshold 1 in Dwrod units */
|
|
|
|
+ count_thrs = CE_DST_BATCH_COUNTER_THRESHOLD;
|
|
|
|
+
|
|
|
|
+ ce_legacy_msi_param_setup(scn, ctrl_addr, ce_id, attr);
|
|
|
|
+ ce_legacy_dest_intr_thres_setup(scn, ctrl_addr, attr,
|
|
|
|
+ timer_thrs, count_thrs);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
static uint32_t ce_get_desc_size_legacy(uint8_t ring_type)
|
|
static uint32_t ce_get_desc_size_legacy(uint8_t ring_type)
|