Move the AIC-specific image tables from the Sahara driver to the AIC specific controller file. This change prevents the Sahara driver from being tagged to a specific Qualcomm device, making it easier to add support for new devices with their own image tables. Signed-off-by: Kishore Batta <kishore.batta@xxxxxxxxxxxxxxxx> --- drivers/accel/qaic/mhi_controller.c | 43 +++++++++++++++++++++++++++++ drivers/accel/qaic/sahara.c | 43 ++--------------------------- drivers/accel/qaic/sahara.h | 7 +++++ 3 files changed, 52 insertions(+), 41 deletions(-) diff --git a/drivers/accel/qaic/mhi_controller.c b/drivers/accel/qaic/mhi_controller.c index 13a14c6c6168..5cc7994f4809 100644 --- a/drivers/accel/qaic/mhi_controller.c +++ b/drivers/accel/qaic/mhi_controller.c @@ -790,6 +790,49 @@ static struct mhi_controller_config mhi_cntrl_configs[] = { }, }; +const char * const aic100_image_table[] = { + [1] = "qcom/aic100/fw1.bin", + [2] = "qcom/aic100/fw2.bin", + [4] = "qcom/aic100/fw4.bin", + [5] = "qcom/aic100/fw5.bin", + [6] = "qcom/aic100/fw6.bin", + [8] = "qcom/aic100/fw8.bin", + [9] = "qcom/aic100/fw9.bin", + [10] = "qcom/aic100/fw10.bin", +}; + +const size_t aic100_image_table_size = ARRAY_SIZE(aic100_image_table); + +const char * const aic200_image_table[] = { + [5] = "qcom/aic200/uefi.elf", + [12] = "qcom/aic200/aic200-nsp.bin", + [23] = "qcom/aic200/aop.mbn", + [32] = "qcom/aic200/tz.mbn", + [33] = "qcom/aic200/hypvm.mbn", + [39] = "qcom/aic200/aic200_abl.elf", + [40] = "qcom/aic200/apdp.mbn", + [41] = "qcom/aic200/devcfg.mbn", + [42] = "qcom/aic200/sec.elf", + [43] = "qcom/aic200/aic200-hlos.elf", + [49] = "qcom/aic200/shrm.elf", + [50] = "qcom/aic200/cpucp.elf", + [51] = "qcom/aic200/aop_devcfg.mbn", + [57] = "qcom/aic200/cpucp_dtbs.elf", + [62] = "qcom/aic200/uefi_dtbs.elf", + [63] = "qcom/aic200/xbl_ac_config.mbn", + [64] = "qcom/aic200/tz_ac_config.mbn", + [65] = "qcom/aic200/hyp_ac_config.mbn", + [66] = "qcom/aic200/pdp.elf", + [67] = "qcom/aic200/pdp_cdb.elf", + [68] = "qcom/aic200/sdi.mbn", + [69] = "qcom/aic200/dcd.mbn", + [73] = "qcom/aic200/gearvm.mbn", + [74] = "qcom/aic200/sti.bin", + [75] = "qcom/aic200/pvs.bin", +}; + +const size_t aic200_image_table_size = ARRAY_SIZE(aic200_image_table); + static int mhi_read_reg(struct mhi_controller *mhi_cntrl, void __iomem *addr, u32 *out) { u32 tmp; diff --git a/drivers/accel/qaic/sahara.c b/drivers/accel/qaic/sahara.c index 3ebcc1f7ff58..cf8f8b585223 100644 --- a/drivers/accel/qaic/sahara.c +++ b/drivers/accel/qaic/sahara.c @@ -177,45 +177,6 @@ struct sahara_context { bool is_mem_dump_mode; }; -static const char * const aic100_image_table[] = { - [1] = "qcom/aic100/fw1.bin", - [2] = "qcom/aic100/fw2.bin", - [4] = "qcom/aic100/fw4.bin", - [5] = "qcom/aic100/fw5.bin", - [6] = "qcom/aic100/fw6.bin", - [8] = "qcom/aic100/fw8.bin", - [9] = "qcom/aic100/fw9.bin", - [10] = "qcom/aic100/fw10.bin", -}; - -static const char * const aic200_image_table[] = { - [5] = "qcom/aic200/uefi.elf", - [12] = "qcom/aic200/aic200-nsp.bin", - [23] = "qcom/aic200/aop.mbn", - [32] = "qcom/aic200/tz.mbn", - [33] = "qcom/aic200/hypvm.mbn", - [39] = "qcom/aic200/aic200_abl.elf", - [40] = "qcom/aic200/apdp.mbn", - [41] = "qcom/aic200/devcfg.mbn", - [42] = "qcom/aic200/sec.elf", - [43] = "qcom/aic200/aic200-hlos.elf", - [49] = "qcom/aic200/shrm.elf", - [50] = "qcom/aic200/cpucp.elf", - [51] = "qcom/aic200/aop_devcfg.mbn", - [57] = "qcom/aic200/cpucp_dtbs.elf", - [62] = "qcom/aic200/uefi_dtbs.elf", - [63] = "qcom/aic200/xbl_ac_config.mbn", - [64] = "qcom/aic200/tz_ac_config.mbn", - [65] = "qcom/aic200/hyp_ac_config.mbn", - [66] = "qcom/aic200/pdp.elf", - [67] = "qcom/aic200/pdp_cdb.elf", - [68] = "qcom/aic200/sdi.mbn", - [69] = "qcom/aic200/dcd.mbn", - [73] = "qcom/aic200/gearvm.mbn", - [74] = "qcom/aic200/sti.bin", - [75] = "qcom/aic200/pvs.bin", -}; - static int sahara_find_image(struct sahara_context *context, u32 image_id) { int ret; @@ -779,10 +740,10 @@ static int sahara_mhi_probe(struct mhi_device *mhi_dev, const struct mhi_device_ if (!strcmp(mhi_dev->mhi_cntrl->name, "AIC200")) { context->image_table = aic200_image_table; - context->table_size = ARRAY_SIZE(aic200_image_table); + context->table_size = aic200_image_table_size; } else { context->image_table = aic100_image_table; - context->table_size = ARRAY_SIZE(aic100_image_table); + context->table_size = aic100_image_table_size; } context->active_image_id = SAHARA_IMAGE_ID_NONE; diff --git a/drivers/accel/qaic/sahara.h b/drivers/accel/qaic/sahara.h index 640208acc0d1..d7fd447ca85b 100644 --- a/drivers/accel/qaic/sahara.h +++ b/drivers/accel/qaic/sahara.h @@ -7,4 +7,11 @@ int sahara_register(void); void sahara_unregister(void); + +extern const char * const aic200_image_table[]; +extern const size_t aic200_image_table_size; + +extern const char * const aic100_image_table[]; +extern const size_t aic100_image_table_size; + #endif /* __SAHARA_H__ */ -- 2.34.1