|
@@ -261,6 +261,8 @@ static inline void hal_write32_mb(struct hal_soc *hal_soc, uint32_t offset,
|
|
|
|
|
|
#define hal_write32_mb_confirm(_hal_soc, _offset, _value) \
|
|
#define hal_write32_mb_confirm(_hal_soc, _offset, _value) \
|
|
hal_write32_mb(_hal_soc, _offset, _value)
|
|
hal_write32_mb(_hal_soc, _offset, _value)
|
|
|
|
+
|
|
|
|
+#define hal_write32_mb_cmem(_hal_soc, _offset, _value)
|
|
#else
|
|
#else
|
|
static inline void hal_write32_mb(struct hal_soc *hal_soc, uint32_t offset,
|
|
static inline void hal_write32_mb(struct hal_soc *hal_soc, uint32_t offset,
|
|
uint32_t value)
|
|
uint32_t value)
|
|
@@ -386,6 +388,35 @@ static inline void hal_write32_mb_confirm(struct hal_soc *hal_soc,
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+static inline void hal_write32_mb_cmem(struct hal_soc *hal_soc, uint32_t offset,
|
|
|
|
+ uint32_t value)
|
|
|
|
+{
|
|
|
|
+ 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;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (!hal_soc->use_register_windowing ||
|
|
|
|
+ offset < MAX_UNWINDOWED_ADDRESS) {
|
|
|
|
+ qdf_iowrite32(hal_soc->dev_base_addr + offset, value);
|
|
|
|
+ } else if (hal_soc->static_window_map) {
|
|
|
|
+ new_addr = hal_get_window_address(
|
|
|
|
+ hal_soc,
|
|
|
|
+ hal_soc->dev_base_addr + offset);
|
|
|
|
+ qdf_iowrite32(new_addr, value);
|
|
|
|
+ } else {
|
|
|
|
+ hal_lock_reg_access(hal_soc, &flags);
|
|
|
|
+ hal_select_window_confirm(hal_soc, offset);
|
|
|
|
+ qdf_iowrite32(hal_soc->dev_base_addr + WINDOW_START +
|
|
|
|
+ (offset & WINDOW_RANGE_MASK), value);
|
|
|
|
+ hal_unlock_reg_access(hal_soc, &flags);
|
|
|
|
+ }
|
|
|
|
+}
|
|
#endif
|
|
#endif
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -481,6 +512,8 @@ static inline uint32_t hal_read32_mb(struct hal_soc *hal_soc, uint32_t offset)
|
|
|
|
|
|
return ret;
|
|
return ret;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+#define hal_read32_mb_cmem(_hal_soc, _offset)
|
|
#else
|
|
#else
|
|
static
|
|
static
|
|
uint32_t hal_read32_mb(struct hal_soc *hal_soc, uint32_t offset)
|
|
uint32_t hal_read32_mb(struct hal_soc *hal_soc, uint32_t offset)
|
|
@@ -531,6 +564,37 @@ uint32_t hal_read32_mb(struct hal_soc *hal_soc, uint32_t offset)
|
|
|
|
|
|
return ret;
|
|
return ret;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+static inline
|
|
|
|
+uint32_t hal_read32_mb_cmem(struct hal_soc *hal_soc, uint32_t offset)
|
|
|
|
+{
|
|
|
|
+ uint32_t ret;
|
|
|
|
+ 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;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (!hal_soc->use_register_windowing ||
|
|
|
|
+ offset < MAX_UNWINDOWED_ADDRESS) {
|
|
|
|
+ ret = qdf_ioread32(hal_soc->dev_base_addr + offset);
|
|
|
|
+ } else if (hal_soc->static_window_map) {
|
|
|
|
+ new_addr = hal_get_window_address(
|
|
|
|
+ hal_soc,
|
|
|
|
+ hal_soc->dev_base_addr + offset);
|
|
|
|
+ ret = qdf_ioread32(new_addr);
|
|
|
|
+ } else {
|
|
|
|
+ hal_lock_reg_access(hal_soc, &flags);
|
|
|
|
+ hal_select_window_confirm(hal_soc, offset);
|
|
|
|
+ ret = qdf_ioread32(hal_soc->dev_base_addr + WINDOW_START +
|
|
|
|
+ (offset & WINDOW_RANGE_MASK));
|
|
|
|
+ hal_unlock_reg_access(hal_soc, &flags);
|
|
|
|
+ }
|
|
|
|
+ return ret;
|
|
|
|
+}
|
|
#endif
|
|
#endif
|
|
|
|
|
|
/* Max times allowed for register writing retry */
|
|
/* Max times allowed for register writing retry */
|