summaryrefslogtreecommitdiff
path: root/src/pc80
diff options
context:
space:
mode:
authorStefan Reinauer <stepan@coresystems.de>2010-02-28 19:12:37 +0000
committerStefan Reinauer <stepan@openbios.org>2010-02-28 19:12:37 +0000
commit9c3e8b52d64c95d8e27c187598f6e4e41e596da9 (patch)
treeda2b9060f062598d1a382668278351340ae85afc /src/pc80
parentc89c4d4602d76e87391ea124aea8e11f2c3eea21 (diff)
use names instead of numbers where possible, also print a better message if no
keyboard is connected. Signed-off-by: Stefan Reinauer <stepan@coresystems.de> Acked-by: Stefan Reinauer <stepan@coresystems.de> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@5173 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'src/pc80')
-rw-r--r--src/pc80/keyboard.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/pc80/keyboard.c b/src/pc80/keyboard.c
index 04abe043cb..6b80620695 100644
--- a/src/pc80/keyboard.c
+++ b/src/pc80/keyboard.c
@@ -154,7 +154,7 @@ static u8 send_keyboard(u8 command)
}
regval = inb(KBD_DATA);
--resend;
- } while (regval == 0xFE && resend > 0);
+ } while (regval == KBD_REPLY_RESEND && resend > 0);
return regval;
}
@@ -183,7 +183,13 @@ void pc_keyboard_init(struct pc_keyboard *keyboard)
/* reset keyboard and self test (keyboard side) */
regval = send_keyboard(0xFF);
- if (regval != 0xFA) {
+ if (regval == KBD_REPLY_RESEND) {
+ /* keeps sending RESENDs, probably no keyboard. */
+ printk_info("No PS/2 keyboard detected.\n");
+ return;
+ }
+
+ if (regval != KBD_REPLY_ACK) {
printk_err("Keyboard selftest failed ACK: 0x%x\n", regval);
return;
}
@@ -206,27 +212,27 @@ void pc_keyboard_init(struct pc_keyboard *keyboard)
/* disable the keyboard */
regval = send_keyboard(0xF5);
- if (regval != 0xFA) {
+ if (regval != KBD_REPLY_ACK) {
printk_err("Keyboard disable failed ACK: 0x%x\n", regval);
return;
}
/* Set scancode command */
regval = send_keyboard(0xF0);
- if (regval != 0xFA) {
+ if (regval != KBD_REPLY_ACK) {
printk_err("Keyboard set scancode cmd failed ACK: 0x%x\n", regval);
return;
}
/* Set scancode mode 2 */
regval = send_keyboard(0x02);
- if (regval != 0xFA) {
+ if (regval != KBD_REPLY_ACK) {
printk_err("Keyboard set scancode mode failed ACK: 0x%x\n", regval);
return;
}
/* enable the keyboard */
regval = send_keyboard(0xF4);
- if (regval != 0xFA) {
+ if (regval != KBD_REPLY_ACK) {
printk_err("Keyboard enable failed ACK: 0x%x\n", regval);
return;
}