American Megatrends, Inc.

KbcEmulation

Copyright

Release Notes

© American Megatrends, Inc.


KbcEmulation

AMIBIOS Document References

Previous Release Notes

Release Notes-016.htm

Release Notes-017.htm

Release Notes-018.htm

Release Notes-019.htm

Built on 15:22:21 12/08/14


Release Notes - NDA Required

Component Information:
Component Title: KbcEmulation
Component Reference Name: KbcEmul
Component Type: eModule
Release Date: 2012-04-06
Source Control Label: 4.6.3-KbcEmulation-016
Source Control Location: SS: Alaska;$/Alaska/Source/Modules/KbcEmulation/ALASKA/KBCEMUL;
Driver Dependencies
USB
Protocol Dependencies
N0NE
File Dependencies
N0NE
Non-Compiled BIN and LIB File(s) within this Component:
N0NE
Component Description:
KbcEmulation eModule can be added to EFI BIOS to support emulation for USB keyboard and mouse - More details check Description page
Filename | Description
Main Component | Root\Core\em\KbcEmul
KbcEmul.cif | Component information file for the eModule.
KbcEmul.mak | Make file becomes part of the BIOS build process.
KbcEmul.sdl | Contains BIOS build parameters.
KbcEmul.dxs | File that has Dependency of KbcEmulation Module with Other Modules.
KbcEmul.c | KBC emulation driver entry point and initialize the SMI for port 6064.
KbcEmul.h | KBC emulation header file.
KbcEmulLib.h | KBC emulation Lib header file used in other files.
KbcEmulLib.c | KBC emulation lib file used in other files.
Kbc.h | KBC Header file has the structure definition for Virtual and Legacy devices.
KbcDevEmul.h | Devices header file.
Kbccore.c | It has function for port 60 read, 60 write, 64 read and 64 write.
Legacykbc.c | LegacyKBC handles the with KBC model.
Legacykbd.c | Legacy Keyboard functions.
LegacyMouse.c | Legacy Mouse functions.
VirtualKbc.c | Handles the Virtual KBC(Without KBC system) function.
VirtualKbd.c | Virtual keyboard functions.
VirtualMouse.c | Handles the Virtual mouse functions.
Ap4x.h | It has the Aptio4.x compatibility include files and headers.
Ap4x.c | It has the Aptio4.x compatibility function.
KbcEmulation.chm | CHM file for the eModule.
KbcEmulAcpi.c | Handles the KbcEmulAcpi functions.
KBCUHCI
ModulePart 		Root\Core\em\KbcEmul - Provide functions to Handle the SMI events for port 60/64
KbcUhci.cif | Component information file for the Module Part.
KbcUhci.c | Handles the SMI events for port 60/64.
KbcUhci.h | Header file for UHCI controller for Emulation.
KBCOHCI
ModulePart 		Root\Core\em\KbcEmul - Provide functions to Handle the SMI events for port 60/64.
KbcOhci.cif | Component information file for the Module Part.
KbcOhci.c | Handles the SMI events for port 60/64.
KbcOhci.h | Header file for OHCI controller for Emulation.
KBCEMULIRQ
ModulePart 		Root\Core\em\KbcEmul - Provide functions to handle the IRQ1 and IRQ12 generation
KbcEmulIrq.cif | Component information file for the Module Part.
KbcEmulIrq.c | Handles the IRQ1 and IRQ12 generation.
KBCSOUTHBRIDGE-IBEXPEAK
ModulePart 		Root\Board\em\KbcSbBoard - South Bridge Board module for KbcEmulation
KbcSbBoard.cif | Component information file for the Module Part.
KbcSbBoard.c | South bridge related code for Emulation.
KbcEmulationBoard
ModulePart 		Root\Board\em\KbcEmulBoard - Board module part for the KbcEmulation
KbcEmulBoard.cif | Component information file for the Module Part.
KbcEmulBoard.c | Board related code for Emulation.
BIOS Parameters
KbcEmulation Module Parameters:
Parameter Name | Type | Description
EMUL6064_SUPPORT | Boolean | Main switch to enable KBC Emulation support in Project.
UHCI_EMUL_SUPPORT | Boolean | Switch to enable UHCI based Emulation support in Project.
OHCI_EMUL_SUPPORT | Boolean | Switch to enable OHCI based Emulation support in Project.
IRQ_EMUL_SUPPORT | Boolean | Switch to enable software method of IRQ generation in Project.
EMULATION_ACPI_ENABLE_DISPATCH | Boolean | 1-Emulation SMI's will be disabled in the USB controller.
ICH10_WORKAROUND | Boolean | Switch to enable ICH10 Workaround. Emulation enabled and one of the USB controller disabled, We must clear the SMI status on disabled USB controller also
SW_IRQ_GENERATION_REG | Integer | Software IRQ generation regsiter from SB to generate the IRQ12 and IRQ1.
AMI Build Tools:
Tools Label: 4.5.5_TOOLS_38, Dated: 2011-12-20
Visual eBios: RSS.5.70.0171, Dated: 2011-12-20
Compiler Tool(s): Microsoft's Windows Driver Kit (WDK) Ver. 7600.16385.1
New features added in this label:
None
General Bug Fixes:
  • EIP#80605 - It can not boot to DOS, If to disable 1st TOKEN report OHCI by setup on legacy free system(must add KBC Emulation module).
EIP addressed in this label:
  • EIP#80605 - It can not boot to DOS, If to disable 1st TOKEN report OHCI by setup on legacy free system(must add KBC Emulation module).
  • EIP#81553 - Change SW_IRQ_GENERATION_REG value based on the PM_BASE_ADDRESS SDL token value
Files changed for EIP fixes:
  • Root\core\em\KbcEmul\KbcEmul.sdl(EIP #81553)
  • Root\core\em\KbcEmul\KbcOhci.c(EIP #80605)
Known issues and limitations in this label:
  1. Issue
    • Symptom:
      PS2 keyboard doesn't work in RedHat Linux 4 when the Emulation is enabled.
    • Root Cause:
      Linux disables the Legacy USB SMI. But still the Port 60/64 Access SMI is enabled in offset C0 and C1 of the UHCI pci configuration space. This makes any Port60/64 read returns 0.
    • Solution:
      Disable the Port60/64 Trapping SMI in ACPI Enable callback resolved the issue.
Remaining Issues:
None
Unit Testing:
  • LegacyFree system, boots to DOS, try Edit command.
  • If the KbcEmulation module is disabled, Edit will not work. Enabled, Edit will work.
Validation Testing:
Validate the KBC Emulation module with the following test cases and conditions.

  • UHCI Emulation Testing With KBC Presence

    1. Verify the Keyboard and Mouse working Option ROM
      • Enable the KBC Emulation in the USB Setup Menu
      • Connect the PCI or PCI-E device that supports Keyboard and Mouse inside the option ROM
      • Verify Ps2 keyboard, USB Keyboard , Ps2 Mouse and USB mouse works inside the option ROM

      Note: PCI or PCI-E card option ROM should be reading the Keyboard and Mouse data directly from the Port60/64 or through Interrupt.

    2. Verify the Keyboard and Mouse working DOS
      • Enable the KBC Emulation in the USB Setup Menu
      • Boot the system to DOS
      • Verify Ps2 keyboard, USB Keyboard, Ps2 Mouse and USB mouse works fine in DOS and DOS Edit.

    3. Verify OS installation and Booting
      • Enable the KBC Emulation in the USB Setup Menu
      • Verify the Installation works for Win7 32 bit and Ubuntu x32 10.10
      • Verify Ps2Keyboard, Ps2Mouse, USB Keyboard and USB Mouse works fine on installation.
      • Verify the booting to Win7 32 bit and Ubuntu x32 10.10

  • UHCI Emulation Testing Without KBC Presence

    1. Verify the Keyboard and Mouse working Option ROM
      • Enable the KBC Emulation in the USB Setup Menu
      • Connect the PCI or PCI-E device that supports Keyboard and Mouse inside the option ROM
      • Verify USB Keyboard and USB mouse works inside the option ROM

      Note: PCI or PCI-E card option ROM should be reading the Keyboard and Mouse data directly from the Port60/64 or through Interrupt.

    2. Verify the Keyboard and Mouse working DOS
      • Enable the KBC Emulation in the USB Setup Menu
      • Boot the system to DOS
      • Verify USB Keyboard and USB mouse works fine in DOS and DOS Edit.

    3. Verify OS installation and Booting
      • Enable the KBC Emulation in the USB Setup Menu
      • Verify the Installation works for Win7 32 bit and Ubuntu x32 10.10
      • Verify USB Keyboard and USB Mouse works fine on installation.
      • Verify the booting to Win7 32 bit and Ubuntu x32 10.10

  • OHCI Emulation Testing With KBC Presence

    1. Verify the Keyboard and Mouse working Option ROM
      • Enable the KBC Emulation in the USB Setup Menu
      • Connect the PCI or PCI-E device that supports Keyboard and Mouse inside the option ROM
      • Verify Ps2 keyboard, USB Keyboard , Ps2 Mouse and USB mouse works inside the option ROM

      Note: PCI or PCI-E card option ROM should be reading the Keyboard and Mouse data directly from the Port60/64 or through Interrupt.

    2. Verify the Keyboard and Mouse working DOS
      • Enable the KBC Emulation in the USB Setup Menu
      • Boot the system to DOS
      • Verify Ps2 keyboard, USB Keyboard, Ps2 Mouse and USB mouse works fine in DOS and DOS Edit.

    3. Verify OS installation and Booting
      • Enable the KBC Emulation in the USB Setup Menu
      • Verify the Installation works for Win7 32 bit and Ubuntu x32 10.10
      • Verify Ps2Keyboard, Ps2Mouse, USB Keyboard and USB Mouse works fine on installation.
      • Verify the booting to Win7 32 bit and Ubuntu x32 10.10

  • OHCI Emulation Testing Without KBC Presence

    1. Verify the Keyboard and Mouse working Option ROM
      • Enable the KBC Emulation in the USB Setup Menu
      • Connect the PCI or PCI-E device that supports Keyboard and Mouse inside the option ROM
      • Verify USB Keyboard and USB mouse works inside the option ROM

      Note: PCI or PCI-E card option ROM should be reading the Keyboard and Mouse data directly from the Port60/64 or through Interrupt.

    2. Verify the Keyboard and Mouse working DOS
      • Enable the KBC Emulation in the USB Setup Menu
      • Boot the system to DOS
      • Verify USB Keyboard and USB mouse works fine in DOS and DOS Edit.

    3. Verify OS installation and Booting
      • Enable the KBC Emulation in the USB Setup Menu
      • Verify the Installation works for Win7 32 bit and Ubuntu x32 10.10
      • Verify USB Keyboard and USB Mouse works fine on installation.
      • Verify the booting to Win7 32 bit and Ubuntu x32 10.10

Validation TEST REPORT:
Here is the Quality Assurance System Test Plan
Here is the Quality Assurance Test Results
Release History:
4.6.3-KbcEmulation-016

  • [TAG] - EIP81553
    [Category] - Improvement
    [Description] - Change SW_IRQ_GENERATION_REG value based on the PM_BASE_ADDRESS SDL token value
    [Files] - KbcEmul.sdl

  • [TAG] - EIP80605
    [Category] - Bug Fix
    [Severity] - Important
    [Symptom] - It can not boot to DOS, If to disable 1st TOKEN report OHCI by setup on legacy free system(must add KBC Emulation module).
    [RootCause] - gOHCIBar gets value from disabled controller and its not valid value
    [Solution] - Added condition to check to have valid value in gOHCIBar
    [Files] - KbcOhci.c

4.6.3-KbcEmulation-015

  • [TAG] - EIP74128
    [Category] - New Feature
    [Description] - Disable the KbcEmulation Smi’s on ACPI enable and Disable SMI call
    [Files] - Kbccore.c, KbcEmuulAcpi.c, KbcEmul.c, KbcEmul.cif, KbcEmul.h, KbcEmul.sdl

  • [TAG] - EIP78617
    [Category] - Bug Fix
    [Severity] - Important
    [Symptom] - When KBCEmulation is enabled during OS runtime phase, system reboots
    [RootCause] - if the SMI happens from AP, Kbcemulation driver unable to handle it.
    [Solution] - Added logic in KbcCore.c to find the CPU that cause SMI and access the corresponding AL register.
    [Files] - Ap4x.h, KbcCore.c

4.6.3-KbcEmulation-014

  • [TAG] - EIP 58434
    [Category]- BUG FIX
    [Severity]- Major
    [Symptom] - IRQ1 not enabled on LegacyFree(No KBC) system while booting to Legacy OS.
    [RootCause]- As there is no KBC, IRQ1 not used by system and it's not enabled.
    [Solution] - When the Emulation module enabled, IRQ1 is added to the used IRQ list.So it's enabled while booting to Legacy OS.
    [Files] - KbcEmul.c

  • [[TAG] - EIP 62672
    [Category]- BUG FIX
    [Severity]- Minor
    [Symptom] - USB PEI (enable KBC emulation) can't boot from USB
    [RootCause]- KbcEmulation gets the wrong BAR address that was initilized by USB PEI driver
    [Solution] - Ohci Base address reading should be done after the PCIbus driver allocates the resource for the OHCI controller
    [Files] - KbcOhci.c

  • [TAG] - EIP 58220
    [Category]- BUG FIX
    [Severity]- Minor
    [Symptom] - Remote Keyboard doesn't work when the Ps2 Keyboard not attached in the system
    [RootCause]- Write Keyboard Data command D2 is not handled
    [Solution] - When the Ps2 device connected we are writting the data to data port. But when the device is not connected we are not sending the data. As this is KBC controller command data, we need to send the data even though device is not connected
    [Files] - LegacyKbc.c

  • [TAG] - EIP71408
    [Category] - Improvement
    [Description] - Remove the customer name reference from the KbcEmulation module.
    [Files] - KbcDevEmul.h,VirtualKbc.c

4.6.3-KbcEmulation-013

  • [TAG]- EIP 57436
    [Category]-IMPROVEMENT
    [Description]- PI1.1 Support.
    [Files]- Ap4x.h, KbcEmul.c

4.6.3-KbcEmulation-012

  • EIP 53687
    [Category] - Improvement
    [Description] - AMI headers update for KbcEmulation Module
    [Files] - KbcEmul.mak,KbcEmul.dxs,KbcEmul.c,KbcEmul.h,KbcEmulLib.h,KbcEmulLib.c,Kbc.h,KbcDevEmul.h,Kbccore.c,Legacykbc.c,
    Legacykbd.c,LegacyMouse.c,VirtualKbc.c,VirtualKbd.c,VirtualMouse.c,Ap4x.h,Ap4x.c,KbcUhci.c, KbcUhci.h,KbcEmulIrq.c, KbcOhci.c, Kbcohci.h
  • EIP 45498
    [Category]- BUG FIX
    [Severity]- Minor
    [Symptom] - In KbcEmulation module, function kbc_kbd_wdata() of Legacykbc.c can cause system to hang in SMM.
    [RootCause]- For loop variable not decremented
    [Solution] - For loop variable decremented to avoid the deadloop
    [Files] - LegacyKbc.c
  • EIP 52171
    [Category]- BUG FIX
    [Severity]- Minor
    [Symptom] - System gives Assert when Keyboard Reset Command issued.
    [RootCause]- KBC Emulation Module SMI handler is using EFI Runtime services for Reset() Instead of SMM RunTime Services
    [Solution] - Smm Runtime Services used to reset the system
    [Files] - VirtualKbc.c
  • EIP 39755
    Workaround added when the Emulation enabled and Another USB controller is disabled in ICH10.
    [Files] - kbcuhci.c
  • ICH10 workaround added.
    [Files] - KbcEmul.sdl, KbcUhci.c

4.6.3-KbcEmulation-011

  • EIP 39712
    OHCI Emulation support Added.
    NOTE:This Version of label should be used with USB module label 4.06.03_USB_08.10.00 or above.

4.6.3-KbcEmulation-010

  • EIP 26451
    [Symptom] - KbcEmulation can't install FreeBSD.
    [Solution] - Implemented command 0xAA (Controller self-test) and 0xAB (Keyboard interface test)
  • EIP 34601
    Before Regsiter the SMI call back for the USB PCI device, check the USB PCI device presence.
  • EIP 28411
    [Symptom] - Install Netware6.5 SP8 Fail.
    [Solution] - Single byte and two Byte command is identified properly and handled.
  • EIP 33687
    Corrected the USB KB stopped working in DOS after "net init" utility is run.
  • EIP 28411
    Corrected arrow keys not working properly during Netware 6.5 installation.
  • The Keyboard data wrongly pushed to Mouse device. That makes keyboard stops working. Corrected this problem.

4.6.3-KbcEmulation-009

  • EIP 25184
    Sb module component created to support SB porting for Emulation module.
    NOTE: The Template SB module returns always RMH disabled. For RMH enabled chipset, For Example Ibexpeak chipset Ibexpeak SB module present and it should be replaced with Sb-Template.

4.6.3-KbcEmulation-008

  • Coding Standard and File header updated.

4.6.3-KbcEmulation-007

  • EIP 21131
    Added Emulation Support for RMH Enable/Disable.

4.6.3-KbcEmulation-006

  • EIP 18730
    [Symptom] - With Latest CSM Emulation doesn't work.
    [Solution] - Added Emulation enable code in outside SMM. This is called from Uhcd.c when ever USB mode changes to Legacy.

4.6.3-KbcEmulation-005

  • Keyboard & Mouse enable/disable command handled.

4.6.3-KbcEmulation-004

  • KBC presence done only based on 0xFF value .
  • IRQ1 or IRQ12 generated again if there is pending data.

4.6.3-KbcEmulation-003

  • IRQ1 Enabled before generating the IRQ1.
  • All UHCI controller registed for the SMI handler.

4.6.3-KbcEmulation-002

  • IRQ1 always unmasked.
  • Detect the KBC presence by reading port 64
  • KBC reset command added
  • Keyboard command D2 support added

© American Megatrends Inc.


Release Notes - NDA Required

Component Information:
Component Title: KbcEmulation
Component Reference Name: KbcEmul
Component Type: eModule
Release Date: 2012-07-10
Source Control Label: 4.6.3-KbcEmulation-017
Source Control Location: SS: Alaska;$/Alaska/Source/Modules/KbcEmulation/ALASKA/KBCEMUL;
Dependencies
Component Dependencies
ONE
Dependent Component Title: USB
Dependent Component Reference Name: USB
Dependent Source Control Label: 4.6.3_USB_08.10.20
Dependent Source Control Location: Path:$/Alaska/SOURCE/Modules/USB/Alaska;

File Dependencies
N0NE

Protocol Dependencies
N0NE
Non-Compiled BIN and LIB File(s) within this Component:
N0NE
Component Description:
KbcEmulation eModule can be added to EFI BIOS to support emulation for USB keyboard and mouse - More details check Description page
Filename | Description
Main Component | Root\Core\em\KbcEmul
KbcEmul.cif | Component information file for the eModule.
KbcEmul.mak | Make file becomes part of the BIOS build process.
KbcEmul.sdl | Contains BIOS build parameters.
KbcEmul.dxs | File that has Dependency of KbcEmulation Module with Other Modules.
KbcEmul.c | KBC emulation driver entry point and initialize the SMI for port 6064.
KbcEmul.h | KBC emulation header file.
KbcEmulLib.h | KBC emulation Lib header file used in other files.
KbcEmulLib.c | KBC emulation lib file used in other files.
Kbc.h | KBC Header file has the structure definition for Virtual and Legacy devices.
KbcDevEmul.h | Devices header file.
Kbccore.c | It has function for port 60 read, 60 write, 64 read and 64 write.
Legacykbc.c | LegacyKBC handles the with KBC model.
Legacykbd.c | Legacy Keyboard functions.
LegacyMouse.c | Legacy Mouse functions.
VirtualKbc.c | Handles the Virtual KBC(Without KBC system) function.
VirtualKbd.c | Virtual keyboard functions.
VirtualMouse.c | Handles the Virtual mouse functions.
Ap4x.h | It has the Aptio4.x compatibility include files and headers.
Ap4x.c | It has the Aptio4.x compatibility function.
KbcEmulation.chm | CHM file for the eModule.
KbcEmulAcpi.c | Handles the KbcEmulAcpi functions.
KBCUHCI
ModulePart 		Root\Core\em\KbcEmul - Provide functions to Handle the SMI events for port 60/64
KbcUhci.cif | Component information file for the Module Part.
KbcUhci.c | Handles the SMI events for port 60/64.
KbcUhci.h | Header file for UHCI controller for Emulation.
KBCOHCI
ModulePart 		Root\Core\em\KbcEmul - Provide functions to Handle the SMI events for port 60/64.
KbcOhci.cif | Component information file for the Module Part.
KbcOhci.c | Handles the SMI events for port 60/64.
KbcOhci.h | Header file for OHCI controller for Emulation.
KBCEMULIRQ
ModulePart 		Root\Core\em\KbcEmul - Provide functions to handle the IRQ1 and IRQ12 generation
KbcEmulIrq.cif | Component information file for the Module Part.
KbcEmulIrq.c | Handles the IRQ1 and IRQ12 generation.
KBCSOUTHBRIDGE-IBEXPEAK
ModulePart 		Root\Board\em\KbcSbBoard - South Bridge Board module for KbcEmulation
KbcSbBoard.cif | Component information file for the Module Part.
KbcSbBoard.c | South bridge related code for Emulation.
KbcEmulationBoard
ModulePart 		Root\Board\em\KbcEmulBoard - Board module part for the KbcEmulation
KbcEmulBoard.cif | Component information file for the Module Part.
KbcEmulBoard.c | Board related code for Emulation.
BIOS Parameters
KbcEmulation Module Parameters:
Parameter Name | Type | Description
EMUL6064_SUPPORT | Boolean | Main switch to enable KBC Emulation support in Project.
UHCI_EMUL_SUPPORT | Boolean | Switch to enable UHCI based Emulation support in Project.
OHCI_EMUL_SUPPORT | Boolean | Switch to enable OHCI based Emulation support in Project.
IRQ_EMUL_SUPPORT | Boolean | Switch to enable software method of IRQ generation in Project.
EMULATION_ACPI_ENABLE_DISPATCH | Boolean | 1-Emulation SMI's will be disabled in the USB controller.
ICH10_WORKAROUND | Boolean | Switch to enable ICH10 Workaround. Emulation enabled and one of the USB controller disabled, We must clear the SMI status on disabled USB controller also
SW_IRQ_GENERATION_REG | Integer | Software IRQ generation regsiter from SB to generate the IRQ12 and IRQ1.
AMI Build Tools:
Tools Label: 4.5.5_TOOLS_39, Dated: 2012-01-04
Visual eBios: RSS.5.72.0220, Dated: 2012-01-04
Compiler Tool(s): Microsoft's Windows Driver Kit (WDK) Ver. 7600.16385.1
New features added in this label:
NONE
General Bug Fixes and EIP Addressed in this Label:

EIP Addressed
EIP #89838 - KbcEmulation module can't changed NUM LOCK ,CAPS LOCK,Scroll lock LED.
Files Changed for General Bug Fixes and EIP Addressed in this Label:

EIP Addressed
Root\core\em\KbcEmul\Legacykbd.c (EIP #89838)
Known Limitations and Erratas in this label:
Errata Item(s) with a Description
  1. Issue
    • Symptom:
      PS2 keyboard doesn't work in RedHat Linux 4 when the Emulation is enabled.
    • Root Cause:
      Linux disables the Legacy USB SMI. But still the Port 60/64 Access SMI is enabled in offset C0 and C1 of the UHCI pci configuration space. This makes any Port60/64 read returns 0.
    • Solution:
      Disable the Port60/64 Trapping SMI in ACPI Enable callback resolved the issue.
Remaining Issues:
NONE
Unit Testing:
  • LegacyFree system, boots to DOS, try Edit command.
  • If the KbcEmulation module is disabled, Edit will not work. Enabled, Edit will work.
Validation Testing:
DOCUMENT ANY BQA TESTING RESULTS
Here is the Quality Assurance System Test Plan
Here is the Quality Assurance Test Results
Release History:
4.6.3-KbcEmulation-017

  • [TAG] - EIP89838
    [Category] - Improvement
    [Description] - KbcEmulation module can't changed NUM LOCK ,CAPS LOCK,Scroll lock LED.
    [Files] - Legacykbd.c

Release_4.6.3_KbcEmulation_016

© American Megatrends Inc.


Release Notes - NDA Required

Component Information:
Component Title: KbcEmulation
Component Reference Name: KbcEmul
Component Type: eModule
Release Date: 2013-09-17
Source Control Label: 4.6.3-KbcEmulation-018
Source Control Location: SS: Alaska;$/Alaska/Source/Modules/KbcEmulation/ALASKA/KBCEMUL;
Dependencies
Component Dependencies
ONE
Dependent Component Title: USB
Dependent Component Reference Name: USB
Dependent Source Control Label: 4.6.3_USB_08.10.27
Dependent Source Control Location: Path:$/Alaska/SOURCE/Modules/USB/Alaska;

File Dependencies
N0NE

Protocol Dependencies
N0NE
Non-Compiled BIN and LIB File(s) within this Component:
N0NE
Component Description:
KbcEmulation eModule can be added to EFI BIOS to support emulation for USB keyboard and mouse - More details check Description page
Filename | Description
Main Component | Root\Core\em\KbcEmul
KbcEmul.cif | Component information file for the eModule.
KbcEmul.mak | Make file becomes part of the BIOS build process.
KbcEmul.sdl | Contains BIOS build parameters.
KbcEmul.dxs | File that has Dependency of KbcEmulation Module with Other Modules.
KbcEmul.c | KBC emulation driver entry point and initialize the SMI for port 6064.
KbcEmul.h | KBC emulation header file.
KbcEmulLib.h | KBC emulation Lib header file used in other files.
KbcEmulLib.c | KBC emulation lib file used in other files.
Kbc.h | KBC Header file has the structure definition for Virtual and Legacy devices.
KbcDevEmul.h | Devices header file.
Kbccore.c | It has function for port 60 read, 60 write, 64 read and 64 write.
Legacykbc.c | LegacyKBC handles the with KBC model.
Legacykbd.c | Legacy Keyboard functions.
LegacyMouse.c | Legacy Mouse functions.
VirtualKbc.c | Handles the Virtual KBC(Without KBC system) function.
VirtualKbd.c | Virtual keyboard functions.
VirtualMouse.c | Handles the Virtual mouse functions.
Ap4x.h | It has the Aptio4.x compatibility include files and headers.
Ap4x.c | It has the Aptio4.x compatibility function.
KbcEmulation.chm | CHM file for the eModule.
KbcEmulAcpi.c | Handles the KbcEmulAcpi functions.
KBCUHCI
ModulePart 		Root\Core\em\KbcEmul - Provide functions to Handle the SMI events for port 60/64
KbcUhci.cif | Component information file for the Module Part.
KbcUhci.c | Handles the SMI events for port 60/64.
KbcUhci.h | Header file for UHCI controller for Emulation.
KBCOHCI
ModulePart 		Root\Core\em\KbcEmul - Provide functions to Handle the SMI events for port 60/64.
KbcOhci.cif | Component information file for the Module Part.
KbcOhci.c | Handles the SMI events for port 60/64.
KbcOhci.h | Header file for OHCI controller for Emulation.
KBCEMULIRQ
ModulePart 		Root\Core\em\KbcEmul - Provide functions to handle the IRQ1 and IRQ12 generation
KbcEmulIrq.cif | Component information file for the Module Part.
KbcEmulIrq.c | Handles the IRQ1 and IRQ12 generation.
KBCSOUTHBRIDGE-IBEXPEAK
ModulePart 		Root\Board\em\KbcSbBoard - South Bridge Board module for KbcEmulation
KbcSbBoard.cif | Component information file for the Module Part.
KbcSbBoard.c | South bridge related code for Emulation.
KbcEmulationBoard
ModulePart 		Root\Board\em\KbcEmulBoard - Board module part for the KbcEmulation
KbcEmulBoard.cif | Component information file for the Module Part.
KbcEmulBoard.c | Board related code for Emulation.
BIOS Parameters
KbcEmulation Module Parameters:
Parameter Name | Type | Description
EMUL6064_SUPPORT | Boolean | Main switch to enable KBC Emulation support in Project.
UHCI_EMUL_SUPPORT | Boolean | Switch to enable UHCI based Emulation support in Project.
OHCI_EMUL_SUPPORT | Boolean | Switch to enable OHCI based Emulation support in Project.
IRQ_EMUL_SUPPORT | Boolean | Switch to enable software method of IRQ generation in Project.
EMULATION_ACPI_ENABLE_DISPATCH | Boolean | 1-Emulation SMI's will be disabled in the USB controller.
ICH10_WORKAROUND | Boolean | Switch to enable ICH10 Workaround. Emulation enabled and one of the USB controller disabled, We must clear the SMI status on disabled USB controller also
SW_IRQ_GENERATION_REG | Integer | Software IRQ generation regsiter from SB to generate the IRQ12 and IRQ1.
UHCI_EMUL_PCI_DEVICES | Expression | List of supported UHCI controllers in the following format: {dev1, ITF, SCC, BCC, offset}, {dev2, ITF, SCC, BCC, offset},...,{devN, ITF, SCC, BCC, offset}\dev represents the location of UHCI controller on PCI bus: dev = Bus << 8 + Dev << 3 + Func.\ITF represents the interface type of PCI device, for UHCI it must be 0.\SCC represents the sub class code of PCI device, for UHCI it must be 0x03.\BCC represents the base class code of PCI device, for UHCI it must be 0x0C.\offset represents the offset of legacy support register, for UHCI it must be 0xC0.
OHCI_EMUL_PCI_DEVICES | Expression | List of supported OHCI controllers in the following format: dev1, dev2,...,devN\dev represents the location of OHCI controller on PCI bus: dev = Bus << 8 + Dev << 3 + Func.
AMI Build Tools:
Tools Label: 4.5.5_TOOLS_40, Dated: 2012-06-21
Visual eBios: RSS.5.73.0239, Dated: 2012-06-21
Compiler Tool(s): Microsoft's Windows Driver Kit (WDK) Ver. 7600.16385.1
New features added in this label:
NONE
General Bug Fixes and EIP Addressed in this Label:

General Bug Fix
EIP #114926 - Write CCB command doesn't enable the keyboard interface
EIP #136515 - Build error in AMD platform when enabling Emul6064_Support
EIP #135441 - Option ROM was not getting dispatched in AMD Platforms

EIP Addressed
EIP #119870 - Build error with KbcEmulation module if update USB module label 4.6.3_USB_08.10.26
Files Changed for General Bug Fixes and EIP Addressed in this Label:

EIP Addressed
Root\core\em\KbcEmul\KbcEmul.mak (EIP #119870, #136515)
Root\core\em\KbcEmul\KbcEmul.sdl (EIP #119870)
Root\core\em\KbcEmul\KbcUhci.c (EIP #119870, #135441)
Root\core\em\KbcEmul\KbcUhci.h (EIP #119870)
Root\core\em\KbcEmul\KbcOhci.c (EIP #119870)
Root\core\em\KbcEmul\VirtualKbc.c (EIP #114926)
Known Limitations and Erratas in this label:
Errata Item(s) with a Description
  1. Issue
    • Symptom:
      PS2 keyboard doesn't work in RedHat Linux 4 when the Emulation is enabled.
    • Root Cause:
      Linux disables the Legacy USB SMI. But still the Port 60/64 Access SMI is enabled in offset C0 and C1 of the UHCI pci configuration space. This makes any Port60/64 read returns 0.
    • Solution:
      Disable the Port60/64 Trapping SMI in ACPI Enable callback resolved the issue.
Remaining Issues:
NONE
Unit Testing:
  • LegacyFree system, boots to DOS, try Edit command.
  • If the KbcEmulation module is disabled, Edit will not work. Enabled, Edit will work.
Validation Testing:
DOCUMENT ANY BQA TESTING RESULTS
Here is the Quality Assurance System Test Plan
Here is the Quality Assurance Test Results
Release History:
4.6.3-KbcEmulation-018
CppCheck was performed with latest CppCheck tool 1.60.1 for this label and no errors were found.
  • [TAG] - EIP119870
    [Category] - Improvement
    [Description] - Build error with KbcEmulation module if update USB module label 4.6.3_USB_08.10.26
    [Files] - KbcEmul.Mak, KbcEmul.SDl, KbcUhci.c, KbcUhci.h, KbcOhci.c

  • [TAG] - EIP114926
    [Category] - Bug Fix
    [Severity] - Minor
    [Symptom] - Write CCB command doesn't enable the keyboard interface
    [RootCause]- Data bytes are not decoded properly.
    [Solution] - Data bytes are decoded properly and device interface and IRQ state values are set properly.
    [Files] - VirtualKbc.c

  • [TAG] - EIP136515
    [Category] - Bug Fix
    [Severity] - Minor
    [Symptom] - Build error in AMD platform when enabling Emul6064_Support
    [RootCause]- OHCI_EMUL_LIB was not inluded while making KbcEmulBin
    [Solution] - Added OHCI_EMUL_LIB while making KbcEmulBin.
    [Files] - KbcEmul.mak

  • [TAG] - EIP135441
    [Category] - Bug Fix
    [Severity] - Minor
    [Symptom] - Option ROM was not getting dispatched in AMD Platforms
    [RootCause]- Setting the IRQ1 in the Entry Point of the KbcEmulation Driver.
    [Solution] - Setting the IRQ1 only if KbcEmulation is Enabled.
    [Files] - KbcEmul.c

Release_4.6.3_KbcEmulation_017
Release_4.6.3_KbcEmulation_016

© American Megatrends Inc.


Release Notes - NDA Required

Component Information:
Component Title: KbcEmulation
Component Reference Name: KbcEmul
Component Type: eModule
Release Date: 2014-04-10
Source Control Label: 4.6.3-KbcEmulation-019
Source Control Location: SS: Alaska;$/Alaska/Source/Modules/KbcEmulation/ALASKA/KBCEMUL;
Dependencies
Component Dependencies
ONE
Dependent Component Title: USB
Dependent Component Reference Name: USB
Dependent Source Control Label: 4.6.3_USB_08.10.27
Dependent Source Control Location: Path:$/Alaska/SOURCE/Modules/USB/Alaska;

File Dependencies
N0NE

Protocol Dependencies
N0NE
Non-Compiled BIN and LIB File(s) within this Component:
N0NE
Component Description:
KbcEmulation eModule can be added to EFI BIOS to support emulation for USB keyboard and mouse - More details check Description page
Filename | Description
Main Component | Root\Core\em\KbcEmul
KbcEmul.cif | Component information file for the eModule.
KbcEmul.mak | Make file becomes part of the BIOS build process.
KbcEmul.sdl | Contains BIOS build parameters.
KbcEmul.dxs | File that has Dependency of KbcEmulation Module with Other Modules.
KbcEmul.c | KBC emulation driver entry point and initialize the SMI for port 6064.
KbcEmul.h | KBC emulation header file.
KbcEmulLib.h | KBC emulation Lib header file used in other files.
KbcEmulLib.c | KBC emulation lib file used in other files.
Kbc.h | KBC Header file has the structure definition for Virtual and Legacy devices.
KbcDevEmul.h | Devices header file.
Kbccore.c | It has function for port 60 read, 60 write, 64 read and 64 write.
Legacykbc.c | LegacyKBC handles the with KBC model.
Legacykbd.c | Legacy Keyboard functions.
LegacyMouse.c | Legacy Mouse functions.
VirtualKbc.c | Handles the Virtual KBC(Without KBC system) function.
VirtualKbd.c | Virtual keyboard functions.
VirtualMouse.c | Handles the Virtual mouse functions.
Ap4x.h | It has the Aptio4.x compatibility include files and headers.
Ap4x.c | It has the Aptio4.x compatibility function.
KbcEmulation.chm | CHM file for the eModule.
KbcEmulAcpi.c | Handles the KbcEmulAcpi functions.
KBCUHCI
ModulePart 		Root\Core\em\KbcEmul - Provide functions to Handle the SMI events for port 60/64
KbcUhci.cif | Component information file for the Module Part.
KbcUhci.c | Handles the SMI events for port 60/64.
KbcUhci.h | Header file for UHCI controller for Emulation.
KBCOHCI
ModulePart 		Root\Core\em\KbcEmul - Provide functions to Handle the SMI events for port 60/64.
KbcOhci.cif | Component information file for the Module Part.
KbcOhci.c | Handles the SMI events for port 60/64.
KbcOhci.h | Header file for OHCI controller for Emulation.
KBCEMULIRQ
ModulePart 		Root\Core\em\KbcEmul - Provide functions to handle the IRQ1 and IRQ12 generation
KbcEmulIrq.cif | Component information file for the Module Part.
KbcEmulIrq.c | Handles the IRQ1 and IRQ12 generation.
KBCSOUTHBRIDGE-IBEXPEAK
ModulePart 		Root\Board\em\KbcSbBoard - South Bridge Board module for KbcEmulation
KbcSbBoard.cif | Component information file for the Module Part.
KbcSbBoard.c | South bridge related code for Emulation.
KbcEmulationBoard
ModulePart 		Root\Board\em\KbcEmulBoard - Board module part for the KbcEmulation
KbcEmulBoard.cif | Component information file for the Module Part.
KbcEmulBoard.c | Board related code for Emulation.
BIOS Parameters
KbcEmulation Module Parameters:
Parameter Name | Type | Description
EMUL6064_SUPPORT | Boolean | Main switch to enable KBC Emulation support in Project.
UHCI_EMUL_SUPPORT | Boolean | Switch to enable UHCI based Emulation support in Project.
OHCI_EMUL_SUPPORT | Boolean | Switch to enable OHCI based Emulation support in Project.
IRQ_EMUL_SUPPORT | Boolean | Switch to enable software method of IRQ generation in Project.
EMULATION_ACPI_ENABLE_DISPATCH | Boolean | 1-Emulation SMI's will be disabled in the USB controller.
ICH10_WORKAROUND | Boolean | Switch to enable ICH10 Workaround. Emulation enabled and one of the USB controller disabled, We must clear the SMI status on disabled USB controller also
SW_IRQ_GENERATION_REG | Integer | Software IRQ generation regsiter from SB to generate the IRQ12 and IRQ1.
UHCI_EMUL_PCI_DEVICES | Expression | List of supported UHCI controllers in the following format: {dev1, ITF, SCC, BCC, offset}, {dev2, ITF, SCC, BCC, offset},...,{devN, ITF, SCC, BCC, offset}\dev represents the location of UHCI controller on PCI bus: dev = Bus << 8 + Dev << 3 + Func.\ITF represents the interface type of PCI device, for UHCI it must be 0.\SCC represents the sub class code of PCI device, for UHCI it must be 0x03.\BCC represents the base class code of PCI device, for UHCI it must be 0x0C.\offset represents the offset of legacy support register, for UHCI it must be 0xC0.
OHCI_EMUL_PCI_DEVICES | Expression | List of supported OHCI controllers in the following format: dev1, dev2,...,devN\dev represents the location of OHCI controller on PCI bus: dev = Bus << 8 + Dev << 3 + Func.
AMI Build Tools:
Tools Label: 4.5.5_TOOLS_41, Dated: 2013-03-19
Visual eBios: RSS.5.73.0244, Dated: 2013-03-19
Compiler Tool(s): Microsoft's Windows Driver Kit (WDK) Ver. 7600.16385.1
New features added in this label:
NONE
General Bug Fixes and EIP Addressed in this Label:

General Bug Fix
None

EIP Addressed
EIP #145881 - Ohci Emulation support needs to be extended for the chipset , where the HCE registers defined in some fixed Memory for Aptio 4.x
EIP #156041 - Aptio 4.x, KbcEmulation: Send the mouse data to EBDA and only the last data through KBC
Files Changed for General Bug Fixes and EIP Addressed in this Label:

EIP Addressed
Root\core\em\KbcEmul\KbcEmul.sdl (EIP #145881)
Root\core\em\KbcEmul\KbcOhci.h (EIP #145881)
Root\core\em\KbcEmul\KbcOhci.c (EIP #145881)
Root\core\em\KbcEmul\VirtualMouse.c (EIP #156041)
Known Limitations and Erratas in this label:
Errata Item(s) with a Description
  1. Issue
    • Symptom:
      PS2 keyboard doesn't work in RedHat Linux 4 when the Emulation is enabled.
    • Root Cause:
      Linux disables the Legacy USB SMI. But still the Port 60/64 Access SMI is enabled in offset C0 and C1 of the UHCI pci configuration space. This makes any Port60/64 read returns 0.
    • Solution:
      Disable the Port60/64 Trapping SMI in ACPI Enable callback resolved the issue.
Remaining Issues:
NONE
Unit Testing:
  • LegacyFree system, boots to DOS, try Edit command.
  • If the KbcEmulation module is disabled, Edit will not work. Enabled, Edit will work.
Validation Testing:
Quality Assurance System Test Plan
Quality Assurance Test Results
Release History:
4.6.3-KbcEmulation-019
  • [TAG] - EIP145881
    [Category] - Improvement
    [Description] - Ohci Emulation support needs to be extended for the chipset , where the HCE registers defined in some fixed Memory for Aptio 4.x
    [Files] - KbcEmul.sdl, KbcOhci.c, KbcOhci.h

  • [TAG] - EIP156041
    [Category] - Improvement
    [Description] - Aptio 4.x, KbcEmulation: Send the mouse data to EBDA and only the last data through KBC
    [Files] - VirtualMouse.c

Release_4.6.3_KbcEmulation_018
Release_4.6.3_KbcEmulation_017
Release_4.6.3_KbcEmulation_016

© American Megatrends Inc.


KbcEmulation

AMIBIOS Document References

Previous Validation Test Report

Validation Test Report-016.htm

Validation Test Report-017.htm

Validation Test Report-018.htm

Validation Test Report-019.htm


Release Notes - NDA Required

Validation Test Report for KbcEmulation Label (INT)_a_4.6.3-KbcEmulation-016

Platform Information Form :

Board Information - Bromolow
BIOS Information (Label, Path) - Labeled'4.6.4.1_VEB_1AOSX015'; Path 'SS: Alaska;$/Alaska/Projects/Intel/SandyBridge/CougarPoint_Bromolow_Crb_1AOSX/Bromolow.Veb';
Chipset Information (Type, Stepping) -
CPU Information (Type, Stepping) -
Memory Info (Manufacturer, Speed, Configuration) -
Graphics (Please specify which one in used) -
Chipset driver Version -
Graphics drive Version -

The following BQA Tests have been validated in Bromolow Platform
Build
REF-31549 .N/A Test ROM Build ----- PASS
Status Update:

Hardware
REF-30851 DOS USB Keyboard/Mouse In DOS ---- PASS
Status Update:

PCI-e
1) REF-28684 Not OS Specific Adaptec PCI-E RAID 1430SA Controller ---- PASS
Status Update:

2)REF-28682 DOS Adaptec PCI-EXPRESS 4805SAS Controller ---- PASS
Status Update:

3)REF-28723 Not OS Specific PCI Express LAN Compatability ---- U/T
Status Update: Option ROM dispatched soon. Unable to test.

4)REF-27930Not OS Specific PCI Express SCSI RAID ---- U/T
Status Update: No IDE Ports is available

Memory
REF-27941Not OS Specific Memtest86+ ---- PASS
Status Update:

Platform Information Form :

Board Information - Maho Bay
BIOS Information (Label, Path) - Labeled'4.6.5.3_VEB_1APTC019'; Path 'SS: Alaska;$/Alaska/Projects/Intel/IvyBridge/PantherPoint_MahoBay_Crb_1APTC/MahoBay.Veb';
Chipset Information (Type, Stepping) -
CPU Information (Type, Stepping) -
Memory Info (Manufacturer, Speed, Configuration) -
Graphics (Please specify which one in used) -
Chipset driver Version -
Graphics drive Version -

The following BQA Tests have been validated in Maho Bay Platform
Build
REF-31549 .N/A Test ROM Build ----- PASS
Status Update:

Hardware
REF-30851 DOS USB Keyboard/Mouse In DOS ---- PASS
Status Update:

PCI-e
1) REF-28684 Not OS Specific Adaptec PCI-E RAID 1430SA Controller ---- U/T
Status Update: ** PCI/e Card is not detected in SUT.

2)REF-28682 DOS Adaptec PCI-EXPRESS 4805SAS Controller ---- PASS
Status Update:

3)REF-28723 Not OS Specific PCI Express LAN Compatability ---- U/T
Status Update: Option ROM dispatched soon. Unable to test.

4)REF-27930Not OS Specific PCI Express SCSI RAID ---- U/T
Status Update: No IDE Port is available

Memory
REF-27941Not OS Specific Memtest86+ ---- PASS
Status Update:


Release Notes - NDA Required

Validation Test Report for KbcEmulation Label (INT)_a_4.6.3-KbcEmulation-017

Platform Information Form :

Board Information - Bromolow
BIOS Information (Label, Path) - Labeled'4.6.4.1_VEB_1AOSX015'; Path 'SS: Alaska;$/Alaska/Projects/Intel/SandyBridge/CougarPoint_Bromolow_Crb_1AOSX/Bromolow.Veb';
Chipset Information (Type, Stepping) -
CPU Information (Type, Stepping) -
Memory Info (Manufacturer, Speed, Configuration) -
Graphics (Please specify which one in used) -
Chipset driver Version -
Graphics drive Version -

The following BQA Tests have been validated in Bromolow Platform
Build
REF-31549 .N/A Test ROM Build ----- PASS
Status Update:

Hardware
REF-30851 DOS USB Keyboard/Mouse In DOS ---- PASS
Status Update:

PCI-e
1) REF-28684 Not OS Specific Adaptec PCI-E RAID 1430SA Controller ---- U/T
Status Update: *** PCI/e Card is not detected in SUT.

2)REF-28682 DOS Adaptec PCI-EXPRESS 4805SAS Controller ---- PASS
Status Update:

3)REF-28723 Not OS Specific PCI Express LAN Compatability ---- U/T
Status Update: Option ROM dispatched soon. Unable to test.

4)REF-27930Not OS Specific PCI Express SCSI RAID ---- U/T
Status Update: No IDE Ports is available

Memory
REF-27941Not OS Specific Memtest86+ ---- PASS
Status Update:

Platform Information Form :

Board Information - Maho Bay
BIOS Information (Label, Path) - Labeled'4.6.5.3_VEB_1APTC021'; Path 'SS: Alaska;$/Alaska/Projects/Intel/IvyBridge/PantherPoint_MahoBay_Crb_1APTC/MahoBay.Veb';
Chipset Information (Type, Stepping) -
CPU Information (Type, Stepping) -
Memory Info (Manufacturer, Speed, Configuration) -
Graphics (Please specify which one in used) -
Chipset driver Version -
Graphics drive Version -

The following BQA Tests have been validated in Maho Bay Platform
Build
REF-31549 .N/A Test ROM Build ----- PASS
Status Update:

Hardware
REF-30851 DOS USB Keyboard/Mouse In DOS ---- PASS
Status Update:

PCI-e
1) REF-28684 Not OS Specific Adaptec PCI-E RAID 1430SA Controller ---- PASS
Status Update:

2)REF-28682 DOS Adaptec PCI-EXPRESS 4805SAS Controller ---- U/T
Status Update: *** PCI/e Card is not detected in SUT.

3)REF-28723 Not OS Specific PCI Express LAN Compatability ---- U/T
Status Update: Option ROM dispatched soon. Unable to test.

4)REF-27930Not OS Specific PCI Express SCSI RAID ---- U/T
Status Update: No IDE Port is available

Memory
REF-27941Not OS Specific Memtest86+ ---- PASS
Status Update:


Release Notes - NDA Required

Validation Test Report for KbcEmulation Label (INT)_b_4.6.3-KbcEmulation-018

Platform Information Form :

Board Information - Chief river
BIOS Information (Label, Path) - Labeled'4.6.5.3_VEB_1APTJ027'; Path 'SAlaska;$/Alaska/Projects/Intel/IvyBridge/PantherPoint_ChiefRiver_Crb_1APTJ/;';
Chipset Information (Type, Stepping) -
CPU Information (Type, Stepping) -
Memory Info (Manufacturer, Speed, Configuration) -
Graphics (Please specify which one in used) -
Chipset driver Version -
Graphics drive Version -

The following BQA Tests have been validated in Chief river Platform
Build
REF-31549 .N/A Test ROM Build ----- PASS
Status Update:

Hardware
REF-30851 DOS USB Keyboard/Mouse In DOS ---- PASS
Status Update:

PCI-e
REF-28684 Not OS Specific Adaptec PCI-E RAID 1430SA Controller ---- PASS
Status Update: ***

REF-28682 DOS Adaptec PCI-EXPRESS 4805SAS Controller ---- PASS
Status Update:

REF-28723 Not OS Specific PCI Express LAN Compatability ---- U/T
Status Update: Option ROM dispatched soon. Unable to test.

REF-27930Not OS Specific PCI Express SCSI RAID ---- Blocked
Status Update: No IDE Ports is available

Memory
REF-27941Not OS Specific Memtest86+ ---- PASS
Status Update:

Kbc Emulation
REF-34751 DOS Test Kbd/Mouse in EDIT.COM with KBC Present system --- PASS
Status Update:

REF-34752 DOS Test Kbd/Mouse in EDIT.COM without KBC Present sys --- Blocked
Status Update: This platform has On Board KBC Controller

REF-34754 DOS Test Ps2/USB Kbd in Option ROM with KBC System --- PASS
Status Update:

REF-34755 DOS Test USB Keyboard in Option ROM without KBC System --- Blocked
Status Update: This platform has On Board KBC Controller

Platform Information Form :

Board Information - Sharkbay
BIOS Information (Label, Path) - Labeled'4.6.5.4_VEB_1AQPM028 1'; Path 'SS: Alaska;$/Alaska/Projects/Intel/Haswell/LynxPoint_SharkBay-MB_Crb_1AQPM; ';
Chipset Information (Type, Stepping) -
CPU Information (Type, Stepping) -
Memory Info (Manufacturer, Speed, Configuration) -
Graphics (Please specify which one in used) -
Chipset driver Version -
Graphics drive Version -

The following BQA Tests have been validated in SharkBay Platform
Build
REF-31549 .N/A Test ROM Build ----- PASS
Status Update:

Hardware
REF-30851 DOS USB Keyboard/Mouse In DOS ---- PASS
Status Update:

PCI-e
REF-28684 Not OS Specific Adaptec PCI-E RAID 1430SA Controller ---- PASS
Status Update:

REF-28682 DOS Adaptec PCI-EXPRESS 4805SAS Controller ---- PASS
Status Update:

REF-28723 Not OS Specific PCI Express LAN Compatability ---- U/T
Status Update: Option ROM dispatched soon. Unable to test.

REF-27930Not OS Specific PCI Express SCSI RAID ---- Blocked
Status Update: No IDE Port is available

Memory
REF-27941Not OS Specific Memtest86+ ---- PASS
Status Update:

Kbc Emulation
REF-34751 DOS Test Kbd/Mouse in EDIT.COM with KBC Present system --- PASS
Status Update:

REF-34752 DOS Test Kbd/Mouse in EDIT.COM without KBC Present sys --- Blocked
Status Update: This platform has On Board KBC Controller

REF-34754 DOS Test Ps2/USB Kbd in Option ROM with KBC System --- PASS
Status Update:

REF-34755 DOS Test USB Keyboard in Option ROM without KBC System --- Blocked
Status Update: This platform has On Board KBC Controller

Platform Information Form :

Board Information - AMD Dory
BIOS Information (Label, Path) - Labeled'4.6.5.3_VEB_1AOUQ_016 '; Path 'SS: Alaska;$/Alaska/Projects/AMD/AgesaV5/OrochiPI/Dory_1AOUQ/;
Chipset Information (Type, Stepping) -
CPU Information (Type, Stepping) -
Memory Info (Manufacturer, Speed, Configuration) -
Graphics (Please specify which one in used) -
Chipset driver Version -
Graphics drive Version -

The following BQA Tests have been validated in AMD Dory Platform
Build
REF-31549 .N/A Test ROM Build ----- PASS
Status Update:

Hardware
REF-30851 DOS USB Keyboard/Mouse In DOS ---- PASS
Status Update:

PCI-e
REF-28684 Not OS Specific Adaptec PCI-E RAID 1430SA Controller ---- PASS
Status Update:

REF-28682 DOS Adaptec PCI-EXPRESS 4805SAS Controller ---- PASS
Status Update:

REF-28723 Not OS Specific PCI Express LAN Compatability ---- U/T
Status Update: Option ROM dispatched soon. Unable to test.

REF-27930Not OS Specific PCI Express SCSI RAID ---- Blocked
Status Update: No IDE Port is available

Memory
REF-27941Not OS Specific Memtest86+ ---- PASS
Status Update:

Kbc Emulation
REF-34751 DOS Test Kbd/Mouse in EDIT.COM with KBC Present system --- PASS
Status Update:

REF-34752 DOS Test Kbd/Mouse in EDIT.COM without KBC Present sys --- PASS
Status Update:

REF-34754 DOS Test Ps2/USB Kbd in Option ROM with KBC System --- PASS
Status Update:

REF-34755 DOS Test USB Keyboard in Option ROM without KBC System --- PASS
Status Update:


Release Notes - NDA Required

Validation Test Report for KbcEmulation Label (INT)_a_4.6.3-KbcEmulation-019

Platform Information Form :

Board Information - Chief river
BIOS Information (Label, Path) - Labeled'4.6.5.3_VEB_1APTJ029'; Path 'SAlaska;$/Alaska/Projects/Intel/IvyBridge/PantherPoint_ChiefRiver_Crb_1APTJ/;';
Chipset Information (Type, Stepping) -
CPU Information (Type, Stepping) -
Memory Info (Manufacturer, Speed, Configuration) -
Graphics (Please specify which one in used) -
Chipset driver Version -
Graphics drive Version -

Description:
Add the Value line in below token then only build will success...
Name = "UHCI_EMUL_PCI_DEVICES"
Value = "{0xF8, 0, 0x01, 0x06, 0x94}"

The following BQA Tests have been validated in Chief river Platform
Build
REF-31549 .N/A 32 Bit Project Compile ----- U/T
Status Update: Not supported for 32bit
REF-31549 .N/A Test ROM Build ----- PASS
Status Update:

Hardware
REF-30851 DOS USB Keyboard/Mouse In DOS ---- PASS
Status Update:

PCI-e
REF-28684 Not OS Specific Adaptec PCI-E RAID 1430SA Controller ---- PASS
Status Update: Adaptec 6805E works fine

REF-28682 DOS PCI-EXPRESS SAS Controller ---- PASS
Status Update: Legacy RAID Works fine

REF-28723 Not OS Specific PCI Express LAN Compatability ---- U/T
Status Update: Option ROM dispatched soon. Unable to test.

REF-27930Not OS Specific PCI Express SCSI RAID ---- Blocked
Status Update: No IDE Ports is available

Memory
REF-27941Not OS Specific Memtest86+ ---- PASS
Status Update:

Kbc Emulation
REF-34751 DOS Test Kbd/Mouse in EDIT.COM with KBC Present system --- PASS
Status Update:

REF-34752 DOS Test Kbd/Mouse in EDIT.COM without KBC Present sys --- Blocked
Status Update: This platform has On Board KBC Controller

REF-34754 DOS Test Ps2/USB Kbd in Option ROM with KBC System --- PASS
Status Update:

REF-34755 DOS Test USB Keyboard in Option ROM without KBC System --- Blocked
Status Update: This platform has On Board KBC Controller

Platform Information Form :

Board Information - Haswell DT Refresh
BIOS Information (Label, Path) - Labeled'4.6.5.4_VEB_1AQPM028 1'; Path ' SS: Alaska;$/Alaska/Projects/Intel/Broadwell/WildcatPoint_Desktop_Crb_1ARYX/HaswellRefreshDT.veb;
Chipset Information (Type, Stepping) -
CPU Information (Type, Stepping) -
Memory Info (Manufacturer, Speed, Configuration) -
Graphics (Please specify which one in used) -
Chipset driver Version -
Graphics drive Version -

The following BQA Tests have been validated in Haswell DT Refresh Platform
Build
REF-31549 .N/A 32 Bit Project Compile ----- Blocked
Status Update: Intel CPU Reference Code does Not support X64_BUILD=0
REF-31549 .N/A Test ROM Build ----- PASS
Status Update:

Hardware
REF-30851 DOS USB Keyboard/Mouse In DOS ---- PASS
Status Update:

PCI-e
REF-28684 Not OS Specific Adaptec PCI-E RAID 1430SA Controller ---- U/T
Status Update: OpRom is not lanuch with Adaptec SAS card

REF-28682 DOS PCI-EXPRESS SAS Controller ---- U/T
Status Update: Not able to Launch OptionROM

REF-28723 Not OS Specific PCI Express LAN Compatability ---- U/T
Status Update: OOption Rom Dispatch earlier

REF-27930Not OS Specific PCI Express SCSI RAID ---- Blocked
Status Update: No IDE Port is available

Memory
REF-27941Not OS Specific Memtest86+ ---- PASS
Status Update: V2.01

Kbc Emulation
REF-34751 DOS Test Kbd/Mouse in EDIT.COM with KBC Present system --- PASS
Status Update: Ps2 is not supported. Tested with USB Kbd\Mouse

REF-34752 DOS Test Kbd/Mouse in EDIT.COM without KBC Present sys --- Blocked
Status Update: This platform has On Board KBC Controller

REF-34754 DOS Test Ps2/USB Kbd in Option ROM with KBC System --- PASS
Status Update: Tested with PXE Oprom with USB KBD. PS2 does not support.

REF-34755 DOS Test USB Keyboard in Option ROM without KBC System --- Blocked
Status Update: This platform has On Board KBC Controller

Platform Information Form :

Board Information - AMD Dory
BIOS Information (Label, Path) - Labeled'4.6.5.3_VEB_1AOUQ_016 '; Path 'SS: Alaska;$/Alaska/Projects/AMD/AgesaV5/OrochiPI/Dory_1AOUQ/;
Chipset Information (Type, Stepping) -
CPU Information (Type, Stepping) -
Memory Info (Manufacturer, Speed, Configuration) -
Graphics (Please specify which one in used) -
Chipset driver Version -
Graphics drive Version -

Description:
Built successfully after added Value in below token:
Name = "OHCI_EMUL_PCI_DEVICES"
Value = "0x90, 0x98, 0xB0, 0xA5"

The following BQA Tests have been validated in AMD Dory Platform
Build
REF-31549 .N/A 32 Bit Project Compile ----- PASS
Status Update:
REF-31549 .N/A Test ROM Build ----- PASS
Status Update:

Hardware
REF-30851 DOS USB Keyboard/Mouse In DOS ---- PASS
Status Update:

PCI-e
REF-28684 Not OS Specific Adaptec PCI-E RAID 1430SA Controller ---- PASS
Status Update: Adaptec 6805E works fine

REF-28682 DOS PCI-EXPRESS SAS Controller ---- PASS
Status Update: Legacy RAID Works fine

REF-28723 Not OS Specific PCI Express LAN Compatability ---- Blocked
Status Update: Not able to Test

REF-27930Not OS Specific PCI Express SCSI RAID ---- Blocked
Status Update: No IDE Ports is available

Memory
REF-27941Not OS Specific Memtest86+ ---- PASS
Status Update:

Kbc Emulation
REF-34751 DOS Test Kbd/Mouse in EDIT.COM with KBC Present system --- PASS
Status Update: PS2 Mouse and Keyboard port is not available in board

REF-34752 DOS Test Kbd/Mouse in EDIT.COM without KBC Present sys --- PASS
Status Update:

REF-34754 DOS Test Ps2/USB Kbd in Option ROM with KBC System --- PASS
Status Update:

REF-34755 DOS Test USB Keyboard in Option ROM without KBC System --- PASS
Status Update:


Copyright

American Megatrends, Inc.
5555 Oakbrook Parkway
Suite 200
Norcross, GA 30093 (USA)

Copyright (c) 1999-2014 American Megatrends, Inc. All Rights Reserved.

This publication contains proprietary information, which is protected by copyright. No part of this publication may be reproduced, transcribed, stored in a retrieval system, translated into any language or computer language, or transmitted in any form whatsoever without the prior written consent of the publisher, American Megatrends, Inc.

American Megatrends, Inc. retains the right to update, change, modify this publication at any time, without notice.

For Additional Information

Call American Megatrends BIOS Sales Department at 1-800-828-9264 for additional information.

Limitations of Liability

In no event shall American Megatrends be held liable for any loss, expenses, or damages of any kind whatsoever, whether direct, indirect, incidental, or consequential, arising from the design or use of this product or the support materials provided with the product.

Limited Warranty

No warranties are made, either expressed or implied, with regard to the contents of this work, its merchantability, or fitness for a particular use. American Megatrends assumes no responsibility for errors and omissions or for the uses made of the material contained herein or reader decisions based on such use.

Trademark and Copyright Acknowledgments

All product names used in this publication are for identification purposes only and are trademarks of their respective Companies.


KBC Emulation

Component Description:

Introduction

Many software applications get data or send commands to the keyboard and mouse devices through port 60/64. To make these applications works with the usb keyboard and mouse we need a keyboard controller (KBC) emulation driver. The KBC emulation driver presents the USB devices as PS2 devices to the system. That is, the USB keyboard and USB mouse are presented as PS/2 keyboard and PS/2 mouse to system software.

Thus, when providing truly "generic" KBC emulation, there are 2 cases to handle:

  1. Systems with a KBC
  2. Systems without a KBC

Systems With KBC:

The diagram below shows a USB system with a keyboard controller. Write/read accesses to the KBC cause emulation trapping. This trapping allows KBC commands to be propagated to USB peripherals when appropriate. Emulation events are generated when the USB host controller has completed a transaction. Part of the service of emulation events is to insert data into the KBC. The KBC then generates the appropriate interrupt and makes the data available on the I/O bus.

Systems Without KBC:

The diagram below shows a system without a keyboard controller. Read and write accesses to the KBC emulator cause emulation trapping. The emulator is responsible for giving the data when there is access to the KBC. Some applications get the data direct via reading from port 60/64 and some data is accessed via IRQ.

KBC Implementation in Aptio:

KBC emulation handles both KBC data and commands. Emulation has to handle keyboard data, keyboard commands, mouse data, mouse commands and KBC commands. The implementation is different for KBC present systems and KBC absent systems.

Emulation Disabled with KBC:

USB Keyboard and mouse data will be placed in the local 6064 buffer and the KBC is responsible for generating the IRQ. Then KBC commands and device (keyboard & mouse) commands will be processed by KBC. This means device commands will not be sent to the USB keyboard and mouse.

Keyboard & Mouse Data
  • USB scanner(converts into IBM standard SCAN code)
  • Place the scan code in KBC (60/64)

Keyboard & Mouse Command to KBC (60/64)
  • Send to PS2 devices

Emulation Enabled with KBC:

For this case, the USB keyboard and mouse data will be placed in the local 6064 buffer and the KBC is responsible for generating the IRQ. KBC commands and device (keyboard & mouse) commands will be processed by KBC and, at the same time, device commands will be sent to the USB keyboard and mouse.

Keyboard & Mouse Data
  • USB scanner(converts into IBM standard SCAN code)
  • Place the scan code in KBC (60/64)

Keyboard & Mouse Command to KBC (60/64)
  • Emulation Driver sends the command to PS2 and USB

Emulation Disabled without KBC:

The USB Keyboard data will be placed in the BDA keyboard buffer. The application accesses to the 6064 to get data will fail and accesses to data from the IRQ handler also fail. Mouse data will not be used at all. All the commands sent to the KBC and devices will fail.

Keyboard Data
  • USB Int9(converts into Ps2 format ASCII/SCAN code and place it BDA KBD buffer

Mouse Data
  • Not used

Keyboard & Mouse Command to KBC (60/64)
  • Not handled

Emulation Enabled without KBC:

Keyboard Data
  • USB Int9(converts into Ps2 format ASCII/SCAN code and place it BDA KBD buffer
  • USB scanner(converts into IBM standard SCAN code)
  • Emulation driver sends via port60/64 by Generating the IRQ1

Mouse Data
  • Emulation driver sends via port60/64 by Generating the IRQ12

Keyboard & Mouse Command to KBC (60/64)
  • Emulation Driver sends to PS2 and USB

Here we have two methods to present the USB keyboard and mouse data to the application:

  1. Some chipsets use the software method of IRQ generation.
  2. The emulation module gets the data it generated via the IRQ1 or IRQ12 based on keyboard or mouse data.

Keyboard DATA:

IRQ Enabled:

Emulation gets the USB keyboard data and holds in local buffer. Then it generates the IRQ1 based on the chipset software IRQ generation method. So that Int9 handler reads port 60/64 to get the data. For the port 60/64 access, the emulation driver responds with the proper data.

IRQ Disabled:

Emulation gets the USB keyboard data, converts it to PS/2 ASCII/SCAN codes and places it in the BDA keyboard data area.

Note: If the application uses the IRQ to get the Keyboard data, it will fail.

Mouse DATA:

IRQ Enabled:

The emulation driver gets the USB Mouse data and places it in a local buffer. Then it generates IRQ12 based on the chipset software IRQ generation method. So that the Int74 handler reads port 60/64 to get the mouse data. For port 60/64 access, the emulation driver responds with the proper data.

IRQ Disabled:

The emulation driver gets the mouse data and places it in a local buffer. If some application requests the data via port 60/64 access, the driver will respond with the proper mouse data.

Note: If the application uses the IRQ to get the mouse data, will fail.

KBC and Device Commands:

For all the KBC and device commands, the emulation driver responds with the proper data.

Emulation for the UHCI Controller:

Emulation is implemented by trapping read/write accesses to port 60/64. The UHCI controller uses SMI generation (USB Legacy Keyboard/Mouse Control Register, Offset C0-C1) whenever there is an access to port 60/64. The emulation driver uses these bits and inside SMI to handle port 60/64 commands and data in a manner similar to KBC.


KBC Emulation

Known Issue:

Issue:

PS2 keyboard doesn't work in RedHat Linux 4 when the Emulation is enabled

RootCause:

Linux disables the Legacy USB SMI. But still the Port 60/64 Access SMI is enabled in offset C0 and C1 of the UHCI pci configuration space. This makes any Port60/64 read returns 0

Solution:

Disable the Port60/64 Trapping SMI in ACPI Enable callback resolved the issue.


Release Notes - NDA Required

Component Information:
Component Title: KbcEmulation
Component Reference Name: KbcEmul
Component Type: eModule
Release Date: 2014-12-08
Source Control Label: 4.6.3-KbcEmulation-020
Source Control Location: SS: Alaska;$/Alaska/Source/Modules/KbcEmulation/ALASKA/KBCEMUL;
Dependencies
Component Dependencies
USB
Dependent Component Title: USB
Dependent Component Reference Name: USB
Dependent Source Control Label: 4.6.3_USB_08.10.27
Dependent Source Control Location: Path:$/Alaska/SOURCE/Modules/USB/Alaska;
AmiBufferValidationLib
Dependent Component Title: AmiBufferValidationLib
Dependent Component Reference Name: AmiBufferValidationLib
Dependent Source Control Label: AmiBufferValidationLib_01
Dependent Source Control Location: Path:$/Alaska/SOURCE/Modules/AmiBufferValidationLib;

File Dependencies
N0NE

Protocol Dependencies
N0NE
Non-Compiled BIN and LIB File(s) within this Component:
N0NE
Component Description:
KbcEmulation eModule can be added to EFI BIOS to support emulation for USB keyboard and mouse - More details check Description page
Filename | Description
Main Component | Root\Core\em\KbcEmul
KbcEmul.cif | Component information file for the eModule.
KbcEmul.mak | Make file becomes part of the BIOS build process.
KbcEmul.sdl | Contains BIOS build parameters.
KbcEmul.dxs | File that has Dependency of KbcEmulation Module with Other Modules.
KbcEmul.c | KBC emulation driver entry point and initialize the SMI for port 6064.
KbcEmul.h | KBC emulation header file.
KbcEmulLib.h | KBC emulation Lib header file used in other files.
KbcEmulLib.c | KBC emulation lib file used in other files.
Kbc.h | KBC Header file has the structure definition for Virtual and Legacy devices.
KbcDevEmul.h | Devices header file.
Kbccore.c | It has function for port 60 read, 60 write, 64 read and 64 write.
Legacykbc.c | LegacyKBC handles the with KBC model.
Legacykbd.c | Legacy Keyboard functions.
LegacyMouse.c | Legacy Mouse functions.
VirtualKbc.c | Handles the Virtual KBC(Without KBC system) function.
VirtualKbd.c | Virtual keyboard functions.
VirtualMouse.c | Handles the Virtual mouse functions.
Ap4x.h | It has the Aptio4.x compatibility include files and headers.
Ap4x.c | It has the Aptio4.x compatibility function.
KbcEmulation.chm | CHM file for the eModule.
KbcEmulAcpi.c | Handles the KbcEmulAcpi functions.
KBCUHCI
ModulePart 		Root\Core\em\KbcEmul - Provide functions to Handle the SMI events for port 60/64
KbcUhci.cif | Component information file for the Module Part.
KbcUhci.c | Handles the SMI events for port 60/64.
KbcUhci.h | Header file for UHCI controller for Emulation.
KBCOHCI
ModulePart 		Root\Core\em\KbcEmul - Provide functions to Handle the SMI events for port 60/64.
KbcOhci.cif | Component information file for the Module Part.
KbcOhci.c | Handles the SMI events for port 60/64.
KbcOhci.h | Header file for OHCI controller for Emulation.
KBCEMULIRQ
ModulePart 		Root\Core\em\KbcEmul - Provide functions to handle the IRQ1 and IRQ12 generation
KbcEmulIrq.cif | Component information file for the Module Part.
KbcEmulIrq.c | Handles the IRQ1 and IRQ12 generation.
KBCSOUTHBRIDGE-IBEXPEAK
ModulePart 		Root\Board\em\KbcSbBoard - South Bridge Board module for KbcEmulation
KbcSbBoard.cif | Component information file for the Module Part.
KbcSbBoard.c | South bridge related code for Emulation.
KbcEmulationBoard
ModulePart 		Root\Board\em\KbcEmulBoard - Board module part for the KbcEmulation
KbcEmulBoard.cif | Component information file for the Module Part.
KbcEmulBoard.c | Board related code for Emulation.
BIOS Parameters
KbcEmulation Module Parameters:
Parameter Name | Type | Description
EMUL6064_SUPPORT | Boolean | Main switch to enable KBC Emulation support in Project.
UHCI_EMUL_SUPPORT | Boolean | Switch to enable UHCI based Emulation support in Project.
OHCI_EMUL_SUPPORT | Boolean | Switch to enable OHCI based Emulation support in Project.
IRQ_EMUL_SUPPORT | Boolean | Switch to enable software method of IRQ generation in Project.
EMULATION_ACPI_ENABLE_DISPATCH | Boolean | 1-Emulation SMI's will be disabled in the USB controller.
ICH10_WORKAROUND | Boolean | Switch to enable ICH10 Workaround. Emulation enabled and one of the USB controller disabled, We must clear the SMI status on disabled USB controller also
SW_IRQ_GENERATION_REG | Integer | Software IRQ generation regsiter from SB to generate the IRQ12 and IRQ1.
UHCI_EMUL_PCI_DEVICES | Expression | List of supported UHCI controllers in the following format: {dev1, ITF, SCC, BCC, offset}, {dev2, ITF, SCC, BCC, offset},...,{devN, ITF, SCC, BCC, offset}\dev represents the location of UHCI controller on PCI bus: dev = Bus << 8 + Dev << 3 + Func.\ITF represents the interface type of PCI device, for UHCI it must be 0.\SCC represents the sub class code of PCI device, for UHCI it must be 0x03.\BCC represents the base class code of PCI device, for UHCI it must be 0x0C.\offset represents the offset of legacy support register, for UHCI it must be 0xC0.
OHCI_EMUL_PCI_DEVICES | Expression | List of supported OHCI controllers in the following format: dev1, dev2,...,devN\dev represents the location of OHCI controller on PCI bus: dev = Bus << 8 + Dev << 3 + Func.
AMI Build Tools:
Tools Label: 4.5.5_TOOLS_41, Dated: 2013-03-19
Visual eBios: RSS.5.73.0244, Dated: 2013-03-19
Compiler Tool(s): Microsoft's Windows Driver Kit (WDK) Ver. 7600.16385.1
New features added in this label:
EIP #193601 - Aptio4.x - Security Enhancement for SMIHandler in KbcEmulation module, Checks if BAR address access is inside SMRAM, if yes, return.
General Bug Fixes and EIP Addressed in this Label:

General Bug Fix
None

EIP Addressed
EIP #193601 - Aptio4.x - Security Enhancement for SMIHandler in KbcEmulation module, Checks if BAR address access is inside SMRAM, if yes, return.
Files Changed for General Bug Fixes and EIP Addressed in this Label:

EIP Addressed
Root\core\em\KbcEmul\KbcEmul.mak (EIP #193601)
Root\core\em\KbcEmul\KbcEmul.c (EIP #193601)
Root\core\em\KbcEmul\KbcOhci.c (EIP #193601)
Known Limitations and Erratas in this label:
Errata Item(s) with a Description
  1. Issue
    • Symptom:
      PS2 keyboard doesn't work in RedHat Linux 4 when the Emulation is enabled.
    • Root Cause:
      Linux disables the Legacy USB SMI. But still the Port 60/64 Access SMI is enabled in offset C0 and C1 of the UHCI pci configuration space. This makes any Port60/64 read returns 0.
    • Solution:
      Disable the Port60/64 Trapping SMI in ACPI Enable callback resolved the issue.

  2. Build Issue: Token "UHCI_EMUL_PCI_DEVICES" & "OHCI_EMUL_PCI_DEVICES" value should be define in the project or else it through build error. To support these feature respectively need to enabled "UHCI_EMULATION_SUPPORT" & "OHCI_EMUL_SUPPORT" tokens.
Remaining Issues:
NONE
Unit Testing:
  • LegacyFree system, boots to DOS, try Edit command.
  • If the KbcEmulation module is disabled, Edit will not work. Enabled, Edit will work.
Validation Testing:
Quality Assurance System Test Plan
Quality Assurance Test Results
Release History:
4.6.3-KbcEmulation-020
  • [TAG] EIP193601
    [Category] New Feature
    [Description] Aptio4.x - Security Enhancement for SMIHandler in KbcEmulation module, Checks if BAR address access is inside SMRAM, if yes, return.
    [Files] KbcEmul.mak, KbcEmul.c, KbcOhci.c

Release_4.6.3_KbcEmulation_019
Release_4.6.3_KbcEmulation_018
Release_4.6.3_KbcEmulation_017
Release_4.6.3_KbcEmulation_016

© American Megatrends Inc.


Release Notes - NDA Required

Validation Test Report for KbcEmulation Label (INT)_a_4.6.3-KbcEmulation-020

Platform Information Form :

Board Information - Chief river
BIOS Information (Label, Path) - Labeled'4.6.5.4_VEB_1APTJ030'; Path 'SAlaska;$/Alaska/Projects/Intel/IvyBridge/PantherPoint_ChiefRiver_Crb_1APTJ/;';
Chipset Information (Type, Stepping) -
CPU Information (Type, Stepping) -
Memory Info (Manufacturer, Speed, Configuration) -
Graphics (Please specify which one in used) -
Chipset driver Version -
Graphics drive Version -

Description:
Configuration:
Platform: Emerald Lake FAB 1
Processor: Ivy Bridge 2100MHZ E0/L0
SB: Panther Point C0
RAM: 2GB DDR3 1333MHZ Samsung
Off Board Vga
DETECT_PS2_KEYBOARD and DETECT_PS2_MOUSE to 1, token INSTALL_KEYBOARD_MOUSE_ALWAYS to 0

The following BQA Tests have been validated in Chief river Platform
Build
REF-31549 .N/A 32 Bit Project Compile ----- Blocked..
Status Update:Intel CPU Reference Code is not to support X64_BUILD=0
REF-37927 .N/A Linux - Test ROM build ----- Blocked..
Status Update:Not applicable for Aptio 4
REF-31549 .N/A Test ROM Build ----- PASS
Status Update:

CppCheck
REF-37351 .N/A Cpp Check ----- Blocked..
Status Update:Not applicable for Aptio 4

Hardware
REF-30851 DOS USB Keyboard/Mouse In DOS ---- PASS
Status Update:

PCI-e
REF-28682 DOS PCI-EXPRESS SAS Controller ---- PASS
Status Update: E RAID 1430SA Controller

REF-28723 Not OS Specific PCI Express LAN Compatability ---- U/T
Status Update: Option ROM dispatched soon. Unable to test.

REF-27930Not OS Specific PCI Express SCSI RAID ---- Blocked
Status Update: No IDE Ports is available

Kbc Emulation
REF-34751 DOS Test Kbd/Mouse in EDIT.COM with KBC Present system --- PASS
Status Update: DETECT_PS2_KEYBOARD and DETECT_PS2_MOUSE to 1, token INSTALL_KEYBOARD_MOUSE_ALWAYS to 0

REF-34752 DOS Test Kbd/Mouse in EDIT.COM without KBC Present sys --- Blocked
Status Update: This platform has On Board KBC Controller

REF-34754 DOS Test Ps2/USB Kbd in Option ROM with KBC System --- PASS
Status Update:

REF-34755 DOS Test USB Keyboard in Option ROM without KBC System --- Blocked
Status Update: This platform has On Board KBC Controller


Function by File Name

AMIBIOS Function Reference

By File Name

The following is a list of the .asm files.
For a list in alphabetical order, see In Alphabetical Order.

  • Ap4x.c
  • Ap4x.h
  • Kbc.h
  • Kbccore.c
  • KbcDevEmul.h
  • KbcEmul.c
  • KbcEmul.dxs
  • KbcEmul.h
  • KbcEmul.mak
  • KbcEmulAcpi.c
  • KbcEmulIrq.c
  • KbcEmulLib.c
  • KbcEmulLib.h
  • KbcOhci.c
  • KbcOhci.h
  • KbcUhci.c
  • KbcUhci.h
  • Legacykbc.c
  • Legacykbd.c
  • LegacyMouse.c
  • VirtualKbc.c
  • VirtualKbd.c
  • VirtualMouse.c


Ap4x.c

Description:
It has the Aptio4.x compatibility function


Ap4x.h

Description:
It has the Aptio4.x compatibility include files and headers


Kbc.h

Description:
KBC Header file has the structure defination for Virtual and Legacy devices


Kbccore.c

Description:
It has function for port 60 read, 60 write, 64 read and 64 write

The following functions are used in the file: Kbccore.c.

Function | Description
FindSMICpu | In a Multiprocessor environment, any logical CPU can generate the SMI. This function finds the CPU that generates SMI by accessing IO 60/64 Ports
getTrapAL | Get the port 60 or 64 input value from the CPU save reg
hasTrapStatus | return the port 6064 trap status
NonSmmTrapEnable | Enable/disable the port6064 trap in Non SMM
setTrapAL | Set the port 60 or 64 output value to the CPU save reg
trap64w | This function handles the Port64 write command
TrapEnable | Enable/disable the port6064 trap


FindSMICpu in the Kbccore.c

Function : FindSMICpu

File: Kbccore.c
Description:
In a Multiprocessor environment, any logical CPU can generate
the SMI. This function finds the CPU that generates SMI by accessing
IO 60/64 Ports
Input:
None
Output:
UINT8 CpuIndex


getTrapAL in the Kbccore.c

Function : getTrapAL

File: Kbccore.c
Description:
Get the port 60 or 64 input value from the CPU save reg
Input:
None
Output:
UINT8 Value


hasTrapStatus in the Kbccore.c

Function : hasTrapStatus

File: Kbccore.c
Description:
return the port 6064 trap status
Input:
None
Output:
TRUE: Trab enabled for port 6064


NonSmmTrapEnable in the Kbccore.c

Function : NonSmmTrapEnable

File: Kbccore.c
Description:
Enable/disable the port6064 trap in Non SMM
Input:
TRUE : enable the trap.
FALSE: Disable the trap.
Output:
TRUE/FALSE


setTrapAL in the Kbccore.c

Function : setTrapAL

File: Kbccore.c
Description:
Set the port 60 or 64 output value to the CPU save reg
Input:
UINT8 Data
Output:
None


trap64w in the Kbccore.c

Function : trap64w

File: Kbccore.c
Description:
This function handles the Port64 write command
Input:
None
Output:
None


TrapEnable in the Kbccore.c

Function : TrapEnable

File: Kbccore.c
Description:
Enable/disable the port6064 trap
Input:
TRUE : enable the trap.
FALSE: Disable the trap.
Output:
TRUE : when suucessfully done else FALSE


KbcDevEmul.h

Description:
Devices header file


KbcEmul.c

Description:
KBC emulation driver entry point and initilize the SMI for port 6064

The following functions are used in the file: KbcEmul.c.

Function | Description
Emulation6064TrapDisable | Disable the SMI source for port 6064
Emulation6064TrapEnable | Enable the SMI source for port 6064
Emulation_Init | Initilize the Keyboard Controller, Keyboard and Mouse device.Regsiter the SMI for port 6064 access.
EmulationEntryPoint | Entry point for Emulation driver. If the port 6064 emulation enabled by setup it enables the SMI event for port 6064 and install the Trap handle protocol.
KbcEmulationFeature | Returns all the feature supported by Emulation
NonSmmEmulation6064TrapDisable | Disable the SMI source for port 6064 in Non SMM
NonSmmEmulation6064TrapEnable | Enable the SMI source for port 6064 in Non SMM


Emulation6064TrapDisable in the KbcEmul.c

Function : Emulation6064TrapDisable

File: KbcEmul.c
Description:
Disable the SMI source for port 6064
Input:
None
Output:
TRUE/FALSE


Emulation6064TrapEnable in the KbcEmul.c

Function : Emulation6064TrapEnable

File: KbcEmul.c
Description:
Enable the SMI source for port 6064
Input:
None
Output:
TRUE/FALSE


Emulation_Init in the KbcEmul.c

Function : Emulation_Init

File: KbcEmul.c
Description:
Initilize the Keyboard Controller, Keyboard and Mouse device.Regsiter the SMI for port 6064
access.
Input:
None
Output:
None


EmulationEntryPoint in the KbcEmul.c

Function : EmulationEntryPoint

File: KbcEmul.c
Description:
Entry point for Emulation driver. If the port 6064 emulation enabled by setup
it enables the SMI event for port 6064 and install the Trap handle protocol.
Input:
Standard EFI Image entry - EFI_IMAGE_ENTRY_POINT
Output:
Status: EFI_SUCCESS = Success
       EFI_ERROR = Failure


KbcEmulationFeature in the KbcEmul.c

Function : KbcEmulationFeature

File: KbcEmul.c
Description:
Returns all the feature supported by Emulation
Input:
None
Output:
None


NonSmmEmulation6064TrapDisable in the KbcEmul.c

Function : NonSmmEmulation6064TrapDisable

File: KbcEmul.c
Description:
Disable the SMI source for port 6064 in Non SMM
Input:
None
Output:
None


NonSmmEmulation6064TrapEnable in the KbcEmul.c

Function : NonSmmEmulation6064TrapEnable

File: KbcEmul.c
Description:
Enable the SMI source for port 6064 in Non SMM
Input:
None
Output:
None


KbcEmul.dxs

Description:
DXS file for the Kbc Emulation


KbcEmul.h

Description:
KBC emulation header file


KbcEmul.mak

Description:
Mak file the KBC Emulation


KbcEmulAcpi.c

Description:
This file contains Emulation SMI disable function on ACPI
enable/Disable SMI

The following functions are used in the file: KbcEmulAcpi.c.

Function | Description
KbcEmulationDisable | This routine will be called when ACPI enabled or disabled SMI happens.
RegisterAcpiEnableCallBack | This routine will be called by KbcEmulation Init to register the callback function on Acpi Enable/Disable SMI.


KbcEmulationDisable in the KbcEmulAcpi.c

Function : KbcEmulationDisable

File: KbcEmulAcpi.c
Description:
This routine will be called when ACPI enabled or disabled SMI happens.
Input:
DispatchHandle  - Handle to the Dispatcher
Output:
None
Notes:
None


RegisterAcpiEnableCallBack in the KbcEmulAcpi.c

Function : RegisterAcpiEnableCallBack

File: KbcEmulAcpi.c
Description:
This routine will be called by KbcEmulation Init
to register the callback function on Acpi Enable/Disable SMI.
Input:
None
Output:
None
Notes:
None


KbcEmulIrq.c

Description:
Handles the IRQ1 and IRQ12 generation

The following functions are used in the file: KbcEmulIrq.c.

Function | Description
GenerateIRQ1 | Generate IRQ1
GenerateIRQ12 | Generate IRQ1


GenerateIRQ1 in the KbcEmulIrq.c

Function : GenerateIRQ1

File: KbcEmulIrq.c
Description:
Generate IRQ1
Input:
None
Output:
None


GenerateIRQ12 in the KbcEmulIrq.c

Function : GenerateIRQ12

File: KbcEmulIrq.c
Description:
Generate IRQ1
Input:
None
Output:
None


KbcEmulLib.c

Description:
KBC emulation lib file that used in other files

The following functions are used in the file: KbcEmulLib.c.

Function | Description
ByteReadIO | This routine reads a Byte from the specified IO address
ByteWriteIO | This routine writes a byte to the specified IO address
ByteWritePCIConfig | This routine writes a byte value to the PCI configuration register space
DwordReadIO | This routine reads a dword from the specified IO address
DwordWriteIO | This routine writes a double word to the specified IO address
DwordWritePCIConfig | This routine writes a Dword value to the PCI configuration register space
NonSmmByteReadIO | This routine reads a Byte from the specified IO address
NonSmmByteWriteIO | This routine writes a byte to the specified IO address
NonSmmByteWritePCIConfig | This routine writes a byte value to the PCI configuration register space
NonSmmDwordReadIO | This routine reads a dword from the specified IO address
NonSmmDwordWriteIO | This routine writes a double word to the specified IO address
NonSmmDwordWritePCIConfig | This routine writes a Dword value to the PCI configuration register space
NonSmmReadPCIConfig | This routine reads from the PCI configuration space register the value can be typecasted to 8bits - 32bits
NonSmmWordReadIO | This routine reads a Word from the specified IO address
NonSmmWordWriteIO | This routine writes a word to the specified IO address
NonSmmWordWritePCIConfig | This routine writes a word value to the PCI configuration register space
NonSmmWritePCIConfig | This function opens PCI configuration for a given register
ReadPCIConfig | This routine reads from the PCI configuration space register the value can be typecasted to 8bits - 32bits
WordReadIO | This routine reads a Word from the specified IO address
WordWriteIO | This routine writes a word to the specified IO address
WordWritePCIConfig | This routine writes a byte value to the PCI configuration register space
WritePCIConfig | This function opens PCI configuration for a given register


ByteReadIO in the KbcEmulLib.c

Function : ByteReadIO

File: KbcEmulLib.c
Description:
This routine reads a Byte from the specified IO address
Input:
wIOAddr     I/O address to read
Output:
Value read


ByteWriteIO in the KbcEmulLib.c

Function : ByteWriteIO

File: KbcEmulLib.c
Description:
This routine writes a byte to the specified IO address
Input:
wIOAddr     I/O address to write
bValue      Byte value to write
Output:
None


ByteWritePCIConfig in the KbcEmulLib.c

Function : ByteWritePCIConfig

File: KbcEmulLib.c
Description:
This routine writes a byte value to the PCI configuration
register space
Input:
BusDevFunc - Bus, device & function number of the PCI device
Register   - Register offset to read
Value      - Value to write
Output:
None


DwordReadIO in the KbcEmulLib.c

Function : DwordReadIO

File: KbcEmulLib.c
Description:
This routine reads a dword from the specified IO address
Input:
wIOAddr     I/O address to read
Output:
Value read


DwordWriteIO in the KbcEmulLib.c

Function : DwordWriteIO

File: KbcEmulLib.c
Description:
This routine writes a double word to the specified IO address
Input:
wIOAddr     I/O address to write
dValue      Double word value to write
Output:
None


DwordWritePCIConfig in the KbcEmulLib.c

Function : DwordWritePCIConfig

File: KbcEmulLib.c
Description:
This routine writes a Dword value to the PCI configuration
register space
Input:
BusDevFunc - Bus, device & function number of the PCI device
Register   - Register offset to read
Value      - Value to write
Output:
None


NonSmmByteReadIO in the KbcEmulLib.c

Function : NonSmmByteReadIO

File: KbcEmulLib.c
Description:
This routine reads a Byte from the specified IO address
Input:
wIOAddr     I/O address to read
Output:
Value read


NonSmmByteWriteIO in the KbcEmulLib.c

Function : NonSmmByteWriteIO

File: KbcEmulLib.c
Description:
This routine writes a byte to the specified IO address
Input:
wIOAddr     I/O address to write
bValue      Byte value to write
Output:
None


NonSmmByteWritePCIConfig in the KbcEmulLib.c

Function : NonSmmByteWritePCIConfig

File: KbcEmulLib.c
Description:
This routine writes a byte value to the PCI configuration
register space
Input:
BusDevFunc - Bus, device & function number of the PCI device
Register   - Register offset to read
Value      - Value to write
Output:
None


NonSmmDwordReadIO in the KbcEmulLib.c

Function : NonSmmDwordReadIO

File: KbcEmulLib.c
Description:
This routine reads a dword from the specified IO address
Input:
wIOAddr     I/O address to read
Output:
Value read


NonSmmDwordWriteIO in the KbcEmulLib.c

Function : NonSmmDwordWriteIO

File: KbcEmulLib.c
Description:
This routine writes a double word to the specified IO address
Input:
wIOAddr     I/O address to write
dValue      Double word value to write
Output:
None


NonSmmDwordWritePCIConfig in the KbcEmulLib.c

Function : NonSmmDwordWritePCIConfig

File: KbcEmulLib.c
Description:
This routine writes a Dword value to the PCI configuration
register space
Input:
BusDevFunc - Bus, device & function number of the PCI device
Register   - Register offset to read
Value      - Value to write
Output:
None


NonSmmReadPCIConfig in the KbcEmulLib.c

Function : NonSmmReadPCIConfig

File: KbcEmulLib.c
Description:
This routine reads from the PCI configuration space register
the value can be typecasted to 8bits - 32bits
Input:
BusDevFunc - Bus, device & function number of the PCI device
Register   - Register offset to read
Output:
Value read


NonSmmWordReadIO in the KbcEmulLib.c

Function : NonSmmWordReadIO

File: KbcEmulLib.c
Description:
This routine reads a Word from the specified IO address
Input:
wIOAddr     I/O address to read
Output:
Value read


NonSmmWordWriteIO in the KbcEmulLib.c

Function : NonSmmWordWriteIO

File: KbcEmulLib.c
Description:
This routine writes a word to the specified IO address
Input:
wIOAddr     I/O address to write
wValue      Word value to write
Output:
None


NonSmmWordWritePCIConfig in the KbcEmulLib.c

Function : NonSmmWordWritePCIConfig

File: KbcEmulLib.c
Description:
This routine writes a word value to the PCI configuration
register space
Input:
BusDevFunc - Bus, device & function number of the PCI device
Register   - Register offset to write
Value      - Value to write
Output:
None


NonSmmWritePCIConfig in the KbcEmulLib.c

Function : NonSmmWritePCIConfig

File: KbcEmulLib.c
Description:
This function opens PCI configuration for a given register
Input:
wBDF  - Bus, device and function number
bReg  - Register number to read
Output:
IO register to write the value


ReadPCIConfig in the KbcEmulLib.c

Function : ReadPCIConfig

File: KbcEmulLib.c
Description:
This routine reads from the PCI configuration space register
the value can be typecasted to 8bits - 32bits
Input:
BusDevFunc - Bus, device & function number of the PCI device
Register   - Register offset to read
Output:
Value read


WordReadIO in the KbcEmulLib.c

Function : WordReadIO

File: KbcEmulLib.c
Description:
This routine reads a Word from the specified IO address
Input:
wIOAddr     I/O address to read
Output:
Value read


WordWriteIO in the KbcEmulLib.c

Function : WordWriteIO

File: KbcEmulLib.c
Description:
This routine writes a word to the specified IO address
Input:
wIOAddr     I/O address to write
wValue      Word value to write
Output:
None


WordWritePCIConfig in the KbcEmulLib.c

Function : WordWritePCIConfig

File: KbcEmulLib.c
Description:
This routine writes a byte value to the PCI configuration
register space
Input:
BusDevFunc - Bus, device & function number of the PCI device
Register   - Register offset to read
Value      - Value to write
Output:
None


WritePCIConfig in the KbcEmulLib.c

Function : WritePCIConfig

File: KbcEmulLib.c
Description:
This function opens PCI configuration for a given register
Input:
wBDF  - Bus, device and function number
bReg  - Register number to read
Output:
IO register to write the value


KbcEmulLib.h

Description:
KBC emulation Lib header file used in other files


KbcOhci.c

Description:
Handles the SMI events for port 60/64

The following functions are used in the file: KbcOhci.c.

Function | Description
CheckNumberofResponseBytes | Based on KBD/Mouse cmd, determine how many response bytes should be provided
CheckPS2KBDMousePresence | Check whether PS2 KBD/Mouse IRQ has been enabled or not
DisableLegKeyRegs | Disable the port6064 SMI source based on the Trap enable mask.
GetHceInput | Reads the HceInput register which holds the data written to port 60/64
GetHceOutput | Reads the HceOutPut register in OHCI controller
GetHceStatus | Reads the HceStatus register in OHCI controller
HandleGA20Sequence | SMI triggered becauase of GA20 sequence change
NonSmmOhci_TrapEnable | Enable/Disable traping in OHCI HC.
Ohci_HasTrapStatus | Return whether Emulation Interrupt has been generated or not
Ohci_TrapEnable | Enable/Disable traping in OHCI HC.
SerialOutput | Directly writes to 3F8 COM port. Using this routine will be faster and debug output delay will have no impact on debugging time sensitive routines O/P the byte and give a space after that;
SetHceControl | Writes to HceControl in OHCI controller
SetHceOutput | Writes to HceOutput which is returned on IO port 60h read
SetHceStatus | Writes to HceStatus in OHCI controller
Smm_Register | Enable the SMI for port 6064 access.
Trap6064_Handler | SMI handler to handle the 64write, 64read, 60 write and 60 read SMI.
Trap6064_Handler_LegFree | SMI handler to handle the 64write, 64read, 60 write and 60 read SMI.
WaitForOBFSMM | Wait till O/P buffer is full


CheckNumberofResponseBytes in the KbcOhci.c

Function : CheckNumberofResponseBytes

File: KbcOhci.c
Description:
Based on KBD/Mouse cmd, determine how many response bytes should be provided
Input:
None
Output:
Updates ResponseBytes

Note :       Called only inside SMM


CheckPS2KBDMousePresence in the KbcOhci.c

Function : CheckPS2KBDMousePresence

File: KbcOhci.c
Description:
Check whether PS2 KBD/Mouse IRQ has been enabled or not
Input:
None
Output:
TRUE: if PS2 KBD/MOUSE IRQ enabled

Note :   Called only inside SMM


DisableLegKeyRegs in the KbcOhci.c

Function : DisableLegKeyRegs

File: KbcOhci.c
Description:
Disable the port6064 SMI source based on the Trap enable mask.
Input:
None
Output:
None

Note :       Called inside SMM


GetHceInput in the KbcOhci.c

Function : GetHceInput

File: KbcOhci.c
Description:
Reads the HceInput register which holds the data written to port 60/64
Input:
None
Output:
UINT8

Note :       Called only inside SMM


GetHceOutput in the KbcOhci.c

Function : GetHceOutput

File: KbcOhci.c
Description:
Reads the HceOutPut register in OHCI controller
Input:
None
Output:
UINT8

Note :       Called only inside SMM


GetHceStatus in the KbcOhci.c

Function : GetHceStatus

File: KbcOhci.c
Description:
Reads the HceStatus register in OHCI controller
Input:
None
Output:
UINT8

Note :       Called only inside SMM


HandleGA20Sequence in the KbcOhci.c

Function : HandleGA20Sequence

File: KbcOhci.c
Description:
SMI triggered becauase of GA20 sequence change
Input:
None
Output:
None

Note :       Called inside SMM


NonSmmOhci_TrapEnable in the KbcOhci.c

Function : NonSmmOhci_TrapEnable

File: KbcOhci.c
Description:
Enable/Disable traping in OHCI HC.
Input:
Boolean
Output:
TRUE/FALSE

Note:        Called outside SMM


Ohci_HasTrapStatus in the KbcOhci.c

Function : Ohci_HasTrapStatus

File: KbcOhci.c
Description:
Return whether Emulation Interrupt has been generated or not
Input:
None
Output:
BOOLEAN

Note :       Called inside SMM. No usage for now. Present for compatible reason with OHCI.


Ohci_TrapEnable in the KbcOhci.c

Function : Ohci_TrapEnable

File: KbcOhci.c
Description:
Enable/Disable traping in OHCI HC.
Input:
Boolean
Output:
TRUE/FALSE

Note :       Called inside SMM


SerialOutput in the KbcOhci.c

Function : SerialOutput

File: KbcOhci.c
Description:
Directly writes to 3F8 COM port. Using this routine will be faster and
debug output delay will have no impact on debugging time sensitive routines
O/P the byte and give a space after that;
Input:
Byte to output
Output:
None

Note :


SetHceControl in the KbcOhci.c

Function : SetHceControl

File: KbcOhci.c
Description:
Writes to HceControl in OHCI controller
Input:
UINT8
Output:
None

Note :       Called only inside SMM


SetHceOutput in the KbcOhci.c

Function : SetHceOutput

File: KbcOhci.c
Description:
Writes to HceOutput which is returned on IO port 60h read
Input:
UINT8
Output:
None

Note :       Called only inside SMM


SetHceStatus in the KbcOhci.c

Function : SetHceStatus

File: KbcOhci.c
Description:
Writes to HceStatus in OHCI controller
Input:
UINT8
Output:
None

Note :       Called only inside SMM


Smm_Register in the KbcOhci.c

Function : Smm_Register

File: KbcOhci.c
Description:
Enable the SMI for port 6064 access.
Input:
None
Output:
None

Note :       Called inside SMM


Trap6064_Handler in the KbcOhci.c

Function : Trap6064_Handler

File: KbcOhci.c
Description:
SMI handler to handle the 64write, 64read, 60 write and 60 read SMI.
Input:
DispatchHandle  - EFI Handle
DispatchContext - Pointer to the EFI_SMM_SW_DISPATCH_CONTEXT
Output:
None

Note :       Called inside SMM
Used only when KBC is present on the system


Trap6064_Handler_LegFree in the KbcOhci.c

Function : Trap6064_Handler_LegFree

File: KbcOhci.c
Description:
SMI handler to handle the 64write, 64read, 60 write and 60 read SMI.
Input:
DispatchHandle  - EFI Handle
DispatchContext - Pointer to the EFI_SMM_SW_DISPATCH_CONTEXT
Output:
None

Note :   Called inside SMM
Used only when KBC is NOT present on the system


WaitForOBFSMM in the KbcOhci.c

Function : WaitForOBFSMM

File: KbcOhci.c
Description:
Wait till O/P buffer is full
Input:
None
Output:
None

Note :       Called only inside SMM


KbcOhci.h

Description:
Header file for OCHI controller for Emulation


KbcUhci.c

Description:
Handles the SMI events for port 60/64

The following functions are used in the file: KbcUhci.c.

Function | Description
ClearLegKeyStatusReg | Clear the Port6064 SMI Status Reg
DisableLegKeyRegs | Disable the port6064 SMI source based on the Trap enable mask.
NonSmmClearLegKeyStatusReg | Clear the Port6064 SMI Status
NonSmmUhci_TrapEnable | Enable/Disable traping in UHCI HC.
NonSmmValidateUhc | Validate the UHCI controller.
NonSmmWriteLegKeyReg | Write the Value in to all the UHCI controller Legacy Regsiters.
Smm_Register | Enable the SMI for port 6064 access.
Trap6064_Handler | SMI handler to handle the 64write, 64read, 60 write and 60 read SMI.
Uhci_HasTrapStatus | Check if trap status is set in UHCI HC.
Uhci_TrapEnable | Enable/Disable traping in UHCI HC.
ValidateUhc | Validate the UHCI controller.
WriteLegKeyReg | Write the Value in to all the UHCI controller Legacy Regsiters.


ClearLegKeyStatusReg in the KbcUhci.c

Function : ClearLegKeyStatusReg

File: KbcUhci.c
Description:
Clear the Port6064 SMI Status Reg
Input:
UINT8 Value
Output:
None


DisableLegKeyRegs in the KbcUhci.c

Function : DisableLegKeyRegs

File: KbcUhci.c
Description:
Disable the port6064 SMI source based on the Trap enable mask.
Input:
None
Output:
None


NonSmmClearLegKeyStatusReg in the KbcUhci.c

Function : NonSmmClearLegKeyStatusReg

File: KbcUhci.c
Description:
Clear the Port6064 SMI Status
Input:
UINT8 Value
Output:
None


NonSmmUhci_TrapEnable in the KbcUhci.c

Function : NonSmmUhci_TrapEnable

File: KbcUhci.c
Description:
Enable/Disable traping in UHCI HC.
Input:
Boolean
Output:
None


NonSmmValidateUhc in the KbcUhci.c

Function : NonSmmValidateUhc

File: KbcUhci.c
Description:
Validate the UHCI controller.
Input:
Boolean
Output:
Boolean


NonSmmWriteLegKeyReg in the KbcUhci.c

Function : NonSmmWriteLegKeyReg

File: KbcUhci.c
Description:
Write the Value in to all the UHCI controller Legacy Regsiters.
Input:
UINT8 Value
Output:
None


Smm_Register in the KbcUhci.c

Function : Smm_Register

File: KbcUhci.c
Description:
Enable the SMI for port 6064 access.
Input:
None
Output:
None


Trap6064_Handler in the KbcUhci.c

Function : Trap6064_Handler

File: KbcUhci.c
Description:
SMI handler to handle the 64write, 64read, 60 write and 60 read SMI.
Input:
DispatchHandle  - EFI Handle
DispatchContext - Pointer to the EFI_SMM_SW_DISPATCH_CONTEXT
Output:
None


Uhci_HasTrapStatus in the KbcUhci.c

Function : Uhci_HasTrapStatus

File: KbcUhci.c
Description:
Check if trap status is set in UHCI HC.
Input:
None
Output:
None


Uhci_TrapEnable in the KbcUhci.c

Function : Uhci_TrapEnable

File: KbcUhci.c
Description:
Enable/Disable traping in UHCI HC.
Input:
Boolean
Output:
None


ValidateUhc in the KbcUhci.c

Function : ValidateUhc

File: KbcUhci.c
Description:
Validate the UHCI controller.
Input:
Boolean
Output:
Boolean


WriteLegKeyReg in the KbcUhci.c

Function : WriteLegKeyReg

File: KbcUhci.c
Description:
Write the Value in to all the UHCI controller Legacy Regsiters.
Input:
UINT8 Value
Output:
None


KbcUhci.h

Description:
Header file for UCHI controller for Emulation


Legacykbc.c

Description:
LegacyKBC handles the with KBC model

The following functions are used in the file: Legacykbc.c.

Function | Description
initLegacyKBC | Initilize the KBC structure
kbc_kbd_wdata | Handle write to port 60. The data is passed to the Keyboard emulation machine Next state is: accepting keyboard data on port 60.
kbc_kbd_wdata2 | Handle write to port 60. This function handles the data specfic the KBC controller. Next state is: accepting keyboard data on port 60.
kbc_mouse_wdata | Handle write to port 60. Previouse command written to port 64 was "Send to auxilary device" (0xD4). The data is passed to the Mouse emulation machine. Next state is: accepting keyboard data on port 60.
kbc_passthrough_wcmd | Handle write to port 64.The emulation doesn't process this write and the access is passed to the KBC
kbc_passthrough_wdata | Handle write to port 60.The emulation doesn't process this write and the access is passed to the KBC
KBC_ReadDataByte | This routine till the keyboard controller sends a data byte
KBC_WaitForInputBufferToBeFree | This routine checks the input buffer free bit and waits till it is set by the keyboard controller
KBC_WaitForOutputBufferToBeFilled | This routine checks the output buffer full bit and waits till it is set by the keyboard controller
kbc_wccb | Handle write to port 60. Previouse command written to port 64 was "Write CCB (60h)" The data is a new ccb. Next state is: accepting keyboard data on port 60.
KBC_WriteCommandByte | This routine writes the command to the keyboard controller
KBC_WriteSubCommandByte | This routine writes the command to the keyboard controller
legkbc_sendout | Implementation of the "send_outb1" for the case of legacy KBC present. Data is put into output buffer of legacy KBC which sets OBF and generates IRQ. Application gets a chance to handle the interrupt and read the data from legacy KBC.
legkbc_updateCCB | Update cached CCB in responce to trapped KBC command.If CCB wasn't loaded before, the new CCB cache is still unkknown.
on_kbc_write_command | Handle write to port 64. New command always aborts previous (no state dependency). This function will always get called on port 64 write.Parse the incomming command and change the state accoringly


initLegacyKBC in the Legacykbc.c

Function : initLegacyKBC

File: Legacykbc.c
Description:
Initilize the KBC structure
Input:
KBC, KBD and Mouse
Output:
None


kbc_kbd_wdata in the Legacykbc.c

Function : kbc_kbd_wdata

File: Legacykbc.c
Description:
Handle write to port 60. The data is passed to the Keyboard emulation machine
   Next state is: accepting keyboard data on port 60.
Input:
KBC, Keyboard data
Output:
None


kbc_kbd_wdata2 in the Legacykbc.c

Function : kbc_kbd_wdata2

File: Legacykbc.c
Description:
Handle write to port 60. This function handles the data specfic the
   KBC controller. Next state is: accepting keyboard data on port 60.
Input:
KBC, Keyboard data
Output:
None


kbc_mouse_wdata in the Legacykbc.c

Function : kbc_mouse_wdata

File: Legacykbc.c
Description:
Handle write to port 60. Previouse command written to port 64 was "Send to auxilary device"
   (0xD4). The data is passed to the Mouse emulation machine.
   Next state is: accepting keyboard data on port 60.
Input:
KBC, Mouse data
Output:
None


kbc_passthrough_wcmd in the Legacykbc.c

Function : kbc_passthrough_wcmd

File: Legacykbc.c
Description:
Handle write to port 64.The emulation doesn't process this write and
   the access is passed to the KBC
Input:
KBC, Port 64 command
Output:
None


kbc_passthrough_wdata in the Legacykbc.c

Function : kbc_passthrough_wdata

File: Legacykbc.c
Description:
Handle write to port 60.The emulation doesn't process this write and the access is passed to the KBC
Input:
KBC, Port 60 Data
Output:
None


KBC_ReadDataByte in the Legacykbc.c

Function : KBC_ReadDataByte

File: Legacykbc.c
Description:
This routine till the keyboard controller sends a data byte
Input:
None
Output:
Data byte received from the keyboard controller


KBC_WaitForInputBufferToBeFree in the Legacykbc.c

Function : KBC_WaitForInputBufferToBeFree

File: Legacykbc.c
Description:
This routine checks the input buffer free bit and waits till
it is set by the keyboard controller
Input:
None
Output:
None


KBC_WaitForOutputBufferToBeFilled in the Legacykbc.c

Function : KBC_WaitForOutputBufferToBeFilled

File: Legacykbc.c
Description:
This routine checks the output buffer full bit and waits till
it is set by the keyboard controller
Input:
None
Output:
None


kbc_wccb in the Legacykbc.c

Function : kbc_wccb

File: Legacykbc.c
Description:
Handle write to port 60. Previouse command written to port 64 was "Write CCB (60h)"
   The data is a new ccb.  Next state is: accepting keyboard data on port 60.
Input:
KBC, CCB Data
Output:
None


KBC_WriteCommandByte in the Legacykbc.c

Function : KBC_WriteCommandByte

File: Legacykbc.c
Description:
This routine writes the command to the keyboard controller
Input:
KBC Command
Output:
None


KBC_WriteSubCommandByte in the Legacykbc.c

Function : KBC_WriteSubCommandByte

File: Legacykbc.c
Description:
This routine writes the command to the keyboard controller
Input:
KBC Command
Output:
None


legkbc_sendout in the Legacykbc.c

Function : legkbc_sendout

File: Legacykbc.c
Description:
Implementation of the "send_outb1" for the case of legacy KBC present. Data is put into output buffer
   of legacy KBC which sets OBF and generates IRQ. Application gets a chance to handle the interrupt and
   read the data from legacy KBC.
Input:
KBC, Device type, Data or Reponce data, Data
Output:
None
Notes:
condition is checked: OBF is cleard (previous data was processed)


legkbc_updateCCB in the Legacykbc.c

Function : legkbc_updateCCB

File: Legacykbc.c
Description:
Update cached CCB in responce to trapped KBC command.If CCB wasn't loaded before, the new CCB cache is
   still unkknown.
Input:
KBC, Set and Mask value
Output:
None


on_kbc_write_command in the Legacykbc.c

Function : on_kbc_write_command

File: Legacykbc.c
Description:
Handle write to port 64.  New command always aborts previous (no state dependency). This function
   will always get called on port 64 write.Parse the incomming command and change the state accoringly
Input:
KBC, Port 64 Command
Output:
None


Legacykbd.c

Description:
Legacy Keyboard functions

The following functions are used in the file: Legacykbd.c.

Function | Description
InitLegacyKbd | Initialize the KBD data
LegacyKbd_initParams | Initialize the KBD data
LegacyKbd_pumpQueue | KBC has empty queue; Legacy I/O trapping is being processed.If Kbd has data to push into KBC, now is a good time to do it
LegacyKbd_read_codes | Keyboard Read Codes.
LegacyKbd_read_option | Keyboard Read option.
LegacyKbd_rw_scancode | Keyboard Read write Scan code.
Legacykbd_scanning | Handle commands sent from KBC to PS2 Keyboard. Keyboard is scanning or idle, waiting for command or key
LegacyKbd_send_resp | Place the Responce bytes in the keyboard buffer.
LegacykbdInput_GetTranslation | KBC translation
LegacykbdInput_Send | Keyboard Input source sends data. Put the data into the buffer, attempt to send the first byte. The call comes outside of Trapping Leg access. Check that Trapping status will not be overriden
LegacykbdInput_updateLED | Update the keyboard LED's


InitLegacyKbd in the Legacykbd.c

Function : InitLegacyKbd

File: Legacykbd.c
Description:
Initialize the KBD data
Input:
kbc     - pointer to the KBC Structure
kbd     - Pointer to the KBD structure
Output:
None


LegacyKbd_initParams in the Legacykbd.c

Function : LegacyKbd_initParams

File: Legacykbd.c
Description:
Initialize the KBD data
Input:
kbd   - Pointer to the KBD structure
Output:
None


LegacyKbd_pumpQueue in the Legacykbd.c

Function : LegacyKbd_pumpQueue

File: Legacykbd.c
Description:
KBC has empty queue; Legacy I/O trapping is being processed.If Kbd has data to push into KBC,
now is a good time to do it
Input:
ps2dev  - pointer to the KBD structure
Output:
None


LegacyKbd_read_codes in the Legacykbd.c

Function : LegacyKbd_read_codes

File: Legacykbd.c
Description:
Keyboard Read Codes.
Input:
ps2dev  - pointer to the KBD structure
Cmd     - Data from the kbc buffer
Output:
None


LegacyKbd_read_option in the Legacykbd.c

Function : LegacyKbd_read_option

File: Legacykbd.c
Description:
Keyboard Read option.
Input:
ps2dev  - pointer to the KBD structure
Cmd     - Data from the kbc buffer
Output:
None


LegacyKbd_rw_scancode in the Legacykbd.c

Function : LegacyKbd_rw_scancode

File: Legacykbd.c
Description:
Keyboard Read write Scan code.
Input:
ps2dev  - pointer to the KBD structure
Cmd     - Data from the kbc buffer
Output:
None


Legacykbd_scanning in the Legacykbd.c

Function : Legacykbd_scanning

File: Legacykbd.c
Description:
Handle commands sent from KBC to PS2 Keyboard. Keyboard is scanning or idle, waiting for command
or key
Input:
ps2dev  - pointer to the KBD structure
Cmd     - Data from the kbc buffer
Output:
None


LegacyKbd_send_resp in the Legacykbd.c

Function : LegacyKbd_send_resp

File: Legacykbd.c
Description:
Place the Responce bytes in the keyboard buffer.
Input:
ps2dev      - pointer to the KBD structure
Data        - Pointer to the Data
count       - Length of the data
Output:
None


LegacykbdInput_GetTranslation in the Legacykbd.c

Function : LegacykbdInput_GetTranslation

File: Legacykbd.c
Description:
KBC translation
Input:
P   - pointer to the Emulation Protocol
Output:
None


LegacykbdInput_Send in the Legacykbd.c

Function : LegacykbdInput_Send

File: Legacykbd.c
Description:
Keyboard Input source sends data. Put the data into the buffer, attempt to send the first byte.
The call comes outside of Trapping Leg access. Check that Trapping status will not be overriden
Input:
P       - pointer to the Emulation Protocol
Buffer  - Data buffer
Count   - Buffer Length
Output:
None


LegacykbdInput_updateLED in the Legacykbd.c

Function : LegacykbdInput_updateLED

File: Legacykbd.c
Description:
Update the keyboard LED's
Input:
P       - pointer to the Emulation Protocol
Data    - LED data
Output:
None


LegacyMouse.c

Description:
LegacyMouse functions

The following functions are used in the file: LegacyMouse.c.

Function | Description
InitLegacyMouse | Initialize the Mouse data
Legacymouse_flushBuffer | Clear the mouse data buffer that tracks the mouse changes; after the data is cleared any data read will return zero (x,y) and current buttons state.
Legacymouse_pumpQueue | KBC has empty queue; Legacy I/O trapping is being processed.If mouse has data to push into KBC, now is a good time to do it
Legacymouse_send_resp | Place the Responce bytes in the keyboard buffer.
mouse_echo | Mouse Echo command
mouse_idle | Handle commands sent from KBC to PS2 Mouse. Mouse idle, waiting for command or key
mouse_initParams | Initialize the mouse data
mouse_reciev_option | Mouse reciev command
msInput_Send | Mouse Input source sends data. Put the data into the buffer, attempt to send the first byte. The call comes outside of Trapping Leg access. Check that Trapping status will not be overriden
SendLegacyMouseBuffer | Send the mouse packet to KBC


InitLegacyMouse in the LegacyMouse.c

Function : InitLegacyMouse

File: LegacyMouse.c
Description:
Initialize the Mouse data
Input:
kbc     - pointer to the KBC Structure
Mouse   - Pointer to the Mouse structure
Output:
None


Legacymouse_flushBuffer in the LegacyMouse.c

Function : Legacymouse_flushBuffer

File: LegacyMouse.c
Description:
Clear the mouse data buffer that tracks the mouse changes; after the data is cleared any data read
will return zero (x,y) and current buttons state.
Input:
ps2dev  - pointer to the KBD structure
Cmd     - Data from the kbc buffer
Output:
None


Legacymouse_pumpQueue in the LegacyMouse.c

Function : Legacymouse_pumpQueue

File: LegacyMouse.c
Description:
KBC has empty queue; Legacy I/O trapping is being processed.If mouse has data to push into KBC,
now is a good time to do it
Input:
ps2dev  - pointer to the Mouse structure
Output:
None


Legacymouse_send_resp in the LegacyMouse.c

Function : Legacymouse_send_resp

File: LegacyMouse.c
Description:
Place the Responce bytes in the keyboard buffer.
Input:
Mousev      - pointer to the Mouse structure
Data        -   Pointer to the Data
count       - Length of the data
Output:
None


mouse_echo in the LegacyMouse.c

Function : mouse_echo

File: LegacyMouse.c
Description:
Mouse Echo command
Input:
ps2dev  - pointer to the Mouse structure
Cmd     - Data from the kbc buffer
Output:
None


mouse_idle in the LegacyMouse.c

Function : mouse_idle

File: LegacyMouse.c
Description:
Handle commands sent from KBC to PS2 Mouse. Mouse idle, waiting for command or key
Input:
ps2dev  - pointer to the Mouse structure
Cmd     - Data from the kbc buffer
Output:
None


mouse_initParams in the LegacyMouse.c

Function : mouse_initParams

File: LegacyMouse.c
Description:
Initialize the mouse data
Input:
kbd   - Pointer to the mouse structure
Output:
None


mouse_reciev_option in the LegacyMouse.c

Function : mouse_reciev_option

File: LegacyMouse.c
Description:
Mouse reciev command
Input:
ps2dev  - pointer to the KBD structure
Cmd     - Data from the kbc buffer
Output:
None


msInput_Send in the LegacyMouse.c

Function : msInput_Send

File: LegacyMouse.c
Description:
Mouse Input source sends data. Put the data into the buffer, attempt to send the first byte.
           The call comes outside of Trapping Leg access. Check that Trapping status will not be overriden
Input:
P   - pointer to the Emulation Protocol
Data - Ps2 mouse Data
Output:
None


SendLegacyMouseBuffer in the LegacyMouse.c

Function : SendLegacyMouseBuffer

File: LegacyMouse.c
Description:
Send the mouse packet to KBC
Input:
Mouse - pointer to the Mouse Structure
Packetr - Mouse Data
Count - Data Length
Output:
None


VirtualKbc.c

Description:
Handles the Virtual KBC(Without KBC system) function

The following functions are used in the file: VirtualKbc.c.

Function | Description
InitVirtualKBC | Initialize KBC structure. Set initial state of the emulated KBC
virtkbc_sendout | Keep the data in the output buffer and set the OBF bit set. Based on device set the status bit also.
vkbc_read_data | Handle read from data port of virtual KBC
vkbc_read_status | Handle read from status port of virtual KBC
vkbc_readCCB | Return the CCB data from the KBC buffer
vkbc_write_command | Handle write to command port of virtual KBC
vkbc_write_data | Handle write to data port of virtual KBC


InitVirtualKBC in the VirtualKbc.c

Function : InitVirtualKBC

File: VirtualKbc.c
Description:
Initialize KBC structure. Set initial state of the emulated KBC
Input:
kbc     - pointer to the KBC structure
kbd     - Pointer to the KBD structure
mouse - Pointer to the Mouse Structure
Output:
None


virtkbc_sendout in the VirtualKbc.c

Function : virtkbc_sendout

File: VirtualKbc.c
Description:
Keep the data in the output buffer and set the OBF bit set. Based on device set the status bit also.
Input:
kbc     - pointer to the KBC structure
Devtype - Data from which device (KBD or Mouse)
orvd    -
Data    - Data to the kbc buffer
Output:
True: Placed the data successfully.


vkbc_read_data in the VirtualKbc.c

Function : vkbc_read_data

File: VirtualKbc.c
Description:
Handle read from data port of virtual KBC
Input:
kbc     - pointer to the KBC structure
Output:
Data    - Data from the keyboard controller


vkbc_read_status in the VirtualKbc.c

Function : vkbc_read_status

File: VirtualKbc.c
Description:
Handle read from status port of virtual KBC
Input:
kbc     - pointer to the KBC structure
Output:
Status      - keyboard controller Status


vkbc_readCCB in the VirtualKbc.c

Function : vkbc_readCCB

File: VirtualKbc.c
Description:
Return the CCB data from the KBC buffer
Input:
kbc     - pointer to the KBC structure
Output:
Data: CCB data


vkbc_write_command in the VirtualKbc.c

Function : vkbc_write_command

File: VirtualKbc.c
Description:
Handle write to command port of virtual KBC
Input:
kbc     - pointer to the KBC structure
cmd     - keyboard controller command
Output:
None


vkbc_write_data in the VirtualKbc.c

Function : vkbc_write_data

File: VirtualKbc.c
Description:
Handle write to data port of virtual KBC
Input:
kbc     - pointer to the KBC structure
Data    - keyboard controller Data
Output:
Status  - keyboard controller Status


VirtualKbd.c

Description:
Virtual keyboard functions

The following functions are used in the file: VirtualKbd.c.

Function | Description
InitVirtualKbd | Initialize the KBD data
kbd_scanning | Handle commands sent from KBC to PS2 Keyboard. Keyboard is scanning or idle, waiting for command or key
kbdInput_GetTranslation | KBC translation
kbdInput_Send | Keyboard Input source sends data. Put the data into the buffer, attempt to send the first byte. The call comes outside of Trapping Leg access. Check that Trapping status will not be overriden
kbdInput_updateLED | Update the keyboard LED's
vkbd_initParams | Initialize the KBD data
vkbd_pumpQueue | KBC has empty queue; Legacy I/O trapping is being processed.If Kbd has data to push into KBC, now is a good time to do it
vkbd_read_codes | Keyboard Read Codes.
vkbd_read_option | Keyboard Read option.
vkbd_rw_scancode | Keyboard Read write Scan code.
vkbd_send_resp | Place the Responce bytes in the keyboard buffer.


InitVirtualKbd in the VirtualKbd.c

Function : InitVirtualKbd

File: VirtualKbd.c
Description:
Initialize the KBD data
Input:
kbc     - pointer to the KBC Structure
kbd     - Pointer to the KBD structure
Output:
None


kbd_scanning in the VirtualKbd.c

Function : kbd_scanning

File: VirtualKbd.c
Description:
Handle commands sent from KBC to PS2 Keyboard. Keyboard is scanning or idle, waiting for command or key
Input:
ps2dev  - pointer to the KBD structure
Cmd     -   Data from the kbc buffer
Output:
None


kbdInput_GetTranslation in the VirtualKbd.c

Function : kbdInput_GetTranslation

File: VirtualKbd.c
Description:
KBC translation
Input:
P   - pointer to the Emulation Protocol
Output:
None


kbdInput_Send in the VirtualKbd.c

Function : kbdInput_Send

File: VirtualKbd.c
Description:
Keyboard Input source sends data. Put the data into the buffer, attempt to send the first byte.
The call comes outside of Trapping Leg access. Check that Trapping status will not be overriden
Input:
P       - pointer to the Emulation Protocol
Buffer  - Data buffer
Count   - Buffer Length
Output:
None


kbdInput_updateLED in the VirtualKbd.c

Function : kbdInput_updateLED

File: VirtualKbd.c
Description:
Update the keyboard LED's
Input:
P       - pointer to the Emulation Protocol
Data    - LED data
Output:
None


vkbd_initParams in the VirtualKbd.c

Function : vkbd_initParams

File: VirtualKbd.c
Description:
Initialize the KBD data
Input:
kbd   - Pointer to the KBD structure
Output:
None


vkbd_pumpQueue in the VirtualKbd.c

Function : vkbd_pumpQueue

File: VirtualKbd.c
Description:
KBC has empty queue; Legacy I/O trapping is being processed.If Kbd has data to push into KBC,
now is a good time to do it
Input:
ps2dev  - pointer to the KBD structure
Output:
None


vkbd_read_codes in the VirtualKbd.c

Function : vkbd_read_codes

File: VirtualKbd.c
Description:
Keyboard Read Codes.
Input:
ps2dev  - pointer to the KBD structure
Cmd     - Data from the kbc buffer
Output:
None


vkbd_read_option in the VirtualKbd.c

Function : vkbd_read_option

File: VirtualKbd.c
Description:
Keyboard Read option.
Input:
ps2dev  - pointer to the KBD structure
Cmd     - Data from the kbc buffer
Output:
None


vkbd_rw_scancode in the VirtualKbd.c

Function : vkbd_rw_scancode

File: VirtualKbd.c
Description:
Keyboard Read write Scan code.
Input:
ps2dev  - pointer to the KBD structure
Cmd     - Data from the kbc buffer
Output:
None


vkbd_send_resp in the VirtualKbd.c

Function : vkbd_send_resp

File: VirtualKbd.c
Description:
Place the Responce bytes in the keyboard buffer.
Input:
ps2dev      - pointer to the KBD structure
Data        -   Pointer to the Data
count       - Length of the data
Output:
None


VirtualMouse.c

Description:
Handles the Virtual mouse functions

The following functions are used in the file: VirtualMouse.c.

Function | Description
InitVirtualMouse | Initialize the Mouse data
mouse_echo | Mouse Echo command
mouse_idle | Handle commands sent from KBC to PS2 Mouse. Mouse idle, waiting for command or key
mouse_initParams | Initialize the mouse data
mouse_reciev_option | Mouse reciev command
msInput_Send | Mouse Input source sends data. Put the data into the buffer, attempt to send the first byte. The call comes outside of Trapping Leg access. Check that Trapping status will not be overriden
SendMouseBuffer | Send the mouse packet to KBC
vmouse_flushBuffer | Clear the mouse data buffer that tracks the mouse changes; after the data is cleared any data read will return zero (x,y) and current buttons state.
vmouse_pumpQueue | KBC has empty queue; Legacy I/O trapping is being processed.If mouse has data to push into KBC, now is a good time to do it
vmouse_send_resp | Place the Response bytes in the keyboard buffer.


InitVirtualMouse in the VirtualMouse.c

Function : InitVirtualMouse

File: VirtualMouse.c
Description:
Initialize the Mouse data
Input:
kbc     - pointer to the KBC Structure
Mouse   - Pointer to the Mouse structure
Output:
None


mouse_echo in the VirtualMouse.c

Function : mouse_echo

File: VirtualMouse.c
Description:
Mouse Echo command
Input:
ps2dev  - pointer to the Mouse structure
Cmd     - Data from the kbc buffer
Output:
None


mouse_idle in the VirtualMouse.c

Function : mouse_idle

File: VirtualMouse.c
Description:
Handle commands sent from KBC to PS2 Mouse. Mouse idle, waiting for command or key
Input:
ps2dev  - pointer to the Mouse structure
Cmd     - Data from the kbc buffer
Output:
None


mouse_initParams in the VirtualMouse.c

Function : mouse_initParams

File: VirtualMouse.c
Description:
Initialize the mouse data
Input:
kbd   - Pointer to the mouse structure
Output:
None


mouse_reciev_option in the VirtualMouse.c

Function : mouse_reciev_option

File: VirtualMouse.c
Description:
Mouse reciev command
Input:
ps2dev  - pointer to the KBD structure
Cmd     - Data from the kbc buffer
Output:
None


msInput_Send in the VirtualMouse.c

Function : msInput_Send

File: VirtualMouse.c
Description:
Mouse Input source sends data. Put the data into the buffer, attempt to send the first byte.
The call comes outside of Trapping Leg access. Check that Trapping status will not be overriden
Input:
P       - pointer to the Emulation Protocol
Data    - Ps2 mouse Data
Output:
None


SendMouseBuffer in the VirtualMouse.c

Function : SendMouseBuffer

File: VirtualMouse.c
Description:
Send the mouse packet to KBC
Input:
Mouse   - pointer to the Mouse Structure
Packetr - Mouse Data
Count   - Data Length
Output:
None


vmouse_flushBuffer in the VirtualMouse.c

Function : vmouse_flushBuffer

File: VirtualMouse.c
Description:
Clear the mouse data buffer that tracks the mouse changes; after the data is cleared any data read
will return zero (x,y) and current buttons state.
Input:
ps2dev  - pointer to the KBD structure
Cmd     - Data from the kbc buffer
Output:
None


vmouse_pumpQueue in the VirtualMouse.c

Function : vmouse_pumpQueue

File: VirtualMouse.c
Description:
KBC has empty queue; Legacy I/O trapping is being processed.If mouse has data to push into KBC,
now is a good time to do it
Input:
ps2dev  - pointer to the Mouse structure
Output:
None


vmouse_send_resp in the VirtualMouse.c

Function : vmouse_send_resp

File: VirtualMouse.c
Description:
Place the Response bytes in the keyboard buffer.
Input:
Mousev  - pointer to the Mouse structure
Data    -   Pointer to the Data
count   - Length of the data
Output:
None


Functions in Alphabetical Order

In Alphabetical Order

The following topics provide a list in alphabetical order.
For a list by file name, see By File Name.

  • B
  • C
  • D
  • E
  • F
  • G
  • H
  • I
  • K
  • L
  • M
  • N
  • O
  • R
  • S
  • T
  • U
  • V
  • W


Functions in Alphabetical Order

B

Function | Description
ByteReadIO | This routine reads a Byte from the specified IO address
ByteWriteIO | This routine writes a byte to the specified IO address
ByteWritePCIConfig | This routine writes a byte value to the PCI configuration register space


Functions in Alphabetical Order

C

Function | Description
CheckNumberofResponseBytes | Based on KBD/Mouse cmd, determine how many response bytes should be provided
CheckPS2KBDMousePresence | Check whether PS2 KBD/Mouse IRQ has been enabled or not
ClearLegKeyStatusReg | Clear the Port6064 SMI Status Reg


Functions in Alphabetical Order

D

Function | Description
DisableLegKeyRegs | Disable the port6064 SMI source based on the Trap enable mask.
DisableLegKeyRegs | Disable the port6064 SMI source based on the Trap enable mask.
DwordReadIO | This routine reads a dword from the specified IO address
DwordWriteIO | This routine writes a double word to the specified IO address
DwordWritePCIConfig | This routine writes a Dword value to the PCI configuration register space


Functions in Alphabetical Order

E

Function | Description
Emulation6064TrapDisable | Disable the SMI source for port 6064
Emulation6064TrapEnable | Enable the SMI source for port 6064
Emulation_Init | Initilize the Keyboard Controller, Keyboard and Mouse device.Regsiter the SMI for port 6064 access.
EmulationEntryPoint | Entry point for Emulation driver. If the port 6064 emulation enabled by setup it enables the SMI event for port 6064 and install the Trap handle protocol.


Functions in Alphabetical Order

F

Function | Description
FindSMICpu | In a Multiprocessor environment, any logical CPU can generate the SMI. This function finds the CPU that generates SMI by accessing IO 60/64 Ports


Functions in Alphabetical Order

G

Function | Description
GenerateIRQ1 | Generate IRQ1
GenerateIRQ12 | Generate IRQ1
GetHceInput | Reads the HceInput register which holds the data written to port 60/64
GetHceOutput | Reads the HceOutPut register in OHCI controller
GetHceStatus | Reads the HceStatus register in OHCI controller
getTrapAL | Get the port 60 or 64 input value from the CPU save reg


Functions in Alphabetical Order

H

Function | Description
HandleGA20Sequence | SMI triggered becauase of GA20 sequence change
hasTrapStatus | return the port 6064 trap status


Functions in Alphabetical Order

I

Function | Description
initLegacyKBC | Initilize the KBC structure
InitLegacyKbd | Initialize the KBD data
InitLegacyMouse | Initialize the Mouse data
InitVirtualKBC | Initialize KBC structure. Set initial state of the emulated KBC
InitVirtualKbd | Initialize the KBD data
InitVirtualMouse | Initialize the Mouse data


Functions in Alphabetical Order

K

Function | Description
kbc_kbd_wdata | Handle write to port 60. The data is passed to the Keyboard emulation machine Next state is: accepting keyboard data on port 60.
kbc_kbd_wdata2 | Handle write to port 60. This function handles the data specfic the KBC controller. Next state is: accepting keyboard data on port 60.
kbc_mouse_wdata | Handle write to port 60. Previouse command written to port 64 was "Send to auxilary device" (0xD4). The data is passed to the Mouse emulation machine. Next state is: accepting keyboard data on port 60.
kbc_passthrough_wcmd | Handle write to port 64.The emulation doesn't process this write and the access is passed to the KBC
kbc_passthrough_wdata | Handle write to port 60.The emulation doesn't process this write and the access is passed to the KBC
KBC_ReadDataByte | This routine till the keyboard controller sends a data byte
KBC_WaitForInputBufferToBeFree | This routine checks the input buffer free bit and waits till it is set by the keyboard controller
KBC_WaitForOutputBufferToBeFilled | This routine checks the output buffer full bit and waits till it is set by the keyboard controller
kbc_wccb | Handle write to port 60. Previouse command written to port 64 was "Write CCB (60h)" The data is a new ccb. Next state is: accepting keyboard data on port 60.
KBC_WriteCommandByte | This routine writes the command to the keyboard controller
KBC_WriteSubCommandByte | This routine writes the command to the keyboard controller
KbcEmulationDisable | This routine will be called when ACPI enabled or disabled SMI happens.
KbcEmulationFeature | Returns all the feature supported by Emulation
kbd_scanning | Handle commands sent from KBC to PS2 Keyboard. Keyboard is scanning or idle, waiting for command or key
kbdInput_GetTranslation | KBC translation
kbdInput_Send | Keyboard Input source sends data. Put the data into the buffer, attempt to send the first byte. The call comes outside of Trapping Leg access. Check that Trapping status will not be overriden
kbdInput_updateLED | Update the keyboard LED's


Functions in Alphabetical Order

L

Function | Description
LegacyKbd_initParams | Initialize the KBD data
LegacyKbd_pumpQueue | KBC has empty queue; Legacy I/O trapping is being processed.If Kbd has data to push into KBC, now is a good time to do it
LegacyKbd_read_codes | Keyboard Read Codes.
LegacyKbd_read_option | Keyboard Read option.
LegacyKbd_rw_scancode | Keyboard Read write Scan code.
Legacykbd_scanning | Handle commands sent from KBC to PS2 Keyboard. Keyboard is scanning or idle, waiting for command or key
LegacyKbd_send_resp | Place the Responce bytes in the keyboard buffer.
LegacykbdInput_GetTranslation | KBC translation
LegacykbdInput_Send | Keyboard Input source sends data. Put the data into the buffer, attempt to send the first byte. The call comes outside of Trapping Leg access. Check that Trapping status will not be overriden
LegacykbdInput_updateLED | Update the keyboard LED's
Legacymouse_flushBuffer | Clear the mouse data buffer that tracks the mouse changes; after the data is cleared any data read will return zero (x,y) and current buttons state.
Legacymouse_pumpQueue | KBC has empty queue; Legacy I/O trapping is being processed.If mouse has data to push into KBC, now is a good time to do it
Legacymouse_send_resp | Place the Responce bytes in the keyboard buffer.
legkbc_sendout | Implementation of the "send_outb1" for the case of legacy KBC present. Data is put into output buffer of legacy KBC which sets OBF and generates IRQ. Application gets a chance to handle the interrupt and read the data from legacy KBC.
legkbc_updateCCB | Update cached CCB in responce to trapped KBC command.If CCB wasn't loaded before, the new CCB cache is still unkknown.


Functions in Alphabetical Order

M

Function | Description
mouse_echo | Mouse Echo command
mouse_echo | Mouse Echo command
mouse_idle | Handle commands sent from KBC to PS2 Mouse. Mouse idle, waiting for command or key
mouse_idle | Handle commands sent from KBC to PS2 Mouse. Mouse idle, waiting for command or key
mouse_initParams | Initialize the mouse data
mouse_initParams | Initialize the mouse data
mouse_reciev_option | Mouse reciev command
mouse_reciev_option | Mouse reciev command
msInput_Send | Mouse Input source sends data. Put the data into the buffer, attempt to send the first byte. The call comes outside of Trapping Leg access. Check that Trapping status will not be overriden
msInput_Send | Mouse Input source sends data. Put the data into the buffer, attempt to send the first byte. The call comes outside of Trapping Leg access. Check that Trapping status will not be overriden


Functions in Alphabetical Order

N

Function | Description
NonSmmByteReadIO | This routine reads a Byte from the specified IO address
NonSmmByteWriteIO | This routine writes a byte to the specified IO address
NonSmmByteWritePCIConfig | This routine writes a byte value to the PCI configuration register space
NonSmmClearLegKeyStatusReg | Clear the Port6064 SMI Status
NonSmmDwordReadIO | This routine reads a dword from the specified IO address
NonSmmDwordWriteIO | This routine writes a double word to the specified IO address
NonSmmDwordWritePCIConfig | This routine writes a Dword value to the PCI configuration register space
NonSmmEmulation6064TrapDisable | Disable the SMI source for port 6064 in Non SMM
NonSmmEmulation6064TrapEnable | Enable the SMI source for port 6064 in Non SMM
NonSmmOhci_TrapEnable | Enable/Disable traping in OHCI HC.
NonSmmReadPCIConfig | This routine reads from the PCI configuration space register the value can be typecasted to 8bits - 32bits
NonSmmTrapEnable | Enable/disable the port6064 trap in Non SMM
NonSmmUhci_TrapEnable | Enable/Disable traping in UHCI HC.
NonSmmValidateUhc | Validate the UHCI controller.
NonSmmWordReadIO | This routine reads a Word from the specified IO address
NonSmmWordWriteIO | This routine writes a word to the specified IO address
NonSmmWordWritePCIConfig | This routine writes a word value to the PCI configuration register space
NonSmmWriteLegKeyReg | Write the Value in to all the UHCI controller Legacy Regsiters.
NonSmmWritePCIConfig | This function opens PCI configuration for a given register


Functions in Alphabetical Order

O

Function | Description
Ohci_HasTrapStatus | Return whether Emulation Interrupt has been generated or not
Ohci_TrapEnable | Enable/Disable traping in OHCI HC.
on_kbc_write_command | Handle write to port 64. New command always aborts previous (no state dependency). This function will always get called on port 64 write.Parse the incomming command and change the state accoringly


Functions in Alphabetical Order

R

Function | Description
ReadPCIConfig | This routine reads from the PCI configuration space register the value can be typecasted to 8bits - 32bits
RegisterAcpiEnableCallBack | This routine will be called by KbcEmulation Init to register the callback function on Acpi Enable/Disable SMI.


Functions in Alphabetical Order

S

Function | Description
SendLegacyMouseBuffer | Send the mouse packet to KBC
SendMouseBuffer | Send the mouse packet to KBC
SerialOutput | Directly writes to 3F8 COM port. Using this routine will be faster and debug output delay will have no impact on debugging time sensitive routines O/P the byte and give a space after that;
SetHceControl | Writes to HceControl in OHCI controller
SetHceOutput | Writes to HceOutput which is returned on IO port 60h read
SetHceStatus | Writes to HceStatus in OHCI controller
setTrapAL | Set the port 60 or 64 output value to the CPU save reg
Smm_Register | Enable the SMI for port 6064 access.
Smm_Register | Enable the SMI for port 6064 access.


Functions in Alphabetical Order

T

Function | Description
Trap6064_Handler | SMI handler to handle the 64write, 64read, 60 write and 60 read SMI.
Trap6064_Handler | SMI handler to handle the 64write, 64read, 60 write and 60 read SMI.
Trap6064_Handler_LegFree | SMI handler to handle the 64write, 64read, 60 write and 60 read SMI.
trap64w | This function handles the Port64 write command
TrapEnable | Enable/disable the port6064 trap


Functions in Alphabetical Order

U

Function | Description
Uhci_HasTrapStatus | Check if trap status is set in UHCI HC.
Uhci_TrapEnable | Enable/Disable traping in UHCI HC.


Functions in Alphabetical Order

V

Function | Description
ValidateUhc | Validate the UHCI controller.
virtkbc_sendout | Keep the data in the output buffer and set the OBF bit set. Based on device set the status bit also.
vkbc_read_data | Handle read from data port of virtual KBC
vkbc_read_status | Handle read from status port of virtual KBC
vkbc_readCCB | Return the CCB data from the KBC buffer
vkbc_write_command | Handle write to command port of virtual KBC
vkbc_write_data | Handle write to data port of virtual KBC
vkbd_initParams | Initialize the KBD data
vkbd_pumpQueue | KBC has empty queue; Legacy I/O trapping is being processed.If Kbd has data to push into KBC, now is a good time to do it
vkbd_read_codes | Keyboard Read Codes.
vkbd_read_option | Keyboard Read option.
vkbd_rw_scancode | Keyboard Read write Scan code.
vkbd_send_resp | Place the Responce bytes in the keyboard buffer.
vmouse_flushBuffer | Clear the mouse data buffer that tracks the mouse changes; after the data is cleared any data read will return zero (x,y) and current buttons state.
vmouse_pumpQueue | KBC has empty queue; Legacy I/O trapping is being processed.If mouse has data to push into KBC, now is a good time to do it
vmouse_send_resp | Place the Response bytes in the keyboard buffer.


Functions in Alphabetical Order

W

Function | Description
WaitForOBFSMM | Wait till O/P buffer is full
WordReadIO | This routine reads a Word from the specified IO address
WordWriteIO | This routine writes a word to the specified IO address
WordWritePCIConfig | This routine writes a byte value to the PCI configuration register space
WriteLegKeyReg | Write the Value in to all the UHCI controller Legacy Regsiters.
WritePCIConfig | This function opens PCI configuration for a given register


General Information