This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <Library/DebugLib.h> | |
#include <Library/IoLib.h> | |
#include <Library/UefiBootServicesTableLib.h> | |
#define CORE 0x0c440000 | |
#define OBSRVR 0x0e600000 | |
#define PMIC_USID 4 // PM6150L GPIO USID | |
#define PMIC_GPIO_BASE 0xC000 // PM6150L GPIO address | |
#define VOL_UP_GPIO 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def TuneDataPatch(data, value1, value2): | |
movInstruction = 0x52800002 | |
instr1 = movInstruction | (value1 << 5) | |
instr2 = movInstruction | (value2 << 5) | |
loc = data.find(instr1.to_bytes(4, byteorder='little')) | |
if loc < 0 or loc % 4 != 0: | |
return data | |
print("Patching tune data at 0x{:08x}".format(loc)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from argparse import ArgumentParser | |
from typing import Any | |
def ParseArgs(): | |
parser = ArgumentParser() | |
parser.add_argument('-i', dest="UefiPlatPath", required=True) | |
return parser.parse_args() | |
class MemoryDescriptor: | |
def __init__(self, name, space, base, size, hob_option, resource_attribute, arm_attribute, resource_type, cache_type): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <Uefi.h> | |
#include <Library/UefiLib.h> | |
#include <Library/PcdLib.h> | |
#include <Library/DebugLib.h> | |
#include <Library/UefiDriverEntryPoint.h> | |
#include <Library/UefiBootServicesTableLib.h> | |
#include <Protocol/EFISPMI.h> | |
EFI_QCOM_SPMI_PROTOCOL *gSPMIProtocol; |