├── workspace └── .gitignore ├── .gitignore ├── EXYNOS7885Pkg ├── Drivers │ ├── LogoDxe │ │ ├── Logo.bmp │ │ ├── Logo.idf │ │ ├── LogoDxeExtra.uni │ │ ├── LogoExtra.uni │ │ ├── LogoDxe.uni │ │ ├── Logo.uni │ │ ├── Logo.inf │ │ ├── LogoDxe.inf │ │ └── Logo.c │ ├── ConSplitterDxe │ │ ├── ConSplitterDxeExtra.uni │ │ ├── ConSplitterDxe.uni │ │ └── ConSplitterDxe.inf │ ├── GraphicsConsoleDxe │ │ ├── GraphicsConsoleDxeExtra.uni │ │ ├── GraphicsConsoleDxe.uni │ │ ├── GraphicsConsoleDxe.inf │ │ └── ComponentName.c │ ├── EXYNOS7885PkgDxe │ │ ├── EXYNOS7885PkgDxe.h │ │ ├── EXYNOS7885PkgDxe.inf │ │ └── EXYNOS7885PkgDxe.c │ ├── SimpleFbDxe │ │ ├── SimpleFbDxe.inf │ │ └── SimpleFbDxe.c │ └── SmbiosPlatformDxe │ │ └── SmbiosPlatformDxe.inf ├── PrePi │ ├── Arm │ │ ├── ArchPrePi.c │ │ └── ModuleEntryPoint.S │ ├── AArch64 │ │ ├── ArchPrePi.c │ │ └── ModuleEntryPoint.S │ ├── PrePi.h │ ├── PrePi.inf │ └── PrePi.c ├── Include │ ├── Resources │ │ ├── FbColor.h │ │ └── font5x12.h │ ├── Library │ │ └── FrameBufferSerialPortLib.h │ ├── Configuration │ │ ├── BootDevices.h │ │ └── DeviceMemoryMap.h │ └── ArmPlatform.h ├── Library │ ├── FrameBufferSerialPortLib │ │ ├── FrameBufferSerialPortLib.h │ │ ├── FrameBufferSerialPortLib.inf │ │ └── FrameBufferSerialPortLib.c │ ├── PlatformPeiLib │ │ ├── PlatformPeiLib.c │ │ └── PlatformPeiLib.inf │ ├── InMemorySerialPortLib │ │ ├── InMemorySerialPortLib.uni │ │ ├── InMemorySerialPortLib.inf │ │ └── InMemorySerialPortLib.c │ ├── MemoryInitPeiLib │ │ ├── PeiMemoryAllocationLib.inf │ │ └── MemoryInitPeiLib.c │ ├── FrameBufferBltLib │ │ └── FrameBufferBltLib.inf │ ├── EXYNOS7885PkgLib │ │ ├── EXYNOS7885PkgLib.inf │ │ ├── EXYNOS7885PkgHelper.S │ │ └── EXYNOS7885Pkg.c │ └── PlatformBootManagerLib │ │ ├── PlatformBm.h │ │ └── PlatformBootManagerLib.inf ├── Devices │ └── a10.dsc ├── AcpiTables │ ├── AcpiTables.inf │ ├── Spcr.aslc │ ├── Dbg2.aslc │ ├── Gtdt.aslc │ ├── Fadt.aslc │ ├── Madt.aslc │ └── AcpiSsdtRootPci.asl ├── EXYNOS7885Pkg.dec ├── CommonFdf.fdf.inc ├── EXYNOS7885Pkg.fdf └── EXYNOS7885Pkg.dsc ├── azure-pipelines.yml ├── firstrun.sh ├── ci-build.sh ├── BootShim ├── Makefile └── BootShim.S ├── .github └── workflows │ └── build.yml ├── device_specific └── reference.dts └── README.md /workspace/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | uefi.img 2 | BootShim/BootShim.bin 3 | 12 4 | 5 | -------------------------------------------------------------------------------- /EXYNOS7885Pkg/Drivers/LogoDxe/Logo.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sonic011gamer/edk2-exynos7885/HEAD/EXYNOS7885Pkg/Drivers/LogoDxe/Logo.bmp -------------------------------------------------------------------------------- /azure-pipelines.yml: -------------------------------------------------------------------------------- 1 | trigger: 2 | - master 3 | 4 | pool: 5 | vmImage: 'Ubuntu-16.04' 6 | 7 | steps: 8 | - script: | 9 | ./ci-build.sh 10 | displayName: 'ci-build' 11 | -------------------------------------------------------------------------------- /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 | . build_common.sh 7 | make -C ../edk2/BaseTools 8 | 9 | -------------------------------------------------------------------------------- /ci-build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | sudo apt update 4 | sudo apt install -y build-essential uuid-dev iasl git nasm gcc-aarch64-linux-gnu bc mkbootimg 5 | curdir="$PWD" 6 | cd .. 7 | git clone https://github.com/tianocore/edk2 --recursive -b edk2-stable202302 8 | git clone https://github.com/tianocore/edk2-platforms.git 9 | cd "$curdir" 10 | ./firstrun.sh 11 | ./build.sh 12 | -------------------------------------------------------------------------------- /EXYNOS7885Pkg/Drivers/ConSplitterDxe/ConSplitterDxeExtra.uni: -------------------------------------------------------------------------------- 1 | // /** @file 2 | // ConSplitterDxe Localized Strings and Content 3 | // 4 | // Copyright (c) 2013 - 2018, Intel Corporation. All rights reserved.
5 | // 6 | // SPDX-License-Identifier: BSD-2-Clause-Patent 7 | // 8 | // **/ 9 | 10 | #string STR_PROPERTIES_MODULE_NAME 11 | #language en-US 12 | "Console Splitter DXE Driver" 13 | 14 | 15 | -------------------------------------------------------------------------------- /EXYNOS7885Pkg/Drivers/GraphicsConsoleDxe/GraphicsConsoleDxeExtra.uni: -------------------------------------------------------------------------------- 1 | // /** @file 2 | // GraphicsConsoleDxe Localized Strings and Content 3 | // 4 | // Copyright (c) 2013 - 2018, Intel Corporation. All rights reserved.
5 | // 6 | // SPDX-License-Identifier: BSD-2-Clause-Patent 7 | // 8 | // **/ 9 | 10 | #string STR_PROPERTIES_MODULE_NAME 11 | #language en-US 12 | "Graphics Console DXE Driver" 13 | 14 | 15 | -------------------------------------------------------------------------------- /BootShim/Makefile: -------------------------------------------------------------------------------- 1 | ARCH = arm64 2 | TARGET = aarch64-linux-gnu 3 | CROSS_COMPILE = $(TARGET)- 4 | CC = $(CROSS_COMPILE)gcc 5 | OBJCOPY = $(CROSS_COMPILE)objcopy 6 | 7 | all: BootShim.elf BootShim.bin 8 | 9 | BootShim.bin: BootShim.elf 10 | $(OBJCOPY) -O binary $< $@ 11 | 12 | BootShim.elf: BootShim.S 13 | $(CC) -c $< -o $@ -DUEFI_BASE=$(UEFI_BASE) -DUEFI_SIZE=$(UEFI_SIZE) 14 | 15 | BootShim.S: -------------------------------------------------------------------------------- /.github/workflows/build.yml: -------------------------------------------------------------------------------- 1 | name: C/C++ CI 2 | 3 | on: 4 | push: 5 | branches: [ "main" ] 6 | pull_request: 7 | branches: [ "main" ] 8 | 9 | jobs: 10 | build: 11 | 12 | runs-on: ubuntu-latest 13 | 14 | steps: 15 | - uses: actions/checkout@v3 16 | - name: CI Build 17 | run: chmod +x ci-build.sh && ./ci-build.sh 18 | 19 | - uses: actions/upload-artifact@v3 20 | with: 21 | name: Galaxy A10 22 | path: ./workspace/boot.tar -------------------------------------------------------------------------------- /EXYNOS7885Pkg/PrePi/Arm/ArchPrePi.c: -------------------------------------------------------------------------------- 1 | /** @file 2 | 3 | Copyright (c) 2011 - 2013, ARM Limited. All rights reserved. 4 | 5 | SPDX-License-Identifier: BSD-2-Clause-Patent 6 | 7 | **/ 8 | 9 | #include "PrePi.h" 10 | 11 | VOID 12 | ArchInitialize ( 13 | VOID 14 | ) 15 | { 16 | // Enable program flow prediction, if supported. 17 | ArmEnableBranchPrediction (); 18 | 19 | if (FixedPcdGet32 (PcdVFPEnabled)) { 20 | ArmEnableVFP (); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /EXYNOS7885Pkg/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 -------------------------------------------------------------------------------- /EXYNOS7885Pkg/PrePi/AArch64/ArchPrePi.c: -------------------------------------------------------------------------------- 1 | /** @file 2 | 3 | Copyright (c) 2011-2017, ARM Limited. All rights reserved. 4 | 5 | SPDX-License-Identifier: BSD-2-Clause-Patent 6 | 7 | **/ 8 | 9 | #include "PrePi.h" 10 | 11 | #include 12 | 13 | /** 14 | Architecture specific initialization routine. 15 | **/ 16 | VOID 17 | ArchInitialize ( 18 | VOID 19 | ) 20 | { 21 | if (ArmReadCurrentEL () == AARCH64_EL2) { 22 | // Trap General Exceptions. All exceptions that would be routed to EL1 are routed to EL2 23 | ArmWriteHcr (ARM_HCR_TGE); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /EXYNOS7885Pkg/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 | -------------------------------------------------------------------------------- /device_specific/reference.dts: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-only 2 | 3 | /dts-v1/; 4 | 5 | / { 6 | // This is used by the bootloader to find the correct DTB 7 | qcom,msm-id = <206 0>; // qcom,msm-id = <247 0>; for APQ8016 8 | qcom,board-id = <0xCE08FF01 4>; /* FIXME: Check your downstream device tree */ 9 | 10 | model = "Samsung Galaxy J5 2016"; // FIXME 11 | compatible = "samsung,j510f", "qcom,msm8916"; // FIXME 12 | 13 | #address-cells = <2>; 14 | #size-cells = <2>; 15 | 16 | // The bootloader gets really sad if it cannot find those nodes 17 | chosen { }; 18 | 19 | memory@0 { 20 | device_type = "memory"; 21 | /* We expect the bootloader to fill in the reg */ 22 | reg = <0 0 0 0>; 23 | }; 24 | }; 25 | -------------------------------------------------------------------------------- /EXYNOS7885Pkg/Drivers/EXYNOS7885PkgDxe/EXYNOS7885PkgDxe.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 __EXYNOS7885PKGDXE_H__ 16 | #define __EXYNOS7885PKGDXE_H__ 17 | 18 | #endif /* __EXYNOS7885PKGDXE_H__ */ 19 | -------------------------------------------------------------------------------- /EXYNOS7885Pkg/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 | -------------------------------------------------------------------------------- /EXYNOS7885Pkg/Drivers/LogoDxe/LogoExtra.uni: -------------------------------------------------------------------------------- 1 | // /** @file 2 | // Logo Localized Strings and Content 3 | // 4 | // Copyright (c) 2013 - 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 | #string STR_PROPERTIES_MODULE_NAME 16 | #language en-US 17 | "Logo Image File" 18 | 19 | 20 | -------------------------------------------------------------------------------- /EXYNOS7885Pkg/Drivers/GraphicsConsoleDxe/GraphicsConsoleDxe.uni: -------------------------------------------------------------------------------- 1 | // /** @file 2 | // Console support on graphic devices. 3 | // 4 | // This driver will install Simple Text Output protocol by consuming Graphices Output 5 | // protocol or UGA Draw protocol on graphic devices. 6 | // 7 | // Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.
8 | // 9 | // SPDX-License-Identifier: BSD-2-Clause-Patent 10 | // 11 | // **/ 12 | 13 | 14 | #string STR_MODULE_ABSTRACT #language en-US "Console support on graphic devices" 15 | 16 | #string STR_MODULE_DESCRIPTION #language en-US "This driver will install SimpleTextOutputProtocol by consuming GraphicesOutput\n" 17 | "Protocol or UgaDrawProtocol on graphics devices." 18 | 19 | -------------------------------------------------------------------------------- /EXYNOS7885Pkg/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 | -------------------------------------------------------------------------------- /EXYNOS7885Pkg/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 -------------------------------------------------------------------------------- /EXYNOS7885Pkg/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 | EXYNOS7885Pkg/EXYNOS7885Pkg.dec 15 | 16 | [LibraryClasses] 17 | ArmLib 18 | PcdLib 19 | IoLib 20 | HobLib 21 | CompilerIntrinsicsLib 22 | CacheMaintenanceLib 23 | 24 | [Pcd] 25 | gEXYNOS7885PkgTokenSpaceGuid.PcdMipiFrameBufferAddress 26 | gEXYNOS7885PkgTokenSpaceGuid.PcdMipiFrameBufferWidth 27 | gEXYNOS7885PkgTokenSpaceGuid.PcdMipiFrameBufferHeight 28 | gEXYNOS7885PkgTokenSpaceGuid.PcdMipiFrameBufferPixelBpp 29 | gEXYNOS7885PkgTokenSpaceGuid.PcdMipiFrameBufferVisibleWidth 30 | gEXYNOS7885PkgTokenSpaceGuid.PcdMipiFrameBufferVisibleHeight 31 | -------------------------------------------------------------------------------- /BootShim/BootShim.S: -------------------------------------------------------------------------------- 1 | _Head: 2 | /* Set _Entry address */ 3 | adr x1, _Payload 4 | 5 | /* Jump to the real code */ 6 | b _Start 7 | 8 | /* Fake Linux kernel header */ 9 | 10 | _StackBase: 11 | /* Text Offset */ 12 | .quad UEFI_BASE 13 | 14 | _StackSize: 15 | /* Image Size */ 16 | .quad UEFI_SIZE 17 | 18 | /* Flags */ 19 | .quad 0 20 | 21 | /* Reserved */ 22 | .quad 0 23 | 24 | /* Reserved */ 25 | .quad 0 26 | 27 | /* Reserved */ 28 | .quad 0 29 | 30 | /* ARM64 Magic */ 31 | .ascii "ARM\x64" 32 | 33 | /* Reserved */ 34 | .long 0 35 | 36 | _Start: 37 | mov x4, x1 38 | ldr x5, _StackBase 39 | cmp x4, x5 40 | beq _Entry 41 | ldr x6, _StackSize 42 | 43 | _CopyLoop: 44 | ldp x2, x3, [x4], #16 45 | stp x2, x3, [x5], #16 46 | subs x6, x6, #16 47 | b.ne _CopyLoop 48 | ldr x5, _StackBase 49 | 50 | _Entry: 51 | br x5 52 | 53 | _Dead: 54 | /* We should never get here */ 55 | b _Dead 56 | 57 | .text 58 | .align 4 59 | 60 | _Payload: 61 | /* Your code will get ran right after this binary */ -------------------------------------------------------------------------------- /EXYNOS7885Pkg/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 | } -------------------------------------------------------------------------------- /EXYNOS7885Pkg/Library/InMemorySerialPortLib/InMemorySerialPortLib.uni: -------------------------------------------------------------------------------- 1 | // /** @file 2 | // Null instance of Serial Port Library with empty functions. 3 | // 4 | // Null instance of Serial Port Library with empty functions. 5 | // 6 | // Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.
7 | // 8 | // This program and the accompanying materials 9 | // are licensed and made available under the terms and conditions of the BSD License 10 | // which accompanies this distribution. The full text of the license may be found at 11 | // http://opensource.org/licenses/bsd-license.php. 12 | // THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 14 | // 15 | // **/ 16 | 17 | 18 | #string STR_MODULE_ABSTRACT #language en-US "Serial Port Library that dumps everything written to in memory buffer" 19 | 20 | #string STR_MODULE_DESCRIPTION #language en-US "Serial Port Library that dumps everything written to in memory buffer" 21 | 22 | -------------------------------------------------------------------------------- /EXYNOS7885Pkg/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 "Provides the default logo bitmap picture shown on setup screen." 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 | -------------------------------------------------------------------------------- /EXYNOS7885Pkg/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 | -------------------------------------------------------------------------------- /EXYNOS7885Pkg/Library/MemoryInitPeiLib/PeiMemoryAllocationLib.inf: -------------------------------------------------------------------------------- 1 | #/** @file 2 | # 3 | # Copyright (c) 2011-2014, ARM Ltd. All rights reserved.
4 | # SPDX-License-Identifier: BSD-2-Clause-Patent 5 | # 6 | #**/ 7 | 8 | [Defines] 9 | INF_VERSION = 0x00010005 10 | BASE_NAME = ArmMemoryInitPeiLib 11 | FILE_GUID = 55ddb6e0-70b5-11e0-b33e-0002a5d5c51b 12 | MODULE_TYPE = BASE 13 | VERSION_STRING = 1.0 14 | LIBRARY_CLASS = MemoryInitPeiLib|SEC PEIM 15 | 16 | [Sources] 17 | MemoryInitPeiLib.c 18 | 19 | 20 | [Packages] 21 | MdePkg/MdePkg.dec 22 | MdeModulePkg/MdeModulePkg.dec 23 | EmbeddedPkg/EmbeddedPkg.dec 24 | ArmPkg/ArmPkg.dec 25 | ArmPlatformPkg/ArmPlatformPkg.dec 26 | UefiCpuPkg/UefiCpuPkg.dec 27 | EXYNOS7885Pkg/EXYNOS7885Pkg.dec 28 | 29 | [LibraryClasses] 30 | DebugLib 31 | HobLib 32 | ArmMmuLib 33 | 34 | [Guids] 35 | gEfiMemoryTypeInformationGuid 36 | 37 | [FeaturePcd] 38 | gEmbeddedTokenSpaceGuid.PcdPrePiProduceMemoryTypeInformationHob 39 | 40 | [Pcd] 41 | gArmTokenSpaceGuid.PcdSystemMemoryBase 42 | gArmTokenSpaceGuid.PcdSystemMemorySize 43 | 44 | [Depex] 45 | TRUE -------------------------------------------------------------------------------- /EXYNOS7885Pkg/PrePi/PrePi.h: -------------------------------------------------------------------------------- 1 | /** @file 2 | 3 | Copyright (c) 2011 - 2020, Arm Limited. All rights reserved.
4 | 5 | SPDX-License-Identifier: BSD-2-Clause-Patent 6 | 7 | **/ 8 | 9 | #ifndef _PREPI_H_ 10 | #define _PREPI_H_ 11 | 12 | #include 13 | 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | 24 | extern UINT64 mSystemMemoryEnd; 25 | 26 | EFI_STATUS 27 | EFIAPI 28 | MemoryPeim ( 29 | IN EFI_PHYSICAL_ADDRESS UefiMemoryBase, 30 | IN UINT64 UefiMemorySize 31 | ); 32 | 33 | EFI_STATUS 34 | EFIAPI 35 | PlatformPeim ( 36 | VOID 37 | ); 38 | 39 | // Either implemented by PrePiLib or by MemoryInitPei 40 | VOID 41 | BuildMemoryTypeInformationHob ( 42 | VOID 43 | ); 44 | 45 | // Initialize the Architecture specific controllers 46 | VOID 47 | ArchInitialize ( 48 | VOID 49 | ); 50 | 51 | VOID 52 | EFIAPI 53 | ProcessLibraryConstructorList ( 54 | VOID 55 | ); 56 | 57 | #endif /* _PREPI_H_ */ 58 | -------------------------------------------------------------------------------- /EXYNOS7885Pkg/Library/FrameBufferBltLib/FrameBufferBltLib.inf: -------------------------------------------------------------------------------- 1 | ## @file 2 | # FrameBufferBltLib - Library to perform blt operations on a frame buffer. 3 | # 4 | # Copyright (c) 2006 - 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 | # 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 = FrameBufferBltLib 19 | FILE_GUID = 243D3E8C-2780-4A25-9693-A410475BFCEC 20 | MODULE_TYPE = UEFI_DRIVER 21 | VERSION_STRING = 1.0 22 | LIBRARY_CLASS = FrameBufferBltLib 23 | 24 | [Sources.common] 25 | FrameBufferBltLib.c 26 | 27 | [LibraryClasses] 28 | BaseLib 29 | BaseMemoryLib 30 | DebugLib 31 | 32 | [Packages] 33 | MdePkg/MdePkg.dec 34 | MdeModulePkg/MdeModulePkg.dec 35 | -------------------------------------------------------------------------------- /EXYNOS7885Pkg/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 - 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 = 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 EBC ARM AARCH64 28 | # 29 | 30 | [Binaries] 31 | BIN|Logo.bmp|* 32 | 33 | [UserExtensions.TianoCore."ExtraFiles"] 34 | LogoExtra.uni 35 | -------------------------------------------------------------------------------- /EXYNOS7885Pkg/Library/InMemorySerialPortLib/InMemorySerialPortLib.inf: -------------------------------------------------------------------------------- 1 | ## @file 2 | # Null instance of Serial Port Library with empty functions. 3 | # 4 | # Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
5 | # 6 | # This program and the accompanying materials 7 | # are licensed and made available under the terms and conditions of the BSD License 8 | # which accompanies this distribution. The full text of the license may be found at 9 | # http://opensource.org/licenses/bsd-license.php. 10 | # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 12 | # 13 | # 14 | ## 15 | 16 | [Defines] 17 | INF_VERSION = 0x00010005 18 | BASE_NAME = InMemorySerialPortLib 19 | MODULE_UNI_FILE = InMemorySerialPortLib.uni 20 | FILE_GUID = 762fbf9a-984a-4960-9c7c-e0a076860304 21 | MODULE_TYPE = BASE 22 | VERSION_STRING = 1.0 23 | LIBRARY_CLASS = SerialPortLib 24 | 25 | 26 | # 27 | # VALID_ARCHITECTURES = IA32 X64 EBC 28 | # 29 | 30 | [Sources] 31 | InMemorySerialPortLib.c 32 | 33 | 34 | [Packages] 35 | MdePkg/MdePkg.dec 36 | 37 | [LibraryClasses] 38 | CacheMaintenanceLib 39 | 40 | -------------------------------------------------------------------------------- /EXYNOS7885Pkg/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 -------------------------------------------------------------------------------- /EXYNOS7885Pkg/Devices/a10.dsc: -------------------------------------------------------------------------------- 1 | [Defines] 2 | PLATFORM_NAME = EXYNOS7885Pkg 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 = EXYNOS7885Pkg/EXYNOS7885Pkg.fdf 11 | 12 | !include EXYNOS7885Pkg/EXYNOS7885Pkg.dsc 13 | 14 | [PcdsFixedAtBuild.common] 15 | # System Memory (1.5GB) 16 | gArmTokenSpaceGuid.PcdSystemMemoryBase|0x80000000 17 | gArmTokenSpaceGuid.PcdSystemMemorySize|0x80000000 18 | gEmbeddedTokenSpaceGuid.PcdPrePiStackBase|0x80C00000 19 | gEmbeddedTokenSpaceGuid.PcdPrePiStackSize|0x00040000 # 256K stack 20 | gEXYNOS7885PkgTokenSpaceGuid.PcdUefiMemPoolBase|0x80D00000 # DXE Heap base address 21 | gEXYNOS7885PkgTokenSpaceGuid.PcdUefiMemPoolSize|0x03300000 # UefiMemorySize, DXE heap size 22 | # Framebuffer (720x1280) 23 | gEXYNOS7885PkgTokenSpaceGuid.PcdMipiFrameBufferAddress|0x0ec000000 24 | gEXYNOS7885PkgTokenSpaceGuid.PcdMipiFrameBufferWidth|720 25 | gEXYNOS7885PkgTokenSpaceGuid.PcdMipiFrameBufferHeight|1520 26 | gEXYNOS7885PkgTokenSpaceGuid.PcdMipiFrameBufferVisibleWidth|720 27 | gEXYNOS7885PkgTokenSpaceGuid.PcdMipiFrameBufferVisibleHeight|1520 28 | -------------------------------------------------------------------------------- /EXYNOS7885Pkg/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 | EXYNOS7885Pkg/EXYNOS7885Pkg.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 | -------------------------------------------------------------------------------- /EXYNOS7885Pkg/Drivers/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 | EXYNOS7885Pkg/EXYNOS7885Pkg.dec 20 | 21 | [LibraryClasses] 22 | BaseLib 23 | ReportStatusCodeLib 24 | UefiLib 25 | UefiBootServicesTableLib 26 | UefiDriverEntryPoint 27 | BaseMemoryLib 28 | DebugLib 29 | PcdLib 30 | FrameBufferBltLib 31 | CacheMaintenanceLib 32 | 33 | [Protocols] 34 | gEfiGraphicsOutputProtocolGuid ## PRODUCES 35 | gEfiCpuArchProtocolGuid 36 | 37 | [FixedPcd] 38 | gEXYNOS7885PkgTokenSpaceGuid.PcdMipiFrameBufferAddress 39 | gEXYNOS7885PkgTokenSpaceGuid.PcdMipiFrameBufferWidth 40 | gEXYNOS7885PkgTokenSpaceGuid.PcdMipiFrameBufferHeight 41 | 42 | [Guids] 43 | gEfiMdeModulePkgTokenSpaceGuid 44 | 45 | [Pcd] 46 | gEfiMdeModulePkgTokenSpaceGuid.PcdVideoHorizontalResolution 47 | gEfiMdeModulePkgTokenSpaceGuid.PcdVideoVerticalResolution 48 | 49 | [Depex] 50 | gEfiCpuArchProtocolGuid 51 | 52 | -------------------------------------------------------------------------------- /EXYNOS7885Pkg/Drivers/EXYNOS7885PkgDxe/EXYNOS7885PkgDxe.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 = EXYNOS7885PkgDxe 16 | FILE_GUID = 422BB380-0FFB-41EC-B86E-AE70F8A02DA3 17 | MODULE_TYPE = DXE_DRIVER 18 | VERSION_STRING = 1.0 19 | ENTRY_POINT = EXYNOS7885PkgEntryPoint 20 | 21 | [Sources.common] 22 | EXYNOS7885PkgDxe.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 | -------------------------------------------------------------------------------- /EXYNOS7885Pkg/Library/EXYNOS7885PkgLib/EXYNOS7885PkgLib.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 = EXYNOS7885PkgLib 16 | FILE_GUID = 61620091-45BA-4EFF-8F58-F7ABF228CEBC 17 | MODULE_TYPE = BASE 18 | VERSION_STRING = 1.0 19 | LIBRARY_CLASS = ArmPlatformLib 20 | 21 | [Packages] 22 | ArmPkg/ArmPkg.dec 23 | ArmPlatformPkg/ArmPlatformPkg.dec 24 | EmbeddedPkg/EmbeddedPkg.dec 25 | MdePkg/MdePkg.dec 26 | MdeModulePkg/MdeModulePkg.dec 27 | 28 | [LibraryClasses] 29 | ArmLib 30 | HobLib 31 | IoLib 32 | MemoryAllocationLib 33 | SerialPortLib 34 | 35 | [Sources.common] 36 | EXYNOS7885Pkg.c 37 | EXYNOS7885PkgHelper.S 38 | 39 | [FixedPcd] 40 | gArmTokenSpaceGuid.PcdArmPrimaryCore 41 | gArmTokenSpaceGuid.PcdArmPrimaryCoreMask 42 | gArmTokenSpaceGuid.PcdSystemMemoryBase 43 | gArmTokenSpaceGuid.PcdSystemMemorySize 44 | gArmTokenSpaceGuid.PcdFdBaseAddress 45 | gArmTokenSpaceGuid.PcdFdSize 46 | -------------------------------------------------------------------------------- /EXYNOS7885Pkg/Drivers/ConSplitterDxe/ConSplitterDxe.uni: -------------------------------------------------------------------------------- 1 | // /** @file 2 | // This driver provides multi console supports. 3 | // 4 | // This driver acts as a virtual console, takes over the console I/O control from selected 5 | // standard console devices, and transmits console I/O to related console device drivers. 6 | // Consplitter could install Graphics Output protocol and/or UGA Draw protocol in system 7 | // table according PCD settings(PcdConOutGopSupport, and PcdConOutUgaSupport). It always 8 | // consumes Graphics Output protocol which is produced by display device, and consumes UGA Draw 9 | // protocol which is produced by display device according to PcdUgaConsumeSupport value. 10 | // Note: If only UGA Draw protocol is installed in system, PcdUgaConsumeSupport should be 11 | // set to TRUE. 12 | // 13 | // Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.
14 | // 15 | // SPDX-License-Identifier: BSD-2-Clause-Patent 16 | // 17 | // **/ 18 | 19 | 20 | #string STR_MODULE_ABSTRACT #language en-US "Provides multi console support" 21 | 22 | #string STR_MODULE_DESCRIPTION #language en-US "This driver acts as a virtual console, takes over the console I/O control from selected standard console devices, and transmits console I/O to related console device drivers. Consplitter could install Graphics Output protocol and/or UGA Draw protocol in system table according PCD settings(PcdConOutGopSupport, and PcdConOutUgaSupport). It always consumes Graphics Output protocol, which is produced by display device, and consumes UGA Draw protocol, which is produced by display device according to PcdUgaConsumeSupport value. Note: If only UGA Draw protocol is installed in system, PcdUgaConsumeSupport should be set to TRUE." 23 | 24 | -------------------------------------------------------------------------------- /EXYNOS7885Pkg/Library/EXYNOS7885PkgLib/EXYNOS7885PkgHelper.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 | //Write to decon to enable framebuffer writing 21 | enableDecon: 22 | mov x0, 112 23 | movk x0, 0x1486, lsl 16 24 | mov w1, 4737 25 | str w1, [x0] 26 | nop 27 | ret 28 | 29 | ASM_FUNC(ArmPlatformPeiBootAction) 30 | stp x29, x30, [sp, -16]! 31 | add x29, sp, 0 32 | bl enableDecon 33 | nop 34 | ldp x29, x30, [sp], 16 35 | ret 36 | 37 | //UINTN 38 | //ArmPlatformIsPrimaryCore ( 39 | // IN UINTN MpId 40 | // ); 41 | ASM_FUNC(ArmPlatformIsPrimaryCore) 42 | MOV32 (w1, FixedPcdGet32(PcdArmPrimaryCoreMask)) 43 | and x0, x0, x1 44 | MOV32 (w1, FixedPcdGet32(PcdArmPrimaryCore)) 45 | cmp w0, w1 46 | cset x0, eq 47 | ret 48 | 49 | //UINTN 50 | //ArmPlatformGetPrimaryCoreMpId ( 51 | // VOID 52 | // ); 53 | ASM_FUNC(ArmPlatformGetPrimaryCoreMpId) 54 | MOV32 (w0, FixedPcdGet32(PcdArmPrimaryCore)) 55 | ret 56 | 57 | //UINTN 58 | //ArmPlatformGetCorePosition ( 59 | // IN UINTN MpId 60 | // ); 61 | // With this function: CorePos = (ClusterId * 4) + CoreId 62 | ASM_FUNC(ArmPlatformGetCorePosition) 63 | and x1, x0, #ARM_CORE_MASK 64 | and x0, x0, #ARM_CLUSTER_MASK 65 | add x0, x1, x0, LSR #6 66 | ret 67 | -------------------------------------------------------------------------------- /EXYNOS7885Pkg/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 ARM AARCH64 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 | -------------------------------------------------------------------------------- /EXYNOS7885Pkg/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 | EXYNOS7885Pkg/EXYNOS7885Pkg.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 | -------------------------------------------------------------------------------- /EXYNOS7885Pkg/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 | -------------------------------------------------------------------------------- /EXYNOS7885Pkg/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 = EXYNOS7885PkgAcpiTables 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 | EXYNOS7885Pkg/EXYNOS7885Pkg.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 | -------------------------------------------------------------------------------- /EXYNOS7885Pkg/Drivers/GraphicsConsoleDxe/GraphicsConsoleDxe.inf: -------------------------------------------------------------------------------- 1 | ## @file 2 | # Console support on graphic devices. 3 | # 4 | # This driver will install Simple Text Output protocol by consuming Graphices Output 5 | # protocol or UGA Draw protocol on graphic devices. 6 | # 7 | # Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
8 | # SPDX-License-Identifier: BSD-2-Clause-Patent 9 | # 10 | # 11 | ## 12 | 13 | [Defines] 14 | INF_VERSION = 0x00010005 15 | BASE_NAME = GraphicsConsoleDxe 16 | MODULE_UNI_FILE = GraphicsConsoleDxe.uni 17 | FILE_GUID = CCCB0C28-4B24-11d5-9A5A-0090273FC14D 18 | MODULE_TYPE = UEFI_DRIVER 19 | VERSION_STRING = 1.0 20 | ENTRY_POINT = InitializeGraphicsConsole 21 | 22 | # 23 | # The following information is for reference only and not required by the build tools. 24 | # 25 | # VALID_ARCHITECTURES = IA32 X64 EBC 26 | # 27 | # DRIVER_BINDING = gGraphicsConsoleDriverBinding 28 | # COMPONENT_NAME = gGraphicsConsoleComponentName 29 | # COMPONENT_NAME2 = gGraphicsConsoleComponentName2 30 | # 31 | 32 | [Sources] 33 | ComponentName.c 34 | LaffStd.c 35 | GraphicsConsole.c 36 | GraphicsConsole.h 37 | 38 | [Packages] 39 | MdePkg/MdePkg.dec 40 | MdeModulePkg/MdeModulePkg.dec 41 | 42 | [LibraryClasses] 43 | UefiBootServicesTableLib 44 | MemoryAllocationLib 45 | BaseMemoryLib 46 | UefiLib 47 | UefiDriverEntryPoint 48 | DebugLib 49 | HiiLib 50 | PcdLib 51 | 52 | [Protocols] 53 | gEfiDevicePathProtocolGuid ## TO_START 54 | gEfiSimpleTextOutProtocolGuid ## BY_START 55 | gEfiGraphicsOutputProtocolGuid ## TO_START 56 | gEfiUgaDrawProtocolGuid ## TO_START 57 | gEfiHiiFontProtocolGuid ## TO_START 58 | ## TO_START 59 | ## NOTIFY 60 | gEfiHiiDatabaseProtocolGuid 61 | 62 | [FeaturePcd] 63 | gEfiMdePkgTokenSpaceGuid.PcdUgaConsumeSupport ## CONSUMES 64 | 65 | [Pcd] 66 | gEfiMdeModulePkgTokenSpaceGuid.PcdVideoHorizontalResolution ## SOMETIMES_CONSUMES 67 | gEfiMdeModulePkgTokenSpaceGuid.PcdVideoVerticalResolution ## SOMETIMES_CONSUMES 68 | gEfiMdeModulePkgTokenSpaceGuid.PcdConOutRow ## SOMETIMES_CONSUMES 69 | gEfiMdeModulePkgTokenSpaceGuid.PcdConOutColumn ## SOMETIMES_CONSUMES 70 | 71 | [UserExtensions.TianoCore."ExtraFiles"] 72 | GraphicsConsoleDxeExtra.uni 73 | -------------------------------------------------------------------------------- /EXYNOS7885Pkg/EXYNOS7885Pkg.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 = EXYNOS7885Pkg 16 | PACKAGE_GUID = 7eb1de03-3910-4d1d-84ce-c17b53636b9a 17 | PACKAGE_VERSION = 0.1 18 | 19 | ################################################################################ 20 | # 21 | # Include Section - list of Include Paths that are provided by this package. 22 | # Comments are used for Keywords and Module Types. 23 | # 24 | # Supported Module Types: 25 | # BASE SEC PEI_CORE PEIM DXE_CORE DXE_DRIVER DXE_RUNTIME_DRIVER DXE_SMM_DRIVER DXE_SAL_DRIVER UEFI_DRIVER UEFI_APPLICATION 26 | # 27 | ################################################################################ 28 | [Includes.common] 29 | Include # Root include for the package 30 | 31 | [Guids.common] 32 | gEXYNOS7885PkgTokenSpaceGuid = { 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 | gQcomClockProtocolGuid = { 0x4fcc91c2, 0x9c4f, 0x4e3c, { 0xa6, 0x73, 0xc6, 0xdf, 0x62, 0xe0, 0x41, 0xd5 } } 37 | gQcomBamProtocolGuid = { 0xacdd545a, 0xf1f6, 0x4272, { 0x81, 0xc5, 0x04, 0x93, 0xe3, 0x58, 0x05, 0x32 } } 38 | 39 | [PcdsFixedAtBuild.common] 40 | # Memory allocation 41 | gEXYNOS7885PkgTokenSpaceGuid.PcdUefiMemPoolBase|0|UINT64|0x00000a106 42 | gEXYNOS7885PkgTokenSpaceGuid.PcdUefiMemPoolSize|0|UINT32|0x00000a107 43 | 44 | # Simple FrameBuffer 45 | gEfiMdeModulePkgTokenSpaceGuid.PcdEmuVariableNvModeEnable|TRUE|BOOLEAN|1 46 | gEXYNOS7885PkgTokenSpaceGuid.PcdMipiFrameBufferAddress|0x00400000|UINT32|0x0000a400 # 0x7C400000 47 | gEXYNOS7885PkgTokenSpaceGuid.PcdMipiFrameBufferWidth|1080|UINT32|0x0000a401 48 | gEXYNOS7885PkgTokenSpaceGuid.PcdMipiFrameBufferHeight|1920|UINT32|0x0000a402 49 | gEXYNOS7885PkgTokenSpaceGuid.PcdMipiFrameBufferPixelBpp|32|UINT32|0x0000a403 50 | gEXYNOS7885PkgTokenSpaceGuid.PcdMipiFrameBufferVisibleWidth|1080|UINT32|0x0000a404 51 | gEXYNOS7885PkgTokenSpaceGuid.PcdMipiFrameBufferVisibleHeight|1920|UINT32|0x0000a405 52 | -------------------------------------------------------------------------------- /EXYNOS7885Pkg/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 | EXYNOS7885Pkg/EXYNOS7885Pkg.dec 43 | 44 | [BuildOptions.AARCH64] 45 | GCC:*_*_*_CC_FLAGS = -Wno-unused-variable 46 | 47 | [LibraryClasses] 48 | BaseLib 49 | BaseMemoryLib 50 | BootLogoLib 51 | CapsuleLib 52 | DebugLib 53 | DevicePathLib 54 | DxeServicesLib 55 | HobLib 56 | MemoryAllocationLib 57 | PcdLib 58 | PrintLib 59 | UefiBootManagerLib 60 | UefiBootServicesTableLib 61 | UefiLib 62 | 63 | [FixedPcd] 64 | gEfiMdePkgTokenSpaceGuid.PcdUartDefaultBaudRate 65 | gEfiMdePkgTokenSpaceGuid.PcdUartDefaultDataBits 66 | gEfiMdePkgTokenSpaceGuid.PcdUartDefaultParity 67 | gEfiMdePkgTokenSpaceGuid.PcdUartDefaultStopBits 68 | gEfiMdePkgTokenSpaceGuid.PcdDefaultTerminalType 69 | 70 | [Pcd] 71 | gEfiMdePkgTokenSpaceGuid.PcdPlatformBootTimeOut 72 | 73 | [Guids] 74 | gEfiFileInfoGuid 75 | gEfiFileSystemInfoGuid 76 | gEfiFileSystemVolumeLabelInfoIdGuid 77 | gEfiEndOfDxeEventGroupGuid 78 | gEfiTtyTermGuid 79 | gUefiShellFileGuid 80 | 81 | [Protocols] 82 | gEfiDevicePathProtocolGuid 83 | gEfiGraphicsOutputProtocolGuid 84 | gEfiLoadedImageProtocolGuid 85 | gEfiSimpleFileSystemProtocolGuid 86 | gEsrtManagementProtocolGuid 87 | gEfiUsb2HcProtocolGuid 88 | gEFIDroidKeypadDeviceProtocolGuid 89 | 90 | -------------------------------------------------------------------------------- /EXYNOS7885Pkg/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 'S','A','M','A','1','0' // OEMID 6 bytes long 30 | #define EFI_ACPI_ARM_OEM_TABLE_ID SIGNATURE_64('S','A','M','-','A','1','0','5') // OEM table id 8 bytes long 31 | #define EFI_ACPI_ARM_OEM_REVISION 0x20140727 32 | #define EFI_ACPI_ARM_CREATOR_ID SIGNATURE_32('S','A','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 | -------------------------------------------------------------------------------- /EXYNOS7885Pkg/PrePi/AArch64/ModuleEntryPoint.S: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2011 - 2020, Arm Limited. All rights reserved.
3 | // 4 | // SPDX-License-Identifier: BSD-2-Clause-Patent 5 | // 6 | // 7 | 8 | #include 9 | 10 | ASM_FUNC(_ModuleEntryPoint) 11 | // Do early platform specific actions 12 | bl ASM_PFX(ArmPlatformPeiBootAction) 13 | 14 | 15 | 16 | _SetSVCMode: 17 | // Check if we can install the stack at the top of the System Memory or if we need 18 | // to install the stacks at the bottom of the Firmware Device (case the FD is located 19 | // at the top of the DRAM) 20 | _SystemMemoryEndInit: 21 | ldr x1, mSystemMemoryEnd 22 | 23 | _SetupStackPosition: 24 | // r1 = SystemMemoryTop 25 | 26 | // Calculate Top of the Firmware Device 27 | MOV64 (x2, FixedPcdGet64(PcdFdBaseAddress)) 28 | MOV32 (x3, FixedPcdGet32(PcdFdSize) - 1) 29 | sub x3, x3, #1 30 | add x3, x3, x2 // x3 = FdTop = PcdFdBaseAddress + PcdFdSize 31 | 32 | // UEFI Memory Size (stacks are allocated in this region) 33 | MOV32 (x4, FixedPcdGet32(PcdSystemMemoryUefiRegionSize)) 34 | 35 | // 36 | // Reserve the memory for the UEFI region (contain stacks on its top) 37 | // 38 | 39 | // Calculate how much space there is between the top of the Firmware and the Top of the System Memory 40 | subs x0, x1, x3 // x0 = SystemMemoryTop - FdTop 41 | b.mi _SetupStack // Jump if negative (FdTop > SystemMemoryTop). Case when the PrePi is in XIP memory outside of the DRAM 42 | cmp x0, x4 43 | b.ge _SetupStack 44 | 45 | // Case the top of stacks is the FdBaseAddress 46 | mov x1, x2 47 | 48 | _SetupStack: 49 | // x1 contains the top of the stack (and the UEFI Memory) 50 | 51 | // Because the 'push' instruction is equivalent to 'stmdb' (decrement before), we need to increment 52 | // one to the top of the stack. We check if incrementing one does not overflow (case of DRAM at the 53 | // top of the memory space) 54 | adds x11, x1, #1 55 | b.cs _SetupOverflowStack 56 | 57 | _SetupAlignedStack: 58 | mov x1, x11 59 | b _GetBaseUefiMemory 60 | 61 | _SetupOverflowStack: 62 | // Case memory at the top of the address space. Ensure the top of the stack is EFI_PAGE_SIZE 63 | // aligned (4KB) 64 | and x1, x1, ~EFI_PAGE_MASK 65 | 66 | _GetBaseUefiMemory: 67 | // Calculate the Base of the UEFI Memory 68 | sub x11, x1, x4 69 | 70 | _GetStackBase: 71 | // r1 = The top of the stack 72 | mov sp, x1 73 | // Stack for the primary core = PrimaryCoreStack 74 | MOV32 (x2, FixedPcdGet32(PcdCPUCorePrimaryStackSize)) 75 | sub x12, x1, x2 76 | 77 | // Get ID of this CPU in multi-core system 78 | bl ASM_PFX(ArmReadMpidr) 79 | 80 | mov x1, x11 81 | mov x2, x12 82 | 83 | // Move sec startup address into a data register 84 | // Ensure we're jumping to FV version of the code (not boot remapped alias) 85 | ldr x4, =ASM_PFX(CEntryPoint) 86 | 87 | // Set the frame pointer to NULL so any backtraces terminate here 88 | mov x29, xzr 89 | 90 | // Jump to PrePiCore C code 91 | // x0 = MpId 92 | // x1 = UefiMemoryBase 93 | // x2 = StacksBase 94 | blr x4 95 | 96 | _NeverReturn: 97 | b _NeverReturn 98 | -------------------------------------------------------------------------------- /EXYNOS7885Pkg/PrePi/PrePi.inf: -------------------------------------------------------------------------------- 1 | #/** @file 2 | # 3 | # (C) Copyright 2015 Hewlett-Packard Development Company, L.P.
4 | # Copyright (c) 2011-2017, ARM Ltd. All rights reserved.
5 | # Copyright (c) 2020, Arm Limited. All rights reserved.
6 | # 7 | # SPDX-License-Identifier: BSD-2-Clause-Patent 8 | # 9 | #**/ 10 | 11 | [Defines] 12 | INF_VERSION = 0x00010005 13 | BASE_NAME = PrePi 14 | FILE_GUID = 3e401783-cc94-4fcd-97bc-bd35ac369d2f 15 | MODULE_TYPE = SEC 16 | VERSION_STRING = 1.0 17 | 18 | [Sources] 19 | PrePi.h 20 | PrePi.c 21 | 22 | [Sources.ARM] 23 | Arm/ArchPrePi.c 24 | Arm/ModuleEntryPoint.S | GCC 25 | 26 | [Sources.AArch64] 27 | AArch64/ArchPrePi.c 28 | AArch64/ModuleEntryPoint.S 29 | 30 | [Packages] 31 | MdePkg/MdePkg.dec 32 | MdeModulePkg/MdeModulePkg.dec 33 | EmbeddedPkg/EmbeddedPkg.dec 34 | ArmPkg/ArmPkg.dec 35 | ArmPlatformPkg/ArmPlatformPkg.dec 36 | EXYNOS7885Pkg/EXYNOS7885Pkg.dec 37 | 38 | [LibraryClasses] 39 | BaseLib 40 | CacheMaintenanceLib 41 | DebugLib 42 | DebugAgentLib 43 | ArmLib 44 | IoLib 45 | TimerLib 46 | SerialPortLib 47 | ExtractGuidedSectionLib 48 | LzmaDecompressLib 49 | DebugAgentLib 50 | PrePiLib 51 | ArmPlatformLib 52 | MemoryAllocationLib 53 | HobLib 54 | PrePiHobListPointerLib 55 | PlatformPeiLib 56 | MemoryInitPeiLib 57 | 58 | [Ppis] 59 | gArmMpCoreInfoPpiGuid 60 | 61 | [Guids] 62 | gArmMpCoreInfoGuid 63 | gEfiFirmwarePerformanceGuid 64 | 65 | [FeaturePcd] 66 | gEmbeddedTokenSpaceGuid.PcdPrePiProduceMemoryTypeInformationHob 67 | 68 | [Pcd] 69 | gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVersionString 70 | 71 | [FixedPcd.ARM] 72 | gArmTokenSpaceGuid.PcdVFPEnabled 73 | 74 | [FixedPcd] 75 | gArmTokenSpaceGuid.PcdFdBaseAddress 76 | gArmTokenSpaceGuid.PcdFdSize 77 | 78 | gArmTokenSpaceGuid.PcdFvBaseAddress 79 | gArmTokenSpaceGuid.PcdFvSize 80 | 81 | gArmPlatformTokenSpaceGuid.PcdCPUCorePrimaryStackSize 82 | 83 | gArmPlatformTokenSpaceGuid.PcdSystemMemoryUefiRegionSize 84 | 85 | gArmPlatformTokenSpaceGuid.PcdCoreCount 86 | 87 | gEmbeddedTokenSpaceGuid.PcdPrePiCpuIoSize 88 | 89 | gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiACPIReclaimMemory 90 | gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiACPIMemoryNVS 91 | gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiReservedMemoryType 92 | gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiRuntimeServicesData 93 | gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiRuntimeServicesCode 94 | gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiBootServicesCode 95 | gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiBootServicesData 96 | gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiLoaderCode 97 | gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiLoaderData 98 | 99 | gEXYNOS7885PkgTokenSpaceGuid.PcdMipiFrameBufferAddress 100 | gEXYNOS7885PkgTokenSpaceGuid.PcdMipiFrameBufferWidth 101 | gEXYNOS7885PkgTokenSpaceGuid.PcdMipiFrameBufferHeight 102 | gEXYNOS7885PkgTokenSpaceGuid.PcdMipiFrameBufferPixelBpp 103 | 104 | [Pcd] 105 | gArmTokenSpaceGuid.PcdSystemMemoryBase 106 | gArmTokenSpaceGuid.PcdSystemMemorySize 107 | -------------------------------------------------------------------------------- /EXYNOS7885Pkg/PrePi/Arm/ModuleEntryPoint.S: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2011 - 2020, Arm Limited. All rights reserved.
3 | // 4 | // SPDX-License-Identifier: BSD-2-Clause-Patent 5 | // 6 | // 7 | 8 | #include 9 | 10 | #include 11 | 12 | ASM_FUNC(_ModuleEntryPoint) 13 | // Do early platform specific actions 14 | bl ASM_PFX(ArmPlatformPeiBootAction) 15 | 16 | 17 | 18 | _SetSVCMode: 19 | // Enter SVC mode, Disable FIQ and IRQ 20 | mov r1, #(CPSR_MODE_SVC | CPSR_IRQ | CPSR_FIQ) 21 | msr CPSR_c, r1 22 | 23 | // Check if we can install the stack at the top of the System Memory or if we need 24 | // to install the stacks at the bottom of the Firmware Device (case the FD is located 25 | // at the top of the DRAM) 26 | _SystemMemoryEndInit: 27 | ADRL (r1, mSystemMemoryEnd) 28 | ldrd r2, r3, [r1] 29 | teq r3, #0 30 | moveq r1, r2 31 | mvnne r1, #0 32 | 33 | _SetupStackPosition: 34 | // r1 = SystemMemoryTop 35 | 36 | // Calculate Top of the Firmware Device 37 | MOV32 (r2, FixedPcdGet32(PcdFdBaseAddress)) 38 | MOV32 (r3, FixedPcdGet32(PcdFdSize) - 1) 39 | add r3, r3, r2 // r3 = FdTop = PcdFdBaseAddress + PcdFdSize 40 | 41 | // UEFI Memory Size (stacks are allocated in this region) 42 | MOV32 (r4, FixedPcdGet32(PcdSystemMemoryUefiRegionSize)) 43 | 44 | // 45 | // Reserve the memory for the UEFI region (contain stacks on its top) 46 | // 47 | 48 | // Calculate how much space there is between the top of the Firmware and the Top of the System Memory 49 | subs r0, r1, r3 // r0 = SystemMemoryTop - FdTop 50 | bmi _SetupStack // Jump if negative (FdTop > SystemMemoryTop). Case when the PrePi is in XIP memory outside of the DRAM 51 | cmp r0, r4 52 | bge _SetupStack 53 | 54 | // Case the top of stacks is the FdBaseAddress 55 | mov r1, r2 56 | 57 | _SetupStack: 58 | // r1 contains the top of the stack (and the UEFI Memory) 59 | 60 | // Because the 'push' instruction is equivalent to 'stmdb' (decrement before), we need to increment 61 | // one to the top of the stack. We check if incrementing one does not overflow (case of DRAM at the 62 | // top of the memory space) 63 | adds r9, r1, #1 64 | bcs _SetupOverflowStack 65 | 66 | _SetupAlignedStack: 67 | mov r1, r9 68 | b _GetBaseUefiMemory 69 | 70 | _SetupOverflowStack: 71 | // Case memory at the top of the address space. Ensure the top of the stack is EFI_PAGE_SIZE 72 | // aligned (4KB) 73 | MOV32 (r9, ~EFI_PAGE_MASK & 0xFFFFFFFF) 74 | and r1, r1, r9 75 | 76 | _GetBaseUefiMemory: 77 | // Calculate the Base of the UEFI Memory 78 | sub r9, r1, r4 79 | 80 | _GetStackBase: 81 | // r1 = The top of the stack 82 | mov sp, r1 83 | 84 | // Stack for the primary core = PrimaryCoreStack 85 | MOV32 (r2, FixedPcdGet32(PcdCPUCorePrimaryStackSize)) 86 | sub r10, r1, r2 87 | 88 | // Get ID of this CPU in multi-core system 89 | bl ASM_PFX(ArmReadMpidr) 90 | 91 | mov r1, r9 92 | mov r2, r10 93 | 94 | // Move sec startup address into a data register 95 | // Ensure we're jumping to FV version of the code (not boot remapped alias) 96 | ldr r4, =ASM_PFX(CEntryPoint) 97 | 98 | // Jump to PrePiCore C code 99 | // r0 = MpId 100 | // r1 = UefiMemoryBase 101 | // r2 = StacksBase 102 | blx r4 103 | 104 | _NeverReturn: 105 | b _NeverReturn 106 | -------------------------------------------------------------------------------- /EXYNOS7885Pkg/Drivers/EXYNOS7885PkgDxe/EXYNOS7885PkgDxe.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 "EXYNOS7885PkgDxe.h" 38 | 39 | EFI_CPU_ARCH_PROTOCOL *gCpu; 40 | 41 | VOID 42 | InitPeripherals ( 43 | IN VOID 44 | ) 45 | { 46 | // MmioWrite32(0x004ab000, 0); 47 | /* This also crashes. Do you really hate memory attributes or something? 48 | EFI_STATUS Status; 49 | // https://lists.01.org/pipermail/edk2-devel/2017-August/013417.html 50 | Status = gCpu->SetMemoryAttributes (gCpu, 0xa1a10000, 0x200000, 51 | EFI_MEMORY_UC | EFI_MEMORY_XP); 52 | ASSERT_EFI_ERROR (Status); 53 | Status = gCpu->SetMemoryAttributes (gCpu, 0x9d400000, 0x2400000, 54 | EFI_MEMORY_WC | EFI_MEMORY_XP); 55 | ASSERT_EFI_ERROR (Status); 56 | */ 57 | } 58 | 59 | /** 60 | Notification function of the event defined as belonging to the 61 | EFI_END_OF_DXE_EVENT_GROUP_GUID event group that was created in 62 | the entry point of the driver. 63 | 64 | This function is called when an event belonging to the 65 | EFI_END_OF_DXE_EVENT_GROUP_GUID event group is signalled. Such an 66 | event is signalled once at the end of the dispatching of all 67 | drivers (end of the so called DXE phase). 68 | 69 | @param[in] Event Event declared in the entry point of the driver whose 70 | notification function is being invoked. 71 | @param[in] Context NULL 72 | **/ 73 | STATIC 74 | VOID 75 | OnEndOfDxe ( 76 | IN EFI_EVENT Event, 77 | IN VOID *Context 78 | ) 79 | { 80 | } 81 | 82 | EFI_STATUS 83 | EFIAPI 84 | EXYNOS7885PkgEntryPoint ( 85 | IN EFI_HANDLE ImageHandle, 86 | IN EFI_SYSTEM_TABLE *SystemTable 87 | ) 88 | { 89 | EFI_STATUS Status; 90 | EFI_EVENT EndOfDxeEvent; 91 | 92 | Status = gBS->LocateProtocol (&gEfiCpuArchProtocolGuid, NULL, (VOID **)&gCpu); 93 | ASSERT_EFI_ERROR(Status); 94 | 95 | InitPeripherals (); 96 | 97 | // 98 | // Create an event belonging to the "gEfiEndOfDxeEventGroupGuid" group. 99 | // The "OnEndOfDxe()" function is declared as the call back function. 100 | // It will be called at the end of the DXE phase when an event of the 101 | // same group is signalled to inform about the end of the DXE phase. 102 | // Install the INSTALL_FDT_PROTOCOL protocol. 103 | // 104 | Status = gBS->CreateEventEx ( 105 | EVT_NOTIFY_SIGNAL, 106 | TPL_CALLBACK, 107 | OnEndOfDxe, 108 | NULL, 109 | &gEfiEndOfDxeEventGroupGuid, 110 | &EndOfDxeEvent 111 | ); 112 | return Status; 113 | } 114 | -------------------------------------------------------------------------------- /EXYNOS7885Pkg/Library/EXYNOS7885PkgLib/EXYNOS7885Pkg.c: -------------------------------------------------------------------------------- 1 | /** @file 2 | * 3 | * Copyright (c) 2018, Linaro Limited. All rights reserved. 4 | * 5 | * This program and the accompanying materials 6 | * are licensed and made available under the terms and conditions of the BSD License 7 | * which accompanies this distribution. The full text of the license may be found at 8 | * http://opensource.org/licenses/bsd-license.php 9 | * 10 | * THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 12 | * 13 | **/ 14 | 15 | #include 16 | #include 17 | #include 18 | #include 19 | 20 | #include 21 | 22 | ARM_CORE_INFO mHiKey960InfoTable[] = { 23 | { 24 | // Cluster 0, Core 0 25 | 0x0, 0x0, 26 | 27 | // MP Core MailBox Set/Get/Clear Addresses and Clear Value 28 | (UINT64)0xFFFFFFFF 29 | }, 30 | /* 31 | { 32 | // Cluster 0, Core 1 33 | 0x0, 0x1, 34 | 35 | // MP Core MailBox Set/Get/Clear Addresses and Clear Value 36 | (UINT64)0xFFFFFFFF 37 | }, 38 | { 39 | // Cluster 0, Core 2 40 | 0x0, 0x2, 41 | 42 | // MP Core MailBox Set/Get/Clear Addresses and Clear Value 43 | (UINT64)0xFFFFFFFF 44 | }, 45 | { 46 | // Cluster 0, Core 3 47 | 0x0, 0x3, 48 | 49 | // MP Core MailBox Set/Get/Clear Addresses and Clear Value 50 | (UINT64)0xFFFFFFFF 51 | }, 52 | { 53 | // Cluster 1, Core 0 54 | 0x1, 0x0, 55 | 56 | // MP Core MailBox Set/Get/Clear Addresses and Clear Value 57 | (UINT64)0xFFFFFFFF 58 | }, 59 | { 60 | // Cluster 1, Core 1 61 | 0x1, 0x1, 62 | 63 | // MP Core MailBox Set/Get/Clear Addresses and Clear Value 64 | (UINT64)0xFFFFFFFF 65 | }, 66 | { 67 | // Cluster 1, Core 2 68 | 0x1, 0x2, 69 | 70 | // MP Core MailBox Set/Get/Clear Addresses and Clear Value 71 | (UINT64)0xFFFFFFFF 72 | }, 73 | { 74 | // Cluster 1, Core 3 75 | 0x1, 0x3, 76 | 77 | // MP Core MailBox Set/Get/Clear Addresses and Clear Value 78 | (UINT64)0xFFFFFFFF 79 | } 80 | */ 81 | }; 82 | 83 | /** 84 | Return the current Boot Mode 85 | 86 | This function returns the boot reason on the platform 87 | 88 | @return Return the current Boot Mode of the platform 89 | 90 | **/ 91 | EFI_BOOT_MODE 92 | ArmPlatformGetBootMode ( 93 | VOID 94 | ) 95 | { 96 | return BOOT_WITH_FULL_CONFIGURATION; 97 | } 98 | 99 | /** 100 | Initialize controllers that must setup in the normal world 101 | 102 | This function is called by the ArmPlatformPkg/Pei or ArmPlatformPkg/Pei/PlatformPeim 103 | in the PEI phase. 104 | 105 | **/ 106 | RETURN_STATUS 107 | ArmPlatformInitialize ( 108 | IN UINTN MpId 109 | ) 110 | { 111 | return RETURN_SUCCESS; 112 | } 113 | 114 | EFI_STATUS 115 | PrePeiCoreGetMpCoreInfo ( 116 | OUT UINTN *CoreCount, 117 | OUT ARM_CORE_INFO **ArmCoreTable 118 | ) 119 | { 120 | // Only support one cluster 121 | *CoreCount = sizeof(mHiKey960InfoTable) / sizeof(ARM_CORE_INFO); 122 | *ArmCoreTable = mHiKey960InfoTable; 123 | return EFI_SUCCESS; 124 | } 125 | 126 | // Needs to be declared in the file. Otherwise gArmMpCoreInfoPpiGuid is undefined in the contect of PrePeiCore 127 | EFI_GUID mArmMpCoreInfoPpiGuid = ARM_MP_CORE_INFO_PPI_GUID; 128 | ARM_MP_CORE_INFO_PPI mMpCoreInfoPpi = { PrePeiCoreGetMpCoreInfo }; 129 | 130 | EFI_PEI_PPI_DESCRIPTOR gPlatformPpiTable[] = { 131 | { 132 | EFI_PEI_PPI_DESCRIPTOR_PPI, 133 | &mArmMpCoreInfoPpiGuid, 134 | &mMpCoreInfoPpi 135 | } 136 | }; 137 | 138 | VOID 139 | ArmPlatformGetPlatformPpiList ( 140 | OUT UINTN *PpiListSize, 141 | OUT EFI_PEI_PPI_DESCRIPTOR **PpiList 142 | ) 143 | { 144 | *PpiListSize = sizeof(gPlatformPpiTable); 145 | *PpiList = gPlatformPpiTable; 146 | } 147 | -------------------------------------------------------------------------------- /EXYNOS7885Pkg/Include/Configuration/DeviceMemoryMap.h: -------------------------------------------------------------------------------- 1 | #ifndef _DEVICE_MEMORY_MAP_H_ 2 | #define _DEVICE_MEMORY_MAP_H_ 3 | 4 | #include 5 | 6 | #define MAX_ARM_MEMORY_REGION_DESCRIPTOR_COUNT 128 7 | 8 | /* Below flag is used for system memory */ 9 | #define SYSTEM_MEMORY_RESOURCE_ATTR_CAPABILITIES \ 10 | EFI_RESOURCE_ATTRIBUTE_PRESENT | EFI_RESOURCE_ATTRIBUTE_INITIALIZED | \ 11 | EFI_RESOURCE_ATTRIBUTE_TESTED | EFI_RESOURCE_ATTRIBUTE_UNCACHEABLE | \ 12 | EFI_RESOURCE_ATTRIBUTE_WRITE_COMBINEABLE | \ 13 | EFI_RESOURCE_ATTRIBUTE_WRITE_THROUGH_CACHEABLE | \ 14 | EFI_RESOURCE_ATTRIBUTE_WRITE_BACK_CACHEABLE | \ 15 | EFI_RESOURCE_ATTRIBUTE_EXECUTION_PROTECTABLE 16 | 17 | typedef enum { NoHob, AddMem, AddDev, HobOnlyNoCacheSetting, MaxMem } DeviceMemoryAddHob; 18 | 19 | #define MEMORY_REGION_NAME_MAX_LENGTH 32 20 | 21 | typedef struct { 22 | CHAR8 Name[MEMORY_REGION_NAME_MAX_LENGTH]; 23 | EFI_PHYSICAL_ADDRESS Address; 24 | UINT64 Length; 25 | DeviceMemoryAddHob HobOption; 26 | EFI_RESOURCE_TYPE ResourceType; 27 | EFI_RESOURCE_ATTRIBUTE_TYPE ResourceAttribute; 28 | EFI_MEMORY_TYPE MemoryType; 29 | ARM_MEMORY_REGION_ATTRIBUTES ArmAttributes; 30 | } ARM_MEMORY_REGION_DESCRIPTOR_EX, *PARM_MEMORY_REGION_DESCRIPTOR_EX; 31 | 32 | #define MEM_RES EFI_RESOURCE_MEMORY_RESERVED 33 | #define MMAP_IO EFI_RESOURCE_MEMORY_MAPPED_IO 34 | #define SYS_MEM EFI_RESOURCE_SYSTEM_MEMORY 35 | 36 | #define SYS_MEM_CAP SYSTEM_MEMORY_RESOURCE_ATTR_CAPABILITIES 37 | #define INITIALIZED EFI_RESOURCE_ATTRIBUTE_INITIALIZED 38 | #define WRITE_COMBINEABLE EFI_RESOURCE_ATTRIBUTE_WRITE_COMBINEABLE 39 | #define UNCACHEABLE EFI_RESOURCE_ATTRIBUTE_UNCACHEABLE 40 | 41 | #define Reserv EfiReservedMemoryType 42 | #define Conv EfiConventionalMemory 43 | #define BsData EfiBootServicesData 44 | #define BsCode EfiBootServicesCode 45 | #define RtData EfiRuntimeServicesData 46 | #define RtCode EfiRuntimeServicesCode 47 | #define MmIO EfiMemoryMappedIO 48 | 49 | #define DEVICE ARM_MEMORY_REGION_ATTRIBUTE_DEVICE 50 | #define WRITE_THROUGH ARM_MEMORY_REGION_ATTRIBUTE_WRITE_THROUGH 51 | #define WRITE_THROUGH_XN ARM_MEMORY_REGION_ATTRIBUTE_WRITE_THROUGH 52 | #define WRITE_BACK ARM_MEMORY_REGION_ATTRIBUTE_WRITE_BACK 53 | #define WRITE_BACK_XN ARM_MEMORY_REGION_ATTRIBUTE_WRITE_BACK 54 | #define UNCACHED_UNBUFFERED ARM_MEMORY_REGION_ATTRIBUTE_UNCACHED_UNBUFFERED 55 | #define UNCACHED_UNBUFFERED_XN ARM_MEMORY_REGION_ATTRIBUTE_UNCACHED_UNBUFFERED 56 | 57 | static ARM_MEMORY_REGION_DESCRIPTOR_EX gDeviceMemoryDescriptorEx[] = { 58 | /* EFI_RESOURCE_ EFI_RESOURCE_ATTRIBUTE_ EFI_MEMORY_TYPE ARM_REGION_ATTRIBUTE_ 59 | MemLabel(32 Char.), MemBase, MemSize, BuildHob, ResourceType, ResourceAttribute, MemoryType, CacheAttributes 60 | */ 61 | 62 | //--------------------- Register --------------------- 63 | {"Periphs", 0x00000000, 0x15000000, AddMem, MEM_RES, UNCACHEABLE, RtCode, DEVICE}, 64 | 65 | //--------------------- DDR --------------------- */ 66 | 67 | {"HLOS 0", 0x80000000, 0x00C00000, AddMem, SYS_MEM, SYS_MEM_CAP, Conv, WRITE_BACK_XN}, 68 | {"UEFI Stack", 0x80C00000, 0x00040000, AddMem, SYS_MEM, SYS_MEM_CAP, BsData, WRITE_BACK}, 69 | {"CPU Vectors", 0x80C40000, 0x00010000, AddMem, SYS_MEM, SYS_MEM_CAP, BsCode, WRITE_BACK}, 70 | {"HLOS 1", 0x80C50000, 0x0F3B0000, AddMem, SYS_MEM, SYS_MEM_CAP, Conv, WRITE_BACK}, 71 | {"UEFI FD", 0x90000000, 0x00200000, AddMem, SYS_MEM, SYS_MEM_CAP, BsCode, WRITE_BACK}, 72 | {"HLOS 1.5", 0x90200000, 0x2BA00000, AddMem, SYS_MEM, SYS_MEM_CAP, Conv, WRITE_BACK}, 73 | /*Memory hole 0xbbc00000 -> 0xc0000000*/ 74 | {"HLOS 3", 0xc0000000, 0x2C000000, AddMem, SYS_MEM, SYS_MEM_CAP, Conv, WRITE_BACK}, 75 | {"Display Reserved", 0xec000000, 0x00800000, AddMem, MEM_RES, SYS_MEM_CAP, Reserv, WRITE_THROUGH_XN}, 76 | {"HLOS 4", 0xEC800000, 0x13800000, AddMem, SYS_MEM, SYS_MEM_CAP, Conv, WRITE_BACK}, 77 | 78 | /* Terminator for MMU */ 79 | { "Terminator", 0, 0, 0, 0, 0, 0, 0}}; 80 | 81 | #endif -------------------------------------------------------------------------------- /EXYNOS7885Pkg/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 | -------------------------------------------------------------------------------- /EXYNOS7885Pkg/Drivers/ConSplitterDxe/ConSplitterDxe.inf: -------------------------------------------------------------------------------- 1 | ## @file 2 | # This driver provides multi console supports. 3 | # 4 | # This driver acts as a virtual console, takes over the console I/O control from selected 5 | # standard console devices, and transmits console I/O to related console device drivers. 6 | # Consplitter could install Graphics Output protocol and/or UGA Draw protocol in system 7 | # table according PCD settings(PcdConOutGopSupport, and PcdConOutUgaSupport). It always 8 | # consumes Graphics Output protocol which is produced by display device, and consumes UGA Draw 9 | # protocol which is produced by display device according to PcdUgaConsumeSupport value. 10 | # Note: If only UGA Draw protocol is installed in system, PcdUgaConsumeSupport should be 11 | # set to TRUE. 12 | # 13 | # Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
14 | # 15 | # SPDX-License-Identifier: BSD-2-Clause-Patent 16 | # 17 | # 18 | ## 19 | 20 | [Defines] 21 | INF_VERSION = 0x00010005 22 | BASE_NAME = ConSplitterDxe 23 | MODULE_UNI_FILE = ConSplitterDxe.uni 24 | FILE_GUID = 408edcec-cf6d-477c-a5a8-b4844e3de281 25 | MODULE_TYPE = UEFI_DRIVER 26 | VERSION_STRING = 1.0 27 | ENTRY_POINT = ConSplitterDriverEntry 28 | 29 | # 30 | # The following information is for reference only and not required by the build tools. 31 | # 32 | # VALID_ARCHITECTURES = IA32 X64 EBC 33 | # 34 | # DRIVER_BINDING = gConSplitterConInDriverBinding 35 | # COMPONENT_NAME = gConSplitterConInComponentName 36 | # COMPONENT_NAME2 = gConSplitterConInComponentName2 37 | # DRIVER_BINDING = gConSplitterSimplePointerDriverBinding 38 | # COMPONENT_NAME = gConSplitterSimplePointerComponentName 39 | # COMPONENT_NAME2 = gConSplitterSimplePointerComponentName2 40 | # DRIVER_BINDING = gConSplitterConOutDriverBinding 41 | # COMPONENT_NAME = gConSplitterConOutComponentName 42 | # COMPONENT_NAME2 = gConSplitterConOutComponentName2 43 | # DRIVER_BINDING = gConSplitterStdErrDriverBinding 44 | # COMPONENT_NAME = gConSplitterStdErrComponentName 45 | # COMPONENT_NAME2 = gConSplitterStdErrComponentName2 46 | # 47 | 48 | [Sources] 49 | ConSplitterGraphics.c 50 | ComponentName.c 51 | ConSplitter.h 52 | ConSplitter.c 53 | 54 | [Packages] 55 | MdePkg/MdePkg.dec 56 | MdeModulePkg/MdeModulePkg.dec 57 | 58 | [LibraryClasses] 59 | UefiBootServicesTableLib 60 | MemoryAllocationLib 61 | BaseMemoryLib 62 | BaseLib 63 | UefiLib 64 | UefiDriverEntryPoint 65 | DebugLib 66 | PcdLib 67 | 68 | [Guids] 69 | gEfiConsoleInDeviceGuid ## SOMETIMES_CONSUMES ## UNDEFINED # protocol GUID installed on device handle 70 | gEfiStandardErrorDeviceGuid ## SOMETIMES_CONSUMES ## UNDEFINED # protocol GUID installed on device handle 71 | gEfiConsoleOutDeviceGuid ## SOMETIMES_CONSUMES ## UNDEFINED # protocol GUID installed on device handle 72 | ## SOMETIMES_PRODUCES ## Event 73 | ## SOMETIMES_CONSUMES ## Event 74 | gConnectConInEventGuid 75 | 76 | [Protocols] 77 | ## PRODUCES 78 | ## TO_START 79 | gEfiSimplePointerProtocolGuid 80 | ## PRODUCES 81 | ## TO_START 82 | gEfiAbsolutePointerProtocolGuid 83 | ## PRODUCES 84 | ## TO_START 85 | gEfiSimpleTextInProtocolGuid 86 | ## PRODUCES 87 | ## TO_START 88 | gEfiSimpleTextInputExProtocolGuid 89 | ## PRODUCES 90 | ## TO_START 91 | gEfiSimpleTextOutProtocolGuid 92 | ## SOMETIMES_PRODUCES 93 | ## SOMETIMES_CONSUMES 94 | gEfiGraphicsOutputProtocolGuid 95 | ## SOMETIMES_PRODUCES 96 | ## SOMETIMES_CONSUMES 97 | gEfiUgaDrawProtocolGuid 98 | 99 | [FeaturePcd] 100 | gEfiMdeModulePkgTokenSpaceGuid.PcdConOutGopSupport ## CONSUMES 101 | gEfiMdeModulePkgTokenSpaceGuid.PcdConOutUgaSupport ## CONSUMES 102 | gEfiMdePkgTokenSpaceGuid.PcdUgaConsumeSupport ## CONSUMES 103 | 104 | [Pcd] 105 | ## SOMETIMES_PRODUCES 106 | ## SOMETIMES_CONSUMES 107 | gEfiMdeModulePkgTokenSpaceGuid.PcdConOutRow 108 | ## SOMETIMES_PRODUCES 109 | ## SOMETIMES_CONSUMES 110 | gEfiMdeModulePkgTokenSpaceGuid.PcdConOutColumn 111 | gEfiMdeModulePkgTokenSpaceGuid.PcdConInConnectOnDemand ## SOMETIMES_CONSUMES 112 | 113 | [UserExtensions.TianoCore."ExtraFiles"] 114 | ConSplitterDxeExtra.uni 115 | -------------------------------------------------------------------------------- /EXYNOS7885Pkg/Library/MemoryInitPeiLib/MemoryInitPeiLib.c: -------------------------------------------------------------------------------- 1 | /** @file 2 | * 3 | * Copyright (c) 2011-2015, ARM Limited. All rights reserved. 4 | * 5 | * This program and the accompanying materials 6 | * are licensed and made available under the terms and conditions of the BSD 7 | *License which accompanies this distribution. The full text of the license may 8 | *be found at http://opensource.org/licenses/bsd-license.php 9 | * 10 | * THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR 12 | *IMPLIED. 13 | * 14 | **/ 15 | 16 | #include 17 | 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | 25 | // This varies by device 26 | #include 27 | 28 | extern UINT64 mSystemMemoryEnd; 29 | 30 | VOID BuildMemoryTypeInformationHob(VOID); 31 | 32 | STATIC 33 | VOID InitMmu(IN ARM_MEMORY_REGION_DESCRIPTOR *MemoryTable) 34 | { 35 | 36 | VOID * TranslationTableBase; 37 | UINTN TranslationTableSize; 38 | RETURN_STATUS Status; 39 | 40 | // Note: Because we called PeiServicesInstallPeiMemory() before 41 | // to call InitMmu() the MMU Page Table resides in 42 | // RAM (even at the top of DRAM as it is the first permanent memory 43 | // allocation) 44 | Status = ArmConfigureMmu( 45 | MemoryTable, &TranslationTableBase, &TranslationTableSize); 46 | 47 | if (EFI_ERROR(Status)) { 48 | DEBUG((EFI_D_ERROR, "Error: Failed to enable MMU: %r\n", Status)); 49 | } 50 | } 51 | 52 | STATIC 53 | VOID AddHob(PARM_MEMORY_REGION_DESCRIPTOR_EX Desc) 54 | { 55 | BuildResourceDescriptorHob( 56 | Desc->ResourceType, Desc->ResourceAttribute, Desc->Address, Desc->Length); 57 | 58 | if (Desc->ResourceType == EFI_RESOURCE_SYSTEM_MEMORY || 59 | Desc->MemoryType == EfiRuntimeServicesData) 60 | { 61 | BuildMemoryAllocationHob(Desc->Address, Desc->Length, Desc->MemoryType); 62 | } 63 | } 64 | 65 | /*++ 66 | 67 | Routine Description: 68 | 69 | 70 | 71 | Arguments: 72 | 73 | FileHandle - Handle of the file being invoked. 74 | PeiServices - Describes the list of possible PEI Services. 75 | 76 | Returns: 77 | 78 | Status - EFI_SUCCESS if the boot mode could be set 79 | 80 | --*/ 81 | EFI_STATUS 82 | EFIAPI 83 | MemoryPeim(IN EFI_PHYSICAL_ADDRESS UefiMemoryBase, IN UINT64 UefiMemorySize) 84 | { 85 | 86 | PARM_MEMORY_REGION_DESCRIPTOR_EX MemoryDescriptorEx = 87 | gDeviceMemoryDescriptorEx; 88 | ARM_MEMORY_REGION_DESCRIPTOR 89 | MemoryDescriptor[MAX_ARM_MEMORY_REGION_DESCRIPTOR_COUNT]; 90 | UINTN Index = 0; 91 | 92 | // Ensure PcdSystemMemorySize has been set 93 | ASSERT(PcdGet64(PcdSystemMemorySize) != 0); 94 | 95 | // Run through each memory descriptor 96 | while (MemoryDescriptorEx->Length != 0) { 97 | switch (MemoryDescriptorEx->HobOption) { 98 | case AddMem: 99 | case AddDev: 100 | case HobOnlyNoCacheSetting: 101 | AddHob(MemoryDescriptorEx); 102 | break; 103 | case NoHob: 104 | default: 105 | goto update; 106 | } 107 | 108 | if (MemoryDescriptorEx->HobOption == HobOnlyNoCacheSetting) { 109 | MemoryDescriptorEx++; 110 | continue; 111 | } 112 | 113 | update: 114 | ASSERT(Index < MAX_ARM_MEMORY_REGION_DESCRIPTOR_COUNT); 115 | 116 | MemoryDescriptor[Index].PhysicalBase = MemoryDescriptorEx->Address; 117 | MemoryDescriptor[Index].VirtualBase = MemoryDescriptorEx->Address; 118 | MemoryDescriptor[Index].Length = MemoryDescriptorEx->Length; 119 | MemoryDescriptor[Index].Attributes = MemoryDescriptorEx->ArmAttributes; 120 | 121 | Index++; 122 | MemoryDescriptorEx++; 123 | } 124 | 125 | // Last one (terminator) 126 | ASSERT(Index < MAX_ARM_MEMORY_REGION_DESCRIPTOR_COUNT); 127 | MemoryDescriptor[Index].PhysicalBase = 0; 128 | MemoryDescriptor[Index].VirtualBase = 0; 129 | MemoryDescriptor[Index].Length = 0; 130 | MemoryDescriptor[Index].Attributes = 0; 131 | 132 | // Build Memory Allocation Hob 133 | DEBUG((EFI_D_INFO, "Configure MMU In \n")); 134 | InitMmu(MemoryDescriptor); 135 | DEBUG((EFI_D_INFO, "Configure MMU Out \n")); 136 | 137 | if (FeaturePcdGet(PcdPrePiProduceMemoryTypeInformationHob)) { 138 | // Optional feature that helps prevent EFI memory map fragmentation. 139 | BuildMemoryTypeInformationHob(); 140 | } 141 | 142 | return EFI_SUCCESS; 143 | } -------------------------------------------------------------------------------- /EXYNOS7885Pkg/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 -------------------------------------------------------------------------------- /EXYNOS7885Pkg/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 | -------------------------------------------------------------------------------- /EXYNOS7885Pkg/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 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 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | 23 | typedef struct { 24 | EFI_IMAGE_ID ImageId; 25 | EDKII_PLATFORM_LOGO_DISPLAY_ATTRIBUTE Attribute; 26 | INTN OffsetX; 27 | INTN OffsetY; 28 | } LOGO_ENTRY; 29 | 30 | EFI_HII_IMAGE_EX_PROTOCOL *mHiiImageEx; 31 | EFI_HII_HANDLE mHiiHandle; 32 | LOGO_ENTRY mLogos[] = { 33 | { 34 | IMAGE_TOKEN (IMG_LOGO), 35 | EdkiiPlatformLogoDisplayAttributeCenter, 36 | 0, 37 | 0 38 | } 39 | }; 40 | 41 | /** 42 | Load a platform logo image and return its data and attributes. 43 | 44 | @param This The pointer to this protocol instance. 45 | @param Instance The visible image instance is found. 46 | @param Image Points to the image. 47 | @param Attribute The display attributes of the image returned. 48 | @param OffsetX The X offset of the image regarding the Attribute. 49 | @param OffsetY The Y offset of the image regarding the Attribute. 50 | 51 | @retval EFI_SUCCESS The image was fetched successfully. 52 | @retval EFI_NOT_FOUND The specified image could not be found. 53 | **/ 54 | EFI_STATUS 55 | EFIAPI 56 | GetImage ( 57 | IN EDKII_PLATFORM_LOGO_PROTOCOL *This, 58 | IN OUT UINT32 *Instance, 59 | OUT EFI_IMAGE_INPUT *Image, 60 | OUT EDKII_PLATFORM_LOGO_DISPLAY_ATTRIBUTE *Attribute, 61 | OUT INTN *OffsetX, 62 | OUT INTN *OffsetY 63 | ) 64 | { 65 | UINT32 Current; 66 | if (Instance == NULL || Image == NULL || 67 | Attribute == NULL || OffsetX == NULL || OffsetY == NULL) { 68 | return EFI_INVALID_PARAMETER; 69 | } 70 | 71 | Current = *Instance; 72 | if (Current >= ARRAY_SIZE (mLogos)) { 73 | return EFI_NOT_FOUND; 74 | } 75 | 76 | (*Instance)++; 77 | *Attribute = mLogos[Current].Attribute; 78 | *OffsetX = mLogos[Current].OffsetX; 79 | *OffsetY = mLogos[Current].OffsetY; 80 | return mHiiImageEx->GetImageEx (mHiiImageEx, mHiiHandle, mLogos[Current].ImageId, Image); 81 | } 82 | 83 | EDKII_PLATFORM_LOGO_PROTOCOL mPlatformLogo = { 84 | GetImage 85 | }; 86 | 87 | /** 88 | Entrypoint of this module. 89 | 90 | This function is the entrypoint of this module. It installs the Edkii 91 | Platform Logo protocol. 92 | 93 | @param ImageHandle The firmware allocated handle for the EFI image. 94 | @param SystemTable A pointer to the EFI System Table. 95 | 96 | @retval EFI_SUCCESS The entry point is executed successfully. 97 | 98 | **/ 99 | EFI_STATUS 100 | EFIAPI 101 | InitializeLogo ( 102 | IN EFI_HANDLE ImageHandle, 103 | IN EFI_SYSTEM_TABLE *SystemTable 104 | ) 105 | { 106 | EFI_STATUS Status; 107 | EFI_HII_PACKAGE_LIST_HEADER *PackageList; 108 | EFI_HII_DATABASE_PROTOCOL *HiiDatabase; 109 | EFI_HANDLE Handle; 110 | 111 | Status = gBS->LocateProtocol ( 112 | &gEfiHiiDatabaseProtocolGuid, 113 | NULL, 114 | (VOID **) &HiiDatabase 115 | ); 116 | ASSERT_EFI_ERROR (Status); 117 | 118 | Status = gBS->LocateProtocol ( 119 | &gEfiHiiImageExProtocolGuid, 120 | NULL, 121 | (VOID **) &mHiiImageEx 122 | ); 123 | ASSERT_EFI_ERROR (Status); 124 | 125 | // 126 | // Retrieve HII package list from ImageHandle 127 | // 128 | Status = gBS->OpenProtocol ( 129 | ImageHandle, 130 | &gEfiHiiPackageListProtocolGuid, 131 | (VOID **) &PackageList, 132 | ImageHandle, 133 | NULL, 134 | EFI_OPEN_PROTOCOL_GET_PROTOCOL 135 | ); 136 | if (EFI_ERROR (Status)) { 137 | DEBUG ((DEBUG_ERROR, "HII Image Package with logo not found in PE/COFF resource section\n")); 138 | return Status; 139 | } 140 | 141 | // 142 | // Publish HII package list to HII Database. 143 | // 144 | Status = HiiDatabase->NewPackageList ( 145 | HiiDatabase, 146 | PackageList, 147 | NULL, 148 | &mHiiHandle 149 | ); 150 | if (!EFI_ERROR (Status)) { 151 | Handle = NULL; 152 | Status = gBS->InstallMultipleProtocolInterfaces ( 153 | &Handle, 154 | &gEdkiiPlatformLogoProtocolGuid, &mPlatformLogo, 155 | NULL 156 | ); 157 | } 158 | return Status; 159 | } 160 | -------------------------------------------------------------------------------- /EXYNOS7885Pkg/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 | -------------------------------------------------------------------------------- /EXYNOS7885Pkg/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 | -------------------------------------------------------------------------------- /EXYNOS7885Pkg/PrePi/PrePi.c: -------------------------------------------------------------------------------- 1 | /** @file 2 | 3 | Copyright (c) 2011-2017, ARM 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 | #include 16 | #include 17 | #include 18 | 19 | #include 20 | #include 21 | #include 22 | 23 | #include "PrePi.h" 24 | 25 | UINT64 mSystemMemoryEnd = FixedPcdGet64 (PcdSystemMemoryBase) + 26 | FixedPcdGet64 (PcdSystemMemorySize) - 1; 27 | 28 | UINTN Width = FixedPcdGet32(PcdMipiFrameBufferWidth); 29 | UINTN Height = FixedPcdGet32(PcdMipiFrameBufferHeight); 30 | UINTN Bpp = FixedPcdGet32(PcdMipiFrameBufferPixelBpp); 31 | UINTN FbAddr = FixedPcdGet32(PcdMipiFrameBufferAddress); 32 | 33 | VOID 34 | PaintScreen( 35 | IN UINTN BgColor 36 | ) 37 | { 38 | // Code from FramebufferSerialPortLib 39 | char* Pixels = (void*)FixedPcdGet32(PcdMipiFrameBufferAddress); 40 | 41 | // Set color. 42 | for (UINTN i = 0; i < Width; i++) 43 | { 44 | for (UINTN j = 0; j < Height; j++) 45 | { 46 | // Set pixel bit 47 | for (UINTN p = 0; p < (Bpp / 8); p++) 48 | { 49 | *Pixels = (unsigned char)BgColor; 50 | BgColor = BgColor >> 8; 51 | Pixels++; 52 | } 53 | } 54 | } 55 | } 56 | 57 | /** 58 | SEC main routine. 59 | @param[in] UefiMemoryBase Start of the PI/UEFI memory region 60 | @param[in] StacksBase Start of the stack 61 | @param[in] StartTimeStamp Timer value at start of execution 62 | **/ 63 | STATIC 64 | VOID 65 | PrePiMain ( 66 | IN UINTN UefiMemoryBase, 67 | IN UINTN StacksBase, 68 | IN UINT64 StartTimeStamp 69 | ) 70 | { 71 | EFI_HOB_HANDOFF_INFO_TABLE *HobList; 72 | EFI_STATUS Status; 73 | CHAR8 Buffer[100]; 74 | UINTN CharCount; 75 | UINTN StacksSize; 76 | FIRMWARE_SEC_PERFORMANCE Performance; 77 | 78 | // Initialize the architecture specific bits 79 | ArchInitialize (); 80 | 81 | // Paint screen to BLACK 82 | PaintScreen(0); 83 | 84 | 85 | // Initialize the Serial Port 86 | SerialPortInitialize (); 87 | CharCount = AsciiSPrint ( 88 | Buffer, 89 | sizeof (Buffer), 90 | "UEFI firmware (version %s built at %a on %a)\n\r", 91 | (CHAR16 *)PcdGetPtr (PcdFirmwareVersionString), 92 | __TIME__, 93 | __DATE__ 94 | ); 95 | SerialPortWrite ((UINT8 *)Buffer, CharCount); 96 | 97 | DEBUG(( 98 | EFI_D_INFO | EFI_D_LOAD, 99 | "UEFI Memory Base = 0x%p, Stack Base = 0x%p\n", 100 | UefiMemoryBase, 101 | StacksBase 102 | )); 103 | 104 | // Initialize the Debug Agent for Source Level Debugging 105 | InitializeDebugAgent (DEBUG_AGENT_INIT_POSTMEM_SEC, NULL, NULL); 106 | SaveAndSetDebugTimerInterrupt (TRUE); 107 | 108 | // Declare the PI/UEFI memory region 109 | HobList = HobConstructor ( 110 | (VOID *)UefiMemoryBase, 111 | FixedPcdGet32 (PcdSystemMemoryUefiRegionSize), 112 | (VOID *)UefiMemoryBase, 113 | (VOID *)StacksBase // The top of the UEFI Memory is reserved for the stacks 114 | ); 115 | PrePeiSetHobList (HobList); 116 | 117 | // Initialize MMU and Memory HOBs (Resource Descriptor HOBs) 118 | Status = MemoryPeim (UefiMemoryBase, FixedPcdGet32 (PcdSystemMemoryUefiRegionSize)); 119 | ASSERT_EFI_ERROR (Status); 120 | 121 | // Create the Stacks HOB 122 | StacksSize = PcdGet32 (PcdCPUCorePrimaryStackSize); 123 | 124 | BuildStackHob (StacksBase, StacksSize); 125 | 126 | // TODO: Call CpuPei as a library 127 | BuildCpuHob (ArmGetPhysicalAddressBits (), PcdGet8 (PcdPrePiCpuIoSize)); 128 | 129 | // Store timer value logged at the beginning of firmware image execution 130 | Performance.ResetEnd = GetTimeInNanoSecond (StartTimeStamp); 131 | 132 | // Build SEC Performance Data Hob 133 | BuildGuidDataHob (&gEfiFirmwarePerformanceGuid, &Performance, sizeof (Performance)); 134 | 135 | // Set the Boot Mode 136 | SetBootMode (ArmPlatformGetBootMode ()); 137 | 138 | // Initialize Platform HOBs (CpuHob and FvHob) 139 | Status = PlatformPeim (); 140 | ASSERT_EFI_ERROR (Status); 141 | 142 | // Now, the HOB List has been initialized, we can register performance information 143 | PERF_START (NULL, "PEI", NULL, StartTimeStamp); 144 | 145 | // SEC phase needs to run library constructors by hand. 146 | ProcessLibraryConstructorList (); 147 | 148 | // Assume the FV that contains the SEC (our code) also contains a compressed FV. 149 | Status = DecompressFirstFv (); 150 | ASSERT_EFI_ERROR (Status); 151 | 152 | // Load the DXE Core and transfer control to it 153 | Status = LoadDxeCoreFromFv (NULL, 0); 154 | ASSERT_EFI_ERROR (Status); 155 | } 156 | 157 | VOID 158 | CEntryPoint ( 159 | IN UINTN MpId, 160 | IN UINTN UefiMemoryBase, 161 | IN UINTN StacksBase 162 | ) 163 | { 164 | UINT64 StartTimeStamp; 165 | 166 | // Initialize the platform specific controllers 167 | ArmPlatformInitialize (MpId); 168 | 169 | StartTimeStamp = 0; 170 | 171 | // Data Cache enabled on Primary core when MMU is enabled. 172 | ArmDisableDataCache (); 173 | // Invalidate instruction cache 174 | ArmInvalidateInstructionCache (); 175 | // Enable Instruction Caches on all cores. 176 | ArmEnableInstructionCache (); 177 | 178 | // Wait the Primary core has defined the address of the Global Variable region (event: ARM_CPU_EVENT_DEFAULT) 179 | ArmCallWFE (); 180 | 181 | PrePiMain (UefiMemoryBase, StacksBase, StartTimeStamp); 182 | 183 | // DXE Core should always load and never return 184 | ASSERT (FALSE); 185 | } 186 | -------------------------------------------------------------------------------- /EXYNOS7885Pkg/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 | -------------------------------------------------------------------------------- /EXYNOS7885Pkg/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 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Attempt to create a minimal EDK2 for Exynos 7885 devices 2 | 3 | ## Status 4 | Boots to UEFI Shell. 5 | 6 | ### Building 7 | Tested on Ubuntu 24.04. 8 | 9 | First, clone EDK2. 10 | 11 | ``` 12 | cd .. 13 | git clone https://github.com/tianocore/edk2 --recursive 14 | git clone https://github.com/tianocore/edk2-platforms.git 15 | ``` 16 | 17 | You should have all three directories side by side. 18 | 19 | Next, install dependencies: 20 | 21 | 18.04 and above: 22 | 23 | ``` 24 | sudo apt install build-essential uuid-dev iasl git nasm python3-distutils gcc-aarch64-linux-gnu 25 | ``` 26 | 27 | Also see [EDK2 website](https://github.com/tianocore/tianocore.github.io/wiki/Using-EDK-II-with-Native-GCC#Install_required_software_from_apt) 28 | 29 | ## Tutorials 30 | 31 | First run ./firstrun.sh 32 | 33 | Then, ./build.sh. 34 | 35 | This should make a boot.tar image to be flashed in ODIN, you may need to adjust. 36 | 37 | ## Porting this project to other Exynos SOCs 38 | 39 | > [!NOTE] 40 | > This may get you to somewhat boot EDK2, however it may not reach shell at all and may crash/get stuck somewhere. 41 | 42 | ### What you will need 43 | 44 | - A phone with an Exynos SOC 45 | - ADB Access 46 | - Access to TWRP 47 | - Android Image Kitchen 48 | - Device Tree Compiler 49 | - Your phone's screen resolution 50 | 51 | ### Grabbing files off your phone 52 | 53 | First, we will grab your boot image as in some cases the boot.img generated by the build system won't boot. 54 | 55 | To do this, in TWRP do the following command 56 | 57 | ```adb shell "dd if=/dev/block/by-name/boot of=/tmp/boot.img``` 58 | 59 | Now grab the file onto your PC 60 | 61 | ```adb pull /tmp/boot.img``` 62 | 63 | We also need the information about your phone's memory allocations so we can find where to write stuff, like enabling framebuffer. 64 | 65 | To get it, in TWRP do the following command: 66 | ```adb pull /proc/iomem``` 67 | 68 | Finally we need your phones DTB (Device Tree Blob) 69 | 70 | To get it, do the following command in TWRP: 71 | ```adb pull /sys/firmware/fdt``` 72 | 73 | ### Taking notes of what is needed 74 | 75 | First we will need the memory base, to find it open up the iomem you dumped and look for the "System RAM" segment, specifically the first one that comes up, We will assume ```80000000-baafffff : System RAM``` as an example. You want to take note of the first part, which in this case is 80000000. 76 | 77 | Next we need the decon area, this is needed for framebuffer, in the iomem dump look for the "decon_f" segment, We will assume ```19050000-1905ffff : decon_f@0x19050000``` to be decon as an example, just as before take note of the first part, which in this case is 19050000 78 | 79 | Now we're gonna decompile your DTB into a DTS (Device Tree Source), to do this do the following command ```dtc -I dtb -O dts -o devicetree.dts fdt``` 80 | 81 | Now open devicetree.dts in a Text Editor, we're gonna look for the interrupt-controller node, again we will assume the interrupt-controller here to be 82 | 83 | ``` 84 | interrupt-controller@10100000 { 85 | compatible = "arm,cortex-a15-gic\0arm,cortex-a9-gic"; 86 | #interrupt-cells = <0x03>; 87 | #address-cells = <0x00>; 88 | interrupt-controller; 89 | reg = <0x00 0x10101000 0x1000 0x00 0x10102000 0x1000 0x00 0x10104000 0x2000 0x00 0x10106000 0x2000>; 90 | interrupts = <0x01 0x09 0xf04>; 91 | phandle = <0x01>; 92 | }; 93 | ``` 94 | 95 | You want to take notes of 2 numbers, the first one being after the "interrupt-controller@", which in this case is 10100000, and the second one being after "reg = [!NOTE] 104 | > You shouldn't make the device use all the ram yet as it may not boot, stick eith 1.5GB or smaller to be safe. 105 | 106 | Go into EXYNOS7885Pkg/Devices and copy a10.dsc to (devicename).dsc, for example we'll copy a10.dsc into s20.dsc 107 | 108 | Now theres only a couple things to edit here thankfully. 109 | 110 | First thing to edit is ```gArmTokenSpaceGuid.PcdSystemMemoryBase```, replace "0x80000000" or whatever address it holds with 0x(Number of the memory base you noted down earlier) 111 | 112 | Final things to edit is the framebuffer area, to avoid boring you with more text ill just put the things needing to be edited. 113 | 114 | ```gEXYNOS7885PkgTokenSpaceGuid.PcdMipiFrameBufferAddress|(Framebuffer offset from earlier)``` 115 | 116 | ```gEXYNOS7885PkgTokenSpaceGuid.PcdMipiFrameBufferWidth|(Screen resolution width)``` 117 | 118 | ```gEXYNOS7885PkgTokenSpaceGuid.PcdMipiFrameBufferHeight|(Screen resolution height)``` 119 | 120 | ```gEXYNOS7885PkgTokenSpaceGuid.PcdMipiFrameBufferVisibleWidth|(Screen resolution width)``` 121 | 122 | ```gEXYNOS7885PkgTokenSpaceGuid.PcdMipiFrameBufferVisibleHeight|(Screen resolution height)``` 123 | 124 | After you've edited that you can save the file and close it. 125 | 126 | ### Correcting the interrupt controller addresses 127 | 128 | Open up EXYNOS7885Pkg/EXYNOS7885.dsc and replace ```gArmTokenSpaceGuid.PcdGicDistributorBase|0x12301000``` with ```gArmTokenSpaceGuid.PcdGicDistributorBase|0x(First interrupt address you noted)``` after which replace ```gArmTokenSpaceGuid.PcdGicInterruptInterfaceBase|0x12302000``` with ```gArmTokenSpaceGuid.PcdGicInterruptInterfaceBase|0x(Second interrupt address you noted)``` 129 | 130 | You can now save and close the file. 131 | 132 | ### Correcting decon address 133 | 134 | Go to https://godbolt.org/ and before doing anything chabge the compiler on the right to ARM64 GCC 5.4. 135 | 136 | Then in the left paste 137 | 138 | ``` 139 | void enableDecon() 140 | { 141 | *(int*) (0x(decon_f noted from before) + 0x70) = 0x1281; 142 | } 143 | ``` 144 | 145 | The assembly you'll want is in the middle. 146 | 147 | 148 | Go to EXYNOS7885Pkg/Library 149 | /EXYNOS7885PkgLib and open up "EXYNOS7885PkgHelper.S" 150 | 151 | Replace the ```enableDecon:``` function with the one you got from the online compiler (except for the last ret) then close and save the file. 152 | 153 | ### Editing the build script 154 | 155 | Open build.sh 156 | 157 | Replace any mention of a10.dsc with (Device name).dsc 158 | 159 | Now you can build with the steps above. 160 | 161 | ### Running EDK2 in your device 162 | 163 | After your device builds don't use the boot.img in workspace as the bootloader may not like it, instead take the boot.img you dumped earlier and place it into Android Image Kitchen, unpack it with ```./unpackimg.sh boot.img``` then take the "UEFI" file from the workspace folder and put it into split_image under the name "boot.img-kernel", obviously replacing the old one, repack the image with ```./repackimg.sh```. 164 | 165 | Rename image-new.img to boot.img, then using 7zip (on windows) or tar on linux, archive it to a ``.tar``. 166 | 167 | You can now flash boot.tar onto your phone using ODIN3, Heimdall, or TWRP if you prefer. 168 | 169 | ### Getting EDK2 shell fullscreen 170 | 171 | If you made it this far, congratulations but you're here to get the shell fullscreen not to get some kind of trophy. To make the shell fullscreen open, up ```EXYNOS7885Pkg/Drivers/GraphicsConsoleDxe/GraphicsConsole.c```, go to line 293, 172 | 173 | ```NewModeBuffer[ValidCount].Columns``` should equal your devices resolution width divided by 8 and ```NewModeBuffer[ValidCount].Rows``` should equal your devices resolution height divided by 19, obviously if any of the divisions have remainders (e.g 23.4) go down to the lowest whole number to be safe (e.g 23) 174 | 175 | 176 | # Credits 177 | 178 | SimpleFbDxe screen driver is from imbushuo's [Lumia950XLPkg](https://github.com/WOA-Project/Lumia950XLPkg). 179 | 180 | Zhuowei for making edk2-pixel3 181 | 182 | All the people in ``EDKII pain and misery, struggles and disappointment`` on Discord. 183 | -------------------------------------------------------------------------------- /EXYNOS7885Pkg/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 | -------------------------------------------------------------------------------- /EXYNOS7885Pkg/Drivers/GraphicsConsoleDxe/ComponentName.c: -------------------------------------------------------------------------------- 1 | /** @file 2 | UEFI Component Name(2) protocol implementation for GraphicsConsole driver. 3 | 4 | Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.
5 | SPDX-License-Identifier: BSD-2-Clause-Patent 6 | 7 | **/ 8 | 9 | #include "GraphicsConsole.h" 10 | 11 | // 12 | // EFI Component Name Protocol 13 | // 14 | GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME_PROTOCOL gGraphicsConsoleComponentName = { 15 | GraphicsConsoleComponentNameGetDriverName, 16 | GraphicsConsoleComponentNameGetControllerName, 17 | "eng" 18 | }; 19 | 20 | // 21 | // EFI Component Name 2 Protocol 22 | // 23 | GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME2_PROTOCOL gGraphicsConsoleComponentName2 = { 24 | (EFI_COMPONENT_NAME2_GET_DRIVER_NAME)GraphicsConsoleComponentNameGetDriverName, 25 | (EFI_COMPONENT_NAME2_GET_CONTROLLER_NAME)GraphicsConsoleComponentNameGetControllerName, 26 | "en" 27 | }; 28 | 29 | GLOBAL_REMOVE_IF_UNREFERENCED EFI_UNICODE_STRING_TABLE mGraphicsConsoleDriverNameTable[] = { 30 | { 31 | "eng;en", 32 | (CHAR16 *)L"Graphics Console Driver" 33 | }, 34 | { 35 | NULL, 36 | NULL 37 | } 38 | }; 39 | 40 | /** 41 | Retrieves a Unicode string that is the user readable name of the driver. 42 | 43 | This function retrieves the user readable name of a driver in the form of a 44 | Unicode string. If the driver specified by This has a user readable name in 45 | the language specified by Language, then a pointer to the driver name is 46 | returned in DriverName, and EFI_SUCCESS is returned. If the driver specified 47 | by This does not support the language specified by Language, 48 | then EFI_UNSUPPORTED is returned. 49 | 50 | @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or 51 | EFI_COMPONENT_NAME_PROTOCOL instance. 52 | 53 | @param Language[in] A pointer to a Null-terminated ASCII string 54 | array indicating the language. This is the 55 | language of the driver name that the caller is 56 | requesting, and it must match one of the 57 | languages specified in SupportedLanguages. The 58 | number of languages supported by a driver is up 59 | to the driver writer. Language is specified 60 | in RFC 4646 or ISO 639-2 language code format. 61 | 62 | @param DriverName[out] A pointer to the Unicode string to return. 63 | This Unicode string is the name of the 64 | driver specified by This in the language 65 | specified by Language. 66 | 67 | @retval EFI_SUCCESS The Unicode string for the Driver specified by 68 | This and the language specified by Language was 69 | returned in DriverName. 70 | 71 | @retval EFI_INVALID_PARAMETER Language is NULL. 72 | 73 | @retval EFI_INVALID_PARAMETER DriverName is NULL. 74 | 75 | @retval EFI_UNSUPPORTED The driver specified by This does not support 76 | the language specified by Language. 77 | 78 | **/ 79 | EFI_STATUS 80 | EFIAPI 81 | GraphicsConsoleComponentNameGetDriverName ( 82 | IN EFI_COMPONENT_NAME_PROTOCOL *This, 83 | IN CHAR8 *Language, 84 | OUT CHAR16 **DriverName 85 | ) 86 | { 87 | return LookupUnicodeString2 ( 88 | Language, 89 | This->SupportedLanguages, 90 | mGraphicsConsoleDriverNameTable, 91 | DriverName, 92 | (BOOLEAN)(This == &gGraphicsConsoleComponentName) 93 | ); 94 | } 95 | 96 | /** 97 | Retrieves a Unicode string that is the user readable name of the controller 98 | that is being managed by a driver. 99 | 100 | This function retrieves the user readable name of the controller specified by 101 | ControllerHandle and ChildHandle in the form of a Unicode string. If the 102 | driver specified by This has a user readable name in the language specified by 103 | Language, then a pointer to the controller name is returned in ControllerName, 104 | and EFI_SUCCESS is returned. If the driver specified by This is not currently 105 | managing the controller specified by ControllerHandle and ChildHandle, 106 | then EFI_UNSUPPORTED is returned. If the driver specified by This does not 107 | support the language specified by Language, then EFI_UNSUPPORTED is returned. 108 | 109 | @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or 110 | EFI_COMPONENT_NAME_PROTOCOL instance. 111 | 112 | @param ControllerHandle[in] The handle of a controller that the driver 113 | specified by This is managing. This handle 114 | specifies the controller whose name is to be 115 | returned. 116 | 117 | @param ChildHandle[in] The handle of the child controller to retrieve 118 | the name of. This is an optional parameter that 119 | may be NULL. It will be NULL for device 120 | drivers. It will also be NULL for a bus drivers 121 | that wish to retrieve the name of the bus 122 | controller. It will not be NULL for a bus 123 | driver that wishes to retrieve the name of a 124 | child controller. 125 | 126 | @param Language[in] A pointer to a Null-terminated ASCII string 127 | array indicating the language. This is the 128 | language of the driver name that the caller is 129 | requesting, and it must match one of the 130 | languages specified in SupportedLanguages. The 131 | number of languages supported by a driver is up 132 | to the driver writer. Language is specified in 133 | RFC 4646 or ISO 639-2 language code format. 134 | 135 | @param ControllerName[out] A pointer to the Unicode string to return. 136 | This Unicode string is the name of the 137 | controller specified by ControllerHandle and 138 | ChildHandle in the language specified by 139 | Language from the point of view of the driver 140 | specified by This. 141 | 142 | @retval EFI_SUCCESS The Unicode string for the user readable name in 143 | the language specified by Language for the 144 | driver specified by This was returned in 145 | DriverName. 146 | 147 | @retval EFI_INVALID_PARAMETER ControllerHandle is NULL. 148 | 149 | @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid 150 | EFI_HANDLE. 151 | 152 | @retval EFI_INVALID_PARAMETER Language is NULL. 153 | 154 | @retval EFI_INVALID_PARAMETER ControllerName is NULL. 155 | 156 | @retval EFI_UNSUPPORTED The driver specified by This is not currently 157 | managing the controller specified by 158 | ControllerHandle and ChildHandle. 159 | 160 | @retval EFI_UNSUPPORTED The driver specified by This does not support 161 | the language specified by Language. 162 | 163 | **/ 164 | EFI_STATUS 165 | EFIAPI 166 | GraphicsConsoleComponentNameGetControllerName ( 167 | IN EFI_COMPONENT_NAME_PROTOCOL *This, 168 | IN EFI_HANDLE ControllerHandle, 169 | IN EFI_HANDLE ChildHandle OPTIONAL, 170 | IN CHAR8 *Language, 171 | OUT CHAR16 **ControllerName 172 | ) 173 | { 174 | return EFI_UNSUPPORTED; 175 | } 176 | -------------------------------------------------------------------------------- /EXYNOS7885Pkg/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*)0x8d100000ull; 38 | for (UINTN i = 0; i < 0x200000; i++) { 39 | base[i] = 0; 40 | } 41 | return RETURN_SUCCESS; 42 | } 43 | 44 | static void mem_putchar(UINT8 c) { 45 | static const UINTN size = 0x200000; 46 | static UINTN offset = 0; 47 | UINT8* base = (UINT8*)0x8d100000ull; 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 | 217 | -------------------------------------------------------------------------------- /EXYNOS7885Pkg/EXYNOS7885Pkg.fdf: -------------------------------------------------------------------------------- 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 | # 15 | # FD Section 16 | # The [FD] Section is made up of the definition statements and a 17 | # description of what goes into the Flash Device Image. Each FD section 18 | # defines one flash "device" image. A flash device image may be one of 19 | # the following: Removable media bootable image (like a boot floppy 20 | # image,) an Option ROM image (that would be "flashed" into an add-in 21 | # card,) a System "Flash" image (that would be burned into a system's 22 | # flash) or an Update ("Capsule") image that will be used to update and 23 | # existing system flash. 24 | # 25 | ################################################################################ 26 | 27 | [FD.EXYNOS7885PKG_UEFI] 28 | BaseAddress = 0x90000000|gArmTokenSpaceGuid.PcdFdBaseAddress # The base address of the Firmware in NOR Flash. 29 | Size = 0x00200000|gArmTokenSpaceGuid.PcdFdSize # The size in bytes of the FLASH Device 30 | ErasePolarity = 1 31 | 32 | # This one is tricky, it must be: BlockSize * NumBlocks = Size 33 | BlockSize = 0x00001000 34 | NumBlocks = 0x200 35 | 36 | ################################################################################ 37 | # 38 | # Following are lists of FD Region layout which correspond to the locations of different 39 | # images within the flash device. 40 | # 41 | # Regions must be defined in ascending order and may not overlap. 42 | # 43 | # A Layout Region start with a eight digit hex offset (leading "0x" required) followed by 44 | # the pipe "|" character, followed by the size of the region, also in hex with the leading 45 | # "0x" characters. Like: 46 | # Offset|Size 47 | # PcdOffsetCName|PcdSizeCName 48 | # RegionType 49 | # 50 | ################################################################################ 51 | 52 | # from ArmVirtPkg/ArmVirtQemuKernel.fdf 53 | # 54 | # Implement the Linux kernel header layout so that the loader will identify 55 | # it as something bootable, and execute it with a FDT pointer in x0 or r2. 56 | # 57 | 0x00000000|0x00200000 58 | gArmTokenSpaceGuid.PcdFvBaseAddress|gArmTokenSpaceGuid.PcdFvSize 59 | FV = FVMAIN_COMPACT 60 | 61 | 62 | ################################################################################ 63 | # 64 | # FV Section 65 | # 66 | # [FV] section is used to define what components or modules are placed within a flash 67 | # device file. This section also defines order the components and modules are positioned 68 | # within the image. The [FV] section consists of define statements, set statements and 69 | # module statements. 70 | # 71 | ################################################################################ 72 | 73 | [FV.FvMain] 74 | BlockSize = 0x40 75 | NumBlocks = 0 # This FV gets compressed so make it just big enough 76 | FvAlignment = 8 # FV alignment and FV attributes setting. 77 | ERASE_POLARITY = 1 78 | MEMORY_MAPPED = TRUE 79 | STICKY_WRITE = TRUE 80 | LOCK_CAP = TRUE 81 | LOCK_STATUS = TRUE 82 | WRITE_DISABLED_CAP = TRUE 83 | WRITE_ENABLED_CAP = TRUE 84 | WRITE_STATUS = TRUE 85 | WRITE_LOCK_CAP = TRUE 86 | WRITE_LOCK_STATUS = TRUE 87 | READ_DISABLED_CAP = TRUE 88 | READ_ENABLED_CAP = TRUE 89 | READ_STATUS = TRUE 90 | READ_LOCK_CAP = TRUE 91 | READ_LOCK_STATUS = TRUE 92 | 93 | APRIORI DXE { 94 | INF MdeModulePkg/Universal/PCD/Dxe/Pcd.inf 95 | } 96 | 97 | INF MdeModulePkg/Core/Dxe/DxeMain.inf 98 | 99 | # 100 | # PI DXE Drivers producing Architectural Protocols (EFI Services) 101 | # 102 | INF ArmPkg/Drivers/CpuDxe/CpuDxe.inf 103 | INF MdeModulePkg/Core/RuntimeDxe/RuntimeDxe.inf 104 | INF MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf 105 | INF MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf 106 | INF EmbeddedPkg/EmbeddedMonotonicCounter/EmbeddedMonotonicCounter.inf 107 | INF MdeModulePkg/Universal/ResetSystemRuntimeDxe/ResetSystemRuntimeDxe.inf 108 | INF EmbeddedPkg/RealTimeClockRuntimeDxe/RealTimeClockRuntimeDxe.inf 109 | INF EmbeddedPkg/MetronomeDxe/MetronomeDxe.inf 110 | 111 | # 112 | # Multiple Console IO support 113 | # 114 | INF MdeModulePkg/Universal/Console/ConPlatformDxe/ConPlatformDxe.inf 115 | INF MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitterDxe.inf 116 | INF MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsoleDxe.inf 117 | INF MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf 118 | INF MdeModulePkg/Universal/SerialDxe/SerialDxe.inf 119 | 120 | INF ArmPkg/Drivers/ArmGicDxe/ArmGicDxe.inf 121 | INF ArmPkg/Drivers/TimerDxe/TimerDxe.inf 122 | 123 | INF MdeModulePkg/Universal/WatchdogTimerDxe/WatchdogTimer.inf 124 | 125 | INF MdeModulePkg/Universal/PCD/Dxe/Pcd.inf 126 | 127 | # 128 | # GPIO 129 | # 130 | 131 | # 132 | # Virtual Keyboard 133 | # 134 | INF EmbeddedPkg/Drivers/VirtualKeyboardDxe/VirtualKeyboardDxe.inf 135 | 136 | # 137 | # Platform Dxes 138 | # 139 | INF EXYNOS7885Pkg/Drivers/EXYNOS7885PkgDxe/EXYNOS7885PkgDxe.inf 140 | INF EXYNOS7885Pkg/Drivers/SimpleFbDxe/SimpleFbDxe.inf 141 | INF EXYNOS7885Pkg/Drivers/LogoDxe/LogoDxe.inf 142 | 143 | # 144 | # USB Host Support 145 | # 146 | INF MdeModulePkg/Bus/Usb/UsbBusDxe/UsbBusDxe.inf 147 | 148 | # 149 | # USB Mass Storage Support 150 | # 151 | INF MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassStorageDxe.inf 152 | 153 | # 154 | # USB Peripheral Support 155 | # 156 | INF EmbeddedPkg/Drivers/AndroidFastbootTransportUsbDxe/FastbootTransportUsbDxe.inf 157 | 158 | # 159 | # Fastboot 160 | # 161 | INF EmbeddedPkg/Application/AndroidFastboot/AndroidFastbootApp.inf 162 | 163 | # 164 | # FAT filesystem + GPT/MBR partitioning 165 | # 166 | INF MdeModulePkg/Universal/Disk/DiskIoDxe/DiskIoDxe.inf 167 | INF MdeModulePkg/Universal/Disk/PartitionDxe/PartitionDxe.inf 168 | INF FatPkg/EnhancedFatDxe/Fat.inf 169 | INF MdeModulePkg/Universal/Disk/UnicodeCollation/EnglishDxe/EnglishDxe.inf 170 | 171 | INF MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf 172 | 173 | INF MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabaseDxe.inf 174 | 175 | # 176 | # ACPI Support 177 | # 178 | INF MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf 179 | INF MdeModulePkg/Universal/Acpi/AcpiPlatformDxe/AcpiPlatformDxe.inf 180 | INF MdeModulePkg/Universal/Acpi/BootGraphicsResourceTableDxe/BootGraphicsResourceTableDxe.inf 181 | INF RuleOverride = ACPITABLE EXYNOS7885Pkg/AcpiTables/AcpiTables.inf 182 | 183 | # 184 | # SMBIOS Support 185 | # 186 | INF EXYNOS7885Pkg/Drivers/SmbiosPlatformDxe/SmbiosPlatformDxe.inf 187 | INF MdeModulePkg/Universal/SmbiosDxe/SmbiosDxe.inf 188 | 189 | # 190 | # UEFI applications 191 | # 192 | INF ShellPkg/Application/Shell/Shell.inf 193 | !ifdef $(INCLUDE_TFTP_COMMAND) 194 | INF ShellPkg/DynamicCommand/TftpDynamicCommand/TftpDynamicCommand.inf 195 | !endif #$(INCLUDE_TFTP_COMMAND) 196 | 197 | # 198 | # Bds 199 | # 200 | INF MdeModulePkg/Universal/PrintDxe/PrintDxe.inf 201 | INF MdeModulePkg/Universal/DevicePathDxe/DevicePathDxe.inf 202 | INF MdeModulePkg/Universal/DisplayEngineDxe/DisplayEngineDxe.inf 203 | INF MdeModulePkg/Universal/SetupBrowserDxe/SetupBrowserDxe.inf 204 | INF MdeModulePkg/Universal/DriverHealthManagerDxe/DriverHealthManagerDxe.inf 205 | INF MdeModulePkg/Universal/BdsDxe/BdsDxe.inf 206 | INF MdeModulePkg/Application/UiApp/UiApp.inf 207 | 208 | [FV.FVMAIN_COMPACT] 209 | FvAlignment = 8 210 | ERASE_POLARITY = 1 211 | MEMORY_MAPPED = TRUE 212 | STICKY_WRITE = TRUE 213 | LOCK_CAP = TRUE 214 | LOCK_STATUS = TRUE 215 | WRITE_DISABLED_CAP = TRUE 216 | WRITE_ENABLED_CAP = TRUE 217 | WRITE_STATUS = TRUE 218 | WRITE_LOCK_CAP = TRUE 219 | WRITE_LOCK_STATUS = TRUE 220 | READ_DISABLED_CAP = TRUE 221 | READ_ENABLED_CAP = TRUE 222 | READ_STATUS = TRUE 223 | READ_LOCK_CAP = TRUE 224 | READ_LOCK_STATUS = TRUE 225 | 226 | INF EXYNOS7885Pkg/PrePi/PrePi.inf 227 | 228 | FILE FV_IMAGE = 9E21FD93-9C72-4c15-8C4B-E77F1DB2D792 { 229 | SECTION GUIDED EE4E5898-3914-4259-9D6E-DC7BD79403CF PROCESSING_REQUIRED = TRUE { 230 | SECTION FV_IMAGE = FVMAIN 231 | } 232 | } 233 | 234 | !include EXYNOS7885Pkg/CommonFdf.fdf.inc 235 | -------------------------------------------------------------------------------- /EXYNOS7885Pkg/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 | -------------------------------------------------------------------------------- /EXYNOS7885Pkg/Drivers/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 "Library/FrameBufferBltLib.h" 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 | /// DeclaresSimpleFbDxe/SimpleFbDxe.c 69 | 70 | STATIC FRAME_BUFFER_CONFIGURE *mFrameBufferBltLibConfigure; 71 | STATIC UINTN mFrameBufferBltLibConfigureSize; 72 | 73 | STATIC 74 | EFI_STATUS 75 | EFIAPI 76 | DisplayQueryMode 77 | ( 78 | IN EFI_GRAPHICS_OUTPUT_PROTOCOL *This, 79 | IN UINT32 ModeNumber, 80 | OUT UINTN *SizeOfInfo, 81 | OUT EFI_GRAPHICS_OUTPUT_MODE_INFORMATION **Info 82 | ); 83 | 84 | STATIC 85 | EFI_STATUS 86 | EFIAPI 87 | DisplaySetMode 88 | ( 89 | IN EFI_GRAPHICS_OUTPUT_PROTOCOL *This, 90 | IN UINT32 ModeNumber 91 | ); 92 | 93 | STATIC 94 | EFI_STATUS 95 | EFIAPI 96 | DisplayBlt 97 | ( 98 | IN EFI_GRAPHICS_OUTPUT_PROTOCOL *This, 99 | IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL *BltBuffer, OPTIONAL 100 | IN EFI_GRAPHICS_OUTPUT_BLT_OPERATION BltOperation, 101 | IN UINTN SourceX, 102 | IN UINTN SourceY, 103 | IN UINTN DestinationX, 104 | IN UINTN DestinationY, 105 | IN UINTN Width, 106 | IN UINTN Height, 107 | IN UINTN Delta OPTIONAL 108 | ); 109 | 110 | STATIC EFI_GRAPHICS_OUTPUT_PROTOCOL mDisplay = { 111 | DisplayQueryMode, 112 | DisplaySetMode, 113 | DisplayBlt, 114 | NULL 115 | }; 116 | 117 | STATIC 118 | EFI_STATUS 119 | EFIAPI 120 | DisplayQueryMode 121 | ( 122 | IN EFI_GRAPHICS_OUTPUT_PROTOCOL *This, 123 | IN UINT32 ModeNumber, 124 | OUT UINTN *SizeOfInfo, 125 | OUT EFI_GRAPHICS_OUTPUT_MODE_INFORMATION **Info 126 | ) 127 | { 128 | EFI_STATUS Status; 129 | Status = gBS->AllocatePool( 130 | EfiBootServicesData, 131 | sizeof(EFI_GRAPHICS_OUTPUT_MODE_INFORMATION), 132 | (VOID **) Info); 133 | 134 | ASSERT_EFI_ERROR(Status); 135 | 136 | *SizeOfInfo = sizeof(EFI_GRAPHICS_OUTPUT_MODE_INFORMATION); 137 | (*Info)->Version = This->Mode->Info->Version; 138 | (*Info)->HorizontalResolution = This->Mode->Info->HorizontalResolution; 139 | (*Info)->VerticalResolution = This->Mode->Info->VerticalResolution; 140 | (*Info)->PixelFormat = This->Mode->Info->PixelFormat; 141 | (*Info)->PixelsPerScanLine = This->Mode->Info->PixelsPerScanLine; 142 | 143 | return EFI_SUCCESS; 144 | } 145 | 146 | STATIC 147 | EFI_STATUS 148 | EFIAPI 149 | DisplaySetMode 150 | ( 151 | IN EFI_GRAPHICS_OUTPUT_PROTOCOL *This, 152 | IN UINT32 ModeNumber 153 | ) 154 | { 155 | return EFI_SUCCESS; 156 | } 157 | 158 | STATIC 159 | EFI_STATUS 160 | EFIAPI 161 | DisplayBlt 162 | ( 163 | IN EFI_GRAPHICS_OUTPUT_PROTOCOL *This, 164 | IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL *BltBuffer, OPTIONAL 165 | IN EFI_GRAPHICS_OUTPUT_BLT_OPERATION BltOperation, 166 | IN UINTN SourceX, 167 | IN UINTN SourceY, 168 | IN UINTN DestinationX, 169 | IN UINTN DestinationY, 170 | IN UINTN Width, 171 | IN UINTN Height, 172 | IN UINTN Delta OPTIONAL 173 | ) 174 | { 175 | 176 | RETURN_STATUS Status; 177 | EFI_TPL Tpl; 178 | // 179 | // We have to raise to TPL_NOTIFY, so we make an atomic write to the frame buffer. 180 | // We would not want a timer based event (Cursor, ...) to come in while we are 181 | // doing this operation. 182 | // 183 | Tpl = gBS->RaiseTPL (TPL_NOTIFY); 184 | Status = FrameBufferBlt ( 185 | mFrameBufferBltLibConfigure, 186 | BltBuffer, 187 | BltOperation, 188 | SourceX, SourceY, 189 | DestinationX, DestinationY, Width, Height, 190 | Delta 191 | ); 192 | gBS->RestoreTPL (Tpl); 193 | 194 | // zhuowei: hack: flush the cache manually since my memory maps are still broken 195 | WriteBackInvalidateDataCacheRange((void*)mDisplay.Mode->FrameBufferBase, 196 | mDisplay.Mode->FrameBufferSize); 197 | // zhuowei: end hack 198 | 199 | return RETURN_ERROR (Status) ? EFI_INVALID_PARAMETER : EFI_SUCCESS; 200 | } 201 | 202 | EFI_STATUS 203 | EFIAPI 204 | SimpleFbDxeInitialize 205 | ( 206 | IN EFI_HANDLE ImageHandle, 207 | IN EFI_SYSTEM_TABLE *SystemTable 208 | ) 209 | { 210 | 211 | EFI_STATUS Status = EFI_SUCCESS; 212 | EFI_HANDLE hUEFIDisplayHandle = NULL; 213 | 214 | /* Retrieve simple frame buffer from pre-SEC bootloader */ 215 | DEBUG((EFI_D_ERROR, "SimpleFbDxe: Retrieve MIPI FrameBuffer parameters from PCD\n")); 216 | UINT32 MipiFrameBufferAddr = FixedPcdGet32(PcdMipiFrameBufferAddress); 217 | UINT32 MipiFrameBufferWidth = FixedPcdGet32(PcdMipiFrameBufferWidth); 218 | UINT32 MipiFrameBufferHeight = FixedPcdGet32(PcdMipiFrameBufferHeight); 219 | 220 | /* Sanity check */ 221 | if (MipiFrameBufferAddr == 0 || MipiFrameBufferWidth == 0 || MipiFrameBufferHeight == 0) 222 | { 223 | DEBUG((EFI_D_ERROR, "SimpleFbDxe: Invalid FrameBuffer parameters\n")); 224 | return EFI_DEVICE_ERROR; 225 | } 226 | 227 | /* Prepare struct */ 228 | if (mDisplay.Mode == NULL) 229 | { 230 | Status = gBS->AllocatePool( 231 | EfiBootServicesData, 232 | sizeof(EFI_GRAPHICS_OUTPUT_PROTOCOL_MODE), 233 | (VOID **) &mDisplay.Mode 234 | ); 235 | 236 | ASSERT_EFI_ERROR(Status); 237 | if (EFI_ERROR(Status)) return Status; 238 | 239 | ZeroMem(mDisplay.Mode, sizeof(EFI_GRAPHICS_OUTPUT_PROTOCOL_MODE)); 240 | } 241 | 242 | if (mDisplay.Mode->Info == NULL) 243 | { 244 | Status = gBS->AllocatePool( 245 | EfiBootServicesData, 246 | sizeof(EFI_GRAPHICS_OUTPUT_MODE_INFORMATION), 247 | (VOID **) &mDisplay.Mode->Info 248 | ); 249 | 250 | ASSERT_EFI_ERROR(Status); 251 | if (EFI_ERROR(Status)) return Status; 252 | 253 | ZeroMem(mDisplay.Mode->Info, sizeof(EFI_GRAPHICS_OUTPUT_MODE_INFORMATION)); 254 | } 255 | 256 | /* Set information */ 257 | mDisplay.Mode->MaxMode = 1; 258 | mDisplay.Mode->Mode = 0; 259 | mDisplay.Mode->Info->Version = 0; 260 | 261 | mDisplay.Mode->Info->HorizontalResolution = MipiFrameBufferWidth; 262 | mDisplay.Mode->Info->VerticalResolution = MipiFrameBufferHeight; 263 | 264 | /* SimpleFB runs on a8r8g8b8 (VIDEO_BPP32) for DB410c */ 265 | UINT32 LineLength = MipiFrameBufferWidth * VNBYTES(VIDEO_BPP32); 266 | UINT32 FrameBufferSize = LineLength * MipiFrameBufferHeight; 267 | EFI_PHYSICAL_ADDRESS FrameBufferAddress = MipiFrameBufferAddr; 268 | 269 | mDisplay.Mode->Info->PixelsPerScanLine = MipiFrameBufferWidth; 270 | mDisplay.Mode->Info->PixelFormat = PixelBlueGreenRedReserved8BitPerColor; 271 | mDisplay.Mode->SizeOfInfo = sizeof(EFI_GRAPHICS_OUTPUT_MODE_INFORMATION); 272 | mDisplay.Mode->FrameBufferBase = FrameBufferAddress; 273 | mDisplay.Mode->FrameBufferSize = FrameBufferSize; 274 | 275 | // 276 | // Create the FrameBufferBltLib configuration. 277 | // 278 | Status = FrameBufferBltConfigure ( 279 | (VOID *) (UINTN) mDisplay.Mode->FrameBufferBase, 280 | mDisplay.Mode->Info, 281 | mFrameBufferBltLibConfigure, 282 | &mFrameBufferBltLibConfigureSize 283 | ); 284 | if (Status == RETURN_BUFFER_TOO_SMALL) { 285 | mFrameBufferBltLibConfigure = AllocatePool (mFrameBufferBltLibConfigureSize); 286 | if (mFrameBufferBltLibConfigure != NULL) { 287 | Status = FrameBufferBltConfigure ( 288 | (VOID *) (UINTN) mDisplay.Mode->FrameBufferBase, 289 | mDisplay.Mode->Info, 290 | mFrameBufferBltLibConfigure, 291 | &mFrameBufferBltLibConfigureSize 292 | ); 293 | } 294 | } 295 | ASSERT_EFI_ERROR (Status); 296 | 297 | // zhuowei: clear the screen to black 298 | // UEFI standard requires this, since text is white - see OvmfPkg/QemuVideoDxe/Gop.c 299 | ZeroMem((void*)FrameBufferAddress, FrameBufferSize); 300 | // hack: clear cache 301 | WriteBackInvalidateDataCacheRange((void*)FrameBufferAddress, FrameBufferSize); 302 | // zhuowei: end 303 | 304 | /* Register handle */ 305 | Status = gBS->InstallMultipleProtocolInterfaces( 306 | &hUEFIDisplayHandle, 307 | &gEfiDevicePathProtocolGuid, 308 | &mDisplayDevicePath, 309 | &gEfiGraphicsOutputProtocolGuid, 310 | &mDisplay, 311 | NULL); 312 | 313 | ASSERT_EFI_ERROR (Status); 314 | 315 | return Status; 316 | 317 | } 318 | -------------------------------------------------------------------------------- /EXYNOS7885Pkg/EXYNOS7885Pkg.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 | ################################################################################ 14 | # 15 | # Defines Section - statements that will be processed to create a Makefile. 16 | # 17 | ################################################################################ 18 | [Defines] 19 | PLATFORM_NAME = EXYNOS7885Pkg 20 | PLATFORM_GUID = 28f1a3bf-193a-47e3-a7b9-5a435eaab2ee 21 | PLATFORM_VERSION = 0.1 22 | DSC_SPECIFICATION = 0x00010019 23 | OUTPUT_DIRECTORY = Build/$(PLATFORM_NAME) 24 | SUPPORTED_ARCHITECTURES = AARCH64 25 | BUILD_TARGETS = DEBUG|RELEASE 26 | SKUID_IDENTIFIER = DEFAULT 27 | FLASH_DEFINITION = EXYNOS7885Pkg/EXYNOS7885Pkg.fdf 28 | 29 | !include EXYNOS7885Pkg/CommonDsc.dsc.inc 30 | 31 | [LibraryClasses] 32 | RegisterFilterLib|MdePkg/Library/RegisterFilterLibNull/RegisterFilterLibNull.inf 33 | VariablePolicyHelperLib|MdeModulePkg/Library/VariablePolicyHelperLib/VariablePolicyHelperLib.inf 34 | VariableFlashInfoLib|MdeModulePkg/Library/BaseVariableFlashInfoLib/BaseVariableFlashInfoLib.inf 35 | 36 | [LibraryClasses.common.DXE_RUNTIME_DRIVER] 37 | VariablePolicyLib|MdeModulePkg/Library/VariablePolicyLib/VariablePolicyLibRuntimeDxe.inf 38 | 39 | [LibraryClasses.common] 40 | OrderedCollectionLib|MdePkg/Library/BaseOrderedCollectionRedBlackTreeLib/BaseOrderedCollectionRedBlackTreeLib.inf 41 | ArmLib|ArmPkg/Library/ArmLib/ArmBaseLib.inf 42 | ArmPlatformLib|EXYNOS7885Pkg/Library/EXYNOS7885PkgLib/EXYNOS7885PkgLib.inf 43 | CompilerIntrinsicsLib|MdePkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf 44 | 45 | CapsuleLib|MdeModulePkg/Library/DxeCapsuleLibNull/DxeCapsuleLibNull.inf 46 | UefiBootManagerLib|MdeModulePkg/Library/UefiBootManagerLib/UefiBootManagerLib.inf 47 | PlatformBootManagerLib|ArmPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf 48 | CustomizedDisplayLib|MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLib.inf 49 | 50 | # UiApp dependencies 51 | ReportStatusCodeLib|MdeModulePkg/Library/DxeReportStatusCodeLib/DxeReportStatusCodeLib.inf 52 | FileExplorerLib|MdeModulePkg/Library/FileExplorerLib/FileExplorerLib.inf 53 | DxeServicesLib|MdePkg/Library/DxeServicesLib/DxeServicesLib.inf 54 | BootLogoLib|MdeModulePkg/Library/BootLogoLib/BootLogoLib.inf 55 | 56 | SerialPortLib|EXYNOS7885Pkg/Library/InMemorySerialPortLib/InMemorySerialPortLib.inf 57 | RealTimeClockLib|EmbeddedPkg/Library/VirtualRealTimeClockLib/VirtualRealTimeClockLib.inf 58 | TimeBaseLib|EmbeddedPkg/Library/TimeBaseLib/TimeBaseLib.inf 59 | 60 | # USB Requirements 61 | UefiUsbLib|MdePkg/Library/UefiUsbLib/UefiUsbLib.inf 62 | 63 | # Network Libraries 64 | UefiScsiLib|MdePkg/Library/UefiScsiLib/UefiScsiLib.inf 65 | NetLib|NetworkPkg/Library/DxeNetLib/DxeNetLib.inf 66 | DpcLib|NetworkPkg/Library/DxeDpcLib/DxeDpcLib.inf 67 | IpIoLib|NetworkPkg/Library/DxeIpIoLib/DxeIpIoLib.inf 68 | UdpIoLib|NetworkPkg/Library/DxeUdpIoLib/DxeUdpIoLib.inf 69 | 70 | # VariableRuntimeDxe Requirements 71 | SynchronizationLib|MdePkg/Library/BaseSynchronizationLib/BaseSynchronizationLib.inf 72 | AuthVariableLib|MdeModulePkg/Library/AuthVariableLibNull/AuthVariableLibNull.inf 73 | TpmMeasurementLib|MdeModulePkg/Library/TpmMeasurementLibNull/TpmMeasurementLibNull.inf 74 | VarCheckLib|MdeModulePkg/Library/VarCheckLib/VarCheckLib.inf 75 | 76 | # SimpleFbDxe 77 | FrameBufferBltLib|EXYNOS7885Pkg/Library/FrameBufferBltLib/FrameBufferBltLib.inf 78 | 79 | SerialPortLib|EXYNOS7885Pkg/Library/FrameBufferSerialPortLib/FrameBufferSerialPortLib.inf 80 | PlatformBootManagerLib|EXYNOS7885Pkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf 81 | MemoryInitPeiLib|EXYNOS7885Pkg/Library/MemoryInitPeiLib/PeiMemoryAllocationLib.inf 82 | PlatformPeiLib|EXYNOS7885Pkg/Library/PlatformPeiLib/PlatformPeiLib.inf 83 | 84 | [LibraryClasses.common.SEC] 85 | PrePiLib|EmbeddedPkg/Library/PrePiLib/PrePiLib.inf 86 | ExtractGuidedSectionLib|EmbeddedPkg/Library/PrePiExtractGuidedSectionLib/PrePiExtractGuidedSectionLib.inf 87 | HobLib|EmbeddedPkg/Library/PrePiHobLib/PrePiHobLib.inf 88 | MemoryAllocationLib|EmbeddedPkg/Library/PrePiMemoryAllocationLib/PrePiMemoryAllocationLib.inf 89 | PrePiHobListPointerLib|ArmPlatformPkg/Library/PrePiHobListPointerLib/PrePiHobListPointerLib.inf 90 | 91 | ################################################################################ 92 | # 93 | # Pcd Section - list of all EDK II PCD Entries defined by this Platform 94 | # 95 | ################################################################################ 96 | 97 | [PcdsFeatureFlag.common] 98 | ## If TRUE, Graphics Output Protocol will be installed on virtual handle created by ConsplitterDxe. 99 | # It could be set FALSE to save size. 100 | gEfiMdeModulePkgTokenSpaceGuid.PcdConOutGopSupport|TRUE 101 | 102 | [PcdsFixedAtBuild.common] 103 | gEfiMdePkgTokenSpaceGuid.PcdDefaultTerminalType|4 104 | 105 | gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVersionString|L"Alpha" 106 | 107 | # We only boot one processor here! 108 | gArmPlatformTokenSpaceGuid.PcdCoreCount|1 109 | gArmPlatformTokenSpaceGuid.PcdClusterCount|1 110 | 111 | # 112 | # ARM General Interrupt Controller 113 | # 114 | gArmTokenSpaceGuid.PcdGicDistributorBase|0x12301000 115 | gArmTokenSpaceGuid.PcdGicInterruptInterfaceBase|0x12302000 116 | 117 | gArmTokenSpaceGuid.PcdArmArchTimerIntrNum|0x12 118 | gArmTokenSpaceGuid.PcdArmArchTimerVirtIntrNum|0x13 119 | 120 | # GUID of the UI app 121 | gEfiMdeModulePkgTokenSpaceGuid.PcdBootManagerMenuFile|{ 0x21, 0xaa, 0x2c, 0x46, 0x14, 0x76, 0x03, 0x45, 0x83, 0x6e, 0x8a, 0xb6, 0xf4, 0x66, 0x23, 0x31 } 122 | 123 | gEfiMdePkgTokenSpaceGuid.PcdPlatformBootTimeOut|0 124 | 125 | gEfiMdeModulePkgTokenSpaceGuid.PcdResetOnMemoryTypeInformationChange|FALSE 126 | 127 | gEmbeddedTokenSpaceGuid.PcdMetronomeTickPeriod|1000 128 | 129 | # 130 | # 131 | # Fastboot 132 | # 133 | gEmbeddedTokenSpaceGuid.PcdAndroidFastbootUsbVendorId|0x18d1 134 | gEmbeddedTokenSpaceGuid.PcdAndroidFastbootUsbProductId|0xd00d 135 | 136 | # 137 | # Make VariableRuntimeDxe work at emulated non-volatile variable mode. 138 | # 139 | gEfiMdeModulePkgTokenSpaceGuid.PcdEmuVariableNvModeEnable|TRUE 140 | 141 | gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiExposedTableVersions|0x20 142 | 143 | [PcdsDynamicDefault.common] 144 | gEfiMdeModulePkgTokenSpaceGuid.PcdVideoHorizontalResolution|0 # /8 = column 145 | gEfiMdeModulePkgTokenSpaceGuid.PcdVideoVerticalResolution|0 #/19 = row 146 | gEfiMdeModulePkgTokenSpaceGuid.PcdSetupVideoHorizontalResolution|0 147 | gEfiMdeModulePkgTokenSpaceGuid.PcdSetupVideoVerticalResolution|0 148 | gEfiMdeModulePkgTokenSpaceGuid.PcdSetupConOutColumn|0 149 | gEfiMdeModulePkgTokenSpaceGuid.PcdSetupConOutRow|0 150 | gEfiMdeModulePkgTokenSpaceGuid.PcdConOutColumn|0 151 | gEfiMdeModulePkgTokenSpaceGuid.PcdConOutRow|0 152 | ################################################################################ 153 | # 154 | # Components Section - list of all EDK II Modules needed by this Platform 155 | # 156 | ################################################################################ 157 | [Components.common] 158 | # 159 | # PEI Phase modules 160 | # 161 | EXYNOS7885Pkg/PrePi/PrePi.inf 162 | 163 | # 164 | # DXE 165 | # 166 | MdeModulePkg/Core/Dxe/DxeMain.inf { 167 | 168 | PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf 169 | NULL|MdeModulePkg/Library/DxeCrc32GuidedSectionExtractLib/DxeCrc32GuidedSectionExtractLib.inf 170 | } 171 | 172 | # 173 | # Architectural Protocols 174 | # 175 | ArmPkg/Drivers/CpuDxe/CpuDxe.inf 176 | MdeModulePkg/Core/RuntimeDxe/RuntimeDxe.inf 177 | MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf 178 | MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf 179 | EmbeddedPkg/EmbeddedMonotonicCounter/EmbeddedMonotonicCounter.inf 180 | MdeModulePkg/Universal/ResetSystemRuntimeDxe/ResetSystemRuntimeDxe.inf 181 | EmbeddedPkg/RealTimeClockRuntimeDxe/RealTimeClockRuntimeDxe.inf 182 | EmbeddedPkg/MetronomeDxe/MetronomeDxe.inf 183 | 184 | 185 | MdeModulePkg/Universal/Console/ConPlatformDxe/ConPlatformDxe.inf 186 | MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitterDxe.inf 187 | MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsoleDxe.inf 188 | MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf 189 | MdeModulePkg/Universal/SerialDxe/SerialDxe.inf 190 | 191 | MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf 192 | 193 | ArmPkg/Drivers/ArmGicDxe/ArmGicDxe.inf 194 | ArmPkg/Drivers/TimerDxe/TimerDxe.inf 195 | 196 | MdeModulePkg/Universal/WatchdogTimerDxe/WatchdogTimer.inf 197 | 198 | MdeModulePkg/Universal/PCD/Dxe/Pcd.inf 199 | 200 | # 201 | # Virtual Keyboard 202 | # 203 | EmbeddedPkg/Drivers/VirtualKeyboardDxe/VirtualKeyboardDxe.inf 204 | 205 | # 206 | # Platform Dxes 207 | # 208 | EXYNOS7885Pkg/Drivers/EXYNOS7885PkgDxe/EXYNOS7885PkgDxe.inf 209 | EXYNOS7885Pkg/Drivers/SimpleFbDxe/SimpleFbDxe.inf 210 | EXYNOS7885Pkg/Drivers/LogoDxe/LogoDxe.inf 211 | 212 | # 213 | # USB Host Support 214 | # 215 | MdeModulePkg/Bus/Usb/UsbBusDxe/UsbBusDxe.inf 216 | 217 | # 218 | # USB Mass Storage Support 219 | # 220 | MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassStorageDxe.inf 221 | 222 | # 223 | # USB Peripheral Support 224 | # 225 | EmbeddedPkg/Drivers/AndroidFastbootTransportUsbDxe/FastbootTransportUsbDxe.inf 226 | 227 | # 228 | # Fastboot 229 | # 230 | EmbeddedPkg/Application/AndroidFastboot/AndroidFastbootApp.inf 231 | 232 | 233 | # 234 | # FAT filesystem + GPT/MBR partitioning 235 | # 236 | MdeModulePkg/Universal/Disk/DiskIoDxe/DiskIoDxe.inf 237 | MdeModulePkg/Universal/Disk/PartitionDxe/PartitionDxe.inf 238 | MdeModulePkg/Universal/Disk/UnicodeCollation/EnglishDxe/EnglishDxe.inf 239 | FatPkg/EnhancedFatDxe/Fat.inf 240 | 241 | # 242 | # ACPI Support 243 | # 244 | MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf 245 | MdeModulePkg/Universal/Acpi/AcpiPlatformDxe/AcpiPlatformDxe.inf 246 | MdeModulePkg/Universal/Acpi/BootGraphicsResourceTableDxe/BootGraphicsResourceTableDxe.inf 247 | EXYNOS7885Pkg/AcpiTables/AcpiTables.inf 248 | 249 | # 250 | # SMBIOS Support 251 | # 252 | EXYNOS7885Pkg/Drivers/SmbiosPlatformDxe/SmbiosPlatformDxe.inf 253 | MdeModulePkg/Universal/SmbiosDxe/SmbiosDxe.inf 254 | 255 | # 256 | # Bds 257 | # 258 | MdeModulePkg/Universal/PrintDxe/PrintDxe.inf 259 | MdeModulePkg/Universal/DevicePathDxe/DevicePathDxe.inf 260 | MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabaseDxe.inf { 261 | 262 | PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf 263 | } 264 | MdeModulePkg/Universal/DisplayEngineDxe/DisplayEngineDxe.inf 265 | MdeModulePkg/Universal/SetupBrowserDxe/SetupBrowserDxe.inf 266 | MdeModulePkg/Universal/DriverHealthManagerDxe/DriverHealthManagerDxe.inf 267 | MdeModulePkg/Universal/BdsDxe/BdsDxe.inf 268 | MdeModulePkg/Application/UiApp/UiApp.inf { 269 | 270 | NULL|MdeModulePkg/Library/DeviceManagerUiLib/DeviceManagerUiLib.inf 271 | NULL|MdeModulePkg/Library/BootManagerUiLib/BootManagerUiLib.inf 272 | NULL|MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenanceManagerUiLib.inf 273 | PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf 274 | } 275 | ShellPkg/Application/Shell/Shell.inf { 276 | 277 | ShellCommandLib|ShellPkg/Library/UefiShellCommandLib/UefiShellCommandLib.inf 278 | NULL|ShellPkg/Library/UefiShellLevel2CommandsLib/UefiShellLevel2CommandsLib.inf 279 | NULL|ShellPkg/Library/UefiShellLevel1CommandsLib/UefiShellLevel1CommandsLib.inf 280 | NULL|ShellPkg/Library/UefiShellLevel3CommandsLib/UefiShellLevel3CommandsLib.inf 281 | NULL|ShellPkg/Library/UefiShellDriver1CommandsLib/UefiShellDriver1CommandsLib.inf 282 | NULL|ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.inf 283 | NULL|ShellPkg/Library/UefiShellInstall1CommandsLib/UefiShellInstall1CommandsLib.inf 284 | NULL|ShellPkg/Library/UefiShellNetwork1CommandsLib/UefiShellNetwork1CommandsLib.inf 285 | NULL|ShellPkg/Library/UefiShellAcpiViewCommandLib/UefiShellAcpiViewCommandLib.inf 286 | HandleParsingLib|ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.inf 287 | PrintLib|MdePkg/Library/BasePrintLib/BasePrintLib.inf 288 | BcfgCommandLib|ShellPkg/Library/UefiShellBcfgCommandLib/UefiShellBcfgCommandLib.inf 289 | 290 | gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask|0xFF 291 | gEfiShellPkgTokenSpaceGuid.PcdShellLibAutoInitialize|FALSE 292 | gEfiMdePkgTokenSpaceGuid.PcdUefiLibMaxPrintBufferSize|8000 293 | } 294 | !ifdef $(INCLUDE_TFTP_COMMAND) 295 | ShellPkg/DynamicCommand/TftpDynamicCommand/TftpDynamicCommand.inf 296 | !endif #$(INCLUDE_TFTP_COMMAND) 297 | --------------------------------------------------------------------------------