qcacmn: Fix IPA WDI3 Tx issues

Fix bug to enable IPA WDI3 Tx H/W path.

Change-Id: Ice691dccc649b38971985cd8da042719d943cec7
CRs-Fixed: 2085751
This commit is contained in:
Yun Park 2017-08-28 21:49:31 -07:00 • committed by snandini
commit 601d0d868a
10 changed files with 447 additions and 344 deletions

View file

@ -338,11 +338,18 @@ extern void *hal_srng_setup(void *hal_soc, int ring_type, int ring_num,
extern void hal_reo_remap_IX0(struct hal_soc *hal, uint32_t remap_val);
/**
* hal_srng_set_hp_paddr() - Set physical address to SRNG head pointer
* hal_srng_set_hp_paddr() - Set physical address to dest SRNG head pointer
* @sring: sring pointer
* @paddr: physical address
*/
extern void hal_srng_set_hp_paddr(struct hal_srng *sring, uint64_t paddr);
extern void hal_srng_dst_set_hp_paddr(struct hal_srng *sring, uint64_t paddr);
/**
* hal_srng_dst_init_hp() - Initilaize head pointer with cached head pointer
* @srng: sring pointer
* @vaddr: virtual address
*/
extern void hal_srng_dst_init_hp(struct hal_srng *srng, uint32_t *vaddr);
/**
* hal_srng_cleanup - Deinitialize HW SRNG ring.
@ -429,6 +436,37 @@ static inline void *hal_srng_dst_get_next(void *hal_soc, void *hal_ring)
return NULL;
}
/**
* hal_srng_dst_get_next_hp - Get next entry from a destination ring and move
* cached head pointer
*
* @hal_soc: Opaque HAL SOC handle
* @hal_ring: Destination ring pointer
*
* Return: Opaque pointer for next ring entry; NULL on failire
*/
static inline void *hal_srng_dst_get_next_hp(void *hal_soc, void *hal_ring)
{
struct hal_srng *srng = (struct hal_srng *)hal_ring;
uint32_t *desc;
/* TODO: Using % is expensive, but we have to do this since
* size of some SRNG rings is not power of 2 (due to descriptor
* sizes). Need to create separate API for rings used
* per-packet, with sizes power of 2 (TCL2SW, REO2SW,
* SW2RXDMA and CE rings)
*/
uint32_t next_hp = (srng->u.dst_ring.cached_hp + srng->entry_size) %
srng->ring_size;
if (next_hp != srng->u.dst_ring.tp) {
desc = &(srng->ring_base_vaddr[srng->u.dst_ring.cached_hp]);
srng->u.dst_ring.cached_hp = next_hp;
return (void *)desc;
}
return NULL;
}
/**
* hal_srng_dst_peek - Get next entry from a ring without moving tail pointer.
* hal_srng_dst_get_next should be called subsequently to move the tail pointer
@ -755,6 +793,7 @@ static inline void hal_srng_access_end(void *hal_soc, void *hal_ring)
static inline void hal_srng_access_end_reap(void *hal_soc, void *hal_ring)
{
struct hal_srng *srng = (struct hal_srng *)hal_ring;
SRNG_UNLOCK(&(srng->lock));
}

View file

@ -967,18 +967,37 @@ void hal_reo_remap_IX0(struct hal_soc *hal, uint32_t remap_val)
}
/**
* hal_srng_set_hp_paddr() - Set physical address to SRNG head pointer
* @sring: sring pointer
* hal_srng_dst_set_hp_paddr() - Set physical address to dest ring head pointer
* @srng: sring pointer
* @paddr: physical address
*/
void hal_srng_set_hp_paddr(struct hal_srng *sring,
uint64_t paddr)
void hal_srng_dst_set_hp_paddr(struct hal_srng *srng,
uint64_t paddr)
{
SRNG_DST_REG_WRITE(sring, HP_ADDR_LSB,
SRNG_DST_REG_WRITE(srng, HP_ADDR_LSB,
paddr & 0xffffffff);
SRNG_DST_REG_WRITE(sring, HP_ADDR_MSB,
SRNG_DST_REG_WRITE(srng, HP_ADDR_MSB,
paddr >> 32);
}
/**
* hal_srng_dst_init_hp() - Initilaize destination ring head pointer
* @srng: sring pointer
* @vaddr: virtual address
*/
void hal_srng_dst_init_hp(struct hal_srng *srng,
uint32_t *vaddr)
{
srng->u.dst_ring.hp_addr = vaddr;
SRNG_DST_REG_WRITE(srng, HP, srng->u.dst_ring.cached_hp);
*(srng->u.dst_ring.hp_addr) = srng->u.dst_ring.cached_hp;
QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_ERROR,
"hp_addr=%p, cached_hp=%d, hp=%d\n",
(void *)srng->u.dst_ring.hp_addr, srng->u.dst_ring.cached_hp,
*(srng->u.dst_ring.hp_addr));
}
/**
* hal_srng_dst_hw_init - Private function to initialize SRNG
* destination ring HW