msm: ipa: Fix updating the doobell for WDI3
For WDI3, requirement is to ring the event ring DB with a value outside of the ring. Currently we are taking the event_ring_size from non SMMU structure which is incorrect. Make a chane to use the value based on SMMU enablement. Also make change to ring the DB with the below logic. Event ring base addr + Event ring size + 1 element size. Change-Id: Ie9e4cad63070d1488d0a36f9d08279d2d566055a Signed-off-by: Chaitanya Pratapa <cpratapa@codeaurora.org>
This commit is contained in:
@@ -459,7 +459,7 @@ int ipa3_conn_wdi3_pipes(struct ipa_wdi_conn_in_params *in,
|
|||||||
int result = 0;
|
int result = 0;
|
||||||
u32 gsi_db_addr_low, gsi_db_addr_high;
|
u32 gsi_db_addr_low, gsi_db_addr_high;
|
||||||
void __iomem *db_addr;
|
void __iomem *db_addr;
|
||||||
u32 evt_ring_db_addr_low, evt_ring_db_addr_high;
|
u32 evt_ring_db_addr_low, evt_ring_db_addr_high, db_val = 0;
|
||||||
|
|
||||||
/* wdi3 only support over gsi */
|
/* wdi3 only support over gsi */
|
||||||
if (!ipa3_ctx->ipa_wdi3_over_gsi) {
|
if (!ipa3_ctx->ipa_wdi3_over_gsi) {
|
||||||
@@ -627,11 +627,18 @@ int ipa3_conn_wdi3_pipes(struct ipa_wdi_conn_in_params *in,
|
|||||||
* initialization of the event, with a value that is
|
* initialization of the event, with a value that is
|
||||||
* outside of the ring range. Eg: ring base = 0x1000,
|
* outside of the ring range. Eg: ring base = 0x1000,
|
||||||
* ring size = 0x100 => AP can write value > 0x1100
|
* ring size = 0x100 => AP can write value > 0x1100
|
||||||
* into the doorbell address. Eg: 0x 1110
|
* into the doorbell address. Eg: 0x 1110.
|
||||||
|
* Use event ring base addr + event ring size + 1 element size.
|
||||||
*/
|
*/
|
||||||
iowrite32(in->u_rx.rx.event_ring_size / 4 + 10, db_addr);
|
db_val = (u32)ep_rx->gsi_mem_info.evt_ring_base_addr;
|
||||||
|
db_val += ((in->is_smmu_enabled) ? in->u_rx.rx_smmu.event_ring_size :
|
||||||
|
in->u_rx.rx.event_ring_size);
|
||||||
|
db_val += GSI_EVT_RING_RE_SIZE_8B;
|
||||||
|
iowrite32(db_val, db_addr);
|
||||||
gsi_query_evt_ring_db_addr(ep_tx->gsi_evt_ring_hdl,
|
gsi_query_evt_ring_db_addr(ep_tx->gsi_evt_ring_hdl,
|
||||||
&evt_ring_db_addr_low, &evt_ring_db_addr_high);
|
&evt_ring_db_addr_low, &evt_ring_db_addr_high);
|
||||||
|
IPADBG("RX base_addr 0x%x evt wp val: 0x%x\n",
|
||||||
|
ep_rx->gsi_mem_info.evt_ring_base_addr, db_val);
|
||||||
|
|
||||||
/* only 32 bit lsb is used */
|
/* only 32 bit lsb is used */
|
||||||
db_addr = ioremap((phys_addr_t)(evt_ring_db_addr_low), 4);
|
db_addr = ioremap((phys_addr_t)(evt_ring_db_addr_low), 4);
|
||||||
@@ -641,9 +648,17 @@ int ipa3_conn_wdi3_pipes(struct ipa_wdi_conn_in_params *in,
|
|||||||
* outside of the ring range. Eg: ring base = 0x1000,
|
* outside of the ring range. Eg: ring base = 0x1000,
|
||||||
* ring size = 0x100 => AP can write value > 0x1100
|
* ring size = 0x100 => AP can write value > 0x1100
|
||||||
* into the doorbell address. Eg: 0x 1110
|
* into the doorbell address. Eg: 0x 1110
|
||||||
|
* Use event ring base addr + event ring size + 1 element size.
|
||||||
*/
|
*/
|
||||||
iowrite32(in->u_tx.tx.event_ring_size / 4 + 10, db_addr);
|
db_val = (u32)ep_tx->gsi_mem_info.evt_ring_base_addr;
|
||||||
|
db_val += ((in->is_smmu_enabled) ? in->u_tx.tx_smmu.event_ring_size :
|
||||||
|
in->u_tx.tx.event_ring_size);
|
||||||
|
db_val += ((ipa3_ctx->ipa_hw_type >= IPA_HW_v4_9) ?
|
||||||
|
GSI_EVT_RING_RE_SIZE_32B : GSI_EVT_RING_RE_SIZE_16B);
|
||||||
|
iowrite32(db_val, db_addr);
|
||||||
|
IPADBG("db_addr %u TX base_addr 0x%x evt wp val: 0x%x\n",
|
||||||
|
evt_ring_db_addr_low,
|
||||||
|
ep_tx->gsi_mem_info.evt_ring_base_addr, db_val);
|
||||||
fail:
|
fail:
|
||||||
IPA_ACTIVE_CLIENTS_DEC_SIMPLE();
|
IPA_ACTIVE_CLIENTS_DEC_SIMPLE();
|
||||||
return result;
|
return result;
|
||||||
|
Reference in New Issue
Block a user