Quartz64 Development

From PINE64
Revision as of 08:49, 30 January 2022 by Strit (talk | contribs) (→‎Upstreaming Status: Add PineNote device tree patchset)
Jump to navigation Jump to search

This page documents the current status of software support for the Quartz64 single-board computer, and provides links to resources to help prospective contributors get started. Information is kept current on a best-effort basis as various patches get accepted into the kernel.


Upstreaming Status

Function Status Component Notes Applies To
Video Output In review[1] rockchipdrm/VOP2
Needs porting rockchip-edpphy-naneng Downstream: [2] Coordinate any porting with Rockchip first
3D Acceleration In review[3] Upstream Mesa panfrost GPU is basically already supported in mainline but needs some device tree changes for this particular SoC
Video Decode Linux Staging Not in ffmpeg[4] hantro-vpu, using v4l2-requests Necessary device tree changes in review
Audio Linux Mainline rockchip-i2s-tdm As of 5.16[5]
Linux Mainline rockchip-spdif As of 5.15[6]
Linux Mainline rk817-codec As of 5.14[7]. Quartz64 Model A/B
u-boot Waiting on ATF sources
Device Tree Linux Mainline Quartz64 Model A As of 5.16[8] Quartz64 Model A
Needs submitting Quartz64 Model B Quartz64 Model B
Needs submitting SOQuartz SOQuartz
In review[9]<[/sub> PineNote User:smaeul wrote a device tree using mainline bindings here.
Gigabit Ethernet Linux Mainline rk3566-gmac As of 5.14[10]
Linux Mainline yt8511-phy As of 5.14[11]
IOMMU Linux Mainline rockchip-iommu As of 5.14[12]
GPIO Linux Mainline gpio-rockchip As of 5.15[13]
pinctrl Linux Mainline
Thermal Regulation Linux Mainline rockchip-thermal As of 5.14[14]
PCIe Linux Mainline pcie-dw-rockchip As of 5.15[15]
Power Management Linux Mainline rockchip-pm-domains As of 5.14[16]
Voltage Control Linux Mainline rk3568-pmu-io-voltage-domain As of 5.15[17]
SPI Linux Mainline spi-rockchip As of 5.14[18]. Necessary device tree changes in review.
Battery In review[19] rk817-charger In the BSP tree this is handled by rk817_battery.c and rk817_charger.c. Quartz64 Model A
Microphone Linux Mainline rockchip-saradc As of 5.15[20]. Headphone jack mic seems to connect to SARADC_VIN2_HP_HOOK, so I'm pretty sure that the dtsi and driver changes are needed for that mic to work
USB 2.0 Linux Mainline rockchip-usb2phy As of 5.17[21]
e-Ink Needs submitting rockchip-ebc A DRM driver is available here; also see RK3566 EBC Reverse-Engineering
Combo PHY In review[22] naneng-combphy
RGA Needs fixing rockchip-rga User:CounterPillow experimentally enabled it[23] in the device tree and ran gstreamer's v4l2convert through it to test, resulting in a completely garbled output.
Fan Controller Needs porting emc2301 Previous attempts at mainlining: [24] and [25]. Latest iteration: [26] SOQuartz Blade
CIF (CSI Camera) Needs porting video_rkcif Downstream: [27]

Current Status

The following sections give an overview over the current status of different parts of the board. Some parts are waiting on a driver to be written or ported, others only need various adjustments.

According to pgwipeout, I/O device performance is within expected ranges now.


  • eMMC
  • SDMMC0 (SD cards)
  • GMAC (Gigabit Ethernet)
  • USB 2.0
  • SATA 2
  • SATA 3
  • UART
    • UART 0 (Pi-bus)
    • UART 1 (Bluetooth)
    • UART 2 (Pi-bus, debug)
  • Video Decode
    • VP8
  • Battery
  • GPU
  • Audio
    • Analog audio works
    • SPDIF works
    • HDMI works
  • SPI — works, user needs to modify device tree to add devices
  • I2C — works, user needs to modify device tree to add devices

Partially Working

  • PCI-Express Controller — everything but devices that need cache coherency (e.g. dGPUs) should work
    • User:CounterPillow noticed some weirdness with NVMe devices disconnecting during heavy write operations, likely down due to power draw on one of the rails as the same sustained bandwidth could be achieved with a different PCIe device with no issue.
  • SDMMC1 (Wi-Fi) — AP6256 working, BL602 needs some work to make it flash firmware
  • GIC — needs errata published by Rockchip to get upstream to add device-specific workarounds[28]
  • Video Output — only at 1920x1080p60 and nothing else, very buggy and rough around more than just the edges

Confirmed Broken

  • USB 3.0 — only works with very short cables and depends on the device. This is due to a hardware design issue relating to the coupling capacitors needed for SATA, which shares the same lines as USB 3.0.
    • Hardware design changes have been suggested to engineers, it's in their hands now.
  • Module autoloading for the Ethernet PHY. The Motorcomm PHY does not have a vendor ID written into the appropriate hardware block, so there is no canonical way to identify the device.

Needs Testing

  • E-Paper — needs EBC driver
  • Microphone Input
  • CSI — needs CIF driver


ebc-dev Reverse Engineering and Development

The driver for the eInk panel needs to both be reverse engineered and then rewritten as C. In its current form, it is mostly an assembly dump produced by gcc with debug symbols. See RK3566 EBC Reverse-Engineering for details.

Investigate MCU

The RK3566 comes with an integrated RISC-V microcontroller (MCU). It communicates with the A55 host through the Mailbox system driven by the rockchip-mailbox driver. Since this MCU would be quite useful for things such as low power standby mode, investigating how it can be turned on and have firmware flashed to it should greatly enhance the power saving features of the PineNote.

Mainline U-Boot Work

Currently, mainline U-Boot does not have support for the RK3566 SoC used on the Quartz64. That's why we currently use the "downstream" Rockchip U-Boot, which is based on an old version of U-Boot and contains vendor specific patches that have not undergone the same level of code review as they'd have done had they been submitted upstream.

While the lack of ATF sources means that using mainline U-Boot would still require the use of Rockchip provided binaries for the firmware, the mainline U-Boot works needs to be done eventually anyway, and even with Rockchip blobs, a more modern version of U-Boot will be much nicer to use.

Someone needs to get on the task of investigating what minimally needs to be ported to get the board booting with mainline U-Boot, port those changes, and submit them for review.

Things that need to be done

This list is non-exhaustive as we don't exactly know how much is missing

  • Do the rk3568.dtsi refactoring into rk356x.dtsi/rk3568.dtsi/rk3566.dtsi that the kernel did, probably just port the kernel dtsi files for this
  • Bring the kernel's Quartz64 DTS into the tree
  • Write a quartz64-rk3566_defconfig based on evb-rk3568_defconfig

Stretch Goals:

  • Port the Naneng Combo PHY driver to u-boot so we can SATA, USB 3 and PCIe boot
  • Look into SPI
  • Port the Motorcomm PHY driver to u-boot for networking?
  • Port a basic VOP2 driver to get a framebuffer from u-boot

List of Useful Resources for this Task

Linux Kernel Config Options

    • for Analog and (in the future) HDMI audio
    • for Analog audio on the Model A
    • Ethernet
    • Ethernet
    • Ethernet, set this one to Y, m won't work out of the box as module autoloading does not work for this specific PHY (the vendor ID is zeroed out), alternatively tell users in board-specific setup instructions to force loading the motorcomm module if you set it to m.
    • MMC/SD
    • MMC/SD
    • PCIe
    • PHY for PCIe/SATA/USB3, not yet upstream
    • GPU
    • SPDIF audio
    • HDMI PHY
    • Video output, not yet upstream
    • General SoC support
    • General SoC support
    • USB 2
    • Real-time Clock
    • Real-time Clock
    • Various things relating to the RK817 chip
    • Voltage regulators
    • Power management domains
    • GPIO support
    • GPIO and general SoC support
    • PWM support
    • IOMMU support
    • Mailbox support (for communication with MCU)
    • Analog-to-digital conversion support, for e.g. microphones
    • Temperature sensor and thermal throttling support
    • SPI support
    • Hardware video decoder support
    • General SoC support so your I/O pins have the right voltage
    • Common clock support




Board/SoC Documentation


Boot Order

The RK3566 boot ROM will search for a valid ID BLOCK in the following order on the support boot media:

  • SPI NOR flash
  • SPI NAND flash
  • SD-Card
  • eMMC

... if this fails, the boot ROM will initialize the USB0 port and wait for a connection from the Rockchip flash/boot tools.

Bootloader Flashing

As per pgwipeout's commit message:

  • Make a partition named uboot as partition number 1 at 8 MiB to 16 MiB
  • dd if=idblock.bin of=/dev/<mmc/sd> seek=64
  • dd if=uboot.img of=/dev/<mmc/sd>1

BSP Image Layout