• Stars
    star
    364
  • Rank 116,389 (Top 3 %)
  • Language
    C
  • License
    BSD 2-Clause "Sim...
  • Created over 6 years ago
  • Updated 9 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Non-EOL (yes!) AArch64 UEFI firmware for Lumia 950 / Lumia 950 XL

EDK2 UEFI Implementation for Lumia 950 and Lumia 950 XL

For users

You can download the latest UEFI build by clicking the Azure Pipelines icon below. Click Artifacts button in Azure Pipelines, then download UEFI.elf in ELF directory.

Build Status (Visual Studio Team Services)

What's this?

This package demonstrates an AArch64 UEFI implementation for hacked Lumia 950 and Lumia 950 XL. Currently it is able to boot Windows 10 ARM64 as well as various Linux distros. See notes below for more details. Please be aware that MSM8992 devices have limited support.

Hapanero support has been dropped as of 2020/11. Hapanero users are expected to completely understand all hardware, firmware and software implementation details, thus there's no point to keep an untested target floating in this project. For existing Hapanero owners, please build and fix this firmware by yourself (use 950 XL configuration as the blueprint), but no PR regarding Hapanero will be accepted.

Support Status

Applicable to all supported targets unless noted.

  • Low-speed I/O: I2C, SPI, GPIO, SPMI and Pinmux (TLMM).
  • Power Management: PMIC and Resource Power Manager (RPM).
  • High-speed I/O for firmware and HLOS: eMMC (SDR50 in firmware, HS200/HS400 in OS) and microSD (be aware that a few cards are unsupported), PCI Express (Firmware-configured, HLOS Only, x2 Lane)
  • Peripherals: Touchscreen (QUP I2C), side-band buttons (TLMM GPIO and PMIC GPIO) and Lattice UC120 (iCE5LP2K) FPGA configuration
  • Display FrameBuffer depends on stock Qualcomm UEFI for boostrapping, MDP is not fully implemented.

What can you do?

I am too busy to write an average-user tutorial. So, if you are interested in, you are welcome to contribute to an easy instruction for all Lumia 950 (XL) users.

Or you can buy me a coffee: PayPal.

Build

If you are familiar with EDK2, you don't need to use my build script.

  • Checkout a copy of EDK2. We are currently tracking the master branch. At least commit 1b6b4a83e1d85e48837068dfe409f5557b50d71d works without further modification.
  • Checkout this repository under EDK2's worktree.
  • Install ACPI tools from your package manager or ACPICA website.
  • Install uuid-dev and python (or equivalent package on your distribution).
  • Install Linaro AArch64 GCC toolchains, my build script uses gcc-linaro-7.5.0-2019.12. Then untar them. I place everything under /opt directory, so I have directories like /opt/gcc-linaro-7.5.0-2019.12-x86_64_aarch64-elf/bin. If you placed it somewhere else, modify build scripts. If you are macOS user, bootstrap the toolchain using ct-ng.
  • Run EDK2 BaseTools setup (make -C BaseTools).
  • Copy rundbbuild.sh in Tools directory to your EDK2 worktree root directory.
  • By default only MSM8994 target is built. To build all, set environment variable BUILDALL.
  • Start build: . rundbbuild.sh --950xl --development

WSL Build Notes

If you checked out the EDK2 repository under Windows and build it using WSL, you will have trouble locating BaseTools Python classes due to file case sensitive behavior changes in WSL. Run the following PowerShell script under EDK2 directory prior to build:

Get-ChildItem .\BaseTools\ -Directory -Recurse | Foreach-Object { fsutil.exe file setCaseSensitiveInfo $_.FullName }

You only need to run it once.

Run

Per UEFI specification, ARM32 UEFI cannot boot ARM64 binaries directly. A recent engineering change removed the dependency of Little Kernel. LK can still boot it, but the path is untested.

To run this UEFI build on Lumia 950 XL, the following procedure is required:

  • Check out Boot Shim. This Boot Manager Application implements a simple ELF loader for the kickstarter (LK) with Secure Monitor Call for EL1 transition. You will need branch msm8994-aa64.
  • Place UEFI.elf in the WP EFIESP root directory, copy Boot Shim EFI application to the EFIESP partition, create a new BCD entry for it.
  • Select this boot entry to enter UEFI.

To re-flash UEFI, simply place new UEFI.elf in WP EFIESP root directory.

TZ Implementation Notes

Qualcomm Snapdragon MSM8992/MSM8994 implements a subset of PSCI interface for multi-processor startup. However, required commands like PSCI_SYSTEM_OFF and PSCI_SYSTEM_RESET are not implemented. Hence we use PMIC to shutdown platform (there's a bug in RT that will be fixed) instead of PSCI. Additionally, 8992/8994 uses HVC call for PSCI commands instead of SMC call.

Linux Notes

The ACPI tables are copied from stock Windows Phone FFU, hence these device IDs are likely not be recognized by Linux.

To get started, starts with the device tree of Qualcomm MSM8994 MTP. The repository devicetree-rebasing with DT content from Android Linux Kernel is sufficient for DT development. To boot with device tree, add it in your GRUB configuration:

devicetree /lumia-950-xl.dtb
linux /vmlinuz ..... acpi=no

PSCI partially works in EL1. If you want to use PSCI for multi-processor startup, add the following code to your DT:

psci {
	compatible	= "arm,psci-0.2";
	method		= "hvc";
};

And use psci for core-enable method. If you are using EL2 startup, use spin-table with per_cpu_mailbox_addr + 0x8 as the release address.

For MSM8994, PCI Express Root Port 1 is firmware-initialized. Similarly, MSM8992 have PCI Express Root Port 0 initialized. Hence it is not necessary to supply qcom,pcie in device tree. Instead, supply a firmware-initialized PCI bus device pci-host-ecam-generic. ACPI MCFG table is supplied for your reference.

Note: interrupt is not configured in the example below (therefore ath10k will crash the system if loaded.)

pci@f8800000 {
	compatible = "pci-host-ecam-generic";
	device_type = "pci";
	#address-cells = <0x3>;
	#size-cells = <0x2>;
	bus-range = <0x0 0x1>;
	#interrupt-cells = <0x1>;

	reg = <0xf8800000 0x200000>;
	ranges = <0x02000000 0x0 0xf8a00000 0xf8a00000 0x0 0x600000>;

	status = "okay";
};

Acknowledgements

License

All code except drivers in GPLDriver directory are licensed under BSD 2-Clause. GPL Drivers are licensed under GPLv2 license.

More Repositories

1

WOA-Deployer-Rpi

WOA Deployer for Raspberry Pi
C#
965
star
2

WoA-Installer-Rpi

This repository was deprecated, use:
C#
850
star
3

WOA-Deployer-Lumia

Making your Lumias great again!
C#
477
star
4

SurfaceDuo-Guides

Guides for the Surface Duo
Python
271
star
5

Lumia-Drivers

Collection of driver binaries for Lumia devices
C#
184
star
6

mu_andromeda_platforms

Project Mu UEFI Firmware for Surface Duo Devices
C
156
star
7

SurfaceDuo-Drivers

Collection of driver binaries for Surface Duo devices
Roff
153
star
8

MSM8994-8992-NT-ARM64-Drivers

Desktop Windows (ARM64) driver collection for MSM8992/8994 SoCs.
136
star
9

guides

Guides relevant to WOA
108
star
10

WOA-Deployer

WOA Deployer
C#
90
star
11

woadialer

A dialer based on UWP and .NET for the WoA on Lumia Project.
C#
79
star
12

Qualcomm-Reference-Drivers

Reference Drivers for Select Qualcomm Reference Platforms found on Windows Update
56
star
13

Chat

Send text messages using your device builtin phone modem.
C#
38
star
14

img2ffu

Converts raw image (img) files into full flash update (FFU) files
C#
37
star
15

DriverUpdater

Utility to update drivers on Lumia 950 and Surface Duo family of devices
C#
30
star
16

LumiaUSBC

USB-C controller driver for the Nokia Lumia 950 and 950XL
C
26
star
17

AndroidDebugBridge

The Android Debug Bridge Protocol, implemented in C# / .NET
C#
25
star
18

LumiaWOA

The github site for LumiaWOA
HTML
25
star
19

WOA-Device-Manager

WOA Device Manager helps you install, update and manage Windows on your Android device.
C#
20
star
20

FastBoot

The FastBoot USB protocol, implemented in C# / .NET
C#
18
star
21

LumiaApp

The Windows Settings app for LumiaWOA
C#
13
star
22

UEFIReader

Tool to generate .inf payloads for use in various other UEFI projects out of an existing UEFI volume
C#
13
star
23

USBFunctionModeSwitcher

Switch USB port roles on phones running Windows Desktop
C++
12
star
24

SurfaceDuo-Releases

Released materials as part of the DuoWOA Project. Also contains release information and changelogs
11
star
25

reg2inf

Convert reg driver to an installable inf (beta) - For splitted BSP regs
C#
10
star
26

SurfaceDuo-XDE-Skin

Surface Duo Emulator Skin for Microsoft XDE Emulator
9
star
27

DisplayDockFlyout

A flyout for Microsoft HD-500 Display Dock
C#
9
star
28

FirmwareGen

Windows Desktop Firmware generation tool for Lumias. Builds Firmwares under 2 hours
C#
9
star
29

RKHReader

A tool to read the root key hash from most Qualcomm signed binaries/dsp firmwares/partitions (works on both last decade and modern day devices!)
C#
8
star
30

AdvancedInfo

Advanced Info application for LumiaWOA
C++
7
star
31

DuoWOA

TypeScript
6
star
32

GlanceScreen

Settings application for Glance Screen
C++
6
star
33

AeoBUtils

C#
5
star
34

PowerSupplyNotifier

Notifies the user when a power supply gets connected by playing a sound
C++
5
star
35

Community-Issues

A repository for hosting conversations and tracking issues related to anything about the project
5
star
36

ResignBSP

C#
5
star
37

SurfaceApp

The Windows Settings app for DuoWOA
C++
4
star
38

Ice5Lp2k

Driver for Lattice UC120 USB-C PD PHY Chip based on Lattice iCE5LP2K FPGA
C
4
star
39

Specifics-Cityman

Lumia 950 XL Specific Drivers
4
star
40

SurfaceDuoDualBootKernelImagePatcher

Utility to help patch kernel images with ease to support SurfaceDuoPkg Dual Boot / Untethered Boot method
C#
4
star
41

UnifiedFlashingPlatform

The Unified Flashing Platform Protocol, implemented in C# / .NET
C#
4
star
42

fsa4480

Driver for the ON Semi. FSA4480 USB-C Audio Analog Switch/DP AUX
C
3
star
43

Deployment-Scripts

Deployment scripts for use with WOA Deployer
3
star
44

SurfaceDuo2Pkg

ASL
3
star
45

SurfaceDuo-ACPI

Windows ACPI 5.0 Firmware for Surface Duo Devices
ASL
3
star
46

Support-Desktop-Drivers

Support drivers for NT Desktop
Batchfile
3
star
47

UserFirstLogonExperience

Work in progress UI for selecting one shell for the LumiaWOA project
C#
3
star
48

SurfaceDisplayConfiguratorService

Configures Display Topology and Settings on device first run.
C++
3
star
49

LumiaNull

Common nulled devices for Lumia devices
C
3
star
50

Andromeda-Sensors-Test-Client

Testing client for Andromeda Sensors (Fold, Flip, Posture...)
C++
3
star
51

RILServiceInit

Initializes a RIL on Windows systems
C
3
star
52

SurfaceMini-Stuff

A collection of random Surface Mini related things
ASL
3
star
53

Specifics-MMO-Drivers

MMO Specific drivers
Batchfile
2
star
54

DT2XmlPanelCmdConverter

An utility to convert Device Tree Panel Command sequences to Xml Command Sequences for Qualcomm Platforms
C#
2
star
55

SurfaceBattery

Fuel gauge drivers for Surface Duo
C
2
star
56

QCBSPRenamer

C#
2
star
57

SurfaceDuoBinaries

BitBake
2
star
58

WMRilShim

Shim for WMRil
C++
2
star
59

ColorProfile

Change the color profile of a Lumia display with windows native integration and night light support
C++
2
star
60

PhoneSvcPermissionUpdaterService

PhoneSvc Permission Updater Service
C++
2
star
61

SurfaceTouchPanelAlignment

C
2
star
62

SurfaceSOCPartitionFilter

C
2
star
63

SurfaceDuo-SensorSDK

2
star
64

TouchSettings

Settings application for the touch driver on Lumias
C++
1
star
65

SubExtInfUpdater

An utility to help update Qualcomm Subsystem Extension INFs with newer binaries or different binaries
C#
1
star
66

LumiaWoA.github.io

Site
1
star
67

Specifics-Talkman

Lumia 950 Specific Drivers
1
star
68

DataManagementSvc

Data Management Service (DataManagementSvc) - Enables data connection on multi sim devices
C
1
star
69

MobileBridge

Mobile Bridge Services & Tools so Lumias can be made great again! (on Desktop or WCOS)
C
1
star
70

Not-NPETSEC

Modem activation bootstrapper library for Nokia's APPerso
C++
1
star
71

VibrationSettings

Brings vibration settings for Windows ARM64 phone devices
C++
1
star
72

TouchPower

The Touch Power driver used by Lumias for gating P-States linked to the digitizer.
C
1
star
73

Tips

Tips application for the LumiaWOA project
C#
1
star
74

AutoRotate

Auto rotation tool for Phones
C++
1
star
75

NTrigConfigurationTools

C#
1
star
76

NTrig-Andromeda-Configurations

Repository holding the N-Trig Configuration Databases for the Surface Andromeda Family of devices
1
star
77

windows_kona_platforms

Platform drivers for Snapdragon 865 ("Kona") devices
1
star
78

windows_lahaina_platforms

Platform drivers for Snapdragon 888 ("Lahaina") devices
1
star
79

firmware_oem_surface_dual_screen_epsilon

Firmware files extracted from official OTA packages for Surface Duo (First Generation)
Roff
1
star
80

icaros_cam_esp_thermal

C
1
star
81

INFCleaner

Tool to help cleanup INF files
C#
1
star