summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPatrick Rudolph <siro@das-labor.org>2017-07-28 17:34:49 +0200
committerPatrick Rudolph <siro@das-labor.org>2017-09-25 16:18:19 +0000
commit3b0f5426af8288bb039922405122282532cfa422 (patch)
tree54f50bc7983d1615321c31851a33b0821832521b /src
parent5661945c3b002da06ecef184df4d92a19fcabd58 (diff)
downloadcoreboot-3b0f5426af8288bb039922405122282532cfa422.tar.xz
ec/lenovo/pmh7: Dump revision and ID
Dump PMH7 revision and ID for diagnostic purposes. Tested on Lenovo T430: PMH7: ID 05 Revision 12 Change-Id: I60d15a8f740aeb974a79b27507e974a730cec174 Signed-off-by: Patrick Rudolph <siro@das-labor.org> Reviewed-on: https://review.coreboot.org/20807 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Arthur Heymans <arthur@aheymans.xyz> Reviewed-by: Alexander Couzens <lynxis@fe80.eu>
Diffstat (limited to 'src')
-rw-r--r--src/ec/lenovo/pmh7/pmh7.c4
-rw-r--r--src/ec/lenovo/pmh7/pmh7.h3
2 files changed, 7 insertions, 0 deletions
diff --git a/src/ec/lenovo/pmh7/pmh7.c b/src/ec/lenovo/pmh7/pmh7.c
index b2c3c08697..c9756795a0 100644
--- a/src/ec/lenovo/pmh7/pmh7.c
+++ b/src/ec/lenovo/pmh7/pmh7.c
@@ -121,6 +121,10 @@ static void enable_dev(struct device *dev)
if (get_option(&val, "trackpoint") != CB_SUCCESS)
val = 1;
pmh7_trackpoint_enable(val);
+
+ printk(BIOS_INFO, "PMH7: ID %02x Revision %02x\n",
+ pmh7_register_read(EC_LENOVO_PMH7_REG_ID),
+ pmh7_register_read(EC_LENOVO_PMH7_REG_REV));
}
struct chip_operations ec_lenovo_pmh7_ops = {
diff --git a/src/ec/lenovo/pmh7/pmh7.h b/src/ec/lenovo/pmh7/pmh7.h
index 772312cba4..d486ceb041 100644
--- a/src/ec/lenovo/pmh7/pmh7.h
+++ b/src/ec/lenovo/pmh7/pmh7.h
@@ -22,6 +22,9 @@
#define EC_LENOVO_PMH7_ADDR (EC_LENOVO_PMH7_BASE + 0x0c)
#define EC_LENOVO_PMH7_DATA (EC_LENOVO_PMH7_BASE + 0x0e)
+#define EC_LENOVO_PMH7_REG_ID 0xc2
+#define EC_LENOVO_PMH7_REG_REV 0xc3
+
void pmh7_register_set_bit(int reg, int bit);
void pmh7_register_clear_bit(int reg, int bit);
char pmh7_register_read(int reg);