qcacmn: write DEST_MAX_LENGTH for CE rings

Change that allows configuration of max buffer
size for SRNG rings in the receive direction

Change-Id: Ib857f1fdf43c849078f9470ec029fe627379fcb4
CRs-Fixed: 1089874
This commit is contained in:
Houston Hoffman
2016-10-21 14:58:34 -07:00
committed by qcabuildsw
parent f7bc308404
commit 74109127d0
4 changed files with 43 additions and 4 deletions

View File

@@ -667,6 +667,31 @@ static inline void hal_srng_src_hw_init(struct hal_soc *hal,
*(srng->u.src_ring.tp_addr) = 0;
}
/**
* hal_ce_dst_setup - Initialize CE destination ring registers
* @hal_soc: HAL SOC handle
* @srng: SRNG ring pointer
*/
static inline void hal_ce_dst_setup(struct hal_soc *hal, struct hal_srng *srng,
int ring_num)
{
uint32_t reg_val = 0;
uint32_t reg_addr;
struct hal_hw_srng_config *ring_config =
HAL_SRNG_CONFIG(hal, CE_DST);
/* set DEST_MAX_LENGTH according to ce assignment */
reg_addr = HWIO_WFSS_CE_CHANNEL_DST_R0_DEST_CTRL_ADDR(
ring_config->reg_start[R0_INDEX] +
(ring_num * ring_config->reg_size[R0_INDEX]));
reg_val = HAL_REG_READ(hal, reg_addr);
reg_val &= ~HWIO_WFSS_CE_CHANNEL_DST_R0_DEST_CTRL_DEST_MAX_LENGTH_BMSK;
reg_val |= srng->u.dst_ring.max_buffer_length &
HWIO_WFSS_CE_CHANNEL_DST_R0_DEST_CTRL_DEST_MAX_LENGTH_BMSK;
HAL_REG_WRITE(hal, reg_addr, reg_val);
}
/**
* hal_srng_dst_hw_init - Private function to initialize SRNG
* destination ring HW
@@ -889,9 +914,16 @@ void *hal_srng_setup(void *hal_soc, int ring_type, int ring_num,
}
}
if (!(ring_config->lmac_ring))
if (!(ring_config->lmac_ring)) {
hal_srng_hw_init(hal, srng);
if (ring_type == CE_DST) {
srng->u.dst_ring.max_buffer_length = ring_params->max_buffer_length;
hal_ce_dst_setup(hal, srng, ring_num);
}
}
SRNG_LOCK_INIT(&srng->lock);
return (void *)srng;