OpenBIC
OpenSource Bridge-IC
|
#include <stdlib.h>
#include <shell/shell.h>
#include "plat_pwm.h"
#include "plat_threshold.h"
#include "sensor.h"
#include "plat_sensor_table.h"
#include "plat_util.h"
#include "common_i2c_mux.h"
#include "nct7363.h"
#include "plat_status.h"
#include "plat_fsc.h"
#include "plat_hwmon.h"
Functions | |
LOG_MODULE_REGISTER (plat_shell) | |
void | cmd_sensor_polling (const struct shell *shell, size_t argc, char **argv) |
void | cmd_get_pump_duty (const struct shell *shell, size_t argc, char **argv) |
void | cmd_get_hex_fan_duty (const struct shell *shell, size_t argc, char **argv) |
void | cmd_get_rpu_fan_duty (const struct shell *shell, size_t argc, char **argv) |
void | cmd_get_fan_duty (const struct shell *shell, size_t argc, char **argv) |
void | cmd_set_pump_duty (const struct shell *shell, size_t argc, char **argv) |
void | cmd_set_hex_fan_duty (const struct shell *shell, size_t argc, char **argv) |
void | cmd_set_rpu_fan_duty (const struct shell *shell, size_t argc, char **argv) |
void | cmd_set_fan_duty (const struct shell *shell, size_t argc, char **argv) |
void | cmd_set_pwm_manual_mode (const struct shell *shell, size_t argc, char **argv) |
void | cmd_switch_fb_mux (const struct shell *shell, size_t argc, char **argv) |
void | cmd_switch_pb_mux (const struct shell *shell, size_t argc, char **argv) |
void | cmd_switch_sb_mux (const struct shell *shell, size_t argc, char **argv) |
void | cmd_switch_pdb_mux (const struct shell *shell, size_t argc, char **argv) |
void | cmd_nct7363_fb (const struct shell *shell, size_t argc, char **argv) |
void | cmd_nct7363_pb (const struct shell *shell, size_t argc, char **argv) |
void | cmd_threshold_tbl_get (const struct shell *shell, size_t argc, char **argv) |
void | cmd_threshold_tbl_set (const struct shell *shell, size_t argc, char **argv) |
void | cmd_threshold_pump_test (const struct shell *shell, size_t argc, char **argv) |
void | cmd_status_leak_get (const struct shell *shell, size_t argc, char **argv) |
void | cmd_status_leak_set (const struct shell *shell, size_t argc, char **argv) |
void | cmd_status_failure_get (const struct shell *shell, size_t argc, char **argv) |
void | cmd_status_failure_set (const struct shell *shell, size_t argc, char **argv) |
void | cmd_status_auto_tune_get (const struct shell *shell, size_t argc, char **argv) |
void | cmd_status_auto_tune_set (const struct shell *shell, size_t argc, char **argv) |
void | cmd_status_pump_redundant_get (const struct shell *shell, size_t argc, char **argv) |
void | cmd_status_pump_redundant_set (const struct shell *shell, size_t argc, char **argv) |
void | cmd_test (const struct shell *shell, size_t argc, char **argv) |
SHELL_STATIC_SUBCMD_SET_CREATE (sub_get_pwm_cmd, SHELL_CMD(pump, NULL, "get pump duty", cmd_get_pump_duty), SHELL_CMD(hex_fan, NULL, "get hex fan duty", cmd_get_hex_fan_duty), SHELL_CMD(rpu_fan, NULL, "get rpu fan duty", cmd_get_rpu_fan_duty), SHELL_CMD(single, NULL, "get fan device duty", cmd_get_fan_duty), SHELL_SUBCMD_SET_END) | |
SHELL_STATIC_SUBCMD_SET_CREATE (sub_set_pwm_cmd, SHELL_CMD(pump, NULL, "set pump duty", cmd_set_pump_duty), SHELL_CMD(hex_fan, NULL, "set hex fan duty", cmd_set_hex_fan_duty), SHELL_CMD(rpu_fan, NULL, "set rpu fan duty", cmd_set_rpu_fan_duty), SHELL_CMD(single, NULL, "set fan device duty", cmd_set_fan_duty), SHELL_CMD(manual, NULL, "set pwm device manual mode", cmd_set_pwm_manual_mode), SHELL_SUBCMD_SET_END) | |
SHELL_STATIC_SUBCMD_SET_CREATE (sub_get_status_cmd, SHELL_CMD(leak, NULL, "get leak status flag", cmd_status_leak_get), SHELL_CMD(failure, NULL, "get failure status flag", cmd_status_failure_get), SHELL_CMD(auto_tune, NULL, "get auto tune flag", cmd_status_auto_tune_get), SHELL_CMD(pump_redundant, NULL, "get pump redundant flag", cmd_status_pump_redundant_get), SHELL_SUBCMD_SET_END) | |
SHELL_STATIC_SUBCMD_SET_CREATE (sub_set_status_cmd, SHELL_CMD(leak, NULL, "set leak status flag", cmd_status_leak_set), SHELL_CMD(failure, NULL, "set failure status flag", cmd_status_failure_set), SHELL_CMD(auto_tune, NULL, "set auto tune flag", cmd_status_auto_tune_set), SHELL_CMD(pump_redundant, NULL, "set pump redundant flag", cmd_status_pump_redundant_set), SHELL_SUBCMD_SET_END) | |
SHELL_STATIC_SUBCMD_SET_CREATE (sub_pwm_cmd, SHELL_CMD(get, &sub_get_pwm_cmd, "get duty", NULL), SHELL_CMD(set, &sub_set_pwm_cmd, "set duty", NULL), SHELL_SUBCMD_SET_END) | |
SHELL_STATIC_SUBCMD_SET_CREATE (sub_mux_cmd, SHELL_CMD(fb, NULL, "switch fan board mux", cmd_switch_fb_mux), SHELL_CMD(pb, NULL, "switch pump board mux", cmd_switch_pb_mux), SHELL_CMD(sb, NULL, "switch sensor board mux", cmd_switch_sb_mux), SHELL_CMD(pdb, NULL, "switch pdb mux", cmd_switch_pdb_mux), SHELL_SUBCMD_SET_END) | |
SHELL_STATIC_SUBCMD_SET_CREATE (sub_nct7363_cmd, SHELL_CMD(fb, NULL, "nct7363 debug for fan board", cmd_nct7363_fb), SHELL_CMD(pb, NULL, "nct7363 debug for pump board", cmd_nct7363_pb), SHELL_SUBCMD_SET_END) | |
SHELL_STATIC_SUBCMD_SET_CREATE (sub_threshold_cmd, SHELL_CMD(get, NULL, "get threshold table", cmd_threshold_tbl_get), SHELL_CMD(set, NULL, "set threshold table", cmd_threshold_tbl_set), SHELL_CMD(pump_test, NULL, "disable pump dynamic threshold", cmd_threshold_pump_test), SHELL_SUBCMD_SET_END) | |
SHELL_STATIC_SUBCMD_SET_CREATE (sub_status_cmd, SHELL_CMD(get, &sub_get_status_cmd, "get status flag", NULL), SHELL_CMD(set, &sub_set_status_cmd, "set status flag", NULL), SHELL_SUBCMD_SET_END) | |
SHELL_STATIC_SUBCMD_SET_CREATE (sub_fsc_cmd, SHELL_CMD(debug, NULL, "fsc debug message", cmd_fsc_debug_enable), SHELL_CMD(table, NULL, "fsc table enable", cmd_fsc_tbl_enable), SHELL_SUBCMD_SET_END) | |
SHELL_STATIC_SUBCMD_SET_CREATE (sub_pump_redundant_cmd, SHELL_CMD(enable, NULL, "pump redundant enable/disable", cmd_pump_redundant_enable), SHELL_CMD(switch_time, NULL, "set pump redundant days", cmd_pump_redundant_switch_day_set), SHELL_SUBCMD_SET_END) | |
SHELL_STATIC_SUBCMD_SET_CREATE (sub_modbus_cmd, SHELL_CMD(write, NULL, "modbus write command", cmd_modbus_write), SHELL_CMD(read, NULL, "modbus read command", cmd_modbus_read), SHELL_SUBCMD_SET_END) | |
SHELL_STATIC_SUBCMD_SET_CREATE (sub_test_cmds, SHELL_CMD(pwm, &sub_pwm_cmd, "set/get pwm command", NULL), SHELL_CMD(poll, NULL, "enable/disable sensor polling", cmd_sensor_polling), SHELL_CMD(mux, &sub_mux_cmd, "switch mux from sensor cfg", NULL), SHELL_CMD(nct7363, &sub_nct7363_cmd, "nct7363 debug command", NULL), SHELL_CMD(threshold, &sub_threshold_cmd, "threshold test command", NULL), SHELL_CMD(status, &sub_status_cmd, "status test command", NULL), SHELL_CMD(fsc, &sub_fsc_cmd, "fan speed control command", NULL), SHELL_CMD(pump_redundant, &sub_pump_redundant_cmd, "pump redundant command", NULL), SHELL_CMD(modbus, &sub_modbus_cmd, "modbus test command", NULL), SHELL_CMD(test, NULL, "test command", cmd_test), SHELL_SUBCMD_SET_END) | |
SHELL_CMD_REGISTER (test, &sub_test_cmds, "Test commands for AALC", NULL) | |
void cmd_get_fan_duty | ( | const struct shell * | shell, |
size_t | argc, | ||
char ** | argv | ||
) |
void cmd_get_hex_fan_duty | ( | const struct shell * | shell, |
size_t | argc, | ||
char ** | argv | ||
) |
void cmd_get_pump_duty | ( | const struct shell * | shell, |
size_t | argc, | ||
char ** | argv | ||
) |
void cmd_get_rpu_fan_duty | ( | const struct shell * | shell, |
size_t | argc, | ||
char ** | argv | ||
) |
void cmd_nct7363_fb | ( | const struct shell * | shell, |
size_t | argc, | ||
char ** | argv | ||
) |
void cmd_nct7363_pb | ( | const struct shell * | shell, |
size_t | argc, | ||
char ** | argv | ||
) |
void cmd_sensor_polling | ( | const struct shell * | shell, |
size_t | argc, | ||
char ** | argv | ||
) |
void cmd_set_fan_duty | ( | const struct shell * | shell, |
size_t | argc, | ||
char ** | argv | ||
) |
void cmd_set_hex_fan_duty | ( | const struct shell * | shell, |
size_t | argc, | ||
char ** | argv | ||
) |
void cmd_set_pump_duty | ( | const struct shell * | shell, |
size_t | argc, | ||
char ** | argv | ||
) |
void cmd_set_pwm_manual_mode | ( | const struct shell * | shell, |
size_t | argc, | ||
char ** | argv | ||
) |
void cmd_set_rpu_fan_duty | ( | const struct shell * | shell, |
size_t | argc, | ||
char ** | argv | ||
) |
void cmd_status_auto_tune_get | ( | const struct shell * | shell, |
size_t | argc, | ||
char ** | argv | ||
) |
void cmd_status_auto_tune_set | ( | const struct shell * | shell, |
size_t | argc, | ||
char ** | argv | ||
) |
void cmd_status_failure_get | ( | const struct shell * | shell, |
size_t | argc, | ||
char ** | argv | ||
) |
void cmd_status_failure_set | ( | const struct shell * | shell, |
size_t | argc, | ||
char ** | argv | ||
) |
void cmd_status_leak_get | ( | const struct shell * | shell, |
size_t | argc, | ||
char ** | argv | ||
) |
void cmd_status_leak_set | ( | const struct shell * | shell, |
size_t | argc, | ||
char ** | argv | ||
) |
void cmd_status_pump_redundant_get | ( | const struct shell * | shell, |
size_t | argc, | ||
char ** | argv | ||
) |
void cmd_status_pump_redundant_set | ( | const struct shell * | shell, |
size_t | argc, | ||
char ** | argv | ||
) |
void cmd_switch_fb_mux | ( | const struct shell * | shell, |
size_t | argc, | ||
char ** | argv | ||
) |
void cmd_switch_pb_mux | ( | const struct shell * | shell, |
size_t | argc, | ||
char ** | argv | ||
) |
void cmd_switch_pdb_mux | ( | const struct shell * | shell, |
size_t | argc, | ||
char ** | argv | ||
) |
void cmd_switch_sb_mux | ( | const struct shell * | shell, |
size_t | argc, | ||
char ** | argv | ||
) |
void cmd_test | ( | const struct shell * | shell, |
size_t | argc, | ||
char ** | argv | ||
) |
void cmd_threshold_pump_test | ( | const struct shell * | shell, |
size_t | argc, | ||
char ** | argv | ||
) |
void cmd_threshold_tbl_get | ( | const struct shell * | shell, |
size_t | argc, | ||
char ** | argv | ||
) |
void cmd_threshold_tbl_set | ( | const struct shell * | shell, |
size_t | argc, | ||
char ** | argv | ||
) |
LOG_MODULE_REGISTER | ( | plat_shell | ) |
SHELL_CMD_REGISTER | ( | test | , |
& | sub_test_cmds, | ||
"Test commands for AALC" | , | ||
NULL | |||
) |
SHELL_STATIC_SUBCMD_SET_CREATE | ( | sub_fsc_cmd | , |
SHELL_CMD(debug, NULL, "fsc debug message", cmd_fsc_debug_enable) | , | ||
SHELL_CMD(table, NULL, "fsc table enable", cmd_fsc_tbl_enable) | , | ||
SHELL_SUBCMD_SET_END | |||
) |
SHELL_STATIC_SUBCMD_SET_CREATE | ( | sub_get_pwm_cmd | , |
SHELL_CMD(pump, NULL, "get pump duty", cmd_get_pump_duty) | , | ||
SHELL_CMD(hex_fan, NULL, "get hex fan duty", cmd_get_hex_fan_duty) | , | ||
SHELL_CMD(rpu_fan, NULL, "get rpu fan duty", cmd_get_rpu_fan_duty) | , | ||
SHELL_CMD(single, NULL, "get fan device duty", cmd_get_fan_duty) | , | ||
SHELL_SUBCMD_SET_END | |||
) |
SHELL_STATIC_SUBCMD_SET_CREATE | ( | sub_get_status_cmd | , |
SHELL_CMD(leak, NULL, "get leak status flag", cmd_status_leak_get) | , | ||
SHELL_CMD(failure, NULL, "get failure status flag", cmd_status_failure_get) | , | ||
SHELL_CMD(auto_tune, NULL, "get auto tune flag", cmd_status_auto_tune_get) | , | ||
SHELL_CMD(pump_redundant, NULL, "get pump redundant flag", cmd_status_pump_redundant_get) | , | ||
SHELL_SUBCMD_SET_END | |||
) |
SHELL_STATIC_SUBCMD_SET_CREATE | ( | sub_modbus_cmd | , |
SHELL_CMD(write, NULL, "modbus write command", cmd_modbus_write) | , | ||
SHELL_CMD(read, NULL, "modbus read command", cmd_modbus_read) | , | ||
SHELL_SUBCMD_SET_END | |||
) |
SHELL_STATIC_SUBCMD_SET_CREATE | ( | sub_mux_cmd | , |
SHELL_CMD(fb, NULL, "switch fan board mux", cmd_switch_fb_mux) | , | ||
SHELL_CMD(pb, NULL, "switch pump board mux", cmd_switch_pb_mux) | , | ||
SHELL_CMD(sb, NULL, "switch sensor board mux", cmd_switch_sb_mux) | , | ||
SHELL_CMD(pdb, NULL, "switch pdb mux", cmd_switch_pdb_mux) | , | ||
SHELL_SUBCMD_SET_END | |||
) |
SHELL_STATIC_SUBCMD_SET_CREATE | ( | sub_nct7363_cmd | , |
SHELL_CMD(fb, NULL, "nct7363 debug for fan board", cmd_nct7363_fb) | , | ||
SHELL_CMD(pb, NULL, "nct7363 debug for pump board", cmd_nct7363_pb) | , | ||
SHELL_SUBCMD_SET_END | |||
) |
SHELL_STATIC_SUBCMD_SET_CREATE | ( | sub_pump_redundant_cmd | , |
SHELL_CMD(enable, NULL, "pump redundant enable/disable", cmd_pump_redundant_enable) | , | ||
SHELL_CMD(switch_time, NULL, "set pump redundant days", cmd_pump_redundant_switch_day_set) | , | ||
SHELL_SUBCMD_SET_END | |||
) |
SHELL_STATIC_SUBCMD_SET_CREATE | ( | sub_pwm_cmd | , |
SHELL_CMD(get, &sub_get_pwm_cmd, "get duty", NULL) | , | ||
SHELL_CMD(set, &sub_set_pwm_cmd, "set duty", NULL) | , | ||
SHELL_SUBCMD_SET_END | |||
) |
SHELL_STATIC_SUBCMD_SET_CREATE | ( | sub_set_pwm_cmd | , |
SHELL_CMD(pump, NULL, "set pump duty", cmd_set_pump_duty) | , | ||
SHELL_CMD(hex_fan, NULL, "set hex fan duty", cmd_set_hex_fan_duty) | , | ||
SHELL_CMD(rpu_fan, NULL, "set rpu fan duty", cmd_set_rpu_fan_duty) | , | ||
SHELL_CMD(single, NULL, "set fan device duty", cmd_set_fan_duty) | , | ||
SHELL_CMD(manual, NULL, "set pwm device manual mode", cmd_set_pwm_manual_mode) | , | ||
SHELL_SUBCMD_SET_END | |||
) |
SHELL_STATIC_SUBCMD_SET_CREATE | ( | sub_set_status_cmd | , |
SHELL_CMD(leak, NULL, "set leak status flag", cmd_status_leak_set) | , | ||
SHELL_CMD(failure, NULL, "set failure status flag", cmd_status_failure_set) | , | ||
SHELL_CMD(auto_tune, NULL, "set auto tune flag", cmd_status_auto_tune_set) | , | ||
SHELL_CMD(pump_redundant, NULL, "set pump redundant flag", cmd_status_pump_redundant_set) | , | ||
SHELL_SUBCMD_SET_END | |||
) |
SHELL_STATIC_SUBCMD_SET_CREATE | ( | sub_status_cmd | , |
SHELL_CMD(get, &sub_get_status_cmd, "get status flag", NULL) | , | ||
SHELL_CMD(set, &sub_set_status_cmd, "set status flag", NULL) | , | ||
SHELL_SUBCMD_SET_END | |||
) |
SHELL_STATIC_SUBCMD_SET_CREATE | ( | sub_test_cmds | , |
SHELL_CMD(pwm, &sub_pwm_cmd, "set/get pwm command", NULL) | , | ||
SHELL_CMD(poll, NULL, "enable/disable sensor polling", cmd_sensor_polling) | , | ||
SHELL_CMD(mux, &sub_mux_cmd, "switch mux from sensor cfg", NULL) | , | ||
SHELL_CMD(nct7363, &sub_nct7363_cmd, "nct7363 debug command", NULL) | , | ||
SHELL_CMD(threshold, &sub_threshold_cmd, "threshold test command", NULL) | , | ||
SHELL_CMD(status, &sub_status_cmd, "status test command", NULL) | , | ||
SHELL_CMD(fsc, &sub_fsc_cmd, "fan speed control command", NULL) | , | ||
SHELL_CMD(pump_redundant, &sub_pump_redundant_cmd, "pump redundant command", NULL) | , | ||
SHELL_CMD(modbus, &sub_modbus_cmd, "modbus test command", NULL) | , | ||
SHELL_CMD(test, NULL, "test command", cmd_test) | , | ||
SHELL_SUBCMD_SET_END | |||
) |
SHELL_STATIC_SUBCMD_SET_CREATE | ( | sub_threshold_cmd | , |
SHELL_CMD(get, NULL, "get threshold table", cmd_threshold_tbl_get) | , | ||
SHELL_CMD(set, NULL, "set threshold table", cmd_threshold_tbl_set) | , | ||
SHELL_CMD(pump_test, NULL, "disable pump dynamic threshold", cmd_threshold_pump_test) | , | ||
SHELL_SUBCMD_SET_END | |||
) |