qcacld-3.0: Skip bmi and ramdump at runtime

Need to support SNOC and PCI dynamically.
Core BSP code is responsible for SNOC firmware
loading and crash dumps.

Change-Id: Ia16076809f2b74be6f32ad5015b79b1fe2c13ca3
CRs-Fixed: 986480
This commit is contained in:
Houston Hoffman
2016-02-12 17:10:24 -08:00
committed by Gerrit - the friendly Code Review server
parent ab091116bf
commit 9a547dc0bc
5 changed files with 44 additions and 33 deletions

2
Kbuild
View File

@@ -624,7 +624,6 @@ BMI_DIR := core/bmi
BMI_INC := -I$(WLAN_ROOT)/$(BMI_DIR)/inc
ifneq ($(CONFIG_ICNSS), y)
BMI_OBJS := $(BMI_DIR)/src/bmi.o \
$(BMI_DIR)/src/ol_fw.o
ifeq ($(CONFIG_FEATURE_BMI_2), y)
@@ -632,7 +631,6 @@ BMI_OBJS += $(BMI_DIR)/src/bmi_2.o
else
BMI_OBJS += $(BMI_DIR)/src/bmi_1.o
endif
endif
########### WMI ###########
WMI_DIR := core/wmi

View File

@@ -62,24 +62,7 @@ struct ol_config_info {
void ol_init_ini_config(struct ol_context *ol_ctx,
struct ol_config_info *cfg);
#ifdef HIF_PCI
void bmi_cleanup(struct ol_context *scn);
QDF_STATUS bmi_done(struct ol_context *ol_ctx);
QDF_STATUS bmi_download_firmware(struct ol_context *ol_ctx);
#else
static inline void bmi_cleanup(struct ol_context *scn)
{
return;
}
static inline QDF_STATUS bmi_done(struct ol_context *ol_ctx)
{
return QDF_STATUS_SUCCESS;
}
static inline QDF_STATUS bmi_download_firmware(struct ol_context *ol_ctx)
{
return QDF_STATUS_SUCCESS;
}
#endif
#endif /* _BMI_H_ */

View File

@@ -47,12 +47,5 @@
#define AR6320_REV4_VERSION AR6320_REV2_1_VERSION
#define AR6320_DEV_VERSION 0x1000000
#ifdef HIF_PCI
void ol_target_failure(void *instance, QDF_STATUS status);
#else
static inline void ol_target_failure(void *instance, QDF_STATUS status)
{
return;
}
#endif
#endif /* _OL_FW_H_ */

View File

@@ -105,9 +105,15 @@ end:
void bmi_cleanup(struct ol_context *ol_ctx)
{
struct bmi_info *info = GET_BMI_CONTEXT(ol_ctx);
qdf_device_t qdf_dev = ol_ctx->qdf_dev;
qdf_device_t qdf_dev;
if (!qdf_dev->dev) {
if (!info || !ol_ctx) {
BMI_WARN("%s: no bmi to cleanup", __func__);
return;
}
qdf_dev = ol_ctx->qdf_dev;
if (!qdf_dev || !qdf_dev->dev) {
BMI_ERR("%s: Invalid Device Pointer", __func__);
return;
}
@@ -129,16 +135,34 @@ void bmi_cleanup(struct ol_context *ol_ctx)
}
}
/**
* bmi_done() - finish the bmi opperation
* @ol_ctx: the bmi context
*
* does some sanity checking.
* exchanges one last message with firmware.
* frees some buffers.
*
* Return: QDF_STATUS_SUCCESS if bmi isn't needed.
* QDF_STATUS_SUCCESS if bmi finishes.
* otherwise returns failure.
*/
QDF_STATUS bmi_done(struct ol_context *ol_ctx)
{
QDF_STATUS status = QDF_STATUS_SUCCESS;
if (NO_BMI)
return status;
return QDF_STATUS_SUCCESS;
if (!ol_ctx) {
BMI_ERR("%s: null context", __func__);
return QDF_STATUS_E_NOMEM;
}
if (!hif_needs_bmi(ol_ctx->scn))
return QDF_STATUS_SUCCESS;
status = bmi_done_local(ol_ctx);
if (status != QDF_STATUS_SUCCESS)
BMI_ERR("BMI_DONE Failed status:%d", status);
@@ -203,8 +227,8 @@ QDF_STATUS bmi_download_firmware(struct ol_context *ol_ctx)
int32_t ret;
struct hif_opaque_softc *scn = ol_ctx->scn;
if (NO_BMI)
return QDF_STATUS_SUCCESS; /* no BMI for Q6 bring up */
if (NO_BMI || !hif_needs_bmi(scn))
return QDF_STATUS_SUCCESS;
if (!scn) {
BMI_ERR("Invalid scn context");

View File

@@ -617,6 +617,11 @@ void ol_target_failure(void *instance, QDF_STATUS status)
ol_target_status target_status =
hif_get_target_status(scn);
if (hif_get_bus_type(scn) == QDF_BUS_TYPE_SNOC) {
BMI_ERR("SNOC doesn't suppor this code path!");
return;
}
qdf_event_set(&wma->recovery_event);
if (OL_TRGET_STATUS_RESET == target_status) {
@@ -1422,6 +1427,7 @@ int ol_diag_read(struct hif_opaque_softc *scn, uint8_t *buffer,
return -EIO;
}
#ifdef HIF_PCI
static int ol_ath_get_reg_table(uint32_t target_version,
tgt_reg_table *reg_table)
{
@@ -1522,6 +1528,13 @@ static int ol_diag_read_reg_loc(struct hif_opaque_softc *scn, uint8_t *buffer,
out:
return result;
}
#else
static int ol_diag_read_reg_loc(struct hif_opaque_softc *scn, uint8_t *buffer,
uint32_t buffer_len)
{
return -EINVAL;
}
#endif
void ol_dump_target_memory(struct hif_opaque_softc *scn, void *memory_block)
{