Difference between revisions of "Quartz64 Development"

From PINE64
Jump to navigation Jump to search
(Create Quartz64 Development page)
 
(Update PineNote and EBC status)
 
(154 intermediate revisions by 8 users not shown)
Line 1: Line 1:
Under Construction!
+
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.
 +
 
 +
== Overview ==
 +
 
 +
=== Upstreaming Status ===
 +
 
 +
{| class="wikitable plainrowheaders" border="1"
 +
! scope="col" | Function
 +
! scope="col" colspan="2" | Status
 +
! scope="col" | Component
 +
! scope="col" | Notes
 +
! scope="col" | Applies To
 +
|-
 +
! scope="row" rowspan="2" | Video Output
 +
| colspan="2" style="background:LightYellow; text-align:center;"|In review<sup>[https://patchwork.kernel.org/project/linux-rockchip/list/?series=598177]</sup>
 +
| <code>rockchipdrm/VOP2</code>
 +
|
 +
|-
 +
| colspan="2" style="background:#F99; text-align:center;"|Needs porting
 +
| <code>rockchip-edpphy-naneng</code>
 +
| Downstream: [https://gitlab.com/pine64-org/quartz-bsp/rockchip-linux/-/blob/quartz64/drivers/phy/rockchip/phy-rockchip-naneng-edp.c] Coordinate any porting with Rockchip first
 +
|-
 +
! scope="row" | 3D Acceleration
 +
| style="background:LightYellow; text-align:center;"|In review<sup>[https://patchwork.kernel.org/project/linux-rockchip/list/?series=586441]</sup>
 +
| style="background:PaleGreen; text-align:center;"|Upstream Mesa
 +
| <code>panfrost</code>
 +
| GPU is basically already supported in mainline but needs some device tree changes for this particular SoC
 +
|-
 +
! scope="row" | Video Decode
 +
| style="background:LightYellow; text-align:center;"|Linux Staging
 +
| style="background:#F99; text-align:center;"|Not in ffmpeg<sup>[https://patchwork.ffmpeg.org/project/ffmpeg/list/?series=2898]</sup>
 +
| <code>hantro-vpu</code>, using <code>v4l2-requests</code>
 +
| Necessary device tree changes [https://patchwork.kernel.org/project/linux-rockchip/patch/20210719225806.26680-1-ezequiel@collabora.com/ in review]
 +
|-
 +
! scope="row" rowspan="3" | Audio
 +
| colspan="2"  style="background:PaleGreen; text-align:center;"|Linux Mainline
 +
| <code>rockchip-i2s-tdm</code>
 +
| As of 5.16<sup>[https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=43b058698f723e3c2087af7069c0da082a3ecbe1]</sup>
 +
|-
 +
| colspan="2" style="background:PaleGreen; text-align:center;"|Linux Mainline
 +
| <code>rockchip-spdif</code>
 +
| As of 5.15<sup>[https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=dac825b6a6bdca41347e25f07354ad94fdc97445]</sup>
 +
|-
 +
| colspan="2"  style="background:PaleGreen; text-align:center;"|Linux Mainline
 +
| <code>rk817-codec</code>
 +
| As of 5.14<sup>[https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=0d6a04da9b25b9a7cf2cac5f5079e3296d3bee0f]</sup>.
 +
| Quartz64 Model A/B
 +
|-
 +
! scope="row" | u-boot
 +
| colspan="2"  style="background:#F99; text-align:center;"|Waiting on ATF sources
 +
|
 +
|
 +
|-
 +
! scope="row" rowspan="4" | Device Tree
 +
| colspan="2"  style="background:PaleGreen; text-align:center;"|Linux Mainline
 +
| Quartz64 Model A
 +
| As of 5.16<sup>[https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=b33a22a1e7c4248608e533fc4fa524258b3fae84]</sup>
 +
| Quartz64 Model A
 +
|-
 +
| colspan="2" style="background:#F99; text-align:center;"|Needs submitting
 +
| Quartz64 Model B
 +
|
 +
| Quartz64 Model B
 +
|-
 +
| colspan="2" style="background:#F99; text-align:center;"|Needs submitting
 +
| SOQuartz
 +
|
 +
| SOQuartz
 +
|-
 +
| colspan="2" style="background:#F99; text-align:center;"|Needs submitting
 +
| PineNote
 +
| [[User:smaeul]] wrote a device tree using mainline bindings [https://github.com/smaeul/linux/commits/rk356x-ebc-dev here].
 +
|-
 +
! scope="row" rowspan="2"| Gigabit Ethernet
 +
| colspan="2"  style="background:PaleGreen; text-align:center;"|Linux Mainline
 +
| <code>rk3566-gmac</code>
 +
| As of 5.14<sup>[https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=3bb3d6b1c1957e88bfc5e77a4557f7e6ba761fe3]</sup>
 +
|-
 +
| colspan="2"  style="background:PaleGreen; text-align:center;"|Linux Mainline
 +
| <code>yt8511-phy</code>
 +
| As of 5.14<sup>[https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=48e8c6f1612b3d2dccaea2285231def830cc5b8e]</sup>
 +
|-
 +
! scope="row" | IOMMU
 +
| colspan="2"  style="background:PaleGreen; text-align:center;"|Linux Mainline
 +
| <code>rockchip-iommu</code>
 +
| As of 5.14<sup>[https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=c55356c534aa651ccc3053ef2d5d8d810adacf5f]</sup>
 +
|-
 +
! scope="row" | GPIO
 +
| colspan="2"  style="background:PaleGreen; text-align:center;"|Linux Mainline
 +
| <code>gpio-rockchip</code>
 +
| As of 5.15<sup>[https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=936ee2675eee1faca0dcdfa79165c7990422e0fc]</sup>
 +
|-
 +
! scope="row" | pinctrl
 +
| colspan="2"  style="background:PaleGreen; text-align:center;"|Linux Mainline
 +
|
 +
|
 +
|-
 +
! scope="row" | Thermal Regulation
 +
| colspan="2"  style="background:PaleGreen; text-align:center;"|Linux Mainline
 +
| <code>rockchip-thermal</code>
 +
| As of 5.14<sup>[https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=4b14c055a6f644cbeb1156ba24647e92fe51ec69]</sup>
 +
|-
 +
! scope="row" | PCIe
 +
| colspan="2"  style="background:PaleGreen; text-align:center;"|Linux Mainline
 +
| <code>pcie-dw-rockchip</code>
 +
| As of 5.15<sup>[https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=0e898eb8df4e34c7b129452444eb7cef68a11f43]</sup>
 +
|-
 +
! scope="row" | Power Management
 +
| colspan="2"  style="background:PaleGreen; text-align:center;"|Linux Mainline
 +
| <code>rockchip-pm-domains</code>
 +
| As of 5.14<sup>[https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=1782c87b44a0b1a527f01a6a184677c58ccbf9c7]</sup>
 +
|-
 +
! scope="row" | Voltage Control
 +
| colspan="2"  style="background:PaleGreen; text-align:center;"|Linux Mainline
 +
| <code>rk3568-pmu-io-voltage-domain</code>
 +
| As of 5.15<sup>[https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=28b05a64e47cbceebb8a5f3f643033148d5c06c3]</sup>
 +
|-
 +
! scope="row" | SPI
 +
| colspan="2"  style="background:PaleGreen; text-align:center;"|Linux Mainline
 +
| <code>spi-rockchip</code>
 +
| As of 5.14<sup>[https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=d74d99229f4d48f42d674f7a8a1137179efd67ac]</sup>. Necessary device tree changes [https://patchwork.kernel.org/project/linux-rockchip/list/?series=586691 in review].
 +
|-
 +
! scope="row" | Battery
 +
| colspan="2" style="background:LightYellow; text-align:center;"|In review<sup>[https://patchwork.kernel.org/project/linux-rockchip/list/?series=536233]</sup>
 +
| <code>rk817-charger</code>
 +
| In the BSP tree this is handled by [https://gitlab.com/pine64-org/quartz-bsp/rockchip-linux/-/blob/quartz64/drivers/power/supply/rk817_battery.c rk817_battery.c] and [https://gitlab.com/pine64-org/quartz-bsp/rockchip-linux/-/blob/quartz64/drivers/power/supply/rk817_charger.c rk817_charger.c].
 +
| Quartz64 Model A
 +
|-
 +
! scope="row" | Microphone
 +
| colspan="2" style="background:PaleGreen; text-align:center;"|Linux Mainline
 +
| <code>rockchip-saradc</code>
 +
| As of 5.15<sup>[https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=7786da3b5ae167c17f35e22ba35e06006338c2f6]</sup>. Headphone jack mic seems to connect to <code>SARADC_VIN2_HP_HOOK</code>, so I'm pretty sure that the dtsi and driver changes are needed for that mic to work
 +
|-
 +
! scope="row" | USB 2.0
 +
| colspan="2" style="background:LightYellow; text-align:center;"|linux-next<sup>[https://git.kernel.org/pub/scm/linux/kernel/git/phy/linux-phy.git/commit/?h=next&id=42b559727a45d79c811f493515eb9b7e56016421]</sup>
 +
| <code>rockchip-usb2phy</code>
 +
|
 +
|-
 +
! scope="row" | e-Ink
 +
| colspan="2" style="background:#F99; text-align:center;"|Needs submitting
 +
| <code>rockchip-ebc</code>
 +
| A DRM driver is available [https://github.com/smaeul/linux/commits/rk356x-ebc-dev here]; also see [[RK3566 EBC Reverse-Engineering]]
 +
|-
 +
! scope="row" | Combo PHY
 +
| colspan="2" style="background:LightYellow; text-align:center;"|In review<sup>[https://patchwork.kernel.org/project/linux-rockchip/list/?series=601993]</sup>
 +
| <code>naneng-combphy</code>
 +
|
 +
|-
 +
! scope="row" | RGA
 +
| colspan="2" style="background:#F99; text-align:center;"|Needs fixing
 +
| <code>rockchip-rga</code>
 +
| [[User:CounterPillow]] experimentally enabled it<sup>[https://gist.github.com/CounterPillow/6bea809f15ada7ddd3a3d7a4994fdc4e]</sup> in the device tree and ran gstreamer's v4l2convert through it to test, resulting in a completely garbled output.
 +
|-
 +
! scope="row" | Fan Controller
 +
| colspan="2" style="background:#F99; text-align:center;"|Needs porting
 +
| <code>emc2301</code>
 +
| Previous attempts at mainlining: [http://lkml.iu.edu/hypermail/linux/kernel/1306.1/02473.html] and [https://lore.kernel.org/all/20200928104326.40386-1-biwen.li@oss.nxp.com/]. Latest iteration: [https://gitlab.traverse.com.au/ls1088firmware/traverse-sensors/-/commit/1cdec49171ebafcf32b347e7701224144de8620b]
 +
| SOQuartz Blade
 +
|-
 +
! scope="row" | CIF (CSI Camera)
 +
| colspan="2" style="background:#F99; text-align:center;"|Needs porting
 +
| <code>video_rkcif</code>
 +
| Downstream: [https://gitlab.com/pine64-org/quartz-bsp/rockchip-linux/-/tree/quartz64/drivers/media/platform/rockchip/cif]
 +
|
 +
|}
 +
 
 +
== 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.
 +
 
 +
=== Working ===
 +
 
 +
* 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 &mdash; works, user needs to modify device tree to add devices
 +
* I<sup>2</sup>C &mdash; works, user needs to modify device tree to add devices
 +
 
 +
=== Partially Working ===
 +
 
 +
* PCI-Express Controller &mdash; 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) &mdash; AP6256 working, BL602 needs some work to make it flash firmware
 +
* [https://developer.arm.com/architectures/system-architectures/system-components/arm-generic-interrupt-controller GIC] &mdash; needs errata published by Rockchip to get upstream to add device-specific workarounds<sup>[https://lore.kernel.org/linux-rockchip/CAMdYzYrQ5f-mv_VmTq_CRf9tR=j3mwRpKHNLmPFgCF9whsGFRw@mail.gmail.com/]</sup>
 +
* Video Output &mdash; only at 1920x1080p60 and nothing else, very buggy and rough around more than just the edges
 +
 
 +
=== Confirmed Broken ===
 +
 
 +
* USB 3.0 &mdash; 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 &mdash; needs EBC driver
 +
* Microphone Input
 +
* CSI &mdash; needs CIF driver
 +
 
 +
== TODO ==
 +
 
 +
=== ebc-dev Reverse Engineering and Development ===
 +
 
 +
The [https://gitlab.com/pine64-org/quartz-bsp/linux-next/-/tree/rk356x-ebc-dev 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 <code>rk3568.dtsi</code> refactoring into <code>rk356x.dtsi</code>/<code>rk3568.dtsi</code>/<code>rk3566.dtsi</code> that the kernel did, probably just port the kernel dtsi files for this
 +
* Bring the kernel's Quartz64 DTS into the tree
 +
* Write a <code>quartz64-rk3566_defconfig</code> based on <code>evb-rk3568_defconfig</code>
 +
 
 +
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 ====
 +
* Downstream Rockchip U-Boot repository with Quartz64 specific patches: https://gitlab.com/pgwipeout/u-boot-rockchip/-/tree/quartz64
 +
* Mainline Rockchip custodian U-Boot repository: https://source.denx.de/u-boot/custodians/u-boot-rockchip
 +
* U-Boot Mailing List: https://lists.denx.de/listinfo/u-boot
 +
 
 +
== Linux Kernel Config Options ==
 +
 
 +
* <code>CONFIG_SND_SOC_ROCKCHIP_I2S_TDM</code>
 +
** for Analog and (in the future) HDMI audio
 +
* <code>CONFIG_SND_SOC_RK817</code>
 +
** for Analog audio on the Model A
 +
* <code>CONFIG_STMMAC_ETH</code>
 +
** Ethernet
 +
* <code>CONFIG_DWMAC_ROCKCHIP</code>
 +
** Ethernet
 +
* <code>CONFIG_MOTORCOMM_PHY</code>
 +
** 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 <code>motorcomm</code> module if you set it to m.
 +
* <code>CONFIG_MMC_DW</code>
 +
** MMC/SD
 +
* <code>CONFIG_MMC_DW_ROCKCHIP</code>
 +
** MMC/SD
 +
* <code>CONFIG_PCIE_ROCKCHIP_DW_HOST</code>
 +
** PCIe
 +
* <code>CONFIG_PHY_ROCKCHIP_NANENG_COMBO_PHY</code>
 +
** PHY for PCIe/SATA/USB3, not yet upstream
 +
* <code>CONFIG_DRM_PANFROST</code>
 +
** GPU
 +
* <code>CONFIG_SND_SOC_ROCKCHIP_SPDIF</code>
 +
** SPDIF audio
 +
* <code>CONFIG_ROCKCHIP_DW_HDMI</code>
 +
** HDMI PHY
 +
* <code>CONFIG_ROCKCHIP_VOP2</code>
 +
** Video output, not yet upstream
 +
* <code>CONFIG_ARCH_ROCKCHIP</code>
 +
** General SoC support
 +
* <code>CONFIG_ROCKCHIP_PHY</code>
 +
** General SoC support
 +
* <code>CONFIG_PHY_ROCKCHIP_INNO_USB2</code>
 +
** USB 2
 +
* <code>CONFIG_RTC_DRV_RK808</code>
 +
** Real-time Clock
 +
* <code>CONFIG_COMMON_CLK_RK808</code>
 +
** Real-time Clock
 +
* <code>CONFIG_MFD_RK808</code>
 +
** Various things relating to the RK817 chip
 +
* <code>CONFIG_REGULATOR_RK808</code>
 +
** Voltage regulators
 +
* <code>CONFIG_ROCKCHIP_PM_DOMAINS</code>
 +
** Power management domains
 +
* <code>CONFIG_GPIO_ROCKCHIP</code>
 +
** GPIO support
 +
* <code>CONFIG_PINCTRL_ROCKCHIP</code>
 +
** GPIO and general SoC support
 +
* <code>CONFIG_PWM_ROCKCHIP</code>
 +
** PWM support
 +
* <code>CONFIG_ROCKCHIP_IOMMU</code>
 +
** IOMMU support
 +
* <code>CONFIG_ROCKCHIP_MBOX</code>
 +
** Mailbox support (for communication with MCU)
 +
* <code>CONFIG_ROCKCHIP_SARADC</code>
 +
** Analog-to-digital conversion support, for e.g. microphones
 +
* <code>CONFIG_ROCKCHIP_THERMAL</code>
 +
** Temperature sensor and thermal throttling support
 +
* <code>CONFIG_SPI_ROCKCHIP</code>
 +
** SPI support
 +
* <code>CONFIG_VIDEO_HANTRO_ROCKCHIP</code>
 +
** Hardware video decoder support
 +
* <code>CONFIG_ROCKCHIP_IODOMAIN</code>
 +
** General SoC support so your I/O pins have the right voltage
 +
* <code>CONFIG_COMMON_CLK_ROCKCHIP</code>
 +
** Common clock support
 +
 
 +
== Resources ==
 +
=== Repositories ===
 +
 
 +
* pgwipeout's kernel tree
 +
** https://gitlab.com/pgwipeout/linux-next/-/tree/quartz64-v5.15-rc1
 +
* BSP based development effort for SPL/U-Boot and Linux
 +
** https://gitlab.com/pine64-org/quartz-bsp
 +
* Image CI pipeline aimed at developers
 +
** https://gitlab.com/pgwipeout/quartz64_ci/
 +
* Rockchip U-Boot
 +
** https://github.com/rockchip-linux/u-boot
 +
* Downstream rockchip-linux kernel tree
 +
** https://gitlab.com/pine64-org/quartz-bsp/rockchip-linux
 +
* Tianocore EDK II port for UEFI on Quartz64
 +
** https://github.com/jaredmcneill/quartz64_uefi
 +
* Mainline U-Boot Port by pgwipeout
 +
** https://gitlab.com/pgwipeout/u-boot-quartz64
 +
 
 +
=== Other ===
 +
 
 +
* Rockchip-SoC Patchwork Page
 +
** https://patchwork.kernel.org/project/linux-rockchip/list/
 +
* Rockchip Kernel Mailing List Archive
 +
** https://lore.kernel.org/linux-rockchip/
 +
 
 +
== Board/SoC Documentation ==
 +
=== Booting ===
 +
==== 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 [https://gitlab.com/pine64-org/quartz-bsp/u-boot/-/commit/12d102b86813378af08b086f3b9c13ed8010754c commit message]:
 +
* Make a partition named <code>uboot</code> as partition number 1 at 8 MiB to 16 MiB
 +
* <code>dd if=idblock.bin of=/dev/''<mmc/sd>'' seek=64</code>
 +
* <code>dd if=uboot.img of=/dev/''<mmc/sd>''1</code>
 +
 
 +
==== BSP Image Layout ====
 +
 
 +
[[Category:Quartz64]][[Category:Rockchip RK3566]]

Latest revision as of 04:46, 8 January 2022

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.

Overview

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
Needs submitting PineNote User:smaeul wrote a device tree using mainline bindings here.
Gigabit Ethernet Linux Mainline rk3566-gmac As of 5.14[9]
Linux Mainline yt8511-phy As of 5.14[10]
IOMMU Linux Mainline rockchip-iommu As of 5.14[11]
GPIO Linux Mainline gpio-rockchip As of 5.15[12]
pinctrl Linux Mainline
Thermal Regulation Linux Mainline rockchip-thermal As of 5.14[13]
PCIe Linux Mainline pcie-dw-rockchip As of 5.15[14]
Power Management Linux Mainline rockchip-pm-domains As of 5.14[15]
Voltage Control Linux Mainline rk3568-pmu-io-voltage-domain As of 5.15[16]
SPI Linux Mainline spi-rockchip As of 5.14[17]. Necessary device tree changes in review.
Battery In review[18] 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[19]. 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-next[20] rockchip-usb2phy
e-Ink Needs submitting rockchip-ebc A DRM driver is available here; also see RK3566 EBC Reverse-Engineering
Combo PHY In review[21] naneng-combphy
RGA Needs fixing rockchip-rga User:CounterPillow experimentally enabled it[22] 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: [23] and [24]. Latest iteration: [25] SOQuartz Blade
CIF (CSI Camera) Needs porting video_rkcif Downstream: [26]

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.

Working

  • 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[27]
  • 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

TODO

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

  • CONFIG_SND_SOC_ROCKCHIP_I2S_TDM
    • for Analog and (in the future) HDMI audio
  • CONFIG_SND_SOC_RK817
    • for Analog audio on the Model A
  • CONFIG_STMMAC_ETH
    • Ethernet
  • CONFIG_DWMAC_ROCKCHIP
    • Ethernet
  • CONFIG_MOTORCOMM_PHY
    • 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.
  • CONFIG_MMC_DW
    • MMC/SD
  • CONFIG_MMC_DW_ROCKCHIP
    • MMC/SD
  • CONFIG_PCIE_ROCKCHIP_DW_HOST
    • PCIe
  • CONFIG_PHY_ROCKCHIP_NANENG_COMBO_PHY
    • PHY for PCIe/SATA/USB3, not yet upstream
  • CONFIG_DRM_PANFROST
    • GPU
  • CONFIG_SND_SOC_ROCKCHIP_SPDIF
    • SPDIF audio
  • CONFIG_ROCKCHIP_DW_HDMI
    • HDMI PHY
  • CONFIG_ROCKCHIP_VOP2
    • Video output, not yet upstream
  • CONFIG_ARCH_ROCKCHIP
    • General SoC support
  • CONFIG_ROCKCHIP_PHY
    • General SoC support
  • CONFIG_PHY_ROCKCHIP_INNO_USB2
    • USB 2
  • CONFIG_RTC_DRV_RK808
    • Real-time Clock
  • CONFIG_COMMON_CLK_RK808
    • Real-time Clock
  • CONFIG_MFD_RK808
    • Various things relating to the RK817 chip
  • CONFIG_REGULATOR_RK808
    • Voltage regulators
  • CONFIG_ROCKCHIP_PM_DOMAINS
    • Power management domains
  • CONFIG_GPIO_ROCKCHIP
    • GPIO support
  • CONFIG_PINCTRL_ROCKCHIP
    • GPIO and general SoC support
  • CONFIG_PWM_ROCKCHIP
    • PWM support
  • CONFIG_ROCKCHIP_IOMMU
    • IOMMU support
  • CONFIG_ROCKCHIP_MBOX
    • Mailbox support (for communication with MCU)
  • CONFIG_ROCKCHIP_SARADC
    • Analog-to-digital conversion support, for e.g. microphones
  • CONFIG_ROCKCHIP_THERMAL
    • Temperature sensor and thermal throttling support
  • CONFIG_SPI_ROCKCHIP
    • SPI support
  • CONFIG_VIDEO_HANTRO_ROCKCHIP
    • Hardware video decoder support
  • CONFIG_ROCKCHIP_IODOMAIN
    • General SoC support so your I/O pins have the right voltage
  • CONFIG_COMMON_CLK_ROCKCHIP
    • Common clock support

Resources

Repositories

Other

Board/SoC Documentation

Booting

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