MdeModulePkg: Clean up source files
1. Do not use tab characters 2. No trailing white space in one line 3. All files must end with CRLF Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
This commit is contained in:
parent
ca79bab7af
commit
d1102dba72
@ -1,7 +1,7 @@
|
|||||||
/** @file
|
/** @file
|
||||||
The application to show the Boot Manager Menu.
|
The application to show the Boot Manager Menu.
|
||||||
|
|
||||||
Copyright (c) 2011 - 2017, Intel Corporation. All rights reserved.<BR>
|
Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||||
This program and the accompanying materials
|
This program and the accompanying materials
|
||||||
are licensed and made available under the terms and conditions of the BSD License
|
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
|
which accompanies this distribution. The full text of the license may be found at
|
||||||
@ -91,19 +91,19 @@ UINTN
|
|||||||
GetLineWidth (
|
GetLineWidth (
|
||||||
IN EFI_STRING_ID StringId
|
IN EFI_STRING_ID StringId
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
UINTN Index;
|
UINTN Index;
|
||||||
UINTN IncrementValue;
|
UINTN IncrementValue;
|
||||||
EFI_STRING String;
|
EFI_STRING String;
|
||||||
UINTN LineWidth;
|
UINTN LineWidth;
|
||||||
|
|
||||||
LineWidth = 0;
|
LineWidth = 0;
|
||||||
String = HiiGetString (gStringPackHandle, StringId, NULL);
|
String = HiiGetString (gStringPackHandle, StringId, NULL);
|
||||||
|
|
||||||
if (String != NULL) {
|
if (String != NULL) {
|
||||||
Index = 0;
|
Index = 0;
|
||||||
IncrementValue = 1;
|
IncrementValue = 1;
|
||||||
|
|
||||||
do {
|
do {
|
||||||
//
|
//
|
||||||
// Advance to the null-terminator or to the first width directive
|
// Advance to the null-terminator or to the first width directive
|
||||||
@ -113,7 +113,7 @@ GetLineWidth (
|
|||||||
Index++, LineWidth = LineWidth + IncrementValue
|
Index++, LineWidth = LineWidth + IncrementValue
|
||||||
)
|
)
|
||||||
;
|
;
|
||||||
|
|
||||||
//
|
//
|
||||||
// We hit the null-terminator, we now have a count
|
// We hit the null-terminator, we now have a count
|
||||||
//
|
//
|
||||||
@ -137,11 +137,11 @@ GetLineWidth (
|
|||||||
Index++;
|
Index++;
|
||||||
IncrementValue = 2;
|
IncrementValue = 2;
|
||||||
}
|
}
|
||||||
} while (String[Index] != 0);
|
} while (String[Index] != 0);
|
||||||
FreePool (String);
|
FreePool (String);
|
||||||
}
|
}
|
||||||
|
|
||||||
return LineWidth;
|
return LineWidth;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -150,10 +150,10 @@ GetLineWidth (
|
|||||||
@param BootMenuData The boot menu data to be processed.
|
@param BootMenuData The boot menu data to be processed.
|
||||||
|
|
||||||
@return EFI_SUCCESS calculate boot menu information successful.
|
@return EFI_SUCCESS calculate boot menu information successful.
|
||||||
@retval EFI_INVALID_PARAMETER Input parameter is invalid
|
@retval EFI_INVALID_PARAMETER Input parameter is invalid
|
||||||
|
|
||||||
**/
|
**/
|
||||||
EFI_STATUS
|
EFI_STATUS
|
||||||
InitializeBootMenuScreen (
|
InitializeBootMenuScreen (
|
||||||
IN OUT BOOT_MENU_POPUP_DATA *BootMenuData
|
IN OUT BOOT_MENU_POPUP_DATA *BootMenuData
|
||||||
)
|
)
|
||||||
@ -172,21 +172,21 @@ InitializeBootMenuScreen (
|
|||||||
//
|
//
|
||||||
// Get maximum string width
|
// Get maximum string width
|
||||||
//
|
//
|
||||||
MaxStrWidth = 0;
|
MaxStrWidth = 0;
|
||||||
for (Index = 0; Index < TITLE_TOKEN_COUNT; Index++) {
|
for (Index = 0; Index < TITLE_TOKEN_COUNT; Index++) {
|
||||||
StrWidth = GetLineWidth (BootMenuData->TitleToken[Index]);
|
StrWidth = GetLineWidth (BootMenuData->TitleToken[Index]);
|
||||||
MaxStrWidth = MaxStrWidth > StrWidth ? MaxStrWidth : StrWidth;
|
MaxStrWidth = MaxStrWidth > StrWidth ? MaxStrWidth : StrWidth;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (Index = 0; Index < BootMenuData->ItemCount; Index++) {
|
for (Index = 0; Index < BootMenuData->ItemCount; Index++) {
|
||||||
StrWidth = GetLineWidth (BootMenuData->PtrTokens[Index]);
|
StrWidth = GetLineWidth (BootMenuData->PtrTokens[Index]);
|
||||||
MaxStrWidth = MaxStrWidth > StrWidth ? MaxStrWidth : StrWidth;
|
MaxStrWidth = MaxStrWidth > StrWidth ? MaxStrWidth : StrWidth;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (Index = 0; Index < HELP_TOKEN_COUNT; Index++) {
|
for (Index = 0; Index < HELP_TOKEN_COUNT; Index++) {
|
||||||
StrWidth = GetLineWidth (BootMenuData->HelpToken[Index]);
|
StrWidth = GetLineWidth (BootMenuData->HelpToken[Index]);
|
||||||
MaxStrWidth = MaxStrWidth > StrWidth ? MaxStrWidth : StrWidth;
|
MaxStrWidth = MaxStrWidth > StrWidth ? MaxStrWidth : StrWidth;
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
// query current row and column to calculate boot menu location
|
// query current row and column to calculate boot menu location
|
||||||
//
|
//
|
||||||
@ -195,10 +195,10 @@ InitializeBootMenuScreen (
|
|||||||
gST->ConOut->Mode->Mode,
|
gST->ConOut->Mode->Mode,
|
||||||
&Column,
|
&Column,
|
||||||
&Row
|
&Row
|
||||||
);
|
);
|
||||||
|
|
||||||
MaxPrintRows = Row - 6;
|
MaxPrintRows = Row - 6;
|
||||||
UnSelectableItmes = TITLE_TOKEN_COUNT + 2 + HELP_TOKEN_COUNT + 2;
|
UnSelectableItmes = TITLE_TOKEN_COUNT + 2 + HELP_TOKEN_COUNT + 2;
|
||||||
BootMenuData->MenuScreen.Width = MaxStrWidth + 8;
|
BootMenuData->MenuScreen.Width = MaxStrWidth + 8;
|
||||||
if (BootMenuData->ItemCount + UnSelectableItmes > MaxPrintRows) {
|
if (BootMenuData->ItemCount + UnSelectableItmes > MaxPrintRows) {
|
||||||
BootMenuData->MenuScreen.Height = MaxPrintRows;
|
BootMenuData->MenuScreen.Height = MaxPrintRows;
|
||||||
@ -211,10 +211,10 @@ InitializeBootMenuScreen (
|
|||||||
BootMenuData->ScrollBarControl.HasScrollBar = FALSE;
|
BootMenuData->ScrollBarControl.HasScrollBar = FALSE;
|
||||||
BootMenuData->ScrollBarControl.ItemCountPerScreen = BootMenuData->ItemCount;
|
BootMenuData->ScrollBarControl.ItemCountPerScreen = BootMenuData->ItemCount;
|
||||||
BootMenuData->ScrollBarControl.FirstItem = 0;
|
BootMenuData->ScrollBarControl.FirstItem = 0;
|
||||||
BootMenuData->ScrollBarControl.LastItem = BootMenuData->ItemCount - 1;
|
BootMenuData->ScrollBarControl.LastItem = BootMenuData->ItemCount - 1;
|
||||||
}
|
}
|
||||||
BootMenuData->MenuScreen.StartCol = (Column - BootMenuData->MenuScreen.Width) / 2;
|
BootMenuData->MenuScreen.StartCol = (Column - BootMenuData->MenuScreen.Width) / 2;
|
||||||
BootMenuData->MenuScreen.StartRow = (Row - BootMenuData->MenuScreen.Height) / 2;
|
BootMenuData->MenuScreen.StartRow = (Row - BootMenuData->MenuScreen.Height) / 2;
|
||||||
|
|
||||||
return EFI_SUCCESS;
|
return EFI_SUCCESS;
|
||||||
}
|
}
|
||||||
@ -222,7 +222,7 @@ InitializeBootMenuScreen (
|
|||||||
This function uses check boot option is wheher setup application or no
|
This function uses check boot option is wheher setup application or no
|
||||||
|
|
||||||
@param BootOption Pointer to EFI_BOOT_MANAGER_LOAD_OPTION array.
|
@param BootOption Pointer to EFI_BOOT_MANAGER_LOAD_OPTION array.
|
||||||
|
|
||||||
@retval TRUE This boot option is setup application.
|
@retval TRUE This boot option is setup application.
|
||||||
@retval FALSE This boot options isn't setup application
|
@retval FALSE This boot options isn't setup application
|
||||||
|
|
||||||
@ -291,9 +291,9 @@ IgnoreBootOption (
|
|||||||
@param BootOption Pointer to EFI_BOOT_MANAGER_LOAD_OPTION array.
|
@param BootOption Pointer to EFI_BOOT_MANAGER_LOAD_OPTION array.
|
||||||
@param BootOptionCount Number of boot option.
|
@param BootOptionCount Number of boot option.
|
||||||
@param BootMenuData The Input BootMenuData to be initialized.
|
@param BootMenuData The Input BootMenuData to be initialized.
|
||||||
|
|
||||||
@retval EFI_SUCCESS Initialize boot menu data successful.
|
@retval EFI_SUCCESS Initialize boot menu data successful.
|
||||||
@retval EFI_INVALID_PARAMETER Input parameter is invalid.
|
@retval EFI_INVALID_PARAMETER Input parameter is invalid.
|
||||||
|
|
||||||
**/
|
**/
|
||||||
EFI_STATUS
|
EFI_STATUS
|
||||||
@ -305,7 +305,7 @@ InitializeBootMenuData (
|
|||||||
{
|
{
|
||||||
UINTN Index;
|
UINTN Index;
|
||||||
UINTN StrIndex;
|
UINTN StrIndex;
|
||||||
|
|
||||||
if (BootOption == NULL || BootMenuData == NULL) {
|
if (BootOption == NULL || BootMenuData == NULL) {
|
||||||
return EFI_INVALID_PARAMETER;
|
return EFI_INVALID_PARAMETER;
|
||||||
}
|
}
|
||||||
@ -324,21 +324,21 @@ InitializeBootMenuData (
|
|||||||
|
|
||||||
ASSERT (BootOption[Index].Description != NULL);
|
ASSERT (BootOption[Index].Description != NULL);
|
||||||
BootMenuData->PtrTokens[StrIndex++] = HiiSetString (
|
BootMenuData->PtrTokens[StrIndex++] = HiiSetString (
|
||||||
gStringPackHandle,
|
gStringPackHandle,
|
||||||
0,
|
0,
|
||||||
BootOption[Index].Description,
|
BootOption[Index].Description,
|
||||||
NULL
|
NULL
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
BootMenuData->ItemCount = StrIndex;
|
BootMenuData->ItemCount = StrIndex;
|
||||||
BootMenuData->HelpToken[0] = STRING_TOKEN (STR_BOOT_POPUP_MENU_HELP1_STRING);
|
BootMenuData->HelpToken[0] = STRING_TOKEN (STR_BOOT_POPUP_MENU_HELP1_STRING);
|
||||||
BootMenuData->HelpToken[1] = STRING_TOKEN (STR_BOOT_POPUP_MENU_HELP2_STRING);
|
BootMenuData->HelpToken[1] = STRING_TOKEN (STR_BOOT_POPUP_MENU_HELP2_STRING);
|
||||||
BootMenuData->HelpToken[2] = STRING_TOKEN (STR_BOOT_POPUP_MENU_HELP3_STRING);
|
BootMenuData->HelpToken[2] = STRING_TOKEN (STR_BOOT_POPUP_MENU_HELP3_STRING);
|
||||||
InitializeBootMenuScreen (BootMenuData);
|
InitializeBootMenuScreen (BootMenuData);
|
||||||
BootMenuData->SelectItem = 0;
|
BootMenuData->SelectItem = 0;
|
||||||
return EFI_SUCCESS;
|
return EFI_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
This function uses input select item to highlight selected item
|
This function uses input select item to highlight selected item
|
||||||
@ -347,9 +347,9 @@ InitializeBootMenuData (
|
|||||||
@param WantSelectItem The user wants to select item.
|
@param WantSelectItem The user wants to select item.
|
||||||
@param BootMenuData The boot menu data to be processed
|
@param BootMenuData The boot menu data to be processed
|
||||||
|
|
||||||
@return EFI_SUCCESS Highlight selected item and update current selected
|
@return EFI_SUCCESS Highlight selected item and update current selected
|
||||||
item successful
|
item successful
|
||||||
@retval EFI_INVALID_PARAMETER Input parameter is invalid
|
@retval EFI_INVALID_PARAMETER Input parameter is invalid
|
||||||
**/
|
**/
|
||||||
EFI_STATUS
|
EFI_STATUS
|
||||||
BootMenuSelectItem (
|
BootMenuSelectItem (
|
||||||
@ -359,7 +359,7 @@ BootMenuSelectItem (
|
|||||||
{
|
{
|
||||||
INT32 SavedAttribute;
|
INT32 SavedAttribute;
|
||||||
EFI_STRING String;
|
EFI_STRING String;
|
||||||
UINTN StartCol;
|
UINTN StartCol;
|
||||||
UINTN StartRow;
|
UINTN StartRow;
|
||||||
UINTN PrintCol;
|
UINTN PrintCol;
|
||||||
UINTN PrintRow;
|
UINTN PrintRow;
|
||||||
@ -370,7 +370,7 @@ BootMenuSelectItem (
|
|||||||
UINTN ItemCountPerScreen;
|
UINTN ItemCountPerScreen;
|
||||||
UINTN Index;
|
UINTN Index;
|
||||||
BOOLEAN RePaintItems;
|
BOOLEAN RePaintItems;
|
||||||
|
|
||||||
if (BootMenuData == NULL || WantSelectItem >= BootMenuData->ItemCount) {
|
if (BootMenuData == NULL || WantSelectItem >= BootMenuData->ItemCount) {
|
||||||
return EFI_INVALID_PARAMETER;
|
return EFI_INVALID_PARAMETER;
|
||||||
}
|
}
|
||||||
@ -381,20 +381,20 @@ BootMenuSelectItem (
|
|||||||
StartRow = BootMenuData->MenuScreen.StartRow;
|
StartRow = BootMenuData->MenuScreen.StartRow;
|
||||||
//
|
//
|
||||||
// print selectable items again and adjust scroll bar if need
|
// print selectable items again and adjust scroll bar if need
|
||||||
//
|
//
|
||||||
if (BootMenuData->ScrollBarControl.HasScrollBar &&
|
if (BootMenuData->ScrollBarControl.HasScrollBar &&
|
||||||
(WantSelectItem < BootMenuData->ScrollBarControl.FirstItem ||
|
(WantSelectItem < BootMenuData->ScrollBarControl.FirstItem ||
|
||||||
WantSelectItem > BootMenuData->ScrollBarControl.LastItem ||
|
WantSelectItem > BootMenuData->ScrollBarControl.LastItem ||
|
||||||
WantSelectItem == BootMenuData->SelectItem)) {
|
WantSelectItem == BootMenuData->SelectItem)) {
|
||||||
ItemCountPerScreen = BootMenuData->ScrollBarControl.ItemCountPerScreen;
|
ItemCountPerScreen = BootMenuData->ScrollBarControl.ItemCountPerScreen;
|
||||||
//
|
//
|
||||||
// Set first item and last item
|
// Set first item and last item
|
||||||
//
|
//
|
||||||
if (WantSelectItem < BootMenuData->ScrollBarControl.FirstItem) {
|
if (WantSelectItem < BootMenuData->ScrollBarControl.FirstItem) {
|
||||||
BootMenuData->ScrollBarControl.FirstItem = WantSelectItem;
|
BootMenuData->ScrollBarControl.FirstItem = WantSelectItem;
|
||||||
BootMenuData->ScrollBarControl.LastItem = WantSelectItem + ItemCountPerScreen - 1;
|
BootMenuData->ScrollBarControl.LastItem = WantSelectItem + ItemCountPerScreen - 1;
|
||||||
} else if (WantSelectItem > BootMenuData->ScrollBarControl.LastItem) {
|
} else if (WantSelectItem > BootMenuData->ScrollBarControl.LastItem) {
|
||||||
BootMenuData->ScrollBarControl.FirstItem = WantSelectItem - ItemCountPerScreen + 1;
|
BootMenuData->ScrollBarControl.FirstItem = WantSelectItem - ItemCountPerScreen + 1;
|
||||||
BootMenuData->ScrollBarControl.LastItem = WantSelectItem;
|
BootMenuData->ScrollBarControl.LastItem = WantSelectItem;
|
||||||
}
|
}
|
||||||
gST->ConOut->SetAttribute (gST->ConOut, EFI_WHITE | EFI_BACKGROUND_BLUE);
|
gST->ConOut->SetAttribute (gST->ConOut, EFI_WHITE | EFI_BACKGROUND_BLUE);
|
||||||
@ -407,7 +407,7 @@ BootMenuSelectItem (
|
|||||||
TopShadeNum++;
|
TopShadeNum++;
|
||||||
}
|
}
|
||||||
PrintCol = StartCol + BootMenuData->MenuScreen.Width - 2;
|
PrintCol = StartCol + BootMenuData->MenuScreen.Width - 2;
|
||||||
PrintRow = StartRow + TITLE_TOKEN_COUNT + 2;
|
PrintRow = StartRow + TITLE_TOKEN_COUNT + 2;
|
||||||
for (Index = 0; Index < TopShadeNum; Index++, PrintRow++) {
|
for (Index = 0; Index < TopShadeNum; Index++, PrintRow++) {
|
||||||
PrintCharAt (PrintCol, PrintRow, BLOCKELEMENT_LIGHT_SHADE);
|
PrintCharAt (PrintCol, PrintRow, BLOCKELEMENT_LIGHT_SHADE);
|
||||||
}
|
}
|
||||||
@ -419,65 +419,65 @@ BootMenuSelectItem (
|
|||||||
LowShadeNum++;
|
LowShadeNum++;
|
||||||
}
|
}
|
||||||
PrintCol = StartCol + BootMenuData->MenuScreen.Width - 2;
|
PrintCol = StartCol + BootMenuData->MenuScreen.Width - 2;
|
||||||
PrintRow = StartRow + TITLE_TOKEN_COUNT + 2 + ItemCountPerScreen - LowShadeNum;
|
PrintRow = StartRow + TITLE_TOKEN_COUNT + 2 + ItemCountPerScreen - LowShadeNum;
|
||||||
for (Index = 0; Index < LowShadeNum; Index++, PrintRow++) {
|
for (Index = 0; Index < LowShadeNum; Index++, PrintRow++) {
|
||||||
PrintCharAt (PrintCol, PrintRow, BLOCKELEMENT_LIGHT_SHADE);
|
PrintCharAt (PrintCol, PrintRow, BLOCKELEMENT_LIGHT_SHADE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
PrintCol = StartCol + BootMenuData->MenuScreen.Width - 2;
|
PrintCol = StartCol + BootMenuData->MenuScreen.Width - 2;
|
||||||
PrintRow = StartRow + TITLE_TOKEN_COUNT + 2 + TopShadeNum;
|
PrintRow = StartRow + TITLE_TOKEN_COUNT + 2 + TopShadeNum;
|
||||||
for (Index = TopShadeNum; Index < ItemCountPerScreen - LowShadeNum; Index++, PrintRow++) {
|
for (Index = TopShadeNum; Index < ItemCountPerScreen - LowShadeNum; Index++, PrintRow++) {
|
||||||
PrintCharAt (PrintCol, PrintRow, BLOCKELEMENT_FULL_BLOCK);
|
PrintCharAt (PrintCol, PrintRow, BLOCKELEMENT_FULL_BLOCK);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Clear selectable items first
|
// Clear selectable items first
|
||||||
//
|
//
|
||||||
PrintCol = StartCol + 1;
|
PrintCol = StartCol + 1;
|
||||||
PrintRow = StartRow + TITLE_TOKEN_COUNT + 2;
|
PrintRow = StartRow + TITLE_TOKEN_COUNT + 2;
|
||||||
String = AllocateZeroPool ((BootMenuData->MenuScreen.Width - 2) * sizeof (CHAR16));
|
String = AllocateZeroPool ((BootMenuData->MenuScreen.Width - 2) * sizeof (CHAR16));
|
||||||
ASSERT (String != NULL);
|
ASSERT (String != NULL);
|
||||||
for (Index = 0; Index < BootMenuData->MenuScreen.Width - 3; Index++) {
|
for (Index = 0; Index < BootMenuData->MenuScreen.Width - 3; Index++) {
|
||||||
String[Index] = 0x20;
|
String[Index] = 0x20;
|
||||||
}
|
}
|
||||||
for (Index = 0; Index < ItemCountPerScreen; Index++) {
|
for (Index = 0; Index < ItemCountPerScreen; Index++) {
|
||||||
PrintStringAt (PrintCol, PrintRow + Index, String);
|
PrintStringAt (PrintCol, PrintRow + Index, String);
|
||||||
}
|
}
|
||||||
FreePool (String);
|
FreePool (String);
|
||||||
//
|
//
|
||||||
// print selectable items
|
// print selectable items
|
||||||
//
|
//
|
||||||
for (Index = 0; Index < ItemCountPerScreen; Index++, PrintRow++) {
|
for (Index = 0; Index < ItemCountPerScreen; Index++, PrintRow++) {
|
||||||
String = HiiGetString (gStringPackHandle, BootMenuData->PtrTokens[Index + FirstItem], NULL);
|
String = HiiGetString (gStringPackHandle, BootMenuData->PtrTokens[Index + FirstItem], NULL);
|
||||||
PrintStringAt (PrintCol, PrintRow, String);
|
PrintStringAt (PrintCol, PrintRow, String);
|
||||||
FreePool (String);
|
FreePool (String);
|
||||||
}
|
}
|
||||||
RePaintItems = TRUE;
|
RePaintItems = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Print want to select item
|
// Print want to select item
|
||||||
//
|
//
|
||||||
FirstItem = BootMenuData->ScrollBarControl.FirstItem;
|
FirstItem = BootMenuData->ScrollBarControl.FirstItem;
|
||||||
gST->ConOut->SetAttribute (gST->ConOut, EFI_WHITE | EFI_BACKGROUND_BLACK);
|
gST->ConOut->SetAttribute (gST->ConOut, EFI_WHITE | EFI_BACKGROUND_BLACK);
|
||||||
String = HiiGetString (gStringPackHandle, BootMenuData->PtrTokens[WantSelectItem], NULL);
|
String = HiiGetString (gStringPackHandle, BootMenuData->PtrTokens[WantSelectItem], NULL);
|
||||||
PrintCol = StartCol + 1;
|
PrintCol = StartCol + 1;
|
||||||
PrintRow = StartRow + TITLE_TOKEN_COUNT + 2 + WantSelectItem - FirstItem;
|
PrintRow = StartRow + TITLE_TOKEN_COUNT + 2 + WantSelectItem - FirstItem;
|
||||||
PrintStringAt (PrintCol, PrintRow, String);
|
PrintStringAt (PrintCol, PrintRow, String);
|
||||||
FreePool (String);
|
FreePool (String);
|
||||||
|
|
||||||
//
|
//
|
||||||
// if Want Select and selected item isn't the same and doesn't re-draw selectable
|
// if Want Select and selected item isn't the same and doesn't re-draw selectable
|
||||||
// items, clear select item
|
// items, clear select item
|
||||||
//
|
//
|
||||||
if (WantSelectItem != BootMenuData->SelectItem && !RePaintItems) {
|
if (WantSelectItem != BootMenuData->SelectItem && !RePaintItems) {
|
||||||
gST->ConOut->SetAttribute (gST->ConOut, EFI_WHITE | EFI_BACKGROUND_BLUE);
|
gST->ConOut->SetAttribute (gST->ConOut, EFI_WHITE | EFI_BACKGROUND_BLUE);
|
||||||
String = HiiGetString (gStringPackHandle, BootMenuData->PtrTokens[BootMenuData->SelectItem], NULL);
|
String = HiiGetString (gStringPackHandle, BootMenuData->PtrTokens[BootMenuData->SelectItem], NULL);
|
||||||
PrintCol = StartCol + 1;
|
PrintCol = StartCol + 1;
|
||||||
PrintRow = StartRow + 3 + BootMenuData->SelectItem - FirstItem;
|
PrintRow = StartRow + 3 + BootMenuData->SelectItem - FirstItem;
|
||||||
PrintStringAt (PrintCol, PrintRow, String);
|
PrintStringAt (PrintCol, PrintRow, String);
|
||||||
FreePool (String);
|
FreePool (String);
|
||||||
}
|
}
|
||||||
|
|
||||||
gST->ConOut->SetAttribute (gST->ConOut, SavedAttribute);
|
gST->ConOut->SetAttribute (gST->ConOut, SavedAttribute);
|
||||||
@ -489,28 +489,28 @@ BootMenuSelectItem (
|
|||||||
This function uses to draw boot popup menu
|
This function uses to draw boot popup menu
|
||||||
|
|
||||||
@param BootMenuData The Input BootMenuData to be processed.
|
@param BootMenuData The Input BootMenuData to be processed.
|
||||||
|
|
||||||
@retval EFI_SUCCESS Draw boot popup menu successful.
|
@retval EFI_SUCCESS Draw boot popup menu successful.
|
||||||
|
|
||||||
**/
|
**/
|
||||||
EFI_STATUS
|
EFI_STATUS
|
||||||
DrawBootPopupMenu (
|
DrawBootPopupMenu (
|
||||||
IN BOOT_MENU_POPUP_DATA *BootMenuData
|
IN BOOT_MENU_POPUP_DATA *BootMenuData
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
EFI_STRING String;
|
EFI_STRING String;
|
||||||
UINTN Index;
|
UINTN Index;
|
||||||
UINTN Width;
|
UINTN Width;
|
||||||
UINTN StartCol;
|
UINTN StartCol;
|
||||||
UINTN StartRow;
|
UINTN StartRow;
|
||||||
UINTN PrintRow;
|
UINTN PrintRow;
|
||||||
UINTN PrintCol;
|
UINTN PrintCol;
|
||||||
UINTN LineWidth;
|
UINTN LineWidth;
|
||||||
INT32 SavedAttribute;
|
INT32 SavedAttribute;
|
||||||
UINTN ItemCountPerScreen;
|
UINTN ItemCountPerScreen;
|
||||||
|
|
||||||
gST->ConOut->ClearScreen (gST->ConOut);
|
gST->ConOut->ClearScreen (gST->ConOut);
|
||||||
|
|
||||||
SavedAttribute = gST->ConOut->Mode->Attribute;
|
SavedAttribute = gST->ConOut->Mode->Attribute;
|
||||||
gST->ConOut->SetAttribute (gST->ConOut, EFI_WHITE | EFI_BACKGROUND_BLUE);
|
gST->ConOut->SetAttribute (gST->ConOut, EFI_WHITE | EFI_BACKGROUND_BLUE);
|
||||||
Width = BootMenuData->MenuScreen.Width;
|
Width = BootMenuData->MenuScreen.Width;
|
||||||
@ -518,17 +518,17 @@ DrawBootPopupMenu (
|
|||||||
StartRow = BootMenuData->MenuScreen.StartRow;
|
StartRow = BootMenuData->MenuScreen.StartRow;
|
||||||
ItemCountPerScreen = BootMenuData->ScrollBarControl.ItemCountPerScreen;
|
ItemCountPerScreen = BootMenuData->ScrollBarControl.ItemCountPerScreen;
|
||||||
PrintRow = StartRow;
|
PrintRow = StartRow;
|
||||||
|
|
||||||
gST->ConOut->EnableCursor (gST->ConOut, FALSE);
|
gST->ConOut->EnableCursor (gST->ConOut, FALSE);
|
||||||
//
|
//
|
||||||
// Draw Boot popup menu screen
|
// Draw Boot popup menu screen
|
||||||
//
|
//
|
||||||
PrintCharAt (StartCol, PrintRow, BOXDRAW_DOWN_RIGHT);
|
PrintCharAt (StartCol, PrintRow, BOXDRAW_DOWN_RIGHT);
|
||||||
for (Index = 1; Index < Width - 1; Index++) {
|
for (Index = 1; Index < Width - 1; Index++) {
|
||||||
PrintCharAt (StartCol + Index, PrintRow, BOXDRAW_HORIZONTAL);
|
PrintCharAt (StartCol + Index, PrintRow, BOXDRAW_HORIZONTAL);
|
||||||
}
|
}
|
||||||
PrintCharAt (StartCol + Width - 1, PrintRow, BOXDRAW_DOWN_LEFT);
|
PrintCharAt (StartCol + Width - 1, PrintRow, BOXDRAW_DOWN_LEFT);
|
||||||
|
|
||||||
//
|
//
|
||||||
// Draw the screen for title
|
// Draw the screen for title
|
||||||
//
|
//
|
||||||
@ -540,18 +540,18 @@ DrawBootPopupMenu (
|
|||||||
|
|
||||||
for (Index = 0; Index < TITLE_TOKEN_COUNT; Index++) {
|
for (Index = 0; Index < TITLE_TOKEN_COUNT; Index++) {
|
||||||
PrintRow++;
|
PrintRow++;
|
||||||
PrintCharAt (StartCol, PrintRow, BOXDRAW_VERTICAL);
|
PrintCharAt (StartCol, PrintRow, BOXDRAW_VERTICAL);
|
||||||
PrintStringAt (StartCol + 1, PrintRow, String);
|
PrintStringAt (StartCol + 1, PrintRow, String);
|
||||||
PrintCharAt (StartCol + Width - 1, PrintRow, BOXDRAW_VERTICAL);
|
PrintCharAt (StartCol + Width - 1, PrintRow, BOXDRAW_VERTICAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
PrintRow++;
|
PrintRow++;
|
||||||
PrintCharAt (StartCol, PrintRow, BOXDRAW_VERTICAL_RIGHT);
|
PrintCharAt (StartCol, PrintRow, BOXDRAW_VERTICAL_RIGHT);
|
||||||
for (Index = 1; Index < Width - 1; Index++) {
|
for (Index = 1; Index < Width - 1; Index++) {
|
||||||
PrintCharAt (StartCol + Index, PrintRow, BOXDRAW_HORIZONTAL);
|
PrintCharAt (StartCol + Index, PrintRow, BOXDRAW_HORIZONTAL);
|
||||||
}
|
}
|
||||||
PrintCharAt (StartCol + Width - 1, PrintRow, BOXDRAW_VERTICAL_LEFT);
|
PrintCharAt (StartCol + Width - 1, PrintRow, BOXDRAW_VERTICAL_LEFT);
|
||||||
|
|
||||||
//
|
//
|
||||||
// Draw screen for selectable items
|
// Draw screen for selectable items
|
||||||
//
|
//
|
||||||
@ -560,15 +560,15 @@ DrawBootPopupMenu (
|
|||||||
PrintCharAt (StartCol, PrintRow, BOXDRAW_VERTICAL);
|
PrintCharAt (StartCol, PrintRow, BOXDRAW_VERTICAL);
|
||||||
PrintStringAt (StartCol + 1, PrintRow, String);
|
PrintStringAt (StartCol + 1, PrintRow, String);
|
||||||
PrintCharAt (StartCol + Width - 1, PrintRow, BOXDRAW_VERTICAL);
|
PrintCharAt (StartCol + Width - 1, PrintRow, BOXDRAW_VERTICAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
PrintRow++;
|
PrintRow++;
|
||||||
PrintCharAt (StartCol, PrintRow, BOXDRAW_VERTICAL_RIGHT);
|
PrintCharAt (StartCol, PrintRow, BOXDRAW_VERTICAL_RIGHT);
|
||||||
for (Index = 1; Index < Width - 1; Index++) {
|
for (Index = 1; Index < Width - 1; Index++) {
|
||||||
PrintCharAt (StartCol + Index, PrintRow, BOXDRAW_HORIZONTAL);
|
PrintCharAt (StartCol + Index, PrintRow, BOXDRAW_HORIZONTAL);
|
||||||
}
|
}
|
||||||
PrintCharAt (StartCol + Width - 1, PrintRow, BOXDRAW_VERTICAL_LEFT);
|
PrintCharAt (StartCol + Width - 1, PrintRow, BOXDRAW_VERTICAL_LEFT);
|
||||||
|
|
||||||
//
|
//
|
||||||
// Draw screen for Help
|
// Draw screen for Help
|
||||||
//
|
//
|
||||||
@ -578,39 +578,39 @@ DrawBootPopupMenu (
|
|||||||
PrintStringAt (StartCol + 1, PrintRow, String);
|
PrintStringAt (StartCol + 1, PrintRow, String);
|
||||||
PrintCharAt (StartCol + Width - 1, PrintRow, BOXDRAW_VERTICAL);
|
PrintCharAt (StartCol + Width - 1, PrintRow, BOXDRAW_VERTICAL);
|
||||||
}
|
}
|
||||||
FreePool (String);
|
FreePool (String);
|
||||||
|
|
||||||
PrintRow++;
|
PrintRow++;
|
||||||
PrintCharAt (StartCol, PrintRow, BOXDRAW_UP_RIGHT);
|
PrintCharAt (StartCol, PrintRow, BOXDRAW_UP_RIGHT);
|
||||||
for (Index = 1; Index < Width - 1; Index++) {
|
for (Index = 1; Index < Width - 1; Index++) {
|
||||||
PrintCharAt (StartCol + Index, PrintRow, BOXDRAW_HORIZONTAL);
|
PrintCharAt (StartCol + Index, PrintRow, BOXDRAW_HORIZONTAL);
|
||||||
}
|
}
|
||||||
PrintCharAt (StartCol + Width - 1, PrintRow, BOXDRAW_UP_LEFT);
|
PrintCharAt (StartCol + Width - 1, PrintRow, BOXDRAW_UP_LEFT);
|
||||||
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// print title strings
|
// print title strings
|
||||||
//
|
//
|
||||||
PrintRow = StartRow + 1;
|
PrintRow = StartRow + 1;
|
||||||
for (Index = 0; Index < TITLE_TOKEN_COUNT; Index++, PrintRow++) {
|
for (Index = 0; Index < TITLE_TOKEN_COUNT; Index++, PrintRow++) {
|
||||||
String = HiiGetString (gStringPackHandle, BootMenuData->TitleToken[Index], NULL);
|
String = HiiGetString (gStringPackHandle, BootMenuData->TitleToken[Index], NULL);
|
||||||
LineWidth = GetLineWidth (BootMenuData->TitleToken[Index]);
|
LineWidth = GetLineWidth (BootMenuData->TitleToken[Index]);
|
||||||
PrintCol = StartCol + (Width - LineWidth) / 2;
|
PrintCol = StartCol + (Width - LineWidth) / 2;
|
||||||
PrintStringAt (PrintCol, PrintRow, String);
|
PrintStringAt (PrintCol, PrintRow, String);
|
||||||
FreePool (String);
|
FreePool (String);
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// print selectable items
|
// print selectable items
|
||||||
//
|
//
|
||||||
PrintCol = StartCol + 1;
|
PrintCol = StartCol + 1;
|
||||||
PrintRow = StartRow + TITLE_TOKEN_COUNT + 2;
|
PrintRow = StartRow + TITLE_TOKEN_COUNT + 2;
|
||||||
for (Index = 0; Index < ItemCountPerScreen; Index++, PrintRow++) {
|
for (Index = 0; Index < ItemCountPerScreen; Index++, PrintRow++) {
|
||||||
String = HiiGetString (gStringPackHandle, BootMenuData->PtrTokens[Index], NULL);
|
String = HiiGetString (gStringPackHandle, BootMenuData->PtrTokens[Index], NULL);
|
||||||
PrintStringAt (PrintCol, PrintRow, String);
|
PrintStringAt (PrintCol, PrintRow, String);
|
||||||
FreePool (String);
|
FreePool (String);
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Print Help strings
|
// Print Help strings
|
||||||
//
|
//
|
||||||
@ -622,20 +622,20 @@ DrawBootPopupMenu (
|
|||||||
PrintStringAt (PrintCol, PrintRow, String);
|
PrintStringAt (PrintCol, PrintRow, String);
|
||||||
FreePool (String);
|
FreePool (String);
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Print scroll bar if has scroll bar
|
// Print scroll bar if has scroll bar
|
||||||
//
|
//
|
||||||
if (BootMenuData->ScrollBarControl.HasScrollBar) {
|
if (BootMenuData->ScrollBarControl.HasScrollBar) {
|
||||||
PrintCol = StartCol + Width - 2;
|
PrintCol = StartCol + Width - 2;
|
||||||
PrintRow = StartRow + 2;
|
PrintRow = StartRow + 2;
|
||||||
PrintCharAt (PrintCol, PrintRow, GEOMETRICSHAPE_UP_TRIANGLE);
|
PrintCharAt (PrintCol, PrintRow, GEOMETRICSHAPE_UP_TRIANGLE);
|
||||||
PrintCharAt (PrintCol + 1, PrintRow, BOXDRAW_VERTICAL);
|
PrintCharAt (PrintCol + 1, PrintRow, BOXDRAW_VERTICAL);
|
||||||
PrintRow += (ItemCountPerScreen + 1);
|
PrintRow += (ItemCountPerScreen + 1);
|
||||||
PrintCharAt (PrintCol, PrintRow, GEOMETRICSHAPE_DOWN_TRIANGLE);
|
PrintCharAt (PrintCol, PrintRow, GEOMETRICSHAPE_DOWN_TRIANGLE);
|
||||||
PrintCharAt (PrintCol + 1, PrintRow, BOXDRAW_VERTICAL);
|
PrintCharAt (PrintCol + 1, PrintRow, BOXDRAW_VERTICAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
gST->ConOut->SetAttribute (gST->ConOut, SavedAttribute);
|
gST->ConOut->SetAttribute (gST->ConOut, SavedAttribute);
|
||||||
//
|
//
|
||||||
// Print Selected item
|
// Print Selected item
|
||||||
@ -645,7 +645,7 @@ DrawBootPopupMenu (
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
This function uses to boot from selected item
|
This function uses to boot from selected item
|
||||||
|
|
||||||
@param BootOptions Pointer to EFI_BOOT_MANAGER_LOAD_OPTION array.
|
@param BootOptions Pointer to EFI_BOOT_MANAGER_LOAD_OPTION array.
|
||||||
@param BootOptionCount Number of boot option.
|
@param BootOptionCount Number of boot option.
|
||||||
@ -654,7 +654,7 @@ DrawBootPopupMenu (
|
|||||||
VOID
|
VOID
|
||||||
BootFromSelectOption (
|
BootFromSelectOption (
|
||||||
IN EFI_BOOT_MANAGER_LOAD_OPTION *BootOptions,
|
IN EFI_BOOT_MANAGER_LOAD_OPTION *BootOptions,
|
||||||
IN UINTN BootOptionCount,
|
IN UINTN BootOptionCount,
|
||||||
IN UINTN SelectItem
|
IN UINTN SelectItem
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
@ -677,9 +677,9 @@ BootFromSelectOption (
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
This function will change video resolution and text mode
|
This function will change video resolution and text mode
|
||||||
according to defined setup mode or defined boot mode
|
according to defined setup mode or defined boot mode
|
||||||
|
|
||||||
@param IsSetupMode Indicate mode is changed to setup mode or boot mode.
|
@param IsSetupMode Indicate mode is changed to setup mode or boot mode.
|
||||||
|
|
||||||
@retval EFI_SUCCESS Mode is changed successfully.
|
@retval EFI_SUCCESS Mode is changed successfully.
|
||||||
@retval Others Mode failed to be changed.
|
@retval Others Mode failed to be changed.
|
||||||
@ -707,13 +707,13 @@ BdsSetConsoleMode (
|
|||||||
EFI_STATUS Status;
|
EFI_STATUS Status;
|
||||||
UINTN Index;
|
UINTN Index;
|
||||||
UINTN CurrentColumn;
|
UINTN CurrentColumn;
|
||||||
UINTN CurrentRow;
|
UINTN CurrentRow;
|
||||||
|
|
||||||
MaxGopMode = 0;
|
MaxGopMode = 0;
|
||||||
MaxTextMode = 0;
|
MaxTextMode = 0;
|
||||||
|
|
||||||
//
|
//
|
||||||
// Get current video resolution and text mode
|
// Get current video resolution and text mode
|
||||||
//
|
//
|
||||||
Status = gBS->HandleProtocol (
|
Status = gBS->HandleProtocol (
|
||||||
gST->ConsoleOutHandle,
|
gST->ConsoleOutHandle,
|
||||||
@ -731,7 +731,7 @@ BdsSetConsoleMode (
|
|||||||
);
|
);
|
||||||
if (EFI_ERROR (Status)) {
|
if (EFI_ERROR (Status)) {
|
||||||
SimpleTextOut = NULL;
|
SimpleTextOut = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((GraphicsOutput == NULL) || (SimpleTextOut == NULL)) {
|
if ((GraphicsOutput == NULL) || (SimpleTextOut == NULL)) {
|
||||||
return EFI_UNSUPPORTED;
|
return EFI_UNSUPPORTED;
|
||||||
@ -752,12 +752,12 @@ BdsSetConsoleMode (
|
|||||||
NewHorizontalResolution = mBootHorizontalResolution;
|
NewHorizontalResolution = mBootHorizontalResolution;
|
||||||
NewVerticalResolution = mBootVerticalResolution;
|
NewVerticalResolution = mBootVerticalResolution;
|
||||||
NewColumns = mBootTextModeColumn;
|
NewColumns = mBootTextModeColumn;
|
||||||
NewRows = mBootTextModeRow;
|
NewRows = mBootTextModeRow;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (GraphicsOutput != NULL) {
|
if (GraphicsOutput != NULL) {
|
||||||
MaxGopMode = GraphicsOutput->Mode->MaxMode;
|
MaxGopMode = GraphicsOutput->Mode->MaxMode;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (SimpleTextOut != NULL) {
|
if (SimpleTextOut != NULL) {
|
||||||
MaxTextMode = SimpleTextOut->Mode->MaxMode;
|
MaxTextMode = SimpleTextOut->Mode->MaxMode;
|
||||||
@ -861,7 +861,7 @@ BdsSetConsoleMode (
|
|||||||
ASSERT_EFI_ERROR (Status);
|
ASSERT_EFI_ERROR (Status);
|
||||||
Status = PcdSet32S (PcdConOutRow, NewRows);
|
Status = PcdSet32S (PcdConOutRow, NewRows);
|
||||||
ASSERT_EFI_ERROR (Status);
|
ASSERT_EFI_ERROR (Status);
|
||||||
|
|
||||||
//
|
//
|
||||||
// Video mode is changed, so restart graphics console driver and higher level driver.
|
// Video mode is changed, so restart graphics console driver and higher level driver.
|
||||||
// Reconnect graphics console driver and higher level driver.
|
// Reconnect graphics console driver and higher level driver.
|
||||||
@ -894,10 +894,10 @@ BdsSetConsoleMode (
|
|||||||
|
|
||||||
@param ImageHandle The image handle.
|
@param ImageHandle The image handle.
|
||||||
@param SystemTable The system table.
|
@param SystemTable The system table.
|
||||||
|
|
||||||
@retval EFI_SUCCESS Boot from selected boot option, and return success from boot option
|
@retval EFI_SUCCESS Boot from selected boot option, and return success from boot option
|
||||||
@retval EFI_NOT_FOUND User select to enter setup or can not find boot option
|
@retval EFI_NOT_FOUND User select to enter setup or can not find boot option
|
||||||
|
|
||||||
**/
|
**/
|
||||||
EFI_STATUS
|
EFI_STATUS
|
||||||
EFIAPI
|
EFIAPI
|
||||||
@ -907,7 +907,7 @@ BootManagerMenuEntry (
|
|||||||
)
|
)
|
||||||
{
|
{
|
||||||
EFI_BOOT_MANAGER_LOAD_OPTION *BootOption;
|
EFI_BOOT_MANAGER_LOAD_OPTION *BootOption;
|
||||||
UINTN BootOptionCount;
|
UINTN BootOptionCount;
|
||||||
EFI_STATUS Status;
|
EFI_STATUS Status;
|
||||||
BOOT_MENU_POPUP_DATA BootMenuData;
|
BOOT_MENU_POPUP_DATA BootMenuData;
|
||||||
UINTN Index;
|
UINTN Index;
|
||||||
@ -950,7 +950,7 @@ BootManagerMenuEntry (
|
|||||||
|
|
||||||
if (!mModeInitialized) {
|
if (!mModeInitialized) {
|
||||||
//
|
//
|
||||||
// After the console is ready, get current video resolution
|
// After the console is ready, get current video resolution
|
||||||
// and text mode before launching setup at first time.
|
// and text mode before launching setup at first time.
|
||||||
//
|
//
|
||||||
Status = gBS->HandleProtocol (
|
Status = gBS->HandleProtocol (
|
||||||
@ -961,7 +961,7 @@ BootManagerMenuEntry (
|
|||||||
if (EFI_ERROR (Status)) {
|
if (EFI_ERROR (Status)) {
|
||||||
GraphicsOutput = NULL;
|
GraphicsOutput = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
Status = gBS->HandleProtocol (
|
Status = gBS->HandleProtocol (
|
||||||
gST->ConsoleOutHandle,
|
gST->ConsoleOutHandle,
|
||||||
&gEfiSimpleTextOutProtocolGuid,
|
&gEfiSimpleTextOutProtocolGuid,
|
||||||
@ -969,7 +969,7 @@ BootManagerMenuEntry (
|
|||||||
);
|
);
|
||||||
if (EFI_ERROR (Status)) {
|
if (EFI_ERROR (Status)) {
|
||||||
SimpleTextOut = NULL;
|
SimpleTextOut = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (GraphicsOutput != NULL) {
|
if (GraphicsOutput != NULL) {
|
||||||
//
|
//
|
||||||
@ -992,14 +992,14 @@ BootManagerMenuEntry (
|
|||||||
|
|
||||||
//
|
//
|
||||||
// Get user defined text mode for setup.
|
// Get user defined text mode for setup.
|
||||||
//
|
//
|
||||||
mSetupHorizontalResolution = PcdGet32 (PcdSetupVideoHorizontalResolution);
|
mSetupHorizontalResolution = PcdGet32 (PcdSetupVideoHorizontalResolution);
|
||||||
mSetupVerticalResolution = PcdGet32 (PcdSetupVideoVerticalResolution);
|
mSetupVerticalResolution = PcdGet32 (PcdSetupVideoVerticalResolution);
|
||||||
mSetupTextModeColumn = PcdGet32 (PcdSetupConOutColumn);
|
mSetupTextModeColumn = PcdGet32 (PcdSetupConOutColumn);
|
||||||
mSetupTextModeRow = PcdGet32 (PcdSetupConOutRow);
|
mSetupTextModeRow = PcdGet32 (PcdSetupConOutRow);
|
||||||
mModeInitialized = TRUE;
|
mModeInitialized = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Set back to conventional setup resolution
|
// Set back to conventional setup resolution
|
||||||
//
|
//
|
||||||
@ -1013,7 +1013,7 @@ BootManagerMenuEntry (
|
|||||||
// According to boot menu data to draw boot popup menu
|
// According to boot menu data to draw boot popup menu
|
||||||
//
|
//
|
||||||
DrawBootPopupMenu (&BootMenuData);
|
DrawBootPopupMenu (&BootMenuData);
|
||||||
|
|
||||||
//
|
//
|
||||||
// check user input to determine want to re-draw or boot from user selected item
|
// check user input to determine want to re-draw or boot from user selected item
|
||||||
//
|
//
|
||||||
@ -1023,18 +1023,18 @@ BootManagerMenuEntry (
|
|||||||
Status = gST->ConIn->ReadKeyStroke (gST->ConIn, &Key);
|
Status = gST->ConIn->ReadKeyStroke (gST->ConIn, &Key);
|
||||||
if (!EFI_ERROR (Status)) {
|
if (!EFI_ERROR (Status)) {
|
||||||
switch (Key.UnicodeChar) {
|
switch (Key.UnicodeChar) {
|
||||||
|
|
||||||
case CHAR_NULL:
|
case CHAR_NULL:
|
||||||
switch (Key.ScanCode) {
|
switch (Key.ScanCode) {
|
||||||
|
|
||||||
case SCAN_UP:
|
case SCAN_UP:
|
||||||
SelectItem = BootMenuData.SelectItem == 0 ? BootMenuData.ItemCount - 1 : BootMenuData.SelectItem - 1;
|
SelectItem = BootMenuData.SelectItem == 0 ? BootMenuData.ItemCount - 1 : BootMenuData.SelectItem - 1;
|
||||||
BootMenuSelectItem (SelectItem, &BootMenuData);
|
BootMenuSelectItem (SelectItem, &BootMenuData);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SCAN_DOWN:
|
case SCAN_DOWN:
|
||||||
SelectItem = BootMenuData.SelectItem == BootMenuData.ItemCount - 1 ? 0 : BootMenuData.SelectItem + 1;
|
SelectItem = BootMenuData.SelectItem == BootMenuData.ItemCount - 1 ? 0 : BootMenuData.SelectItem + 1;
|
||||||
BootMenuSelectItem (SelectItem, &BootMenuData);
|
BootMenuSelectItem (SelectItem, &BootMenuData);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SCAN_ESC:
|
case SCAN_ESC:
|
||||||
@ -1045,12 +1045,12 @@ BootManagerMenuEntry (
|
|||||||
//
|
//
|
||||||
BdsSetConsoleMode (FALSE);
|
BdsSetConsoleMode (FALSE);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case CHAR_CARRIAGE_RETURN:
|
case CHAR_CARRIAGE_RETURN:
|
||||||
gST->ConOut->ClearScreen (gST->ConOut);
|
gST->ConOut->ClearScreen (gST->ConOut);
|
||||||
//
|
//
|
||||||
@ -1064,7 +1064,7 @@ BootManagerMenuEntry (
|
|||||||
BdsSetConsoleMode (TRUE);
|
BdsSetConsoleMode (TRUE);
|
||||||
DrawBootPopupMenu (&BootMenuData);
|
DrawBootPopupMenu (&BootMenuData);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -1076,5 +1076,5 @@ BootManagerMenuEntry (
|
|||||||
HiiRemovePackages (gStringPackHandle);
|
HiiRemovePackages (gStringPackHandle);
|
||||||
|
|
||||||
return Status;
|
return Status;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/** @file
|
/** @file
|
||||||
FrontPage routines to handle the callbacks and browser calls
|
FrontPage routines to handle the callbacks and browser calls
|
||||||
|
|
||||||
Copyright (c) 2004 - 2015, Intel Corporation. All rights reserved.<BR>
|
Copyright (c) 2004 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||||
This program and the accompanying materials
|
This program and the accompanying materials
|
||||||
are licensed and made available under the terms and conditions of the BSD License
|
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
|
which accompanies this distribution. The full text of the license may be found at
|
||||||
@ -37,24 +37,24 @@ typedef struct _BOOT_MENU_SCREEN {
|
|||||||
UINTN StartRow;
|
UINTN StartRow;
|
||||||
UINTN Width;
|
UINTN Width;
|
||||||
UINTN Height;
|
UINTN Height;
|
||||||
} BOOT_MENU_SCREEN;
|
} BOOT_MENU_SCREEN;
|
||||||
|
|
||||||
typedef struct _BOOT_MENU_SCROLL_BAR_CONTROL {
|
typedef struct _BOOT_MENU_SCROLL_BAR_CONTROL {
|
||||||
BOOLEAN HasScrollBar;
|
BOOLEAN HasScrollBar;
|
||||||
UINTN ItemCountPerScreen;
|
UINTN ItemCountPerScreen;
|
||||||
UINTN FirstItem;
|
UINTN FirstItem;
|
||||||
UINTN LastItem;
|
UINTN LastItem;
|
||||||
} BOOT_MENU_SCROLL_BAR_CONTROL;
|
} BOOT_MENU_SCROLL_BAR_CONTROL;
|
||||||
|
|
||||||
typedef struct _BOOT_MENU_POPUP_DATA {
|
typedef struct _BOOT_MENU_POPUP_DATA {
|
||||||
EFI_STRING_ID TitleToken[TITLE_TOKEN_COUNT]; // Title string ID
|
EFI_STRING_ID TitleToken[TITLE_TOKEN_COUNT]; // Title string ID
|
||||||
UINTN ItemCount; // Selectable item count
|
UINTN ItemCount; // Selectable item count
|
||||||
EFI_STRING_ID *PtrTokens; // All of selectable items string ID
|
EFI_STRING_ID *PtrTokens; // All of selectable items string ID
|
||||||
EFI_STRING_ID HelpToken[HELP_TOKEN_COUNT]; // All of help string ID
|
EFI_STRING_ID HelpToken[HELP_TOKEN_COUNT]; // All of help string ID
|
||||||
UINTN SelectItem; // Current select item
|
UINTN SelectItem; // Current select item
|
||||||
BOOT_MENU_SCREEN MenuScreen; // Boot menu screen information
|
BOOT_MENU_SCREEN MenuScreen; // Boot menu screen information
|
||||||
BOOT_MENU_SCROLL_BAR_CONTROL ScrollBarControl; // Boot menu scroll bar inoformation
|
BOOT_MENU_SCROLL_BAR_CONTROL ScrollBarControl; // Boot menu scroll bar inoformation
|
||||||
} BOOT_MENU_POPUP_DATA;
|
} BOOT_MENU_POPUP_DATA;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -3,16 +3,16 @@
|
|||||||
#
|
#
|
||||||
# The application pops up a menu showing all the boot options referenced by
|
# The application pops up a menu showing all the boot options referenced by
|
||||||
# BootOrder NV variable and user can choose to boot from one of them.
|
# BootOrder NV variable and user can choose to boot from one of them.
|
||||||
#
|
#
|
||||||
# Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.<BR>
|
# Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||||
# This program and the accompanying materials
|
# This program and the accompanying materials
|
||||||
# are licensed and made available under the terms and conditions of the BSD License
|
# 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
|
# which accompanies this distribution. The full text of the license may be found at
|
||||||
# http://opensource.org/licenses/bsd-license.php
|
# http://opensource.org/licenses/bsd-license.php
|
||||||
#
|
#
|
||||||
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||||
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||||
#
|
#
|
||||||
##
|
##
|
||||||
|
|
||||||
[Defines]
|
[Defines]
|
||||||
@ -21,7 +21,7 @@
|
|||||||
MODULE_UNI_FILE = BootManagerMenuApp.uni
|
MODULE_UNI_FILE = BootManagerMenuApp.uni
|
||||||
FILE_GUID = EEC25BDC-67F2-4D95-B1D5-F81B2039D11D
|
FILE_GUID = EEC25BDC-67F2-4D95-B1D5-F81B2039D11D
|
||||||
MODULE_TYPE = UEFI_APPLICATION
|
MODULE_TYPE = UEFI_APPLICATION
|
||||||
VERSION_STRING = 1.0
|
VERSION_STRING = 1.0
|
||||||
ENTRY_POINT = BootManagerMenuEntry
|
ENTRY_POINT = BootManagerMenuEntry
|
||||||
|
|
||||||
#
|
#
|
||||||
@ -47,7 +47,7 @@
|
|||||||
UefiBootServicesTableLib
|
UefiBootServicesTableLib
|
||||||
UefiApplicationEntryPoint
|
UefiApplicationEntryPoint
|
||||||
UefiBootManagerLib
|
UefiBootManagerLib
|
||||||
|
|
||||||
[Guids]
|
[Guids]
|
||||||
|
|
||||||
[Protocols]
|
[Protocols]
|
||||||
|
@ -4,13 +4,13 @@
|
|||||||
// The application pops up a menu showing all the boot options referenced by
|
// The application pops up a menu showing all the boot options referenced by
|
||||||
// BootOrder NV variable and user can choose to boot from one of them.
|
// BootOrder NV variable and user can choose to boot from one of them.
|
||||||
//
|
//
|
||||||
// Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>
|
// Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||||
//
|
//
|
||||||
// This program and the accompanying materials
|
// This program and the accompanying materials
|
||||||
// are licensed and made available under the terms and conditions of the BSD License
|
// 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
|
// which accompanies this distribution. The full text of the license may be found at
|
||||||
// http://opensource.org/licenses/bsd-license.php.
|
// http://opensource.org/licenses/bsd-license.php.
|
||||||
//
|
//
|
||||||
// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||||
// WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
// WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||||
//
|
//
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
// The application pops up a menu showing all the boot options referenced by
|
// The application pops up a menu showing all the boot options referenced by
|
||||||
// BootOrder NV variable and user can choose to boot from one of them.
|
// BootOrder NV variable and user can choose to boot from one of them.
|
||||||
//
|
//
|
||||||
// Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>
|
// Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||||
//
|
//
|
||||||
// This program and the accompanying materials
|
// This program and the accompanying materials
|
||||||
// are licensed and made available under the terms and conditions of the BSD License
|
// are licensed and made available under the terms and conditions of the BSD License
|
||||||
@ -16,8 +16,8 @@
|
|||||||
//
|
//
|
||||||
// **/
|
// **/
|
||||||
|
|
||||||
#string STR_PROPERTIES_MODULE_NAME
|
#string STR_PROPERTIES_MODULE_NAME
|
||||||
#language en-US
|
#language en-US
|
||||||
"Boot Manager Menu Application"
|
"Boot Manager Menu Application"
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// /** @file
|
// /** @file
|
||||||
// String definitions for BootManagerMenuApp.
|
// String definitions for BootManagerMenuApp.
|
||||||
//
|
//
|
||||||
// Copyright (c) 2004 - 2011, Intel Corporation. All rights reserved.<BR>
|
// Copyright (c) 2004 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||||
// This program and the accompanying materials
|
// This program and the accompanying materials
|
||||||
// are licensed and made available under the terms and conditions of the BSD License
|
// 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
|
// which accompanies this distribution. The full text of the license may be found at
|
||||||
|
@ -1,15 +1,15 @@
|
|||||||
/** @file
|
/** @file
|
||||||
This sample application bases on HelloWorld PCD setting
|
This sample application bases on HelloWorld PCD setting
|
||||||
to print "UEFI Hello World!" to the UEFI Console.
|
to print "UEFI Hello World!" to the UEFI Console.
|
||||||
|
|
||||||
Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>
|
Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||||
This program and the accompanying materials
|
This program and the accompanying materials
|
||||||
are licensed and made available under the terms and conditions of the BSD License
|
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
|
which accompanies this distribution. The full text of the license may be found at
|
||||||
http://opensource.org/licenses/bsd-license.php
|
http://opensource.org/licenses/bsd-license.php
|
||||||
|
|
||||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||||
|
|
||||||
**/
|
**/
|
||||||
|
|
||||||
@ -32,9 +32,9 @@ GLOBAL_REMOVE_IF_UNREFERENCED EFI_STRING_ID mStringHelpTokenId = STRING_TOKEN (S
|
|||||||
The user Entry Point for Application. The user code starts with this function
|
The user Entry Point for Application. The user code starts with this function
|
||||||
as the real entry point for the application.
|
as the real entry point for the application.
|
||||||
|
|
||||||
@param[in] ImageHandle The firmware allocated handle for the EFI image.
|
@param[in] ImageHandle The firmware allocated handle for the EFI image.
|
||||||
@param[in] SystemTable A pointer to the EFI System Table.
|
@param[in] SystemTable A pointer to the EFI System Table.
|
||||||
|
|
||||||
@retval EFI_SUCCESS The entry point is executed successfully.
|
@retval EFI_SUCCESS The entry point is executed successfully.
|
||||||
@retval other Some error occurs when executing this entry point.
|
@retval other Some error occurs when executing this entry point.
|
||||||
|
|
||||||
@ -46,19 +46,19 @@ UefiMain (
|
|||||||
IN EFI_SYSTEM_TABLE *SystemTable
|
IN EFI_SYSTEM_TABLE *SystemTable
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
UINT32 Index;
|
UINT32 Index;
|
||||||
|
|
||||||
Index = 0;
|
Index = 0;
|
||||||
|
|
||||||
//
|
//
|
||||||
// Three PCD type (FeatureFlag, UINT32 and String) are used as the sample.
|
// Three PCD type (FeatureFlag, UINT32 and String) are used as the sample.
|
||||||
//
|
//
|
||||||
if (FeaturePcdGet (PcdHelloWorldPrintEnable)) {
|
if (FeaturePcdGet (PcdHelloWorldPrintEnable)) {
|
||||||
for (Index = 0; Index < PcdGet32 (PcdHelloWorldPrintTimes); Index ++) {
|
for (Index = 0; Index < PcdGet32 (PcdHelloWorldPrintTimes); Index ++) {
|
||||||
//
|
//
|
||||||
// Use UefiLib Print API to print string to UEFI console
|
// Use UefiLib Print API to print string to UEFI console
|
||||||
//
|
//
|
||||||
Print ((CHAR16*)PcdGetPtr (PcdHelloWorldPrintString));
|
Print ((CHAR16*)PcdGetPtr (PcdHelloWorldPrintString));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,10 +3,10 @@
|
|||||||
//
|
//
|
||||||
// This is a sample shell application that will print "UEFI Hello World!" to the
|
// This is a sample shell application that will print "UEFI Hello World!" to the
|
||||||
// UEFI Console based on PCD setting.
|
// UEFI Console based on PCD setting.
|
||||||
//
|
//
|
||||||
// It demos how to use EDKII PCD mechanism to make code more flexible.
|
// It demos how to use EDKII PCD mechanism to make code more flexible.
|
||||||
//
|
//
|
||||||
// Copyright (c) 2008 - 2014, Intel Corporation. All rights reserved.<BR>
|
// Copyright (c) 2008 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||||
//
|
//
|
||||||
// This program and the accompanying materials
|
// This program and the accompanying materials
|
||||||
// are licensed and made available under the terms and conditions of the BSD License
|
// are licensed and made available under the terms and conditions of the BSD License
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// /** @file
|
// /** @file
|
||||||
// HelloWorld Localized Strings and Content
|
// HelloWorld Localized Strings and Content
|
||||||
//
|
//
|
||||||
// Copyright (c) 2013 - 2014, Intel Corporation. All rights reserved.<BR>
|
// Copyright (c) 2013 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||||
//
|
//
|
||||||
// This program and the accompanying materials
|
// This program and the accompanying materials
|
||||||
// are licensed and made available under the terms and conditions of the BSD License
|
// are licensed and made available under the terms and conditions of the BSD License
|
||||||
@ -12,8 +12,8 @@
|
|||||||
//
|
//
|
||||||
// **/
|
// **/
|
||||||
|
|
||||||
#string STR_PROPERTIES_MODULE_NAME
|
#string STR_PROPERTIES_MODULE_NAME
|
||||||
#language en-US
|
#language en-US
|
||||||
"Hello World Application"
|
"Hello World Application"
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// /** @file
|
// /** @file
|
||||||
// MemoryProfileInfo Localized Strings and Content
|
// MemoryProfileInfo Localized Strings and Content
|
||||||
//
|
//
|
||||||
// Copyright (c) 2014, Intel Corporation. All rights reserved.<BR>
|
// Copyright (c) 2014 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||||
//
|
//
|
||||||
// This program and the accompanying materials
|
// This program and the accompanying materials
|
||||||
// are licensed and made available under the terms and conditions of the BSD License
|
// are licensed and made available under the terms and conditions of the BSD License
|
||||||
@ -12,8 +12,8 @@
|
|||||||
//
|
//
|
||||||
// **/
|
// **/
|
||||||
|
|
||||||
#string STR_PROPERTIES_MODULE_NAME
|
#string STR_PROPERTIES_MODULE_NAME
|
||||||
#language en-US
|
#language en-US
|
||||||
"Memory Profile Information Application"
|
"Memory Profile Information Application"
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,15 +1,15 @@
|
|||||||
## @file
|
## @file
|
||||||
# UiApp module is driver for BDS phase.
|
# UiApp module is driver for BDS phase.
|
||||||
#
|
#
|
||||||
# Copyright (c) 2011 - 2016, Intel Corporation. All rights reserved.<BR>
|
# Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||||
# This program and the accompanying materials
|
# This program and the accompanying materials
|
||||||
# are licensed and made available under the terms and conditions of the BSD License
|
# 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
|
# which accompanies this distribution. The full text of the license may be found at
|
||||||
# http://opensource.org/licenses/bsd-license.php
|
# http://opensource.org/licenses/bsd-license.php
|
||||||
#
|
#
|
||||||
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||||
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||||
#
|
#
|
||||||
##
|
##
|
||||||
|
|
||||||
[Defines]
|
[Defines]
|
||||||
@ -60,7 +60,7 @@
|
|||||||
PcdLib
|
PcdLib
|
||||||
UefiHiiServicesLib
|
UefiHiiServicesLib
|
||||||
UefiBootManagerLib
|
UefiBootManagerLib
|
||||||
|
|
||||||
[Guids]
|
[Guids]
|
||||||
gEfiIfrTianoGuid ## CONSUMES ## GUID (Extended IFR Guid Opcode)
|
gEfiIfrTianoGuid ## CONSUMES ## GUID (Extended IFR Guid Opcode)
|
||||||
gEfiIfrFrontPageGuid ## CONSUMES ## GUID
|
gEfiIfrFrontPageGuid ## CONSUMES ## GUID
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// /** @file
|
// /** @file
|
||||||
// VariableInfo Localized Strings and Content
|
// VariableInfo Localized Strings and Content
|
||||||
//
|
//
|
||||||
// Copyright (c) 2013 - 2014, Intel Corporation. All rights reserved.<BR>
|
// Copyright (c) 2013 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||||
//
|
//
|
||||||
// This program and the accompanying materials
|
// This program and the accompanying materials
|
||||||
// are licensed and made available under the terms and conditions of the BSD License
|
// are licensed and made available under the terms and conditions of the BSD License
|
||||||
@ -12,8 +12,8 @@
|
|||||||
//
|
//
|
||||||
// **/
|
// **/
|
||||||
|
|
||||||
#string STR_PROPERTIES_MODULE_NAME
|
#string STR_PROPERTIES_MODULE_NAME
|
||||||
#language en-US
|
#language en-US
|
||||||
"Variable Information Application"
|
"Variable Information Application"
|
||||||
|
|
||||||
|
|
||||||
|
@ -820,7 +820,7 @@ AhciPioTransfer (
|
|||||||
Offset = EFI_AHCI_PORT_START + Port * EFI_AHCI_PORT_REG_WIDTH + EFI_AHCI_PORT_TFD;
|
Offset = EFI_AHCI_PORT_START + Port * EFI_AHCI_PORT_REG_WIDTH + EFI_AHCI_PORT_TFD;
|
||||||
PortTfd = AhciReadReg (PciIo, (UINT32) Offset);
|
PortTfd = AhciReadReg (PciIo, (UINT32) Offset);
|
||||||
//
|
//
|
||||||
// PxTFD will be updated if there is a D2H or SetupFIS received.
|
// PxTFD will be updated if there is a D2H or SetupFIS received.
|
||||||
//
|
//
|
||||||
if ((PortTfd & EFI_AHCI_PORT_TFD_ERR) != 0) {
|
if ((PortTfd & EFI_AHCI_PORT_TFD_ERR) != 0) {
|
||||||
Status = EFI_DEVICE_ERROR;
|
Status = EFI_DEVICE_ERROR;
|
||||||
@ -2010,7 +2010,7 @@ AhciCreateTransferDescriptor (
|
|||||||
//
|
//
|
||||||
MaxCommandSlotNumber = (UINT8) (((Capability & 0x1F00) >> 8) + 1);
|
MaxCommandSlotNumber = (UINT8) (((Capability & 0x1F00) >> 8) + 1);
|
||||||
Support64Bit = (BOOLEAN) (((Capability & BIT31) != 0) ? TRUE : FALSE);
|
Support64Bit = (BOOLEAN) (((Capability & BIT31) != 0) ? TRUE : FALSE);
|
||||||
|
|
||||||
PortImplementBitMap = AhciReadReg(PciIo, EFI_AHCI_PI_OFFSET);
|
PortImplementBitMap = AhciReadReg(PciIo, EFI_AHCI_PI_OFFSET);
|
||||||
//
|
//
|
||||||
// Get the highest bit of implemented ports which decides how many bytes are allocated for recived FIS.
|
// Get the highest bit of implemented ports which decides how many bytes are allocated for recived FIS.
|
||||||
|
@ -1,14 +1,14 @@
|
|||||||
/** @file
|
/** @file
|
||||||
Header file for AHCI mode of ATA host controller.
|
Header file for AHCI mode of ATA host controller.
|
||||||
|
|
||||||
Copyright (c) 2010 - 2018, 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
|
|
||||||
http://opensource.org/licenses/bsd-license.php
|
|
||||||
|
|
||||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
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 __ATA_HC_AHCI_MODE_H__
|
#ifndef __ATA_HC_AHCI_MODE_H__
|
||||||
@ -68,7 +68,7 @@ typedef union {
|
|||||||
#define EFI_AHCI_MAX_DATA_PER_PRDT 0x400000
|
#define EFI_AHCI_MAX_DATA_PER_PRDT 0x400000
|
||||||
|
|
||||||
#define EFI_AHCI_FIS_REGISTER_H2D 0x27 //Register FIS - Host to Device
|
#define EFI_AHCI_FIS_REGISTER_H2D 0x27 //Register FIS - Host to Device
|
||||||
#define EFI_AHCI_FIS_REGISTER_H2D_LENGTH 20
|
#define EFI_AHCI_FIS_REGISTER_H2D_LENGTH 20
|
||||||
#define EFI_AHCI_FIS_REGISTER_D2H 0x34 //Register FIS - Device to Host
|
#define EFI_AHCI_FIS_REGISTER_D2H 0x34 //Register FIS - Device to Host
|
||||||
#define EFI_AHCI_FIS_REGISTER_D2H_LENGTH 20
|
#define EFI_AHCI_FIS_REGISTER_D2H_LENGTH 20
|
||||||
#define EFI_AHCI_FIS_DMA_ACTIVATE 0x39 //DMA Activate FIS - Device to Host
|
#define EFI_AHCI_FIS_DMA_ACTIVATE 0x39 //DMA Activate FIS - Device to Host
|
||||||
@ -213,12 +213,12 @@ typedef struct {
|
|||||||
UINT32 AhciCmdPrdbc; //Physical Region Descriptor Byte Count
|
UINT32 AhciCmdPrdbc; //Physical Region Descriptor Byte Count
|
||||||
UINT32 AhciCmdCtba; //Command Table Descriptor Base Address
|
UINT32 AhciCmdCtba; //Command Table Descriptor Base Address
|
||||||
UINT32 AhciCmdCtbau; //Command Table Descriptor Base Address Upper 32-BITs
|
UINT32 AhciCmdCtbau; //Command Table Descriptor Base Address Upper 32-BITs
|
||||||
UINT32 AhciCmdRsvd1[4];
|
UINT32 AhciCmdRsvd1[4];
|
||||||
} EFI_AHCI_COMMAND_LIST;
|
} EFI_AHCI_COMMAND_LIST;
|
||||||
|
|
||||||
//
|
//
|
||||||
// This is a software constructed FIS.
|
// This is a software constructed FIS.
|
||||||
// For data transfer operations, this is the H2D Register FIS format as
|
// For data transfer operations, this is the H2D Register FIS format as
|
||||||
// specified in the Serial ATA Revision 2.6 specification.
|
// specified in the Serial ATA Revision 2.6 specification.
|
||||||
//
|
//
|
||||||
typedef struct {
|
typedef struct {
|
||||||
@ -257,7 +257,7 @@ typedef struct {
|
|||||||
// Physical Region Descriptor Table includes up to 65535 entries
|
// Physical Region Descriptor Table includes up to 65535 entries
|
||||||
// The entry data structure is listed at the following.
|
// The entry data structure is listed at the following.
|
||||||
// the actual entry number comes from the PRDTL field in the command
|
// the actual entry number comes from the PRDTL field in the command
|
||||||
// list entry for this command slot.
|
// list entry for this command slot.
|
||||||
//
|
//
|
||||||
typedef struct {
|
typedef struct {
|
||||||
UINT32 AhciPrdtDba; //Data Base Address
|
UINT32 AhciPrdtDba; //Data Base Address
|
||||||
@ -285,13 +285,13 @@ typedef struct {
|
|||||||
UINT8 AhciDmaSetupFis[0x1C]; // Dma Setup Fis: offset 0x00
|
UINT8 AhciDmaSetupFis[0x1C]; // Dma Setup Fis: offset 0x00
|
||||||
UINT8 AhciDmaSetupFisRsvd[0x04];
|
UINT8 AhciDmaSetupFisRsvd[0x04];
|
||||||
UINT8 AhciPioSetupFis[0x14]; // Pio Setup Fis: offset 0x20
|
UINT8 AhciPioSetupFis[0x14]; // Pio Setup Fis: offset 0x20
|
||||||
UINT8 AhciPioSetupFisRsvd[0x0C];
|
UINT8 AhciPioSetupFisRsvd[0x0C];
|
||||||
UINT8 AhciD2HRegisterFis[0x14]; // D2H Register Fis: offset 0x40
|
UINT8 AhciD2HRegisterFis[0x14]; // D2H Register Fis: offset 0x40
|
||||||
UINT8 AhciD2HRegisterFisRsvd[0x04];
|
UINT8 AhciD2HRegisterFisRsvd[0x04];
|
||||||
UINT64 AhciSetDeviceBitsFis; // Set Device Bits Fix: offset 0x58
|
UINT64 AhciSetDeviceBitsFis; // Set Device Bits Fix: offset 0x58
|
||||||
UINT8 AhciUnknownFis[0x40]; // Unkonwn Fis: offset 0x60
|
UINT8 AhciUnknownFis[0x40]; // Unkonwn Fis: offset 0x60
|
||||||
UINT8 AhciUnknownFisRsvd[0x60];
|
UINT8 AhciUnknownFisRsvd[0x60];
|
||||||
} EFI_AHCI_RECEIVED_FIS;
|
} EFI_AHCI_RECEIVED_FIS;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
UINT8 Madt : 5;
|
UINT8 Madt : 5;
|
||||||
@ -320,12 +320,12 @@ typedef struct {
|
|||||||
} EFI_AHCI_REGISTERS;
|
} EFI_AHCI_REGISTERS;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
This function is used to send out ATAPI commands conforms to the Packet Command
|
This function is used to send out ATAPI commands conforms to the Packet Command
|
||||||
with PIO Protocol.
|
with PIO Protocol.
|
||||||
|
|
||||||
@param PciIo The PCI IO protocol instance.
|
@param PciIo The PCI IO protocol instance.
|
||||||
@param AhciRegisters The pointer to the EFI_AHCI_REGISTERS.
|
@param AhciRegisters The pointer to the EFI_AHCI_REGISTERS.
|
||||||
@param Port The number of port.
|
@param Port The number of port.
|
||||||
@param PortMultiplier The number of port multiplier.
|
@param PortMultiplier The number of port multiplier.
|
||||||
@param Packet A pointer to EFI_EXT_SCSI_PASS_THRU_SCSI_REQUEST_PACKET structure.
|
@param Packet A pointer to EFI_EXT_SCSI_PASS_THRU_SCSI_REQUEST_PACKET structure.
|
||||||
|
|
||||||
@ -346,12 +346,12 @@ AhciPacketCommandExecute (
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
Start command for give slot on specific port.
|
Start command for give slot on specific port.
|
||||||
|
|
||||||
@param PciIo The PCI IO protocol instance.
|
@param PciIo The PCI IO protocol instance.
|
||||||
@param Port The number of port.
|
@param Port The number of port.
|
||||||
@param CommandSlot The number of CommandSlot.
|
@param CommandSlot The number of CommandSlot.
|
||||||
@param Timeout The timeout value of start, uses 100ns as a unit.
|
@param Timeout The timeout value of start, uses 100ns as a unit.
|
||||||
|
|
||||||
@retval EFI_DEVICE_ERROR The command start unsuccessfully.
|
@retval EFI_DEVICE_ERROR The command start unsuccessfully.
|
||||||
@retval EFI_TIMEOUT The operation is time out.
|
@retval EFI_TIMEOUT The operation is time out.
|
||||||
@retval EFI_SUCCESS The command start successfully.
|
@retval EFI_SUCCESS The command start successfully.
|
||||||
@ -368,11 +368,11 @@ AhciStartCommand (
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
Stop command running for giving port
|
Stop command running for giving port
|
||||||
|
|
||||||
@param PciIo The PCI IO protocol instance.
|
@param PciIo The PCI IO protocol instance.
|
||||||
@param Port The number of port.
|
@param Port The number of port.
|
||||||
@param Timeout The timeout value of stop, uses 100ns as a unit.
|
@param Timeout The timeout value of stop, uses 100ns as a unit.
|
||||||
|
|
||||||
@retval EFI_DEVICE_ERROR The command stop unsuccessfully.
|
@retval EFI_DEVICE_ERROR The command stop unsuccessfully.
|
||||||
@retval EFI_TIMEOUT The operation is time out.
|
@retval EFI_TIMEOUT The operation is time out.
|
||||||
@retval EFI_SUCCESS The command stop successfully.
|
@retval EFI_SUCCESS The command stop successfully.
|
||||||
|
@ -29,9 +29,9 @@
|
|||||||
#
|
#
|
||||||
# VALID_ARCHITECTURES = IA32 X64 IPF EBC
|
# VALID_ARCHITECTURES = IA32 X64 IPF EBC
|
||||||
#
|
#
|
||||||
# DRIVER_BINDING = gAtaAtapiPassThruDriverBinding
|
# DRIVER_BINDING = gAtaAtapiPassThruDriverBinding
|
||||||
# COMPONENT_NAME = gAtaAtapiPassThruComponentName
|
# COMPONENT_NAME = gAtaAtapiPassThruComponentName
|
||||||
# COMPONENT_NAME2 = gAtaAtapiPassThruComponentName2
|
# COMPONENT_NAME2 = gAtaAtapiPassThruComponentName2
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
|
|
||||||
@ -43,7 +43,7 @@
|
|||||||
IdeMode.c
|
IdeMode.c
|
||||||
IdeMode.h
|
IdeMode.h
|
||||||
ComponentName.c
|
ComponentName.c
|
||||||
|
|
||||||
[Packages]
|
[Packages]
|
||||||
MdePkg/MdePkg.dec
|
MdePkg/MdePkg.dec
|
||||||
MdeModulePkg/MdeModulePkg.dec
|
MdeModulePkg/MdeModulePkg.dec
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// /** @file
|
// /** @file
|
||||||
// AtaAtapiPassThruDxe Localized Strings and Content
|
// AtaAtapiPassThruDxe Localized Strings and Content
|
||||||
//
|
//
|
||||||
// Copyright (c) 2013 - 2014, Intel Corporation. All rights reserved.<BR>
|
// Copyright (c) 2013 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||||
//
|
//
|
||||||
// This program and the accompanying materials
|
// This program and the accompanying materials
|
||||||
// are licensed and made available under the terms and conditions of the BSD License
|
// are licensed and made available under the terms and conditions of the BSD License
|
||||||
@ -12,8 +12,8 @@
|
|||||||
//
|
//
|
||||||
// **/
|
// **/
|
||||||
|
|
||||||
#string STR_PROPERTIES_MODULE_NAME
|
#string STR_PROPERTIES_MODULE_NAME
|
||||||
#language en-US
|
#language en-US
|
||||||
"ATA ATAPI Pass Thru DXE Driver"
|
"ATA ATAPI Pass Thru DXE Driver"
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,21 +1,21 @@
|
|||||||
/** @file
|
/** @file
|
||||||
UEFI Component Name(2) protocol implementation for AtaAtapiPassThru driver.
|
UEFI Component Name(2) protocol implementation for AtaAtapiPassThru driver.
|
||||||
|
|
||||||
Copyright (c) 2010 - 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
|
|
||||||
http://opensource.org/licenses/bsd-license.php
|
|
||||||
|
|
||||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
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 "AtaAtapiPassThru.h"
|
#include "AtaAtapiPassThru.h"
|
||||||
|
|
||||||
//
|
//
|
||||||
// Driver name table
|
// Driver name table
|
||||||
//
|
//
|
||||||
GLOBAL_REMOVE_IF_UNREFERENCED EFI_UNICODE_STRING_TABLE mAtaAtapiPassThruDriverNameTable[] = {
|
GLOBAL_REMOVE_IF_UNREFERENCED EFI_UNICODE_STRING_TABLE mAtaAtapiPassThruDriverNameTable[] = {
|
||||||
{ "eng;en", L"AtaAtapiPassThru Driver" },
|
{ "eng;en", L"AtaAtapiPassThru Driver" },
|
||||||
|
@ -1,14 +1,14 @@
|
|||||||
/** @file
|
/** @file
|
||||||
Header file for IDE mode of ATA host controller.
|
Header file for IDE mode of ATA host controller.
|
||||||
|
|
||||||
Copyright (c) 2010 - 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
|
|
||||||
http://opensource.org/licenses/bsd-license.php
|
|
||||||
|
|
||||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
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 __ATA_HC_IDE_MODE_H__
|
#ifndef __ATA_HC_IDE_MODE_H__
|
||||||
@ -121,7 +121,7 @@ typedef struct {
|
|||||||
#define IDE_SECONDARY_PROGRAMMABLE_INDICATOR BIT3
|
#define IDE_SECONDARY_PROGRAMMABLE_INDICATOR BIT3
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Get IDE i/o port registers' base addresses by mode.
|
Get IDE i/o port registers' base addresses by mode.
|
||||||
|
|
||||||
In 'Compatibility' mode, use fixed addresses.
|
In 'Compatibility' mode, use fixed addresses.
|
||||||
In Native-PCI mode, get base addresses from BARs in the PCI IDE controller's
|
In Native-PCI mode, get base addresses from BARs in the PCI IDE controller's
|
||||||
@ -144,7 +144,7 @@ typedef struct {
|
|||||||
|___________|_______________|_______________|
|
|___________|_______________|_______________|
|
||||||
|
|
||||||
Table 1. Compatibility resource mappings
|
Table 1. Compatibility resource mappings
|
||||||
|
|
||||||
b) In Native-PCI mode, IDE registers are mapped into IO space using the BARs
|
b) In Native-PCI mode, IDE registers are mapped into IO space using the BARs
|
||||||
in IDE controller's PCI Configuration Space, shown in the Table 2 below.
|
in IDE controller's PCI Configuration Space, shown in the Table 2 below.
|
||||||
___________________________________________________
|
___________________________________________________
|
||||||
@ -161,7 +161,7 @@ typedef struct {
|
|||||||
@param[in] PciIo Pointer to the EFI_PCI_IO_PROTOCOL instance
|
@param[in] PciIo Pointer to the EFI_PCI_IO_PROTOCOL instance
|
||||||
@param[in, out] IdeRegisters Pointer to EFI_IDE_REGISTERS which is used to
|
@param[in, out] IdeRegisters Pointer to EFI_IDE_REGISTERS which is used to
|
||||||
store the IDE i/o port registers' base addresses
|
store the IDE i/o port registers' base addresses
|
||||||
|
|
||||||
@retval EFI_UNSUPPORTED Return this value when the BARs is not IO type
|
@retval EFI_UNSUPPORTED Return this value when the BARs is not IO type
|
||||||
@retval EFI_SUCCESS Get the Base address successfully
|
@retval EFI_SUCCESS Get the Base address successfully
|
||||||
@retval Other Read the pci configureation data error
|
@retval Other Read the pci configureation data error
|
||||||
@ -175,7 +175,7 @@ GetIdeRegisterIoAddr (
|
|||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
This function is used to send out ATAPI commands conforms to the Packet Command
|
This function is used to send out ATAPI commands conforms to the Packet Command
|
||||||
with PIO Data In Protocol.
|
with PIO Data In Protocol.
|
||||||
|
|
||||||
@param[in] PciIo Pointer to the EFI_PCI_IO_PROTOCOL instance
|
@param[in] PciIo Pointer to the EFI_PCI_IO_PROTOCOL instance
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// /** @file
|
// /** @file
|
||||||
// AtaBusDxe Localized Strings and Content
|
// AtaBusDxe Localized Strings and Content
|
||||||
//
|
//
|
||||||
// Copyright (c) 2013 - 2014, Intel Corporation. All rights reserved.<BR>
|
// Copyright (c) 2013 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||||
//
|
//
|
||||||
// This program and the accompanying materials
|
// This program and the accompanying materials
|
||||||
// are licensed and made available under the terms and conditions of the BSD License
|
// are licensed and made available under the terms and conditions of the BSD License
|
||||||
@ -12,8 +12,8 @@
|
|||||||
//
|
//
|
||||||
// **/
|
// **/
|
||||||
|
|
||||||
#string STR_PROPERTIES_MODULE_NAME
|
#string STR_PROPERTIES_MODULE_NAME
|
||||||
#language en-US
|
#language en-US
|
||||||
"ATA Bus DXE Driver"
|
"ATA Bus DXE Driver"
|
||||||
|
|
||||||
|
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
for Security Protocol Specific layout. This implementation uses big endian for
|
for Security Protocol Specific layout. This implementation uses big endian for
|
||||||
Cylinder register.
|
Cylinder register.
|
||||||
|
|
||||||
Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.<BR>
|
Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||||
(C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>
|
(C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>
|
||||||
This program and the accompanying materials
|
This program and the accompanying materials
|
||||||
are licensed and made available under the terms and conditions of the BSD License
|
are licensed and made available under the terms and conditions of the BSD License
|
||||||
@ -633,7 +633,7 @@ AtaTerminateNonBlockingTask (
|
|||||||
|
|
||||||
//
|
//
|
||||||
// Aborting operation has been done. From now on, don't need to abort normal operation.
|
// Aborting operation has been done. From now on, don't need to abort normal operation.
|
||||||
//
|
//
|
||||||
OldTpl = gBS->RaiseTPL (TPL_NOTIFY);
|
OldTpl = gBS->RaiseTPL (TPL_NOTIFY);
|
||||||
AtaDevice->Abort = FALSE;
|
AtaDevice->Abort = FALSE;
|
||||||
gBS->RestoreTPL (OldTpl);
|
gBS->RestoreTPL (OldTpl);
|
||||||
|
@ -1,21 +1,21 @@
|
|||||||
/** @file
|
/** @file
|
||||||
UEFI Component Name(2) protocol implementation for ConPlatform driver.
|
UEFI Component Name(2) protocol implementation for ConPlatform driver.
|
||||||
|
|
||||||
Copyright (c) 2009 - 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
|
|
||||||
http://opensource.org/licenses/bsd-license.php
|
|
||||||
|
|
||||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
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 "AtaBus.h"
|
#include "AtaBus.h"
|
||||||
|
|
||||||
//
|
//
|
||||||
// Driver name table
|
// Driver name table
|
||||||
//
|
//
|
||||||
GLOBAL_REMOVE_IF_UNREFERENCED EFI_UNICODE_STRING_TABLE mAtaBusDriverNameTable[] = {
|
GLOBAL_REMOVE_IF_UNREFERENCED EFI_UNICODE_STRING_TABLE mAtaBusDriverNameTable[] = {
|
||||||
{ "eng;en", L"ATA Bus Driver" },
|
{ "eng;en", L"ATA Bus Driver" },
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
/** @file
|
/** @file
|
||||||
This file implements I2C IO Protocol which enables the user to manipulate a single
|
This file implements I2C IO Protocol which enables the user to manipulate a single
|
||||||
I2C device independent of the host controller and I2C design.
|
I2C device independent of the host controller and I2C design.
|
||||||
|
|
||||||
Copyright (c) 2013 - 2015, Intel Corporation. All rights reserved.<BR>
|
Copyright (c) 2013 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||||
This program and the accompanying materials
|
This program and the accompanying materials
|
||||||
are licensed and made available under the terms and conditions of the BSD License
|
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
|
which accompanies this distribution. The full text of the license may be found at
|
||||||
@ -76,7 +76,7 @@ VENDOR_DEVICE_PATH gVendorDevicePathTemplate = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
//
|
//
|
||||||
// Driver name table
|
// Driver name table
|
||||||
//
|
//
|
||||||
GLOBAL_REMOVE_IF_UNREFERENCED EFI_UNICODE_STRING_TABLE mI2cBusDriverNameTable[] = {
|
GLOBAL_REMOVE_IF_UNREFERENCED EFI_UNICODE_STRING_TABLE mI2cBusDriverNameTable[] = {
|
||||||
{ "eng;en", (CHAR16 *) L"I2C Bus Driver" },
|
{ "eng;en", (CHAR16 *) L"I2C Bus Driver" },
|
||||||
@ -241,12 +241,12 @@ I2cBusComponentNameGetControllerName (
|
|||||||
/**
|
/**
|
||||||
Check if the child of I2C controller has been created.
|
Check if the child of I2C controller has been created.
|
||||||
|
|
||||||
@param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
|
@param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
|
||||||
@param[in] Controller I2C controller handle.
|
@param[in] Controller I2C controller handle.
|
||||||
@param[in] RemainingDevicePath A pointer to the remaining portion of a device path.
|
@param[in] RemainingDevicePath A pointer to the remaining portion of a device path.
|
||||||
@param[in] RemainingHasControllerNode Indicate if RemainingDevicePath contains CONTROLLER_DEVICE_PATH.
|
@param[in] RemainingHasControllerNode Indicate if RemainingDevicePath contains CONTROLLER_DEVICE_PATH.
|
||||||
@param[in] RemainingControllerNumber Controller number in CONTROLLER_DEVICE_PATH.
|
@param[in] RemainingControllerNumber Controller number in CONTROLLER_DEVICE_PATH.
|
||||||
|
|
||||||
@retval EFI_SUCCESS The child of I2C controller is not created.
|
@retval EFI_SUCCESS The child of I2C controller is not created.
|
||||||
@retval Others The child of I2C controller has been created or other errors happen.
|
@retval Others The child of I2C controller has been created or other errors happen.
|
||||||
|
|
||||||
@ -266,11 +266,11 @@ CheckRemainingDevicePath (
|
|||||||
UINTN EntryCount;
|
UINTN EntryCount;
|
||||||
UINTN Index;
|
UINTN Index;
|
||||||
BOOLEAN SystemHasControllerNode;
|
BOOLEAN SystemHasControllerNode;
|
||||||
UINT32 SystemControllerNumber;
|
UINT32 SystemControllerNumber;
|
||||||
|
|
||||||
SystemHasControllerNode = FALSE;
|
SystemHasControllerNode = FALSE;
|
||||||
SystemControllerNumber = 0;
|
SystemControllerNumber = 0;
|
||||||
|
|
||||||
Status = gBS->OpenProtocolInformation (
|
Status = gBS->OpenProtocolInformation (
|
||||||
Controller,
|
Controller,
|
||||||
&gEfiI2cHostProtocolGuid,
|
&gEfiI2cHostProtocolGuid,
|
||||||
@ -280,7 +280,7 @@ CheckRemainingDevicePath (
|
|||||||
if (EFI_ERROR (Status)) {
|
if (EFI_ERROR (Status)) {
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (Index = 0; Index < EntryCount; Index++) {
|
for (Index = 0; Index < EntryCount; Index++) {
|
||||||
if ((OpenInfoBuffer[Index].Attributes & EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER) != 0) {
|
if ((OpenInfoBuffer[Index].Attributes & EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER) != 0) {
|
||||||
Status = gBS->OpenProtocol (
|
Status = gBS->OpenProtocol (
|
||||||
@ -294,7 +294,7 @@ CheckRemainingDevicePath (
|
|||||||
if (!EFI_ERROR (Status)) {
|
if (!EFI_ERROR (Status)) {
|
||||||
//
|
//
|
||||||
// Find vendor device path node and compare
|
// Find vendor device path node and compare
|
||||||
//
|
//
|
||||||
while (!IsDevicePathEnd (SystemDevicePath)) {
|
while (!IsDevicePathEnd (SystemDevicePath)) {
|
||||||
if ((DevicePathType (SystemDevicePath) == HARDWARE_DEVICE_PATH) &&
|
if ((DevicePathType (SystemDevicePath) == HARDWARE_DEVICE_PATH) &&
|
||||||
(DevicePathSubType (SystemDevicePath) == HW_VENDOR_DP)) {
|
(DevicePathSubType (SystemDevicePath) == HW_VENDOR_DP)) {
|
||||||
@ -469,7 +469,7 @@ I2cBusDriverSupported (
|
|||||||
//
|
//
|
||||||
// Determine if the I2C Host Protocol is available
|
// Determine if the I2C Host Protocol is available
|
||||||
//
|
//
|
||||||
Status = gBS->OpenProtocol (
|
Status = gBS->OpenProtocol (
|
||||||
Controller,
|
Controller,
|
||||||
&gEfiI2cHostProtocolGuid,
|
&gEfiI2cHostProtocolGuid,
|
||||||
(VOID **) &I2cHost,
|
(VOID **) &I2cHost,
|
||||||
@ -489,7 +489,7 @@ I2cBusDriverSupported (
|
|||||||
|
|
||||||
|
|
||||||
if (Status == EFI_ALREADY_STARTED) {
|
if (Status == EFI_ALREADY_STARTED) {
|
||||||
if ((RemainingDevicePath == NULL) ||
|
if ((RemainingDevicePath == NULL) ||
|
||||||
((RemainingDevicePath != NULL) && IsDevicePathEnd (RemainingDevicePath))) {
|
((RemainingDevicePath != NULL) && IsDevicePathEnd (RemainingDevicePath))) {
|
||||||
//
|
//
|
||||||
// If RemainingDevicePath is NULL or is the End of Device Path Node, return EFI_SUCCESS.
|
// If RemainingDevicePath is NULL or is the End of Device Path Node, return EFI_SUCCESS.
|
||||||
@ -498,7 +498,7 @@ I2cBusDriverSupported (
|
|||||||
} else {
|
} else {
|
||||||
//
|
//
|
||||||
// Test if the child with the RemainingDevicePath has already been created.
|
// Test if the child with the RemainingDevicePath has already been created.
|
||||||
//
|
//
|
||||||
Status = CheckRemainingDevicePath (
|
Status = CheckRemainingDevicePath (
|
||||||
This,
|
This,
|
||||||
Controller,
|
Controller,
|
||||||
@ -647,7 +647,7 @@ I2cBusDriverStart (
|
|||||||
Status = EFI_OUT_OF_RESOURCES;
|
Status = EFI_OUT_OF_RESOURCES;
|
||||||
goto Error;
|
goto Error;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
+----------------+
|
+----------------+
|
||||||
.->| I2C_BUS_CONTEXT|<----- This file Protocol (gEfiCallerIdGuid) installed on I2C Controller handle
|
.->| I2C_BUS_CONTEXT|<----- This file Protocol (gEfiCallerIdGuid) installed on I2C Controller handle
|
||||||
@ -660,7 +660,7 @@ I2cBusDriverStart (
|
|||||||
| I2C IO Protocol Structure | <----- I2C IO Protocol
|
| I2C IO Protocol Structure | <----- I2C IO Protocol
|
||||||
| |
|
| |
|
||||||
+----------------------------+
|
+----------------------------+
|
||||||
|
|
||||||
*/
|
*/
|
||||||
I2cBusContext->I2cHost = I2cHost;
|
I2cBusContext->I2cHost = I2cHost;
|
||||||
I2cBusContext->I2cEnumerate = I2cEnumerate;
|
I2cBusContext->I2cEnumerate = I2cEnumerate;
|
||||||
@ -672,9 +672,9 @@ I2cBusDriverStart (
|
|||||||
// Parent controller device path used to create children device path
|
// Parent controller device path used to create children device path
|
||||||
//
|
//
|
||||||
I2cBusContext->ParentDevicePath = ParentDevicePath;
|
I2cBusContext->ParentDevicePath = ParentDevicePath;
|
||||||
|
|
||||||
I2cBusContext->DriverBindingHandle = This->DriverBindingHandle;
|
I2cBusContext->DriverBindingHandle = This->DriverBindingHandle;
|
||||||
|
|
||||||
Status = gBS->InstallMultipleProtocolInterfaces (
|
Status = gBS->InstallMultipleProtocolInterfaces (
|
||||||
&Controller,
|
&Controller,
|
||||||
&gEfiCallerIdGuid,
|
&gEfiCallerIdGuid,
|
||||||
@ -698,7 +698,7 @@ Error:
|
|||||||
if (EFI_ERROR (Status)) {
|
if (EFI_ERROR (Status)) {
|
||||||
DEBUG ((EFI_D_ERROR, "I2cBus: Start() function failed, Status = %r\n", Status));
|
DEBUG ((EFI_D_ERROR, "I2cBus: Start() function failed, Status = %r\n", Status));
|
||||||
if (ParentDevicePath != NULL) {
|
if (ParentDevicePath != NULL) {
|
||||||
gBS->CloseProtocol (
|
gBS->CloseProtocol (
|
||||||
Controller,
|
Controller,
|
||||||
&gEfiDevicePathProtocolGuid,
|
&gEfiDevicePathProtocolGuid,
|
||||||
This->DriverBindingHandle,
|
This->DriverBindingHandle,
|
||||||
@ -716,14 +716,14 @@ Error:
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (I2cEnumerate != NULL) {
|
if (I2cEnumerate != NULL) {
|
||||||
gBS->CloseProtocol (
|
gBS->CloseProtocol (
|
||||||
Controller,
|
Controller,
|
||||||
&gEfiI2cEnumerateProtocolGuid,
|
&gEfiI2cEnumerateProtocolGuid,
|
||||||
This->DriverBindingHandle,
|
This->DriverBindingHandle,
|
||||||
Controller
|
Controller
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (I2cBusContext != NULL) {
|
if (I2cBusContext != NULL) {
|
||||||
Status = gBS->UninstallMultipleProtocolInterfaces (
|
Status = gBS->UninstallMultipleProtocolInterfaces (
|
||||||
&Controller,
|
&Controller,
|
||||||
@ -783,7 +783,7 @@ I2cBusDriverStop (
|
|||||||
UINTN Index;
|
UINTN Index;
|
||||||
|
|
||||||
if (NumberOfChildren == 0) {
|
if (NumberOfChildren == 0) {
|
||||||
gBS->CloseProtocol (
|
gBS->CloseProtocol (
|
||||||
Controller,
|
Controller,
|
||||||
&gEfiDevicePathProtocolGuid,
|
&gEfiDevicePathProtocolGuid,
|
||||||
This->DriverBindingHandle,
|
This->DriverBindingHandle,
|
||||||
@ -880,14 +880,14 @@ RegisterI2cDevice (
|
|||||||
// Default DeviceIndex
|
// Default DeviceIndex
|
||||||
//
|
//
|
||||||
RemainingPathDeviceIndex = 0;
|
RemainingPathDeviceIndex = 0;
|
||||||
|
|
||||||
//
|
//
|
||||||
// Determine the controller number in Controller Node Device Path when RemainingDevicePath is not NULL.
|
// Determine the controller number in Controller Node Device Path when RemainingDevicePath is not NULL.
|
||||||
//
|
//
|
||||||
if (RemainingDevicePath != NULL) {
|
if (RemainingDevicePath != NULL) {
|
||||||
//
|
//
|
||||||
// Check if there is a controller node appended after vendor node
|
// Check if there is a controller node appended after vendor node
|
||||||
//
|
//
|
||||||
DevPathNode = NextDevicePathNode (RemainingDevicePath);
|
DevPathNode = NextDevicePathNode (RemainingDevicePath);
|
||||||
if ((DevicePathType (DevPathNode) == HARDWARE_DEVICE_PATH) &&
|
if ((DevicePathType (DevPathNode) == HARDWARE_DEVICE_PATH) &&
|
||||||
(DevicePathSubType(DevPathNode) == HW_CONTROLLER_DP)) {
|
(DevicePathSubType(DevPathNode) == HW_CONTROLLER_DP)) {
|
||||||
@ -965,7 +965,7 @@ RegisterI2cDevice (
|
|||||||
//
|
//
|
||||||
if ((!CompareGuid (&((VENDOR_DEVICE_PATH *)RemainingDevicePath)->Guid, Device->DeviceGuid)) ||
|
if ((!CompareGuid (&((VENDOR_DEVICE_PATH *)RemainingDevicePath)->Guid, Device->DeviceGuid)) ||
|
||||||
(RemainingPathDeviceIndex != Device->DeviceIndex)) {
|
(RemainingPathDeviceIndex != Device->DeviceIndex)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1015,7 +1015,7 @@ RegisterI2cDevice (
|
|||||||
ReleaseI2cDeviceContext (I2cDeviceContext);
|
ReleaseI2cDeviceContext (I2cDeviceContext);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Create the child handle
|
// Create the child handle
|
||||||
//
|
//
|
||||||
@ -1040,7 +1040,7 @@ RegisterI2cDevice (
|
|||||||
// Free resources for this I2C device
|
// Free resources for this I2C device
|
||||||
//
|
//
|
||||||
ReleaseI2cDeviceContext (I2cDeviceContext);
|
ReleaseI2cDeviceContext (I2cDeviceContext);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (RemainingDevicePath != NULL) {
|
if (RemainingDevicePath != NULL) {
|
||||||
@ -1074,7 +1074,7 @@ RegisterI2cDevice (
|
|||||||
|
|
||||||
The upper layer driver writer provides the following to the platform
|
The upper layer driver writer provides the following to the platform
|
||||||
vendor:
|
vendor:
|
||||||
|
|
||||||
1. Vendor specific GUID for the I2C part
|
1. Vendor specific GUID for the I2C part
|
||||||
2. Guidance on proper construction of the slave address array when the
|
2. Guidance on proper construction of the slave address array when the
|
||||||
I2C device uses more than one slave address. The I2C bus protocol
|
I2C device uses more than one slave address. The I2C bus protocol
|
||||||
@ -1192,7 +1192,7 @@ ReleaseI2cDeviceContext (
|
|||||||
if (I2cDeviceContext == NULL) {
|
if (I2cDeviceContext == NULL) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (I2cDeviceContext->DevicePath != NULL) {
|
if (I2cDeviceContext->DevicePath != NULL) {
|
||||||
FreePool (I2cDeviceContext->DevicePath);
|
FreePool (I2cDeviceContext->DevicePath);
|
||||||
}
|
}
|
||||||
@ -1282,12 +1282,12 @@ UnRegisterI2cDevice (
|
|||||||
);
|
);
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Free resources for this I2C device
|
// Free resources for this I2C device
|
||||||
//
|
//
|
||||||
ReleaseI2cDeviceContext (I2cDeviceContext);
|
ReleaseI2cDeviceContext (I2cDeviceContext);
|
||||||
|
|
||||||
return EFI_SUCCESS;
|
return EFI_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1310,12 +1310,12 @@ I2cBusDevicePathAppend (
|
|||||||
)
|
)
|
||||||
{
|
{
|
||||||
EFI_DEVICE_PATH_PROTOCOL *PreviousDevicePath;
|
EFI_DEVICE_PATH_PROTOCOL *PreviousDevicePath;
|
||||||
|
|
||||||
PreviousDevicePath = NULL;
|
PreviousDevicePath = NULL;
|
||||||
|
|
||||||
//
|
//
|
||||||
// Build vendor device path
|
// Build vendor device path
|
||||||
//
|
//
|
||||||
CopyMem (&gVendorDevicePathTemplate.Guid, I2cDeviceContext->I2cDevice->DeviceGuid, sizeof (EFI_GUID));
|
CopyMem (&gVendorDevicePathTemplate.Guid, I2cDeviceContext->I2cDevice->DeviceGuid, sizeof (EFI_GUID));
|
||||||
I2cDeviceContext->DevicePath = AppendDevicePathNode (
|
I2cDeviceContext->DevicePath = AppendDevicePathNode (
|
||||||
I2cDeviceContext->I2cBusContext->ParentDevicePath,
|
I2cDeviceContext->I2cBusContext->ParentDevicePath,
|
||||||
@ -1325,13 +1325,13 @@ I2cBusDevicePathAppend (
|
|||||||
if (I2cDeviceContext->DevicePath == NULL) {
|
if (I2cDeviceContext->DevicePath == NULL) {
|
||||||
return EFI_OUT_OF_RESOURCES;
|
return EFI_OUT_OF_RESOURCES;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((BuildControllerNode) && (I2cDeviceContext->DevicePath != NULL)) {
|
if ((BuildControllerNode) && (I2cDeviceContext->DevicePath != NULL)) {
|
||||||
//
|
//
|
||||||
// Build the final I2C device path with controller node
|
// Build the final I2C device path with controller node
|
||||||
//
|
//
|
||||||
PreviousDevicePath = I2cDeviceContext->DevicePath;
|
PreviousDevicePath = I2cDeviceContext->DevicePath;
|
||||||
gControllerDevicePathTemplate.ControllerNumber = I2cDeviceContext->I2cDevice->DeviceIndex;
|
gControllerDevicePathTemplate.ControllerNumber = I2cDeviceContext->I2cDevice->DeviceIndex;
|
||||||
I2cDeviceContext->DevicePath = AppendDevicePathNode (
|
I2cDeviceContext->DevicePath = AppendDevicePathNode (
|
||||||
I2cDeviceContext->DevicePath,
|
I2cDeviceContext->DevicePath,
|
||||||
(EFI_DEVICE_PATH_PROTOCOL *) &gControllerDevicePathTemplate
|
(EFI_DEVICE_PATH_PROTOCOL *) &gControllerDevicePathTemplate
|
||||||
@ -1379,7 +1379,7 @@ InitializeI2cBus(
|
|||||||
);
|
);
|
||||||
ASSERT_EFI_ERROR (Status);
|
ASSERT_EFI_ERROR (Status);
|
||||||
|
|
||||||
|
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// /** @file
|
// /** @file
|
||||||
// I2cBusDxe Localized Strings and Content
|
// I2cBusDxe Localized Strings and Content
|
||||||
//
|
//
|
||||||
// Copyright (c) 2014, Intel Corporation. All rights reserved.<BR>
|
// Copyright (c) 2014 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||||
//
|
//
|
||||||
// This program and the accompanying materials
|
// This program and the accompanying materials
|
||||||
// are licensed and made available under the terms and conditions of the BSD License
|
// are licensed and made available under the terms and conditions of the BSD License
|
||||||
@ -12,8 +12,8 @@
|
|||||||
//
|
//
|
||||||
// **/
|
// **/
|
||||||
|
|
||||||
#string STR_PROPERTIES_MODULE_NAME
|
#string STR_PROPERTIES_MODULE_NAME
|
||||||
#language en-US
|
#language en-US
|
||||||
"I2C Bus DXE Driver"
|
"I2C Bus DXE Driver"
|
||||||
|
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
This file defines common data structures, macro definitions and some module
|
This file defines common data structures, macro definitions and some module
|
||||||
internal function header files.
|
internal function header files.
|
||||||
|
|
||||||
Copyright (c) 2013, Intel Corporation. All rights reserved.<BR>
|
Copyright (c) 2013 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||||
This program and the accompanying materials
|
This program and the accompanying materials
|
||||||
are licensed and made available under the terms and conditions of the BSD License
|
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
|
which accompanies this distribution. The full text of the license may be found at
|
||||||
@ -53,7 +53,7 @@ typedef struct {
|
|||||||
EFI_I2C_HOST_PROTOCOL *I2cHost;
|
EFI_I2C_HOST_PROTOCOL *I2cHost;
|
||||||
EFI_HANDLE Controller;
|
EFI_HANDLE Controller;
|
||||||
EFI_DEVICE_PATH_PROTOCOL *ParentDevicePath;
|
EFI_DEVICE_PATH_PROTOCOL *ParentDevicePath;
|
||||||
EFI_HANDLE DriverBindingHandle;
|
EFI_HANDLE DriverBindingHandle;
|
||||||
} I2C_BUS_CONTEXT;
|
} I2C_BUS_CONTEXT;
|
||||||
|
|
||||||
//
|
//
|
||||||
@ -102,7 +102,7 @@ typedef struct {
|
|||||||
// Signature
|
// Signature
|
||||||
//
|
//
|
||||||
UINT32 Signature;
|
UINT32 Signature;
|
||||||
|
|
||||||
//
|
//
|
||||||
// Next request in the pending request list
|
// Next request in the pending request list
|
||||||
//
|
//
|
||||||
@ -218,7 +218,7 @@ extern EFI_DRIVER_BINDING_PROTOCOL gI2cHostDriverBinding;
|
|||||||
@param[in] RemainingDevicePath A pointer to the remaining portion of a device path.
|
@param[in] RemainingDevicePath A pointer to the remaining portion of a device path.
|
||||||
|
|
||||||
@retval EFI_SUCCESS Driver API properly initialized
|
@retval EFI_SUCCESS Driver API properly initialized
|
||||||
|
|
||||||
**/
|
**/
|
||||||
EFI_STATUS
|
EFI_STATUS
|
||||||
RegisterI2cDevice (
|
RegisterI2cDevice (
|
||||||
@ -285,7 +285,7 @@ I2cBusDevicePathAppend (
|
|||||||
|
|
||||||
The upper layer driver writer provides the following to the platform
|
The upper layer driver writer provides the following to the platform
|
||||||
vendor:
|
vendor:
|
||||||
|
|
||||||
1. Vendor specific GUID for the I2C part
|
1. Vendor specific GUID for the I2C part
|
||||||
2. Guidance on proper construction of the slave address array when the
|
2. Guidance on proper construction of the slave address array when the
|
||||||
I2C device uses more than one slave address. The I2C bus protocol
|
I2C device uses more than one slave address. The I2C bus protocol
|
||||||
@ -524,7 +524,7 @@ I2cBusComponentNameGetDriverName (
|
|||||||
IN CHAR8 *Language,
|
IN CHAR8 *Language,
|
||||||
OUT CHAR16 **DriverName
|
OUT CHAR16 **DriverName
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Retrieves a Unicode string that is the user readable name of the controller
|
Retrieves a Unicode string that is the user readable name of the controller
|
||||||
that is being managed by a driver.
|
that is being managed by a driver.
|
||||||
@ -789,7 +789,7 @@ I2cHostDriverStart (
|
|||||||
IN EFI_HANDLE Controller,
|
IN EFI_HANDLE Controller,
|
||||||
IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
|
IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Stops a device controller or a bus controller.
|
Stops a device controller or a bus controller.
|
||||||
|
|
||||||
@ -871,7 +871,7 @@ I2cHostComponentNameGetDriverName (
|
|||||||
IN CHAR8 *Language,
|
IN CHAR8 *Language,
|
||||||
OUT CHAR16 **DriverName
|
OUT CHAR16 **DriverName
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Retrieves a Unicode string that is the user readable name of the controller
|
Retrieves a Unicode string that is the user readable name of the controller
|
||||||
that is being managed by a driver.
|
that is being managed by a driver.
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// /** @file
|
// /** @file
|
||||||
// I2cDxe Localized Strings and Content
|
// I2cDxe Localized Strings and Content
|
||||||
//
|
//
|
||||||
// Copyright (c) 2014, Intel Corporation. All rights reserved.<BR>
|
// Copyright (c) 2014 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||||
//
|
//
|
||||||
// This program and the accompanying materials
|
// This program and the accompanying materials
|
||||||
// are licensed and made available under the terms and conditions of the BSD License
|
// are licensed and made available under the terms and conditions of the BSD License
|
||||||
@ -12,8 +12,8 @@
|
|||||||
//
|
//
|
||||||
// **/
|
// **/
|
||||||
|
|
||||||
#string STR_PROPERTIES_MODULE_NAME
|
#string STR_PROPERTIES_MODULE_NAME
|
||||||
#language en-US
|
#language en-US
|
||||||
"I2C DXE Driver"
|
"I2C DXE Driver"
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
/** @file
|
/** @file
|
||||||
This file implements I2C Host Protocol which provides callers with the ability to
|
This file implements I2C Host Protocol which provides callers with the ability to
|
||||||
do I/O transactions to all of the devices on the I2C bus.
|
do I/O transactions to all of the devices on the I2C bus.
|
||||||
|
|
||||||
Copyright (c) 2014, Hewlett-Packard Development Company, L.P.<BR>
|
Copyright (c) 2014, Hewlett-Packard Development Company, L.P.<BR>
|
||||||
Copyright (c) 2013 - 2015, Intel Corporation. All rights reserved.<BR>
|
Copyright (c) 2013 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||||
This program and the accompanying materials
|
This program and the accompanying materials
|
||||||
are licensed and made available under the terms and conditions of the BSD License
|
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
|
which accompanies this distribution. The full text of the license may be found at
|
||||||
@ -26,7 +26,7 @@ EFI_DRIVER_BINDING_PROTOCOL gI2cHostDriverBinding = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
//
|
//
|
||||||
// Driver name table
|
// Driver name table
|
||||||
//
|
//
|
||||||
GLOBAL_REMOVE_IF_UNREFERENCED EFI_UNICODE_STRING_TABLE mI2cHostDriverNameTable[] = {
|
GLOBAL_REMOVE_IF_UNREFERENCED EFI_UNICODE_STRING_TABLE mI2cHostDriverNameTable[] = {
|
||||||
{ "eng;en", L"I2c Host Driver" },
|
{ "eng;en", L"I2c Host Driver" },
|
||||||
@ -356,7 +356,7 @@ I2cHostDriverStart (
|
|||||||
//
|
//
|
||||||
// Locate I2C Master Protocol
|
// Locate I2C Master Protocol
|
||||||
//
|
//
|
||||||
Status = gBS->OpenProtocol (
|
Status = gBS->OpenProtocol (
|
||||||
Controller,
|
Controller,
|
||||||
&gEfiI2cMasterProtocolGuid,
|
&gEfiI2cMasterProtocolGuid,
|
||||||
(VOID **)&I2cMaster,
|
(VOID **)&I2cMaster,
|
||||||
@ -425,7 +425,7 @@ I2cHostDriverStart (
|
|||||||
if (EFI_ERROR (Status)) {
|
if (EFI_ERROR (Status)) {
|
||||||
DEBUG ((EFI_D_ERROR, "I2cHost: create bus available event error, Status = %r\n", Status));
|
DEBUG ((EFI_D_ERROR, "I2cHost: create bus available event error, Status = %r\n", Status));
|
||||||
goto Exit;
|
goto Exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Build the I2C host protocol for the current I2C controller
|
// Build the I2C host protocol for the current I2C controller
|
||||||
@ -451,9 +451,9 @@ Exit:
|
|||||||
&gEfiI2cBusConfigurationManagementProtocolGuid,
|
&gEfiI2cBusConfigurationManagementProtocolGuid,
|
||||||
This->DriverBindingHandle,
|
This->DriverBindingHandle,
|
||||||
Controller
|
Controller
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((I2cHostContext != NULL) && (I2cHostContext->I2cEvent != NULL)) {
|
if ((I2cHostContext != NULL) && (I2cHostContext->I2cEvent != NULL)) {
|
||||||
gBS->CloseEvent (I2cHostContext->I2cEvent);
|
gBS->CloseEvent (I2cHostContext->I2cEvent);
|
||||||
I2cHostContext->I2cEvent = NULL;
|
I2cHostContext->I2cEvent = NULL;
|
||||||
@ -513,7 +513,7 @@ I2cHostDriverStop (
|
|||||||
IN EFI_HANDLE *ChildHandleBuffer
|
IN EFI_HANDLE *ChildHandleBuffer
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
EFI_STATUS Status;
|
EFI_STATUS Status;
|
||||||
I2C_HOST_CONTEXT *I2cHostContext;
|
I2C_HOST_CONTEXT *I2cHostContext;
|
||||||
EFI_I2C_HOST_PROTOCOL *I2cHost;
|
EFI_I2C_HOST_PROTOCOL *I2cHost;
|
||||||
EFI_TPL TplPrevious;
|
EFI_TPL TplPrevious;
|
||||||
@ -543,14 +543,14 @@ I2cHostDriverStop (
|
|||||||
// Raise TPL for critical section
|
// Raise TPL for critical section
|
||||||
//
|
//
|
||||||
TplPrevious = gBS->RaiseTPL (TPL_I2C_SYNC);
|
TplPrevious = gBS->RaiseTPL (TPL_I2C_SYNC);
|
||||||
|
|
||||||
//
|
//
|
||||||
// If there is pending request or pending bus configuration, do not stop
|
// If there is pending request or pending bus configuration, do not stop
|
||||||
//
|
//
|
||||||
Status = EFI_DEVICE_ERROR;
|
Status = EFI_DEVICE_ERROR;
|
||||||
if (( !I2cHostContext->I2cBusConfigurationManagementPending )
|
if (( !I2cHostContext->I2cBusConfigurationManagementPending )
|
||||||
&& IsListEmpty (&I2cHostContext->RequestList)) {
|
&& IsListEmpty (&I2cHostContext->RequestList)) {
|
||||||
|
|
||||||
//
|
//
|
||||||
// Remove the I2C host protocol
|
// Remove the I2C host protocol
|
||||||
//
|
//
|
||||||
@ -561,7 +561,7 @@ I2cHostDriverStop (
|
|||||||
NULL
|
NULL
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Leave critical section
|
// Leave critical section
|
||||||
//
|
//
|
||||||
@ -581,12 +581,12 @@ I2cHostDriverStop (
|
|||||||
gBS->CloseEvent (I2cHostContext->I2cBusConfigurationEvent);
|
gBS->CloseEvent (I2cHostContext->I2cBusConfigurationEvent);
|
||||||
I2cHostContext->I2cBusConfigurationEvent = NULL;
|
I2cHostContext->I2cBusConfigurationEvent = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (I2cHostContext->I2cEvent != NULL) {
|
if (I2cHostContext->I2cEvent != NULL) {
|
||||||
gBS->CloseEvent (I2cHostContext->I2cEvent);
|
gBS->CloseEvent (I2cHostContext->I2cEvent);
|
||||||
I2cHostContext->I2cEvent = NULL;
|
I2cHostContext->I2cEvent = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
FreePool (I2cHostContext);
|
FreePool (I2cHostContext);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -644,7 +644,7 @@ I2cHostI2cBusConfigurationAvailable (
|
|||||||
// Force next operation to enable the I2C bus configuration
|
// Force next operation to enable the I2C bus configuration
|
||||||
//
|
//
|
||||||
I2cHostContext->I2cBusConfiguration = (UINTN) -1;
|
I2cHostContext->I2cBusConfiguration = (UINTN) -1;
|
||||||
|
|
||||||
//
|
//
|
||||||
// Do not continue current I2C request
|
// Do not continue current I2C request
|
||||||
//
|
//
|
||||||
@ -666,7 +666,7 @@ I2cHostI2cBusConfigurationAvailable (
|
|||||||
//
|
//
|
||||||
// Start an I2C operation on the host, the status is returned by I2cHostContext->Status
|
// Start an I2C operation on the host, the status is returned by I2cHostContext->Status
|
||||||
//
|
//
|
||||||
Status = I2cMaster->StartRequest (
|
Status = I2cMaster->StartRequest (
|
||||||
I2cMaster,
|
I2cMaster,
|
||||||
I2cRequest->SlaveAddress,
|
I2cRequest->SlaveAddress,
|
||||||
I2cRequest->RequestPacket,
|
I2cRequest->RequestPacket,
|
||||||
@ -734,7 +734,7 @@ I2cHostRequestComplete (
|
|||||||
if(!IsListEmpty (EntryHeader)) {
|
if(!IsListEmpty (EntryHeader)) {
|
||||||
I2cHostRequestEnable (I2cHostContext);
|
I2cHostRequestEnable (I2cHostContext);
|
||||||
}
|
}
|
||||||
|
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -942,7 +942,7 @@ I2cHostQueueRequest (
|
|||||||
if (RequestPacket == NULL) {
|
if (RequestPacket == NULL) {
|
||||||
return EFI_INVALID_PARAMETER;
|
return EFI_INVALID_PARAMETER;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((SlaveAddress & I2C_ADDRESSING_10_BIT) != 0) {
|
if ((SlaveAddress & I2C_ADDRESSING_10_BIT) != 0) {
|
||||||
//
|
//
|
||||||
// 10-bit address, bits 0-9 are used for 10-bit I2C slave addresses,
|
// 10-bit address, bits 0-9 are used for 10-bit I2C slave addresses,
|
||||||
@ -970,7 +970,7 @@ I2cHostQueueRequest (
|
|||||||
//
|
//
|
||||||
// For synchronous transaction, register an event used to wait for finishing synchronous transaction
|
// For synchronous transaction, register an event used to wait for finishing synchronous transaction
|
||||||
//
|
//
|
||||||
Status = gBS->CreateEvent (
|
Status = gBS->CreateEvent (
|
||||||
0,
|
0,
|
||||||
TPL_I2C_SYNC,
|
TPL_I2C_SYNC,
|
||||||
NULL,
|
NULL,
|
||||||
@ -981,7 +981,7 @@ I2cHostQueueRequest (
|
|||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// TPL should be at or below TPL_NOTIFY.
|
// TPL should be at or below TPL_NOTIFY.
|
||||||
// For synchronous requests this routine must be called at or below TPL_CALLBACK.
|
// For synchronous requests this routine must be called at or below TPL_CALLBACK.
|
||||||
@ -1022,9 +1022,9 @@ I2cHostQueueRequest (
|
|||||||
// Synchronize with the other threads
|
// Synchronize with the other threads
|
||||||
//
|
//
|
||||||
gBS->RaiseTPL ( TPL_I2C_SYNC );
|
gBS->RaiseTPL ( TPL_I2C_SYNC );
|
||||||
|
|
||||||
FirstRequest = IsListEmpty (&I2cHostContext->RequestList);
|
FirstRequest = IsListEmpty (&I2cHostContext->RequestList);
|
||||||
|
|
||||||
//
|
//
|
||||||
// Insert new I2C request in the list
|
// Insert new I2C request in the list
|
||||||
//
|
//
|
||||||
@ -1034,7 +1034,7 @@ I2cHostQueueRequest (
|
|||||||
// Release the thread synchronization
|
// Release the thread synchronization
|
||||||
//
|
//
|
||||||
gBS->RestoreTPL (TplPrevious);
|
gBS->RestoreTPL (TplPrevious);
|
||||||
|
|
||||||
if (FirstRequest) {
|
if (FirstRequest) {
|
||||||
//
|
//
|
||||||
// Start the first I2C request, then the subsequent of I2C request will continue
|
// Start the first I2C request, then the subsequent of I2C request will continue
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// /** @file
|
// /** @file
|
||||||
// I2cHostDxe Localized Strings and Content
|
// I2cHostDxe Localized Strings and Content
|
||||||
//
|
//
|
||||||
// Copyright (c) 2014, Intel Corporation. All rights reserved.<BR>
|
// Copyright (c) 2014 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||||
//
|
//
|
||||||
// This program and the accompanying materials
|
// This program and the accompanying materials
|
||||||
// are licensed and made available under the terms and conditions of the BSD License
|
// are licensed and made available under the terms and conditions of the BSD License
|
||||||
@ -12,8 +12,8 @@
|
|||||||
//
|
//
|
||||||
// **/
|
// **/
|
||||||
|
|
||||||
#string STR_PROPERTIES_MODULE_NAME
|
#string STR_PROPERTIES_MODULE_NAME
|
||||||
#language en-US
|
#language en-US
|
||||||
"I2C Host DXE Driver"
|
"I2C Host DXE Driver"
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,14 +1,14 @@
|
|||||||
/** @file
|
/** @file
|
||||||
UEFI Component Name(2) protocol implementation for IsaBusDxe driver.
|
UEFI Component Name(2) protocol implementation for IsaBusDxe driver.
|
||||||
|
|
||||||
Copyright (c) 2015, 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
|
|
||||||
http://opensource.org/licenses/bsd-license.php
|
|
||||||
|
|
||||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
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.
|
||||||
|
|
||||||
**/
|
**/
|
||||||
|
|
||||||
@ -16,7 +16,7 @@
|
|||||||
#include <Library/UefiLib.h>
|
#include <Library/UefiLib.h>
|
||||||
|
|
||||||
//
|
//
|
||||||
// Driver name table
|
// Driver name table
|
||||||
//
|
//
|
||||||
GLOBAL_REMOVE_IF_UNREFERENCED EFI_UNICODE_STRING_TABLE mIsaBusDriverNameTable[] = {
|
GLOBAL_REMOVE_IF_UNREFERENCED EFI_UNICODE_STRING_TABLE mIsaBusDriverNameTable[] = {
|
||||||
{ "eng;en", L"PI ISA BUS Driver" },
|
{ "eng;en", L"PI ISA BUS Driver" },
|
||||||
|
@ -1,14 +1,14 @@
|
|||||||
/** @file
|
/** @file
|
||||||
UEFI Component Name(2) protocol implementation for IsaBusDxe driver.
|
UEFI Component Name(2) protocol implementation for IsaBusDxe driver.
|
||||||
|
|
||||||
Copyright (c) 2015, 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
|
|
||||||
http://opensource.org/licenses/bsd-license.php
|
|
||||||
|
|
||||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
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.
|
||||||
|
|
||||||
**/
|
**/
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
Controller and installs the ISA Host Controller Service Binding protocol
|
Controller and installs the ISA Host Controller Service Binding protocol
|
||||||
on the ISA Host Controller's handle.
|
on the ISA Host Controller's handle.
|
||||||
|
|
||||||
Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.<BR>
|
Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||||
This program and the accompanying materials
|
This program and the accompanying materials
|
||||||
are licensed and made available under the terms and conditions of the BSD License
|
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
|
which accompanies this distribution. The full text of the license may be found at
|
||||||
@ -19,19 +19,19 @@
|
|||||||
#include "ComponentName.h"
|
#include "ComponentName.h"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Tests to see if this driver supports a given controller. If a child device is provided,
|
Tests to see if this driver supports a given controller. If a child device is provided,
|
||||||
it further tests to see if this driver supports creating a handle for the specified child device.
|
it further tests to see if this driver supports creating a handle for the specified child device.
|
||||||
|
|
||||||
@param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
|
@param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
|
||||||
@param[in] ControllerHandle The handle of the controller to test. This handle
|
@param[in] ControllerHandle The handle of the controller to test. This handle
|
||||||
must support a protocol interface that supplies
|
must support a protocol interface that supplies
|
||||||
an I/O abstraction to the driver.
|
an I/O abstraction to the driver.
|
||||||
@param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This
|
@param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This
|
||||||
parameter is ignored by device drivers, and is optional for bus
|
parameter is ignored by device drivers, and is optional for bus
|
||||||
drivers. For bus drivers, if this parameter is not NULL, then
|
drivers. For bus drivers, if this parameter is not NULL, then
|
||||||
the bus driver must determine if the bus controller specified
|
the bus driver must determine if the bus controller specified
|
||||||
by ControllerHandle and the child controller specified
|
by ControllerHandle and the child controller specified
|
||||||
by RemainingDevicePath are both supported by this
|
by RemainingDevicePath are both supported by this
|
||||||
bus driver.
|
bus driver.
|
||||||
|
|
||||||
@retval EFI_SUCCESS The device specified by ControllerHandle and
|
@retval EFI_SUCCESS The device specified by ControllerHandle and
|
||||||
@ -105,14 +105,14 @@ ISA_BUS_CHILD_PRIVATE_DATA mIsaBusChildPrivateTemplate = {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
Creates a child handle and installs a protocol.
|
Creates a child handle and installs a protocol.
|
||||||
|
|
||||||
The CreateChild() function installs a protocol on ChildHandle.
|
The CreateChild() function installs a protocol on ChildHandle.
|
||||||
If ChildHandle is a pointer to NULL, then a new handle is created and returned in ChildHandle.
|
If ChildHandle is a pointer to NULL, then a new handle is created and returned in ChildHandle.
|
||||||
If ChildHandle is not a pointer to NULL, then the protocol installs on the existing ChildHandle.
|
If ChildHandle is not a pointer to NULL, then the protocol installs on the existing ChildHandle.
|
||||||
|
|
||||||
@param This Pointer to the EFI_SERVICE_BINDING_PROTOCOL instance.
|
@param This Pointer to the EFI_SERVICE_BINDING_PROTOCOL instance.
|
||||||
@param ChildHandle Pointer to the handle of the child to create. If it is NULL,
|
@param ChildHandle Pointer to the handle of the child to create. If it is NULL,
|
||||||
then a new handle is created. If it is a pointer to an existing UEFI handle,
|
then a new handle is created. If it is a pointer to an existing UEFI handle,
|
||||||
then the protocol is added to the existing UEFI handle.
|
then the protocol is added to the existing UEFI handle.
|
||||||
|
|
||||||
@retval EFI_SUCCES The protocol was added to ChildHandle.
|
@retval EFI_SUCCES The protocol was added to ChildHandle.
|
||||||
@ -164,9 +164,9 @@ IsaBusCreateChild (
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
Destroys a child handle with a protocol installed on it.
|
Destroys a child handle with a protocol installed on it.
|
||||||
|
|
||||||
The DestroyChild() function does the opposite of CreateChild(). It removes a protocol
|
The DestroyChild() function does the opposite of CreateChild(). It removes a protocol
|
||||||
that was installed by CreateChild() from ChildHandle. If the removed protocol is the
|
that was installed by CreateChild() from ChildHandle. If the removed protocol is the
|
||||||
last protocol on ChildHandle, then ChildHandle is destroyed.
|
last protocol on ChildHandle, then ChildHandle is destroyed.
|
||||||
|
|
||||||
@param This Pointer to the EFI_SERVICE_BINDING_PROTOCOL instance.
|
@param This Pointer to the EFI_SERVICE_BINDING_PROTOCOL instance.
|
||||||
@ -260,18 +260,18 @@ ISA_BUS_PRIVATE_DATA mIsaBusPrivateTemplate = {
|
|||||||
Starts a device controller or a bus controller.
|
Starts a device controller or a bus controller.
|
||||||
|
|
||||||
@param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
|
@param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
|
||||||
@param[in] ControllerHandle The handle of the controller to start. This handle
|
@param[in] ControllerHandle The handle of the controller to start. This handle
|
||||||
must support a protocol interface that supplies
|
must support a protocol interface that supplies
|
||||||
an I/O abstraction to the driver.
|
an I/O abstraction to the driver.
|
||||||
@param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This
|
@param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This
|
||||||
parameter is ignored by device drivers, and is optional for bus
|
parameter is ignored by device drivers, and is optional for bus
|
||||||
drivers. For a bus driver, if this parameter is NULL, then handles
|
drivers. For a bus driver, if this parameter is NULL, then handles
|
||||||
for all the children of Controller are created by this driver.
|
for all the children of Controller are created by this driver.
|
||||||
If this parameter is not NULL and the first Device Path Node is
|
If this parameter is not NULL and the first Device Path Node is
|
||||||
not the End of Device Path Node, then only the handle for the
|
not the End of Device Path Node, then only the handle for the
|
||||||
child device specified by the first Device Path Node of
|
child device specified by the first Device Path Node of
|
||||||
RemainingDevicePath is created by this driver.
|
RemainingDevicePath is created by this driver.
|
||||||
If the first Device Path Node of RemainingDevicePath is
|
If the first Device Path Node of RemainingDevicePath is
|
||||||
the End of Device Path Node, no child handle is created by this
|
the End of Device Path Node, no child handle is created by this
|
||||||
driver.
|
driver.
|
||||||
|
|
||||||
@ -340,13 +340,13 @@ IsaBusDriverBindingStart (
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
Stops a device controller or a bus controller.
|
Stops a device controller or a bus controller.
|
||||||
|
|
||||||
@param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
|
@param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
|
||||||
@param[in] ControllerHandle A handle to the device being stopped. The handle must
|
@param[in] ControllerHandle A handle to the device being stopped. The handle must
|
||||||
support a bus specific I/O protocol for the driver
|
support a bus specific I/O protocol for the driver
|
||||||
to use to stop the device.
|
to use to stop the device.
|
||||||
@param[in] NumberOfChildren The number of child device handles in ChildHandleBuffer.
|
@param[in] NumberOfChildren The number of child device handles in ChildHandleBuffer.
|
||||||
@param[in] ChildHandleBuffer An array of child handles to be freed. May be NULL
|
@param[in] ChildHandleBuffer An array of child handles to be freed. May be NULL
|
||||||
if NumberOfChildren is 0.
|
if NumberOfChildren is 0.
|
||||||
|
|
||||||
@retval EFI_SUCCESS The device was stopped.
|
@retval EFI_SUCCESS The device was stopped.
|
||||||
@ -432,10 +432,10 @@ EFI_DRIVER_BINDING_PROTOCOL gIsaBusDriverBinding = {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
Entry point of the IsaBusDxe driver.
|
Entry point of the IsaBusDxe driver.
|
||||||
|
|
||||||
@param[in] ImageHandle The firmware allocated handle for the EFI image.
|
@param[in] ImageHandle The firmware allocated handle for the EFI image.
|
||||||
@param[in] SystemTable A pointer to the EFI System Table.
|
@param[in] SystemTable A pointer to the EFI System Table.
|
||||||
|
|
||||||
@retval EFI_SUCCESS The entry point is executed successfully.
|
@retval EFI_SUCCESS The entry point is executed successfully.
|
||||||
@retval other Some error occurs when executing this entry point.
|
@retval other Some error occurs when executing this entry point.
|
||||||
**/
|
**/
|
||||||
@ -447,7 +447,7 @@ InitializeIsaBus (
|
|||||||
)
|
)
|
||||||
{
|
{
|
||||||
EFI_STATUS Status;
|
EFI_STATUS Status;
|
||||||
|
|
||||||
Status = EfiLibInstallDriverBindingComponentName2 (
|
Status = EfiLibInstallDriverBindingComponentName2 (
|
||||||
ImageHandle,
|
ImageHandle,
|
||||||
SystemTable,
|
SystemTable,
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
# the ISA Host Controller and installs the ISA Host Controller Service Binding
|
# the ISA Host Controller and installs the ISA Host Controller Service Binding
|
||||||
# protocol on the ISA Host Controller's handle.
|
# protocol on the ISA Host Controller's handle.
|
||||||
#
|
#
|
||||||
# Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>
|
# Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||||
#
|
#
|
||||||
# This program and the accompanying materials
|
# This program and the accompanying materials
|
||||||
# are licensed and made available under the terms and conditions of the BSD License
|
# are licensed and made available under the terms and conditions of the BSD License
|
||||||
@ -56,9 +56,9 @@
|
|||||||
DebugLib
|
DebugLib
|
||||||
|
|
||||||
[Protocols]
|
[Protocols]
|
||||||
## CONSUMES
|
## CONSUMES
|
||||||
## PRODUCES
|
## PRODUCES
|
||||||
gEfiIsaHcProtocolGuid
|
gEfiIsaHcProtocolGuid
|
||||||
gEfiIsaHcServiceBindingProtocolGuid ## PRODUCES
|
gEfiIsaHcServiceBindingProtocolGuid ## PRODUCES
|
||||||
|
|
||||||
[UserExtensions.TianoCore."ExtraFiles"]
|
[UserExtensions.TianoCore."ExtraFiles"]
|
||||||
|
@ -718,7 +718,7 @@ KeyNotifyProcessHandler (
|
|||||||
while (TRUE) {
|
while (TRUE) {
|
||||||
//
|
//
|
||||||
// Enter critical section
|
// Enter critical section
|
||||||
//
|
//
|
||||||
OldTpl = gBS->RaiseTPL (TPL_NOTIFY);
|
OldTpl = gBS->RaiseTPL (TPL_NOTIFY);
|
||||||
Status = PopEfikeyBufHead (&ConsoleIn->EfiKeyQueueForNotify, &KeyData);
|
Status = PopEfikeyBufHead (&ConsoleIn->EfiKeyQueueForNotify, &KeyData);
|
||||||
//
|
//
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
/** @file
|
/** @file
|
||||||
UEFI Component Name(2) protocol implementation for EHCI driver.
|
UEFI Component Name(2) protocol implementation for EHCI driver.
|
||||||
|
|
||||||
Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>
|
Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||||
|
|
||||||
This program and the accompanying materials
|
This program and the accompanying materials
|
||||||
are licensed and made available under the terms and conditions
|
are licensed and made available under the terms and conditions
|
||||||
of the BSD License which accompanies this distribution. The
|
of the BSD License which accompanies this distribution. The
|
||||||
|
@ -1,14 +1,14 @@
|
|||||||
/** @file
|
/** @file
|
||||||
The Ehci controller driver.
|
The Ehci controller driver.
|
||||||
|
|
||||||
EhciDxe driver is responsible for managing the behavior of EHCI controller.
|
EhciDxe driver is responsible for managing the behavior of EHCI controller.
|
||||||
It implements the interfaces of monitoring the status of all ports and transferring
|
It implements the interfaces of monitoring the status of all ports and transferring
|
||||||
Control, Bulk, Interrupt and Isochronous requests to Usb2.0 device.
|
Control, Bulk, Interrupt and Isochronous requests to Usb2.0 device.
|
||||||
|
|
||||||
Note that EhciDxe driver is enhanced to guarantee that the EHCI controller get attached
|
Note that EhciDxe driver is enhanced to guarantee that the EHCI controller get attached
|
||||||
to the EHCI controller before a UHCI or OHCI driver attaches to the companion UHCI or
|
to the EHCI controller before a UHCI or OHCI driver attaches to the companion UHCI or
|
||||||
OHCI controller. This way avoids the control transfer on a shared port between EHCI
|
OHCI controller. This way avoids the control transfer on a shared port between EHCI
|
||||||
and companion host controller when UHCI or OHCI gets attached earlier than EHCI and a
|
and companion host controller when UHCI or OHCI gets attached earlier than EHCI and a
|
||||||
USB 2.0 device inserts.
|
USB 2.0 device inserts.
|
||||||
|
|
||||||
Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
|
Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||||
@ -1608,7 +1608,7 @@ EhcCreateUsb2Hc (
|
|||||||
gBS->FreePool (Ehc);
|
gBS->FreePool (Ehc);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
EhcGetUsbDebugPortInfo (Ehc);
|
EhcGetUsbDebugPortInfo (Ehc);
|
||||||
|
|
||||||
//
|
//
|
||||||
@ -1781,12 +1781,12 @@ EhcDriverBindingStart (
|
|||||||
goto CLOSE_PCIIO;
|
goto CLOSE_PCIIO;
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
// Determine if the device is UHCI or OHCI host controller or not. If yes, then find out the
|
// Determine if the device is UHCI or OHCI host controller or not. If yes, then find out the
|
||||||
// companion usb ehci host controller and force EHCI driver get attached to it before
|
// companion usb ehci host controller and force EHCI driver get attached to it before
|
||||||
// UHCI or OHCI driver attaches to UHCI or OHCI host controller.
|
// UHCI or OHCI driver attaches to UHCI or OHCI host controller.
|
||||||
//
|
//
|
||||||
if ((UsbClassCReg.ProgInterface == PCI_IF_UHCI || UsbClassCReg.ProgInterface == PCI_IF_OHCI) &&
|
if ((UsbClassCReg.ProgInterface == PCI_IF_UHCI || UsbClassCReg.ProgInterface == PCI_IF_OHCI) &&
|
||||||
(UsbClassCReg.BaseCode == PCI_CLASS_SERIAL) &&
|
(UsbClassCReg.BaseCode == PCI_CLASS_SERIAL) &&
|
||||||
(UsbClassCReg.SubClassCode == PCI_CLASS_SERIAL_USB)) {
|
(UsbClassCReg.SubClassCode == PCI_CLASS_SERIAL_USB)) {
|
||||||
Status = PciIo->GetLocation (
|
Status = PciIo->GetLocation (
|
||||||
PciIo,
|
PciIo,
|
||||||
@ -1835,7 +1835,7 @@ EhcDriverBindingStart (
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ((UsbClassCReg.ProgInterface == PCI_IF_EHCI) &&
|
if ((UsbClassCReg.ProgInterface == PCI_IF_EHCI) &&
|
||||||
(UsbClassCReg.BaseCode == PCI_CLASS_SERIAL) &&
|
(UsbClassCReg.BaseCode == PCI_CLASS_SERIAL) &&
|
||||||
(UsbClassCReg.SubClassCode == PCI_CLASS_SERIAL_USB)) {
|
(UsbClassCReg.SubClassCode == PCI_CLASS_SERIAL_USB)) {
|
||||||
Status = Instance->GetLocation (
|
Status = Instance->GetLocation (
|
||||||
Instance,
|
Instance,
|
||||||
@ -2098,7 +2098,7 @@ EhcDriverBindingStop (
|
|||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Disable routing of all ports to EHCI controller, so all ports are
|
// Disable routing of all ports to EHCI controller, so all ports are
|
||||||
// routed back to the UHCI or OHCI controller.
|
// routed back to the UHCI or OHCI controller.
|
||||||
//
|
//
|
||||||
EhcClearOpRegBit (Ehc, EHC_CONFIG_FLAG_OFFSET, CONFIGFLAG_ROUTE_EHC);
|
EhcClearOpRegBit (Ehc, EHC_CONFIG_FLAG_OFFSET, CONFIGFLAG_ROUTE_EHC);
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
Provides some data struct used by EHCI controller driver.
|
Provides some data struct used by EHCI controller driver.
|
||||||
|
|
||||||
Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR>
|
Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||||
This program and the accompanying materials
|
This program and the accompanying materials
|
||||||
are licensed and made available under the terms and conditions of the BSD License
|
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
|
which accompanies this distribution. The full text of the license may be found at
|
||||||
@ -133,7 +133,7 @@ struct _USB2_HC_DEV {
|
|||||||
EFI_EVENT PollTimer;
|
EFI_EVENT PollTimer;
|
||||||
|
|
||||||
//
|
//
|
||||||
// ExitBootServicesEvent is used to stop the EHC DMA operation
|
// ExitBootServicesEvent is used to stop the EHC DMA operation
|
||||||
// after exit boot service.
|
// after exit boot service.
|
||||||
//
|
//
|
||||||
EFI_EVENT ExitBootServiceEvent;
|
EFI_EVENT ExitBootServiceEvent;
|
||||||
|
@ -1,14 +1,14 @@
|
|||||||
## @file
|
## @file
|
||||||
# The EhciDxe driver is responsible for managing the behavior of EHCI controller.
|
# The EhciDxe driver is responsible for managing the behavior of EHCI controller.
|
||||||
# It implements the interfaces of monitoring the status of all ports and transferring
|
# It implements the interfaces of monitoring the status of all ports and transferring
|
||||||
# Control, Bulk, Interrupt and Isochronous requests to Usb2.0 device.
|
# Control, Bulk, Interrupt and Isochronous requests to Usb2.0 device.
|
||||||
#
|
#
|
||||||
# Note that EhciDxe driver is enhanced to guarantee that the EHCI controller get attached
|
# Note that EhciDxe driver is enhanced to guarantee that the EHCI controller get attached
|
||||||
# to the EHCI controller before the UHCI driver attaches to the companion UHCI controller.
|
# to the EHCI controller before the UHCI driver attaches to the companion UHCI controller.
|
||||||
# This way avoids the control transfer on a shared port between EHCI and companion host
|
# This way avoids the control transfer on a shared port between EHCI and companion host
|
||||||
# controller when UHCI gets attached earlier than EHCI and a USB 2.0 device inserts.
|
# controller when UHCI gets attached earlier than EHCI and a USB 2.0 device inserts.
|
||||||
#
|
#
|
||||||
# Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>
|
# Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||||
#
|
#
|
||||||
# This program and the accompanying materials
|
# This program and the accompanying materials
|
||||||
# are licensed and made available under the terms and conditions of the BSD License
|
# are licensed and made available under the terms and conditions of the BSD License
|
||||||
@ -36,7 +36,7 @@
|
|||||||
#
|
#
|
||||||
# VALID_ARCHITECTURES = IA32 X64 IPF EBC ARM AARCH64
|
# VALID_ARCHITECTURES = IA32 X64 IPF EBC ARM AARCH64
|
||||||
#
|
#
|
||||||
# DRIVER_BINDING = gEhciDriverBinding
|
# DRIVER_BINDING = gEhciDriverBinding
|
||||||
# COMPONENT_NAME = gEhciComponentName
|
# COMPONENT_NAME = gEhciComponentName
|
||||||
# COMPONENT_NAME2 = gEhciComponentName2
|
# COMPONENT_NAME2 = gEhciComponentName2
|
||||||
#
|
#
|
||||||
|
@ -3,19 +3,19 @@
|
|||||||
//
|
//
|
||||||
// It implements the interfaces of monitoring the status of all ports and transferring
|
// It implements the interfaces of monitoring the status of all ports and transferring
|
||||||
// Control, Bulk, Interrupt and Isochronous requests to Usb2.0 device.
|
// Control, Bulk, Interrupt and Isochronous requests to Usb2.0 device.
|
||||||
//
|
//
|
||||||
// Note that EhciDxe driver is enhanced to guarantee that the EHCI controller get attached
|
// Note that EhciDxe driver is enhanced to guarantee that the EHCI controller get attached
|
||||||
// to the EHCI controller before the UHCI driver attaches to the companion UHCI controller.
|
// to the EHCI controller before the UHCI driver attaches to the companion UHCI controller.
|
||||||
// This way avoids the control transfer on a shared port between EHCI and companion host
|
// This way avoids the control transfer on a shared port between EHCI and companion host
|
||||||
// controller when UHCI gets attached earlier than EHCI and a USB 2.0 device inserts.
|
// controller when UHCI gets attached earlier than EHCI and a USB 2.0 device inserts.
|
||||||
//
|
//
|
||||||
// Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>
|
// Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||||
//
|
//
|
||||||
// This program and the accompanying materials
|
// This program and the accompanying materials
|
||||||
// are licensed and made available under the terms and conditions of the BSD License
|
// 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
|
// which accompanies this distribution. The full text of the license may be found at
|
||||||
// http://opensource.org/licenses/bsd-license.php
|
// http://opensource.org/licenses/bsd-license.php
|
||||||
//
|
//
|
||||||
// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||||
// WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
// WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||||
//
|
//
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// /** @file
|
// /** @file
|
||||||
// EhciDxe Localized Strings and Content
|
// EhciDxe Localized Strings and Content
|
||||||
//
|
//
|
||||||
// Copyright (c) 2013 - 2014, Intel Corporation. All rights reserved.<BR>
|
// Copyright (c) 2013 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||||
//
|
//
|
||||||
// This program and the accompanying materials
|
// This program and the accompanying materials
|
||||||
// are licensed and made available under the terms and conditions of the BSD License
|
// are licensed and made available under the terms and conditions of the BSD License
|
||||||
@ -13,8 +13,8 @@
|
|||||||
//
|
//
|
||||||
// **/
|
// **/
|
||||||
|
|
||||||
#string STR_PROPERTIES_MODULE_NAME
|
#string STR_PROPERTIES_MODULE_NAME
|
||||||
#language en-US
|
#language en-US
|
||||||
"EHCI Controller DXE Driver"
|
"EHCI Controller DXE Driver"
|
||||||
|
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
EHCI transfer scheduling routines.
|
EHCI transfer scheduling routines.
|
||||||
|
|
||||||
Copyright (c) 2007 - 2013, Intel Corporation. All rights reserved.<BR>
|
Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||||
This program and the accompanying materials
|
This program and the accompanying materials
|
||||||
are licensed and made available under the terms and conditions of the BSD License
|
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
|
which accompanies this distribution. The full text of the license may be found at
|
||||||
@ -918,7 +918,7 @@ EhcUpdateAsyncRequest (
|
|||||||
//
|
//
|
||||||
// calculate physical address by offset.
|
// calculate physical address by offset.
|
||||||
//
|
//
|
||||||
PciAddr = (UINTN)Urb->DataPhy + ((UINTN)Qtd->Data - (UINTN)Urb->Data);
|
PciAddr = (UINTN)Urb->DataPhy + ((UINTN)Qtd->Data - (UINTN)Urb->Data);
|
||||||
QtdHw->Page[0] = EHC_LOW_32BIT (PciAddr);
|
QtdHw->Page[0] = EHC_LOW_32BIT (PciAddr);
|
||||||
QtdHw->PageHigh[0]= EHC_HIGH_32BIT (PciAddr);
|
QtdHw->PageHigh[0]= EHC_HIGH_32BIT (PciAddr);
|
||||||
}
|
}
|
||||||
|
@ -2,8 +2,8 @@
|
|||||||
PEIM to produce gPeiUsb2HostControllerPpiGuid based on gPeiUsbControllerPpiGuid
|
PEIM to produce gPeiUsb2HostControllerPpiGuid based on gPeiUsbControllerPpiGuid
|
||||||
which is used to enable recovery function from USB Drivers.
|
which is used to enable recovery function from USB Drivers.
|
||||||
|
|
||||||
Copyright (c) 2010 - 2017, Intel Corporation. All rights reserved.<BR>
|
Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||||
|
|
||||||
This program and the accompanying materials
|
This program and the accompanying materials
|
||||||
are licensed and made available under the terms and conditions
|
are licensed and made available under the terms and conditions
|
||||||
of the BSD License which accompanies this distribution. The
|
of the BSD License which accompanies this distribution. The
|
||||||
@ -39,7 +39,7 @@ USB_PORT_STATE_MAP mUsbPortChangeMap[] = {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
Read Ehc Operation register.
|
Read Ehc Operation register.
|
||||||
|
|
||||||
@param Ehc The EHCI device.
|
@param Ehc The EHCI device.
|
||||||
@param Offset The operation register offset.
|
@param Offset The operation register offset.
|
||||||
|
|
||||||
@ -53,17 +53,17 @@ EhcReadOpReg (
|
|||||||
)
|
)
|
||||||
{
|
{
|
||||||
UINT32 Data;
|
UINT32 Data;
|
||||||
|
|
||||||
ASSERT (Ehc->CapLen != 0);
|
ASSERT (Ehc->CapLen != 0);
|
||||||
|
|
||||||
Data = MmioRead32 (Ehc->UsbHostControllerBaseAddress + Ehc->CapLen + Offset);
|
Data = MmioRead32 (Ehc->UsbHostControllerBaseAddress + Ehc->CapLen + Offset);
|
||||||
|
|
||||||
return Data;
|
return Data;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Write the data to the EHCI operation register.
|
Write the data to the EHCI operation register.
|
||||||
|
|
||||||
@param Ehc The EHCI device.
|
@param Ehc The EHCI device.
|
||||||
@param Offset EHCI operation register offset.
|
@param Offset EHCI operation register offset.
|
||||||
@param Data The data to write.
|
@param Data The data to write.
|
||||||
@ -85,7 +85,7 @@ EhcWriteOpReg (
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
Set one bit of the operational register while keeping other bits.
|
Set one bit of the operational register while keeping other bits.
|
||||||
|
|
||||||
@param Ehc The EHCI device.
|
@param Ehc The EHCI device.
|
||||||
@param Offset The offset of the operational register.
|
@param Offset The offset of the operational register.
|
||||||
@param Bit The bit mask of the register to set.
|
@param Bit The bit mask of the register to set.
|
||||||
@ -107,7 +107,7 @@ EhcSetOpRegBit (
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
Clear one bit of the operational register while keeping other bits.
|
Clear one bit of the operational register while keeping other bits.
|
||||||
|
|
||||||
@param Ehc The EHCI device.
|
@param Ehc The EHCI device.
|
||||||
@param Offset The offset of the operational register.
|
@param Offset The offset of the operational register.
|
||||||
@param Bit The bit mask of the register to clear.
|
@param Bit The bit mask of the register to clear.
|
||||||
@ -128,9 +128,9 @@ EhcClearOpRegBit (
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Wait the operation register's bit as specified by Bit
|
Wait the operation register's bit as specified by Bit
|
||||||
to become set (or clear).
|
to become set (or clear).
|
||||||
|
|
||||||
@param Ehc The EHCI device.
|
@param Ehc The EHCI device.
|
||||||
@param Offset The offset of the operational register.
|
@param Offset The offset of the operational register.
|
||||||
@param Bit The bit mask of the register to wait for.
|
@param Bit The bit mask of the register to wait for.
|
||||||
@ -165,7 +165,7 @@ EhcWaitOpRegBit (
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
Read EHCI capability register.
|
Read EHCI capability register.
|
||||||
|
|
||||||
@param Ehc The EHCI device.
|
@param Ehc The EHCI device.
|
||||||
@param Offset Capability register address.
|
@param Offset Capability register address.
|
||||||
|
|
||||||
@ -179,16 +179,16 @@ EhcReadCapRegister (
|
|||||||
)
|
)
|
||||||
{
|
{
|
||||||
UINT32 Data;
|
UINT32 Data;
|
||||||
|
|
||||||
Data = MmioRead32(Ehc->UsbHostControllerBaseAddress + Offset);
|
Data = MmioRead32(Ehc->UsbHostControllerBaseAddress + Offset);
|
||||||
|
|
||||||
return Data;
|
return Data;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Set door bell and wait it to be ACKed by host controller.
|
Set door bell and wait it to be ACKed by host controller.
|
||||||
This function is used to synchronize with the hardware.
|
This function is used to synchronize with the hardware.
|
||||||
|
|
||||||
@param Ehc The EHCI device.
|
@param Ehc The EHCI device.
|
||||||
@param Timeout The time to wait before abort (in millisecond, ms).
|
@param Timeout The time to wait before abort (in millisecond, ms).
|
||||||
|
|
||||||
@ -223,9 +223,9 @@ EhcSetAndWaitDoorBell (
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Clear all the interrutp status bits, these bits
|
Clear all the interrutp status bits, these bits
|
||||||
are Write-Clean.
|
are Write-Clean.
|
||||||
|
|
||||||
@param Ehc The EHCI device.
|
@param Ehc The EHCI device.
|
||||||
|
|
||||||
**/
|
**/
|
||||||
@ -238,9 +238,9 @@ EhcAckAllInterrupt (
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Enable the periodic schedule then wait EHC to
|
Enable the periodic schedule then wait EHC to
|
||||||
actually enable it.
|
actually enable it.
|
||||||
|
|
||||||
@param Ehc The EHCI device.
|
@param Ehc The EHCI device.
|
||||||
@param Timeout The time to wait before abort (in millisecond, ms).
|
@param Timeout The time to wait before abort (in millisecond, ms).
|
||||||
|
|
||||||
@ -264,7 +264,7 @@ EhcEnablePeriodSchd (
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
Enable asynchrounous schedule.
|
Enable asynchrounous schedule.
|
||||||
|
|
||||||
@param Ehc The EHCI device.
|
@param Ehc The EHCI device.
|
||||||
@param Timeout Time to wait before abort.
|
@param Timeout Time to wait before abort.
|
||||||
|
|
||||||
@ -288,7 +288,7 @@ EhcEnableAsyncSchd (
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
Check whether Ehc is halted.
|
Check whether Ehc is halted.
|
||||||
|
|
||||||
@param Ehc The EHCI device.
|
@param Ehc The EHCI device.
|
||||||
|
|
||||||
@retval TRUE The controller is halted.
|
@retval TRUE The controller is halted.
|
||||||
@ -305,7 +305,7 @@ EhcIsHalt (
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
Check whether system error occurred.
|
Check whether system error occurred.
|
||||||
|
|
||||||
@param Ehc The EHCI device.
|
@param Ehc The EHCI device.
|
||||||
|
|
||||||
@retval TRUE System error happened.
|
@retval TRUE System error happened.
|
||||||
@ -322,7 +322,7 @@ EhcIsSysError (
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
Reset the host controller.
|
Reset the host controller.
|
||||||
|
|
||||||
@param Ehc The EHCI device.
|
@param Ehc The EHCI device.
|
||||||
@param Timeout Time to wait before abort (in millisecond, ms).
|
@param Timeout Time to wait before abort (in millisecond, ms).
|
||||||
|
|
||||||
@ -356,7 +356,7 @@ EhcResetHC (
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
Halt the host controller.
|
Halt the host controller.
|
||||||
|
|
||||||
@param Ehc The EHCI device.
|
@param Ehc The EHCI device.
|
||||||
@param Timeout Time to wait before abort.
|
@param Timeout Time to wait before abort.
|
||||||
|
|
||||||
@ -379,7 +379,7 @@ EhcHaltHC (
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
Set the EHCI to run.
|
Set the EHCI to run.
|
||||||
|
|
||||||
@param Ehc The EHCI device.
|
@param Ehc The EHCI device.
|
||||||
@param Timeout Time to wait before abort.
|
@param Timeout Time to wait before abort.
|
||||||
|
|
||||||
@ -402,7 +402,7 @@ EhcRunHC (
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
Power On All EHCI Ports.
|
Power On All EHCI Ports.
|
||||||
|
|
||||||
@param Ehc The EHCI device.
|
@param Ehc The EHCI device.
|
||||||
|
|
||||||
**/
|
**/
|
||||||
@ -414,7 +414,7 @@ EhcPowerOnAllPorts (
|
|||||||
UINT8 PortNumber;
|
UINT8 PortNumber;
|
||||||
UINT8 Index;
|
UINT8 Index;
|
||||||
UINT32 RegVal;
|
UINT32 RegVal;
|
||||||
|
|
||||||
PortNumber = (UINT8)(Ehc->HcStructParams & HCSP_NPORTS);
|
PortNumber = (UINT8)(Ehc->HcStructParams & HCSP_NPORTS);
|
||||||
for (Index = 0; Index < PortNumber; Index++) {
|
for (Index = 0; Index < PortNumber; Index++) {
|
||||||
//
|
//
|
||||||
@ -429,14 +429,14 @@ EhcPowerOnAllPorts (
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Initialize the HC hardware.
|
Initialize the HC hardware.
|
||||||
EHCI spec lists the five things to do to initialize the hardware.
|
EHCI spec lists the five things to do to initialize the hardware.
|
||||||
1. Program CTRLDSSEGMENT.
|
1. Program CTRLDSSEGMENT.
|
||||||
2. Set USBINTR to enable interrupts.
|
2. Set USBINTR to enable interrupts.
|
||||||
3. Set periodic list base.
|
3. Set periodic list base.
|
||||||
4. Set USBCMD, interrupt threshold, frame list size etc.
|
4. Set USBCMD, interrupt threshold, frame list size etc.
|
||||||
5. Write 1 to CONFIGFLAG to route all ports to EHCI.
|
5. Write 1 to CONFIGFLAG to route all ports to EHCI.
|
||||||
|
|
||||||
@param Ehc The EHCI device.
|
@param Ehc The EHCI device.
|
||||||
|
|
||||||
@retval EFI_SUCCESS The EHCI has come out of halt state.
|
@retval EFI_SUCCESS The EHCI has come out of halt state.
|
||||||
@ -451,7 +451,7 @@ EhcInitHC (
|
|||||||
EFI_STATUS Status;
|
EFI_STATUS Status;
|
||||||
EFI_PHYSICAL_ADDRESS TempPtr;
|
EFI_PHYSICAL_ADDRESS TempPtr;
|
||||||
UINTN PageNumber;
|
UINTN PageNumber;
|
||||||
|
|
||||||
ASSERT (EhcIsHalt (Ehc));
|
ASSERT (EhcIsHalt (Ehc));
|
||||||
|
|
||||||
//
|
//
|
||||||
@ -472,9 +472,9 @@ EhcInitHC (
|
|||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
EhcPowerOnAllPorts (Ehc);
|
EhcPowerOnAllPorts (Ehc);
|
||||||
MicroSecondDelay (EHC_ROOT_PORT_RECOVERY_STALL);
|
MicroSecondDelay (EHC_ROOT_PORT_RECOVERY_STALL);
|
||||||
|
|
||||||
Status = EhcInitSched (Ehc);
|
Status = EhcInitSched (Ehc);
|
||||||
|
|
||||||
if (EFI_ERROR (Status)) {
|
if (EFI_ERROR (Status)) {
|
||||||
@ -523,26 +523,26 @@ EhcInitHC (
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
Submits bulk transfer to a bulk endpoint of a USB device.
|
Submits bulk transfer to a bulk endpoint of a USB device.
|
||||||
|
|
||||||
@param PeiServices The pointer of EFI_PEI_SERVICES.
|
@param PeiServices The pointer of EFI_PEI_SERVICES.
|
||||||
@param This The pointer of PEI_USB2_HOST_CONTROLLER_PPI.
|
@param This The pointer of PEI_USB2_HOST_CONTROLLER_PPI.
|
||||||
@param DeviceAddress Target device address.
|
@param DeviceAddress Target device address.
|
||||||
@param EndPointAddress Endpoint number and its direction in bit 7.
|
@param EndPointAddress Endpoint number and its direction in bit 7.
|
||||||
@param DeviceSpeed Device speed, Low speed device doesn't support
|
@param DeviceSpeed Device speed, Low speed device doesn't support
|
||||||
bulk transfer.
|
bulk transfer.
|
||||||
@param MaximumPacketLength Maximum packet size the endpoint is capable of
|
@param MaximumPacketLength Maximum packet size the endpoint is capable of
|
||||||
sending or receiving.
|
sending or receiving.
|
||||||
@param Data Array of pointers to the buffers of data to transmit
|
@param Data Array of pointers to the buffers of data to transmit
|
||||||
from or receive into.
|
from or receive into.
|
||||||
@param DataLength The lenght of the data buffer.
|
@param DataLength The lenght of the data buffer.
|
||||||
@param DataToggle On input, the initial data toggle for the transfer;
|
@param DataToggle On input, the initial data toggle for the transfer;
|
||||||
On output, it is updated to to next data toggle to use of
|
On output, it is updated to to next data toggle to use of
|
||||||
the subsequent bulk transfer.
|
the subsequent bulk transfer.
|
||||||
@param TimeOut Indicates the maximum time, in millisecond, which the
|
@param TimeOut Indicates the maximum time, in millisecond, which the
|
||||||
transfer is allowed to complete.
|
transfer is allowed to complete.
|
||||||
If Timeout is 0, then the caller must wait for the function
|
If Timeout is 0, then the caller must wait for the function
|
||||||
to be completed until EFI_SUCCESS or EFI_DEVICE_ERROR is returned.
|
to be completed until EFI_SUCCESS or EFI_DEVICE_ERROR is returned.
|
||||||
@param Translator A pointr to the transaction translator data.
|
@param Translator A pointr to the transaction translator data.
|
||||||
@param TransferResult A pointer to the detailed result information of the
|
@param TransferResult A pointer to the detailed result information of the
|
||||||
bulk transfer.
|
bulk transfer.
|
||||||
|
|
||||||
@ -577,7 +577,7 @@ EhcBulkTransfer (
|
|||||||
//
|
//
|
||||||
// Validate the parameters
|
// Validate the parameters
|
||||||
//
|
//
|
||||||
if ((DataLength == NULL) || (*DataLength == 0) ||
|
if ((DataLength == NULL) || (*DataLength == 0) ||
|
||||||
(Data == NULL) || (Data[0] == NULL) || (TransferResult == NULL)) {
|
(Data == NULL) || (Data[0] == NULL) || (TransferResult == NULL)) {
|
||||||
return EFI_INVALID_PARAMETER;
|
return EFI_INVALID_PARAMETER;
|
||||||
}
|
}
|
||||||
@ -652,10 +652,10 @@ ON_EXIT:
|
|||||||
Retrieves the number of root hub ports.
|
Retrieves the number of root hub ports.
|
||||||
|
|
||||||
@param[in] PeiServices The pointer to the PEI Services Table.
|
@param[in] PeiServices The pointer to the PEI Services Table.
|
||||||
@param[in] This The pointer to this instance of the
|
@param[in] This The pointer to this instance of the
|
||||||
PEI_USB2_HOST_CONTROLLER_PPI.
|
PEI_USB2_HOST_CONTROLLER_PPI.
|
||||||
@param[out] PortNumber The pointer to the number of the root hub ports.
|
@param[out] PortNumber The pointer to the number of the root hub ports.
|
||||||
|
|
||||||
@retval EFI_SUCCESS The port number was retrieved successfully.
|
@retval EFI_SUCCESS The port number was retrieved successfully.
|
||||||
@retval EFI_INVALID_PARAMETER PortNumber is NULL.
|
@retval EFI_INVALID_PARAMETER PortNumber is NULL.
|
||||||
|
|
||||||
@ -671,19 +671,19 @@ EhcGetRootHubPortNumber (
|
|||||||
|
|
||||||
PEI_USB2_HC_DEV *EhcDev;
|
PEI_USB2_HC_DEV *EhcDev;
|
||||||
EhcDev = PEI_RECOVERY_USB_EHC_DEV_FROM_EHCI_THIS (This);
|
EhcDev = PEI_RECOVERY_USB_EHC_DEV_FROM_EHCI_THIS (This);
|
||||||
|
|
||||||
if (PortNumber == NULL) {
|
if (PortNumber == NULL) {
|
||||||
return EFI_INVALID_PARAMETER;
|
return EFI_INVALID_PARAMETER;
|
||||||
}
|
}
|
||||||
|
|
||||||
*PortNumber = (UINT8)(EhcDev->HcStructParams & HCSP_NPORTS);
|
*PortNumber = (UINT8)(EhcDev->HcStructParams & HCSP_NPORTS);
|
||||||
return EFI_SUCCESS;
|
return EFI_SUCCESS;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Clears a feature for the specified root hub port.
|
Clears a feature for the specified root hub port.
|
||||||
|
|
||||||
@param PeiServices The pointer of EFI_PEI_SERVICES.
|
@param PeiServices The pointer of EFI_PEI_SERVICES.
|
||||||
@param This The pointer of PEI_USB2_HOST_CONTROLLER_PPI.
|
@param This The pointer of PEI_USB2_HOST_CONTROLLER_PPI.
|
||||||
@param PortNumber Specifies the root hub port whose feature
|
@param PortNumber Specifies the root hub port whose feature
|
||||||
@ -691,7 +691,7 @@ EhcGetRootHubPortNumber (
|
|||||||
@param PortFeature Indicates the feature selector associated with the
|
@param PortFeature Indicates the feature selector associated with the
|
||||||
feature clear request.
|
feature clear request.
|
||||||
|
|
||||||
@retval EFI_SUCCESS The feature specified by PortFeature was cleared
|
@retval EFI_SUCCESS The feature specified by PortFeature was cleared
|
||||||
for the USB root hub port specified by PortNumber.
|
for the USB root hub port specified by PortNumber.
|
||||||
@retval EFI_INVALID_PARAMETER PortNumber is invalid or PortFeature is invalid.
|
@retval EFI_INVALID_PARAMETER PortNumber is invalid or PortFeature is invalid.
|
||||||
|
|
||||||
@ -805,7 +805,7 @@ ON_EXIT:
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
Sets a feature for the specified root hub port.
|
Sets a feature for the specified root hub port.
|
||||||
|
|
||||||
@param PeiServices The pointer of EFI_PEI_SERVICES
|
@param PeiServices The pointer of EFI_PEI_SERVICES
|
||||||
@param This The pointer of PEI_USB2_HOST_CONTROLLER_PPI
|
@param This The pointer of PEI_USB2_HOST_CONTROLLER_PPI
|
||||||
@param PortNumber Root hub port to set.
|
@param PortNumber Root hub port to set.
|
||||||
@ -876,7 +876,7 @@ EhcSetRootHubPortFeature (
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Set one to PortReset bit must also set zero to PortEnable bit
|
// Set one to PortReset bit must also set zero to PortEnable bit
|
||||||
//
|
//
|
||||||
@ -907,10 +907,10 @@ ON_EXIT:
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
Retrieves the current status of a USB root hub port.
|
Retrieves the current status of a USB root hub port.
|
||||||
|
|
||||||
@param PeiServices The pointer of EFI_PEI_SERVICES.
|
@param PeiServices The pointer of EFI_PEI_SERVICES.
|
||||||
@param This The pointer of PEI_USB2_HOST_CONTROLLER_PPI.
|
@param This The pointer of PEI_USB2_HOST_CONTROLLER_PPI.
|
||||||
@param PortNumber The root hub port to retrieve the state from.
|
@param PortNumber The root hub port to retrieve the state from.
|
||||||
@param PortStatus Variable to receive the port state.
|
@param PortStatus Variable to receive the port state.
|
||||||
|
|
||||||
@retval EFI_SUCCESS The status of the USB root hub port specified.
|
@retval EFI_SUCCESS The status of the USB root hub port specified.
|
||||||
@ -957,9 +957,9 @@ EhcGetRootHubPortStatus (
|
|||||||
|
|
||||||
//
|
//
|
||||||
// Identify device speed. If in K state, it is low speed.
|
// Identify device speed. If in K state, it is low speed.
|
||||||
// If the port is enabled after reset, the device is of
|
// If the port is enabled after reset, the device is of
|
||||||
// high speed. The USB bus driver should retrieve the actual
|
// high speed. The USB bus driver should retrieve the actual
|
||||||
// port speed after reset.
|
// port speed after reset.
|
||||||
//
|
//
|
||||||
if (EHC_BIT_IS_SET (State, PORTSC_LINESTATE_K)) {
|
if (EHC_BIT_IS_SET (State, PORTSC_LINESTATE_K)) {
|
||||||
PortStatus->PortStatus |= USB_PORT_STAT_LOW_SPEED;
|
PortStatus->PortStatus |= USB_PORT_STAT_LOW_SPEED;
|
||||||
@ -967,7 +967,7 @@ EhcGetRootHubPortStatus (
|
|||||||
} else if (EHC_BIT_IS_SET (State, PORTSC_ENABLED)) {
|
} else if (EHC_BIT_IS_SET (State, PORTSC_ENABLED)) {
|
||||||
PortStatus->PortStatus |= USB_PORT_STAT_HIGH_SPEED;
|
PortStatus->PortStatus |= USB_PORT_STAT_HIGH_SPEED;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Convert the EHCI port/port change state to UEFI status
|
// Convert the EHCI port/port change state to UEFI status
|
||||||
//
|
//
|
||||||
@ -993,12 +993,12 @@ ON_EXIT:
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
Submits control transfer to a target USB device.
|
Submits control transfer to a target USB device.
|
||||||
|
|
||||||
@param PeiServices The pointer of EFI_PEI_SERVICES.
|
@param PeiServices The pointer of EFI_PEI_SERVICES.
|
||||||
@param This The pointer of PEI_USB2_HOST_CONTROLLER_PPI.
|
@param This The pointer of PEI_USB2_HOST_CONTROLLER_PPI.
|
||||||
@param DeviceAddress The target device address.
|
@param DeviceAddress The target device address.
|
||||||
@param DeviceSpeed Target device speed.
|
@param DeviceSpeed Target device speed.
|
||||||
@param MaximumPacketLength Maximum packet size the default control transfer
|
@param MaximumPacketLength Maximum packet size the default control transfer
|
||||||
endpoint is capable of sending or receiving.
|
endpoint is capable of sending or receiving.
|
||||||
@param Request USB device request to send.
|
@param Request USB device request to send.
|
||||||
@param TransferDirection Specifies the data direction for the data stage.
|
@param TransferDirection Specifies the data direction for the data stage.
|
||||||
@ -1052,12 +1052,12 @@ EhcControlTransfer (
|
|||||||
return EFI_INVALID_PARAMETER;
|
return EFI_INVALID_PARAMETER;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((TransferDirection == EfiUsbNoData) &&
|
if ((TransferDirection == EfiUsbNoData) &&
|
||||||
((Data != NULL) || (*DataLength != 0))) {
|
((Data != NULL) || (*DataLength != 0))) {
|
||||||
return EFI_INVALID_PARAMETER;
|
return EFI_INVALID_PARAMETER;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((TransferDirection != EfiUsbNoData) &&
|
if ((TransferDirection != EfiUsbNoData) &&
|
||||||
((Data == NULL) || (*DataLength == 0))) {
|
((Data == NULL) || (*DataLength == 0))) {
|
||||||
return EFI_INVALID_PARAMETER;
|
return EFI_INVALID_PARAMETER;
|
||||||
}
|
}
|
||||||
@ -1225,7 +1225,7 @@ EhcPeimEntry (
|
|||||||
if (EFI_ERROR (Status)) {
|
if (EFI_ERROR (Status)) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// This PEIM is for UHC type controller.
|
// This PEIM is for UHC type controller.
|
||||||
//
|
//
|
||||||
@ -1303,19 +1303,19 @@ EhcPeimEntry (
|
|||||||
**/
|
**/
|
||||||
EFI_STATUS
|
EFI_STATUS
|
||||||
InitializeUsbHC (
|
InitializeUsbHC (
|
||||||
IN PEI_USB2_HC_DEV *EhcDev
|
IN PEI_USB2_HC_DEV *EhcDev
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
EFI_STATUS Status;
|
EFI_STATUS Status;
|
||||||
|
|
||||||
|
|
||||||
EhcResetHC (EhcDev, EHC_RESET_TIMEOUT);
|
EhcResetHC (EhcDev, EHC_RESET_TIMEOUT);
|
||||||
|
|
||||||
Status = EhcInitHC (EhcDev);
|
Status = EhcInitHC (EhcDev);
|
||||||
|
|
||||||
if (EFI_ERROR (Status)) {
|
if (EFI_ERROR (Status)) {
|
||||||
return EFI_ABORTED;
|
return EFI_ABORTED;
|
||||||
}
|
}
|
||||||
|
|
||||||
return EFI_SUCCESS;
|
return EFI_SUCCESS;
|
||||||
}
|
}
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
/** @file
|
/** @file
|
||||||
Private Header file for Usb Host Controller PEIM
|
Private Header file for Usb Host Controller PEIM
|
||||||
|
|
||||||
Copyright (c) 2010 - 2017, Intel Corporation. All rights reserved.<BR>
|
Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||||
|
|
||||||
This program and the accompanying materials
|
This program and the accompanying materials
|
||||||
are licensed and made available under the terms and conditions
|
are licensed and made available under the terms and conditions
|
||||||
of the BSD License which accompanies this distribution. The
|
of the BSD License which accompanies this distribution. The
|
||||||
@ -118,20 +118,20 @@ struct _PEI_USB2_HC_DEV {
|
|||||||
//
|
//
|
||||||
PEI_EHC_QTD *ShortReadStop;
|
PEI_EHC_QTD *ShortReadStop;
|
||||||
EFI_EVENT PollTimer;
|
EFI_EVENT PollTimer;
|
||||||
|
|
||||||
//
|
//
|
||||||
// Asynchronous(bulk and control) transfer schedule data:
|
// Asynchronous(bulk and control) transfer schedule data:
|
||||||
// ReclaimHead is used as the head of the asynchronous transfer
|
// ReclaimHead is used as the head of the asynchronous transfer
|
||||||
// list. It acts as the reclamation header.
|
// list. It acts as the reclamation header.
|
||||||
//
|
//
|
||||||
PEI_EHC_QH *ReclaimHead;
|
PEI_EHC_QH *ReclaimHead;
|
||||||
|
|
||||||
//
|
//
|
||||||
// Periodic (interrupt) transfer schedule data:
|
// Periodic (interrupt) transfer schedule data:
|
||||||
//
|
//
|
||||||
VOID *PeriodFrame; // Mapped as common buffer
|
VOID *PeriodFrame; // Mapped as common buffer
|
||||||
VOID *PeriodFrameMap;
|
VOID *PeriodFrameMap;
|
||||||
|
|
||||||
PEI_EHC_QH *PeriodOne;
|
PEI_EHC_QH *PeriodOne;
|
||||||
EFI_LIST_ENTRY AsyncIntTransfers;
|
EFI_LIST_ENTRY AsyncIntTransfers;
|
||||||
|
|
||||||
@ -156,14 +156,14 @@ struct _PEI_USB2_HC_DEV {
|
|||||||
**/
|
**/
|
||||||
EFI_STATUS
|
EFI_STATUS
|
||||||
InitializeUsbHC (
|
InitializeUsbHC (
|
||||||
IN PEI_USB2_HC_DEV *EhcDev
|
IN PEI_USB2_HC_DEV *EhcDev
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Initialize the memory management pool for the host controller.
|
Initialize the memory management pool for the host controller.
|
||||||
|
|
||||||
@param Ehc The EHCI device.
|
@param Ehc The EHCI device.
|
||||||
@param Check4G Whether the host controller requires allocated memory
|
@param Check4G Whether the host controller requires allocated memory
|
||||||
from one 4G address space.
|
from one 4G address space.
|
||||||
@param Which4G The 4G memory area each memory allocated should be from.
|
@param Which4G The 4G memory area each memory allocated should be from.
|
||||||
|
|
||||||
@ -178,7 +178,7 @@ UsbHcInitMemPool (
|
|||||||
IN UINT32 Which4G
|
IN UINT32 Which4G
|
||||||
)
|
)
|
||||||
;
|
;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Release the memory management pool.
|
Release the memory management pool.
|
||||||
|
|
||||||
@ -199,7 +199,7 @@ UsbHcFreeMemPool (
|
|||||||
/**
|
/**
|
||||||
Allocate some memory from the host controller's memory pool
|
Allocate some memory from the host controller's memory pool
|
||||||
which can be used to communicate with host controller.
|
which can be used to communicate with host controller.
|
||||||
|
|
||||||
@param Ehc The EHCI device.
|
@param Ehc The EHCI device.
|
||||||
@param Pool The host controller's memory pool.
|
@param Pool The host controller's memory pool.
|
||||||
@param Size Size of the memory to allocate.
|
@param Size Size of the memory to allocate.
|
||||||
|
@ -4,14 +4,14 @@
|
|||||||
# It produces gPeiUsb2HostControllerPpiGuid based on gPeiUsbControllerPpiGuid
|
# It produces gPeiUsb2HostControllerPpiGuid based on gPeiUsbControllerPpiGuid
|
||||||
# which is used to enable recovery function from USB Drivers.
|
# which is used to enable recovery function from USB Drivers.
|
||||||
#
|
#
|
||||||
# Copyright (c) 2010 - 2017, Intel Corporation. All rights reserved.<BR>
|
# Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||||
#
|
#
|
||||||
# This program and the accompanying materials
|
# This program and the accompanying materials
|
||||||
# are licensed and made available under the terms and conditions
|
# are licensed and made available under the terms and conditions
|
||||||
# of the BSD License which accompanies this distribution. The
|
# of the BSD License which accompanies this distribution. The
|
||||||
# full text of the license may be found at
|
# full text of the license may be found at
|
||||||
# http://opensource.org/licenses/bsd-license.php
|
# http://opensource.org/licenses/bsd-license.php
|
||||||
#
|
#
|
||||||
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||||
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||||
#
|
#
|
||||||
|
@ -4,14 +4,14 @@
|
|||||||
// It produces gPeiUsb2HostControllerPpiGuid based on gPeiUsbControllerPpiGuid
|
// It produces gPeiUsb2HostControllerPpiGuid based on gPeiUsbControllerPpiGuid
|
||||||
// which is used to enable recovery function from USB Drivers.
|
// which is used to enable recovery function from USB Drivers.
|
||||||
//
|
//
|
||||||
// Copyright (c) 2010 - 2014, Intel Corporation. All rights reserved.<BR>
|
// Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||||
//
|
//
|
||||||
// This program and the accompanying materials
|
// This program and the accompanying materials
|
||||||
// are licensed and made available under the terms and conditions
|
// are licensed and made available under the terms and conditions
|
||||||
// of the BSD License which accompanies this distribution. The
|
// of the BSD License which accompanies this distribution. The
|
||||||
// full text of the license may be found at
|
// full text of the license may be found at
|
||||||
// http://opensource.org/licenses/bsd-license.php
|
// http://opensource.org/licenses/bsd-license.php
|
||||||
//
|
//
|
||||||
// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||||
// WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
// WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||||
//
|
//
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// /** @file
|
// /** @file
|
||||||
// EhciPei Localized Strings and Content
|
// EhciPei Localized Strings and Content
|
||||||
//
|
//
|
||||||
// Copyright (c) 2013 - 2014, Intel Corporation. All rights reserved.<BR>
|
// Copyright (c) 2013 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||||
//
|
//
|
||||||
// This program and the accompanying materials
|
// This program and the accompanying materials
|
||||||
// are licensed and made available under the terms and conditions
|
// are licensed and made available under the terms and conditions
|
||||||
@ -14,8 +14,8 @@
|
|||||||
//
|
//
|
||||||
// **/
|
// **/
|
||||||
|
|
||||||
#string STR_PROPERTIES_MODULE_NAME
|
#string STR_PROPERTIES_MODULE_NAME
|
||||||
#language en-US
|
#language en-US
|
||||||
"EHCI PEI Module for Recovery"
|
"EHCI PEI Module for Recovery"
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
/** @file
|
/** @file
|
||||||
Private Header file for Usb Host Controller PEIM
|
Private Header file for Usb Host Controller PEIM
|
||||||
|
|
||||||
Copyright (c) 2010, Intel Corporation. All rights reserved.<BR>
|
Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||||
|
|
||||||
This program and the accompanying materials
|
This program and the accompanying materials
|
||||||
are licensed and made available under the terms and conditions
|
are licensed and made available under the terms and conditions
|
||||||
of the BSD License which accompanies this distribution. The
|
of the BSD License which accompanies this distribution. The
|
||||||
@ -94,8 +94,8 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
|||||||
#define EHCI_IS_DATAIN(EndpointAddr) EHC_BIT_IS_SET((EndpointAddr), 0x80)
|
#define EHCI_IS_DATAIN(EndpointAddr) EHC_BIT_IS_SET((EndpointAddr), 0x80)
|
||||||
|
|
||||||
//
|
//
|
||||||
// Structure to map the hardware port states to the
|
// Structure to map the hardware port states to the
|
||||||
// UEFI's port states.
|
// UEFI's port states.
|
||||||
//
|
//
|
||||||
typedef struct {
|
typedef struct {
|
||||||
UINT16 HwState;
|
UINT16 HwState;
|
||||||
@ -116,7 +116,7 @@ typedef struct {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
Read EHCI capability register.
|
Read EHCI capability register.
|
||||||
|
|
||||||
@param Ehc The EHCI device.
|
@param Ehc The EHCI device.
|
||||||
@param Offset Capability register address.
|
@param Offset Capability register address.
|
||||||
|
|
||||||
@ -132,7 +132,7 @@ EhcReadCapRegister (
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
Read Ehc Operation register.
|
Read Ehc Operation register.
|
||||||
|
|
||||||
@param Ehc The EHCI device.
|
@param Ehc The EHCI device.
|
||||||
@param Offset The operation register offset.
|
@param Offset The operation register offset.
|
||||||
|
|
||||||
@ -148,7 +148,7 @@ EhcReadOpReg (
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
Write the data to the EHCI operation register.
|
Write the data to the EHCI operation register.
|
||||||
|
|
||||||
@param Ehc The EHCI device.
|
@param Ehc The EHCI device.
|
||||||
@param Offset EHCI operation register offset.
|
@param Offset EHCI operation register offset.
|
||||||
@param Data The data to write.
|
@param Data The data to write.
|
||||||
@ -164,7 +164,7 @@ EhcWriteOpReg (
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
Stop the legacy USB SMI support.
|
Stop the legacy USB SMI support.
|
||||||
|
|
||||||
@param Ehc The EHCI device.
|
@param Ehc The EHCI device.
|
||||||
|
|
||||||
**/
|
**/
|
||||||
@ -177,7 +177,7 @@ EhcClearLegacySupport (
|
|||||||
/**
|
/**
|
||||||
Set door bell and wait it to be ACKed by host controller.
|
Set door bell and wait it to be ACKed by host controller.
|
||||||
This function is used to synchronize with the hardware.
|
This function is used to synchronize with the hardware.
|
||||||
|
|
||||||
@param Ehc The EHCI device.
|
@param Ehc The EHCI device.
|
||||||
@param Timeout The time to wait before abort (in millisecond, ms).
|
@param Timeout The time to wait before abort (in millisecond, ms).
|
||||||
|
|
||||||
@ -193,9 +193,9 @@ EhcSetAndWaitDoorBell (
|
|||||||
;
|
;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Clear all the interrutp status bits, these bits
|
Clear all the interrutp status bits, these bits
|
||||||
are Write-Clean.
|
are Write-Clean.
|
||||||
|
|
||||||
@param Ehc The EHCI device.
|
@param Ehc The EHCI device.
|
||||||
|
|
||||||
**/
|
**/
|
||||||
@ -207,7 +207,7 @@ EhcAckAllInterrupt (
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
Check whether Ehc is halted.
|
Check whether Ehc is halted.
|
||||||
|
|
||||||
@param Ehc The EHCI device.
|
@param Ehc The EHCI device.
|
||||||
|
|
||||||
@retval TRUE The controller is halted.
|
@retval TRUE The controller is halted.
|
||||||
@ -222,7 +222,7 @@ EhcIsHalt (
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
Check whether system error occurred.
|
Check whether system error occurred.
|
||||||
|
|
||||||
@param Ehc The EHCI device.
|
@param Ehc The EHCI device.
|
||||||
|
|
||||||
@retval TRUE System error happened.
|
@retval TRUE System error happened.
|
||||||
@ -237,7 +237,7 @@ EhcIsSysError (
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
Reset the host controller.
|
Reset the host controller.
|
||||||
|
|
||||||
@param Ehc The EHCI device.
|
@param Ehc The EHCI device.
|
||||||
@param Timeout Time to wait before abort (in millisecond, ms).
|
@param Timeout Time to wait before abort (in millisecond, ms).
|
||||||
|
|
||||||
@ -254,7 +254,7 @@ EhcResetHC (
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
Halt the host controller.
|
Halt the host controller.
|
||||||
|
|
||||||
@param Ehc The EHCI device.
|
@param Ehc The EHCI device.
|
||||||
@param Timeout Time to wait before abort.
|
@param Timeout Time to wait before abort.
|
||||||
|
|
||||||
@ -271,7 +271,7 @@ EhcHaltHC (
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
Set the EHCI to run
|
Set the EHCI to run
|
||||||
|
|
||||||
@param Ehc The EHCI device.
|
@param Ehc The EHCI device.
|
||||||
@param Timeout Time to wait before abort.
|
@param Timeout Time to wait before abort.
|
||||||
|
|
||||||
@ -287,14 +287,14 @@ EhcRunHC (
|
|||||||
;
|
;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Initialize the HC hardware.
|
Initialize the HC hardware.
|
||||||
EHCI spec lists the five things to do to initialize the hardware.
|
EHCI spec lists the five things to do to initialize the hardware.
|
||||||
1. Program CTRLDSSEGMENT.
|
1. Program CTRLDSSEGMENT.
|
||||||
2. Set USBINTR to enable interrupts.
|
2. Set USBINTR to enable interrupts.
|
||||||
3. Set periodic list base.
|
3. Set periodic list base.
|
||||||
4. Set USBCMD, interrupt threshold, frame list size etc.
|
4. Set USBCMD, interrupt threshold, frame list size etc.
|
||||||
5. Write 1 to CONFIGFLAG to route all ports to EHCI.
|
5. Write 1 to CONFIGFLAG to route all ports to EHCI.
|
||||||
|
|
||||||
@param Ehc The EHCI device.
|
@param Ehc The EHCI device.
|
||||||
|
|
||||||
@retval EFI_SUCCESS The EHCI has come out of halt state.
|
@retval EFI_SUCCESS The EHCI has come out of halt state.
|
||||||
|
@ -2,8 +2,8 @@
|
|||||||
PEIM to produce gPeiUsb2HostControllerPpiGuid based on gPeiUsbControllerPpiGuid
|
PEIM to produce gPeiUsb2HostControllerPpiGuid based on gPeiUsbControllerPpiGuid
|
||||||
which is used to enable recovery function from USB Drivers.
|
which is used to enable recovery function from USB Drivers.
|
||||||
|
|
||||||
Copyright (c) 2010 - 2017, Intel Corporation. All rights reserved.<BR>
|
Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||||
|
|
||||||
This program and the accompanying materials
|
This program and the accompanying materials
|
||||||
are licensed and made available under the terms and conditions
|
are licensed and made available under the terms and conditions
|
||||||
of the BSD License which accompanies this distribution. The
|
of the BSD License which accompanies this distribution. The
|
||||||
@ -19,7 +19,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
Create helper QTD/QH for the EHCI device.
|
Create helper QTD/QH for the EHCI device.
|
||||||
|
|
||||||
@param Ehc The EHCI device.
|
@param Ehc The EHCI device.
|
||||||
|
|
||||||
@retval EFI_OUT_OF_RESOURCES Failed to allocate resource for helper QTD/QH.
|
@retval EFI_OUT_OF_RESOURCES Failed to allocate resource for helper QTD/QH.
|
||||||
@ -95,7 +95,7 @@ EhcCreateHelpQ (
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
Initialize the schedule data structure such as frame list.
|
Initialize the schedule data structure such as frame list.
|
||||||
|
|
||||||
@param Ehc The EHCI device to init schedule data for.
|
@param Ehc The EHCI device to init schedule data for.
|
||||||
|
|
||||||
@retval EFI_OUT_OF_RESOURCES Failed to allocate resource to init schedule data.
|
@retval EFI_OUT_OF_RESOURCES Failed to allocate resource to init schedule data.
|
||||||
@ -162,7 +162,7 @@ EhcInitSched (
|
|||||||
if (EFI_ERROR (Status)) {
|
if (EFI_ERROR (Status)) {
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Initialize the frame list entries then set the registers
|
// Initialize the frame list entries then set the registers
|
||||||
//
|
//
|
||||||
@ -186,8 +186,8 @@ EhcInitSched (
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
Free the schedule data. It may be partially initialized.
|
Free the schedule data. It may be partially initialized.
|
||||||
|
|
||||||
@param Ehc The EHCI device.
|
@param Ehc The EHCI device.
|
||||||
|
|
||||||
**/
|
**/
|
||||||
VOID
|
VOID
|
||||||
@ -230,7 +230,7 @@ EhcFreeSched (
|
|||||||
due to its interfaces. This simplifies the AsynList
|
due to its interfaces. This simplifies the AsynList
|
||||||
management: A reclamation header is always linked to
|
management: A reclamation header is always linked to
|
||||||
the AsyncListAddr, the only active QH is appended to it.
|
the AsyncListAddr, the only active QH is appended to it.
|
||||||
|
|
||||||
@param Ehc The EHCI device.
|
@param Ehc The EHCI device.
|
||||||
@param Qh The queue head to link.
|
@param Qh The queue head to link.
|
||||||
|
|
||||||
@ -260,7 +260,7 @@ EhcLinkQhToAsync (
|
|||||||
/**
|
/**
|
||||||
Unlink a queue head from the asynchronous schedule list.
|
Unlink a queue head from the asynchronous schedule list.
|
||||||
Need to synchronize with hardware.
|
Need to synchronize with hardware.
|
||||||
|
|
||||||
@param Ehc The EHCI device.
|
@param Ehc The EHCI device.
|
||||||
@param Qh The queue head to unlink.
|
@param Qh The queue head to unlink.
|
||||||
|
|
||||||
@ -291,13 +291,13 @@ EhcUnlinkQhFromAsync (
|
|||||||
// Set and wait the door bell to synchronize with the hardware
|
// Set and wait the door bell to synchronize with the hardware
|
||||||
//
|
//
|
||||||
EhcSetAndWaitDoorBell (Ehc, EHC_GENERIC_TIMEOUT);
|
EhcSetAndWaitDoorBell (Ehc, EHC_GENERIC_TIMEOUT);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Check the URB's execution result and update the URB's
|
Check the URB's execution result and update the URB's
|
||||||
result accordingly.
|
result accordingly.
|
||||||
|
|
||||||
@param Ehc The EHCI device.
|
@param Ehc The EHCI device.
|
||||||
@param Urb The URB to check result.
|
@param Urb The URB to check result.
|
||||||
@ -358,13 +358,13 @@ EhcCheckUrbResult (
|
|||||||
|
|
||||||
Finished = TRUE;
|
Finished = TRUE;
|
||||||
goto ON_EXIT;
|
goto ON_EXIT;
|
||||||
|
|
||||||
} else if (EHC_BIT_IS_SET (State, QTD_STAT_ACTIVE)) {
|
} else if (EHC_BIT_IS_SET (State, QTD_STAT_ACTIVE)) {
|
||||||
//
|
//
|
||||||
// The QTD is still active, no need to check furthur.
|
// The QTD is still active, no need to check furthur.
|
||||||
//
|
//
|
||||||
Urb->Result |= EFI_USB_ERR_NOTEXECUTE;
|
Urb->Result |= EFI_USB_ERR_NOTEXECUTE;
|
||||||
|
|
||||||
Finished = FALSE;
|
Finished = FALSE;
|
||||||
goto ON_EXIT;
|
goto ON_EXIT;
|
||||||
|
|
||||||
@ -387,7 +387,7 @@ EhcCheckUrbResult (
|
|||||||
// Status Stage of the setup transfer to get the finial result
|
// Status Stage of the setup transfer to get the finial result
|
||||||
//
|
//
|
||||||
if (QtdHw->AltNext == QTD_LINK (Ehc->ShortReadStop, FALSE)) {
|
if (QtdHw->AltNext == QTD_LINK (Ehc->ShortReadStop, FALSE)) {
|
||||||
|
|
||||||
Finished = TRUE;
|
Finished = TRUE;
|
||||||
goto ON_EXIT;
|
goto ON_EXIT;
|
||||||
}
|
}
|
||||||
@ -412,7 +412,7 @@ ON_EXIT:
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
Execute the transfer by polling the URB. This is a synchronous operation.
|
Execute the transfer by polling the URB. This is a synchronous operation.
|
||||||
|
|
||||||
@param Ehc The EHCI device.
|
@param Ehc The EHCI device.
|
||||||
@param Urb The URB to execute.
|
@param Urb The URB to execute.
|
||||||
@param TimeOut The time to wait before abort, in millisecond.
|
@param TimeOut The time to wait before abort, in millisecond.
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
/** @file
|
/** @file
|
||||||
Private Header file for Usb Host Controller PEIM
|
Private Header file for Usb Host Controller PEIM
|
||||||
|
|
||||||
Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.<BR>
|
Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||||
|
|
||||||
This program and the accompanying materials
|
This program and the accompanying materials
|
||||||
are licensed and made available under the terms and conditions
|
are licensed and made available under the terms and conditions
|
||||||
of the BSD License which accompanies this distribution. The
|
of the BSD License which accompanies this distribution. The
|
||||||
@ -19,7 +19,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
Initialize the schedule data structure such as frame list.
|
Initialize the schedule data structure such as frame list.
|
||||||
|
|
||||||
@param Ehc The EHCI device to init schedule data for.
|
@param Ehc The EHCI device to init schedule data for.
|
||||||
|
|
||||||
@retval EFI_OUT_OF_RESOURCES Failed to allocate resource to init schedule data.
|
@retval EFI_OUT_OF_RESOURCES Failed to allocate resource to init schedule data.
|
||||||
@ -34,7 +34,7 @@ EhcInitSched (
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
Free the schedule data. It may be partially initialized.
|
Free the schedule data. It may be partially initialized.
|
||||||
|
|
||||||
@param Ehc The EHCI device.
|
@param Ehc The EHCI device.
|
||||||
|
|
||||||
**/
|
**/
|
||||||
@ -50,7 +50,7 @@ EhcFreeSched (
|
|||||||
due to its interfaces. This simplifies the AsynList
|
due to its interfaces. This simplifies the AsynList
|
||||||
management: A reclamation header is always linked to
|
management: A reclamation header is always linked to
|
||||||
the AsyncListAddr, the only active QH is appended to it.
|
the AsyncListAddr, the only active QH is appended to it.
|
||||||
|
|
||||||
@param Ehc The EHCI device.
|
@param Ehc The EHCI device.
|
||||||
@param Qh The queue head to link.
|
@param Qh The queue head to link.
|
||||||
|
|
||||||
@ -65,7 +65,7 @@ EhcLinkQhToAsync (
|
|||||||
/**
|
/**
|
||||||
Unlink a queue head from the asynchronous schedule list.
|
Unlink a queue head from the asynchronous schedule list.
|
||||||
Need to synchronize with hardware.
|
Need to synchronize with hardware.
|
||||||
|
|
||||||
@param Ehc The EHCI device.
|
@param Ehc The EHCI device.
|
||||||
@param Qh The queue head to unlink.
|
@param Qh The queue head to unlink.
|
||||||
|
|
||||||
@ -79,7 +79,7 @@ EhcUnlinkQhFromAsync (
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
Execute the transfer by polling the URB. This is a synchronous operation.
|
Execute the transfer by polling the URB. This is a synchronous operation.
|
||||||
|
|
||||||
@param Ehc The EHCI device.
|
@param Ehc The EHCI device.
|
||||||
@param Urb The URB to execute.
|
@param Urb The URB to execute.
|
||||||
@param TimeOut The time to wait before abort, in millisecond.
|
@param TimeOut The time to wait before abort, in millisecond.
|
||||||
|
@ -2,8 +2,8 @@
|
|||||||
PEIM to produce gPeiUsb2HostControllerPpiGuid based on gPeiUsbControllerPpiGuid
|
PEIM to produce gPeiUsb2HostControllerPpiGuid based on gPeiUsbControllerPpiGuid
|
||||||
which is used to enable recovery function from USB Drivers.
|
which is used to enable recovery function from USB Drivers.
|
||||||
|
|
||||||
Copyright (c) 2010 - 2017, Intel Corporation. All rights reserved.<BR>
|
Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||||
|
|
||||||
This program and the accompanying materials
|
This program and the accompanying materials
|
||||||
are licensed and made available under the terms and conditions
|
are licensed and made available under the terms and conditions
|
||||||
of the BSD License which accompanies this distribution. The
|
of the BSD License which accompanies this distribution. The
|
||||||
@ -20,7 +20,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
|||||||
/**
|
/**
|
||||||
Delete a single asynchronous interrupt transfer for
|
Delete a single asynchronous interrupt transfer for
|
||||||
the device and endpoint.
|
the device and endpoint.
|
||||||
|
|
||||||
@param Ehc The EHCI device.
|
@param Ehc The EHCI device.
|
||||||
@param Data Current data not associated with a QTD.
|
@param Data Current data not associated with a QTD.
|
||||||
@param DataLen The length of the data.
|
@param DataLen The length of the data.
|
||||||
@ -96,7 +96,7 @@ EhcCreateQtd (
|
|||||||
Len += ThisBufLen;
|
Len += ThisBufLen;
|
||||||
Data += ThisBufLen;
|
Data += ThisBufLen;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Need to fix the last pointer if the Qtd can't hold all the
|
// Need to fix the last pointer if the Qtd can't hold all the
|
||||||
// user's data to make sure that the length is in the unit of
|
// user's data to make sure that the length is in the unit of
|
||||||
@ -120,7 +120,7 @@ EhcCreateQtd (
|
|||||||
1. SplitXState in the Status field.
|
1. SplitXState in the Status field.
|
||||||
2. Microframe S-mask.
|
2. Microframe S-mask.
|
||||||
3. Microframe C-mask.
|
3. Microframe C-mask.
|
||||||
|
|
||||||
@param Ep The queue head's related endpoint.
|
@param Ep The queue head's related endpoint.
|
||||||
@param QhHw The queue head to initialize.
|
@param QhHw The queue head to initialize.
|
||||||
|
|
||||||
@ -142,7 +142,7 @@ EhcInitIntQh (
|
|||||||
QhHw->SMask = QH_MICROFRAME_0;
|
QhHw->SMask = QH_MICROFRAME_0;
|
||||||
return ;
|
return ;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// For low/full speed device, the transfer must go through
|
// For low/full speed device, the transfer must go through
|
||||||
// the split transaction. Need to update three fields
|
// the split transaction. Need to update three fields
|
||||||
@ -160,7 +160,7 @@ EhcInitIntQh (
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
Allocate and initialize a EHCI queue head.
|
Allocate and initialize a EHCI queue head.
|
||||||
|
|
||||||
@param Ehci The EHCI device.
|
@param Ehci The EHCI device.
|
||||||
@param Ep The endpoint to create queue head for.
|
@param Ep The endpoint to create queue head for.
|
||||||
|
|
||||||
@ -185,7 +185,7 @@ EhcCreateQh (
|
|||||||
Qh->Signature = EHC_QH_SIG;
|
Qh->Signature = EHC_QH_SIG;
|
||||||
Qh->NextQh = NULL;
|
Qh->NextQh = NULL;
|
||||||
Qh->Interval = Ep->PollRate;
|
Qh->Interval = Ep->PollRate;
|
||||||
|
|
||||||
InitializeListHead (&Qh->Qtds);
|
InitializeListHead (&Qh->Qtds);
|
||||||
|
|
||||||
QhHw = &Qh->QhHw;
|
QhHw = &Qh->QhHw;
|
||||||
@ -250,7 +250,7 @@ EhcCreateQh (
|
|||||||
can't support high speed endpoint with a interval less
|
can't support high speed endpoint with a interval less
|
||||||
than 8 microframe because interval is specified in
|
than 8 microframe because interval is specified in
|
||||||
the unit of ms (millisecond).
|
the unit of ms (millisecond).
|
||||||
|
|
||||||
@param Interval The interval to convert.
|
@param Interval The interval to convert.
|
||||||
|
|
||||||
@retval The converted interval.
|
@retval The converted interval.
|
||||||
@ -266,7 +266,7 @@ EhcConvertPollRate (
|
|||||||
if (Interval == 0) {
|
if (Interval == 0) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Find the index (1 based) of the highest non-zero bit
|
// Find the index (1 based) of the highest non-zero bit
|
||||||
//
|
//
|
||||||
@ -282,7 +282,7 @@ EhcConvertPollRate (
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
Free a list of QTDs.
|
Free a list of QTDs.
|
||||||
|
|
||||||
@param Ehc The EHCI device.
|
@param Ehc The EHCI device.
|
||||||
@param Qtds The list head of the QTD.
|
@param Qtds The list head of the QTD.
|
||||||
|
|
||||||
@ -307,7 +307,7 @@ EhcFreeQtds (
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
Free an allocated URB. It is possible for it to be partially inited.
|
Free an allocated URB. It is possible for it to be partially inited.
|
||||||
|
|
||||||
@param Ehc The EHCI device.
|
@param Ehc The EHCI device.
|
||||||
@param Urb The URB to free.
|
@param Urb The URB to free.
|
||||||
|
|
||||||
@ -338,7 +338,7 @@ EhcFreeUrb (
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
Create a list of QTDs for the URB.
|
Create a list of QTDs for the URB.
|
||||||
|
|
||||||
@param Ehc The EHCI device.
|
@param Ehc The EHCI device.
|
||||||
@param Urb The URB to create QTDs for.
|
@param Urb The URB to create QTDs for.
|
||||||
|
|
||||||
@ -380,7 +380,7 @@ EhcCreateQtds (
|
|||||||
if (Ep->Direction == EfiUsbDataIn) {
|
if (Ep->Direction == EfiUsbDataIn) {
|
||||||
AlterNext = QTD_LINK (Ehc->ShortReadStop, FALSE);
|
AlterNext = QTD_LINK (Ehc->ShortReadStop, FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Build the Setup and status packets for control transfer
|
// Build the Setup and status packets for control transfer
|
||||||
//
|
//
|
||||||
@ -457,7 +457,7 @@ EhcCreateQtds (
|
|||||||
|
|
||||||
Len += Qtd->DataLen;
|
Len += Qtd->DataLen;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Insert the status packet for control transfer
|
// Insert the status packet for control transfer
|
||||||
//
|
//
|
||||||
@ -496,7 +496,7 @@ ON_ERROR:
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
Create a new URB and its associated QTD.
|
Create a new URB and its associated QTD.
|
||||||
|
|
||||||
@param Ehc The EHCI device.
|
@param Ehc The EHCI device.
|
||||||
@param DevAddr The device address.
|
@param DevAddr The device address.
|
||||||
@param EpAddr Endpoint addrress & its direction.
|
@param EpAddr Endpoint addrress & its direction.
|
||||||
@ -519,7 +519,7 @@ PEI_URB *
|
|||||||
EhcCreateUrb (
|
EhcCreateUrb (
|
||||||
IN PEI_USB2_HC_DEV *Ehc,
|
IN PEI_USB2_HC_DEV *Ehc,
|
||||||
IN UINT8 DevAddr,
|
IN UINT8 DevAddr,
|
||||||
IN UINT8 EpAddr,
|
IN UINT8 EpAddr,
|
||||||
IN UINT8 DevSpeed,
|
IN UINT8 DevSpeed,
|
||||||
IN UINT8 Toggle,
|
IN UINT8 Toggle,
|
||||||
IN UINTN MaxPacket,
|
IN UINTN MaxPacket,
|
||||||
@ -540,7 +540,7 @@ EhcCreateUrb (
|
|||||||
UINTN Len;
|
UINTN Len;
|
||||||
PEI_URB *Urb;
|
PEI_URB *Urb;
|
||||||
VOID *Map;
|
VOID *Map;
|
||||||
|
|
||||||
Urb = Ehc->Urb;
|
Urb = Ehc->Urb;
|
||||||
Urb->Signature = EHC_URB_SIG;
|
Urb->Signature = EHC_URB_SIG;
|
||||||
InitializeListHead (&Urb->UrbList);
|
InitializeListHead (&Urb->UrbList);
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
/** @file
|
/** @file
|
||||||
Private Header file for Usb Host Controller PEIM
|
Private Header file for Usb Host Controller PEIM
|
||||||
|
|
||||||
Copyright (c) 2010, Intel Corporation. All rights reserved.<BR>
|
Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||||
|
|
||||||
This program and the accompanying materials
|
This program and the accompanying materials
|
||||||
are licensed and made available under the terms and conditions
|
are licensed and made available under the terms and conditions
|
||||||
of the BSD License which accompanies this distribution. The
|
of the BSD License which accompanies this distribution. The
|
||||||
@ -73,7 +73,7 @@ typedef struct _PEI_URB PEI_URB;
|
|||||||
#define USB_ERR_SHORT_PACKET 0x200
|
#define USB_ERR_SHORT_PACKET 0x200
|
||||||
|
|
||||||
//
|
//
|
||||||
// Fill in the hardware link point: pass in a EHC_QH/QH_HW
|
// Fill in the hardware link point: pass in a EHC_QH/QH_HW
|
||||||
// pointer to QH_LINK; A EHC_QTD/QTD_HW pointer to QTD_LINK
|
// pointer to QH_LINK; A EHC_QTD/QTD_HW pointer to QTD_LINK
|
||||||
//
|
//
|
||||||
#define QH_LINK(Addr, Type, Term) \
|
#define QH_LINK(Addr, Type, Term) \
|
||||||
@ -82,16 +82,16 @@ typedef struct _PEI_URB PEI_URB;
|
|||||||
#define QTD_LINK(Addr, Term) QH_LINK((Addr), 0, (Term))
|
#define QTD_LINK(Addr, Term) QH_LINK((Addr), 0, (Term))
|
||||||
|
|
||||||
//
|
//
|
||||||
// The defination of EHCI hardware used data structure for
|
// The defination of EHCI hardware used data structure for
|
||||||
// little endian architecture. The QTD and QH structures
|
// little endian architecture. The QTD and QH structures
|
||||||
// are required to be 32 bytes aligned. Don't add members
|
// are required to be 32 bytes aligned. Don't add members
|
||||||
// to the head of the associated software strucuture.
|
// to the head of the associated software strucuture.
|
||||||
//
|
//
|
||||||
#pragma pack(1)
|
#pragma pack(1)
|
||||||
typedef struct {
|
typedef struct {
|
||||||
UINT32 NextQtd;
|
UINT32 NextQtd;
|
||||||
UINT32 AltNext;
|
UINT32 AltNext;
|
||||||
|
|
||||||
UINT32 Status : 8;
|
UINT32 Status : 8;
|
||||||
UINT32 Pid : 2;
|
UINT32 Pid : 2;
|
||||||
UINT32 ErrCnt : 2;
|
UINT32 ErrCnt : 2;
|
||||||
@ -105,7 +105,7 @@ typedef struct {
|
|||||||
} QTD_HW;
|
} QTD_HW;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
UINT32 HorizonLink;
|
UINT32 HorizonLink;
|
||||||
//
|
//
|
||||||
// Endpoint capabilities/Characteristics DWord 1 and DWord 2
|
// Endpoint capabilities/Characteristics DWord 1 and DWord 2
|
||||||
//
|
//
|
||||||
@ -131,7 +131,7 @@ typedef struct {
|
|||||||
UINT32 CurQtd;
|
UINT32 CurQtd;
|
||||||
UINT32 NextQtd;
|
UINT32 NextQtd;
|
||||||
UINT32 AltQtd;
|
UINT32 AltQtd;
|
||||||
|
|
||||||
UINT32 Status : 8;
|
UINT32 Status : 8;
|
||||||
UINT32 Pid : 2;
|
UINT32 Pid : 2;
|
||||||
UINT32 ErrCnt : 2;
|
UINT32 ErrCnt : 2;
|
||||||
@ -163,7 +163,7 @@ typedef struct _USB_ENDPOINT {
|
|||||||
} USB_ENDPOINT;
|
} USB_ENDPOINT;
|
||||||
|
|
||||||
//
|
//
|
||||||
// Software QTD strcture, this is used to manage all the
|
// Software QTD strcture, this is used to manage all the
|
||||||
// QTD generated from a URB. Don't add fields before QtdHw.
|
// QTD generated from a URB. Don't add fields before QtdHw.
|
||||||
//
|
//
|
||||||
struct _PEI_EHC_QTD {
|
struct _PEI_EHC_QTD {
|
||||||
@ -177,17 +177,17 @@ struct _PEI_EHC_QTD {
|
|||||||
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Software QH structure. All three different transaction types
|
// Software QH structure. All three different transaction types
|
||||||
// supported by UEFI USB, that is the control/bulk/interrupt
|
// supported by UEFI USB, that is the control/bulk/interrupt
|
||||||
// transfers use the queue head and queue token strcuture.
|
// transfers use the queue head and queue token strcuture.
|
||||||
//
|
//
|
||||||
// Interrupt QHs are linked to periodic frame list in the reversed
|
// Interrupt QHs are linked to periodic frame list in the reversed
|
||||||
// 2^N tree. Each interrupt QH is linked to the list starting at
|
// 2^N tree. Each interrupt QH is linked to the list starting at
|
||||||
// frame 0. There is a dummy interrupt QH linked to each frame as
|
// frame 0. There is a dummy interrupt QH linked to each frame as
|
||||||
// a sentinental whose polling interval is 1. Synchronous interrupt
|
// a sentinental whose polling interval is 1. Synchronous interrupt
|
||||||
// transfer is linked after this dummy QH.
|
// transfer is linked after this dummy QH.
|
||||||
//
|
//
|
||||||
// For control/bulk transfer, only synchronous (in the sense of UEFI)
|
// For control/bulk transfer, only synchronous (in the sense of UEFI)
|
||||||
// transfer is supported. A dummy QH is linked to EHCI AsyncListAddr
|
// transfer is supported. A dummy QH is linked to EHCI AsyncListAddr
|
||||||
// as the reclamation header. New transfer is inserted after this QH.
|
// as the reclamation header. New transfer is inserted after this QH.
|
||||||
//
|
//
|
||||||
@ -196,17 +196,17 @@ struct _PEI_EHC_QH {
|
|||||||
UINT32 Signature;
|
UINT32 Signature;
|
||||||
PEI_EHC_QH *NextQh; // The queue head pointed to by horizontal link
|
PEI_EHC_QH *NextQh; // The queue head pointed to by horizontal link
|
||||||
EFI_LIST_ENTRY Qtds; // The list of QTDs to this queue head
|
EFI_LIST_ENTRY Qtds; // The list of QTDs to this queue head
|
||||||
UINTN Interval;
|
UINTN Interval;
|
||||||
};
|
};
|
||||||
|
|
||||||
//
|
//
|
||||||
// URB (Usb Request Block) contains information for all kinds of
|
// URB (Usb Request Block) contains information for all kinds of
|
||||||
// usb requests.
|
// usb requests.
|
||||||
//
|
//
|
||||||
struct _PEI_URB {
|
struct _PEI_URB {
|
||||||
UINT32 Signature;
|
UINT32 Signature;
|
||||||
EFI_LIST_ENTRY UrbList;
|
EFI_LIST_ENTRY UrbList;
|
||||||
|
|
||||||
//
|
//
|
||||||
// Transaction information
|
// Transaction information
|
||||||
//
|
//
|
||||||
@ -218,14 +218,14 @@ struct _PEI_URB {
|
|||||||
UINTN DataLen;
|
UINTN DataLen;
|
||||||
VOID *DataPhy; // Address of the mapped user data
|
VOID *DataPhy; // Address of the mapped user data
|
||||||
VOID *DataMap;
|
VOID *DataMap;
|
||||||
EFI_ASYNC_USB_TRANSFER_CALLBACK Callback;
|
EFI_ASYNC_USB_TRANSFER_CALLBACK Callback;
|
||||||
VOID *Context;
|
VOID *Context;
|
||||||
|
|
||||||
//
|
//
|
||||||
// Schedule data
|
// Schedule data
|
||||||
//
|
//
|
||||||
PEI_EHC_QH *Qh;
|
PEI_EHC_QH *Qh;
|
||||||
|
|
||||||
//
|
//
|
||||||
// Transaction result
|
// Transaction result
|
||||||
//
|
//
|
||||||
@ -237,7 +237,7 @@ struct _PEI_URB {
|
|||||||
/**
|
/**
|
||||||
Delete a single asynchronous interrupt transfer for
|
Delete a single asynchronous interrupt transfer for
|
||||||
the device and endpoint.
|
the device and endpoint.
|
||||||
|
|
||||||
@param Ehc The EHCI device.
|
@param Ehc The EHCI device.
|
||||||
@param Data Current data not associated with a QTD.
|
@param Data Current data not associated with a QTD.
|
||||||
@param DataLen The length of the data.
|
@param DataLen The length of the data.
|
||||||
@ -261,7 +261,7 @@ EhcCreateQtd (
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
Allocate and initialize a EHCI queue head.
|
Allocate and initialize a EHCI queue head.
|
||||||
|
|
||||||
@param Ehci The EHCI device.
|
@param Ehci The EHCI device.
|
||||||
@param Ep The endpoint to create queue head for.
|
@param Ep The endpoint to create queue head for.
|
||||||
|
|
||||||
@ -277,7 +277,7 @@ EhcCreateQh (
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
Free an allocated URB. It is possible for it to be partially inited.
|
Free an allocated URB. It is possible for it to be partially inited.
|
||||||
|
|
||||||
@param Ehc The EHCI device.
|
@param Ehc The EHCI device.
|
||||||
@param Urb The URB to free.
|
@param Urb The URB to free.
|
||||||
|
|
||||||
@ -291,7 +291,7 @@ EhcFreeUrb (
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
Create a new URB and its associated QTD.
|
Create a new URB and its associated QTD.
|
||||||
|
|
||||||
@param Ehc The EHCI device.
|
@param Ehc The EHCI device.
|
||||||
@param DevAddr The device address.
|
@param DevAddr The device address.
|
||||||
@param EpAddr Endpoint addrress & its direction.
|
@param EpAddr Endpoint addrress & its direction.
|
||||||
@ -314,7 +314,7 @@ PEI_URB *
|
|||||||
EhcCreateUrb (
|
EhcCreateUrb (
|
||||||
IN PEI_USB2_HC_DEV *Ehc,
|
IN PEI_USB2_HC_DEV *Ehc,
|
||||||
IN UINT8 DevAddr,
|
IN UINT8 DevAddr,
|
||||||
IN UINT8 EpAddr,
|
IN UINT8 EpAddr,
|
||||||
IN UINT8 DevSpeed,
|
IN UINT8 DevSpeed,
|
||||||
IN UINT8 Toggle,
|
IN UINT8 Toggle,
|
||||||
IN UINTN MaxPacket,
|
IN UINTN MaxPacket,
|
||||||
|
@ -2,8 +2,8 @@
|
|||||||
PEIM to produce gPeiUsb2HostControllerPpiGuid based on gPeiUsbControllerPpiGuid
|
PEIM to produce gPeiUsb2HostControllerPpiGuid based on gPeiUsbControllerPpiGuid
|
||||||
which is used to enable recovery function from USB Drivers.
|
which is used to enable recovery function from USB Drivers.
|
||||||
|
|
||||||
Copyright (c) 2010 - 2017, Intel Corporation. All rights reserved.<BR>
|
Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||||
|
|
||||||
This program and the accompanying materials
|
This program and the accompanying materials
|
||||||
are licensed and made available under the terms and conditions
|
are licensed and made available under the terms and conditions
|
||||||
of the BSD License which accompanies this distribution. The
|
of the BSD License which accompanies this distribution. The
|
||||||
@ -54,28 +54,28 @@ UsbHcAllocMemBlock (
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
ZeroMem ((VOID *)(UINTN)TempPtr, PageNumber*EFI_PAGE_SIZE);
|
ZeroMem ((VOID *)(UINTN)TempPtr, PageNumber*EFI_PAGE_SIZE);
|
||||||
|
|
||||||
//
|
//
|
||||||
// each bit in the bit array represents USBHC_MEM_UNIT
|
// each bit in the bit array represents USBHC_MEM_UNIT
|
||||||
// bytes of memory in the memory block.
|
// bytes of memory in the memory block.
|
||||||
//
|
//
|
||||||
ASSERT (USBHC_MEM_UNIT * 8 <= EFI_PAGE_SIZE);
|
ASSERT (USBHC_MEM_UNIT * 8 <= EFI_PAGE_SIZE);
|
||||||
|
|
||||||
Block = (USBHC_MEM_BLOCK*)(UINTN)TempPtr;
|
Block = (USBHC_MEM_BLOCK*)(UINTN)TempPtr;
|
||||||
Block->BufLen = EFI_PAGES_TO_SIZE (Pages);
|
Block->BufLen = EFI_PAGES_TO_SIZE (Pages);
|
||||||
Block->BitsLen = Block->BufLen / (USBHC_MEM_UNIT * 8);
|
Block->BitsLen = Block->BufLen / (USBHC_MEM_UNIT * 8);
|
||||||
|
|
||||||
PageNumber = (Block->BitsLen)/PAGESIZE +1;
|
PageNumber = (Block->BitsLen)/PAGESIZE +1;
|
||||||
Status = PeiServicesAllocatePages (
|
Status = PeiServicesAllocatePages (
|
||||||
EfiBootServicesCode,
|
EfiBootServicesCode,
|
||||||
PageNumber,
|
PageNumber,
|
||||||
&TempPtr
|
&TempPtr
|
||||||
);
|
);
|
||||||
|
|
||||||
if (EFI_ERROR (Status)) {
|
if (EFI_ERROR (Status)) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
ZeroMem ((VOID *)(UINTN)TempPtr, PageNumber*EFI_PAGE_SIZE);
|
ZeroMem ((VOID *)(UINTN)TempPtr, PageNumber*EFI_PAGE_SIZE);
|
||||||
|
|
||||||
Block->Bits = (UINT8 *)(UINTN)TempPtr;
|
Block->Bits = (UINT8 *)(UINTN)TempPtr;
|
||||||
|
|
||||||
@ -184,7 +184,7 @@ UsbHcAllocMemFromBlock (
|
|||||||
if (Available < Units) {
|
if (Available < Units) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Mark the memory as allocated
|
// Mark the memory as allocated
|
||||||
//
|
//
|
||||||
@ -283,7 +283,7 @@ UsbHcIsMemBlockEmpty (
|
|||||||
{
|
{
|
||||||
UINTN Index;
|
UINTN Index;
|
||||||
|
|
||||||
|
|
||||||
for (Index = 0; Index < Block->BitsLen; Index++) {
|
for (Index = 0; Index < Block->BitsLen; Index++) {
|
||||||
if (Block->Bits[Index] != 0) {
|
if (Block->Bits[Index] != 0) {
|
||||||
return FALSE;
|
return FALSE;
|
||||||
@ -321,7 +321,7 @@ UsbHcUnlinkMemBlock (
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
Initialize the memory management pool for the host controller.
|
Initialize the memory management pool for the host controller.
|
||||||
|
|
||||||
@param Ehc The EHCI device.
|
@param Ehc The EHCI device.
|
||||||
@param Check4G Whether the host controller requires allocated memory.
|
@param Check4G Whether the host controller requires allocated memory.
|
||||||
from one 4G address space.
|
from one 4G address space.
|
||||||
@ -342,7 +342,7 @@ UsbHcInitMemPool (
|
|||||||
UINTN PageNumber;
|
UINTN PageNumber;
|
||||||
EFI_STATUS Status;
|
EFI_STATUS Status;
|
||||||
EFI_PHYSICAL_ADDRESS TempPtr;
|
EFI_PHYSICAL_ADDRESS TempPtr;
|
||||||
|
|
||||||
PageNumber = sizeof(USBHC_MEM_POOL)/PAGESIZE +1;
|
PageNumber = sizeof(USBHC_MEM_POOL)/PAGESIZE +1;
|
||||||
Status = PeiServicesAllocatePages (
|
Status = PeiServicesAllocatePages (
|
||||||
EfiBootServicesCode,
|
EfiBootServicesCode,
|
||||||
@ -353,9 +353,9 @@ UsbHcInitMemPool (
|
|||||||
if (EFI_ERROR (Status)) {
|
if (EFI_ERROR (Status)) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
ZeroMem ((VOID *)(UINTN)TempPtr, PageNumber*EFI_PAGE_SIZE);
|
ZeroMem ((VOID *)(UINTN)TempPtr, PageNumber*EFI_PAGE_SIZE);
|
||||||
|
|
||||||
Pool = (USBHC_MEM_POOL *) ((UINTN) TempPtr);
|
Pool = (USBHC_MEM_POOL *) ((UINTN) TempPtr);
|
||||||
|
|
||||||
Pool->Check4G = Check4G;
|
Pool->Check4G = Check4G;
|
||||||
Pool->Which4G = Which4G;
|
Pool->Which4G = Which4G;
|
||||||
@ -405,7 +405,7 @@ UsbHcFreeMemPool (
|
|||||||
/**
|
/**
|
||||||
Allocate some memory from the host controller's memory pool
|
Allocate some memory from the host controller's memory pool
|
||||||
which can be used to communicate with host controller.
|
which can be used to communicate with host controller.
|
||||||
|
|
||||||
@param Ehc The EHCI device.
|
@param Ehc The EHCI device.
|
||||||
@param Pool The host controller's memory pool.
|
@param Pool The host controller's memory pool.
|
||||||
@param Size Size of the memory to allocate.
|
@param Size Size of the memory to allocate.
|
||||||
@ -464,7 +464,7 @@ UsbHcAllocateMem (
|
|||||||
if (NewBlock == NULL) {
|
if (NewBlock == NULL) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Add the new memory block to the pool, then allocate memory from it
|
// Add the new memory block to the pool, then allocate memory from it
|
||||||
//
|
//
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
/** @file
|
/** @file
|
||||||
Private Header file for Usb Host Controller PEIM
|
Private Header file for Usb Host Controller PEIM
|
||||||
|
|
||||||
Copyright (c) 2010 - 2017, Intel Corporation. All rights reserved.<BR>
|
Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||||
|
|
||||||
This program and the accompanying materials
|
This program and the accompanying materials
|
||||||
are licensed and made available under the terms and conditions
|
are licensed and made available under the terms and conditions
|
||||||
of the BSD License which accompanies this distribution. The
|
of the BSD License which accompanies this distribution. The
|
||||||
@ -32,22 +32,22 @@ typedef struct _USBHC_MEM_BLOCK USBHC_MEM_BLOCK;
|
|||||||
|
|
||||||
struct _USBHC_MEM_BLOCK {
|
struct _USBHC_MEM_BLOCK {
|
||||||
UINT8 *Bits; // Bit array to record which unit is allocated
|
UINT8 *Bits; // Bit array to record which unit is allocated
|
||||||
UINTN BitsLen;
|
UINTN BitsLen;
|
||||||
UINT8 *Buf;
|
UINT8 *Buf;
|
||||||
UINT8 *BufHost;
|
UINT8 *BufHost;
|
||||||
UINTN BufLen; // Memory size in bytes
|
UINTN BufLen; // Memory size in bytes
|
||||||
VOID *Mapping;
|
VOID *Mapping;
|
||||||
USBHC_MEM_BLOCK *Next;
|
USBHC_MEM_BLOCK *Next;
|
||||||
};
|
};
|
||||||
|
|
||||||
//
|
//
|
||||||
// USBHC_MEM_POOL is used to manage the memory used by USB
|
// USBHC_MEM_POOL is used to manage the memory used by USB
|
||||||
// host controller. EHCI requires the control memory and transfer
|
// host controller. EHCI requires the control memory and transfer
|
||||||
// data to be on the same 4G memory.
|
// data to be on the same 4G memory.
|
||||||
//
|
//
|
||||||
typedef struct _USBHC_MEM_POOL {
|
typedef struct _USBHC_MEM_POOL {
|
||||||
BOOLEAN Check4G;
|
BOOLEAN Check4G;
|
||||||
UINT32 Which4G;
|
UINT32 Which4G;
|
||||||
USBHC_MEM_BLOCK *Head;
|
USBHC_MEM_BLOCK *Head;
|
||||||
} USBHC_MEM_POOL;
|
} USBHC_MEM_POOL;
|
||||||
|
|
||||||
@ -71,7 +71,7 @@ typedef struct _USBHC_MEM_POOL {
|
|||||||
(Byte)++; \
|
(Byte)++; \
|
||||||
(Bit) = 0; \
|
(Bit) = 0; \
|
||||||
} \
|
} \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -5,7 +5,7 @@ ATA controllers in the platform.
|
|||||||
This PPI can be consumed by PEIM which produce gEfiPeiDeviceRecoveryModulePpiGuid
|
This PPI can be consumed by PEIM which produce gEfiPeiDeviceRecoveryModulePpiGuid
|
||||||
for Atapi CD ROM device.
|
for Atapi CD ROM device.
|
||||||
|
|
||||||
Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.<BR>
|
Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||||
|
|
||||||
This program and the accompanying materials
|
This program and the accompanying materials
|
||||||
are licensed and made available under the terms and conditions
|
are licensed and made available under the terms and conditions
|
||||||
@ -21,8 +21,8 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
|||||||
#include "AtapiPeim.h"
|
#include "AtapiPeim.h"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Initializes the Atapi Block Io PPI.
|
Initializes the Atapi Block Io PPI.
|
||||||
|
|
||||||
@param[in] FileHandle Handle of the file being invoked.
|
@param[in] FileHandle Handle of the file being invoked.
|
||||||
@param[in] PeiServices Describes the list of possible PEI Services.
|
@param[in] PeiServices Describes the list of possible PEI Services.
|
||||||
|
|
||||||
@ -97,16 +97,16 @@ AtapiPeimEntry (
|
|||||||
/**
|
/**
|
||||||
Gets the count of block I/O devices that one specific block driver detects.
|
Gets the count of block I/O devices that one specific block driver detects.
|
||||||
|
|
||||||
This function is used for getting the count of block I/O devices that one
|
This function is used for getting the count of block I/O devices that one
|
||||||
specific block driver detects. To the PEI ATAPI driver, it returns the number
|
specific block driver detects. To the PEI ATAPI driver, it returns the number
|
||||||
of all the detected ATAPI devices it detects during the enumeration process.
|
of all the detected ATAPI devices it detects during the enumeration process.
|
||||||
To the PEI legacy floppy driver, it returns the number of all the legacy
|
To the PEI legacy floppy driver, it returns the number of all the legacy
|
||||||
devices it finds during its enumeration process. If no device is detected,
|
devices it finds during its enumeration process. If no device is detected,
|
||||||
then the function will return zero.
|
then the function will return zero.
|
||||||
|
|
||||||
@param[in] PeiServices General-purpose services that are available
|
@param[in] PeiServices General-purpose services that are available
|
||||||
to every PEIM.
|
to every PEIM.
|
||||||
@param[in] This Indicates the EFI_PEI_RECOVERY_BLOCK_IO_PPI
|
@param[in] This Indicates the EFI_PEI_RECOVERY_BLOCK_IO_PPI
|
||||||
instance.
|
instance.
|
||||||
@param[out] NumberBlockDevices The number of block I/O devices discovered.
|
@param[out] NumberBlockDevices The number of block I/O devices discovered.
|
||||||
|
|
||||||
@ -135,27 +135,27 @@ AtapiGetNumberOfBlockDevices (
|
|||||||
/**
|
/**
|
||||||
Gets a block device's media information.
|
Gets a block device's media information.
|
||||||
|
|
||||||
This function will provide the caller with the specified block device's media
|
This function will provide the caller with the specified block device's media
|
||||||
information. If the media changes, calling this function will update the media
|
information. If the media changes, calling this function will update the media
|
||||||
information accordingly.
|
information accordingly.
|
||||||
|
|
||||||
@param[in] PeiServices General-purpose services that are available to every
|
@param[in] PeiServices General-purpose services that are available to every
|
||||||
PEIM
|
PEIM
|
||||||
@param[in] This Indicates the EFI_PEI_RECOVERY_BLOCK_IO_PPI instance.
|
@param[in] This Indicates the EFI_PEI_RECOVERY_BLOCK_IO_PPI instance.
|
||||||
@param[in] DeviceIndex Specifies the block device to which the function wants
|
@param[in] DeviceIndex Specifies the block device to which the function wants
|
||||||
to talk. Because the driver that implements Block I/O
|
to talk. Because the driver that implements Block I/O
|
||||||
PPIs will manage multiple block devices, the PPIs that
|
PPIs will manage multiple block devices, the PPIs that
|
||||||
want to talk to a single device must specify the
|
want to talk to a single device must specify the
|
||||||
device index that was assigned during the enumeration
|
device index that was assigned during the enumeration
|
||||||
process. This index is a number from one to
|
process. This index is a number from one to
|
||||||
NumberBlockDevices.
|
NumberBlockDevices.
|
||||||
@param[out] MediaInfo The media information of the specified block media.
|
@param[out] MediaInfo The media information of the specified block media.
|
||||||
The caller is responsible for the ownership of this
|
The caller is responsible for the ownership of this
|
||||||
data structure.
|
data structure.
|
||||||
|
|
||||||
@retval EFI_SUCCESS Media information about the specified block device
|
@retval EFI_SUCCESS Media information about the specified block device
|
||||||
was obtained successfully.
|
was obtained successfully.
|
||||||
@retval EFI_DEVICE_ERROR Cannot get the media information due to a hardware
|
@retval EFI_DEVICE_ERROR Cannot get the media information due to a hardware
|
||||||
error.
|
error.
|
||||||
@retval Others Other failure occurs.
|
@retval Others Other failure occurs.
|
||||||
|
|
||||||
@ -196,7 +196,7 @@ AtapiGetBlockDeviceMediaInfo (
|
|||||||
//
|
//
|
||||||
// probe media and retrieve latest media information
|
// probe media and retrieve latest media information
|
||||||
//
|
//
|
||||||
DEBUG ((EFI_D_INFO, "Atatpi GetInfo DevicePosition is %d\n", AtapiBlkIoDev->DeviceInfo[Index].DevicePosition));
|
DEBUG ((EFI_D_INFO, "Atatpi GetInfo DevicePosition is %d\n", AtapiBlkIoDev->DeviceInfo[Index].DevicePosition));
|
||||||
DEBUG ((EFI_D_INFO, "Atatpi GetInfo DeviceType is %d\n", AtapiBlkIoDev->DeviceInfo[Index].MediaInfo.DeviceType));
|
DEBUG ((EFI_D_INFO, "Atatpi GetInfo DeviceType is %d\n", AtapiBlkIoDev->DeviceInfo[Index].MediaInfo.DeviceType));
|
||||||
DEBUG ((EFI_D_INFO, "Atatpi GetInfo MediaPresent is %d\n", AtapiBlkIoDev->DeviceInfo[Index].MediaInfo.MediaPresent));
|
DEBUG ((EFI_D_INFO, "Atatpi GetInfo MediaPresent is %d\n", AtapiBlkIoDev->DeviceInfo[Index].MediaInfo.MediaPresent));
|
||||||
DEBUG ((EFI_D_INFO, "Atatpi GetInfo BlockSize is 0x%x\n", AtapiBlkIoDev->DeviceInfo[Index].MediaInfo.BlockSize));
|
DEBUG ((EFI_D_INFO, "Atatpi GetInfo BlockSize is 0x%x\n", AtapiBlkIoDev->DeviceInfo[Index].MediaInfo.BlockSize));
|
||||||
@ -217,7 +217,7 @@ AtapiGetBlockDeviceMediaInfo (
|
|||||||
DEBUG ((EFI_D_INFO, "Atatpi GetInfo MediaPresent is %d\n", AtapiBlkIoDev->DeviceInfo[Index].MediaInfo.MediaPresent));
|
DEBUG ((EFI_D_INFO, "Atatpi GetInfo MediaPresent is %d\n", AtapiBlkIoDev->DeviceInfo[Index].MediaInfo.MediaPresent));
|
||||||
DEBUG ((EFI_D_INFO, "Atatpi GetInfo BlockSize is 0x%x\n", AtapiBlkIoDev->DeviceInfo[Index].MediaInfo.BlockSize));
|
DEBUG ((EFI_D_INFO, "Atatpi GetInfo BlockSize is 0x%x\n", AtapiBlkIoDev->DeviceInfo[Index].MediaInfo.BlockSize));
|
||||||
DEBUG ((EFI_D_INFO, "Atatpi GetInfo LastBlock is 0x%x\n", AtapiBlkIoDev->DeviceInfo[Index].MediaInfo.LastBlock));
|
DEBUG ((EFI_D_INFO, "Atatpi GetInfo LastBlock is 0x%x\n", AtapiBlkIoDev->DeviceInfo[Index].MediaInfo.LastBlock));
|
||||||
|
|
||||||
//
|
//
|
||||||
// Get media info from AtapiBlkIoDev
|
// Get media info from AtapiBlkIoDev
|
||||||
//
|
//
|
||||||
@ -229,31 +229,31 @@ AtapiGetBlockDeviceMediaInfo (
|
|||||||
/**
|
/**
|
||||||
Reads the requested number of blocks from the specified block device.
|
Reads the requested number of blocks from the specified block device.
|
||||||
|
|
||||||
The function reads the requested number of blocks from the device. All the
|
The function reads the requested number of blocks from the device. All the
|
||||||
blocks are read, or an error is returned. If there is no media in the device,
|
blocks are read, or an error is returned. If there is no media in the device,
|
||||||
the function returns EFI_NO_MEDIA.
|
the function returns EFI_NO_MEDIA.
|
||||||
|
|
||||||
@param[in] PeiServices General-purpose services that are available to
|
@param[in] PeiServices General-purpose services that are available to
|
||||||
every PEIM.
|
every PEIM.
|
||||||
@param[in] This Indicates the EFI_PEI_RECOVERY_BLOCK_IO_PPI instance.
|
@param[in] This Indicates the EFI_PEI_RECOVERY_BLOCK_IO_PPI instance.
|
||||||
@param[in] DeviceIndex Specifies the block device to which the function wants
|
@param[in] DeviceIndex Specifies the block device to which the function wants
|
||||||
to talk. Because the driver that implements Block I/O
|
to talk. Because the driver that implements Block I/O
|
||||||
PPIs will manage multiple block devices, the PPIs that
|
PPIs will manage multiple block devices, the PPIs that
|
||||||
want to talk to a single device must specify the device
|
want to talk to a single device must specify the device
|
||||||
index that was assigned during the enumeration process.
|
index that was assigned during the enumeration process.
|
||||||
This index is a number from one to NumberBlockDevices.
|
This index is a number from one to NumberBlockDevices.
|
||||||
@param[in] StartLBA The starting logical block address (LBA) to read from
|
@param[in] StartLBA The starting logical block address (LBA) to read from
|
||||||
on the device
|
on the device
|
||||||
@param[in] BufferSize The size of the Buffer in bytes. This number must be
|
@param[in] BufferSize The size of the Buffer in bytes. This number must be
|
||||||
a multiple of the intrinsic block size of the device.
|
a multiple of the intrinsic block size of the device.
|
||||||
@param[out] Buffer A pointer to the destination buffer for the data.
|
@param[out] Buffer A pointer to the destination buffer for the data.
|
||||||
The caller is responsible for the ownership of the
|
The caller is responsible for the ownership of the
|
||||||
buffer.
|
buffer.
|
||||||
|
|
||||||
@retval EFI_SUCCESS The data was read correctly from the device.
|
@retval EFI_SUCCESS The data was read correctly from the device.
|
||||||
@retval EFI_DEVICE_ERROR The device reported an error while attempting
|
@retval EFI_DEVICE_ERROR The device reported an error while attempting
|
||||||
to perform the read operation.
|
to perform the read operation.
|
||||||
@retval EFI_INVALID_PARAMETER The read request contains LBAs that are not
|
@retval EFI_INVALID_PARAMETER The read request contains LBAs that are not
|
||||||
valid, or the buffer is not properly aligned.
|
valid, or the buffer is not properly aligned.
|
||||||
@retval EFI_NO_MEDIA There is no media in the device.
|
@retval EFI_NO_MEDIA There is no media in the device.
|
||||||
@retval EFI_BAD_BUFFER_SIZE The BufferSize parameter is not a multiple of
|
@retval EFI_BAD_BUFFER_SIZE The BufferSize parameter is not a multiple of
|
||||||
@ -553,7 +553,7 @@ AtapiEnumerateDevices (
|
|||||||
);
|
);
|
||||||
|
|
||||||
//
|
//
|
||||||
// Allow SATA Devices to spin-up. This is needed if
|
// Allow SATA Devices to spin-up. This is needed if
|
||||||
// SEC and PEI phase is too short, for example Release Build.
|
// SEC and PEI phase is too short, for example Release Build.
|
||||||
//
|
//
|
||||||
DEBUG ((EFI_D_INFO, "Delay for %d seconds for SATA devices to spin-up\n", PcdGet16 (PcdSataSpinUpDelayInSecForRecoveryPath)));
|
DEBUG ((EFI_D_INFO, "Delay for %d seconds for SATA devices to spin-up\n", PcdGet16 (PcdSataSpinUpDelayInSecForRecoveryPath)));
|
||||||
@ -571,7 +571,7 @@ AtapiEnumerateDevices (
|
|||||||
//
|
//
|
||||||
// Using Command and Control Regs Base Address to fill other registers.
|
// Using Command and Control Regs Base Address to fill other registers.
|
||||||
//
|
//
|
||||||
for (Index1 = 0; Index1 < IdeEnabledNumber; Index1 ++) {
|
for (Index1 = 0; Index1 < IdeEnabledNumber; Index1 ++) {
|
||||||
CommandBlockBaseAddr = IdeRegsBaseAddr[Index1].CommandBlockBaseAddr;
|
CommandBlockBaseAddr = IdeRegsBaseAddr[Index1].CommandBlockBaseAddr;
|
||||||
AtapiBlkIoDev->IdeIoPortReg[Index1].Data = CommandBlockBaseAddr;
|
AtapiBlkIoDev->IdeIoPortReg[Index1].Data = CommandBlockBaseAddr;
|
||||||
AtapiBlkIoDev->IdeIoPortReg[Index1].Reg1.Feature = (UINT16) (CommandBlockBaseAddr + 0x1);
|
AtapiBlkIoDev->IdeIoPortReg[Index1].Reg1.Feature = (UINT16) (CommandBlockBaseAddr + 0x1);
|
||||||
@ -585,7 +585,7 @@ AtapiEnumerateDevices (
|
|||||||
ControlBlockBaseAddr = IdeRegsBaseAddr[Index1].ControlBlockBaseAddr;
|
ControlBlockBaseAddr = IdeRegsBaseAddr[Index1].ControlBlockBaseAddr;
|
||||||
AtapiBlkIoDev->IdeIoPortReg[Index1].Alt.DeviceControl = ControlBlockBaseAddr;
|
AtapiBlkIoDev->IdeIoPortReg[Index1].Alt.DeviceControl = ControlBlockBaseAddr;
|
||||||
AtapiBlkIoDev->IdeIoPortReg[Index1].DriveAddress = (UINT16) (ControlBlockBaseAddr + 0x1);
|
AtapiBlkIoDev->IdeIoPortReg[Index1].DriveAddress = (UINT16) (ControlBlockBaseAddr + 0x1);
|
||||||
|
|
||||||
//
|
//
|
||||||
// Scan IDE bus for ATAPI devices IDE or Sata device
|
// Scan IDE bus for ATAPI devices IDE or Sata device
|
||||||
//
|
//
|
||||||
@ -628,7 +628,7 @@ AtapiEnumerateDevices (
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
Detect Atapi devices.
|
Detect Atapi devices.
|
||||||
|
|
||||||
@param[in] AtapiBlkIoDev A pointer to atapi block IO device.
|
@param[in] AtapiBlkIoDev A pointer to atapi block IO device.
|
||||||
@param[in] DevicePosition An integer to signify device position.
|
@param[in] DevicePosition An integer to signify device position.
|
||||||
@param[out] MediaInfo The media information of the specified block media.
|
@param[out] MediaInfo The media information of the specified block media.
|
||||||
@ -667,7 +667,7 @@ DiscoverAtapiDevice (
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
Check power mode of Atapi devices.
|
Check power mode of Atapi devices.
|
||||||
|
|
||||||
@param[in] AtapiBlkIoDev A pointer to atapi block IO device.
|
@param[in] AtapiBlkIoDev A pointer to atapi block IO device.
|
||||||
@param[in] DevicePosition An integer to signify device position.
|
@param[in] DevicePosition An integer to signify device position.
|
||||||
@param[in] AtaCommand The Ata Command passed in.
|
@param[in] AtaCommand The Ata Command passed in.
|
||||||
@ -800,7 +800,7 @@ CheckPowerMode (
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
Detect if an IDE controller exists in specified position.
|
Detect if an IDE controller exists in specified position.
|
||||||
|
|
||||||
@param[in] AtapiBlkIoDev A pointer to atapi block IO device.
|
@param[in] AtapiBlkIoDev A pointer to atapi block IO device.
|
||||||
@param[in] DevicePosition An integer to signify device position.
|
@param[in] DevicePosition An integer to signify device position.
|
||||||
|
|
||||||
@ -842,7 +842,7 @@ DetectIDEController (
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
Wait specified time interval to poll for BSY bit clear in the Status Register.
|
Wait specified time interval to poll for BSY bit clear in the Status Register.
|
||||||
|
|
||||||
@param[in] AtapiBlkIoDev A pointer to atapi block IO device.
|
@param[in] AtapiBlkIoDev A pointer to atapi block IO device.
|
||||||
@param[in] IdeIoRegisters A pointer to IDE IO registers.
|
@param[in] IdeIoRegisters A pointer to IDE IO registers.
|
||||||
@param[in] TimeoutInMilliSeconds Time specified in milliseconds.
|
@param[in] TimeoutInMilliSeconds Time specified in milliseconds.
|
||||||
@ -887,7 +887,7 @@ WaitForBSYClear (
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
Wait specified time interval to poll for DRDY bit set in the Status register.
|
Wait specified time interval to poll for DRDY bit set in the Status register.
|
||||||
|
|
||||||
@param[in] AtapiBlkIoDev A pointer to atapi block IO device.
|
@param[in] AtapiBlkIoDev A pointer to atapi block IO device.
|
||||||
@param[in] IdeIoRegisters A pointer to IDE IO registers.
|
@param[in] IdeIoRegisters A pointer to IDE IO registers.
|
||||||
@param[in] TimeoutInMilliSeconds Time specified in milliseconds.
|
@param[in] TimeoutInMilliSeconds Time specified in milliseconds.
|
||||||
@ -928,7 +928,7 @@ DRDYReady (
|
|||||||
return EFI_ABORTED;
|
return EFI_ABORTED;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
MicroSecondDelay (250);
|
MicroSecondDelay (250);
|
||||||
|
|
||||||
Delay--;
|
Delay--;
|
||||||
@ -944,7 +944,7 @@ DRDYReady (
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
Wait specified time interval to poll for DRQ bit clear in the Status Register.
|
Wait specified time interval to poll for DRQ bit clear in the Status Register.
|
||||||
|
|
||||||
@param[in] AtapiBlkIoDev A pointer to atapi block IO device.
|
@param[in] AtapiBlkIoDev A pointer to atapi block IO device.
|
||||||
@param[in] IdeIoRegisters A pointer to IDE IO registers.
|
@param[in] IdeIoRegisters A pointer to IDE IO registers.
|
||||||
@param[in] TimeoutInMilliSeconds Time specified in milliseconds.
|
@param[in] TimeoutInMilliSeconds Time specified in milliseconds.
|
||||||
@ -987,7 +987,7 @@ DRQClear (
|
|||||||
return EFI_ABORTED;
|
return EFI_ABORTED;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
MicroSecondDelay (250);
|
MicroSecondDelay (250);
|
||||||
|
|
||||||
Delay--;
|
Delay--;
|
||||||
@ -1002,7 +1002,7 @@ DRQClear (
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
Wait specified time interval to poll for DRQ bit clear in the Alternate Status Register.
|
Wait specified time interval to poll for DRQ bit clear in the Alternate Status Register.
|
||||||
|
|
||||||
@param[in] AtapiBlkIoDev A pointer to atapi block IO device.
|
@param[in] AtapiBlkIoDev A pointer to atapi block IO device.
|
||||||
@param[in] IdeIoRegisters A pointer to IDE IO registers.
|
@param[in] IdeIoRegisters A pointer to IDE IO registers.
|
||||||
@param[in] TimeoutInMilliSeconds Time specified in milliseconds.
|
@param[in] TimeoutInMilliSeconds Time specified in milliseconds.
|
||||||
@ -1045,7 +1045,7 @@ DRQClear2 (
|
|||||||
return EFI_ABORTED;
|
return EFI_ABORTED;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
MicroSecondDelay (250);
|
MicroSecondDelay (250);
|
||||||
|
|
||||||
Delay--;
|
Delay--;
|
||||||
@ -1406,7 +1406,7 @@ TestUnitReady (
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
Send out ATAPI commands conforms to the Packet Command with PIO Data In Protocol.
|
Send out ATAPI commands conforms to the Packet Command with PIO Data In Protocol.
|
||||||
|
|
||||||
@param[in] AtapiBlkIoDev A pointer to atapi block IO device.
|
@param[in] AtapiBlkIoDev A pointer to atapi block IO device.
|
||||||
@param[in] DevicePosition An integer to signify device position.
|
@param[in] DevicePosition An integer to signify device position.
|
||||||
@param[in] Packet A pointer to ATAPI command packet.
|
@param[in] Packet A pointer to ATAPI command packet.
|
||||||
@ -1702,8 +1702,8 @@ Inquiry (
|
|||||||
return EFI_SUCCESS;
|
return EFI_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Used before read/write blocks from/to ATAPI device media.
|
Used before read/write blocks from/to ATAPI device media.
|
||||||
Since ATAPI device media is removable, it is necessary to detect
|
Since ATAPI device media is removable, it is necessary to detect
|
||||||
whether media is present and get current present media's information.
|
whether media is present and get current present media's information.
|
||||||
|
|
||||||
@ -1739,7 +1739,7 @@ DetectMedia (
|
|||||||
if (SenseBuffers == NULL) {
|
if (SenseBuffers == NULL) {
|
||||||
return EFI_OUT_OF_RESOURCES;
|
return EFI_OUT_OF_RESOURCES;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Test Unit Ready command is used to detect whether device is accessible,
|
// Test Unit Ready command is used to detect whether device is accessible,
|
||||||
// the device will produce corresponding Sense data.
|
// the device will produce corresponding Sense data.
|
||||||
@ -1878,7 +1878,7 @@ DetectMedia (
|
|||||||
return EFI_SUCCESS;
|
return EFI_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Reset specified Atapi device.
|
Reset specified Atapi device.
|
||||||
|
|
||||||
@param[in] AtapiBlkIoDev A pointer to atapi block IO device.
|
@param[in] AtapiBlkIoDev A pointer to atapi block IO device.
|
||||||
@ -1976,7 +1976,7 @@ ResetDevice (
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Sends out ATAPI Request Sense Packet Command to the specified device.
|
Sends out ATAPI Request Sense Packet Command to the specified device.
|
||||||
|
|
||||||
@param[in] AtapiBlkIoDev A pointer to atapi block IO device.
|
@param[in] AtapiBlkIoDev A pointer to atapi block IO device.
|
||||||
@ -2072,7 +2072,7 @@ RequestSense (
|
|||||||
return EFI_SUCCESS;
|
return EFI_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Sends out ATAPI Read Capacity Packet Command to the specified device.
|
Sends out ATAPI Read Capacity Packet Command to the specified device.
|
||||||
This command will return the information regarding the capacity of the
|
This command will return the information regarding the capacity of the
|
||||||
media in the device.
|
media in the device.
|
||||||
@ -2185,7 +2185,7 @@ ReadCapacity (
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Perform read from disk in block unit.
|
Perform read from disk in block unit.
|
||||||
|
|
||||||
@param[in] AtapiBlkIoDev A pointer to atapi block IO device.
|
@param[in] AtapiBlkIoDev A pointer to atapi block IO device.
|
||||||
@ -2288,7 +2288,7 @@ ReadSectors (
|
|||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Check if there is media according to sense data.
|
Check if there is media according to sense data.
|
||||||
|
|
||||||
@param[in] SenseData Pointer to sense data.
|
@param[in] SenseData Pointer to sense data.
|
||||||
@ -2324,14 +2324,14 @@ IsNoMedia (
|
|||||||
return IsNoMedia;
|
return IsNoMedia;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Check if device state is unclear according to sense data.
|
Check if device state is unclear according to sense data.
|
||||||
|
|
||||||
@param[in] SenseData Pointer to sense data.
|
@param[in] SenseData Pointer to sense data.
|
||||||
@param[in] SenseCounts Count of sense data.
|
@param[in] SenseCounts Count of sense data.
|
||||||
|
|
||||||
@retval TRUE Device state is unclear
|
@retval TRUE Device state is unclear
|
||||||
@retval FALSE Device state is clear
|
@retval FALSE Device state is clear
|
||||||
|
|
||||||
**/
|
**/
|
||||||
BOOLEAN
|
BOOLEAN
|
||||||
@ -2365,7 +2365,7 @@ IsDeviceStateUnclear (
|
|||||||
return Unclear;
|
return Unclear;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Check if there is media error according to sense data.
|
Check if there is media error according to sense data.
|
||||||
|
|
||||||
@param[in] SenseData Pointer to sense data.
|
@param[in] SenseData Pointer to sense data.
|
||||||
@ -2438,7 +2438,7 @@ IsMediaError (
|
|||||||
return IsError;
|
return IsError;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Check if drive is ready according to sense data.
|
Check if drive is ready according to sense data.
|
||||||
|
|
||||||
@param[in] SenseData Pointer to sense data.
|
@param[in] SenseData Pointer to sense data.
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/** @file
|
/** @file
|
||||||
Private Include file for IdeBus PEIM.
|
Private Include file for IdeBus PEIM.
|
||||||
|
|
||||||
Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR>
|
Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||||
|
|
||||||
This program and the accompanying materials
|
This program and the accompanying materials
|
||||||
are licensed and made available under the terms and conditions
|
are licensed and made available under the terms and conditions
|
||||||
@ -140,16 +140,16 @@ typedef struct {
|
|||||||
/**
|
/**
|
||||||
Gets the count of block I/O devices that one specific block driver detects.
|
Gets the count of block I/O devices that one specific block driver detects.
|
||||||
|
|
||||||
This function is used for getting the count of block I/O devices that one
|
This function is used for getting the count of block I/O devices that one
|
||||||
specific block driver detects. To the PEI ATAPI driver, it returns the number
|
specific block driver detects. To the PEI ATAPI driver, it returns the number
|
||||||
of all the detected ATAPI devices it detects during the enumeration process.
|
of all the detected ATAPI devices it detects during the enumeration process.
|
||||||
To the PEI legacy floppy driver, it returns the number of all the legacy
|
To the PEI legacy floppy driver, it returns the number of all the legacy
|
||||||
devices it finds during its enumeration process. If no device is detected,
|
devices it finds during its enumeration process. If no device is detected,
|
||||||
then the function will return zero.
|
then the function will return zero.
|
||||||
|
|
||||||
@param[in] PeiServices General-purpose services that are available
|
@param[in] PeiServices General-purpose services that are available
|
||||||
to every PEIM.
|
to every PEIM.
|
||||||
@param[in] This Indicates the EFI_PEI_RECOVERY_BLOCK_IO_PPI
|
@param[in] This Indicates the EFI_PEI_RECOVERY_BLOCK_IO_PPI
|
||||||
instance.
|
instance.
|
||||||
@param[out] NumberBlockDevices The number of block I/O devices discovered.
|
@param[out] NumberBlockDevices The number of block I/O devices discovered.
|
||||||
|
|
||||||
@ -167,27 +167,27 @@ AtapiGetNumberOfBlockDevices (
|
|||||||
/**
|
/**
|
||||||
Gets a block device's media information.
|
Gets a block device's media information.
|
||||||
|
|
||||||
This function will provide the caller with the specified block device's media
|
This function will provide the caller with the specified block device's media
|
||||||
information. If the media changes, calling this function will update the media
|
information. If the media changes, calling this function will update the media
|
||||||
information accordingly.
|
information accordingly.
|
||||||
|
|
||||||
@param[in] PeiServices General-purpose services that are available to every
|
@param[in] PeiServices General-purpose services that are available to every
|
||||||
PEIM
|
PEIM
|
||||||
@param[in] This Indicates the EFI_PEI_RECOVERY_BLOCK_IO_PPI instance.
|
@param[in] This Indicates the EFI_PEI_RECOVERY_BLOCK_IO_PPI instance.
|
||||||
@param[in] DeviceIndex Specifies the block device to which the function wants
|
@param[in] DeviceIndex Specifies the block device to which the function wants
|
||||||
to talk. Because the driver that implements Block I/O
|
to talk. Because the driver that implements Block I/O
|
||||||
PPIs will manage multiple block devices, the PPIs that
|
PPIs will manage multiple block devices, the PPIs that
|
||||||
want to talk to a single device must specify the
|
want to talk to a single device must specify the
|
||||||
device index that was assigned during the enumeration
|
device index that was assigned during the enumeration
|
||||||
process. This index is a number from one to
|
process. This index is a number from one to
|
||||||
NumberBlockDevices.
|
NumberBlockDevices.
|
||||||
@param[out] MediaInfo The media information of the specified block media.
|
@param[out] MediaInfo The media information of the specified block media.
|
||||||
The caller is responsible for the ownership of this
|
The caller is responsible for the ownership of this
|
||||||
data structure.
|
data structure.
|
||||||
|
|
||||||
@retval EFI_SUCCESS Media information about the specified block device
|
@retval EFI_SUCCESS Media information about the specified block device
|
||||||
was obtained successfully.
|
was obtained successfully.
|
||||||
@retval EFI_DEVICE_ERROR Cannot get the media information due to a hardware
|
@retval EFI_DEVICE_ERROR Cannot get the media information due to a hardware
|
||||||
error.
|
error.
|
||||||
@retval Others Other failure occurs.
|
@retval Others Other failure occurs.
|
||||||
|
|
||||||
@ -204,31 +204,31 @@ AtapiGetBlockDeviceMediaInfo (
|
|||||||
/**
|
/**
|
||||||
Reads the requested number of blocks from the specified block device.
|
Reads the requested number of blocks from the specified block device.
|
||||||
|
|
||||||
The function reads the requested number of blocks from the device. All the
|
The function reads the requested number of blocks from the device. All the
|
||||||
blocks are read, or an error is returned. If there is no media in the device,
|
blocks are read, or an error is returned. If there is no media in the device,
|
||||||
the function returns EFI_NO_MEDIA.
|
the function returns EFI_NO_MEDIA.
|
||||||
|
|
||||||
@param[in] PeiServices General-purpose services that are available to
|
@param[in] PeiServices General-purpose services that are available to
|
||||||
every PEIM.
|
every PEIM.
|
||||||
@param[in] This Indicates the EFI_PEI_RECOVERY_BLOCK_IO_PPI instance.
|
@param[in] This Indicates the EFI_PEI_RECOVERY_BLOCK_IO_PPI instance.
|
||||||
@param[in] DeviceIndex Specifies the block device to which the function wants
|
@param[in] DeviceIndex Specifies the block device to which the function wants
|
||||||
to talk. Because the driver that implements Block I/O
|
to talk. Because the driver that implements Block I/O
|
||||||
PPIs will manage multiple block devices, the PPIs that
|
PPIs will manage multiple block devices, the PPIs that
|
||||||
want to talk to a single device must specify the device
|
want to talk to a single device must specify the device
|
||||||
index that was assigned during the enumeration process.
|
index that was assigned during the enumeration process.
|
||||||
This index is a number from one to NumberBlockDevices.
|
This index is a number from one to NumberBlockDevices.
|
||||||
@param[in] StartLBA The starting logical block address (LBA) to read from
|
@param[in] StartLBA The starting logical block address (LBA) to read from
|
||||||
on the device
|
on the device
|
||||||
@param[in] BufferSize The size of the Buffer in bytes. This number must be
|
@param[in] BufferSize The size of the Buffer in bytes. This number must be
|
||||||
a multiple of the intrinsic block size of the device.
|
a multiple of the intrinsic block size of the device.
|
||||||
@param[out] Buffer A pointer to the destination buffer for the data.
|
@param[out] Buffer A pointer to the destination buffer for the data.
|
||||||
The caller is responsible for the ownership of the
|
The caller is responsible for the ownership of the
|
||||||
buffer.
|
buffer.
|
||||||
|
|
||||||
@retval EFI_SUCCESS The data was read correctly from the device.
|
@retval EFI_SUCCESS The data was read correctly from the device.
|
||||||
@retval EFI_DEVICE_ERROR The device reported an error while attempting
|
@retval EFI_DEVICE_ERROR The device reported an error while attempting
|
||||||
to perform the read operation.
|
to perform the read operation.
|
||||||
@retval EFI_INVALID_PARAMETER The read request contains LBAs that are not
|
@retval EFI_INVALID_PARAMETER The read request contains LBAs that are not
|
||||||
valid, or the buffer is not properly aligned.
|
valid, or the buffer is not properly aligned.
|
||||||
@retval EFI_NO_MEDIA There is no media in the device.
|
@retval EFI_NO_MEDIA There is no media in the device.
|
||||||
@retval EFI_BAD_BUFFER_SIZE The BufferSize parameter is not a multiple of
|
@retval EFI_BAD_BUFFER_SIZE The BufferSize parameter is not a multiple of
|
||||||
@ -374,7 +374,7 @@ AtapiEnumerateDevices (
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
Detect Atapi devices.
|
Detect Atapi devices.
|
||||||
|
|
||||||
@param[in] AtapiBlkIoDev A pointer to atapi block IO device.
|
@param[in] AtapiBlkIoDev A pointer to atapi block IO device.
|
||||||
@param[in] DevicePosition An integer to signify device position.
|
@param[in] DevicePosition An integer to signify device position.
|
||||||
@param[out] MediaInfo The media information of the specified block media.
|
@param[out] MediaInfo The media information of the specified block media.
|
||||||
@ -394,7 +394,7 @@ DiscoverAtapiDevice (
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
Detect if an IDE controller exists in specified position.
|
Detect if an IDE controller exists in specified position.
|
||||||
|
|
||||||
@param[in] AtapiBlkIoDev A pointer to atapi block IO device.
|
@param[in] AtapiBlkIoDev A pointer to atapi block IO device.
|
||||||
@param[in] DevicePosition An integer to signify device position.
|
@param[in] DevicePosition An integer to signify device position.
|
||||||
|
|
||||||
@ -410,7 +410,7 @@ DetectIDEController (
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
Wait specified time interval to poll for BSY bit clear in the Status Register.
|
Wait specified time interval to poll for BSY bit clear in the Status Register.
|
||||||
|
|
||||||
@param[in] AtapiBlkIoDev A pointer to atapi block IO device.
|
@param[in] AtapiBlkIoDev A pointer to atapi block IO device.
|
||||||
@param[in] IdeIoRegisters A pointer to IDE IO registers.
|
@param[in] IdeIoRegisters A pointer to IDE IO registers.
|
||||||
@param[in] TimeoutInMilliSeconds Time specified in milliseconds.
|
@param[in] TimeoutInMilliSeconds Time specified in milliseconds.
|
||||||
@ -428,7 +428,7 @@ WaitForBSYClear (
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
Wait specified time interval to poll for DRDY bit set in the Status register.
|
Wait specified time interval to poll for DRDY bit set in the Status register.
|
||||||
|
|
||||||
@param[in] AtapiBlkIoDev A pointer to atapi block IO device.
|
@param[in] AtapiBlkIoDev A pointer to atapi block IO device.
|
||||||
@param[in] IdeIoRegisters A pointer to IDE IO registers.
|
@param[in] IdeIoRegisters A pointer to IDE IO registers.
|
||||||
@param[in] TimeoutInMilliSeconds Time specified in milliseconds.
|
@param[in] TimeoutInMilliSeconds Time specified in milliseconds.
|
||||||
@ -446,7 +446,7 @@ DRDYReady (
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
Wait specified time interval to poll for DRQ bit clear in the Status Register.
|
Wait specified time interval to poll for DRQ bit clear in the Status Register.
|
||||||
|
|
||||||
@param[in] AtapiBlkIoDev A pointer to atapi block IO device.
|
@param[in] AtapiBlkIoDev A pointer to atapi block IO device.
|
||||||
@param[in] IdeIoRegisters A pointer to IDE IO registers.
|
@param[in] IdeIoRegisters A pointer to IDE IO registers.
|
||||||
@param[in] TimeoutInMilliSeconds Time specified in milliseconds.
|
@param[in] TimeoutInMilliSeconds Time specified in milliseconds.
|
||||||
@ -464,7 +464,7 @@ DRQClear (
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
Wait specified time interval to poll for DRQ bit clear in the Alternate Status Register.
|
Wait specified time interval to poll for DRQ bit clear in the Alternate Status Register.
|
||||||
|
|
||||||
@param[in] AtapiBlkIoDev A pointer to atapi block IO device.
|
@param[in] AtapiBlkIoDev A pointer to atapi block IO device.
|
||||||
@param[in] IdeIoRegisters A pointer to IDE IO registers.
|
@param[in] IdeIoRegisters A pointer to IDE IO registers.
|
||||||
@param[in] TimeoutInMilliSeconds Time specified in milliseconds.
|
@param[in] TimeoutInMilliSeconds Time specified in milliseconds.
|
||||||
@ -569,7 +569,7 @@ TestUnitReady (
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
Send out ATAPI commands conforms to the Packet Command with PIO Data In Protocol.
|
Send out ATAPI commands conforms to the Packet Command with PIO Data In Protocol.
|
||||||
|
|
||||||
@param[in] AtapiBlkIoDev A pointer to atapi block IO device.
|
@param[in] AtapiBlkIoDev A pointer to atapi block IO device.
|
||||||
@param[in] DevicePosition An integer to signify device position.
|
@param[in] DevicePosition An integer to signify device position.
|
||||||
@param[in] Packet A pointer to ATAPI command packet.
|
@param[in] Packet A pointer to ATAPI command packet.
|
||||||
@ -613,10 +613,10 @@ Inquiry (
|
|||||||
OUT EFI_PEI_BLOCK_IO2_MEDIA *MediaInfo2
|
OUT EFI_PEI_BLOCK_IO2_MEDIA *MediaInfo2
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Used before read/write blocks from/to ATAPI device media.
|
Used before read/write blocks from/to ATAPI device media.
|
||||||
Since ATAPI device media is removable, it is necessary to detect
|
Since ATAPI device media is removable, it is necessary to detect
|
||||||
whether media is present and get current present media's information.
|
whether media is present and get current present media's information.
|
||||||
|
|
||||||
@param[in] AtapiBlkIoDev A pointer to atapi block IO device.
|
@param[in] AtapiBlkIoDev A pointer to atapi block IO device.
|
||||||
@param[in] DevicePosition An integer to signify device position.
|
@param[in] DevicePosition An integer to signify device position.
|
||||||
@ -636,7 +636,7 @@ DetectMedia (
|
|||||||
IN OUT EFI_PEI_BLOCK_IO2_MEDIA *MediaInfo2
|
IN OUT EFI_PEI_BLOCK_IO2_MEDIA *MediaInfo2
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Reset specified Atapi device.
|
Reset specified Atapi device.
|
||||||
|
|
||||||
@param[in] AtapiBlkIoDev A pointer to atapi block IO device.
|
@param[in] AtapiBlkIoDev A pointer to atapi block IO device.
|
||||||
@ -654,7 +654,7 @@ ResetDevice (
|
|||||||
IN BOOLEAN Extensive
|
IN BOOLEAN Extensive
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Sends out ATAPI Request Sense Packet Command to the specified device.
|
Sends out ATAPI Request Sense Packet Command to the specified device.
|
||||||
|
|
||||||
@param[in] AtapiBlkIoDev A pointer to atapi block IO device.
|
@param[in] AtapiBlkIoDev A pointer to atapi block IO device.
|
||||||
@ -674,7 +674,7 @@ RequestSense (
|
|||||||
IN OUT UINT8 *SenseCounts
|
IN OUT UINT8 *SenseCounts
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Sends out ATAPI Read Capacity Packet Command to the specified device.
|
Sends out ATAPI Read Capacity Packet Command to the specified device.
|
||||||
This command will return the information regarding the capacity of the
|
This command will return the information regarding the capacity of the
|
||||||
media in the device.
|
media in the device.
|
||||||
@ -696,7 +696,7 @@ ReadCapacity (
|
|||||||
IN OUT EFI_PEI_BLOCK_IO2_MEDIA *MediaInfo2
|
IN OUT EFI_PEI_BLOCK_IO2_MEDIA *MediaInfo2
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Perform read from disk in block unit.
|
Perform read from disk in block unit.
|
||||||
|
|
||||||
@param[in] AtapiBlkIoDev A pointer to atapi block IO device.
|
@param[in] AtapiBlkIoDev A pointer to atapi block IO device.
|
||||||
@ -720,7 +720,7 @@ ReadSectors (
|
|||||||
IN UINTN BlockSize
|
IN UINTN BlockSize
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Check if there is media according to sense data.
|
Check if there is media according to sense data.
|
||||||
|
|
||||||
@param[in] SenseData Pointer to sense data.
|
@param[in] SenseData Pointer to sense data.
|
||||||
@ -736,14 +736,14 @@ IsNoMedia (
|
|||||||
IN UINTN SenseCounts
|
IN UINTN SenseCounts
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Check if device state is unclear according to sense data.
|
Check if device state is unclear according to sense data.
|
||||||
|
|
||||||
@param[in] SenseData Pointer to sense data.
|
@param[in] SenseData Pointer to sense data.
|
||||||
@param[in] SenseCounts Count of sense data.
|
@param[in] SenseCounts Count of sense data.
|
||||||
|
|
||||||
@retval TRUE Device state is unclear
|
@retval TRUE Device state is unclear
|
||||||
@retval FALSE Device state is clear
|
@retval FALSE Device state is clear
|
||||||
|
|
||||||
**/
|
**/
|
||||||
BOOLEAN
|
BOOLEAN
|
||||||
@ -752,7 +752,7 @@ IsDeviceStateUnclear (
|
|||||||
IN UINTN SenseCounts
|
IN UINTN SenseCounts
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Check if there is media error according to sense data.
|
Check if there is media error according to sense data.
|
||||||
|
|
||||||
@param[in] SenseData Pointer to sense data.
|
@param[in] SenseData Pointer to sense data.
|
||||||
@ -768,7 +768,7 @@ IsMediaError (
|
|||||||
IN UINTN SenseCounts
|
IN UINTN SenseCounts
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Check if drive is ready according to sense data.
|
Check if drive is ready according to sense data.
|
||||||
|
|
||||||
@param[in] SenseData Pointer to sense data.
|
@param[in] SenseData Pointer to sense data.
|
||||||
|
@ -3,17 +3,17 @@
|
|||||||
//
|
//
|
||||||
// This PPI can be consumed by PEIM which produce gEfiPeiDeviceRecoveryModulePpiGuid
|
// This PPI can be consumed by PEIM which produce gEfiPeiDeviceRecoveryModulePpiGuid
|
||||||
// for Atapi CD ROM device.
|
// for Atapi CD ROM device.
|
||||||
//
|
//
|
||||||
// This module discovers CDROM devices in Legacy and native mode and installs block IO ppis for them.
|
// This module discovers CDROM devices in Legacy and native mode and installs block IO ppis for them.
|
||||||
//
|
//
|
||||||
// Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>
|
// Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||||
//
|
//
|
||||||
// This program and the accompanying materials
|
// This program and the accompanying materials
|
||||||
// are licensed and made available under the terms and conditions
|
// are licensed and made available under the terms and conditions
|
||||||
// of the BSD License which accompanies this distribution. The
|
// of the BSD License which accompanies this distribution. The
|
||||||
// full text of the license may be found at
|
// full text of the license may be found at
|
||||||
// http://opensource.org/licenses/bsd-license.php
|
// http://opensource.org/licenses/bsd-license.php
|
||||||
//
|
//
|
||||||
// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||||
// WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
// WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||||
//
|
//
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// /** @file
|
// /** @file
|
||||||
// IdeBusPei Localized Strings and Content
|
// IdeBusPei Localized Strings and Content
|
||||||
//
|
//
|
||||||
// Copyright (c) 2013 - 2014, Intel Corporation. All rights reserved.<BR>
|
// Copyright (c) 2013 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||||
//
|
//
|
||||||
// This program and the accompanying materials
|
// This program and the accompanying materials
|
||||||
// are licensed and made available under the terms and conditions
|
// are licensed and made available under the terms and conditions
|
||||||
@ -14,8 +14,8 @@
|
|||||||
//
|
//
|
||||||
// **/
|
// **/
|
||||||
|
|
||||||
#string STR_PROPERTIES_MODULE_NAME
|
#string STR_PROPERTIES_MODULE_NAME
|
||||||
#language en-US
|
#language en-US
|
||||||
"IDE Bus PEI Module for Recovery"
|
"IDE Bus PEI Module for Recovery"
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/** @file
|
/** @file
|
||||||
This module is one template module for Incompatible PCI Device Support protocol.
|
This module is one template module for Incompatible PCI Device Support protocol.
|
||||||
It includes one incompatible pci devices list template.
|
It includes one incompatible pci devices list template.
|
||||||
|
|
||||||
Incompatible PCI Device Support protocol allows the PCI bus driver to support
|
Incompatible PCI Device Support protocol allows the PCI bus driver to support
|
||||||
resource allocation for some PCI devices that do not comply with the PCI Specification.
|
resource allocation for some PCI devices that do not comply with the PCI Specification.
|
||||||
|
|
||||||
@ -68,7 +68,7 @@ typedef struct {
|
|||||||
the configuration requirement.
|
the configuration requirement.
|
||||||
|
|
||||||
@retval EFI_SUCCESS Successfully got ACPI resource for specified PCI device.
|
@retval EFI_SUCCESS Successfully got ACPI resource for specified PCI device.
|
||||||
@retval EFI_INVALID_PARAMETER Configuration is NULL.
|
@retval EFI_INVALID_PARAMETER Configuration is NULL.
|
||||||
@retval EFI_OUT_OF_RESOURCES No memory available.
|
@retval EFI_OUT_OF_RESOURCES No memory available.
|
||||||
@retval EFI_UNSUPPORTED The specified PCI device wasn't supported.
|
@retval EFI_UNSUPPORTED The specified PCI device wasn't supported.
|
||||||
|
|
||||||
@ -233,7 +233,7 @@ IncompatiblePciDeviceSupportEntryPoint (
|
|||||||
the configuration requirement.
|
the configuration requirement.
|
||||||
|
|
||||||
@retval EFI_SUCCESS Successfully got ACPI resource for specified PCI device.
|
@retval EFI_SUCCESS Successfully got ACPI resource for specified PCI device.
|
||||||
@retval EFI_INVALID_PARAMETER Configuration is NULL.
|
@retval EFI_INVALID_PARAMETER Configuration is NULL.
|
||||||
@retval EFI_OUT_OF_RESOURCES No memory available.
|
@retval EFI_OUT_OF_RESOURCES No memory available.
|
||||||
@retval EFI_UNSUPPORTED The specified PCI device wasn't supported.
|
@retval EFI_UNSUPPORTED The specified PCI device wasn't supported.
|
||||||
|
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
## @file
|
## @file
|
||||||
# PCI Incompatible device support module template.
|
# PCI Incompatible device support module template.
|
||||||
#
|
#
|
||||||
# Installs EFI PCI Incompatible Device Support protocol and includes one incompatile
|
# Installs EFI PCI Incompatible Device Support protocol and includes one incompatile
|
||||||
# pci devices list template.
|
# pci devices list template.
|
||||||
#
|
#
|
||||||
# Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.<BR>
|
# Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||||
#
|
#
|
||||||
# This program and the accompanying materials
|
# This program and the accompanying materials
|
||||||
# are licensed and made available under the terms and conditions of the BSD License
|
# are licensed and made available under the terms and conditions of the BSD License
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// /** @file
|
// /** @file
|
||||||
// IncompatiblePciDeviceSupport Localized Strings and Content
|
// IncompatiblePciDeviceSupport Localized Strings and Content
|
||||||
//
|
//
|
||||||
// Copyright (c) 2013 - 2014, Intel Corporation. All rights reserved.<BR>
|
// Copyright (c) 2013 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||||
//
|
//
|
||||||
// This program and the accompanying materials
|
// This program and the accompanying materials
|
||||||
// are licensed and made available under the terms and conditions of the BSD License
|
// are licensed and made available under the terms and conditions of the BSD License
|
||||||
@ -12,8 +12,8 @@
|
|||||||
//
|
//
|
||||||
// **/
|
// **/
|
||||||
|
|
||||||
#string STR_PROPERTIES_MODULE_NAME
|
#string STR_PROPERTIES_MODULE_NAME
|
||||||
#language en-US
|
#language en-US
|
||||||
"Incompatible PCI Device Support DXE Driver"
|
"Incompatible PCI Device Support DXE Driver"
|
||||||
|
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
# NvmExpressDxe driver is used to manage non-volatile memory subsystem which follows
|
# NvmExpressDxe driver is used to manage non-volatile memory subsystem which follows
|
||||||
# NVM Express specification.
|
# NVM Express specification.
|
||||||
#
|
#
|
||||||
# Copyright (c) 2013 - 2017, Intel Corporation. All rights reserved.<BR>
|
# Copyright (c) 2013 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||||
#
|
#
|
||||||
# This program and the accompanying materials
|
# This program and the accompanying materials
|
||||||
# are licensed and made available under the terms and conditions of the BSD License
|
# are licensed and made available under the terms and conditions of the BSD License
|
||||||
@ -78,4 +78,4 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
[UserExtensions.TianoCore."ExtraFiles"]
|
[UserExtensions.TianoCore."ExtraFiles"]
|
||||||
NvmExpressDxeExtra.uni
|
NvmExpressDxeExtra.uni
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// /** @file
|
// /** @file
|
||||||
// NvmExpressDxe Localized Strings and Content
|
// NvmExpressDxe Localized Strings and Content
|
||||||
//
|
//
|
||||||
// Copyright (c) 2014, Intel Corporation. All rights reserved.<BR>
|
// Copyright (c) 2014 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||||
//
|
//
|
||||||
// This program and the accompanying materials
|
// This program and the accompanying materials
|
||||||
// are licensed and made available under the terms and conditions of the BSD License
|
// are licensed and made available under the terms and conditions of the BSD License
|
||||||
@ -12,8 +12,8 @@
|
|||||||
//
|
//
|
||||||
// **/
|
// **/
|
||||||
|
|
||||||
#string STR_PROPERTIES_MODULE_NAME
|
#string STR_PROPERTIES_MODULE_NAME
|
||||||
#language en-US
|
#language en-US
|
||||||
"NVM Express DXE Driver"
|
"NVM Express DXE Driver"
|
||||||
|
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
NvmExpressDxe driver is used to manage non-volatile memory subsystem which follows
|
NvmExpressDxe driver is used to manage non-volatile memory subsystem which follows
|
||||||
NVM Express specification.
|
NVM Express specification.
|
||||||
|
|
||||||
Copyright (c) 2013 - 2017, Intel Corporation. All rights reserved.<BR>
|
Copyright (c) 2013 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||||
This program and the accompanying materials
|
This program and the accompanying materials
|
||||||
are licensed and made available under the terms and conditions of the BSD License
|
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
|
which accompanies this distribution. The full text of the license may be found at
|
||||||
@ -1003,7 +1003,7 @@ NvmeControllerInit (
|
|||||||
//
|
//
|
||||||
if (Private->ControllerData == NULL) {
|
if (Private->ControllerData == NULL) {
|
||||||
Private->ControllerData = (NVME_ADMIN_CONTROLLER_DATA *)AllocateZeroPool (sizeof(NVME_ADMIN_CONTROLLER_DATA));
|
Private->ControllerData = (NVME_ADMIN_CONTROLLER_DATA *)AllocateZeroPool (sizeof(NVME_ADMIN_CONTROLLER_DATA));
|
||||||
|
|
||||||
if (Private->ControllerData == NULL) {
|
if (Private->ControllerData == NULL) {
|
||||||
return EFI_OUT_OF_RESOURCES;
|
return EFI_OUT_OF_RESOURCES;
|
||||||
}
|
}
|
||||||
|
@ -781,7 +781,7 @@ NvmExpressPassThru (
|
|||||||
// Copy the Respose Queue entry for this command to the callers response buffer
|
// Copy the Respose Queue entry for this command to the callers response buffer
|
||||||
//
|
//
|
||||||
CopyMem(Packet->NvmeCompletion, Cq, sizeof(EFI_NVM_EXPRESS_COMPLETION));
|
CopyMem(Packet->NvmeCompletion, Cq, sizeof(EFI_NVM_EXPRESS_COMPLETION));
|
||||||
|
|
||||||
//
|
//
|
||||||
// Dump every completion entry status for debugging.
|
// Dump every completion entry status for debugging.
|
||||||
//
|
//
|
||||||
|
@ -140,7 +140,7 @@ PciBusDriverBindingSupported (
|
|||||||
//
|
//
|
||||||
if (RemainingDevicePath != NULL) {
|
if (RemainingDevicePath != NULL) {
|
||||||
//
|
//
|
||||||
// Check if RemainingDevicePath is the End of Device Path Node,
|
// Check if RemainingDevicePath is the End of Device Path Node,
|
||||||
// if yes, go on checking other conditions
|
// if yes, go on checking other conditions
|
||||||
//
|
//
|
||||||
if (!IsDevicePathEnd (RemainingDevicePath)) {
|
if (!IsDevicePathEnd (RemainingDevicePath)) {
|
||||||
@ -254,7 +254,7 @@ PciBusDriverBindingStart (
|
|||||||
//
|
//
|
||||||
if (RemainingDevicePath != NULL) {
|
if (RemainingDevicePath != NULL) {
|
||||||
//
|
//
|
||||||
// Check if RemainingDevicePath is the End of Device Path Node,
|
// Check if RemainingDevicePath is the End of Device Path Node,
|
||||||
// if yes, return EFI_SUCCESS
|
// if yes, return EFI_SUCCESS
|
||||||
//
|
//
|
||||||
if (IsDevicePathEnd (RemainingDevicePath)) {
|
if (IsDevicePathEnd (RemainingDevicePath)) {
|
||||||
@ -282,14 +282,14 @@ PciBusDriverBindingStart (
|
|||||||
//
|
//
|
||||||
// If PCI Platform protocol doesn't exist, try to Pci Override Protocol.
|
// If PCI Platform protocol doesn't exist, try to Pci Override Protocol.
|
||||||
//
|
//
|
||||||
if (gPciPlatformProtocol == NULL) {
|
if (gPciPlatformProtocol == NULL) {
|
||||||
gPciOverrideProtocol = NULL;
|
gPciOverrideProtocol = NULL;
|
||||||
gBS->LocateProtocol (
|
gBS->LocateProtocol (
|
||||||
&gEfiPciOverrideProtocolGuid,
|
&gEfiPciOverrideProtocolGuid,
|
||||||
NULL,
|
NULL,
|
||||||
(VOID **) &gPciOverrideProtocol
|
(VOID **) &gPciOverrideProtocol
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mIoMmuProtocol == NULL) {
|
if (mIoMmuProtocol == NULL) {
|
||||||
gBS->LocateProtocol (
|
gBS->LocateProtocol (
|
||||||
@ -315,7 +315,7 @@ PciBusDriverBindingStart (
|
|||||||
This->DriverBindingHandle,
|
This->DriverBindingHandle,
|
||||||
Controller,
|
Controller,
|
||||||
EFI_OPEN_PROTOCOL_GET_PROTOCOL
|
EFI_OPEN_PROTOCOL_GET_PROTOCOL
|
||||||
);
|
);
|
||||||
ASSERT_EFI_ERROR (Status);
|
ASSERT_EFI_ERROR (Status);
|
||||||
|
|
||||||
//
|
//
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
# The PCI bus driver will probe all PCI devices and allocate MMIO and IO space for these devices.
|
# The PCI bus driver will probe all PCI devices and allocate MMIO and IO space for these devices.
|
||||||
# Please use PCD feature flag PcdPciBusHotplugDeviceSupport to enable hot plug supporting.
|
# Please use PCD feature flag PcdPciBusHotplugDeviceSupport to enable hot plug supporting.
|
||||||
#
|
#
|
||||||
# Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.<BR>
|
# Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||||
#
|
#
|
||||||
# This program and the accompanying materials
|
# This program and the accompanying materials
|
||||||
# are licensed and made available under the terms and conditions of the BSD License
|
# are licensed and made available under the terms and conditions of the BSD License
|
||||||
@ -90,8 +90,8 @@
|
|||||||
gEfiPciHotPlugInitProtocolGuid ## SOMETIMES_CONSUMES
|
gEfiPciHotPlugInitProtocolGuid ## SOMETIMES_CONSUMES
|
||||||
gEfiPciHostBridgeResourceAllocationProtocolGuid ## TO_START
|
gEfiPciHostBridgeResourceAllocationProtocolGuid ## TO_START
|
||||||
gEfiPciPlatformProtocolGuid ## SOMETIMES_CONSUMES
|
gEfiPciPlatformProtocolGuid ## SOMETIMES_CONSUMES
|
||||||
gEfiPciOverrideProtocolGuid ## SOMETIMES_CONSUMES
|
gEfiPciOverrideProtocolGuid ## SOMETIMES_CONSUMES
|
||||||
gEfiPciEnumerationCompleteProtocolGuid ## PRODUCES
|
gEfiPciEnumerationCompleteProtocolGuid ## PRODUCES
|
||||||
gEfiPciRootBridgeIoProtocolGuid ## TO_START
|
gEfiPciRootBridgeIoProtocolGuid ## TO_START
|
||||||
gEfiIncompatiblePciDeviceSupportProtocolGuid ## SOMETIMES_CONSUMES
|
gEfiIncompatiblePciDeviceSupportProtocolGuid ## SOMETIMES_CONSUMES
|
||||||
gEfiLoadFile2ProtocolGuid ## SOMETIMES_PRODUCES
|
gEfiLoadFile2ProtocolGuid ## SOMETIMES_PRODUCES
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// /** @file
|
// /** @file
|
||||||
// PciBusDxe Localized Strings and Content
|
// PciBusDxe Localized Strings and Content
|
||||||
//
|
//
|
||||||
// Copyright (c) 2013 - 2014, Intel Corporation. All rights reserved.<BR>
|
// Copyright (c) 2013 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||||
//
|
//
|
||||||
// This program and the accompanying materials
|
// This program and the accompanying materials
|
||||||
// are licensed and made available under the terms and conditions of the BSD License
|
// are licensed and made available under the terms and conditions of the BSD License
|
||||||
@ -12,8 +12,8 @@
|
|||||||
//
|
//
|
||||||
// **/
|
// **/
|
||||||
|
|
||||||
#string STR_PROPERTIES_MODULE_NAME
|
#string STR_PROPERTIES_MODULE_NAME
|
||||||
#language en-US
|
#language en-US
|
||||||
"PCI Bus DXE Driver"
|
"PCI Bus DXE Driver"
|
||||||
|
|
||||||
|
|
||||||
|
@ -236,7 +236,7 @@ RegisterPciDevice (
|
|||||||
PciIo = &(PciIoDevice->PciIo);
|
PciIo = &(PciIoDevice->PciIo);
|
||||||
Data8 = PCI_INT_LINE_UNKNOWN;
|
Data8 = PCI_INT_LINE_UNKNOWN;
|
||||||
PciIo->Pci.Write (PciIo, EfiPciIoWidthUint8, 0x3C, 1, &Data8);
|
PciIo->Pci.Write (PciIo, EfiPciIoWidthUint8, 0x3C, 1, &Data8);
|
||||||
|
|
||||||
//
|
//
|
||||||
// Process OpRom
|
// Process OpRom
|
||||||
//
|
//
|
||||||
@ -296,7 +296,7 @@ RegisterPciDevice (
|
|||||||
PciIoDevice->PciIo.RomImage,
|
PciIoDevice->PciIo.RomImage,
|
||||||
PciIoDevice->PciIo.RomSize
|
PciIoDevice->PciIo.RomSize
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -187,7 +187,7 @@ PciRootBridgeEnumerator (
|
|||||||
AddrRangeMin = Configuration1->AddrRangeMin;
|
AddrRangeMin = Configuration1->AddrRangeMin;
|
||||||
Configuration1->AddrRangeMin = Configuration2->AddrRangeMin;
|
Configuration1->AddrRangeMin = Configuration2->AddrRangeMin;
|
||||||
Configuration2->AddrRangeMin = AddrRangeMin;
|
Configuration2->AddrRangeMin = AddrRangeMin;
|
||||||
|
|
||||||
AddrLen = Configuration1->AddrLen;
|
AddrLen = Configuration1->AddrLen;
|
||||||
Configuration1->AddrLen = Configuration2->AddrLen;
|
Configuration1->AddrLen = Configuration2->AddrLen;
|
||||||
Configuration2->AddrLen = AddrLen;
|
Configuration2->AddrLen = AddrLen;
|
||||||
@ -234,7 +234,7 @@ PciRootBridgeEnumerator (
|
|||||||
Status = PciAllocateBusNumber (RootBridgeDev, SubBusNumber, PaddedBusRange, &SubBusNumber);
|
Status = PciAllocateBusNumber (RootBridgeDev, SubBusNumber, PaddedBusRange, &SubBusNumber);
|
||||||
if (EFI_ERROR (Status)) {
|
if (EFI_ERROR (Status)) {
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Find the bus range which contains the higest bus number, then returns the number of buses
|
// Find the bus range which contains the higest bus number, then returns the number of buses
|
||||||
@ -252,7 +252,7 @@ PciRootBridgeEnumerator (
|
|||||||
Configuration++;
|
Configuration++;
|
||||||
Desc = Configuration->Desc;
|
Desc = Configuration->Desc;
|
||||||
Configuration->Desc = ACPI_END_TAG_DESCRIPTOR;
|
Configuration->Desc = ACPI_END_TAG_DESCRIPTOR;
|
||||||
|
|
||||||
//
|
//
|
||||||
// Set bus number
|
// Set bus number
|
||||||
//
|
//
|
||||||
@ -267,7 +267,7 @@ PciRootBridgeEnumerator (
|
|||||||
//
|
//
|
||||||
Configuration->Desc = Desc;
|
Configuration->Desc = Desc;
|
||||||
(Configuration - 1)->AddrLen = AddrLen;
|
(Configuration - 1)->AddrLen = AddrLen;
|
||||||
|
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1812,7 +1812,7 @@ NotifyPhase (
|
|||||||
Phase,
|
Phase,
|
||||||
ChipsetEntry
|
ChipsetEntry
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Status = PciResAlloc->NotifyPhase (
|
Status = PciResAlloc->NotifyPhase (
|
||||||
PciResAlloc,
|
PciResAlloc,
|
||||||
@ -2043,7 +2043,7 @@ PciHotPlugRequestNotify (
|
|||||||
return EFI_INVALID_PARAMETER;
|
return EFI_INVALID_PARAMETER;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Status = gBS->OpenProtocol (
|
Status = gBS->OpenProtocol (
|
||||||
Controller,
|
Controller,
|
||||||
&gEfiPciIoProtocolGuid,
|
&gEfiPciIoProtocolGuid,
|
||||||
|
@ -1736,7 +1736,7 @@ PciIovParseVfBar (
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Check the length again so as to keep compatible with some special bars
|
// Check the length again so as to keep compatible with some special bars
|
||||||
//
|
//
|
||||||
@ -1745,7 +1745,7 @@ PciIovParseVfBar (
|
|||||||
PciIoDevice->VfPciBar[BarIndex].BaseAddress = 0;
|
PciIoDevice->VfPciBar[BarIndex].BaseAddress = 0;
|
||||||
PciIoDevice->VfPciBar[BarIndex].Alignment = 0;
|
PciIoDevice->VfPciBar[BarIndex].Alignment = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Increment number of bar
|
// Increment number of bar
|
||||||
//
|
//
|
||||||
@ -2185,7 +2185,7 @@ CreatePciIoDevice (
|
|||||||
//
|
//
|
||||||
ParentPciIo = &Bridge->PciIo;
|
ParentPciIo = &Bridge->PciIo;
|
||||||
ParentPciIo->Pci.Read (
|
ParentPciIo->Pci.Read (
|
||||||
ParentPciIo,
|
ParentPciIo,
|
||||||
EfiPciIoWidthUint32,
|
EfiPciIoWidthUint32,
|
||||||
Bridge->PciExpressCapabilityOffset + EFI_PCIE_CAPABILITY_DEVICE_CAPABILITIES_2_OFFSET,
|
Bridge->PciExpressCapabilityOffset + EFI_PCIE_CAPABILITY_DEVICE_CAPABILITIES_2_OFFSET,
|
||||||
1,
|
1,
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/** @file
|
/** @file
|
||||||
EFI PCI IO protocol functions implementation for PCI Bus module.
|
EFI PCI IO protocol functions implementation for PCI Bus module.
|
||||||
|
|
||||||
Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.<BR>
|
Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||||
This program and the accompanying materials
|
This program and the accompanying materials
|
||||||
are licensed and made available under the terms and conditions of the BSD License
|
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
|
which accompanies this distribution. The full text of the license may be found at
|
||||||
@ -232,7 +232,7 @@ PciIoPollMem (
|
|||||||
|
|
||||||
//
|
//
|
||||||
// If request is not aligned, then convert request to EfiPciIoWithXXXUint8
|
// If request is not aligned, then convert request to EfiPciIoWithXXXUint8
|
||||||
//
|
//
|
||||||
if (FeaturePcdGet (PcdUnalignedPciIoEnable)) {
|
if (FeaturePcdGet (PcdUnalignedPciIoEnable)) {
|
||||||
if ((Offset & ((1 << (Width & 0x03)) - 1)) != 0) {
|
if ((Offset & ((1 << (Width & 0x03)) - 1)) != 0) {
|
||||||
Status = PciIoMemRead (This, Width, BarIndex, Offset, 1, Result);
|
Status = PciIoMemRead (This, Width, BarIndex, Offset, 1, Result);
|
||||||
@ -262,7 +262,7 @@ PciIoPollMem (
|
|||||||
} while (TRUE);
|
} while (TRUE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Status = PciIoDevice->PciRootBridgeIo->PollMem (
|
Status = PciIoDevice->PciRootBridgeIo->PollMem (
|
||||||
PciIoDevice->PciRootBridgeIo,
|
PciIoDevice->PciRootBridgeIo,
|
||||||
(EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH) Width,
|
(EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH) Width,
|
||||||
@ -335,7 +335,7 @@ PciIoPollIo (
|
|||||||
|
|
||||||
//
|
//
|
||||||
// If request is not aligned, then convert request to EfiPciIoWithXXXUint8
|
// If request is not aligned, then convert request to EfiPciIoWithXXXUint8
|
||||||
//
|
//
|
||||||
if (FeaturePcdGet (PcdUnalignedPciIoEnable)) {
|
if (FeaturePcdGet (PcdUnalignedPciIoEnable)) {
|
||||||
if ((Offset & ((1 << (Width & 0x03)) - 1)) != 0) {
|
if ((Offset & ((1 << (Width & 0x03)) - 1)) != 0) {
|
||||||
Status = PciIoIoRead (This, Width, BarIndex, Offset, 1, Result);
|
Status = PciIoIoRead (This, Width, BarIndex, Offset, 1, Result);
|
||||||
@ -365,7 +365,7 @@ PciIoPollIo (
|
|||||||
} while (TRUE);
|
} while (TRUE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Status = PciIoDevice->PciRootBridgeIo->PollIo (
|
Status = PciIoDevice->PciRootBridgeIo->PollIo (
|
||||||
PciIoDevice->PciRootBridgeIo,
|
PciIoDevice->PciRootBridgeIo,
|
||||||
(EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH) Width,
|
(EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH) Width,
|
||||||
@ -438,14 +438,14 @@ PciIoMemRead (
|
|||||||
|
|
||||||
//
|
//
|
||||||
// If request is not aligned, then convert request to EfiPciIoWithXXXUint8
|
// If request is not aligned, then convert request to EfiPciIoWithXXXUint8
|
||||||
//
|
//
|
||||||
if (FeaturePcdGet (PcdUnalignedPciIoEnable)) {
|
if (FeaturePcdGet (PcdUnalignedPciIoEnable)) {
|
||||||
if ((Offset & ((1 << (Width & 0x03)) - 1)) != 0) {
|
if ((Offset & ((1 << (Width & 0x03)) - 1)) != 0) {
|
||||||
Count *= (UINTN)(1 << (Width & 0x03));
|
Count *= (UINTN)(1 << (Width & 0x03));
|
||||||
Width = (EFI_PCI_IO_PROTOCOL_WIDTH) (Width & (~0x03));
|
Width = (EFI_PCI_IO_PROTOCOL_WIDTH) (Width & (~0x03));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Status = PciIoDevice->PciRootBridgeIo->Mem.Read (
|
Status = PciIoDevice->PciRootBridgeIo->Mem.Read (
|
||||||
PciIoDevice->PciRootBridgeIo,
|
PciIoDevice->PciRootBridgeIo,
|
||||||
@ -517,7 +517,7 @@ PciIoMemWrite (
|
|||||||
|
|
||||||
//
|
//
|
||||||
// If request is not aligned, then convert request to EfiPciIoWithXXXUint8
|
// If request is not aligned, then convert request to EfiPciIoWithXXXUint8
|
||||||
//
|
//
|
||||||
if (FeaturePcdGet (PcdUnalignedPciIoEnable)) {
|
if (FeaturePcdGet (PcdUnalignedPciIoEnable)) {
|
||||||
if ((Offset & ((1 << (Width & 0x03)) - 1)) != 0) {
|
if ((Offset & ((1 << (Width & 0x03)) - 1)) != 0) {
|
||||||
Count *= (UINTN)(1 << (Width & 0x03));
|
Count *= (UINTN)(1 << (Width & 0x03));
|
||||||
@ -595,13 +595,13 @@ PciIoIoRead (
|
|||||||
|
|
||||||
//
|
//
|
||||||
// If request is not aligned, then convert request to EfiPciIoWithXXXUint8
|
// If request is not aligned, then convert request to EfiPciIoWithXXXUint8
|
||||||
//
|
//
|
||||||
if (FeaturePcdGet (PcdUnalignedPciIoEnable)) {
|
if (FeaturePcdGet (PcdUnalignedPciIoEnable)) {
|
||||||
if ((Offset & ((1 << (Width & 0x03)) - 1)) != 0) {
|
if ((Offset & ((1 << (Width & 0x03)) - 1)) != 0) {
|
||||||
Count *= (UINTN)(1 << (Width & 0x03));
|
Count *= (UINTN)(1 << (Width & 0x03));
|
||||||
Width = (EFI_PCI_IO_PROTOCOL_WIDTH) (Width & (~0x03));
|
Width = (EFI_PCI_IO_PROTOCOL_WIDTH) (Width & (~0x03));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Status = PciIoDevice->PciRootBridgeIo->Io.Read (
|
Status = PciIoDevice->PciRootBridgeIo->Io.Read (
|
||||||
PciIoDevice->PciRootBridgeIo,
|
PciIoDevice->PciRootBridgeIo,
|
||||||
@ -673,13 +673,13 @@ PciIoIoWrite (
|
|||||||
|
|
||||||
//
|
//
|
||||||
// If request is not aligned, then convert request to EfiPciIoWithXXXUint8
|
// If request is not aligned, then convert request to EfiPciIoWithXXXUint8
|
||||||
//
|
//
|
||||||
if (FeaturePcdGet (PcdUnalignedPciIoEnable)) {
|
if (FeaturePcdGet (PcdUnalignedPciIoEnable)) {
|
||||||
if ((Offset & ((1 << (Width & 0x03)) - 1)) != 0) {
|
if ((Offset & ((1 << (Width & 0x03)) - 1)) != 0) {
|
||||||
Count *= (UINTN)(1 << (Width & 0x03));
|
Count *= (UINTN)(1 << (Width & 0x03));
|
||||||
Width = (EFI_PCI_IO_PROTOCOL_WIDTH) (Width & (~0x03));
|
Width = (EFI_PCI_IO_PROTOCOL_WIDTH) (Width & (~0x03));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Status = PciIoDevice->PciRootBridgeIo->Io.Write (
|
Status = PciIoDevice->PciRootBridgeIo->Io.Write (
|
||||||
PciIoDevice->PciRootBridgeIo,
|
PciIoDevice->PciRootBridgeIo,
|
||||||
@ -739,16 +739,16 @@ PciIoConfigRead (
|
|||||||
if (EFI_ERROR (Status)) {
|
if (EFI_ERROR (Status)) {
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// If request is not aligned, then convert request to EfiPciIoWithXXXUint8
|
// If request is not aligned, then convert request to EfiPciIoWithXXXUint8
|
||||||
//
|
//
|
||||||
if (FeaturePcdGet (PcdUnalignedPciIoEnable)) {
|
if (FeaturePcdGet (PcdUnalignedPciIoEnable)) {
|
||||||
if ((Offset & ((1 << (Width & 0x03)) - 1)) != 0) {
|
if ((Offset & ((1 << (Width & 0x03)) - 1)) != 0) {
|
||||||
Count *= (UINTN)(1 << (Width & 0x03));
|
Count *= (UINTN)(1 << (Width & 0x03));
|
||||||
Width = (EFI_PCI_IO_PROTOCOL_WIDTH) (Width & (~0x03));
|
Width = (EFI_PCI_IO_PROTOCOL_WIDTH) (Width & (~0x03));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Status = PciIoDevice->PciRootBridgeIo->Pci.Read (
|
Status = PciIoDevice->PciRootBridgeIo->Pci.Read (
|
||||||
PciIoDevice->PciRootBridgeIo,
|
PciIoDevice->PciRootBridgeIo,
|
||||||
@ -811,14 +811,14 @@ PciIoConfigWrite (
|
|||||||
|
|
||||||
//
|
//
|
||||||
// If request is not aligned, then convert request to EfiPciIoWithXXXUint8
|
// If request is not aligned, then convert request to EfiPciIoWithXXXUint8
|
||||||
//
|
//
|
||||||
if (FeaturePcdGet (PcdUnalignedPciIoEnable)) {
|
if (FeaturePcdGet (PcdUnalignedPciIoEnable)) {
|
||||||
if ((Offset & ((1 << (Width & 0x03)) - 1)) != 0) {
|
if ((Offset & ((1 << (Width & 0x03)) - 1)) != 0) {
|
||||||
Count *= (UINTN)(1 << (Width & 0x03));
|
Count *= (UINTN)(1 << (Width & 0x03));
|
||||||
Width = (EFI_PCI_IO_PROTOCOL_WIDTH) (Width & (~0x03));
|
Width = (EFI_PCI_IO_PROTOCOL_WIDTH) (Width & (~0x03));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Status = PciIoDevice->PciRootBridgeIo->Pci.Write (
|
Status = PciIoDevice->PciRootBridgeIo->Pci.Write (
|
||||||
PciIoDevice->PciRootBridgeIo,
|
PciIoDevice->PciRootBridgeIo,
|
||||||
(EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH) Width,
|
(EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH) Width,
|
||||||
@ -910,13 +910,13 @@ PciIoCopyMem (
|
|||||||
|
|
||||||
//
|
//
|
||||||
// If request is not aligned, then convert request to EfiPciIoWithXXXUint8
|
// If request is not aligned, then convert request to EfiPciIoWithXXXUint8
|
||||||
//
|
//
|
||||||
if (FeaturePcdGet (PcdUnalignedPciIoEnable)) {
|
if (FeaturePcdGet (PcdUnalignedPciIoEnable)) {
|
||||||
if ((SrcOffset & ((1 << (Width & 0x03)) - 1)) != 0 || (DestOffset & ((1 << (Width & 0x03)) - 1)) != 0) {
|
if ((SrcOffset & ((1 << (Width & 0x03)) - 1)) != 0 || (DestOffset & ((1 << (Width & 0x03)) - 1)) != 0) {
|
||||||
Count *= (UINTN)(1 << (Width & 0x03));
|
Count *= (UINTN)(1 << (Width & 0x03));
|
||||||
Width = (EFI_PCI_IO_PROTOCOL_WIDTH) (Width & (~0x03));
|
Width = (EFI_PCI_IO_PROTOCOL_WIDTH) (Width & (~0x03));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Status = PciIoDevice->PciRootBridgeIo->CopyMem (
|
Status = PciIoDevice->PciRootBridgeIo->CopyMem (
|
||||||
PciIoDevice->PciRootBridgeIo,
|
PciIoDevice->PciRootBridgeIo,
|
||||||
@ -1790,7 +1790,7 @@ PciIoAttributes (
|
|||||||
@param AddrRangeMin The base address of the MMIO.
|
@param AddrRangeMin The base address of the MMIO.
|
||||||
@param AddrLen The length of the MMIO.
|
@param AddrLen The length of the MMIO.
|
||||||
|
|
||||||
@retval The AddrTranslationOffset from RootBridgeIo for the
|
@retval The AddrTranslationOffset from RootBridgeIo for the
|
||||||
specified range, or (UINT64) -1 if the range is not
|
specified range, or (UINT64) -1 if the range is not
|
||||||
found in RootBridgeIo.
|
found in RootBridgeIo.
|
||||||
**/
|
**/
|
||||||
|
@ -269,11 +269,11 @@ DumpBridgeResource (
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
Find the corresponding resource node for the Device in child list of BridgeResource.
|
Find the corresponding resource node for the Device in child list of BridgeResource.
|
||||||
|
|
||||||
@param[in] Device Pointer to PCI_IO_DEVICE.
|
@param[in] Device Pointer to PCI_IO_DEVICE.
|
||||||
@param[in] BridgeResource Pointer to PCI_RESOURCE_NODE.
|
@param[in] BridgeResource Pointer to PCI_RESOURCE_NODE.
|
||||||
@param[out] DeviceResources Pointer to a buffer to receive resources for the Device.
|
@param[out] DeviceResources Pointer to a buffer to receive resources for the Device.
|
||||||
|
|
||||||
@return Count of the resource descriptors returned.
|
@return Count of the resource descriptors returned.
|
||||||
**/
|
**/
|
||||||
UINTN
|
UINTN
|
||||||
@ -306,7 +306,7 @@ FindResourceNode (
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
Dump the resource map of all the devices under Bridge.
|
Dump the resource map of all the devices under Bridge.
|
||||||
|
|
||||||
@param[in] Bridge Bridge device instance.
|
@param[in] Bridge Bridge device instance.
|
||||||
@param[in] Resources Resource descriptors for the bridge device.
|
@param[in] Resources Resource descriptors for the bridge device.
|
||||||
@param[in] ResourceCount Count of resource descriptors.
|
@param[in] ResourceCount Count of resource descriptors.
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/** @file
|
/** @file
|
||||||
PCI Rom supporting funtions implementation for PCI Bus module.
|
PCI Rom supporting funtions implementation for PCI Bus module.
|
||||||
|
|
||||||
Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.<BR>
|
Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||||
This program and the accompanying materials
|
This program and the accompanying materials
|
||||||
are licensed and made available under the terms and conditions of the BSD License
|
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
|
which accompanies this distribution. The full text of the license may be found at
|
||||||
@ -342,7 +342,7 @@ ContainEfiImage (
|
|||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// The PCI Data Structure must be DWORD aligned.
|
// The PCI Data Structure must be DWORD aligned.
|
||||||
//
|
//
|
||||||
if (RomHeader->PcirOffset == 0 ||
|
if (RomHeader->PcirOffset == 0 ||
|
||||||
(RomHeader->PcirOffset & 3) != 0 ||
|
(RomHeader->PcirOffset & 3) != 0 ||
|
||||||
@ -471,8 +471,8 @@ LoadOpRomImage (
|
|||||||
FirstCheck = FALSE;
|
FirstCheck = FALSE;
|
||||||
OffsetPcir = RomHeader->PcirOffset;
|
OffsetPcir = RomHeader->PcirOffset;
|
||||||
//
|
//
|
||||||
// If the pointer to the PCI Data Structure is invalid, no further images can be located.
|
// If the pointer to the PCI Data Structure is invalid, no further images can be located.
|
||||||
// The PCI Data Structure must be DWORD aligned.
|
// The PCI Data Structure must be DWORD aligned.
|
||||||
//
|
//
|
||||||
if (OffsetPcir == 0 ||
|
if (OffsetPcir == 0 ||
|
||||||
(OffsetPcir & 3) != 0 ||
|
(OffsetPcir & 3) != 0 ||
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/** @file
|
/** @file
|
||||||
PCI resouces support functions implemntation for PCI Bus module.
|
PCI resouces support functions implemntation for PCI Bus module.
|
||||||
|
|
||||||
Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.<BR>
|
Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||||
This program and the accompanying materials
|
This program and the accompanying materials
|
||||||
are licensed and made available under the terms and conditions of the BSD License
|
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
|
which accompanies this distribution. The full text of the license may be found at
|
||||||
@ -1116,7 +1116,7 @@ DegradeResource (
|
|||||||
PMem64Node,
|
PMem64Node,
|
||||||
TRUE
|
TRUE
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// if both PMEM64 and PMEM32 requests from child devices, which can not be satisfied
|
// if both PMEM64 and PMEM32 requests from child devices, which can not be satisfied
|
||||||
|
@ -537,7 +537,7 @@ GetElapsedTick (
|
|||||||
)
|
)
|
||||||
{
|
{
|
||||||
UINT64 PreviousTick;
|
UINT64 PreviousTick;
|
||||||
|
|
||||||
PreviousTick = *CurrentTick;
|
PreviousTick = *CurrentTick;
|
||||||
*CurrentTick = GetPerformanceCounter();
|
*CurrentTick = GetPerformanceCounter();
|
||||||
if (StartTick < EndTick) {
|
if (StartTick < EndTick) {
|
||||||
|
@ -3,13 +3,13 @@
|
|||||||
//
|
//
|
||||||
// Produces the Serial I/O protocol for standard UARTS using Super I/O or PCI I/O.
|
// Produces the Serial I/O protocol for standard UARTS using Super I/O or PCI I/O.
|
||||||
//
|
//
|
||||||
// Copyright (c) 2007 - 2015, Intel Corporation. All rights reserved.<BR>
|
// Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||||
//
|
//
|
||||||
// This program and the accompanying materials
|
// This program and the accompanying materials
|
||||||
// are licensed and made available under the terms and conditions of the BSD License
|
// 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
|
// which accompanies this distribution. The full text of the license may be found at
|
||||||
// http://opensource.org/licenses/bsd-license.php
|
// http://opensource.org/licenses/bsd-license.php
|
||||||
//
|
//
|
||||||
// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||||
// WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
// WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||||
//
|
//
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// /** @file
|
// /** @file
|
||||||
// PciSioSerialDxe Localized Strings and Content
|
// PciSioSerialDxe Localized Strings and Content
|
||||||
//
|
//
|
||||||
// Copyright (c) 2013 - 2015, Intel Corporation. All rights reserved.<BR>
|
// Copyright (c) 2013 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||||
//
|
//
|
||||||
// This program and the accompanying materials
|
// This program and the accompanying materials
|
||||||
// are licensed and made available under the terms and conditions of the BSD License
|
// are licensed and made available under the terms and conditions of the BSD License
|
||||||
@ -13,6 +13,6 @@
|
|||||||
//
|
//
|
||||||
// **/
|
// **/
|
||||||
|
|
||||||
#string STR_PROPERTIES_MODULE_NAME
|
#string STR_PROPERTIES_MODULE_NAME
|
||||||
#language en-US
|
#language en-US
|
||||||
"PCI SIO UART Serial Bus DXE Driver"
|
"PCI SIO UART Serial Bus DXE Driver"
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/** @file
|
/** @file
|
||||||
Serial driver for PCI or SIO UARTS.
|
Serial driver for PCI or SIO UARTS.
|
||||||
|
|
||||||
Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>
|
Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||||
This program and the accompanying materials
|
This program and the accompanying materials
|
||||||
are licensed and made available under the terms and conditions of the BSD License
|
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
|
which accompanies this distribution. The full text of the license may be found at
|
||||||
@ -94,7 +94,7 @@ SERIAL_DEV gSerialDevTemplate = {
|
|||||||
Check the device path node whether it's the Flow Control node or not.
|
Check the device path node whether it's the Flow Control node or not.
|
||||||
|
|
||||||
@param[in] FlowControl The device path node to be checked.
|
@param[in] FlowControl The device path node to be checked.
|
||||||
|
|
||||||
@retval TRUE It's the Flow Control node.
|
@retval TRUE It's the Flow Control node.
|
||||||
@retval FALSE It's not.
|
@retval FALSE It's not.
|
||||||
|
|
||||||
@ -114,9 +114,9 @@ IsUartFlowControlDevicePathNode (
|
|||||||
/**
|
/**
|
||||||
The user Entry Point for module PciSioSerial. The user code starts with this function.
|
The user Entry Point for module PciSioSerial. The user code starts with this function.
|
||||||
|
|
||||||
@param[in] ImageHandle The firmware allocated handle for the EFI image.
|
@param[in] ImageHandle The firmware allocated handle for the EFI image.
|
||||||
@param[in] SystemTable A pointer to the EFI System Table.
|
@param[in] SystemTable A pointer to the EFI System Table.
|
||||||
|
|
||||||
@retval EFI_SUCCESS The entry point is executed successfully.
|
@retval EFI_SUCCESS The entry point is executed successfully.
|
||||||
@retval other Some error occurs when executing this entry point.
|
@retval other Some error occurs when executing this entry point.
|
||||||
|
|
||||||
@ -396,7 +396,7 @@ SerialControllerDriverSupported (
|
|||||||
if (EFI_ERROR (Status)) {
|
if (EFI_ERROR (Status)) {
|
||||||
Status = IsPciSerialController (Controller);
|
Status = IsPciSerialController (Controller);
|
||||||
}
|
}
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/** @file
|
/** @file
|
||||||
Header file for PciSioSerial Driver
|
Header file for PciSioSerial Driver
|
||||||
|
|
||||||
Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>
|
Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||||
This program and the accompanying materials
|
This program and the accompanying materials
|
||||||
are licensed and made available under the terms and conditions of the BSD License
|
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
|
which accompanies this distribution. The full text of the license may be found at
|
||||||
@ -497,7 +497,7 @@ SerialFifoFull (
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
Detect whether specific FIFO is empty or not.
|
Detect whether specific FIFO is empty or not.
|
||||||
|
|
||||||
@param Fifo A pointer to the Data Structure SERIAL_DEV_FIFO
|
@param Fifo A pointer to the Data Structure SERIAL_DEV_FIFO
|
||||||
|
|
||||||
@return whether specific FIFO is empty or not
|
@return whether specific FIFO is empty or not
|
||||||
@ -777,7 +777,7 @@ SkipControllerDevicePathNode (
|
|||||||
Check the device path node whether it's the Flow Control node or not.
|
Check the device path node whether it's the Flow Control node or not.
|
||||||
|
|
||||||
@param[in] FlowControl The device path node to be checked.
|
@param[in] FlowControl The device path node to be checked.
|
||||||
|
|
||||||
@retval TRUE It's the Flow Control node.
|
@retval TRUE It's the Flow Control node.
|
||||||
@retval FALSE It's not.
|
@retval FALSE It's not.
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/** @file
|
/** @file
|
||||||
SerialIo implementation for PCI or SIO UARTs.
|
SerialIo implementation for PCI or SIO UARTs.
|
||||||
|
|
||||||
Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>
|
Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||||
This program and the accompanying materials
|
This program and the accompanying materials
|
||||||
are licensed and made available under the terms and conditions of the BSD License
|
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
|
which accompanies this distribution. The full text of the license may be found at
|
||||||
@ -92,7 +92,7 @@ VerifyUartParameters (
|
|||||||
((DataBits >= 6) && (DataBits <= 8) && (StopBits == OneFiveStopBits))
|
((DataBits >= 6) && (DataBits <= 8) && (StopBits == OneFiveStopBits))
|
||||||
) {
|
) {
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Do not verify the baud rate if clock rate is unknown (0).
|
// Do not verify the baud rate if clock rate is unknown (0).
|
||||||
@ -169,8 +169,8 @@ VerifyUartParameters (
|
|||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// ActualBaudRate is higher than requested baud rate and more than 4%
|
// ActualBaudRate is higher than requested baud rate and more than 4%
|
||||||
// higher than the requested value. Increment Divisor if it is less
|
// higher than the requested value. Increment Divisor if it is less
|
||||||
// than MAX_UINT16 and computed baud rate with new divisor.
|
// than MAX_UINT16 and computed baud rate with new divisor.
|
||||||
//
|
//
|
||||||
if (ComputedDivisor == MAX_UINT16) {
|
if (ComputedDivisor == MAX_UINT16) {
|
||||||
@ -212,7 +212,7 @@ SerialFifoFull (
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
Detect whether specific FIFO is empty or not.
|
Detect whether specific FIFO is empty or not.
|
||||||
|
|
||||||
@param Fifo A pointer to the Data Structure SERIAL_DEV_FIFO
|
@param Fifo A pointer to the Data Structure SERIAL_DEV_FIFO
|
||||||
|
|
||||||
@return whether specific FIFO is empty or not
|
@return whether specific FIFO is empty or not
|
||||||
@ -363,7 +363,7 @@ SerialReceiveTransmit (
|
|||||||
Data = READ_RBR (SerialDevice);
|
Data = READ_RBR (SerialDevice);
|
||||||
|
|
||||||
SerialFifoAdd (&SerialDevice->Receive, Data);
|
SerialFifoAdd (&SerialDevice->Receive, Data);
|
||||||
|
|
||||||
//
|
//
|
||||||
// For full handshake flow control, if receive buffer full
|
// For full handshake flow control, if receive buffer full
|
||||||
// tell the peer to stop sending data.
|
// tell the peer to stop sending data.
|
||||||
@ -1065,7 +1065,7 @@ SerialWrite (
|
|||||||
NULL
|
NULL
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
for (Index = 0; Index < *BufferSize; Index++) {
|
for (Index = 0; Index < *BufferSize; Index++) {
|
||||||
SerialFifoAdd (&SerialDevice->Transmit, CharBuffer[Index]);
|
SerialFifoAdd (&SerialDevice->Transmit, CharBuffer[Index]);
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/** @file
|
/** @file
|
||||||
UEFI Component Name(2) protocol implementation for Sata Controller driver.
|
UEFI Component Name(2) protocol implementation for Sata Controller driver.
|
||||||
|
|
||||||
Copyright (c) 2011 - 2016, Intel Corporation. All rights reserved.<BR>
|
Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||||
This program and the accompanying materials
|
This program and the accompanying materials
|
||||||
are licensed and made available under the terms and conditions of the BSD License
|
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
|
which accompanies this distribution. The full text of the license may be found at
|
||||||
@ -72,7 +72,7 @@ GLOBAL_REMOVE_IF_UNREFERENCED EFI_UNICODE_STRING_TABLE mSataControllerController
|
|||||||
@param DriverName A pointer to the Unicode string to return. This Unicode string
|
@param DriverName A pointer to the Unicode string to return. This Unicode string
|
||||||
is the name of the driver specified by This in the language
|
is the name of the driver specified by This in the language
|
||||||
specified by Language.
|
specified by Language.
|
||||||
|
|
||||||
@retval EFI_SUCCESS The Unicode string for the Driver specified by This
|
@retval EFI_SUCCESS The Unicode string for the Driver specified by This
|
||||||
and the language specified by Language was returned
|
and the language specified by Language was returned
|
||||||
in DriverName.
|
in DriverName.
|
||||||
@ -100,7 +100,7 @@ SataControllerComponentNameGetDriverName (
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
Retrieves a Unicode string that is the user readable name of the controller
|
Retrieves a Unicode string that is the user readable name of the controller
|
||||||
that is being managed by an UEFI Driver.
|
that is being managed by an UEFI Driver.
|
||||||
|
|
||||||
@param This A pointer to the EFI_COMPONENT_NAME_PROTOCOL instance.
|
@param This A pointer to the EFI_COMPONENT_NAME_PROTOCOL instance.
|
||||||
@param ControllerHandle The handle of a controller that the driver specified by
|
@param ControllerHandle The handle of a controller that the driver specified by
|
||||||
@ -123,7 +123,7 @@ SataControllerComponentNameGetDriverName (
|
|||||||
ControllerHandle and ChildHandle in the language
|
ControllerHandle and ChildHandle in the language
|
||||||
specified by Language from the point of view of the
|
specified by Language from the point of view of the
|
||||||
driver specified by This.
|
driver specified by This.
|
||||||
|
|
||||||
@retval EFI_SUCCESS The Unicode string for the user readable name in the
|
@retval EFI_SUCCESS The Unicode string for the user readable name in the
|
||||||
language specified by Language for the driver
|
language specified by Language for the driver
|
||||||
specified by This was returned in DriverName.
|
specified by This was returned in DriverName.
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/** @file
|
/** @file
|
||||||
This driver module produces IDE_CONTROLLER_INIT protocol for Sata Controllers.
|
This driver module produces IDE_CONTROLLER_INIT protocol for Sata Controllers.
|
||||||
|
|
||||||
Copyright (c) 2011 - 2016, Intel Corporation. All rights reserved.<BR>
|
Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||||
Copyright (c) 2018, ARM Ltd. All rights reserved.<BR>
|
Copyright (c) 2018, ARM Ltd. All rights reserved.<BR>
|
||||||
This program and the accompanying materials
|
This program and the accompanying materials
|
||||||
are licensed and made available under the terms and conditions of the BSD License
|
are licensed and made available under the terms and conditions of the BSD License
|
||||||
@ -46,7 +46,7 @@ AhciReadReg (
|
|||||||
UINT32 Data;
|
UINT32 Data;
|
||||||
|
|
||||||
ASSERT (PciIo != NULL);
|
ASSERT (PciIo != NULL);
|
||||||
|
|
||||||
Data = 0;
|
Data = 0;
|
||||||
|
|
||||||
PciIo->Mem.Read (
|
PciIo->Mem.Read (
|
||||||
@ -242,9 +242,9 @@ CalculateBestUdmaMode (
|
|||||||
/**
|
/**
|
||||||
The Entry Point of module. It follows the standard UEFI driver model.
|
The Entry Point of module. It follows the standard UEFI driver model.
|
||||||
|
|
||||||
@param[in] ImageHandle The firmware allocated handle for the EFI image.
|
@param[in] ImageHandle The firmware allocated handle for the EFI image.
|
||||||
@param[in] SystemTable A pointer to the EFI System Table.
|
@param[in] SystemTable A pointer to the EFI System Table.
|
||||||
|
|
||||||
@retval EFI_SUCCESS The entry point is executed successfully.
|
@retval EFI_SUCCESS The entry point is executed successfully.
|
||||||
@retval other Some error occurs when executing this entry point.
|
@retval other Some error occurs when executing this entry point.
|
||||||
|
|
||||||
@ -338,7 +338,7 @@ SataControllerSupported (
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
This routine is called right after the .Supported() called and
|
This routine is called right after the .Supported() called and
|
||||||
Start this driver on ControllerHandle.
|
Start this driver on ControllerHandle.
|
||||||
|
|
||||||
@param This Protocol instance pointer.
|
@param This Protocol instance pointer.
|
||||||
@ -558,7 +558,7 @@ Done:
|
|||||||
@param This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
|
@param This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
|
||||||
@param Controller A handle to the device being stopped.
|
@param Controller A handle to the device being stopped.
|
||||||
@param NumberOfChildren The number of child device handles in ChildHandleBuffer.
|
@param NumberOfChildren The number of child device handles in ChildHandleBuffer.
|
||||||
@param ChildHandleBuffer An array of child handles to be freed.
|
@param ChildHandleBuffer An array of child handles to be freed.
|
||||||
|
|
||||||
@retval EFI_SUCCESS This driver is removed from this device.
|
@retval EFI_SUCCESS This driver is removed from this device.
|
||||||
@retval other Some error occurs when removing this driver from this device.
|
@retval other Some error occurs when removing this driver from this device.
|
||||||
@ -679,34 +679,34 @@ FlatDeviceIndex (
|
|||||||
//
|
//
|
||||||
/**
|
/**
|
||||||
Returns the information about the specified IDE channel.
|
Returns the information about the specified IDE channel.
|
||||||
|
|
||||||
This function can be used to obtain information about a particular IDE channel.
|
This function can be used to obtain information about a particular IDE channel.
|
||||||
The driver entity uses this information during the enumeration process.
|
The driver entity uses this information during the enumeration process.
|
||||||
|
|
||||||
If Enabled is set to FALSE, the driver entity will not scan the channel. Note
|
If Enabled is set to FALSE, the driver entity will not scan the channel. Note
|
||||||
that it will not prevent an operating system driver from scanning the channel.
|
that it will not prevent an operating system driver from scanning the channel.
|
||||||
|
|
||||||
For most of today's controllers, MaxDevices will either be 1 or 2. For SATA
|
For most of today's controllers, MaxDevices will either be 1 or 2. For SATA
|
||||||
controllers, this value will always be 1. SATA configurations can contain SATA
|
controllers, this value will always be 1. SATA configurations can contain SATA
|
||||||
port multipliers. SATA port multipliers behave like SATA bridges and can support
|
port multipliers. SATA port multipliers behave like SATA bridges and can support
|
||||||
up to 16 devices on the other side. If a SATA port out of the IDE controller
|
up to 16 devices on the other side. If a SATA port out of the IDE controller
|
||||||
is connected to a port multiplier, MaxDevices will be set to the number of SATA
|
is connected to a port multiplier, MaxDevices will be set to the number of SATA
|
||||||
devices that the port multiplier supports. Because today's port multipliers
|
devices that the port multiplier supports. Because today's port multipliers
|
||||||
support up to fifteen SATA devices, this number can be as large as fifteen. The IDE
|
support up to fifteen SATA devices, this number can be as large as fifteen. The IDE
|
||||||
bus driver is required to scan for the presence of port multipliers behind an SATA
|
bus driver is required to scan for the presence of port multipliers behind an SATA
|
||||||
controller and enumerate up to MaxDevices number of devices behind the port
|
controller and enumerate up to MaxDevices number of devices behind the port
|
||||||
multiplier.
|
multiplier.
|
||||||
|
|
||||||
In this context, the devices behind a port multiplier constitute a channel.
|
In this context, the devices behind a port multiplier constitute a channel.
|
||||||
|
|
||||||
@param[in] This The pointer to the EFI_IDE_CONTROLLER_INIT_PROTOCOL instance.
|
@param[in] This The pointer to the EFI_IDE_CONTROLLER_INIT_PROTOCOL instance.
|
||||||
@param[in] Channel Zero-based channel number.
|
@param[in] Channel Zero-based channel number.
|
||||||
@param[out] Enabled TRUE if this channel is enabled. Disabled channels
|
@param[out] Enabled TRUE if this channel is enabled. Disabled channels
|
||||||
are not scanned to see if any devices are present.
|
are not scanned to see if any devices are present.
|
||||||
@param[out] MaxDevices The maximum number of IDE devices that the bus driver
|
@param[out] MaxDevices The maximum number of IDE devices that the bus driver
|
||||||
can expect on this channel. For the ATA/ATAPI
|
can expect on this channel. For the ATA/ATAPI
|
||||||
specification, version 6, this number will either be
|
specification, version 6, this number will either be
|
||||||
one or two. For Serial ATA (SATA) configurations with a
|
one or two. For Serial ATA (SATA) configurations with a
|
||||||
port multiplier, this number can be as large as fifteen.
|
port multiplier, this number can be as large as fifteen.
|
||||||
|
|
||||||
@retval EFI_SUCCESS Information was returned without any errors.
|
@retval EFI_SUCCESS Information was returned without any errors.
|
||||||
@ -739,13 +739,13 @@ IdeInitGetChannelInfo (
|
|||||||
/**
|
/**
|
||||||
The notifications from the driver entity that it is about to enter a certain
|
The notifications from the driver entity that it is about to enter a certain
|
||||||
phase of the IDE channel enumeration process.
|
phase of the IDE channel enumeration process.
|
||||||
|
|
||||||
This function can be used to notify the IDE controller driver to perform
|
This function can be used to notify the IDE controller driver to perform
|
||||||
specific actions, including any chipset-specific initialization, so that the
|
specific actions, including any chipset-specific initialization, so that the
|
||||||
chipset is ready to enter the next phase. Seven notification points are defined
|
chipset is ready to enter the next phase. Seven notification points are defined
|
||||||
at this time.
|
at this time.
|
||||||
|
|
||||||
More synchronization points may be added as required in the future.
|
More synchronization points may be added as required in the future.
|
||||||
|
|
||||||
@param[in] This The pointer to the EFI_IDE_CONTROLLER_INIT_PROTOCOL
|
@param[in] This The pointer to the EFI_IDE_CONTROLLER_INIT_PROTOCOL
|
||||||
instance.
|
instance.
|
||||||
@ -755,9 +755,9 @@ IdeInitGetChannelInfo (
|
|||||||
@retval EFI_SUCCESS The notification was accepted without any errors.
|
@retval EFI_SUCCESS The notification was accepted without any errors.
|
||||||
@retval EFI_UNSUPPORTED Phase is not supported.
|
@retval EFI_UNSUPPORTED Phase is not supported.
|
||||||
@retval EFI_INVALID_PARAMETER Channel is invalid (Channel >= ChannelCount).
|
@retval EFI_INVALID_PARAMETER Channel is invalid (Channel >= ChannelCount).
|
||||||
@retval EFI_NOT_READY This phase cannot be entered at this time; for
|
@retval EFI_NOT_READY This phase cannot be entered at this time; for
|
||||||
example, an attempt was made to enter a Phase
|
example, an attempt was made to enter a Phase
|
||||||
without having entered one or more previous
|
without having entered one or more previous
|
||||||
Phase.
|
Phase.
|
||||||
|
|
||||||
**/
|
**/
|
||||||
@ -775,32 +775,32 @@ IdeInitNotifyPhase (
|
|||||||
/**
|
/**
|
||||||
Submits the device information to the IDE controller driver.
|
Submits the device information to the IDE controller driver.
|
||||||
|
|
||||||
This function is used by the driver entity to pass detailed information about
|
This function is used by the driver entity to pass detailed information about
|
||||||
a particular device to the IDE controller driver. The driver entity obtains
|
a particular device to the IDE controller driver. The driver entity obtains
|
||||||
this information by issuing an ATA or ATAPI IDENTIFY_DEVICE command. IdentifyData
|
this information by issuing an ATA or ATAPI IDENTIFY_DEVICE command. IdentifyData
|
||||||
is the pointer to the response data buffer. The IdentifyData buffer is owned
|
is the pointer to the response data buffer. The IdentifyData buffer is owned
|
||||||
by the driver entity, and the IDE controller driver must make a local copy
|
by the driver entity, and the IDE controller driver must make a local copy
|
||||||
of the entire buffer or parts of the buffer as needed. The original IdentifyData
|
of the entire buffer or parts of the buffer as needed. The original IdentifyData
|
||||||
buffer pointer may not be valid when
|
buffer pointer may not be valid when
|
||||||
|
|
||||||
- EFI_IDE_CONTROLLER_INIT_PROTOCOL.CalculateMode() or
|
- EFI_IDE_CONTROLLER_INIT_PROTOCOL.CalculateMode() or
|
||||||
- EFI_IDE_CONTROLLER_INIT_PROTOCOL.DisqualifyMode() is called at a later point.
|
- EFI_IDE_CONTROLLER_INIT_PROTOCOL.DisqualifyMode() is called at a later point.
|
||||||
|
|
||||||
The IDE controller driver may consult various fields of EFI_IDENTIFY_DATA to
|
The IDE controller driver may consult various fields of EFI_IDENTIFY_DATA to
|
||||||
compute the optimum mode for the device. These fields are not limited to the
|
compute the optimum mode for the device. These fields are not limited to the
|
||||||
timing information. For example, an implementation of the IDE controller driver
|
timing information. For example, an implementation of the IDE controller driver
|
||||||
may examine the vendor and type/mode field to match known bad drives.
|
may examine the vendor and type/mode field to match known bad drives.
|
||||||
|
|
||||||
The driver entity may submit drive information in any order, as long as it
|
The driver entity may submit drive information in any order, as long as it
|
||||||
submits information for all the devices belonging to the enumeration group
|
submits information for all the devices belonging to the enumeration group
|
||||||
before EFI_IDE_CONTROLLER_INIT_PROTOCOL.CalculateMode() is called for any device
|
before EFI_IDE_CONTROLLER_INIT_PROTOCOL.CalculateMode() is called for any device
|
||||||
in that enumeration group. If a device is absent, EFI_IDE_CONTROLLER_INIT_PROTOCOL.SubmitData()
|
in that enumeration group. If a device is absent, EFI_IDE_CONTROLLER_INIT_PROTOCOL.SubmitData()
|
||||||
should be called with IdentifyData set to NULL. The IDE controller driver may
|
should be called with IdentifyData set to NULL. The IDE controller driver may
|
||||||
not have any other mechanism to know whether a device is present or not. Therefore,
|
not have any other mechanism to know whether a device is present or not. Therefore,
|
||||||
setting IdentifyData to NULL does not constitute an error condition.
|
setting IdentifyData to NULL does not constitute an error condition.
|
||||||
EFI_IDE_CONTROLLER_INIT_PROTOCOL.SubmitData() can be called only once for a
|
EFI_IDE_CONTROLLER_INIT_PROTOCOL.SubmitData() can be called only once for a
|
||||||
given (Channel, Device) pair.
|
given (Channel, Device) pair.
|
||||||
|
|
||||||
@param[in] This A pointer to the EFI_IDE_CONTROLLER_INIT_PROTOCOL instance.
|
@param[in] This A pointer to the EFI_IDE_CONTROLLER_INIT_PROTOCOL instance.
|
||||||
@param[in] Channel Zero-based channel number.
|
@param[in] Channel Zero-based channel number.
|
||||||
@param[in] Device Zero-based device number on the Channel.
|
@param[in] Device Zero-based device number on the Channel.
|
||||||
@ -853,31 +853,31 @@ IdeInitSubmitData (
|
|||||||
/**
|
/**
|
||||||
Disqualifies specific modes for an IDE device.
|
Disqualifies specific modes for an IDE device.
|
||||||
|
|
||||||
This function allows the driver entity or other drivers (such as platform
|
This function allows the driver entity or other drivers (such as platform
|
||||||
drivers) to reject certain timing modes and request the IDE controller driver
|
drivers) to reject certain timing modes and request the IDE controller driver
|
||||||
to recalculate modes. This function allows the driver entity and the IDE
|
to recalculate modes. This function allows the driver entity and the IDE
|
||||||
controller driver to negotiate the timings on a per-device basis. This function
|
controller driver to negotiate the timings on a per-device basis. This function
|
||||||
is useful in the case of drives that lie about their capabilities. An example
|
is useful in the case of drives that lie about their capabilities. An example
|
||||||
is when the IDE device fails to accept the timing modes that are calculated
|
is when the IDE device fails to accept the timing modes that are calculated
|
||||||
by the IDE controller driver based on the response to the Identify Drive command.
|
by the IDE controller driver based on the response to the Identify Drive command.
|
||||||
|
|
||||||
If the driver entity does not want to limit the ATA timing modes and leave that
|
If the driver entity does not want to limit the ATA timing modes and leave that
|
||||||
decision to the IDE controller driver, it can either not call this function for
|
decision to the IDE controller driver, it can either not call this function for
|
||||||
the given device or call this function and set the Valid flag to FALSE for all
|
the given device or call this function and set the Valid flag to FALSE for all
|
||||||
modes that are listed in EFI_ATA_COLLECTIVE_MODE.
|
modes that are listed in EFI_ATA_COLLECTIVE_MODE.
|
||||||
|
|
||||||
The driver entity may disqualify modes for a device in any order and any number
|
The driver entity may disqualify modes for a device in any order and any number
|
||||||
of times.
|
of times.
|
||||||
|
|
||||||
This function can be called multiple times to invalidate multiple modes of the
|
This function can be called multiple times to invalidate multiple modes of the
|
||||||
same type (e.g., Programmed Input/Output [PIO] modes 3 and 4). See the ATA/ATAPI
|
same type (e.g., Programmed Input/Output [PIO] modes 3 and 4). See the ATA/ATAPI
|
||||||
specification for more information on PIO modes.
|
specification for more information on PIO modes.
|
||||||
|
|
||||||
For Serial ATA (SATA) controllers, this member function can be used to disqualify
|
For Serial ATA (SATA) controllers, this member function can be used to disqualify
|
||||||
a higher transfer rate mode on a given channel. For example, a platform driver
|
a higher transfer rate mode on a given channel. For example, a platform driver
|
||||||
may inform the IDE controller driver to not use second-generation (Gen2) speeds
|
may inform the IDE controller driver to not use second-generation (Gen2) speeds
|
||||||
for a certain SATA drive.
|
for a certain SATA drive.
|
||||||
|
|
||||||
@param[in] This The pointer to the EFI_IDE_CONTROLLER_INIT_PROTOCOL instance.
|
@param[in] This The pointer to the EFI_IDE_CONTROLLER_INIT_PROTOCOL instance.
|
||||||
@param[in] Channel The zero-based channel number.
|
@param[in] Channel The zero-based channel number.
|
||||||
@param[in] Device The zero-based device number on the Channel.
|
@param[in] Device The zero-based device number on the Channel.
|
||||||
@ -888,7 +888,7 @@ IdeInitSubmitData (
|
|||||||
@retval EFI_INVALID_PARAMETER Channel is invalid (Channel >= ChannelCount).
|
@retval EFI_INVALID_PARAMETER Channel is invalid (Channel >= ChannelCount).
|
||||||
@retval EFI_INVALID_PARAMETER Device is invalid.
|
@retval EFI_INVALID_PARAMETER Device is invalid.
|
||||||
@retval EFI_INVALID_PARAMETER IdentifyData is NULL.
|
@retval EFI_INVALID_PARAMETER IdentifyData is NULL.
|
||||||
|
|
||||||
**/
|
**/
|
||||||
EFI_STATUS
|
EFI_STATUS
|
||||||
EFIAPI
|
EFIAPI
|
||||||
@ -928,39 +928,39 @@ IdeInitDisqualifyMode (
|
|||||||
Returns the information about the optimum modes for the specified IDE device.
|
Returns the information about the optimum modes for the specified IDE device.
|
||||||
|
|
||||||
This function is used by the driver entity to obtain the optimum ATA modes for
|
This function is used by the driver entity to obtain the optimum ATA modes for
|
||||||
a specific device. The IDE controller driver takes into account the following
|
a specific device. The IDE controller driver takes into account the following
|
||||||
while calculating the mode:
|
while calculating the mode:
|
||||||
- The IdentifyData inputs to EFI_IDE_CONTROLLER_INIT_PROTOCOL.SubmitData()
|
- The IdentifyData inputs to EFI_IDE_CONTROLLER_INIT_PROTOCOL.SubmitData()
|
||||||
- The BadModes inputs to EFI_IDE_CONTROLLER_INIT_PROTOCOL.DisqualifyMode()
|
- The BadModes inputs to EFI_IDE_CONTROLLER_INIT_PROTOCOL.DisqualifyMode()
|
||||||
|
|
||||||
The driver entity is required to call EFI_IDE_CONTROLLER_INIT_PROTOCOL.SubmitData()
|
The driver entity is required to call EFI_IDE_CONTROLLER_INIT_PROTOCOL.SubmitData()
|
||||||
for all the devices that belong to an enumeration group before calling
|
for all the devices that belong to an enumeration group before calling
|
||||||
EFI_IDE_CONTROLLER_INIT_PROTOCOL.CalculateMode() for any device in the same group.
|
EFI_IDE_CONTROLLER_INIT_PROTOCOL.CalculateMode() for any device in the same group.
|
||||||
|
|
||||||
The IDE controller driver will use controller- and possibly platform-specific
|
The IDE controller driver will use controller- and possibly platform-specific
|
||||||
algorithms to arrive at SupportedModes. The IDE controller may base its
|
algorithms to arrive at SupportedModes. The IDE controller may base its
|
||||||
decision on user preferences and other considerations as well. This function
|
decision on user preferences and other considerations as well. This function
|
||||||
may be called multiple times because the driver entity may renegotiate the mode
|
may be called multiple times because the driver entity may renegotiate the mode
|
||||||
with the IDE controller driver using EFI_IDE_CONTROLLER_INIT_PROTOCOL.DisqualifyMode().
|
with the IDE controller driver using EFI_IDE_CONTROLLER_INIT_PROTOCOL.DisqualifyMode().
|
||||||
|
|
||||||
The driver entity may collect timing information for various devices in any
|
The driver entity may collect timing information for various devices in any
|
||||||
order. The driver entity is responsible for making sure that all the dependencies
|
order. The driver entity is responsible for making sure that all the dependencies
|
||||||
are satisfied. For example, the SupportedModes information for device A that
|
are satisfied. For example, the SupportedModes information for device A that
|
||||||
was previously returned may become stale after a call to
|
was previously returned may become stale after a call to
|
||||||
EFI_IDE_CONTROLLER_INIT_PROTOCOL.DisqualifyMode() for device B.
|
EFI_IDE_CONTROLLER_INIT_PROTOCOL.DisqualifyMode() for device B.
|
||||||
|
|
||||||
The buffer SupportedModes is allocated by the callee because the caller does
|
The buffer SupportedModes is allocated by the callee because the caller does
|
||||||
not necessarily know the size of the buffer. The type EFI_ATA_COLLECTIVE_MODE
|
not necessarily know the size of the buffer. The type EFI_ATA_COLLECTIVE_MODE
|
||||||
is defined in a way that allows for future extensibility and can be of variable
|
is defined in a way that allows for future extensibility and can be of variable
|
||||||
length. This memory pool should be deallocated by the caller when it is no
|
length. This memory pool should be deallocated by the caller when it is no
|
||||||
longer necessary.
|
longer necessary.
|
||||||
|
|
||||||
The IDE controller driver for a Serial ATA (SATA) controller can use this
|
The IDE controller driver for a Serial ATA (SATA) controller can use this
|
||||||
member function to force a lower speed (first-generation [Gen1] speeds on a
|
member function to force a lower speed (first-generation [Gen1] speeds on a
|
||||||
second-generation [Gen2]-capable hardware). The IDE controller driver can
|
second-generation [Gen2]-capable hardware). The IDE controller driver can
|
||||||
also allow the driver entity to stay with the speed that has been negotiated
|
also allow the driver entity to stay with the speed that has been negotiated
|
||||||
by the physical layer.
|
by the physical layer.
|
||||||
|
|
||||||
@param[in] This The pointer to the EFI_IDE_CONTROLLER_INIT_PROTOCOL instance.
|
@param[in] This The pointer to the EFI_IDE_CONTROLLER_INIT_PROTOCOL instance.
|
||||||
@param[in] Channel A zero-based channel number.
|
@param[in] Channel A zero-based channel number.
|
||||||
@param[in] Device A zero-based device number on the Channel.
|
@param[in] Device A zero-based device number on the Channel.
|
||||||
@ -968,13 +968,13 @@ IdeInitDisqualifyMode (
|
|||||||
|
|
||||||
@retval EFI_SUCCESS SupportedModes was returned.
|
@retval EFI_SUCCESS SupportedModes was returned.
|
||||||
@retval EFI_INVALID_PARAMETER Channel is invalid (Channel >= ChannelCount).
|
@retval EFI_INVALID_PARAMETER Channel is invalid (Channel >= ChannelCount).
|
||||||
@retval EFI_INVALID_PARAMETER Device is invalid.
|
@retval EFI_INVALID_PARAMETER Device is invalid.
|
||||||
@retval EFI_INVALID_PARAMETER SupportedModes is NULL.
|
@retval EFI_INVALID_PARAMETER SupportedModes is NULL.
|
||||||
@retval EFI_NOT_READY Modes cannot be calculated due to a lack of
|
@retval EFI_NOT_READY Modes cannot be calculated due to a lack of
|
||||||
data. This error may happen if
|
data. This error may happen if
|
||||||
EFI_IDE_CONTROLLER_INIT_PROTOCOL.SubmitData()
|
EFI_IDE_CONTROLLER_INIT_PROTOCOL.SubmitData()
|
||||||
and EFI_IDE_CONTROLLER_INIT_PROTOCOL.DisqualifyData()
|
and EFI_IDE_CONTROLLER_INIT_PROTOCOL.DisqualifyData()
|
||||||
were not called for at least one drive in the
|
were not called for at least one drive in the
|
||||||
same enumeration group.
|
same enumeration group.
|
||||||
|
|
||||||
**/
|
**/
|
||||||
@ -1061,9 +1061,9 @@ IdeInitCalculateMode (
|
|||||||
Commands the IDE controller driver to program the IDE controller hardware
|
Commands the IDE controller driver to program the IDE controller hardware
|
||||||
so that the specified device can operate at the specified mode.
|
so that the specified device can operate at the specified mode.
|
||||||
|
|
||||||
This function is used by the driver entity to instruct the IDE controller
|
This function is used by the driver entity to instruct the IDE controller
|
||||||
driver to program the IDE controller hardware to the specified modes. This
|
driver to program the IDE controller hardware to the specified modes. This
|
||||||
function can be called only once for a particular device. For a Serial ATA
|
function can be called only once for a particular device. For a Serial ATA
|
||||||
(SATA) Advanced Host Controller Interface (AHCI) controller, no controller-
|
(SATA) Advanced Host Controller Interface (AHCI) controller, no controller-
|
||||||
specific programming may be required.
|
specific programming may be required.
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/** @file
|
/** @file
|
||||||
Header file for Sata Controller driver.
|
Header file for Sata Controller driver.
|
||||||
|
|
||||||
Copyright (c) 2011 - 2016, Intel Corporation. All rights reserved.<BR>
|
Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||||
Copyright (c) 2018, ARM Ltd. All rights reserved.<BR>
|
Copyright (c) 2018, ARM Ltd. All rights reserved.<BR>
|
||||||
This program and the accompanying materials
|
This program and the accompanying materials
|
||||||
are licensed and made available under the terms and conditions of the BSD License
|
are licensed and made available under the terms and conditions of the BSD License
|
||||||
@ -146,7 +146,7 @@ SataControllerSupported (
|
|||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
This routine is called right after the .Supported() called and
|
This routine is called right after the .Supported() called and
|
||||||
Start this driver on ControllerHandle.
|
Start this driver on ControllerHandle.
|
||||||
|
|
||||||
@param This Protocol instance pointer.
|
@param This Protocol instance pointer.
|
||||||
@ -173,7 +173,7 @@ SataControllerStart (
|
|||||||
@param This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
|
@param This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
|
||||||
@param Controller A handle to the device being stopped.
|
@param Controller A handle to the device being stopped.
|
||||||
@param NumberOfChildren The number of child device handles in ChildHandleBuffer.
|
@param NumberOfChildren The number of child device handles in ChildHandleBuffer.
|
||||||
@param ChildHandleBuffer An array of child handles to be freed.
|
@param ChildHandleBuffer An array of child handles to be freed.
|
||||||
|
|
||||||
@retval EFI_SUCCESS This driver is removed from this device.
|
@retval EFI_SUCCESS This driver is removed from this device.
|
||||||
@retval other Some error occurs when removing this driver from this device.
|
@retval other Some error occurs when removing this driver from this device.
|
||||||
@ -193,34 +193,34 @@ SataControllerStop (
|
|||||||
//
|
//
|
||||||
/**
|
/**
|
||||||
Returns the information about the specified IDE channel.
|
Returns the information about the specified IDE channel.
|
||||||
|
|
||||||
This function can be used to obtain information about a particular IDE channel.
|
This function can be used to obtain information about a particular IDE channel.
|
||||||
The driver entity uses this information during the enumeration process.
|
The driver entity uses this information during the enumeration process.
|
||||||
|
|
||||||
If Enabled is set to FALSE, the driver entity will not scan the channel. Note
|
If Enabled is set to FALSE, the driver entity will not scan the channel. Note
|
||||||
that it will not prevent an operating system driver from scanning the channel.
|
that it will not prevent an operating system driver from scanning the channel.
|
||||||
|
|
||||||
For most of today's controllers, MaxDevices will either be 1 or 2. For SATA
|
For most of today's controllers, MaxDevices will either be 1 or 2. For SATA
|
||||||
controllers, this value will always be 1. SATA configurations can contain SATA
|
controllers, this value will always be 1. SATA configurations can contain SATA
|
||||||
port multipliers. SATA port multipliers behave like SATA bridges and can support
|
port multipliers. SATA port multipliers behave like SATA bridges and can support
|
||||||
up to 16 devices on the other side. If a SATA port out of the IDE controller
|
up to 16 devices on the other side. If a SATA port out of the IDE controller
|
||||||
is connected to a port multiplier, MaxDevices will be set to the number of SATA
|
is connected to a port multiplier, MaxDevices will be set to the number of SATA
|
||||||
devices that the port multiplier supports. Because today's port multipliers
|
devices that the port multiplier supports. Because today's port multipliers
|
||||||
support up to fifteen SATA devices, this number can be as large as fifteen. The IDE
|
support up to fifteen SATA devices, this number can be as large as fifteen. The IDE
|
||||||
bus driver is required to scan for the presence of port multipliers behind an SATA
|
bus driver is required to scan for the presence of port multipliers behind an SATA
|
||||||
controller and enumerate up to MaxDevices number of devices behind the port
|
controller and enumerate up to MaxDevices number of devices behind the port
|
||||||
multiplier.
|
multiplier.
|
||||||
|
|
||||||
In this context, the devices behind a port multiplier constitute a channel.
|
In this context, the devices behind a port multiplier constitute a channel.
|
||||||
|
|
||||||
@param[in] This The pointer to the EFI_IDE_CONTROLLER_INIT_PROTOCOL instance.
|
@param[in] This The pointer to the EFI_IDE_CONTROLLER_INIT_PROTOCOL instance.
|
||||||
@param[in] Channel Zero-based channel number.
|
@param[in] Channel Zero-based channel number.
|
||||||
@param[out] Enabled TRUE if this channel is enabled. Disabled channels
|
@param[out] Enabled TRUE if this channel is enabled. Disabled channels
|
||||||
are not scanned to see if any devices are present.
|
are not scanned to see if any devices are present.
|
||||||
@param[out] MaxDevices The maximum number of IDE devices that the bus driver
|
@param[out] MaxDevices The maximum number of IDE devices that the bus driver
|
||||||
can expect on this channel. For the ATA/ATAPI
|
can expect on this channel. For the ATA/ATAPI
|
||||||
specification, version 6, this number will either be
|
specification, version 6, this number will either be
|
||||||
one or two. For Serial ATA (SATA) configurations with a
|
one or two. For Serial ATA (SATA) configurations with a
|
||||||
port multiplier, this number can be as large as fifteen.
|
port multiplier, this number can be as large as fifteen.
|
||||||
|
|
||||||
|
|
||||||
@ -240,13 +240,13 @@ IdeInitGetChannelInfo (
|
|||||||
/**
|
/**
|
||||||
The notifications from the driver entity that it is about to enter a certain
|
The notifications from the driver entity that it is about to enter a certain
|
||||||
phase of the IDE channel enumeration process.
|
phase of the IDE channel enumeration process.
|
||||||
|
|
||||||
This function can be used to notify the IDE controller driver to perform
|
This function can be used to notify the IDE controller driver to perform
|
||||||
specific actions, including any chipset-specific initialization, so that the
|
specific actions, including any chipset-specific initialization, so that the
|
||||||
chipset is ready to enter the next phase. Seven notification points are defined
|
chipset is ready to enter the next phase. Seven notification points are defined
|
||||||
at this time.
|
at this time.
|
||||||
|
|
||||||
More synchronization points may be added as required in the future.
|
More synchronization points may be added as required in the future.
|
||||||
|
|
||||||
@param[in] This The pointer to the EFI_IDE_CONTROLLER_INIT_PROTOCOL
|
@param[in] This The pointer to the EFI_IDE_CONTROLLER_INIT_PROTOCOL
|
||||||
instance.
|
instance.
|
||||||
@ -256,9 +256,9 @@ IdeInitGetChannelInfo (
|
|||||||
@retval EFI_SUCCESS The notification was accepted without any errors.
|
@retval EFI_SUCCESS The notification was accepted without any errors.
|
||||||
@retval EFI_UNSUPPORTED Phase is not supported.
|
@retval EFI_UNSUPPORTED Phase is not supported.
|
||||||
@retval EFI_INVALID_PARAMETER Channel is invalid (Channel >= ChannelCount).
|
@retval EFI_INVALID_PARAMETER Channel is invalid (Channel >= ChannelCount).
|
||||||
@retval EFI_NOT_READY This phase cannot be entered at this time; for
|
@retval EFI_NOT_READY This phase cannot be entered at this time; for
|
||||||
example, an attempt was made to enter a Phase
|
example, an attempt was made to enter a Phase
|
||||||
without having entered one or more previous
|
without having entered one or more previous
|
||||||
Phase.
|
Phase.
|
||||||
|
|
||||||
**/
|
**/
|
||||||
@ -273,32 +273,32 @@ IdeInitNotifyPhase (
|
|||||||
/**
|
/**
|
||||||
Submits the device information to the IDE controller driver.
|
Submits the device information to the IDE controller driver.
|
||||||
|
|
||||||
This function is used by the driver entity to pass detailed information about
|
This function is used by the driver entity to pass detailed information about
|
||||||
a particular device to the IDE controller driver. The driver entity obtains
|
a particular device to the IDE controller driver. The driver entity obtains
|
||||||
this information by issuing an ATA or ATAPI IDENTIFY_DEVICE command. IdentifyData
|
this information by issuing an ATA or ATAPI IDENTIFY_DEVICE command. IdentifyData
|
||||||
is the pointer to the response data buffer. The IdentifyData buffer is owned
|
is the pointer to the response data buffer. The IdentifyData buffer is owned
|
||||||
by the driver entity, and the IDE controller driver must make a local copy
|
by the driver entity, and the IDE controller driver must make a local copy
|
||||||
of the entire buffer or parts of the buffer as needed. The original IdentifyData
|
of the entire buffer or parts of the buffer as needed. The original IdentifyData
|
||||||
buffer pointer may not be valid when
|
buffer pointer may not be valid when
|
||||||
|
|
||||||
- EFI_IDE_CONTROLLER_INIT_PROTOCOL.CalculateMode() or
|
- EFI_IDE_CONTROLLER_INIT_PROTOCOL.CalculateMode() or
|
||||||
- EFI_IDE_CONTROLLER_INIT_PROTOCOL.DisqualifyMode() is called at a later point.
|
- EFI_IDE_CONTROLLER_INIT_PROTOCOL.DisqualifyMode() is called at a later point.
|
||||||
|
|
||||||
The IDE controller driver may consult various fields of EFI_IDENTIFY_DATA to
|
The IDE controller driver may consult various fields of EFI_IDENTIFY_DATA to
|
||||||
compute the optimum mode for the device. These fields are not limited to the
|
compute the optimum mode for the device. These fields are not limited to the
|
||||||
timing information. For example, an implementation of the IDE controller driver
|
timing information. For example, an implementation of the IDE controller driver
|
||||||
may examine the vendor and type/mode field to match known bad drives.
|
may examine the vendor and type/mode field to match known bad drives.
|
||||||
|
|
||||||
The driver entity may submit drive information in any order, as long as it
|
The driver entity may submit drive information in any order, as long as it
|
||||||
submits information for all the devices belonging to the enumeration group
|
submits information for all the devices belonging to the enumeration group
|
||||||
before EFI_IDE_CONTROLLER_INIT_PROTOCOL.CalculateMode() is called for any device
|
before EFI_IDE_CONTROLLER_INIT_PROTOCOL.CalculateMode() is called for any device
|
||||||
in that enumeration group. If a device is absent, EFI_IDE_CONTROLLER_INIT_PROTOCOL.SubmitData()
|
in that enumeration group. If a device is absent, EFI_IDE_CONTROLLER_INIT_PROTOCOL.SubmitData()
|
||||||
should be called with IdentifyData set to NULL. The IDE controller driver may
|
should be called with IdentifyData set to NULL. The IDE controller driver may
|
||||||
not have any other mechanism to know whether a device is present or not. Therefore,
|
not have any other mechanism to know whether a device is present or not. Therefore,
|
||||||
setting IdentifyData to NULL does not constitute an error condition.
|
setting IdentifyData to NULL does not constitute an error condition.
|
||||||
EFI_IDE_CONTROLLER_INIT_PROTOCOL.SubmitData() can be called only once for a
|
EFI_IDE_CONTROLLER_INIT_PROTOCOL.SubmitData() can be called only once for a
|
||||||
given (Channel, Device) pair.
|
given (Channel, Device) pair.
|
||||||
|
|
||||||
@param[in] This A pointer to the EFI_IDE_CONTROLLER_INIT_PROTOCOL instance.
|
@param[in] This A pointer to the EFI_IDE_CONTROLLER_INIT_PROTOCOL instance.
|
||||||
@param[in] Channel Zero-based channel number.
|
@param[in] Channel Zero-based channel number.
|
||||||
@param[in] Device Zero-based device number on the Channel.
|
@param[in] Device Zero-based device number on the Channel.
|
||||||
@ -321,31 +321,31 @@ IdeInitSubmitData (
|
|||||||
/**
|
/**
|
||||||
Disqualifies specific modes for an IDE device.
|
Disqualifies specific modes for an IDE device.
|
||||||
|
|
||||||
This function allows the driver entity or other drivers (such as platform
|
This function allows the driver entity or other drivers (such as platform
|
||||||
drivers) to reject certain timing modes and request the IDE controller driver
|
drivers) to reject certain timing modes and request the IDE controller driver
|
||||||
to recalculate modes. This function allows the driver entity and the IDE
|
to recalculate modes. This function allows the driver entity and the IDE
|
||||||
controller driver to negotiate the timings on a per-device basis. This function
|
controller driver to negotiate the timings on a per-device basis. This function
|
||||||
is useful in the case of drives that lie about their capabilities. An example
|
is useful in the case of drives that lie about their capabilities. An example
|
||||||
is when the IDE device fails to accept the timing modes that are calculated
|
is when the IDE device fails to accept the timing modes that are calculated
|
||||||
by the IDE controller driver based on the response to the Identify Drive command.
|
by the IDE controller driver based on the response to the Identify Drive command.
|
||||||
|
|
||||||
If the driver entity does not want to limit the ATA timing modes and leave that
|
If the driver entity does not want to limit the ATA timing modes and leave that
|
||||||
decision to the IDE controller driver, it can either not call this function for
|
decision to the IDE controller driver, it can either not call this function for
|
||||||
the given device or call this function and set the Valid flag to FALSE for all
|
the given device or call this function and set the Valid flag to FALSE for all
|
||||||
modes that are listed in EFI_ATA_COLLECTIVE_MODE.
|
modes that are listed in EFI_ATA_COLLECTIVE_MODE.
|
||||||
|
|
||||||
The driver entity may disqualify modes for a device in any order and any number
|
The driver entity may disqualify modes for a device in any order and any number
|
||||||
of times.
|
of times.
|
||||||
|
|
||||||
This function can be called multiple times to invalidate multiple modes of the
|
This function can be called multiple times to invalidate multiple modes of the
|
||||||
same type (e.g., Programmed Input/Output [PIO] modes 3 and 4). See the ATA/ATAPI
|
same type (e.g., Programmed Input/Output [PIO] modes 3 and 4). See the ATA/ATAPI
|
||||||
specification for more information on PIO modes.
|
specification for more information on PIO modes.
|
||||||
|
|
||||||
For Serial ATA (SATA) controllers, this member function can be used to disqualify
|
For Serial ATA (SATA) controllers, this member function can be used to disqualify
|
||||||
a higher transfer rate mode on a given channel. For example, a platform driver
|
a higher transfer rate mode on a given channel. For example, a platform driver
|
||||||
may inform the IDE controller driver to not use second-generation (Gen2) speeds
|
may inform the IDE controller driver to not use second-generation (Gen2) speeds
|
||||||
for a certain SATA drive.
|
for a certain SATA drive.
|
||||||
|
|
||||||
@param[in] This The pointer to the EFI_IDE_CONTROLLER_INIT_PROTOCOL instance.
|
@param[in] This The pointer to the EFI_IDE_CONTROLLER_INIT_PROTOCOL instance.
|
||||||
@param[in] Channel The zero-based channel number.
|
@param[in] Channel The zero-based channel number.
|
||||||
@param[in] Device The zero-based device number on the Channel.
|
@param[in] Device The zero-based device number on the Channel.
|
||||||
@ -356,7 +356,7 @@ IdeInitSubmitData (
|
|||||||
@retval EFI_INVALID_PARAMETER Channel is invalid (Channel >= ChannelCount).
|
@retval EFI_INVALID_PARAMETER Channel is invalid (Channel >= ChannelCount).
|
||||||
@retval EFI_INVALID_PARAMETER Device is invalid.
|
@retval EFI_INVALID_PARAMETER Device is invalid.
|
||||||
@retval EFI_INVALID_PARAMETER IdentifyData is NULL.
|
@retval EFI_INVALID_PARAMETER IdentifyData is NULL.
|
||||||
|
|
||||||
**/
|
**/
|
||||||
EFI_STATUS
|
EFI_STATUS
|
||||||
EFIAPI
|
EFIAPI
|
||||||
@ -371,39 +371,39 @@ IdeInitDisqualifyMode (
|
|||||||
Returns the information about the optimum modes for the specified IDE device.
|
Returns the information about the optimum modes for the specified IDE device.
|
||||||
|
|
||||||
This function is used by the driver entity to obtain the optimum ATA modes for
|
This function is used by the driver entity to obtain the optimum ATA modes for
|
||||||
a specific device. The IDE controller driver takes into account the following
|
a specific device. The IDE controller driver takes into account the following
|
||||||
while calculating the mode:
|
while calculating the mode:
|
||||||
- The IdentifyData inputs to EFI_IDE_CONTROLLER_INIT_PROTOCOL.SubmitData()
|
- The IdentifyData inputs to EFI_IDE_CONTROLLER_INIT_PROTOCOL.SubmitData()
|
||||||
- The BadModes inputs to EFI_IDE_CONTROLLER_INIT_PROTOCOL.DisqualifyMode()
|
- The BadModes inputs to EFI_IDE_CONTROLLER_INIT_PROTOCOL.DisqualifyMode()
|
||||||
|
|
||||||
The driver entity is required to call EFI_IDE_CONTROLLER_INIT_PROTOCOL.SubmitData()
|
The driver entity is required to call EFI_IDE_CONTROLLER_INIT_PROTOCOL.SubmitData()
|
||||||
for all the devices that belong to an enumeration group before calling
|
for all the devices that belong to an enumeration group before calling
|
||||||
EFI_IDE_CONTROLLER_INIT_PROTOCOL.CalculateMode() for any device in the same group.
|
EFI_IDE_CONTROLLER_INIT_PROTOCOL.CalculateMode() for any device in the same group.
|
||||||
|
|
||||||
The IDE controller driver will use controller- and possibly platform-specific
|
The IDE controller driver will use controller- and possibly platform-specific
|
||||||
algorithms to arrive at SupportedModes. The IDE controller may base its
|
algorithms to arrive at SupportedModes. The IDE controller may base its
|
||||||
decision on user preferences and other considerations as well. This function
|
decision on user preferences and other considerations as well. This function
|
||||||
may be called multiple times because the driver entity may renegotiate the mode
|
may be called multiple times because the driver entity may renegotiate the mode
|
||||||
with the IDE controller driver using EFI_IDE_CONTROLLER_INIT_PROTOCOL.DisqualifyMode().
|
with the IDE controller driver using EFI_IDE_CONTROLLER_INIT_PROTOCOL.DisqualifyMode().
|
||||||
|
|
||||||
The driver entity may collect timing information for various devices in any
|
The driver entity may collect timing information for various devices in any
|
||||||
order. The driver entity is responsible for making sure that all the dependencies
|
order. The driver entity is responsible for making sure that all the dependencies
|
||||||
are satisfied. For example, the SupportedModes information for device A that
|
are satisfied. For example, the SupportedModes information for device A that
|
||||||
was previously returned may become stale after a call to
|
was previously returned may become stale after a call to
|
||||||
EFI_IDE_CONTROLLER_INIT_PROTOCOL.DisqualifyMode() for device B.
|
EFI_IDE_CONTROLLER_INIT_PROTOCOL.DisqualifyMode() for device B.
|
||||||
|
|
||||||
The buffer SupportedModes is allocated by the callee because the caller does
|
The buffer SupportedModes is allocated by the callee because the caller does
|
||||||
not necessarily know the size of the buffer. The type EFI_ATA_COLLECTIVE_MODE
|
not necessarily know the size of the buffer. The type EFI_ATA_COLLECTIVE_MODE
|
||||||
is defined in a way that allows for future extensibility and can be of variable
|
is defined in a way that allows for future extensibility and can be of variable
|
||||||
length. This memory pool should be deallocated by the caller when it is no
|
length. This memory pool should be deallocated by the caller when it is no
|
||||||
longer necessary.
|
longer necessary.
|
||||||
|
|
||||||
The IDE controller driver for a Serial ATA (SATA) controller can use this
|
The IDE controller driver for a Serial ATA (SATA) controller can use this
|
||||||
member function to force a lower speed (first-generation [Gen1] speeds on a
|
member function to force a lower speed (first-generation [Gen1] speeds on a
|
||||||
second-generation [Gen2]-capable hardware). The IDE controller driver can
|
second-generation [Gen2]-capable hardware). The IDE controller driver can
|
||||||
also allow the driver entity to stay with the speed that has been negotiated
|
also allow the driver entity to stay with the speed that has been negotiated
|
||||||
by the physical layer.
|
by the physical layer.
|
||||||
|
|
||||||
@param[in] This The pointer to the EFI_IDE_CONTROLLER_INIT_PROTOCOL instance.
|
@param[in] This The pointer to the EFI_IDE_CONTROLLER_INIT_PROTOCOL instance.
|
||||||
@param[in] Channel A zero-based channel number.
|
@param[in] Channel A zero-based channel number.
|
||||||
@param[in] Device A zero-based device number on the Channel.
|
@param[in] Device A zero-based device number on the Channel.
|
||||||
@ -411,13 +411,13 @@ IdeInitDisqualifyMode (
|
|||||||
|
|
||||||
@retval EFI_SUCCESS SupportedModes was returned.
|
@retval EFI_SUCCESS SupportedModes was returned.
|
||||||
@retval EFI_INVALID_PARAMETER Channel is invalid (Channel >= ChannelCount).
|
@retval EFI_INVALID_PARAMETER Channel is invalid (Channel >= ChannelCount).
|
||||||
@retval EFI_INVALID_PARAMETER Device is invalid.
|
@retval EFI_INVALID_PARAMETER Device is invalid.
|
||||||
@retval EFI_INVALID_PARAMETER SupportedModes is NULL.
|
@retval EFI_INVALID_PARAMETER SupportedModes is NULL.
|
||||||
@retval EFI_NOT_READY Modes cannot be calculated due to a lack of
|
@retval EFI_NOT_READY Modes cannot be calculated due to a lack of
|
||||||
data. This error may happen if
|
data. This error may happen if
|
||||||
EFI_IDE_CONTROLLER_INIT_PROTOCOL.SubmitData()
|
EFI_IDE_CONTROLLER_INIT_PROTOCOL.SubmitData()
|
||||||
and EFI_IDE_CONTROLLER_INIT_PROTOCOL.DisqualifyData()
|
and EFI_IDE_CONTROLLER_INIT_PROTOCOL.DisqualifyData()
|
||||||
were not called for at least one drive in the
|
were not called for at least one drive in the
|
||||||
same enumeration group.
|
same enumeration group.
|
||||||
|
|
||||||
**/
|
**/
|
||||||
@ -434,9 +434,9 @@ IdeInitCalculateMode (
|
|||||||
Commands the IDE controller driver to program the IDE controller hardware
|
Commands the IDE controller driver to program the IDE controller hardware
|
||||||
so that the specified device can operate at the specified mode.
|
so that the specified device can operate at the specified mode.
|
||||||
|
|
||||||
This function is used by the driver entity to instruct the IDE controller
|
This function is used by the driver entity to instruct the IDE controller
|
||||||
driver to program the IDE controller hardware to the specified modes. This
|
driver to program the IDE controller hardware to the specified modes. This
|
||||||
function can be called only once for a particular device. For a Serial ATA
|
function can be called only once for a particular device. For a Serial ATA
|
||||||
(SATA) Advanced Host Controller Interface (AHCI) controller, no controller-
|
(SATA) Advanced Host Controller Interface (AHCI) controller, no controller-
|
||||||
specific programming may be required.
|
specific programming may be required.
|
||||||
|
|
||||||
|
@ -1,15 +1,15 @@
|
|||||||
## @file
|
## @file
|
||||||
# SataController driver to manage SATA compliance IDE/AHCI host controllers.
|
# SataController driver to manage SATA compliance IDE/AHCI host controllers.
|
||||||
#
|
#
|
||||||
# Copyright (c) 2011 - 2016, Intel Corporation. All rights reserved.<BR>
|
# Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||||
# This program and the accompanying materials
|
# This program and the accompanying materials
|
||||||
# are licensed and made available under the terms and conditions of the BSD License
|
# 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
|
# which accompanies this distribution. The full text of the license may be found at
|
||||||
# http://opensource.org/licenses/bsd-license.php
|
# http://opensource.org/licenses/bsd-license.php
|
||||||
#
|
#
|
||||||
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||||
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||||
#
|
#
|
||||||
##
|
##
|
||||||
|
|
||||||
[Defines]
|
[Defines]
|
||||||
@ -26,7 +26,7 @@
|
|||||||
#
|
#
|
||||||
# VALID_ARCHITECTURES = IA32 X64 IPF EBC ARM AARCH64
|
# VALID_ARCHITECTURES = IA32 X64 IPF EBC ARM AARCH64
|
||||||
#
|
#
|
||||||
# DRIVER_BINDING = gSataControllerDriverBinding
|
# DRIVER_BINDING = gSataControllerDriverBinding
|
||||||
# COMPONENT_NAME = gSataControllerComponentName
|
# COMPONENT_NAME = gSataControllerComponentName
|
||||||
# COMPONENT_NAME2 = gSataControllerComponentName2
|
# COMPONENT_NAME2 = gSataControllerComponentName2
|
||||||
#
|
#
|
||||||
|
@ -3,13 +3,13 @@
|
|||||||
//
|
//
|
||||||
// It consumes PciIo protocol and produces IdeControllerInit protocol for upper layer use.
|
// It consumes PciIo protocol and produces IdeControllerInit protocol for upper layer use.
|
||||||
//
|
//
|
||||||
// Copyright (c) 2016, Intel Corporation. All rights reserved.<BR>
|
// Copyright (c) 2016 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||||
//
|
//
|
||||||
// This program and the accompanying materials
|
// This program and the accompanying materials
|
||||||
// are licensed and made available under the terms and conditions of the BSD License
|
// 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
|
// which accompanies this distribution. The full text of the license may be found at
|
||||||
// http://opensource.org/licenses/bsd-license.php
|
// http://opensource.org/licenses/bsd-license.php
|
||||||
//
|
//
|
||||||
// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||||
// WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
// WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||||
//
|
//
|
||||||
@ -19,4 +19,4 @@
|
|||||||
#string STR_MODULE_ABSTRACT #language en-US "Responsible for managing the standard SATA controller"
|
#string STR_MODULE_ABSTRACT #language en-US "Responsible for managing the standard SATA controller"
|
||||||
|
|
||||||
#string STR_MODULE_DESCRIPTION #language en-US "Implements the IdeControllerInit protocol interface for upper layer use\n"
|
#string STR_MODULE_DESCRIPTION #language en-US "Implements the IdeControllerInit protocol interface for upper layer use\n"
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// /** @file
|
// /** @file
|
||||||
// SataControllerDxe Localized Strings and Content
|
// SataControllerDxe Localized Strings and Content
|
||||||
//
|
//
|
||||||
// Copyright (c) 2016, Intel Corporation. All rights reserved.<BR>
|
// Copyright (c) 2016 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||||
//
|
//
|
||||||
// This program and the accompanying materials
|
// This program and the accompanying materials
|
||||||
// are licensed and made available under the terms and conditions of the BSD License
|
// are licensed and made available under the terms and conditions of the BSD License
|
||||||
@ -13,8 +13,8 @@
|
|||||||
//
|
//
|
||||||
// **/
|
// **/
|
||||||
|
|
||||||
#string STR_PROPERTIES_MODULE_NAME
|
#string STR_PROPERTIES_MODULE_NAME
|
||||||
#language en-US
|
#language en-US
|
||||||
"SATA Controller DXE Driver"
|
"SATA Controller DXE Driver"
|
||||||
|
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
SdMmcPciHcPei driver is used to provide platform-dependent info, mainly SD/MMC
|
SdMmcPciHcPei driver is used to provide platform-dependent info, mainly SD/MMC
|
||||||
host controller MMIO base, to upper layer SD/MMC drivers.
|
host controller MMIO base, to upper layer SD/MMC drivers.
|
||||||
|
|
||||||
Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>
|
Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||||
This program and the accompanying materials
|
This program and the accompanying materials
|
||||||
are licensed and made available under the terms and conditions of the BSD License
|
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
|
which accompanies this distribution. The full text of the license may be found at
|
||||||
@ -160,7 +160,7 @@ InitializeSdMmcHcPeim (
|
|||||||
//
|
//
|
||||||
MmioSize = Size & 0xFFFFFFF0;
|
MmioSize = Size & 0xFFFFFFF0;
|
||||||
PciWrite32 (PCI_LIB_ADDRESS(Bus, Device, Function, PCI_BASE_ADDRESSREG_OFFSET + 4), 0xFFFFFFFF);
|
PciWrite32 (PCI_LIB_ADDRESS(Bus, Device, Function, PCI_BASE_ADDRESSREG_OFFSET + 4), 0xFFFFFFFF);
|
||||||
Size = PciRead32 (PCI_LIB_ADDRESS(Bus, Device, Function, PCI_BASE_ADDRESSREG_OFFSET + 4));
|
Size = PciRead32 (PCI_LIB_ADDRESS(Bus, Device, Function, PCI_BASE_ADDRESSREG_OFFSET + 4));
|
||||||
//
|
//
|
||||||
// Fix the length to support some spefic 64 bit BAR
|
// Fix the length to support some spefic 64 bit BAR
|
||||||
//
|
//
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
## @file
|
## @file
|
||||||
# Component Description File For SD/MMC Pci Host Controller Pei Module.
|
# Component Description File For SD/MMC Pci Host Controller Pei Module.
|
||||||
#
|
#
|
||||||
# Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>
|
# Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||||
#
|
#
|
||||||
# This program and the accompanying materials
|
# This program and the accompanying materials
|
||||||
# are licensed and made available under the terms and conditions of the BSD License
|
# are licensed and made available under the terms and conditions of the BSD License
|
||||||
@ -53,4 +53,4 @@
|
|||||||
gEfiPeiMasterBootModePpiGuid AND gEfiPeiMemoryDiscoveredPpiGuid
|
gEfiPeiMasterBootModePpiGuid AND gEfiPeiMemoryDiscoveredPpiGuid
|
||||||
|
|
||||||
[UserExtensions.TianoCore."ExtraFiles"]
|
[UserExtensions.TianoCore."ExtraFiles"]
|
||||||
SdMmcPciHcPeiExtra.uni
|
SdMmcPciHcPeiExtra.uni
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
UfsHcDxe driver produces EFI_UFS_HOST_CONTROLLER_PROTOCOL. The upper layer module
|
UfsHcDxe driver produces EFI_UFS_HOST_CONTROLLER_PROTOCOL. The upper layer module
|
||||||
uses it to query the MMIO base address of the UFS host controller.
|
uses it to query the MMIO base address of the UFS host controller.
|
||||||
|
|
||||||
Copyright (c) 2014, Intel Corporation. All rights reserved.<BR>
|
Copyright (c) 2014 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||||
This program and the accompanying materials
|
This program and the accompanying materials
|
||||||
are licensed and made available under the terms and conditions of the BSD License
|
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
|
which accompanies this distribution. The full text of the license may be found at
|
||||||
@ -38,7 +38,7 @@ GLOBAL_REMOVE_IF_UNREFERENCED EFI_UNICODE_STRING_TABLE mUfsHcDriverNameTable[] =
|
|||||||
"eng;en",
|
"eng;en",
|
||||||
L"Universal Flash Storage (UFS) Pci Host Controller Driver"
|
L"Universal Flash Storage (UFS) Pci Host Controller Driver"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
NULL,
|
NULL,
|
||||||
NULL
|
NULL
|
||||||
}
|
}
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
UfsHcDxe driver is used to provide platform-dependent info, mainly UFS host controller
|
UfsHcDxe driver is used to provide platform-dependent info, mainly UFS host controller
|
||||||
MMIO base, to upper layer UFS drivers.
|
MMIO base, to upper layer UFS drivers.
|
||||||
|
|
||||||
Copyright (c) 2014 - 2017, Intel Corporation. All rights reserved.<BR>
|
Copyright (c) 2014 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||||
This program and the accompanying materials
|
This program and the accompanying materials
|
||||||
are licensed and made available under the terms and conditions of the BSD License
|
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
|
which accompanies this distribution. The full text of the license may be found at
|
||||||
@ -95,24 +95,24 @@ UfsHcGetMmioBar (
|
|||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Provides the UFS controller-specific addresses needed to access system memory.
|
Provides the UFS controller-specific addresses needed to access system memory.
|
||||||
|
|
||||||
@param This A pointer to the EFI_UFS_HOST_CONTROLLER_PROTOCOL instance.
|
@param This A pointer to the EFI_UFS_HOST_CONTROLLER_PROTOCOL instance.
|
||||||
@param Operation Indicates if the bus master is going to read or write to system memory.
|
@param Operation Indicates if the bus master is going to read or write to system memory.
|
||||||
@param HostAddress The system memory address to map to the UFS controller.
|
@param HostAddress The system memory address to map to the UFS controller.
|
||||||
@param NumberOfBytes On input the number of bytes to map. On output the number of bytes
|
@param NumberOfBytes On input the number of bytes to map. On output the number of bytes
|
||||||
that were mapped.
|
that were mapped.
|
||||||
@param DeviceAddress The resulting map address for the bus master UFS controller to use to
|
@param DeviceAddress The resulting map address for the bus master UFS controller to use to
|
||||||
access the hosts HostAddress.
|
access the hosts HostAddress.
|
||||||
@param Mapping A resulting value to pass to Unmap().
|
@param Mapping A resulting value to pass to Unmap().
|
||||||
|
|
||||||
@retval EFI_SUCCESS The range was mapped for the returned NumberOfBytes.
|
@retval EFI_SUCCESS The range was mapped for the returned NumberOfBytes.
|
||||||
@retval EFI_UNSUPPORTED The HostAddress cannot be mapped as a common buffer.
|
@retval EFI_UNSUPPORTED The HostAddress cannot be mapped as a common buffer.
|
||||||
@retval EFI_INVALID_PARAMETER One or more parameters are invalid.
|
@retval EFI_INVALID_PARAMETER One or more parameters are invalid.
|
||||||
@retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources.
|
@retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources.
|
||||||
@retval EFI_DEVICE_ERROR The system hardware could not map the requested address.
|
@retval EFI_DEVICE_ERROR The system hardware could not map the requested address.
|
||||||
|
|
||||||
**/
|
**/
|
||||||
EFI_STATUS
|
EFI_STATUS
|
||||||
EFIAPI
|
EFIAPI
|
||||||
@ -140,15 +140,15 @@ UfsHcMap (
|
|||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Completes the Map() operation and releases any corresponding resources.
|
Completes the Map() operation and releases any corresponding resources.
|
||||||
|
|
||||||
@param This A pointer to the EFI_UFS_HOST_CONTROLLER_PROTOCOL instance.
|
@param This A pointer to the EFI_UFS_HOST_CONTROLLER_PROTOCOL instance.
|
||||||
@param Mapping The mapping value returned from Map().
|
@param Mapping The mapping value returned from Map().
|
||||||
|
|
||||||
@retval EFI_SUCCESS The range was unmapped.
|
@retval EFI_SUCCESS The range was unmapped.
|
||||||
@retval EFI_DEVICE_ERROR The data was not committed to the target system memory.
|
@retval EFI_DEVICE_ERROR The data was not committed to the target system memory.
|
||||||
|
|
||||||
**/
|
**/
|
||||||
EFI_STATUS
|
EFI_STATUS
|
||||||
EFIAPI
|
EFIAPI
|
||||||
@ -172,25 +172,25 @@ UfsHcUnmap (
|
|||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Allocates pages that are suitable for an EfiUfsHcOperationBusMasterCommonBuffer
|
Allocates pages that are suitable for an EfiUfsHcOperationBusMasterCommonBuffer
|
||||||
mapping.
|
mapping.
|
||||||
|
|
||||||
@param This A pointer to the EFI_UFS_HOST_CONTROLLER_PROTOCOL instance.
|
@param This A pointer to the EFI_UFS_HOST_CONTROLLER_PROTOCOL instance.
|
||||||
@param Type This parameter is not used and must be ignored.
|
@param Type This parameter is not used and must be ignored.
|
||||||
@param MemoryType The type of memory to allocate, EfiBootServicesData or
|
@param MemoryType The type of memory to allocate, EfiBootServicesData or
|
||||||
EfiRuntimeServicesData.
|
EfiRuntimeServicesData.
|
||||||
@param Pages The number of pages to allocate.
|
@param Pages The number of pages to allocate.
|
||||||
@param HostAddress A pointer to store the base system memory address of the
|
@param HostAddress A pointer to store the base system memory address of the
|
||||||
allocated range.
|
allocated range.
|
||||||
@param Attributes The requested bit mask of attributes for the allocated range.
|
@param Attributes The requested bit mask of attributes for the allocated range.
|
||||||
|
|
||||||
@retval EFI_SUCCESS The requested memory pages were allocated.
|
@retval EFI_SUCCESS The requested memory pages were allocated.
|
||||||
@retval EFI_UNSUPPORTED Attributes is unsupported. The only legal attribute bits are
|
@retval EFI_UNSUPPORTED Attributes is unsupported. The only legal attribute bits are
|
||||||
MEMORY_WRITE_COMBINE and MEMORY_CACHED.
|
MEMORY_WRITE_COMBINE and MEMORY_CACHED.
|
||||||
@retval EFI_INVALID_PARAMETER One or more parameters are invalid.
|
@retval EFI_INVALID_PARAMETER One or more parameters are invalid.
|
||||||
@retval EFI_OUT_OF_RESOURCES The memory pages could not be allocated.
|
@retval EFI_OUT_OF_RESOURCES The memory pages could not be allocated.
|
||||||
|
|
||||||
**/
|
**/
|
||||||
EFI_STATUS
|
EFI_STATUS
|
||||||
EFIAPI
|
EFIAPI
|
||||||
@ -218,17 +218,17 @@ UfsHcAllocateBuffer (
|
|||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Frees memory that was allocated with AllocateBuffer().
|
Frees memory that was allocated with AllocateBuffer().
|
||||||
|
|
||||||
@param This A pointer to the EFI_UFS_HOST_CONTROLLER_PROTOCOL instance.
|
@param This A pointer to the EFI_UFS_HOST_CONTROLLER_PROTOCOL instance.
|
||||||
@param Pages The number of pages to free.
|
@param Pages The number of pages to free.
|
||||||
@param HostAddress The base system memory address of the allocated range.
|
@param HostAddress The base system memory address of the allocated range.
|
||||||
|
|
||||||
@retval EFI_SUCCESS The requested memory pages were freed.
|
@retval EFI_SUCCESS The requested memory pages were freed.
|
||||||
@retval EFI_INVALID_PARAMETER The memory range specified by HostAddress and Pages
|
@retval EFI_INVALID_PARAMETER The memory range specified by HostAddress and Pages
|
||||||
was not allocated with AllocateBuffer().
|
was not allocated with AllocateBuffer().
|
||||||
|
|
||||||
**/
|
**/
|
||||||
EFI_STATUS
|
EFI_STATUS
|
||||||
EFIAPI
|
EFIAPI
|
||||||
@ -253,16 +253,16 @@ UfsHcFreeBuffer (
|
|||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Flushes all posted write transactions from the UFS bus to attached UFS device.
|
Flushes all posted write transactions from the UFS bus to attached UFS device.
|
||||||
|
|
||||||
@param This A pointer to the EFI_UFS_HOST_CONTROLLER_PROTOCOL instance.
|
@param This A pointer to the EFI_UFS_HOST_CONTROLLER_PROTOCOL instance.
|
||||||
|
|
||||||
@retval EFI_SUCCESS The posted write transactions were flushed from the UFS bus
|
@retval EFI_SUCCESS The posted write transactions were flushed from the UFS bus
|
||||||
to attached UFS device.
|
to attached UFS device.
|
||||||
@retval EFI_DEVICE_ERROR The posted write transactions were not flushed from the UFS
|
@retval EFI_DEVICE_ERROR The posted write transactions were not flushed from the UFS
|
||||||
bus to attached UFS device due to a hardware error.
|
bus to attached UFS device due to a hardware error.
|
||||||
|
|
||||||
**/
|
**/
|
||||||
EFI_STATUS
|
EFI_STATUS
|
||||||
EFIAPI
|
EFIAPI
|
||||||
@ -281,7 +281,7 @@ UfsHcFlush (
|
|||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Enable a UFS bus driver to access UFS MMIO registers in the UFS Host Controller memory space.
|
Enable a UFS bus driver to access UFS MMIO registers in the UFS Host Controller memory space.
|
||||||
|
|
||||||
@param This A pointer to the EDKII_UFS_HOST_CONTROLLER_PROTOCOL instance.
|
@param This A pointer to the EDKII_UFS_HOST_CONTROLLER_PROTOCOL instance.
|
||||||
@ -323,7 +323,7 @@ UfsHcMmioRead (
|
|||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Enable a UFS bus driver to access UFS MMIO registers in the UFS Host Controller memory space.
|
Enable a UFS bus driver to access UFS MMIO registers in the UFS Host Controller memory space.
|
||||||
|
|
||||||
@param This A pointer to the EDKII_UFS_HOST_CONTROLLER_PROTOCOL instance.
|
@param This A pointer to the EDKII_UFS_HOST_CONTROLLER_PROTOCOL instance.
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
UfsHcDxe driver is used to provide platform-dependent info, mainly UFS host controller
|
UfsHcDxe driver is used to provide platform-dependent info, mainly UFS host controller
|
||||||
MMIO base, to upper layer UFS drivers.
|
MMIO base, to upper layer UFS drivers.
|
||||||
|
|
||||||
Copyright (c) 2014 - 2017, Intel Corporation. All rights reserved.<BR>
|
Copyright (c) 2014 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||||
This program and the accompanying materials
|
This program and the accompanying materials
|
||||||
are licensed and made available under the terms and conditions of the BSD License
|
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
|
which accompanies this distribution. The full text of the license may be found at
|
||||||
@ -55,7 +55,7 @@ struct _UFS_HOST_CONTROLLER_PRIVATE_DATA {
|
|||||||
UINT32 Signature;
|
UINT32 Signature;
|
||||||
|
|
||||||
EDKII_UFS_HOST_CONTROLLER_PROTOCOL UfsHc;
|
EDKII_UFS_HOST_CONTROLLER_PROTOCOL UfsHc;
|
||||||
EFI_PCI_IO_PROTOCOL *PciIo;
|
EFI_PCI_IO_PROTOCOL *PciIo;
|
||||||
UINT8 BarIndex;
|
UINT8 BarIndex;
|
||||||
UINT64 PciAttributes;
|
UINT64 PciAttributes;
|
||||||
};
|
};
|
||||||
@ -336,24 +336,24 @@ UfsHcGetMmioBar (
|
|||||||
OUT UINTN *MmioBar
|
OUT UINTN *MmioBar
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Provides the UFS controller-specific addresses needed to access system memory.
|
Provides the UFS controller-specific addresses needed to access system memory.
|
||||||
|
|
||||||
@param This A pointer to the EFI_UFS_HOST_CONTROLLER_PROTOCOL instance.
|
@param This A pointer to the EFI_UFS_HOST_CONTROLLER_PROTOCOL instance.
|
||||||
@param Operation Indicates if the bus master is going to read or write to system memory.
|
@param Operation Indicates if the bus master is going to read or write to system memory.
|
||||||
@param HostAddress The system memory address to map to the UFS controller.
|
@param HostAddress The system memory address to map to the UFS controller.
|
||||||
@param NumberOfBytes On input the number of bytes to map. On output the number of bytes
|
@param NumberOfBytes On input the number of bytes to map. On output the number of bytes
|
||||||
that were mapped.
|
that were mapped.
|
||||||
@param DeviceAddress The resulting map address for the bus master UFS controller to use to
|
@param DeviceAddress The resulting map address for the bus master UFS controller to use to
|
||||||
access the hosts HostAddress.
|
access the hosts HostAddress.
|
||||||
@param Mapping A resulting value to pass to Unmap().
|
@param Mapping A resulting value to pass to Unmap().
|
||||||
|
|
||||||
@retval EFI_SUCCESS The range was mapped for the returned NumberOfBytes.
|
@retval EFI_SUCCESS The range was mapped for the returned NumberOfBytes.
|
||||||
@retval EFI_UNSUPPORTED The HostAddress cannot be mapped as a common buffer.
|
@retval EFI_UNSUPPORTED The HostAddress cannot be mapped as a common buffer.
|
||||||
@retval EFI_INVALID_PARAMETER One or more parameters are invalid.
|
@retval EFI_INVALID_PARAMETER One or more parameters are invalid.
|
||||||
@retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources.
|
@retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources.
|
||||||
@retval EFI_DEVICE_ERROR The system hardware could not map the requested address.
|
@retval EFI_DEVICE_ERROR The system hardware could not map the requested address.
|
||||||
|
|
||||||
**/
|
**/
|
||||||
EFI_STATUS
|
EFI_STATUS
|
||||||
EFIAPI
|
EFIAPI
|
||||||
@ -366,15 +366,15 @@ UfsHcMap (
|
|||||||
OUT VOID **Mapping
|
OUT VOID **Mapping
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Completes the Map() operation and releases any corresponding resources.
|
Completes the Map() operation and releases any corresponding resources.
|
||||||
|
|
||||||
@param This A pointer to the EFI_UFS_HOST_CONTROLLER_PROTOCOL instance.
|
@param This A pointer to the EFI_UFS_HOST_CONTROLLER_PROTOCOL instance.
|
||||||
@param Mapping The mapping value returned from Map().
|
@param Mapping The mapping value returned from Map().
|
||||||
|
|
||||||
@retval EFI_SUCCESS The range was unmapped.
|
@retval EFI_SUCCESS The range was unmapped.
|
||||||
@retval EFI_DEVICE_ERROR The data was not committed to the target system memory.
|
@retval EFI_DEVICE_ERROR The data was not committed to the target system memory.
|
||||||
|
|
||||||
**/
|
**/
|
||||||
EFI_STATUS
|
EFI_STATUS
|
||||||
EFIAPI
|
EFIAPI
|
||||||
@ -383,25 +383,25 @@ UfsHcUnmap (
|
|||||||
IN VOID *Mapping
|
IN VOID *Mapping
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Allocates pages that are suitable for an EfiUfsHcOperationBusMasterCommonBuffer
|
Allocates pages that are suitable for an EfiUfsHcOperationBusMasterCommonBuffer
|
||||||
mapping.
|
mapping.
|
||||||
|
|
||||||
@param This A pointer to the EFI_UFS_HOST_CONTROLLER_PROTOCOL instance.
|
@param This A pointer to the EFI_UFS_HOST_CONTROLLER_PROTOCOL instance.
|
||||||
@param Type This parameter is not used and must be ignored.
|
@param Type This parameter is not used and must be ignored.
|
||||||
@param MemoryType The type of memory to allocate, EfiBootServicesData or
|
@param MemoryType The type of memory to allocate, EfiBootServicesData or
|
||||||
EfiRuntimeServicesData.
|
EfiRuntimeServicesData.
|
||||||
@param Pages The number of pages to allocate.
|
@param Pages The number of pages to allocate.
|
||||||
@param HostAddress A pointer to store the base system memory address of the
|
@param HostAddress A pointer to store the base system memory address of the
|
||||||
allocated range.
|
allocated range.
|
||||||
@param Attributes The requested bit mask of attributes for the allocated range.
|
@param Attributes The requested bit mask of attributes for the allocated range.
|
||||||
|
|
||||||
@retval EFI_SUCCESS The requested memory pages were allocated.
|
@retval EFI_SUCCESS The requested memory pages were allocated.
|
||||||
@retval EFI_UNSUPPORTED Attributes is unsupported. The only legal attribute bits are
|
@retval EFI_UNSUPPORTED Attributes is unsupported. The only legal attribute bits are
|
||||||
MEMORY_WRITE_COMBINE and MEMORY_CACHED.
|
MEMORY_WRITE_COMBINE and MEMORY_CACHED.
|
||||||
@retval EFI_INVALID_PARAMETER One or more parameters are invalid.
|
@retval EFI_INVALID_PARAMETER One or more parameters are invalid.
|
||||||
@retval EFI_OUT_OF_RESOURCES The memory pages could not be allocated.
|
@retval EFI_OUT_OF_RESOURCES The memory pages could not be allocated.
|
||||||
|
|
||||||
**/
|
**/
|
||||||
EFI_STATUS
|
EFI_STATUS
|
||||||
EFIAPI
|
EFIAPI
|
||||||
@ -414,17 +414,17 @@ UfsHcAllocateBuffer (
|
|||||||
IN UINT64 Attributes
|
IN UINT64 Attributes
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Frees memory that was allocated with AllocateBuffer().
|
Frees memory that was allocated with AllocateBuffer().
|
||||||
|
|
||||||
@param This A pointer to the EFI_UFS_HOST_CONTROLLER_PROTOCOL instance.
|
@param This A pointer to the EFI_UFS_HOST_CONTROLLER_PROTOCOL instance.
|
||||||
@param Pages The number of pages to free.
|
@param Pages The number of pages to free.
|
||||||
@param HostAddress The base system memory address of the allocated range.
|
@param HostAddress The base system memory address of the allocated range.
|
||||||
|
|
||||||
@retval EFI_SUCCESS The requested memory pages were freed.
|
@retval EFI_SUCCESS The requested memory pages were freed.
|
||||||
@retval EFI_INVALID_PARAMETER The memory range specified by HostAddress and Pages
|
@retval EFI_INVALID_PARAMETER The memory range specified by HostAddress and Pages
|
||||||
was not allocated with AllocateBuffer().
|
was not allocated with AllocateBuffer().
|
||||||
|
|
||||||
**/
|
**/
|
||||||
EFI_STATUS
|
EFI_STATUS
|
||||||
EFIAPI
|
EFIAPI
|
||||||
@ -434,16 +434,16 @@ UfsHcFreeBuffer (
|
|||||||
IN VOID *HostAddress
|
IN VOID *HostAddress
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Flushes all posted write transactions from the UFS bus to attached UFS device.
|
Flushes all posted write transactions from the UFS bus to attached UFS device.
|
||||||
|
|
||||||
@param This A pointer to the EFI_UFS_HOST_CONTROLLER_PROTOCOL instance.
|
@param This A pointer to the EFI_UFS_HOST_CONTROLLER_PROTOCOL instance.
|
||||||
|
|
||||||
@retval EFI_SUCCESS The posted write transactions were flushed from the UFS bus
|
@retval EFI_SUCCESS The posted write transactions were flushed from the UFS bus
|
||||||
to attached UFS device.
|
to attached UFS device.
|
||||||
@retval EFI_DEVICE_ERROR The posted write transactions were not flushed from the UFS
|
@retval EFI_DEVICE_ERROR The posted write transactions were not flushed from the UFS
|
||||||
bus to attached UFS device due to a hardware error.
|
bus to attached UFS device due to a hardware error.
|
||||||
|
|
||||||
**/
|
**/
|
||||||
EFI_STATUS
|
EFI_STATUS
|
||||||
EFIAPI
|
EFIAPI
|
||||||
@ -451,7 +451,7 @@ UfsHcFlush (
|
|||||||
IN EDKII_UFS_HOST_CONTROLLER_PROTOCOL *This
|
IN EDKII_UFS_HOST_CONTROLLER_PROTOCOL *This
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Enable a UFS bus driver to access UFS MMIO registers in the UFS Host Controller memory space.
|
Enable a UFS bus driver to access UFS MMIO registers in the UFS Host Controller memory space.
|
||||||
|
|
||||||
@param This A pointer to the EDKII_UFS_HOST_CONTROLLER_PROTOCOL instance.
|
@param This A pointer to the EDKII_UFS_HOST_CONTROLLER_PROTOCOL instance.
|
||||||
@ -479,7 +479,7 @@ UfsHcMmioRead (
|
|||||||
IN OUT VOID *Buffer
|
IN OUT VOID *Buffer
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Enable a UFS bus driver to access UFS MMIO registers in the UFS Host Controller memory space.
|
Enable a UFS bus driver to access UFS MMIO registers in the UFS Host Controller memory space.
|
||||||
|
|
||||||
@param This A pointer to the EDKII_UFS_HOST_CONTROLLER_PROTOCOL instance.
|
@param This A pointer to the EDKII_UFS_HOST_CONTROLLER_PROTOCOL instance.
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
## @file
|
## @file
|
||||||
# Component Description File For Universal Flash Storage Pci Host Controller Module.
|
# Component Description File For Universal Flash Storage Pci Host Controller Module.
|
||||||
#
|
#
|
||||||
# Copyright (c) 2014 - 2015, Intel Corporation. All rights reserved.<BR>
|
# Copyright (c) 2014 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||||
#
|
#
|
||||||
# This program and the accompanying materials
|
# This program and the accompanying materials
|
||||||
# are licensed and made available under the terms and conditions of the BSD License
|
# are licensed and made available under the terms and conditions of the BSD License
|
||||||
@ -53,4 +53,4 @@
|
|||||||
gEdkiiUfsHostControllerProtocolGuid ## BY_START
|
gEdkiiUfsHostControllerProtocolGuid ## BY_START
|
||||||
|
|
||||||
[UserExtensions.TianoCore."ExtraFiles"]
|
[UserExtensions.TianoCore."ExtraFiles"]
|
||||||
UfsPciHcDxeExtra.uni
|
UfsPciHcDxeExtra.uni
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
// /** @file
|
// /** @file
|
||||||
// The UfsPciHcDxe driver is used by upper layer to retrieve mmio base address of managed pci-based Ufs host controller.
|
// The UfsPciHcDxe driver is used by upper layer to retrieve mmio base address of managed pci-based Ufs host controller.
|
||||||
//
|
//
|
||||||
// Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>
|
// Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||||
//
|
//
|
||||||
// This program and the accompanying materials
|
// This program and the accompanying materials
|
||||||
// are licensed and made available under the terms and conditions of the BSD License
|
// 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
|
// which accompanies this distribution. The full text of the license may be found at
|
||||||
// http://opensource.org/licenses/bsd-license.php
|
// http://opensource.org/licenses/bsd-license.php
|
||||||
//
|
//
|
||||||
// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||||
// WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
// WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||||
//
|
//
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// /** @file
|
// /** @file
|
||||||
// UfsPciHcDxe Localized Strings and Content
|
// UfsPciHcDxe Localized Strings and Content
|
||||||
//
|
//
|
||||||
// Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>
|
// Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||||
//
|
//
|
||||||
// This program and the accompanying materials
|
// This program and the accompanying materials
|
||||||
// are licensed and made available under the terms and conditions of the BSD License
|
// are licensed and made available under the terms and conditions of the BSD License
|
||||||
@ -13,8 +13,8 @@
|
|||||||
//
|
//
|
||||||
// **/
|
// **/
|
||||||
|
|
||||||
#string STR_PROPERTIES_MODULE_NAME
|
#string STR_PROPERTIES_MODULE_NAME
|
||||||
#language en-US
|
#language en-US
|
||||||
"UFS PCI-Based HC Driver"
|
"UFS PCI-Based HC Driver"
|
||||||
|
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
UfsPciHcPei driver is used to provide platform-dependent info, mainly UFS host controller
|
UfsPciHcPei driver is used to provide platform-dependent info, mainly UFS host controller
|
||||||
MMIO base, to upper layer UFS drivers.
|
MMIO base, to upper layer UFS drivers.
|
||||||
|
|
||||||
Copyright (c) 2014, Intel Corporation. All rights reserved.<BR>
|
Copyright (c) 2014 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||||
This program and the accompanying materials
|
This program and the accompanying materials
|
||||||
are licensed and made available under the terms and conditions of the BSD License
|
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
|
which accompanies this distribution. The full text of the license may be found at
|
||||||
@ -53,7 +53,7 @@ GetUfsHcMmioBar (
|
|||||||
if (ControllerId >= Private->TotalUfsHcs) {
|
if (ControllerId >= Private->TotalUfsHcs) {
|
||||||
return EFI_INVALID_PARAMETER;
|
return EFI_INVALID_PARAMETER;
|
||||||
}
|
}
|
||||||
|
|
||||||
*MmioBar = (UINTN)Private->UfsHcPciAddr[ControllerId];
|
*MmioBar = (UINTN)Private->UfsHcPciAddr[ControllerId];
|
||||||
|
|
||||||
return EFI_SUCCESS;
|
return EFI_SUCCESS;
|
||||||
@ -61,7 +61,7 @@ GetUfsHcMmioBar (
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
The user code starts with this function.
|
The user code starts with this function.
|
||||||
|
|
||||||
@param FileHandle Handle of the file being invoked.
|
@param FileHandle Handle of the file being invoked.
|
||||||
@param PeiServices Describes the list of possible PEI Services.
|
@param PeiServices Describes the list of possible PEI Services.
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
## @file
|
## @file
|
||||||
# Component Description File For Universal Flash Storage Pci Host Controller Pei Module.
|
# Component Description File For Universal Flash Storage Pci Host Controller Pei Module.
|
||||||
#
|
#
|
||||||
# Copyright (c) 2014 - 2015, Intel Corporation. All rights reserved.<BR>
|
# Copyright (c) 2014 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||||
#
|
#
|
||||||
# This program and the accompanying materials
|
# This program and the accompanying materials
|
||||||
# are licensed and made available under the terms and conditions of the BSD License
|
# are licensed and made available under the terms and conditions of the BSD License
|
||||||
@ -53,4 +53,4 @@
|
|||||||
gEfiPeiMasterBootModePpiGuid AND gEfiPeiMemoryDiscoveredPpiGuid
|
gEfiPeiMasterBootModePpiGuid AND gEfiPeiMemoryDiscoveredPpiGuid
|
||||||
|
|
||||||
[UserExtensions.TianoCore."ExtraFiles"]
|
[UserExtensions.TianoCore."ExtraFiles"]
|
||||||
UfsPciHcPeiExtra.uni
|
UfsPciHcPeiExtra.uni
|
||||||
|
@ -2,14 +2,14 @@
|
|||||||
// The UfsPciHcPei driver is used by upper layer to retrieve mmio base address of managed
|
// The UfsPciHcPei driver is used by upper layer to retrieve mmio base address of managed
|
||||||
// pci-based Ufs host controller at PEI phase.
|
// pci-based Ufs host controller at PEI phase.
|
||||||
//
|
//
|
||||||
// Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>
|
// Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||||
//
|
//
|
||||||
// This program and the accompanying materials
|
// This program and the accompanying materials
|
||||||
// are licensed and made available under the terms and conditions
|
// are licensed and made available under the terms and conditions
|
||||||
// of the BSD License which accompanies this distribution. The
|
// of the BSD License which accompanies this distribution. The
|
||||||
// full text of the license may be found at
|
// full text of the license may be found at
|
||||||
// http://opensource.org/licenses/bsd-license.php
|
// http://opensource.org/licenses/bsd-license.php
|
||||||
//
|
//
|
||||||
// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||||
// WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
// WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||||
//
|
//
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// /** @file
|
// /** @file
|
||||||
// UfsPciHcPei Localized Strings and Content
|
// UfsPciHcPei Localized Strings and Content
|
||||||
//
|
//
|
||||||
// Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>
|
// Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||||
//
|
//
|
||||||
// This program and the accompanying materials
|
// This program and the accompanying materials
|
||||||
// are licensed and made available under the terms and conditions
|
// are licensed and made available under the terms and conditions
|
||||||
@ -14,8 +14,8 @@
|
|||||||
//
|
//
|
||||||
// **/
|
// **/
|
||||||
|
|
||||||
#string STR_PROPERTIES_MODULE_NAME
|
#string STR_PROPERTIES_MODULE_NAME
|
||||||
#language en-US
|
#language en-US
|
||||||
"UFS PCI-Based HC Module for Recovery"
|
"UFS PCI-Based HC Module for Recovery"
|
||||||
|
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
The UHCI driver model and HC protocol routines.
|
The UHCI driver model and HC protocol routines.
|
||||||
|
|
||||||
Copyright (c) 2004 - 2015, Intel Corporation. All rights reserved.<BR>
|
Copyright (c) 2004 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||||
This program and the accompanying materials
|
This program and the accompanying materials
|
||||||
are licensed and made available under the terms and conditions of the BSD License
|
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
|
which accompanies this distribution. The full text of the license may be found at
|
||||||
@ -1519,7 +1519,7 @@ UhciFreeDev (
|
|||||||
if (Uhc->ExitBootServiceEvent != NULL) {
|
if (Uhc->ExitBootServiceEvent != NULL) {
|
||||||
gBS->CloseEvent (Uhc->ExitBootServiceEvent);
|
gBS->CloseEvent (Uhc->ExitBootServiceEvent);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Uhc->MemPool != NULL) {
|
if (Uhc->MemPool != NULL) {
|
||||||
UsbHcFreeMemPool (Uhc->MemPool);
|
UsbHcFreeMemPool (Uhc->MemPool);
|
||||||
}
|
}
|
||||||
@ -1796,7 +1796,7 @@ UhciDriverBindingStart (
|
|||||||
UhciWriteReg (Uhc->PciIo, USBCMD_OFFSET, USBCMD_RS | USBCMD_MAXP);
|
UhciWriteReg (Uhc->PciIo, USBCMD_OFFSET, USBCMD_RS | USBCMD_MAXP);
|
||||||
|
|
||||||
return EFI_SUCCESS;
|
return EFI_SUCCESS;
|
||||||
|
|
||||||
UNINSTALL_USBHC:
|
UNINSTALL_USBHC:
|
||||||
gBS->UninstallMultipleProtocolInterfaces (
|
gBS->UninstallMultipleProtocolInterfaces (
|
||||||
Controller,
|
Controller,
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
The definition for UHCI driver model and HC protocol routines.
|
The definition for UHCI driver model and HC protocol routines.
|
||||||
|
|
||||||
Copyright (c) 2004 - 2015, Intel Corporation. All rights reserved.<BR>
|
Copyright (c) 2004 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||||
This program and the accompanying materials
|
This program and the accompanying materials
|
||||||
are licensed and made available under the terms and conditions of the BSD License
|
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
|
which accompanies this distribution. The full text of the license may be found at
|
||||||
@ -145,7 +145,7 @@ struct _USB_HC_DEV {
|
|||||||
VOID *FrameMapping;
|
VOID *FrameMapping;
|
||||||
|
|
||||||
//
|
//
|
||||||
// ExitBootServicesEvent is used to stop the EHC DMA operation
|
// ExitBootServicesEvent is used to stop the EHC DMA operation
|
||||||
// after exit boot service.
|
// after exit boot service.
|
||||||
//
|
//
|
||||||
EFI_EVENT ExitBootServiceEvent;
|
EFI_EVENT ExitBootServiceEvent;
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
## @file
|
## @file
|
||||||
# The UhciDxe driver is responsible for managing the behavior of UHCI controller.
|
# The UhciDxe driver is responsible for managing the behavior of UHCI controller.
|
||||||
# It implements the interfaces of monitoring the status of all ports and transferring
|
# It implements the interfaces of monitoring the status of all ports and transferring
|
||||||
# Control, Bulk, Interrupt and Isochronous requests to Usb1.x device
|
# Control, Bulk, Interrupt and Isochronous requests to Usb1.x device
|
||||||
#
|
#
|
||||||
# Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>
|
# Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||||
#
|
#
|
||||||
# This program and the accompanying materials
|
# This program and the accompanying materials
|
||||||
# are licensed and made available under the terms and conditions of the BSD License
|
# are licensed and made available under the terms and conditions of the BSD License
|
||||||
@ -23,7 +23,7 @@
|
|||||||
FILE_GUID = 2FB92EFA-2EE0-4bae-9EB6-7464125E1EF7
|
FILE_GUID = 2FB92EFA-2EE0-4bae-9EB6-7464125E1EF7
|
||||||
MODULE_TYPE = UEFI_DRIVER
|
MODULE_TYPE = UEFI_DRIVER
|
||||||
VERSION_STRING = 1.0
|
VERSION_STRING = 1.0
|
||||||
|
|
||||||
ENTRY_POINT = UhciDriverEntryPoint
|
ENTRY_POINT = UhciDriverEntryPoint
|
||||||
|
|
||||||
#
|
#
|
||||||
@ -31,7 +31,7 @@
|
|||||||
#
|
#
|
||||||
# VALID_ARCHITECTURES = IA32 X64 IPF EBC ARM AARCH64
|
# VALID_ARCHITECTURES = IA32 X64 IPF EBC ARM AARCH64
|
||||||
#
|
#
|
||||||
# DRIVER_BINDING = gUhciDriverBinding
|
# DRIVER_BINDING = gUhciDriverBinding
|
||||||
# COMPONENT_NAME = gUhciComponentName
|
# COMPONENT_NAME = gUhciComponentName
|
||||||
# COMPONENT_NAME2 = gUhciComponentName2
|
# COMPONENT_NAME2 = gUhciComponentName2
|
||||||
#
|
#
|
||||||
|
@ -4,13 +4,13 @@
|
|||||||
// It implements the interfaces of monitoring the status of all ports and transferring
|
// It implements the interfaces of monitoring the status of all ports and transferring
|
||||||
// Control, Bulk, Interrupt and Isochronous requests to Usb1.x device
|
// Control, Bulk, Interrupt and Isochronous requests to Usb1.x device
|
||||||
//
|
//
|
||||||
// Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>
|
// Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||||
//
|
//
|
||||||
// This program and the accompanying materials
|
// This program and the accompanying materials
|
||||||
// are licensed and made available under the terms and conditions of the BSD License
|
// 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
|
// which accompanies this distribution. The full text of the license may be found at
|
||||||
// http://opensource.org/licenses/bsd-license.php
|
// http://opensource.org/licenses/bsd-license.php
|
||||||
//
|
//
|
||||||
// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||||
// WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
// WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||||
//
|
//
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user