QuarkSocPkg: Add new package for Quark SoC X1000
Changes for V4 ============== 1) Remove Unicode character from C source file 2) Move delete of QuarkSocPkg\QuarkNorthCluster\Binary\QuarkMicrocode from QuarkPlatformPkg commit to QuarkSocPkg commit Changes for V2 ============== 1) Sync with new APIs in SmmCpuFeaturesLib class 2) Use new generic PCI serial driver PciSioSerialDxe in MdeModulePkg 3) Remove PCI serial driver from QuarkSocPkg 4) Apply optimizations to MtrrLib from MtrrLib in UefiCpuPkg 5) Convert all UNI files to utf-8 6) Replace tabs with spaces and remove trailing spaces 7) Add License.txt Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Michael Kinney <michael.d.kinney@intel.com> Acked-by: Jordan Justen <jordan.l.justen@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19286 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
@@ -0,0 +1,233 @@
|
||||
/** @file
|
||||
|
||||
UEFI Component Name(2) protocol implementation for SD controller driver.
|
||||
|
||||
Copyright (c) 2013-2015 Intel Corporation.
|
||||
|
||||
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
|
||||
http://opensource.org/licenses/bsd-license.php
|
||||
|
||||
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 "SDController.h"
|
||||
|
||||
|
||||
//
|
||||
// EFI Component Name Protocol
|
||||
//
|
||||
|
||||
GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME_PROTOCOL gSDControllerName = {
|
||||
SDControllerGetDriverName,
|
||||
SDControllerGetControllerName,
|
||||
"eng"
|
||||
};
|
||||
|
||||
//
|
||||
// EFI Component Name 2 Protocol
|
||||
//
|
||||
GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME2_PROTOCOL gSDControllerName2 = {
|
||||
(EFI_COMPONENT_NAME2_GET_DRIVER_NAME) SDControllerGetDriverName,
|
||||
(EFI_COMPONENT_NAME2_GET_CONTROLLER_NAME) SDControllerGetControllerName,
|
||||
"en"
|
||||
};
|
||||
|
||||
|
||||
GLOBAL_REMOVE_IF_UNREFERENCED EFI_UNICODE_STRING_TABLE mSDControllerDriverNameTable[] = {
|
||||
{ "eng;en", L"EFI SD Host Controller Driver" },
|
||||
{ NULL, NULL }
|
||||
};
|
||||
|
||||
|
||||
//
|
||||
// EFI Component Name Functions
|
||||
//
|
||||
|
||||
/**
|
||||
Retrieves a Unicode string that is the user readable name of the driver.
|
||||
|
||||
This function retrieves the user readable name of a driver in the form of a
|
||||
Unicode string. If the driver specified by This has a user readable name in
|
||||
the language specified by Language, then a pointer to the driver name is
|
||||
returned in DriverName, and EFI_SUCCESS is returned. If the driver specified
|
||||
by This does not support the language specified by Language,
|
||||
then EFI_UNSUPPORTED is returned.
|
||||
|
||||
@param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or
|
||||
EFI_COMPONENT_NAME_PROTOCOL instance.
|
||||
|
||||
@param Language[in] A pointer to a Null-terminated ASCII string
|
||||
array indicating the language. This is the
|
||||
language of the driver name that the caller is
|
||||
requesting, and it must match one of the
|
||||
languages specified in SupportedLanguages. The
|
||||
number of languages supported by a driver is up
|
||||
to the driver writer. Language is specified
|
||||
in RFC 3066 or ISO 639-2 language code format.
|
||||
|
||||
@param DriverName[out] A pointer to the Unicode string to return.
|
||||
This Unicode string is the name of the
|
||||
driver specified by This in the language
|
||||
specified by Language.
|
||||
|
||||
@retval EFI_SUCCESS The Unicode string for the Driver specified by
|
||||
This and the language specified by Language was
|
||||
returned in DriverName.
|
||||
|
||||
@retval EFI_INVALID_PARAMETER Language is NULL.
|
||||
|
||||
@retval EFI_INVALID_PARAMETER DriverName is NULL.
|
||||
|
||||
@retval EFI_UNSUPPORTED The driver specified by This does not support
|
||||
the language specified by Language.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
SDControllerGetDriverName (
|
||||
IN EFI_COMPONENT_NAME_PROTOCOL *This,
|
||||
IN CHAR8 *Language,
|
||||
OUT CHAR16 **DriverName
|
||||
)
|
||||
{
|
||||
return LookupUnicodeString2 (
|
||||
Language,
|
||||
This->SupportedLanguages,
|
||||
mSDControllerDriverNameTable,
|
||||
DriverName,
|
||||
(BOOLEAN)(This == &gSDControllerName)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
Retrieves a Unicode string that is the user readable name of the controller
|
||||
that is being managed by a driver.
|
||||
|
||||
This function retrieves the user readable name of the controller specified by
|
||||
ControllerHandle and ChildHandle in the form of a Unicode string. If the
|
||||
driver specified by This has a user readable name in the language specified by
|
||||
Language, then a pointer to the controller name is returned in ControllerName,
|
||||
and EFI_SUCCESS is returned. If the driver specified by This is not currently
|
||||
managing the controller specified by ControllerHandle and ChildHandle,
|
||||
then EFI_UNSUPPORTED is returned. If the driver specified by This does not
|
||||
support the language specified by Language, then EFI_UNSUPPORTED is returned.
|
||||
|
||||
@param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or
|
||||
EFI_COMPONENT_NAME_PROTOCOL instance.
|
||||
|
||||
@param ControllerHandle[in] The handle of a controller that the driver
|
||||
specified by This is managing. This handle
|
||||
specifies the controller whose name is to be
|
||||
returned.
|
||||
|
||||
@param ChildHandle[in] The handle of the child controller to retrieve
|
||||
the name of. This is an optional parameter that
|
||||
may be NULL. It will be NULL for device
|
||||
drivers. It will also be NULL for a bus drivers
|
||||
that wish to retrieve the name of the bus
|
||||
controller. It will not be NULL for a bus
|
||||
driver that wishes to retrieve the name of a
|
||||
child controller.
|
||||
|
||||
@param Language[in] A pointer to a Null-terminated ASCII string
|
||||
array indicating the language. This is the
|
||||
language of the driver name that the caller is
|
||||
requesting, and it must match one of the
|
||||
languages specified in SupportedLanguages. The
|
||||
number of languages supported by a driver is up
|
||||
to the driver writer. Language is specified in
|
||||
RFC 3066 or ISO 639-2 language code format.
|
||||
|
||||
@param ControllerName[out] A pointer to the Unicode string to return.
|
||||
This Unicode string is the name of the
|
||||
controller specified by ControllerHandle and
|
||||
ChildHandle in the language specified by
|
||||
Language from the point of view of the driver
|
||||
specified by This.
|
||||
|
||||
@retval EFI_SUCCESS The Unicode string for the user readable name in
|
||||
the language specified by Language for the
|
||||
driver specified by This was returned in
|
||||
DriverName.
|
||||
|
||||
@retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE.
|
||||
|
||||
@retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid
|
||||
EFI_HANDLE.
|
||||
|
||||
@retval EFI_INVALID_PARAMETER Language is NULL.
|
||||
|
||||
@retval EFI_INVALID_PARAMETER ControllerName is NULL.
|
||||
|
||||
@retval EFI_UNSUPPORTED The driver specified by This is not currently
|
||||
managing the controller specified by
|
||||
ControllerHandle and ChildHandle.
|
||||
|
||||
@retval EFI_UNSUPPORTED The driver specified by This does not support
|
||||
the language specified by Language.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
SDControllerGetControllerName (
|
||||
IN EFI_COMPONENT_NAME_PROTOCOL *This,
|
||||
IN EFI_HANDLE ControllerHandle,
|
||||
IN EFI_HANDLE ChildHandle OPTIONAL,
|
||||
IN CHAR8 *Language,
|
||||
OUT CHAR16 **ControllerName
|
||||
)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
EFI_SD_HOST_IO_PROTOCOL *SDHostIo;
|
||||
SDHOST_DATA *SDHostData;
|
||||
|
||||
//
|
||||
// This is a device driver, so ChildHandle must be NULL.
|
||||
//
|
||||
if (ChildHandle != NULL) {
|
||||
return EFI_UNSUPPORTED;
|
||||
}
|
||||
|
||||
//
|
||||
// Make sure this driver is currently managing ControllerHandle
|
||||
//
|
||||
Status = EfiTestManagedDevice (
|
||||
ControllerHandle,
|
||||
gSDControllerDriverBinding.DriverBindingHandle,
|
||||
&gEfiPciIoProtocolGuid
|
||||
);
|
||||
if (EFI_ERROR (Status)) {
|
||||
return Status;
|
||||
}
|
||||
|
||||
//
|
||||
// Get the device context
|
||||
//
|
||||
Status = gBS->OpenProtocol (
|
||||
ControllerHandle,
|
||||
&gEfiSDHostIoProtocolGuid,
|
||||
(VOID **) &SDHostIo,
|
||||
gSDControllerDriverBinding.DriverBindingHandle,
|
||||
ControllerHandle,
|
||||
EFI_OPEN_PROTOCOL_GET_PROTOCOL
|
||||
);
|
||||
|
||||
if (EFI_ERROR (Status)) {
|
||||
return Status;
|
||||
}
|
||||
|
||||
SDHostData = SDHOST_DATA_FROM_THIS(SDHostIo);
|
||||
|
||||
return LookupUnicodeString2 (
|
||||
Language,
|
||||
This->SupportedLanguages,
|
||||
SDHostData->ControllerNameTable,
|
||||
ControllerName,
|
||||
(BOOLEAN)(This == &gSDControllerName)
|
||||
);
|
||||
|
||||
}
|
@@ -0,0 +1,147 @@
|
||||
/** @file
|
||||
|
||||
This file contains the delarations for componet name routines.
|
||||
|
||||
Copyright (c) 2013-2015 Intel Corporation.
|
||||
|
||||
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
|
||||
http://opensource.org/licenses/bsd-license.php
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
**/
|
||||
|
||||
|
||||
#ifndef _COMPONENT_NAME_H_
|
||||
#define _COMPONENT_NAME_H_
|
||||
|
||||
/**
|
||||
Retrieves a Unicode string that is the user readable name of the driver.
|
||||
|
||||
This function retrieves the user readable name of a driver in the form of a
|
||||
Unicode string. If the driver specified by This has a user readable name in
|
||||
the language specified by Language, then a pointer to the driver name is
|
||||
returned in DriverName, and EFI_SUCCESS is returned. If the driver specified
|
||||
by This does not support the language specified by Language,
|
||||
then EFI_UNSUPPORTED is returned.
|
||||
|
||||
@param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or
|
||||
EFI_COMPONENT_NAME_PROTOCOL instance.
|
||||
|
||||
@param Language[in] A pointer to a Null-terminated ASCII string
|
||||
array indicating the language. This is the
|
||||
language of the driver name that the caller is
|
||||
requesting, and it must match one of the
|
||||
languages specified in SupportedLanguages. The
|
||||
number of languages supported by a driver is up
|
||||
to the driver writer. Language is specified
|
||||
in RFC 3066 or ISO 639-2 language code format.
|
||||
|
||||
@param DriverName[out] A pointer to the Unicode string to return.
|
||||
This Unicode string is the name of the
|
||||
driver specified by This in the language
|
||||
specified by Language.
|
||||
|
||||
@retval EFI_SUCCESS The Unicode string for the Driver specified by
|
||||
This and the language specified by Language was
|
||||
returned in DriverName.
|
||||
|
||||
@retval EFI_INVALID_PARAMETER Language is NULL.
|
||||
|
||||
@retval EFI_INVALID_PARAMETER DriverName is NULL.
|
||||
|
||||
@retval EFI_UNSUPPORTED The driver specified by This does not support
|
||||
the language specified by Language.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
SDControllerGetDriverName (
|
||||
IN EFI_COMPONENT_NAME_PROTOCOL *This,
|
||||
IN CHAR8 *Language,
|
||||
OUT CHAR16 **DriverName
|
||||
);
|
||||
|
||||
|
||||
/**
|
||||
Retrieves a Unicode string that is the user readable name of the controller
|
||||
that is being managed by a driver.
|
||||
|
||||
This function retrieves the user readable name of the controller specified by
|
||||
ControllerHandle and ChildHandle in the form of a Unicode string. If the
|
||||
driver specified by This has a user readable name in the language specified by
|
||||
Language, then a pointer to the controller name is returned in ControllerName,
|
||||
and EFI_SUCCESS is returned. If the driver specified by This is not currently
|
||||
managing the controller specified by ControllerHandle and ChildHandle,
|
||||
then EFI_UNSUPPORTED is returned. If the driver specified by This does not
|
||||
support the language specified by Language, then EFI_UNSUPPORTED is returned.
|
||||
|
||||
@param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or
|
||||
EFI_COMPONENT_NAME_PROTOCOL instance.
|
||||
|
||||
@param ControllerHandle[in] The handle of a controller that the driver
|
||||
specified by This is managing. This handle
|
||||
specifies the controller whose name is to be
|
||||
returned.
|
||||
|
||||
@param ChildHandle[in] The handle of the child controller to retrieve
|
||||
the name of. This is an optional parameter that
|
||||
may be NULL. It will be NULL for device
|
||||
drivers. It will also be NULL for a bus drivers
|
||||
that wish to retrieve the name of the bus
|
||||
controller. It will not be NULL for a bus
|
||||
driver that wishes to retrieve the name of a
|
||||
child controller.
|
||||
|
||||
@param Language[in] A pointer to a Null-terminated ASCII string
|
||||
array indicating the language. This is the
|
||||
language of the driver name that the caller is
|
||||
requesting, and it must match one of the
|
||||
languages specified in SupportedLanguages. The
|
||||
number of languages supported by a driver is up
|
||||
to the driver writer. Language is specified in
|
||||
RFC 3066 or ISO 639-2 language code format.
|
||||
|
||||
@param ControllerName[out] A pointer to the Unicode string to return.
|
||||
This Unicode string is the name of the
|
||||
controller specified by ControllerHandle and
|
||||
ChildHandle in the language specified by
|
||||
Language from the point of view of the driver
|
||||
specified by This.
|
||||
|
||||
@retval EFI_SUCCESS The Unicode string for the user readable name in
|
||||
the language specified by Language for the
|
||||
driver specified by This was returned in
|
||||
DriverName.
|
||||
|
||||
@retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE.
|
||||
|
||||
@retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid
|
||||
EFI_HANDLE.
|
||||
|
||||
@retval EFI_INVALID_PARAMETER Language is NULL.
|
||||
|
||||
@retval EFI_INVALID_PARAMETER ControllerName is NULL.
|
||||
|
||||
@retval EFI_UNSUPPORTED The driver specified by This is not currently
|
||||
managing the controller specified by
|
||||
ControllerHandle and ChildHandle.
|
||||
|
||||
@retval EFI_UNSUPPORTED The driver specified by This does not support
|
||||
the language specified by Language.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
SDControllerGetControllerName (
|
||||
IN EFI_COMPONENT_NAME_PROTOCOL *This,
|
||||
IN EFI_HANDLE ControllerHandle,
|
||||
IN EFI_HANDLE ChildHandle OPTIONAL,
|
||||
IN CHAR8 *Language,
|
||||
OUT CHAR16 **ControllerName
|
||||
);
|
||||
|
||||
#endif
|
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,322 @@
|
||||
/** @file
|
||||
|
||||
The definition for SD host controller driver model and HC protocol routines.
|
||||
|
||||
Copyright (c) 2013-2015 Intel Corporation.
|
||||
|
||||
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
|
||||
http://opensource.org/licenses/bsd-license.php
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
**/
|
||||
|
||||
#ifndef _SD_CONTROLLER_H_
|
||||
#define _SD_CONTROLLER_H_
|
||||
|
||||
|
||||
#include <Uefi.h>
|
||||
|
||||
|
||||
#include <Protocol/PciIo.h>
|
||||
|
||||
#include <Library/DebugLib.h>
|
||||
#include <Library/BaseMemoryLib.h>
|
||||
#include <Library/UefiDriverEntryPoint.h>
|
||||
#include <Library/UefiBootServicesTableLib.h>
|
||||
#include <Library/UefiLib.h>
|
||||
#include <Library/BaseLib.h>
|
||||
#include <Library/MemoryAllocationLib.h>
|
||||
#include <Library/PcdLib.h>
|
||||
#include <IndustryStandard/Pci22.h>
|
||||
|
||||
|
||||
#include "ComponentName.h"
|
||||
#include "SDHostIo.h"
|
||||
|
||||
|
||||
extern EFI_DRIVER_BINDING_PROTOCOL gSDControllerDriverBinding;
|
||||
extern EFI_COMPONENT_NAME_PROTOCOL gSDControllerName;
|
||||
extern EFI_COMPONENT_NAME2_PROTOCOL gSDControllerName2;
|
||||
|
||||
|
||||
#define SDHOST_DATA_SIGNATURE SIGNATURE_32 ('s', 'd', 'h', 's')
|
||||
|
||||
#define BLOCK_SIZE 0x200
|
||||
#define TIME_OUT_1S 1000
|
||||
|
||||
#pragma pack(1)
|
||||
//
|
||||
// PCI Class Code structure
|
||||
//
|
||||
typedef struct {
|
||||
UINT8 PI;
|
||||
UINT8 SubClassCode;
|
||||
UINT8 BaseCode;
|
||||
} PCI_CLASSC;
|
||||
|
||||
#pragma pack()
|
||||
|
||||
|
||||
typedef struct {
|
||||
UINTN Signature;
|
||||
EFI_SD_HOST_IO_PROTOCOL SDHostIo;
|
||||
EFI_PCI_IO_PROTOCOL *PciIo;
|
||||
BOOLEAN IsAutoStopCmd;
|
||||
UINT32 BaseClockInMHz;
|
||||
UINT32 CurrentClockInKHz;
|
||||
UINT32 BlockLength;
|
||||
EFI_UNICODE_STRING_TABLE *ControllerNameTable;
|
||||
}SDHOST_DATA;
|
||||
|
||||
#define SDHOST_DATA_FROM_THIS(a) \
|
||||
CR(a, SDHOST_DATA, SDHostIo, SDHOST_DATA_SIGNATURE)
|
||||
|
||||
/**
|
||||
Test to see if this driver supports ControllerHandle. Any
|
||||
ControllerHandle that has SDHostIoProtocol installed will be supported.
|
||||
|
||||
@param This Protocol instance pointer.
|
||||
@param Controller Handle of device to test.
|
||||
@param RemainingDevicePath Not used.
|
||||
|
||||
@return EFI_SUCCESS This driver supports this device.
|
||||
@return EFI_UNSUPPORTED This driver does not support this device.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
SDControllerSupported (
|
||||
IN EFI_DRIVER_BINDING_PROTOCOL *This,
|
||||
IN EFI_HANDLE Controller,
|
||||
IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
|
||||
);
|
||||
|
||||
/**
|
||||
Starting the SD Host Controller Driver.
|
||||
|
||||
@param This Protocol instance pointer.
|
||||
@param Controller Handle of device to test.
|
||||
@param RemainingDevicePath Not used.
|
||||
|
||||
@retval EFI_SUCCESS This driver supports this device.
|
||||
@retval EFI_UNSUPPORTED This driver does not support this device.
|
||||
@retval EFI_DEVICE_ERROR This driver cannot be started due to device Error.
|
||||
EFI_OUT_OF_RESOURCES- Failed due to resource shortage.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
SDControllerStart (
|
||||
IN EFI_DRIVER_BINDING_PROTOCOL *This,
|
||||
IN EFI_HANDLE Controller,
|
||||
IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
|
||||
);
|
||||
|
||||
/**
|
||||
Stop this driver on ControllerHandle. Support stoping any child handles
|
||||
created by this driver.
|
||||
|
||||
@param This Protocol instance pointer.
|
||||
@param Controller Handle of device to stop driver on.
|
||||
@param NumberOfChildren Number of Children in the ChildHandleBuffer.
|
||||
@param ChildHandleBuffer List of handles for the children we need to stop.
|
||||
|
||||
@return EFI_SUCCESS
|
||||
@return others
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
SDControllerStop (
|
||||
IN EFI_DRIVER_BINDING_PROTOCOL *This,
|
||||
IN EFI_HANDLE Controller,
|
||||
IN UINTN NumberOfChildren,
|
||||
IN EFI_HANDLE *ChildHandleBuffer
|
||||
);
|
||||
|
||||
/**
|
||||
The main function used to send the command to the card inserted into the SD host slot.
|
||||
It will assemble the arguments to set the command register and wait for the command
|
||||
and transfer completed until timeout. Then it will read the response register to fill
|
||||
the ResponseData.
|
||||
|
||||
@param This A pointer to the EFI_SD_HOST_IO_PROTOCOL instance.
|
||||
@param CommandIndex The command index to set the command index field of command register.
|
||||
@param Argument Command argument to set the argument field of command register.
|
||||
@param DataType TRANSFER_TYPE, indicates no data, data in or data out.
|
||||
@param Buffer Contains the data read from / write to the device.
|
||||
@param BufferSize The size of the buffer.
|
||||
@param ResponseType RESPONSE_TYPE.
|
||||
@param TimeOut Time out value in 1 ms unit.
|
||||
@param ResponseData Depending on the ResponseType, such as CSD or card status.
|
||||
|
||||
@retval EFI_SUCCESS
|
||||
@retval EFI_INVALID_PARAMETER
|
||||
@retval EFI_OUT_OF_RESOURCES
|
||||
@retval EFI_TIMEOUT
|
||||
@retval EFI_DEVICE_ERROR
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
SendCommand (
|
||||
IN EFI_SD_HOST_IO_PROTOCOL *This,
|
||||
IN UINT16 CommandIndex,
|
||||
IN UINT32 Argument,
|
||||
IN TRANSFER_TYPE DataType,
|
||||
IN UINT8 *Buffer, OPTIONAL
|
||||
IN UINT32 BufferSize,
|
||||
IN RESPONSE_TYPE ResponseType,
|
||||
IN UINT32 TimeOut,
|
||||
OUT UINT32 *ResponseData OPTIONAL
|
||||
);
|
||||
|
||||
/**
|
||||
Set max clock frequency of the host, the actual frequency may not be the same as MaxFrequency.
|
||||
It depends on the max frequency the host can support, divider, and host speed mode.
|
||||
|
||||
@param This A pointer to the EFI_SD_HOST_IO_PROTOCOL instance.
|
||||
@param MaxFrequency Max frequency in HZ.
|
||||
|
||||
@retval EFI_SUCCESS
|
||||
@retval EFI_TIMEOUT
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
SetClockFrequency (
|
||||
IN EFI_SD_HOST_IO_PROTOCOL *This,
|
||||
IN UINT32 MaxFrequencyInKHz
|
||||
);
|
||||
|
||||
/**
|
||||
Set bus width of the host controller
|
||||
|
||||
@param This A pointer to the EFI_SD_HOST_IO_PROTOCOL instance.
|
||||
@param BusWidth Bus width in 1, 4, 8 bits.
|
||||
|
||||
@retval EFI_SUCCESS
|
||||
@retval EFI_INVALID_PARAMETER
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
SetBusWidth (
|
||||
IN EFI_SD_HOST_IO_PROTOCOL *This,
|
||||
IN UINT32 BusWidth
|
||||
);
|
||||
|
||||
|
||||
/**
|
||||
Set voltage which could supported by the host controller.
|
||||
Support 0(Power off the host), 1.8V, 3.0V, 3.3V
|
||||
|
||||
@param This A pointer to the EFI_SD_HOST_IO_PROTOCOL instance.
|
||||
@param Voltage Units in 0.1 V.
|
||||
|
||||
@retval EFI_SUCCESS
|
||||
@retval EFI_INVALID_PARAMETER
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
SetHostVoltage (
|
||||
IN EFI_SD_HOST_IO_PROTOCOL *This,
|
||||
IN UINT32 Voltage
|
||||
);
|
||||
|
||||
|
||||
/**
|
||||
Reset the host controller.
|
||||
|
||||
@param This A pointer to the EFI_SD_HOST_IO_PROTOCOL instance.
|
||||
@param ResetAll TRUE to reset all.
|
||||
|
||||
@retval EFI_SUCCESS
|
||||
@retval EFI_TIMEOUT
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
ResetSDHost (
|
||||
IN EFI_SD_HOST_IO_PROTOCOL *This,
|
||||
IN RESET_TYPE ResetType
|
||||
);
|
||||
|
||||
|
||||
/**
|
||||
Enable auto stop on the host controller.
|
||||
|
||||
@param This A pointer to the EFI_SD_HOST_IO_PROTOCOL instance.
|
||||
@param Enable TRUE to enable, FALSE to disable.
|
||||
|
||||
@retval EFI_SUCCESS
|
||||
@retval EFI_TIMEOUT
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
EnableAutoStopCmd (
|
||||
IN EFI_SD_HOST_IO_PROTOCOL *This,
|
||||
IN BOOLEAN Enable
|
||||
);
|
||||
|
||||
/**
|
||||
Find whether these is a card inserted into the slot. If so init the host.
|
||||
If not, return EFI_NOT_FOUND.
|
||||
|
||||
@param This A pointer to the EFI_SD_HOST_IO_PROTOCOL instance.
|
||||
|
||||
@retval EFI_SUCCESS
|
||||
@retval EFI_NOT_FOUND
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
DetectCardAndInitHost (
|
||||
IN EFI_SD_HOST_IO_PROTOCOL *This
|
||||
);
|
||||
|
||||
/**
|
||||
Set the Block length on the host controller.
|
||||
|
||||
@param This A pointer to the EFI_SD_HOST_IO_PROTOCOL instance.
|
||||
@param BlockLength card supportes block length.
|
||||
|
||||
@retval EFI_SUCCESS
|
||||
@retval EFI_TIMEOUT
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
SetBlockLength (
|
||||
IN EFI_SD_HOST_IO_PROTOCOL *This,
|
||||
IN UINT32 BlockLength
|
||||
);
|
||||
|
||||
/**
|
||||
Enable/Disable High Speed transfer mode
|
||||
|
||||
@param This A pointer to the EFI_SD_HOST_IO_PROTOCOL instance.
|
||||
@param Enable TRUE to Enable, FALSE to Disable
|
||||
|
||||
@return EFI_SUCCESS
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
SetHighSpeedMode (
|
||||
IN EFI_SD_HOST_IO_PROTOCOL *This,
|
||||
IN BOOLEAN Enable
|
||||
);
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
SetDDRMode (
|
||||
IN EFI_SD_HOST_IO_PROTOCOL *This,
|
||||
IN BOOLEAN Enable
|
||||
);
|
||||
#endif
|
@@ -0,0 +1,62 @@
|
||||
## @file
|
||||
#
|
||||
# Component Description File For SDControllerDxe Module.
|
||||
#
|
||||
# Copyright (c) 2013-2015 Intel Corporation.
|
||||
#
|
||||
# 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
|
||||
# http://opensource.org/licenses/bsd-license.php
|
||||
#
|
||||
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
#
|
||||
##
|
||||
|
||||
[Defines]
|
||||
INF_VERSION = 0x00010005
|
||||
BASE_NAME = SDController
|
||||
FILE_GUID = 90A330BD-6F89-4900-933A-C25EB4356348
|
||||
MODULE_TYPE = UEFI_DRIVER
|
||||
VERSION_STRING = 1.0
|
||||
ENTRY_POINT = InitializeSDController
|
||||
|
||||
#
|
||||
# The following information is for reference only and not required by the build tools.
|
||||
#
|
||||
# VALID_ARCHITECTURES = IA32 X64 IPF EBC
|
||||
#
|
||||
# DRIVER_BINDING = gSDControllerDriverBinding
|
||||
# COMPONENT_NAME = gSDControllerName
|
||||
# COMPONENT_NAME2 = gSDControllerName2
|
||||
#
|
||||
|
||||
[Sources]
|
||||
SDController.c
|
||||
SDController.h
|
||||
ComponentName.c
|
||||
ComponentName.h
|
||||
|
||||
[Packages]
|
||||
MdePkg/MdePkg.dec
|
||||
MdeModulePkg/MdeModulePkg.dec
|
||||
QuarkSocPkg/QuarkSocPkg.dec
|
||||
|
||||
[LibraryClasses]
|
||||
MemoryAllocationLib
|
||||
BaseLib
|
||||
UefiLib
|
||||
UefiBootServicesTableLib
|
||||
UefiDriverEntryPoint
|
||||
BaseMemoryLib
|
||||
DebugLib
|
||||
PcdLib
|
||||
|
||||
[Protocols]
|
||||
gEfiPciIoProtocolGuid ## TO_START
|
||||
gEfiSDHostIoProtocolGuid ## BY_START
|
||||
|
||||
[FeaturePcd]
|
||||
gEfiQuarkSCSocIdTokenSpaceGuid.PcdSdHciQuirkNoHiSpd
|
||||
|
Reference in New Issue
Block a user