Keith Hui has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/81884?usp=email )
Change subject: superio/nuvoton/nct6779d: Allow swapping PS/2 keyboard/mouse ports ......................................................................
superio/nuvoton/nct6779d: Allow swapping PS/2 keyboard/mouse ports
Add nvram option to allow user to manually swap PS/2 keyboard and mouse ports (i.e. keyboard port serves the mouse instead). This is intended for mainboards with only one PS/2 port for either keyboard or mouse. Until coreboot gets improved keyboard and mouse detection and initialization and can decide on its own when to swap, this option allows PS/2 mouse connected to this one port a chance to work in the OS.
Without this support, the one PS/2 port works with keyboards only.
TEST=With nvram option added to asus/p8x7x-series/v/p8z77-m and turned on, PS/2 mouse works.
Change-Id: I2d58719c207da973ad049cb9151d92f31ff6cd92 Signed-off-by: Keith Hui buurin@gmail.com --- M src/superio/nuvoton/nct6779d/superio.c 1 file changed, 9 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/84/81884/1
diff --git a/src/superio/nuvoton/nct6779d/superio.c b/src/superio/nuvoton/nct6779d/superio.c index e908c9c..09942d6 100644 --- a/src/superio/nuvoton/nct6779d/superio.c +++ b/src/superio/nuvoton/nct6779d/superio.c @@ -12,6 +12,7 @@ { uint8_t byte; uint8_t power_status; + uint8_t swap_kbd_mouse;
if (!dev->enabled) return; @@ -38,12 +39,20 @@
power_status = get_uint_option("power_on_after_fail", CONFIG_MAINBOARD_POWER_FAILURE_STATE) & 0x03; + swap_kbd_mouse = get_uint_option("swap_keyboard_and_mouse", 0) & 0x1; pnp_enter_conf_mode(dev); pnp_set_logical_device(dev); byte = pnp_read_config(dev, 0xe4); byte &= ~0x60; byte |= (power_status << 5); pnp_write_config(dev, 0xe4, byte); + /* Swap keyboard and mouse port if requested */ + byte = pnp_read_config(dev, 0xe0); + if (swap_kbd_mouse) + byte |= (1 << 2); + else + byte &= ~(1 << 2); + pnp_write_config(dev, 0xe0, byte); pnp_exit_conf_mode(dev); break; }