GithubHelp home page GithubHelp logo

nikescar / edk2-rk3588 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from edk2-porting/edk2-rk3588

0.0 0.0 0.0 78.94 MB

EDK2 UEFI firmware for Rockchip RK3588 platforms

Shell 0.21% C++ 1.25% Python 0.02% C 95.71% Assembly 0.08% NASL 0.39% ASL 2.33% Dockerfile 0.02%

edk2-rk3588's Introduction

EDK2 UEFI firmware for Rockchip RK3588 platforms

This repository contains an UEFI firmware implementation based on EDK2 for various RK3588 boards.

Supported platforms

Supported peripherals

Applicable to all platforms unless otherwise noted.

Device Status Notes
USB 3 / 2.0 / 1.1 ๐ŸŸข Working Host-mode only
PCIe 3.0 (RK3588) ๐ŸŸก Partial
PCIe 2.1 ๐Ÿ”ด Not working
SATA ๐ŸŸข Working
SD/eMMC ๐ŸŸข Working
HDMI output ๐ŸŸข Working Single display with mode limited at 1080p 60 Hz
USB-C DP output ๐Ÿ”ด Not working
eDP output ๐Ÿ”ด Not working
DSI ๐Ÿ”ด Not working
GMAC Ethernet ๐Ÿ”ด Not working
UART ๐ŸŸข Working
GPIO ๐ŸŸก Partial No pin function support
I2C ๐ŸŸข Working
SPI ๐ŸŸข Working
SARADC ๐Ÿ”ด Not working
PWM โšช Untested
SPI NOR Flash ๐ŸŸข Working
Voltage regulators (RK806, RK860) ๐ŸŸข Working
FUSB302 USB-C PD negotiation ๐Ÿ”ด Not working Only present on a few boards (ROCK 5B, Edge2)

Supported OSes

OS Version Tested/supported hardware Notes
Windows 10 (1904x), 11 Status
NetBSD 10 HDMI GOP, USB, SATA, UART
VMware ESXi Arm Fling 1.12 HDMI GOP, USB Need to hide PCIe 3 in ACPI

Installation & usage

Check out the latest release at: https://github.com/edk2-porting/edk2-rk35xx/releases, including install instructions.

Configuration settings

The UEFI configuration settings can be viewed and changed using both the UI configuration menu (under Device Manager -> Rockchip Platform Configuration), as well as the UEFI Shell. To configure using the UEFI Shell, use setvar command to read/write the UEFI variables with GUID = 10f41c33-a468-42cd-85ee-7043213f73a3.

The syntax to read a setting is:

setvar <NAME> -guid 10f41c33-a468-42cd-85ee-7043213f73a3

The syntax to write a setting is:

setvar <NAME> -guid 10f41c33-a468-42cd-85ee-7043213f73a3 -bs -rt -nv =<VALUE>

VALUE must be in hexadecimal.

For string-type settings, the syntax to write is:

setvar <NAME> -guid 10f41c33-a468-42cd-85ee-7043213f73a3 -bs -rt -nv =L"<VALUE>" =0x0000

CPU Performance

Cluster clocks / voltages

Variable NAME VALUE
CPUx Clock Preset CpuPerf_CPUxClusterClockPreset Boot default = 0x00000000
Min = 0x00000001
Max = 0x00000002
Custom = 0x00000003
CPUx Custom Clock Preset (MHz) CpuPerf_CPUxClusterClockCustom Hex numeric option, 4-bytes
See below.
CPUx Voltage Mode CpuPerf_CPUxClusterVoltageMode Auto = 0x00000000 (default)
Custom = 0x00000001
CPUx Custom Voltage (uV) CpuPerf_CPUxClusterVoltageCustom Hex numeric value, 4-bytes
See below.

x can be :

  • L for LITTLE cluster
  • B01 for big cluster #0
  • B23 for big cluster #1

CpuPerf_CPUxClusterClockCustom can have one of the following values:

  • All clusters: 408000000, 600000000, 816000000, 1008000000, 1200000000, 1416000000, 1608000000, 1800000000
  • Big cluster additional clocks: 2016000000, 2208000000, 2256000000, 2304000000, 2352000000, 2400000000

CpuPerf_CPUxClusterVoltageCustom is the cluster voltage in microvolts. Min: 500000, Max: 1500000. Default value depends on cluster type.

PCIe/SATA/USB Combo PIPE PHY

Variable NAME VALUE
PHY #0 Mode ComboPhy0Mode Unconnected = 0x00000000
PCIe = 0x00000001
SATA = 0x00000002
PHY #1 Mode ComboPhy1Mode Unconnected = 0x00000000
PCIe = 0x00000001
SATA = 0x00000002
PHY #2 Mode ComboPhy2Mode Unconnected = 0x00000000
PCIe = 0x00000001
SATA = 0x00000002
USB3 = 0x00000003

Default values and supported options depend on the platform. Check documentation and schematics for more details on PHY wiring.

Examples:

  • To read the 'CPUL Clock Preset' setting :
setvar CpuPerf_CPULClusterClockPreset -guid 10f41c33-a468-42cd-85ee-7043213f73a3
  • To change the 'CPUL Clock Preset' setting to 'Maximum' :
setvar CpuPerf_CPULClusterClockPreset -guid 10f41c33-a468-42cd-85ee-7043213f73a3 -bs -rt -nv =0x00000002

Building

The firmware can only be built on Linux currently. For Windows use WSL.

  1. Install required packages:

    For Ubuntu/Debian:

    sudo apt install git gcc g++ build-essential gcc-aarch64-linux-gnu iasl python3-pyelftools device-tree-compiler

    For Arch Linux:

    sudo pacman -Syu
    sudo pacman -S git base-devel gcc dtc aarch64-linux-gnu-binutils aarch64-linux-gnu-gcc aarch64-linux-gnu-glibc python python-pyelftools iasl --needed
  2. Clone the repository:

    git clone https://github.com/edk2-porting/edk2-rk35xx.git --recursive
    cd edk2-rk35xx
  3. Build UEFI (ROCK 5B for example, check list of platform configs):

    ./build.sh --device rock-5b --release Release # (or Debug)

Notes

ACPI

ACPI support is limited, with only boot critical devices being currently exposed. It has been tested with Windows, NetBSD and VMware ESXi.

Flash layout

Address Size Desc File
0x00000000 0x00004400 GPT Table rk3588_spi_nor_gpt.img
0x00008000 IDBlock idblock.bin
0x00088000 IDBlock idblock.bin
0x00100000 0x00500000 BL33_AP_UEFI FV ${DEVICE}_EFI.itb

Memory Map

Address Size Desc File
0x00040000 ATF bl31_0x00040000.bin
0x000f0000 ATF bl31_0x000f0000.bin
0x00200000 0x00500000 UEFI FV BL33_AP_UEFI.Fv
0x007C0000 0x00010000 NV_VARIABLE_STORE
0x007D0000 0x00010000 NV_FTW_WORKING
0x007E0000 0x00010000 NV_FTW_SPARE
0x08400000 OP-TEE bl32.bin
0xff100000 ATF (PMU_MEM) bl31_0xff100000.bin

Licenses

The UEFI code and produced FD binary are licensed under the current EDK2 license, which is BSD-2-Clause-Patent.

The license of the blobs in the misc/rkbin/ directory is to be determined. Most of them are built from open-source projects such as U-Boot, Arm Trusted Firmware and OP-TEE.

Community

Credits & alternatives

This firmware is based on Rockchip's initial efforts at https://gitlab.com/rk3588_linux/rk/uefi-monorepo.

There's also minimal support for RK356X (likely broken in our repo with no plans of reviving), but there's a much better implementation made by @jaredmcneill at https://github.com/jaredmcneill/quartz64_uefi, from which we also reused some code.

edk2-rk3588's People

Contributors

amazingfate avatar danct12 avatar googulator avatar initdc avatar mariobalanica avatar mollysophia avatar nikescar avatar prokn1fe avatar strongtz avatar willzenzou avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.