From b73ca808be7142018b2985848b0aa5f1a1f9a969 Mon Sep 17 00:00:00 2001 From: Vadim Bendebury Date: Thu, 2 Feb 2017 17:22:12 -0800 Subject: [PATCH] g: fix pinmux command implementation The output of pinmux command is garbled (it probably was OK until the console UART TX buffer was significantly reduced in size by https://chromium-review.googlesource.com/418948). Let's flush the console every so often. Also, fixed the bug where the second GPIO port base address in PIMUX was off, and added a newline to separate UART section of the output. BRANCH=none BUG=none TEST=ran pinmux command successfully. make -j buildall passes Change-Id: Iae0dcbbd0a55d704ffe2296d6e0e81b2c6aec527 Signed-off-by: Vadim Bendebury Reviewed-on: https://chromium-review.googlesource.com/436765 Reviewed-by: Mary Ruthven --- chip/g/gpio.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/chip/g/gpio.c b/chip/g/gpio.c index 0ec603d18b..23c551c945 100644 --- a/chip/g/gpio.c +++ b/chip/g/gpio.c @@ -365,6 +365,7 @@ static void show_pinmux(const char *name, int i, int ofs) ccprintf("%s", edge ? "RISING" : "HIGH"); } ccprintf("\n"); + cflush(); } static void print_dio_str(uint32_t sel) @@ -379,6 +380,7 @@ static void print_dio_str(uint32_t sel) ccprintf(" DIOM%d\n", 30 - sel); else ccprintf("\n"); + cflush(); } static void show_pinmux_gpio(const char *name, int i, int ofs) @@ -428,11 +430,12 @@ static int command_pinmux(int argc, char **argv) for (i = 0; i <= 15; i++) show_pinmux_gpio("GPIO0_GPIO", i, 0xf8); for (i = 0; i <= 15; i++) - show_pinmux_gpio("GPIO1_GPIO", i, 0x134); + show_pinmux_gpio("GPIO1_GPIO", i, 0x138); for (i = 0; i <= 11; i++) show_pinmux_uart(i); + ccprintf("\n"); return EC_SUCCESS; } DECLARE_SAFE_CONSOLE_COMMAND(pinmux, command_pinmux,