slim_ngd: Re-initialize Slimbus NGD controller when ADSP restarts
Slimbus manager HW is controlled from ADSP. When ADSP restarts, NGD
controller goes in inactive state, and BAM pipes are disconnected.
When ADSP comes up later, controller is re-initialized and all slaves
on this controller are re-assigned logical address. BAM pipes are
reconnected as well. These steps are done after ADSP slimbus HW
informs NGD controller that it has come up.
CRs-Fixed: 419384
Change-Id: Ic1ba1fe14adeb9661de3735a0afc8e4b05fa4606
Signed-off-by: Sagar Dharia <sdharia@codeaurora.org>
diff --git a/drivers/slimbus/slim-msm.c b/drivers/slimbus/slim-msm.c
index 137f85e..72a8669 100644
--- a/drivers/slimbus/slim-msm.c
+++ b/drivers/slimbus/slim-msm.c
@@ -517,6 +517,8 @@
},
};
+ if (dev->bam.hdl)
+ goto init_rx_msgq;
bam_props.ee = dev->ee;
bam_props.virt_addr = dev->bam.base;
bam_props.phys_addr = bam_mem->start;
@@ -565,7 +567,7 @@
return ret;
}
-void msm_slim_sps_exit(struct msm_slim_ctrl *dev)
+void msm_slim_sps_exit(struct msm_slim_ctrl *dev, bool dereg)
{
if (dev->use_rx_msgqs) {
struct msm_slim_endp *endpoint = &dev->rx_msgq;
@@ -579,7 +581,10 @@
sps_disconnect(endpoint->sps);
msm_slim_sps_mem_free(dev, descr);
msm_slim_free_endpoint(endpoint);
+ }
+ if (dereg) {
sps_deregister_bam_device(dev->bam.hdl);
+ dev->bam.hdl = 0L;
}
}