g: add wake pin info to pinmux command

It is useful to be able to see which pins are set as wake pins and what
type they are. This change adds prints to show_pinmux to describe the
wake pins.

BUG=none
BRANCH=none
TEST='pinmux' should show DIOA12 as a wake_low source.

Change-Id: I2a0ccdbf9b07abb627c3d52c7dd28433a2beff3c
Signed-off-by: Mary Ruthven <mruthven@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/363494
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
This commit is contained in:
Mary Ruthven
2016-07-26 16:35:11 -07:00
committed by chrome-bot
parent 43b2f5bac6
commit eb0660283d

View File

@@ -335,9 +335,11 @@ static void show_pinmux(const char *name, int i, int ofs)
{
uint32_t sel = DIO_SEL_REG(i * 8 + ofs);
uint32_t ctl = DIO_CTL_REG(i * 8 + ofs);
uint32_t bitmask = 1 << (i + ofs / 8);
uint32_t edge = GREG32(PINMUX, EXITEDGE0) & bitmask;
/* skip empty ones (ignoring drive strength bits) */
if (sel == 0 && (ctl & (0xf << 2)) == 0)
if (!sel && !(ctl & (0xf << 2)) && !(GREG32(PINMUX, EXITEN0) & bitmask))
return;
ccprintf("%08x: %s%-2d %2d %s%s%s%s",
@@ -349,13 +351,20 @@ static void show_pinmux(const char *name, int i, int ofs)
(ctl & (1<<5)) ? " INV" : "");
if (sel >= 1 && sel <= 16)
ccprintf(" GPIO0_GPIO%d\n", sel - 1);
ccprintf(" GPIO0_GPIO%d", sel - 1);
else if (sel >= 17 && sel <= 32)
ccprintf(" GPIO1_GPIO%d\n", sel - 17);
ccprintf(" GPIO1_GPIO%d", sel - 17);
else if (sel >= 67 && sel <= 78)
ccprintf(" UART%s\n", uart_str[sel - 67]);
else
ccprintf("\n");
ccprintf(" UART%s", uart_str[sel - 67]);
if (GREG32(PINMUX, EXITEN0) & bitmask) {
ccprintf(" WAKE_");
if (GREG32(PINMUX, EXITINV0) & bitmask)
ccprintf("%s", edge ? "FALLING" : "LOW");
else
ccprintf("%s", edge ? "RISING" : "HIGH");
}
ccprintf("\n");
}
static void print_dio_str(uint32_t sel)