IsaAcpi.c revision 4fd606d1f5abe38e1f42c38de1d2e895166bd0f4
/** @file
ISA ACPI Protocol Implementation
Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
#include "PcatIsaAcpi.h"
//
// Platform specific data for the ISA devices that are present.in the platform
//
//
// COM 1 UART Controller
//
{EfiIsaAcpiResourceInterrupt, 0, 4, 0},
{EfiIsaAcpiResourceEndOfList, 0, 0, 0}
};
//
// COM 2 UART Controller
//
{EfiIsaAcpiResourceInterrupt, 0, 3, 0},
{EfiIsaAcpiResourceEndOfList, 0, 0, 0}
};
//
// PS/2 Keyboard Controller
//
{EfiIsaAcpiResourceInterrupt, 0, 1, 0},
{EfiIsaAcpiResourceEndOfList, 0, 0, 0}
};
//
// PS/2 Mouse Controller
//
{EfiIsaAcpiResourceInterrupt, 0, 12, 0},
{EfiIsaAcpiResourceEndOfList, 0, 0, 0}
};
//
// Floppy Disk Controller
//
{EfiIsaAcpiResourceInterrupt, 0, 6, 0},
{EfiIsaAcpiResourceDma, EFI_ISA_IO_SLAVE_DMA_ATTRIBUTE_SPEED_COMPATIBLE | EFI_ISA_IO_SLAVE_DMA_ATTRIBUTE_WIDTH_8 | EFI_ISA_IO_SLAVE_DMA_ATTRIBUTE_SINGLE_MODE, 2, 0},
{EfiIsaAcpiResourceEndOfList, 0, 0, 0}
};
}; // COM 1 UART Controller
}; // COM 2 UART Controller
}; // PS/2 Keyboard Controller
}; // PS/2 Mouse Controller
}; // Floppy Disk Controller A:
}; // Floppy Disk Controller B:
//
// Table of ISA Controllers
//
/**
Initialize gPcatIsaAcpiDeviceList.
**/
)
{
Index = 0;
if (PcdGetBool (PcdIsaAcpiCom1Enable)) {
Index++;
}
if (PcdGetBool (PcdIsaAcpiCom2Enable)) {
Index++;
}
if (PcdGetBool (PcdIsaAcpiPs2KeyboardEnable)) {
CopyMem (&gPcatIsaAcpiDeviceList[Index], &mPcatIsaAcpiPs2KeyboardDevice, sizeof(mPcatIsaAcpiPs2KeyboardDevice));
Index++;
}
if (PcdGetBool (PcdIsaAcpiPs2MouseEnable)) {
CopyMem (&gPcatIsaAcpiDeviceList[Index], &mPcatIsaAcpiPs2MouseDevice, sizeof(mPcatIsaAcpiPs2MouseDevice));
Index++;
}
if (PcdGetBool (PcdIsaAcpiFloppyAEnable)) {
CopyMem (&gPcatIsaAcpiDeviceList[Index], &mPcatIsaAcpiFloppyADevice, sizeof(mPcatIsaAcpiFloppyADevice));
Index++;
}
if (PcdGetBool (PcdIsaAcpiFloppyBEnable)) {
CopyMem (&gPcatIsaAcpiDeviceList[Index], &mPcatIsaAcpiFloppyBDevice, sizeof(mPcatIsaAcpiFloppyBDevice));
Index++;
}
}
//
// ISA ACPI Protocol Functions
//
/**
Enumerate the ISA devices on the ISA bus.
@param Device Point to device ID instance
@param IsaAcpiDevice On return, point to resource data for Isa device
@param NextIsaAcpiDevice On return, point to resource data for next Isa device
**/
)
{
*IsaAcpiDevice = NULL;
if (NextIsaAcpiDevice != NULL) {
}
Index = 0;
} else {
break;
}
}
return;
}
Index++;
}
}
}
/**
Enumerate the ISA devices on the ISA bus
@param This Point to instance of EFI_ISA_ACPI_PROTOCOL
@param Device Point to device ID instance
@retval EFI_NOT_FOUND Can not found the next Isa device.
@retval EFI_SUCESS Success retrieve the next Isa device for enumration.
**/
)
{
if (NextIsaAcpiDevice == NULL) {
return EFI_NOT_FOUND;
}
return EFI_SUCCESS;
}
/**
Set ISA device power
@param This Point to instance of EFI_ISA_ACPI_PROTOCOL
@param Device Point to device ID instance
@param OnOff TRUE for setting isa device power on,
FALSE for setting isa device power off
@return EFI_SUCCESS Sucess to change power status for isa device.
**/
)
{
return EFI_SUCCESS;
}
/**
Get current resource for the specific ISA device.
@param This Point to instance of EFI_ISA_ACPI_PROTOCOL
@param Device Point to device ID instance
@param ResourceList On return, point to resources instances for given isa device
@retval EFI_NOT_FOUND Can not found the resource instance for given isa device
@retval EFI_SUCCESS Success to get resource instance for given isa device.
**/
)
{
if (*ResourceList == NULL) {
return EFI_NOT_FOUND;
}
return EFI_SUCCESS;
}
/**
Get possible resource for the specific ISA device.
@param This Point to instance of EFI_ISA_ACPI_PROTOCOL
@param Device Point to device ID instance
@param ResourceList On return, point to resources instances for given isa device
@retval EFI_SUCCESS Success to get resource instance for given isa device.
**/
)
{
return EFI_SUCCESS;
}
/**
Set resource for the specific ISA device.
@param This Point to instance of EFI_ISA_ACPI_PROTOCOL
@param Device Point to device ID instance
@param ResourceList Point to resources instances for given isa device
@return EFI_SUCESS Success to set resource.
**/
)
{
return EFI_SUCCESS;
}
/**
@param This Point to instance of EFI_ISA_ACPI_PROTOCOL
@param Device Point to device ID instance
**/
)
{
return EFI_SUCCESS;
}
/**
Initialize the specific ISA device.
@param This Point to instance of EFI_ISA_ACPI_PROTOCOL
@param Device Point to device ID instance
@return EFI_SUCESS Success to initialize.
**/
)
{
return EFI_SUCCESS;
}
/**
Initialize the ISA interface.
@param This Point to instance of EFI_ISA_ACPI_PROTOCOL
@return EFI_SUCESS Success to initialize ISA interface.
**/
)
{
return EFI_SUCCESS;
}