summaryrefslogtreecommitdiff
path: root/payloads/libpayload/drivers/i8042/i8042.c
diff options
context:
space:
mode:
authorFurquan Shaikh <furquan@google.com>2018-06-29 09:24:54 -0700
committerPatrick Georgi <pgeorgi@google.com>2018-07-02 07:32:33 +0000
commit1299dc107dca75a586f05ebdeaf99ba6a974a5e7 (patch)
tree23c89d6fb4ba6bba3fc1ea570b6db6cc6850464f /payloads/libpayload/drivers/i8042/i8042.c
parent118fb60b3a67d43aa71fc5cffb9b424d118866d9 (diff)
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 <furquan@google.com> Reviewed-on: https://review.coreboot.org/27289 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Duncan Laurie <dlaurie@chromium.org> Reviewed-by: Aaron Durbin <adurbin@chromium.org> Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Diffstat (limited to 'payloads/libpayload/drivers/i8042/i8042.c')
-rw-r--r--payloads/libpayload/drivers/i8042/i8042.c13
1 files changed, 8 insertions, 5 deletions
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 <libpayload.h>
#include <stddef.h>
+#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;