12 #define KBD_COMMAND 0x64
13 #define KBD_STATUS 0x64
14 #define KBD_IBF (1 << 1)
15 #define KBD_OBF (1 << 0)
18 #define KBC_CMD_READ_COMMAND 0x20
19 #define KBC_CMD_WRITE_COMMAND 0x60
20 #define KBC_CMD_AUX_ENABLE 0xA8
21 #define KBC_CMD_AUX_TEST 0xA9
22 #define KBC_CMD_SELF_TEST 0xAA
23 #define KBC_CMD_KBD_TEST 0xAB
39 #define KBC_REPLY_SELFTEST_OK 0x55
44 #define KBD_REPLY_POR 0xAA
45 #define KBD_REPLY_ACK 0xFA
46 #define KBD_REPLY_RESEND 0xFE
49 #define KBC_TIMEOUT_IN_MS 400
61 "Unexpected Keyboard controller input buffer full\n");
75 "Keyboard controller output buffer result timeout\n");
91 "Couldn't cleanup the keyboard controller buffers\n");
105 if (aux_probe_result)
106 *aux_probe_result = 0;
126 if (self_test != 0x55) {
146 if (self_test != 0x00) {
156 printk(
BIOS_ERR,
"Timeout waiting for controller during aux enable.\n");
161 printk(
BIOS_ERR,
"Timeout waiting for controller during aux probe.\n");
166 if (!(
byte & (0x1 << 5))) {
180 if (self_test != 0x00) {
181 printk(
BIOS_ERR,
"No device detected on auxiliary channel: 0x%x\n",
187 if (aux_probe_result)
188 *aux_probe_result = 1;
209 if (command == 0xFF) {
218 "Could not send keyboard command %02x\n",
236 if (!
CONFIG(DRIVERS_PS2_KEYBOARD))
289 if (regval != 0xAA) {
318 "Keyboard set scancode mode failed ACK: 0x%x\n", regval);
343 return aux_dev_detected;
static int acpi_is_wakeup_s3(void)
cb_err
coreboot error codes
@ CB_KBD_INTERFACE_FAILURE
@ CB_SUCCESS
Call completed successfully.
@ CB_KBD_CONTROLLER_FAILURE
#define printk(level,...)
void mdelay(unsigned int msecs)
void outb(u8 val, u16 port)
#define KBC_CMD_SELF_TEST
#define KBC_CMD_READ_COMMAND
#define KBC_TIMEOUT_IN_MS
static int kbc_cleanup_buffers(void)
#define KBC_CMD_AUX_ENABLE
static int kbc_input_buffer_empty(void)
static enum cb_err kbc_self_test(uint8_t probe_aux, uint8_t *aux_probe_result)
void set_kbc_ps2_mode(void)
static int kbc_output_buffer_full(void)
static u8 send_keyboard(u8 command)
uint8_t pc_keyboard_init(uint8_t probe_aux)
#define BIOS_INFO
BIOS_INFO - Expected events.
#define BIOS_DEBUG
BIOS_DEBUG - Verbose output.
#define BIOS_ERR
BIOS_ERR - System in incomplete state.
#define BIOS_WARNING
BIOS_WARNING - Bad configuration.