You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

49 lines
1.6 KiB

/*
* Copyright (c) Hisilicon Technologies Co., Ltd. 2020-2021. All rights reserved.
* Description: Initial Draft
* Author: Hisilicon
* Create: 2020-09-30
*/
#include "mpi_mdbg.h"
#include "soc_log.h"
#include "mpi_system_ext.h"
td_s32 ext_mpi_mdbg_get_chipversion(ext_mdbg_chip *chip_class)
{
td_s32 ret;
ext_sys_version sys_version;
if (chip_class == NULL) {
return TD_FAILURE;
}
ret = ext_mpi_sys_init();
if (ret != TD_SUCCESS) {
soc_fatal_print_call_fun_err(ext_mpi_sys_init, ret);
return ret;
}
ext_mpi_sys_get_version(&sys_version);
if ((sys_version.chip_name_id == CHIP_NAME_RESERVED5 || sys_version.chip_name_id == CHIP_NAME_RESERVED2)) {
*chip_class = MDBG_CHIP_RESERVED5;
} else if ((sys_version.chip_name_id == CHIP_NAME_RESERVED13) ||
(sys_version.chip_name_id == CHIP_NAME_RESERVED6)) {
*chip_class = MDBG_CHIP_RESERVED13;
} else if ((sys_version.chip_name_id == CHIP_NAME_RESERVED9) ||
(sys_version.chip_name_id == CHIP_NAME_RESERVED8)) {
*chip_class = MDBG_CHIP_RESERVED9;
} else if ((sys_version.chip_name_id == CHIP_NAME_RESERVED19) ||
(sys_version.chip_name_id == CHIP_NAME_RESERVED17)) {
*chip_class = MDBG_CHIP_RESERVED19;
} else if (sys_version.chip_name_id == CHIP_NAME_HI3751V811) {
*chip_class = MDBG_CHIP_HI3751V811;
} else {
printf(" unkown chip type and chip version ...\n");
(td_void)ext_mpi_sys_deinit();
return TD_FAILURE;
}
(td_void)ext_mpi_sys_deinit();
return TD_SUCCESS;
}