This file contains hidden or 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 hidden or 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 hidden or 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
| import argparse | |
| import re | |
| import typing | |
| from pyfdt.pyfdt import FdtBlobParse, Fdt, FdtNode, FdtProperty | |
| CONFIG_PARAMETERS_BLACKLIST = [ | |
| "ConfigParameterCount", | |
| "MaxCount", | |
| "StrMaxCount" |
This file contains hidden or 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; |