From 1299dc107dca75a586f05ebdeaf99ba6a974a5e7 Mon Sep 17 00:00:00 2001 From: Furquan Shaikh Date: Fri, 29 Jun 2018 09:24:54 -0700 Subject: payloads/libpayload/drivers/i8042: Add macros for i8042 commands This change adds macros for commands (written to 0x64) and keyboard commands (written to 0x60) for 8042 controller. BUG=b:110024487 Change-Id: I74b2388d048e35b5bdf5bd862d0975e88f1bd6af Signed-off-by: Furquan Shaikh Reviewed-on: https://review.coreboot.org/27289 Tested-by: build bot (Jenkins) Reviewed-by: Duncan Laurie Reviewed-by: Aaron Durbin Reviewed-by: Paul Menzel --- payloads/libpayload/drivers/i8042/i8042.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'payloads/libpayload/drivers/i8042/i8042.c') diff --git a/payloads/libpayload/drivers/i8042/i8042.c b/payloads/libpayload/drivers/i8042/i8042.c index b67944871f..69740d9f44 100644 --- a/payloads/libpayload/drivers/i8042/i8042.c +++ b/payloads/libpayload/drivers/i8042/i8042.c @@ -31,6 +31,8 @@ #include #include +#include "i8042.h" + /* Overflowing FIFO implementation */ struct fifo { @@ -204,13 +206,13 @@ u8 i8042_probe(void) kbc_init = 1; /* Disable first device */ - if (i8042_cmd(0xad) != 0) { + if (i8042_cmd(I8042_CMD_DIS_KB) != 0) { kbc_init = 0; return 0; } /* Disable second device */ - if (i8042_cmd(0xa7) != 0) { + if (i8042_cmd(I8042_CMD_DIS_AUX) != 0) { kbc_init = 0; return 0; } @@ -220,17 +222,18 @@ u8 i8042_probe(void) read_data(); /* Self test. */ - if (i8042_cmd_with_response(0xaa) != 0x55) { + if (i8042_cmd_with_response(I8042_CMD_SELF_TEST) + != I8042_SELF_TEST_RSP) { kbc_init = 0; return 0; } /* Test secondary port */ - if (i8042_cmd_with_response(0xa9) == 0) + if (i8042_cmd_with_response(I8042_CMD_AUX_TEST) == 0) aux_fifo = fifo_init(4 * 32); /* Test first PS/2 port */ - if (i8042_cmd_with_response(0xab) == 0) + if (i8042_cmd_with_response(I8042_CMD_KB_TEST) == 0) ps2_fifo = fifo_init(2 * 16); kbc_init = 0; -- cgit v1.2.3