qcacmn: Check target ready before accessing registers on qca6750
Before accessing any register on chip 6750, check if target is ready or not. Do not allow register access if target is not ready. Change-Id: I41a604d04e861c97bdd676998222ccecbf12fd5a CRs-Fixed: 2688920
This commit is contained in:
@@ -269,6 +269,12 @@ static inline void hal_write32_mb(struct hal_soc *hal_soc, uint32_t offset,
|
||||
unsigned long flags;
|
||||
qdf_iomem_t new_addr;
|
||||
|
||||
if (!TARGET_ACCESS_ALLOWED(HIF_GET_SOFTC(
|
||||
hal_soc->hif_handle))) {
|
||||
hal_err_rl("%s: target access is not allowed", __func__);
|
||||
return;
|
||||
}
|
||||
|
||||
/* Region < BAR + 4K can be directly accessed */
|
||||
if (offset < MAPPED_REF_OFF) {
|
||||
qdf_iowrite32(hal_soc->dev_base_addr + offset, value);
|
||||
@@ -323,6 +329,12 @@ static inline void hal_write32_mb_confirm(struct hal_soc *hal_soc,
|
||||
unsigned long flags;
|
||||
qdf_iomem_t new_addr;
|
||||
|
||||
if (!TARGET_ACCESS_ALLOWED(HIF_GET_SOFTC(
|
||||
hal_soc->hif_handle))) {
|
||||
hal_err_rl("%s: target access is not allowed", __func__);
|
||||
return;
|
||||
}
|
||||
|
||||
/* Region < BAR + 4K can be directly accessed */
|
||||
if (offset < MAPPED_REF_OFF) {
|
||||
qdf_iowrite32(hal_soc->dev_base_addr + offset, value);
|
||||
@@ -477,6 +489,12 @@ uint32_t hal_read32_mb(struct hal_soc *hal_soc, uint32_t offset)
|
||||
unsigned long flags;
|
||||
qdf_iomem_t new_addr;
|
||||
|
||||
if (!TARGET_ACCESS_ALLOWED(HIF_GET_SOFTC(
|
||||
hal_soc->hif_handle))) {
|
||||
hal_err_rl("%s: target access is not allowed", __func__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Region < BAR + 4K can be directly accessed */
|
||||
if (offset < MAPPED_REF_OFF)
|
||||
return qdf_ioread32(hal_soc->dev_base_addr + offset);
|
||||
|
Reference in New Issue
Block a user