Before porting, please make sure whether edk2-sdm845 supports your device, if it already exists, use it directly.
Supported devices - edk2-porting/edk2-sdm845
DO NOT EVER TRY TO PORT IT TO SONY AND GOOGLE DEVICES, YOUR UFS WILL BE WIPED CLEAN!!!
-
Make sure your device uses the Snapdragon 845 (sdm845) processor.
-
First, determine your device codename
(Such as: OnePlus 6T = fajita, Xiaomi MI 8 = dipper, this article uses fck845) -
Get the screen resolution of your device (eg: 1080x2248)
You can execute the following command on the device to get it, or use other methods.
cat /sys/class/drm/card0-DSI-1/modes
-
Get fdt on your device
Get the /sys/firmware/fdt file of your device
-
Prepare system environment
It is recommended to use Ubuntu 20.04. For details, please refer to: Dependencies - edk2-porting/edk2-sdm845 -
Clone the project and enter the directory
git clone https://hub.fastgit.org/edk2-porting/edk2-sdm845.git
Or
git clone https://github.com/edk2-porting/edk2-sdm845.git
Note: If you need to porting to a new device, do not use --depth=1 or download the zip directly to submit your changes -
Put your fdt into device_specific and rename it to CodeName.dtb
-
Copy and edit .dsc file
Copy sdm845pkg/devices/generic.dsc as sdm845pkg/devices/CodeName.dsc and fill in your screen resolution
gsdm845PkgTokenSpaceGuid.PcdMipiFrameBufferWidth|Screen width in px
gsdm845PkgTokenSpaceGuid.PcdMipiFrameBufferHeight|Screen height in px
-
Add the device codename in the compilation script build.sh (note that the indentation of the file is Tab character (\t))
-
Add the device code in the CI script
.github/workflows/main.yml
(note that the indentation of the file is a space character)
-
Add the device to README.md and README.zh.md
Please align the device codename with the previous line, it is recommended to use a monospaced font
-
Try to compile
./build.sh -d CodeName
Reference Building - edk2-porting/edk2-sdm845
-
Try to boot
Turn the device to fastboot mode (aka bootloader), executefastboot boot boot-CodeName.img
And observe the device
Criteria for successful porting: you can see the Renegade-Project logo or enter the UEFI Shell -
Check your changes
Before commit, use git command to check your changes to make sure there are no extra files or characters
Executegit status
to check to ensure that there are no redundant files
Executegit diff
to check to ensure that there are no unnecessary modifications
-
Commit your changes
git add .
git commit
add new device Device Name (Device CodeName)
-
Initiate a PullRequest to edk2-sdm845
You can send a pullrequest to edk2-porting/edk2-sdm845 to include your device support into edk2-sdm845
If you encounter difficulties or have some questions, you can ask questions in the Q&A area of the forum or join a group discussion Resources - edk2-porting/edk2-sdm845