Skip to content

Commit a3cba9e

Browse files
committed
fsp: tgl: add DEBUG_GPIO capabilities
1 parent 1959f19 commit a3cba9e

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/x86/tgl_fsp.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,12 @@
148148
#define GPIO_GPPC_T2_CFG_OFF (0x8c0)
149149
#define GPIO_GPPC_T3_CFG_OFF (0x8d0)
150150

151+
#ifdef DEBUG_GPIO
152+
#define GPIO_DEBUG_PRINTF(...) wolfBoot_printf(__VA_ARGS__)
153+
#else
154+
#define GPIO_DEBUG_PRINTF(...) do {} while(0)
155+
#endif /* DEBUG_GPIO */
156+
151157
SI_PCH_DEVICE_INTERRUPT_CONFIG mPchHDevIntConfig[] = {
152158
{30, 0, SiPchIntA, 16},
153159
};
@@ -1463,6 +1469,9 @@ static void tgl_gpio_configure(const struct tgl_gpio_conf *gpio)
14631469

14641470
g = gpio->gpio;
14651471

1472+
GPIO_DEBUG_PRINTF("Gpio port: %d off: 0x%x :\r\n", i, g.comm_port_id,
1473+
g.cfg_offset);
1474+
14661475
dw0 = _dw0 = pch_read32(g.comm_port_id, g.cfg_offset);
14671476
dw1 = _dw1 = pch_read32(g.comm_port_id, g.cfg_offset + 4);
14681477

@@ -1490,6 +1499,9 @@ static void tgl_gpio_configure(const struct tgl_gpio_conf *gpio)
14901499
dw0 &= ~(GPIO_RXEVCONF_MASK);
14911500
dw0 |= gpio->gpio_rxevconf << GPIO_RXEVCONF_SHIFT;
14921501
}
1502+
1503+
GPIO_DEBUG_PRINTF("dw0: 0x%x -> 0x%x, dw1: 0x%x->0x%x\r\n",
1504+
_dw0, dw0, _dw1, dw1);
14931505
if (_dw1 != dw1) {
14941506
pch_write32(g.comm_port_id, g.cfg_offset + 4, dw1);
14951507
}

0 commit comments

Comments
 (0)