mirror of
https://github.com/rd-stuffs/msm-4.14.git
synced 2025-02-20 11:45:48 +08:00
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:
parent
2451522301
commit
7b304439c6
@ -446,7 +446,7 @@ int ipa3_conn_wdi3_pipes(struct ipa_wdi_conn_in_params *in,
|
||||
int result = 0;
|
||||
u32 gsi_db_addr_low, gsi_db_addr_high;
|
||||
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 */
|
||||
if (ipa3_get_wdi_version() != IPA_WDI_3) {
|
||||
@ -612,11 +612,18 @@ int ipa3_conn_wdi3_pipes(struct ipa_wdi_conn_in_params *in,
|
||||
* initialization of the event, with a value that is
|
||||
* outside of the ring range. Eg: ring base = 0x1000,
|
||||
* 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,
|
||||
&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 */
|
||||
db_addr = ioremap((phys_addr_t)(evt_ring_db_addr_low), 4);
|
||||
@ -626,9 +633,16 @@ int ipa3_conn_wdi3_pipes(struct ipa_wdi_conn_in_params *in,
|
||||
* outside of the ring range. Eg: ring base = 0x1000,
|
||||
* ring size = 0x100 => AP can write value > 0x1100
|
||||
* 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 += 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:
|
||||
IPA_ACTIVE_CLIENTS_DEC_SIMPLE();
|
||||
return result;
|
||||
|
Loading…
x
Reference in New Issue
Block a user