edk2-sdm845 new device porting guide

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!!!

  1. Make sure your device uses the Snapdragon 845 (sdm845) processor.

  2. First, determine your device codename
    (Such as: OnePlus 6T = fajita, Xiaomi MI 8 = dipper, this article uses fck845)

  3. 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

  4. Get fdt on your device
    Get the /sys/firmware/fdt file of your device

  5. Prepare system environment
    It is recommended to use Ubuntu 20.04. For details, please refer to: Dependencies - edk2-porting/edk2-sdm845

  6. 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

  7. Put your fdt into device_specific and rename it to CodeName.dtb

  8. 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
  1. Add the device codename in the compilation script build.sh (note that the indentation of the file is Tab character (\t))

  2. Add the device code in the CI script .github/workflows/main.yml (note that the indentation of the file is a space character)

  3. 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
    add-to-readme-md
    add-to-readme-zh-md

  4. Try to compile
    ./build.sh -d CodeName
    Reference Building - edk2-porting/edk2-sdm845


  5. Try to boot
    Turn the device to fastboot mode (aka bootloader), execute fastboot boot boot-CodeName.img
    And observe the device
    Criteria for successful porting: you can see the Renegade-Project logo or enter the UEFI Shell

  6. Check your changes
    Before commit, use git command to check your changes to make sure there are no extra files or characters
    Execute git status to check to ensure that there are no redundant files


    Execute git diff to check to ensure that there are no unnecessary modifications

  7. Commit your changes
    git add .
    git commit
    add new device Device Name (Device CodeName)
    add-and-commit


  8. 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

2 Likes