Christian Walter has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/38586 )
Change subject: superio/aspeed/ast2400: Add eSPI auto detection ......................................................................
superio/aspeed/ast2400: Add eSPI auto detection
Change-Id: Ide58f3210475d949d69d9a91da8b83fc5b2b38ac Signed-off-by: Christian Walter christian.walter@9elements.com --- M src/superio/aspeed/ast2400/superio.c 1 file changed, 11 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/86/38586/1
diff --git a/src/superio/aspeed/ast2400/superio.c b/src/superio/aspeed/ast2400/superio.c index 6f2cbcd..556dea9 100644 --- a/src/superio/aspeed/ast2400/superio.c +++ b/src/superio/aspeed/ast2400/superio.c @@ -31,7 +31,17 @@ if (!dev->enabled) return;
- if (conf && conf->use_espi) { + + // Detect eSPI Mode automatically + pnp_enter_conf_mode(dev); + pnp_set_logical_device(dev); + u8 val = pnp_read_config(dev, 0x70) & 0x07; + pnp_exit_conf_mode(dev); + + if (val == 0xC) { + if (conf) + conf->use_espi = 1; + pnp_enter_conf_mode(dev); pnp_set_logical_device(dev); /* In ESPI mode must write 0 to IRQ level on every LDN */