├── .gitignore
├── GalaxyA72
├── AcpiTables
│ ├── AcpiSsdtRootPci.asl
│ ├── AcpiTables.inf
│ ├── Dbg2.aslc
│ ├── Dsdt.asl
│ ├── Fadt.aslc
│ ├── Gtdt.aslc
│ ├── Madt.aslc
│ ├── Spcr.aslc
│ └── test
│ │ ├── DBG2.aml
│ │ ├── DSDT.aml
│ │ ├── FACP.aml
│ │ ├── GTDT.aml
│ │ ├── IORT.aml
│ │ ├── MADT.aml
│ │ └── PPTT.aml
├── Binary
│ ├── ChipInfo
│ │ ├── ChipInfo.depex
│ │ └── ChipInfo.efi
│ ├── ClockDxe
│ │ ├── ClockDxe.depex
│ │ └── ClockDxe.efi
│ ├── CmdDbDxe
│ │ ├── CmdDbDxe.depex
│ │ └── CmdDbDxe.efi
│ ├── DALSys
│ │ ├── DALSys.depex
│ │ └── DALSys.efi
│ ├── DALTLMM
│ │ ├── DALTLMM.depex
│ │ └── DALTLMM.efi
│ ├── DDRInfoDxe
│ │ ├── DDRInfoDxe.depex
│ │ └── DDRInfoDxe.efi
│ ├── HALIOMMU
│ │ ├── HALIOMMU.depex
│ │ └── HALIOMMU.efi
│ ├── HWIODxeDriver
│ │ ├── HWIODxeDriver.depex
│ │ └── HWIODxeDriver.efi
│ ├── NpaDxe
│ │ ├── NpaDxe.depex
│ │ └── NpaDxe.efi
│ ├── PdcDxe
│ │ ├── PdcDxe.depex
│ │ └── PdcDxe.efi
│ ├── PlatformInfoDxeDriver
│ │ ├── PlatformInfoDxeDriver.depex
│ │ └── PlatformInfoDxeDriver.efi
│ ├── PmicDxe
│ │ ├── PmicDxe.depex
│ │ └── PmicDxe.efi
│ ├── RpmhDxe
│ │ ├── RpmhDxe.depex
│ │ └── RpmhDxe.efi
│ ├── SPMI
│ │ ├── SPMI.depex
│ │ └── SPMI.efi
│ ├── ShmBridgeDxe
│ │ ├── ShmBridgeDxe.depex
│ │ └── ShmBridgeDxe.efi
│ ├── SmemDxe
│ │ ├── SmemDxe.depex
│ │ └── SmemDxe.efi
│ ├── UFSDxe
│ │ ├── UFSDxe.depex
│ │ └── UFSDxe.efi
│ └── ULogDxe
│ │ ├── ULogDxe.depex
│ │ └── ULogDxe.efi
├── CommonDsc.dsc.inc
├── 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
├── GalaxyA72.dec
├── GalaxyA72.dsc
├── GalaxyA72.fdf
├── GalaxyA72Dxe
│ ├── GalaxyA72Dxe.c
│ ├── GalaxyA72Dxe.h
│ └── GalaxyA72Dxe.inf
├── GalaxyA72_6G.dsc
├── GalaxyA72_8G.dsc
├── Include
│ ├── ArmPlatform.h
│ ├── Configuration
│ │ ├── BootDevices.h
│ │ └── DeviceMemoryMap.h
│ ├── Library
│ │ ├── AcpiPlatformUpdateLib.h
│ │ ├── AslUpdateLib.h
│ │ └── FrameBufferSerialPortLib.h
│ ├── Protocol
│ │ ├── EFIChipInfo.h
│ │ ├── EFIChipInfoTypes.h
│ │ ├── EFIPlatformInfo.h
│ │ ├── EFIPlatformInfoTypes.h
│ │ └── EFISmem.h
│ └── Resources
│ │ ├── FbColor.h
│ │ └── font5x12.h
├── Library
│ ├── AcpiPlatformUpdateLib
│ │ ├── AcpiPlatformUpdateLib.c
│ │ └── AcpiPlatformUpdateLib.inf
│ ├── ArmMmuLib
│ │ ├── AArch64
│ │ │ ├── ArmMmuLibCore.c
│ │ │ ├── ArmMmuLibReplaceEntry.S
│ │ │ └── ArmMmuPeiLibConstructor.c
│ │ ├── Arm
│ │ │ ├── ArmMmuLibCore.c
│ │ │ ├── ArmMmuLibV7Support.S
│ │ │ └── ArmMmuLibV7Support.asm
│ │ ├── ArmMmuBaseLib.inf
│ │ └── ArmMmuPeiLib.inf
│ ├── DxeAslUpdateLib
│ │ ├── DxeAslUpdateLib.c
│ │ └── DxeAslUpdateLib.inf
│ ├── FrameBufferSerialPortLib
│ │ ├── FrameBufferSerialPortLib.c
│ │ ├── FrameBufferSerialPortLib.h
│ │ └── FrameBufferSerialPortLib.inf
│ ├── GalaxyA72Lib
│ │ ├── GalaxyA72.c
│ │ ├── GalaxyA72Helper.S
│ │ ├── GalaxyA72Lib.inf
│ │ └── GalaxyA72Mem.c
│ ├── InMemorySerialPortLib
│ │ ├── InMemorySerialPortLib.c
│ │ ├── InMemorySerialPortLib.inf
│ │ └── InMemorySerialPortLib.uni
│ ├── MemoryInitPeiLib
│ │ ├── MemoryInitPeiLib.c
│ │ └── PeiMemoryAllocationLib.inf
│ ├── PlatformBootManagerLib
│ │ ├── PlatformBm.c
│ │ ├── PlatformBm.h
│ │ └── PlatformBootManagerLib.inf
│ └── PlatformPeiLib
│ │ ├── PlatformPeiLib.c
│ │ └── PlatformPeiLib.inf
└── SimpleFbDxe
│ ├── SimpleFbDxe.c
│ └── SimpleFbDxe.inf
├── README.md
├── a72q.dtb
├── build.sh
├── build_8G.sh
├── build_common.sh
├── build_debug.sh
└── firstrun.sh
/.gitignore:
--------------------------------------------------------------------------------
1 | #Build Script
2 | /uefi.img
3 | /boot-a72q*.img
4 | /ramdisk
5 | /workspace
6 |
7 | #VSCode
8 | .vscode
--------------------------------------------------------------------------------
/GalaxyA72/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 |
--------------------------------------------------------------------------------
/GalaxyA72/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 = GalaxyA72AcpiTables
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 | GalaxyA72/GalaxyA72.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 |
--------------------------------------------------------------------------------
/GalaxyA72/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 |
--------------------------------------------------------------------------------
/GalaxyA72/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 |
--------------------------------------------------------------------------------
/GalaxyA72/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 |
--------------------------------------------------------------------------------
/GalaxyA72/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 |
--------------------------------------------------------------------------------
/GalaxyA72/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 |
--------------------------------------------------------------------------------
/GalaxyA72/AcpiTables/test/DBG2.aml:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/map220v/edk2-a72q/ab0a45671a90e7cc94eca1aa966238091385732c/GalaxyA72/AcpiTables/test/DBG2.aml
--------------------------------------------------------------------------------
/GalaxyA72/AcpiTables/test/DSDT.aml:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/map220v/edk2-a72q/ab0a45671a90e7cc94eca1aa966238091385732c/GalaxyA72/AcpiTables/test/DSDT.aml
--------------------------------------------------------------------------------
/GalaxyA72/AcpiTables/test/FACP.aml:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/map220v/edk2-a72q/ab0a45671a90e7cc94eca1aa966238091385732c/GalaxyA72/AcpiTables/test/FACP.aml
--------------------------------------------------------------------------------
/GalaxyA72/AcpiTables/test/GTDT.aml:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/map220v/edk2-a72q/ab0a45671a90e7cc94eca1aa966238091385732c/GalaxyA72/AcpiTables/test/GTDT.aml
--------------------------------------------------------------------------------
/GalaxyA72/AcpiTables/test/IORT.aml:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/map220v/edk2-a72q/ab0a45671a90e7cc94eca1aa966238091385732c/GalaxyA72/AcpiTables/test/IORT.aml
--------------------------------------------------------------------------------
/GalaxyA72/AcpiTables/test/MADT.aml:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/map220v/edk2-a72q/ab0a45671a90e7cc94eca1aa966238091385732c/GalaxyA72/AcpiTables/test/MADT.aml
--------------------------------------------------------------------------------
/GalaxyA72/AcpiTables/test/PPTT.aml:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/map220v/edk2-a72q/ab0a45671a90e7cc94eca1aa966238091385732c/GalaxyA72/AcpiTables/test/PPTT.aml
--------------------------------------------------------------------------------
/GalaxyA72/Binary/ChipInfo/ChipInfo.depex:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/map220v/edk2-a72q/ab0a45671a90e7cc94eca1aa966238091385732c/GalaxyA72/Binary/ChipInfo/ChipInfo.depex
--------------------------------------------------------------------------------
/GalaxyA72/Binary/ChipInfo/ChipInfo.efi:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/map220v/edk2-a72q/ab0a45671a90e7cc94eca1aa966238091385732c/GalaxyA72/Binary/ChipInfo/ChipInfo.efi
--------------------------------------------------------------------------------
/GalaxyA72/Binary/ClockDxe/ClockDxe.depex:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/map220v/edk2-a72q/ab0a45671a90e7cc94eca1aa966238091385732c/GalaxyA72/Binary/ClockDxe/ClockDxe.depex
--------------------------------------------------------------------------------
/GalaxyA72/Binary/ClockDxe/ClockDxe.efi:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/map220v/edk2-a72q/ab0a45671a90e7cc94eca1aa966238091385732c/GalaxyA72/Binary/ClockDxe/ClockDxe.efi
--------------------------------------------------------------------------------
/GalaxyA72/Binary/CmdDbDxe/CmdDbDxe.depex:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/GalaxyA72/Binary/CmdDbDxe/CmdDbDxe.efi:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/map220v/edk2-a72q/ab0a45671a90e7cc94eca1aa966238091385732c/GalaxyA72/Binary/CmdDbDxe/CmdDbDxe.efi
--------------------------------------------------------------------------------
/GalaxyA72/Binary/DALSys/DALSys.depex:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/map220v/edk2-a72q/ab0a45671a90e7cc94eca1aa966238091385732c/GalaxyA72/Binary/DALSys/DALSys.depex
--------------------------------------------------------------------------------
/GalaxyA72/Binary/DALSys/DALSys.efi:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/map220v/edk2-a72q/ab0a45671a90e7cc94eca1aa966238091385732c/GalaxyA72/Binary/DALSys/DALSys.efi
--------------------------------------------------------------------------------
/GalaxyA72/Binary/DALTLMM/DALTLMM.depex:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/map220v/edk2-a72q/ab0a45671a90e7cc94eca1aa966238091385732c/GalaxyA72/Binary/DALTLMM/DALTLMM.depex
--------------------------------------------------------------------------------
/GalaxyA72/Binary/DALTLMM/DALTLMM.efi:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/map220v/edk2-a72q/ab0a45671a90e7cc94eca1aa966238091385732c/GalaxyA72/Binary/DALTLMM/DALTLMM.efi
--------------------------------------------------------------------------------
/GalaxyA72/Binary/DDRInfoDxe/DDRInfoDxe.depex:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/GalaxyA72/Binary/DDRInfoDxe/DDRInfoDxe.efi:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/map220v/edk2-a72q/ab0a45671a90e7cc94eca1aa966238091385732c/GalaxyA72/Binary/DDRInfoDxe/DDRInfoDxe.efi
--------------------------------------------------------------------------------
/GalaxyA72/Binary/HALIOMMU/HALIOMMU.depex:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/map220v/edk2-a72q/ab0a45671a90e7cc94eca1aa966238091385732c/GalaxyA72/Binary/HALIOMMU/HALIOMMU.depex
--------------------------------------------------------------------------------
/GalaxyA72/Binary/HALIOMMU/HALIOMMU.efi:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/map220v/edk2-a72q/ab0a45671a90e7cc94eca1aa966238091385732c/GalaxyA72/Binary/HALIOMMU/HALIOMMU.efi
--------------------------------------------------------------------------------
/GalaxyA72/Binary/HWIODxeDriver/HWIODxeDriver.depex:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/map220v/edk2-a72q/ab0a45671a90e7cc94eca1aa966238091385732c/GalaxyA72/Binary/HWIODxeDriver/HWIODxeDriver.depex
--------------------------------------------------------------------------------
/GalaxyA72/Binary/HWIODxeDriver/HWIODxeDriver.efi:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/map220v/edk2-a72q/ab0a45671a90e7cc94eca1aa966238091385732c/GalaxyA72/Binary/HWIODxeDriver/HWIODxeDriver.efi
--------------------------------------------------------------------------------
/GalaxyA72/Binary/NpaDxe/NpaDxe.depex:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/GalaxyA72/Binary/NpaDxe/NpaDxe.efi:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/map220v/edk2-a72q/ab0a45671a90e7cc94eca1aa966238091385732c/GalaxyA72/Binary/NpaDxe/NpaDxe.efi
--------------------------------------------------------------------------------
/GalaxyA72/Binary/PdcDxe/PdcDxe.depex:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/GalaxyA72/Binary/PdcDxe/PdcDxe.efi:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/map220v/edk2-a72q/ab0a45671a90e7cc94eca1aa966238091385732c/GalaxyA72/Binary/PdcDxe/PdcDxe.efi
--------------------------------------------------------------------------------
/GalaxyA72/Binary/PlatformInfoDxeDriver/PlatformInfoDxeDriver.depex:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/map220v/edk2-a72q/ab0a45671a90e7cc94eca1aa966238091385732c/GalaxyA72/Binary/PlatformInfoDxeDriver/PlatformInfoDxeDriver.depex
--------------------------------------------------------------------------------
/GalaxyA72/Binary/PlatformInfoDxeDriver/PlatformInfoDxeDriver.efi:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/map220v/edk2-a72q/ab0a45671a90e7cc94eca1aa966238091385732c/GalaxyA72/Binary/PlatformInfoDxeDriver/PlatformInfoDxeDriver.efi
--------------------------------------------------------------------------------
/GalaxyA72/Binary/PmicDxe/PmicDxe.depex:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/map220v/edk2-a72q/ab0a45671a90e7cc94eca1aa966238091385732c/GalaxyA72/Binary/PmicDxe/PmicDxe.depex
--------------------------------------------------------------------------------
/GalaxyA72/Binary/PmicDxe/PmicDxe.efi:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/map220v/edk2-a72q/ab0a45671a90e7cc94eca1aa966238091385732c/GalaxyA72/Binary/PmicDxe/PmicDxe.efi
--------------------------------------------------------------------------------
/GalaxyA72/Binary/RpmhDxe/RpmhDxe.depex:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/map220v/edk2-a72q/ab0a45671a90e7cc94eca1aa966238091385732c/GalaxyA72/Binary/RpmhDxe/RpmhDxe.depex
--------------------------------------------------------------------------------
/GalaxyA72/Binary/RpmhDxe/RpmhDxe.efi:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/map220v/edk2-a72q/ab0a45671a90e7cc94eca1aa966238091385732c/GalaxyA72/Binary/RpmhDxe/RpmhDxe.efi
--------------------------------------------------------------------------------
/GalaxyA72/Binary/SPMI/SPMI.depex:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/GalaxyA72/Binary/SPMI/SPMI.efi:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/map220v/edk2-a72q/ab0a45671a90e7cc94eca1aa966238091385732c/GalaxyA72/Binary/SPMI/SPMI.efi
--------------------------------------------------------------------------------
/GalaxyA72/Binary/ShmBridgeDxe/ShmBridgeDxe.depex:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/GalaxyA72/Binary/ShmBridgeDxe/ShmBridgeDxe.efi:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/map220v/edk2-a72q/ab0a45671a90e7cc94eca1aa966238091385732c/GalaxyA72/Binary/ShmBridgeDxe/ShmBridgeDxe.efi
--------------------------------------------------------------------------------
/GalaxyA72/Binary/SmemDxe/SmemDxe.depex:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/GalaxyA72/Binary/SmemDxe/SmemDxe.efi:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/map220v/edk2-a72q/ab0a45671a90e7cc94eca1aa966238091385732c/GalaxyA72/Binary/SmemDxe/SmemDxe.efi
--------------------------------------------------------------------------------
/GalaxyA72/Binary/UFSDxe/UFSDxe.depex:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/map220v/edk2-a72q/ab0a45671a90e7cc94eca1aa966238091385732c/GalaxyA72/Binary/UFSDxe/UFSDxe.depex
--------------------------------------------------------------------------------
/GalaxyA72/Binary/UFSDxe/UFSDxe.efi:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/map220v/edk2-a72q/ab0a45671a90e7cc94eca1aa966238091385732c/GalaxyA72/Binary/UFSDxe/UFSDxe.efi
--------------------------------------------------------------------------------
/GalaxyA72/Binary/ULogDxe/ULogDxe.depex:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/GalaxyA72/Binary/ULogDxe/ULogDxe.efi:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/map220v/edk2-a72q/ab0a45671a90e7cc94eca1aa966238091385732c/GalaxyA72/Binary/ULogDxe/ULogDxe.efi
--------------------------------------------------------------------------------
/GalaxyA72/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 |
--------------------------------------------------------------------------------
/GalaxyA72/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 |
--------------------------------------------------------------------------------
/GalaxyA72/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 | GalaxyA72/GalaxyA72.dec
18 |
19 | [LibraryClasses]
20 | UefiDriverEntryPoint
21 | MemoryAllocationLib
22 | KeypadDeviceImplLib
23 |
24 | [Protocols]
25 | gEFIDroidKeypadDeviceProtocolGuid
26 | gEfiDevicePathProtocolGuid
27 |
28 | [Depex]
29 | TRUE
30 |
--------------------------------------------------------------------------------
/GalaxyA72/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 |
--------------------------------------------------------------------------------
/GalaxyA72/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 | GalaxyA72/GalaxyA72.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 |
--------------------------------------------------------------------------------
/GalaxyA72/Drivers/KeypadDxe/Source.txt:
--------------------------------------------------------------------------------
1 | URL: https://github.com/tianocore/edk2/tree/master/MdeModulePkg/Bus/Isa/Ps2KeyboardDxe
2 | BRANCH: master @ 35dadd7c54
3 |
--------------------------------------------------------------------------------
/GalaxyA72/Drivers/LogoDxe/Logo.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/map220v/edk2-a72q/ab0a45671a90e7cc94eca1aa966238091385732c/GalaxyA72/Drivers/LogoDxe/Logo.bmp
--------------------------------------------------------------------------------
/GalaxyA72/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 |
--------------------------------------------------------------------------------
/GalaxyA72/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 |
--------------------------------------------------------------------------------
/GalaxyA72/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 |
--------------------------------------------------------------------------------
/GalaxyA72/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 |
--------------------------------------------------------------------------------
/GalaxyA72/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 |
--------------------------------------------------------------------------------
/GalaxyA72/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 |
--------------------------------------------------------------------------------
/GalaxyA72/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 |
--------------------------------------------------------------------------------
/GalaxyA72/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 |
--------------------------------------------------------------------------------
/GalaxyA72/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 | GalaxyA72/GalaxyA72.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 |
--------------------------------------------------------------------------------
/GalaxyA72/GalaxyA72.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 = GalaxyA72
16 | PACKAGE_GUID = 8eb62855-b263-42f4-9256-3848a1393da4
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 | gGalaxyA72TokenSpaceGuid = { 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 | # ChipInfo
37 | gEfiChipInfoProtocolGuid = { 0xb0760469, 0x970c, 0x487a, { 0xa4, 0xb5, 0x28, 0xdb, 0x7b, 0x45, 0xce, 0xf1 } }
38 | # SMEM Protocol guid
39 | gEfiSMEMProtocolGuid = { 0xf4e5c7d0, 0xd239, 0x47cb, { 0xaa, 0xcd, 0x7f, 0x66, 0xef, 0x76, 0x32, 0x38 } }
40 | # PlatformInfo
41 | gEfiPlatformInfoProtocolGuid = { 0x157a5c45, 0x21b2, 0x43c5, { 0xba, 0x7c, 0x82, 0x2f, 0xee, 0x5f, 0xe5, 0x99 } }
42 |
43 | [PcdsFixedAtBuild.common]
44 | # Simple FrameBuffer
45 | gGalaxyA72TokenSpaceGuid.PcdMipiFrameBufferAddress|0x00400000|UINT32|0x0000a400
46 | gGalaxyA72TokenSpaceGuid.PcdMipiFrameBufferWidth|1080|UINT32|0x0000a401
47 | gGalaxyA72TokenSpaceGuid.PcdMipiFrameBufferHeight|1920|UINT32|0x0000a402
48 | gGalaxyA72TokenSpaceGuid.PcdMipiFrameBufferPixelBpp|32|UINT32|0x0000a403
--------------------------------------------------------------------------------
/GalaxyA72/GalaxyA72.dsc:
--------------------------------------------------------------------------------
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 | !include GalaxyA72/CommonDsc.dsc.inc
14 |
15 | [LibraryClasses.common]
16 | ArmLib|ArmPkg/Library/ArmLib/ArmBaseLib.inf
17 | ArmPlatformLib|GalaxyA72/Library/GalaxyA72Lib/GalaxyA72Lib.inf
18 | CompilerIntrinsicsLib|ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
19 | CapsuleLib|MdeModulePkg/Library/DxeCapsuleLibNull/DxeCapsuleLibNull.inf
20 | UefiBootManagerLib|MdeModulePkg/Library/UefiBootManagerLib/UefiBootManagerLib.inf
21 | PlatformBootManagerLib|ArmPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf
22 | CustomizedDisplayLib|MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLib.inf
23 |
24 | # UiApp dependencies
25 | ReportStatusCodeLib|MdeModulePkg/Library/DxeReportStatusCodeLib/DxeReportStatusCodeLib.inf
26 | FileExplorerLib|MdeModulePkg/Library/FileExplorerLib/FileExplorerLib.inf
27 | DxeServicesLib|MdePkg/Library/DxeServicesLib/DxeServicesLib.inf
28 | BootLogoLib|MdeModulePkg/Library/BootLogoLib/BootLogoLib.inf
29 |
30 | SerialPortLib|GalaxyA72/Library/InMemorySerialPortLib/InMemorySerialPortLib.inf
31 | RealTimeClockLib|EmbeddedPkg/Library/VirtualRealTimeClockLib/VirtualRealTimeClockLib.inf
32 | TimeBaseLib|EmbeddedPkg/Library/TimeBaseLib/TimeBaseLib.inf
33 |
34 | # USB Requirements
35 | UefiUsbLib|MdePkg/Library/UefiUsbLib/UefiUsbLib.inf
36 |
37 | # Network Libraries
38 | UefiScsiLib|MdePkg/Library/UefiScsiLib/UefiScsiLib.inf
39 |
40 | # VariableRuntimeDxe Requirements
41 | SynchronizationLib|MdePkg/Library/BaseSynchronizationLib/BaseSynchronizationLib.inf
42 | AuthVariableLib|MdeModulePkg/Library/AuthVariableLibNull/AuthVariableLibNull.inf
43 | TpmMeasurementLib|MdeModulePkg/Library/TpmMeasurementLibNull/TpmMeasurementLibNull.inf
44 | VarCheckLib|MdeModulePkg/Library/VarCheckLib/VarCheckLib.inf
45 |
46 | # SimpleFbDxe
47 | FrameBufferBltLib|MdeModulePkg/Library/FrameBufferBltLib/FrameBufferBltLib.inf
48 |
49 | SerialPortLib|GalaxyA72/Library/FrameBufferSerialPortLib/FrameBufferSerialPortLib.inf
50 | PlatformBootManagerLib|GalaxyA72/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf
51 | MemoryInitPeiLib|GalaxyA72/Library/MemoryInitPeiLib/PeiMemoryAllocationLib.inf
52 | PlatformPeiLib|GalaxyA72/Library/PlatformPeiLib/PlatformPeiLib.inf
53 |
54 | VariableFlashInfoLib|MdeModulePkg/Library/BaseVariableFlashInfoLib/BaseVariableFlashInfoLib.inf
55 |
56 | AslUpdateLib|GalaxyA72/Library/DxeAslUpdateLib/DxeAslUpdateLib.inf
57 | AcpiPlatformUpdateLib|GalaxyA72/Library/AcpiPlatformUpdateLib/AcpiPlatformUpdateLib.inf
58 |
59 | [LibraryClasses.common.SEC]
60 | PrePiLib|EmbeddedPkg/Library/PrePiLib/PrePiLib.inf
61 | ExtractGuidedSectionLib|EmbeddedPkg/Library/PrePiExtractGuidedSectionLib/PrePiExtractGuidedSectionLib.inf
62 | HobLib|EmbeddedPkg/Library/PrePiHobLib/PrePiHobLib.inf
63 | MemoryAllocationLib|EmbeddedPkg/Library/PrePiMemoryAllocationLib/PrePiMemoryAllocationLib.inf
64 | #MemoryInitPeiLib|ArmPlatformPkg/MemoryInitPei/MemoryInitPeiLib.inf
65 | #PlatformPeiLib|ArmPlatformPkg/PlatformPei/PlatformPeiLib.inf
66 | PrePiHobListPointerLib|ArmPlatformPkg/Library/PrePiHobListPointerLib/PrePiHobListPointerLib.inf
67 |
68 | ################################################################################
69 | #
70 | # Pcd Section - list of all EDK II PCD Entries defined by this Platform
71 | #
72 | ################################################################################
73 |
74 | [PcdsFeatureFlag.common]
75 | ## If TRUE, Graphics Output Protocol will be installed on virtual handle created by ConsplitterDxe.
76 | # It could be set FALSE to save size.
77 | gEfiMdeModulePkgTokenSpaceGuid.PcdConOutGopSupport|TRUE
78 | gEfiMdeModulePkgTokenSpaceGuid.PcdConOutUgaSupport|FALSE
79 |
80 | [PcdsFixedAtBuild.common]
81 | gEfiMdePkgTokenSpaceGuid.PcdDefaultTerminalType|4
82 |
83 | gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVersionString|L"Alpha"
84 |
85 | # System Memory (6GB)
86 | gArmTokenSpaceGuid.PcdSystemMemoryBase|0x80000000
87 | gArmTokenSpaceGuid.PcdSystemMemorySize|0x180000000
88 |
89 | # We bring up eight cores here!
90 | gArmPlatformTokenSpaceGuid.PcdCoreCount|8
91 | gArmPlatformTokenSpaceGuid.PcdClusterCount|2
92 |
93 | #
94 | # ARM PrimeCell
95 | #
96 |
97 | #
98 | # ARM General Interrupt Controller
99 | #
100 | gArmTokenSpaceGuid.PcdArmArchTimerFreqInHz|19200000
101 |
102 | gArmTokenSpaceGuid.PcdGicDistributorBase|0x17A00000
103 | gArmTokenSpaceGuid.PcdGicRedistributorsBase|0x17A60000
104 |
105 | # Below PcdGicInterruptInterfaceBase is used for supporting the GICv2 Emulation in the Hyper visor
106 | # Which need mGicInterruptInterfaceBase to be initialized to 0x17A60000
107 | gArmTokenSpaceGuid.PcdGicInterruptInterfaceBase|0x17A60000
108 |
109 | # Timers
110 | # ARM Architectural Timer Interrupt(GIC PPI) numbers
111 | gArmTokenSpaceGuid.PcdArmArchTimerSecIntrNum|17
112 | gArmTokenSpaceGuid.PcdArmArchTimerIntrNum|18
113 | gArmTokenSpaceGuid.PcdArmArchTimerHypIntrNum|0
114 | gArmTokenSpaceGuid.PcdArmArchTimerVirtIntrNum|19
115 |
116 | # GUID of the UI app
117 | gEfiMdeModulePkgTokenSpaceGuid.PcdBootManagerMenuFile|{ 0x21, 0xaa, 0x2c, 0x46, 0x14, 0x76, 0x03, 0x45, 0x83, 0x6e, 0x8a, 0xb6, 0xf4, 0x66, 0x23, 0x31 }
118 |
119 | gEfiMdePkgTokenSpaceGuid.PcdPlatformBootTimeOut|5
120 |
121 | gEfiMdeModulePkgTokenSpaceGuid.PcdResetOnMemoryTypeInformationChange|FALSE
122 |
123 | #
124 | #
125 | # Fastboot
126 | #
127 | gEmbeddedTokenSpaceGuid.PcdAndroidFastbootUsbVendorId|0x18d1
128 | gEmbeddedTokenSpaceGuid.PcdAndroidFastbootUsbProductId|0xd00d
129 |
130 | #
131 | # Make VariableRuntimeDxe work at emulated non-volatile variable mode.
132 | #
133 | gEfiMdeModulePkgTokenSpaceGuid.PcdEmuVariableNvModeEnable|TRUE
134 |
135 | gGalaxyA72TokenSpaceGuid.PcdMipiFrameBufferAddress|0x9c000000
136 | gGalaxyA72TokenSpaceGuid.PcdMipiFrameBufferWidth|1080
137 | gGalaxyA72TokenSpaceGuid.PcdMipiFrameBufferHeight|2400
138 |
139 | gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiExposedTableVersions|0x20
140 |
141 | ################################################################################
142 | #
143 | # Components Section - list of all EDK II Modules needed by this Platform
144 | #
145 | ################################################################################
146 | [Components.common]
147 | #
148 | # PEI Phase modules
149 | #
150 | ArmPlatformPkg/PrePi/PeiUniCore.inf
151 |
152 | #
153 | # DXE
154 | #
155 | MdeModulePkg/Core/Dxe/DxeMain.inf {
156 |
157 | PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf
158 | NULL|MdeModulePkg/Library/DxeCrc32GuidedSectionExtractLib/DxeCrc32GuidedSectionExtractLib.inf
159 | }
160 |
161 | #
162 | # Architectural Protocols
163 | #
164 | ArmPkg/Drivers/CpuDxe/CpuDxe.inf
165 | MdeModulePkg/Core/RuntimeDxe/RuntimeDxe.inf
166 | MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf
167 | MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf
168 | EmbeddedPkg/EmbeddedMonotonicCounter/EmbeddedMonotonicCounter.inf
169 | MdeModulePkg/Universal/ResetSystemRuntimeDxe/ResetSystemRuntimeDxe.inf
170 | EmbeddedPkg/RealTimeClockRuntimeDxe/RealTimeClockRuntimeDxe.inf
171 | EmbeddedPkg/MetronomeDxe/MetronomeDxe.inf
172 | MdeModulePkg/Universal/ReportStatusCodeRouter/RuntimeDxe/ReportStatusCodeRouterRuntimeDxe.inf
173 | MdeModulePkg/Universal/StatusCodeHandler/RuntimeDxe/StatusCodeHandlerRuntimeDxe.inf
174 | MdeModulePkg/Universal/Console/ConPlatformDxe/ConPlatformDxe.inf
175 | MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitterDxe.inf
176 | MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsoleDxe.inf
177 | MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf
178 |
179 | MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf
180 |
181 | ArmPkg/Drivers/ArmGic/ArmGicDxe.inf
182 | ArmPkg/Drivers/TimerDxe/TimerDxe.inf
183 |
184 | MdeModulePkg/Universal/WatchdogTimerDxe/WatchdogTimer.inf
185 |
186 | MdeModulePkg/Universal/PCD/Dxe/Pcd.inf
187 |
188 | #
189 | # GPIO
190 | #
191 |
192 | #
193 | # Virtual Keyboard
194 | #
195 | EmbeddedPkg/Drivers/VirtualKeyboardDxe/VirtualKeyboardDxe.inf
196 |
197 | GalaxyA72/GalaxyA72Dxe/GalaxyA72Dxe.inf
198 | GalaxyA72/SimpleFbDxe/SimpleFbDxe.inf
199 |
200 | #
201 | # USB Host Support
202 | #
203 | MdeModulePkg/Bus/Usb/UsbBusDxe/UsbBusDxe.inf
204 |
205 | MdeModulePkg/Bus/Usb/UsbKbDxe/UsbKbDxe.inf
206 |
207 | #
208 | # USB Mass Storage Support
209 | #
210 | MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassStorageDxe.inf
211 |
212 | #
213 | # USB Peripheral Support
214 | #
215 | EmbeddedPkg/Drivers/AndroidFastbootTransportUsbDxe/FastbootTransportUsbDxe.inf
216 |
217 | #
218 | # Fastboot
219 | #
220 | EmbeddedPkg/Application/AndroidFastboot/AndroidFastbootApp.inf
221 |
222 |
223 | #
224 | # UEFI Network Stack
225 | #
226 | #!include NetworkPkg/Network.dsc.inc
227 |
228 | #
229 | # FAT filesystem + GPT/MBR partitioning
230 | #
231 | MdeModulePkg/Universal/Disk/DiskIoDxe/DiskIoDxe.inf
232 | MdeModulePkg/Universal/Disk/PartitionDxe/PartitionDxe.inf
233 | FatPkg/EnhancedFatDxe/Fat.inf
234 | MdeModulePkg/Universal/Disk/UnicodeCollation/EnglishDxe/EnglishDxe.inf
235 | MdeModulePkg/Universal/FvSimpleFileSystemDxe/FvSimpleFileSystemDxe.inf
236 |
237 | #
238 | # ACPI Support
239 | #
240 | MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf
241 | MdeModulePkg/Universal/Acpi/AcpiPlatformDxe/AcpiPlatformDxe.inf
242 | MdeModulePkg/Universal/Acpi/BootGraphicsResourceTableDxe/BootGraphicsResourceTableDxe.inf
243 | GalaxyA72/AcpiTables/AcpiTables.inf
244 |
245 | #
246 | # SMBIOS Support
247 | #
248 | GalaxyA72/Drivers/SmbiosPlatformDxe/SmbiosPlatformDxe.inf
249 | MdeModulePkg/Universal/SmbiosDxe/SmbiosDxe.inf
250 |
251 | #
252 | # Bds
253 | #
254 | MdeModulePkg/Universal/PrintDxe/PrintDxe.inf
255 | MdeModulePkg/Universal/DevicePathDxe/DevicePathDxe.inf
256 | MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabaseDxe.inf {
257 |
258 | PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf
259 | }
260 | MdeModulePkg/Universal/DisplayEngineDxe/DisplayEngineDxe.inf
261 | MdeModulePkg/Universal/SetupBrowserDxe/SetupBrowserDxe.inf
262 | MdeModulePkg/Universal/DriverHealthManagerDxe/DriverHealthManagerDxe.inf
263 | MdeModulePkg/Universal/BdsDxe/BdsDxe.inf
264 | MdeModulePkg/Application/UiApp/UiApp.inf {
265 |
266 | NULL|MdeModulePkg/Library/DeviceManagerUiLib/DeviceManagerUiLib.inf
267 | NULL|MdeModulePkg/Library/BootManagerUiLib/BootManagerUiLib.inf
268 | NULL|MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenanceManagerUiLib.inf
269 | PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf
270 | }
271 | GalaxyA72/Drivers/LogoDxe/LogoDxe.inf
272 |
273 | ShellPkg/Application/Shell/Shell.inf {
274 |
275 | ShellCommandLib|ShellPkg/Library/UefiShellCommandLib/UefiShellCommandLib.inf
276 | NULL|ShellPkg/Library/UefiShellLevel2CommandsLib/UefiShellLevel2CommandsLib.inf
277 | NULL|ShellPkg/Library/UefiShellLevel1CommandsLib/UefiShellLevel1CommandsLib.inf
278 | NULL|ShellPkg/Library/UefiShellLevel3CommandsLib/UefiShellLevel3CommandsLib.inf
279 | NULL|ShellPkg/Library/UefiShellDriver1CommandsLib/UefiShellDriver1CommandsLib.inf
280 | NULL|ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.inf
281 | NULL|ShellPkg/Library/UefiShellInstall1CommandsLib/UefiShellInstall1CommandsLib.inf
282 | #NULL|ShellPkg/Library/UefiShellNetwork1CommandsLib/UefiShellNetwork1CommandsLib.inf
283 | NULL|ShellPkg/Library/UefiShellAcpiViewCommandLib/UefiShellAcpiViewCommandLib.inf
284 | HandleParsingLib|ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.inf
285 | PrintLib|MdePkg/Library/BasePrintLib/BasePrintLib.inf
286 | BcfgCommandLib|ShellPkg/Library/UefiShellBcfgCommandLib/UefiShellBcfgCommandLib.inf
287 |
288 | gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask|0xFF
289 | gEfiShellPkgTokenSpaceGuid.PcdShellLibAutoInitialize|FALSE
290 | gEfiMdePkgTokenSpaceGuid.PcdUefiLibMaxPrintBufferSize|8000
291 | }
292 | !ifdef $(INCLUDE_TFTP_COMMAND)
293 | ShellPkg/DynamicCommand/TftpDynamicCommand/TftpDynamicCommand.inf
294 | !endif #$(INCLUDE_TFTP_COMMAND)
295 |
--------------------------------------------------------------------------------
/GalaxyA72/GalaxyA72Dxe/GalaxyA72Dxe.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 "GalaxyA72Dxe.h"
38 |
39 | EFI_CPU_ARCH_PROTOCOL *gCpu;
40 |
41 | VOID
42 | InitPeripherals (
43 | IN VOID
44 | )
45 | {
46 | }
47 |
48 | /**
49 | Notification function of the event defined as belonging to the
50 | EFI_END_OF_DXE_EVENT_GROUP_GUID event group that was created in
51 | the entry point of the driver.
52 |
53 | This function is called when an event belonging to the
54 | EFI_END_OF_DXE_EVENT_GROUP_GUID event group is signalled. Such an
55 | event is signalled once at the end of the dispatching of all
56 | drivers (end of the so called DXE phase).
57 |
58 | @param[in] Event Event declared in the entry point of the driver whose
59 | notification function is being invoked.
60 | @param[in] Context NULL
61 | **/
62 | STATIC
63 | VOID
64 | OnEndOfDxe (
65 | IN EFI_EVENT Event,
66 | IN VOID *Context
67 | )
68 | {
69 | }
70 |
71 | EFI_STATUS
72 | EFIAPI
73 | GalaxyA72EntryPoint (
74 | IN EFI_HANDLE ImageHandle,
75 | IN EFI_SYSTEM_TABLE *SystemTable
76 | )
77 | {
78 | EFI_STATUS Status;
79 | EFI_EVENT EndOfDxeEvent;
80 |
81 | Status = gBS->LocateProtocol (&gEfiCpuArchProtocolGuid, NULL, (VOID **)&gCpu);
82 | ASSERT_EFI_ERROR(Status);
83 |
84 | InitPeripherals ();
85 |
86 | //
87 | // Create an event belonging to the "gEfiEndOfDxeEventGroupGuid" group.
88 | // The "OnEndOfDxe()" function is declared as the call back function.
89 | // It will be called at the end of the DXE phase when an event of the
90 | // same group is signalled to inform about the end of the DXE phase.
91 | // Install the INSTALL_FDT_PROTOCOL protocol.
92 | //
93 | Status = gBS->CreateEventEx (
94 | EVT_NOTIFY_SIGNAL,
95 | TPL_CALLBACK,
96 | OnEndOfDxe,
97 | NULL,
98 | &gEfiEndOfDxeEventGroupGuid,
99 | &EndOfDxeEvent
100 | );
101 | return Status;
102 | }
103 |
--------------------------------------------------------------------------------
/GalaxyA72/GalaxyA72Dxe/GalaxyA72Dxe.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 __GALAXYA72DXE_H__
16 | #define __GALAXYA72DXE_H__
17 |
18 | #endif /* __GALAXYA72DXE_H__ */
--------------------------------------------------------------------------------
/GalaxyA72/GalaxyA72Dxe/GalaxyA72Dxe.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 = GalaxyA72Dxe
16 | FILE_GUID = 5a172c8d-026f-4366-bf20-af2df1194a28
17 | MODULE_TYPE = DXE_DRIVER
18 | VERSION_STRING = 1.0
19 | ENTRY_POINT = GalaxyA72EntryPoint
20 |
21 | [Sources.common]
22 | GalaxyA72Dxe.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 |
--------------------------------------------------------------------------------
/GalaxyA72/GalaxyA72_6G.dsc:
--------------------------------------------------------------------------------
1 | [Defines]
2 | PLATFORM_NAME = GalaxyA72
3 | PLATFORM_GUID = 28f1a3bf-193a-47e3-a7b9-5a435eaab2ee
4 | PLATFORM_VERSION = 0.1
5 | DSC_SPECIFICATION = 0x00010019
6 | OUTPUT_DIRECTORY = Build/$(PLATFORM_NAME)
7 | SUPPORTED_ARCHITECTURES = AARCH64
8 | BUILD_TARGETS = DEBUG|RELEASE
9 | SKUID_IDENTIFIER = DEFAULT
10 | FLASH_DEFINITION = GalaxyA72/GalaxyA72.fdf
11 |
12 | !include GalaxyA72/GalaxyA72.dsc
13 |
14 | [PcdsFixedAtBuild.common]
15 | # System Memory (6GB)
16 | gArmTokenSpaceGuid.PcdSystemMemorySize|0x180000000
--------------------------------------------------------------------------------
/GalaxyA72/GalaxyA72_8G.dsc:
--------------------------------------------------------------------------------
1 | [Defines]
2 | PLATFORM_NAME = GalaxyA72_8G
3 | PLATFORM_GUID = 28f1a3bf-193a-47e3-a7b9-5a435eaab2ee
4 | PLATFORM_VERSION = 0.1
5 | DSC_SPECIFICATION = 0x00010019
6 | OUTPUT_DIRECTORY = Build/$(PLATFORM_NAME)
7 | SUPPORTED_ARCHITECTURES = AARCH64
8 | BUILD_TARGETS = DEBUG|RELEASE
9 | SKUID_IDENTIFIER = DEFAULT
10 | FLASH_DEFINITION = GalaxyA72/GalaxyA72.fdf
11 |
12 | !include GalaxyA72/GalaxyA72.dsc
13 |
14 | [BuildOptions.common]
15 | GCC:*_*_AARCH64_CC_FLAGS = -DMEMORY_8G
16 |
17 | [PcdsFixedAtBuild.common]
18 | # System Memory (8GB)
19 | gArmTokenSpaceGuid.PcdSystemMemorySize|0x200000000
--------------------------------------------------------------------------------
/GalaxyA72/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 |
--------------------------------------------------------------------------------
/GalaxyA72/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
--------------------------------------------------------------------------------
/GalaxyA72/Include/Library/AcpiPlatformUpdateLib.h:
--------------------------------------------------------------------------------
1 | #ifndef _ACPI_PLATFORM_UPDATE_LIB_H_
2 | #define _ACPI_PLATFORM_UPDATE_LIB_H_
3 |
4 | VOID
5 | PlatformUpdateAcpiTables(VOID);
6 |
7 | #endif /* _ACPI_PLATFORM_UPDATE_LIB_H_ */
--------------------------------------------------------------------------------
/GalaxyA72/Include/Library/AslUpdateLib.h:
--------------------------------------------------------------------------------
1 | /** @file
2 | ASL dynamic update library definitions.
3 |
4 | This library provides dynamic update to various ASL structures.
5 | There may be different libraries for different environments (PEI, BS, RT, SMM).
6 | Make sure you meet the requirements for the library (protocol dependencies, use
7 | restrictions, etc).
8 |
9 | Note that the current version of the library updates AML.
10 |
11 | Copyright (c) 2020 Intel Corporation. All rights reserved.
12 |
13 | SPDX-License-Identifier: BSD-2-Clause-Patent
14 | **/
15 |
16 | #ifndef _ASL_UPDATE_LIB_H_
17 | #define _ASL_UPDATE_LIB_H_
18 |
19 | //
20 | // Include files
21 | //
22 | #include
23 | #include
24 | #include
25 | #include
26 |
27 | /**
28 | This procedure will update immediate value assigned to a Name.
29 |
30 | @param[in] AslSignature The signature of Operation Region that we want to update.
31 | @param[in] Buffer source of data to be written over original aml
32 | @param[in] Length length of data to be overwritten
33 |
34 | @retval EFI_SUCCESS The function completed successfully.
35 | @retval EFI_NOT_FOUND Failed to locate AcpiTable.
36 | @retval EFI_NOT_READY Not ready to locate AcpiTable.
37 | @retval EFI_UNSUPPORTED The function is not supported in this library.
38 | **/
39 | EFI_STATUS
40 | EFIAPI
41 | UpdateNameAslCode (
42 | IN UINT32 AslSignature,
43 | IN VOID *Buffer,
44 | IN UINTN Length
45 | );
46 |
47 | /**
48 | This procedure will update immediate value assigned to a Name in SSDT table.
49 |
50 | @param[in] TableId - Pointer to an ASCII string containing the OEM Table ID from the ACPI table header
51 | @param[in] TableIdSize - Length of the TableId to match. Table ID are 8 bytes long, this function
52 | @param[in] AslSignature - The signature of Operation Region that we want to update.
53 | @param[in] Buffer - source of data to be written over original aml
54 | @param[in] Length - length of data to be overwritten
55 |
56 | @retval EFI_SUCCESS - The function completed successfully.
57 | @retval EFI_NOT_FOUND - Failed to locate AcpiTable.
58 | @retval EFI_NOT_READY - Not ready to locate AcpiTable.
59 | @retval EFI_UNSUPPORTED - The function is not supported in this library.
60 | **/
61 | EFI_STATUS
62 | EFIAPI
63 | UpdateSsdtNameAslCode (
64 | IN UINT8 *TableId,
65 | IN UINT8 TableIdSize,
66 | IN UINT32 AslSignature,
67 | IN VOID *Buffer,
68 | IN UINTN Length
69 | );
70 |
71 | /**
72 | This procedure will update the name of ASL Method.
73 |
74 | @param[in] AslSignature - The signature of Operation Region that we want to update.
75 | @param[in] Buffer - source of data to be written over original aml
76 | @param[in] Length - length of data to be overwritten
77 |
78 | @retval EFI_SUCCESS - The function completed successfully.
79 | @retval EFI_NOT_FOUND - Failed to locate AcpiTable.
80 | @retval EFI_NOT_READY - Not ready to locate AcpiTable.
81 | @retval EFI_UNSUPPORTED - The function is not supported in this library.
82 | **/
83 | EFI_STATUS
84 | EFIAPI
85 | UpdateMethodAslCode (
86 | IN UINT32 AslSignature,
87 | IN VOID *Buffer,
88 | IN UINTN Length
89 | );
90 |
91 | /**
92 | This function uses the ACPI support protocol to locate an ACPI table.
93 | It is really only useful for finding tables that only have a single instance,
94 | e.g. FADT, FACS, MADT, etc. It is not good for locating SSDT, etc.
95 | Matches are determined by finding the table with ACPI table that has
96 | a matching signature.
97 |
98 | @param[in] Signature Pointer to an ASCII string containing the Signature to match
99 | @param[in, out] Table Updated with a pointer to the table
100 | @param[in, out] Handle AcpiSupport protocol table handle for the table found
101 | @see AcpiSupport protocol for details
102 |
103 | @retval EFI_SUCCESS The function completed successfully.
104 | @retval EFI_NOT_FOUND Failed to locate AcpiTable.
105 | @retval EFI_NOT_READY Not ready to locate AcpiTable.
106 | @retval EFI_UNSUPPORTED The function is not supported in this library.
107 | **/
108 | EFI_STATUS
109 | EFIAPI
110 | LocateAcpiTableBySignature (
111 | IN UINT32 Signature,
112 | IN OUT EFI_ACPI_DESCRIPTION_HEADER **Table,
113 | IN OUT UINTN *Handle
114 | );
115 |
116 | #endif
117 |
--------------------------------------------------------------------------------
/GalaxyA72/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 |
--------------------------------------------------------------------------------
/GalaxyA72/Include/Protocol/EFIChipInfoTypes.h:
--------------------------------------------------------------------------------
1 | /* Copyright (c) 2015-2016,2019 The Linux Foundation. All rights reserved.
2 | *
3 | * Redistribution and use in source and binary forms, with or without
4 | * modification, are permitted provided that the following conditions are
5 | * met:
6 | * * Redistributions of source code must retain the above copyright
7 | * notice, this list of conditions and the following disclaimer.
8 | * * Redistributions in binary form must reproduce the above
9 | * copyright notice, this list of conditions and the following
10 | * disclaimer in the documentation and/or other materials provided
11 | * with the distribution.
12 | * * Neither the name of The Linux Foundation nor the names of its
13 | * contributors may be used to endorse or promote products derived
14 | * from this software without specific prior written permission.
15 | *
16 | * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
20 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
23 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
24 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
25 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
26 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 | */
28 |
29 | #ifndef __EFICHIPINFOTYPES_H__
30 | #define __EFICHIPINFOTYPES_H__
31 |
32 | /** @addtogroup efi_chipInfo_constants
33 | @{ */
34 | /** Macro to generate the hardware version number from a specified major
35 | and minor number. This is used when comparing against the return value of
36 | hw_version(). For example, to check if the version is at least Version 1.2: \n
37 |
38 | @code
39 | EFI_ChipInfo_GetVersion(h, &version);
40 | if (version >= EFI_CHIPINFO_VERSION(1,2)) ...
41 | @endcode
42 | */
43 | #define EFI_CHIPINFO_VERSION(major, minor) (((major) << 16) | (minor))
44 | #define EFI_CHIPINFO_VERSION_UNKNOWN 0
45 |
46 | /** Maximum length of a chip ID string. This can be used by clients when
47 | declaring space for the EFI_DALCHIPINFO_GETCHIPIDSTRING() function. */
48 | #define EFICHIPINFO_MAX_ID_LENGTH 16
49 |
50 | /**
51 | Maximum length of a processor name string. This can be used
52 | by clients when declaring space for the
53 | EFI_DALCHIPINFO_GETPROCESSORNAMESTRING() function. */
54 | #define EFICHIPINFO_MAX_NAME_LENGTH EFICHIPINFO_MAX_ID_LENGTH
55 |
56 | /**
57 | Maximum number of CPU clusters supported by the GetDefectiveParts API
58 | **/
59 | #define EFICHIPINFO_MAX_CPU_CLUSTERS 4
60 |
61 | /**
62 | * Other macros used to indicate unknown values
63 | */
64 | #define EFICHIPINFO_RAW_VERSION_UNKNOWN 0x0
65 | #define EFICHIPINFO_RAW_ID_UNKNOWN 0x0
66 | #define EFICHIPINFO_SERIAL_NUM_UNKNOWN 0x0
67 | #define EFICHIPINFO_RAW_DEVICE_FAMILY_UNKNOWN 0x0
68 | #define EFICHIPINFO_RAW_DEVICE_NUMBER_UNKNOWN 0x0
69 | #define EFICHIPINFO_QFPROM_CHIPID_UNKNOWN 0x0
70 |
71 | /** @endcond */
72 |
73 | /** @addtogroup efi_chipInfo_data_types
74 | @{ */
75 | /** Chip version with the major number in the upper 16 bits and the
76 | minor number in the lower 16 bits. For example: \n
77 | - Version 1.0 is 0x00010000
78 | - Version 2.3 is 0x00020003
79 |
80 | The #EFI_CHIPINFO_VERSION macro must be used to generate the
81 | appropriate comparison value because the format is not guaranteed
82 | to remain unchanged.
83 | */
84 | typedef UINT32 EFIChipInfoVersionType;
85 |
86 | /** Stores information about modem hardware supported on the
87 | platform. */
88 | typedef UINT32 EFIChipInfoModemType;
89 |
90 | /** Chip identification. */
91 | /* Any new IDs must be added to the end. */
92 | typedef enum
93 | {
94 | /** @cond */
95 | EFICHIPINFO_ID_UNKNOWN = 0, /**< Unknown chip. */
96 | EFICHIPINFO_ID_MSM8998 = 292,
97 | EFICHIPINFO_ID_APQ8098 = 319,
98 | EFICHIPINFO_ID_SDM845 = 321,
99 |
100 | EFICHIPINFO_NUM_IDS = 401,
101 | EFICHIPINFO_ID_32BITS = 0x7FFFFFF
102 | /** @endcond */
103 | } EFIChipInfoIdType;
104 |
105 | /** Chip family. This is the family type of the chip on which the software is
106 | running. Each family may include multiple chip IDs.
107 | */
108 | typedef enum
109 | {
110 | /** @cond */
111 | EFICHIPINFO_FAMILY_UNKNOWN = 0, /**< Unknown family. */
112 | EFICHIPINFO_FAMILY_MSM8998 = 67,
113 | EFICHIPINFO_FAMILY_SDM845 = 79,
114 |
115 | /** @cond */
116 | EFICHIPINFO_NUM_FAMILIES = 102,
117 | EFICHIPINFO_FAMILY_32BITS = 0x7FFFFFF
118 | /** @endcond */
119 | } EFIChipInfoFamilyType;
120 |
121 | /**
122 | Chip serial number. Unique within each EfiChipInfoFamily.
123 | */
124 | typedef UINT32 EFIChipInfoSerialNumType;
125 |
126 | /**
127 | Chip serial number as read from QFPROM.
128 | */
129 | typedef UINT32 EFIChipInfoQFPROMChipIdType;
130 |
131 | /**
132 | Chip Foundry type.
133 | */
134 | typedef enum
135 | {
136 | EFICHIPINFO_FOUNDRYID_UNKNOWN = 0,
137 | EFICHIPINFO_FOUNDRYID_TSMC = 1,
138 | EFICHIPINFO_FOUNDRYID_GF = 2,
139 | EFICHIPINFO_FOUNDRYID_SS = 3,
140 | EFICHIPINFO_FOUNDRYID_IBM = 4,
141 | EFICHIPINFO_FOUNDRYID_UMC = 5,
142 | EFICHIPINFO_FOUNDRYID_SMIC = 6,
143 |
144 | EFICHIPINFO_NUM_FOUNDRYIDS,
145 | EFICHIPINFO_FOUNDRYID_32BITS = 0x7FFFFFF
146 | } EFIChipInfoFoundryIdType;
147 |
148 | /**
149 | * Defective parts supported by the GetDefectivePart API
150 | */
151 | typedef enum
152 | {
153 | EFICHIPINFO_PART_UNKNOWN = 0,
154 | EFICHIPINFO_PART_GPU = 1,
155 | EFICHIPINFO_PART_VIDEO = 2,
156 | EFICHIPINFO_PART_CAMERA = 3,
157 | EFICHIPINFO_PART_DISPLAY = 4,
158 | EFICHIPINFO_PART_AUDIO = 5,
159 | EFICHIPINFO_PART_MODEM = 6,
160 | EFICHIPINFO_PART_WLAN = 7,
161 | EFICHIPINFO_PART_COMP = 8,
162 | EFICHIPINFO_PART_SENSORS = 9,
163 | EFICHIPINFO_PART_NPU = 10,
164 | EFICHIPINFO_PART_SPSS = 11,
165 | EFICHIPINFO_PART_NAV = 12,
166 | /*
167 | * TODO Add Group E parts
168 | * once they've been finalized
169 | */
170 |
171 | EFICHIPINFO_NUM_PARTS,
172 | EFICHIPINFO_PART_32BITS = 0x7FFFFFFF
173 | } EFIChipInfoPartType;
174 |
175 | #endif /* __EFICHIPINFOTYPES_H__ */
176 |
--------------------------------------------------------------------------------
/GalaxyA72/Include/Protocol/EFIPlatformInfo.h:
--------------------------------------------------------------------------------
1 | /* Copyright (c) 2015-2016, The Linux Foundation. All rights reserved.
2 | *
3 | * Redistribution and use in source and binary forms, with or without
4 | * modification, are permitted provided that the following conditions are
5 | * met:
6 | * * Redistributions of source code must retain the above copyright
7 | * notice, this list of conditions and the following disclaimer.
8 | * * Redistributions in binary form must reproduce the above
9 | * copyright notice, this list of conditions and the following
10 | * disclaimer in the documentation and/or other materials provided
11 | * with the distribution.
12 | * * Neither the name of The Linux Foundation nor the names of its
13 | * contributors may be used to endorse or promote products derived
14 | * from this software without specific prior written permission.
15 | *
16 | * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
20 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
23 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
24 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
25 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
26 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 | */
28 |
29 | #ifndef __EFIPLATFORMINFO_H__
30 | #define __EFIPLATFORMINFO_H__
31 |
32 | /*===========================================================================
33 | INCLUDE FILES
34 | ===========================================================================*/
35 |
36 | #include "EFIPlatformInfoTypes.h"
37 |
38 | /*===========================================================================
39 | MACRO DECLARATIONS
40 | ===========================================================================*/
41 | /** @addtogroup efi_platformInfo_constants
42 | @{ */
43 | /**
44 | Protocol version.
45 | */
46 | #define EFI_PLATFORMINFO_PROTOCOL_VERSION 0x0000000000020000
47 | /** @} */ /* end_addtogroup efi_platformInfo_constants */
48 |
49 | /* Protocol GUID definition */
50 | /** @ingroup efi_platformInfo_protocol */
51 | #define EFI_PLATFORMINFO_PROTOCOL_GUID \
52 | { \
53 | 0x157a5c45, 0x21b2, 0x43c5, \
54 | { \
55 | 0xba, 0x7c, 0x82, 0x2f, 0xee, 0x5f, 0xe5, 0x99 \
56 | } \
57 | }
58 |
59 | /** @cond */
60 | /*===========================================================================
61 | EXTERNAL VARIABLES
62 | ===========================================================================*/
63 | /**
64 | External reference to the Platform Info Protocol GUID.
65 | */
66 | extern EFI_GUID gEfiPlatformInfoProtocolGuid;
67 |
68 | /*===========================================================================
69 | TYPE DEFINITIONS
70 | ===========================================================================*/
71 | /**
72 | Protocol declaration.
73 | */
74 | typedef struct _EFI_PLATFORMINFO_PROTOCOL EFI_PLATFORMINFO_PROTOCOL;
75 | /** @endcond */
76 |
77 | /**
78 | Stores the target platform, the platform version, and the subtype of the
79 | platform.
80 | */
81 | typedef struct {
82 | EFI_PLATFORMINFO_PLATFORM_TYPE platform;
83 | /**< Type of the current target; see #EFI_PLATFORMINFO_PLATFORM_TYPE for
84 | details. */
85 | UINT32 version;
86 | /**< Version of the platform in use. */
87 | UINT32 subtype;
88 | /**< Subtype of the platform. */
89 | BOOLEAN fusion;
90 | /**< TRUE if Fusion; FALSE otherwise. */
91 | } EFI_PLATFORMINFO_PLATFORM_INFO_TYPE;
92 | /** @} */ /* end_addtogroup efi_platformInfo_data_types */
93 |
94 | /*===========================================================================
95 | FUNCTION DEFINITIONS
96 | ===========================================================================*/
97 | /* EFI_PLATFORMINFO_GET_PLATFORMINFO */
98 | /** @ingroup efi_platformInfo_get_platformInfo
99 | @par Summary
100 | Gets information about the current platform. The information is returned
101 | in the PlatformInfo parameter.
102 |
103 | @param[in] This Pointer to the EFI_PLATFORMINFO_PROTOCOL instance.
104 | @param[out] PlatformInfo Pointer to the platform information to be filled
105 | in; see #EFI_PLATFORMINFO_PLATFORM_INFO_TYPE.
106 |
107 | @return
108 | EFI_SUCCESS -- Function completed successfully. \n
109 | EFI_PROTOCOL_ERROR -- Error occurred during the operation.
110 | */
111 | typedef EFI_STATUS (EFIAPI *EFI_PLATFORMINFO_GET_PLATFORMINFO) (
112 | IN EFI_PLATFORMINFO_PROTOCOL *This,
113 | OUT EFI_PLATFORMINFO_PLATFORM_INFO_TYPE *PlatformInfo);
114 |
115 | /* EFI_PLATFORMINFO_GET_KEYVALUE */
116 | /** @ingroup efi_platformInfo_get_platformInfo
117 | @par Summary
118 | Gets a key value.
119 |
120 | @param[in] This Pointer to the EFI_PLATFORMINFO_PROTOCOL instance.
121 | @param[in] Key Key to get the value for;
122 | see #EFI_PLATFORMINFO_KEY_TYPE.
123 | @param[out] Value Key value.
124 |
125 | @return
126 | EFI_SUCCESS -- Key found. \n
127 | EFI_NOT_FOUND -- Key not found. \n
128 | EFI_INVALID_PARAMETER -- Key out of range or Value is NULL.
129 | */
130 | typedef EFI_STATUS (EFIAPI *EFI_PLATFORMINFO_GET_KEYVALUE) (
131 | IN EFI_PLATFORMINFO_PROTOCOL *This,
132 | IN EFI_PLATFORMINFO_KEY_TYPE Key,
133 | OUT UINT32 *Value);
134 |
135 | /*===========================================================================
136 | PROTOCOL INTERFACE
137 | ===========================================================================*/
138 | /** @ingroup efi_platformInfo_protocol
139 | @par Summary
140 | Platform Information Protocol interface.
141 |
142 | @par Parameters
143 | @inputprotoparams{platform_info_proto_params.tex}
144 | */
145 | struct _EFI_PLATFORMINFO_PROTOCOL {
146 | UINT64 Version;
147 | EFI_PLATFORMINFO_GET_PLATFORMINFO GetPlatformInfo;
148 | EFI_PLATFORMINFO_GET_KEYVALUE GetKeyValue;
149 | };
150 |
151 | #endif /* __EFIPLATFORMINFO_H__ */
152 |
--------------------------------------------------------------------------------
/GalaxyA72/Include/Protocol/EFIPlatformInfoTypes.h:
--------------------------------------------------------------------------------
1 | /* Copyright (c) 2015-2018, The Linux Foundation. All rights reserved.
2 | *
3 | * Redistribution and use in source and binary forms, with or without
4 | * modification, are permitted provided that the following conditions are
5 | * met:
6 | * * Redistributions of source code must retain the above copyright
7 | * notice, this list of conditions and the following disclaimer.
8 | * * Redistributions in binary form must reproduce the above
9 | * copyright notice, this list of conditions and the following
10 | * disclaimer in the documentation and/or other materials provided
11 | * with the distribution.
12 | * * Neither the name of The Linux Foundation nor the names of its
13 | * contributors may be used to endorse or promote products derived
14 | * from this software without specific prior written permission.
15 | *
16 | * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
20 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
23 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
24 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
25 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
26 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 | */
28 |
29 | #ifndef __EFIPLATFORMINFOTYPES_H__
30 | #define __EFIPLATFORMINFOTYPES_H__
31 |
32 | /*===========================================================================
33 | * INCLUDE FILES
34 | *===========================================================================*/
35 |
36 | /*===========================================================================
37 | * TYPE DEFINITIONS
38 | * ===========================================================================*/
39 |
40 | /** @addtogroup efi_platformInfo_data_types
41 | @{ */
42 | /**
43 | Target type of the device on which the platform is running.
44 | */
45 | typedef enum {
46 | EFI_PLATFORMINFO_TYPE_UNKNOWN = 0x00, /**< Unknown target device. */
47 | EFI_PLATFORMINFO_TYPE_CDP = 0x01, /**< CDP device. */
48 | EFI_PLATFORMINFO_TYPE_FFA = 0x02, /**< Form-fit accurate device. */
49 | EFI_PLATFORMINFO_TYPE_FLUID = 0x03, /**< Forward looking user interface
50 | demonstration device. */
51 | EFI_PLATFORMINFO_TYPE_OEM = 0x05, /**< Original equipment manufacturer
52 | device. */
53 | EFI_PLATFORMINFO_TYPE_QT = 0x06, /**< Qualcomm tablet device. */
54 | EFI_PLATFORMINFO_TYPE_MTP = 0x08, /**< MTP device. */
55 | EFI_PLATFORMINFO_TYPE_LIQUID = 0x09, /**< LiQUID device. */
56 | EFI_PLATFORMINFO_TYPE_DRAGONBOARD = 0x0A, /**< DragonBoard@tm device. */
57 | EFI_PLATFORMINFO_TYPE_QRD = 0x0B, /**< QRD device. */
58 | EFI_PLATFORMINFO_TYPE_EVB = 0x0C, /**< EVB device. */
59 | EFI_PLATFORMINFO_TYPE_HRD = 0x0D, /**< HRD device. */
60 | EFI_PLATFORMINFO_TYPE_DTV = 0x0E, /**< DTV device. */
61 | EFI_PLATFORMINFO_TYPE_RUMI = 0x0F, /**< Target is on Rumi (ASIC emulation). */
62 | EFI_PLATFORMINFO_TYPE_VIRTIO = 0x10, /**< Target is on Virtio
63 | (system-level simulation). */
64 | EFI_PLATFORMINFO_TYPE_GOBI = 0x11, /**< Gobi@tm device. */
65 | EFI_PLATFORMINFO_TYPE_CBH = 0x12, /**< CBH device. */
66 | EFI_PLATFORMINFO_TYPE_BTS = 0x13, /**< BTS device. */
67 | EFI_PLATFORMINFO_TYPE_XPM = 0x14, /**< XPM device. */
68 | EFI_PLATFORMINFO_TYPE_RCM = 0x15, /**< RCM device. */
69 | EFI_PLATFORMINFO_TYPE_DMA = 0x16, /**< DMA device. */
70 | EFI_PLATFORMINFO_TYPE_STP = 0x17, /**< STP device. */
71 | EFI_PLATFORMINFO_TYPE_SBC = 0x18, /**< SBC device. */
72 | EFI_PLATFORMINFO_TYPE_ADP = 0x19, /**< ADP device. */
73 | EFI_PLATFORMINFO_TYPE_CHI = 0x1A, /**< CHI device. */
74 | EFI_PLATFORMINFO_TYPE_SDP = 0x1B, /**< SDP device. */
75 | EFI_PLATFORMINFO_TYPE_RRP = 0x1C, /**< RRP device. */
76 | EFI_PLATFORMINFO_TYPE_CLS = 0x1D, /**< CLS device. */
77 | EFI_PLATFORMINFO_TYPE_TTP = 0x1E, /**< TTP device. */
78 | EFI_PLATFORMINFO_TYPE_HDK = 0x1F, /**< HDK device. */
79 | EFI_PLATFORMINFO_TYPE_IOT = 0x20, /**< IOT device. */
80 | EFI_PLATFORMINFO_TYPE_ATP = 0x21, /**< ATP device. */
81 | EFI_PLATFORMINFO_TYPE_IDP = 0x22, /**< IDP device. */
82 |
83 | EFI_PLATFORMINFO_NUM_TYPES, /**< Number of known targets
84 | (including unknown). @newpage
85 | */
86 | /** @cond */
87 | EFI_PLATFORMINFO_TYPE_32BITS = 0x7FFFFFFF
88 | /** @endcond */
89 | } EFI_PLATFORMINFO_PLATFORM_TYPE;
90 |
91 | /**
92 | * Keys to get data out of the CDT.
93 | */
94 | typedef enum {
95 | EFI_PLATFORMINFO_KEY_UNKNOWN = 0x00,
96 | EFI_PLATFORMINFO_KEY_DDR_FREQ = 0x01,
97 | EFI_PLATFORMINFO_KEY_GFX_FREQ = 0x02,
98 | EFI_PLATFORMINFO_KEY_CAMERA_FREQ = 0x03,
99 | EFI_PLATFORMINFO_KEY_FUSION = 0x04,
100 | EFI_PLATFORMINFO_KEY_CUST = 0x05,
101 |
102 | EFI_PLATFORMINFO_NUM_KEYS = 0x06,
103 |
104 | /** @cond */
105 | EFI_PLATFORMINFO_KEY_32BITS = 0x7FFFFFFF
106 | /** @endcond */
107 | } EFI_PLATFORMINFO_KEY_TYPE;
108 |
109 | #endif /* __EFIPLATFORMINFOTYPES_H__ */
110 |
--------------------------------------------------------------------------------
/GalaxyA72/Include/Protocol/EFISmem.h:
--------------------------------------------------------------------------------
1 | #ifndef __EFISMEM_H__
2 | #define __EFISMEM_H__
3 |
4 | #include
5 |
6 | typedef struct _EFI_SMEM_PROTOCOL EFI_SMEM_PROTOCOL;
7 |
8 | #define EFI_SMEM_PROTOCOL_REVISION 0x0000000000010001
9 | #define EFI_SMEM_PROTOCOL_GUID { 0xf4e5c7d0, 0xd239, 0x47cb, { 0xaa, 0xcd, 0x7f, 0x66, 0xef, 0x76, 0x32, 0x38 } }
10 |
11 | extern EFI_GUID gEfiSMEMProtocolGuid;
12 |
13 | typedef EFI_STATUS (EFIAPI *EFI_SMEM_ALLOCATE_ITEM)(int itemIndex, unsigned int size, void **pAddr);
14 | typedef EFI_STATUS (EFIAPI *EFI_SMEM_GET_ITEM_ADDR)(int itemIndex, unsigned int* size, void **pAddr);
15 | typedef EFI_STATUS (EFIAPI *EFI_SMEM_FUNC_2_3)(void* params);
16 |
17 | struct _EFI_SMEM_PROTOCOL {
18 | UINT64 Revision;
19 | EFI_SMEM_ALLOCATE_ITEM AllocFunc;
20 | EFI_SMEM_GET_ITEM_ADDR GetFunc;
21 | EFI_SMEM_FUNC_2_3 Func2;
22 | EFI_SMEM_FUNC_2_3 Func3;
23 | };
24 |
25 | #endif /* EFISMEM_H */
--------------------------------------------------------------------------------
/GalaxyA72/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
--------------------------------------------------------------------------------
/GalaxyA72/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
--------------------------------------------------------------------------------
/GalaxyA72/Library/AcpiPlatformUpdateLib/AcpiPlatformUpdateLib.c:
--------------------------------------------------------------------------------
1 | #include
2 |
3 | #include
4 | #include
5 | #include
6 | #include
7 | #include
8 | #include
9 | #include
10 | #include
11 | #include
12 |
13 | #include
14 | #include
15 | #include
16 |
17 | VOID
18 | PlatformUpdateAcpiTables(VOID)
19 | {
20 | EFI_STATUS Status;
21 |
22 | UINT32 SOID = 0;
23 | UINT32 STOR = 0x1;
24 | UINT32 SIDV = 0;
25 | UINT16 SDFE = 0;
26 | UINT16 SIDM = 0;
27 | // UINT32 SUFS = 0xFFFFFFFF;
28 | UINT32 PUS3 = 0x0;
29 | // UINT32 SUS3 = 0xFFFFFFFF;
30 | UINT32 *pSIDT = (UINT32 *)0x784180;
31 | UINT32 SIDT = (*pSIDT & 0xFF00000) >> 20;
32 | UINT32 SOSN1 = 0;
33 | UINT32 SOSN2 = 0;
34 | UINT32 TPMA = 0x1;
35 | UINT32 TDTV = 0x6654504D;
36 | UINT64 SOSI = 0;
37 | UINT32 PRP0 = 0;
38 | UINT32 PRP1 = 0;
39 | CHAR8 SIDS[EFICHIPINFO_MAX_ID_LENGTH] = {0};
40 | EFI_PLATFORMINFO_PLATFORM_INFO_TYPE PlatformInfo;
41 | UINT32 RMTB = 0;
42 | UINT32 RMTX = 0;
43 | UINT32 RFMB = 0;
44 | UINT32 RFMS = 0;
45 | UINT32 RFAB = 0;
46 | UINT32 RFAS = 0;
47 | UINT32 TCMA = 0;
48 | UINT32 TCML = 0;
49 |
50 | EFI_CHIPINFO_PROTOCOL *mBoardProtocol = NULL;
51 | EFI_SMEM_PROTOCOL *pEfiSmemProtocol = NULL;
52 | EFI_PLATFORMINFO_PROTOCOL *pEfiPlatformInfoProtocol = NULL;
53 |
54 | UINT32 SmemSize = 0;
55 |
56 | //
57 | // Find the ChipInfo protocol
58 | //
59 | Status = gBS->LocateProtocol(
60 | &gEfiChipInfoProtocolGuid, NULL, (VOID *)&mBoardProtocol);
61 | if (EFI_ERROR(Status)) {
62 | return;
63 | }
64 |
65 | //
66 | // Find the SMEM protocol
67 | //
68 | Status = gBS->LocateProtocol(
69 | &gEfiSMEMProtocolGuid, NULL, (VOID **)&pEfiSmemProtocol);
70 | if (EFI_ERROR(Status)) {
71 | return;
72 | }
73 |
74 | //
75 | // Find the PlatformInfo protocol
76 | //
77 | Status = gBS->LocateProtocol(
78 | &gEfiPlatformInfoProtocolGuid, NULL, (VOID **)&pEfiPlatformInfoProtocol);
79 | if (EFI_ERROR(Status)) {
80 | return;
81 | }
82 |
83 | mBoardProtocol->GetChipId(mBoardProtocol, &SOID);
84 | mBoardProtocol->GetChipVersion(mBoardProtocol, &SIDV);
85 | mBoardProtocol->GetChipFamily(mBoardProtocol, (EFIChipInfoFamilyType *)&SDFE);
86 | mBoardProtocol->GetModemSupport(mBoardProtocol, (EFIChipInfoModemType *)&SIDM);
87 | mBoardProtocol->GetSerialNumber(mBoardProtocol, (EFIChipInfoSerialNumType *)&SOSN1);
88 | mBoardProtocol->GetQFPROMChipId(mBoardProtocol, (EFIChipInfoQFPROMChipIdType *)&SOSN2);
89 | mBoardProtocol->GetChipIdString(mBoardProtocol, SIDS, EFICHIPINFO_MAX_ID_LENGTH);
90 | pEfiSmemProtocol->GetFunc(137, &SmemSize, (VOID **)&SOSI);
91 | pEfiPlatformInfoProtocol->GetPlatformInfo(pEfiPlatformInfoProtocol, &PlatformInfo);
92 |
93 | UINT16 SVMJ = (UINT16)((SIDV >> 16) & 0xFFFF);
94 | UINT16 SVMI = (UINT16)(SIDV & 0xFFFF);
95 | UINT64 SOSN = ((UINT64)SOSN2 << 32) | SOSN1;
96 | UINT32 PLST = PlatformInfo.subtype;
97 |
98 | RMTB = 0x80600000;
99 | RMTX = 0x00200000;
100 |
101 | // Also configure MPSS Permissions!
102 |
103 | // Allow MPSS and HLOS to access the allocated RFS Shared Memory Region
104 | // Normally this would be done by a driver in Linux
105 | // TODO: Move to a better place!
106 | //RFSLocateAndProtectSharedArea();
107 |
108 | TCMA = 0x9E400000;
109 | TCML = 0x01400000;
110 |
111 | DEBUG((EFI_D_WARN, "Chip Id: %d\n", SOID));
112 | DEBUG((EFI_D_WARN, "Chip Family Id: %d\n", SDFE));
113 | DEBUG((EFI_D_WARN, "Chip Major Version: %d\n", SVMJ));
114 | DEBUG((EFI_D_WARN, "Chip Minor Version: %d\n", SVMI));
115 | DEBUG((EFI_D_WARN, "Chip Modem Support: 0x%x\n", SIDM));
116 | DEBUG((EFI_D_WARN, "Chip Serial Number: 0x%x\n", SOSN));
117 | DEBUG((EFI_D_WARN, "Chip Name: %a\n", SIDS));
118 | DEBUG((EFI_D_WARN, "Chip Info Address: 0x%x\n", SOSI));
119 | DEBUG((EFI_D_WARN, "Platform Subtype: %d\n", PLST));
120 |
121 | UpdateNameAslCode(SIGNATURE_32('S', 'O', 'I', 'D'), &SOID, 4);
122 | UpdateNameAslCode(SIGNATURE_32('S', 'T', 'O', 'R'), &STOR, 4);
123 | UpdateNameAslCode(SIGNATURE_32('S', 'I', 'D', 'V'), &SIDV, 4);
124 | UpdateNameAslCode(SIGNATURE_32('S', 'V', 'M', 'J'), &SVMJ, 2);
125 | UpdateNameAslCode(SIGNATURE_32('S', 'V', 'M', 'I'), &SVMI, 2);
126 | UpdateNameAslCode(SIGNATURE_32('S', 'D', 'F', 'E'), &SDFE, 2);
127 | UpdateNameAslCode(SIGNATURE_32('S', 'I', 'D', 'M'), &SIDM, 2);
128 | // UpdateNameAslCode(SIGNATURE_32('S', 'U', 'F', 'S'), &SUFS, 4);
129 | UpdateNameAslCode(SIGNATURE_32('P', 'U', 'S', '3'), &PUS3, 4);
130 | // UpdateNameAslCode(SIGNATURE_32('S', 'U', 'S', '3'), &SUS3, 4);
131 | UpdateNameAslCode(SIGNATURE_32('S', 'I', 'D', 'T'), &SIDT, 4);
132 | UpdateNameAslCode(SIGNATURE_32('S', 'O', 'S', 'N'), &SOSN, 8);
133 | UpdateNameAslCode(SIGNATURE_32('P', 'L', 'S', 'T'), &PLST, 4);
134 | UpdateNameAslCode(SIGNATURE_32('R', 'M', 'T', 'B'), &RMTB, 4);
135 | UpdateNameAslCode(SIGNATURE_32('R', 'M', 'T', 'X'), &RMTX, 4);
136 | UpdateNameAslCode(SIGNATURE_32('R', 'F', 'M', 'B'), &RFMB, 4);
137 | UpdateNameAslCode(SIGNATURE_32('R', 'F', 'M', 'S'), &RFMS, 4);
138 | UpdateNameAslCode(SIGNATURE_32('R', 'F', 'A', 'B'), &RFAB, 4);
139 | UpdateNameAslCode(SIGNATURE_32('R', 'F', 'A', 'S'), &RFAS, 4);
140 | UpdateNameAslCode(SIGNATURE_32('T', 'P', 'M', 'A'), &TPMA, 4);
141 | UpdateNameAslCode(SIGNATURE_32('T', 'D', 'T', 'V'), &TDTV, 4);
142 | UpdateNameAslCode(SIGNATURE_32('T', 'C', 'M', 'A'), &TCMA, 4);
143 | UpdateNameAslCode(SIGNATURE_32('T', 'C', 'M', 'L'), &TCML, 4);
144 | UpdateNameAslCode(SIGNATURE_32('S', 'O', 'S', 'I'), &SOSI, 8);
145 | UpdateNameAslCode(SIGNATURE_32('P', 'R', 'P', '0'), &PRP0, 4);
146 | UpdateNameAslCode(SIGNATURE_32('P', 'R', 'P', '1'), &PRP1, 4);
147 | UpdateNameAslCode(SIGNATURE_32('S', 'I', 'D', 'S'), &SIDS, EFICHIPINFO_MAX_ID_LENGTH);
148 | }
149 |
--------------------------------------------------------------------------------
/GalaxyA72/Library/AcpiPlatformUpdateLib/AcpiPlatformUpdateLib.inf:
--------------------------------------------------------------------------------
1 | [Defines]
2 | INF_VERSION = 0x00010005
3 | BASE_NAME = AcpiPlatformUpdateLib
4 | FILE_GUID = 2FDF4E63-5AD5-4385-A729-868019B45A99
5 | MODULE_TYPE = DXE_DRIVER
6 | VERSION_STRING = 1.0
7 | LIBRARY_CLASS = AcpiPlatformUpdateLib|DXE_DRIVER DXE_RUNTIME_DRIVER UEFI_APPLICATION
8 |
9 | #
10 | # VALID_ARCHITECTURES = IA32 X64
11 | #
12 |
13 | [Sources]
14 | AcpiPlatformUpdateLib.c
15 |
16 | [Packages]
17 | ArmPkg/ArmPkg.dec
18 | MdePkg/MdePkg.dec
19 | MdeModulePkg/MdeModulePkg.dec
20 | GalaxyA72/GalaxyA72.dec
21 |
22 | [LibraryClasses]
23 | BaseMemoryLib
24 | DebugLib
25 | DevicePathLib
26 | IoLib
27 | UefiBootServicesTableLib
28 | UefiLib
29 | AslUpdateLib
30 |
31 | [Protocols]
32 | gEfiChipInfoProtocolGuid ## CONSUMES
33 | gEfiSMEMProtocolGuid ## CONSUMES
34 | gEfiPlatformInfoProtocolGuid ## CONSUMES
35 |
36 | [BuildOptions.AARCH64]
37 | GCC:*_*_*_CC_FLAGS = -Wno-unused-function -Wno-unused-variable
38 |
--------------------------------------------------------------------------------
/GalaxyA72/Library/ArmMmuLib/AArch64/ArmMmuLibReplaceEntry.S:
--------------------------------------------------------------------------------
1 | #------------------------------------------------------------------------------
2 | #
3 | # Copyright (c) 2016, Linaro Limited. All rights reserved.
4 | #
5 | # SPDX-License-Identifier: BSD-2-Clause-Patent
6 | #
7 | #------------------------------------------------------------------------------
8 |
9 | #include
10 |
11 | .set CTRL_M_BIT, (1 << 0)
12 |
13 | .macro __replace_entry, el
14 |
15 | // disable the MMU
16 | mrs x8, sctlr_el\el
17 | bic x9, x8, #CTRL_M_BIT
18 | msr sctlr_el\el, x9
19 | isb
20 |
21 | // write updated entry
22 | str x1, [x0]
23 |
24 | // invalidate again to get rid of stale clean cachelines that may
25 | // have been filled speculatively since the last invalidate
26 | dmb sy
27 | dc ivac, x0
28 |
29 | // flush translations for the target address from the TLBs
30 | lsr x2, x2, #12
31 | .if \el == 1
32 | tlbi vaae1, x2
33 | .else
34 | tlbi vae\el, x2
35 | .endif
36 | dsb nsh
37 |
38 | // re-enable the MMU
39 | msr sctlr_el\el, x8
40 | isb
41 | .endm
42 |
43 | //VOID
44 | //ArmReplaceLiveTranslationEntry (
45 | // IN UINT64 *Entry,
46 | // IN UINT64 Value,
47 | // IN UINT64 Address
48 | // )
49 | ASM_FUNC(ArmReplaceLiveTranslationEntry)
50 |
51 | // disable interrupts
52 | mrs x4, daif
53 | msr daifset, #0xf
54 | isb
55 |
56 | // clean and invalidate first so that we don't clobber
57 | // adjacent entries that are dirty in the caches
58 | dc civac, x0
59 | dsb nsh
60 |
61 | EL1_OR_EL2_OR_EL3(x3)
62 | 1:__replace_entry 1
63 | b 4f
64 | 2:__replace_entry 2
65 | b 4f
66 | 3:__replace_entry 3
67 |
68 | 4:msr daif, x4
69 | ret
70 |
71 | ASM_GLOBAL ASM_PFX(ArmReplaceLiveTranslationEntrySize)
72 |
73 | ASM_PFX(ArmReplaceLiveTranslationEntrySize):
74 | .long . - ArmReplaceLiveTranslationEntry
75 |
--------------------------------------------------------------------------------
/GalaxyA72/Library/ArmMmuLib/AArch64/ArmMmuPeiLibConstructor.c:
--------------------------------------------------------------------------------
1 | #/* @file
2 | #
3 | # Copyright (c) 2016, Linaro Limited. All rights reserved.
4 | #
5 | # SPDX-License-Identifier: BSD-2-Clause-Patent
6 | #
7 | #*/
8 |
9 | #include
10 |
11 | #include
12 | #include
13 | #include
14 | #include
15 |
16 | EFI_STATUS
17 | EFIAPI
18 | ArmMmuPeiLibConstructor(
19 | IN EFI_PEI_FILE_HANDLE FileHandle, IN CONST EFI_PEI_SERVICES **PeiServices)
20 | {
21 | extern UINT32 ArmReplaceLiveTranslationEntrySize;
22 |
23 | EFI_FV_FILE_INFO FileInfo;
24 | EFI_STATUS Status;
25 |
26 | ASSERT(FileHandle != NULL);
27 |
28 | Status = (*PeiServices)->FfsGetFileInfo(FileHandle, &FileInfo);
29 | ASSERT_EFI_ERROR(Status);
30 |
31 | //
32 | // Some platforms do not cope very well with cache maintenance being
33 | // performed on regions backed by NOR flash. Since the firmware image
34 | // can be assumed to be clean to the PoC when running XIP, even when PEI
35 | // is executing from DRAM, we only need to perform the cache maintenance
36 | // when not executing in place.
37 | //
38 | if ((UINTN)FileInfo.Buffer <= (UINTN)ArmReplaceLiveTranslationEntry &&
39 | ((UINTN)FileInfo.Buffer + FileInfo.BufferSize >=
40 | (UINTN)ArmReplaceLiveTranslationEntry +
41 | ArmReplaceLiveTranslationEntrySize)) {
42 | DEBUG((EFI_D_INFO, "ArmMmuLib: skipping cache maintenance on XIP PEIM\n"));
43 | }
44 | else {
45 | DEBUG(
46 | (EFI_D_INFO,
47 | "ArmMmuLib: performing cache maintenance on shadowed PEIM\n"));
48 | //
49 | // The ArmReplaceLiveTranslationEntry () helper function may be invoked
50 | // with the MMU off so we have to ensure that it gets cleaned to the PoC
51 | //
52 | WriteBackDataCacheRange(
53 | ArmReplaceLiveTranslationEntry, ArmReplaceLiveTranslationEntrySize);
54 | }
55 |
56 | return RETURN_SUCCESS;
57 | }
58 |
--------------------------------------------------------------------------------
/GalaxyA72/Library/ArmMmuLib/Arm/ArmMmuLibV7Support.S:
--------------------------------------------------------------------------------
1 | #------------------------------------------------------------------------------
2 | #
3 | # Copyright (c) 2016, Linaro Limited. All rights reserved.
4 | #
5 | # SPDX-License-Identifier: BSD-2-Clause-Patent
6 | #
7 | #------------------------------------------------------------------------------
8 |
9 | #include
10 |
11 | .text
12 | .align 2
13 |
14 | GCC_ASM_EXPORT (ArmReadIdMmfr0)
15 | GCC_ASM_EXPORT (ArmHasMpExtensions)
16 |
17 | #------------------------------------------------------------------------------
18 |
19 | ASM_PFX (ArmHasMpExtensions):
20 | mrc p15,0,R0,c0,c0,5
21 | // Get Multiprocessing extension (bit31)
22 | lsr R0, R0, #31
23 | bx LR
24 |
25 | ASM_PFX(ArmReadIdMmfr0):
26 | mrc p15, 0, r0, c0, c1, 4 @ Read ID_MMFR0 Register
27 | bx lr
28 |
29 | ASM_FUNCTION_REMOVE_IF_UNREFERENCED
30 |
--------------------------------------------------------------------------------
/GalaxyA72/Library/ArmMmuLib/Arm/ArmMmuLibV7Support.asm:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // Copyright (c) 2016, Linaro Limited. All rights reserved.
4 | //
5 | // SPDX-License-Identifier: BSD-2-Clause-Patent
6 | //
7 | //------------------------------------------------------------------------------
8 |
9 |
10 |
11 | INCLUDE AsmMacroExport.inc
12 |
13 |
14 | //------------------------------------------------------------------------------
15 |
16 | RVCT_ASM_EXPORT ArmHasMpExtensions
17 | mrc p15,0,R0,c0,c0,5
18 | // Get Multiprocessing extension (bit31)
19 | lsr R0, R0, #31
20 | bx LR
21 |
22 | RVCT_ASM_EXPORT ArmReadIdMmfr0
23 | mrc p15, 0, r0, c0, c1, 4 ; Read ID_MMFR0 Register
24 | bx lr
25 |
26 | END
27 |
--------------------------------------------------------------------------------
/GalaxyA72/Library/ArmMmuLib/ArmMmuBaseLib.inf:
--------------------------------------------------------------------------------
1 | #/** @file
2 | #
3 | # Copyright (c) 2016 Linaro Ltd. All rights reserved.
4 | #
5 | # SPDX-License-Identifier: BSD-2-Clause-Patent
6 | #
7 | #
8 | #**/
9 |
10 | [Defines]
11 | INF_VERSION = 0x00010005
12 | BASE_NAME = ArmMmuBaseLib
13 | FILE_GUID = 459A0113-F77B-4270-7C40-ED473B985ED5
14 | MODULE_TYPE = BASE
15 | VERSION_STRING = 1.1
16 | LIBRARY_CLASS = ArmMmuLib
17 | CONSTRUCTOR = ArmMmuBaseLibConstructor
18 |
19 | [Sources.AARCH64]
20 | AArch64/ArmMmuLibCore.c
21 | AArch64/ArmMmuLibReplaceEntry.S
22 |
23 | [Sources.ARM]
24 | Arm/ArmMmuLibCore.c
25 | Arm/ArmMmuLibV7Support.S |GCC
26 | Arm/ArmMmuLibV7Support.asm |RVCT
27 |
28 | [Packages]
29 | ArmPkg/ArmPkg.dec
30 | EmbeddedPkg/EmbeddedPkg.dec
31 | MdePkg/MdePkg.dec
32 |
33 | [LibraryClasses]
34 | ArmLib
35 | CacheMaintenanceLib
36 | MemoryAllocationLib
37 |
38 | [Pcd.ARM]
39 | gArmTokenSpaceGuid.PcdNormalMemoryNonshareableOverride
40 |
--------------------------------------------------------------------------------
/GalaxyA72/Library/ArmMmuLib/ArmMmuPeiLib.inf:
--------------------------------------------------------------------------------
1 | #/** @file
2 | #
3 | # Copyright (c) 2016 Linaro Ltd. All rights reserved.
4 | #
5 | # SPDX-License-Identifier: BSD-2-Clause-Patent
6 | #
7 | #
8 | #**/
9 |
10 | [Defines]
11 | INF_VERSION = 0x00010005
12 | BASE_NAME = ArmMmuPeiLib
13 | FILE_GUID = 2FD24913-D00D-6E81-35DE-0EFA5A0AE893
14 | MODULE_TYPE = PEIM
15 | VERSION_STRING = 1.1
16 | LIBRARY_CLASS = ArmMmuLib|PEIM
17 | CONSTRUCTOR = ArmMmuPeiLibConstructor
18 |
19 | [Sources.AARCH64]
20 | AArch64/ArmMmuLibCore.c
21 | AArch64/ArmMmuPeiLibConstructor.c
22 | AArch64/ArmMmuLibReplaceEntry.S
23 |
24 | [Packages]
25 | ArmPkg/ArmPkg.dec
26 | EmbeddedPkg/EmbeddedPkg.dec
27 | MdePkg/MdePkg.dec
28 |
29 | [LibraryClasses]
30 | ArmLib
31 | CacheMaintenanceLib
32 | MemoryAllocationLib
33 |
--------------------------------------------------------------------------------
/GalaxyA72/Library/DxeAslUpdateLib/DxeAslUpdateLib.inf:
--------------------------------------------------------------------------------
1 | ## @file
2 | # Provides services to update ASL tables.
3 | # Note that the current version of the library updates AML.
4 | #
5 | # Copyright (c) 2020, Intel Corporation. All rights reserved.
6 | #
7 | # SPDX-License-Identifier: BSD-2-Clause-Patent
8 | #
9 | ##
10 |
11 |
12 |
13 | [Defines]
14 | INF_VERSION = 0x00010017
15 | BASE_NAME = DxeAslUpdateLib
16 | FILE_GUID = 8621697D-4E3A-4bf2-ADB0-3E2FF06559CA
17 | VERSION_STRING = 1.0
18 | MODULE_TYPE = DXE_DRIVER
19 | LIBRARY_CLASS = AslUpdateLib
20 |
21 |
22 | [LibraryClasses]
23 | BaseLib
24 | IoLib
25 | DebugLib
26 | PcdLib
27 | BaseMemoryLib
28 | UefiLib
29 | MemoryAllocationLib
30 |
31 |
32 | [Packages]
33 | MdePkg/MdePkg.dec
34 | GalaxyA72/GalaxyA72.dec
35 |
36 | [Sources]
37 | DxeAslUpdateLib.c
38 |
39 |
40 | [Protocols]
41 | gEfiAcpiTableProtocolGuid ## CONSUMES
42 | gEfiAcpiSdtProtocolGuid ## CONSUMES
43 |
--------------------------------------------------------------------------------
/GalaxyA72/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 | }
465 |
--------------------------------------------------------------------------------
/GalaxyA72/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
--------------------------------------------------------------------------------
/GalaxyA72/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 | GalaxyA72/GalaxyA72.dec
15 |
16 | [LibraryClasses]
17 | ArmLib
18 | PcdLib
19 | IoLib
20 | HobLib
21 | CompilerIntrinsicsLib
22 | CacheMaintenanceLib
23 |
24 | [Pcd]
25 | gGalaxyA72TokenSpaceGuid.PcdMipiFrameBufferAddress
26 | gGalaxyA72TokenSpaceGuid.PcdMipiFrameBufferWidth
27 | gGalaxyA72TokenSpaceGuid.PcdMipiFrameBufferHeight
28 | gGalaxyA72TokenSpaceGuid.PcdMipiFrameBufferPixelBpp
--------------------------------------------------------------------------------
/GalaxyA72/Library/GalaxyA72Lib/GalaxyA72.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 mGalaxyA72InfoTable[] = {
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 | // Cluster 0, Core 1
32 | 0x0, 0x1,
33 |
34 | // MP Core MailBox Set/Get/Clear Addresses and Clear Value
35 | (UINT64)0xFFFFFFFF
36 | },
37 | {
38 | // Cluster 0, Core 2
39 | 0x0, 0x2,
40 |
41 | // MP Core MailBox Set/Get/Clear Addresses and Clear Value
42 | (UINT64)0xFFFFFFFF
43 | },
44 | {
45 | // Cluster 0, Core 3
46 | 0x0, 0x3,
47 |
48 | // MP Core MailBox Set/Get/Clear Addresses and Clear Value
49 | (UINT64)0xFFFFFFFF
50 | },
51 | {
52 | // Cluster 1, Core 0
53 | 0x1, 0x0,
54 |
55 | // MP Core MailBox Set/Get/Clear Addresses and Clear Value
56 | (UINT64)0xFFFFFFFF
57 | },
58 | {
59 | // Cluster 1, Core 1
60 | 0x1, 0x1,
61 |
62 | // MP Core MailBox Set/Get/Clear Addresses and Clear Value
63 | (UINT64)0xFFFFFFFF
64 | },
65 | {
66 | // Cluster 1, Core 2
67 | 0x1, 0x2,
68 |
69 | // MP Core MailBox Set/Get/Clear Addresses and Clear Value
70 | (UINT64)0xFFFFFFFF
71 | },
72 | {
73 | // Cluster 1, Core 3
74 | 0x1, 0x3,
75 |
76 | // MP Core MailBox Set/Get/Clear Addresses and Clear Value
77 | (UINT64)0xFFFFFFFF
78 | }*/
79 | };
80 |
81 | /**
82 | Return the current Boot Mode
83 |
84 | This function returns the boot reason on the platform
85 |
86 | @return Return the current Boot Mode of the platform
87 |
88 | **/
89 | EFI_BOOT_MODE
90 | ArmPlatformGetBootMode (
91 | VOID
92 | )
93 | {
94 | return BOOT_WITH_FULL_CONFIGURATION;
95 | }
96 |
97 | /**
98 | Initialize controllers that must setup in the normal world
99 |
100 | This function is called by the ArmPlatformPkg/Pei or ArmPlatformPkg/Pei/PlatformPeim
101 | in the PEI phase.
102 |
103 | **/
104 | RETURN_STATUS
105 | ArmPlatformInitialize (
106 | IN UINTN MpId
107 | )
108 | {
109 | return RETURN_SUCCESS;
110 | }
111 |
112 | EFI_STATUS
113 | PrePeiCoreGetMpCoreInfo (
114 | OUT UINTN *CoreCount,
115 | OUT ARM_CORE_INFO **ArmCoreTable
116 | )
117 | {
118 | // Only support one cluster
119 | *CoreCount = sizeof(mGalaxyA72InfoTable) / sizeof(ARM_CORE_INFO);
120 | *ArmCoreTable = mGalaxyA72InfoTable;
121 | return EFI_SUCCESS;
122 | }
123 |
124 | // Needs to be declared in the file. Otherwise gArmMpCoreInfoPpiGuid is undefined in the contect of PrePeiCore
125 | EFI_GUID mArmMpCoreInfoPpiGuid = ARM_MP_CORE_INFO_PPI_GUID;
126 | ARM_MP_CORE_INFO_PPI mMpCoreInfoPpi = { PrePeiCoreGetMpCoreInfo };
127 |
128 | EFI_PEI_PPI_DESCRIPTOR gPlatformPpiTable[] = {
129 | {
130 | EFI_PEI_PPI_DESCRIPTOR_PPI,
131 | &mArmMpCoreInfoPpiGuid,
132 | &mMpCoreInfoPpi
133 | }
134 | };
135 |
136 | VOID
137 | ArmPlatformGetPlatformPpiList (
138 | OUT UINTN *PpiListSize,
139 | OUT EFI_PEI_PPI_DESCRIPTOR **PpiList
140 | )
141 | {
142 | *PpiListSize = sizeof(gPlatformPpiTable);
143 | *PpiList = gPlatformPpiTable;
144 | }
145 |
--------------------------------------------------------------------------------
/GalaxyA72/Library/GalaxyA72Lib/GalaxyA72Helper.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 |
--------------------------------------------------------------------------------
/GalaxyA72/Library/GalaxyA72Lib/GalaxyA72Lib.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 = GalaxyA72Lib
16 | FILE_GUID = f1582daa-ed2f-43a7-b0a7-5660ff468edd
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 | GalaxyA72/GalaxyA72.dec
28 |
29 | [LibraryClasses]
30 | ArmLib
31 | HobLib
32 | IoLib
33 | MemoryAllocationLib
34 | SerialPortLib
35 |
36 | [Sources.common]
37 | GalaxyA72.c
38 | GalaxyA72Helper.S
39 | GalaxyA72Mem.c
40 |
41 | [FixedPcd]
42 | gArmTokenSpaceGuid.PcdArmPrimaryCore
43 | gArmTokenSpaceGuid.PcdArmPrimaryCoreMask
44 | gArmTokenSpaceGuid.PcdSystemMemoryBase
45 | gArmTokenSpaceGuid.PcdSystemMemorySize
46 | gArmTokenSpaceGuid.PcdFdBaseAddress
47 | gArmTokenSpaceGuid.PcdFdSize
48 |
--------------------------------------------------------------------------------
/GalaxyA72/Library/GalaxyA72Lib/GalaxyA72Mem.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 | }
98 |
--------------------------------------------------------------------------------
/GalaxyA72/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 | /*UINT8* base = (UINT8*)0xb4600000ull;
38 | for (UINTN i = 0; i < 0x100000; i++) {
39 | base[i] = 0;
40 | }*/
41 | return RETURN_SUCCESS;
42 | }
43 |
44 | static void mem_putchar(UINT8 c) {
45 | static const UINTN size = 0x100000;
46 | static UINTN offset = 0;
47 | UINT8* base = (UINT8*)0xb4600000ull;
48 | base[offset++] = c;
49 | if (offset >= size) {
50 | offset = 0;
51 | }
52 | WriteBackInvalidateDataCacheRange(base, size);
53 | }
54 |
55 | /**
56 | Write data from buffer to serial device.
57 |
58 | Writes NumberOfBytes data bytes from Buffer to the serial device.
59 | The number of bytes actually written to the serial device is returned.
60 | If the return value is less than NumberOfBytes, then the write operation failed.
61 | If Buffer is NULL, then ASSERT().
62 | If NumberOfBytes is zero, then return 0.
63 |
64 | @param Buffer The pointer to the data buffer to be written.
65 | @param NumberOfBytes The number of bytes to written to the serial device.
66 |
67 | @retval 0 NumberOfBytes is 0.
68 | @retval >0 The number of bytes written to the serial device.
69 | If this value is less than NumberOfBytes, then the write operation failed.
70 |
71 | **/
72 | UINTN
73 | EFIAPI
74 | SerialPortWrite (
75 | IN UINT8 *Buffer,
76 | IN UINTN NumberOfBytes
77 | )
78 | {
79 | for (UINTN i = 0; i < NumberOfBytes; i++) {
80 | mem_putchar(Buffer[i]);
81 | }
82 | return NumberOfBytes;
83 | }
84 |
85 |
86 | /**
87 | Read data from serial device and save the datas in buffer.
88 |
89 | Reads NumberOfBytes data bytes from a serial device into the buffer
90 | specified by Buffer. The number of bytes actually read is returned.
91 | If the return value is less than NumberOfBytes, then the rest operation failed.
92 | If Buffer is NULL, then ASSERT().
93 | If NumberOfBytes is zero, then return 0.
94 |
95 | @param Buffer The pointer to the data buffer to store the data read from the serial device.
96 | @param NumberOfBytes The number of bytes which will be read.
97 |
98 | @retval 0 Read data failed; No data is to be read.
99 | @retval >0 The actual number of bytes read from serial device.
100 |
101 | **/
102 | UINTN
103 | EFIAPI
104 | SerialPortRead (
105 | OUT UINT8 *Buffer,
106 | IN UINTN NumberOfBytes
107 | )
108 | {
109 | return 0;
110 | }
111 |
112 | /**
113 | Polls a serial device to see if there is any data waiting to be read.
114 |
115 | Polls a serial device to see if there is any data waiting to be read.
116 | If there is data waiting to be read from the serial device, then TRUE is returned.
117 | If there is no data waiting to be read from the serial device, then FALSE is returned.
118 |
119 | @retval TRUE Data is waiting to be read from the serial device.
120 | @retval FALSE There is no data waiting to be read from the serial device.
121 |
122 | **/
123 | BOOLEAN
124 | EFIAPI
125 | SerialPortPoll (
126 | VOID
127 | )
128 | {
129 | return FALSE;
130 | }
131 |
132 | /**
133 | Sets the control bits on a serial device.
134 |
135 | @param Control Sets the bits of Control that are settable.
136 |
137 | @retval RETURN_SUCCESS The new control bits were set on the serial device.
138 | @retval RETURN_UNSUPPORTED The serial device does not support this operation.
139 | @retval RETURN_DEVICE_ERROR The serial device is not functioning correctly.
140 |
141 | **/
142 | RETURN_STATUS
143 | EFIAPI
144 | SerialPortSetControl (
145 | IN UINT32 Control
146 | )
147 | {
148 | return RETURN_UNSUPPORTED;
149 | }
150 |
151 | /**
152 | Retrieve the status of the control bits on a serial device.
153 |
154 | @param Control A pointer to return the current control signals from the serial device.
155 |
156 | @retval RETURN_SUCCESS The control bits were read from the serial device.
157 | @retval RETURN_UNSUPPORTED The serial device does not support this operation.
158 | @retval RETURN_DEVICE_ERROR The serial device is not functioning correctly.
159 |
160 | **/
161 | RETURN_STATUS
162 | EFIAPI
163 | SerialPortGetControl (
164 | OUT UINT32 *Control
165 | )
166 | {
167 | return RETURN_UNSUPPORTED;
168 | }
169 |
170 | /**
171 | Sets the baud rate, receive FIFO depth, transmit/receice time out, parity,
172 | data bits, and stop bits on a serial device.
173 |
174 | @param BaudRate The requested baud rate. A BaudRate value of 0 will use the
175 | device's default interface speed.
176 | On output, the value actually set.
177 | @param ReveiveFifoDepth The requested depth of the FIFO on the receive side of the
178 | serial interface. A ReceiveFifoDepth value of 0 will use
179 | the device's default FIFO depth.
180 | On output, the value actually set.
181 | @param Timeout The requested time out for a single character in microseconds.
182 | This timeout applies to both the transmit and receive side of the
183 | interface. A Timeout value of 0 will use the device's default time
184 | out value.
185 | On output, the value actually set.
186 | @param Parity The type of parity to use on this serial device. A Parity value of
187 | DefaultParity will use the device's default parity value.
188 | On output, the value actually set.
189 | @param DataBits The number of data bits to use on the serial device. A DataBits
190 | vaule of 0 will use the device's default data bit setting.
191 | On output, the value actually set.
192 | @param StopBits The number of stop bits to use on this serial device. A StopBits
193 | value of DefaultStopBits will use the device's default number of
194 | stop bits.
195 | On output, the value actually set.
196 |
197 | @retval RETURN_SUCCESS The new attributes were set on the serial device.
198 | @retval RETURN_UNSUPPORTED The serial device does not support this operation.
199 | @retval RETURN_INVALID_PARAMETER One or more of the attributes has an unsupported value.
200 | @retval RETURN_DEVICE_ERROR The serial device is not functioning correctly.
201 |
202 | **/
203 | RETURN_STATUS
204 | EFIAPI
205 | SerialPortSetAttributes (
206 | IN OUT UINT64 *BaudRate,
207 | IN OUT UINT32 *ReceiveFifoDepth,
208 | IN OUT UINT32 *Timeout,
209 | IN OUT EFI_PARITY_TYPE *Parity,
210 | IN OUT UINT8 *DataBits,
211 | IN OUT EFI_STOP_BITS_TYPE *StopBits
212 | )
213 | {
214 | return RETURN_UNSUPPORTED;
215 | }
216 |
--------------------------------------------------------------------------------
/GalaxyA72/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 = c969e679-0841-41a8-a45c-435e6d232f74
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
--------------------------------------------------------------------------------
/GalaxyA72/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 |
--------------------------------------------------------------------------------
/GalaxyA72/Library/MemoryInitPeiLib/MemoryInitPeiLib.c:
--------------------------------------------------------------------------------
1 | /** @file
2 | *
3 | * Copyright (c) 2011-2015, 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 |
18 | #include
19 | #include
20 | #include
21 | #include
22 | #include
23 | #include
24 |
25 | extern UINT64 mSystemMemoryEnd;
26 |
27 | VOID
28 | BuildMemoryTypeInformationHob (
29 | VOID
30 | );
31 |
32 | STATIC
33 | VOID
34 | InitMmu (
35 | IN ARM_MEMORY_REGION_DESCRIPTOR *MemoryTable
36 | )
37 | {
38 |
39 | VOID *TranslationTableBase;
40 | UINTN TranslationTableSize;
41 | RETURN_STATUS Status;
42 |
43 | //Note: Because we called PeiServicesInstallPeiMemory() before to call InitMmu() the MMU Page Table resides in
44 | // DRAM (even at the top of DRAM as it is the first permanent memory allocation)
45 | Status = ArmConfigureMmu (MemoryTable, &TranslationTableBase, &TranslationTableSize);
46 | if (EFI_ERROR (Status)) {
47 | DEBUG ((EFI_D_ERROR, "Error: Failed to enable MMU\n"));
48 | }
49 | }
50 |
51 | EFI_STATUS
52 | EFIAPI
53 | MemoryPeim (
54 | IN EFI_PHYSICAL_ADDRESS UefiMemoryBase,
55 | IN UINT64 UefiMemorySize
56 | )
57 | {
58 | ARM_MEMORY_REGION_DESCRIPTOR *MemoryTable;
59 |
60 | // Get Virtual Memory Map from the Platform Library
61 | ArmPlatformGetVirtualMemoryMap (&MemoryTable);
62 |
63 | // Ensure PcdSystemMemorySize has been set
64 | ASSERT (PcdGet64 (PcdSystemMemorySize) != 0);
65 |
66 | InitMmu (MemoryTable);
67 |
68 | if (FeaturePcdGet (PcdPrePiProduceMemoryTypeInformationHob)){
69 | // Optional feature that helps prevent EFI memory map fragmentation.
70 | BuildMemoryTypeInformationHob();
71 | }
72 |
73 | return EFI_SUCCESS;
74 | }
--------------------------------------------------------------------------------
/GalaxyA72/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 | GalaxyA72/GalaxyA72.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 |
--------------------------------------------------------------------------------
/GalaxyA72/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 |
--------------------------------------------------------------------------------
/GalaxyA72/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 | GalaxyA72/GalaxyA72.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 | AcpiPlatformUpdateLib
63 |
64 | [FeaturePcd]
65 | gEfiMdePkgTokenSpaceGuid.PcdUgaConsumeSupport
66 |
67 | [FixedPcd]
68 | gEfiMdePkgTokenSpaceGuid.PcdUartDefaultBaudRate
69 | gEfiMdePkgTokenSpaceGuid.PcdUartDefaultDataBits
70 | gEfiMdePkgTokenSpaceGuid.PcdUartDefaultParity
71 | gEfiMdePkgTokenSpaceGuid.PcdUartDefaultStopBits
72 | gEfiMdePkgTokenSpaceGuid.PcdDefaultTerminalType
73 |
74 | [Pcd]
75 | gEfiMdePkgTokenSpaceGuid.PcdPlatformBootTimeOut
76 |
77 | [Guids]
78 | gEfiFileInfoGuid
79 | gEfiFileSystemInfoGuid
80 | gEfiFileSystemVolumeLabelInfoIdGuid
81 | gEfiEndOfDxeEventGroupGuid
82 | gEfiTtyTermGuid
83 | gUefiShellFileGuid
84 |
85 | [Protocols]
86 | gEfiDevicePathProtocolGuid
87 | gEfiGraphicsOutputProtocolGuid
88 | gEfiLoadedImageProtocolGuid
89 | gEfiSimpleFileSystemProtocolGuid
90 | gEsrtManagementProtocolGuid
91 | gEfiUsb2HcProtocolGuid
92 | gEFIDroidKeypadDeviceProtocolGuid
93 |
94 |
--------------------------------------------------------------------------------
/GalaxyA72/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 | }
--------------------------------------------------------------------------------
/GalaxyA72/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 | GalaxyA72/GalaxyA72.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 |
--------------------------------------------------------------------------------
/GalaxyA72/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 | }
--------------------------------------------------------------------------------
/GalaxyA72/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 | GalaxyA72/GalaxyA72.dec
20 |
21 | [LibraryClasses]
22 | BaseLib
23 | ReportStatusCodeLib
24 | UefiLib
25 | UefiBootServicesTableLib
26 | UefiDriverEntryPoint
27 | BaseMemoryLib
28 | DebugLib
29 | CompilerIntrinsicsLib
30 | PcdLib
31 | FrameBufferBltLib
32 | CacheMaintenanceLib
33 |
34 | [Protocols]
35 | gEfiGraphicsOutputProtocolGuid ## PRODUCES
36 | gEfiCpuArchProtocolGuid
37 |
38 | [FixedPcd]
39 | gGalaxyA72TokenSpaceGuid.PcdMipiFrameBufferAddress
40 | gGalaxyA72TokenSpaceGuid.PcdMipiFrameBufferWidth
41 | gGalaxyA72TokenSpaceGuid.PcdMipiFrameBufferHeight
42 |
43 | [Guids]
44 | gEfiMdeModulePkgTokenSpaceGuid
45 |
46 | [Pcd]
47 | gEfiMdeModulePkgTokenSpaceGuid.PcdVideoHorizontalResolution
48 | gEfiMdeModulePkgTokenSpaceGuid.PcdVideoVerticalResolution
49 |
50 | [Depex]
51 | gEfiCpuArchProtocolGuid
52 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | EDK2 for Samsung Galaxy A72.
2 |
3 | Based on zhuowei's commits for Pixel3XL - https://github.com/Pixel3Dev/edk2-pixel3
4 |
5 | ## Status
6 | Boot Windows PE: Boots with clean boot.wim(not 20h2pe_new that has sdm845 drivers)
7 |
8 | [winpe_desktop_NODRIVERS.zip](https://drive.google.com/drive/folders/1-k4LwTuVw48e3Es_CIKPNf68CA9HXYRb?usp=sharing)
9 |
10 | Requires drivers from Snapdragon 7C(sc7180) to make usb, etc to work.
11 |
12 | ## Bugs
13 | UFS detected in Windows but partitions cannot be mounted. (Windows doesn't like samsung's gpt tables...)
14 |
15 | ## WARNING
16 |
17 | **DO NOT EVER TRY TO PORT IT TO *SONY* and *GOOGLE* DEVICES**
18 |
19 | **YOUR UFS WILL BE WIPED CLEAN!!!**
20 |
21 | ## Building
22 | Tested on:
23 |
24 | Ubuntu 20.04 (WSL2)
25 |
26 | Ubuntu 18.04 arm64 (android chroot)
27 |
28 | Setup
29 | ```
30 | git clone https://github.com/map220v/edk2-a72q
31 | git clone https://github.com/tianocore/edk2.git --recursive --depth 1
32 | sudo apt install build-essential uuid-dev iasl git nasm python3-distutils gcc-aarch64-linux-gnu abootimg
33 | cd edk2-a72q
34 | ./firstrun.sh
35 | ```
36 | Build
37 | ```
38 | ./build.sh
39 | ```
40 | Or this for 8Gb RAM model
41 | ```
42 | ./build_8G.sh
43 | ```
44 | Flash
45 | ```
46 | heimdall flash --BOOT boot-a72q.img
47 | ```
48 |
49 | # Credits
50 |
51 | SimpleFbDxe screen driver is from imbushuo's [Lumia950XLPkg](https://github.com/WOA-Project/Lumia950XLPkg).
52 |
53 | `fxsheep` for his original `edk2-sagit`
54 |
55 | `strongtz` for maintaining Renegade Project
56 |
--------------------------------------------------------------------------------
/a72q.dtb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/map220v/edk2-a72q/ab0a45671a90e7cc94eca1aa966238091385732c/a72q.dtb
--------------------------------------------------------------------------------
/build.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # based on the instructions from edk2-platform
3 | set -e
4 | . build_common.sh
5 | # not actually GCC5; it's GCC7 on Ubuntu 18.04.
6 | GCC5_AARCH64_PREFIX=aarch64-linux-gnu- build -s -n 0 -a AARCH64 -t GCC5 -p GalaxyA72/GalaxyA72_6G.dsc -b RELEASE
7 | gzip -c < workspace/Build/GalaxyA72/RELEASE_GCC5/FV/GALAXYA72_UEFI.fd >uefi.img
8 | cat a72q.dtb >>uefi.img
9 | echo > ramdisk
10 | abootimg --create boot-a72q.img -k uefi.img -r ramdisk
--------------------------------------------------------------------------------
/build_8G.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # based on the instructions from edk2-platform
3 | set -e
4 | . build_common.sh
5 | # not actually GCC5; it's GCC7 on Ubuntu 18.04.
6 | GCC5_AARCH64_PREFIX=aarch64-linux-gnu- build -s -n 0 -a AARCH64 -t GCC5 -p GalaxyA72/GalaxyA72_8G.dsc -b RELEASE
7 | gzip -c < workspace/Build/GalaxyA72_8G/RELEASE_GCC5/FV/GALAXYA72_UEFI.fd >uefi.img
8 | cat a72q.dtb >>uefi.img
9 | echo > ramdisk
10 | abootimg --create boot-a72q_8G.img -k uefi.img -r ramdisk
--------------------------------------------------------------------------------
/build_common.sh:
--------------------------------------------------------------------------------
1 | export PACKAGES_PATH=$PWD/../edk2:$PWD
2 | export WORKSPACE=$PWD/workspace
3 | . ../edk2/edksetup.sh
4 |
--------------------------------------------------------------------------------
/build_debug.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # based on the instructions from edk2-platform
3 | set -e
4 | . build_common.sh
5 | # not actually GCC5; it's GCC7 on Ubuntu 18.04.
6 | GCC5_AARCH64_PREFIX=aarch64-linux-gnu- build -s -n 0 -a AARCH64 -t GCC5 -p GalaxyA72/GalaxyA72_6G.dsc
7 | gzip -c < workspace/Build/GalaxyA72/DEBUG_GCC5/FV/GALAXYA72_UEFI.fd >uefi.img
8 | cat a72q.dtb >>uefi.img
9 | echo > ramdisk
10 | abootimg --create boot-a72q_DEBUG.img -k uefi.img -r ramdisk
--------------------------------------------------------------------------------
/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 | mkdir -p workspace
7 | . build_common.sh
8 | make -C ../edk2/BaseTools
9 |
10 |
--------------------------------------------------------------------------------