X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=drivers%2Fram%2Fstm32mp1%2Fstm32mp1_interactive.c;h=47e176b28211af3d1b22a18849d90ca01fb02140;hb=09140113108541b95d340f3c7b6ee597d31ccc73;hp=cc9b2e7c96c96e5c8fd4af70fa796cea99ebad19;hpb=c18b103657d9541305a45a1fb21f979c317fba49;p=oweals%2Fu-boot.git diff --git a/drivers/ram/stm32mp1/stm32mp1_interactive.c b/drivers/ram/stm32mp1/stm32mp1_interactive.c index cc9b2e7c96..47e176b282 100644 --- a/drivers/ram/stm32mp1/stm32mp1_interactive.c +++ b/drivers/ram/stm32mp1/stm32mp1_interactive.c @@ -4,6 +4,7 @@ */ #include +#include #include #include #include @@ -106,7 +107,7 @@ static void stm32mp1_do_usage(void) "help displays help\n" "info displays DDR information\n" "info changes DDR information\n" - " with = step, name, size or speed\n" + " with = step, name, size, speed or cal\n" "freq displays the DDR PHY frequency in kHz\n" "freq changes the DDR PHY frequency\n" "param [type|reg] prints input parameters\n" @@ -150,7 +151,7 @@ static bool stm32mp1_check_step(enum stm32mp1_ddr_interact_step step, static void stm32mp1_do_info(struct ddr_info *priv, struct stm32mp1_ddr_config *config, enum stm32mp1_ddr_interact_step step, - int argc, char * const argv[]) + int argc, char *const argv[]) { unsigned long value; static char *ddr_name; @@ -160,6 +161,7 @@ static void stm32mp1_do_info(struct ddr_info *priv, printf("name = %s\n", config->info.name); printf("size = 0x%x\n", config->info.size); printf("speed = %d kHz\n", config->info.speed); + printf("cal = %d\n", config->p_cal_present); return; } @@ -208,11 +210,21 @@ static void stm32mp1_do_info(struct ddr_info *priv, } return; } + if (!strcmp(argv[1], "cal")) { + if (strict_strtoul(argv[2], 10, &value) < 0 || + (value != 0 && value != 1)) { + printf("invalid value %s\n", argv[2]); + } else { + config->p_cal_present = value; + printf("cal = %d\n", config->p_cal_present); + } + return; + } printf("argument %s invalid\n", argv[1]); } static bool stm32mp1_do_freq(struct ddr_info *priv, - int argc, char * const argv[]) + int argc, char *const argv[]) { unsigned long ddrphy_clk; @@ -235,7 +247,7 @@ static bool stm32mp1_do_freq(struct ddr_info *priv, static void stm32mp1_do_param(enum stm32mp1_ddr_interact_step step, const struct stm32mp1_ddr_config *config, - int argc, char * const argv[]) + int argc, char *const argv[]) { switch (argc) { case 1: @@ -255,7 +267,7 @@ static void stm32mp1_do_param(enum stm32mp1_ddr_interact_step step, } static void stm32mp1_do_print(struct ddr_info *priv, - int argc, char * const argv[]) + int argc, char *const argv[]) { switch (argc) { case 1: @@ -270,7 +282,7 @@ static void stm32mp1_do_print(struct ddr_info *priv, } static int stm32mp1_do_step(enum stm32mp1_ddr_interact_step step, - int argc, char * const argv[]) + int argc, char *const argv[]) { int i; unsigned long value; @@ -367,7 +379,6 @@ bool stm32mp1_ddr_interactive(void *priv, enum stm32mp1_ddr_interact_step step, const struct stm32mp1_ddr_config *config) { - const char *prompt = "DDR>"; char buffer[CONFIG_SYS_CBSIZE]; char *argv[CONFIG_SYS_MAXARGS + 1]; /* NULL terminated */ int argc; @@ -403,13 +414,12 @@ bool stm32mp1_ddr_interactive(void *priv, } printf("%d:%s\n", step, step_str[step]); - printf("%s\n", prompt); if (next_step > step) return false; while (next_step == step) { - cli_readline_into_buffer(prompt, buffer, 0); + cli_readline_into_buffer("DDR>", buffer, 0); argc = cli_simple_parse_line(buffer, argv); if (!argc) continue;