]> xenbits.xensource.com Git - people/andrewcoop/seabios.git/commitdiff
ps2: Eliminate "etc/ps2-poll-only"; use CONFIG_HARDWARE_IRQ instead
authorKevin O'Connor <kevin@koconnor.net>
Mon, 10 Aug 2015 19:50:53 +0000 (15:50 -0400)
committerKevin O'Connor <kevin@koconnor.net>
Mon, 24 Aug 2015 15:02:13 +0000 (11:02 -0400)
The "etc/ps2-poll-only" runtime setting is directly tied to the new
CONFIG_HARDWARE_IRQ setting - use the compile time setting to control
both.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
docs/Runtime_config.md
src/hw/ps2port.c

index 962a8a9ee02e4649b0537e11d6daa0b41d7b8675..4ac0eae3df7363b687f319fdd8ca5a5fd70bcd4b 100644 (file)
@@ -180,7 +180,6 @@ There are several additional configuration options available in the
 | boot-fail-wait      | If no boot devices are found SeaBIOS will reboot after 60 seconds. Set this to the amount of time (in milliseconds) to customize the reboot delay or set to -1 to disable rebooting when no boot devices are found
 | extra-pci-roots     | If the target machine has multiple independent root buses set this to a positive value. The SeaBIOS PCI probe will then search for the given number of extra root buses.
 | ps2-keyboard-spinup | Some laptops that emulate PS2 keyboards don't respond to keyboard commands immediately after powering on. One may specify the amount of time (in milliseconds) here to allow as additional time for the keyboard to become responsive. When this field is set, SeaBIOS will repeatedly attempt to detect the keyboard until the keyboard is found or the specified timeout is reached.
-| ps2-poll-only       | SeaBIOS normally sets up the PS2 port to generate interrupts on keyboard and mouse events. One may set this field to a non-zero value to have SeaBIOS periodically poll the PS2 port for events instead. This may be useful on machines that do not properly route PS2 port interrupts.
 | optionroms-checksum | Option ROMs are required to have correct checksums. However, some option ROMs in the wild don't correctly follow the specifications and have bad checksums. Set this to a zero value to allow SeaBIOS to execute them anyways.
 | pci-optionrom-exec  | Controls option ROM execution for roms found on PCI devices (as opposed to roms found in CBFS/fw_cfg).  Valid values are 0: Execute no ROMs, 1: Execute only VGA ROMs, 2: Execute all ROMs. The default is 2 (execute all ROMs).
 | s3-resume-vga-init  | Set this to a non-zero value to instruct SeaBIOS to run the vga rom on an S3 resume.
index c368afc082cd3887787d3d6e514b0fb1003ba1a9..d5504f71ea40bed9e7f3bf982e6027781879b2c6 100644 (file)
@@ -211,7 +211,6 @@ ps2_sendbyte(int aux, u8 command, int timeout)
 }
 
 u8 Ps2ctr VARLOW = I8042_CTR_KBDDIS | I8042_CTR_AUXDIS;
-u8 Ps2poll VARFSEG;
 
 static int
 __ps2_command(int aux, int command, u8 *param)
@@ -345,10 +344,9 @@ ps2_mouse_command(int command, u8 *param)
 
     // Update ps2ctr for mouse enable/disable.
     if (command == PSMOUSE_CMD_ENABLE || command == PSMOUSE_CMD_DISABLE) {
-        u8 ps2poll = GET_GLOBAL(Ps2poll);
         u8 ps2ctr = GET_LOW(Ps2ctr);
         if (command == PSMOUSE_CMD_ENABLE)
-            ps2ctr = ((ps2ctr | (ps2poll ? 0 : I8042_CTR_AUXINT))
+            ps2ctr = ((ps2ctr | (CONFIG_HARDWARE_IRQ ? I8042_CTR_AUXINT : 0))
                       & ~I8042_CTR_AUXDIS);
         else
             ps2ctr = (ps2ctr | I8042_CTR_AUXDIS) & ~I8042_CTR_AUXINT;
@@ -420,10 +418,11 @@ done:
     pic_eoi1();
 }
 
+// Check for ps2 activity on machines without hardware irqs
 void
 ps2_check_event(void)
 {
-    if (! CONFIG_PS2PORT || !GET_GLOBAL(Ps2poll))
+    if (! CONFIG_PS2PORT || CONFIG_HARDWARE_IRQ)
         return;
     u8 ps2ctr = GET_LOW(Ps2ctr);
     if ((ps2ctr & (I8042_CTR_KBDDIS|I8042_CTR_AUXDIS))
@@ -510,7 +509,7 @@ ps2_keyboard_setup(void *data)
 
     // Keyboard Mode: disable mouse, scan code convert, enable kbd IRQ
     Ps2ctr = (I8042_CTR_AUXDIS | I8042_CTR_XLATE
-              | (Ps2poll ? 0 : I8042_CTR_KBDINT));
+              | (CONFIG_HARDWARE_IRQ ? I8042_CTR_KBDINT : 0));
 
     /* Enable keyboard */
     ret = ps2_kbd_command(ATKBD_CMD_ENABLE, NULL);
@@ -528,11 +527,8 @@ ps2port_setup(void)
         return;
     dprintf(3, "init ps2port\n");
 
-    Ps2poll = romfile_loadint("etc/ps2-poll-only", 0);
-    if (!Ps2poll) {
-        enable_hwirq(1, FUNC16(entry_09));
-        enable_hwirq(12, FUNC16(entry_74));
-    }
+    enable_hwirq(1, FUNC16(entry_09));
+    enable_hwirq(12, FUNC16(entry_74));
 
     run_thread(ps2_keyboard_setup, NULL);
 }