From e6e4ca5fe48989539a26e30417688757cfd6bf75 Mon Sep 17 00:00:00 2001 From: Felix Singer Date: Mon, 18 Jul 2022 02:36:18 +0200 Subject: [PATCH] realtek_mst_i2c_spi: Use underscores for parameters instead hyphens realtek_mst_i2c_spi is the only programmer which uses hyphens instead of underscores in its parameter names. Thus, for consistency, rename the parameters so that they use underscores. Signed-off-by: Felix Singer Change-Id: I5ff6d8d432d875670fcaa2088e9cf9d9f1b83dc2 Reviewed-on: https://review.coreboot.org/c/flashrom/+/65935 Reviewed-by: Anastasia Klimchuk Reviewed-by: Peter Marheine Reviewed-by: Angel Pons Reviewed-by: Thomas Heijligen Tested-by: build bot (Jenkins) Reviewed-by: Edward O'Callaghan --- flashrom.8.tmpl | 14 +++++++------- realtek_mst_i2c_spi.c | 14 +++++++------- tests/realtek_mst_i2c_spi.c | 2 +- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/flashrom.8.tmpl b/flashrom.8.tmpl index a37b88a03..2cf3a38ce 100644 --- a/flashrom.8.tmpl +++ b/flashrom.8.tmpl @@ -1543,30 +1543,30 @@ commands through the MST hub's I2C connection with the host). .TP .B In-system programming (ISP) mode .sp -The \fBreset-mcu\fP and \fBenter-isp\fP options provide control over device +The \fBreset_mcu\fP and \fBenter_isp\fP options provide control over device mode changes, where each can be set to 0 or 1 to enable or disable the corresponding mode transition. -\fBenter-isp\fP defaults to 1, and if enabled will issue commands to the MST +\fBenter_isp\fP defaults to 1, and if enabled will issue commands to the MST hub when beginning operation to put it into ISP mode. -\fBreset-mcu\fP defaults to 0, and if enabled will issue a reset command to +\fBreset_mcu\fP defaults to 0, and if enabled will issue a reset command to the MST hub on programming completion, causing it to exit ISP mode and to reload its own firmware from flash. -\fBallow-brick\fP defaults to no, however must be set explicitly to "yes" +\fBallow_brick\fP defaults to no, however must be set explicitly to "yes" to allow the driver to run if you are sure you have a MST chip. The hub must be in ISP mode for SPI flash access to be possible, so it is -usually only useful to disable \fBenter-isp\fP if an earlier invocation avoided +usually only useful to disable \fBenter_isp\fP if an earlier invocation avoided resetting it on completion. For instance, to erase the flash and rewrite it with the contents of a file without resetting in between (which could render it nonfunctional if attempting to load firmware from a blank flash): .sp -.B " flashrom -p realtek_mst_i2c_spi:bus=0,enter-isp=1,reset-mcu=0 -E" +.B " flashrom -p realtek_mst_i2c_spi:bus=0,enter_isp=1,reset_mcu=0 -E" .br -.B " flashrom -p realtek_mst_i2c_spi:bus=0,enter-isp=0,reset-mcu=1 -w new.bin" +.B " flashrom -p realtek_mst_i2c_spi:bus=0,enter_isp=0,reset_mcu=1 -w new.bin" .SS .BR "parade_lspcon " programmer .IP diff --git a/realtek_mst_i2c_spi.c b/realtek_mst_i2c_spi.c index f817b9cd9..ce1637a10 100644 --- a/realtek_mst_i2c_spi.c +++ b/realtek_mst_i2c_spi.c @@ -449,7 +449,7 @@ static int get_params(int *reset, int *enter_isp, int *allow_brick) char *reset_str = NULL, *isp_str = NULL, *brick_str = NULL; int ret = 0; - brick_str = extract_programmer_param_str("allow-brick"); + brick_str = extract_programmer_param_str("allow_brick"); if (brick_str) { if (!strcmp(brick_str, "yes")) { *allow_brick = 1; @@ -462,14 +462,14 @@ static int get_params(int *reset, int *enter_isp, int *allow_brick) } free(brick_str); - reset_str = extract_programmer_param_str("reset-mcu"); + reset_str = extract_programmer_param_str("reset_mcu"); if (reset_str) { if (reset_str[0] == '1') { *reset = 1; } else if (reset_str[0] == '0') { *reset = 0; } else { - msg_perr("%s: Incorrect param format, reset-mcu=1 or 0.\n", __func__); + msg_perr("%s: Incorrect param format, reset_mcu=1 or 0.\n", __func__); ret = SPI_GENERIC_ERROR; } } else { @@ -477,14 +477,14 @@ static int get_params(int *reset, int *enter_isp, int *allow_brick) } free(reset_str); - isp_str = extract_programmer_param_str("enter-isp"); + isp_str = extract_programmer_param_str("enter_isp"); if (isp_str) { if (isp_str[0] == '1') { *enter_isp = 1; } else if (isp_str[0] == '0') { *enter_isp = 0; } else { - msg_perr("%s: Incorrect param format, enter-isp=1 or 0.\n", __func__); + msg_perr("%s: Incorrect param format, enter_isp=1 or 0.\n", __func__); ret = SPI_GENERIC_ERROR; } } else { @@ -508,9 +508,9 @@ static int realtek_mst_i2c_spi_init(void) * then this can be removed. */ if (!allow_brick) { - msg_perr("%s: For i2c drivers you must explicitly 'allow-brick=yes'. ", __func__); + msg_perr("%s: For i2c drivers you must explicitly 'allow_brick=yes'. ", __func__); msg_perr("There is currently no way to determine if the programmer works on a board " - "as i2c device address space can be overloaded. Set 'allow-brick=yes' if " + "as i2c device address space can be overloaded. Set 'allow_brick=yes' if " "you are sure you know what you are doing.\n"); return SPI_GENERIC_ERROR; } diff --git a/tests/realtek_mst_i2c_spi.c b/tests/realtek_mst_i2c_spi.c index 3b004cbee..85ebc13c2 100644 --- a/tests/realtek_mst_i2c_spi.c +++ b/tests/realtek_mst_i2c_spi.c @@ -56,7 +56,7 @@ void realtek_mst_basic_lifecycle_test_success(void **state) .fallback_open_state = &realtek_mst_fallback_open_state, }; - run_basic_lifecycle(state, &realtek_mst_io, &programmer_realtek_mst_i2c_spi, "bus=254,enter-isp=0,allow-brick=yes"); + run_basic_lifecycle(state, &realtek_mst_io, &programmer_realtek_mst_i2c_spi, "bus=254,enter_isp=0,allow_brick=yes"); } #else SKIP_TEST(realtek_mst_basic_lifecycle_test_success)