├── README.md
├── XiaomiMI8Pkg
├── AcpiTables
│ ├── AcpiSsdtRootPci.asl
│ ├── AcpiTables.inf
│ ├── Dbg2.aslc
│ ├── Dsdt.asl
│ ├── Fadt.aslc
│ ├── Gtdt.aslc
│ ├── Madt.aslc
│ ├── SDM850
│ │ ├── CSRT.aml
│ │ ├── DBG2.aml
│ │ ├── DSDT.aml
│ │ ├── FACS.aml
│ │ ├── FADT.aml
│ │ ├── GTDT.aml
│ │ ├── MADT.aml
│ │ ├── MCFG.aml
│ │ └── PPTT.aml
│ ├── Source
│ │ ├── CSRT.dsl
│ │ ├── DBG2.dsl
│ │ ├── DSDT.dsl
│ │ ├── FACS.dsl
│ │ ├── FADT.dsl
│ │ ├── GTDT.dsl
│ │ ├── MADT.dsl
│ │ ├── MCFG.dsl
│ │ └── PPTT.dsl
│ └── Spcr.aslc
├── Binary
│ ├── ASN1X509Dxe
│ │ ├── ASN1X509Dxe.efi
│ │ ├── file.obj
│ │ └── section1.ui
│ ├── AdcDxe
│ │ ├── AdcDxe.depex
│ │ ├── AdcDxe.efi
│ │ ├── file.obj
│ │ └── section2.ui
│ ├── ButtonsDxe
│ │ ├── ButtonsDxe.depex
│ │ ├── ButtonsDxe.efi
│ │ ├── file.obj
│ │ └── section2.ui
│ ├── ChipInfo
│ │ ├── ChipInfo.depex
│ │ ├── ChipInfo.efi
│ │ ├── file.obj
│ │ └── section2.ui
│ ├── ClockDxe
│ │ ├── ClockDxe.depex
│ │ ├── ClockDxe.efi
│ │ ├── file.obj
│ │ └── section2.ui
│ ├── DALTLMM
│ │ ├── .depex
│ │ ├── DALTLMM.depex
│ │ ├── DALTLMM.efi
│ │ ├── file.obj
│ │ └── section2.ui
│ ├── EmuVariableRuntimeDxe
│ │ ├── EmuVariableRuntimeDxe.depex
│ │ ├── EmuVariableRuntimeDxe.efi
│ │ ├── file.obj
│ │ └── section2.ui
│ ├── HWIODxeDriver
│ │ ├── HWIODxeDriver.depex
│ │ ├── HWIODxeDriver.efi
│ │ ├── file.obj
│ │ └── section2.ui
│ ├── HashDxe
│ │ ├── HashDxe.efi
│ │ ├── file.obj
│ │ └── section1.ui
│ ├── PlatformInfoDxeDriver
│ │ ├── PlatformInfoDxeDriver.depex
│ │ ├── PlatformInfoDxeDriver.efi
│ │ ├── file.obj
│ │ └── section2.ui
│ ├── PmicDxe
│ │ ├── PmicDxe.depex
│ │ ├── PmicDxe.efi
│ │ ├── file.obj
│ │ └── section2.ui
│ ├── QcomChargerDxeLA
│ │ ├── QcomChargerDxeLA.depex
│ │ ├── QcomChargerDxeLA.efi
│ │ ├── file.obj
│ │ └── section2.ui
│ ├── SPI
│ │ ├── SPI.depex
│ │ └── SPI.efi
│ ├── SPMI
│ │ ├── SPMI.depex
│ │ ├── SPMI.efi
│ │ ├── file.obj
│ │ └── section2.ui
│ ├── SdccDxe
│ │ ├── SdccDxe.depex
│ │ ├── SdccDxe.efi
│ │ ├── file.obj
│ │ └── section2.ui
│ ├── SecRSADxe
│ │ ├── SecRSADxe.efi
│ │ ├── file.obj
│ │ └── section1.ui
│ ├── SmemDxe
│ │ ├── SmemDxe.depex
│ │ ├── SmemDxe.efi
│ │ ├── file.obj
│ │ └── section2.ui
│ ├── UFSDxe
│ │ ├── UFSDxe.depex
│ │ ├── UFSDxe.efi
│ │ ├── file.obj
│ │ └── section2.ui
│ ├── UsbConfigDxe
│ │ ├── UsbConfigDxe.depex
│ │ ├── UsbConfigDxe.efi
│ │ ├── file.obj
│ │ └── section2.ui
│ ├── UsbDeviceDxe
│ │ ├── UsbDeviceDxe.depex
│ │ ├── UsbDeviceDxe.efi
│ │ ├── file.obj
│ │ └── section2.ui
│ ├── UsbMsdDxe
│ │ ├── UsbMsdDxe.depex
│ │ ├── UsbMsdDxe.efi
│ │ ├── file.obj
│ │ └── section2.ui
│ ├── UsbPwrCtrlDxe
│ │ ├── UsbPwrCtrlDxe.depex
│ │ ├── UsbPwrCtrlDxe.efi
│ │ ├── file.obj
│ │ └── section2.ui
│ └── UsbfnDwc3Dxe
│ │ ├── UsbfnDwc3Dxe.depex
│ │ ├── UsbfnDwc3Dxe.efi
│ │ ├── file.obj
│ │ └── section2.ui
├── CommonDsc.dsc.inc
├── CommonDsc.dsc.inc_debug
├── CommonFdf.fdf.inc
├── Drivers
│ ├── GenericKeypadDeviceDxe
│ │ ├── GenericKeypadDevice.c
│ │ └── GenericKeypadDeviceDxe.inf
│ ├── KeypadDxe
│ │ ├── ComponentName.c
│ │ ├── Keypad.c
│ │ ├── Keypad.h
│ │ ├── KeypadController.c
│ │ ├── KeypadDxe.inf
│ │ ├── KeypadTextIn.c
│ │ └── Source.txt
│ ├── LogoDxe
│ │ ├── Logo.bmp
│ │ ├── Logo.c
│ │ ├── Logo.idf
│ │ ├── Logo.inf
│ │ ├── Logo.uni
│ │ ├── LogoDxe.inf
│ │ ├── LogoDxe.uni
│ │ ├── LogoDxeExtra.uni
│ │ └── LogoExtra.uni
│ └── SmbiosPlatformDxe
│ │ ├── SmbiosPlatformDxe.c
│ │ └── SmbiosPlatformDxe.inf
├── Include
│ ├── ArmPlatform.h
│ ├── Configuration
│ │ ├── BootDevices.h
│ │ ├── DeviceMemoryMap.h
│ │ └── Hob.h
│ ├── Library
│ │ └── FrameBufferSerialPortLib.h
│ └── Resources
│ │ ├── FbColor.h
│ │ └── font5x12.h
├── Library
│ ├── FrameBufferSerialPortLib
│ │ ├── FrameBufferSerialPortLib.c
│ │ ├── FrameBufferSerialPortLib.h
│ │ └── FrameBufferSerialPortLib.inf
│ ├── InMemorySerialPortLib
│ │ ├── InMemorySerialPortLib.c
│ │ ├── InMemorySerialPortLib.inf
│ │ └── InMemorySerialPortLib.uni
│ ├── MemoryInitPeiLib
│ │ ├── MemoryInitPeiLib.c
│ │ └── PeiMemoryAllocationLib.inf
│ ├── PlatformBootManagerLib
│ │ ├── PlatformBm.c
│ │ ├── PlatformBm.h
│ │ └── PlatformBootManagerLib.inf
│ ├── PlatformPeiLib
│ │ ├── PlatformPeiLib.c
│ │ └── PlatformPeiLib.inf
│ ├── VirtualRealTimeClockLib
│ │ ├── VirtualRealTimeClockLib.c
│ │ └── VirtualRealTimeClockLib.inf
│ └── XiaomiMI8Lib
│ │ ├── XiaomiMI8.c
│ │ ├── XiaomiMI8Helper.S
│ │ ├── XiaomiMI8Lib.inf
│ │ └── XiaomiMI8Mem.c
├── SimpleFbDxe
│ ├── SimpleFbDxe.c
│ └── SimpleFbDxe.inf
├── XiaomiMI8Dxe
│ ├── XiaomiMI8Dxe.c
│ ├── XiaomiMI8Dxe.h
│ └── XiaomiMI8Dxe.inf
├── XiaomiMI8Pkg.dec
├── XiaomiMI8Pkg.dsc
└── XiaomiMI8Pkg.fdf
├── azure-pipelines.yml
├── bootimg.cfg
├── build.sh
├── build_common.sh
├── ci-build.sh
├── dipper.dtb
├── dipper.dts
├── firstrun.sh
├── ramdisk
└── workspace
└── .gitignore
/README.md:
--------------------------------------------------------------------------------
1 | # EDK2 UEFI Firmware For Xiaomi MI 8 (Dipper)
2 | Attempt to create a normal EDK2 for Xiaomi MI8 - dipper.
3 |
4 | Based on zhuowei's port for [Pixel3XL](https://github.com/Pixel3Dev/edk2-pixel3/).
5 |
6 | [](https://dev.azure.com/nekokecore/edk2-dipper/_build/latest?definitionId=1&branchName=master)
7 | 
8 | 
9 | [](https://app.fossa.com/projects/git%2Bgithub.com%2FNekokeCore%2Fedk2-dipper?ref=badge_shield)
10 | 
11 | 
12 |
13 | ## The Most Important
14 | DO NOT FLASH THIS UEFI FIRMWARE IN YOUR MAIN PHONE !!!
15 |
16 | It's very unstable and you may lost your data.
17 |
18 | ## Status
19 | UFS WORK!
20 |
21 | Can boot Linux Arm
22 |
23 | Clock WORK!
24 |
25 | Test ACPI etc. tables added.
26 |
27 | And can load Windows PE.
28 |
29 | ## Dev Logs
30 | 2020.1.6 Fix 5 compiler error.
31 |
32 | 2020.1.7 Start work and successfully run on my phone.
33 |
34 | 2020.1.8 Fix Display.
35 |
36 | 2020.4.17 Fix UFS drive and Fix MemoryMap(Thanks [Lemon1Ice](https://github.com/Lemon1Ice)).
37 |
38 | 2020.4.19 Add ACPI etc. Tables and Fix DSDT 24 Errors. (PS.The ACPI and SSDT etc. Tables Provided by [5超级菜鸟5](https://github.com/sunshuyu)
39 |
40 | 2020.4.24 Fix Clock and The Clock is work well && Add SmemDxe SPI SPMI HWIODxeDriver PmicDxe ButtonsDxe ChipInfoDxe to Binary && Add USB driver
41 |
42 | 2020.4.30 Re added MemoryMap and can boot Windows to BlueScreen(Stop Code:Memory Managent) and (Stop Code:IRQL NOT LESS OR EQUAL)
43 |
44 | 2020.5.6 Fix A Lot but Nothing.
45 |
46 | 2020.5.8 Fix A Lot but Nothing.
47 |
48 | 2020.5.10 Can boot WindowsPE . Thank for [Lemon1Ice](https://github.com/Lemon1Ice) patience and great help!
49 |
50 | 2020.5.11 Change SMBIOS Information and Add Some Binaries
51 | ## To-Do
52 | 1.Fix fts touchscreen
53 |
54 | 2.Fix ACPI tables
55 |
56 | 3.Partition UFS
57 |
58 | 4.make USB work
59 |
60 | ## Dependencies
61 |
62 | Ubuntu 18.04:
63 |
64 | ```
65 | sudo apt update
66 | sudo apt install build-essential uuid-dev iasl git nasm python3-distutils gcc-aarch64-linux-gnu abootimg figlet
67 | ```
68 | Or
69 | ```
70 | sudo apt install build-essential
71 | sudo apt install build-essential
72 | sudo apt install uuid-dev
73 | sudo apt install iasl
74 | sudo apt install git
75 | sudo apt install nasm
76 | sudo apt install python3-distutils
77 | sudo apt install gcc-aarch64-linux-gnu
78 | sudo apt install abootimg
79 | sudo apt install figlet
80 | ```
81 |
82 |
83 | ## Building
84 | 1.Clone edk2 and edk2-platforms (Place three directories side by side.)
85 |
86 | edk2:
87 | ```
88 | commit:3a3713e62cfad00d78bb938b0d9fb1eedaeff314
89 | ```
90 |
91 | edk2-platforms:
92 | ```
93 | commit:cfdc7f907d545b14302295b819ea078bc36c6a40
94 | ```
95 |
96 | ```
97 | mkdir workspaceedk2
98 | cd workspaceedk2
99 | git clone https://github.com/tianocore/edk2.git -o 3a3713e62cfad00d78bb938b0d9fb1eedaeff314 --recursive --depth=1
100 | git clone https://github.com/tianocore/edk2-platforms.git -o cfdc7f907d545b14302295b819ea078bc36c6a40 --recursive --depth=1
101 | ```
102 |
103 | 2.Clone this project
104 | ```
105 | git clone https://github.com/NekokeCore/edk2-dipper.git
106 | ```
107 |
108 | 3.Build environment
109 | ```
110 | cd edk2-dipper
111 | bash firstrun.sh
112 | ```
113 |
114 | 4.Build this project
115 | ```
116 | bash build.sh
117 | ```
118 | 5.Debug and use
119 | ```
120 | fastboot boot uefi.img
121 | ```
122 |
123 | ## Credits
124 | MemoryMap thanks [Lemon1Ice](https://github.com/Lemon1Ice).
125 |
126 | ACPI etc. tables thanks [5超级菜鸟5](https://github.com/sunshuyu)
127 |
128 | Orther edk2 project [EngLearnsh](https://github.com/EngLearnsh/edk2-dipper).
129 |
130 | SimpleFbDxe screen driver is from imbushuo's [Lumia950XLPkg](https://github.com/WOA-Project/Lumia950XLPkg).
131 |
132 | Also thanks [edk2 website](https://github.com/tianocore/tianocore.github.io/wiki/Using-EDK-II-with-Native-GCC#Install_required_software_from_apt).
133 |
--------------------------------------------------------------------------------
/XiaomiMI8Pkg/AcpiTables/AcpiSsdtRootPci.asl:
--------------------------------------------------------------------------------
1 | /** @file
2 | Differentiated System Description Table Fields (SSDT)
3 |
4 | Copyright (c) 2014-2015, ARM Ltd. All rights reserved.
5 | This program and the accompanying materials
6 | are licensed and made available under the terms and conditions of the BSD License
7 | which accompanies this distribution. The full text of the license may be found at
8 | http://opensource.org/licenses/bsd-license.php
9 |
10 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
12 |
13 | **/
14 |
15 | #include "ArmPlatform.h"
16 |
17 | /*
18 | See ACPI 6.1 Section 6.2.13
19 |
20 | There are two ways that _PRT can be used. ...
21 |
22 | In the first model, a PCI Link device is used to provide additional
23 | configuration information such as whether the interrupt is Level or
24 | Edge triggered, it is active High or Low, Shared or Exclusive, etc.
25 |
26 | In the second model, the PCI interrupts are hardwired to specific
27 | interrupt inputs on the interrupt controller and are not
28 | configurable. In this case, the Source field in _PRT does not
29 | reference a device, but instead contains the value zero, and the
30 | Source Index field contains the global system interrupt to which the
31 | PCI interrupt is hardwired.
32 |
33 | We use the first model with link indirection to set the correct
34 | interrupt type as PCI defaults (Level Triggered, Active Low) are not
35 | compatible with GICv2.
36 | */
37 | #define LNK_DEVICE(Unique_Id, Link_Name, irq) \
38 | Device(Link_Name) { \
39 | Name(_HID, EISAID("PNP0C0F")) \
40 | Name(_UID, Unique_Id) \
41 | Name(_PRS, ResourceTemplate() { \
42 | Interrupt(ResourceProducer, Level, ActiveHigh, Exclusive) { irq } \
43 | }) \
44 | Method (_CRS, 0) { Return (_PRS) } \
45 | Method (_SRS, 1) { } \
46 | Method (_DIS) { } \
47 | }
48 |
49 | #define PRT_ENTRY(Address, Pin, Link) \
50 | Package (4) { \
51 | Address, /* uses the same format as _ADR */ \
52 | Pin, /* The PCI pin number of the device (0-INTA, 1-INTB, 2-INTC, 3-INTD). */ \
53 | Link, /* Interrupt allocated via Link device. */ \
54 | Zero /* global system interrupt number (no used) */ \
55 | }
56 |
57 | /*
58 | See Reference [1] 6.1.1
59 | "High word–Device #, Low word–Function #. (for example, device 3, function 2 is
60 | 0x00030002). To refer to all the functions on a device #, use a function number of FFFF)."
61 | */
62 | #define ROOT_PRT_ENTRY(Pin, Link) PRT_ENTRY(0x0000FFFF, Pin, Link)
63 | // Device 0 for Bridge.
64 |
65 |
66 | DefinitionBlock("SsdtPci.aml", "SSDT", 1, "ARMLTD", "ARM-JUNO", EFI_ACPI_ARM_OEM_REVISION) {
67 | Scope(_SB) {
68 | //
69 | // PCI Root Complex
70 | //
71 | LNK_DEVICE(1, LNKA, 168)
72 | LNK_DEVICE(2, LNKB, 169)
73 | LNK_DEVICE(3, LNKC, 170)
74 | LNK_DEVICE(4, LNKD, 171)
75 |
76 | Device(PCI0)
77 | {
78 | Name(_HID, EISAID("PNP0A08")) // PCI Express Root Bridge
79 | Name(_CID, EISAID("PNP0A03")) // Compatible PCI Root Bridge
80 | Name(_SEG, Zero) // PCI Segment Group number
81 | Name(_BBN, Zero) // PCI Base Bus Number
82 | Name(_CCA, 1) // Initially mark the PCI coherent (for JunoR1)
83 |
84 | // Root Complex 0
85 | Device (RP0) {
86 | Name(_ADR, 0xF0000000) // Dev 0, Func 0
87 | }
88 |
89 | // PCI Routing Table
90 | Name(_PRT, Package() {
91 | ROOT_PRT_ENTRY(0, LNKA), // INTA
92 | ROOT_PRT_ENTRY(1, LNKB), // INTB
93 | ROOT_PRT_ENTRY(2, LNKC), // INTC
94 | ROOT_PRT_ENTRY(3, LNKD), // INTD
95 | })
96 | // Root complex resources
97 | Method (_CRS, 0, Serialized) {
98 | Name (RBUF, ResourceTemplate () {
99 | WordBusNumber ( // Bus numbers assigned to this root
100 | ResourceProducer,
101 | MinFixed, MaxFixed, PosDecode,
102 | 0, // AddressGranularity
103 | 0, // AddressMinimum - Minimum Bus Number
104 | 255, // AddressMaximum - Maximum Bus Number
105 | 0, // AddressTranslation - Set to 0
106 | 256 // RangeLength - Number of Busses
107 | )
108 |
109 | DWordMemory ( // 32-bit BAR Windows
110 | ResourceProducer, PosDecode,
111 | MinFixed, MaxFixed,
112 | Cacheable, ReadWrite,
113 | 0x00000000, // Granularity
114 | 0x50000000, // Min Base Address
115 | 0x57FFFFFF, // Max Base Address
116 | 0x00000000, // Translate
117 | 0x08000000 // Length
118 | )
119 |
120 | QWordMemory ( // 64-bit BAR Windows
121 | ResourceProducer, PosDecode,
122 | MinFixed, MaxFixed,
123 | Cacheable, ReadWrite,
124 | 0x00000000, // Granularity
125 | 0x4000000000, // Min Base Address
126 | 0x40FFFFFFFF, // Max Base Address
127 | 0x00000000, // Translate
128 | 0x100000000 // Length
129 | )
130 |
131 | DWordIo ( // IO window
132 | ResourceProducer,
133 | MinFixed,
134 | MaxFixed,
135 | PosDecode,
136 | EntireRange,
137 | 0x00000000, // Granularity
138 | 0x00000000, // Min Base Address
139 | 0x007fffff, // Max Base Address
140 | 0x5f800000, // Translate
141 | 0x00800000, // Length
142 | ,,,TypeTranslation
143 | )
144 | }) // Name(RBUF)
145 |
146 | Return (RBUF)
147 | } // Method(_CRS)
148 |
149 | //
150 | // OS Control Handoff
151 | //
152 | Name(SUPP, Zero) // PCI _OSC Support Field value
153 | Name(CTRL, Zero) // PCI _OSC Control Field value
154 |
155 | /*
156 | See [1] 6.2.10, [2] 4.5
157 | */
158 | Method(_OSC,4) {
159 | // Check for proper UUID
160 | If(LEqual(Arg0,ToUUID("33DB4D5B-1FF7-401C-9657-7441C03DD766"))) {
161 | // Create DWord-adressable fields from the Capabilities Buffer
162 | CreateDWordField(Arg3,0,CDW1)
163 | CreateDWordField(Arg3,4,CDW2)
164 | CreateDWordField(Arg3,8,CDW3)
165 |
166 | // Save Capabilities DWord2 & 3
167 | Store(CDW2,SUPP)
168 | Store(CDW3,CTRL)
169 |
170 | // Only allow native hot plug control if OS supports:
171 | // * ASPM
172 | // * Clock PM
173 | // * MSI/MSI-X
174 | If(LNotEqual(And(SUPP, 0x16), 0x16)) {
175 | And(CTRL,0x1E,CTRL) // Mask bit 0 (and undefined bits)
176 | }
177 |
178 | // Always allow native PME, AER (no dependencies)
179 |
180 | // Never allow SHPC (no SHPC controller in this system)
181 | And(CTRL,0x1D,CTRL)
182 |
183 | #if 0
184 | If(LNot(And(CDW1,1))) { // Query flag clear?
185 | // Disable GPEs for features granted native control.
186 | If(And(CTRL,0x01)) { // Hot plug control granted?
187 | Store(0,HPCE) // clear the hot plug SCI enable bit
188 | Store(1,HPCS) // clear the hot plug SCI status bit
189 | }
190 | If(And(CTRL,0x04)) { // PME control granted?
191 | Store(0,PMCE) // clear the PME SCI enable bit
192 | Store(1,PMCS) // clear the PME SCI status bit
193 | }
194 | If(And(CTRL,0x10)) { // OS restoring PCIe cap structure?
195 | // Set status to not restore PCIe cap structure
196 | // upon resume from S3
197 | Store(1,S3CR)
198 | }
199 | }
200 | #endif
201 |
202 | If(LNotEqual(Arg1,One)) { // Unknown revision
203 | Or(CDW1,0x08,CDW1)
204 | }
205 |
206 | If(LNotEqual(CDW3,CTRL)) { // Capabilities bits were masked
207 | Or(CDW1,0x10,CDW1)
208 | }
209 | // Update DWORD3 in the buffer
210 | Store(CTRL,CDW3)
211 | Return(Arg3)
212 | } Else {
213 | Or(CDW1,4,CDW1) // Unrecognized UUID
214 | Return(Arg3)
215 | }
216 | } // End _OSC
217 | } // PCI0
218 | }
219 | }
220 |
--------------------------------------------------------------------------------
/XiaomiMI8Pkg/AcpiTables/AcpiTables.inf:
--------------------------------------------------------------------------------
1 | ## @file
2 | #
3 | # ACPI table data and ASL sources required to boot the platform.
4 | #
5 | # Copyright (c) 2014-2017, ARM Ltd. All rights reserved.
6 | #
7 | # This program and the accompanying materials
8 | # are licensed and made available under the terms and conditions of the BSD License
9 | # which accompanies this distribution. The full text of the license may be found at
10 | # http://opensource.org/licenses/bsd-license.php
11 | #
12 | # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
13 | # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
14 | #
15 | ##
16 |
17 | [Defines]
18 | INF_VERSION = 0x00010005
19 | BASE_NAME = XiaomiMI8AcpiTables
20 | FILE_GUID = 7E374E25-8E01-4FEE-87F2-390C23C606CD # Must be this
21 | MODULE_TYPE = USER_DEFINED
22 | VERSION_STRING = 1.0
23 |
24 | [Sources]
25 | Dsdt.asl
26 | Dbg2.aslc
27 | #Spcr.aslc
28 | Fadt.aslc
29 | Gtdt.aslc
30 | Madt.aslc
31 | #AcpiSsdtRootPci.asl # Juno R1 specific
32 |
33 | [Packages]
34 | ArmPkg/ArmPkg.dec
35 | ArmPlatformPkg/ArmPlatformPkg.dec
36 | EmbeddedPkg/EmbeddedPkg.dec
37 | MdePkg/MdePkg.dec
38 | MdeModulePkg/MdeModulePkg.dec
39 | XiaomiMI8Pkg/XiaomiMI8Pkg.dec
40 |
41 | [FixedPcd]
42 | gArmPlatformTokenSpaceGuid.PcdCoreCount
43 | gArmTokenSpaceGuid.PcdGicDistributorBase
44 | gArmTokenSpaceGuid.PcdGicInterruptInterfaceBase
45 | gArmTokenSpaceGuid.PcdGicRedistributorsBase
46 |
47 | gArmTokenSpaceGuid.PcdArmArchTimerSecIntrNum
48 | gArmTokenSpaceGuid.PcdArmArchTimerIntrNum
49 | gArmTokenSpaceGuid.PcdArmArchTimerHypIntrNum
50 | gArmTokenSpaceGuid.PcdArmArchTimerVirtIntrNum
51 |
52 | gArmTokenSpaceGuid.PcdGenericWatchdogControlBase
53 | gArmTokenSpaceGuid.PcdGenericWatchdogRefreshBase
54 |
55 | #
56 | # PL011 UART Settings for Serial Port Console Redirection
57 | #
58 | gEfiMdeModulePkgTokenSpaceGuid.PcdSerialRegisterBase
59 | gEfiMdePkgTokenSpaceGuid.PcdUartDefaultBaudRate
60 | gArmPlatformTokenSpaceGuid.PL011UartClkInHz
61 | gArmPlatformTokenSpaceGuid.PL011UartInterrupt
62 |
63 | gArmPlatformTokenSpaceGuid.PcdSerialDbgRegisterBase
64 |
65 | gArmPlatformTokenSpaceGuid.PcdWatchdogCount
66 |
--------------------------------------------------------------------------------
/XiaomiMI8Pkg/AcpiTables/Dbg2.aslc:
--------------------------------------------------------------------------------
1 | /** @file
2 | * DBG2 Table
3 | *
4 | * Copyright (c) 2012-2016, ARM Limited. All rights reserved.
5 | *
6 | * This program and the accompanying materials
7 | * are licensed and made available under the terms and conditions of the BSD License
8 | * which accompanies this distribution. The full text of the license may be found at
9 | * http://opensource.org/licenses/bsd-license.php
10 | *
11 | * THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
13 | *
14 | **/
15 |
16 | #include "ArmPlatform.h"
17 | #include
18 | #include
19 | #include
20 | #include
21 | #include
22 |
23 | #pragma pack(1)
24 |
25 | #define DBG2_NUM_DEBUG_PORTS 0
26 | #define DBG2_NUMBER_OF_GENERIC_ADDRESS_REGISTERS 1
27 | #define DBG2_NAMESPACESTRING_FIELD_SIZE 8
28 | #define PL011_UART_LENGTH 0x1000
29 |
30 | #define NAME_STR_UART1 {'C', 'O', 'M', '1', '\0', '\0', '\0', '\0'}
31 |
32 | typedef struct {
33 | EFI_ACPI_DBG2_DEBUG_DEVICE_INFORMATION_STRUCT Dbg2Device;
34 | EFI_ACPI_5_1_GENERIC_ADDRESS_STRUCTURE BaseAddressRegister;
35 | UINT32 AddressSize;
36 | UINT8 NameSpaceString[DBG2_NAMESPACESTRING_FIELD_SIZE];
37 | } DBG2_DEBUG_DEVICE_INFORMATION;
38 |
39 | typedef struct {
40 | EFI_ACPI_DEBUG_PORT_2_DESCRIPTION_TABLE Description;
41 | DBG2_DEBUG_DEVICE_INFORMATION Dbg2DeviceInfo[DBG2_NUM_DEBUG_PORTS];
42 | } DBG2_TABLE;
43 |
44 |
45 | #define DBG2_DEBUG_PORT_DDI(NumReg, SubType, UartBase, UartAddrLen, UartNameStr) { \
46 | { \
47 | EFI_ACPI_DBG2_DEBUG_DEVICE_INFORMATION_STRUCT_REVISION, /* UINT8 Revision */ \
48 | sizeof (DBG2_DEBUG_DEVICE_INFORMATION), /* UINT16 Length */ \
49 | NumReg, /* UINT8 NumberofGenericAddressRegisters */ \
50 | DBG2_NAMESPACESTRING_FIELD_SIZE, /* UINT16 NameSpaceStringLength */ \
51 | OFFSET_OF (DBG2_DEBUG_DEVICE_INFORMATION, NameSpaceString), /* UINT16 NameSpaceStringOffset */ \
52 | 0, /* UINT16 OemDataLength */ \
53 | 0, /* UINT16 OemDataOffset */ \
54 | EFI_ACPI_DBG2_PORT_TYPE_SERIAL, /* UINT16 Port Type */ \
55 | SubType, /* UINT16 Port Subtype */ \
56 | {EFI_ACPI_RESERVED_BYTE, EFI_ACPI_RESERVED_BYTE}, /* UINT8 Reserved[2] */ \
57 | OFFSET_OF (DBG2_DEBUG_DEVICE_INFORMATION, BaseAddressRegister), /* UINT16 BaseAddressRegister Offset */ \
58 | OFFSET_OF (DBG2_DEBUG_DEVICE_INFORMATION, AddressSize) /* UINT16 AddressSize Offset */ \
59 | }, \
60 | ARM_GAS32 (UartBase), /* EFI_ACPI_5_1_GENERIC_ADDRESS_STRUCTURE BaseAddressRegister */ \
61 | UartAddrLen, /* UINT32 AddressSize */ \
62 | UartNameStr /* UINT8 NameSpaceString[MAX_DBG2_NAME_LEN] */ \
63 | }
64 |
65 |
66 | STATIC DBG2_TABLE Dbg2 = {
67 | {
68 | ARM_ACPI_HEADER (EFI_ACPI_5_1_DEBUG_PORT_2_TABLE_SIGNATURE,
69 | DBG2_TABLE,
70 | EFI_ACPI_DBG2_DEBUG_DEVICE_INFORMATION_STRUCT_REVISION),
71 | OFFSET_OF (DBG2_TABLE, Dbg2DeviceInfo),
72 | DBG2_NUM_DEBUG_PORTS /* UINT32 NumberDbgDeviceInfo */
73 | },
74 | {
75 | #if 0
76 | /*
77 | * Kernel Debug Port
78 | */
79 | DBG2_DEBUG_PORT_DDI (DBG2_NUMBER_OF_GENERIC_ADDRESS_REGISTERS,
80 | EFI_ACPI_DBG2_PORT_SUBTYPE_SERIAL_ARM_PL011_UART,
81 | FixedPcdGet64 (PcdSerialDbgRegisterBase),
82 | PL011_UART_LENGTH,
83 | NAME_STR_UART1),
84 | #endif
85 | }
86 | };
87 |
88 | #pragma pack()
89 |
90 | //
91 | // Reference the table being generated to prevent the optimizer from removing
92 | // the data structure from the executable
93 | //
94 | VOID* CONST ReferenceAcpiTable = &Dbg2;
95 |
--------------------------------------------------------------------------------
/XiaomiMI8Pkg/AcpiTables/Fadt.aslc:
--------------------------------------------------------------------------------
1 | /** @file
2 | * Fixed ACPI Description Table (FADT)
3 | *
4 | * Copyright (c) 2012 - 2016, ARM Limited. All rights reserved.
5 | *
6 | * This program and the accompanying materials
7 | * are licensed and made available under the terms and conditions of the BSD License
8 | * which accompanies this distribution. The full text of the license may be found at
9 | * http://opensource.org/licenses/bsd-license.php
10 | *
11 | * THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
13 | *
14 | **/
15 |
16 | #include "ArmPlatform.h"
17 | #include
18 | #include
19 |
20 | #ifdef ARM_JUNO_ACPI_5_0
21 | EFI_ACPI_5_0_FIXED_ACPI_DESCRIPTION_TABLE Fadt = {
22 | ARM_ACPI_HEADER (
23 | EFI_ACPI_5_0_FIXED_ACPI_DESCRIPTION_TABLE_SIGNATURE,
24 | EFI_ACPI_5_0_FIXED_ACPI_DESCRIPTION_TABLE,
25 | EFI_ACPI_5_0_FIXED_ACPI_DESCRIPTION_TABLE_REVISION
26 | ),
27 | #else
28 | EFI_ACPI_5_1_FIXED_ACPI_DESCRIPTION_TABLE Fadt = {
29 | ARM_ACPI_HEADER (
30 | EFI_ACPI_5_1_FIXED_ACPI_DESCRIPTION_TABLE_SIGNATURE,
31 | EFI_ACPI_5_1_FIXED_ACPI_DESCRIPTION_TABLE,
32 | EFI_ACPI_5_1_FIXED_ACPI_DESCRIPTION_TABLE_REVISION
33 | ),
34 | #endif
35 | 0, // UINT32 FirmwareCtrl
36 | 0, // UINT32 Dsdt
37 | EFI_ACPI_RESERVED_BYTE, // UINT8 Reserved0
38 | EFI_ACPI_5_0_PM_PROFILE_UNSPECIFIED, // UINT8 PreferredPmProfile
39 | 0, // UINT16 SciInt
40 | 0, // UINT32 SmiCmd
41 | 0, // UINT8 AcpiEnable
42 | 0, // UINT8 AcpiDisable
43 | 0, // UINT8 S4BiosReq
44 | 0, // UINT8 PstateCnt
45 | 0, // UINT32 Pm1aEvtBlk
46 | 0, // UINT32 Pm1bEvtBlk
47 | 0, // UINT32 Pm1aCntBlk
48 | 0, // UINT32 Pm1bCntBlk
49 | 0, // UINT32 Pm2CntBlk
50 | 0, // UINT32 PmTmrBlk
51 | 0, // UINT32 Gpe0Blk
52 | 0, // UINT32 Gpe1Blk
53 | 0, // UINT8 Pm1EvtLen
54 | 0, // UINT8 Pm1CntLen
55 | 0, // UINT8 Pm2CntLen
56 | 0, // UINT8 PmTmrLen
57 | 0, // UINT8 Gpe0BlkLen
58 | 0, // UINT8 Gpe1BlkLen
59 | 0, // UINT8 Gpe1Base
60 | 0, // UINT8 CstCnt
61 | 0, // UINT16 PLvl2Lat
62 | 0, // UINT16 PLvl3Lat
63 | 0, // UINT16 FlushSize
64 | 0, // UINT16 FlushStride
65 | 0, // UINT8 DutyOffset
66 | 0, // UINT8 DutyWidth
67 | 0, // UINT8 DayAlrm
68 | 0, // UINT8 MonAlrm
69 | 0, // UINT8 Century
70 | 0, // UINT16 IaPcBootArch
71 | 0, // UINT8 Reserved1
72 | EFI_ACPI_5_0_HW_REDUCED_ACPI | EFI_ACPI_5_0_LOW_POWER_S0_IDLE_CAPABLE, // UINT32 Flags
73 | NULL_GAS, // EFI_ACPI_5_0_GENERIC_ADDRESS_STRUCTURE ResetReg
74 | 0, // UINT8 ResetValue
75 | #ifdef ARM_JUNO_ACPI_5_0
76 | {EFI_ACPI_RESERVED_BYTE,EFI_ACPI_RESERVED_BYTE,EFI_ACPI_RESERVED_BYTE}, // UINT8 Reserved2[3]
77 | #else
78 | EFI_ACPI_5_1_ARM_PSCI_COMPLIANT, // UINT16 ArmBootArchFlags
79 | EFI_ACPI_5_1_FIXED_ACPI_DESCRIPTION_TABLE_MINOR_REVISION, // UINT8 MinorRevision
80 | #endif
81 | 0, // UINT64 XFirmwareCtrl
82 | 0, // UINT64 XDsdt
83 | NULL_GAS, // EFI_ACPI_5_0_GENERIC_ADDRESS_STRUCTURE XPm1aEvtBlk
84 | NULL_GAS, // EFI_ACPI_5_0_GENERIC_ADDRESS_STRUCTURE XPm1bEvtBlk
85 | NULL_GAS, // EFI_ACPI_5_0_GENERIC_ADDRESS_STRUCTURE XPm1aCntBlk
86 | NULL_GAS, // EFI_ACPI_5_0_GENERIC_ADDRESS_STRUCTURE XPm1bCntBlk
87 | NULL_GAS, // EFI_ACPI_5_0_GENERIC_ADDRESS_STRUCTURE XPm2CntBlk
88 | NULL_GAS, // EFI_ACPI_5_0_GENERIC_ADDRESS_STRUCTURE XPmTmrBlk
89 | NULL_GAS, // EFI_ACPI_5_0_GENERIC_ADDRESS_STRUCTURE XGpe0Blk
90 | NULL_GAS, // EFI_ACPI_5_0_GENERIC_ADDRESS_STRUCTURE XGpe1Blk
91 | NULL_GAS, // EFI_ACPI_5_0_GENERIC_ADDRESS_STRUCTURE SleepControlReg
92 | NULL_GAS // EFI_ACPI_5_0_GENERIC_ADDRESS_STRUCTURE SleepStatusReg
93 | };
94 |
95 | //
96 | // Reference the table being generated to prevent the optimizer from removing the
97 | // data structure from the executable
98 | //
99 | VOID* CONST ReferenceAcpiTable = &Fadt;
100 |
--------------------------------------------------------------------------------
/XiaomiMI8Pkg/AcpiTables/Gtdt.aslc:
--------------------------------------------------------------------------------
1 | /** @file
2 | * Generic Timer Description Table (GTDT)
3 | *
4 | * Copyright (c) 2012 - 2017, ARM Limited. All rights reserved.
5 | *
6 | * This program and the accompanying materials
7 | * are licensed and made available under the terms and conditions of the BSD License
8 | * which accompanies this distribution. The full text of the license may be found at
9 | * http://opensource.org/licenses/bsd-license.php
10 | *
11 | * THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
13 | *
14 | **/
15 |
16 | #include "ArmPlatform.h"
17 | #include
18 | #include
19 | #include
20 |
21 | #define GTDT_GLOBAL_FLAGS_MAPPED EFI_ACPI_5_0_GTDT_GLOBAL_FLAG_MEMORY_MAPPED_BLOCK_PRESENT
22 | #define GTDT_GLOBAL_FLAGS_NOT_MAPPED 0
23 | #define GTDT_GLOBAL_FLAGS_EDGE EFI_ACPI_5_0_GTDT_GLOBAL_FLAG_INTERRUPT_MODE
24 | #define GTDT_GLOBAL_FLAGS_LEVEL 0
25 |
26 | // Note: We could have a build flag that switches between memory mapped/non-memory mapped timer
27 | #ifdef SYSTEM_TIMER_BASE_ADDRESS
28 | #define GTDT_GLOBAL_FLAGS (GTDT_GLOBAL_FLAGS_MAPPED | GTDT_GLOBAL_FLAGS_LEVEL)
29 | #else
30 | #define GTDT_GLOBAL_FLAGS (GTDT_GLOBAL_FLAGS_NOT_MAPPED | GTDT_GLOBAL_FLAGS_LEVEL)
31 | #define SYSTEM_TIMER_BASE_ADDRESS 0xFFFFFFFFFFFFFFFF
32 | #endif
33 |
34 | #define GTDT_TIMER_EDGE_TRIGGERED EFI_ACPI_5_0_GTDT_TIMER_FLAG_TIMER_INTERRUPT_MODE
35 | #define GTDT_TIMER_LEVEL_TRIGGERED 0
36 | #define GTDT_TIMER_ACTIVE_LOW EFI_ACPI_5_0_GTDT_TIMER_FLAG_TIMER_INTERRUPT_POLARITY
37 | #define GTDT_TIMER_ACTIVE_HIGH 0
38 |
39 | #define GTDT_GTIMER_FLAGS (GTDT_TIMER_ACTIVE_LOW | GTDT_TIMER_LEVEL_TRIGGERED)
40 |
41 | #define JUNO_WATCHDOG_COUNT FixedPcdGet32 (PcdWatchdogCount)
42 |
43 |
44 | #ifdef ARM_JUNO_ACPI_5_0
45 | EFI_ACPI_5_0_GENERIC_TIMER_DESCRIPTION_TABLE Gtdt = {
46 | ARM_ACPI_HEADER(
47 | EFI_ACPI_5_0_GENERIC_TIMER_DESCRIPTION_TABLE_SIGNATURE,
48 | EFI_ACPI_5_0_GENERIC_TIMER_DESCRIPTION_TABLE,
49 | EFI_ACPI_5_0_GENERIC_TIMER_DESCRIPTION_TABLE_REVISION
50 | ),
51 | SYSTEM_TIMER_BASE_ADDRESS, // UINT64 PhysicalAddress
52 | GTDT_GLOBAL_FLAGS, // UINT32 GlobalFlags
53 | FixedPcdGet32 (PcdArmArchTimerSecIntrNum), // UINT32 SecurePL1TimerGSIV
54 | GTDT_GTIMER_FLAGS, // UINT32 SecurePL1TimerFlags
55 | FixedPcdGet32 (PcdArmArchTimerIntrNum), // UINT32 NonSecurePL1TimerGSIV
56 | GTDT_GTIMER_FLAGS, // UINT32 NonSecurePL1TimerFlags
57 | FixedPcdGet32 (PcdArmArchTimerVirtIntrNum), // UINT32 VirtualTimerGSIV
58 | GTDT_GTIMER_FLAGS, // UINT32 VirtualTimerFlags
59 | FixedPcdGet32 (PcdArmArchTimerHypIntrNum), // UINT32 NonSecurePL2TimerGSIV
60 | GTDT_GTIMER_FLAGS // UINT32 NonSecurePL2TimerFlags
61 | };
62 | #else
63 | #pragma pack (1)
64 |
65 | typedef struct {
66 | EFI_ACPI_5_1_GENERIC_TIMER_DESCRIPTION_TABLE Gtdt;
67 | #if (JUNO_WATCHDOG_COUNT != 0)
68 | EFI_ACPI_5_1_GTDT_SBSA_GENERIC_WATCHDOG_STRUCTURE Watchdogs[JUNO_WATCHDOG_COUNT];
69 | #endif
70 | } GENERIC_TIMER_DESCRIPTION_TABLE;
71 |
72 | #pragma pack ()
73 |
74 | GENERIC_TIMER_DESCRIPTION_TABLE Gtdt = {
75 | {
76 | ARM_ACPI_HEADER(
77 | EFI_ACPI_5_1_GENERIC_TIMER_DESCRIPTION_TABLE_SIGNATURE,
78 | GENERIC_TIMER_DESCRIPTION_TABLE,
79 | EFI_ACPI_5_1_GENERIC_TIMER_DESCRIPTION_TABLE_REVISION
80 | ),
81 | SYSTEM_TIMER_BASE_ADDRESS, // UINT64 PhysicalAddress
82 | 0, // UINT32 Reserved
83 | FixedPcdGet32 (PcdArmArchTimerSecIntrNum), // UINT32 SecurePL1TimerGSIV
84 | GTDT_GTIMER_FLAGS, // UINT32 SecurePL1TimerFlags
85 | FixedPcdGet32 (PcdArmArchTimerIntrNum), // UINT32 NonSecurePL1TimerGSIV
86 | GTDT_GTIMER_FLAGS, // UINT32 NonSecurePL1TimerFlags
87 | FixedPcdGet32 (PcdArmArchTimerVirtIntrNum), // UINT32 VirtualTimerGSIV
88 | GTDT_GTIMER_FLAGS, // UINT32 VirtualTimerFlags
89 | FixedPcdGet32 (PcdArmArchTimerHypIntrNum), // UINT32 NonSecurePL2TimerGSIV
90 | GTDT_GTIMER_FLAGS, // UINT32 NonSecurePL2TimerFlags
91 | 0xFFFFFFFFFFFFFFFF, // UINT64 CntReadBasePhysicalAddress
92 | JUNO_WATCHDOG_COUNT, // UINT32 PlatformTimerCount
93 | #if (JUNO_WATCHDOG_COUNT != 0)
94 | sizeof (EFI_ACPI_5_1_GENERIC_TIMER_DESCRIPTION_TABLE) // UINT32 PlatfromTimerOffset
95 | #else
96 | 0
97 | #endif
98 | },
99 | #if (JUNO_WATCHDOG_COUNT != 0)
100 | {
101 | EFI_ACPI_5_1_SBSA_GENERIC_WATCHDOG_STRUCTURE_INIT(
102 | FixedPcdGet64 (PcdGenericWatchdogRefreshBase),
103 | FixedPcdGet64 (PcdGenericWatchdogControlBase),
104 | 93,
105 | 0),
106 | EFI_ACPI_5_1_SBSA_GENERIC_WATCHDOG_STRUCTURE_INIT(
107 | FixedPcdGet64 (PcdGenericWatchdogRefreshBase),
108 | FixedPcdGet64 (PcdGenericWatchdogControlBase),
109 | 94,
110 | EFI_ACPI_5_1_GTDT_SBSA_GENERIC_WATCHDOG_FLAG_SECURE_TIMER)
111 | }
112 | #endif
113 | };
114 | #endif
115 |
116 | //
117 | // Reference the table being generated to prevent the optimizer from removing the
118 | // data structure from the executable
119 | //
120 | VOID* CONST ReferenceAcpiTable = &Gtdt;
121 |
--------------------------------------------------------------------------------
/XiaomiMI8Pkg/AcpiTables/Madt.aslc:
--------------------------------------------------------------------------------
1 | /** @file
2 | * Multiple APIC Description Table (MADT)
3 | *
4 | * Copyright (c) 2012 - 2016, ARM Limited. All rights reserved.
5 | *
6 | * This program and the accompanying materials
7 | * are licensed and made available under the terms and conditions of the BSD License
8 | * which accompanies this distribution. The full text of the license may be found at
9 | * http://opensource.org/licenses/bsd-license.php
10 | *
11 | * THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
13 | *
14 | **/
15 |
16 | #include "ArmPlatform.h"
17 | #include
18 | #include
19 | #include
20 | #include
21 |
22 | //
23 | // Multiple APIC Description Table
24 | //
25 | #ifdef ARM_JUNO_ACPI_5_0
26 | #pragma pack (1)
27 |
28 | typedef struct {
29 | EFI_ACPI_5_0_MULTIPLE_APIC_DESCRIPTION_TABLE_HEADER Header;
30 | EFI_ACPI_5_0_GIC_STRUCTURE GicInterfaces[FixedPcdGet32 (PcdCoreCount)];
31 | EFI_ACPI_5_0_GIC_DISTRIBUTOR_STRUCTURE GicDistributor;
32 | } EFI_ACPI_5_0_MULTIPLE_APIC_DESCRIPTION_TABLE;
33 |
34 | #pragma pack ()
35 |
36 | EFI_ACPI_5_0_MULTIPLE_APIC_DESCRIPTION_TABLE Madt = {
37 | {
38 | ARM_ACPI_HEADER (
39 | EFI_ACPI_5_0_MULTIPLE_APIC_DESCRIPTION_TABLE_SIGNATURE,
40 | EFI_ACPI_5_0_MULTIPLE_APIC_DESCRIPTION_TABLE,
41 | EFI_ACPI_5_0_MULTIPLE_APIC_DESCRIPTION_TABLE_REVISION
42 | ),
43 | //
44 | // MADT specific fields
45 | //
46 | 0, // LocalApicAddress
47 | 0, // Flags
48 | },
49 | {
50 | // Format: EFI_ACPI_5_0_GIC_STRUCTURE_INIT(GicId, AcpiCpuId, Flags, PmuIrq, GicBase)
51 | // Note: The GIC Structure of the primary CPU must be the first entry (see note in 5.2.12.14 GIC Structure of
52 | // ACPI v5.0).
53 | // On Juno we can change the primary CPU changing the SCC register. It is not currently supported in the
54 | // Trusted Firmware. When supported, we will need to code to dynamically change the ordering.
55 | // For now we leave CPU2 (A53-0) at the first position.
56 | // The cores from a same cluster are kept together. It is not an ACPI requirement but in case the OSPM uses
57 | // the ACPI ARM Parking protocol, it might want to wake up the cores in the order of this table.
58 | EFI_ACPI_5_0_GIC_STRUCTURE_INIT(2, 0, EFI_ACPI_5_0_GIC_ENABLED, 50, FixedPcdGet64 (PcdGicInterruptInterfaceBase)), // A53-0
59 | EFI_ACPI_5_0_GIC_STRUCTURE_INIT(3, 1, EFI_ACPI_5_0_GIC_ENABLED, 54, FixedPcdGet64 (PcdGicInterruptInterfaceBase)), // A53-1
60 | EFI_ACPI_5_0_GIC_STRUCTURE_INIT(4, 2, EFI_ACPI_5_0_GIC_ENABLED, 58, FixedPcdGet64 (PcdGicInterruptInterfaceBase)), // A53-2
61 | EFI_ACPI_5_0_GIC_STRUCTURE_INIT(5, 3, EFI_ACPI_5_0_GIC_ENABLED, 62, FixedPcdGet64 (PcdGicInterruptInterfaceBase)), // A53-3
62 | EFI_ACPI_5_0_GIC_STRUCTURE_INIT(0, 4, EFI_ACPI_5_0_GIC_ENABLED, 34, FixedPcdGet64 (PcdGicInterruptInterfaceBase)), // A57-0
63 | EFI_ACPI_5_0_GIC_STRUCTURE_INIT(1, 5, EFI_ACPI_5_0_GIC_ENABLED, 38, FixedPcdGet64 (PcdGicInterruptInterfaceBase)) // A57-1
64 | },
65 | EFI_ACPI_5_0_GIC_DISTRIBUTOR_INIT(0, FixedPcdGet64 (PcdGicDistributorBase), 0)
66 | };
67 | #else
68 | #pragma pack (1)
69 |
70 | typedef struct {
71 | EFI_ACPI_5_0_MULTIPLE_APIC_DESCRIPTION_TABLE_HEADER Header;
72 | EFI_ACPI_5_1_GIC_STRUCTURE GicInterfaces[FixedPcdGet32 (PcdCoreCount)];
73 | EFI_ACPI_5_1_GIC_DISTRIBUTOR_STRUCTURE GicDistributor;
74 | #if 0
75 | EFI_ACPI_6_0_GIC_MSI_FRAME_STRUCTURE MsiFrame;
76 | #endif
77 | EFI_ACPI_6_1_GICR_STRUCTURE Gicr;
78 | } MULTIPLE_APIC_DESCRIPTION_TABLE;
79 |
80 | #pragma pack ()
81 |
82 | MULTIPLE_APIC_DESCRIPTION_TABLE Madt = {
83 | {
84 | ARM_ACPI_HEADER (
85 | EFI_ACPI_5_0_MULTIPLE_APIC_DESCRIPTION_TABLE_SIGNATURE,
86 | MULTIPLE_APIC_DESCRIPTION_TABLE,
87 | EFI_ACPI_5_0_MULTIPLE_APIC_DESCRIPTION_TABLE_REVISION
88 | ),
89 | //
90 | // MADT specific fields
91 | //
92 | 0, // LocalApicAddress
93 | 0, // Flags
94 | },
95 | {
96 | // Format: EFI_ACPI_5_1_GICC_STRUCTURE_INIT(GicId, AcpiCpuUid, MpIdr, Flags, PmuIrq, GicBase, GicVBase, GicHBase,
97 | // GsivId, GicRBase)
98 | // Note: The GIC Structure of the primary CPU must be the first entry (see note in 5.2.12.14 GICC Structure of
99 | // ACPI v5.1).
100 | // On Juno we can change the primary CPU changing the SCC register. It is not currently supported in the
101 | // Trusted Firmware. When supported, we will need to code to dynamically change the ordering.
102 | // For now we leave CPU2 (A53-0) at the first position.
103 | // The cores from a same cluster are kept together. It is not an ACPI requirement but in case the OSPM uses
104 | // the ACPI ARM Parking protocol, it might want to wake up the cores in the order of this table.
105 | EFI_ACPI_5_1_GICC_STRUCTURE_INIT( // A53-0
106 | 0, 0, GET_MPID(0, 0), EFI_ACPI_5_0_GIC_ENABLED, 23, FixedPcdGet64 (PcdGicInterruptInterfaceBase),
107 | 0 /* GicVBase */, 0 /*GicHBase */, 25, 0 /* GicRBase */),
108 | #if 0
109 | EFI_ACPI_5_1_GICC_STRUCTURE_INIT( // A53-1
110 | 3, 1, GET_MPID(1, 1), EFI_ACPI_5_0_GIC_ENABLED, 54, FixedPcdGet64 (PcdGicInterruptInterfaceBase),
111 | 0x2C06F000, 0x2C04F000, 25, 0 /* GicRBase */),
112 | EFI_ACPI_5_1_GICC_STRUCTURE_INIT( // A53-2
113 | 4, 2, GET_MPID(1, 2), EFI_ACPI_5_0_GIC_ENABLED, 58, FixedPcdGet64 (PcdGicInterruptInterfaceBase),
114 | 0x2C06F000, 0x2C04F000, 25, 0 /* GicRBase */),
115 | EFI_ACPI_5_1_GICC_STRUCTURE_INIT( // A53-3
116 | 5, 3, GET_MPID(1, 3), EFI_ACPI_5_0_GIC_ENABLED, 62, FixedPcdGet64 (PcdGicInterruptInterfaceBase),
117 | 0x2C06F000, 0x2C04F000, 25, 0 /* GicRBase */),
118 | EFI_ACPI_5_1_GICC_STRUCTURE_INIT( // A57-0
119 | 0, 4, GET_MPID(0, 0), EFI_ACPI_5_0_GIC_ENABLED, 34, FixedPcdGet64 (PcdGicInterruptInterfaceBase),
120 | 0x2C06F000, 0x2C04F000, 25, 0 /* GicRBase */),
121 | EFI_ACPI_5_1_GICC_STRUCTURE_INIT( // A57-1
122 | 1, 5, GET_MPID(0, 1), EFI_ACPI_5_0_GIC_ENABLED, 38, FixedPcdGet64 (PcdGicInterruptInterfaceBase),
123 | 0x2C06F000, 0x2C04F000, 25, 0 /* GicRBase */),
124 | #endif
125 | },
126 | // Format: EFI_ACPI_6_0_GIC_DISTRIBUTOR_INIT(GicDistHwId, GicDistBase, GicDistVector, GicVersion)
127 | EFI_ACPI_6_0_GIC_DISTRIBUTOR_INIT(0, FixedPcdGet64 (PcdGicDistributorBase), 0, 3),
128 | // Format: EFI_ACPI_6_0_GIC_MSI_FRAME_INIT(GicMsiFrameId, PhysicalBaseAddress, Flags, SPICount, SPIBase)
129 | #if 0
130 | EFI_ACPI_6_0_GIC_MSI_FRAME_INIT(0, ARM_JUNO_GIV2M_MSI_BASE, 0, ARM_JUNO_GIV2M_MSI_SPI_COUNT, ARM_JUNO_GIV2M_MSI_SPI_BASE)
131 | #endif
132 | /* GIC Redistributor */
133 | {
134 | EFI_ACPI_6_1_GICR, // UINT8 Type
135 | sizeof(EFI_ACPI_6_1_GICR_STRUCTURE), // UINT8 Length
136 | EFI_ACPI_RESERVED_WORD, // UINT16 Reserved
137 | FixedPcdGet64 (PcdGicRedistributorsBase), // UINT64 DiscoveryRangeBaseAddress
138 | 0x00100000, // UINT32 DiscoveryRangeLength
139 | }
140 | };
141 | #endif
142 |
143 | //
144 | // Reference the table being generated to prevent the optimizer from removing the
145 | // data structure from the executable
146 | //
147 | VOID* CONST ReferenceAcpiTable = &Madt;
148 |
--------------------------------------------------------------------------------
/XiaomiMI8Pkg/AcpiTables/SDM850/CSRT.aml:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NekokeCore/edk2-dipper/40783e64e903c79f9b02f1d35cb15630d35c603e/XiaomiMI8Pkg/AcpiTables/SDM850/CSRT.aml
--------------------------------------------------------------------------------
/XiaomiMI8Pkg/AcpiTables/SDM850/DBG2.aml:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NekokeCore/edk2-dipper/40783e64e903c79f9b02f1d35cb15630d35c603e/XiaomiMI8Pkg/AcpiTables/SDM850/DBG2.aml
--------------------------------------------------------------------------------
/XiaomiMI8Pkg/AcpiTables/SDM850/DSDT.aml:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NekokeCore/edk2-dipper/40783e64e903c79f9b02f1d35cb15630d35c603e/XiaomiMI8Pkg/AcpiTables/SDM850/DSDT.aml
--------------------------------------------------------------------------------
/XiaomiMI8Pkg/AcpiTables/SDM850/FACS.aml:
--------------------------------------------------------------------------------
1 | FACS@
--------------------------------------------------------------------------------
/XiaomiMI8Pkg/AcpiTables/SDM850/FADT.aml:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NekokeCore/edk2-dipper/40783e64e903c79f9b02f1d35cb15630d35c603e/XiaomiMI8Pkg/AcpiTables/SDM850/FADT.aml
--------------------------------------------------------------------------------
/XiaomiMI8Pkg/AcpiTables/SDM850/GTDT.aml:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NekokeCore/edk2-dipper/40783e64e903c79f9b02f1d35cb15630d35c603e/XiaomiMI8Pkg/AcpiTables/SDM850/GTDT.aml
--------------------------------------------------------------------------------
/XiaomiMI8Pkg/AcpiTables/SDM850/MADT.aml:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NekokeCore/edk2-dipper/40783e64e903c79f9b02f1d35cb15630d35c603e/XiaomiMI8Pkg/AcpiTables/SDM850/MADT.aml
--------------------------------------------------------------------------------
/XiaomiMI8Pkg/AcpiTables/SDM850/MCFG.aml:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NekokeCore/edk2-dipper/40783e64e903c79f9b02f1d35cb15630d35c603e/XiaomiMI8Pkg/AcpiTables/SDM850/MCFG.aml
--------------------------------------------------------------------------------
/XiaomiMI8Pkg/AcpiTables/SDM850/PPTT.aml:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NekokeCore/edk2-dipper/40783e64e903c79f9b02f1d35cb15630d35c603e/XiaomiMI8Pkg/AcpiTables/SDM850/PPTT.aml
--------------------------------------------------------------------------------
/XiaomiMI8Pkg/AcpiTables/Source/DBG2.dsl:
--------------------------------------------------------------------------------
1 | /*
2 | * Intel ACPI Component Architecture
3 | * AML/ASL+ Disassembler version 20200430 (32-bit version)
4 | * Copyright (c) 2000 - 2020 Intel Corporation
5 | *
6 | * Disassembly of acpi/DBG2.aml, Mon May 11 18:23:42 2020
7 | *
8 | * ACPI Data Table [DBG2]
9 | *
10 | * Format: [HexOffset DecimalOffset ByteLength] FieldName : FieldValue
11 | */
12 |
13 | [000h 0000 4] Signature : "DBG2" [Debug Port table type 2]
14 | [004h 0004 4] Table Length : 00000204
15 | [008h 0008 1] Revision : 01
16 | [009h 0009 1] Checksum : 35
17 | [00Ah 0010 6] Oem ID : "HUAWEI"
18 | [010h 0016 8] Oem Table ID : "QCOMEDK2"
19 | [018h 0024 4] Oem Revision : 00000850
20 | [01Ch 0028 4] Asl Compiler ID : "INTL"
21 | [020h 0032 4] Asl Compiler Revision : 20200326
22 |
23 | [024h 0036 4] Info Offset : 0000002C
24 | [028h 0040 4] Info Count : 00000003
25 |
26 | [02Ch 0044 1] Revision : 01
27 | [02Dh 0045 2] Length : 0030
28 | [02Fh 0047 1] Register Count : 01
29 | [030h 0048 2] Namepath Length : 000A
30 | [032h 0050 2] Namepath Offset : 0026
31 | [034h 0052 2] OEM Data Length : 0000 [Optional field not present]
32 | [036h 0054 2] OEM Data Offset : 0000 [Optional field not present]
33 | [038h 0056 2] Port Type : 8000
34 | [03Ah 0058 2] Port Subtype : 0011
35 | [03Ch 0060 2] Reserved : 0000
36 | [03Eh 0062 2] Base Address Offset : 0016
37 | [040h 0064 2] Address Size Offset : 0022
38 |
39 | [042h 0066 12] Base Address Register : [Generic Address Structure]
40 | [042h 0066 1] Space ID : 00 [SystemMemory]
41 | [043h 0067 1] Bit Width : 20
42 | [044h 0068 1] Bit Offset : 00
43 | [045h 0069 1] Encoded Access Width : 20 [Unknown Width Encoding]
44 | [046h 0070 8] Address : 0000000000A84000
45 |
46 | [04Eh 0078 4] Address Size : 00001000
47 |
48 | [052h 0082 10] Namepath : "\_SB.UARD"
49 |
50 | [05Ch 0092 1] Revision : 01
51 | [05Dh 0093 2] Length : 00D4
52 | [05Fh 0095 1] Register Count : 02
53 | [060h 0096 2] Namepath Length : 000A
54 | [062h 0098 2] Namepath Offset : 0036
55 | [064h 0100 2] OEM Data Length : 0094
56 | [066h 0102 2] OEM Data Offset : 0040
57 | [068h 0104 2] Port Type : 8003
58 | [06Ah 0106 2] Port Subtype : 5143
59 | [06Ch 0108 2] Reserved : 0000
60 | [06Eh 0110 2] Base Address Offset : 0016
61 | [070h 0112 2] Address Size Offset : 002E
62 |
63 | [072h 0114 12] Base Address Register : [Generic Address Structure]
64 | [072h 0114 1] Space ID : 00 [SystemMemory]
65 | [073h 0115 1] Bit Width : 20
66 | [074h 0116 1] Bit Offset : 00
67 | [075h 0117 1] Encoded Access Width : 20 [Unknown Width Encoding]
68 | [076h 0118 8] Address : 000000000A600000
69 |
70 |
71 | [07Eh 0126 12] Base Address Register : [Generic Address Structure]
72 | [07Eh 0126 1] Space ID : 00 [SystemMemory]
73 | [07Fh 0127 1] Bit Width : 20
74 | [080h 0128 1] Bit Offset : 00
75 | [081h 0129 1] Encoded Access Width : 20 [Unknown Width Encoding]
76 | [082h 0130 8] Address : 000000000A600000
77 |
78 | [08Ah 0138 4] Address Size : 000FFFFF
79 | [08Eh 0142 4] Address Size : 00001000
80 |
81 | [092h 0146 10] Namepath : "\_SB.URS0"
82 | [09Ch 0156 148] OEM Data : \
83 | 05 00 00 00 32 58 49 46 02 00 00 00 00 02 00 00 \
84 | 00 C7 00 00 F8 FF FF FF 00 00 00 00 00 02 00 00 \
85 | 10 88 0F 00 00 00 00 00 00 00 10 10 00 00 00 00 \
86 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \
87 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \
88 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \
89 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \
90 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \
91 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \
92 | 43 42 53 55
93 |
94 | [130h 0304 1] Revision : 01
95 | [131h 0305 2] Length : 00D4
96 | [133h 0307 1] Register Count : 02
97 | [134h 0308 2] Namepath Length : 000A
98 | [136h 0310 2] Namepath Offset : 0036
99 | [138h 0312 2] OEM Data Length : 0094
100 | [13Ah 0314 2] OEM Data Offset : 0040
101 | [13Ch 0316 2] Port Type : 8003
102 | [13Eh 0318 2] Port Subtype : 5143
103 | [140h 0320 2] Reserved : 0000
104 | [142h 0322 2] Base Address Offset : 0016
105 | [144h 0324 2] Address Size Offset : 002E
106 |
107 | [146h 0326 12] Base Address Register : [Generic Address Structure]
108 | [146h 0326 1] Space ID : 00 [SystemMemory]
109 | [147h 0327 1] Bit Width : 20
110 | [148h 0328 1] Bit Offset : 00
111 | [149h 0329 1] Encoded Access Width : 20 [Unknown Width Encoding]
112 | [14Ah 0330 8] Address : 000000000A800000
113 |
114 |
115 | [152h 0338 12] Base Address Register : [Generic Address Structure]
116 | [152h 0338 1] Space ID : 00 [SystemMemory]
117 | [153h 0339 1] Bit Width : 20
118 | [154h 0340 1] Bit Offset : 00
119 | [155h 0341 1] Encoded Access Width : 20 [Unknown Width Encoding]
120 | [156h 0342 8] Address : 000000000A800000
121 |
122 | [15Eh 0350 4] Address Size : 000FFFFF
123 | [162h 0354 4] Address Size : 00001000
124 |
125 | [166h 0358 10] Namepath : "\_SB.USB1"
126 | [170h 0368 148] OEM Data : \
127 | 05 00 00 00 32 58 49 46 02 00 00 00 00 02 00 00 \
128 | 00 C7 00 00 F8 FF FF FF 00 00 00 00 00 02 00 00 \
129 | 10 88 0F 00 00 00 00 00 00 00 10 10 00 00 00 00 \
130 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \
131 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \
132 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \
133 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \
134 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \
135 | 00 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 \
136 | 43 42 53 55
137 |
138 | Raw Table Data: Length 516 (0x204)
139 |
140 | 0000: 44 42 47 32 04 02 00 00 01 35 48 55 41 57 45 49 // DBG2.....5HUAWEI
141 | 0010: 51 43 4F 4D 45 44 4B 32 50 08 00 00 49 4E 54 4C // QCOMEDK2P...INTL
142 | 0020: 26 03 20 20 2C 00 00 00 03 00 00 00 01 30 00 01 // &. ,........0..
143 | 0030: 0A 00 26 00 00 00 00 00 00 80 11 00 00 00 16 00 // ..&.............
144 | 0040: 22 00 00 20 00 20 00 40 A8 00 00 00 00 00 00 10 // ".. . .@........
145 | 0050: 00 00 5C 5F 53 42 2E 55 41 52 44 00 01 D4 00 02 // ..\_SB.UARD.....
146 | 0060: 0A 00 36 00 94 00 40 00 03 80 43 51 00 00 16 00 // ..6...@...CQ....
147 | 0070: 2E 00 00 20 00 20 00 00 60 0A 00 00 00 00 00 20 // ... . ..`......
148 | 0080: 00 20 00 00 60 0A 00 00 00 00 FF FF 0F 00 00 10 // . ..`...........
149 | 0090: 00 00 5C 5F 53 42 2E 55 52 53 30 00 05 00 00 00 // ..\_SB.URS0.....
150 | 00A0: 32 58 49 46 02 00 00 00 00 02 00 00 00 C7 00 00 // 2XIF............
151 | 00B0: F8 FF FF FF 00 00 00 00 00 02 00 00 10 88 0F 00 // ................
152 | 00C0: 00 00 00 00 00 00 10 10 00 00 00 00 00 00 00 00 // ................
153 | 00D0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 // ................
154 | 00E0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 // ................
155 | 00F0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 // ................
156 | 0100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 // ................
157 | 0110: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 // ................
158 | 0120: 00 00 00 00 00 00 00 00 00 00 00 00 43 42 53 55 // ............CBSU
159 | 0130: 01 D4 00 02 0A 00 36 00 94 00 40 00 03 80 43 51 // ......6...@...CQ
160 | 0140: 00 00 16 00 2E 00 00 20 00 20 00 00 80 0A 00 00 // ....... . ......
161 | 0150: 00 00 00 20 00 20 00 00 80 0A 00 00 00 00 FF FF // ... . ..........
162 | 0160: 0F 00 00 10 00 00 5C 5F 53 42 2E 55 53 42 31 00 // ......\_SB.USB1.
163 | 0170: 05 00 00 00 32 58 49 46 02 00 00 00 00 02 00 00 // ....2XIF........
164 | 0180: 00 C7 00 00 F8 FF FF FF 00 00 00 00 00 02 00 00 // ................
165 | 0190: 10 88 0F 00 00 00 00 00 00 00 10 10 00 00 00 00 // ................
166 | 01A0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 // ................
167 | 01B0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 // ................
168 | 01C0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 // ................
169 | 01D0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 // ................
170 | 01E0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 // ................
171 | 01F0: 00 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 // ................
172 | 0200: 43 42 53 55 // CBSU
173 |
--------------------------------------------------------------------------------
/XiaomiMI8Pkg/AcpiTables/Source/FACS.dsl:
--------------------------------------------------------------------------------
1 | /*
2 | * Intel ACPI Component Architecture
3 | * AML/ASL+ Disassembler version 20200430 (32-bit version)
4 | * Copyright (c) 2000 - 2020 Intel Corporation
5 | *
6 | * Disassembly of acpi/FACS.aml, Mon May 11 18:23:42 2020
7 | *
8 | * ACPI Data Table [FACS]
9 | *
10 | * Format: [HexOffset DecimalOffset ByteLength] FieldName : FieldValue
11 | */
12 |
13 | [000h 0000 4] Signature : "FACS"
14 | [004h 0004 4] Length : 00000040
15 | [008h 0008 4] Hardware Signature : 00000000
16 | [00Ch 0012 4] 32 Firmware Waking Vector : 00000000
17 | [010h 0016 4] Global Lock : 00000000
18 | [014h 0020 4] Flags (decoded below) : 00000000
19 | S4BIOS Support Present : 0
20 | 64-bit Wake Supported (V2) : 0
21 | [018h 0024 8] 64 Firmware Waking Vector : 0000000000000000
22 | [020h 0032 1] Version : 02
23 | [021h 0033 3] Reserved : 000000
24 | [024h 0036 4] OspmFlags (decoded below) : 00000000
25 | 64-bit Wake Env Required (V2) : 0
26 |
27 | Raw Table Data: Length 64 (0x40)
28 |
29 | 0000: 46 41 43 53 40 00 00 00 00 00 00 00 00 00 00 00 // FACS@...........
30 | 0010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 // ................
31 | 0020: 02 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 // ................
32 | 0030: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 // ................
33 |
--------------------------------------------------------------------------------
/XiaomiMI8Pkg/AcpiTables/Source/FADT.dsl:
--------------------------------------------------------------------------------
1 | /*
2 | * Intel ACPI Component Architecture
3 | * AML/ASL+ Disassembler version 20200430 (32-bit version)
4 | * Copyright (c) 2000 - 2020 Intel Corporation
5 | *
6 | * Disassembly of acpi/FADT.aml, Mon May 11 18:23:42 2020
7 | *
8 | * ACPI Data Table [FACP]
9 | *
10 | * Format: [HexOffset DecimalOffset ByteLength] FieldName : FieldValue
11 | */
12 |
13 | [000h 0000 4] Signature : "FACP" [Fixed ACPI Description Table (FADT)]
14 | [004h 0004 4] Table Length : 0000010C
15 | [008h 0008 1] Revision : 05
16 | [009h 0009 1] Checksum : 32
17 | [00Ah 0010 6] Oem ID : "HUAWEI"
18 | [010h 0016 8] Oem Table ID : "QCOMEDK2"
19 | [018h 0024 4] Oem Revision : 00000850
20 | [01Ch 0028 4] Asl Compiler ID : "INTL"
21 | [020h 0032 4] Asl Compiler Revision : 20200326
22 |
23 | [024h 0036 4] FACS Address : FFE57000
24 | [028h 0040 4] DSDT Address : FFFAC000
25 | [02Ch 0044 1] Model : 00
26 | [02Dh 0045 1] PM Profile : 08 [Tablet]
27 | [02Eh 0046 2] SCI Interrupt : 0000
28 | [030h 0048 4] SMI Command Port : 00000000
29 | [034h 0052 1] ACPI Enable Value : 00
30 | [035h 0053 1] ACPI Disable Value : 00
31 | [036h 0054 1] S4BIOS Command : 00
32 | [037h 0055 1] P-State Control : 00
33 | [038h 0056 4] PM1A Event Block Address : 00000000
34 | [03Ch 0060 4] PM1B Event Block Address : 00000000
35 | [040h 0064 4] PM1A Control Block Address : 00000000
36 | [044h 0068 4] PM1B Control Block Address : 00000000
37 | [048h 0072 4] PM2 Control Block Address : 00000000
38 | [04Ch 0076 4] PM Timer Block Address : 00000000
39 | [050h 0080 4] GPE0 Block Address : 00000000
40 | [054h 0084 4] GPE1 Block Address : 00000000
41 | [058h 0088 1] PM1 Event Block Length : 00
42 | [059h 0089 1] PM1 Control Block Length : 00
43 | [05Ah 0090 1] PM2 Control Block Length : 00
44 | [05Bh 0091 1] PM Timer Block Length : 00
45 | [05Ch 0092 1] GPE0 Block Length : 00
46 | [05Dh 0093 1] GPE1 Block Length : 00
47 | [05Eh 0094 1] GPE1 Base Offset : 00
48 | [05Fh 0095 1] _CST Support : 00
49 | [060h 0096 2] C2 Latency : 0000
50 | [062h 0098 2] C3 Latency : 0000
51 | [064h 0100 2] CPU Cache Size : 0000
52 | [066h 0102 2] Cache Flush Stride : 0000
53 | [068h 0104 1] Duty Cycle Offset : 00
54 | [069h 0105 1] Duty Cycle Width : 00
55 | [06Ah 0106 1] RTC Day Alarm Index : 00
56 | [06Bh 0107 1] RTC Month Alarm Index : 00
57 | [06Ch 0108 1] RTC Century Index : 00
58 | [06Dh 0109 2] Boot Flags (decoded below) : 0000
59 | Legacy Devices Supported (V2) : 0
60 | 8042 Present on ports 60/64 (V2) : 0
61 | VGA Not Present (V4) : 0
62 | MSI Not Supported (V4) : 0
63 | PCIe ASPM Not Supported (V4) : 0
64 | CMOS RTC Not Present (V5) : 0
65 | [06Fh 0111 1] Reserved : 00
66 | [070h 0112 4] Flags (decoded below) : 00300000
67 | WBINVD instruction is operational (V1) : 0
68 | WBINVD flushes all caches (V1) : 0
69 | All CPUs support C1 (V1) : 0
70 | C2 works on MP system (V1) : 0
71 | Control Method Power Button (V1) : 0
72 | Control Method Sleep Button (V1) : 0
73 | RTC wake not in fixed reg space (V1) : 0
74 | RTC can wake system from S4 (V1) : 0
75 | 32-bit PM Timer (V1) : 0
76 | Docking Supported (V1) : 0
77 | Reset Register Supported (V2) : 0
78 | Sealed Case (V3) : 0
79 | Headless - No Video (V3) : 0
80 | Use native instr after SLP_TYPx (V3) : 0
81 | PCIEXP_WAK Bits Supported (V4) : 0
82 | Use Platform Timer (V4) : 0
83 | RTC_STS valid on S4 wake (V4) : 0
84 | Remote Power-on capable (V4) : 0
85 | Use APIC Cluster Model (V4) : 0
86 | Use APIC Physical Destination Mode (V4) : 0
87 | Hardware Reduced (V5) : 1
88 | Low Power S0 Idle (V5) : 1
89 |
90 | [074h 0116 12] Reset Register : [Generic Address Structure]
91 | [074h 0116 1] Space ID : 03 [EmbeddedControl]
92 | [075h 0117 1] Bit Width : 00
93 | [076h 0118 1] Bit Offset : 00
94 | [077h 0119 1] Encoded Access Width : 03 [DWord Access:32]
95 | [078h 0120 8] Address : 00000000009020B4
96 |
97 | [080h 0128 1] Value to cause reset : 01
98 | [081h 0129 2] ARM Flags (decoded below) : 0001
99 | PSCI Compliant : 1
100 | Must use HVC for PSCI : 0
101 |
102 | [083h 0131 1] FADT Minor Revision : 00
103 | [084h 0132 8] FACS Address : 0000000000000000
104 | [08Ch 0140 8] DSDT Address : 0000000000000000
105 | [094h 0148 12] PM1A Event Block : [Generic Address Structure]
106 | [094h 0148 1] Space ID : 00 [SystemMemory]
107 | [095h 0149 1] Bit Width : 00
108 | [096h 0150 1] Bit Offset : 00
109 | [097h 0151 1] Encoded Access Width : 00 [Undefined/Legacy]
110 | [098h 0152 8] Address : 0000000000000000
111 |
112 | [0A0h 0160 12] PM1B Event Block : [Generic Address Structure]
113 | [0A0h 0160 1] Space ID : 00 [SystemMemory]
114 | [0A1h 0161 1] Bit Width : 00
115 | [0A2h 0162 1] Bit Offset : 00
116 | [0A3h 0163 1] Encoded Access Width : 00 [Undefined/Legacy]
117 | [0A4h 0164 8] Address : 0000000000000000
118 |
119 | [0ACh 0172 12] PM1A Control Block : [Generic Address Structure]
120 | [0ACh 0172 1] Space ID : 00 [SystemMemory]
121 | [0ADh 0173 1] Bit Width : 00
122 | [0AEh 0174 1] Bit Offset : 00
123 | [0AFh 0175 1] Encoded Access Width : 00 [Undefined/Legacy]
124 | [0B0h 0176 8] Address : 0000000000000000
125 |
126 | [0B8h 0184 12] PM1B Control Block : [Generic Address Structure]
127 | [0B8h 0184 1] Space ID : 00 [SystemMemory]
128 | [0B9h 0185 1] Bit Width : 00
129 | [0BAh 0186 1] Bit Offset : 00
130 | [0BBh 0187 1] Encoded Access Width : 00 [Undefined/Legacy]
131 | [0BCh 0188 8] Address : 0000000000000000
132 |
133 | [0C4h 0196 12] PM2 Control Block : [Generic Address Structure]
134 | [0C4h 0196 1] Space ID : 00 [SystemMemory]
135 | [0C5h 0197 1] Bit Width : 00
136 | [0C6h 0198 1] Bit Offset : 00
137 | [0C7h 0199 1] Encoded Access Width : 00 [Undefined/Legacy]
138 | [0C8h 0200 8] Address : 0000000000000000
139 |
140 | [0D0h 0208 12] PM Timer Block : [Generic Address Structure]
141 | [0D0h 0208 1] Space ID : 00 [SystemMemory]
142 | [0D1h 0209 1] Bit Width : 00
143 | [0D2h 0210 1] Bit Offset : 00
144 | [0D3h 0211 1] Encoded Access Width : 00 [Undefined/Legacy]
145 | [0D4h 0212 8] Address : 0000000000000000
146 |
147 | [0DCh 0220 12] GPE0 Block : [Generic Address Structure]
148 | [0DCh 0220 1] Space ID : 00 [SystemMemory]
149 | [0DDh 0221 1] Bit Width : 00
150 | [0DEh 0222 1] Bit Offset : 00
151 | [0DFh 0223 1] Encoded Access Width : 00 [Undefined/Legacy]
152 | [0E0h 0224 8] Address : 0000000000000000
153 |
154 | [0E8h 0232 12] GPE1 Block : [Generic Address Structure]
155 | [0E8h 0232 1] Space ID : 00 [SystemMemory]
156 | [0E9h 0233 1] Bit Width : 00
157 | [0EAh 0234 1] Bit Offset : 00
158 | [0EBh 0235 1] Encoded Access Width : 00 [Undefined/Legacy]
159 | [0ECh 0236 8] Address : 0000000000000000
160 |
161 |
162 | [0F4h 0244 12] Sleep Control Register : [Generic Address Structure]
163 | [0F4h 0244 1] Space ID : 00 [SystemMemory]
164 | [0F5h 0245 1] Bit Width : 00
165 | [0F6h 0246 1] Bit Offset : 00
166 | [0F7h 0247 1] Encoded Access Width : 00 [Undefined/Legacy]
167 | [0F8h 0248 8] Address : 0000000000000000
168 |
169 | [100h 0256 12] Sleep Status Register : [Generic Address Structure]
170 | [100h 0256 1] Space ID : 00 [SystemMemory]
171 | [101h 0257 1] Bit Width : 00
172 | [102h 0258 1] Bit Offset : 00
173 | [103h 0259 1] Encoded Access Width : 00 [Undefined/Legacy]
174 | [104h 0260 8] Address : 0000000000000000
175 |
176 | /**** ACPI table terminates in the middle of a data structure! (dump table) */
177 |
178 | Raw Table Data: Length 268 (0x10C)
179 |
180 | 0000: 46 41 43 50 0C 01 00 00 05 32 48 55 41 57 45 49 // FACP.....2HUAWEI
181 | 0010: 51 43 4F 4D 45 44 4B 32 50 08 00 00 49 4E 54 4C // QCOMEDK2P...INTL
182 | 0020: 26 03 20 20 00 70 E5 FF 00 C0 FA FF 00 08 00 00 // &. .p..........
183 | 0030: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 // ................
184 | 0040: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 // ................
185 | 0050: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 // ................
186 | 0060: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 // ................
187 | 0070: 00 00 30 00 03 00 00 03 B4 20 90 00 00 00 00 00 // ..0...... ......
188 | 0080: 01 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 // ................
189 | 0090: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 // ................
190 | 00A0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 // ................
191 | 00B0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 // ................
192 | 00C0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 // ................
193 | 00D0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 // ................
194 | 00E0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 // ................
195 | 00F0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 // ................
196 | 0100: 00 00 00 00 00 00 00 00 00 00 00 00 // ............
197 |
--------------------------------------------------------------------------------
/XiaomiMI8Pkg/AcpiTables/Source/GTDT.dsl:
--------------------------------------------------------------------------------
1 | /*
2 | * Intel ACPI Component Architecture
3 | * AML/ASL+ Disassembler version 20200430 (32-bit version)
4 | * Copyright (c) 2000 - 2020 Intel Corporation
5 | *
6 | * Disassembly of acpi/GTDT.aml, Mon May 11 18:23:42 2020
7 | *
8 | * ACPI Data Table [GTDT]
9 | *
10 | * Format: [HexOffset DecimalOffset ByteLength] FieldName : FieldValue
11 | */
12 |
13 | [000h 0000 4] Signature : "GTDT" [Generic Timer Description Table]
14 | [004h 0004 4] Table Length : 0000009C
15 | [008h 0008 1] Revision : 02
16 | [009h 0009 1] Checksum : 64
17 | [00Ah 0010 6] Oem ID : "HUAWEI"
18 | [010h 0016 8] Oem Table ID : "QCOMEDK2"
19 | [018h 0024 4] Oem Revision : 00000850
20 | [01Ch 0028 4] Asl Compiler ID : "INTL"
21 | [020h 0032 4] Asl Compiler Revision : 20200326
22 |
23 | [024h 0036 8] Counter Block Address : FFFFFFFFFFFFFFFF
24 | [02Ch 0044 4] Reserved : 00000000
25 |
26 | [030h 0048 4] Secure EL1 Interrupt : 00000011
27 | [034h 0052 4] EL1 Flags (decoded below) : 00000000
28 | Trigger Mode : 0
29 | Polarity : 0
30 | Always On : 0
31 |
32 | [038h 0056 4] Non-Secure EL1 Interrupt : 00000012
33 | [03Ch 0060 4] NEL1 Flags (decoded below) : 00000000
34 | Trigger Mode : 0
35 | Polarity : 0
36 | Always On : 0
37 |
38 | [040h 0064 4] Virtual Timer Interrupt : 00000013
39 | [044h 0068 4] VT Flags (decoded below) : 00000000
40 | Trigger Mode : 0
41 | Polarity : 0
42 | Always On : 0
43 |
44 | [048h 0072 4] Non-Secure EL2 Interrupt : 00000010
45 | [04Ch 0076 4] NEL2 Flags (decoded below) : 00000000
46 | Trigger Mode : 0
47 | Polarity : 0
48 | Always On : 0
49 | [050h 0080 8] Counter Read Block Address : FFFFFFFFFFFFFFFF
50 |
51 | [058h 0088 4] Platform Timer Count : 00000001
52 | [05Ch 0092 4] Platform Timer Offset : 00000060
53 |
54 | [060h 0096 1] Subtable Type : 00 [Generic Timer Block]
55 | [061h 0097 2] Length : 003C
56 | [063h 0099 1] Reserved : 00
57 | [064h 0100 8] Block Address : 0000000017C90000
58 | [06Ch 0108 4] Timer Count : 00000001
59 | [070h 0112 4] Timer Offset : 00000014
60 |
61 | [074h 0116 1] Frame Number : 00
62 | [075h 0117 3] Reserved : 000000
63 | [078h 0120 8] Base Address : 0000000017CA0000
64 | [080h 0128 8] EL0 Base Address : 0000000017CB0000
65 | [088h 0136 4] Timer Interrupt : 00000027
66 | [08Ch 0140 4] Timer Flags (decoded below) : 00000000
67 | Trigger Mode : 0
68 | Polarity : 0
69 | [090h 0144 4] Virtual Timer Interrupt : 00000026
70 | [094h 0148 4] Virtual Timer Flags (decoded below) : 00000000
71 | Trigger Mode : 0
72 | Polarity : 0
73 | [098h 0152 4] Common Flags (decoded below) : 00000002
74 | Secure : 0
75 | Always On : 1
76 |
77 | Raw Table Data: Length 156 (0x9C)
78 |
79 | 0000: 47 54 44 54 9C 00 00 00 02 64 48 55 41 57 45 49 // GTDT.....dHUAWEI
80 | 0010: 51 43 4F 4D 45 44 4B 32 50 08 00 00 49 4E 54 4C // QCOMEDK2P...INTL
81 | 0020: 26 03 20 20 FF FF FF FF FF FF FF FF 00 00 00 00 // &. ............
82 | 0030: 11 00 00 00 00 00 00 00 12 00 00 00 00 00 00 00 // ................
83 | 0040: 13 00 00 00 00 00 00 00 10 00 00 00 00 00 00 00 // ................
84 | 0050: FF FF FF FF FF FF FF FF 01 00 00 00 60 00 00 00 // ............`...
85 | 0060: 00 3C 00 00 00 00 C9 17 00 00 00 00 01 00 00 00 // .<..............
86 | 0070: 14 00 00 00 00 00 00 00 00 00 CA 17 00 00 00 00 // ................
87 | 0080: 00 00 CB 17 00 00 00 00 27 00 00 00 00 00 00 00 // ........'.......
88 | 0090: 26 00 00 00 00 00 00 00 02 00 00 00 // &...........
89 |
--------------------------------------------------------------------------------
/XiaomiMI8Pkg/AcpiTables/Source/MCFG.dsl:
--------------------------------------------------------------------------------
1 | /*
2 | * Intel ACPI Component Architecture
3 | * AML/ASL+ Disassembler version 20200430 (32-bit version)
4 | * Copyright (c) 2000 - 2020 Intel Corporation
5 | *
6 | * Disassembly of acpi/MCFG.aml, Mon May 11 18:23:42 2020
7 | *
8 | * ACPI Data Table [MCFG]
9 | *
10 | * Format: [HexOffset DecimalOffset ByteLength] FieldName : FieldValue
11 | */
12 |
13 | [000h 0000 4] Signature : "MCFG" [Memory Mapped Configuration table]
14 | [004h 0004 4] Table Length : 0000002C
15 | [008h 0008 1] Revision : 01
16 | [009h 0009 1] Checksum : C5
17 | [00Ah 0010 6] Oem ID : "HUAWEI"
18 | [010h 0016 8] Oem Table ID : "QCOMEDK2"
19 | [018h 0024 4] Oem Revision : 00000850
20 | [01Ch 0028 4] Asl Compiler ID : "INTL"
21 | [020h 0032 4] Asl Compiler Revision : 20200326
22 |
23 | [024h 0036 8] Reserved : 0000000000000000
24 |
25 | Raw Table Data: Length 44 (0x2C)
26 |
27 | 0000: 4D 43 46 47 2C 00 00 00 01 C5 48 55 41 57 45 49 // MCFG,.....HUAWEI
28 | 0010: 51 43 4F 4D 45 44 4B 32 50 08 00 00 49 4E 54 4C // QCOMEDK2P...INTL
29 | 0020: 26 03 20 20 00 00 00 00 00 00 00 00 // &. ........
30 |
--------------------------------------------------------------------------------
/XiaomiMI8Pkg/AcpiTables/Spcr.aslc:
--------------------------------------------------------------------------------
1 | /** @file
2 | * SPCR Table
3 | *
4 | * Copyright (c) 2014 - 2016, ARM Limited. All rights reserved.
5 | *
6 | * This program and the accompanying materials are licensed and made available
7 | * under the terms and conditions of the BSD License which accompanies this
8 | * distribution. The full text of the license may be found at
9 | * http://opensource.org/licenses/bsd-license.php
10 | *
11 | * THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
13 | *
14 | **/
15 |
16 | #include "ArmPlatform.h"
17 | #include
18 | #include
19 | #include
20 | #include
21 | #include
22 |
23 | /**
24 | * References:
25 | * Serial Port Console Redirection Table Specification Version 1.03 - August 10, 2015
26 | **/
27 |
28 |
29 | ///
30 | /// SPCR Flow Control
31 | ///
32 | #define SPCR_FLOW_CONTROL_NONE 0
33 |
34 |
35 | STATIC EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE Spcr = {
36 | ARM_ACPI_HEADER (EFI_ACPI_5_1_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_SIGNATURE,
37 | EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE,
38 | EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_REVISION),
39 | // UINT8 InterfaceType;
40 | EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_INTERFACE_TYPE_ARM_PL011_UART,
41 | // UINT8 Reserved1[3];
42 | {
43 | EFI_ACPI_RESERVED_BYTE,
44 | EFI_ACPI_RESERVED_BYTE,
45 | EFI_ACPI_RESERVED_BYTE
46 | },
47 | // EFI_ACPI_5_0_GENERIC_ADDRESS_STRUCTURE BaseAddress;
48 | ARM_GAS32 (FixedPcdGet64 (PcdSerialRegisterBase)),
49 | // UINT8 InterruptType;
50 | EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_INTERRUPT_TYPE_GIC,
51 | // UINT8 Irq;
52 | 0, // Not used on ARM
53 | // UINT32 GlobalSystemInterrupt;
54 | FixedPcdGet32 (PL011UartInterrupt),
55 | // UINT8 BaudRate;
56 | #if (FixedPcdGet64 (PcdUartDefaultBaudRate) == 9600)
57 | EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_BAUD_RATE_9600,
58 | #elif (FixedPcdGet64 (PcdUartDefaultBaudRate) == 19200)
59 | EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_BAUD_RATE_19200,
60 | #elif (FixedPcdGet64 (PcdUartDefaultBaudRate) == 57600)
61 | EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_BAUD_RATE_57600,
62 | #elif (FixedPcdGet64 (PcdUartDefaultBaudRate) == 115200)
63 | EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_BAUD_RATE_115200,
64 | #else
65 | #error Unsupported SPCR Baud Rate
66 | #endif
67 | // UINT8 Parity;
68 | EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_PARITY_NO_PARITY,
69 | // UINT8 StopBits;
70 | EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_STOP_BITS_1,
71 | // UINT8 FlowControl;
72 | SPCR_FLOW_CONTROL_NONE,
73 | // UINT8 TerminalType;
74 | EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_TERMINAL_TYPE_ANSI,
75 | // UINT8 Reserved2;
76 | EFI_ACPI_RESERVED_BYTE,
77 | // UINT16 PciDeviceId;
78 | 0xFFFF,
79 | // UINT16 PciVendorId;
80 | 0xFFFF,
81 | // UINT8 PciBusNumber;
82 | 0x00,
83 | // UINT8 PciDeviceNumber;
84 | 0x00,
85 | // UINT8 PciFunctionNumber;
86 | 0x00,
87 | // UINT32 PciFlags;
88 | 0x00000000,
89 | // UINT8 PciSegment;
90 | 0x00,
91 | // UINT32 Reserved3;
92 | EFI_ACPI_RESERVED_DWORD
93 | };
94 |
95 | //
96 | // Reference the table being generated to prevent the optimizer from removing the
97 | // data structure from the executable
98 | //
99 | VOID* CONST ReferenceAcpiTable = &Spcr;
100 |
--------------------------------------------------------------------------------
/XiaomiMI8Pkg/Binary/ASN1X509Dxe/ASN1X509Dxe.efi:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NekokeCore/edk2-dipper/40783e64e903c79f9b02f1d35cb15630d35c603e/XiaomiMI8Pkg/Binary/ASN1X509Dxe/ASN1X509Dxe.efi
--------------------------------------------------------------------------------
/XiaomiMI8Pkg/Binary/ASN1X509Dxe/file.obj:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NekokeCore/edk2-dipper/40783e64e903c79f9b02f1d35cb15630d35c603e/XiaomiMI8Pkg/Binary/ASN1X509Dxe/file.obj
--------------------------------------------------------------------------------
/XiaomiMI8Pkg/Binary/ASN1X509Dxe/section1.ui:
--------------------------------------------------------------------------------
1 | A S N 1 X 5 0 9 D x e
--------------------------------------------------------------------------------
/XiaomiMI8Pkg/Binary/AdcDxe/AdcDxe.depex:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NekokeCore/edk2-dipper/40783e64e903c79f9b02f1d35cb15630d35c603e/XiaomiMI8Pkg/Binary/AdcDxe/AdcDxe.depex
--------------------------------------------------------------------------------
/XiaomiMI8Pkg/Binary/AdcDxe/AdcDxe.efi:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NekokeCore/edk2-dipper/40783e64e903c79f9b02f1d35cb15630d35c603e/XiaomiMI8Pkg/Binary/AdcDxe/AdcDxe.efi
--------------------------------------------------------------------------------
/XiaomiMI8Pkg/Binary/AdcDxe/file.obj:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NekokeCore/edk2-dipper/40783e64e903c79f9b02f1d35cb15630d35c603e/XiaomiMI8Pkg/Binary/AdcDxe/file.obj
--------------------------------------------------------------------------------
/XiaomiMI8Pkg/Binary/AdcDxe/section2.ui:
--------------------------------------------------------------------------------
1 | A d c D x e
--------------------------------------------------------------------------------
/XiaomiMI8Pkg/Binary/ButtonsDxe/ButtonsDxe.depex:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NekokeCore/edk2-dipper/40783e64e903c79f9b02f1d35cb15630d35c603e/XiaomiMI8Pkg/Binary/ButtonsDxe/ButtonsDxe.depex
--------------------------------------------------------------------------------
/XiaomiMI8Pkg/Binary/ButtonsDxe/ButtonsDxe.efi:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NekokeCore/edk2-dipper/40783e64e903c79f9b02f1d35cb15630d35c603e/XiaomiMI8Pkg/Binary/ButtonsDxe/ButtonsDxe.efi
--------------------------------------------------------------------------------
/XiaomiMI8Pkg/Binary/ButtonsDxe/file.obj:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NekokeCore/edk2-dipper/40783e64e903c79f9b02f1d35cb15630d35c603e/XiaomiMI8Pkg/Binary/ButtonsDxe/file.obj
--------------------------------------------------------------------------------
/XiaomiMI8Pkg/Binary/ButtonsDxe/section2.ui:
--------------------------------------------------------------------------------
1 | B u t t o n s D x e
--------------------------------------------------------------------------------
/XiaomiMI8Pkg/Binary/ChipInfo/ChipInfo.depex:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NekokeCore/edk2-dipper/40783e64e903c79f9b02f1d35cb15630d35c603e/XiaomiMI8Pkg/Binary/ChipInfo/ChipInfo.depex
--------------------------------------------------------------------------------
/XiaomiMI8Pkg/Binary/ChipInfo/ChipInfo.efi:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NekokeCore/edk2-dipper/40783e64e903c79f9b02f1d35cb15630d35c603e/XiaomiMI8Pkg/Binary/ChipInfo/ChipInfo.efi
--------------------------------------------------------------------------------
/XiaomiMI8Pkg/Binary/ChipInfo/file.obj:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NekokeCore/edk2-dipper/40783e64e903c79f9b02f1d35cb15630d35c603e/XiaomiMI8Pkg/Binary/ChipInfo/file.obj
--------------------------------------------------------------------------------
/XiaomiMI8Pkg/Binary/ChipInfo/section2.ui:
--------------------------------------------------------------------------------
1 | C h i p I n f o
--------------------------------------------------------------------------------
/XiaomiMI8Pkg/Binary/ClockDxe/ClockDxe.depex:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NekokeCore/edk2-dipper/40783e64e903c79f9b02f1d35cb15630d35c603e/XiaomiMI8Pkg/Binary/ClockDxe/ClockDxe.depex
--------------------------------------------------------------------------------
/XiaomiMI8Pkg/Binary/ClockDxe/ClockDxe.efi:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NekokeCore/edk2-dipper/40783e64e903c79f9b02f1d35cb15630d35c603e/XiaomiMI8Pkg/Binary/ClockDxe/ClockDxe.efi
--------------------------------------------------------------------------------
/XiaomiMI8Pkg/Binary/ClockDxe/file.obj:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NekokeCore/edk2-dipper/40783e64e903c79f9b02f1d35cb15630d35c603e/XiaomiMI8Pkg/Binary/ClockDxe/file.obj
--------------------------------------------------------------------------------
/XiaomiMI8Pkg/Binary/ClockDxe/section2.ui:
--------------------------------------------------------------------------------
1 | C l o c k D x e
--------------------------------------------------------------------------------
/XiaomiMI8Pkg/Binary/DALTLMM/.depex:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NekokeCore/edk2-dipper/40783e64e903c79f9b02f1d35cb15630d35c603e/XiaomiMI8Pkg/Binary/DALTLMM/.depex
--------------------------------------------------------------------------------
/XiaomiMI8Pkg/Binary/DALTLMM/DALTLMM.depex:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NekokeCore/edk2-dipper/40783e64e903c79f9b02f1d35cb15630d35c603e/XiaomiMI8Pkg/Binary/DALTLMM/DALTLMM.depex
--------------------------------------------------------------------------------
/XiaomiMI8Pkg/Binary/DALTLMM/DALTLMM.efi:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NekokeCore/edk2-dipper/40783e64e903c79f9b02f1d35cb15630d35c603e/XiaomiMI8Pkg/Binary/DALTLMM/DALTLMM.efi
--------------------------------------------------------------------------------
/XiaomiMI8Pkg/Binary/DALTLMM/file.obj:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NekokeCore/edk2-dipper/40783e64e903c79f9b02f1d35cb15630d35c603e/XiaomiMI8Pkg/Binary/DALTLMM/file.obj
--------------------------------------------------------------------------------
/XiaomiMI8Pkg/Binary/DALTLMM/section2.ui:
--------------------------------------------------------------------------------
1 | D A L T L M M
--------------------------------------------------------------------------------
/XiaomiMI8Pkg/Binary/EmuVariableRuntimeDxe/EmuVariableRuntimeDxe.depex:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/XiaomiMI8Pkg/Binary/EmuVariableRuntimeDxe/EmuVariableRuntimeDxe.efi:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NekokeCore/edk2-dipper/40783e64e903c79f9b02f1d35cb15630d35c603e/XiaomiMI8Pkg/Binary/EmuVariableRuntimeDxe/EmuVariableRuntimeDxe.efi
--------------------------------------------------------------------------------
/XiaomiMI8Pkg/Binary/EmuVariableRuntimeDxe/file.obj:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NekokeCore/edk2-dipper/40783e64e903c79f9b02f1d35cb15630d35c603e/XiaomiMI8Pkg/Binary/EmuVariableRuntimeDxe/file.obj
--------------------------------------------------------------------------------
/XiaomiMI8Pkg/Binary/EmuVariableRuntimeDxe/section2.ui:
--------------------------------------------------------------------------------
1 | E m u V a r i a b l e R u n t i m e D x e
--------------------------------------------------------------------------------
/XiaomiMI8Pkg/Binary/HWIODxeDriver/HWIODxeDriver.depex:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NekokeCore/edk2-dipper/40783e64e903c79f9b02f1d35cb15630d35c603e/XiaomiMI8Pkg/Binary/HWIODxeDriver/HWIODxeDriver.depex
--------------------------------------------------------------------------------
/XiaomiMI8Pkg/Binary/HWIODxeDriver/HWIODxeDriver.efi:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NekokeCore/edk2-dipper/40783e64e903c79f9b02f1d35cb15630d35c603e/XiaomiMI8Pkg/Binary/HWIODxeDriver/HWIODxeDriver.efi
--------------------------------------------------------------------------------
/XiaomiMI8Pkg/Binary/HWIODxeDriver/file.obj:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NekokeCore/edk2-dipper/40783e64e903c79f9b02f1d35cb15630d35c603e/XiaomiMI8Pkg/Binary/HWIODxeDriver/file.obj
--------------------------------------------------------------------------------
/XiaomiMI8Pkg/Binary/HWIODxeDriver/section2.ui:
--------------------------------------------------------------------------------
1 | H W I O D x e D r i v e r
--------------------------------------------------------------------------------
/XiaomiMI8Pkg/Binary/HashDxe/HashDxe.efi:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NekokeCore/edk2-dipper/40783e64e903c79f9b02f1d35cb15630d35c603e/XiaomiMI8Pkg/Binary/HashDxe/HashDxe.efi
--------------------------------------------------------------------------------
/XiaomiMI8Pkg/Binary/HashDxe/file.obj:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NekokeCore/edk2-dipper/40783e64e903c79f9b02f1d35cb15630d35c603e/XiaomiMI8Pkg/Binary/HashDxe/file.obj
--------------------------------------------------------------------------------
/XiaomiMI8Pkg/Binary/HashDxe/section1.ui:
--------------------------------------------------------------------------------
1 | H a s h D x e
--------------------------------------------------------------------------------
/XiaomiMI8Pkg/Binary/PlatformInfoDxeDriver/PlatformInfoDxeDriver.depex:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NekokeCore/edk2-dipper/40783e64e903c79f9b02f1d35cb15630d35c603e/XiaomiMI8Pkg/Binary/PlatformInfoDxeDriver/PlatformInfoDxeDriver.depex
--------------------------------------------------------------------------------
/XiaomiMI8Pkg/Binary/PlatformInfoDxeDriver/PlatformInfoDxeDriver.efi:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NekokeCore/edk2-dipper/40783e64e903c79f9b02f1d35cb15630d35c603e/XiaomiMI8Pkg/Binary/PlatformInfoDxeDriver/PlatformInfoDxeDriver.efi
--------------------------------------------------------------------------------
/XiaomiMI8Pkg/Binary/PlatformInfoDxeDriver/file.obj:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NekokeCore/edk2-dipper/40783e64e903c79f9b02f1d35cb15630d35c603e/XiaomiMI8Pkg/Binary/PlatformInfoDxeDriver/file.obj
--------------------------------------------------------------------------------
/XiaomiMI8Pkg/Binary/PlatformInfoDxeDriver/section2.ui:
--------------------------------------------------------------------------------
1 | P l a t f o r m I n f o D x e D r i v e r
--------------------------------------------------------------------------------
/XiaomiMI8Pkg/Binary/PmicDxe/PmicDxe.depex:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NekokeCore/edk2-dipper/40783e64e903c79f9b02f1d35cb15630d35c603e/XiaomiMI8Pkg/Binary/PmicDxe/PmicDxe.depex
--------------------------------------------------------------------------------
/XiaomiMI8Pkg/Binary/PmicDxe/PmicDxe.efi:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NekokeCore/edk2-dipper/40783e64e903c79f9b02f1d35cb15630d35c603e/XiaomiMI8Pkg/Binary/PmicDxe/PmicDxe.efi
--------------------------------------------------------------------------------
/XiaomiMI8Pkg/Binary/PmicDxe/file.obj:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NekokeCore/edk2-dipper/40783e64e903c79f9b02f1d35cb15630d35c603e/XiaomiMI8Pkg/Binary/PmicDxe/file.obj
--------------------------------------------------------------------------------
/XiaomiMI8Pkg/Binary/PmicDxe/section2.ui:
--------------------------------------------------------------------------------
1 | P m i c D x e
--------------------------------------------------------------------------------
/XiaomiMI8Pkg/Binary/QcomChargerDxeLA/QcomChargerDxeLA.depex:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/XiaomiMI8Pkg/Binary/QcomChargerDxeLA/QcomChargerDxeLA.efi:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NekokeCore/edk2-dipper/40783e64e903c79f9b02f1d35cb15630d35c603e/XiaomiMI8Pkg/Binary/QcomChargerDxeLA/QcomChargerDxeLA.efi
--------------------------------------------------------------------------------
/XiaomiMI8Pkg/Binary/QcomChargerDxeLA/file.obj:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NekokeCore/edk2-dipper/40783e64e903c79f9b02f1d35cb15630d35c603e/XiaomiMI8Pkg/Binary/QcomChargerDxeLA/file.obj
--------------------------------------------------------------------------------
/XiaomiMI8Pkg/Binary/QcomChargerDxeLA/section2.ui:
--------------------------------------------------------------------------------
1 | Q c o m C h a r g e r D x e L A
--------------------------------------------------------------------------------
/XiaomiMI8Pkg/Binary/SPI/SPI.depex:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NekokeCore/edk2-dipper/40783e64e903c79f9b02f1d35cb15630d35c603e/XiaomiMI8Pkg/Binary/SPI/SPI.depex
--------------------------------------------------------------------------------
/XiaomiMI8Pkg/Binary/SPI/SPI.efi:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NekokeCore/edk2-dipper/40783e64e903c79f9b02f1d35cb15630d35c603e/XiaomiMI8Pkg/Binary/SPI/SPI.efi
--------------------------------------------------------------------------------
/XiaomiMI8Pkg/Binary/SPMI/SPMI.depex:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/XiaomiMI8Pkg/Binary/SPMI/SPMI.efi:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NekokeCore/edk2-dipper/40783e64e903c79f9b02f1d35cb15630d35c603e/XiaomiMI8Pkg/Binary/SPMI/SPMI.efi
--------------------------------------------------------------------------------
/XiaomiMI8Pkg/Binary/SPMI/file.obj:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NekokeCore/edk2-dipper/40783e64e903c79f9b02f1d35cb15630d35c603e/XiaomiMI8Pkg/Binary/SPMI/file.obj
--------------------------------------------------------------------------------
/XiaomiMI8Pkg/Binary/SPMI/section2.ui:
--------------------------------------------------------------------------------
1 | S P M I
--------------------------------------------------------------------------------
/XiaomiMI8Pkg/Binary/SdccDxe/SdccDxe.depex:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NekokeCore/edk2-dipper/40783e64e903c79f9b02f1d35cb15630d35c603e/XiaomiMI8Pkg/Binary/SdccDxe/SdccDxe.depex
--------------------------------------------------------------------------------
/XiaomiMI8Pkg/Binary/SdccDxe/SdccDxe.efi:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NekokeCore/edk2-dipper/40783e64e903c79f9b02f1d35cb15630d35c603e/XiaomiMI8Pkg/Binary/SdccDxe/SdccDxe.efi
--------------------------------------------------------------------------------
/XiaomiMI8Pkg/Binary/SdccDxe/file.obj:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NekokeCore/edk2-dipper/40783e64e903c79f9b02f1d35cb15630d35c603e/XiaomiMI8Pkg/Binary/SdccDxe/file.obj
--------------------------------------------------------------------------------
/XiaomiMI8Pkg/Binary/SdccDxe/section2.ui:
--------------------------------------------------------------------------------
1 | S d c c D x e
--------------------------------------------------------------------------------
/XiaomiMI8Pkg/Binary/SecRSADxe/SecRSADxe.efi:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NekokeCore/edk2-dipper/40783e64e903c79f9b02f1d35cb15630d35c603e/XiaomiMI8Pkg/Binary/SecRSADxe/SecRSADxe.efi
--------------------------------------------------------------------------------
/XiaomiMI8Pkg/Binary/SecRSADxe/file.obj:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NekokeCore/edk2-dipper/40783e64e903c79f9b02f1d35cb15630d35c603e/XiaomiMI8Pkg/Binary/SecRSADxe/file.obj
--------------------------------------------------------------------------------
/XiaomiMI8Pkg/Binary/SecRSADxe/section1.ui:
--------------------------------------------------------------------------------
1 | S e c R S A D x e
--------------------------------------------------------------------------------
/XiaomiMI8Pkg/Binary/SmemDxe/SmemDxe.depex:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/XiaomiMI8Pkg/Binary/SmemDxe/SmemDxe.efi:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NekokeCore/edk2-dipper/40783e64e903c79f9b02f1d35cb15630d35c603e/XiaomiMI8Pkg/Binary/SmemDxe/SmemDxe.efi
--------------------------------------------------------------------------------
/XiaomiMI8Pkg/Binary/SmemDxe/file.obj:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NekokeCore/edk2-dipper/40783e64e903c79f9b02f1d35cb15630d35c603e/XiaomiMI8Pkg/Binary/SmemDxe/file.obj
--------------------------------------------------------------------------------
/XiaomiMI8Pkg/Binary/SmemDxe/section2.ui:
--------------------------------------------------------------------------------
1 | S m e m D x e
--------------------------------------------------------------------------------
/XiaomiMI8Pkg/Binary/UFSDxe/UFSDxe.depex:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NekokeCore/edk2-dipper/40783e64e903c79f9b02f1d35cb15630d35c603e/XiaomiMI8Pkg/Binary/UFSDxe/UFSDxe.depex
--------------------------------------------------------------------------------
/XiaomiMI8Pkg/Binary/UFSDxe/UFSDxe.efi:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NekokeCore/edk2-dipper/40783e64e903c79f9b02f1d35cb15630d35c603e/XiaomiMI8Pkg/Binary/UFSDxe/UFSDxe.efi
--------------------------------------------------------------------------------
/XiaomiMI8Pkg/Binary/UFSDxe/file.obj:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NekokeCore/edk2-dipper/40783e64e903c79f9b02f1d35cb15630d35c603e/XiaomiMI8Pkg/Binary/UFSDxe/file.obj
--------------------------------------------------------------------------------
/XiaomiMI8Pkg/Binary/UFSDxe/section2.ui:
--------------------------------------------------------------------------------
1 | U F S D x e
--------------------------------------------------------------------------------
/XiaomiMI8Pkg/Binary/UsbConfigDxe/UsbConfigDxe.depex:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NekokeCore/edk2-dipper/40783e64e903c79f9b02f1d35cb15630d35c603e/XiaomiMI8Pkg/Binary/UsbConfigDxe/UsbConfigDxe.depex
--------------------------------------------------------------------------------
/XiaomiMI8Pkg/Binary/UsbConfigDxe/UsbConfigDxe.efi:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NekokeCore/edk2-dipper/40783e64e903c79f9b02f1d35cb15630d35c603e/XiaomiMI8Pkg/Binary/UsbConfigDxe/UsbConfigDxe.efi
--------------------------------------------------------------------------------
/XiaomiMI8Pkg/Binary/UsbConfigDxe/file.obj:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NekokeCore/edk2-dipper/40783e64e903c79f9b02f1d35cb15630d35c603e/XiaomiMI8Pkg/Binary/UsbConfigDxe/file.obj
--------------------------------------------------------------------------------
/XiaomiMI8Pkg/Binary/UsbConfigDxe/section2.ui:
--------------------------------------------------------------------------------
1 | U s b C o n f i g D x e
--------------------------------------------------------------------------------
/XiaomiMI8Pkg/Binary/UsbDeviceDxe/UsbDeviceDxe.depex:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/XiaomiMI8Pkg/Binary/UsbDeviceDxe/UsbDeviceDxe.efi:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NekokeCore/edk2-dipper/40783e64e903c79f9b02f1d35cb15630d35c603e/XiaomiMI8Pkg/Binary/UsbDeviceDxe/UsbDeviceDxe.efi
--------------------------------------------------------------------------------
/XiaomiMI8Pkg/Binary/UsbDeviceDxe/file.obj:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NekokeCore/edk2-dipper/40783e64e903c79f9b02f1d35cb15630d35c603e/XiaomiMI8Pkg/Binary/UsbDeviceDxe/file.obj
--------------------------------------------------------------------------------
/XiaomiMI8Pkg/Binary/UsbDeviceDxe/section2.ui:
--------------------------------------------------------------------------------
1 | U s b D e v i c e D x e
--------------------------------------------------------------------------------
/XiaomiMI8Pkg/Binary/UsbMsdDxe/UsbMsdDxe.depex:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/XiaomiMI8Pkg/Binary/UsbMsdDxe/UsbMsdDxe.efi:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NekokeCore/edk2-dipper/40783e64e903c79f9b02f1d35cb15630d35c603e/XiaomiMI8Pkg/Binary/UsbMsdDxe/UsbMsdDxe.efi
--------------------------------------------------------------------------------
/XiaomiMI8Pkg/Binary/UsbMsdDxe/file.obj:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NekokeCore/edk2-dipper/40783e64e903c79f9b02f1d35cb15630d35c603e/XiaomiMI8Pkg/Binary/UsbMsdDxe/file.obj
--------------------------------------------------------------------------------
/XiaomiMI8Pkg/Binary/UsbMsdDxe/section2.ui:
--------------------------------------------------------------------------------
1 | U s b M s d D x e
--------------------------------------------------------------------------------
/XiaomiMI8Pkg/Binary/UsbPwrCtrlDxe/UsbPwrCtrlDxe.depex:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/XiaomiMI8Pkg/Binary/UsbPwrCtrlDxe/UsbPwrCtrlDxe.efi:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NekokeCore/edk2-dipper/40783e64e903c79f9b02f1d35cb15630d35c603e/XiaomiMI8Pkg/Binary/UsbPwrCtrlDxe/UsbPwrCtrlDxe.efi
--------------------------------------------------------------------------------
/XiaomiMI8Pkg/Binary/UsbPwrCtrlDxe/file.obj:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NekokeCore/edk2-dipper/40783e64e903c79f9b02f1d35cb15630d35c603e/XiaomiMI8Pkg/Binary/UsbPwrCtrlDxe/file.obj
--------------------------------------------------------------------------------
/XiaomiMI8Pkg/Binary/UsbPwrCtrlDxe/section2.ui:
--------------------------------------------------------------------------------
1 | U s b P w r C t r l D x e
--------------------------------------------------------------------------------
/XiaomiMI8Pkg/Binary/UsbfnDwc3Dxe/UsbfnDwc3Dxe.depex:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NekokeCore/edk2-dipper/40783e64e903c79f9b02f1d35cb15630d35c603e/XiaomiMI8Pkg/Binary/UsbfnDwc3Dxe/UsbfnDwc3Dxe.depex
--------------------------------------------------------------------------------
/XiaomiMI8Pkg/Binary/UsbfnDwc3Dxe/UsbfnDwc3Dxe.efi:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NekokeCore/edk2-dipper/40783e64e903c79f9b02f1d35cb15630d35c603e/XiaomiMI8Pkg/Binary/UsbfnDwc3Dxe/UsbfnDwc3Dxe.efi
--------------------------------------------------------------------------------
/XiaomiMI8Pkg/Binary/UsbfnDwc3Dxe/file.obj:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NekokeCore/edk2-dipper/40783e64e903c79f9b02f1d35cb15630d35c603e/XiaomiMI8Pkg/Binary/UsbfnDwc3Dxe/file.obj
--------------------------------------------------------------------------------
/XiaomiMI8Pkg/Binary/UsbfnDwc3Dxe/section2.ui:
--------------------------------------------------------------------------------
1 | U s b f n D w c 3 D x e
--------------------------------------------------------------------------------
/XiaomiMI8Pkg/CommonFdf.fdf.inc:
--------------------------------------------------------------------------------
1 | #/** @file
2 | #
3 | # Copyright (c) 2016, Hisilicon Limited. All rights reserved.
4 | # Copyright (c) 2016, Linaro Limited. All rights reserved.
5 | #
6 | # This program and the accompanying materials
7 | # are licensed and made available under the terms and conditions of the BSD License
8 | # which accompanies this distribution. The full text of the license may be found at
9 | # http://opensource.org/licenses/bsd-license.php
10 | #
11 | # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
13 | #
14 | #**/
15 |
16 |
17 | ################################################################################
18 | #
19 | # Rules are use with the [FV] section's module INF type to define
20 | # how an FFS file is created for a given INF file. The following Rule are the default
21 | # rules for the different module type. User can add the customized rules to define the
22 | # content of the FFS file.
23 | #
24 | ################################################################################
25 |
26 |
27 | ############################################################################
28 | # Example of a DXE_DRIVER FFS file with a Checksum encapsulation section #
29 | ############################################################################
30 | #
31 | #[Rule.Common.DXE_DRIVER]
32 | # FILE DRIVER = $(NAMED_GUID) {
33 | # DXE_DEPEX DXE_DEPEX Optional $(INF_OUTPUT)/$(MODULE_NAME).depex
34 | # COMPRESS PI_STD {
35 | # GUIDED {
36 | # PE32 PE32 $(INF_OUTPUT)/$(MODULE_NAME).efi
37 | # UI STRING="$(MODULE_NAME)" Optional
38 | # VERSION STRING="$(INF_VERSION)" Optional BUILD_NUM=$(BUILD_NUMBER)
39 | # }
40 | # }
41 | # }
42 | #
43 | ############################################################################
44 |
45 | [Rule.Common.SEC]
46 | FILE SEC = $(NAMED_GUID) RELOCS_STRIPPED {
47 | TE TE Align = 4K $(INF_OUTPUT)/$(MODULE_NAME).efi
48 | }
49 |
50 | [Rule.Common.PEI_CORE]
51 | FILE PEI_CORE = $(NAMED_GUID) {
52 | TE TE Align = Auto $(INF_OUTPUT)/$(MODULE_NAME).efi
53 | UI STRING ="$(MODULE_NAME)" Optional
54 | }
55 |
56 | [Rule.Common.PEIM]
57 | FILE PEIM = $(NAMED_GUID) {
58 | PEI_DEPEX PEI_DEPEX Optional $(INF_OUTPUT)/$(MODULE_NAME).depex
59 | TE TE Align = Auto $(INF_OUTPUT)/$(MODULE_NAME).efi
60 | UI STRING="$(MODULE_NAME)" Optional
61 | }
62 |
63 | [Rule.Common.PEIM.BINARY]
64 | FILE PEIM = $(NAMED_GUID) {
65 | PEI_DEPEX PEI_DEPEX Optional $(INF_OUTPUT)/$(MODULE_NAME).depex
66 | TE TE Align = Auto |.efi
67 | UI STRING="$(MODULE_NAME)" Optional
68 | }
69 |
70 | [Rule.Common.PEIM.TIANOCOMPRESSED]
71 | FILE PEIM = $(NAMED_GUID) DEBUG_MYTOOLS_IA32 {
72 | PEI_DEPEX PEI_DEPEX Optional $(INF_OUTPUT)/$(MODULE_NAME).depex
73 | GUIDED A31280AD-481E-41B6-95E8-127F4C984779 PROCESSING_REQUIRED = TRUE {
74 | PE32 PE32 $(INF_OUTPUT)/$(MODULE_NAME).efi
75 | UI STRING="$(MODULE_NAME)" Optional
76 | }
77 | }
78 |
79 | [Rule.Common.PEIM.FMP_IMAGE_DESC]
80 | FILE PEIM = $(NAMED_GUID) {
81 | RAW BIN |.acpi
82 | PEI_DEPEX PEI_DEPEX Optional $(INF_OUTPUT)/$(MODULE_NAME).depex
83 | PE32 PE32 Align=4K $(INF_OUTPUT)/$(MODULE_NAME).efi
84 | UI STRING="$(MODULE_NAME)" Optional
85 | VERSION STRING="$(INF_VERSION)" Optional BUILD_NUM=$(BUILD_NUMBER)
86 | }
87 |
88 | [Rule.Common.DXE_CORE]
89 | FILE DXE_CORE = $(NAMED_GUID) {
90 | PE32 PE32 $(INF_OUTPUT)/$(MODULE_NAME).efi
91 | UI STRING="$(MODULE_NAME)" Optional
92 | }
93 |
94 | [Rule.Common.UEFI_DRIVER]
95 | FILE DRIVER = $(NAMED_GUID) {
96 | DXE_DEPEX DXE_DEPEX Optional $(INF_OUTPUT)/$(MODULE_NAME).depex
97 | PE32 PE32 $(INF_OUTPUT)/$(MODULE_NAME).efi
98 | UI STRING="$(MODULE_NAME)" Optional
99 | }
100 |
101 | [Rule.Common.DXE_DRIVER]
102 | FILE DRIVER = $(NAMED_GUID) {
103 | DXE_DEPEX DXE_DEPEX Optional $(INF_OUTPUT)/$(MODULE_NAME).depex
104 | PE32 PE32 $(INF_OUTPUT)/$(MODULE_NAME).efi
105 | UI STRING="$(MODULE_NAME)" Optional
106 | }
107 |
108 | [Rule.Common.DXE_DRIVER.BINARY]
109 | FILE DRIVER = $(NAMED_GUID) {
110 | DXE_DEPEX DXE_DEPEX Optional |.depex
111 | PE32 PE32 |.efi
112 | UI STRING="$(MODULE_NAME)" Optional
113 | }
114 |
115 | [Rule.Common.DXE_RUNTIME_DRIVER]
116 | FILE DRIVER = $(NAMED_GUID) {
117 | DXE_DEPEX DXE_DEPEX Optional $(INF_OUTPUT)/$(MODULE_NAME).depex
118 | PE32 PE32 $(INF_OUTPUT)/$(MODULE_NAME).efi
119 | UI STRING="$(MODULE_NAME)" Optional
120 | }
121 |
122 | [Rule.Common.UEFI_APPLICATION]
123 | FILE APPLICATION = $(NAMED_GUID) {
124 | UI STRING ="$(MODULE_NAME)" Optional
125 | PE32 PE32 $(INF_OUTPUT)/$(MODULE_NAME).efi
126 | }
127 |
128 | [Rule.Common.UEFI_DRIVER.BINARY]
129 | FILE DRIVER = $(NAMED_GUID) {
130 | DXE_DEPEX DXE_DEPEX Optional |.depex
131 | PE32 PE32 |.efi
132 | UI STRING="$(MODULE_NAME)" Optional
133 | VERSION STRING="$(INF_VERSION)" Optional BUILD_NUM=$(BUILD_NUMBER)
134 | }
135 |
136 | [Rule.Common.UEFI_APPLICATION.BINARY]
137 | FILE APPLICATION = $(NAMED_GUID) {
138 | PE32 PE32 |.efi
139 | UI STRING="$(MODULE_NAME)" Optional
140 | VERSION STRING="$(INF_VERSION)" Optional BUILD_NUM=$(BUILD_NUMBER)
141 | }
142 |
143 | [Rule.Common.USER_DEFINED.ACPITABLE]
144 | FILE FREEFORM = $(NAMED_GUID) {
145 | RAW ACPI |.acpi
146 | RAW ASL |.aml
147 | }
148 |
149 |
--------------------------------------------------------------------------------
/XiaomiMI8Pkg/Drivers/GenericKeypadDeviceDxe/GenericKeypadDevice.c:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 | #include
4 | #include
5 | #include
6 |
7 | typedef struct {
8 | VENDOR_DEVICE_PATH Keypad;
9 | EFI_DEVICE_PATH End;
10 | } KEYPAD_DEVICE_PATH;
11 |
12 | KEYPAD_DEVICE_PATH mInternalDevicePath = {
13 | {
14 | {
15 | HARDWARE_DEVICE_PATH,
16 | HW_VENDOR_DP,
17 | {
18 | (UINT8)(sizeof(VENDOR_DEVICE_PATH)),
19 | (UINT8)((sizeof(VENDOR_DEVICE_PATH)) >> 8),
20 | },
21 | },
22 | EFI_CALLER_ID_GUID,
23 | },
24 | {
25 | END_DEVICE_PATH_TYPE,
26 | END_ENTIRE_DEVICE_PATH_SUBTYPE,
27 | { sizeof (EFI_DEVICE_PATH_PROTOCOL), 0 }
28 | }
29 | };
30 |
31 | STATIC KEYPAD_DEVICE_PROTOCOL mInternalKeypadDevice = {
32 | KeypadDeviceImplReset,
33 | KeypadDeviceImplGetKeys,
34 | };
35 |
36 | EFI_STATUS
37 | EFIAPI
38 | KeypadDeviceDxeInitialize (
39 | IN EFI_HANDLE ImageHandle,
40 | IN EFI_SYSTEM_TABLE *SystemTable
41 | )
42 | {
43 | EFI_STATUS Status;
44 |
45 | Status = gBS->InstallMultipleProtocolInterfaces(
46 | &ImageHandle,
47 | &gEFIDroidKeypadDeviceProtocolGuid,
48 | &mInternalKeypadDevice,
49 | &gEfiDevicePathProtocolGuid,
50 | &mInternalDevicePath,
51 | NULL
52 | );
53 | ASSERT_EFI_ERROR(Status);
54 |
55 | return Status;
56 | }
57 |
--------------------------------------------------------------------------------
/XiaomiMI8Pkg/Drivers/GenericKeypadDeviceDxe/GenericKeypadDeviceDxe.inf:
--------------------------------------------------------------------------------
1 | [Defines]
2 | INF_VERSION = 0x00010005
3 | BASE_NAME = GenericKeypadDeviceDxe
4 | FILE_GUID = 39A24CF8-411E-48EB-8BEA-3ED07327F400
5 | MODULE_TYPE = DXE_DRIVER
6 | VERSION_STRING = 1.0
7 |
8 | ENTRY_POINT = KeypadDeviceDxeInitialize
9 |
10 | [Sources.common]
11 | GenericKeypadDevice.c
12 |
13 | [Packages]
14 | MdePkg/MdePkg.dec
15 | ArmPkg/ArmPkg.dec
16 | EmbeddedPkg/EmbeddedPkg.dec
17 | Lumia930Pkg/Lumia930Pkg.dec
18 |
19 | [LibraryClasses]
20 | UefiDriverEntryPoint
21 | MemoryAllocationLib
22 | KeypadDeviceImplLib
23 |
24 | [Protocols]
25 | gEFIDroidKeypadDeviceProtocolGuid
26 | gEfiDevicePathProtocolGuid
27 |
28 | [Depex]
29 | TRUE
30 |
--------------------------------------------------------------------------------
/XiaomiMI8Pkg/Drivers/KeypadDxe/KeypadController.c:
--------------------------------------------------------------------------------
1 | /** @file
2 | Routines that talk to the KeypadDevice protocol
3 |
4 | Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.
5 | This program and the accompanying materials
6 | are licensed and made available under the terms and conditions of the BSD License
7 | which accompanies this distribution. The full text of the license may be found at
8 | http://opensource.org/licenses/bsd-license.php
9 |
10 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
12 |
13 | **/
14 |
15 | #include "Keypad.h"
16 |
17 | /**
18 | Display error message.
19 |
20 | @param ConsoleIn Pointer to instance of KEYPAD_CONSOLE_IN_DEV
21 | @param ErrMsg Unicode string of error message
22 |
23 | **/
24 | VOID
25 | KeypadError (
26 | IN KEYPAD_CONSOLE_IN_DEV *ConsoleIn,
27 | IN CHAR16 *ErrMsg
28 | )
29 | {
30 | ConsoleIn->KeypadErr = TRUE;
31 | }
32 |
33 | /**
34 | Timer event handler: read a series of scancodes from 8042
35 | and put them into memory scancode buffer.
36 | it read as much scancodes to either fill
37 | the memory buffer or empty the keypad buffer.
38 | It is registered as running under TPL_NOTIFY
39 |
40 | @param Event The timer event
41 | @param Context A KEYPAD_CONSOLE_IN_DEV pointer
42 |
43 | **/
44 | VOID
45 | EFIAPI
46 | KeypadTimerHandler (
47 | IN EFI_EVENT Event,
48 | IN VOID *Context
49 | )
50 |
51 | {
52 | EFI_TPL OldTpl;
53 | KEYPAD_CONSOLE_IN_DEV *ConsoleIn;
54 |
55 | ConsoleIn = (KEYPAD_CONSOLE_IN_DEV *) Context;
56 |
57 | //
58 | // Enter critical section
59 | //
60 | OldTpl = gBS->RaiseTPL (TPL_NOTIFY);
61 |
62 | if (((KEYPAD_CONSOLE_IN_DEV *) Context)->KeypadErr) {
63 | //
64 | // Leave critical section and return
65 | //
66 | gBS->RestoreTPL (OldTpl);
67 | return ;
68 | }
69 |
70 | UINT64 CurrentCounterValue = GetPerformanceCounter();
71 | UINT64 DeltaCounter = CurrentCounterValue - ConsoleIn->Last;
72 | ConsoleIn->Last = CurrentCounterValue;
73 |
74 | ConsoleIn->KeypadDevice->GetKeys(ConsoleIn->KeypadDevice, &ConsoleIn->KeypadReturnApi, GetTimeInNanoSecond(DeltaCounter));
75 |
76 | //
77 | // Leave critical section and return
78 | //
79 | gBS->RestoreTPL (OldTpl);
80 | }
81 |
82 | /**
83 | Perform 8042 controller and keypad Initialization.
84 | If ExtendedVerification is TRUE, do additional test for
85 | the keypad interface
86 |
87 | @param ConsoleIn - KEYPAD_CONSOLE_IN_DEV instance pointer
88 | @param ExtendedVerification - indicates a thorough initialization
89 |
90 | @retval EFI_DEVICE_ERROR Fail to init keypad
91 | @retval EFI_SUCCESS Success to init keypad
92 | **/
93 | EFI_STATUS
94 | InitKeypad (
95 | IN OUT KEYPAD_CONSOLE_IN_DEV *ConsoleIn,
96 | IN BOOLEAN ExtendedVerification
97 | )
98 | {
99 | EFI_STATUS Status;
100 |
101 | Status = EFI_SUCCESS;
102 |
103 | ConsoleIn->KeypadDevice->Reset(ConsoleIn->KeypadDevice);
104 |
105 | //
106 | // Clear Memory Scancode Buffer
107 | //
108 | ConsoleIn->EfiKeyQueue.Head = 0;
109 | ConsoleIn->EfiKeyQueue.Tail = 0;
110 | ConsoleIn->EfiKeyQueueForNotify.Head = 0;
111 | ConsoleIn->EfiKeyQueueForNotify.Tail = 0;
112 |
113 | //
114 | // Reset the status indicators
115 | //
116 | ConsoleIn->CapsLock = FALSE;
117 | ConsoleIn->NumLock = FALSE;
118 | ConsoleIn->ScrollLock = FALSE;
119 | ConsoleIn->LeftCtrl = FALSE;
120 | ConsoleIn->RightCtrl = FALSE;
121 | ConsoleIn->LeftAlt = FALSE;
122 | ConsoleIn->RightAlt = FALSE;
123 | ConsoleIn->LeftShift = FALSE;
124 | ConsoleIn->RightShift = FALSE;
125 | ConsoleIn->LeftLogo = FALSE;
126 | ConsoleIn->RightLogo = FALSE;
127 | ConsoleIn->Menu = FALSE;
128 | ConsoleIn->SysReq = FALSE;
129 |
130 | ConsoleIn->IsSupportPartialKey = FALSE;
131 |
132 | if (!EFI_ERROR (Status)) {
133 | return EFI_SUCCESS;
134 | } else {
135 | return EFI_DEVICE_ERROR;
136 | }
137 |
138 | }
139 |
--------------------------------------------------------------------------------
/XiaomiMI8Pkg/Drivers/KeypadDxe/KeypadDxe.inf:
--------------------------------------------------------------------------------
1 | ## @file
2 | # Keypad Driver.
3 | #
4 | # Keypad Driver for UEFI. The keypad type implemented follows IBM
5 | # compatible PS2 protocol using Scan Code Set 1.
6 | #
7 | # Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.
8 | #
9 | # This program and the accompanying materials
10 | # are licensed and made available under the terms and conditions of the BSD License
11 | # which accompanies this distribution. The full text of the license may be found at
12 | # http://opensource.org/licenses/bsd-license.php
13 | #
14 | # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
15 | # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
16 | #
17 | #
18 | ##
19 |
20 | [Defines]
21 | INF_VERSION = 0x00010005
22 | BASE_NAME = KeypadDxe
23 | FILE_GUID = 463C9415-765B-4AE8-9B1A-AA5C6ECB2892
24 | MODULE_TYPE = UEFI_DRIVER
25 | VERSION_STRING = 1.0
26 | ENTRY_POINT = InitializeKeypad
27 |
28 | [Sources]
29 | ComponentName.c
30 | Keypad.h
31 | KeypadController.c
32 | KeypadTextIn.c
33 | Keypad.c
34 |
35 | [Packages]
36 | MdePkg/MdePkg.dec
37 | MdeModulePkg/MdeModulePkg.dec
38 | Lumia930Pkg/Lumia930Pkg.dec
39 |
40 | [LibraryClasses]
41 | MemoryAllocationLib
42 | UefiRuntimeServicesTableLib
43 | DebugLib
44 | DevicePathLib
45 | UefiBootServicesTableLib
46 | UefiLib
47 | UefiDriverEntryPoint
48 | BaseLib
49 | BaseMemoryLib
50 | TimerLib
51 | PcdLib
52 | IoLib
53 |
54 | [Protocols]
55 | gEfiSimpleTextInProtocolGuid ## BY_START
56 | gEfiSimpleTextInputExProtocolGuid ## BY_START
57 | gEFIDroidKeypadDeviceProtocolGuid
58 |
--------------------------------------------------------------------------------
/XiaomiMI8Pkg/Drivers/KeypadDxe/Source.txt:
--------------------------------------------------------------------------------
1 | URL: https://github.com/tianocore/edk2/tree/master/MdeModulePkg/Bus/Isa/Ps2KeyboardDxe
2 | BRANCH: master @ 35dadd7c54
3 |
--------------------------------------------------------------------------------
/XiaomiMI8Pkg/Drivers/LogoDxe/Logo.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NekokeCore/edk2-dipper/40783e64e903c79f9b02f1d35cb15630d35c603e/XiaomiMI8Pkg/Drivers/LogoDxe/Logo.bmp
--------------------------------------------------------------------------------
/XiaomiMI8Pkg/Drivers/LogoDxe/Logo.c:
--------------------------------------------------------------------------------
1 | /** @file
2 | Logo DXE Driver, install Edkii Platform Logo protocol.
3 |
4 | Copyright (c) 2016 - 2017, Intel Corporation. All rights reserved.
5 | This program and the accompanying materials
6 | are licensed and made available under the terms and conditions of the BSD
7 | License which accompanies this distribution. The full text of the license may
8 | be found at http://opensource.org/licenses/bsd-license.php
9 |
10 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
12 |
13 | **/
14 | #include
15 |
16 | #include
17 | #include
18 |
19 | #include
20 | #include
21 | #include
22 | #include
23 | #include
24 |
25 | typedef struct {
26 | EFI_IMAGE_ID ImageId;
27 | EDKII_PLATFORM_LOGO_DISPLAY_ATTRIBUTE Attribute;
28 | INTN OffsetX;
29 | INTN OffsetY;
30 | } LOGO_ENTRY;
31 |
32 | EFI_HII_IMAGE_EX_PROTOCOL *mHiiImageEx;
33 | EFI_HII_HANDLE mHiiHandle;
34 | LOGO_ENTRY mLogos[] = {
35 | {IMAGE_TOKEN(IMG_LOGO), EdkiiPlatformLogoDisplayAttributeCenter, 0, 0}};
36 |
37 | /**
38 | Load a platform logo image and return its data and attributes.
39 |
40 | @param This The pointer to this protocol instance.
41 | @param Instance The visible image instance is found.
42 | @param Image Points to the image.
43 | @param Attribute The display attributes of the image returned.
44 | @param OffsetX The X offset of the image regarding the Attribute.
45 | @param OffsetY The Y offset of the image regarding the Attribute.
46 |
47 | @retval EFI_SUCCESS The image was fetched successfully.
48 | @retval EFI_NOT_FOUND The specified image could not be found.
49 | **/
50 | EFI_STATUS
51 | EFIAPI
52 | GetImage(
53 | IN EDKII_PLATFORM_LOGO_PROTOCOL *This, IN OUT UINT32 *Instance,
54 | OUT EFI_IMAGE_INPUT *Image,
55 | OUT EDKII_PLATFORM_LOGO_DISPLAY_ATTRIBUTE *Attribute, OUT INTN *OffsetX,
56 | OUT INTN *OffsetY)
57 | {
58 | UINT32 Current;
59 | if (Instance == NULL || Image == NULL || Attribute == NULL ||
60 | OffsetX == NULL || OffsetY == NULL) {
61 | return EFI_INVALID_PARAMETER;
62 | }
63 |
64 | Current = *Instance;
65 | if (Current >= ARRAY_SIZE(mLogos)) {
66 | return EFI_NOT_FOUND;
67 | }
68 |
69 | (*Instance)++;
70 | *Attribute = mLogos[Current].Attribute;
71 | *OffsetX = mLogos[Current].OffsetX;
72 | *OffsetY = mLogos[Current].OffsetY;
73 | return mHiiImageEx->GetImageEx(
74 | mHiiImageEx, mHiiHandle, mLogos[Current].ImageId, Image);
75 | }
76 |
77 | EDKII_PLATFORM_LOGO_PROTOCOL mPlatformLogo = {GetImage};
78 |
79 | /**
80 | Entrypoint of this module.
81 |
82 | This function is the entrypoint of this module. It installs the Edkii
83 | Platform Logo protocol.
84 |
85 | @param ImageHandle The firmware allocated handle for the EFI image.
86 | @param SystemTable A pointer to the EFI System Table.
87 |
88 | @retval EFI_SUCCESS The entry point is executed successfully.
89 |
90 | **/
91 | EFI_STATUS
92 | EFIAPI
93 | InitializeLogo(IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
94 | {
95 | EFI_STATUS Status;
96 | EFI_HII_PACKAGE_LIST_HEADER *PackageList;
97 | EFI_HII_DATABASE_PROTOCOL * HiiDatabase;
98 | EFI_HANDLE Handle;
99 |
100 | Status = gBS->LocateProtocol(
101 | &gEfiHiiDatabaseProtocolGuid, NULL, (VOID **)&HiiDatabase);
102 | ASSERT_EFI_ERROR(Status);
103 |
104 | Status = gBS->LocateProtocol(
105 | &gEfiHiiImageExProtocolGuid, NULL, (VOID **)&mHiiImageEx);
106 | ASSERT_EFI_ERROR(Status);
107 |
108 | //
109 | // Retrieve HII package list from ImageHandle
110 | //
111 | Status = gBS->OpenProtocol(
112 | ImageHandle, &gEfiHiiPackageListProtocolGuid, (VOID **)&PackageList,
113 | ImageHandle, NULL, EFI_OPEN_PROTOCOL_GET_PROTOCOL);
114 | if (EFI_ERROR(Status)) {
115 | DEBUG((
116 | DEBUG_ERROR,
117 | "HII Image Package with logo not found in PE/COFF resource section\n"));
118 | return Status;
119 | }
120 |
121 | //
122 | // Publish HII package list to HII Database.
123 | //
124 | Status =
125 | HiiDatabase->NewPackageList(HiiDatabase, PackageList, NULL, &mHiiHandle);
126 | if (!EFI_ERROR(Status)) {
127 | Handle = NULL;
128 | Status = gBS->InstallMultipleProtocolInterfaces(
129 | &Handle, &gEdkiiPlatformLogoProtocolGuid, &mPlatformLogo, NULL);
130 | }
131 | return Status;
132 | }
133 |
--------------------------------------------------------------------------------
/XiaomiMI8Pkg/Drivers/LogoDxe/Logo.idf:
--------------------------------------------------------------------------------
1 | // /** @file
2 | // Platform Logo image definition file.
3 | //
4 | // Copyright (c) 2016 - 2018, Intel Corporation. All rights reserved.
5 | //
6 | // This program and the accompanying materials
7 | // are licensed and made available under the terms and conditions of the BSD License
8 | // which accompanies this distribution. The full text of the license may be found at
9 | // http://opensource.org/licenses/bsd-license.php
10 | // THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
12 | //
13 | // **/
14 |
15 | #image IMG_LOGO Logo.bmp
16 |
--------------------------------------------------------------------------------
/XiaomiMI8Pkg/Drivers/LogoDxe/Logo.inf:
--------------------------------------------------------------------------------
1 | ## @file
2 | # The default logo bitmap picture shown on setup screen, which is corresponding to gEfiDefaultBmpLogoGuid.
3 | #
4 | # Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.
5 | #
6 | # This program and the accompanying materials
7 | # are licensed and made available under the terms and conditions of the BSD License
8 | # which accompanies this distribution. The full text of the license may be found at
9 | # http://opensource.org/licenses/bsd-license.php
10 | # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
12 | #
13 | #
14 | ##
15 |
16 | [Defines]
17 | INF_VERSION = 0x00010005
18 | BASE_NAME = Logo
19 | MODULE_UNI_FILE = Logo.uni
20 | FILE_GUID = 7BB28B99-61BB-11D5-9A5D-0090273FC14D
21 | MODULE_TYPE = USER_DEFINED
22 | VERSION_STRING = 1.0
23 |
24 | #
25 | # The following information is for reference only and not required by the build tools.
26 | #
27 | # VALID_ARCHITECTURES = IA32 X64 IPF EBC ARM AARCH64
28 | #
29 |
30 | [Binaries]
31 | BIN|Logo.bmp|*
32 |
33 | [UserExtensions.TianoCore."ExtraFiles"]
34 | LogoExtra.uni
35 |
--------------------------------------------------------------------------------
/XiaomiMI8Pkg/Drivers/LogoDxe/Logo.uni:
--------------------------------------------------------------------------------
1 | // /** @file
2 | // The default logo bitmap picture shown on setup screen, which is corresponding to gEfiDefaultBmpLogoGuid.
3 | //
4 | // This module provides the default logo bitmap picture shown on setup screen, which corresponds to gEfiDefaultBmpLogoGuid.
5 | //
6 | // Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.
7 | //
8 | // This program and the accompanying materials
9 | // are licensed and made available under the terms and conditions of the BSD License
10 | // which accompanies this distribution. The full text of the license may be found at
11 | // http://opensource.org/licenses/bsd-license.php
12 | // THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
13 | // WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
14 | //
15 | // **/
16 |
17 |
18 | #string STR_MODULE_ABSTRACT #language en-US "Provides the default logo bitmap picture shown on setup screen, which corresponds to gEfiDefaultBmpLogoGuid"
19 |
20 | #string STR_MODULE_DESCRIPTION #language en-US "This module provides the default logo bitmap picture shown on setup screen, which corresponds to gEfiDefaultBmpLogoGuid."
21 |
22 |
--------------------------------------------------------------------------------
/XiaomiMI8Pkg/Drivers/LogoDxe/LogoDxe.inf:
--------------------------------------------------------------------------------
1 | ## @file
2 | # The default logo bitmap picture shown on setup screen.
3 | #
4 | # Copyright (c) 2016 - 2017, Intel Corporation. All rights reserved.
5 | #
6 | # This program and the accompanying materials
7 | # are licensed and made available under the terms and conditions of the BSD License
8 | # which accompanies this distribution. The full text of the license may be found at
9 | # http://opensource.org/licenses/bsd-license.php
10 | # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
12 | #
13 | #
14 | ##
15 |
16 | [Defines]
17 | INF_VERSION = 0x00010005
18 | BASE_NAME = LogoDxe
19 | MODULE_UNI_FILE = LogoDxe.uni
20 | FILE_GUID = F74D20EE-37E7-48FC-97F7-9B1047749C69
21 | MODULE_TYPE = DXE_DRIVER
22 | VERSION_STRING = 1.0
23 |
24 | ENTRY_POINT = InitializeLogo
25 | #
26 | # This flag specifies whether HII resource section is generated into PE image.
27 | #
28 | UEFI_HII_RESOURCE_SECTION = TRUE
29 |
30 | #
31 | # The following information is for reference only and not required by the build tools.
32 | #
33 | # VALID_ARCHITECTURES = IA32 X64
34 | #
35 |
36 | [Sources]
37 | Logo.bmp
38 | Logo.c
39 | Logo.idf
40 |
41 | [Packages]
42 | MdeModulePkg/MdeModulePkg.dec
43 | MdePkg/MdePkg.dec
44 |
45 | [LibraryClasses]
46 | UefiBootServicesTableLib
47 | UefiDriverEntryPoint
48 | DebugLib
49 |
50 | [Protocols]
51 | gEfiHiiDatabaseProtocolGuid ## CONSUMES
52 | gEfiHiiImageExProtocolGuid ## CONSUMES
53 | gEfiHiiPackageListProtocolGuid ## PRODUCES CONSUMES
54 | gEdkiiPlatformLogoProtocolGuid ## PRODUCES
55 |
56 | [Depex]
57 | gEfiHiiDatabaseProtocolGuid AND
58 | gEfiHiiImageExProtocolGuid
59 |
60 | [UserExtensions.TianoCore."ExtraFiles"]
61 | LogoDxeExtra.uni
62 |
--------------------------------------------------------------------------------
/XiaomiMI8Pkg/Drivers/LogoDxe/LogoDxe.uni:
--------------------------------------------------------------------------------
1 | // /** @file
2 | // The default logo bitmap picture shown on setup screen.
3 | //
4 | // This module provides the default logo bitmap picture shown on setup screen, through EDKII Platform Logo protocol.
5 | //
6 | // Copyright (c) 2016, Intel Corporation. All rights reserved.
7 | //
8 | // This program and the accompanying materials
9 | // are licensed and made available under the terms and conditions of the BSD License
10 | // which accompanies this distribution. The full text of the license may be found at
11 | // http://opensource.org/licenses/bsd-license.php
12 | // THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
13 | // WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
14 | //
15 | // **/
16 |
17 |
18 | #string STR_MODULE_ABSTRACT #language en-US "Little Moe LLC Logo"
19 |
20 | #string STR_MODULE_DESCRIPTION #language en-US "This module provides the default logo bitmap picture shown on setup screen, through EDKII Platform Logo protocol."
21 |
22 |
--------------------------------------------------------------------------------
/XiaomiMI8Pkg/Drivers/LogoDxe/LogoDxeExtra.uni:
--------------------------------------------------------------------------------
1 | // /** @file
2 | // Logo Localized Strings and Content
3 | //
4 | // Copyright (c) 2016, Intel Corporation. All rights reserved.
5 | //
6 | // This program and the accompanying materials
7 | // are licensed and made available under the terms and conditions of the BSD License
8 | // which accompanies this distribution. The full text of the license may be found at
9 | // http://opensource.org/licenses/bsd-license.php
10 | // THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
12 | //
13 | // **/
14 |
15 | #string STR_PROPERTIES_MODULE_NAME
16 | #language en-US
17 | "Logo Image File"
18 |
19 |
20 |
--------------------------------------------------------------------------------
/XiaomiMI8Pkg/Drivers/LogoDxe/LogoExtra.uni:
--------------------------------------------------------------------------------
1 | // /** @file
2 | // Logo Localized Strings and Content
3 | //
4 | // Copyright (c) 2013 - 2014, Intel Corporation. All rights reserved.
5 | //
6 | // This program and the accompanying materials
7 | // are licensed and made available under the terms and conditions of the BSD License
8 | // which accompanies this distribution. The full text of the license may be found at
9 | // http://opensource.org/licenses/bsd-license.php
10 | // THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
12 | //
13 | // **/
14 |
15 | #string STR_PROPERTIES_MODULE_NAME
16 | #language en-US
17 | "Logo Image File"
18 |
19 |
20 |
--------------------------------------------------------------------------------
/XiaomiMI8Pkg/Drivers/SmbiosPlatformDxe/SmbiosPlatformDxe.inf:
--------------------------------------------------------------------------------
1 | ## @file
2 | # This driver installs SMBIOS information for ArmJuno
3 | #
4 | # Copyright (c) 2011, Bei Guan
5 | # Copyright (c) 2011, Intel Corporation. All rights reserved.
6 | # Copyright (c) 2015, ARM Limited. All rights reserved.
7 | #
8 | # This program and the accompanying materials
9 | # are licensed and made available under the terms and conditions of the BSD License
10 | # which accompanies this distribution. The full text of the license may be found at
11 | # http://opensource.org/licenses/bsd-license.php
12 | # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
13 | # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
14 | #
15 | ##
16 |
17 | [Defines]
18 | INF_VERSION = 0x00010005
19 | BASE_NAME = SmbiosPlatformDxe
20 | FILE_GUID = B736DF5D-59ED-48C0-AC10-1EEE228D085B
21 | MODULE_TYPE = DXE_DRIVER
22 | VERSION_STRING = 1.0
23 |
24 | ENTRY_POINT = SmbiosTablePublishEntry
25 |
26 | #
27 | # The following information is for reference only and not required by the build tools.
28 | #
29 | # VALID_ARCHITECTURES = AARCH64
30 | #
31 |
32 | [Sources]
33 | SmbiosPlatformDxe.c
34 |
35 | [Packages]
36 | ArmPkg/ArmPkg.dec
37 | ArmPlatformPkg/ArmPlatformPkg.dec
38 | MdeModulePkg/MdeModulePkg.dec
39 | MdePkg/MdePkg.dec
40 | XiaomiMI8Pkg/XiaomiMI8Pkg.dec
41 |
42 | [LibraryClasses]
43 | ArmLib
44 | BaseMemoryLib
45 | BaseLib
46 | DebugLib
47 | HobLib
48 | IoLib
49 | MemoryAllocationLib
50 | PcdLib
51 | UefiBootServicesTableLib
52 | UefiDriverEntryPoint
53 |
54 | [Guids]
55 | gEfiGlobalVariableGuid
56 |
57 | [FixedPcd]
58 | gArmTokenSpaceGuid.PcdSystemMemoryBase
59 | gArmTokenSpaceGuid.PcdSystemMemorySize
60 | gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareRevision
61 |
62 | [Protocols]
63 | gEfiSmbiosProtocolGuid # PROTOCOL ALWAYS_CONSUMED
64 |
65 | [Guids]
66 |
67 | [Depex]
68 | gEfiSmbiosProtocolGuid
69 |
--------------------------------------------------------------------------------
/XiaomiMI8Pkg/Include/ArmPlatform.h:
--------------------------------------------------------------------------------
1 | /** @file
2 | *
3 | * Copyright (c) 2013-2017, ARM Limited. All rights reserved.
4 | *
5 | * This program and the accompanying materials
6 | * are licensed and made available under the terms and conditions of the BSD License
7 | * which accompanies this distribution. The full text of the license may be found at
8 | * http://opensource.org/licenses/bsd-license.php
9 | *
10 | * THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 | * WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
12 | *
13 | **/
14 |
15 | #ifndef __ARM_JUNO_H__
16 | #define __ARM_JUNO_H__
17 |
18 | //#include
19 |
20 | /***********************************************************************************
21 | // Platform Memory Map
22 | ************************************************************************************/
23 |
24 | // Motherboard Peripheral and On-chip peripheral
25 |
26 | //
27 | // ACPI table information used to initialize tables.
28 | //
29 | #define EFI_ACPI_ARM_OEM_ID 'A','R','M','L','T','D' // OEMID 6 bytes long
30 | #define EFI_ACPI_ARM_OEM_TABLE_ID SIGNATURE_64('A','R','M','-','J','U','N','O') // OEM table id 8 bytes long
31 | #define EFI_ACPI_ARM_OEM_REVISION 0x20140727
32 | #define EFI_ACPI_ARM_CREATOR_ID SIGNATURE_32('A','R','M',' ')
33 | #define EFI_ACPI_ARM_CREATOR_REVISION 0x00000099
34 |
35 | // A macro to initialise the common header part of EFI ACPI tables as defined by
36 | // EFI_ACPI_DESCRIPTION_HEADER structure.
37 | #define ARM_ACPI_HEADER(Signature, Type, Revision) { \
38 | Signature, /* UINT32 Signature */ \
39 | sizeof (Type), /* UINT32 Length */ \
40 | Revision, /* UINT8 Revision */ \
41 | 0, /* UINT8 Checksum */ \
42 | { EFI_ACPI_ARM_OEM_ID }, /* UINT8 OemId[6] */ \
43 | EFI_ACPI_ARM_OEM_TABLE_ID, /* UINT64 OemTableId */ \
44 | EFI_ACPI_ARM_OEM_REVISION, /* UINT32 OemRevision */ \
45 | EFI_ACPI_ARM_CREATOR_ID, /* UINT32 CreatorId */ \
46 | EFI_ACPI_ARM_CREATOR_REVISION /* UINT32 CreatorRevision */ \
47 | }
48 |
49 | //
50 | // Hardware platform identifiers
51 | //
52 | #define JUNO_REVISION_PROTOTYPE 0
53 | #define JUNO_REVISION_R0 1
54 | #define JUNO_REVISION_R1 2
55 | #define JUNO_REVISION_R2 3
56 | #define JUNO_REVISION_UKNOWN 0xFF
57 |
58 | // Define if the exported ACPI Tables are based on ACPI 5.0 spec or latest
59 | //#define ARM_JUNO_ACPI_5_0
60 |
61 | //
62 | // Address of the system registers that contain the MAC address
63 | // assigned to the PCI Gigabyte Ethernet device.
64 | //
65 |
66 | /***********************************************************************************
67 | // Motherboard memory-mapped peripherals
68 | ************************************************************************************/
69 |
70 | // Define MotherBoard SYS flags offsets (from ARM_VE_BOARD_PERIPH_BASE)
71 | //
72 | // Sites where the peripheral is fitted
73 | //
74 | #endif
75 |
--------------------------------------------------------------------------------
/XiaomiMI8Pkg/Include/Configuration/BootDevices.h:
--------------------------------------------------------------------------------
1 | #ifndef _BOOT_DEVICES_H_
2 | #define _BOOT_DEVICES_H_
3 |
4 | #include
5 | #include
6 |
7 | #define PLAT_KEYPAD_DEVICE_GUID \
8 | { \
9 | 0xD7F58A0E, 0xBED2, 0x4B5A, \
10 | { \
11 | 0xBB, 0x43, 0x8A, 0xB2, 0x3D, 0xD0, 0xE2, 0xB0 \
12 | } \
13 | }
14 |
15 | /* DevicePath definition for Button driver */
16 | #pragma pack(1)
17 | typedef struct {
18 | VENDOR_DEVICE_PATH VendorDevicePath;
19 | EFI_DEVICE_PATH_PROTOCOL End;
20 | } EFI_KEYPAD_DEVICE_PATH;
21 | #pragma pack()
22 |
23 | EFI_KEYPAD_DEVICE_PATH KeyPadDxeDevicePath = {
24 | {{HARDWARE_DEVICE_PATH,
25 | HW_VENDOR_DP,
26 | {(UINT8)(sizeof(VENDOR_DEVICE_PATH)),
27 | (UINT8)((sizeof(VENDOR_DEVICE_PATH)) >> 8)}},
28 | PLAT_KEYPAD_DEVICE_GUID},
29 | {END_DEVICE_PATH_TYPE,
30 | END_ENTIRE_DEVICE_PATH_SUBTYPE,
31 | {(UINT8)(END_DEVICE_PATH_LENGTH),
32 | (UINT8)((END_DEVICE_PATH_LENGTH) >> 8)}}};
33 |
34 | #endif
--------------------------------------------------------------------------------
/XiaomiMI8Pkg/Include/Configuration/Hob.h:
--------------------------------------------------------------------------------
1 | #ifndef __LOCAL_HOB_H__
2 | #define __LOCAL_HOB_H__
3 |
4 | #define PRELOADER_ENV_ADDR 0xb0000000
5 | #define PRELOADER_VERSION_MIN 0x1000
6 |
7 | #define PRELOADER_HEADER SIGNATURE_32('B', 'S', 'E', 'N')
8 |
9 | typedef struct _PRELOADER_ENVIRONMENT {
10 | UINT32 Header;
11 | UINT32 PreloaderVersion;
12 | CHAR8 PreloaderRelease[64];
13 | EFI_TIME BootTimeEpoch;
14 | UINT32 UefiDisplayInfo[30];
15 | UINT32 Crc32;
16 | } PRELOADER_ENVIRONMENT, *PPRELOADER_ENVIRONMENT;
17 |
18 | #endif
--------------------------------------------------------------------------------
/XiaomiMI8Pkg/Include/Library/FrameBufferSerialPortLib.h:
--------------------------------------------------------------------------------
1 | #ifndef _FRAMEBUFFER_SERIALPORT_LIB_H_
2 | #define _FRAMEBUFFER_SERIALPORT_LIB_H_
3 |
4 | typedef struct _FBCON_POSITION {
5 | INTN x;
6 | INTN y;
7 | } FBCON_POSITION, *PFBCON_POSITION;
8 |
9 | typedef struct _FBCON_COLOR {
10 | UINTN Foreground;
11 | UINTN Background;
12 | } FBCON_COLOR, *PFBCON_COLOR;
13 |
14 | enum FbConMsgType {
15 | /* type for menu */
16 | FBCON_COMMON_MSG = 0,
17 | FBCON_UNLOCK_TITLE_MSG,
18 | FBCON_TITLE_MSG,
19 | FBCON_SUBTITLE_MSG,
20 |
21 | /* type for warning */
22 | FBCON_YELLOW_MSG,
23 | FBCON_ORANGE_MSG,
24 | FBCON_RED_MSG,
25 | FBCON_GREEN_MSG,
26 |
27 | /* and the select message's background */
28 | FBCON_SELECT_MSG_BG_COLOR,
29 | };
30 |
31 | void ResetFb(void);
32 |
33 | UINTN
34 | EFIAPI
35 | SerialPortWriteCritical
36 | (
37 | IN UINT8 *Buffer,
38 | IN UINTN NumberOfBytes
39 | );
40 |
41 | #endif
42 |
--------------------------------------------------------------------------------
/XiaomiMI8Pkg/Include/Resources/FbColor.h:
--------------------------------------------------------------------------------
1 | #ifndef _FB_COLOR_H_
2 | #define _FB_COLOR_H_
3 |
4 | #define FB_BGRA8888_BLACK 0xff000000
5 | #define FB_BGRA8888_WHITE 0xffffffff
6 | #define FB_BGRA8888_CYAN 0xff00ffff
7 | #define FB_BGRA8888_BLUE 0xff0000ff
8 | #define FB_BGRA8888_SILVER 0xffc0c0c0
9 | #define FB_BGRA8888_YELLOW 0xffffff00
10 | #define FB_BGRA8888_ORANGE 0xffffa500
11 | #define FB_BGRA8888_RED 0xffff0000
12 | #define FB_BGRA8888_GREEN 0xff00ff00
13 |
14 | #endif
--------------------------------------------------------------------------------
/XiaomiMI8Pkg/Include/Resources/font5x12.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2008 The Android Open Source Project
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions
7 | * are met:
8 | * * Redistributions of source code must retain the above copyright
9 | * notice, this list of conditions and the following disclaimer.
10 | * * Redistributions in binary form must reproduce the above copyright
11 | * notice, this list of conditions and the following disclaimer in
12 | * the documentation and/or other materials provided with the
13 | * distribution.
14 | *
15 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
16 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
17 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
18 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
19 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
20 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
21 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
22 | * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
23 | * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
24 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
25 | * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26 | * SUCH DAMAGE.
27 | */
28 |
29 | #ifndef _FONT_5x12_DATA_
30 | #define _FONT_5x12_DATA_
31 |
32 | #define FONT_WIDTH 5
33 | #define FONT_HEIGHT 12
34 |
35 | #define SCALE_FACTOR 2
36 |
37 | unsigned font5x12[] = {
38 | 0x00000000, 0x00000000,
39 | 0x08421080, 0x00020084,
40 | 0x00052940, 0x00000000,
41 | 0x15f52800, 0x0000295f,
42 | 0x1c52f880, 0x00023e94,
43 | 0x08855640, 0x0004d542,
44 | 0x04528800, 0x000b2725,
45 | 0x00021080, 0x00000000,
46 | 0x04211088, 0x00821042,
47 | 0x10841082, 0x00221108,
48 | 0x09575480, 0x00000000,
49 | 0x3e420000, 0x00000084,
50 | 0x00000000, 0x00223000,
51 | 0x3e000000, 0x00000000,
52 | 0x00000000, 0x00471000,
53 | 0x08844200, 0x00008442,
54 | 0x2318a880, 0x00022a31,
55 | 0x08429880, 0x000f9084,
56 | 0x1108c5c0, 0x000f8444,
57 | 0x1c4443e0, 0x00074610,
58 | 0x14a62100, 0x000423e9,
59 | 0x26d087e0, 0x00074610,
60 | 0x1e10c5c0, 0x00074631,
61 | 0x088443e0, 0x00010844,
62 | 0x1d18c5c0, 0x00074631,
63 | 0x3d18c5c0, 0x00074610,
64 | 0x08e20000, 0x00471000,
65 | 0x08e20000, 0x00223000,
66 | 0x02222200, 0x00082082,
67 | 0x01f00000, 0x000003e0,
68 | 0x20820820, 0x00008888,
69 | 0x1108c5c0, 0x00020084,
70 | 0x2b98c5c0, 0x000f05b5,
71 | 0x2318a880, 0x0008c63f,
72 | 0x1d2949e0, 0x0007ca52,
73 | 0x0210c5c0, 0x00074421,
74 | 0x252949e0, 0x0007ca52,
75 | 0x1e1087e0, 0x000f8421,
76 | 0x1e1087e0, 0x00008421,
77 | 0x0210c5c0, 0x00074639,
78 | 0x3f18c620, 0x0008c631,
79 | 0x084211c0, 0x00071084,
80 | 0x10842380, 0x00032508,
81 | 0x0654c620, 0x0008c525,
82 | 0x02108420, 0x000f8421,
83 | 0x2b5dc620, 0x0008c631,
84 | 0x2b59ce20, 0x0008c739,
85 | 0x2318c5c0, 0x00074631,
86 | 0x1f18c5e0, 0x00008421,
87 | 0x2318c5c0, 0x01075631,
88 | 0x1f18c5e0, 0x0008c525,
89 | 0x1c10c5c0, 0x00074610,
90 | 0x084213e0, 0x00021084,
91 | 0x2318c620, 0x00074631,
92 | 0x1518c620, 0x0002114a,
93 | 0x2b18c620, 0x000556b5,
94 | 0x08a54620, 0x0008c54a,
95 | 0x08a54620, 0x00021084,
96 | 0x088443e0, 0x000f8442,
97 | 0x0421084e, 0x00e10842,
98 | 0x08210420, 0x00084108,
99 | 0x1084210e, 0x00e42108,
100 | 0x0008a880, 0x00000000,
101 | 0x00000000, 0x01f00000,
102 | 0x00000104, 0x00000000,
103 | 0x20e00000, 0x000b663e,
104 | 0x22f08420, 0x0007c631,
105 | 0x22e00000, 0x00074421,
106 | 0x23e84200, 0x000f4631,
107 | 0x22e00000, 0x0007443f,
108 | 0x1e214980, 0x00010842,
109 | 0x22e00000, 0x1d187a31,
110 | 0x26d08420, 0x0008c631,
111 | 0x08601000, 0x00071084,
112 | 0x10c02000, 0x0c94a108,
113 | 0x0a908420, 0x0008a4a3,
114 | 0x084210c0, 0x00071084,
115 | 0x2ab00000, 0x0008d6b5,
116 | 0x26d00000, 0x0008c631,
117 | 0x22e00000, 0x00074631,
118 | 0x22f00000, 0x0210be31,
119 | 0x23e00000, 0x21087a31,
120 | 0x26d00000, 0x00008421,
121 | 0x22e00000, 0x00074506,
122 | 0x04f10800, 0x00064842,
123 | 0x23100000, 0x000b6631,
124 | 0x23100000, 0x00022951,
125 | 0x23100000, 0x000556b5,
126 | 0x15100000, 0x0008a884,
127 | 0x23100000, 0x1d185b31,
128 | 0x11f00000, 0x000f8444,
129 | 0x06421098, 0x01821084,
130 | 0x08421080, 0x00021084,
131 | 0x30421083, 0x00321084,
132 | 0x0004d640, 0x00000000,
133 | 0x00000000, 0x00000000,
134 | };
135 |
136 | #endif
137 |
--------------------------------------------------------------------------------
/XiaomiMI8Pkg/Library/FrameBufferSerialPortLib/FrameBufferSerialPortLib.c:
--------------------------------------------------------------------------------
1 | #include
2 |
3 | #include
4 | #include
5 | #include
6 | #include
7 |
8 | #include
9 | #include
10 |
11 | #include "FrameBufferSerialPortLib.h"
12 |
13 | FBCON_POSITION m_Position;
14 | FBCON_POSITION m_MaxPosition;
15 | FBCON_COLOR m_Color;
16 | BOOLEAN m_Initialized = FALSE;
17 |
18 | UINTN gWidth = FixedPcdGet32(PcdMipiFrameBufferWidth);
19 | // Reserve half screen for output
20 | UINTN gHeight = FixedPcdGet32(PcdMipiFrameBufferHeight);
21 | UINTN gBpp = FixedPcdGet32(PcdMipiFrameBufferPixelBpp);
22 |
23 | // Module-used internal routine
24 | void FbConPutCharWithFactor
25 | (
26 | char c,
27 | int type,
28 | unsigned scale_factor
29 | );
30 |
31 | void FbConDrawglyph
32 | (
33 | char *pixels,
34 | unsigned stride,
35 | unsigned bpp,
36 | unsigned *glyph,
37 | unsigned scale_factor
38 | );
39 |
40 | void FbConReset(void);
41 | void FbConScrollUp(void);
42 | void FbConFlush(void);
43 |
44 | RETURN_STATUS
45 | EFIAPI
46 | SerialPortInitialize
47 | (
48 | VOID
49 | )
50 | {
51 | UINTN InterruptState = 0;
52 |
53 | // Prevent dup initialization
54 | if (m_Initialized) return RETURN_SUCCESS;
55 |
56 | // Interrupt Disable
57 | InterruptState = ArmGetInterruptState();
58 | ArmDisableInterrupts();
59 |
60 | // Reset console
61 | FbConReset();
62 |
63 | // Set flag
64 | m_Initialized = TRUE;
65 |
66 | if (InterruptState) ArmEnableInterrupts();
67 | return RETURN_SUCCESS;
68 | }
69 |
70 | void ResetFb(void)
71 | {
72 | // Clear current screen.
73 | char* Pixels = (void*)FixedPcdGet32(PcdMipiFrameBufferAddress);
74 | UINTN BgColor = FB_BGRA8888_BLACK;
75 |
76 | // Set to black color.
77 | for (UINTN i = 0; i < gWidth; i++)
78 | {
79 | for (UINTN j = 0; j < gHeight; j++)
80 | {
81 | BgColor = FB_BGRA8888_BLACK;
82 | // Set pixel bit
83 | for (UINTN p = 0; p < (gBpp / 8); p++)
84 | {
85 | *Pixels = (unsigned char)BgColor;
86 | BgColor = BgColor >> 8;
87 | Pixels++;
88 | }
89 | }
90 | }
91 | }
92 |
93 | void FbConReset(void)
94 | {
95 | // Reset position.
96 | m_Position.x = 0;
97 | m_Position.y = 0;
98 |
99 | // Calc max position.
100 | m_MaxPosition.x = gWidth / (FONT_WIDTH + 1);
101 | m_MaxPosition.y = (gHeight - 1) / FONT_HEIGHT;
102 |
103 | // Reset color.
104 | m_Color.Foreground = FB_BGRA8888_WHITE;
105 | m_Color.Background = FB_BGRA8888_BLACK;
106 | }
107 |
108 | void FbConPutCharWithFactor
109 | (
110 | char c,
111 | int type,
112 | unsigned scale_factor
113 | )
114 | {
115 | char* Pixels;
116 |
117 | if (!m_Initialized) return;
118 |
119 | paint:
120 |
121 | if ((unsigned char)c > 127) return;
122 |
123 | if ((unsigned char)c < 32)
124 | {
125 | if (c == '\n')
126 | {
127 | goto newline;
128 | }
129 | else if (c == '\r')
130 | {
131 | m_Position.x = 0;
132 | return;
133 | }
134 | else
135 | {
136 | return;
137 | }
138 | }
139 |
140 | // Save some space
141 | if (m_Position.x == 0 && (unsigned char)c == ' ' &&
142 | type != FBCON_SUBTITLE_MSG &&
143 | type != FBCON_TITLE_MSG)
144 | return;
145 |
146 | BOOLEAN intstate = ArmGetInterruptState();
147 | ArmDisableInterrupts();
148 |
149 | Pixels = (void*)FixedPcdGet32(PcdMipiFrameBufferAddress);
150 | Pixels += m_Position.y * ((gBpp / 8) * FONT_HEIGHT * gWidth);
151 | Pixels += m_Position.x * scale_factor * ((gBpp / 8) * (FONT_WIDTH + 1));
152 |
153 | FbConDrawglyph(
154 | Pixels,
155 | gWidth,
156 | (gBpp / 8),
157 | font5x12 + (c - 32) * 2,
158 | scale_factor);
159 |
160 | m_Position.x++;
161 |
162 | if (m_Position.x >= (int)(m_MaxPosition.x / scale_factor)) goto newline;
163 |
164 | if (intstate) ArmEnableInterrupts();
165 | return;
166 |
167 | newline:
168 | m_Position.y += scale_factor;
169 | m_Position.x = 0;
170 | if (m_Position.y >= m_MaxPosition.y - scale_factor)
171 | {
172 | ResetFb();
173 | FbConFlush();
174 | m_Position.y = 0;
175 |
176 | if (intstate) ArmEnableInterrupts();
177 | goto paint;
178 | }
179 | else
180 | {
181 | FbConFlush();
182 | if (intstate) ArmEnableInterrupts();
183 | }
184 |
185 | }
186 |
187 | void FbConDrawglyph
188 | (
189 | char *pixels,
190 | unsigned stride,
191 | unsigned bpp,
192 | unsigned *glyph,
193 | unsigned scale_factor
194 | )
195 | {
196 | char *bg_pixels = pixels;
197 | unsigned x, y, i, j, k;
198 | unsigned data, temp;
199 | unsigned int fg_color = m_Color.Foreground;
200 | unsigned int bg_color = m_Color.Background;
201 | stride -= FONT_WIDTH * scale_factor;
202 |
203 | for (y = 0; y < FONT_HEIGHT / 2; ++y)
204 | {
205 | for (i = 0; i < scale_factor; i++)
206 | {
207 | for (x = 0; x < FONT_WIDTH; ++x)
208 | {
209 | for (j = 0; j < scale_factor; j++)
210 | {
211 | bg_color = m_Color.Background;
212 | for (k = 0; k < bpp; k++)
213 | {
214 | *bg_pixels = (unsigned char)bg_color;
215 | bg_color = bg_color >> 8;
216 | bg_pixels++;
217 | }
218 | }
219 | }
220 | bg_pixels += (stride * bpp);
221 | }
222 | }
223 |
224 | for (y = 0; y < FONT_HEIGHT / 2; ++y)
225 | {
226 | for (i = 0; i < scale_factor; i++)
227 | {
228 | for (x = 0; x < FONT_WIDTH; ++x)
229 | {
230 | for (j = 0; j < scale_factor; j++)
231 | {
232 | bg_color = m_Color.Background;
233 | for (k = 0; k < bpp; k++)
234 | {
235 | *bg_pixels = (unsigned char)bg_color;
236 | bg_color = bg_color >> 8;
237 | bg_pixels++;
238 | }
239 | }
240 | }
241 | bg_pixels += (stride * bpp);
242 | }
243 | }
244 |
245 | data = glyph[0];
246 | for (y = 0; y < FONT_HEIGHT / 2; ++y)
247 | {
248 | temp = data;
249 | for (i = 0; i < scale_factor; i++)
250 | {
251 | data = temp;
252 | for (x = 0; x < FONT_WIDTH; ++x)
253 | {
254 | if (data & 1)
255 | {
256 | for (j = 0; j < scale_factor; j++)
257 | {
258 | fg_color = m_Color.Foreground;
259 | for (k = 0; k < bpp; k++)
260 | {
261 | *pixels = (unsigned char)fg_color;
262 | fg_color = fg_color >> 8;
263 | pixels++;
264 | }
265 | }
266 | }
267 | else
268 | {
269 | for (j = 0; j < scale_factor; j++)
270 | {
271 | pixels = pixels + bpp;
272 | }
273 | }
274 | data >>= 1;
275 | }
276 | pixels += (stride * bpp);
277 | }
278 | }
279 |
280 | data = glyph[1];
281 | for (y = 0; y < FONT_HEIGHT / 2; ++y)
282 | {
283 | temp = data;
284 | for (i = 0; i < scale_factor; i++)
285 | {
286 | data = temp;
287 | for (x = 0; x < FONT_WIDTH; ++x)
288 | {
289 | if (data & 1)
290 | {
291 | for (j = 0; j < scale_factor; j++)
292 | {
293 | fg_color = m_Color.Foreground;
294 | for (k = 0; k < bpp; k++)
295 | {
296 | *pixels = (unsigned char)fg_color;
297 | fg_color = fg_color >> 8;
298 | pixels++;
299 | }
300 | }
301 | }
302 | else
303 | {
304 | for (j = 0; j < scale_factor; j++)
305 | {
306 | pixels = pixels + bpp;
307 | }
308 | }
309 | data >>= 1;
310 | }
311 | pixels += (stride * bpp);
312 | }
313 | }
314 | }
315 |
316 | /* TODO: Take stride into account */
317 | void FbConScrollUp(void)
318 | {
319 | unsigned short *dst = (void*)FixedPcdGet32(PcdMipiFrameBufferAddress);
320 | unsigned short *src = dst + (gWidth * FONT_HEIGHT);
321 | unsigned count = gWidth * (gHeight - FONT_HEIGHT);
322 |
323 | while (count--)
324 | {
325 | *dst++ = *src++;
326 | }
327 |
328 | count = gWidth * FONT_HEIGHT;
329 | while (count--)
330 | {
331 | *dst++ = m_Color.Background;
332 | }
333 |
334 | FbConFlush();
335 | }
336 |
337 | void FbConFlush(void)
338 | {
339 | unsigned total_x, total_y;
340 | unsigned bytes_per_bpp;
341 |
342 | total_x = gWidth;
343 | total_y = gHeight;
344 | bytes_per_bpp = (gBpp / 8);
345 |
346 | WriteBackInvalidateDataCacheRange(
347 | (void*)FixedPcdGet32(PcdMipiFrameBufferAddress),
348 | (total_x * total_y * bytes_per_bpp)
349 | );
350 | }
351 |
352 | UINTN
353 | EFIAPI
354 | SerialPortWrite
355 | (
356 | IN UINT8 *Buffer,
357 | IN UINTN NumberOfBytes
358 | )
359 | {
360 | UINT8* CONST Final = &Buffer[NumberOfBytes];
361 | UINTN InterruptState = ArmGetInterruptState();
362 | ArmDisableInterrupts();
363 |
364 | while (Buffer < Final)
365 | {
366 | FbConPutCharWithFactor(*Buffer++, FBCON_COMMON_MSG, SCALE_FACTOR);
367 | }
368 |
369 | if (InterruptState) ArmEnableInterrupts();
370 | return NumberOfBytes;
371 | }
372 |
373 | UINTN
374 | EFIAPI
375 | SerialPortWriteCritical
376 | (
377 | IN UINT8 *Buffer,
378 | IN UINTN NumberOfBytes
379 | )
380 | {
381 | UINT8* CONST Final = &Buffer[NumberOfBytes];
382 | UINTN CurrentForeground = m_Color.Foreground;
383 | UINTN InterruptState = ArmGetInterruptState();
384 |
385 | ArmDisableInterrupts();
386 | m_Color.Foreground = FB_BGRA8888_YELLOW;
387 |
388 | while (Buffer < Final)
389 | {
390 | FbConPutCharWithFactor(*Buffer++, FBCON_COMMON_MSG, SCALE_FACTOR);
391 | }
392 |
393 | m_Color.Foreground = CurrentForeground;
394 |
395 | if (InterruptState) ArmEnableInterrupts();
396 | return NumberOfBytes;
397 | }
398 |
399 | UINTN
400 | EFIAPI
401 | SerialPortRead
402 | (
403 | OUT UINT8 *Buffer,
404 | IN UINTN NumberOfBytes
405 | )
406 | {
407 | return 0;
408 | }
409 |
410 | BOOLEAN
411 | EFIAPI
412 | SerialPortPoll
413 | (
414 | VOID
415 | )
416 | {
417 | return FALSE;
418 | }
419 |
420 | RETURN_STATUS
421 | EFIAPI
422 | SerialPortSetControl
423 | (
424 | IN UINT32 Control
425 | )
426 | {
427 | return RETURN_UNSUPPORTED;
428 | }
429 |
430 | RETURN_STATUS
431 | EFIAPI
432 | SerialPortGetControl
433 | (
434 | OUT UINT32 *Control
435 | )
436 | {
437 | return RETURN_UNSUPPORTED;
438 | }
439 |
440 | RETURN_STATUS
441 | EFIAPI
442 | SerialPortSetAttributes
443 | (
444 | IN OUT UINT64 *BaudRate,
445 | IN OUT UINT32 *ReceiveFifoDepth,
446 | IN OUT UINT32 *Timeout,
447 | IN OUT EFI_PARITY_TYPE *Parity,
448 | IN OUT UINT8 *DataBits,
449 | IN OUT EFI_STOP_BITS_TYPE *StopBits
450 | )
451 | {
452 | return RETURN_UNSUPPORTED;
453 | }
454 |
455 | UINTN SerialPortFlush(VOID)
456 | {
457 | return 0;
458 | }
459 |
460 | VOID
461 | EnableSynchronousSerialPortIO(VOID)
462 | {
463 | // Already synchronous
464 | }
--------------------------------------------------------------------------------
/XiaomiMI8Pkg/Library/FrameBufferSerialPortLib/FrameBufferSerialPortLib.h:
--------------------------------------------------------------------------------
1 | #ifndef _FRAMEBUFFER_SERIALPORT_LIB_H_
2 | #define _FRAMEBUFFER_SERIALPORT_LIB_H_
3 |
4 | typedef struct _FBCON_POSITION {
5 | INTN x;
6 | INTN y;
7 | } FBCON_POSITION, *PFBCON_POSITION;
8 |
9 | typedef struct _FBCON_COLOR {
10 | UINTN Foreground;
11 | UINTN Background;
12 | } FBCON_COLOR, *PFBCON_COLOR;
13 |
14 | enum FbConMsgType {
15 | /* type for menu */
16 | FBCON_COMMON_MSG = 0,
17 | FBCON_UNLOCK_TITLE_MSG,
18 | FBCON_TITLE_MSG,
19 | FBCON_SUBTITLE_MSG,
20 |
21 | /* type for warning */
22 | FBCON_YELLOW_MSG,
23 | FBCON_ORANGE_MSG,
24 | FBCON_RED_MSG,
25 | FBCON_GREEN_MSG,
26 |
27 | /* and the select message's background */
28 | FBCON_SELECT_MSG_BG_COLOR,
29 | };
30 |
31 | void ResetFb(void);
32 |
33 | UINTN
34 | EFIAPI
35 | SerialPortWriteCritical
36 | (
37 | IN UINT8 *Buffer,
38 | IN UINTN NumberOfBytes
39 | );
40 |
41 | #endif
42 |
--------------------------------------------------------------------------------
/XiaomiMI8Pkg/Library/FrameBufferSerialPortLib/FrameBufferSerialPortLib.inf:
--------------------------------------------------------------------------------
1 | [Defines]
2 | INF_VERSION = 0x00010005
3 | BASE_NAME = FrameBufferSerialPortLib
4 | MODULE_TYPE = BASE
5 | VERSION_STRING = 1.0
6 | LIBRARY_CLASS = SerialPortLib
7 |
8 | [Sources.common]
9 | FrameBufferSerialPortLib.c
10 |
11 | [Packages]
12 | MdePkg/MdePkg.dec
13 | ArmPkg/ArmPkg.dec
14 | XiaomiMI8Pkg/XiaomiMI8Pkg.dec
15 |
16 | [LibraryClasses]
17 | ArmLib
18 | PcdLib
19 | IoLib
20 | HobLib
21 | CompilerIntrinsicsLib
22 | CacheMaintenanceLib
23 |
24 | [Pcd]
25 | gXiaomiMI8PkgTokenSpaceGuid.PcdMipiFrameBufferAddress
26 | gXiaomiMI8PkgTokenSpaceGuid.PcdMipiFrameBufferWidth
27 | gXiaomiMI8PkgTokenSpaceGuid.PcdMipiFrameBufferHeight
28 | gXiaomiMI8PkgTokenSpaceGuid.PcdMipiFrameBufferPixelBpp
29 | gXiaomiMI8PkgTokenSpaceGuid.PcdMipiFrameBufferVisibleWidth
30 | gXiaomiMI8PkgTokenSpaceGuid.PcdMipiFrameBufferVisibleHeight
31 |
--------------------------------------------------------------------------------
/XiaomiMI8Pkg/Library/InMemorySerialPortLib/InMemorySerialPortLib.c:
--------------------------------------------------------------------------------
1 | /** @file
2 | Null Serial Port library instance with empty functions.
3 |
4 | Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
5 | This program and the accompanying materials
6 | are licensed and made available under the terms and conditions of the BSD License
7 | which accompanies this distribution. The full text of the license may be found at
8 | http://opensource.org/licenses/bsd-license.php.
9 |
10 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
12 |
13 | **/
14 |
15 |
16 | #include
17 | #include
18 | #include
19 |
20 | /**
21 | Initialize the serial device hardware.
22 |
23 | If no initialization is required, then return RETURN_SUCCESS.
24 | If the serial device was successfully initialized, then return RETURN_SUCCESS.
25 | If the serial device could not be initialized, then return RETURN_DEVICE_ERROR.
26 |
27 | @retval RETURN_SUCCESS The serial device was initialized.
28 | @retval RETURN_DEVICE_ERROR The serial device could not be initialized.
29 |
30 | **/
31 | RETURN_STATUS
32 | EFIAPI
33 | SerialPortInitialize (
34 | VOID
35 | )
36 | {
37 | #if 0
38 | UINT8* base = (UINT8*)0xa1a10000ull;
39 | for (UINTN i = 0; i < 0x200000; i++) {
40 | base[i] = 0;
41 | }
42 | #endif
43 | return RETURN_SUCCESS;
44 | }
45 |
46 | static void mem_putchar(UINT8 c) {
47 | static const UINTN size = 0x200000;
48 | static UINTN offset = 0;
49 | UINT8* base = (UINT8*)0xa1a10000ull;
50 | base[offset++] = c;
51 | if (offset >= size) {
52 | offset = 0;
53 | }
54 | WriteBackInvalidateDataCacheRange(base, size);
55 | }
56 |
57 | /**
58 | Write data from buffer to serial device.
59 |
60 | Writes NumberOfBytes data bytes from Buffer to the serial device.
61 | The number of bytes actually written to the serial device is returned.
62 | If the return value is less than NumberOfBytes, then the write operation failed.
63 | If Buffer is NULL, then ASSERT().
64 | If NumberOfBytes is zero, then return 0.
65 |
66 | @param Buffer The pointer to the data buffer to be written.
67 | @param NumberOfBytes The number of bytes to written to the serial device.
68 |
69 | @retval 0 NumberOfBytes is 0.
70 | @retval >0 The number of bytes written to the serial device.
71 | If this value is less than NumberOfBytes, then the write operation failed.
72 |
73 | **/
74 | UINTN
75 | EFIAPI
76 | SerialPortWrite (
77 | IN UINT8 *Buffer,
78 | IN UINTN NumberOfBytes
79 | )
80 | {
81 | for (UINTN i = 0; i < NumberOfBytes; i++) {
82 | mem_putchar(Buffer[i]);
83 | }
84 | return NumberOfBytes;
85 | }
86 |
87 |
88 | /**
89 | Read data from serial device and save the datas in buffer.
90 |
91 | Reads NumberOfBytes data bytes from a serial device into the buffer
92 | specified by Buffer. The number of bytes actually read is returned.
93 | If the return value is less than NumberOfBytes, then the rest operation failed.
94 | If Buffer is NULL, then ASSERT().
95 | If NumberOfBytes is zero, then return 0.
96 |
97 | @param Buffer The pointer to the data buffer to store the data read from the serial device.
98 | @param NumberOfBytes The number of bytes which will be read.
99 |
100 | @retval 0 Read data failed; No data is to be read.
101 | @retval >0 The actual number of bytes read from serial device.
102 |
103 | **/
104 | UINTN
105 | EFIAPI
106 | SerialPortRead (
107 | OUT UINT8 *Buffer,
108 | IN UINTN NumberOfBytes
109 | )
110 | {
111 | return 0;
112 | }
113 |
114 | /**
115 | Polls a serial device to see if there is any data waiting to be read.
116 |
117 | Polls a serial device to see if there is any data waiting to be read.
118 | If there is data waiting to be read from the serial device, then TRUE is returned.
119 | If there is no data waiting to be read from the serial device, then FALSE is returned.
120 |
121 | @retval TRUE Data is waiting to be read from the serial device.
122 | @retval FALSE There is no data waiting to be read from the serial device.
123 |
124 | **/
125 | BOOLEAN
126 | EFIAPI
127 | SerialPortPoll (
128 | VOID
129 | )
130 | {
131 | return FALSE;
132 | }
133 |
134 | /**
135 | Sets the control bits on a serial device.
136 |
137 | @param Control Sets the bits of Control that are settable.
138 |
139 | @retval RETURN_SUCCESS The new control bits were set on the serial device.
140 | @retval RETURN_UNSUPPORTED The serial device does not support this operation.
141 | @retval RETURN_DEVICE_ERROR The serial device is not functioning correctly.
142 |
143 | **/
144 | RETURN_STATUS
145 | EFIAPI
146 | SerialPortSetControl (
147 | IN UINT32 Control
148 | )
149 | {
150 | return RETURN_UNSUPPORTED;
151 | }
152 |
153 | /**
154 | Retrieve the status of the control bits on a serial device.
155 |
156 | @param Control A pointer to return the current control signals from the serial device.
157 |
158 | @retval RETURN_SUCCESS The control bits were read from the serial device.
159 | @retval RETURN_UNSUPPORTED The serial device does not support this operation.
160 | @retval RETURN_DEVICE_ERROR The serial device is not functioning correctly.
161 |
162 | **/
163 | RETURN_STATUS
164 | EFIAPI
165 | SerialPortGetControl (
166 | OUT UINT32 *Control
167 | )
168 | {
169 | return RETURN_UNSUPPORTED;
170 | }
171 |
172 | /**
173 | Sets the baud rate, receive FIFO depth, transmit/receice time out, parity,
174 | data bits, and stop bits on a serial device.
175 |
176 | @param BaudRate The requested baud rate. A BaudRate value of 0 will use the
177 | device's default interface speed.
178 | On output, the value actually set.
179 | @param ReveiveFifoDepth The requested depth of the FIFO on the receive side of the
180 | serial interface. A ReceiveFifoDepth value of 0 will use
181 | the device's default FIFO depth.
182 | On output, the value actually set.
183 | @param Timeout The requested time out for a single character in microseconds.
184 | This timeout applies to both the transmit and receive side of the
185 | interface. A Timeout value of 0 will use the device's default time
186 | out value.
187 | On output, the value actually set.
188 | @param Parity The type of parity to use on this serial device. A Parity value of
189 | DefaultParity will use the device's default parity value.
190 | On output, the value actually set.
191 | @param DataBits The number of data bits to use on the serial device. A DataBits
192 | vaule of 0 will use the device's default data bit setting.
193 | On output, the value actually set.
194 | @param StopBits The number of stop bits to use on this serial device. A StopBits
195 | value of DefaultStopBits will use the device's default number of
196 | stop bits.
197 | On output, the value actually set.
198 |
199 | @retval RETURN_SUCCESS The new attributes were set on the serial device.
200 | @retval RETURN_UNSUPPORTED The serial device does not support this operation.
201 | @retval RETURN_INVALID_PARAMETER One or more of the attributes has an unsupported value.
202 | @retval RETURN_DEVICE_ERROR The serial device is not functioning correctly.
203 |
204 | **/
205 | RETURN_STATUS
206 | EFIAPI
207 | SerialPortSetAttributes (
208 | IN OUT UINT64 *BaudRate,
209 | IN OUT UINT32 *ReceiveFifoDepth,
210 | IN OUT UINT32 *Timeout,
211 | IN OUT EFI_PARITY_TYPE *Parity,
212 | IN OUT UINT8 *DataBits,
213 | IN OUT EFI_STOP_BITS_TYPE *StopBits
214 | )
215 | {
216 | return RETURN_UNSUPPORTED;
217 | }
218 |
219 |
--------------------------------------------------------------------------------
/XiaomiMI8Pkg/Library/InMemorySerialPortLib/InMemorySerialPortLib.inf:
--------------------------------------------------------------------------------
1 | ## @file
2 | # Null instance of Serial Port Library with empty functions.
3 | #
4 | # Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
5 | #
6 | # This program and the accompanying materials
7 | # are licensed and made available under the terms and conditions of the BSD License
8 | # which accompanies this distribution. The full text of the license may be found at
9 | # http://opensource.org/licenses/bsd-license.php.
10 | # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
12 | #
13 | #
14 | ##
15 |
16 | [Defines]
17 | INF_VERSION = 0x00010005
18 | BASE_NAME = InMemorySerialPortLib
19 | MODULE_UNI_FILE = InMemorySerialPortLib.uni
20 | FILE_GUID = 762fbf9a-984a-4960-9c7c-e0a076860304
21 | MODULE_TYPE = BASE
22 | VERSION_STRING = 1.0
23 | LIBRARY_CLASS = SerialPortLib
24 |
25 |
26 | #
27 | # VALID_ARCHITECTURES = IA32 X64 EBC
28 | #
29 |
30 | [Sources]
31 | InMemorySerialPortLib.c
32 |
33 |
34 | [Packages]
35 | MdePkg/MdePkg.dec
36 |
37 | [LibraryClasses]
38 | CacheMaintenanceLib
39 |
40 |
--------------------------------------------------------------------------------
/XiaomiMI8Pkg/Library/InMemorySerialPortLib/InMemorySerialPortLib.uni:
--------------------------------------------------------------------------------
1 | // /** @file
2 | // Null instance of Serial Port Library with empty functions.
3 | //
4 | // Null instance of Serial Port Library with empty functions.
5 | //
6 | // Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.
7 | //
8 | // This program and the accompanying materials
9 | // are licensed and made available under the terms and conditions of the BSD License
10 | // which accompanies this distribution. The full text of the license may be found at
11 | // http://opensource.org/licenses/bsd-license.php.
12 | // THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
13 | // WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
14 | //
15 | // **/
16 |
17 |
18 | #string STR_MODULE_ABSTRACT #language en-US "Serial Port Library that dumps everything written to in memory buffer"
19 |
20 | #string STR_MODULE_DESCRIPTION #language en-US "Serial Port Library that dumps everything written to in memory buffer"
21 |
22 |
--------------------------------------------------------------------------------
/XiaomiMI8Pkg/Library/MemoryInitPeiLib/MemoryInitPeiLib.c:
--------------------------------------------------------------------------------
1 | /** @file
2 | *
3 | * Copyright (c) 2011-2015, ARM Limited. All rights reserved.
4 | *
5 | * This program and the accompanying materials
6 | * are licensed and made available under the terms and conditions of the BSD
7 | *License which accompanies this distribution. The full text of the license may
8 | *be found at http://opensource.org/licenses/bsd-license.php
9 | *
10 | * THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 | * WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR
12 | *IMPLIED.
13 | *
14 | **/
15 |
16 | #include
17 |
18 | #include
19 | #include
20 | #include
21 | #include
22 | #include
23 | #include
24 |
25 | // This varies by device
26 | #include
27 |
28 | extern UINT64 mSystemMemoryEnd;
29 |
30 | VOID BuildMemoryTypeInformationHob(VOID);
31 |
32 | STATIC
33 | VOID InitMmu(IN ARM_MEMORY_REGION_DESCRIPTOR *MemoryTable)
34 | {
35 |
36 | VOID * TranslationTableBase;
37 | UINTN TranslationTableSize;
38 | RETURN_STATUS Status;
39 |
40 | // Note: Because we called PeiServicesInstallPeiMemory() before
41 | // to call InitMmu() the MMU Page Table resides in
42 | // RAM (even at the top of DRAM as it is the first permanent memory
43 | // allocation)
44 | Status = ArmConfigureMmu(
45 | MemoryTable, &TranslationTableBase, &TranslationTableSize);
46 |
47 | if (EFI_ERROR(Status)) {
48 | DEBUG((EFI_D_ERROR, "Error: Failed to enable MMU: %r\n", Status));
49 | }
50 | }
51 |
52 | STATIC
53 | VOID AddHob(PARM_MEMORY_REGION_DESCRIPTOR_EX Desc)
54 | {
55 | BuildResourceDescriptorHob(
56 | Desc->ResourceType, Desc->ResourceAttribute, Desc->Address, Desc->Length);
57 |
58 | BuildMemoryAllocationHob(Desc->Address, Desc->Length, Desc->MemoryType);
59 | }
60 |
61 | /*++
62 |
63 | Routine Description:
64 |
65 |
66 |
67 | Arguments:
68 |
69 | FileHandle - Handle of the file being invoked.
70 | PeiServices - Describes the list of possible PEI Services.
71 |
72 | Returns:
73 |
74 | Status - EFI_SUCCESS if the boot mode could be set
75 |
76 | --*/
77 | EFI_STATUS
78 | EFIAPI
79 | MemoryPeim(IN EFI_PHYSICAL_ADDRESS UefiMemoryBase, IN UINT64 UefiMemorySize)
80 | {
81 |
82 | PARM_MEMORY_REGION_DESCRIPTOR_EX MemoryDescriptorEx =
83 | gDeviceMemoryDescriptorEx;
84 | ARM_MEMORY_REGION_DESCRIPTOR
85 | MemoryDescriptor[MAX_ARM_MEMORY_REGION_DESCRIPTOR_COUNT];
86 | UINTN Index = 0;
87 |
88 | // Ensure PcdSystemMemorySize has been set
89 | ASSERT(PcdGet64(PcdSystemMemorySize) != 0);
90 |
91 | // Run through each memory descriptor
92 | while (MemoryDescriptorEx->Length != 0) {
93 | switch (MemoryDescriptorEx->HobOption) {
94 | case AddMem:
95 | case AddDev:
96 | AddHob(MemoryDescriptorEx);
97 | break;
98 | case NoHob:
99 | default:
100 | goto update;
101 | }
102 |
103 | update:
104 | ASSERT(Index < MAX_ARM_MEMORY_REGION_DESCRIPTOR_COUNT);
105 |
106 | MemoryDescriptor[Index].PhysicalBase = MemoryDescriptorEx->Address;
107 | MemoryDescriptor[Index].VirtualBase = MemoryDescriptorEx->Address;
108 | MemoryDescriptor[Index].Length = MemoryDescriptorEx->Length;
109 | MemoryDescriptor[Index].Attributes = MemoryDescriptorEx->ArmAttributes;
110 |
111 | Index++;
112 | MemoryDescriptorEx++;
113 | }
114 |
115 | // Last one (terminator)
116 | ASSERT(Index < MAX_ARM_MEMORY_REGION_DESCRIPTOR_COUNT);
117 | MemoryDescriptor[Index].PhysicalBase = 0;
118 | MemoryDescriptor[Index].VirtualBase = 0;
119 | MemoryDescriptor[Index].Length = 0;
120 | MemoryDescriptor[Index].Attributes = 0;
121 |
122 | // Build Memory Allocation Hob
123 | DEBUG((EFI_D_INFO, "Configure MMU In \n"));
124 | InitMmu(MemoryDescriptor);
125 | DEBUG((EFI_D_INFO, "Configure MMU Out \n"));
126 |
127 | if (FeaturePcdGet(PcdPrePiProduceMemoryTypeInformationHob)) {
128 | // Optional feature that helps prevent EFI memory map fragmentation.
129 | BuildMemoryTypeInformationHob();
130 | }
131 |
132 | return EFI_SUCCESS;
133 | }
134 |
--------------------------------------------------------------------------------
/XiaomiMI8Pkg/Library/MemoryInitPeiLib/PeiMemoryAllocationLib.inf:
--------------------------------------------------------------------------------
1 | #/** @file
2 | #
3 | # Copyright (c) 2011-2014, ARM Ltd. All rights reserved.
4 | # Copyright (c) 2016, Linaro, Ltd. All rights reserved.
5 | # This program and the accompanying materials
6 | # are licensed and made available under the terms and conditions of the BSD License
7 | # which accompanies this distribution. The full text of the license may be found at
8 | # http://opensource.org/licenses/bsd-license.php
9 | #
10 | # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
12 | #
13 | #**/
14 |
15 | [Defines]
16 | INF_VERSION = 0x00010005
17 | BASE_NAME = MemoryInitPeiLib
18 | FILE_GUID = 4bbc9c10-a100-43fb-8311-332ba497d1b4
19 | MODULE_TYPE = BASE
20 | VERSION_STRING = 1.0
21 | LIBRARY_CLASS = MemoryInitPeiLib|SEC PEIM
22 |
23 | [Sources]
24 | MemoryInitPeiLib.c
25 |
26 | [Packages]
27 | MdePkg/MdePkg.dec
28 | MdeModulePkg/MdeModulePkg.dec
29 | EmbeddedPkg/EmbeddedPkg.dec
30 | ArmPkg/ArmPkg.dec
31 | ArmPlatformPkg/ArmPlatformPkg.dec
32 | XiaomiMI8Pkg/XiaomiMI8Pkg.dec
33 |
34 | [LibraryClasses]
35 | DebugLib
36 | HobLib
37 | ArmMmuLib
38 | ArmPlatformLib
39 |
40 | [Guids]
41 | gEfiMemoryTypeInformationGuid
42 |
43 | [FeaturePcd]
44 | gEmbeddedTokenSpaceGuid.PcdPrePiProduceMemoryTypeInformationHob
45 |
46 | [FixedPcd]
47 | gArmTokenSpaceGuid.PcdSystemMemoryBase
48 | gArmTokenSpaceGuid.PcdSystemMemorySize
49 |
50 | [Depex]
51 | TRUE
52 |
--------------------------------------------------------------------------------
/XiaomiMI8Pkg/Library/PlatformBootManagerLib/PlatformBm.h:
--------------------------------------------------------------------------------
1 | /** @file
2 | Head file for BDS Platform specific code
3 |
4 | Copyright (C) 2015-2016, Red Hat, Inc.
5 | Copyright (c) 2004 - 2008, Intel Corporation. All rights reserved.
6 | Copyright (c) 2016, Linaro Ltd. All rights reserved.
7 | Copyright (c), 2017, Andrei Warkentin
8 |
9 | This program and the accompanying materials are licensed and made available
10 | under the terms and conditions of the BSD License which accompanies this
11 | distribution. The full text of the license may be found at
12 | http://opensource.org/licenses/bsd-license.php
13 |
14 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT
15 | WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
16 |
17 | **/
18 |
19 | #ifndef _PLATFORM_BM_H_
20 | #define _PLATFORM_BM_H_
21 |
22 | #include
23 | #include
24 | #include
25 | #include
26 | #include
27 | #include
28 | #include
29 | #include
30 |
31 | /**
32 | Use SystemTable Conout to stop video based Simple Text Out consoles from
33 | going to the video device. Put up LogoFile on every video device that is a
34 | console.
35 |
36 | @param[in] LogoFile File name of logo to display on the center of the
37 | screen.
38 |
39 | @retval EFI_SUCCESS ConsoleControl has been flipped to graphics and logo
40 | displayed.
41 | @retval EFI_UNSUPPORTED Logo not found
42 | **/
43 | EFI_STATUS
44 | EnableQuietBoot (
45 | IN EFI_GUID *LogoFile
46 | );
47 |
48 | /**
49 | Use SystemTable Conout to turn on video based Simple Text Out consoles. The
50 | Simple Text Out screens will now be synced up with all non video output
51 | devices
52 |
53 | @retval EFI_SUCCESS UGA devices are back in text mode and synced up.
54 | **/
55 | EFI_STATUS
56 | DisableQuietBoot (
57 | VOID
58 | );
59 |
60 | #endif // _PLATFORM_BM_H_
61 |
--------------------------------------------------------------------------------
/XiaomiMI8Pkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf:
--------------------------------------------------------------------------------
1 | ## @file
2 | # Implementation for PlatformBootManagerLib library class interfaces.
3 | #
4 | # Copyright (C) 2015-2016, Red Hat, Inc.
5 | # Copyright (c) 2014, ARM Ltd. All rights reserved.
6 | # Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.
7 | # Copyright (c) 2016, Linaro Ltd. All rights reserved.
8 | # Copyright (c), 2017, Andrei Warkentin
9 | #
10 | # This program and the accompanying materials are licensed and made available
11 | # under the terms and conditions of the BSD License which accompanies this
12 | # distribution. The full text of the license may be found at
13 | # http://opensource.org/licenses/bsd-license.php
14 | #
15 | # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
16 | # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR
17 | # IMPLIED.
18 | #
19 | ##
20 |
21 | [Defines]
22 | INF_VERSION = 0x00010005
23 | BASE_NAME = PlatformBootManagerLib
24 | FILE_GUID = 92FD2DE3-B9CB-4B35-8141-42AD34D73C9F
25 | MODULE_TYPE = DXE_DRIVER
26 | VERSION_STRING = 1.0
27 | LIBRARY_CLASS = PlatformBootManagerLib|DXE_DRIVER
28 |
29 | #
30 | # The following information is for reference only and not required by the build tools.
31 | #
32 | # VALID_ARCHITECTURES = ARM AARCH64
33 | #
34 |
35 | [Sources]
36 | PlatformBm.c
37 |
38 | [Packages]
39 | MdeModulePkg/MdeModulePkg.dec
40 | MdePkg/MdePkg.dec
41 | ShellPkg/ShellPkg.dec
42 | XiaomiMI8Pkg/XiaomiMI8Pkg.dec
43 |
44 | [BuildOptions.AARCH64]
45 | GCC:*_*_*_CC_FLAGS = -Wno-unused-variable
46 |
47 | [LibraryClasses]
48 | BaseLib
49 | BaseMemoryLib
50 | BootLogoLib
51 | CapsuleLib
52 | DebugLib
53 | DevicePathLib
54 | DxeServicesLib
55 | HobLib
56 | MemoryAllocationLib
57 | PcdLib
58 | PrintLib
59 | UefiBootManagerLib
60 | UefiBootServicesTableLib
61 | UefiLib
62 |
63 | [FeaturePcd]
64 | gEfiMdePkgTokenSpaceGuid.PcdUgaConsumeSupport
65 |
66 | [FixedPcd]
67 | gEfiMdePkgTokenSpaceGuid.PcdUartDefaultBaudRate
68 | gEfiMdePkgTokenSpaceGuid.PcdUartDefaultDataBits
69 | gEfiMdePkgTokenSpaceGuid.PcdUartDefaultParity
70 | gEfiMdePkgTokenSpaceGuid.PcdUartDefaultStopBits
71 | gEfiMdePkgTokenSpaceGuid.PcdDefaultTerminalType
72 |
73 | [Pcd]
74 | gEfiMdePkgTokenSpaceGuid.PcdPlatformBootTimeOut
75 |
76 | [Guids]
77 | gEfiFileInfoGuid
78 | gEfiFileSystemInfoGuid
79 | gEfiFileSystemVolumeLabelInfoIdGuid
80 | gEfiEndOfDxeEventGroupGuid
81 | gEfiTtyTermGuid
82 | gUefiShellFileGuid
83 |
84 | [Protocols]
85 | gEfiDevicePathProtocolGuid
86 | gEfiGraphicsOutputProtocolGuid
87 | gEfiLoadedImageProtocolGuid
88 | gEfiSimpleFileSystemProtocolGuid
89 | gEsrtManagementProtocolGuid
90 | gEfiUsb2HcProtocolGuid
91 | gEFIDroidKeypadDeviceProtocolGuid
92 |
93 |
--------------------------------------------------------------------------------
/XiaomiMI8Pkg/Library/PlatformPeiLib/PlatformPeiLib.c:
--------------------------------------------------------------------------------
1 | /** @file
2 | *
3 | * Copyright (c) 2011-2014, ARM Limited. All rights reserved.
4 | * Copyright (c) 2014, Linaro Limited. All rights reserved.
5 | *
6 | * This program and the accompanying materials
7 | * are licensed and made available under the terms and conditions of the BSD
8 | *License which accompanies this distribution. The full text of the license may
9 | *be found at http://opensource.org/licenses/bsd-license.php
10 | *
11 | * THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR
13 | *IMPLIED.
14 | *
15 | **/
16 |
17 | #include
18 |
19 | #include
20 | #include
21 | #include
22 | #include
23 |
24 | EFI_STATUS
25 | EFIAPI
26 | PlatformPeim(VOID)
27 | {
28 |
29 | BuildFvHob(PcdGet64(PcdFvBaseAddress), PcdGet32(PcdFvSize));
30 |
31 | return EFI_SUCCESS;
32 | }
--------------------------------------------------------------------------------
/XiaomiMI8Pkg/Library/PlatformPeiLib/PlatformPeiLib.inf:
--------------------------------------------------------------------------------
1 | #/** @file
2 | #
3 | # Copyright (c) 2011-2015, ARM Limited. All rights reserved.
4 | # Copyright (c) 2014, Linaro Limited. All rights reserved.
5 | #
6 | # This program and the accompanying materials
7 | # are licensed and made available under the terms and conditions of the BSD License
8 | # which accompanies this distribution. The full text of the license may be found at
9 | # http://opensource.org/licenses/bsd-license.php
10 | #
11 | # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
13 | #
14 | #**/
15 |
16 | [Defines]
17 | INF_VERSION = 0x00010005
18 | BASE_NAME = PlatformPeiLib
19 | FILE_GUID = 59C11815-F8DA-4F49-B4FB-EC1E41ED1F06
20 | MODULE_TYPE = SEC
21 | VERSION_STRING = 1.0
22 | LIBRARY_CLASS = PlatformPeiLib
23 |
24 | [Sources]
25 | PlatformPeiLib.c
26 |
27 | [Packages]
28 | ArmPkg/ArmPkg.dec
29 | XiaomiMI8Pkg/XiaomiMI8Pkg.dec
30 | MdePkg/MdePkg.dec
31 | MdeModulePkg/MdeModulePkg.dec
32 | EmbeddedPkg/EmbeddedPkg.dec
33 |
34 | [LibraryClasses]
35 | DebugLib
36 | HobLib
37 |
38 | [FixedPcd]
39 | gArmTokenSpaceGuid.PcdFvSize
40 |
41 | [Pcd]
42 | gArmTokenSpaceGuid.PcdFvBaseAddress
43 |
44 | [Depex]
45 | gEfiPeiMemoryDiscoveredPpiGuid
46 |
--------------------------------------------------------------------------------
/XiaomiMI8Pkg/Library/VirtualRealTimeClockLib/VirtualRealTimeClockLib.c:
--------------------------------------------------------------------------------
1 | /** @file
2 | *
3 | * Implement dummy EFI RealTimeClock runtime services.
4 | *
5 | * Copyright (c), 2018, Andrei Warkentin
6 | * Copyright (c) Microsoft Corporation. All rights reserved.
7 | *
8 | * This program and the accompanying materials
9 | * are licensed and made available under the terms and conditions of the BSD
10 | *License which accompanies this distribution. The full text of the license may
11 | *be found at http://opensource.org/licenses/bsd-license.php
12 | *
13 | * THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR
15 | *IMPLIED.
16 | *
17 | **/
18 |
19 | #include
20 |
21 | #include
22 | #include
23 | #include
24 | #include
25 | #include
26 | #include
27 | #include
28 | #include
29 |
30 | #include
31 |
32 | STATIC EFI_TIME BaseTime;
33 |
34 | /**
35 | Returns the current time and date information, and the time-keeping capabilities
36 | of the virtual RTC.
37 |
38 | For simplicity, this LibGetTime does not report Years/Months, instead it will
39 | only report current Day, Hours, Minutes and Seconds starting from the begining
40 | of CPU up-time. Otherwise, a more complex logic will be required to account for
41 | leap years and days/month differences.
42 |
43 | @param Time A pointer to storage to receive a snapshot of the
44 | current time.
45 | @param Capabilities An optional pointer to a buffer to receive the
46 | real time clock device's capabilities.
47 |
48 | @retval EFI_SUCCESS The operation completed successfully.
49 | @retval EFI_INVALID_PARAMETER Time is NULL.
50 | @retval EFI_DEVICE_ERROR The time could not be retrieved due to hardware
51 | error.
52 |
53 | **/
54 | EFI_STATUS
55 | EFIAPI
56 | LibGetTime(OUT EFI_TIME *Time, OUT EFI_TIME_CAPABILITIES *Capabilities)
57 | {
58 | UINT32 Freq = ArmGenericTimerGetTimerFreq();
59 |
60 | if (Time == NULL) {
61 | return EFI_INVALID_PARAMETER;
62 | }
63 |
64 | //
65 | // Depend on ARM generic timer to report date/time relative to the
66 | // start of CPU timer counting where date and time will always
67 | // be relative to the date/time 1/1/1900 00H:00M:00S
68 | //
69 |
70 | ASSERT(Freq != 0);
71 | if (Freq == 0) {
72 | return EFI_DEVICE_ERROR;
73 | }
74 |
75 | if (Capabilities) {
76 | Capabilities->Accuracy = 0;
77 | Capabilities->Resolution = Freq;
78 | Capabilities->SetsToZero = FALSE;
79 | }
80 |
81 | UINT64 ElapsedSeconds = GetPerformanceCounter() / Freq;
82 |
83 | //
84 | // Don't report Year/Month since Leap Year logic is not implemented. This
85 | // should be fine since the sole purpose of this special implementation is to
86 | // be used for relative time measurement. e.g. Windows Boot Manager.
87 | //
88 |
89 | Time->Year = BaseTime.Year;
90 | Time->Month = BaseTime.Month;
91 |
92 | const UINT64 SECONDS_PER_DAY = 24 * 60 * 60;
93 | Time->Day = (ElapsedSeconds / SECONDS_PER_DAY);
94 | ElapsedSeconds %= SECONDS_PER_DAY;
95 |
96 | const UINT64 SECONDS_PER_HOUR = 60 * 60;
97 | Time->Hour = (ElapsedSeconds / SECONDS_PER_HOUR);
98 | ElapsedSeconds %= SECONDS_PER_HOUR;
99 |
100 | const UINT64 SECONDS_PER_MINUTE = 60;
101 | Time->Minute = (ElapsedSeconds / SECONDS_PER_MINUTE);
102 | ElapsedSeconds %= SECONDS_PER_MINUTE;
103 |
104 | Time->Second = ElapsedSeconds;
105 |
106 | //
107 | // Not required to report in our special case
108 | //
109 |
110 | Time->Nanosecond = 0;
111 | Time->TimeZone = 0;
112 | Time->Daylight = 0;
113 |
114 | return EFI_SUCCESS;
115 | }
116 |
117 | /**
118 | Sets the current local time and date information.
119 |
120 | @param Time A pointer to the current time.
121 |
122 | @retval EFI_SUCCESS The operation completed successfully.
123 | @retval EFI_INVALID_PARAMETER A time field is out of range.
124 | @retval EFI_DEVICE_ERROR The time could not be set due due to hardware
125 | error.
126 |
127 | **/
128 | EFI_STATUS
129 | EFIAPI
130 | LibSetTime(IN EFI_TIME *Time)
131 | {
132 | //
133 | // The virtual clock is read-only.
134 | //
135 | return EFI_UNSUPPORTED;
136 | }
137 |
138 | /**
139 | Returns the current wakeup alarm clock setting.
140 |
141 | @param Enabled Indicates if the alarm is currently enabled or
142 | disabled.
143 | @param Pending Indicates if the alarm signal is pending and
144 | requires acknowledgement.
145 | @param Time The current alarm setting.
146 |
147 | @retval EFI_SUCCESS The alarm settings were returned.
148 | @retval EFI_INVALID_PARAMETER Any parameter is NULL.
149 | @retval EFI_DEVICE_ERROR The wakeup time could not be retrieved due to a
150 | hardware error.
151 |
152 | **/
153 | EFI_STATUS
154 | EFIAPI
155 | LibGetWakeupTime(OUT BOOLEAN *Enabled, OUT BOOLEAN *Pending, OUT EFI_TIME *Time)
156 | {
157 | return EFI_UNSUPPORTED;
158 | }
159 |
160 | /**
161 | Sets the system wakeup alarm clock time.
162 |
163 | @param Enabled Enable or disable the wakeup alarm.
164 | @param Time If Enable is TRUE, the time to set the wakeup
165 | alarm for.
166 |
167 | @retval EFI_SUCCESS If Enable is TRUE, then the wakeup alarm was
168 | enabled. If Enable is FALSE, then the wakeup alarm was disabled.
169 | @retval EFI_INVALID_PARAMETER A time field is out of range.
170 | @retval EFI_DEVICE_ERROR The wakeup time could not be set due to a hardware
171 | error.
172 | @retval EFI_UNSUPPORTED A wakeup timer is not supported on this platform.
173 |
174 | **/
175 | EFI_STATUS
176 | EFIAPI
177 | LibSetWakeupTime(IN BOOLEAN Enabled, OUT EFI_TIME *Time)
178 | {
179 | return EFI_UNSUPPORTED;
180 | }
181 |
182 | /**
183 | This is the declaration of an EFI image entry point. This can be the entry point
184 | to an application written to this specification, an EFI boot service driver, or
185 | an EFI runtime driver.
186 |
187 | @param ImageHandle Handle that identifies the loaded image.
188 | @param SystemTable System Table for this image.
189 |
190 | @retval EFI_SUCCESS The operation completed successfully.
191 |
192 | **/
193 | EFI_STATUS
194 | EFIAPI
195 | LibRtcInitialize(IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
196 | {
197 | BaseTime.Year = 2019;
198 | BaseTime.Month = 1;
199 |
200 | return EFI_SUCCESS;
201 | }
202 |
203 | /**
204 | Fixup internal data so that EFI can be call in virtual mode.
205 | Call the passed in Child Notify event and convert any pointers in
206 | lib to virtual mode.
207 |
208 | @param[in] Event The Event that is being processed
209 | @param[in] Context Event Context
210 | **/
211 | VOID EFIAPI LibRtcVirtualNotifyEvent(IN EFI_EVENT Event, IN VOID *Context)
212 | {
213 | return;
214 | }
215 |
--------------------------------------------------------------------------------
/XiaomiMI8Pkg/Library/VirtualRealTimeClockLib/VirtualRealTimeClockLib.inf:
--------------------------------------------------------------------------------
1 | #/* @file
2 | #
3 | # Implement dummy EFI RealTimeClock runtime services.
4 | #
5 | # Copyright (c), 2018, Andrei Warkentin
6 | # Copyright (c) Microsoft Corporation. All rights reserved.
7 | #
8 | # This program and the accompanying materials
9 | # are licensed and made available under the terms and conditions of the BSD License
10 | # which accompanies this distribution. The full text of the license may be found at
11 | # http://opensource.org/licenses/bsd-license.php
12 | #
13 | # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
14 | # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
15 | #
16 | #*/
17 |
18 | [Defines]
19 | INF_VERSION = 0x00010005
20 | BASE_NAME = VirtualRealTimeClockLib
21 | FILE_GUID = 1E27D461-78F3-4F7D-B1C2-F72384F13A6E
22 | MODULE_TYPE = BASE
23 | VERSION_STRING = 1.0
24 | LIBRARY_CLASS = RealTimeClockLib
25 |
26 | [Sources.common]
27 | VirtualRealTimeClockLib.c
28 |
29 | [Packages]
30 | ArmPkg/ArmPkg.dec
31 | MdePkg/MdePkg.dec
32 | EmbeddedPkg/EmbeddedPkg.dec
33 | XiaomiMI8Pkg/XiaomiMI8Pkg.dec
34 |
35 | [LibraryClasses]
36 | IoLib
37 | DebugLib
38 | TimerLib
39 | HobLib
40 | PcdLib
41 |
42 | [FixedPcd]
43 | gXiaomiMI8PkgTokenSpaceGuid.PcdBootShimInfo1
--------------------------------------------------------------------------------
/XiaomiMI8Pkg/Library/XiaomiMI8Lib/XiaomiMI8.c:
--------------------------------------------------------------------------------
1 | /** @file
2 | *
3 | * Copyright (c) 2018, Linaro Limited. All rights reserved.
4 | *
5 | * This program and the accompanying materials
6 | * are licensed and made available under the terms and conditions of the BSD License
7 | * which accompanies this distribution. The full text of the license may be found at
8 | * http://opensource.org/licenses/bsd-license.php
9 | *
10 | * THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 | * WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
12 | *
13 | **/
14 |
15 | #include
16 | #include
17 | #include
18 | #include
19 |
20 | #include
21 |
22 | ARM_CORE_INFO mHiKey960InfoTable[] = {
23 | {
24 | // Cluster 0, Core 0
25 | 0x0, 0x0,
26 |
27 | // MP Core MailBox Set/Get/Clear Addresses and Clear Value
28 | (UINT64)0xFFFFFFFF
29 | },
30 | /*
31 | {
32 | // Cluster 0, Core 1
33 | 0x0, 0x1,
34 |
35 | // MP Core MailBox Set/Get/Clear Addresses and Clear Value
36 | (UINT64)0xFFFFFFFF
37 | },
38 | {
39 | // Cluster 0, Core 2
40 | 0x0, 0x2,
41 |
42 | // MP Core MailBox Set/Get/Clear Addresses and Clear Value
43 | (UINT64)0xFFFFFFFF
44 | },
45 | {
46 | // Cluster 0, Core 3
47 | 0x0, 0x3,
48 |
49 | // MP Core MailBox Set/Get/Clear Addresses and Clear Value
50 | (UINT64)0xFFFFFFFF
51 | },
52 | {
53 | // Cluster 1, Core 0
54 | 0x1, 0x0,
55 |
56 | // MP Core MailBox Set/Get/Clear Addresses and Clear Value
57 | (UINT64)0xFFFFFFFF
58 | },
59 | {
60 | // Cluster 1, Core 1
61 | 0x1, 0x1,
62 |
63 | // MP Core MailBox Set/Get/Clear Addresses and Clear Value
64 | (UINT64)0xFFFFFFFF
65 | },
66 | {
67 | // Cluster 1, Core 2
68 | 0x1, 0x2,
69 |
70 | // MP Core MailBox Set/Get/Clear Addresses and Clear Value
71 | (UINT64)0xFFFFFFFF
72 | },
73 | {
74 | // Cluster 1, Core 3
75 | 0x1, 0x3,
76 |
77 | // MP Core MailBox Set/Get/Clear Addresses and Clear Value
78 | (UINT64)0xFFFFFFFF
79 | }
80 | */
81 | };
82 |
83 | /**
84 | Return the current Boot Mode
85 |
86 | This function returns the boot reason on the platform
87 |
88 | @return Return the current Boot Mode of the platform
89 |
90 | **/
91 | EFI_BOOT_MODE
92 | ArmPlatformGetBootMode (
93 | VOID
94 | )
95 | {
96 | return BOOT_WITH_FULL_CONFIGURATION;
97 | }
98 |
99 | /**
100 | Initialize controllers that must setup in the normal world
101 |
102 | This function is called by the ArmPlatformPkg/Pei or ArmPlatformPkg/Pei/PlatformPeim
103 | in the PEI phase.
104 |
105 | **/
106 | RETURN_STATUS
107 | ArmPlatformInitialize (
108 | IN UINTN MpId
109 | )
110 | {
111 | return RETURN_SUCCESS;
112 | }
113 |
114 | EFI_STATUS
115 | PrePeiCoreGetMpCoreInfo (
116 | OUT UINTN *CoreCount,
117 | OUT ARM_CORE_INFO **ArmCoreTable
118 | )
119 | {
120 | // Only support one cluster
121 | *CoreCount = sizeof(mHiKey960InfoTable) / sizeof(ARM_CORE_INFO);
122 | *ArmCoreTable = mHiKey960InfoTable;
123 | return EFI_SUCCESS;
124 | }
125 |
126 | // Needs to be declared in the file. Otherwise gArmMpCoreInfoPpiGuid is undefined in the contect of PrePeiCore
127 | EFI_GUID mArmMpCoreInfoPpiGuid = ARM_MP_CORE_INFO_PPI_GUID;
128 | ARM_MP_CORE_INFO_PPI mMpCoreInfoPpi = { PrePeiCoreGetMpCoreInfo };
129 |
130 | EFI_PEI_PPI_DESCRIPTOR gPlatformPpiTable[] = {
131 | {
132 | EFI_PEI_PPI_DESCRIPTOR_PPI,
133 | &mArmMpCoreInfoPpiGuid,
134 | &mMpCoreInfoPpi
135 | }
136 | };
137 |
138 | VOID
139 | ArmPlatformGetPlatformPpiList (
140 | OUT UINTN *PpiListSize,
141 | OUT EFI_PEI_PPI_DESCRIPTOR **PpiList
142 | )
143 | {
144 | *PpiListSize = sizeof(gPlatformPpiTable);
145 | *PpiList = gPlatformPpiTable;
146 | }
147 |
--------------------------------------------------------------------------------
/XiaomiMI8Pkg/Library/XiaomiMI8Lib/XiaomiMI8Helper.S:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright (c) 2018, Linaro Limited. All rights reserved.
3 | #
4 | # This program and the accompanying materials
5 | # are licensed and made available under the terms and conditions of the BSD License
6 | # which accompanies this distribution. The full text of the license may be found at
7 | # http://opensource.org/licenses/bsd-license.php
8 | #
9 | # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 | # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
11 | #
12 | #
13 |
14 | #include
15 | #include
16 |
17 | .text
18 | .align 3
19 |
20 | ASM_FUNC(ArmPlatformPeiBootAction)
21 | startlabel:
22 | // check if we're located at expected location
23 | adr x4, .
24 | ldr x5, =ArmPlatformPeiBootAction
25 | cmp x4, x5
26 | bne docopy
27 | ret
28 | docopy:
29 | // find our start address by getting our expected offset, then subtracting it from our actual address
30 | ldr x6, =FixedPcdGet64 (PcdFdBaseAddress)
31 | sub x5, x5, x6 // x5 now holds offset of ArmPlatformPeiBootAction from start of FD base
32 | sub x4, x4, x5 // x4 now holds address of actual FD base
33 | // tweak the return address
34 | // note: x30 is lr; gcc5 doesn't have the alias
35 | sub x30, x30, x4
36 | add x30, x30, x6
37 | ldr x5, =FixedPcdGet64 (PcdFdSize)
38 | // crap memcpy
39 | loop:
40 | ldp x2, x3, [x4], #16
41 | stp x2, x3, [x6], #16
42 | subs x5, x5, #16
43 | b.ne loop
44 | ret
45 | .ltorg
46 |
47 | //UINTN
48 | //ArmPlatformIsPrimaryCore (
49 | // IN UINTN MpId
50 | // );
51 | ASM_FUNC(ArmPlatformIsPrimaryCore)
52 | MOV32 (w1, FixedPcdGet32(PcdArmPrimaryCoreMask))
53 | and x0, x0, x1
54 | MOV32 (w1, FixedPcdGet32(PcdArmPrimaryCore))
55 | cmp w0, w1
56 | cset x0, eq
57 | ret
58 |
59 | //UINTN
60 | //ArmPlatformGetPrimaryCoreMpId (
61 | // VOID
62 | // );
63 | ASM_FUNC(ArmPlatformGetPrimaryCoreMpId)
64 | MOV32 (w0, FixedPcdGet32(PcdArmPrimaryCore))
65 | ret
66 |
67 | //UINTN
68 | //ArmPlatformGetCorePosition (
69 | // IN UINTN MpId
70 | // );
71 | // With this function: CorePos = (ClusterId * 4) + CoreId
72 | ASM_FUNC(ArmPlatformGetCorePosition)
73 | and x1, x0, #ARM_CORE_MASK
74 | and x0, x0, #ARM_CLUSTER_MASK
75 | add x0, x1, x0, LSR #6
76 | ret
77 |
--------------------------------------------------------------------------------
/XiaomiMI8Pkg/Library/XiaomiMI8Lib/XiaomiMI8Lib.inf:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright (c) 2018, Linaro Limited. All rights reserved.
3 | #
4 | # This program and the accompanying materials
5 | # are licensed and made available under the terms and conditions of the BSD License
6 | # which accompanies this distribution. The full text of the license may be found at
7 | # http://opensource.org/licenses/bsd-license.php
8 | #
9 | # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 | # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
11 | #
12 |
13 | [Defines]
14 | INF_VERSION = 0x00010019
15 | BASE_NAME = XiaomiMI8Lib
16 | FILE_GUID = 61620091-45BA-4EFF-8F58-F7ABF228CEBC
17 | MODULE_TYPE = BASE
18 | VERSION_STRING = 1.0
19 | LIBRARY_CLASS = ArmPlatformLib
20 |
21 | [Packages]
22 | ArmPkg/ArmPkg.dec
23 | ArmPlatformPkg/ArmPlatformPkg.dec
24 | EmbeddedPkg/EmbeddedPkg.dec
25 | MdePkg/MdePkg.dec
26 | MdeModulePkg/MdeModulePkg.dec
27 | XiaomiMI8Pkg/XiaomiMI8Pkg.dec
28 |
29 | [LibraryClasses]
30 | ArmLib
31 | HobLib
32 | IoLib
33 | MemoryAllocationLib
34 | SerialPortLib
35 |
36 | [Sources.common]
37 | XiaomiMI8.c
38 | XiaomiMI8Helper.S
39 | XiaomiMI8Mem.c
40 |
41 | [FixedPcd]
42 | gArmTokenSpaceGuid.PcdArmPrimaryCore
43 | gArmTokenSpaceGuid.PcdArmPrimaryCoreMask
44 | gArmTokenSpaceGuid.PcdSystemMemoryBase
45 | gArmTokenSpaceGuid.PcdSystemMemorySize
46 | gArmTokenSpaceGuid.PcdFdBaseAddress
47 | gArmTokenSpaceGuid.PcdFdSize
48 |
--------------------------------------------------------------------------------
/XiaomiMI8Pkg/Library/XiaomiMI8Lib/XiaomiMI8Mem.c:
--------------------------------------------------------------------------------
1 | /** @file
2 | *
3 | * Copyright (c) 2011, ARM Limited. All rights reserved.
4 | * Copyright (c) 2019, RUIKAI LIU and MR TUNNEL. All rights reserved.
5 | *
6 | * This program and the accompanying materials
7 | * are licensed and made available under the terms and conditions of the BSD License
8 | * which accompanies this distribution. The full text of the license may be found at
9 | * http://opensource.org/licenses/bsd-license.php
10 | *
11 | * THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
13 | *
14 | **/
15 |
16 | #include
17 | #include
18 | #include
19 | #include
20 | #include
21 | /**
22 | Return the Virtual Memory Map of your platform
23 | This Virtual Memory Map is used by MemoryInitPei Module to initialize the MMU on your platform.
24 | @param[out] VirtualMemoryMap Array of ARM_MEMORY_REGION_DESCRIPTOR describing a Physical-to-
25 | Virtual Memory mapping. This array must be ended by a zero-filled
26 | entry
27 | **/
28 |
29 | STATIC
30 | VOID
31 | AddHob
32 | (
33 | ARM_MEMORY_REGION_DESCRIPTOR_EX Desc
34 | )
35 | {
36 | BuildResourceDescriptorHob(
37 | Desc.ResourceType,
38 | Desc.ResourceAttribute,
39 | Desc.Address,
40 | Desc.Length
41 | );
42 |
43 | BuildMemoryAllocationHob(
44 | Desc.Address,
45 | Desc.Length,
46 | Desc.MemoryType
47 | );
48 | }
49 |
50 | VOID
51 | ArmPlatformGetVirtualMemoryMap (
52 | IN ARM_MEMORY_REGION_DESCRIPTOR** VirtualMemoryMap
53 | )
54 | {
55 | //TO-DO:ADD MEMORY MAP HERE
56 | ARM_MEMORY_REGION_DESCRIPTOR* MemoryDescriptor;
57 | UINTN Index = 0;
58 |
59 | MemoryDescriptor = (ARM_MEMORY_REGION_DESCRIPTOR*)AllocatePages
60 | (EFI_SIZE_TO_PAGES (sizeof (ARM_MEMORY_REGION_DESCRIPTOR) *
61 | MAX_ARM_MEMORY_REGION_DESCRIPTOR_COUNT));
62 |
63 | // Run through each memory descriptor
64 | while (gDeviceMemoryDescriptorEx[Index].Address != (EFI_PHYSICAL_ADDRESS)0xFFFFFFFF)
65 | {
66 | switch (gDeviceMemoryDescriptorEx[Index].HobOption)
67 | {
68 | case AddMem:
69 | case AddDev:
70 | AddHob(gDeviceMemoryDescriptorEx[Index]);
71 | break;
72 | case NoHob:
73 | default:
74 | goto update;
75 | }
76 |
77 | update:
78 | ASSERT(Index < MAX_ARM_MEMORY_REGION_DESCRIPTOR_COUNT);
79 |
80 | MemoryDescriptor[Index].PhysicalBase = gDeviceMemoryDescriptorEx[Index].Address;
81 | MemoryDescriptor[Index].VirtualBase = gDeviceMemoryDescriptorEx[Index].Address;
82 | MemoryDescriptor[Index].Length = gDeviceMemoryDescriptorEx[Index].Length;
83 | MemoryDescriptor[Index].Attributes = gDeviceMemoryDescriptorEx[Index].ArmAttributes;
84 |
85 | Index++;
86 | }
87 |
88 | // Last one (terminator)
89 | MemoryDescriptor[Index].PhysicalBase = 0;
90 | MemoryDescriptor[Index].VirtualBase = 0;
91 | MemoryDescriptor[Index].Length = 0;
92 | MemoryDescriptor[Index++].Attributes = (ARM_MEMORY_REGION_ATTRIBUTES)0;
93 | ASSERT(Index <= MAX_ARM_MEMORY_REGION_DESCRIPTOR_COUNT);
94 |
95 | *VirtualMemoryMap = &MemoryDescriptor[0];
96 | //ASSERT(0);
97 | }
--------------------------------------------------------------------------------
/XiaomiMI8Pkg/SimpleFbDxe/SimpleFbDxe.c:
--------------------------------------------------------------------------------
1 | /* SimpleFbDxe: Simple FrameBuffer */
2 | #include
3 | #include
4 | #include
5 | #include
6 | #include
7 | #include
8 | #include
9 | #include
10 | #include
11 | #include
12 | #include
13 | #include
14 | #include
15 |
16 | /// Defines
17 | /*
18 | * Convert enum video_log2_bpp to bytes and bits. Note we omit the outer
19 | * brackets to allow multiplication by fractional pixels.
20 | */
21 | #define VNBYTES(bpix) (1 << (bpix)) / 8
22 | #define VNBITS(bpix) (1 << (bpix))
23 |
24 | #define FB_BITS_PER_PIXEL (32)
25 | #define FB_BYTES_PER_PIXEL (FB_BITS_PER_PIXEL / 8)
26 |
27 | /*
28 | * Bits per pixel selector. Each value n is such that the bits-per-pixel is
29 | * 2 ^ n
30 | */
31 | enum video_log2_bpp {
32 | VIDEO_BPP1 = 0,
33 | VIDEO_BPP2,
34 | VIDEO_BPP4,
35 | VIDEO_BPP8,
36 | VIDEO_BPP16,
37 | VIDEO_BPP32,
38 | };
39 |
40 | typedef struct {
41 | VENDOR_DEVICE_PATH DisplayDevicePath;
42 | EFI_DEVICE_PATH EndDevicePath;
43 | } DISPLAY_DEVICE_PATH;
44 |
45 | DISPLAY_DEVICE_PATH mDisplayDevicePath =
46 | {
47 | {
48 | {
49 | HARDWARE_DEVICE_PATH,
50 | HW_VENDOR_DP,
51 | {
52 | (UINT8)(sizeof(VENDOR_DEVICE_PATH)),
53 | (UINT8)((sizeof(VENDOR_DEVICE_PATH)) >> 8),
54 | }
55 | },
56 | EFI_GRAPHICS_OUTPUT_PROTOCOL_GUID
57 | },
58 | {
59 | END_DEVICE_PATH_TYPE,
60 | END_ENTIRE_DEVICE_PATH_SUBTYPE,
61 | {
62 | sizeof(EFI_DEVICE_PATH_PROTOCOL),
63 | 0
64 | }
65 | }
66 | };
67 |
68 | /// Declares
69 |
70 | STATIC FRAME_BUFFER_CONFIGURE *mFrameBufferBltLibConfigure;
71 | STATIC UINTN mFrameBufferBltLibConfigureSize;
72 |
73 | STATIC
74 | EFI_STATUS
75 | EFIAPI
76 | DisplayQueryMode
77 | (
78 | IN EFI_GRAPHICS_OUTPUT_PROTOCOL *This,
79 | IN UINT32 ModeNumber,
80 | OUT UINTN *SizeOfInfo,
81 | OUT EFI_GRAPHICS_OUTPUT_MODE_INFORMATION **Info
82 | );
83 |
84 | STATIC
85 | EFI_STATUS
86 | EFIAPI
87 | DisplaySetMode
88 | (
89 | IN EFI_GRAPHICS_OUTPUT_PROTOCOL *This,
90 | IN UINT32 ModeNumber
91 | );
92 |
93 | STATIC
94 | EFI_STATUS
95 | EFIAPI
96 | DisplayBlt
97 | (
98 | IN EFI_GRAPHICS_OUTPUT_PROTOCOL *This,
99 | IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL *BltBuffer, OPTIONAL
100 | IN EFI_GRAPHICS_OUTPUT_BLT_OPERATION BltOperation,
101 | IN UINTN SourceX,
102 | IN UINTN SourceY,
103 | IN UINTN DestinationX,
104 | IN UINTN DestinationY,
105 | IN UINTN Width,
106 | IN UINTN Height,
107 | IN UINTN Delta OPTIONAL
108 | );
109 |
110 | STATIC EFI_GRAPHICS_OUTPUT_PROTOCOL mDisplay = {
111 | DisplayQueryMode,
112 | DisplaySetMode,
113 | DisplayBlt,
114 | NULL
115 | };
116 |
117 | STATIC
118 | EFI_STATUS
119 | EFIAPI
120 | DisplayQueryMode
121 | (
122 | IN EFI_GRAPHICS_OUTPUT_PROTOCOL *This,
123 | IN UINT32 ModeNumber,
124 | OUT UINTN *SizeOfInfo,
125 | OUT EFI_GRAPHICS_OUTPUT_MODE_INFORMATION **Info
126 | )
127 | {
128 | EFI_STATUS Status;
129 | Status = gBS->AllocatePool(
130 | EfiBootServicesData,
131 | sizeof(EFI_GRAPHICS_OUTPUT_MODE_INFORMATION),
132 | (VOID **) Info);
133 |
134 | ASSERT_EFI_ERROR(Status);
135 |
136 | *SizeOfInfo = sizeof(EFI_GRAPHICS_OUTPUT_MODE_INFORMATION);
137 | (*Info)->Version = This->Mode->Info->Version;
138 | (*Info)->HorizontalResolution = This->Mode->Info->HorizontalResolution;
139 | (*Info)->VerticalResolution = This->Mode->Info->VerticalResolution;
140 | (*Info)->PixelFormat = This->Mode->Info->PixelFormat;
141 | (*Info)->PixelsPerScanLine = This->Mode->Info->PixelsPerScanLine;
142 |
143 | return EFI_SUCCESS;
144 | }
145 |
146 | STATIC
147 | EFI_STATUS
148 | EFIAPI
149 | DisplaySetMode
150 | (
151 | IN EFI_GRAPHICS_OUTPUT_PROTOCOL *This,
152 | IN UINT32 ModeNumber
153 | )
154 | {
155 | return EFI_SUCCESS;
156 | }
157 |
158 | STATIC
159 | EFI_STATUS
160 | EFIAPI
161 | DisplayBlt
162 | (
163 | IN EFI_GRAPHICS_OUTPUT_PROTOCOL *This,
164 | IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL *BltBuffer, OPTIONAL
165 | IN EFI_GRAPHICS_OUTPUT_BLT_OPERATION BltOperation,
166 | IN UINTN SourceX,
167 | IN UINTN SourceY,
168 | IN UINTN DestinationX,
169 | IN UINTN DestinationY,
170 | IN UINTN Width,
171 | IN UINTN Height,
172 | IN UINTN Delta OPTIONAL
173 | )
174 | {
175 |
176 | RETURN_STATUS Status;
177 | EFI_TPL Tpl;
178 | //
179 | // We have to raise to TPL_NOTIFY, so we make an atomic write to the frame buffer.
180 | // We would not want a timer based event (Cursor, ...) to come in while we are
181 | // doing this operation.
182 | //
183 | Tpl = gBS->RaiseTPL (TPL_NOTIFY);
184 | Status = FrameBufferBlt (
185 | mFrameBufferBltLibConfigure,
186 | BltBuffer,
187 | BltOperation,
188 | SourceX, SourceY,
189 | DestinationX, DestinationY, Width, Height,
190 | Delta
191 | );
192 | gBS->RestoreTPL (Tpl);
193 |
194 | // zhuowei: hack: flush the cache manually since my memory maps are still broken
195 | WriteBackInvalidateDataCacheRange((void*)mDisplay.Mode->FrameBufferBase,
196 | mDisplay.Mode->FrameBufferSize);
197 | // zhuowei: end hack
198 |
199 | return RETURN_ERROR (Status) ? EFI_INVALID_PARAMETER : EFI_SUCCESS;
200 | }
201 |
202 | EFI_STATUS
203 | EFIAPI
204 | SimpleFbDxeInitialize
205 | (
206 | IN EFI_HANDLE ImageHandle,
207 | IN EFI_SYSTEM_TABLE *SystemTable
208 | )
209 | {
210 |
211 | EFI_STATUS Status = EFI_SUCCESS;
212 | EFI_HANDLE hUEFIDisplayHandle = NULL;
213 |
214 | /* Retrieve simple frame buffer from pre-SEC bootloader */
215 | DEBUG((EFI_D_ERROR, "SimpleFbDxe: Retrieve MIPI FrameBuffer parameters from PCD\n"));
216 | UINT32 MipiFrameBufferAddr = FixedPcdGet32(PcdMipiFrameBufferAddress);
217 | UINT32 MipiFrameBufferWidth = FixedPcdGet32(PcdMipiFrameBufferWidth);
218 | UINT32 MipiFrameBufferHeight = FixedPcdGet32(PcdMipiFrameBufferHeight);
219 |
220 | /* Sanity check */
221 | if (MipiFrameBufferAddr == 0 || MipiFrameBufferWidth == 0 || MipiFrameBufferHeight == 0)
222 | {
223 | DEBUG((EFI_D_ERROR, "SimpleFbDxe: Invalid FrameBuffer parameters\n"));
224 | return EFI_DEVICE_ERROR;
225 | }
226 |
227 | /* Prepare struct */
228 | if (mDisplay.Mode == NULL)
229 | {
230 | Status = gBS->AllocatePool(
231 | EfiBootServicesData,
232 | sizeof(EFI_GRAPHICS_OUTPUT_PROTOCOL_MODE),
233 | (VOID **) &mDisplay.Mode
234 | );
235 |
236 | ASSERT_EFI_ERROR(Status);
237 | if (EFI_ERROR(Status)) return Status;
238 |
239 | ZeroMem(mDisplay.Mode, sizeof(EFI_GRAPHICS_OUTPUT_PROTOCOL_MODE));
240 | }
241 |
242 | if (mDisplay.Mode->Info == NULL)
243 | {
244 | Status = gBS->AllocatePool(
245 | EfiBootServicesData,
246 | sizeof(EFI_GRAPHICS_OUTPUT_MODE_INFORMATION),
247 | (VOID **) &mDisplay.Mode->Info
248 | );
249 |
250 | ASSERT_EFI_ERROR(Status);
251 | if (EFI_ERROR(Status)) return Status;
252 |
253 | ZeroMem(mDisplay.Mode->Info, sizeof(EFI_GRAPHICS_OUTPUT_MODE_INFORMATION));
254 | }
255 |
256 | /* Set information */
257 | mDisplay.Mode->MaxMode = 1;
258 | mDisplay.Mode->Mode = 0;
259 | mDisplay.Mode->Info->Version = 0;
260 |
261 | mDisplay.Mode->Info->HorizontalResolution = MipiFrameBufferWidth;
262 | mDisplay.Mode->Info->VerticalResolution = MipiFrameBufferHeight;
263 |
264 | /* SimpleFB runs on a8r8g8b8 (VIDEO_BPP32) for DB410c */
265 | UINT32 LineLength = MipiFrameBufferWidth * VNBYTES(VIDEO_BPP32);
266 | UINT32 FrameBufferSize = LineLength * MipiFrameBufferHeight;
267 | EFI_PHYSICAL_ADDRESS FrameBufferAddress = MipiFrameBufferAddr;
268 |
269 | mDisplay.Mode->Info->PixelsPerScanLine = MipiFrameBufferWidth;
270 | mDisplay.Mode->Info->PixelFormat = PixelBlueGreenRedReserved8BitPerColor;
271 | mDisplay.Mode->SizeOfInfo = sizeof(EFI_GRAPHICS_OUTPUT_MODE_INFORMATION);
272 | mDisplay.Mode->FrameBufferBase = FrameBufferAddress;
273 | mDisplay.Mode->FrameBufferSize = FrameBufferSize;
274 |
275 | //
276 | // Create the FrameBufferBltLib configuration.
277 | //
278 | Status = FrameBufferBltConfigure (
279 | (VOID *) (UINTN) mDisplay.Mode->FrameBufferBase,
280 | mDisplay.Mode->Info,
281 | mFrameBufferBltLibConfigure,
282 | &mFrameBufferBltLibConfigureSize
283 | );
284 | if (Status == RETURN_BUFFER_TOO_SMALL) {
285 | mFrameBufferBltLibConfigure = AllocatePool (mFrameBufferBltLibConfigureSize);
286 | if (mFrameBufferBltLibConfigure != NULL) {
287 | Status = FrameBufferBltConfigure (
288 | (VOID *) (UINTN) mDisplay.Mode->FrameBufferBase,
289 | mDisplay.Mode->Info,
290 | mFrameBufferBltLibConfigure,
291 | &mFrameBufferBltLibConfigureSize
292 | );
293 | }
294 | }
295 | ASSERT_EFI_ERROR (Status);
296 |
297 | // zhuowei: clear the screen to black
298 | // UEFI standard requires this, since text is white - see OvmfPkg/QemuVideoDxe/Gop.c
299 | ZeroMem((void*)FrameBufferAddress, FrameBufferSize);
300 | // hack: clear cache
301 | WriteBackInvalidateDataCacheRange((void*)FrameBufferAddress, FrameBufferSize);
302 | // zhuowei: end
303 |
304 | /* Register handle */
305 | Status = gBS->InstallMultipleProtocolInterfaces(
306 | &hUEFIDisplayHandle,
307 | &gEfiDevicePathProtocolGuid,
308 | &mDisplayDevicePath,
309 | &gEfiGraphicsOutputProtocolGuid,
310 | &mDisplay,
311 | NULL);
312 |
313 | ASSERT_EFI_ERROR (Status);
314 |
315 | return Status;
316 |
317 | }
318 |
--------------------------------------------------------------------------------
/XiaomiMI8Pkg/SimpleFbDxe/SimpleFbDxe.inf:
--------------------------------------------------------------------------------
1 | # SimpleFbDxe.inf: Implements Simple FrameBuffer in UEFI.
2 |
3 | [Defines]
4 | INF_VERSION = 0x00010005
5 | BASE_NAME = SimpleFbDxe
6 | FILE_GUID = dcfd1e6d-788d-4ffc-8e1b-ca2f75651a92
7 | MODULE_TYPE = DXE_DRIVER
8 | VERSION_STRING = 1.0
9 | ENTRY_POINT = SimpleFbDxeInitialize
10 |
11 | [Sources.common]
12 | SimpleFbDxe.c
13 |
14 | [Packages]
15 | MdePkg/MdePkg.dec
16 | MdeModulePkg/MdeModulePkg.dec
17 | EmbeddedPkg/EmbeddedPkg.dec
18 | ArmPkg/ArmPkg.dec
19 | XiaomiMI8Pkg/XiaomiMI8Pkg.dec
20 |
21 | [LibraryClasses]
22 | BaseLib
23 | ReportStatusCodeLib
24 | UefiLib
25 | UefiBootServicesTableLib
26 | UefiDriverEntryPoint
27 | BaseMemoryLib
28 | DebugLib
29 | PcdLib
30 | FrameBufferBltLib
31 | CacheMaintenanceLib
32 |
33 | [Protocols]
34 | gEfiGraphicsOutputProtocolGuid ## PRODUCES
35 | gEfiCpuArchProtocolGuid
36 |
37 | [FixedPcd]
38 | gXiaomiMI8PkgTokenSpaceGuid.PcdMipiFrameBufferAddress
39 | gXiaomiMI8PkgTokenSpaceGuid.PcdMipiFrameBufferWidth
40 | gXiaomiMI8PkgTokenSpaceGuid.PcdMipiFrameBufferHeight
41 |
42 | [Guids]
43 | gEfiMdeModulePkgTokenSpaceGuid
44 |
45 | [Pcd]
46 | gEfiMdeModulePkgTokenSpaceGuid.PcdVideoHorizontalResolution
47 | gEfiMdeModulePkgTokenSpaceGuid.PcdVideoVerticalResolution
48 |
49 | [Depex]
50 | gEfiCpuArchProtocolGuid
51 |
52 |
--------------------------------------------------------------------------------
/XiaomiMI8Pkg/XiaomiMI8Dxe/XiaomiMI8Dxe.c:
--------------------------------------------------------------------------------
1 | /** @file
2 | *
3 | * Copyright (c) 2018, Linaro Ltd. All rights reserved.
4 | *
5 | * This program and the accompanying materials
6 | * are licensed and made available under the terms and conditions of the BSD License
7 | * which accompanies this distribution. The full text of the license may be found at
8 | * http://opensource.org/licenses/bsd-license.php
9 | *
10 | * THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 | * WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
12 | *
13 | **/
14 |
15 | #include
16 |
17 | #include
18 | #include
19 | #include
20 | #include
21 | #include
22 | #include
23 | #include
24 | #include
25 | #include
26 | #include
27 | #include
28 | #include
29 | #include
30 |
31 | #include
32 | #include
33 | #include
34 | #include
35 | #include
36 |
37 | #include "XiaomiMI8Dxe.h"
38 |
39 | EFI_CPU_ARCH_PROTOCOL *gCpu;
40 |
41 | VOID
42 | InitPeripherals (
43 | IN VOID
44 | )
45 | {
46 | //This mainly works.
47 | EFI_STATUS Status;
48 |
49 | Status = gCpu->SetMemoryAttributes (gCpu, 0xa1a10000, 0x200000,
50 | EFI_MEMORY_UC | EFI_MEMORY_XP);
51 | ASSERT_EFI_ERROR (Status);
52 | Status = gCpu->SetMemoryAttributes (gCpu, 0x9d400000, 0x2400000,
53 | EFI_MEMORY_WC | EFI_MEMORY_XP);
54 | ASSERT_EFI_ERROR (Status);
55 | }
56 |
57 | /**
58 | Notification function of the event defined as belonging to the
59 | EFI_END_OF_DXE_EVENT_GROUP_GUID event group that was created in
60 | the entry point of the driver.
61 |
62 | This function is called when an event belonging to the
63 | EFI_END_OF_DXE_EVENT_GROUP_GUID event group is signalled. Such an
64 | event is signalled once at the end of the dispatching of all
65 | drivers (end of the so called DXE phase).
66 |
67 | @param[in] Event Event declared in the entry point of the driver whose
68 | notification function is being invoked.
69 | @param[in] Context NULL
70 | **/
71 | STATIC
72 | VOID
73 | OnEndOfDxe (
74 | IN EFI_EVENT Event,
75 | IN VOID *Context
76 | )
77 | {
78 | }
79 |
80 | EFI_STATUS
81 | EFIAPI
82 | XiaomiMI8EntryPoint (
83 | IN EFI_HANDLE ImageHandle,
84 | IN EFI_SYSTEM_TABLE *SystemTable
85 | )
86 | {
87 | EFI_STATUS Status;
88 | EFI_EVENT EndOfDxeEvent;
89 |
90 | Status = gBS->LocateProtocol (&gEfiCpuArchProtocolGuid, NULL, (VOID **)&gCpu);
91 | ASSERT_EFI_ERROR(Status);
92 |
93 | InitPeripherals ();
94 |
95 | //
96 | // Create an event belonging to the "gEfiEndOfDxeEventGroupGuid" group.
97 | // The "OnEndOfDxe()" function is declared as the call back function.
98 | // It will be called at the end of the DXE phase when an event of the
99 | // same group is signalled to inform about the end of the DXE phase.
100 | // Install the INSTALL_FDT_PROTOCOL protocol.
101 | //
102 | Status = gBS->CreateEventEx (
103 | EVT_NOTIFY_SIGNAL,
104 | TPL_CALLBACK,
105 | OnEndOfDxe,
106 | NULL,
107 | &gEfiEndOfDxeEventGroupGuid,
108 | &EndOfDxeEvent
109 | );
110 | return Status;
111 | }
112 |
--------------------------------------------------------------------------------
/XiaomiMI8Pkg/XiaomiMI8Dxe/XiaomiMI8Dxe.h:
--------------------------------------------------------------------------------
1 | /** @file
2 | *
3 | * Copyright (c) 2018, Linaro Ltd. All rights reserved.
4 | *
5 | * This program and the accompanying materials
6 | * are licensed and made available under the terms and conditions of the BSD License
7 | * which accompanies this distribution. The full text of the license may be found at
8 | * http://opensource.org/licenses/bsd-license.php
9 | *
10 | * THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 | * WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
12 | *
13 | **/
14 |
15 | #ifndef __PIXEL3XLDXE_H__
16 | #define __PIXEL3XLDXE_H__
17 |
18 | #endif /* __PIXEL3XLDXE_H__ */
19 |
--------------------------------------------------------------------------------
/XiaomiMI8Pkg/XiaomiMI8Dxe/XiaomiMI8Dxe.inf:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright (c) 2018, Linaro Limited. All rights reserved.
3 | #
4 | # This program and the accompanying materials
5 | # are licensed and made available under the terms and conditions of the BSD License
6 | # which accompanies this distribution. The full text of the license may be found at
7 | # http://opensource.org/licenses/bsd-license.php
8 | #
9 | # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 | # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
11 | #
12 |
13 | [Defines]
14 | INF_VERSION = 0x0001001a
15 | BASE_NAME = XiaomiMI8Dxe
16 | FILE_GUID = 422BB380-0FFB-41EC-B86E-AE70F8A02DA3
17 | MODULE_TYPE = DXE_DRIVER
18 | VERSION_STRING = 1.0
19 | ENTRY_POINT = XiaomiMI8EntryPoint
20 |
21 | [Sources.common]
22 | XiaomiMI8Dxe.c
23 |
24 | [Packages]
25 | EmbeddedPkg/EmbeddedPkg.dec
26 | MdeModulePkg/MdeModulePkg.dec
27 | MdePkg/MdePkg.dec
28 |
29 | [LibraryClasses]
30 | BaseMemoryLib
31 | CacheMaintenanceLib
32 | DxeServicesTableLib
33 | IoLib
34 | PcdLib
35 | TimerLib
36 | UefiDriverEntryPoint
37 | UefiLib
38 |
39 | [Protocols]
40 | gEfiDevicePathFromTextProtocolGuid
41 | gEfiLoadedImageProtocolGuid
42 | gEfiCpuArchProtocolGuid
43 |
44 | [Guids]
45 | gEfiEndOfDxeEventGroupGuid
46 |
47 | [Depex]
48 | gEfiCpuArchProtocolGuid
49 |
--------------------------------------------------------------------------------
/XiaomiMI8Pkg/XiaomiMI8Pkg.dec:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright (c) 2018, Linaro Limited. All rights reserved.
3 | #
4 | # This program and the accompanying materials
5 | # are licensed and made available under the terms and conditions of the BSD License
6 | # which accompanies this distribution. The full text of the license may be found at
7 | # http://opensource.org/licenses/bsd-license.php
8 | #
9 | # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 | # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
11 | #
12 |
13 | [Defines]
14 | DEC_SPECIFICATION = 0x0001001a
15 | PACKAGE_NAME = XiaomiMI8Pkg
16 | PACKAGE_GUID = 7eb1de03-3910-4d1d-84ce-c17b53636b9a
17 | PACKAGE_VERSION = 0.1
18 |
19 | ################################################################################
20 | #
21 | # Include Section - list of Include Paths that are provided by this package.
22 | # Comments are used for Keywords and Module Types.
23 | #
24 | # Supported Module Types:
25 | # BASE SEC PEI_CORE PEIM DXE_CORE DXE_DRIVER DXE_RUNTIME_DRIVER DXE_SMM_DRIVER DXE_SAL_DRIVER UEFI_DRIVER UEFI_APPLICATION
26 | #
27 | ################################################################################
28 | [Includes.common]
29 | Include # Root include for the package
30 |
31 | [Guids.common]
32 | gXiaomiMI8PkgTokenSpaceGuid = { 0x99a14446, 0xaad7, 0xe460, {0xb4, 0xe5, 0x1f, 0x79, 0xaa, 0xa4, 0x93, 0xfd } }
33 |
34 | [Protocols]
35 | gEFIDroidKeypadDeviceProtocolGuid = { 0xb27625b5, 0x0b6c, 0x4614, { 0xaa, 0x3c, 0x33, 0x13, 0xb5, 0x1d, 0x36, 0x46 } }
36 |
37 |
38 | [PcdsFixedAtBuild.common]
39 | # Simple FrameBuffer
40 | gXiaomiMI8PkgTokenSpaceGuid.PcdMipiFrameBufferAddress|0x00400000|UINT32|0x0000a400
41 | gXiaomiMI8PkgTokenSpaceGuid.PcdMipiFrameBufferWidth|1080|UINT32|0x0000a401
42 | gXiaomiMI8PkgTokenSpaceGuid.PcdMipiFrameBufferHeight|2248|UINT32|0x0000a402
43 | gXiaomiMI8PkgTokenSpaceGuid.PcdMipiFrameBufferPixelBpp|32|UINT32|0x0000a403
44 | gXiaomiMI8PkgTokenSpaceGuid.PcdMipiFrameBufferVisibleWidth|1080|UINT32|0x0000a404
45 | gXiaomiMI8PkgTokenSpaceGuid.PcdMipiFrameBufferVisibleHeight|2248|UINT32|0x0000a405
46 | # RTC information
47 | gXiaomiMI8PkgTokenSpaceGuid.PcdBootShimInfo1|0xb0000000|UINT64|0x00000a601
48 |
--------------------------------------------------------------------------------
/azure-pipelines.yml:
--------------------------------------------------------------------------------
1 | trigger:
2 | - master
3 |
4 | pool:
5 | vmImage: 'Ubuntu-18.04'
6 |
7 | steps:
8 | - script: |
9 | bash ci-build.sh
10 | displayName: 'ci-build'
--------------------------------------------------------------------------------
/bootimg.cfg:
--------------------------------------------------------------------------------
1 | bootsize =
2 | pagesize = 0x1000
3 | kerneladdr = 0x8000
4 | ramdiskaddr = 0x1000000
5 | secondaddr = 0xf00000
6 | tagsaddr = 0x100
7 | name = thisconfig
8 | cmdline =
--------------------------------------------------------------------------------
/build.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # based on the instructions from edk2-platform
3 | #if throw error then exit
4 | set -e
5 |
6 | figlet Edk2-Dipper
7 |
8 | echo [BuildTools] Cleanning BuidFiles
9 |
10 | echo [BuildTools] Now Cleanning Workspace
11 | rm -rf workspace/*
12 | echo [BuildTools] Clean Done.
13 |
14 | echo [BuildTools] Now Cleanning AcpiTables
15 | rm -rf XiaomiMI8Pkg/AcpiTables/SDM850/DSDT.aml
16 | echo [BuildTools] Clean Done.
17 |
18 | echo [BuildTools] Now Cleanning Image
19 | rm -rf uefi.img
20 | rm -rf boot.img
21 | echo [BuildTools] Clean Done.
22 |
23 | echo [BuildTools] Building ACPI Tables
24 |
25 | echo [BuildTools] Now Building DSDT Table
26 | iasl -f XiaomiMI8Pkg/AcpiTables/Source/DSDT.dsl
27 | echo [BuildTools] Done.
28 | echo [BuildTools] Now Moveing DSDT Table to Target Folder
29 | mv XiaomiMI8Pkg/AcpiTables/Source/DSDT.aml XiaomiMI8Pkg/AcpiTables/SDM850/DSDT.aml
30 | echo [BuildTools] Done.
31 |
32 | echo [BuildTools] Build ACPI Tables Done.
33 |
34 | echo [BuildTools] Building UEFI Firmware
35 |
36 | echo [BuildTools] Now Building Edk2 Environment
37 | . build_common.sh
38 | echo [BuildTools] Done.
39 |
40 | echo [BuildTools] Now Building UEFI_FV
41 | # not actually GCC5; it's GCC7 on Ubuntu 18.04.
42 | GCC5_AARCH64_PREFIX=aarch64-linux-gnu- build -s -n 0 -a AARCH64 -t GCC5 -p XiaomiMI8Pkg/XiaomiMI8Pkg.dsc
43 | echo [BuildTools] Done.
44 |
45 | echo [BuildTools] Now Making boot.img
46 | gzip -c < workspace/Build/XiaomiMI8Pkg/DEBUG_GCC5/FV/XIAOMIMI8PKG_UEFI.fd >uefi_img
47 | cat dipper.dtb >>uefi_img
48 | # build Abooting Img
49 | abootimg --create boot.img -k uefi_img -r ramdisk -f bootimg.cfg
50 | rm -rf ./uefi_img
51 | echo [BuildTools] Done.
52 |
53 | echo [BuildTools] Now Making uefi.img
54 | # build common
55 | gzip -c < workspace/Build/XiaomiMI8Pkg/DEBUG_GCC5/FV/XIAOMIMI8PKG_UEFI.fd >uefi.img
56 | cat dipper.dtb >>uefi.img
57 | echo [BuildTools] Done.
58 |
59 | echo [BuildTools] Compile Finished, Enjoy It Now.
--------------------------------------------------------------------------------
/build_common.sh:
--------------------------------------------------------------------------------
1 | export PACKAGES_PATH=$PWD/../edk2:$PWD/../edk2-platforms:$PWD
2 | export WORKSPACE=$PWD/workspace
3 | . ../edk2/edksetup.sh
4 |
--------------------------------------------------------------------------------
/ci-build.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | set -e
3 | echo [BuildTools] Now Start CIBuid
4 | sudo apt update
5 | sudo apt install -y build-essential uuid-dev iasl git nasm gcc-aarch64-linux-gnu bc abootimg figlet
6 | figlet Edk2-Dipper-CI
7 | curdir="$PWD"
8 | cd ..
9 | git clone https://github.com/tianocore/edk2.git --recursive
10 | git clone https://github.com/tianocore/edk2-platforms.git
11 | cd "$curdir"
12 | bash firstrun.sh
13 | bash build.sh
--------------------------------------------------------------------------------
/dipper.dtb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NekokeCore/edk2-dipper/40783e64e903c79f9b02f1d35cb15630d35c603e/dipper.dtb
--------------------------------------------------------------------------------
/firstrun.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # based on the instructions from edk2-platform
3 | # do this first:
4 | # https://github.com/tianocore/tianocore.github.io/wiki/Using-EDK-II-with-Native-GCC#Install_required_software_from_apt
5 | set -e
6 | figlet Edk2-Dipper
7 | echo [BuildTools] Now Building Edk2 Environment
8 | . build_common.sh
9 | make -C ../edk2/BaseTools
10 | echo [BuildTools] Done.
11 |
--------------------------------------------------------------------------------
/ramdisk:
--------------------------------------------------------------------------------
1 | fake
--------------------------------------------------------------------------------
/workspace/.gitignore:
--------------------------------------------------------------------------------
1 | # Ignore everything in this directory
2 | *
3 | # Except this file
4 | !.gitignore
--------------------------------------------------------------------------------