hello,
i tried to modify the uefi source code, in order for UEFI to select the boot option based on the GPIO values each time it is powered on, please tell me what should i do? And what code files (functions) should i focus on?
Hi,
For manipulating GPIO pins in UEFI, please refer to this post:
Hi, I am trying to get GPIO level in UEFI boot flow. Because I want to use gpio to select boot Mode or use
GPIO to select the boot device. Is there any reference?
Kind regards
Bryan
There are some functions for you to get the status of GPIO pins:
/** @file
Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
SPDX-License-Identifier: BSD-2-Clause-Patent
**/
#ifndef __EMBEDDED_GPIO_H__
#define __EMBEDDED_GPIO_H__
//
// Protocol interface structure
//
typedef struct _EMBEDDED_GPIO EMBEDDED_GPIO;
//
// Data Types
//
typedef UINTN EMBEDDED_GPIO_PIN;
This file has been truncated. show original
For setting boot order/options, the main logic is handled in this folder:
Especially the SetBootOrder() function as entry point for you:
if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_ERROR, "Fail to append boot class %a, Status= %r\r\n", mBootPriorityTemplate[BootClassIndex].OrderName, Status));
}
}
return;
}
VOID
EFIAPI
SetBootOrder (
VOID
)
{
EFI_STATUS Status;
BOOLEAN VariableData;
UINTN VariableSize;
UINT32 VariableAttributes;
VariableData = FALSE;
VariableSize = sizeof (BOOLEAN);
system
Closed
August 7, 2024, 7:07am
7
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.