https://wiki.pine64.org/api.php?action=feedcontributions&user=Tom&feedformat=atomPINE64 - User contributions [en]2024-03-28T09:55:29ZUser contributionsMediaWiki 1.37.1https://wiki.pine64.org/index.php?title=ROCKPro64&diff=21146ROCKPro642023-11-17T17:11:46Z<p>Tom: /* Troubleshooting */ Add "PCIe probe failures on Linux kernel boot" and LKML link</p>
<hr />
<div>[[File:ROCKPro64v21FRONT.jpg|400px|thumb|right|The ROCKPro64]]<br />
<br />
The '''ROCKPro64''' is the most powerful single-board computer released by PINE64. It is powered by a Rockchip RK3399 hexa-core (dual ARM Cortex A72 and quad ARM Cortex A53) 64-bit processor with a Mali T-860 quad-core GPU. The key features include a PCI Express (PCIe) x4 open-ended slot, the use of LPDDR4 DRAM, and industry-standard heatsink mounting holes.<br />
<br />
The ROCKPro64 is equipped with 2 or 4&nbsp;GB of LPDDR4 system memory, and 128&nbsp;Mb of SPI boot flash. There is also an optional eMMC module (up to 128&nbsp;GB) and microSD slot for booting. The board is equipped with 1x USB 3.0 Type-C host port with DP 1.2, 1x USB 3.0 Type-A host port, 2x USB 2.0 host port, Gigabit Ethernet, PI-2 GPIO bus, MiPi DSI interface, eDP interface, touch panel interface, stereo MiPi CSI interface, as well as many other device interfaces such as UART, SPI, I<sup>2</sup>C, for makers to integrate with sensors and other peripherals. Many different operating systems (OSes) are freely available from the open-source community, such as Linux (Ubuntu, Debian, Arch), BSD and Android.<br />
<br />
== Getting Started ==<br />
<br />
The article [[ROCKPro64 Getting Started]] gives important information to get the board up and running.<br />
<br />
== Software releases ==<br />
<br />
In the [[ROCKPro64 Software Releases]] page, you will find a complete list of currently supported Operating System images that work with the ROCKPro64, as well as other related software. The Software Release page has links to download the images as well as high level instructions to load each image.<br />
<br />
Please see the [[Getting started]] page for detailed discussion of what you need (prerequisites) as well as instructions if the high level instructions are insufficient.<br />
<br />
== Board Layout ==<br />
[[Image:ROCKPro64v21REAR.jpg|thumb|right|A hi-res picture of v2.1 rear.]]<br />
[[Image:FLIR 20220619 125451 686.jpg|thumb|right|A thermal image of v2.1 front (upside-down).]]<br />
<br />
<br />
[[File:ROCKPro64_annotated.jpg|500px|An annotated ROCKPro64]]<br />
<br />
=== Main Chips ===<br />
* RK3399 system-on-chip (1)<br />
* LPDDR4 SDRAM 1 (18)<br />
* LPDDR4 SDRAM 2 (3)<br />
* SPI NOR flash memory (17)<br />
* RK808 power management (near 19)<br />
* RTL8211 ethernet transceiver (near 25)<br />
* ES8316 Sound Codec (on rear of board)<br />
* The heatsink mounting holes around the RK3399 are 59 mm apart<br />
<br />
=== Switches ===<br />
<br />
The Power button (11, SW3): is the same as on your mobile phone - press and release after about 1 second to power on. Press and hold for about 3 seconds to power off.<br />
<br />
The Reset button (10, SW901): performs a reset.<br />
<br />
The Recover button (28, SW900): used to enter maskrom mode.<br />
<br />
=== Connectors, Sockets and Headers ===<br />
<br />
{| class="wikitable sortable" style="line-height: 1.4;"<br />
|- style="font-size: .9em;"<br />
! Diagram !! Schematic<br>designator !! Silkscreen<br>label !! Number<br>of pins !! Description<br />
|-<br />
| style="text-align: center;" | 2 || U39 || PI-2-bus || style="text-align: center;" | 40 || Pi-2 bus <br />
|-<br />
| style="text-align: center;" | 4 || J8 || +FAN- || style="text-align: center;" | 2 || PWM controlled fan header<br />
|-<br />
| style="text-align: center;" | 5 || J10 || SPDIF || style="text-align: center;" | 3 || SPDIF header<br />
|- <br />
| style="text-align: center;" | 6 || U6 || +RTC- || style="text-align: center;" | 2 || RTC battery backup header<br />
|-<br />
| style="text-align: center;" | 7 || U31 || Wifi-BT || style="text-align: center;" | 16 || SDIO WIFI/BT module-MIMO 2<br />
|-<br />
| style="text-align: center;" | 8 || USB3 || || style="text-align: center;" | 9 || USB-3 and USB Type C<br />
|-<br />
| style="text-align: center;" | 9 || USB1 || || style="text-align: center;" | 2×4 || Dual USB-2<br />
|-<br />
| style="text-align: center;" | 12 || IR1 || IR || style="text-align: center;" | 3 || infrared receiver socket <br />
|-<br />
| style="text-align: center;" | 13 || J16 || Headphone+mic || style="text-align: center;" | 4 || Headphone + mic 3.5mm jack<br />
|-<br />
| style="text-align: center;" | - || CON16 || GND PWR RST GND || style="text-align: center;" | 4 || Power & reset, unpopulated<br>header near Headphone jack<br />
|-<br />
| style="text-align: center;" | 14 || U29 || EMMC || style="text-align: center;" | 34 || eMMC connector<br />(Note: Some datasheets indicate a low<br />supported number of mating cycles.)<br />
|-<br />
| style="text-align: center;" | 14* || J13 || || style="text-align: center;" | 13 || TF-card, a.k.a. microSD<br>(* under 14 on the bottom side)<br />
|-<br />
| style="text-align: center;" | 15 || U30 || || style="text-align: center;" | 14 || SDIO WIFI/BT module-MIMO 1<br />
|-<br />
| style="text-align: center;" | 16 || SW4 || || style="text-align: center;" | 2 || Jumper to [[#Disable eMMC]]<br />
|-<br />
| style="text-align: center;" | 19 || J15 || PCI || style="text-align: center;" | 64 || PCI-express X4 socket<br />
|-<br />
| style="text-align: center;" | 20 || J21 || DSI || style="text-align: center;" | 30 || DSI<br />
|-<br />
| style="text-align: center;" | 21 || J22 || EDP || style="text-align: center;" | 30 || LCD EDP<br />
|-<br />
| style="text-align: center;" | 22 || CON1 || TP || style="text-align: center;" | 6 || touch panel connector<br />
|-<br />
| style="text-align: center;" | 23 || CON15 || || style="text-align: center;" | 4 || DC out for SATA disk cable<br>(direct connect from DC-IN)<br />
|-<br />
| style="text-align: center;" | 24 || J11 || DC-IN || style="text-align: center;" | 2 || Power input, positive tip;<br>12V/3A (minimum) recommended<br />
|-<br />
| style="text-align: center;" | 25 || U32 || || style="text-align: center;" | 8 || 8P8C (often referred to as 'RJ45')<br />
|-<br />
| style="text-align: center;" | 26 || J14 || || style="text-align: center;" | 19 || HDMI<br />
|-<br />
| style="text-align: center;" | 27 || J17 || MIPI CAM || style="text-align: center;" | 32 || MIPI-1<br />
|-<br />
| style="text-align: center;" | 29 || J19 || MIPI CAM || style="text-align: center;" | 32 || MIPI-2<br />
|-<br />
| style="text-align: center;" | 30 || J18 || CIF || style="text-align: center;" | 26 || CIF<br />
|}<br />
<br />
=== LEDs ===<br />
<br />
A green LED next to the 12V input barrel connector will light as long as there is 12V applied to the connector. (Even if the RockPro64 is powered off.)<br />
<br />
A white LED behind the reset button will light as long as the RockPro64 is running (it comes on a few seconds after power on, when control is passed to the operating system.)<br />
<br />
A red LED behind the reset button is DIY - it is lit for example if the board is in OTG mode with an Ayufan image, or if an Android image is in standby mode.<br />
<br />
Yellow and green LEDs on the LAN socket behave in a standard way.<br />
<br />
=== Jumpers ===<br />
They are used for boot device selection, as described in the following section.<br />
<br />
==== Disable eMMC ====<br />
<br />
There is an unlabelled (on the PCB silk-screen) 2-pin jumper (16) between the eMMC socket (14) and the SPI chip (17). It is designated as SW4 on the [[#Board Information, Schematics and Certifications | schematic diagram]]. The default condition is OPEN (no jumper). It is useful for controlling the boot as follows:<br />
<br />
Default boot device (with no SPI software) is eMMC, then SDcard. If both the eMMC and the SDcard contain bootable images then the eMMC can be disabled by installing the jumper. This completely removes the eMMC from the resulting OS. If you wish the eMMC to be visible in the booted OS the jumper should be removed 2 seconds after applying power (and before the white LED comes on).<br />
<br />
The possible combinations are summarised in the table below.<br />
<br />
* 1 = present<br />
* 0 = not present<br />
<br />
{| class="wikitable sortable" style="text-align: center;"<br />
! µSD !! eMMC !! SW4 !! boot from<br />
|-<br />
| 0 || 0 || 0 || unsupported<br />
|-<br />
| 0 || 0 || 1 || unsupported<br />
|-<br />
| 0 || 1 || 0 || eMMC<br />
|-<br />
| 0 || 1 || 1 || unsupported<br />
|-<br />
| 1 || 0 || 0 || SDCard<br />
|-<br />
| 1 || 0 || 1 || SDCard<br />
|-<br />
| 1 || 1 || 0 || eMMC<br />
|-<br />
| 1 || 1 || 1 || SDCard<br />
|}<br />
<br />
==== Disable SPI (while booting) ====<br />
There is a second possibility to jumper your ROCKPro64: If you mess-up your SPI and are unable to boot, jumpering pins 23 (CLK) and 25 pin (GND) on the PI-2-bus header will disable the SPI as a boot device. (This was taken from the IRC logs, 09 August 2018 @ 17:23) You have to remove the jumper 2 seconds after having started your RP64 (before the white LED turns ON) otherwise the SPI will be missing and you won't be able to flash it.<br />
Ayufan images contain (at the moment) only one script for the SPI and the RP64, it's "rockpro64_reset_spi_flash". Other SPI scripts are dedicated to the R64 (as it is written on the name) and it will mess-up your RP64 SPI if you use them.<br />
<br />
== Hardware Compatibility ==<br />
<br />
The hardware compatibility list can be found under [[ROCKPro64 Hardware compatibility]].<br />
<br />
== Board Features ==<br />
<br />
This section outlines the most important characteristics of the board and its components.<br />
<br />
=== SoC and Memory Specification ===<br />
* Based on Rockchip RK3399<br />
[[File:Rockchip_RK3399.png|right]]<br />
<br />
==== CPU Architecture ====<br />
<br />
* [https://developer.arm.com/products/processors/cortex-a/cortex-a72 Dual-core Cortex-A72 up to 2.0GHz CPU]<br />
* [https://developer.arm.com/products/processors/cortex-a/cortex-a53 Quad-core Cortex-A53 up to 1.5GHz CPU]<br />
* big.LITTLE architecture: Dual Cortex-A72 + Quad Cortex-A53, 64-bit CPU<br />
* Cortex-A72:<br />
** 1-4x Symmetrical Multiprocessing (SMP) within a single processor cluster, and multiple coherent SMP processor clusters through AMBA 5 CHI or AMBA 4 ACE technology<br />
** AArch64 for 64-bit support and new architectural features<br />
** L1 cache 48KB Icache and 32KB Dcache for each A72 <br />
** L2 cache 1024KB for big cluster <br />
** DSP & SIMD extensions<br />
** VFPv4 floating point<br />
** Hardware virtualization support<br />
* Cortex-A53:<br />
** L1 cache 32KB Icache and 32KB Dcache for each A53<br />
** L2 cache 512KB for little cluster <br />
* Full implementation of the ARM architecture v8-A instruction set<br />
* ARM Neon Advanced SIMD (single instruction, multiple data) support for accelerated media and signal processing computation<br />
* ARMv8 Cryptography Extensions<br />
* In-order pipeline with symmetric dual-issue of most instructions<br />
* Include VFP v3 hardware to support single and double-precision operations<br />
* TrustZone technology support<br />
* Full CoreSight debug solution<br />
* One isolated voltage domain to support DVFS<br />
<br />
==== GPU Architecture ====<br />
<br />
* [https://developer.arm.com/products/graphics-and-multimedia/mali-gpus/mali-t860-and-mali-t880-gpus ARM Mali-T860MP4 Quad-core GPU]<br />
* The highest performance GPUs built on Arm Mali’s famous Midgard architecture, the Mali-T860 GPU is designed for complex graphics use cases and provides stunning visuals for UHD content.<br />
* Frequency: 650MHz <br />
* Throughput: 1300Mtri/s, 10.4Gpix/s <br />
* OpenGL® ES 1.1, 1.2, 2.0, 3.1, 3.2, Vulkan 1.0*, OpenCL™ 1.1, 1.2, DirectX® 11 FL11_1, RenderScript™.<br />
<br />
==== System Memory ====<br />
* LPDDR4 RAM Memory Variants: Dual Channels 2GB and 4GB.<br />
* Storage Memory: 128Mb built-in SPI Flash memory (as at August 2018 only support for USB boot).<br />
<br />
=== Display ===<br />
<br />
* Dual VOP: one supports resolutions up to 4096x2160 and [https://www.arm.com/why-arm/technologies/graphics-technologies/arm-frame-buffer-compression AFBC]; the other supports resolutions up to 2560x1600<br />
* Dual channel MIPI-DSI (4 lanes per channel)<br />
* eDP 1.3 (4 lanes with 10.8Gbps) to support displays, with PSR<br />
* Digital Video port up to 4Kp60<br />
* DisplayPort 1.2 (4 lanes, up to 4K 60Hz)<br />
* Supports Rec.2020 and conversion to Rec.709 <br />
<br />
=== Video ===<br />
<br />
* Digital Video output up to 4K@60Hz<br />
* 4K HDR @ 30fps<br />
* H.264/AVC Base/Main/High/High10 profile @ level 5.1; up to 4Kx2K @ 60fps<br />
* H.265/HEVC Main/Main10 profile @ level 5.1 High-tier; up to 4Kx2K @ 60fps<br />
* VP9, up to 4Kx2K @ 60fps<br />
* MPEG-1, ISO/IEC 11172-2, up to 1080P @ 60fps<br />
* MPEG-2, ISO/IEC 13818-2, SP@ML, MP@HL, up to 1080P @ 60fps<br />
* MPEG-4, ISO/IEC 14496-2, SP@L0-3, ASP@L0-5, up to 1080P @ 60fps<br />
* VC-1, SP@ML, MP@HL, AP@L0-3, up to 1080P @ 60fps<br />
* MVC is supported based on H.264 or H.265, up to 1080P @ 60fps<br />
<br />
=== Audio ===<br />
<br />
* 3.5mm Phone Jack<br />
* 3-pin S/PDIF header <br />
* Audio via Digital Video port<br />
<br />
=== Camera ===<br />
<br />
* Dual MIPI CSI,dual ISP, maximum input resolution of 13M pixels <br />
<br />
=== Network ===<br />
<br />
* 10/100/1000Mbps Ethernet - Capable of pushing 941 MBit/s in iperf3<br />
* Wi-Fi 802.11 ac/a/b/g/n with Bluetooth 4.01 (old version with 2x2) / Bluetooth 5 (new version with 1x1) (optional)<br />
<br />
=== Storage ===<br />
<br />
* microSD - bootable, supports SDHC and SDXC<br />
* eMMC - bootable (optional eMMC module)<br />
* 1x USB 3.0 host port<br />
* 1x USB Type-C OTG port with alternate mode DP output <br />
* 2x USB 2.0 dedicated host port<br />
<br />
=== Expansion Ports ===<br />
<br />
* 2x20 pins "Pi2" GPIO header<br />
* PCI Express 2.1 x4 (four full-duplex lanes) open-ended port, [https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=712fa1777207 limited] to the Gen1 speed<br />
<br />
==== GPIO Pins ====<br />
<br />
{| class="wikitable plainrowheaders" border="1"<br />
! scope="col" style="width:20em;" | Assigned To<br />
! scope="col" | Pin Nr.<br />
! scope="col" | Pin Nr.<br />
! scope="col" style="width:20em;" | Assigned To<br />
|-<br />
| style="text-align:right;"| 3.3 V<br />
| style="text-align:center; background-color:black; color:gold; font-weight:bold;"| 1<br />
| style="text-align:center; background-color:black; color:gold; font-weight:bold;"| 2<br />
| style="text-align:left;"| 5 V<br />
|-<br />
| style="text-align:right;"| GPIO1_C4 (I2C8_SDA) <sup style="font-style:italic;color:green">a</sup><br />
| style="text-align:center; background-color:black; color:gold; font-weight:bold;"| 3<br />
| style="text-align:center; background-color:black; color:gold; font-weight:bold;"| 4<br />
| style="text-align:left;"| 5 V<br />
|-<br />
| style="text-align:right;"| GPIO1_C5 (I2C8_SCL) <sup style="font-style:italic;color:green">a</sup><br />
| style="text-align:center; background-color:black; color:gold; font-weight:bold;"| 5<br />
| style="text-align:center; background-color:black; color:gold; font-weight:bold;"| 6<br />
| style="text-align:left;"| GND<br />
|-<br />
| style="text-align:right;"| GPIO4_D0 (CPU_GPCLK)<br />
| style="text-align:center; background-color:black; color:gold; font-weight:bold;"| 7<br />
| style="text-align:center; background-color:black; color:gold; font-weight:bold;"| 8<br />
| style="text-align:left;"| GPIO4_C4 (UART2_TX)<br />
|-<br />
| style="text-align:right;"| GND<br />
| style="text-align:center; background-color:black; color:gold; font-weight:bold;"| 9<br />
| style="text-align:center; background-color:black; color:gold; font-weight:bold;"| 10<br />
| style="text-align:left;"| GPIO4_C3 (UART2_RX)<br />
|-<br />
| style="text-align:right;"| GPIO1_C6<br />
| style="text-align:center; background-color:black; color:gold; font-weight:bold;"| 11<br />
| style="text-align:center; background-color:black; color:gold; font-weight:bold;"| 12<br />
| style="text-align:left;"| GPIO3_D0 (I2S0_CLK)<br />
|-<br />
| style="text-align:right;"| GPIO1_C2<br />
| style="text-align:center; background-color:black; color:gold; font-weight:bold;"| 13<br />
| style="text-align:center; background-color:black; color:gold; font-weight:bold;"| 14<br />
| style="text-align:left;"| GND<br />
|-<br />
| style="text-align:right;"| GPIO1_A1<br />
| style="text-align:center; background-color:black; color:gold; font-weight:bold;"| 15<br />
| style="text-align:center; background-color:black; color:gold; font-weight:bold;"| 16<br />
| style="text-align:left;"| GPIO1_A4<br />
|-<br />
| style="text-align:right;"| 3.3 V<br />
| style="text-align:center; background-color:black; color:gold; font-weight:bold;"| 17<br />
| style="text-align:center; background-color:black; color:gold; font-weight:bold;"| 18<br />
| style="text-align:left;"| GPIO4_C5 [SPDIF]<br />
|-<br />
| style="text-align:right;"| [UART4_TX] GPIO1_B0 (SPI1_TXD)<br />
| style="text-align:center; background-color:black; color:gold; font-weight:bold;"| 19<br />
| style="text-align:center; background-color:black; color:gold; font-weight:bold;"| 20<br />
| style="text-align:left;"| GND<br />
|-<br />
| style="text-align:right;"| [UART4_RX] GPIO1_A7 (SPI1_RXD)<br />
| style="text-align:center; background-color:black; color:gold; font-weight:bold;"| 21<br />
| style="text-align:center; background-color:black; color:gold; font-weight:bold;"| 22<br />
| style="text-align:left;"| GPIO4_D1<br />
|-<br />
| style="text-align:right;"| GPIO1_B1 (SPI1_CLK)<br />
| style="text-align:center; background-color:black; color:gold; font-weight:bold;"| 23<br />
| style="text-align:center; background-color:black; color:gold; font-weight:bold;"| 24<br />
| style="text-align:left;"| GPIO1_B2 (SPI1_CSN0)<br />
|-<br />
| style="text-align:right;"| GND<br />
| style="text-align:center; background-color:black; color:gold; font-weight:bold;"| 25<br />
| style="text-align:center; background-color:black; color:gold; font-weight:bold;"| 26<br />
| style="text-align:left;"| GPIO1_B5<br />
|-<br />
| style="text-align:right;"| GPIO1_B3 (I2C4_SDA)<br />
| style="text-align:center; background-color:black; color:gold; font-weight:bold;"| 27<br />
| style="text-align:center; background-color:black; color:gold; font-weight:bold;"| 28<br />
| style="text-align:left;"| GPIO1_B4 (I2C4_SCL)<br />
|-<br />
| style="text-align:right;"| GPIO4_D3<br />
| style="text-align:center; background-color:black; color:gold; font-weight:bold;"| 29<br />
| style="text-align:center; background-color:black; color:gold; font-weight:bold;"| 30<br />
| style="text-align:left;"| GND<br />
|-<br />
| style="text-align:right;"| GPIO4_D4<br />
| style="text-align:center; background-color:black; color:gold; font-weight:bold;"| 31<br />
| style="text-align:center; background-color:black; color:gold; font-weight:bold;"| 32<br />
| style="text-align:left;"| GPIO3_D4 (I2S0_SDI1SDO3)<br />
|-<br />
| style="text-align:right;"| GPIO3_D5 (I2S0_SDI2SDO2)<br />
| style="text-align:center; background-color:black; color:gold; font-weight:bold;"| 33<br />
| style="text-align:center; background-color:black; color:gold; font-weight:bold;"| 34<br />
| style="text-align:left;"| GND<br />
|-<br />
| style="text-align:right;"| GPIO3_D2 (I2S0_LRCKTX)<br />
| style="text-align:center; background-color:black; color:gold; font-weight:bold;"| 35<br />
| style="text-align:center; background-color:black; color:gold; font-weight:bold;"| 36<br />
| style="text-align:left;"| GPIO3_D6 (I2S0_SDI3SDO1)<br />
|-<br />
| style="text-align:right;"| GPIO3_D1 (I2S0_LRCKRX)<br />
| style="text-align:center; background-color:black; color:gold; font-weight:bold;"| 37<br />
| style="text-align:center; background-color:black; color:gold; font-weight:bold;"| 38<br />
| style="text-align:left;"| GPIO3_D3 (I2S0_SDI0)<br />
|-<br />
| style="text-align:right;"| GND<br />
| style="text-align:center; background-color:black; color:gold; font-weight:bold;"| 39<br />
| style="text-align:center; background-color:black; color:gold; font-weight:bold;"| 40<br />
| style="text-align:left;"| GPIO3_D7 (I2S0_SDO0)<br />
|}<br />
<br />
===== Notes =====<br />
<br />
* '''a:''' pulled high to 3.3V through 2.2kOhm resistor<br />
<br />
===== Linux /dev/gpiochip Assignments =====<br />
<br />
{| class=wikitable style="max-width: 1000px; text-align: center;"<br />
|-<br />
! scope="row" | Pin Nr.<br />
| 3 || 5 || 7 || 8 || 10 || 11 || 12 || 13 || 15 || 16 || 18 || 19 || 21 || 22 || 23 || 24 || 26 || 27 || 28 || 29 || 31 || 32 || 33 || 35 || 36 || 37 || 38 || 40<br />
|- <br />
! scope="row" | Chip<br />
| 1 || 1 || 4 || 4 || 4 || 1 || 3 || 1 || 1 || 1 || 4 || 1 || 1 || 4 || 1 || 1 || 1 || 1 || 1 || 4 || 4 || 3 || 3 || 3 || 3 || 3 || 3 || 3<br />
|-<br />
! scope="row" | Line<br />
| 20 || 21 || 24 || 20 || 19 || 22 || 24 || 18 || 1 || 4 || 21 || 8 || 7 || 25 || 9 || 10 || 13 || 11 || 12 || 27 || 28 || 28 || 29 || 26 || 30 || 25 || 27 || 31<br />
|}<br />
<br />
On Linux, using the new <code>/dev/gpiochip</code> API, the <code>''n''</code> in <code>GPIO''n''_''XX''</code> appears to correlate to the number of the <code>/dev/gpiochip''n''</code>, and the <code>''XX''</code> to the definition <code>RK_P''XX''</code> of lines in <code>include/dt-bindings/pinctrl/rockchip.h</code> of the Linux kernel source. Having these named in the dts would be nice.<br />
<br />
You can use [https://git.kernel.org/pub/scm/libs/libgpiod/libgpiod.git/ libgpiod] to drive them, and test them with the included tools (<code>gpioinfo</code>, <code>gpioset</code>, ...)<br />
<br />
For example, <code>gpioset 4 25=1</code> (run as root) would turn pin 22 on. Do beware that poking the wrong GPIO pin can lock up your system.<br />
<br />
The conversion table at right is also available as a [https://gist.github.com/CounterPillow/fe066655bf2d929148fe6eb3f15b1dd5 C header file].<br />
<br />
=== Working Features ===<br />
<br />
{| class="wikitable sortable"<br />
! Feature/Option<br />
! Android<br />
! Android Version<br />
! Linux<br />
! Linux Version<br />
! Test/Verify Steps<br />
! Notes<br />
! Product Link<br />
|-<br />
| PINE64 LCD Touchscreen (Screen/Touch)<br />
| Yes/Yes<br />
| <br />
| No/No<br />
| <br />
| <br />
| Maybe [https://github.com/avafinger/pine64-touchscreen this] will help get this working?<br />
| [https://pine64.com/?product=7-lcd-touch-screen-panel 7-inch LCD Touch Screen Panel]<br />
|-<br />
| Wireless<br />
<small>ROCKPro64 2×2 MIMO Dual Band WiFi 802.11AC / Bluetooth 4.2 Module (old)<br />
ROCKPro64 1x1 Dual Band WiFi 802.11AC / Bluetooth 5.0 Module (new)</small><br />
| Yes/Yes<br />
| <br />
| No/Yes*<br />
| <br />
| For the "new" ROCKPro64 WIFI module: Verified with Manjaro ARM (kernel 6.2.5). A config file ("firmware file") is needed at <code>/lib/firmware/brcm/brcmfmac43455-sdio.txt</code>. See [[#Getting wifi working ("new" wifi module)]] for the file contents and details.<br />
| In 0.7.9 Ayufan linux releases this is deliberately disabled for stability reasons. On Manjaro ARM (kernel 6.2.5), WIFI seems to be stable with the firmware file. On a 5GHz network (802.11AC), it is possible to get about 120Mbps using the "new" ROCKPro64 WIFI module.<br />
| [https://store.pine64.org/product/rockpro64-1x1-dual-band-wifi-802-11acbluetooth-5-0-module ROCKPro64 1x1 Dual Band WiFi 802.11AC / Bluetooth 5.0 Module]<br />
|-<br />
| USB OTG<br />
| <br />
| <br />
| <br />
| <br />
| use this script: [https://github.com/ayufan-rock64/linux-package/blob/master/root-rockpro64/usr/local/sbin/rockpro64_enable_otg.sh rockpro64_enable_otg.sh], then configure ip on usb0: ifconfig usb0 169.169.222.222 and run iperf, you should likely see about 200-300MB/s<br />
| [[ROCKPro64#OTG_mode]]<br />
| <br />
|-<br />
| USB Mass Storage USB2/USB3<br />
| Yes/yes<br />
| <br />
| Yes/Yes<br />
| <br />
| <br />
| <br />
| <br />
|-<br />
| Dedicated Fan Power (pwm1)<br />
| <br />
| <br />
| Yes<br />
| <br />
| <br />
| You might want to use [https://github.com/tuxd3v/ats ATS].<br />
| <br />
|-<br />
| GPIO pins (raw or via RPI python scripts)<br />
| <br />
| <br />
| <br />
| <br />
| <br />
| Check out [https://forum.frank-mankel.org/topic/292/rockpro64-rp64-gpio/2 what Frank Mankel has done].<br />
| <br />
|-<br />
| MIPI CSI Camera 1 and 2<br />
| <br />
| <br />
| <br />
| <br />
| <br />
| <br />
| <br />
|-<br />
| eDP<br />
| <br />
| <br />
| <br />
| <br />
| <br />
| <br />
| <br />
|-<br />
| HDMI Audio<br />
| Yes<br />
| 7.1.2<br />
| Yes<br />
| 4.4.132-1083 - 4.4.138-1100<br />
| <br />
| Stopped working in 4.4.154.1105. Ayufan is looking into it. This is working in Manjaro ARM (kernel 6.2.5). Select the <code>Analog Output (Built-in Audio Stereo)</code> option in the audio output device selection window (either use <code>pavucontrol</code> or the volume button in the KDE desktop). Despite the slightly misleading name, audio does go through the HDMI port. See here for details: https://forum.manjaro.org/t/no-hdmi-audio-on-rockpro64/25595/2.<br />
| <br />
|-<br />
| 3.5mm Audio/Mic<br />
| <br />
| <br />
| <br />
| <br />
| <br />
| <br />
| <br />
|-<br />
| USB-C Host<br />
| <br />
| <br />
| <br />
| <br />
| <br />
| <br />
| <br />
|-<br />
| Display via USB-C<br />
| Yes<br />
| 7.x and 8.x<br />
| <br />
| <br />
| <br />
| eDP via USB-C per tillim. No sound on Android 7.x. Sound does work on Android 8.x<br />
| <br />
|-<br />
| ROCKPro64 PLAYBOX ENCLOSURE<br />
| N/A<br />
| <br />
| N/A<br />
| <br />
| N/A<br />
| Ventilation does not exist, thus requires manual changes to add venting. Case should be modified to account power adapter not being centered in cut holes. Opening the case once close without modifying it first is nearly impossible without special tools. Graphene heatsink is included and does well for Linux but not Android.<br />
| [https://pine64.com/?product=rockpro64-playbox-enclosure ROCKPro64 Playbox Enclosure]<br />
|-<br />
| ROCKPro64 30mm Tall Profile Heatsink<br />
| N/A<br />
| <br />
| N/A<br />
| <br />
| N/A<br />
| <br />
| [https://pine64.com/product/rockpro64-30mm-tall-profile-heatsink/ ROCKPro64 30&nbsp;mm Tall-Profile Heatsink]<br />
|-<br />
| ROCKPro64 20mm Mid Profile Heatsink<br />
| N/A<br />
| <br />
| N/A<br />
| <br />
| N/A<br />
| <br />
| [https://pine64.com/?product=rockpro64-20mm-mid-profile-heatsink ROCKPro64 20&nbsp;mm Mid-Profile Heatsink]<br />
|-<br />
| Fan For ROCKPro64 20mm Mid Profile Heatsink<br />
| N/A<br />
| <br />
| N/A<br />
| <br />
| N/A<br />
| You might want to use [https://github.com/tuxd3v/fanctl fanctl] to control the fan while keeping your CPU cool<br />
| [https://pine64.com/?product=fan-for-rockpro64-20mm-mid-profile-heatsink Fan For ROCKPro64 20&nbsp;mm Mid-Profile Heatsink]<br />
|-<br />
| HDMI output 4K@60Hz<br />
| <br />
| <br />
| <br />
| <br />
| <br />
| <br />
| <br />
|-<br />
| PCI Express 2.1<br />
| <br />
| <br />
| <br />
| <br />
| <br />
| The PCI Express interface of the RK3399 [https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=712fa1777207 is limited] to the Gen1 speed. As a result, some installed PCI Express devices may operate with degraded performance, such as M.2 SSDs that support fewer than four PCI Express lanes, installed using an adapter like [https://pine64.com/product/rockpro64-pci-e-x4-to-m-2-ngff-nvme-ssd-interface-card/ this one].<br />
| <br />
|-<br />
| Real Time Clock (RTC) battery backup<br />
| <br />
| <br />
| <br />
| <br />
| <br />
| <br />
| [https://pine64.com/product/rtc-backup-battery-holder-cr-2032/ RTC Backup Battery Holder CR2032]<br />
|-<br />
| Boot from USB/PXE<br />
| <br />
| <br />
| <br />
| <br />
| <br />
| <br />
| <br />
|}<br />
<br />
RockChip themselves have tables of supported features at 4.4 and mainline kernel versions [http://opensource.rock-chips.com/wiki_Status_Matrix in their wiki here].<br />
<br />
== Board Information, Schematics and Certifications ==<br />
* Board dimensions: 133&nbsp;mm&nbsp;x 80&nbsp;mm&nbsp;x 19&nbsp;mm<br />
* Power input: 12&nbsp;V, 3&nbsp;A or 5&nbsp;A, using 5.5&nbsp;mm (OD)&nbsp;/ 2.1&nbsp;mm (ID) type M barrel DC connector<br />
* [https://files.pine64.org/doc/rockpro64/rockpro64_v21-SCH.pdf ROCKPro64 Schematic v2.1 (Second Batch Production Release)]<br />
** [https://files.pine64.org/doc/rockpro64/RockPro64_v21_Boardoutline-top.dxf ROCKPro64 v2.1 Board Top Outline in AutoCad DXF format]<br />
** [https://files.pine64.org/doc/rockpro64/RockPro64_v21_Boardoutline-bottom.dxf ROCKPro64 v2.1 Board Bottom Outline in AutoCad DXF format]<br />
** [https://files.pine64.org/doc/rockpro64/RockPro64_v21_Boardoutline-top.pdf ROCKPro64 v2.1 Board Top Outline in PDF format]<br />
** [https://files.pine64.org/doc/rockpro64/RockPro64_v21_Boardoutline-bottom.pdf ROCKPro64 v2.1 Board Bottom Outline in PDF format]<br />
* [https://files.pine64.org/doc/rockpro64/rockpro64_v20-SCH.pdf ROCKPro64 Schematic v2.0 (Pilot Production Release)]<br />
** [http://files.pine64.org/doc/rockpro64/Rockpro64-ver2.0-topsilk_ref.pdf ROCKPro64 v2.0 Board Top Silkscreen in PDF format] (contains component labels)<br />
** [https://files.pine64.org/doc/rockpro64/ROCKPRo64%20Engineering%20Change%20Notice%2020180628RP01.pdf Engineering Change Notice for v2.0 to turn on 3.3V power on PCIe]<br />
* [https://files.pine64.org/doc/rockpro64/rockpro64_wifi_ap6359SA.pdf ROCKPro64 AP6359SA Wifi/BT Schematic]<br />
* [https://files.pine64.org/doc/rockpro64/Rockpro64%20Pi-2%20Connector%20ver0.2.png ROCKPro64 Pi-2 Pin assignment and definition]<br />
* [https://files.pine64.org/doc/rockpro64/RockPro-3D-model.zip ROCKPro64 3D model]<br />
<br />
Certifications:<br />
<br />
* Disclaimer: Please note that PINE64 SBC is not a "final" product and in general certification is not necessary. However, PINE64 still submit the SBC for FCC, CE, and ROHS certification and obtain the certificates to proof that SBC board is capable on passing the testing. Please note a final commercial product needs to performs its owns testing and obtains its owns certificates.<br />
* [https://files.pine64.org/doc/cert/ROCKPro64%20FCC%20SDOC%20Certificate.pdf ROCKPro64 FCC Certificate]<br />
* [https://files.pine64.org/doc/cert/ROCKPro64%20CE-EMC%20Certificate.pdf ROCKPro64 CE Certificate]<br />
* [https://files.pine64.org/doc/cert/ROCKPro64%20ROHS%20%20SEC180529404001E%20Report.pdf ROCKPro64 RoHS Report]<br />
<br />
== Datasheets for Components and Peripherals ==<br />
<br />
Rockchip RK3399 SoC information:<br />
<br />
* [https://www.rock-chips.com/a/en/products/RK33_Series/2016/0419/758.html Rockchip RK3399 SoC Brief]<br />
* [http://opensource.rock-chips.com/images/d/d7/Rockchip_RK3399_Datasheet_V2.1-20200323.pdf Rockchip RK3399 Datasheet V2.1]<br />
* [http://opensource.rock-chips.com/images/e/ee/Rockchip_RK3399TRM_V1.4_Part1-20170408.pdf Rockchip RK3399 Technical Reference Manual part 1]<br />
* [https://files.pine64.org/doc/datasheet/rockpro64/RK808%20datasheet%20V0.8.pdf Rockchip RK808 Datasheet V0.8]<br />
<br />
LPDDR4 (200 Balls) SDRAM:<br />
<br />
* [https://files.pine64.org/doc/datasheet/rockpro64/SM512M32Z01MD2BNP(200BALL).pdf Micron LPDDR4 Mobile LPDDR4 Datasheet]<br />
<br />
eMMC information:<br />
<br />
* [https://files.pine64.org/doc/rock64/PINE64_eMMC_Module_20170719.pdf PINE64 eMMC module schematic]<br />
* [https://files.pine64.org/doc/rock64/usb%20emmc%20module%20adapter%20v2.pdf PINE64 USB adapter for eMMC module V2 schematic]<br />
* [https://files.pine64.org/doc/rock64/USB%20adapter%20for%20eMMC%20module%20PCB.tar PINE64 USB adapter for eMMC module PCB in JPEG]<br />
* [https://files.pine64.org/doc/datasheet/pine64/E-00517%20FORESEE_eMMC_NCEMAM8B-16G%20SPEC.pdf 16GB Foresee eMMC Datasheet]<br />
* [https://files.pine64.org/doc/datasheet/pine64/SDINADF4-16-128GB-H%20data%20sheet%20v1.13.pdf 32GB/64GB/128GB SanDisk eMMC Datasheet]<br />
<br />
SPI NOR Flash information:<br />
<br />
* [https://files.pine64.org/doc/datasheet/pine64/w25q128jv%20spi%20revc%2011162016.pdf WinBond 128Mb SPI Flash Datasheet]<br />
* [https://files.pine64.org/doc/datasheet/pine64/GD25Q128C-Rev2.5.pdf GigaDevice 128Mb SPI Flash Datasheet]<br />
<br />
Heatsink related info:<br />
<br />
* [https://files.pine64.org/doc/datasheet/rockpro64/Rockpro%20Passive%20Heatsink%20Spec.jpg ROCKPro64 Passive Heatsink Dimension Drawing]<br />
* [https://files.pine64.org/doc/datasheet/rockpro64/LMS-TC150%20Silicon%20Thermal%20Pad.pdf Heatsink Thermal Pad Specification]<br />
<br />
Wireless related info:<br />
<br />
* AMPAK AP6256 11AC WiFi + Bluetooth5.0 Datasheet [https://files.pine64.org/doc/datasheet/rockpro64/AP6256%20datasheet_V1.3_12202017.pdf (v. 1.3)] [http://files.pine64.org/doc/datasheet/PinebookPro/AP6256%20datasheet_V1.7_12282018.pdf (v. 1.7)]<br />
<br />
Ethernet related info:<br />
<br />
* [https://files.pine64.org/doc/datasheet/rock64/RTL8211F-CG-Realtek.pdf Realtek RTL8211F 10/100/1000M Ethernet Transceiver Datasheet]<br />
<br />
Peripheral related info:<br />
<br />
* [https://files.pine64.org/doc/datasheet/rockpro64/ASM1061_Data%20Sheet_R1_8.pdf asmedia ASM1061 PCIe SATA 2.0 Datasheet]<br />
<br />
Remote control button mapping:<br />
<br />
* [https://files.pine64.org/doc/Pine%20A64%20Schematic/remote-wit-logo.jpg Official Remote Control for the PINE64 Button Mapping]<br />
<br />
Audio Codec (ES8316) (under board):<br />
<br />
* [http://everest-semi.com/pdf/ES8316%20PB.pdf Everest ES8316 Audio Codec]<br />
<br />
PWM controlled fan, SPDIF, and RTC Battery Backup headers:<br />
<br />
* [https://www.jst-mfg.com/product/pdf/eng/ePH.pdf JST-PH connector]<br />
<br />
== Useful Articles and Blog Posts ==<br />
<br />
If you want to dive in to the ecosystem, here's a short list of various articles and blog posts that can help you set up your soft- or hardware development environment.<br />
<br />
* [https://stikonas.eu/wordpress/2019/09/15/blobless-boot-with-rockpro64/ Blobless boot with RockPro64 by Andrius Štikonas]<br />
* [https://marcin.juszkiewicz.com.pl/2020/06/17/ebbr-on-rockpro64/ EBBR on RockPro64 by Marcin Juszkiewicz]<br />
* [[ROCKPro64 Device Tree Overlays on Mainline]]<br />
* [[ROCKPro64 Hardware Tweaks]]<br />
<br />
== The NAS Case for the ROCKPro64 ==<br />
<br />
[[file:NASCaseMain.png|thumb|right|Front View of the PINE64 NAS Case for the ROCKPro64]]<br />
<br />
Please [[NASCase|follow this this link]] for '''detailed instructions on how to assemble the ROCKPro64 NAS Case'''.<br />
<br />
The NAS Case instructions also contains detailed information about:<br />
*what the NAS Case ships with<br />
*What additional things you need to purchase for your NAS Case<br />
*What optional things you can consider purchasing for your NAS build<br />
*What OS Image we recommend you use for your NAS build<br />
*IO accessibility after installing the ROCKPro64 into the NAS Case<br />
*[https://files.pine64.org/doc/rockpro64/ROCKPro64%20NAS%20Case%20Exploded%20View%20Diagram.pdf NAS Case Exploded View]<br />
*[https://files.pine64.org/doc/rockpro64/NAS%20Case%20Drawing.dwg NAS Case Drawing]<br />
<br />
== 3D printable ITX mounting brackets ==<br />
<br />
[[file:ITX-Bracket-Mounted.jpg|300px|thumb|right|A Quartz64-A mounted in an ITX case using 3D printed brackets]]<br />
<br />
Allows mounting a ROCKPro64-A or Quartz64-A board inside a regular PC case that conforms to the ITX standard, using 3D printed brackets:<br />
<br />
* AMF/STL/STEP files plus the original FreeCAD file used to create the models [[File:RP64-A_Q64-A_to_ITX_mounting_brackets.zip]]<br />
* Make sure to flip the two brackets by 180 degrees on one of the horizontal axes (X/Y) in your slicer of choice before printing to avoid unnecessary supports<br />
* To allow enough clearance between the board and the bracket you either need to print four copies of the washer model or add nut(s) between the board and the bracket<br />
* If using nuts for the clearance between the board and the brackets, make sure it creates at least 3.2mm of spacing in between<br />
* Depending on the accuracy and calibration of a 3D printer, slight deviation can occur and you likely need to manually widen some of the holes to allow screws to fit<br />
<br />
== Other Resources ==<br />
<br />
* [https://forum.pine64.org/forumdisplay.php?fid=98 ROCKPro64 Forum]<br />
* [https://pine64.com/?post_type=product PINE64 shop]<br />
* [https://github.com/rockchip-linux Rockchip Linux GitHub Repo]<br />
* [http://opensource.rock-chips.com/ Rockchip Open Source Wiki]<br />
* ExplainingComputers have a video review [https://www.youtube.com/watch?v=CeoNHGFN_30 of the RockPro64 here, including linux first boot.]<br />
* [[ROCKPro64 Installing Arch Linux ARM]]<br />
* [[ROCKPro64 Powering From An ATX Supply]]<br />
<br />
== Troubleshooting ==<br />
<br />
=== No Video or GPU Acceleration on Debian ===<br />
<br />
If you can log in through serial but don't get any video or GPU acceleration on Debian, this is likely due to Debian's decision to compile the devfreq governors as loadable modules but not including them early enough for panfrost to be able to be provided with one of them.<br />
<br />
The usual sign of this being the case is the following line in your log: <code>[drm:panfrost_devfreq_init [panfrost]] *ERROR* Couldn't initialize GPU devfreq</code><br />
<br />
Log in to your ROCKPro64, and run the following:<br />
<br />
sudo -i<br />
echo governor_simpleondemand >> /etc/initramfs-tools/modules && update-initramfs -u -k $(uname -r)<br />
exit<br />
<br />
Then, reboot.<br />
<br />
[[Category:ROCKPro64]]<br />
[[Category:Rockchip RK3399]]<br />
<br />
=== PCIe probe failures on Linux kernel boot ===<br />
<br />
During Linux boot, you might experience PCIe probe failures. This will result in inability to boot over PCIe.<br />
<br />
[https://lore.kernel.org/all/20230509153912.515218-1-vincenzopalazzodev@gmail.com/ LKML "drivers: pci: introduce configurable delay for Rockchip PCIe bus scan"] discusses this issue, and proposes a fix.<br />
<br />
Manjaro have applied this patch, which fixes the issue:<br />
<br />
* https://gitlab.manjaro.org/manjaro-arm/packages/core/linux/-/blob/44e81d83b7e002e9955ac3c54e276218dc9ac76d/1005-rk3399-rp64-pcie-Reimplement-rockchip-PCIe-bus-scan-delay.patch<br />
* https://gitlab.manjaro.org/manjaro-arm/packages/core/linux/-/blob/44e81d83b7e002e9955ac3c54e276218dc9ac76d/1007-arm64-dts-rockchip-Add-PCIe-bus-scan-delay-to-RockPr.patch</div>Tomhttps://wiki.pine64.org/index.php?title=QuartzPro64_Development&diff=21122QuartzPro64 Development2023-11-11T14:20:11Z<p>Tom: /* Mounting Holes */ Note suitable standoff lengths to clear all components.</p>
<hr />
<div>[[File:Quartzpro64_whole_board_top_resized.jpeg|250px|thumb|right|The QuartzPro64 development board, front side]]<br />
[[File:BoardBackSide.jpg|250px|thumb|right|Back side of the board]]<br />
<br />
A '''QuartzPro64 Development''' Wiki page before a '''QuartzPro64''' Wiki page? It's more likely than you think!<br />
<br />
This page will be used for both documenting the current development efforts and the board in general, as we don't know yet how a generally available QuartzPro64 will look like so documenting the dev board is probably best left to the development page.<br />
<br />
== Obtaining a Development Board ==<br />
<br />
Register for a preorder: [https://preorder.pine64.org/#/quartzpro64 https://preorder.pine64.org/#/quartzpro64]<br />
<br />
== Upstreaming Status ==<br />
<br />
* Linux Kernel DT: https://github.com/torvalds/linux/blob/master/arch/arm64/boot/dts/rockchip/rk3588-quartzpro64.dts<br />
* u-boot: https://github.com/u-boot/u-boot/blob/master/arch/arm/dts/rk3588-quartzpro64-u-boot.dtsi<br />
<br />
{| class="wikitable plainrowheaders" border="1"<br />
! scope="col" | Function<br />
! scope="col" colspan="2" | Status<br />
! scope="col" | Component<br />
! scope="col" | Notes<br />
|-<br />
! scope="row" | Video Output<br />
| colspan="2" style="background:#F99; text-align:center;"|Needs porting<br />
| <code>VOP2</code><br />
| Collabora said they'll work on this. The video output IP on the RK3588 should mostly be the same as the one on the RK356x, but the chip specific stuff will need to be integrated into the vop2 driver.<br />
|-<br />
! scope="row" | Video Input<br />
| colspan="2" style="background:#F99; text-align:center;"|Needs porting<br />
| <code>rk_hdmirx</code><br />
| Huge 3600 line driver, but generally seems to be in good condition<br />
|-<br />
! scope="row" | 3D Acceleration <br />
| style="background:#F99; text-align:center;"|Needs writing<br />
| style="background:#F99; text-align:center;"|Needs writing<br />
| <code>panfrost</code><br />
| Collabora said they'll work on this. New architecture, reportedly needs many changes to the kernel component of Panfrost.<br />
|-<br />
! scope="row" rowspan="4" | Video Decode <br />
| style="background:#F99; text-align:center;"|Needs writing<br />
| style="background:LightYellow; text-align:center;" rowspan="4"|GStreamer only, no ffmpeg<sup>[https://patchwork.ffmpeg.org/project/ffmpeg/list/?series=2898]</sup><br />
| <code>hantro</code> using <code>v4l2-requests</code><br />
| VDPU121 handling 1080p60 H.263/MPEG-4, MPEG-1 and MPEG-2<br />
|-<br />
| style="background:#F99; text-align:center;"|Needs writing<br />
| <code>rkvdec2</code> using <code>v4l2-requests</code><br />
| Nobody is known to be working on this for now. VDPU346 handling 8K60 H.265, H.264, VP9 and AVS<br />
|-<br />
| style="background:#F99; text-align:center;"|Needs writing<br />
| <code>rkdjpeg</code> using <code>v4l2-requests</code><br />
| [[User:CounterPillow]] is doing a little work on this. VDPU720 handling JPEG<br />
|-<br />
| style="background:LightYellow; text-align:center;"|In review<sup>[https://patchwork.kernel.org/project/linux-rockchip/list/?series=721724]</sup><br />
| <code>hantro</code> using <code>v4l2-requests</code><br />
| Collabora is working on this. VDPU981 handling 4K60 AV1<br />
|-<br />
! scope="row" rowspan="3" | Video Encode <br />
| style="background:#F99; text-align:center;"|Needs writing<br />
| style="text-align:center; background:LightYellow;"|GStreamer only<br />
| JPEG on VEPU121<br />
| Driver already exists, only minor changes needed.<br />
|-<br />
| style="background:#F99; text-align:center;"|Needs writing<br />
| style="text-align:center;"|?<br />
| H.264 on VEPU580<br />
| <br />
|-<br />
| style="background:#F99; text-align:center;"|Needs writing<br />
| style="text-align:center;"|?<br />
| H.265 on VEPU580<br />
| <br />
|-<br />
! scope="row" rowspan="2" | Audio <br />
| colspan="2" style="background:PaleGreen; text-align:center;"|Linux Mainline<br />
| <code>rockchip-i2s-tdm</code><br />
| As of 6.2<sup>[https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=c619bd4268ff9895760dab303b4eb15ed3d0f7e9]</sup><br />
|-<br />
| colspan="2" style="background:PaleGreen; text-align:center;"|Linux Mainline<br />
| <code>es8388</code> CODEC<br />
| <br />
|-<br />
! scope="row" | CRU<br />
| colspan="2" style="background:PaleGreen; text-align:center;"|Linux Mainline<br />
| <code>clk-rk3588</code><br />
| As of 6.2<sup>[https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=f1c506d152ff235ad621d3c25d061cb16da67214]</sup><br />
|-<br />
! scope="row" | MMC<br />
| colspan="2" style="background:PaleGreen; text-align:center;"|Linux Mainline<br />
| <code>sdhci-of-dwcmshc</code><br />
| As of 5.19<sup>[https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=bbbd8872825310b14bc6e04250d2cb5edcd55edb]</sup><br />
|-<br />
! scope="row" | pinctrl<br />
| colspan="2" style="background:PaleGreen; text-align:center;"|Linux Mainline<br />
| <code>pinctrl-rockchip</code><br />
| As of 5.19<sup>[https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=fdc33eba11c5919199f3d13dc53571cc7bf19d7d]</sup><br />
|-<br />
! scope="row" | GPIO<br />
| colspan="2" style="background:PaleGreen; text-align:center;"|Linux Mainline<br />
| <code>rockchip-gpio</code><br />
| As of 6.1<sup>[https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=cc165ba48aaf7d792e99d0c7e4b12e9625bc73e3]</sup><br />
|-<br />
! scope="row" | I<sup>2</sup>C<br />
| colspan="2" style="background:PaleGreen; text-align:center;"|Linux Mainline<br />
| <code>rk3x-i2c</code><br />
| Should be the same as RK3399, just needs devicetree work<br />
|-<br />
! scope="row" | SPI<br />
| colspan="2" style="background:PaleGreen; text-align:center;"|Linux Mainline<br />
| <code>rockchip-spi</code><br />
| Should be the same as previous SoCs, just needs devicetree work<br />
|-<br />
! scope="row" | PMU<br />
| colspan="2" style="background:LightYellow; text-align:center;"|In review<sup>[https://patchwork.kernel.org/project/linux-rockchip/list/?series=687286]</sup><br />
| <code>rk806</code><br />
| Talks over SPI<br />
|-<br />
! scope="row" | Regulators<br />
| colspan="2" style="background:#F99; text-align:center;"|Needs porting<br />
| <code>rk860</code><br />
| Talks over I<sup>2</sup>C<br />
|-<br />
! scope="row" | GMAC<br />
| colspan="2" style="background:PaleGreen; text-align:center;"|Linux Mainline<br />
| <code>dwmac-rk</code><br />
| As of 6.1<sup>[https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=2f2b60a0ec2826e5a2b2a1ddf68994a868dccbc1]</sup><br />
|-<br />
! scope="row" | Power Domains<br />
| colspan="2" style="background:PaleGreen; text-align:center;"|Linux Mainline<br />
| <code>rockchip-pm-domain</code><br />
| As of 6.1<sup>[https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=6541b424ce1dda616d3946e839f015c984df7a99]</sup><br />
|-<br />
! scope="row" | CAN<br />
| colspan="2" style="background:#F99; text-align:center;"|Needs porting<br />
| <code>rockchip_canfd</code><br />
| Not broken out on the QuartzPro64, so we probably won't be the ones porting it<br />
|-<br />
! scope="row" | SPDIF TX<br />
| colspan="2" style="background:#F99; text-align:center;"|May need porting<br />
| <code>rockchip-spdif</code><br />
| Genuinely just needs the compatible string added, I think, otherwise we're all good. Not broken out on QuartzPro64 dev board<br />
|-<br />
! scope="row" | SPDIF RX<br />
| colspan="2" style="background:#F99; text-align:center;"|Needs porting<br />
| <code>rockchip-spdifrx</code><br />
| Not broken out on QuartzPro64 dev board<br />
|-<br />
! scope="row" | PCIe<br />
| colspan="2" style="background:#F99; text-align:center;"|May need porting<br />
| <code>rockchip-dw-pcie</code><br />
| Downstream driver and upstream are quite different, look into how much work actually needs doing. Seems to be the same controller as rk3568 so maybe none?<br />
|-<br />
! scope="row" | NPU<br />
| style="background:#F99; text-align:center;"|Needs porting/writing<br />
| style="text-align:center;"|?<br />
| <code>rockchip-rknpu</code><br />
|-<br />
! scope="row" | USB 2.0<br />
| colspan="2" style="background:LightYellow; text-align:center;"|In review<sup>[https://patchwork.kernel.org/project/linux-rockchip/list/?series=749871]</sup><br />
| <code>phy-rockchip-inno-usb2</code><br />
| There's probably more to USB 2 than just the PHY but this is what I found for now<br />
|-<br />
! scope="row" | USB 3.0<br />
| colspan="2" style="background:#F99; text-align:center;"|?<br />
| <code>?</code><br />
|<br />
|-<br />
! scope="row" | SATA<br />
| colspan="2" style="background:PaleGreen; text-align:center;"|Linux Mainline<br />
| <code>ahci-dwc</code><br />
| Just needs the compatible added to the bindings, done in [https://patchwork.kernel.org/project/linux-rockchip/list/?series=749876]<br />
|-<br />
! scope="row" | Thermal<br />
| colspan="2" style="background:LightYellow; text-align:center;"|In review<sup>[https://patchwork.kernel.org/project/linux-rockchip/list/?series=687619]</sup><br />
| <code>rockchip-thermal</code><br />
|<br />
|-<br />
! scope="row" | Wifi & Bluetooth<br />
| colspan="2" style="background:#F99; text-align:center;"|?<br />
| <code>?</code><br />
|<br />
|-<br />
! scope="row" | HWRNG<br />
| colspan="2" style="background:#F99; text-align:center;"|Needs porting<br />
| <code>rockchip-rng</code><br />
| The code & DT work is easy to port & working<br />
|<br />
|-<br />
! scope="row" | RTC<br />
| colspan="2" style="background:PaleGreen; text-align:center;"|Linux Mainline<br />
| <code>hym8563</code><br />
| Should only need DT work (see [https://patchwork.kernel.org/project/linux-rockchip/list/?series=736799 here] for an example)<br />
|-<br />
! scope="row" | OTP<br />
| colspan="2" style="background:LightYellow; text-align:center;"|In review<sup>[https://patchwork.kernel.org/project/linux-rockchip/list/?series=744118]</sup><br />
| <code>rockchip-otp</code><br />
|<br />
|-<br />
! scope="row" | SARADC<br />
| colspan="2" style="background:LightYellow; text-align:center;"|In review<sup>[https://patchwork.kernel.org/project/linux-rockchip/list/?series=748188]</sup><br />
| <code>rockchip_saradc</code><br />
|<br />
|}<br />
<br />
== Hardware ==<br />
<br />
[[File:Quartzpro64_soc_and_ram_resized.jpeg|200px|thumb|right|The SoC and RAM packages]]<br />
<br />
=== General ===<br />
<br />
* RK3588 SoC (8 cores: 4x A76@2.4GHz + 4x A55@1.8GHz)<br />
* Mali G610MC4 GPU (4x Valhalla cores)<br />
* 16 GB LPDDR4X (SK hynix)<br />
* 64 GB eMMC (Foresee, soldered)<br />
* 1x USB-C (with video-alt mode)<br />
* 1x USB-C (FTDI debug UART, FT232RL)<br />
* 1x USB 3.0<br />
* 2x USB 2.0<br />
* 1x HDMI in<br />
* 2x HDMI out<br />
* 1x PCIe 3.0 slot (open-ended)<br />
* 1x SD / TF card slot<br />
* 2x SATA ports<br />
* 2x Gigabit ethernet (1x from SoC, 1x on PCIe, RTL8211F, RTL8111HS)<br />
* 1x WiFi & BT Module (AMPAK Tech AP6275PR3)<br />
* 2x SMA Antenna<br />
* 2x MIPI DPHY<br />
* 1x MIPI D/C PHY<br />
* 1x MIPI CSI<br />
* 1x PWM Fan header (4 pins)<br />
* 1x RTC battery socket (CR1220, 3V, see [[#Documentation|QuartzPro64 board schematics PDF]], page 21)<br />
* 1x MIC (soldered)<br />
* 1x audio output 3.5mm jack<br />
* Power in via DC 12V<br />
<br />
=== Cooler ===<br />
<br />
The board comes with two cooler mounts, a 4-hole mount that appears to be spaced 55x55mm apart, and the ~60mm diagonal "northbridge heatsink" mount the ROCKPro64 and Quartz64 Model A uses.<br />
<br />
RK3588 is slightly (<1mm?) taller than the DRAM chips, use a thick enough thermal pad instead of thermal compound.<br />
<br />
=== UART ===<br />
<br />
Plug in the USB-C port labelled "<tt>DEBUG PORT</tt>" on the QP64 board to another computer with a USB-A-to-C cable.<br />
<br />
It will show up as a FT232 USB Serial adapter in <code>lsusb</code>:<br />
<pre><br />
$ lsusb<br />
[...]<br />
Bus 005 Device 027: ID 0403:6001 Future Technology Devices International, Ltd FT232 Serial (UART) IC<br />
[...]<br />
</pre><br />
<br />
Baud rate is 1.5 mbauds or 1500000.<br />
<br />
Ensure you have the driver module loaded:<br />
<pre><br />
# modprobe ftdi_sio<br />
# lsmod | grep ftdi_sio<br />
ftdi_sio 61440 0<br />
usbserial 53248 1 ftdi_sio<br />
usbcore 290816 7 ftdi_sio,usbserial,xhci_hcd,usbhid,usbkbd,usbmouse,xhci_pci<br />
</pre><br />
<br />
If the above is not working, check the required driver is supported by your kernel, using one of the following commands:<br />
<pre><br />
$ zgrep FTDI_SIO /proc/config.gz<br />
CONFIG_USB_SERIAL_FTDI_SIO=m<br />
$ grep FTDI_SIO "/boot/config-$(uname -r)"<br />
CONFIG_USB_SERIAL_FTDI_SIO=m<br />
</pre><br />
<br />
Using the <code>dmesg</code> command, you should see something like the following:<br />
<pre><br />
[24784.535804] usb 5-3: new full-speed USB device number 3 using xhci_hcd<br />
[24784.710714] usb 5-3: New USB device found, idVendor=0403, idProduct=6001, bcdDevice= 6.00<br />
[24784.710723] usb 5-3: New USB device strings: Mfr=1, Product=2, SerialNumber=3<br />
[24784.710725] usb 5-3: Product: FT232R USB UART<br />
[24784.710727] usb 5-3: Manufacturer: FTDI<br />
[24784.710728] usb 5-3: SerialNumber: A10LLO86<br />
[24784.723858] usbcore: registered new interface driver usbserial_generic<br />
[24784.723865] usbserial: USB Serial support registered for generic<br />
[24784.725286] usbcore: registered new interface driver ftdi_sio<br />
[24784.725295] usbserial: USB Serial support registered for FTDI USB Serial Device<br />
[24784.725348] ftdi_sio 5-3:1.0: FTDI USB Serial Device converter detected<br />
[24784.725368] usb 5-3: Detected FT232RL<br />
[24784.731685] usb 5-3: FTDI USB Serial Device converter now attached to ttyUSB0<br />
</pre><br />
<br />
Then you can get console output from the QP64 with, for example:<br />
<br />
<pre><br />
screen /dev/ttyUSB0 1500000<br />
</pre><br />
<br />
=== Mounting Holes ===<br />
<br />
Mounting holes are 3mm in diameter.<br />
<br />
Can't be bothered to take a precise measurement of all the holes right now, just use [https://www.ebay.com/sch/i.html?kw=pc%20standoff%20kit some M3 PC standoffs] and have the board sit on your desk, it's a dev board after all.<br />
<br />
See the PCB layout PDF files, linked in the [https://wiki.pine64.org/wiki/QuartzPro64_Development#Documentation Documentation] section.<br />
<br />
For anyone designing a case, the height from the bottom of the PCB to the tallest component (the USB ports) is 18mm. 20mm would be the minimum suitable standoff length to place some acrylic over the board. 24mm would be comfortable.<br />
<br />
=== Storage ===<br />
<br />
[[File:Quartzpro64_emmc_resized.jpeg|200px|thumb|right|The eMMC on the dev board]]<br />
<br />
* Soldered on 64 GB FORESEE eMMC chip, it comes pre-flashed with some Android (you'll even get a brief bit of HDMI output)<br />
* microSD card slot<br />
* 2x SATA 3.0 (molex power connector for it not populated, but easy to remedy)<br />
<br />
=== Power ===<br />
<br />
[[File:Power_and_switch.jpg|100px|thumb|right|Power switch & barrel connector]]<br />
<br />
You can provide power to the board via the 12V barrel connector, it's 5.5mm OD/2.1mm ID barrel 'coaxial' type "M" centre-positive, the ROCKPro64 5A power supply from the PINE64 store will work. (TODO: add alternative ways).<br />
<br />
There is a hardware flip switch to power up / down the board.<br />
<br />
=== PMU ===<br />
<br />
[[File:Quartzpro64_pmu.jpeg|100px|thumb|right|The PMU]]<br />
<br />
2x RK806-2, not RK808 compatible. It's a dual PMU configuration where one PMU is a subordinate of the other.<br />
<br />
Verify this once we have access to SDK sources.<br />
<br />
=== Ethernet ===<br />
<br />
The RGMII ethernet port (near the SDCARD socket) is working if you use neg2led's linux-quartz64 repo.<br />
<br />
The other port (near the sound jack) is hooked to the SoC via PCIe and is currently reported working (on the matrix channel) with latest neggles kernel.<br />
<br />
== Boot ==<br />
<br />
The board can boot from the following interfaces:<br />
* SPI<br />
* eMMC<br />
* SD/MMC<br />
<br />
TODO: in which priority / order are those boot options tried ?<br />
<br />
== Recovery ==<br />
<br />
In the case you erase the eMMC and are unable to boot the board, you can use rkdeveloptool to recover the board. While you can use the [https://gitlab.com/pine64-org/quartz-bsp/rkdeveloptool Pine64 Fork], it is recommended to use [https://gitlab.com/cypheon/rkdeveloptool/-/tree/main?ref_type=heads cypheon's Fork] until some Pending PRs are merged in to [https://gitlab.com/pine64-org/quartz-bsp/rkdeveloptool/-/merge_requests?scope=all&state=opened&author_username=cypheon resolve issues] with larger files. This is important when working with the larger 64GB eMMC on the QuartzPro64.<br />
<br />
With rkdeveloptool installed, you will also need the rk3588_spl from rockchip to init the memory/flash when in maskrom mode. This can be downloaded from the [https://github.com/rockchip-linux/rkbin/blob/master/bin/rk35/rk3588_spl_v1.12.bin rockchip-linux/rkbin repo].<br />
<br />
Entering maskrom can be done in a variety of ways:<br />
<br />
* Hold the maskrom button (little white button labelled "MASKROM" next to SATA socket) during powerup, OR<br />
* Enter rockusb mode, and execute "rkdeveloptool reboot-maskrom".<br />
* Bork your eMMC and SD devices (how? erase?), in which case bootup will fallback to maskrom.<br />
<br />
=== Dumping the eMMC ===<br />
<br />
Boot the device into maskrom mode, and then verify rkdeveloptool can see the board. <br />
'''# rkdeveloptool list'''<br />
DevNo=1 Vid=0x2207,Pid=0x350b,LocationID=503 Maskrom<br />
<br />
Once the board shows up, load the rk3588_spl you downloaded earlier, and verify that the eMMC can be seen.<br />
'''# rkdeveloptool boot ./rk3588_spl_loader_v1.08.111.bin'''<br />
Downloading bootloader succeeded.<br />
'''# rkdeveloptool read-flash-info'''<br />
Flash Info:<br />
Manufacturer: SAMSUNG, value=00<br />
Flash Size: 59000 MB<br />
Flash Size: 120832000 Sectors<br />
Block Size: 512 KB<br />
Page Size: 2 KB<br />
ECC Bits: 0<br />
Access Time: 40<br />
Flash CS: Flash<0><br />
<br />
You can now dump the eMMC using the read command. Note that first you have to calculate the eMMC size, which can be done using the output from the previous flash info command. You need to take the sector count, and times it by the sector size, to get the total number of bytes. So in the above example, 120832000*512 so the total flash size is 61865984000.<br />
<br />
Using the calculated size, you can now dump the eMMC. Please note this will take 1-2 minutes.<br />
'''# rkdeveloptool read 0x0 61865984000 ./quartzpro64_emmc_dump.bin'''<br />
Read LBA to file (0%)<br />
...<br />
Read LBA to file (100%)<br />
<br />
You now have a full dump of the entire eMMC (SHA256 62cb4ae8d02aeacccf231fa1d00087cdc74b599790a274569305693aa205318d). Note that you can also use the list-partitions and read-partition commands to dump specific partitions, but this only shows GPT partitions on the eMMC. Because of this, it will NOT include the spl_loader found in the first 4MB of the eMMC!<br />
<br />
=== Flasing the eMMC ===<br />
<br />
Boot the device into maskrom mode, and then verify rkdeveloptool can see the board. <br />
'''# rkdeveloptool list'''<br />
DevNo=1 Vid=0x2207,Pid=0x350b,LocationID=503 Maskrom<br />
<br />
Once the board shows up, load the rk3588_spl you downloaded earlier, and verify that the eMMC can be seen.<br />
'''# rkdeveloptool boot ./rk3588_spl_loader_v1.08.111.bin'''<br />
Downloading bootloader succeeded.<br />
'''# rkdeveloptool read-flash-info'''<br />
Flash Info:<br />
Manufacturer: SAMSUNG, value=00<br />
Flash Size: 59000 MB<br />
Flash Size: 120832000 Sectors<br />
Block Size: 512 KB<br />
Page Size: 2 KB<br />
ECC Bits: 0<br />
Access Time: 40<br />
Flash CS: Flash<0><br />
<br />
You can now flash the device using either the write command, or write-partition command, depending on what you are trying to do. If you are looking to restore the entire eMMC from a backup you made, you would use the command below to accomplish this.<br />
'''rkdeveloptool write 0 ./quartzpro64_emmc_dump.bin'''<br />
<br />
== Immediate TODOs ==<br />
<br />
=== Enable cpufreq Stuff ===<br />
<br />
Current neggles kernel has the CPU at 1.2 GHz, apparently SRE has patches to enable cpufreq? (see below, in [[QuartzPro64_Development#Kernel|Resources]])<br />
<br />
=== Add RK3588 Support To VOP2 ===<br />
<br />
VOP2 IP on the RK3588 is very similar to the one on the RK356x, but it still needs platform specific code added.<br />
<br />
== Ways To Do Things ==<br />
<br />
=== Using rkdeveloptool ===<br />
<br />
Use the [https://gitlab.com/pine64-org/quartz-bsp/rkdeveloptool PINE64 fork of rkdeveloptool].<br />
<br />
Connect a USB-C cable to the "DEBUG PORT" USB-C port, and a second to the "DOWNLOAD" USB-C port. '''Cable direction for the latter matters, so if it doesn't show up after entering download mode, try rotating the USB-C connector to the other side!'''<br />
<br />
To enter rockusb mode, interrupt the boot by holding the "V+/REC" on-board button or mashing Ctrl+C very quickly on the serial comms, then type <code>download</code>.<br />
<br />
$ rkdeveloptool list<br />
<br />
should now show you the device somewhat like this:<br />
<br />
'''$ rkdeveloptool list'''<br />
DevNo=1 Vid=0x2207,Pid=0x350b,LocationID=204 Loader<br />
<br />
{{Template:note|'''Note:''' If you receive an error about being unable to create the comms object in the following steps, make sure you have the udev rules installed with [https://gitlab.com/pine64-org/quartz-bsp/rkdeveloptool/-/merge_requests/19 CounterPillow's RK3588 device id patch], install them to <code>/etc/udev/rules.d/</code> and <code>udevadm control --reload</code>}}<br />
<br />
Now, we can e.g. show the partitions on the eMMC:<br />
<br />
'''$ rkdeveloptool list-partitions'''<br />
# LBA start (sectors) LBA end (sectors) Size (bytes) Name <br />
00 8192 16383 4194304 security<br />
01 16384 24575 4194304 uboot<br />
02 24576 32767 4194304 trust<br />
03 32768 40959 4194304 misc<br />
04 40960 49151 4194304 dtbo<br />
05 49152 51199 1048576 vbmeta<br />
06 51200 133119 41943040 boot<br />
07 133120 329727 100663296 recovery<br />
08 329728 1116159 402653184 backup<br />
09 1116160 1902591 402653184 cache<br />
10 1902592 1935359 16777216 metadata<br />
11 1935360 1937407 1048576 baseparameter<br />
12 1937408 8310783 3263168512 super<br />
13 8310784 120831935 57610829824 userdata<br />
<br />
You can now use <code>rkdeveloptool write-partition partitionname yourfile</code> to overwrite one of the eMMC partitions.<br />
<br />
=== U-Boot + Kernel On SD, RootFS On eMMC ===<br />
<br />
This is the setup [[User:CounterPillow]] currently uses. In short, you'll need a vendor U-Boot on your SD card, with a boot partition on it that contains your <tt>extlinux.conf</tt>, device tree and kernel.<br />
<br />
==== Setting Up The SD Card ====<br />
<br />
Assuming your SD card is <tt>/dev/sdX</tt>, partition as e.g. follows:<br />
<br />
# parted -s /dev/sdX mklabel gpt<br />
# parted -s /dev/sdX mkpart loader 64s 8MiB<br />
# parted -s /dev/sdX mkpart uboot 8MiB 16MiB<br />
# parted -s /dev/sdX mkpart env 16MiB 32MiB<br />
# parted -s /dev/sdX mkpart efi fat32 32MiB 544MiB # increase size as you wish<br />
# parted -s /dev/sdX set 4 boot on<br />
<br />
Flash SPL and u-boot:<br />
# dd if=rk3588_spl_loader_v1.06.109.bin of=/dev/sdX1<br />
# dd if=uboot.img of=/dev/sdX2<br />
<br />
Then make the filesystem:<br />
# mkfs.vfat -n "efi" /dev/sdX4<br />
<br />
Mount it to e.g. <tt>/mnt/sdcardboot</tt>:<br />
# mount /dev/sda4 /mnt/sdcardboot<br />
<br />
Put the following in <tt>/mnt/sdcardboot/extlinux/extlinux.conf</tt>:<br />
default l0<br />
menu title QuartzPro64 Boot Menu<br />
prompt 0<br />
timeout 50<br />
<br />
label l0<br />
menu label Boot Jank Kernel SDMMC<br />
linux /jank<br />
fdt /dtbs/rockchip/rk3588-evb1-v10.dtb<br />
append earlycon=uart8250,mmio32,0xfeb50000 console=ttyS2,1500000n8 root=/dev/mmcblk0p14 rw rootwait<br />
<br />
Copy your kernel to <tt>/mnt/sdcardboot/jank</tt> and your DTB to <tt>/mnt/sdcardboot/dtbs/rockchip/rk3588-evb1-v10.dtb</tt>.<br />
<br />
Unmount it, we're done with the SD card.<br />
<br />
==== Creating The Root File System ====<br />
<br />
First, allocate a file the size of your desired root partition (larger sizes will take longer to transfer, don't make the same mistakes as CounterPillow did), here we choose 16G:<br />
$ fallocate -l 16G rootpart.bin<br />
<br />
then, make the filesystem on it. CounterPillow went for ext4 because nobody has ever been fired for using ext4:<br />
$ mkfs.ext4 rootpart.bin<br />
<br />
Cool, now mount it:<br />
# mount rootpart.bin /mnt/emmc-root<br />
<br />
Now we'll download the Arch Linux ARM generic rootfs tarball and go to town:<br />
$ wget -N http://os.archlinuxarm.org/os/ArchLinuxARM-aarch64-latest.tar.gz{,.sig}<br />
$ curl 'https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x68b3537f39a313b3e574d06777193f152bdbe6a6' | gpg --import=- # in case you're lacking the key<br />
$ gpg --verify ArchLinuxARM-aarch64-latest.tar.gz.sig # don't you dare skip this<br />
# bsdtar -xpf ArchLinuxARM-aarch64-latest.tar.gz -C /mnt/emmc-root # notice that this is run as root<br />
<br />
Then we just need to edit fstab. Get the UUID (not PARTUUID) from lsblk:<br />
$ lsblk -o NAME,SIZE,MOUNTPOINTS,UUID<br />
<br />
and put it in <tt>/mnt/emmc-root/etc/fstab</tt> as follows:<br />
UUID=''root-uuid-here'' / ext4 defaults 0 1<br />
<br />
Unmount <tt>/mnt/emmc-root</tt>, we're done with it.<br />
<br />
==== Flashing The Root File System With RockUSB ====<br />
<br />
{{Template:warning|This '''will''' destroy whatever data is on that userdata partition. But you're here to run Linux, not Android, right?}}<br />
<br />
Plug one USB-C cable into the debug UART port, the other into the download port. Yes you will need two USB-C cables (or A-to-C cables) for this, get over it.<br />
<br />
Plug in your board, reset it while hammering Ctrl+c on the debug UART until you get into a u-boot command line. Now enter the <code>download</code> command.<br />
<br />
If your device doesn't show up in <code>lsusb</code> or <code>rkdeveloptool list</code> command, pull out the download USB-C plug, rotate it axially by 180 Euler degrees, and plug it back in.<br />
<br />
Next, flash the partition. Depending on the size of it, this can take over an hour:<br />
$ rkdeveloptool write-partition userdata rootpart.bin<br />
<br />
==== Booting ====<br />
<br />
Unplug the download USB-C cable once done.<br />
<br />
Put the SD card in the board. Reset it. You can now boot and your rootfs on eMMC will be mounted and contains an ALARM userland.<br />
<br />
To update kernels or the device tree, just shut down the board, take out the SD card, write a new kernel or dtb to it, and plug it back in. No more need for rkdeveloptool, yay.<br />
<br />
== Resources ==<br />
<br />
=== Kernel ===<br />
<br />
* [http://lists.infradead.org/pipermail/linux-rockchip/ The linux-rockchip mailing list archives]<br />
* [https://patchwork.kernel.org/project/linux-rockchip/list/ linux-rockchip patchwork]<br />
* [https://github.com/neg2led/linux-quartz64 neggles / neg2led's mainline kernel repository with patches picked from the mailing list]<br />
* [https://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-misc.git/log/?h=rk3588 Sebastian Reichel's (SRE) rk3588 branch]<br />
* [https://github.com/rockchip-linux/kernel Rockchip BSP kernel tree]<br />
* [https://gitlab.collabora.com/hardware-enablement/rockchip-3588/linux Collabora RK3588 integration branch]<br />
* [https://gitlab.collabora.com/hardware-enablement/rockchip-3588/notes-for-rockchip-3588/-/blob/main/mainline-status.md Collabora Mainline Status Table]<br />
* [https://github.com/radxa/kernel/tree/stable-5.10-rock5 Radxa kernel tree, for reference, a lot is happening here]<br />
<br />
=== Misc ===<br />
<br />
* The quartz64 and quartz-dev channels on the PINE64 chats (bridged IRC, Matrix, Discord and Telegram)<br />
* [https://gitlab.com/pine64-org/quartz-bsp/rkdeveloptool PINE64 rkdeveloptool fork]<br />
* [https://github.com/CounterPillow/uboot-qp64 CounterPillow's uboot-qp64 repository], used with [https://github.com/rockchip-linux/rkbin/ the official rkbin repository]<br />
* [https://opensource.rock-chips.com/wiki_Main_Page Rockchip OpenSource wiki]<br />
* [https://github.com/collabora/rockchiprs rockchiprs] (rkdeveloptool replacement written in Rust)<br />
<br />
=== Documentation ===<br />
<br />
The documentation for the QuartzPro64 board and most of the documentation for the chips it uses hasn't been publicly released yet, but if you do own a QuartzPro64 board, [[User:CounterPillow|CounterPillow]] or [[User:Dsimic|dsimic]] will happily provide the documentation to you for the research or development purposes, if you ask them in the PINE64 [[Main Page#Chat Platforms|chat channels]]. We've got the following documents, some of which can also be found elsewhere on the Internet rather easily:<br />
<br />
* RK3588 datasheet<br />
* RK3588 technical reference manual (TRM), parts 1 and 2<br />
* RK3588 hardware design guide, machine translated to English from Chinese, and the original version in Chinese<br />
* RK860 datasheet, including register descriptions<br />
* RK806 datasheet, including register descriptions<br />
* [https://devzone.pine64.org/uploads/d392f228-d53b-11ec-9ab8-fe0395c0c83d/9fee695f-39a4-4858-a58a-c91b86d4fa2c/QuartzPro64-DevBoard-Schematic-V1.0_20220216.pdf QuartzPro64 schematics]<br />
* [https://devzone.pine64.org/uploads/d392f228-d53b-11ec-9ab8-fe0395c0c83d/cf368836-966e-4c3c-9e0d-04a82a705d45/QuartzPro64-DevBoard-PCB-V1.0_20220216_topplace.pdf QuartzPro64 PCB top layout]<br />
* [https://devzone.pine64.org/uploads/d392f228-d53b-11ec-9ab8-fe0395c0c83d/ec260213-d4f7-4c61-ad1f-40ee7b7b7a35/QuartzPro64-DevBoard-PCB-V1.0_20220216_bottomplace.pdf QuartzPro64 PCB bottom layout]<br />
* [https://datasheet.lcsc.com/lcsc/2203311530_AMPAK-Tech-AP6275PR3_C2984106.pdf AMPAK AP6275PR3 (WiFi + BT module) datasheet]<br />
* AMPAK AP6275P (WiFi + BT module) datasheet<br />
<br />
[[Category:Rockchip RK3588]]<br />
[[Category:QuartzPro64]]</div>Tomhttps://wiki.pine64.org/index.php?title=QuartzPro64_Development&diff=21121QuartzPro64 Development2023-11-11T14:17:42Z<p>Tom: /* Mounting Holes */ Note that mounting holes are 3mm.</p>
<hr />
<div>[[File:Quartzpro64_whole_board_top_resized.jpeg|250px|thumb|right|The QuartzPro64 development board, front side]]<br />
[[File:BoardBackSide.jpg|250px|thumb|right|Back side of the board]]<br />
<br />
A '''QuartzPro64 Development''' Wiki page before a '''QuartzPro64''' Wiki page? It's more likely than you think!<br />
<br />
This page will be used for both documenting the current development efforts and the board in general, as we don't know yet how a generally available QuartzPro64 will look like so documenting the dev board is probably best left to the development page.<br />
<br />
== Obtaining a Development Board ==<br />
<br />
Register for a preorder: [https://preorder.pine64.org/#/quartzpro64 https://preorder.pine64.org/#/quartzpro64]<br />
<br />
== Upstreaming Status ==<br />
<br />
* Linux Kernel DT: https://github.com/torvalds/linux/blob/master/arch/arm64/boot/dts/rockchip/rk3588-quartzpro64.dts<br />
* u-boot: https://github.com/u-boot/u-boot/blob/master/arch/arm/dts/rk3588-quartzpro64-u-boot.dtsi<br />
<br />
{| class="wikitable plainrowheaders" border="1"<br />
! scope="col" | Function<br />
! scope="col" colspan="2" | Status<br />
! scope="col" | Component<br />
! scope="col" | Notes<br />
|-<br />
! scope="row" | Video Output<br />
| colspan="2" style="background:#F99; text-align:center;"|Needs porting<br />
| <code>VOP2</code><br />
| Collabora said they'll work on this. The video output IP on the RK3588 should mostly be the same as the one on the RK356x, but the chip specific stuff will need to be integrated into the vop2 driver.<br />
|-<br />
! scope="row" | Video Input<br />
| colspan="2" style="background:#F99; text-align:center;"|Needs porting<br />
| <code>rk_hdmirx</code><br />
| Huge 3600 line driver, but generally seems to be in good condition<br />
|-<br />
! scope="row" | 3D Acceleration <br />
| style="background:#F99; text-align:center;"|Needs writing<br />
| style="background:#F99; text-align:center;"|Needs writing<br />
| <code>panfrost</code><br />
| Collabora said they'll work on this. New architecture, reportedly needs many changes to the kernel component of Panfrost.<br />
|-<br />
! scope="row" rowspan="4" | Video Decode <br />
| style="background:#F99; text-align:center;"|Needs writing<br />
| style="background:LightYellow; text-align:center;" rowspan="4"|GStreamer only, no ffmpeg<sup>[https://patchwork.ffmpeg.org/project/ffmpeg/list/?series=2898]</sup><br />
| <code>hantro</code> using <code>v4l2-requests</code><br />
| VDPU121 handling 1080p60 H.263/MPEG-4, MPEG-1 and MPEG-2<br />
|-<br />
| style="background:#F99; text-align:center;"|Needs writing<br />
| <code>rkvdec2</code> using <code>v4l2-requests</code><br />
| Nobody is known to be working on this for now. VDPU346 handling 8K60 H.265, H.264, VP9 and AVS<br />
|-<br />
| style="background:#F99; text-align:center;"|Needs writing<br />
| <code>rkdjpeg</code> using <code>v4l2-requests</code><br />
| [[User:CounterPillow]] is doing a little work on this. VDPU720 handling JPEG<br />
|-<br />
| style="background:LightYellow; text-align:center;"|In review<sup>[https://patchwork.kernel.org/project/linux-rockchip/list/?series=721724]</sup><br />
| <code>hantro</code> using <code>v4l2-requests</code><br />
| Collabora is working on this. VDPU981 handling 4K60 AV1<br />
|-<br />
! scope="row" rowspan="3" | Video Encode <br />
| style="background:#F99; text-align:center;"|Needs writing<br />
| style="text-align:center; background:LightYellow;"|GStreamer only<br />
| JPEG on VEPU121<br />
| Driver already exists, only minor changes needed.<br />
|-<br />
| style="background:#F99; text-align:center;"|Needs writing<br />
| style="text-align:center;"|?<br />
| H.264 on VEPU580<br />
| <br />
|-<br />
| style="background:#F99; text-align:center;"|Needs writing<br />
| style="text-align:center;"|?<br />
| H.265 on VEPU580<br />
| <br />
|-<br />
! scope="row" rowspan="2" | Audio <br />
| colspan="2" style="background:PaleGreen; text-align:center;"|Linux Mainline<br />
| <code>rockchip-i2s-tdm</code><br />
| As of 6.2<sup>[https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=c619bd4268ff9895760dab303b4eb15ed3d0f7e9]</sup><br />
|-<br />
| colspan="2" style="background:PaleGreen; text-align:center;"|Linux Mainline<br />
| <code>es8388</code> CODEC<br />
| <br />
|-<br />
! scope="row" | CRU<br />
| colspan="2" style="background:PaleGreen; text-align:center;"|Linux Mainline<br />
| <code>clk-rk3588</code><br />
| As of 6.2<sup>[https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=f1c506d152ff235ad621d3c25d061cb16da67214]</sup><br />
|-<br />
! scope="row" | MMC<br />
| colspan="2" style="background:PaleGreen; text-align:center;"|Linux Mainline<br />
| <code>sdhci-of-dwcmshc</code><br />
| As of 5.19<sup>[https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=bbbd8872825310b14bc6e04250d2cb5edcd55edb]</sup><br />
|-<br />
! scope="row" | pinctrl<br />
| colspan="2" style="background:PaleGreen; text-align:center;"|Linux Mainline<br />
| <code>pinctrl-rockchip</code><br />
| As of 5.19<sup>[https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=fdc33eba11c5919199f3d13dc53571cc7bf19d7d]</sup><br />
|-<br />
! scope="row" | GPIO<br />
| colspan="2" style="background:PaleGreen; text-align:center;"|Linux Mainline<br />
| <code>rockchip-gpio</code><br />
| As of 6.1<sup>[https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=cc165ba48aaf7d792e99d0c7e4b12e9625bc73e3]</sup><br />
|-<br />
! scope="row" | I<sup>2</sup>C<br />
| colspan="2" style="background:PaleGreen; text-align:center;"|Linux Mainline<br />
| <code>rk3x-i2c</code><br />
| Should be the same as RK3399, just needs devicetree work<br />
|-<br />
! scope="row" | SPI<br />
| colspan="2" style="background:PaleGreen; text-align:center;"|Linux Mainline<br />
| <code>rockchip-spi</code><br />
| Should be the same as previous SoCs, just needs devicetree work<br />
|-<br />
! scope="row" | PMU<br />
| colspan="2" style="background:LightYellow; text-align:center;"|In review<sup>[https://patchwork.kernel.org/project/linux-rockchip/list/?series=687286]</sup><br />
| <code>rk806</code><br />
| Talks over SPI<br />
|-<br />
! scope="row" | Regulators<br />
| colspan="2" style="background:#F99; text-align:center;"|Needs porting<br />
| <code>rk860</code><br />
| Talks over I<sup>2</sup>C<br />
|-<br />
! scope="row" | GMAC<br />
| colspan="2" style="background:PaleGreen; text-align:center;"|Linux Mainline<br />
| <code>dwmac-rk</code><br />
| As of 6.1<sup>[https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=2f2b60a0ec2826e5a2b2a1ddf68994a868dccbc1]</sup><br />
|-<br />
! scope="row" | Power Domains<br />
| colspan="2" style="background:PaleGreen; text-align:center;"|Linux Mainline<br />
| <code>rockchip-pm-domain</code><br />
| As of 6.1<sup>[https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=6541b424ce1dda616d3946e839f015c984df7a99]</sup><br />
|-<br />
! scope="row" | CAN<br />
| colspan="2" style="background:#F99; text-align:center;"|Needs porting<br />
| <code>rockchip_canfd</code><br />
| Not broken out on the QuartzPro64, so we probably won't be the ones porting it<br />
|-<br />
! scope="row" | SPDIF TX<br />
| colspan="2" style="background:#F99; text-align:center;"|May need porting<br />
| <code>rockchip-spdif</code><br />
| Genuinely just needs the compatible string added, I think, otherwise we're all good. Not broken out on QuartzPro64 dev board<br />
|-<br />
! scope="row" | SPDIF RX<br />
| colspan="2" style="background:#F99; text-align:center;"|Needs porting<br />
| <code>rockchip-spdifrx</code><br />
| Not broken out on QuartzPro64 dev board<br />
|-<br />
! scope="row" | PCIe<br />
| colspan="2" style="background:#F99; text-align:center;"|May need porting<br />
| <code>rockchip-dw-pcie</code><br />
| Downstream driver and upstream are quite different, look into how much work actually needs doing. Seems to be the same controller as rk3568 so maybe none?<br />
|-<br />
! scope="row" | NPU<br />
| style="background:#F99; text-align:center;"|Needs porting/writing<br />
| style="text-align:center;"|?<br />
| <code>rockchip-rknpu</code><br />
|-<br />
! scope="row" | USB 2.0<br />
| colspan="2" style="background:LightYellow; text-align:center;"|In review<sup>[https://patchwork.kernel.org/project/linux-rockchip/list/?series=749871]</sup><br />
| <code>phy-rockchip-inno-usb2</code><br />
| There's probably more to USB 2 than just the PHY but this is what I found for now<br />
|-<br />
! scope="row" | USB 3.0<br />
| colspan="2" style="background:#F99; text-align:center;"|?<br />
| <code>?</code><br />
|<br />
|-<br />
! scope="row" | SATA<br />
| colspan="2" style="background:PaleGreen; text-align:center;"|Linux Mainline<br />
| <code>ahci-dwc</code><br />
| Just needs the compatible added to the bindings, done in [https://patchwork.kernel.org/project/linux-rockchip/list/?series=749876]<br />
|-<br />
! scope="row" | Thermal<br />
| colspan="2" style="background:LightYellow; text-align:center;"|In review<sup>[https://patchwork.kernel.org/project/linux-rockchip/list/?series=687619]</sup><br />
| <code>rockchip-thermal</code><br />
|<br />
|-<br />
! scope="row" | Wifi & Bluetooth<br />
| colspan="2" style="background:#F99; text-align:center;"|?<br />
| <code>?</code><br />
|<br />
|-<br />
! scope="row" | HWRNG<br />
| colspan="2" style="background:#F99; text-align:center;"|Needs porting<br />
| <code>rockchip-rng</code><br />
| The code & DT work is easy to port & working<br />
|<br />
|-<br />
! scope="row" | RTC<br />
| colspan="2" style="background:PaleGreen; text-align:center;"|Linux Mainline<br />
| <code>hym8563</code><br />
| Should only need DT work (see [https://patchwork.kernel.org/project/linux-rockchip/list/?series=736799 here] for an example)<br />
|-<br />
! scope="row" | OTP<br />
| colspan="2" style="background:LightYellow; text-align:center;"|In review<sup>[https://patchwork.kernel.org/project/linux-rockchip/list/?series=744118]</sup><br />
| <code>rockchip-otp</code><br />
|<br />
|-<br />
! scope="row" | SARADC<br />
| colspan="2" style="background:LightYellow; text-align:center;"|In review<sup>[https://patchwork.kernel.org/project/linux-rockchip/list/?series=748188]</sup><br />
| <code>rockchip_saradc</code><br />
|<br />
|}<br />
<br />
== Hardware ==<br />
<br />
[[File:Quartzpro64_soc_and_ram_resized.jpeg|200px|thumb|right|The SoC and RAM packages]]<br />
<br />
=== General ===<br />
<br />
* RK3588 SoC (8 cores: 4x A76@2.4GHz + 4x A55@1.8GHz)<br />
* Mali G610MC4 GPU (4x Valhalla cores)<br />
* 16 GB LPDDR4X (SK hynix)<br />
* 64 GB eMMC (Foresee, soldered)<br />
* 1x USB-C (with video-alt mode)<br />
* 1x USB-C (FTDI debug UART, FT232RL)<br />
* 1x USB 3.0<br />
* 2x USB 2.0<br />
* 1x HDMI in<br />
* 2x HDMI out<br />
* 1x PCIe 3.0 slot (open-ended)<br />
* 1x SD / TF card slot<br />
* 2x SATA ports<br />
* 2x Gigabit ethernet (1x from SoC, 1x on PCIe, RTL8211F, RTL8111HS)<br />
* 1x WiFi & BT Module (AMPAK Tech AP6275PR3)<br />
* 2x SMA Antenna<br />
* 2x MIPI DPHY<br />
* 1x MIPI D/C PHY<br />
* 1x MIPI CSI<br />
* 1x PWM Fan header (4 pins)<br />
* 1x RTC battery socket (CR1220, 3V, see [[#Documentation|QuartzPro64 board schematics PDF]], page 21)<br />
* 1x MIC (soldered)<br />
* 1x audio output 3.5mm jack<br />
* Power in via DC 12V<br />
<br />
=== Cooler ===<br />
<br />
The board comes with two cooler mounts, a 4-hole mount that appears to be spaced 55x55mm apart, and the ~60mm diagonal "northbridge heatsink" mount the ROCKPro64 and Quartz64 Model A uses.<br />
<br />
RK3588 is slightly (<1mm?) taller than the DRAM chips, use a thick enough thermal pad instead of thermal compound.<br />
<br />
=== UART ===<br />
<br />
Plug in the USB-C port labelled "<tt>DEBUG PORT</tt>" on the QP64 board to another computer with a USB-A-to-C cable.<br />
<br />
It will show up as a FT232 USB Serial adapter in <code>lsusb</code>:<br />
<pre><br />
$ lsusb<br />
[...]<br />
Bus 005 Device 027: ID 0403:6001 Future Technology Devices International, Ltd FT232 Serial (UART) IC<br />
[...]<br />
</pre><br />
<br />
Baud rate is 1.5 mbauds or 1500000.<br />
<br />
Ensure you have the driver module loaded:<br />
<pre><br />
# modprobe ftdi_sio<br />
# lsmod | grep ftdi_sio<br />
ftdi_sio 61440 0<br />
usbserial 53248 1 ftdi_sio<br />
usbcore 290816 7 ftdi_sio,usbserial,xhci_hcd,usbhid,usbkbd,usbmouse,xhci_pci<br />
</pre><br />
<br />
If the above is not working, check the required driver is supported by your kernel, using one of the following commands:<br />
<pre><br />
$ zgrep FTDI_SIO /proc/config.gz<br />
CONFIG_USB_SERIAL_FTDI_SIO=m<br />
$ grep FTDI_SIO "/boot/config-$(uname -r)"<br />
CONFIG_USB_SERIAL_FTDI_SIO=m<br />
</pre><br />
<br />
Using the <code>dmesg</code> command, you should see something like the following:<br />
<pre><br />
[24784.535804] usb 5-3: new full-speed USB device number 3 using xhci_hcd<br />
[24784.710714] usb 5-3: New USB device found, idVendor=0403, idProduct=6001, bcdDevice= 6.00<br />
[24784.710723] usb 5-3: New USB device strings: Mfr=1, Product=2, SerialNumber=3<br />
[24784.710725] usb 5-3: Product: FT232R USB UART<br />
[24784.710727] usb 5-3: Manufacturer: FTDI<br />
[24784.710728] usb 5-3: SerialNumber: A10LLO86<br />
[24784.723858] usbcore: registered new interface driver usbserial_generic<br />
[24784.723865] usbserial: USB Serial support registered for generic<br />
[24784.725286] usbcore: registered new interface driver ftdi_sio<br />
[24784.725295] usbserial: USB Serial support registered for FTDI USB Serial Device<br />
[24784.725348] ftdi_sio 5-3:1.0: FTDI USB Serial Device converter detected<br />
[24784.725368] usb 5-3: Detected FT232RL<br />
[24784.731685] usb 5-3: FTDI USB Serial Device converter now attached to ttyUSB0<br />
</pre><br />
<br />
Then you can get console output from the QP64 with, for example:<br />
<br />
<pre><br />
screen /dev/ttyUSB0 1500000<br />
</pre><br />
<br />
=== Mounting Holes ===<br />
<br />
Mounting holes are 3mm in diameter.<br />
<br />
Can't be bothered to take a precise measurement of all the holes right now, just use [https://www.ebay.com/sch/i.html?kw=pc%20standoff%20kit some M3 PC standoffs] and have the board sit on your desk, it's a dev board after all.<br />
<br />
See the PCB layout PDF files, linked in the [https://wiki.pine64.org/wiki/QuartzPro64_Development#Documentation Documentation] section.<br />
<br />
=== Storage ===<br />
<br />
[[File:Quartzpro64_emmc_resized.jpeg|200px|thumb|right|The eMMC on the dev board]]<br />
<br />
* Soldered on 64 GB FORESEE eMMC chip, it comes pre-flashed with some Android (you'll even get a brief bit of HDMI output)<br />
* microSD card slot<br />
* 2x SATA 3.0 (molex power connector for it not populated, but easy to remedy)<br />
<br />
=== Power ===<br />
<br />
[[File:Power_and_switch.jpg|100px|thumb|right|Power switch & barrel connector]]<br />
<br />
You can provide power to the board via the 12V barrel connector, it's 5.5mm OD/2.1mm ID barrel 'coaxial' type "M" centre-positive, the ROCKPro64 5A power supply from the PINE64 store will work. (TODO: add alternative ways).<br />
<br />
There is a hardware flip switch to power up / down the board.<br />
<br />
=== PMU ===<br />
<br />
[[File:Quartzpro64_pmu.jpeg|100px|thumb|right|The PMU]]<br />
<br />
2x RK806-2, not RK808 compatible. It's a dual PMU configuration where one PMU is a subordinate of the other.<br />
<br />
Verify this once we have access to SDK sources.<br />
<br />
=== Ethernet ===<br />
<br />
The RGMII ethernet port (near the SDCARD socket) is working if you use neg2led's linux-quartz64 repo.<br />
<br />
The other port (near the sound jack) is hooked to the SoC via PCIe and is currently reported working (on the matrix channel) with latest neggles kernel.<br />
<br />
== Boot ==<br />
<br />
The board can boot from the following interfaces:<br />
* SPI<br />
* eMMC<br />
* SD/MMC<br />
<br />
TODO: in which priority / order are those boot options tried ?<br />
<br />
== Recovery ==<br />
<br />
In the case you erase the eMMC and are unable to boot the board, you can use rkdeveloptool to recover the board. While you can use the [https://gitlab.com/pine64-org/quartz-bsp/rkdeveloptool Pine64 Fork], it is recommended to use [https://gitlab.com/cypheon/rkdeveloptool/-/tree/main?ref_type=heads cypheon's Fork] until some Pending PRs are merged in to [https://gitlab.com/pine64-org/quartz-bsp/rkdeveloptool/-/merge_requests?scope=all&state=opened&author_username=cypheon resolve issues] with larger files. This is important when working with the larger 64GB eMMC on the QuartzPro64.<br />
<br />
With rkdeveloptool installed, you will also need the rk3588_spl from rockchip to init the memory/flash when in maskrom mode. This can be downloaded from the [https://github.com/rockchip-linux/rkbin/blob/master/bin/rk35/rk3588_spl_v1.12.bin rockchip-linux/rkbin repo].<br />
<br />
Entering maskrom can be done in a variety of ways:<br />
<br />
* Hold the maskrom button (little white button labelled "MASKROM" next to SATA socket) during powerup, OR<br />
* Enter rockusb mode, and execute "rkdeveloptool reboot-maskrom".<br />
* Bork your eMMC and SD devices (how? erase?), in which case bootup will fallback to maskrom.<br />
<br />
=== Dumping the eMMC ===<br />
<br />
Boot the device into maskrom mode, and then verify rkdeveloptool can see the board. <br />
'''# rkdeveloptool list'''<br />
DevNo=1 Vid=0x2207,Pid=0x350b,LocationID=503 Maskrom<br />
<br />
Once the board shows up, load the rk3588_spl you downloaded earlier, and verify that the eMMC can be seen.<br />
'''# rkdeveloptool boot ./rk3588_spl_loader_v1.08.111.bin'''<br />
Downloading bootloader succeeded.<br />
'''# rkdeveloptool read-flash-info'''<br />
Flash Info:<br />
Manufacturer: SAMSUNG, value=00<br />
Flash Size: 59000 MB<br />
Flash Size: 120832000 Sectors<br />
Block Size: 512 KB<br />
Page Size: 2 KB<br />
ECC Bits: 0<br />
Access Time: 40<br />
Flash CS: Flash<0><br />
<br />
You can now dump the eMMC using the read command. Note that first you have to calculate the eMMC size, which can be done using the output from the previous flash info command. You need to take the sector count, and times it by the sector size, to get the total number of bytes. So in the above example, 120832000*512 so the total flash size is 61865984000.<br />
<br />
Using the calculated size, you can now dump the eMMC. Please note this will take 1-2 minutes.<br />
'''# rkdeveloptool read 0x0 61865984000 ./quartzpro64_emmc_dump.bin'''<br />
Read LBA to file (0%)<br />
...<br />
Read LBA to file (100%)<br />
<br />
You now have a full dump of the entire eMMC (SHA256 62cb4ae8d02aeacccf231fa1d00087cdc74b599790a274569305693aa205318d). Note that you can also use the list-partitions and read-partition commands to dump specific partitions, but this only shows GPT partitions on the eMMC. Because of this, it will NOT include the spl_loader found in the first 4MB of the eMMC!<br />
<br />
=== Flasing the eMMC ===<br />
<br />
Boot the device into maskrom mode, and then verify rkdeveloptool can see the board. <br />
'''# rkdeveloptool list'''<br />
DevNo=1 Vid=0x2207,Pid=0x350b,LocationID=503 Maskrom<br />
<br />
Once the board shows up, load the rk3588_spl you downloaded earlier, and verify that the eMMC can be seen.<br />
'''# rkdeveloptool boot ./rk3588_spl_loader_v1.08.111.bin'''<br />
Downloading bootloader succeeded.<br />
'''# rkdeveloptool read-flash-info'''<br />
Flash Info:<br />
Manufacturer: SAMSUNG, value=00<br />
Flash Size: 59000 MB<br />
Flash Size: 120832000 Sectors<br />
Block Size: 512 KB<br />
Page Size: 2 KB<br />
ECC Bits: 0<br />
Access Time: 40<br />
Flash CS: Flash<0><br />
<br />
You can now flash the device using either the write command, or write-partition command, depending on what you are trying to do. If you are looking to restore the entire eMMC from a backup you made, you would use the command below to accomplish this.<br />
'''rkdeveloptool write 0 ./quartzpro64_emmc_dump.bin'''<br />
<br />
== Immediate TODOs ==<br />
<br />
=== Enable cpufreq Stuff ===<br />
<br />
Current neggles kernel has the CPU at 1.2 GHz, apparently SRE has patches to enable cpufreq? (see below, in [[QuartzPro64_Development#Kernel|Resources]])<br />
<br />
=== Add RK3588 Support To VOP2 ===<br />
<br />
VOP2 IP on the RK3588 is very similar to the one on the RK356x, but it still needs platform specific code added.<br />
<br />
== Ways To Do Things ==<br />
<br />
=== Using rkdeveloptool ===<br />
<br />
Use the [https://gitlab.com/pine64-org/quartz-bsp/rkdeveloptool PINE64 fork of rkdeveloptool].<br />
<br />
Connect a USB-C cable to the "DEBUG PORT" USB-C port, and a second to the "DOWNLOAD" USB-C port. '''Cable direction for the latter matters, so if it doesn't show up after entering download mode, try rotating the USB-C connector to the other side!'''<br />
<br />
To enter rockusb mode, interrupt the boot by holding the "V+/REC" on-board button or mashing Ctrl+C very quickly on the serial comms, then type <code>download</code>.<br />
<br />
$ rkdeveloptool list<br />
<br />
should now show you the device somewhat like this:<br />
<br />
'''$ rkdeveloptool list'''<br />
DevNo=1 Vid=0x2207,Pid=0x350b,LocationID=204 Loader<br />
<br />
{{Template:note|'''Note:''' If you receive an error about being unable to create the comms object in the following steps, make sure you have the udev rules installed with [https://gitlab.com/pine64-org/quartz-bsp/rkdeveloptool/-/merge_requests/19 CounterPillow's RK3588 device id patch], install them to <code>/etc/udev/rules.d/</code> and <code>udevadm control --reload</code>}}<br />
<br />
Now, we can e.g. show the partitions on the eMMC:<br />
<br />
'''$ rkdeveloptool list-partitions'''<br />
# LBA start (sectors) LBA end (sectors) Size (bytes) Name <br />
00 8192 16383 4194304 security<br />
01 16384 24575 4194304 uboot<br />
02 24576 32767 4194304 trust<br />
03 32768 40959 4194304 misc<br />
04 40960 49151 4194304 dtbo<br />
05 49152 51199 1048576 vbmeta<br />
06 51200 133119 41943040 boot<br />
07 133120 329727 100663296 recovery<br />
08 329728 1116159 402653184 backup<br />
09 1116160 1902591 402653184 cache<br />
10 1902592 1935359 16777216 metadata<br />
11 1935360 1937407 1048576 baseparameter<br />
12 1937408 8310783 3263168512 super<br />
13 8310784 120831935 57610829824 userdata<br />
<br />
You can now use <code>rkdeveloptool write-partition partitionname yourfile</code> to overwrite one of the eMMC partitions.<br />
<br />
=== U-Boot + Kernel On SD, RootFS On eMMC ===<br />
<br />
This is the setup [[User:CounterPillow]] currently uses. In short, you'll need a vendor U-Boot on your SD card, with a boot partition on it that contains your <tt>extlinux.conf</tt>, device tree and kernel.<br />
<br />
==== Setting Up The SD Card ====<br />
<br />
Assuming your SD card is <tt>/dev/sdX</tt>, partition as e.g. follows:<br />
<br />
# parted -s /dev/sdX mklabel gpt<br />
# parted -s /dev/sdX mkpart loader 64s 8MiB<br />
# parted -s /dev/sdX mkpart uboot 8MiB 16MiB<br />
# parted -s /dev/sdX mkpart env 16MiB 32MiB<br />
# parted -s /dev/sdX mkpart efi fat32 32MiB 544MiB # increase size as you wish<br />
# parted -s /dev/sdX set 4 boot on<br />
<br />
Flash SPL and u-boot:<br />
# dd if=rk3588_spl_loader_v1.06.109.bin of=/dev/sdX1<br />
# dd if=uboot.img of=/dev/sdX2<br />
<br />
Then make the filesystem:<br />
# mkfs.vfat -n "efi" /dev/sdX4<br />
<br />
Mount it to e.g. <tt>/mnt/sdcardboot</tt>:<br />
# mount /dev/sda4 /mnt/sdcardboot<br />
<br />
Put the following in <tt>/mnt/sdcardboot/extlinux/extlinux.conf</tt>:<br />
default l0<br />
menu title QuartzPro64 Boot Menu<br />
prompt 0<br />
timeout 50<br />
<br />
label l0<br />
menu label Boot Jank Kernel SDMMC<br />
linux /jank<br />
fdt /dtbs/rockchip/rk3588-evb1-v10.dtb<br />
append earlycon=uart8250,mmio32,0xfeb50000 console=ttyS2,1500000n8 root=/dev/mmcblk0p14 rw rootwait<br />
<br />
Copy your kernel to <tt>/mnt/sdcardboot/jank</tt> and your DTB to <tt>/mnt/sdcardboot/dtbs/rockchip/rk3588-evb1-v10.dtb</tt>.<br />
<br />
Unmount it, we're done with the SD card.<br />
<br />
==== Creating The Root File System ====<br />
<br />
First, allocate a file the size of your desired root partition (larger sizes will take longer to transfer, don't make the same mistakes as CounterPillow did), here we choose 16G:<br />
$ fallocate -l 16G rootpart.bin<br />
<br />
then, make the filesystem on it. CounterPillow went for ext4 because nobody has ever been fired for using ext4:<br />
$ mkfs.ext4 rootpart.bin<br />
<br />
Cool, now mount it:<br />
# mount rootpart.bin /mnt/emmc-root<br />
<br />
Now we'll download the Arch Linux ARM generic rootfs tarball and go to town:<br />
$ wget -N http://os.archlinuxarm.org/os/ArchLinuxARM-aarch64-latest.tar.gz{,.sig}<br />
$ curl 'https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x68b3537f39a313b3e574d06777193f152bdbe6a6' | gpg --import=- # in case you're lacking the key<br />
$ gpg --verify ArchLinuxARM-aarch64-latest.tar.gz.sig # don't you dare skip this<br />
# bsdtar -xpf ArchLinuxARM-aarch64-latest.tar.gz -C /mnt/emmc-root # notice that this is run as root<br />
<br />
Then we just need to edit fstab. Get the UUID (not PARTUUID) from lsblk:<br />
$ lsblk -o NAME,SIZE,MOUNTPOINTS,UUID<br />
<br />
and put it in <tt>/mnt/emmc-root/etc/fstab</tt> as follows:<br />
UUID=''root-uuid-here'' / ext4 defaults 0 1<br />
<br />
Unmount <tt>/mnt/emmc-root</tt>, we're done with it.<br />
<br />
==== Flashing The Root File System With RockUSB ====<br />
<br />
{{Template:warning|This '''will''' destroy whatever data is on that userdata partition. But you're here to run Linux, not Android, right?}}<br />
<br />
Plug one USB-C cable into the debug UART port, the other into the download port. Yes you will need two USB-C cables (or A-to-C cables) for this, get over it.<br />
<br />
Plug in your board, reset it while hammering Ctrl+c on the debug UART until you get into a u-boot command line. Now enter the <code>download</code> command.<br />
<br />
If your device doesn't show up in <code>lsusb</code> or <code>rkdeveloptool list</code> command, pull out the download USB-C plug, rotate it axially by 180 Euler degrees, and plug it back in.<br />
<br />
Next, flash the partition. Depending on the size of it, this can take over an hour:<br />
$ rkdeveloptool write-partition userdata rootpart.bin<br />
<br />
==== Booting ====<br />
<br />
Unplug the download USB-C cable once done.<br />
<br />
Put the SD card in the board. Reset it. You can now boot and your rootfs on eMMC will be mounted and contains an ALARM userland.<br />
<br />
To update kernels or the device tree, just shut down the board, take out the SD card, write a new kernel or dtb to it, and plug it back in. No more need for rkdeveloptool, yay.<br />
<br />
== Resources ==<br />
<br />
=== Kernel ===<br />
<br />
* [http://lists.infradead.org/pipermail/linux-rockchip/ The linux-rockchip mailing list archives]<br />
* [https://patchwork.kernel.org/project/linux-rockchip/list/ linux-rockchip patchwork]<br />
* [https://github.com/neg2led/linux-quartz64 neggles / neg2led's mainline kernel repository with patches picked from the mailing list]<br />
* [https://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-misc.git/log/?h=rk3588 Sebastian Reichel's (SRE) rk3588 branch]<br />
* [https://github.com/rockchip-linux/kernel Rockchip BSP kernel tree]<br />
* [https://gitlab.collabora.com/hardware-enablement/rockchip-3588/linux Collabora RK3588 integration branch]<br />
* [https://gitlab.collabora.com/hardware-enablement/rockchip-3588/notes-for-rockchip-3588/-/blob/main/mainline-status.md Collabora Mainline Status Table]<br />
* [https://github.com/radxa/kernel/tree/stable-5.10-rock5 Radxa kernel tree, for reference, a lot is happening here]<br />
<br />
=== Misc ===<br />
<br />
* The quartz64 and quartz-dev channels on the PINE64 chats (bridged IRC, Matrix, Discord and Telegram)<br />
* [https://gitlab.com/pine64-org/quartz-bsp/rkdeveloptool PINE64 rkdeveloptool fork]<br />
* [https://github.com/CounterPillow/uboot-qp64 CounterPillow's uboot-qp64 repository], used with [https://github.com/rockchip-linux/rkbin/ the official rkbin repository]<br />
* [https://opensource.rock-chips.com/wiki_Main_Page Rockchip OpenSource wiki]<br />
* [https://github.com/collabora/rockchiprs rockchiprs] (rkdeveloptool replacement written in Rust)<br />
<br />
=== Documentation ===<br />
<br />
The documentation for the QuartzPro64 board and most of the documentation for the chips it uses hasn't been publicly released yet, but if you do own a QuartzPro64 board, [[User:CounterPillow|CounterPillow]] or [[User:Dsimic|dsimic]] will happily provide the documentation to you for the research or development purposes, if you ask them in the PINE64 [[Main Page#Chat Platforms|chat channels]]. We've got the following documents, some of which can also be found elsewhere on the Internet rather easily:<br />
<br />
* RK3588 datasheet<br />
* RK3588 technical reference manual (TRM), parts 1 and 2<br />
* RK3588 hardware design guide, machine translated to English from Chinese, and the original version in Chinese<br />
* RK860 datasheet, including register descriptions<br />
* RK806 datasheet, including register descriptions<br />
* [https://devzone.pine64.org/uploads/d392f228-d53b-11ec-9ab8-fe0395c0c83d/9fee695f-39a4-4858-a58a-c91b86d4fa2c/QuartzPro64-DevBoard-Schematic-V1.0_20220216.pdf QuartzPro64 schematics]<br />
* [https://devzone.pine64.org/uploads/d392f228-d53b-11ec-9ab8-fe0395c0c83d/cf368836-966e-4c3c-9e0d-04a82a705d45/QuartzPro64-DevBoard-PCB-V1.0_20220216_topplace.pdf QuartzPro64 PCB top layout]<br />
* [https://devzone.pine64.org/uploads/d392f228-d53b-11ec-9ab8-fe0395c0c83d/ec260213-d4f7-4c61-ad1f-40ee7b7b7a35/QuartzPro64-DevBoard-PCB-V1.0_20220216_bottomplace.pdf QuartzPro64 PCB bottom layout]<br />
* [https://datasheet.lcsc.com/lcsc/2203311530_AMPAK-Tech-AP6275PR3_C2984106.pdf AMPAK AP6275PR3 (WiFi + BT module) datasheet]<br />
* AMPAK AP6275P (WiFi + BT module) datasheet<br />
<br />
[[Category:Rockchip RK3588]]<br />
[[Category:QuartzPro64]]</div>Tomhttps://wiki.pine64.org/index.php?title=QuartzPro64_Development&diff=21120QuartzPro64 Development2023-11-11T14:15:51Z<p>Tom: Remove superfluous mention of stale kernel fork.</p>
<hr />
<div>[[File:Quartzpro64_whole_board_top_resized.jpeg|250px|thumb|right|The QuartzPro64 development board, front side]]<br />
[[File:BoardBackSide.jpg|250px|thumb|right|Back side of the board]]<br />
<br />
A '''QuartzPro64 Development''' Wiki page before a '''QuartzPro64''' Wiki page? It's more likely than you think!<br />
<br />
This page will be used for both documenting the current development efforts and the board in general, as we don't know yet how a generally available QuartzPro64 will look like so documenting the dev board is probably best left to the development page.<br />
<br />
== Obtaining a Development Board ==<br />
<br />
Register for a preorder: [https://preorder.pine64.org/#/quartzpro64 https://preorder.pine64.org/#/quartzpro64]<br />
<br />
== Upstreaming Status ==<br />
<br />
* Linux Kernel DT: https://github.com/torvalds/linux/blob/master/arch/arm64/boot/dts/rockchip/rk3588-quartzpro64.dts<br />
* u-boot: https://github.com/u-boot/u-boot/blob/master/arch/arm/dts/rk3588-quartzpro64-u-boot.dtsi<br />
<br />
{| class="wikitable plainrowheaders" border="1"<br />
! scope="col" | Function<br />
! scope="col" colspan="2" | Status<br />
! scope="col" | Component<br />
! scope="col" | Notes<br />
|-<br />
! scope="row" | Video Output<br />
| colspan="2" style="background:#F99; text-align:center;"|Needs porting<br />
| <code>VOP2</code><br />
| Collabora said they'll work on this. The video output IP on the RK3588 should mostly be the same as the one on the RK356x, but the chip specific stuff will need to be integrated into the vop2 driver.<br />
|-<br />
! scope="row" | Video Input<br />
| colspan="2" style="background:#F99; text-align:center;"|Needs porting<br />
| <code>rk_hdmirx</code><br />
| Huge 3600 line driver, but generally seems to be in good condition<br />
|-<br />
! scope="row" | 3D Acceleration <br />
| style="background:#F99; text-align:center;"|Needs writing<br />
| style="background:#F99; text-align:center;"|Needs writing<br />
| <code>panfrost</code><br />
| Collabora said they'll work on this. New architecture, reportedly needs many changes to the kernel component of Panfrost.<br />
|-<br />
! scope="row" rowspan="4" | Video Decode <br />
| style="background:#F99; text-align:center;"|Needs writing<br />
| style="background:LightYellow; text-align:center;" rowspan="4"|GStreamer only, no ffmpeg<sup>[https://patchwork.ffmpeg.org/project/ffmpeg/list/?series=2898]</sup><br />
| <code>hantro</code> using <code>v4l2-requests</code><br />
| VDPU121 handling 1080p60 H.263/MPEG-4, MPEG-1 and MPEG-2<br />
|-<br />
| style="background:#F99; text-align:center;"|Needs writing<br />
| <code>rkvdec2</code> using <code>v4l2-requests</code><br />
| Nobody is known to be working on this for now. VDPU346 handling 8K60 H.265, H.264, VP9 and AVS<br />
|-<br />
| style="background:#F99; text-align:center;"|Needs writing<br />
| <code>rkdjpeg</code> using <code>v4l2-requests</code><br />
| [[User:CounterPillow]] is doing a little work on this. VDPU720 handling JPEG<br />
|-<br />
| style="background:LightYellow; text-align:center;"|In review<sup>[https://patchwork.kernel.org/project/linux-rockchip/list/?series=721724]</sup><br />
| <code>hantro</code> using <code>v4l2-requests</code><br />
| Collabora is working on this. VDPU981 handling 4K60 AV1<br />
|-<br />
! scope="row" rowspan="3" | Video Encode <br />
| style="background:#F99; text-align:center;"|Needs writing<br />
| style="text-align:center; background:LightYellow;"|GStreamer only<br />
| JPEG on VEPU121<br />
| Driver already exists, only minor changes needed.<br />
|-<br />
| style="background:#F99; text-align:center;"|Needs writing<br />
| style="text-align:center;"|?<br />
| H.264 on VEPU580<br />
| <br />
|-<br />
| style="background:#F99; text-align:center;"|Needs writing<br />
| style="text-align:center;"|?<br />
| H.265 on VEPU580<br />
| <br />
|-<br />
! scope="row" rowspan="2" | Audio <br />
| colspan="2" style="background:PaleGreen; text-align:center;"|Linux Mainline<br />
| <code>rockchip-i2s-tdm</code><br />
| As of 6.2<sup>[https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=c619bd4268ff9895760dab303b4eb15ed3d0f7e9]</sup><br />
|-<br />
| colspan="2" style="background:PaleGreen; text-align:center;"|Linux Mainline<br />
| <code>es8388</code> CODEC<br />
| <br />
|-<br />
! scope="row" | CRU<br />
| colspan="2" style="background:PaleGreen; text-align:center;"|Linux Mainline<br />
| <code>clk-rk3588</code><br />
| As of 6.2<sup>[https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=f1c506d152ff235ad621d3c25d061cb16da67214]</sup><br />
|-<br />
! scope="row" | MMC<br />
| colspan="2" style="background:PaleGreen; text-align:center;"|Linux Mainline<br />
| <code>sdhci-of-dwcmshc</code><br />
| As of 5.19<sup>[https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=bbbd8872825310b14bc6e04250d2cb5edcd55edb]</sup><br />
|-<br />
! scope="row" | pinctrl<br />
| colspan="2" style="background:PaleGreen; text-align:center;"|Linux Mainline<br />
| <code>pinctrl-rockchip</code><br />
| As of 5.19<sup>[https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=fdc33eba11c5919199f3d13dc53571cc7bf19d7d]</sup><br />
|-<br />
! scope="row" | GPIO<br />
| colspan="2" style="background:PaleGreen; text-align:center;"|Linux Mainline<br />
| <code>rockchip-gpio</code><br />
| As of 6.1<sup>[https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=cc165ba48aaf7d792e99d0c7e4b12e9625bc73e3]</sup><br />
|-<br />
! scope="row" | I<sup>2</sup>C<br />
| colspan="2" style="background:PaleGreen; text-align:center;"|Linux Mainline<br />
| <code>rk3x-i2c</code><br />
| Should be the same as RK3399, just needs devicetree work<br />
|-<br />
! scope="row" | SPI<br />
| colspan="2" style="background:PaleGreen; text-align:center;"|Linux Mainline<br />
| <code>rockchip-spi</code><br />
| Should be the same as previous SoCs, just needs devicetree work<br />
|-<br />
! scope="row" | PMU<br />
| colspan="2" style="background:LightYellow; text-align:center;"|In review<sup>[https://patchwork.kernel.org/project/linux-rockchip/list/?series=687286]</sup><br />
| <code>rk806</code><br />
| Talks over SPI<br />
|-<br />
! scope="row" | Regulators<br />
| colspan="2" style="background:#F99; text-align:center;"|Needs porting<br />
| <code>rk860</code><br />
| Talks over I<sup>2</sup>C<br />
|-<br />
! scope="row" | GMAC<br />
| colspan="2" style="background:PaleGreen; text-align:center;"|Linux Mainline<br />
| <code>dwmac-rk</code><br />
| As of 6.1<sup>[https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=2f2b60a0ec2826e5a2b2a1ddf68994a868dccbc1]</sup><br />
|-<br />
! scope="row" | Power Domains<br />
| colspan="2" style="background:PaleGreen; text-align:center;"|Linux Mainline<br />
| <code>rockchip-pm-domain</code><br />
| As of 6.1<sup>[https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=6541b424ce1dda616d3946e839f015c984df7a99]</sup><br />
|-<br />
! scope="row" | CAN<br />
| colspan="2" style="background:#F99; text-align:center;"|Needs porting<br />
| <code>rockchip_canfd</code><br />
| Not broken out on the QuartzPro64, so we probably won't be the ones porting it<br />
|-<br />
! scope="row" | SPDIF TX<br />
| colspan="2" style="background:#F99; text-align:center;"|May need porting<br />
| <code>rockchip-spdif</code><br />
| Genuinely just needs the compatible string added, I think, otherwise we're all good. Not broken out on QuartzPro64 dev board<br />
|-<br />
! scope="row" | SPDIF RX<br />
| colspan="2" style="background:#F99; text-align:center;"|Needs porting<br />
| <code>rockchip-spdifrx</code><br />
| Not broken out on QuartzPro64 dev board<br />
|-<br />
! scope="row" | PCIe<br />
| colspan="2" style="background:#F99; text-align:center;"|May need porting<br />
| <code>rockchip-dw-pcie</code><br />
| Downstream driver and upstream are quite different, look into how much work actually needs doing. Seems to be the same controller as rk3568 so maybe none?<br />
|-<br />
! scope="row" | NPU<br />
| style="background:#F99; text-align:center;"|Needs porting/writing<br />
| style="text-align:center;"|?<br />
| <code>rockchip-rknpu</code><br />
|-<br />
! scope="row" | USB 2.0<br />
| colspan="2" style="background:LightYellow; text-align:center;"|In review<sup>[https://patchwork.kernel.org/project/linux-rockchip/list/?series=749871]</sup><br />
| <code>phy-rockchip-inno-usb2</code><br />
| There's probably more to USB 2 than just the PHY but this is what I found for now<br />
|-<br />
! scope="row" | USB 3.0<br />
| colspan="2" style="background:#F99; text-align:center;"|?<br />
| <code>?</code><br />
|<br />
|-<br />
! scope="row" | SATA<br />
| colspan="2" style="background:PaleGreen; text-align:center;"|Linux Mainline<br />
| <code>ahci-dwc</code><br />
| Just needs the compatible added to the bindings, done in [https://patchwork.kernel.org/project/linux-rockchip/list/?series=749876]<br />
|-<br />
! scope="row" | Thermal<br />
| colspan="2" style="background:LightYellow; text-align:center;"|In review<sup>[https://patchwork.kernel.org/project/linux-rockchip/list/?series=687619]</sup><br />
| <code>rockchip-thermal</code><br />
|<br />
|-<br />
! scope="row" | Wifi & Bluetooth<br />
| colspan="2" style="background:#F99; text-align:center;"|?<br />
| <code>?</code><br />
|<br />
|-<br />
! scope="row" | HWRNG<br />
| colspan="2" style="background:#F99; text-align:center;"|Needs porting<br />
| <code>rockchip-rng</code><br />
| The code & DT work is easy to port & working<br />
|<br />
|-<br />
! scope="row" | RTC<br />
| colspan="2" style="background:PaleGreen; text-align:center;"|Linux Mainline<br />
| <code>hym8563</code><br />
| Should only need DT work (see [https://patchwork.kernel.org/project/linux-rockchip/list/?series=736799 here] for an example)<br />
|-<br />
! scope="row" | OTP<br />
| colspan="2" style="background:LightYellow; text-align:center;"|In review<sup>[https://patchwork.kernel.org/project/linux-rockchip/list/?series=744118]</sup><br />
| <code>rockchip-otp</code><br />
|<br />
|-<br />
! scope="row" | SARADC<br />
| colspan="2" style="background:LightYellow; text-align:center;"|In review<sup>[https://patchwork.kernel.org/project/linux-rockchip/list/?series=748188]</sup><br />
| <code>rockchip_saradc</code><br />
|<br />
|}<br />
<br />
== Hardware ==<br />
<br />
[[File:Quartzpro64_soc_and_ram_resized.jpeg|200px|thumb|right|The SoC and RAM packages]]<br />
<br />
=== General ===<br />
<br />
* RK3588 SoC (8 cores: 4x A76@2.4GHz + 4x A55@1.8GHz)<br />
* Mali G610MC4 GPU (4x Valhalla cores)<br />
* 16 GB LPDDR4X (SK hynix)<br />
* 64 GB eMMC (Foresee, soldered)<br />
* 1x USB-C (with video-alt mode)<br />
* 1x USB-C (FTDI debug UART, FT232RL)<br />
* 1x USB 3.0<br />
* 2x USB 2.0<br />
* 1x HDMI in<br />
* 2x HDMI out<br />
* 1x PCIe 3.0 slot (open-ended)<br />
* 1x SD / TF card slot<br />
* 2x SATA ports<br />
* 2x Gigabit ethernet (1x from SoC, 1x on PCIe, RTL8211F, RTL8111HS)<br />
* 1x WiFi & BT Module (AMPAK Tech AP6275PR3)<br />
* 2x SMA Antenna<br />
* 2x MIPI DPHY<br />
* 1x MIPI D/C PHY<br />
* 1x MIPI CSI<br />
* 1x PWM Fan header (4 pins)<br />
* 1x RTC battery socket (CR1220, 3V, see [[#Documentation|QuartzPro64 board schematics PDF]], page 21)<br />
* 1x MIC (soldered)<br />
* 1x audio output 3.5mm jack<br />
* Power in via DC 12V<br />
<br />
=== Cooler ===<br />
<br />
The board comes with two cooler mounts, a 4-hole mount that appears to be spaced 55x55mm apart, and the ~60mm diagonal "northbridge heatsink" mount the ROCKPro64 and Quartz64 Model A uses.<br />
<br />
RK3588 is slightly (<1mm?) taller than the DRAM chips, use a thick enough thermal pad instead of thermal compound.<br />
<br />
=== UART ===<br />
<br />
Plug in the USB-C port labelled "<tt>DEBUG PORT</tt>" on the QP64 board to another computer with a USB-A-to-C cable.<br />
<br />
It will show up as a FT232 USB Serial adapter in <code>lsusb</code>:<br />
<pre><br />
$ lsusb<br />
[...]<br />
Bus 005 Device 027: ID 0403:6001 Future Technology Devices International, Ltd FT232 Serial (UART) IC<br />
[...]<br />
</pre><br />
<br />
Baud rate is 1.5 mbauds or 1500000.<br />
<br />
Ensure you have the driver module loaded:<br />
<pre><br />
# modprobe ftdi_sio<br />
# lsmod | grep ftdi_sio<br />
ftdi_sio 61440 0<br />
usbserial 53248 1 ftdi_sio<br />
usbcore 290816 7 ftdi_sio,usbserial,xhci_hcd,usbhid,usbkbd,usbmouse,xhci_pci<br />
</pre><br />
<br />
If the above is not working, check the required driver is supported by your kernel, using one of the following commands:<br />
<pre><br />
$ zgrep FTDI_SIO /proc/config.gz<br />
CONFIG_USB_SERIAL_FTDI_SIO=m<br />
$ grep FTDI_SIO "/boot/config-$(uname -r)"<br />
CONFIG_USB_SERIAL_FTDI_SIO=m<br />
</pre><br />
<br />
Using the <code>dmesg</code> command, you should see something like the following:<br />
<pre><br />
[24784.535804] usb 5-3: new full-speed USB device number 3 using xhci_hcd<br />
[24784.710714] usb 5-3: New USB device found, idVendor=0403, idProduct=6001, bcdDevice= 6.00<br />
[24784.710723] usb 5-3: New USB device strings: Mfr=1, Product=2, SerialNumber=3<br />
[24784.710725] usb 5-3: Product: FT232R USB UART<br />
[24784.710727] usb 5-3: Manufacturer: FTDI<br />
[24784.710728] usb 5-3: SerialNumber: A10LLO86<br />
[24784.723858] usbcore: registered new interface driver usbserial_generic<br />
[24784.723865] usbserial: USB Serial support registered for generic<br />
[24784.725286] usbcore: registered new interface driver ftdi_sio<br />
[24784.725295] usbserial: USB Serial support registered for FTDI USB Serial Device<br />
[24784.725348] ftdi_sio 5-3:1.0: FTDI USB Serial Device converter detected<br />
[24784.725368] usb 5-3: Detected FT232RL<br />
[24784.731685] usb 5-3: FTDI USB Serial Device converter now attached to ttyUSB0<br />
</pre><br />
<br />
Then you can get console output from the QP64 with, for example:<br />
<br />
<pre><br />
screen /dev/ttyUSB0 1500000<br />
</pre><br />
<br />
=== Mounting Holes ===<br />
<br />
Can't be bothered to take a precise measurement of all the holes right now, just use [https://www.ebay.com/sch/i.html?kw=pc%20standoff%20kit some PC standoffs] and have the board sit on your desk, it's a dev board after all.<br />
<br />
See the PCB layout PDF files, linked in the [https://wiki.pine64.org/wiki/QuartzPro64_Development#Documentation Documentation] section.<br />
<br />
=== Storage ===<br />
<br />
[[File:Quartzpro64_emmc_resized.jpeg|200px|thumb|right|The eMMC on the dev board]]<br />
<br />
* Soldered on 64 GB FORESEE eMMC chip, it comes pre-flashed with some Android (you'll even get a brief bit of HDMI output)<br />
* microSD card slot<br />
* 2x SATA 3.0 (molex power connector for it not populated, but easy to remedy)<br />
<br />
=== Power ===<br />
<br />
[[File:Power_and_switch.jpg|100px|thumb|right|Power switch & barrel connector]]<br />
<br />
You can provide power to the board via the 12V barrel connector, it's 5.5mm OD/2.1mm ID barrel 'coaxial' type "M" centre-positive, the ROCKPro64 5A power supply from the PINE64 store will work. (TODO: add alternative ways).<br />
<br />
There is a hardware flip switch to power up / down the board.<br />
<br />
=== PMU ===<br />
<br />
[[File:Quartzpro64_pmu.jpeg|100px|thumb|right|The PMU]]<br />
<br />
2x RK806-2, not RK808 compatible. It's a dual PMU configuration where one PMU is a subordinate of the other.<br />
<br />
Verify this once we have access to SDK sources.<br />
<br />
=== Ethernet ===<br />
<br />
The RGMII ethernet port (near the SDCARD socket) is working if you use neg2led's linux-quartz64 repo.<br />
<br />
The other port (near the sound jack) is hooked to the SoC via PCIe and is currently reported working (on the matrix channel) with latest neggles kernel.<br />
<br />
== Boot ==<br />
<br />
The board can boot from the following interfaces:<br />
* SPI<br />
* eMMC<br />
* SD/MMC<br />
<br />
TODO: in which priority / order are those boot options tried ?<br />
<br />
== Recovery ==<br />
<br />
In the case you erase the eMMC and are unable to boot the board, you can use rkdeveloptool to recover the board. While you can use the [https://gitlab.com/pine64-org/quartz-bsp/rkdeveloptool Pine64 Fork], it is recommended to use [https://gitlab.com/cypheon/rkdeveloptool/-/tree/main?ref_type=heads cypheon's Fork] until some Pending PRs are merged in to [https://gitlab.com/pine64-org/quartz-bsp/rkdeveloptool/-/merge_requests?scope=all&state=opened&author_username=cypheon resolve issues] with larger files. This is important when working with the larger 64GB eMMC on the QuartzPro64.<br />
<br />
With rkdeveloptool installed, you will also need the rk3588_spl from rockchip to init the memory/flash when in maskrom mode. This can be downloaded from the [https://github.com/rockchip-linux/rkbin/blob/master/bin/rk35/rk3588_spl_v1.12.bin rockchip-linux/rkbin repo].<br />
<br />
Entering maskrom can be done in a variety of ways:<br />
<br />
* Hold the maskrom button (little white button labelled "MASKROM" next to SATA socket) during powerup, OR<br />
* Enter rockusb mode, and execute "rkdeveloptool reboot-maskrom".<br />
* Bork your eMMC and SD devices (how? erase?), in which case bootup will fallback to maskrom.<br />
<br />
=== Dumping the eMMC ===<br />
<br />
Boot the device into maskrom mode, and then verify rkdeveloptool can see the board. <br />
'''# rkdeveloptool list'''<br />
DevNo=1 Vid=0x2207,Pid=0x350b,LocationID=503 Maskrom<br />
<br />
Once the board shows up, load the rk3588_spl you downloaded earlier, and verify that the eMMC can be seen.<br />
'''# rkdeveloptool boot ./rk3588_spl_loader_v1.08.111.bin'''<br />
Downloading bootloader succeeded.<br />
'''# rkdeveloptool read-flash-info'''<br />
Flash Info:<br />
Manufacturer: SAMSUNG, value=00<br />
Flash Size: 59000 MB<br />
Flash Size: 120832000 Sectors<br />
Block Size: 512 KB<br />
Page Size: 2 KB<br />
ECC Bits: 0<br />
Access Time: 40<br />
Flash CS: Flash<0><br />
<br />
You can now dump the eMMC using the read command. Note that first you have to calculate the eMMC size, which can be done using the output from the previous flash info command. You need to take the sector count, and times it by the sector size, to get the total number of bytes. So in the above example, 120832000*512 so the total flash size is 61865984000.<br />
<br />
Using the calculated size, you can now dump the eMMC. Please note this will take 1-2 minutes.<br />
'''# rkdeveloptool read 0x0 61865984000 ./quartzpro64_emmc_dump.bin'''<br />
Read LBA to file (0%)<br />
...<br />
Read LBA to file (100%)<br />
<br />
You now have a full dump of the entire eMMC (SHA256 62cb4ae8d02aeacccf231fa1d00087cdc74b599790a274569305693aa205318d). Note that you can also use the list-partitions and read-partition commands to dump specific partitions, but this only shows GPT partitions on the eMMC. Because of this, it will NOT include the spl_loader found in the first 4MB of the eMMC!<br />
<br />
=== Flasing the eMMC ===<br />
<br />
Boot the device into maskrom mode, and then verify rkdeveloptool can see the board. <br />
'''# rkdeveloptool list'''<br />
DevNo=1 Vid=0x2207,Pid=0x350b,LocationID=503 Maskrom<br />
<br />
Once the board shows up, load the rk3588_spl you downloaded earlier, and verify that the eMMC can be seen.<br />
'''# rkdeveloptool boot ./rk3588_spl_loader_v1.08.111.bin'''<br />
Downloading bootloader succeeded.<br />
'''# rkdeveloptool read-flash-info'''<br />
Flash Info:<br />
Manufacturer: SAMSUNG, value=00<br />
Flash Size: 59000 MB<br />
Flash Size: 120832000 Sectors<br />
Block Size: 512 KB<br />
Page Size: 2 KB<br />
ECC Bits: 0<br />
Access Time: 40<br />
Flash CS: Flash<0><br />
<br />
You can now flash the device using either the write command, or write-partition command, depending on what you are trying to do. If you are looking to restore the entire eMMC from a backup you made, you would use the command below to accomplish this.<br />
'''rkdeveloptool write 0 ./quartzpro64_emmc_dump.bin'''<br />
<br />
== Immediate TODOs ==<br />
<br />
=== Enable cpufreq Stuff ===<br />
<br />
Current neggles kernel has the CPU at 1.2 GHz, apparently SRE has patches to enable cpufreq? (see below, in [[QuartzPro64_Development#Kernel|Resources]])<br />
<br />
=== Add RK3588 Support To VOP2 ===<br />
<br />
VOP2 IP on the RK3588 is very similar to the one on the RK356x, but it still needs platform specific code added.<br />
<br />
== Ways To Do Things ==<br />
<br />
=== Using rkdeveloptool ===<br />
<br />
Use the [https://gitlab.com/pine64-org/quartz-bsp/rkdeveloptool PINE64 fork of rkdeveloptool].<br />
<br />
Connect a USB-C cable to the "DEBUG PORT" USB-C port, and a second to the "DOWNLOAD" USB-C port. '''Cable direction for the latter matters, so if it doesn't show up after entering download mode, try rotating the USB-C connector to the other side!'''<br />
<br />
To enter rockusb mode, interrupt the boot by holding the "V+/REC" on-board button or mashing Ctrl+C very quickly on the serial comms, then type <code>download</code>.<br />
<br />
$ rkdeveloptool list<br />
<br />
should now show you the device somewhat like this:<br />
<br />
'''$ rkdeveloptool list'''<br />
DevNo=1 Vid=0x2207,Pid=0x350b,LocationID=204 Loader<br />
<br />
{{Template:note|'''Note:''' If you receive an error about being unable to create the comms object in the following steps, make sure you have the udev rules installed with [https://gitlab.com/pine64-org/quartz-bsp/rkdeveloptool/-/merge_requests/19 CounterPillow's RK3588 device id patch], install them to <code>/etc/udev/rules.d/</code> and <code>udevadm control --reload</code>}}<br />
<br />
Now, we can e.g. show the partitions on the eMMC:<br />
<br />
'''$ rkdeveloptool list-partitions'''<br />
# LBA start (sectors) LBA end (sectors) Size (bytes) Name <br />
00 8192 16383 4194304 security<br />
01 16384 24575 4194304 uboot<br />
02 24576 32767 4194304 trust<br />
03 32768 40959 4194304 misc<br />
04 40960 49151 4194304 dtbo<br />
05 49152 51199 1048576 vbmeta<br />
06 51200 133119 41943040 boot<br />
07 133120 329727 100663296 recovery<br />
08 329728 1116159 402653184 backup<br />
09 1116160 1902591 402653184 cache<br />
10 1902592 1935359 16777216 metadata<br />
11 1935360 1937407 1048576 baseparameter<br />
12 1937408 8310783 3263168512 super<br />
13 8310784 120831935 57610829824 userdata<br />
<br />
You can now use <code>rkdeveloptool write-partition partitionname yourfile</code> to overwrite one of the eMMC partitions.<br />
<br />
=== U-Boot + Kernel On SD, RootFS On eMMC ===<br />
<br />
This is the setup [[User:CounterPillow]] currently uses. In short, you'll need a vendor U-Boot on your SD card, with a boot partition on it that contains your <tt>extlinux.conf</tt>, device tree and kernel.<br />
<br />
==== Setting Up The SD Card ====<br />
<br />
Assuming your SD card is <tt>/dev/sdX</tt>, partition as e.g. follows:<br />
<br />
# parted -s /dev/sdX mklabel gpt<br />
# parted -s /dev/sdX mkpart loader 64s 8MiB<br />
# parted -s /dev/sdX mkpart uboot 8MiB 16MiB<br />
# parted -s /dev/sdX mkpart env 16MiB 32MiB<br />
# parted -s /dev/sdX mkpart efi fat32 32MiB 544MiB # increase size as you wish<br />
# parted -s /dev/sdX set 4 boot on<br />
<br />
Flash SPL and u-boot:<br />
# dd if=rk3588_spl_loader_v1.06.109.bin of=/dev/sdX1<br />
# dd if=uboot.img of=/dev/sdX2<br />
<br />
Then make the filesystem:<br />
# mkfs.vfat -n "efi" /dev/sdX4<br />
<br />
Mount it to e.g. <tt>/mnt/sdcardboot</tt>:<br />
# mount /dev/sda4 /mnt/sdcardboot<br />
<br />
Put the following in <tt>/mnt/sdcardboot/extlinux/extlinux.conf</tt>:<br />
default l0<br />
menu title QuartzPro64 Boot Menu<br />
prompt 0<br />
timeout 50<br />
<br />
label l0<br />
menu label Boot Jank Kernel SDMMC<br />
linux /jank<br />
fdt /dtbs/rockchip/rk3588-evb1-v10.dtb<br />
append earlycon=uart8250,mmio32,0xfeb50000 console=ttyS2,1500000n8 root=/dev/mmcblk0p14 rw rootwait<br />
<br />
Copy your kernel to <tt>/mnt/sdcardboot/jank</tt> and your DTB to <tt>/mnt/sdcardboot/dtbs/rockchip/rk3588-evb1-v10.dtb</tt>.<br />
<br />
Unmount it, we're done with the SD card.<br />
<br />
==== Creating The Root File System ====<br />
<br />
First, allocate a file the size of your desired root partition (larger sizes will take longer to transfer, don't make the same mistakes as CounterPillow did), here we choose 16G:<br />
$ fallocate -l 16G rootpart.bin<br />
<br />
then, make the filesystem on it. CounterPillow went for ext4 because nobody has ever been fired for using ext4:<br />
$ mkfs.ext4 rootpart.bin<br />
<br />
Cool, now mount it:<br />
# mount rootpart.bin /mnt/emmc-root<br />
<br />
Now we'll download the Arch Linux ARM generic rootfs tarball and go to town:<br />
$ wget -N http://os.archlinuxarm.org/os/ArchLinuxARM-aarch64-latest.tar.gz{,.sig}<br />
$ curl 'https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x68b3537f39a313b3e574d06777193f152bdbe6a6' | gpg --import=- # in case you're lacking the key<br />
$ gpg --verify ArchLinuxARM-aarch64-latest.tar.gz.sig # don't you dare skip this<br />
# bsdtar -xpf ArchLinuxARM-aarch64-latest.tar.gz -C /mnt/emmc-root # notice that this is run as root<br />
<br />
Then we just need to edit fstab. Get the UUID (not PARTUUID) from lsblk:<br />
$ lsblk -o NAME,SIZE,MOUNTPOINTS,UUID<br />
<br />
and put it in <tt>/mnt/emmc-root/etc/fstab</tt> as follows:<br />
UUID=''root-uuid-here'' / ext4 defaults 0 1<br />
<br />
Unmount <tt>/mnt/emmc-root</tt>, we're done with it.<br />
<br />
==== Flashing The Root File System With RockUSB ====<br />
<br />
{{Template:warning|This '''will''' destroy whatever data is on that userdata partition. But you're here to run Linux, not Android, right?}}<br />
<br />
Plug one USB-C cable into the debug UART port, the other into the download port. Yes you will need two USB-C cables (or A-to-C cables) for this, get over it.<br />
<br />
Plug in your board, reset it while hammering Ctrl+c on the debug UART until you get into a u-boot command line. Now enter the <code>download</code> command.<br />
<br />
If your device doesn't show up in <code>lsusb</code> or <code>rkdeveloptool list</code> command, pull out the download USB-C plug, rotate it axially by 180 Euler degrees, and plug it back in.<br />
<br />
Next, flash the partition. Depending on the size of it, this can take over an hour:<br />
$ rkdeveloptool write-partition userdata rootpart.bin<br />
<br />
==== Booting ====<br />
<br />
Unplug the download USB-C cable once done.<br />
<br />
Put the SD card in the board. Reset it. You can now boot and your rootfs on eMMC will be mounted and contains an ALARM userland.<br />
<br />
To update kernels or the device tree, just shut down the board, take out the SD card, write a new kernel or dtb to it, and plug it back in. No more need for rkdeveloptool, yay.<br />
<br />
== Resources ==<br />
<br />
=== Kernel ===<br />
<br />
* [http://lists.infradead.org/pipermail/linux-rockchip/ The linux-rockchip mailing list archives]<br />
* [https://patchwork.kernel.org/project/linux-rockchip/list/ linux-rockchip patchwork]<br />
* [https://github.com/neg2led/linux-quartz64 neggles / neg2led's mainline kernel repository with patches picked from the mailing list]<br />
* [https://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-misc.git/log/?h=rk3588 Sebastian Reichel's (SRE) rk3588 branch]<br />
* [https://github.com/rockchip-linux/kernel Rockchip BSP kernel tree]<br />
* [https://gitlab.collabora.com/hardware-enablement/rockchip-3588/linux Collabora RK3588 integration branch]<br />
* [https://gitlab.collabora.com/hardware-enablement/rockchip-3588/notes-for-rockchip-3588/-/blob/main/mainline-status.md Collabora Mainline Status Table]<br />
* [https://github.com/radxa/kernel/tree/stable-5.10-rock5 Radxa kernel tree, for reference, a lot is happening here]<br />
<br />
=== Misc ===<br />
<br />
* The quartz64 and quartz-dev channels on the PINE64 chats (bridged IRC, Matrix, Discord and Telegram)<br />
* [https://gitlab.com/pine64-org/quartz-bsp/rkdeveloptool PINE64 rkdeveloptool fork]<br />
* [https://github.com/CounterPillow/uboot-qp64 CounterPillow's uboot-qp64 repository], used with [https://github.com/rockchip-linux/rkbin/ the official rkbin repository]<br />
* [https://opensource.rock-chips.com/wiki_Main_Page Rockchip OpenSource wiki]<br />
* [https://github.com/collabora/rockchiprs rockchiprs] (rkdeveloptool replacement written in Rust)<br />
<br />
=== Documentation ===<br />
<br />
The documentation for the QuartzPro64 board and most of the documentation for the chips it uses hasn't been publicly released yet, but if you do own a QuartzPro64 board, [[User:CounterPillow|CounterPillow]] or [[User:Dsimic|dsimic]] will happily provide the documentation to you for the research or development purposes, if you ask them in the PINE64 [[Main Page#Chat Platforms|chat channels]]. We've got the following documents, some of which can also be found elsewhere on the Internet rather easily:<br />
<br />
* RK3588 datasheet<br />
* RK3588 technical reference manual (TRM), parts 1 and 2<br />
* RK3588 hardware design guide, machine translated to English from Chinese, and the original version in Chinese<br />
* RK860 datasheet, including register descriptions<br />
* RK806 datasheet, including register descriptions<br />
* [https://devzone.pine64.org/uploads/d392f228-d53b-11ec-9ab8-fe0395c0c83d/9fee695f-39a4-4858-a58a-c91b86d4fa2c/QuartzPro64-DevBoard-Schematic-V1.0_20220216.pdf QuartzPro64 schematics]<br />
* [https://devzone.pine64.org/uploads/d392f228-d53b-11ec-9ab8-fe0395c0c83d/cf368836-966e-4c3c-9e0d-04a82a705d45/QuartzPro64-DevBoard-PCB-V1.0_20220216_topplace.pdf QuartzPro64 PCB top layout]<br />
* [https://devzone.pine64.org/uploads/d392f228-d53b-11ec-9ab8-fe0395c0c83d/ec260213-d4f7-4c61-ad1f-40ee7b7b7a35/QuartzPro64-DevBoard-PCB-V1.0_20220216_bottomplace.pdf QuartzPro64 PCB bottom layout]<br />
* [https://datasheet.lcsc.com/lcsc/2203311530_AMPAK-Tech-AP6275PR3_C2984106.pdf AMPAK AP6275PR3 (WiFi + BT module) datasheet]<br />
* AMPAK AP6275P (WiFi + BT module) datasheet<br />
<br />
[[Category:Rockchip RK3588]]<br />
[[Category:QuartzPro64]]</div>Tomhttps://wiki.pine64.org/index.php?title=QuartzPro64_Development&diff=21119QuartzPro64 Development2023-11-11T14:14:03Z<p>Tom: /* Upstreaming Status */ Link to the kernel and u-boot mainline DTs</p>
<hr />
<div>[[File:Quartzpro64_whole_board_top_resized.jpeg|250px|thumb|right|The QuartzPro64 development board, front side]]<br />
[[File:BoardBackSide.jpg|250px|thumb|right|Back side of the board]]<br />
<br />
A '''QuartzPro64 Development''' Wiki page before a '''QuartzPro64''' Wiki page? It's more likely than you think!<br />
<br />
This page will be used for both documenting the current development efforts and the board in general, as we don't know yet how a generally available QuartzPro64 will look like so documenting the dev board is probably best left to the development page.<br />
<br />
== Obtaining a Development Board ==<br />
<br />
Register for a preorder: [https://preorder.pine64.org/#/quartzpro64 https://preorder.pine64.org/#/quartzpro64]<br />
<br />
== Upstreaming Status ==<br />
<br />
* Linux Kernel DT: https://github.com/torvalds/linux/blob/master/arch/arm64/boot/dts/rockchip/rk3588-quartzpro64.dts<br />
* u-boot: https://github.com/u-boot/u-boot/blob/master/arch/arm/dts/rk3588-quartzpro64-u-boot.dtsi<br />
<br />
{| class="wikitable plainrowheaders" border="1"<br />
! scope="col" | Function<br />
! scope="col" colspan="2" | Status<br />
! scope="col" | Component<br />
! scope="col" | Notes<br />
|-<br />
! scope="row" | Video Output<br />
| colspan="2" style="background:#F99; text-align:center;"|Needs porting<br />
| <code>VOP2</code><br />
| Collabora said they'll work on this. The video output IP on the RK3588 should mostly be the same as the one on the RK356x, but the chip specific stuff will need to be integrated into the vop2 driver.<br />
|-<br />
! scope="row" | Video Input<br />
| colspan="2" style="background:#F99; text-align:center;"|Needs porting<br />
| <code>rk_hdmirx</code><br />
| Huge 3600 line driver, but generally seems to be in good condition<br />
|-<br />
! scope="row" | 3D Acceleration <br />
| style="background:#F99; text-align:center;"|Needs writing<br />
| style="background:#F99; text-align:center;"|Needs writing<br />
| <code>panfrost</code><br />
| Collabora said they'll work on this. New architecture, reportedly needs many changes to the kernel component of Panfrost.<br />
|-<br />
! scope="row" rowspan="4" | Video Decode <br />
| style="background:#F99; text-align:center;"|Needs writing<br />
| style="background:LightYellow; text-align:center;" rowspan="4"|GStreamer only, no ffmpeg<sup>[https://patchwork.ffmpeg.org/project/ffmpeg/list/?series=2898]</sup><br />
| <code>hantro</code> using <code>v4l2-requests</code><br />
| VDPU121 handling 1080p60 H.263/MPEG-4, MPEG-1 and MPEG-2<br />
|-<br />
| style="background:#F99; text-align:center;"|Needs writing<br />
| <code>rkvdec2</code> using <code>v4l2-requests</code><br />
| Nobody is known to be working on this for now. VDPU346 handling 8K60 H.265, H.264, VP9 and AVS<br />
|-<br />
| style="background:#F99; text-align:center;"|Needs writing<br />
| <code>rkdjpeg</code> using <code>v4l2-requests</code><br />
| [[User:CounterPillow]] is doing a little work on this. VDPU720 handling JPEG<br />
|-<br />
| style="background:LightYellow; text-align:center;"|In review<sup>[https://patchwork.kernel.org/project/linux-rockchip/list/?series=721724]</sup><br />
| <code>hantro</code> using <code>v4l2-requests</code><br />
| Collabora is working on this. VDPU981 handling 4K60 AV1<br />
|-<br />
! scope="row" rowspan="3" | Video Encode <br />
| style="background:#F99; text-align:center;"|Needs writing<br />
| style="text-align:center; background:LightYellow;"|GStreamer only<br />
| JPEG on VEPU121<br />
| Driver already exists, only minor changes needed.<br />
|-<br />
| style="background:#F99; text-align:center;"|Needs writing<br />
| style="text-align:center;"|?<br />
| H.264 on VEPU580<br />
| <br />
|-<br />
| style="background:#F99; text-align:center;"|Needs writing<br />
| style="text-align:center;"|?<br />
| H.265 on VEPU580<br />
| <br />
|-<br />
! scope="row" rowspan="2" | Audio <br />
| colspan="2" style="background:PaleGreen; text-align:center;"|Linux Mainline<br />
| <code>rockchip-i2s-tdm</code><br />
| As of 6.2<sup>[https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=c619bd4268ff9895760dab303b4eb15ed3d0f7e9]</sup><br />
|-<br />
| colspan="2" style="background:PaleGreen; text-align:center;"|Linux Mainline<br />
| <code>es8388</code> CODEC<br />
| <br />
|-<br />
! scope="row" | CRU<br />
| colspan="2" style="background:PaleGreen; text-align:center;"|Linux Mainline<br />
| <code>clk-rk3588</code><br />
| As of 6.2<sup>[https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=f1c506d152ff235ad621d3c25d061cb16da67214]</sup><br />
|-<br />
! scope="row" | MMC<br />
| colspan="2" style="background:PaleGreen; text-align:center;"|Linux Mainline<br />
| <code>sdhci-of-dwcmshc</code><br />
| As of 5.19<sup>[https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=bbbd8872825310b14bc6e04250d2cb5edcd55edb]</sup><br />
|-<br />
! scope="row" | pinctrl<br />
| colspan="2" style="background:PaleGreen; text-align:center;"|Linux Mainline<br />
| <code>pinctrl-rockchip</code><br />
| As of 5.19<sup>[https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=fdc33eba11c5919199f3d13dc53571cc7bf19d7d]</sup><br />
|-<br />
! scope="row" | GPIO<br />
| colspan="2" style="background:PaleGreen; text-align:center;"|Linux Mainline<br />
| <code>rockchip-gpio</code><br />
| As of 6.1<sup>[https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=cc165ba48aaf7d792e99d0c7e4b12e9625bc73e3]</sup><br />
|-<br />
! scope="row" | I<sup>2</sup>C<br />
| colspan="2" style="background:PaleGreen; text-align:center;"|Linux Mainline<br />
| <code>rk3x-i2c</code><br />
| Should be the same as RK3399, just needs devicetree work<br />
|-<br />
! scope="row" | SPI<br />
| colspan="2" style="background:PaleGreen; text-align:center;"|Linux Mainline<br />
| <code>rockchip-spi</code><br />
| Should be the same as previous SoCs, just needs devicetree work<br />
|-<br />
! scope="row" | PMU<br />
| colspan="2" style="background:LightYellow; text-align:center;"|In review<sup>[https://patchwork.kernel.org/project/linux-rockchip/list/?series=687286]</sup><br />
| <code>rk806</code><br />
| Talks over SPI<br />
|-<br />
! scope="row" | Regulators<br />
| colspan="2" style="background:#F99; text-align:center;"|Needs porting<br />
| <code>rk860</code><br />
| Talks over I<sup>2</sup>C<br />
|-<br />
! scope="row" | GMAC<br />
| colspan="2" style="background:PaleGreen; text-align:center;"|Linux Mainline<br />
| <code>dwmac-rk</code><br />
| As of 6.1<sup>[https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=2f2b60a0ec2826e5a2b2a1ddf68994a868dccbc1]</sup><br />
|-<br />
! scope="row" | Power Domains<br />
| colspan="2" style="background:PaleGreen; text-align:center;"|Linux Mainline<br />
| <code>rockchip-pm-domain</code><br />
| As of 6.1<sup>[https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=6541b424ce1dda616d3946e839f015c984df7a99]</sup><br />
|-<br />
! scope="row" | CAN<br />
| colspan="2" style="background:#F99; text-align:center;"|Needs porting<br />
| <code>rockchip_canfd</code><br />
| Not broken out on the QuartzPro64, so we probably won't be the ones porting it<br />
|-<br />
! scope="row" | SPDIF TX<br />
| colspan="2" style="background:#F99; text-align:center;"|May need porting<br />
| <code>rockchip-spdif</code><br />
| Genuinely just needs the compatible string added, I think, otherwise we're all good. Not broken out on QuartzPro64 dev board<br />
|-<br />
! scope="row" | SPDIF RX<br />
| colspan="2" style="background:#F99; text-align:center;"|Needs porting<br />
| <code>rockchip-spdifrx</code><br />
| Not broken out on QuartzPro64 dev board<br />
|-<br />
! scope="row" | PCIe<br />
| colspan="2" style="background:#F99; text-align:center;"|May need porting<br />
| <code>rockchip-dw-pcie</code><br />
| Downstream driver and upstream are quite different, look into how much work actually needs doing. Seems to be the same controller as rk3568 so maybe none?<br />
|-<br />
! scope="row" | NPU<br />
| style="background:#F99; text-align:center;"|Needs porting/writing<br />
| style="text-align:center;"|?<br />
| <code>rockchip-rknpu</code><br />
|-<br />
! scope="row" | USB 2.0<br />
| colspan="2" style="background:LightYellow; text-align:center;"|In review<sup>[https://patchwork.kernel.org/project/linux-rockchip/list/?series=749871]</sup><br />
| <code>phy-rockchip-inno-usb2</code><br />
| There's probably more to USB 2 than just the PHY but this is what I found for now<br />
|-<br />
! scope="row" | USB 3.0<br />
| colspan="2" style="background:#F99; text-align:center;"|?<br />
| <code>?</code><br />
|<br />
|-<br />
! scope="row" | SATA<br />
| colspan="2" style="background:PaleGreen; text-align:center;"|Linux Mainline<br />
| <code>ahci-dwc</code><br />
| Just needs the compatible added to the bindings, done in [https://patchwork.kernel.org/project/linux-rockchip/list/?series=749876]<br />
|-<br />
! scope="row" | Thermal<br />
| colspan="2" style="background:LightYellow; text-align:center;"|In review<sup>[https://patchwork.kernel.org/project/linux-rockchip/list/?series=687619]</sup><br />
| <code>rockchip-thermal</code><br />
|<br />
|-<br />
! scope="row" | Wifi & Bluetooth<br />
| colspan="2" style="background:#F99; text-align:center;"|?<br />
| <code>?</code><br />
|<br />
|-<br />
! scope="row" | HWRNG<br />
| colspan="2" style="background:#F99; text-align:center;"|Needs porting<br />
| <code>rockchip-rng</code><br />
| The code & DT work is easy to port & working<br />
|<br />
|-<br />
! scope="row" | RTC<br />
| colspan="2" style="background:PaleGreen; text-align:center;"|Linux Mainline<br />
| <code>hym8563</code><br />
| Should only need DT work (see [https://patchwork.kernel.org/project/linux-rockchip/list/?series=736799 here] for an example)<br />
|-<br />
! scope="row" | OTP<br />
| colspan="2" style="background:LightYellow; text-align:center;"|In review<sup>[https://patchwork.kernel.org/project/linux-rockchip/list/?series=744118]</sup><br />
| <code>rockchip-otp</code><br />
|<br />
|-<br />
! scope="row" | SARADC<br />
| colspan="2" style="background:LightYellow; text-align:center;"|In review<sup>[https://patchwork.kernel.org/project/linux-rockchip/list/?series=748188]</sup><br />
| <code>rockchip_saradc</code><br />
|<br />
|}<br />
<br />
== Hardware ==<br />
<br />
[[File:Quartzpro64_soc_and_ram_resized.jpeg|200px|thumb|right|The SoC and RAM packages]]<br />
<br />
=== General ===<br />
<br />
* RK3588 SoC (8 cores: 4x A76@2.4GHz + 4x A55@1.8GHz)<br />
* Mali G610MC4 GPU (4x Valhalla cores)<br />
* 16 GB LPDDR4X (SK hynix)<br />
* 64 GB eMMC (Foresee, soldered)<br />
* 1x USB-C (with video-alt mode)<br />
* 1x USB-C (FTDI debug UART, FT232RL)<br />
* 1x USB 3.0<br />
* 2x USB 2.0<br />
* 1x HDMI in<br />
* 2x HDMI out<br />
* 1x PCIe 3.0 slot (open-ended)<br />
* 1x SD / TF card slot<br />
* 2x SATA ports<br />
* 2x Gigabit ethernet (1x from SoC, 1x on PCIe, RTL8211F, RTL8111HS)<br />
* 1x WiFi & BT Module (AMPAK Tech AP6275PR3)<br />
* 2x SMA Antenna<br />
* 2x MIPI DPHY<br />
* 1x MIPI D/C PHY<br />
* 1x MIPI CSI<br />
* 1x PWM Fan header (4 pins)<br />
* 1x RTC battery socket (CR1220, 3V, see [[#Documentation|QuartzPro64 board schematics PDF]], page 21)<br />
* 1x MIC (soldered)<br />
* 1x audio output 3.5mm jack<br />
* Power in via DC 12V<br />
<br />
=== Cooler ===<br />
<br />
The board comes with two cooler mounts, a 4-hole mount that appears to be spaced 55x55mm apart, and the ~60mm diagonal "northbridge heatsink" mount the ROCKPro64 and Quartz64 Model A uses.<br />
<br />
RK3588 is slightly (<1mm?) taller than the DRAM chips, use a thick enough thermal pad instead of thermal compound.<br />
<br />
=== UART ===<br />
<br />
Plug in the USB-C port labelled "<tt>DEBUG PORT</tt>" on the QP64 board to another computer with a USB-A-to-C cable.<br />
<br />
It will show up as a FT232 USB Serial adapter in <code>lsusb</code>:<br />
<pre><br />
$ lsusb<br />
[...]<br />
Bus 005 Device 027: ID 0403:6001 Future Technology Devices International, Ltd FT232 Serial (UART) IC<br />
[...]<br />
</pre><br />
<br />
Baud rate is 1.5 mbauds or 1500000.<br />
<br />
Ensure you have the driver module loaded:<br />
<pre><br />
# modprobe ftdi_sio<br />
# lsmod | grep ftdi_sio<br />
ftdi_sio 61440 0<br />
usbserial 53248 1 ftdi_sio<br />
usbcore 290816 7 ftdi_sio,usbserial,xhci_hcd,usbhid,usbkbd,usbmouse,xhci_pci<br />
</pre><br />
<br />
If the above is not working, check the required driver is supported by your kernel, using one of the following commands:<br />
<pre><br />
$ zgrep FTDI_SIO /proc/config.gz<br />
CONFIG_USB_SERIAL_FTDI_SIO=m<br />
$ grep FTDI_SIO "/boot/config-$(uname -r)"<br />
CONFIG_USB_SERIAL_FTDI_SIO=m<br />
</pre><br />
<br />
Using the <code>dmesg</code> command, you should see something like the following:<br />
<pre><br />
[24784.535804] usb 5-3: new full-speed USB device number 3 using xhci_hcd<br />
[24784.710714] usb 5-3: New USB device found, idVendor=0403, idProduct=6001, bcdDevice= 6.00<br />
[24784.710723] usb 5-3: New USB device strings: Mfr=1, Product=2, SerialNumber=3<br />
[24784.710725] usb 5-3: Product: FT232R USB UART<br />
[24784.710727] usb 5-3: Manufacturer: FTDI<br />
[24784.710728] usb 5-3: SerialNumber: A10LLO86<br />
[24784.723858] usbcore: registered new interface driver usbserial_generic<br />
[24784.723865] usbserial: USB Serial support registered for generic<br />
[24784.725286] usbcore: registered new interface driver ftdi_sio<br />
[24784.725295] usbserial: USB Serial support registered for FTDI USB Serial Device<br />
[24784.725348] ftdi_sio 5-3:1.0: FTDI USB Serial Device converter detected<br />
[24784.725368] usb 5-3: Detected FT232RL<br />
[24784.731685] usb 5-3: FTDI USB Serial Device converter now attached to ttyUSB0<br />
</pre><br />
<br />
Then you can get console output from the QP64 with, for example:<br />
<br />
<pre><br />
screen /dev/ttyUSB0 1500000<br />
</pre><br />
<br />
=== Mounting Holes ===<br />
<br />
Can't be bothered to take a precise measurement of all the holes right now, just use [https://www.ebay.com/sch/i.html?kw=pc%20standoff%20kit some PC standoffs] and have the board sit on your desk, it's a dev board after all.<br />
<br />
See the PCB layout PDF files, linked in the [https://wiki.pine64.org/wiki/QuartzPro64_Development#Documentation Documentation] section.<br />
<br />
=== Storage ===<br />
<br />
[[File:Quartzpro64_emmc_resized.jpeg|200px|thumb|right|The eMMC on the dev board]]<br />
<br />
* Soldered on 64 GB FORESEE eMMC chip, it comes pre-flashed with some Android (you'll even get a brief bit of HDMI output)<br />
* microSD card slot<br />
* 2x SATA 3.0 (molex power connector for it not populated, but easy to remedy)<br />
<br />
=== Power ===<br />
<br />
[[File:Power_and_switch.jpg|100px|thumb|right|Power switch & barrel connector]]<br />
<br />
You can provide power to the board via the 12V barrel connector, it's 5.5mm OD/2.1mm ID barrel 'coaxial' type "M" centre-positive, the ROCKPro64 5A power supply from the PINE64 store will work. (TODO: add alternative ways).<br />
<br />
There is a hardware flip switch to power up / down the board.<br />
<br />
=== PMU ===<br />
<br />
[[File:Quartzpro64_pmu.jpeg|100px|thumb|right|The PMU]]<br />
<br />
2x RK806-2, not RK808 compatible. It's a dual PMU configuration where one PMU is a subordinate of the other.<br />
<br />
Verify this once we have access to SDK sources.<br />
<br />
=== Ethernet ===<br />
<br />
The RGMII ethernet port (near the SDCARD socket) is working if you use neg2led's linux-quartz64 repo.<br />
<br />
The other port (near the sound jack) is hooked to the SoC via PCIe and is currently reported working (on the matrix channel) with latest neggles kernel.<br />
<br />
== Boot ==<br />
<br />
The board can boot from the following interfaces:<br />
* SPI<br />
* eMMC<br />
* SD/MMC<br />
<br />
TODO: in which priority / order are those boot options tried ?<br />
<br />
== Recovery ==<br />
<br />
In the case you erase the eMMC and are unable to boot the board, you can use rkdeveloptool to recover the board. While you can use the [https://gitlab.com/pine64-org/quartz-bsp/rkdeveloptool Pine64 Fork], it is recommended to use [https://gitlab.com/cypheon/rkdeveloptool/-/tree/main?ref_type=heads cypheon's Fork] until some Pending PRs are merged in to [https://gitlab.com/pine64-org/quartz-bsp/rkdeveloptool/-/merge_requests?scope=all&state=opened&author_username=cypheon resolve issues] with larger files. This is important when working with the larger 64GB eMMC on the QuartzPro64.<br />
<br />
With rkdeveloptool installed, you will also need the rk3588_spl from rockchip to init the memory/flash when in maskrom mode. This can be downloaded from the [https://github.com/rockchip-linux/rkbin/blob/master/bin/rk35/rk3588_spl_v1.12.bin rockchip-linux/rkbin repo].<br />
<br />
Entering maskrom can be done in a variety of ways:<br />
<br />
* Hold the maskrom button (little white button labelled "MASKROM" next to SATA socket) during powerup, OR<br />
* Enter rockusb mode, and execute "rkdeveloptool reboot-maskrom".<br />
* Bork your eMMC and SD devices (how? erase?), in which case bootup will fallback to maskrom.<br />
<br />
=== Dumping the eMMC ===<br />
<br />
Boot the device into maskrom mode, and then verify rkdeveloptool can see the board. <br />
'''# rkdeveloptool list'''<br />
DevNo=1 Vid=0x2207,Pid=0x350b,LocationID=503 Maskrom<br />
<br />
Once the board shows up, load the rk3588_spl you downloaded earlier, and verify that the eMMC can be seen.<br />
'''# rkdeveloptool boot ./rk3588_spl_loader_v1.08.111.bin'''<br />
Downloading bootloader succeeded.<br />
'''# rkdeveloptool read-flash-info'''<br />
Flash Info:<br />
Manufacturer: SAMSUNG, value=00<br />
Flash Size: 59000 MB<br />
Flash Size: 120832000 Sectors<br />
Block Size: 512 KB<br />
Page Size: 2 KB<br />
ECC Bits: 0<br />
Access Time: 40<br />
Flash CS: Flash<0><br />
<br />
You can now dump the eMMC using the read command. Note that first you have to calculate the eMMC size, which can be done using the output from the previous flash info command. You need to take the sector count, and times it by the sector size, to get the total number of bytes. So in the above example, 120832000*512 so the total flash size is 61865984000.<br />
<br />
Using the calculated size, you can now dump the eMMC. Please note this will take 1-2 minutes.<br />
'''# rkdeveloptool read 0x0 61865984000 ./quartzpro64_emmc_dump.bin'''<br />
Read LBA to file (0%)<br />
...<br />
Read LBA to file (100%)<br />
<br />
You now have a full dump of the entire eMMC (SHA256 62cb4ae8d02aeacccf231fa1d00087cdc74b599790a274569305693aa205318d). Note that you can also use the list-partitions and read-partition commands to dump specific partitions, but this only shows GPT partitions on the eMMC. Because of this, it will NOT include the spl_loader found in the first 4MB of the eMMC!<br />
<br />
=== Flasing the eMMC ===<br />
<br />
Boot the device into maskrom mode, and then verify rkdeveloptool can see the board. <br />
'''# rkdeveloptool list'''<br />
DevNo=1 Vid=0x2207,Pid=0x350b,LocationID=503 Maskrom<br />
<br />
Once the board shows up, load the rk3588_spl you downloaded earlier, and verify that the eMMC can be seen.<br />
'''# rkdeveloptool boot ./rk3588_spl_loader_v1.08.111.bin'''<br />
Downloading bootloader succeeded.<br />
'''# rkdeveloptool read-flash-info'''<br />
Flash Info:<br />
Manufacturer: SAMSUNG, value=00<br />
Flash Size: 59000 MB<br />
Flash Size: 120832000 Sectors<br />
Block Size: 512 KB<br />
Page Size: 2 KB<br />
ECC Bits: 0<br />
Access Time: 40<br />
Flash CS: Flash<0><br />
<br />
You can now flash the device using either the write command, or write-partition command, depending on what you are trying to do. If you are looking to restore the entire eMMC from a backup you made, you would use the command below to accomplish this.<br />
'''rkdeveloptool write 0 ./quartzpro64_emmc_dump.bin'''<br />
<br />
== Immediate TODOs ==<br />
<br />
=== Enable cpufreq Stuff ===<br />
<br />
Current neggles kernel has the CPU at 1.2 GHz, apparently SRE has patches to enable cpufreq? (see below, in [[QuartzPro64_Development#Kernel|Resources]])<br />
<br />
=== Add RK3588 Support To VOP2 ===<br />
<br />
VOP2 IP on the RK3588 is very similar to the one on the RK356x, but it still needs platform specific code added.<br />
<br />
== Ways To Do Things ==<br />
<br />
=== Using rkdeveloptool ===<br />
<br />
Use the [https://gitlab.com/pine64-org/quartz-bsp/rkdeveloptool PINE64 fork of rkdeveloptool].<br />
<br />
Connect a USB-C cable to the "DEBUG PORT" USB-C port, and a second to the "DOWNLOAD" USB-C port. '''Cable direction for the latter matters, so if it doesn't show up after entering download mode, try rotating the USB-C connector to the other side!'''<br />
<br />
To enter rockusb mode, interrupt the boot by holding the "V+/REC" on-board button or mashing Ctrl+C very quickly on the serial comms, then type <code>download</code>.<br />
<br />
$ rkdeveloptool list<br />
<br />
should now show you the device somewhat like this:<br />
<br />
'''$ rkdeveloptool list'''<br />
DevNo=1 Vid=0x2207,Pid=0x350b,LocationID=204 Loader<br />
<br />
{{Template:note|'''Note:''' If you receive an error about being unable to create the comms object in the following steps, make sure you have the udev rules installed with [https://gitlab.com/pine64-org/quartz-bsp/rkdeveloptool/-/merge_requests/19 CounterPillow's RK3588 device id patch], install them to <code>/etc/udev/rules.d/</code> and <code>udevadm control --reload</code>}}<br />
<br />
Now, we can e.g. show the partitions on the eMMC:<br />
<br />
'''$ rkdeveloptool list-partitions'''<br />
# LBA start (sectors) LBA end (sectors) Size (bytes) Name <br />
00 8192 16383 4194304 security<br />
01 16384 24575 4194304 uboot<br />
02 24576 32767 4194304 trust<br />
03 32768 40959 4194304 misc<br />
04 40960 49151 4194304 dtbo<br />
05 49152 51199 1048576 vbmeta<br />
06 51200 133119 41943040 boot<br />
07 133120 329727 100663296 recovery<br />
08 329728 1116159 402653184 backup<br />
09 1116160 1902591 402653184 cache<br />
10 1902592 1935359 16777216 metadata<br />
11 1935360 1937407 1048576 baseparameter<br />
12 1937408 8310783 3263168512 super<br />
13 8310784 120831935 57610829824 userdata<br />
<br />
You can now use <code>rkdeveloptool write-partition partitionname yourfile</code> to overwrite one of the eMMC partitions.<br />
<br />
=== U-Boot + Kernel On SD, RootFS On eMMC ===<br />
<br />
This is the setup [[User:CounterPillow]] currently uses. In short, you'll need a vendor U-Boot on your SD card, with a boot partition on it that contains your <tt>extlinux.conf</tt>, device tree and kernel.<br />
<br />
==== Setting Up The SD Card ====<br />
<br />
Assuming your SD card is <tt>/dev/sdX</tt>, partition as e.g. follows:<br />
<br />
# parted -s /dev/sdX mklabel gpt<br />
# parted -s /dev/sdX mkpart loader 64s 8MiB<br />
# parted -s /dev/sdX mkpart uboot 8MiB 16MiB<br />
# parted -s /dev/sdX mkpart env 16MiB 32MiB<br />
# parted -s /dev/sdX mkpart efi fat32 32MiB 544MiB # increase size as you wish<br />
# parted -s /dev/sdX set 4 boot on<br />
<br />
Flash SPL and u-boot:<br />
# dd if=rk3588_spl_loader_v1.06.109.bin of=/dev/sdX1<br />
# dd if=uboot.img of=/dev/sdX2<br />
<br />
Then make the filesystem:<br />
# mkfs.vfat -n "efi" /dev/sdX4<br />
<br />
Mount it to e.g. <tt>/mnt/sdcardboot</tt>:<br />
# mount /dev/sda4 /mnt/sdcardboot<br />
<br />
Put the following in <tt>/mnt/sdcardboot/extlinux/extlinux.conf</tt>:<br />
default l0<br />
menu title QuartzPro64 Boot Menu<br />
prompt 0<br />
timeout 50<br />
<br />
label l0<br />
menu label Boot Jank Kernel SDMMC<br />
linux /jank<br />
fdt /dtbs/rockchip/rk3588-evb1-v10.dtb<br />
append earlycon=uart8250,mmio32,0xfeb50000 console=ttyS2,1500000n8 root=/dev/mmcblk0p14 rw rootwait<br />
<br />
Copy your kernel to <tt>/mnt/sdcardboot/jank</tt> and your DTB to <tt>/mnt/sdcardboot/dtbs/rockchip/rk3588-evb1-v10.dtb</tt>.<br />
<br />
Unmount it, we're done with the SD card.<br />
<br />
==== Creating The Root File System ====<br />
<br />
First, allocate a file the size of your desired root partition (larger sizes will take longer to transfer, don't make the same mistakes as CounterPillow did), here we choose 16G:<br />
$ fallocate -l 16G rootpart.bin<br />
<br />
then, make the filesystem on it. CounterPillow went for ext4 because nobody has ever been fired for using ext4:<br />
$ mkfs.ext4 rootpart.bin<br />
<br />
Cool, now mount it:<br />
# mount rootpart.bin /mnt/emmc-root<br />
<br />
Now we'll download the Arch Linux ARM generic rootfs tarball and go to town:<br />
$ wget -N http://os.archlinuxarm.org/os/ArchLinuxARM-aarch64-latest.tar.gz{,.sig}<br />
$ curl 'https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x68b3537f39a313b3e574d06777193f152bdbe6a6' | gpg --import=- # in case you're lacking the key<br />
$ gpg --verify ArchLinuxARM-aarch64-latest.tar.gz.sig # don't you dare skip this<br />
# bsdtar -xpf ArchLinuxARM-aarch64-latest.tar.gz -C /mnt/emmc-root # notice that this is run as root<br />
<br />
Then we just need to edit fstab. Get the UUID (not PARTUUID) from lsblk:<br />
$ lsblk -o NAME,SIZE,MOUNTPOINTS,UUID<br />
<br />
and put it in <tt>/mnt/emmc-root/etc/fstab</tt> as follows:<br />
UUID=''root-uuid-here'' / ext4 defaults 0 1<br />
<br />
Unmount <tt>/mnt/emmc-root</tt>, we're done with it.<br />
<br />
==== Flashing The Root File System With RockUSB ====<br />
<br />
{{Template:warning|This '''will''' destroy whatever data is on that userdata partition. But you're here to run Linux, not Android, right?}}<br />
<br />
Plug one USB-C cable into the debug UART port, the other into the download port. Yes you will need two USB-C cables (or A-to-C cables) for this, get over it.<br />
<br />
Plug in your board, reset it while hammering Ctrl+c on the debug UART until you get into a u-boot command line. Now enter the <code>download</code> command.<br />
<br />
If your device doesn't show up in <code>lsusb</code> or <code>rkdeveloptool list</code> command, pull out the download USB-C plug, rotate it axially by 180 Euler degrees, and plug it back in.<br />
<br />
Next, flash the partition. Depending on the size of it, this can take over an hour:<br />
$ rkdeveloptool write-partition userdata rootpart.bin<br />
<br />
==== Booting ====<br />
<br />
Unplug the download USB-C cable once done.<br />
<br />
Put the SD card in the board. Reset it. You can now boot and your rootfs on eMMC will be mounted and contains an ALARM userland.<br />
<br />
To update kernels or the device tree, just shut down the board, take out the SD card, write a new kernel or dtb to it, and plug it back in. No more need for rkdeveloptool, yay.<br />
<br />
=== Using neg2led's kernel branch ===<br />
<br />
{{Template:note|'''Note:''' Boot hangs have been observed with latest code in this branch. Try to revert back to commit [https://github.com/neggles/linux-quartz64/commit/01f523af0fce727a0e0a37029bbb2d45626d209a arm64: dts: rockchip: rk3588: add pine64 quartzpro64 board] then retest.}}<br />
<br />
If you use the linux-quartz64 branch from neg2led's kernel fork (see Resources for a link). The uSD card reader is working and you can use a partition on it for the root FS. This will eliminate the need to use rkdeveloptool.<br />
<br />
Create the additionnal partition:<br />
<br />
# parted -s /dev/sdX mkpart root ext4 544MiB 4GiB<br />
<br />
Mount it:<br />
<br />
# mount /dev/sda4 /mnt/sdcardroot<br />
<br />
Extract the ALARM rootfs tarball in there:<br />
<br />
# bsdtar -xpf ArchLinuxARM-aarch64-latest.tar.gz -C /mnt/sdcardroot # notice that this is run as root<br />
<br />
Find the right device your SD card will be (by booting neg2led's kernel once and looking at the boot log). Then modify "root=" from extlinux/extlinux.conf, for example:<br />
<br />
root=/dev/mmcblk1p5<br />
<br />
== Resources ==<br />
<br />
=== Kernel ===<br />
<br />
* [http://lists.infradead.org/pipermail/linux-rockchip/ The linux-rockchip mailing list archives]<br />
* [https://patchwork.kernel.org/project/linux-rockchip/list/ linux-rockchip patchwork]<br />
* [https://github.com/neg2led/linux-quartz64 neggles / neg2led's mainline kernel repository with patches picked from the mailing list]<br />
* [https://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-misc.git/log/?h=rk3588 Sebastian Reichel's (SRE) rk3588 branch]<br />
* [https://github.com/rockchip-linux/kernel Rockchip BSP kernel tree]<br />
* [https://gitlab.collabora.com/hardware-enablement/rockchip-3588/linux Collabora RK3588 integration branch]<br />
* [https://gitlab.collabora.com/hardware-enablement/rockchip-3588/notes-for-rockchip-3588/-/blob/main/mainline-status.md Collabora Mainline Status Table]<br />
* [https://github.com/radxa/kernel/tree/stable-5.10-rock5 Radxa kernel tree, for reference, a lot is happening here]<br />
<br />
=== Misc ===<br />
<br />
* The quartz64 and quartz-dev channels on the PINE64 chats (bridged IRC, Matrix, Discord and Telegram)<br />
* [https://gitlab.com/pine64-org/quartz-bsp/rkdeveloptool PINE64 rkdeveloptool fork]<br />
* [https://github.com/CounterPillow/uboot-qp64 CounterPillow's uboot-qp64 repository], used with [https://github.com/rockchip-linux/rkbin/ the official rkbin repository]<br />
* [https://opensource.rock-chips.com/wiki_Main_Page Rockchip OpenSource wiki]<br />
* [https://github.com/collabora/rockchiprs rockchiprs] (rkdeveloptool replacement written in Rust)<br />
<br />
=== Documentation ===<br />
<br />
The documentation for the QuartzPro64 board and most of the documentation for the chips it uses hasn't been publicly released yet, but if you do own a QuartzPro64 board, [[User:CounterPillow|CounterPillow]] or [[User:Dsimic|dsimic]] will happily provide the documentation to you for the research or development purposes, if you ask them in the PINE64 [[Main Page#Chat Platforms|chat channels]]. We've got the following documents, some of which can also be found elsewhere on the Internet rather easily:<br />
<br />
* RK3588 datasheet<br />
* RK3588 technical reference manual (TRM), parts 1 and 2<br />
* RK3588 hardware design guide, machine translated to English from Chinese, and the original version in Chinese<br />
* RK860 datasheet, including register descriptions<br />
* RK806 datasheet, including register descriptions<br />
* [https://devzone.pine64.org/uploads/d392f228-d53b-11ec-9ab8-fe0395c0c83d/9fee695f-39a4-4858-a58a-c91b86d4fa2c/QuartzPro64-DevBoard-Schematic-V1.0_20220216.pdf QuartzPro64 schematics]<br />
* [https://devzone.pine64.org/uploads/d392f228-d53b-11ec-9ab8-fe0395c0c83d/cf368836-966e-4c3c-9e0d-04a82a705d45/QuartzPro64-DevBoard-PCB-V1.0_20220216_topplace.pdf QuartzPro64 PCB top layout]<br />
* [https://devzone.pine64.org/uploads/d392f228-d53b-11ec-9ab8-fe0395c0c83d/ec260213-d4f7-4c61-ad1f-40ee7b7b7a35/QuartzPro64-DevBoard-PCB-V1.0_20220216_bottomplace.pdf QuartzPro64 PCB bottom layout]<br />
* [https://datasheet.lcsc.com/lcsc/2203311530_AMPAK-Tech-AP6275PR3_C2984106.pdf AMPAK AP6275PR3 (WiFi + BT module) datasheet]<br />
* AMPAK AP6275P (WiFi + BT module) datasheet<br />
<br />
[[Category:Rockchip RK3588]]<br />
[[Category:QuartzPro64]]</div>Tomhttps://wiki.pine64.org/index.php?title=QuartzPro64_Development&diff=20795QuartzPro64 Development2023-10-03T10:18:21Z<p>Tom: /* Recovery */ Note that maskrom can be entered via the tiny maskrom button!</p>
<hr />
<div>[[File:Quartzpro64_whole_board_top_resized.jpeg|250px|thumb|right|The QuartzPro64 development board]]<br />
[[File:BoardBackSide.jpg|100px|thumb|right|Board back side]]<br />
<br />
A '''QuartzPro64 Development''' Wiki page before a '''QuartzPro64''' Wiki page? It's more likely than you think!<br />
<br />
This page will be used for both documenting the current development efforts and the board in general, as we don't know yet how a generally available QuartzPro64 will look like so documenting the dev board is probably best left to the development page.<br />
<br />
== Obtaining a Development Board ==<br />
<br />
Request/Register: [https://preorder.pine64.org/#/quartzpro64 https://preorder.pine64.org/#/quartzpro64]<br />
<br />
== Upstreaming Status ==<br />
<br />
{| class="wikitable plainrowheaders" border="1"<br />
! scope="col" | Function<br />
! scope="col" colspan="2" | Status<br />
! scope="col" | Component<br />
! scope="col" | Notes<br />
|-<br />
! scope="row" | Video Output<br />
| colspan="2" style="background:#F99; text-align:center;"|Needs porting<br />
| <code>VOP2</code><br />
| Collabora said they'll work on this. The video output IP on the RK3588 should mostly be the same as the one on the RK356x, but the chip specific stuff will need to be integrated into the vop2 driver.<br />
|-<br />
! scope="row" | Video Input<br />
| colspan="2" style="background:#F99; text-align:center;"|Needs porting<br />
| <code>rk_hdmirx</code><br />
| Huge 3600 line driver, but generally seems to be in good condition<br />
|-<br />
! scope="row" | 3D Acceleration <br />
| style="background:#F99; text-align:center;"|Needs writing<br />
| style="background:#F99; text-align:center;"|Needs writing<br />
| <code>panfrost</code><br />
| Collabora said they'll work on this. New architecture, reportedly needs many changes to the kernel component of Panfrost.<br />
|-<br />
! scope="row" rowspan="4" | Video Decode <br />
| style="background:#F99; text-align:center;"|Needs writing<br />
| style="background:LightYellow; text-align:center;" rowspan="4"|GStreamer only, no ffmpeg<sup>[https://patchwork.ffmpeg.org/project/ffmpeg/list/?series=2898]</sup><br />
| <code>hantro</code> using <code>v4l2-requests</code><br />
| VDPU121 handling 1080p60 H.263/MPEG-4, MPEG-1 and MPEG-2<br />
|-<br />
| style="background:#F99; text-align:center;"|Needs writing<br />
| <code>rkvdec2</code> using <code>v4l2-requests</code><br />
| Nobody is known to be working on this for now. VDPU346 handling 8K60 H.265, H.264, VP9 and AVS<br />
|-<br />
| style="background:#F99; text-align:center;"|Needs writing<br />
| <code>rkdjpeg</code> using <code>v4l2-requests</code><br />
| [[User:CounterPillow]] is doing a little work on this. VDPU720 handling JPEG<br />
|-<br />
| style="background:LightYellow; text-align:center;"|In review<sup>[https://patchwork.kernel.org/project/linux-rockchip/list/?series=721724]</sup><br />
| <code>hantro</code> using <code>v4l2-requests</code><br />
| Collabora is working on this. VDPU981 handling 4K60 AV1<br />
|-<br />
! scope="row" rowspan="3" | Video Encode <br />
| style="background:#F99; text-align:center;"|Needs writing<br />
| style="text-align:center; background:LightYellow;"|GStreamer only<br />
| JPEG on VEPU121<br />
| Driver already exists, only minor changes needed.<br />
|-<br />
| style="background:#F99; text-align:center;"|Needs writing<br />
| style="text-align:center;"|?<br />
| H.264 on VEPU580<br />
| <br />
|-<br />
| style="background:#F99; text-align:center;"|Needs writing<br />
| style="text-align:center;"|?<br />
| H.265 on VEPU580<br />
| <br />
|-<br />
! scope="row" rowspan="2" | Audio <br />
| colspan="2" style="background:PaleGreen; text-align:center;"|Linux Mainline<br />
| <code>rockchip-i2s-tdm</code><br />
| As of 6.2<sup>[https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=c619bd4268ff9895760dab303b4eb15ed3d0f7e9]</sup><br />
|-<br />
| colspan="2" style="background:PaleGreen; text-align:center;"|Linux Mainline<br />
| <code>es8388</code> CODEC<br />
| <br />
|-<br />
! scope="row" | CRU<br />
| colspan="2" style="background:PaleGreen; text-align:center;"|Linux Mainline<br />
| <code>clk-rk3588</code><br />
| As of 6.2<sup>[https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=f1c506d152ff235ad621d3c25d061cb16da67214]</sup><br />
|-<br />
! scope="row" | MMC<br />
| colspan="2" style="background:PaleGreen; text-align:center;"|Linux Mainline<br />
| <code>sdhci-of-dwcmshc</code><br />
| As of 5.19<sup>[https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=bbbd8872825310b14bc6e04250d2cb5edcd55edb]</sup><br />
|-<br />
! scope="row" | pinctrl<br />
| colspan="2" style="background:PaleGreen; text-align:center;"|Linux Mainline<br />
| <code>pinctrl-rockchip</code><br />
| As of 5.19<sup>[https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=fdc33eba11c5919199f3d13dc53571cc7bf19d7d]</sup><br />
|-<br />
! scope="row" | GPIO<br />
| colspan="2" style="background:PaleGreen; text-align:center;"|Linux Mainline<br />
| <code>rockchip-gpio</code><br />
| As of 6.1<sup>[https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=cc165ba48aaf7d792e99d0c7e4b12e9625bc73e3]</sup><br />
|-<br />
! scope="row" | I<sup>2</sup>C<br />
| colspan="2" style="background:PaleGreen; text-align:center;"|Linux Mainline<br />
| <code>rk3x-i2c</code><br />
| Should be the same as RK3399, just needs devicetree work<br />
|-<br />
! scope="row" | SPI<br />
| colspan="2" style="background:PaleGreen; text-align:center;"|Linux Mainline<br />
| <code>rockchip-spi</code><br />
| Should be the same as previous SoCs, just needs devicetree work<br />
|-<br />
! scope="row" | PMU<br />
| colspan="2" style="background:LightYellow; text-align:center;"|In review<sup>[https://patchwork.kernel.org/project/linux-rockchip/list/?series=687286]</sup><br />
| <code>rk806</code><br />
| Talks over SPI<br />
|-<br />
! scope="row" | Regulators<br />
| colspan="2" style="background:#F99; text-align:center;"|Needs porting<br />
| <code>rk860</code><br />
| Talks over I<sup>2</sup>C<br />
|-<br />
! scope="row" | GMAC<br />
| colspan="2" style="background:PaleGreen; text-align:center;"|Linux Mainline<br />
| <code>dwmac-rk</code><br />
| As of 6.1<sup>[https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=2f2b60a0ec2826e5a2b2a1ddf68994a868dccbc1]</sup><br />
|-<br />
! scope="row" | Power Domains<br />
| colspan="2" style="background:PaleGreen; text-align:center;"|Linux Mainline<br />
| <code>rockchip-pm-domain</code><br />
| As of 6.1<sup>[https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=6541b424ce1dda616d3946e839f015c984df7a99]</sup><br />
|-<br />
! scope="row" | CAN<br />
| colspan="2" style="background:#F99; text-align:center;"|Needs porting<br />
| <code>rockchip_canfd</code><br />
| Not broken out on the QuartzPro64, so we probably won't be the ones porting it<br />
|-<br />
! scope="row" | SPDIF TX<br />
| colspan="2" style="background:#F99; text-align:center;"|May need porting<br />
| <code>rockchip-spdif</code><br />
| Genuinely just needs the compatible string added, I think, otherwise we're all good. Not broken out on QuartzPro64 dev board<br />
|-<br />
! scope="row" | SPDIF RX<br />
| colspan="2" style="background:#F99; text-align:center;"|Needs porting<br />
| <code>rockchip-spdifrx</code><br />
| Not broken out on QuartzPro64 dev board<br />
|-<br />
! scope="row" | PCIe<br />
| colspan="2" style="background:#F99; text-align:center;"|May need porting<br />
| <code>rockchip-dw-pcie</code><br />
| Downstream driver and upstream are quite different, look into how much work actually needs doing. Seems to be the same controller as rk3568 so maybe none?<br />
|-<br />
! scope="row" | NPU<br />
| style="background:#F99; text-align:center;"|Needs porting/writing<br />
| style="text-align:center;"|?<br />
| <code>rockchip-rknpu</code><br />
|-<br />
! scope="row" | USB 2.0<br />
| colspan="2" style="background:LightYellow; text-align:center;"|In review<sup>[https://patchwork.kernel.org/project/linux-rockchip/list/?series=749871]</sup><br />
| <code>phy-rockchip-inno-usb2</code><br />
| There's probably more to USB 2 than just the PHY but this is what I found for now<br />
|-<br />
! scope="row" | USB 3.0<br />
| colspan="2" style="background:#F99; text-align:center;"|?<br />
| <code>?</code><br />
|<br />
|-<br />
! scope="row" | SATA<br />
| colspan="2" style="background:PaleGreen; text-align:center;"|Linux Mainline<br />
| <code>ahci-dwc</code><br />
| Just needs the compatible added to the bindings, done in [https://patchwork.kernel.org/project/linux-rockchip/list/?series=749876]<br />
|-<br />
! scope="row" | Thermal<br />
| colspan="2" style="background:LightYellow; text-align:center;"|In review<sup>[https://patchwork.kernel.org/project/linux-rockchip/list/?series=687619]</sup><br />
| <code>rockchip-thermal</code><br />
|<br />
|-<br />
! scope="row" | Wifi & Bluetooth<br />
| colspan="2" style="background:#F99; text-align:center;"|?<br />
| <code>?</code><br />
|<br />
|-<br />
! scope="row" | HWRNG<br />
| colspan="2" style="background:#F99; text-align:center;"|Needs porting<br />
| <code>rockchip-rng</code><br />
| The code & DT work is easy to port & working<br />
|<br />
|-<br />
! scope="row" | RTC<br />
| colspan="2" style="background:PaleGreen; text-align:center;"|Linux Mainline<br />
| <code>hym8563</code><br />
| Should only need DT work (see [https://patchwork.kernel.org/project/linux-rockchip/list/?series=736799 here] for an example)<br />
|-<br />
! scope="row" | OTP<br />
| colspan="2" style="background:LightYellow; text-align:center;"|In review<sup>[https://patchwork.kernel.org/project/linux-rockchip/list/?series=744118]</sup><br />
| <code>rockchip-otp</code><br />
|<br />
|-<br />
! scope="row" | SARADC<br />
| colspan="2" style="background:LightYellow; text-align:center;"|In review<sup>[https://patchwork.kernel.org/project/linux-rockchip/list/?series=748188]</sup><br />
| <code>rockchip_saradc</code><br />
|<br />
|}<br />
<br />
== Hardware ==<br />
<br />
[[File:Quartzpro64_soc_and_ram_resized.jpeg|200px|thumb|right|The SoC and RAM packages]]<br />
<br />
=== General ===<br />
<br />
* RK3588 SoC (8 cores: 4x A76@2.4GHz + 4x A55@1.8GHz)<br />
* Mali G610MC4 GPU (4x Valhalla cores)<br />
* 16 GB LPDDR4X (SK hynix)<br />
* 64 GB eMMC (Foresee, soldered)<br />
* 1x USB-C (with video-alt mode)<br />
* 1x USB-C (FTDI debug UART, FT232RL)<br />
* 1x USB 3.0<br />
* 2x USB 2.0<br />
* 1x HDMI in<br />
* 2x HDMI out<br />
* 1x PCIe 3.0 slot (open-ended)<br />
* 1x SD / TF card slot<br />
* 2x SATA ports<br />
* 2x Gigabit ethernet (1x from SoC, 1x on PCIe, RTL8211F, RTL8111HS)<br />
* 1x WiFi & BT Module (AMPAK Tech AP6275PR3)<br />
* 2x SMA Antenna<br />
* 2x MIPI DPHY<br />
* 1x MIPI D/C PHY<br />
* 1x MIPI CSI<br />
* 1x PWM Fan header (4 pins)<br />
* 1x RTC battery socket (CR1220, 3V, see [[#Documentation|QuartzPro64 board schematics PDF]], page 21)<br />
* 1x MIC (soldered)<br />
* 1x audio output 3.5mm jack<br />
* Power in via DC 12V<br />
<br />
=== Cooler ===<br />
<br />
The board comes with two cooler mounts, a 4-hole mount that appears to be spaced 55x55mm apart, and the ~60mm diagonal "northbridge heatsink" mount the ROCKPro64 and Quartz64 Model A uses.<br />
<br />
RK3588 is slightly (<1mm?) taller than the DRAM chips, use a thick enough thermal pad instead of thermal compound.<br />
<br />
=== UART ===<br />
<br />
Plug in the USB-C port labelled "<tt>DEBUG PORT</tt>" on the QP64 board to another computer with a USB-A-to-C cable.<br />
<br />
It will show up as a FT232 USB Serial adapter in <code>lsusb</code>:<br />
<pre><br />
$ lsusb<br />
[...]<br />
Bus 005 Device 027: ID 0403:6001 Future Technology Devices International, Ltd FT232 Serial (UART) IC<br />
[...]<br />
</pre><br />
<br />
Baud rate is 1.5 mbauds or 1500000.<br />
<br />
Ensure you have the driver module loaded:<br />
<pre><br />
# modprobe ftdi_sio<br />
# lsmod | grep ftdi_sio<br />
ftdi_sio 61440 0<br />
usbserial 53248 1 ftdi_sio<br />
usbcore 290816 7 ftdi_sio,usbserial,xhci_hcd,usbhid,usbkbd,usbmouse,xhci_pci<br />
</pre><br />
<br />
If the above is not working, check the required driver is supported by your kernel, using one of the following commands:<br />
<pre><br />
$ zgrep FTDI_SIO /proc/config.gz<br />
CONFIG_USB_SERIAL_FTDI_SIO=m<br />
$ grep FTDI_SIO "/boot/config-$(uname -r)"<br />
CONFIG_USB_SERIAL_FTDI_SIO=m<br />
</pre><br />
<br />
Using the <code>dmesg</code> command, you should see something like the following:<br />
<pre><br />
[24784.535804] usb 5-3: new full-speed USB device number 3 using xhci_hcd<br />
[24784.710714] usb 5-3: New USB device found, idVendor=0403, idProduct=6001, bcdDevice= 6.00<br />
[24784.710723] usb 5-3: New USB device strings: Mfr=1, Product=2, SerialNumber=3<br />
[24784.710725] usb 5-3: Product: FT232R USB UART<br />
[24784.710727] usb 5-3: Manufacturer: FTDI<br />
[24784.710728] usb 5-3: SerialNumber: A10LLO86<br />
[24784.723858] usbcore: registered new interface driver usbserial_generic<br />
[24784.723865] usbserial: USB Serial support registered for generic<br />
[24784.725286] usbcore: registered new interface driver ftdi_sio<br />
[24784.725295] usbserial: USB Serial support registered for FTDI USB Serial Device<br />
[24784.725348] ftdi_sio 5-3:1.0: FTDI USB Serial Device converter detected<br />
[24784.725368] usb 5-3: Detected FT232RL<br />
[24784.731685] usb 5-3: FTDI USB Serial Device converter now attached to ttyUSB0<br />
</pre><br />
<br />
Then you can get console output from the QP64 with, for example:<br />
<br />
<pre><br />
screen /dev/ttyUSB0 1500000<br />
</pre><br />
<br />
=== Mounting Holes ===<br />
<br />
Can't be bothered to take a precise measurement of all the holes right now, just use [https://www.ebay.com/sch/i.html?kw=pc%20standoff%20kit some PC standoffs] and have the board sit on your desk, it's a dev board after all.<br />
<br />
See the PCB layout PDF files, linked in the [https://wiki.pine64.org/wiki/QuartzPro64_Development#Documentation Documentation] section.<br />
<br />
=== Storage ===<br />
<br />
[[File:Quartzpro64_emmc_resized.jpeg|200px|thumb|right|The eMMC on the dev board]]<br />
<br />
* Soldered on 64 GB FORESEE eMMC chip, it comes pre-flashed with some Android (you'll even get a brief bit of HDMI output)<br />
* microSD card slot<br />
* 2x SATA 3.0 (molex power connector for it not populated, but easy to remedy)<br />
<br />
=== Power ===<br />
<br />
[[File:Power_and_switch.jpg|100px|thumb|right|Power switch & barrel connector]]<br />
<br />
You can provide power to the board via the 12V barrel connector, it's 5.5mm OD/2.1mm ID barrel 'coaxial' type "M" centre-positive, the ROCKPro64 5A power supply from the PINE64 store will work. (TODO: add alternative ways).<br />
<br />
There is a hardware flip switch to power up / down the board.<br />
<br />
=== PMU ===<br />
<br />
[[File:Quartzpro64_pmu.jpeg|100px|thumb|right|The PMU]]<br />
<br />
2x RK806-2, not RK808 compatible. It's a dual PMU configuration where one PMU is a subordinate of the other.<br />
<br />
Verify this once we have access to SDK sources.<br />
<br />
=== Ethernet ===<br />
<br />
The RGMII ethernet port (near the SDCARD socket) is working if you use neg2led's linux-quartz64 repo.<br />
<br />
The other port (near the sound jack) is hooked to the SoC via PCIe and is currently reported working (on the matrix channel) with latest neggles kernel.<br />
<br />
== Boot ==<br />
<br />
The board can boot from the following interfaces:<br />
* SPI<br />
* eMMC<br />
* SD/MMC<br />
<br />
TODO: in which priority / order are those boot options tried ?<br />
<br />
== Recovery ==<br />
<br />
In the case you erase the eMMC and are unable to boot the board, you can use rkdeveloptool to recover the board. While you can use the [https://gitlab.com/pine64-org/quartz-bsp/rkdeveloptool Pine64 Fork], it is recommended to use [https://gitlab.com/cypheon/rkdeveloptool/-/tree/main?ref_type=heads cypheon's Fork] until some Pending PRs are merged in to [https://gitlab.com/pine64-org/quartz-bsp/rkdeveloptool/-/merge_requests?scope=all&state=opened&author_username=cypheon resolve issues] with larger files. This is important when working with the larger 64GB eMMC on the QuartzPro64.<br />
<br />
With rkdeveloptool installed, you will also need the rk3588_spl from rockchip to init the memory/flash when in maskrom mode. This can be downloaded from the [https://github.com/rockchip-linux/rkbin/blob/master/bin/rk35/rk3588_spl_v1.12.bin rockchip-linux/rkbin repo].<br />
<br />
Entering maskrom can be done in a variety of ways:<br />
<br />
* Hold the maskrom button (little white button labelled "MASKROM" next to SATA socket) during powerup, OR<br />
* Enter rockusb mode, and execute "rkdeveloptool reboot-maskrom".<br />
* Bork your eMMC and SD devices (how? erase?), in which case bootup will fallback to maskrom.<br />
<br />
=== Dumping the eMMC ===<br />
<br />
Boot the device into maskrom mode, and then verify rkdeveloptool can see the board. <br />
'''# rkdeveloptool list'''<br />
DevNo=1 Vid=0x2207,Pid=0x350b,LocationID=503 Maskrom<br />
<br />
Once the board shows up, load the rk3588_spl you downloaded earlier, and verify that the eMMC can be seen.<br />
'''# rkdeveloptool boot ./rk3588_spl_loader_v1.08.111.bin'''<br />
Downloading bootloader succeeded.<br />
'''# rkdeveloptool read-flash-info'''<br />
Flash Info:<br />
Manufacturer: SAMSUNG, value=00<br />
Flash Size: 59000 MB<br />
Flash Size: 120832000 Sectors<br />
Block Size: 512 KB<br />
Page Size: 2 KB<br />
ECC Bits: 0<br />
Access Time: 40<br />
Flash CS: Flash<0><br />
<br />
You can now dump the eMMC using the read command. Note that first you have to calculate the eMMC size, which can be done using the output from the previous flash info command. You need to take the sector count, and times it by the sector size, to get the total number of bytes. So in the above example, 120832000*512 so the total flash size is 61865984000.<br />
<br />
Using the calculated size, you can now dump the eMMC. Please note this will take 1-2 minutes.<br />
'''# rkdeveloptool read 0x0 61865984000 ./quartzpro64_emmc_dump.bin'''<br />
Read LBA to file (0%)<br />
...<br />
Read LBA to file (100%)<br />
<br />
You now have a full dump of the entire eMMC (SHA256 62cb4ae8d02aeacccf231fa1d00087cdc74b599790a274569305693aa205318d). Note that you can also use the list-partitions and read-partition commands to dump specific partitions, but this only shows GPT partitions on the eMMC. Because of this, it will NOT include the spl_loader found in the first 4MB of the eMMC!<br />
<br />
=== Flasing the eMMC ===<br />
<br />
Boot the device into maskrom mode, and then verify rkdeveloptool can see the board. <br />
'''# rkdeveloptool list'''<br />
DevNo=1 Vid=0x2207,Pid=0x350b,LocationID=503 Maskrom<br />
<br />
Once the board shows up, load the rk3588_spl you downloaded earlier, and verify that the eMMC can be seen.<br />
'''# rkdeveloptool boot ./rk3588_spl_loader_v1.08.111.bin'''<br />
Downloading bootloader succeeded.<br />
'''# rkdeveloptool read-flash-info'''<br />
Flash Info:<br />
Manufacturer: SAMSUNG, value=00<br />
Flash Size: 59000 MB<br />
Flash Size: 120832000 Sectors<br />
Block Size: 512 KB<br />
Page Size: 2 KB<br />
ECC Bits: 0<br />
Access Time: 40<br />
Flash CS: Flash<0><br />
<br />
You can now flash the device using either the write command, or write-partition command, depending on what you are trying to do. If you are looking to restore the entire eMMC from a backup you made, you would use the command below to accomplish this.<br />
'''rkdeveloptool write 0 ./quartzpro64_emmc_dump.bin'''<br />
<br />
== Immediate TODOs ==<br />
<br />
=== Enable cpufreq Stuff ===<br />
<br />
Current neggles kernel has the CPU at 1.2 GHz, apparently SRE has patches to enable cpufreq? (see below, in [[QuartzPro64_Development#Kernel|Resources]])<br />
<br />
=== Add RK3588 Support To VOP2 ===<br />
<br />
VOP2 IP on the RK3588 is very similar to the one on the RK356x, but it still needs platform specific code added.<br />
<br />
== Ways To Do Things ==<br />
<br />
=== Using rkdeveloptool ===<br />
<br />
Use the [https://gitlab.com/pine64-org/quartz-bsp/rkdeveloptool PINE64 fork of rkdeveloptool].<br />
<br />
Connect a USB-C cable to the "DEBUG PORT" USB-C port, and a second to the "DOWNLOAD" USB-C port. '''Cable direction for the latter matters, so if it doesn't show up after entering download mode, try rotating the USB-C connector to the other side!'''<br />
<br />
To enter rockusb mode, interrupt the boot by holding the "V+/REC" on-board button or mashing Ctrl+C very quickly on the serial comms, then type <code>download</code>.<br />
<br />
$ rkdeveloptool list<br />
<br />
should now show you the device somewhat like this:<br />
<br />
'''$ rkdeveloptool list'''<br />
DevNo=1 Vid=0x2207,Pid=0x350b,LocationID=204 Loader<br />
<br />
{{Template:note|'''Note:''' If you receive an error about being unable to create the comms object in the following steps, make sure you have the udev rules installed with [https://gitlab.com/pine64-org/quartz-bsp/rkdeveloptool/-/merge_requests/19 CounterPillow's RK3588 device id patch], install them to <code>/etc/udev/rules.d/</code> and <code>udevadm control --reload</code>}}<br />
<br />
Now, we can e.g. show the partitions on the eMMC:<br />
<br />
'''$ rkdeveloptool list-partitions'''<br />
# LBA start (sectors) LBA end (sectors) Size (bytes) Name <br />
00 8192 16383 4194304 security<br />
01 16384 24575 4194304 uboot<br />
02 24576 32767 4194304 trust<br />
03 32768 40959 4194304 misc<br />
04 40960 49151 4194304 dtbo<br />
05 49152 51199 1048576 vbmeta<br />
06 51200 133119 41943040 boot<br />
07 133120 329727 100663296 recovery<br />
08 329728 1116159 402653184 backup<br />
09 1116160 1902591 402653184 cache<br />
10 1902592 1935359 16777216 metadata<br />
11 1935360 1937407 1048576 baseparameter<br />
12 1937408 8310783 3263168512 super<br />
13 8310784 120831935 57610829824 userdata<br />
<br />
You can now use <code>rkdeveloptool write-partition partitionname yourfile</code> to overwrite one of the eMMC partitions.<br />
<br />
=== U-Boot + Kernel On SD, RootFS On eMMC ===<br />
<br />
This is the setup [[User:CounterPillow]] currently uses. In short, you'll need a vendor U-Boot on your SD card, with a boot partition on it that contains your <tt>extlinux.conf</tt>, device tree and kernel.<br />
<br />
==== Setting Up The SD Card ====<br />
<br />
Assuming your SD card is <tt>/dev/sdX</tt>, partition as e.g. follows:<br />
<br />
# parted -s /dev/sdX mklabel gpt<br />
# parted -s /dev/sdX mkpart loader 64s 8MiB<br />
# parted -s /dev/sdX mkpart uboot 8MiB 16MiB<br />
# parted -s /dev/sdX mkpart env 16MiB 32MiB<br />
# parted -s /dev/sdX mkpart efi fat32 32MiB 544MiB # increase size as you wish<br />
# parted -s /dev/sdX set 4 boot on<br />
<br />
Flash SPL and u-boot:<br />
# dd if=rk3588_spl_loader_v1.06.109.bin of=/dev/sdX1<br />
# dd if=uboot.img of=/dev/sdX2<br />
<br />
Then make the filesystem:<br />
# mkfs.vfat -n "efi" /dev/sdX4<br />
<br />
Mount it to e.g. <tt>/mnt/sdcardboot</tt>:<br />
# mount /dev/sda4 /mnt/sdcardboot<br />
<br />
Put the following in <tt>/mnt/sdcardboot/extlinux/extlinux.conf</tt>:<br />
default l0<br />
menu title QuartzPro64 Boot Menu<br />
prompt 0<br />
timeout 50<br />
<br />
label l0<br />
menu label Boot Jank Kernel SDMMC<br />
linux /jank<br />
fdt /dtbs/rockchip/rk3588-evb1-v10.dtb<br />
append earlycon=uart8250,mmio32,0xfeb50000 console=ttyS2,1500000n8 root=/dev/mmcblk0p14 rw rootwait<br />
<br />
Copy your kernel to <tt>/mnt/sdcardboot/jank</tt> and your DTB to <tt>/mnt/sdcardboot/dtbs/rockchip/rk3588-evb1-v10.dtb</tt>.<br />
<br />
Unmount it, we're done with the SD card.<br />
<br />
==== Creating The Root File System ====<br />
<br />
First, allocate a file the size of your desired root partition (larger sizes will take longer to transfer, don't make the same mistakes as CounterPillow did), here we choose 16G:<br />
$ fallocate -l 16G rootpart.bin<br />
<br />
then, make the filesystem on it. CounterPillow went for ext4 because nobody has ever been fired for using ext4:<br />
$ mkfs.ext4 rootpart.bin<br />
<br />
Cool, now mount it:<br />
# mount rootpart.bin /mnt/emmc-root<br />
<br />
Now we'll download the Arch Linux ARM generic rootfs tarball and go to town:<br />
$ wget -N http://os.archlinuxarm.org/os/ArchLinuxARM-aarch64-latest.tar.gz{,.sig}<br />
$ curl 'https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x68b3537f39a313b3e574d06777193f152bdbe6a6' | gpg --import=- # in case you're lacking the key<br />
$ gpg --verify ArchLinuxARM-aarch64-latest.tar.gz.sig # don't you dare skip this<br />
# bsdtar -xpf ArchLinuxARM-aarch64-latest.tar.gz -C /mnt/emmc-root # notice that this is run as root<br />
<br />
Then we just need to edit fstab. Get the UUID (not PARTUUID) from lsblk:<br />
$ lsblk -o NAME,SIZE,MOUNTPOINTS,UUID<br />
<br />
and put it in <tt>/mnt/emmc-root/etc/fstab</tt> as follows:<br />
UUID=''root-uuid-here'' / ext4 defaults 0 1<br />
<br />
Unmount <tt>/mnt/emmc-root</tt>, we're done with it.<br />
<br />
==== Flashing The Root File System With RockUSB ====<br />
<br />
{{Template:warning|This '''will''' destroy whatever data is on that userdata partition. But you're here to run Linux, not Android, right?}}<br />
<br />
Plug one USB-C cable into the debug UART port, the other into the download port. Yes you will need two USB-C cables (or A-to-C cables) for this, get over it.<br />
<br />
Plug in your board, reset it while hammering Ctrl+c on the debug UART until you get into a u-boot command line. Now enter the <code>download</code> command.<br />
<br />
If your device doesn't show up in <code>lsusb</code> or <code>rkdeveloptool list</code> command, pull out the download USB-C plug, rotate it axially by 180 Euler degrees, and plug it back in.<br />
<br />
Next, flash the partition. Depending on the size of it, this can take over an hour:<br />
$ rkdeveloptool write-partition userdata rootpart.bin<br />
<br />
==== Booting ====<br />
<br />
Unplug the download USB-C cable once done.<br />
<br />
Put the SD card in the board. Reset it. You can now boot and your rootfs on eMMC will be mounted and contains an ALARM userland.<br />
<br />
To update kernels or the device tree, just shut down the board, take out the SD card, write a new kernel or dtb to it, and plug it back in. No more need for rkdeveloptool, yay.<br />
<br />
=== Using neg2led's kernel branch ===<br />
<br />
{{Template:note|'''Note:''' Boot hangs have been observed with latest code in this branch. Try to revert back to commit [https://github.com/neggles/linux-quartz64/commit/01f523af0fce727a0e0a37029bbb2d45626d209a arm64: dts: rockchip: rk3588: add pine64 quartzpro64 board] then retest.}}<br />
<br />
If you use the linux-quartz64 branch from neg2led's kernel fork (see Resources for a link). The uSD card reader is working and you can use a partition on it for the root FS. This will eliminate the need to use rkdeveloptool.<br />
<br />
Create the additionnal partition:<br />
<br />
# parted -s /dev/sdX mkpart root ext4 544MiB 4GiB<br />
<br />
Mount it:<br />
<br />
# mount /dev/sda4 /mnt/sdcardroot<br />
<br />
Extract the ALARM rootfs tarball in there:<br />
<br />
# bsdtar -xpf ArchLinuxARM-aarch64-latest.tar.gz -C /mnt/sdcardroot # notice that this is run as root<br />
<br />
Find the right device your SD card will be (by booting neg2led's kernel once and looking at the boot log). Then modify "root=" from extlinux/extlinux.conf, for example:<br />
<br />
root=/dev/mmcblk1p5<br />
<br />
== Resources ==<br />
<br />
=== Kernel ===<br />
<br />
* [http://lists.infradead.org/pipermail/linux-rockchip/ The linux-rockchip mailing list archives]<br />
* [https://patchwork.kernel.org/project/linux-rockchip/list/ linux-rockchip patchwork]<br />
* [https://github.com/neg2led/linux-quartz64 neggles / neg2led's mainline kernel repository with patches picked from the mailing list]<br />
* [https://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-misc.git/log/?h=rk3588 Sebastian Reichel's (SRE) rk3588 branch]<br />
* [https://github.com/rockchip-linux/kernel Rockchip BSP kernel tree]<br />
* [https://gitlab.collabora.com/hardware-enablement/rockchip-3588/linux Collabora RK3588 integration branch]<br />
* [https://gitlab.collabora.com/hardware-enablement/rockchip-3588/notes-for-rockchip-3588/-/blob/main/mainline-status.md Collabora Mainline Status Table]<br />
* [https://github.com/radxa/kernel/tree/stable-5.10-rock5 Radxa kernel tree, for reference, a lot is happening here]<br />
<br />
=== Misc ===<br />
<br />
* The quartz64 and quartz-dev channels on the PINE64 chats (bridged IRC, Matrix, Discord and Telegram)<br />
* [https://gitlab.com/pine64-org/quartz-bsp/rkdeveloptool PINE64 rkdeveloptool fork]<br />
* [https://github.com/CounterPillow/uboot-qp64 CounterPillow's uboot-qp64 repository], used with [https://github.com/rockchip-linux/rkbin/ the official rkbin repository]<br />
* [https://opensource.rock-chips.com/wiki_Main_Page Rockchip OpenSource wiki]<br />
* [https://github.com/collabora/rockchiprs rockchiprs] (rkdeveloptool replacement written in Rust)<br />
<br />
=== Documentation ===<br />
<br />
The various documents relating to the chips and board haven't been publicly released yet, but if you do have a QuartzPro64 board [[User:CounterPillow]] will happily provide the documentation for you if you ask him in the PINE64 chats. We have the following:<br />
* RK3588 TRM Part 1 and Part 2<br />
* RK860 datasheet including register descriptions<br />
* RK806 datasheet including register descriptions<br />
* RK3588 hardware design guide, machine translated to English from Chinese, and the original Chinese copy<br />
* [https://devzone.pine64.org/uploads/d392f228-d53b-11ec-9ab8-fe0395c0c83d/9fee695f-39a4-4858-a58a-c91b86d4fa2c/QuartzPro64-DevBoard-Schematic-V1.0_20220216.pdf QuartzPro64 schematics]<br />
* [https://devzone.pine64.org/uploads/d392f228-d53b-11ec-9ab8-fe0395c0c83d/cf368836-966e-4c3c-9e0d-04a82a705d45/QuartzPro64-DevBoard-PCB-V1.0_20220216_topplace.pdf QuartzPro64 PCB top layout]<br />
* [https://devzone.pine64.org/uploads/d392f228-d53b-11ec-9ab8-fe0395c0c83d/ec260213-d4f7-4c61-ad1f-40ee7b7b7a35/QuartzPro64-DevBoard-PCB-V1.0_20220216_bottomplace.pdf QuartzPro64 PCB bottom layout]<br />
* [https://datasheet.lcsc.com/lcsc/2203311530_AMPAK-Tech-AP6275PR3_C2984106.pdf AMPAK-Tech AP6275PR3 (WIFI & BT chip) datasheet]<br />
<br />
<br />
[[Category:Rockchip RK3588]] [[Category:QuartzPro64]]</div>Tomhttps://wiki.pine64.org/index.php?title=QuartzPro64_Development&diff=20789QuartzPro64 Development2023-10-02T15:17:10Z<p>Tom: /* Dumping the eMMC */ Note the duration and hash of the eMMC dump</p>
<hr />
<div>[[File:Quartzpro64_whole_board_top_resized.jpeg|250px|thumb|right|The QuartzPro64 development board]]<br />
[[File:BoardBackSide.jpg|100px|thumb|right|Board back side]]<br />
<br />
A '''QuartzPro64 Development''' Wiki page before a '''QuartzPro64''' Wiki page? It's more likely than you think!<br />
<br />
This page will be used for both documenting the current development efforts and the board in general, as we don't know yet how a generally available QuartzPro64 will look like so documenting the dev board is probably best left to the development page.<br />
<br />
== Obtaining a Development Board ==<br />
<br />
Request/Register: [https://preorder.pine64.org/#/quartzpro64 https://preorder.pine64.org/#/quartzpro64]<br />
<br />
== Upstreaming Status ==<br />
<br />
{| class="wikitable plainrowheaders" border="1"<br />
! scope="col" | Function<br />
! scope="col" colspan="2" | Status<br />
! scope="col" | Component<br />
! scope="col" | Notes<br />
|-<br />
! scope="row" | Video Output<br />
| colspan="2" style="background:#F99; text-align:center;"|Needs porting<br />
| <code>VOP2</code><br />
| Collabora said they'll work on this. The video output IP on the RK3588 should mostly be the same as the one on the RK356x, but the chip specific stuff will need to be integrated into the vop2 driver.<br />
|-<br />
! scope="row" | Video Input<br />
| colspan="2" style="background:#F99; text-align:center;"|Needs porting<br />
| <code>rk_hdmirx</code><br />
| Huge 3600 line driver, but generally seems to be in good condition<br />
|-<br />
! scope="row" | 3D Acceleration <br />
| style="background:#F99; text-align:center;"|Needs writing<br />
| style="background:#F99; text-align:center;"|Needs writing<br />
| <code>panfrost</code><br />
| Collabora said they'll work on this. New architecture, reportedly needs many changes to the kernel component of Panfrost.<br />
|-<br />
! scope="row" rowspan="4" | Video Decode <br />
| style="background:#F99; text-align:center;"|Needs writing<br />
| style="background:LightYellow; text-align:center;" rowspan="4"|GStreamer only, no ffmpeg<sup>[https://patchwork.ffmpeg.org/project/ffmpeg/list/?series=2898]</sup><br />
| <code>hantro</code> using <code>v4l2-requests</code><br />
| VDPU121 handling 1080p60 H.263/MPEG-4, MPEG-1 and MPEG-2<br />
|-<br />
| style="background:#F99; text-align:center;"|Needs writing<br />
| <code>rkvdec2</code> using <code>v4l2-requests</code><br />
| Nobody is known to be working on this for now. VDPU346 handling 8K60 H.265, H.264, VP9 and AVS<br />
|-<br />
| style="background:#F99; text-align:center;"|Needs writing<br />
| <code>rkdjpeg</code> using <code>v4l2-requests</code><br />
| [[User:CounterPillow]] is doing a little work on this. VDPU720 handling JPEG<br />
|-<br />
| style="background:LightYellow; text-align:center;"|In review<sup>[https://patchwork.kernel.org/project/linux-rockchip/list/?series=721724]</sup><br />
| <code>hantro</code> using <code>v4l2-requests</code><br />
| Collabora is working on this. VDPU981 handling 4K60 AV1<br />
|-<br />
! scope="row" rowspan="3" | Video Encode <br />
| style="background:#F99; text-align:center;"|Needs writing<br />
| style="text-align:center; background:LightYellow;"|GStreamer only<br />
| JPEG on VEPU121<br />
| Driver already exists, only minor changes needed.<br />
|-<br />
| style="background:#F99; text-align:center;"|Needs writing<br />
| style="text-align:center;"|?<br />
| H.264 on VEPU580<br />
| <br />
|-<br />
| style="background:#F99; text-align:center;"|Needs writing<br />
| style="text-align:center;"|?<br />
| H.265 on VEPU580<br />
| <br />
|-<br />
! scope="row" rowspan="2" | Audio <br />
| colspan="2" style="background:PaleGreen; text-align:center;"|Linux Mainline<br />
| <code>rockchip-i2s-tdm</code><br />
| As of 6.2<sup>[https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=c619bd4268ff9895760dab303b4eb15ed3d0f7e9]</sup><br />
|-<br />
| colspan="2" style="background:PaleGreen; text-align:center;"|Linux Mainline<br />
| <code>es8388</code> CODEC<br />
| <br />
|-<br />
! scope="row" | CRU<br />
| colspan="2" style="background:PaleGreen; text-align:center;"|Linux Mainline<br />
| <code>clk-rk3588</code><br />
| As of 6.2<sup>[https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=f1c506d152ff235ad621d3c25d061cb16da67214]</sup><br />
|-<br />
! scope="row" | MMC<br />
| colspan="2" style="background:PaleGreen; text-align:center;"|Linux Mainline<br />
| <code>sdhci-of-dwcmshc</code><br />
| As of 5.19<sup>[https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=bbbd8872825310b14bc6e04250d2cb5edcd55edb]</sup><br />
|-<br />
! scope="row" | pinctrl<br />
| colspan="2" style="background:PaleGreen; text-align:center;"|Linux Mainline<br />
| <code>pinctrl-rockchip</code><br />
| As of 5.19<sup>[https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=fdc33eba11c5919199f3d13dc53571cc7bf19d7d]</sup><br />
|-<br />
! scope="row" | GPIO<br />
| colspan="2" style="background:PaleGreen; text-align:center;"|Linux Mainline<br />
| <code>rockchip-gpio</code><br />
| As of 6.1<sup>[https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=cc165ba48aaf7d792e99d0c7e4b12e9625bc73e3]</sup><br />
|-<br />
! scope="row" | I<sup>2</sup>C<br />
| colspan="2" style="background:PaleGreen; text-align:center;"|Linux Mainline<br />
| <code>rk3x-i2c</code><br />
| Should be the same as RK3399, just needs devicetree work<br />
|-<br />
! scope="row" | SPI<br />
| colspan="2" style="background:PaleGreen; text-align:center;"|Linux Mainline<br />
| <code>rockchip-spi</code><br />
| Should be the same as previous SoCs, just needs devicetree work<br />
|-<br />
! scope="row" | PMU<br />
| colspan="2" style="background:LightYellow; text-align:center;"|In review<sup>[https://patchwork.kernel.org/project/linux-rockchip/list/?series=687286]</sup><br />
| <code>rk806</code><br />
| Talks over SPI<br />
|-<br />
! scope="row" | Regulators<br />
| colspan="2" style="background:#F99; text-align:center;"|Needs porting<br />
| <code>rk860</code><br />
| Talks over I<sup>2</sup>C<br />
|-<br />
! scope="row" | GMAC<br />
| colspan="2" style="background:PaleGreen; text-align:center;"|Linux Mainline<br />
| <code>dwmac-rk</code><br />
| As of 6.1<sup>[https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=2f2b60a0ec2826e5a2b2a1ddf68994a868dccbc1]</sup><br />
|-<br />
! scope="row" | Power Domains<br />
| colspan="2" style="background:PaleGreen; text-align:center;"|Linux Mainline<br />
| <code>rockchip-pm-domain</code><br />
| As of 6.1<sup>[https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=6541b424ce1dda616d3946e839f015c984df7a99]</sup><br />
|-<br />
! scope="row" | CAN<br />
| colspan="2" style="background:#F99; text-align:center;"|Needs porting<br />
| <code>rockchip_canfd</code><br />
| Not broken out on the QuartzPro64, so we probably won't be the ones porting it<br />
|-<br />
! scope="row" | SPDIF TX<br />
| colspan="2" style="background:#F99; text-align:center;"|May need porting<br />
| <code>rockchip-spdif</code><br />
| Genuinely just needs the compatible string added, I think, otherwise we're all good. Not broken out on QuartzPro64 dev board<br />
|-<br />
! scope="row" | SPDIF RX<br />
| colspan="2" style="background:#F99; text-align:center;"|Needs porting<br />
| <code>rockchip-spdifrx</code><br />
| Not broken out on QuartzPro64 dev board<br />
|-<br />
! scope="row" | PCIe<br />
| colspan="2" style="background:#F99; text-align:center;"|May need porting<br />
| <code>rockchip-dw-pcie</code><br />
| Downstream driver and upstream are quite different, look into how much work actually needs doing. Seems to be the same controller as rk3568 so maybe none?<br />
|-<br />
! scope="row" | NPU<br />
| style="background:#F99; text-align:center;"|Needs porting/writing<br />
| style="text-align:center;"|?<br />
| <code>rockchip-rknpu</code><br />
|-<br />
! scope="row" | USB 2.0<br />
| colspan="2" style="background:LightYellow; text-align:center;"|In review<sup>[https://patchwork.kernel.org/project/linux-rockchip/list/?series=749871]</sup><br />
| <code>phy-rockchip-inno-usb2</code><br />
| There's probably more to USB 2 than just the PHY but this is what I found for now<br />
|-<br />
! scope="row" | USB 3.0<br />
| colspan="2" style="background:#F99; text-align:center;"|?<br />
| <code>?</code><br />
|<br />
|-<br />
! scope="row" | SATA<br />
| colspan="2" style="background:PaleGreen; text-align:center;"|Linux Mainline<br />
| <code>ahci-dwc</code><br />
| Just needs the compatible added to the bindings, done in [https://patchwork.kernel.org/project/linux-rockchip/list/?series=749876]<br />
|-<br />
! scope="row" | Thermal<br />
| colspan="2" style="background:LightYellow; text-align:center;"|In review<sup>[https://patchwork.kernel.org/project/linux-rockchip/list/?series=687619]</sup><br />
| <code>rockchip-thermal</code><br />
|<br />
|-<br />
! scope="row" | Wifi & Bluetooth<br />
| colspan="2" style="background:#F99; text-align:center;"|?<br />
| <code>?</code><br />
|<br />
|-<br />
! scope="row" | HWRNG<br />
| colspan="2" style="background:#F99; text-align:center;"|Needs porting<br />
| <code>rockchip-rng</code><br />
| The code & DT work is easy to port & working<br />
|<br />
|-<br />
! scope="row" | RTC<br />
| colspan="2" style="background:PaleGreen; text-align:center;"|Linux Mainline<br />
| <code>hym8563</code><br />
| Should only need DT work (see [https://patchwork.kernel.org/project/linux-rockchip/list/?series=736799 here] for an example)<br />
|-<br />
! scope="row" | OTP<br />
| colspan="2" style="background:LightYellow; text-align:center;"|In review<sup>[https://patchwork.kernel.org/project/linux-rockchip/list/?series=744118]</sup><br />
| <code>rockchip-otp</code><br />
|<br />
|-<br />
! scope="row" | SARADC<br />
| colspan="2" style="background:LightYellow; text-align:center;"|In review<sup>[https://patchwork.kernel.org/project/linux-rockchip/list/?series=748188]</sup><br />
| <code>rockchip_saradc</code><br />
|<br />
|}<br />
<br />
== Hardware ==<br />
<br />
[[File:Quartzpro64_soc_and_ram_resized.jpeg|200px|thumb|right|The SoC and RAM packages]]<br />
<br />
=== General ===<br />
<br />
* RK3588 SoC (8 cores: 4x A76@2.4GHz + 4x A55@1.8GHz)<br />
* Mali G610MC4 GPU (4x Valhalla cores)<br />
* 16 GB LPDDR4X (SK hynix)<br />
* 64 GB eMMC (Foresee, soldered)<br />
* 1x USB-C (with video-alt mode)<br />
* 1x USB-C (FTDI debug UART, FT232RL)<br />
* 1x USB 3.0<br />
* 2x USB 2.0<br />
* 1x HDMI in<br />
* 2x HDMI out<br />
* 1x PCIe 3.0 slot (open-ended)<br />
* 1x SD / TF card slot<br />
* 2x SATA ports<br />
* 2x Gigabit ethernet (1x from SoC, 1x on PCIe, RTL8211F, RTL8111HS)<br />
* 1x WiFi & BT Module (AMPAK Tech AP6275PR3)<br />
* 2x SMA Antenna<br />
* 2x MIPI DPHY<br />
* 1x MIPI D/C PHY<br />
* 1x MIPI CSI<br />
* 1x PWM Fan header (4 pins)<br />
* 1x RTC battery socket (CR1220, 3V, see [[#Documentation|QuartzPro64 board schematics PDF]], page 21)<br />
* 1x MIC (soldered)<br />
* 1x audio output 3.5mm jack<br />
* Power in via DC 12V<br />
<br />
=== Cooler ===<br />
<br />
The board comes with two cooler mounts, a 4-hole mount that appears to be spaced 55x55mm apart, and the ~60mm diagonal "northbridge heatsink" mount the ROCKPro64 and Quartz64 Model A uses.<br />
<br />
RK3588 is slightly (<1mm?) taller than the DRAM chips, use a thick enough thermal pad instead of thermal compound.<br />
<br />
=== UART ===<br />
<br />
Plug in the USB-C port labelled "<tt>DEBUG PORT</tt>" on the QP64 board to another computer with a USB-A-to-C cable.<br />
<br />
It will show up as a FT232 USB Serial adapter in <code>lsusb</code>:<br />
<pre><br />
$ lsusb<br />
[...]<br />
Bus 005 Device 027: ID 0403:6001 Future Technology Devices International, Ltd FT232 Serial (UART) IC<br />
[...]<br />
</pre><br />
<br />
Baud rate is 1.5 mbauds or 1500000.<br />
<br />
Ensure you have the driver module loaded:<br />
<pre><br />
# modprobe ftdi_sio<br />
# lsmod | grep ftdi_sio<br />
ftdi_sio 61440 0<br />
usbserial 53248 1 ftdi_sio<br />
usbcore 290816 7 ftdi_sio,usbserial,xhci_hcd,usbhid,usbkbd,usbmouse,xhci_pci<br />
</pre><br />
<br />
If the above is not working, check the required driver is supported by your kernel, using one of the following commands:<br />
<pre><br />
$ zgrep FTDI_SIO /proc/config.gz<br />
CONFIG_USB_SERIAL_FTDI_SIO=m<br />
$ grep FTDI_SIO "/boot/config-$(uname -r)"<br />
CONFIG_USB_SERIAL_FTDI_SIO=m<br />
</pre><br />
<br />
Using the <code>dmesg</code> command, you should see something like the following:<br />
<pre><br />
[24784.535804] usb 5-3: new full-speed USB device number 3 using xhci_hcd<br />
[24784.710714] usb 5-3: New USB device found, idVendor=0403, idProduct=6001, bcdDevice= 6.00<br />
[24784.710723] usb 5-3: New USB device strings: Mfr=1, Product=2, SerialNumber=3<br />
[24784.710725] usb 5-3: Product: FT232R USB UART<br />
[24784.710727] usb 5-3: Manufacturer: FTDI<br />
[24784.710728] usb 5-3: SerialNumber: A10LLO86<br />
[24784.723858] usbcore: registered new interface driver usbserial_generic<br />
[24784.723865] usbserial: USB Serial support registered for generic<br />
[24784.725286] usbcore: registered new interface driver ftdi_sio<br />
[24784.725295] usbserial: USB Serial support registered for FTDI USB Serial Device<br />
[24784.725348] ftdi_sio 5-3:1.0: FTDI USB Serial Device converter detected<br />
[24784.725368] usb 5-3: Detected FT232RL<br />
[24784.731685] usb 5-3: FTDI USB Serial Device converter now attached to ttyUSB0<br />
</pre><br />
<br />
Then you can get console output from the QP64 with, for example:<br />
<br />
<pre><br />
screen /dev/ttyUSB0 1500000<br />
</pre><br />
<br />
=== Mounting Holes ===<br />
<br />
Can't be bothered to take a precise measurement of all the holes right now, just use [https://www.ebay.com/sch/i.html?kw=pc%20standoff%20kit some PC standoffs] and have the board sit on your desk, it's a dev board after all.<br />
<br />
See the PCB layout PDF files, linked in the [https://wiki.pine64.org/wiki/QuartzPro64_Development#Documentation Documentation] section.<br />
<br />
=== Storage ===<br />
<br />
[[File:Quartzpro64_emmc_resized.jpeg|200px|thumb|right|The eMMC on the dev board]]<br />
<br />
* Soldered on 64 GB FORESEE eMMC chip, it comes pre-flashed with some Android (you'll even get a brief bit of HDMI output)<br />
* microSD card slot<br />
* 2x SATA 3.0 (molex power connector for it not populated, but easy to remedy)<br />
<br />
=== Power ===<br />
<br />
[[File:Power_and_switch.jpg|100px|thumb|right|Power switch & barrel connector]]<br />
<br />
You can provide power to the board via the 12V barrel connector, it's 5.5mm OD/2.1mm ID barrel 'coaxial' type "M" centre-positive, the ROCKPro64 5A power supply from the PINE64 store will work. (TODO: add alternative ways).<br />
<br />
There is a hardware flip switch to power up / down the board.<br />
<br />
=== PMU ===<br />
<br />
[[File:Quartzpro64_pmu.jpeg|100px|thumb|right|The PMU]]<br />
<br />
2x RK806-2, not RK808 compatible. It's a dual PMU configuration where one PMU is a subordinate of the other.<br />
<br />
Verify this once we have access to SDK sources.<br />
<br />
=== Ethernet ===<br />
<br />
The RGMII ethernet port (near the SDCARD socket) is working if you use neg2led's linux-quartz64 repo.<br />
<br />
The other port (near the sound jack) is hooked to the SoC via PCIe and is currently reported working (on the matrix channel) with latest neggles kernel.<br />
<br />
== Boot ==<br />
<br />
The board can boot from the following interfaces:<br />
* SPI<br />
* eMMC<br />
* SD/MMC<br />
<br />
TODO: in which priority / order are those boot options tried ?<br />
<br />
== Recovery ==<br />
<br />
In the case you erase the eMMC and are unable to boot the board, you can use rkdeveloptool to recover the board. While you can use the [https://gitlab.com/pine64-org/quartz-bsp/rkdeveloptool Pine64 Fork], it is recommended to use [https://gitlab.com/cypheon/rkdeveloptool/-/tree/main?ref_type=heads cypheon's Fork] until some Pending PRs are merged in to [https://gitlab.com/pine64-org/quartz-bsp/rkdeveloptool/-/merge_requests?scope=all&state=opened&author_username=cypheon resolve issues] with larger files. This is important when working with the larger 64GB eMMC on the QuartzPro64.<br />
<br />
With rkdeveloptool installed, you will also need the rk3588_spl from rockchip to init the memory/flash when in maskrom mode. This can be downloaded from the [https://github.com/rockchip-linux/rkbin/blob/master/bin/rk35/rk3588_spl_v1.12.bin rockchip-linux/rkbin repo].<br />
<br />
To enter maskrom, enter rockusb mode and execute "rkdeveloptool reboot-maskrom".<br />
<br />
=== Dumping the eMMC ===<br />
<br />
Boot the device into maskrom mode, and then verify rkdeveloptool can see the board. <br />
'''# rkdeveloptool list'''<br />
DevNo=1 Vid=0x2207,Pid=0x350b,LocationID=503 Maskrom<br />
<br />
Once the board shows up, load the rk3588_spl you downloaded earlier, and verify that the eMMC can be seen.<br />
'''# rkdeveloptool boot ./rk3588_spl_loader_v1.08.111.bin'''<br />
Downloading bootloader succeeded.<br />
'''# rkdeveloptool read-flash-info'''<br />
Flash Info:<br />
Manufacturer: SAMSUNG, value=00<br />
Flash Size: 59000 MB<br />
Flash Size: 120832000 Sectors<br />
Block Size: 512 KB<br />
Page Size: 2 KB<br />
ECC Bits: 0<br />
Access Time: 40<br />
Flash CS: Flash<0><br />
<br />
You can now dump the eMMC using the read command. Note that first you have to calculate the eMMC size, which can be done using the output from the previous flash info command. You need to take the sector count, and times it by the sector size, to get the total number of bytes. So in the above example, 120832000*512 so the total flash size is 61865984000.<br />
<br />
Using the calculated size, you can now dump the eMMC. Please note this will take 1-2 minutes.<br />
'''# rkdeveloptool read 0x0 61865984000 ./quartzpro64_emmc_dump.bin'''<br />
Read LBA to file (0%)<br />
...<br />
Read LBA to file (100%)<br />
<br />
You now have a full dump of the entire eMMC (SHA256 62cb4ae8d02aeacccf231fa1d00087cdc74b599790a274569305693aa205318d). Note that you can also use the list-partitions and read-partition commands to dump specific partitions, but this only shows GPT partitions on the eMMC. Because of this, it will NOT include the spl_loader found in the first 4MB of the eMMC!<br />
<br />
=== Flasing the eMMC ===<br />
<br />
Boot the device into maskrom mode, and then verify rkdeveloptool can see the board. <br />
'''# rkdeveloptool list'''<br />
DevNo=1 Vid=0x2207,Pid=0x350b,LocationID=503 Maskrom<br />
<br />
Once the board shows up, load the rk3588_spl you downloaded earlier, and verify that the eMMC can be seen.<br />
'''# rkdeveloptool boot ./rk3588_spl_loader_v1.08.111.bin'''<br />
Downloading bootloader succeeded.<br />
'''# rkdeveloptool read-flash-info'''<br />
Flash Info:<br />
Manufacturer: SAMSUNG, value=00<br />
Flash Size: 59000 MB<br />
Flash Size: 120832000 Sectors<br />
Block Size: 512 KB<br />
Page Size: 2 KB<br />
ECC Bits: 0<br />
Access Time: 40<br />
Flash CS: Flash<0><br />
<br />
You can now flash the device using either the write command, or write-partition command, depending on what you are trying to do. If you are looking to restore the entire eMMC from a backup you made, you would use the command below to accomplish this.<br />
'''rkdeveloptool write 0 ./quartzpro64_emmc_dump.bin'''<br />
<br />
== Immediate TODOs ==<br />
<br />
=== Enable cpufreq Stuff ===<br />
<br />
Current neggles kernel has the CPU at 1.2 GHz, apparently SRE has patches to enable cpufreq? (see below, in [[QuartzPro64_Development#Kernel|Resources]])<br />
<br />
=== Add RK3588 Support To VOP2 ===<br />
<br />
VOP2 IP on the RK3588 is very similar to the one on the RK356x, but it still needs platform specific code added.<br />
<br />
== Ways To Do Things ==<br />
<br />
=== Using rkdeveloptool ===<br />
<br />
Use the [https://gitlab.com/pine64-org/quartz-bsp/rkdeveloptool PINE64 fork of rkdeveloptool].<br />
<br />
Connect a USB-C cable to the "DEBUG PORT" USB-C port, and a second to the "DOWNLOAD" USB-C port. '''Cable direction for the latter matters, so if it doesn't show up after entering download mode, try rotating the USB-C connector to the other side!'''<br />
<br />
To enter rockusb mode, interrupt the boot by holding the "V+/REC" on-board button or mashing Ctrl+C very quickly on the serial comms, then type <code>download</code>.<br />
<br />
$ rkdeveloptool list<br />
<br />
should now show you the device somewhat like this:<br />
<br />
'''$ rkdeveloptool list'''<br />
DevNo=1 Vid=0x2207,Pid=0x350b,LocationID=204 Loader<br />
<br />
{{Template:note|'''Note:''' If you receive an error about being unable to create the comms object in the following steps, make sure you have the udev rules installed with [https://gitlab.com/pine64-org/quartz-bsp/rkdeveloptool/-/merge_requests/19 CounterPillow's RK3588 device id patch], install them to <code>/etc/udev/rules.d/</code> and <code>udevadm control --reload</code>}}<br />
<br />
Now, we can e.g. show the partitions on the eMMC:<br />
<br />
'''$ rkdeveloptool list-partitions'''<br />
# LBA start (sectors) LBA end (sectors) Size (bytes) Name <br />
00 8192 16383 4194304 security<br />
01 16384 24575 4194304 uboot<br />
02 24576 32767 4194304 trust<br />
03 32768 40959 4194304 misc<br />
04 40960 49151 4194304 dtbo<br />
05 49152 51199 1048576 vbmeta<br />
06 51200 133119 41943040 boot<br />
07 133120 329727 100663296 recovery<br />
08 329728 1116159 402653184 backup<br />
09 1116160 1902591 402653184 cache<br />
10 1902592 1935359 16777216 metadata<br />
11 1935360 1937407 1048576 baseparameter<br />
12 1937408 8310783 3263168512 super<br />
13 8310784 120831935 57610829824 userdata<br />
<br />
You can now use <code>rkdeveloptool write-partition partitionname yourfile</code> to overwrite one of the eMMC partitions.<br />
<br />
=== U-Boot + Kernel On SD, RootFS On eMMC ===<br />
<br />
This is the setup [[User:CounterPillow]] currently uses. In short, you'll need a vendor U-Boot on your SD card, with a boot partition on it that contains your <tt>extlinux.conf</tt>, device tree and kernel.<br />
<br />
==== Setting Up The SD Card ====<br />
<br />
Assuming your SD card is <tt>/dev/sdX</tt>, partition as e.g. follows:<br />
<br />
# parted -s /dev/sdX mklabel gpt<br />
# parted -s /dev/sdX mkpart loader 64s 8MiB<br />
# parted -s /dev/sdX mkpart uboot 8MiB 16MiB<br />
# parted -s /dev/sdX mkpart env 16MiB 32MiB<br />
# parted -s /dev/sdX mkpart efi fat32 32MiB 544MiB # increase size as you wish<br />
# parted -s /dev/sdX set 4 boot on<br />
<br />
Flash SPL and u-boot:<br />
# dd if=rk3588_spl_loader_v1.06.109.bin of=/dev/sdX1<br />
# dd if=uboot.img of=/dev/sdX2<br />
<br />
Then make the filesystem:<br />
# mkfs.vfat -n "efi" /dev/sdX4<br />
<br />
Mount it to e.g. <tt>/mnt/sdcardboot</tt>:<br />
# mount /dev/sda4 /mnt/sdcardboot<br />
<br />
Put the following in <tt>/mnt/sdcardboot/extlinux/extlinux.conf</tt>:<br />
default l0<br />
menu title QuartzPro64 Boot Menu<br />
prompt 0<br />
timeout 50<br />
<br />
label l0<br />
menu label Boot Jank Kernel SDMMC<br />
linux /jank<br />
fdt /dtbs/rockchip/rk3588-evb1-v10.dtb<br />
append earlycon=uart8250,mmio32,0xfeb50000 console=ttyS2,1500000n8 root=/dev/mmcblk0p14 rw rootwait<br />
<br />
Copy your kernel to <tt>/mnt/sdcardboot/jank</tt> and your DTB to <tt>/mnt/sdcardboot/dtbs/rockchip/rk3588-evb1-v10.dtb</tt>.<br />
<br />
Unmount it, we're done with the SD card.<br />
<br />
==== Creating The Root File System ====<br />
<br />
First, allocate a file the size of your desired root partition (larger sizes will take longer to transfer, don't make the same mistakes as CounterPillow did), here we choose 16G:<br />
$ fallocate -l 16G rootpart.bin<br />
<br />
then, make the filesystem on it. CounterPillow went for ext4 because nobody has ever been fired for using ext4:<br />
$ mkfs.ext4 rootpart.bin<br />
<br />
Cool, now mount it:<br />
# mount rootpart.bin /mnt/emmc-root<br />
<br />
Now we'll download the Arch Linux ARM generic rootfs tarball and go to town:<br />
$ wget -N http://os.archlinuxarm.org/os/ArchLinuxARM-aarch64-latest.tar.gz{,.sig}<br />
$ curl 'https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x68b3537f39a313b3e574d06777193f152bdbe6a6' | gpg --import=- # in case you're lacking the key<br />
$ gpg --verify ArchLinuxARM-aarch64-latest.tar.gz.sig # don't you dare skip this<br />
# bsdtar -xpf ArchLinuxARM-aarch64-latest.tar.gz -C /mnt/emmc-root # notice that this is run as root<br />
<br />
Then we just need to edit fstab. Get the UUID (not PARTUUID) from lsblk:<br />
$ lsblk -o NAME,SIZE,MOUNTPOINTS,UUID<br />
<br />
and put it in <tt>/mnt/emmc-root/etc/fstab</tt> as follows:<br />
UUID=''root-uuid-here'' / ext4 defaults 0 1<br />
<br />
Unmount <tt>/mnt/emmc-root</tt>, we're done with it.<br />
<br />
==== Flashing The Root File System With RockUSB ====<br />
<br />
{{Template:warning|This '''will''' destroy whatever data is on that userdata partition. But you're here to run Linux, not Android, right?}}<br />
<br />
Plug one USB-C cable into the debug UART port, the other into the download port. Yes you will need two USB-C cables (or A-to-C cables) for this, get over it.<br />
<br />
Plug in your board, reset it while hammering Ctrl+c on the debug UART until you get into a u-boot command line. Now enter the <code>download</code> command.<br />
<br />
If your device doesn't show up in <code>lsusb</code> or <code>rkdeveloptool list</code> command, pull out the download USB-C plug, rotate it axially by 180 Euler degrees, and plug it back in.<br />
<br />
Next, flash the partition. Depending on the size of it, this can take over an hour:<br />
$ rkdeveloptool write-partition userdata rootpart.bin<br />
<br />
==== Booting ====<br />
<br />
Unplug the download USB-C cable once done.<br />
<br />
Put the SD card in the board. Reset it. You can now boot and your rootfs on eMMC will be mounted and contains an ALARM userland.<br />
<br />
To update kernels or the device tree, just shut down the board, take out the SD card, write a new kernel or dtb to it, and plug it back in. No more need for rkdeveloptool, yay.<br />
<br />
=== Using neg2led's kernel branch ===<br />
<br />
{{Template:note|'''Note:''' Boot hangs have been observed with latest code in this branch. Try to revert back to commit [https://github.com/neggles/linux-quartz64/commit/01f523af0fce727a0e0a37029bbb2d45626d209a arm64: dts: rockchip: rk3588: add pine64 quartzpro64 board] then retest.}}<br />
<br />
If you use the linux-quartz64 branch from neg2led's kernel fork (see Resources for a link). The uSD card reader is working and you can use a partition on it for the root FS. This will eliminate the need to use rkdeveloptool.<br />
<br />
Create the additionnal partition:<br />
<br />
# parted -s /dev/sdX mkpart root ext4 544MiB 4GiB<br />
<br />
Mount it:<br />
<br />
# mount /dev/sda4 /mnt/sdcardroot<br />
<br />
Extract the ALARM rootfs tarball in there:<br />
<br />
# bsdtar -xpf ArchLinuxARM-aarch64-latest.tar.gz -C /mnt/sdcardroot # notice that this is run as root<br />
<br />
Find the right device your SD card will be (by booting neg2led's kernel once and looking at the boot log). Then modify "root=" from extlinux/extlinux.conf, for example:<br />
<br />
root=/dev/mmcblk1p5<br />
<br />
== Resources ==<br />
<br />
=== Kernel ===<br />
<br />
* [http://lists.infradead.org/pipermail/linux-rockchip/ The linux-rockchip mailing list archives]<br />
* [https://patchwork.kernel.org/project/linux-rockchip/list/ linux-rockchip patchwork]<br />
* [https://github.com/neg2led/linux-quartz64 neggles / neg2led's mainline kernel repository with patches picked from the mailing list]<br />
* [https://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-misc.git/log/?h=rk3588 Sebastian Reichel's (SRE) rk3588 branch]<br />
* [https://github.com/rockchip-linux/kernel Rockchip BSP kernel tree]<br />
* [https://gitlab.collabora.com/hardware-enablement/rockchip-3588/linux Collabora RK3588 integration branch]<br />
* [https://gitlab.collabora.com/hardware-enablement/rockchip-3588/notes-for-rockchip-3588/-/blob/main/mainline-status.md Collabora Mainline Status Table]<br />
* [https://github.com/radxa/kernel/tree/stable-5.10-rock5 Radxa kernel tree, for reference, a lot is happening here]<br />
<br />
=== Misc ===<br />
<br />
* The quartz64 and quartz-dev channels on the PINE64 chats (bridged IRC, Matrix, Discord and Telegram)<br />
* [https://gitlab.com/pine64-org/quartz-bsp/rkdeveloptool PINE64 rkdeveloptool fork]<br />
* [https://github.com/CounterPillow/uboot-qp64 CounterPillow's uboot-qp64 repository], used with [https://github.com/rockchip-linux/rkbin/ the official rkbin repository]<br />
* [https://opensource.rock-chips.com/wiki_Main_Page Rockchip OpenSource wiki]<br />
* [https://github.com/collabora/rockchiprs rockchiprs] (rkdeveloptool replacement written in Rust)<br />
<br />
=== Documentation ===<br />
<br />
The various documents relating to the chips and board haven't been publicly released yet, but if you do have a QuartzPro64 board [[User:CounterPillow]] will happily provide the documentation for you if you ask him in the PINE64 chats. We have the following:<br />
* RK3588 TRM Part 1 and Part 2<br />
* RK860 datasheet including register descriptions<br />
* RK806 datasheet including register descriptions<br />
* RK3588 hardware design guide, machine translated to English from Chinese, and the original Chinese copy<br />
* [https://devzone.pine64.org/uploads/d392f228-d53b-11ec-9ab8-fe0395c0c83d/9fee695f-39a4-4858-a58a-c91b86d4fa2c/QuartzPro64-DevBoard-Schematic-V1.0_20220216.pdf QuartzPro64 schematics]<br />
* [https://devzone.pine64.org/uploads/d392f228-d53b-11ec-9ab8-fe0395c0c83d/cf368836-966e-4c3c-9e0d-04a82a705d45/QuartzPro64-DevBoard-PCB-V1.0_20220216_topplace.pdf QuartzPro64 PCB top layout]<br />
* [https://devzone.pine64.org/uploads/d392f228-d53b-11ec-9ab8-fe0395c0c83d/ec260213-d4f7-4c61-ad1f-40ee7b7b7a35/QuartzPro64-DevBoard-PCB-V1.0_20220216_bottomplace.pdf QuartzPro64 PCB bottom layout]<br />
* [https://datasheet.lcsc.com/lcsc/2203311530_AMPAK-Tech-AP6275PR3_C2984106.pdf AMPAK-Tech AP6275PR3 (WIFI & BT chip) datasheet]<br />
<br />
<br />
[[Category:Rockchip RK3588]] [[Category:QuartzPro64]]</div>Tomhttps://wiki.pine64.org/index.php?title=QuartzPro64_Development&diff=20788QuartzPro64 Development2023-10-02T15:15:41Z<p>Tom: /* Ways To Do Things */ Note how to enter rockusb via pressing the "V+/REC" button.</p>
<hr />
<div>[[File:Quartzpro64_whole_board_top_resized.jpeg|250px|thumb|right|The QuartzPro64 development board]]<br />
[[File:BoardBackSide.jpg|100px|thumb|right|Board back side]]<br />
<br />
A '''QuartzPro64 Development''' Wiki page before a '''QuartzPro64''' Wiki page? It's more likely than you think!<br />
<br />
This page will be used for both documenting the current development efforts and the board in general, as we don't know yet how a generally available QuartzPro64 will look like so documenting the dev board is probably best left to the development page.<br />
<br />
== Obtaining a Development Board ==<br />
<br />
Request/Register: [https://preorder.pine64.org/#/quartzpro64 https://preorder.pine64.org/#/quartzpro64]<br />
<br />
== Upstreaming Status ==<br />
<br />
{| class="wikitable plainrowheaders" border="1"<br />
! scope="col" | Function<br />
! scope="col" colspan="2" | Status<br />
! scope="col" | Component<br />
! scope="col" | Notes<br />
|-<br />
! scope="row" | Video Output<br />
| colspan="2" style="background:#F99; text-align:center;"|Needs porting<br />
| <code>VOP2</code><br />
| Collabora said they'll work on this. The video output IP on the RK3588 should mostly be the same as the one on the RK356x, but the chip specific stuff will need to be integrated into the vop2 driver.<br />
|-<br />
! scope="row" | Video Input<br />
| colspan="2" style="background:#F99; text-align:center;"|Needs porting<br />
| <code>rk_hdmirx</code><br />
| Huge 3600 line driver, but generally seems to be in good condition<br />
|-<br />
! scope="row" | 3D Acceleration <br />
| style="background:#F99; text-align:center;"|Needs writing<br />
| style="background:#F99; text-align:center;"|Needs writing<br />
| <code>panfrost</code><br />
| Collabora said they'll work on this. New architecture, reportedly needs many changes to the kernel component of Panfrost.<br />
|-<br />
! scope="row" rowspan="4" | Video Decode <br />
| style="background:#F99; text-align:center;"|Needs writing<br />
| style="background:LightYellow; text-align:center;" rowspan="4"|GStreamer only, no ffmpeg<sup>[https://patchwork.ffmpeg.org/project/ffmpeg/list/?series=2898]</sup><br />
| <code>hantro</code> using <code>v4l2-requests</code><br />
| VDPU121 handling 1080p60 H.263/MPEG-4, MPEG-1 and MPEG-2<br />
|-<br />
| style="background:#F99; text-align:center;"|Needs writing<br />
| <code>rkvdec2</code> using <code>v4l2-requests</code><br />
| Nobody is known to be working on this for now. VDPU346 handling 8K60 H.265, H.264, VP9 and AVS<br />
|-<br />
| style="background:#F99; text-align:center;"|Needs writing<br />
| <code>rkdjpeg</code> using <code>v4l2-requests</code><br />
| [[User:CounterPillow]] is doing a little work on this. VDPU720 handling JPEG<br />
|-<br />
| style="background:LightYellow; text-align:center;"|In review<sup>[https://patchwork.kernel.org/project/linux-rockchip/list/?series=721724]</sup><br />
| <code>hantro</code> using <code>v4l2-requests</code><br />
| Collabora is working on this. VDPU981 handling 4K60 AV1<br />
|-<br />
! scope="row" rowspan="3" | Video Encode <br />
| style="background:#F99; text-align:center;"|Needs writing<br />
| style="text-align:center; background:LightYellow;"|GStreamer only<br />
| JPEG on VEPU121<br />
| Driver already exists, only minor changes needed.<br />
|-<br />
| style="background:#F99; text-align:center;"|Needs writing<br />
| style="text-align:center;"|?<br />
| H.264 on VEPU580<br />
| <br />
|-<br />
| style="background:#F99; text-align:center;"|Needs writing<br />
| style="text-align:center;"|?<br />
| H.265 on VEPU580<br />
| <br />
|-<br />
! scope="row" rowspan="2" | Audio <br />
| colspan="2" style="background:PaleGreen; text-align:center;"|Linux Mainline<br />
| <code>rockchip-i2s-tdm</code><br />
| As of 6.2<sup>[https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=c619bd4268ff9895760dab303b4eb15ed3d0f7e9]</sup><br />
|-<br />
| colspan="2" style="background:PaleGreen; text-align:center;"|Linux Mainline<br />
| <code>es8388</code> CODEC<br />
| <br />
|-<br />
! scope="row" | CRU<br />
| colspan="2" style="background:PaleGreen; text-align:center;"|Linux Mainline<br />
| <code>clk-rk3588</code><br />
| As of 6.2<sup>[https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=f1c506d152ff235ad621d3c25d061cb16da67214]</sup><br />
|-<br />
! scope="row" | MMC<br />
| colspan="2" style="background:PaleGreen; text-align:center;"|Linux Mainline<br />
| <code>sdhci-of-dwcmshc</code><br />
| As of 5.19<sup>[https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=bbbd8872825310b14bc6e04250d2cb5edcd55edb]</sup><br />
|-<br />
! scope="row" | pinctrl<br />
| colspan="2" style="background:PaleGreen; text-align:center;"|Linux Mainline<br />
| <code>pinctrl-rockchip</code><br />
| As of 5.19<sup>[https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=fdc33eba11c5919199f3d13dc53571cc7bf19d7d]</sup><br />
|-<br />
! scope="row" | GPIO<br />
| colspan="2" style="background:PaleGreen; text-align:center;"|Linux Mainline<br />
| <code>rockchip-gpio</code><br />
| As of 6.1<sup>[https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=cc165ba48aaf7d792e99d0c7e4b12e9625bc73e3]</sup><br />
|-<br />
! scope="row" | I<sup>2</sup>C<br />
| colspan="2" style="background:PaleGreen; text-align:center;"|Linux Mainline<br />
| <code>rk3x-i2c</code><br />
| Should be the same as RK3399, just needs devicetree work<br />
|-<br />
! scope="row" | SPI<br />
| colspan="2" style="background:PaleGreen; text-align:center;"|Linux Mainline<br />
| <code>rockchip-spi</code><br />
| Should be the same as previous SoCs, just needs devicetree work<br />
|-<br />
! scope="row" | PMU<br />
| colspan="2" style="background:LightYellow; text-align:center;"|In review<sup>[https://patchwork.kernel.org/project/linux-rockchip/list/?series=687286]</sup><br />
| <code>rk806</code><br />
| Talks over SPI<br />
|-<br />
! scope="row" | Regulators<br />
| colspan="2" style="background:#F99; text-align:center;"|Needs porting<br />
| <code>rk860</code><br />
| Talks over I<sup>2</sup>C<br />
|-<br />
! scope="row" | GMAC<br />
| colspan="2" style="background:PaleGreen; text-align:center;"|Linux Mainline<br />
| <code>dwmac-rk</code><br />
| As of 6.1<sup>[https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=2f2b60a0ec2826e5a2b2a1ddf68994a868dccbc1]</sup><br />
|-<br />
! scope="row" | Power Domains<br />
| colspan="2" style="background:PaleGreen; text-align:center;"|Linux Mainline<br />
| <code>rockchip-pm-domain</code><br />
| As of 6.1<sup>[https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=6541b424ce1dda616d3946e839f015c984df7a99]</sup><br />
|-<br />
! scope="row" | CAN<br />
| colspan="2" style="background:#F99; text-align:center;"|Needs porting<br />
| <code>rockchip_canfd</code><br />
| Not broken out on the QuartzPro64, so we probably won't be the ones porting it<br />
|-<br />
! scope="row" | SPDIF TX<br />
| colspan="2" style="background:#F99; text-align:center;"|May need porting<br />
| <code>rockchip-spdif</code><br />
| Genuinely just needs the compatible string added, I think, otherwise we're all good. Not broken out on QuartzPro64 dev board<br />
|-<br />
! scope="row" | SPDIF RX<br />
| colspan="2" style="background:#F99; text-align:center;"|Needs porting<br />
| <code>rockchip-spdifrx</code><br />
| Not broken out on QuartzPro64 dev board<br />
|-<br />
! scope="row" | PCIe<br />
| colspan="2" style="background:#F99; text-align:center;"|May need porting<br />
| <code>rockchip-dw-pcie</code><br />
| Downstream driver and upstream are quite different, look into how much work actually needs doing. Seems to be the same controller as rk3568 so maybe none?<br />
|-<br />
! scope="row" | NPU<br />
| style="background:#F99; text-align:center;"|Needs porting/writing<br />
| style="text-align:center;"|?<br />
| <code>rockchip-rknpu</code><br />
|-<br />
! scope="row" | USB 2.0<br />
| colspan="2" style="background:LightYellow; text-align:center;"|In review<sup>[https://patchwork.kernel.org/project/linux-rockchip/list/?series=749871]</sup><br />
| <code>phy-rockchip-inno-usb2</code><br />
| There's probably more to USB 2 than just the PHY but this is what I found for now<br />
|-<br />
! scope="row" | USB 3.0<br />
| colspan="2" style="background:#F99; text-align:center;"|?<br />
| <code>?</code><br />
|<br />
|-<br />
! scope="row" | SATA<br />
| colspan="2" style="background:PaleGreen; text-align:center;"|Linux Mainline<br />
| <code>ahci-dwc</code><br />
| Just needs the compatible added to the bindings, done in [https://patchwork.kernel.org/project/linux-rockchip/list/?series=749876]<br />
|-<br />
! scope="row" | Thermal<br />
| colspan="2" style="background:LightYellow; text-align:center;"|In review<sup>[https://patchwork.kernel.org/project/linux-rockchip/list/?series=687619]</sup><br />
| <code>rockchip-thermal</code><br />
|<br />
|-<br />
! scope="row" | Wifi & Bluetooth<br />
| colspan="2" style="background:#F99; text-align:center;"|?<br />
| <code>?</code><br />
|<br />
|-<br />
! scope="row" | HWRNG<br />
| colspan="2" style="background:#F99; text-align:center;"|Needs porting<br />
| <code>rockchip-rng</code><br />
| The code & DT work is easy to port & working<br />
|<br />
|-<br />
! scope="row" | RTC<br />
| colspan="2" style="background:PaleGreen; text-align:center;"|Linux Mainline<br />
| <code>hym8563</code><br />
| Should only need DT work (see [https://patchwork.kernel.org/project/linux-rockchip/list/?series=736799 here] for an example)<br />
|-<br />
! scope="row" | OTP<br />
| colspan="2" style="background:LightYellow; text-align:center;"|In review<sup>[https://patchwork.kernel.org/project/linux-rockchip/list/?series=744118]</sup><br />
| <code>rockchip-otp</code><br />
|<br />
|-<br />
! scope="row" | SARADC<br />
| colspan="2" style="background:LightYellow; text-align:center;"|In review<sup>[https://patchwork.kernel.org/project/linux-rockchip/list/?series=748188]</sup><br />
| <code>rockchip_saradc</code><br />
|<br />
|}<br />
<br />
== Hardware ==<br />
<br />
[[File:Quartzpro64_soc_and_ram_resized.jpeg|200px|thumb|right|The SoC and RAM packages]]<br />
<br />
=== General ===<br />
<br />
* RK3588 SoC (8 cores: 4x A76@2.4GHz + 4x A55@1.8GHz)<br />
* Mali G610MC4 GPU (4x Valhalla cores)<br />
* 16 GB LPDDR4X (SK hynix)<br />
* 64 GB eMMC (Foresee, soldered)<br />
* 1x USB-C (with video-alt mode)<br />
* 1x USB-C (FTDI debug UART, FT232RL)<br />
* 1x USB 3.0<br />
* 2x USB 2.0<br />
* 1x HDMI in<br />
* 2x HDMI out<br />
* 1x PCIe 3.0 slot (open-ended)<br />
* 1x SD / TF card slot<br />
* 2x SATA ports<br />
* 2x Gigabit ethernet (1x from SoC, 1x on PCIe, RTL8211F, RTL8111HS)<br />
* 1x WiFi & BT Module (AMPAK Tech AP6275PR3)<br />
* 2x SMA Antenna<br />
* 2x MIPI DPHY<br />
* 1x MIPI D/C PHY<br />
* 1x MIPI CSI<br />
* 1x PWM Fan header (4 pins)<br />
* 1x RTC battery socket (CR1220, 3V, see [[#Documentation|QuartzPro64 board schematics PDF]], page 21)<br />
* 1x MIC (soldered)<br />
* 1x audio output 3.5mm jack<br />
* Power in via DC 12V<br />
<br />
=== Cooler ===<br />
<br />
The board comes with two cooler mounts, a 4-hole mount that appears to be spaced 55x55mm apart, and the ~60mm diagonal "northbridge heatsink" mount the ROCKPro64 and Quartz64 Model A uses.<br />
<br />
RK3588 is slightly (<1mm?) taller than the DRAM chips, use a thick enough thermal pad instead of thermal compound.<br />
<br />
=== UART ===<br />
<br />
Plug in the USB-C port labelled "<tt>DEBUG PORT</tt>" on the QP64 board to another computer with a USB-A-to-C cable.<br />
<br />
It will show up as a FT232 USB Serial adapter in <code>lsusb</code>:<br />
<pre><br />
$ lsusb<br />
[...]<br />
Bus 005 Device 027: ID 0403:6001 Future Technology Devices International, Ltd FT232 Serial (UART) IC<br />
[...]<br />
</pre><br />
<br />
Baud rate is 1.5 mbauds or 1500000.<br />
<br />
Ensure you have the driver module loaded:<br />
<pre><br />
# modprobe ftdi_sio<br />
# lsmod | grep ftdi_sio<br />
ftdi_sio 61440 0<br />
usbserial 53248 1 ftdi_sio<br />
usbcore 290816 7 ftdi_sio,usbserial,xhci_hcd,usbhid,usbkbd,usbmouse,xhci_pci<br />
</pre><br />
<br />
If the above is not working, check the required driver is supported by your kernel, using one of the following commands:<br />
<pre><br />
$ zgrep FTDI_SIO /proc/config.gz<br />
CONFIG_USB_SERIAL_FTDI_SIO=m<br />
$ grep FTDI_SIO "/boot/config-$(uname -r)"<br />
CONFIG_USB_SERIAL_FTDI_SIO=m<br />
</pre><br />
<br />
Using the <code>dmesg</code> command, you should see something like the following:<br />
<pre><br />
[24784.535804] usb 5-3: new full-speed USB device number 3 using xhci_hcd<br />
[24784.710714] usb 5-3: New USB device found, idVendor=0403, idProduct=6001, bcdDevice= 6.00<br />
[24784.710723] usb 5-3: New USB device strings: Mfr=1, Product=2, SerialNumber=3<br />
[24784.710725] usb 5-3: Product: FT232R USB UART<br />
[24784.710727] usb 5-3: Manufacturer: FTDI<br />
[24784.710728] usb 5-3: SerialNumber: A10LLO86<br />
[24784.723858] usbcore: registered new interface driver usbserial_generic<br />
[24784.723865] usbserial: USB Serial support registered for generic<br />
[24784.725286] usbcore: registered new interface driver ftdi_sio<br />
[24784.725295] usbserial: USB Serial support registered for FTDI USB Serial Device<br />
[24784.725348] ftdi_sio 5-3:1.0: FTDI USB Serial Device converter detected<br />
[24784.725368] usb 5-3: Detected FT232RL<br />
[24784.731685] usb 5-3: FTDI USB Serial Device converter now attached to ttyUSB0<br />
</pre><br />
<br />
Then you can get console output from the QP64 with, for example:<br />
<br />
<pre><br />
screen /dev/ttyUSB0 1500000<br />
</pre><br />
<br />
=== Mounting Holes ===<br />
<br />
Can't be bothered to take a precise measurement of all the holes right now, just use [https://www.ebay.com/sch/i.html?kw=pc%20standoff%20kit some PC standoffs] and have the board sit on your desk, it's a dev board after all.<br />
<br />
See the PCB layout PDF files, linked in the [https://wiki.pine64.org/wiki/QuartzPro64_Development#Documentation Documentation] section.<br />
<br />
=== Storage ===<br />
<br />
[[File:Quartzpro64_emmc_resized.jpeg|200px|thumb|right|The eMMC on the dev board]]<br />
<br />
* Soldered on 64 GB FORESEE eMMC chip, it comes pre-flashed with some Android (you'll even get a brief bit of HDMI output)<br />
* microSD card slot<br />
* 2x SATA 3.0 (molex power connector for it not populated, but easy to remedy)<br />
<br />
=== Power ===<br />
<br />
[[File:Power_and_switch.jpg|100px|thumb|right|Power switch & barrel connector]]<br />
<br />
You can provide power to the board via the 12V barrel connector, it's 5.5mm OD/2.1mm ID barrel 'coaxial' type "M" centre-positive, the ROCKPro64 5A power supply from the PINE64 store will work. (TODO: add alternative ways).<br />
<br />
There is a hardware flip switch to power up / down the board.<br />
<br />
=== PMU ===<br />
<br />
[[File:Quartzpro64_pmu.jpeg|100px|thumb|right|The PMU]]<br />
<br />
2x RK806-2, not RK808 compatible. It's a dual PMU configuration where one PMU is a subordinate of the other.<br />
<br />
Verify this once we have access to SDK sources.<br />
<br />
=== Ethernet ===<br />
<br />
The RGMII ethernet port (near the SDCARD socket) is working if you use neg2led's linux-quartz64 repo.<br />
<br />
The other port (near the sound jack) is hooked to the SoC via PCIe and is currently reported working (on the matrix channel) with latest neggles kernel.<br />
<br />
== Boot ==<br />
<br />
The board can boot from the following interfaces:<br />
* SPI<br />
* eMMC<br />
* SD/MMC<br />
<br />
TODO: in which priority / order are those boot options tried ?<br />
<br />
== Recovery ==<br />
<br />
In the case you erase the eMMC and are unable to boot the board, you can use rkdeveloptool to recover the board. While you can use the [https://gitlab.com/pine64-org/quartz-bsp/rkdeveloptool Pine64 Fork], it is recommended to use [https://gitlab.com/cypheon/rkdeveloptool/-/tree/main?ref_type=heads cypheon's Fork] until some Pending PRs are merged in to [https://gitlab.com/pine64-org/quartz-bsp/rkdeveloptool/-/merge_requests?scope=all&state=opened&author_username=cypheon resolve issues] with larger files. This is important when working with the larger 64GB eMMC on the QuartzPro64.<br />
<br />
With rkdeveloptool installed, you will also need the rk3588_spl from rockchip to init the memory/flash when in maskrom mode. This can be downloaded from the [https://github.com/rockchip-linux/rkbin/blob/master/bin/rk35/rk3588_spl_v1.12.bin rockchip-linux/rkbin repo].<br />
<br />
To enter maskrom, enter rockusb mode and execute "rkdeveloptool reboot-maskrom".<br />
<br />
=== Dumping the eMMC ===<br />
<br />
Boot the device into maskrom mode, and then verify rkdeveloptool can see the board. <br />
'''# rkdeveloptool list'''<br />
DevNo=1 Vid=0x2207,Pid=0x350b,LocationID=503 Maskrom<br />
<br />
Once the board shows up, load the rk3588_spl you downloaded earlier, and verify that the eMMC can be seen.<br />
'''# rkdeveloptool boot ./rk3588_spl_loader_v1.08.111.bin'''<br />
Downloading bootloader succeeded.<br />
'''# rkdeveloptool read-flash-info'''<br />
Flash Info:<br />
Manufacturer: SAMSUNG, value=00<br />
Flash Size: 59000 MB<br />
Flash Size: 120832000 Sectors<br />
Block Size: 512 KB<br />
Page Size: 2 KB<br />
ECC Bits: 0<br />
Access Time: 40<br />
Flash CS: Flash<0><br />
<br />
You can now dump the eMMC using the read command. Note that first you have to calculate the eMMC size, which can be done using the output from the previous flash info command. You need to take the sector count, and times it by the sector size, to get the total number of bytes. So in the above example, 120832000*512 so the total flash size is 61865984000.<br />
<br />
Using the calculated size, you can now dump the eMMC. Please note this will take a while!!!<br />
'''# rkdeveloptool read 0x0 61865984000 ./quartzpro64_emmc_dump.bin'''<br />
Read LBA to file (0%)<br />
...<br />
Read LBA to file (100%)<br />
<br />
You now have a full dump of the entire eMMC. Note that you can also use the list-partitions and read-partition commands to dump specific partitions, but this only shows GPT partitions on the eMMC. Because of this, it will NOT include the spl_loader found in the first 4MB of the eMMC!<br />
<br />
=== Flasing the eMMC ===<br />
<br />
Boot the device into maskrom mode, and then verify rkdeveloptool can see the board. <br />
'''# rkdeveloptool list'''<br />
DevNo=1 Vid=0x2207,Pid=0x350b,LocationID=503 Maskrom<br />
<br />
Once the board shows up, load the rk3588_spl you downloaded earlier, and verify that the eMMC can be seen.<br />
'''# rkdeveloptool boot ./rk3588_spl_loader_v1.08.111.bin'''<br />
Downloading bootloader succeeded.<br />
'''# rkdeveloptool read-flash-info'''<br />
Flash Info:<br />
Manufacturer: SAMSUNG, value=00<br />
Flash Size: 59000 MB<br />
Flash Size: 120832000 Sectors<br />
Block Size: 512 KB<br />
Page Size: 2 KB<br />
ECC Bits: 0<br />
Access Time: 40<br />
Flash CS: Flash<0><br />
<br />
You can now flash the device using either the write command, or write-partition command, depending on what you are trying to do. If you are looking to restore the entire eMMC from a backup you made, you would use the command below to accomplish this.<br />
'''rkdeveloptool write 0 ./quartzpro64_emmc_dump.bin'''<br />
<br />
== Immediate TODOs ==<br />
<br />
=== Enable cpufreq Stuff ===<br />
<br />
Current neggles kernel has the CPU at 1.2 GHz, apparently SRE has patches to enable cpufreq? (see below, in [[QuartzPro64_Development#Kernel|Resources]])<br />
<br />
=== Add RK3588 Support To VOP2 ===<br />
<br />
VOP2 IP on the RK3588 is very similar to the one on the RK356x, but it still needs platform specific code added.<br />
<br />
== Ways To Do Things ==<br />
<br />
=== Using rkdeveloptool ===<br />
<br />
Use the [https://gitlab.com/pine64-org/quartz-bsp/rkdeveloptool PINE64 fork of rkdeveloptool].<br />
<br />
Connect a USB-C cable to the "DEBUG PORT" USB-C port, and a second to the "DOWNLOAD" USB-C port. '''Cable direction for the latter matters, so if it doesn't show up after entering download mode, try rotating the USB-C connector to the other side!'''<br />
<br />
To enter rockusb mode, interrupt the boot by holding the "V+/REC" on-board button or mashing Ctrl+C very quickly on the serial comms, then type <code>download</code>.<br />
<br />
$ rkdeveloptool list<br />
<br />
should now show you the device somewhat like this:<br />
<br />
'''$ rkdeveloptool list'''<br />
DevNo=1 Vid=0x2207,Pid=0x350b,LocationID=204 Loader<br />
<br />
{{Template:note|'''Note:''' If you receive an error about being unable to create the comms object in the following steps, make sure you have the udev rules installed with [https://gitlab.com/pine64-org/quartz-bsp/rkdeveloptool/-/merge_requests/19 CounterPillow's RK3588 device id patch], install them to <code>/etc/udev/rules.d/</code> and <code>udevadm control --reload</code>}}<br />
<br />
Now, we can e.g. show the partitions on the eMMC:<br />
<br />
'''$ rkdeveloptool list-partitions'''<br />
# LBA start (sectors) LBA end (sectors) Size (bytes) Name <br />
00 8192 16383 4194304 security<br />
01 16384 24575 4194304 uboot<br />
02 24576 32767 4194304 trust<br />
03 32768 40959 4194304 misc<br />
04 40960 49151 4194304 dtbo<br />
05 49152 51199 1048576 vbmeta<br />
06 51200 133119 41943040 boot<br />
07 133120 329727 100663296 recovery<br />
08 329728 1116159 402653184 backup<br />
09 1116160 1902591 402653184 cache<br />
10 1902592 1935359 16777216 metadata<br />
11 1935360 1937407 1048576 baseparameter<br />
12 1937408 8310783 3263168512 super<br />
13 8310784 120831935 57610829824 userdata<br />
<br />
You can now use <code>rkdeveloptool write-partition partitionname yourfile</code> to overwrite one of the eMMC partitions.<br />
<br />
=== U-Boot + Kernel On SD, RootFS On eMMC ===<br />
<br />
This is the setup [[User:CounterPillow]] currently uses. In short, you'll need a vendor U-Boot on your SD card, with a boot partition on it that contains your <tt>extlinux.conf</tt>, device tree and kernel.<br />
<br />
==== Setting Up The SD Card ====<br />
<br />
Assuming your SD card is <tt>/dev/sdX</tt>, partition as e.g. follows:<br />
<br />
# parted -s /dev/sdX mklabel gpt<br />
# parted -s /dev/sdX mkpart loader 64s 8MiB<br />
# parted -s /dev/sdX mkpart uboot 8MiB 16MiB<br />
# parted -s /dev/sdX mkpart env 16MiB 32MiB<br />
# parted -s /dev/sdX mkpart efi fat32 32MiB 544MiB # increase size as you wish<br />
# parted -s /dev/sdX set 4 boot on<br />
<br />
Flash SPL and u-boot:<br />
# dd if=rk3588_spl_loader_v1.06.109.bin of=/dev/sdX1<br />
# dd if=uboot.img of=/dev/sdX2<br />
<br />
Then make the filesystem:<br />
# mkfs.vfat -n "efi" /dev/sdX4<br />
<br />
Mount it to e.g. <tt>/mnt/sdcardboot</tt>:<br />
# mount /dev/sda4 /mnt/sdcardboot<br />
<br />
Put the following in <tt>/mnt/sdcardboot/extlinux/extlinux.conf</tt>:<br />
default l0<br />
menu title QuartzPro64 Boot Menu<br />
prompt 0<br />
timeout 50<br />
<br />
label l0<br />
menu label Boot Jank Kernel SDMMC<br />
linux /jank<br />
fdt /dtbs/rockchip/rk3588-evb1-v10.dtb<br />
append earlycon=uart8250,mmio32,0xfeb50000 console=ttyS2,1500000n8 root=/dev/mmcblk0p14 rw rootwait<br />
<br />
Copy your kernel to <tt>/mnt/sdcardboot/jank</tt> and your DTB to <tt>/mnt/sdcardboot/dtbs/rockchip/rk3588-evb1-v10.dtb</tt>.<br />
<br />
Unmount it, we're done with the SD card.<br />
<br />
==== Creating The Root File System ====<br />
<br />
First, allocate a file the size of your desired root partition (larger sizes will take longer to transfer, don't make the same mistakes as CounterPillow did), here we choose 16G:<br />
$ fallocate -l 16G rootpart.bin<br />
<br />
then, make the filesystem on it. CounterPillow went for ext4 because nobody has ever been fired for using ext4:<br />
$ mkfs.ext4 rootpart.bin<br />
<br />
Cool, now mount it:<br />
# mount rootpart.bin /mnt/emmc-root<br />
<br />
Now we'll download the Arch Linux ARM generic rootfs tarball and go to town:<br />
$ wget -N http://os.archlinuxarm.org/os/ArchLinuxARM-aarch64-latest.tar.gz{,.sig}<br />
$ curl 'https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x68b3537f39a313b3e574d06777193f152bdbe6a6' | gpg --import=- # in case you're lacking the key<br />
$ gpg --verify ArchLinuxARM-aarch64-latest.tar.gz.sig # don't you dare skip this<br />
# bsdtar -xpf ArchLinuxARM-aarch64-latest.tar.gz -C /mnt/emmc-root # notice that this is run as root<br />
<br />
Then we just need to edit fstab. Get the UUID (not PARTUUID) from lsblk:<br />
$ lsblk -o NAME,SIZE,MOUNTPOINTS,UUID<br />
<br />
and put it in <tt>/mnt/emmc-root/etc/fstab</tt> as follows:<br />
UUID=''root-uuid-here'' / ext4 defaults 0 1<br />
<br />
Unmount <tt>/mnt/emmc-root</tt>, we're done with it.<br />
<br />
==== Flashing The Root File System With RockUSB ====<br />
<br />
{{Template:warning|This '''will''' destroy whatever data is on that userdata partition. But you're here to run Linux, not Android, right?}}<br />
<br />
Plug one USB-C cable into the debug UART port, the other into the download port. Yes you will need two USB-C cables (or A-to-C cables) for this, get over it.<br />
<br />
Plug in your board, reset it while hammering Ctrl+c on the debug UART until you get into a u-boot command line. Now enter the <code>download</code> command.<br />
<br />
If your device doesn't show up in <code>lsusb</code> or <code>rkdeveloptool list</code> command, pull out the download USB-C plug, rotate it axially by 180 Euler degrees, and plug it back in.<br />
<br />
Next, flash the partition. Depending on the size of it, this can take over an hour:<br />
$ rkdeveloptool write-partition userdata rootpart.bin<br />
<br />
==== Booting ====<br />
<br />
Unplug the download USB-C cable once done.<br />
<br />
Put the SD card in the board. Reset it. You can now boot and your rootfs on eMMC will be mounted and contains an ALARM userland.<br />
<br />
To update kernels or the device tree, just shut down the board, take out the SD card, write a new kernel or dtb to it, and plug it back in. No more need for rkdeveloptool, yay.<br />
<br />
=== Using neg2led's kernel branch ===<br />
<br />
{{Template:note|'''Note:''' Boot hangs have been observed with latest code in this branch. Try to revert back to commit [https://github.com/neggles/linux-quartz64/commit/01f523af0fce727a0e0a37029bbb2d45626d209a arm64: dts: rockchip: rk3588: add pine64 quartzpro64 board] then retest.}}<br />
<br />
If you use the linux-quartz64 branch from neg2led's kernel fork (see Resources for a link). The uSD card reader is working and you can use a partition on it for the root FS. This will eliminate the need to use rkdeveloptool.<br />
<br />
Create the additionnal partition:<br />
<br />
# parted -s /dev/sdX mkpart root ext4 544MiB 4GiB<br />
<br />
Mount it:<br />
<br />
# mount /dev/sda4 /mnt/sdcardroot<br />
<br />
Extract the ALARM rootfs tarball in there:<br />
<br />
# bsdtar -xpf ArchLinuxARM-aarch64-latest.tar.gz -C /mnt/sdcardroot # notice that this is run as root<br />
<br />
Find the right device your SD card will be (by booting neg2led's kernel once and looking at the boot log). Then modify "root=" from extlinux/extlinux.conf, for example:<br />
<br />
root=/dev/mmcblk1p5<br />
<br />
== Resources ==<br />
<br />
=== Kernel ===<br />
<br />
* [http://lists.infradead.org/pipermail/linux-rockchip/ The linux-rockchip mailing list archives]<br />
* [https://patchwork.kernel.org/project/linux-rockchip/list/ linux-rockchip patchwork]<br />
* [https://github.com/neg2led/linux-quartz64 neggles / neg2led's mainline kernel repository with patches picked from the mailing list]<br />
* [https://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-misc.git/log/?h=rk3588 Sebastian Reichel's (SRE) rk3588 branch]<br />
* [https://github.com/rockchip-linux/kernel Rockchip BSP kernel tree]<br />
* [https://gitlab.collabora.com/hardware-enablement/rockchip-3588/linux Collabora RK3588 integration branch]<br />
* [https://gitlab.collabora.com/hardware-enablement/rockchip-3588/notes-for-rockchip-3588/-/blob/main/mainline-status.md Collabora Mainline Status Table]<br />
* [https://github.com/radxa/kernel/tree/stable-5.10-rock5 Radxa kernel tree, for reference, a lot is happening here]<br />
<br />
=== Misc ===<br />
<br />
* The quartz64 and quartz-dev channels on the PINE64 chats (bridged IRC, Matrix, Discord and Telegram)<br />
* [https://gitlab.com/pine64-org/quartz-bsp/rkdeveloptool PINE64 rkdeveloptool fork]<br />
* [https://github.com/CounterPillow/uboot-qp64 CounterPillow's uboot-qp64 repository], used with [https://github.com/rockchip-linux/rkbin/ the official rkbin repository]<br />
* [https://opensource.rock-chips.com/wiki_Main_Page Rockchip OpenSource wiki]<br />
* [https://github.com/collabora/rockchiprs rockchiprs] (rkdeveloptool replacement written in Rust)<br />
<br />
=== Documentation ===<br />
<br />
The various documents relating to the chips and board haven't been publicly released yet, but if you do have a QuartzPro64 board [[User:CounterPillow]] will happily provide the documentation for you if you ask him in the PINE64 chats. We have the following:<br />
* RK3588 TRM Part 1 and Part 2<br />
* RK860 datasheet including register descriptions<br />
* RK806 datasheet including register descriptions<br />
* RK3588 hardware design guide, machine translated to English from Chinese, and the original Chinese copy<br />
* [https://devzone.pine64.org/uploads/d392f228-d53b-11ec-9ab8-fe0395c0c83d/9fee695f-39a4-4858-a58a-c91b86d4fa2c/QuartzPro64-DevBoard-Schematic-V1.0_20220216.pdf QuartzPro64 schematics]<br />
* [https://devzone.pine64.org/uploads/d392f228-d53b-11ec-9ab8-fe0395c0c83d/cf368836-966e-4c3c-9e0d-04a82a705d45/QuartzPro64-DevBoard-PCB-V1.0_20220216_topplace.pdf QuartzPro64 PCB top layout]<br />
* [https://devzone.pine64.org/uploads/d392f228-d53b-11ec-9ab8-fe0395c0c83d/ec260213-d4f7-4c61-ad1f-40ee7b7b7a35/QuartzPro64-DevBoard-PCB-V1.0_20220216_bottomplace.pdf QuartzPro64 PCB bottom layout]<br />
* [https://datasheet.lcsc.com/lcsc/2203311530_AMPAK-Tech-AP6275PR3_C2984106.pdf AMPAK-Tech AP6275PR3 (WIFI & BT chip) datasheet]<br />
<br />
<br />
[[Category:Rockchip RK3588]] [[Category:QuartzPro64]]</div>Tomhttps://wiki.pine64.org/index.php?title=QuartzPro64_Development&diff=20787QuartzPro64 Development2023-10-02T15:14:16Z<p>Tom: /* Recovery */ Note how to enter maskrom mode.</p>
<hr />
<div>[[File:Quartzpro64_whole_board_top_resized.jpeg|250px|thumb|right|The QuartzPro64 development board]]<br />
[[File:BoardBackSide.jpg|100px|thumb|right|Board back side]]<br />
<br />
A '''QuartzPro64 Development''' Wiki page before a '''QuartzPro64''' Wiki page? It's more likely than you think!<br />
<br />
This page will be used for both documenting the current development efforts and the board in general, as we don't know yet how a generally available QuartzPro64 will look like so documenting the dev board is probably best left to the development page.<br />
<br />
== Obtaining a Development Board ==<br />
<br />
Request/Register: [https://preorder.pine64.org/#/quartzpro64 https://preorder.pine64.org/#/quartzpro64]<br />
<br />
== Upstreaming Status ==<br />
<br />
{| class="wikitable plainrowheaders" border="1"<br />
! scope="col" | Function<br />
! scope="col" colspan="2" | Status<br />
! scope="col" | Component<br />
! scope="col" | Notes<br />
|-<br />
! scope="row" | Video Output<br />
| colspan="2" style="background:#F99; text-align:center;"|Needs porting<br />
| <code>VOP2</code><br />
| Collabora said they'll work on this. The video output IP on the RK3588 should mostly be the same as the one on the RK356x, but the chip specific stuff will need to be integrated into the vop2 driver.<br />
|-<br />
! scope="row" | Video Input<br />
| colspan="2" style="background:#F99; text-align:center;"|Needs porting<br />
| <code>rk_hdmirx</code><br />
| Huge 3600 line driver, but generally seems to be in good condition<br />
|-<br />
! scope="row" | 3D Acceleration <br />
| style="background:#F99; text-align:center;"|Needs writing<br />
| style="background:#F99; text-align:center;"|Needs writing<br />
| <code>panfrost</code><br />
| Collabora said they'll work on this. New architecture, reportedly needs many changes to the kernel component of Panfrost.<br />
|-<br />
! scope="row" rowspan="4" | Video Decode <br />
| style="background:#F99; text-align:center;"|Needs writing<br />
| style="background:LightYellow; text-align:center;" rowspan="4"|GStreamer only, no ffmpeg<sup>[https://patchwork.ffmpeg.org/project/ffmpeg/list/?series=2898]</sup><br />
| <code>hantro</code> using <code>v4l2-requests</code><br />
| VDPU121 handling 1080p60 H.263/MPEG-4, MPEG-1 and MPEG-2<br />
|-<br />
| style="background:#F99; text-align:center;"|Needs writing<br />
| <code>rkvdec2</code> using <code>v4l2-requests</code><br />
| Nobody is known to be working on this for now. VDPU346 handling 8K60 H.265, H.264, VP9 and AVS<br />
|-<br />
| style="background:#F99; text-align:center;"|Needs writing<br />
| <code>rkdjpeg</code> using <code>v4l2-requests</code><br />
| [[User:CounterPillow]] is doing a little work on this. VDPU720 handling JPEG<br />
|-<br />
| style="background:LightYellow; text-align:center;"|In review<sup>[https://patchwork.kernel.org/project/linux-rockchip/list/?series=721724]</sup><br />
| <code>hantro</code> using <code>v4l2-requests</code><br />
| Collabora is working on this. VDPU981 handling 4K60 AV1<br />
|-<br />
! scope="row" rowspan="3" | Video Encode <br />
| style="background:#F99; text-align:center;"|Needs writing<br />
| style="text-align:center; background:LightYellow;"|GStreamer only<br />
| JPEG on VEPU121<br />
| Driver already exists, only minor changes needed.<br />
|-<br />
| style="background:#F99; text-align:center;"|Needs writing<br />
| style="text-align:center;"|?<br />
| H.264 on VEPU580<br />
| <br />
|-<br />
| style="background:#F99; text-align:center;"|Needs writing<br />
| style="text-align:center;"|?<br />
| H.265 on VEPU580<br />
| <br />
|-<br />
! scope="row" rowspan="2" | Audio <br />
| colspan="2" style="background:PaleGreen; text-align:center;"|Linux Mainline<br />
| <code>rockchip-i2s-tdm</code><br />
| As of 6.2<sup>[https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=c619bd4268ff9895760dab303b4eb15ed3d0f7e9]</sup><br />
|-<br />
| colspan="2" style="background:PaleGreen; text-align:center;"|Linux Mainline<br />
| <code>es8388</code> CODEC<br />
| <br />
|-<br />
! scope="row" | CRU<br />
| colspan="2" style="background:PaleGreen; text-align:center;"|Linux Mainline<br />
| <code>clk-rk3588</code><br />
| As of 6.2<sup>[https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=f1c506d152ff235ad621d3c25d061cb16da67214]</sup><br />
|-<br />
! scope="row" | MMC<br />
| colspan="2" style="background:PaleGreen; text-align:center;"|Linux Mainline<br />
| <code>sdhci-of-dwcmshc</code><br />
| As of 5.19<sup>[https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=bbbd8872825310b14bc6e04250d2cb5edcd55edb]</sup><br />
|-<br />
! scope="row" | pinctrl<br />
| colspan="2" style="background:PaleGreen; text-align:center;"|Linux Mainline<br />
| <code>pinctrl-rockchip</code><br />
| As of 5.19<sup>[https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=fdc33eba11c5919199f3d13dc53571cc7bf19d7d]</sup><br />
|-<br />
! scope="row" | GPIO<br />
| colspan="2" style="background:PaleGreen; text-align:center;"|Linux Mainline<br />
| <code>rockchip-gpio</code><br />
| As of 6.1<sup>[https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=cc165ba48aaf7d792e99d0c7e4b12e9625bc73e3]</sup><br />
|-<br />
! scope="row" | I<sup>2</sup>C<br />
| colspan="2" style="background:PaleGreen; text-align:center;"|Linux Mainline<br />
| <code>rk3x-i2c</code><br />
| Should be the same as RK3399, just needs devicetree work<br />
|-<br />
! scope="row" | SPI<br />
| colspan="2" style="background:PaleGreen; text-align:center;"|Linux Mainline<br />
| <code>rockchip-spi</code><br />
| Should be the same as previous SoCs, just needs devicetree work<br />
|-<br />
! scope="row" | PMU<br />
| colspan="2" style="background:LightYellow; text-align:center;"|In review<sup>[https://patchwork.kernel.org/project/linux-rockchip/list/?series=687286]</sup><br />
| <code>rk806</code><br />
| Talks over SPI<br />
|-<br />
! scope="row" | Regulators<br />
| colspan="2" style="background:#F99; text-align:center;"|Needs porting<br />
| <code>rk860</code><br />
| Talks over I<sup>2</sup>C<br />
|-<br />
! scope="row" | GMAC<br />
| colspan="2" style="background:PaleGreen; text-align:center;"|Linux Mainline<br />
| <code>dwmac-rk</code><br />
| As of 6.1<sup>[https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=2f2b60a0ec2826e5a2b2a1ddf68994a868dccbc1]</sup><br />
|-<br />
! scope="row" | Power Domains<br />
| colspan="2" style="background:PaleGreen; text-align:center;"|Linux Mainline<br />
| <code>rockchip-pm-domain</code><br />
| As of 6.1<sup>[https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=6541b424ce1dda616d3946e839f015c984df7a99]</sup><br />
|-<br />
! scope="row" | CAN<br />
| colspan="2" style="background:#F99; text-align:center;"|Needs porting<br />
| <code>rockchip_canfd</code><br />
| Not broken out on the QuartzPro64, so we probably won't be the ones porting it<br />
|-<br />
! scope="row" | SPDIF TX<br />
| colspan="2" style="background:#F99; text-align:center;"|May need porting<br />
| <code>rockchip-spdif</code><br />
| Genuinely just needs the compatible string added, I think, otherwise we're all good. Not broken out on QuartzPro64 dev board<br />
|-<br />
! scope="row" | SPDIF RX<br />
| colspan="2" style="background:#F99; text-align:center;"|Needs porting<br />
| <code>rockchip-spdifrx</code><br />
| Not broken out on QuartzPro64 dev board<br />
|-<br />
! scope="row" | PCIe<br />
| colspan="2" style="background:#F99; text-align:center;"|May need porting<br />
| <code>rockchip-dw-pcie</code><br />
| Downstream driver and upstream are quite different, look into how much work actually needs doing. Seems to be the same controller as rk3568 so maybe none?<br />
|-<br />
! scope="row" | NPU<br />
| style="background:#F99; text-align:center;"|Needs porting/writing<br />
| style="text-align:center;"|?<br />
| <code>rockchip-rknpu</code><br />
|-<br />
! scope="row" | USB 2.0<br />
| colspan="2" style="background:LightYellow; text-align:center;"|In review<sup>[https://patchwork.kernel.org/project/linux-rockchip/list/?series=749871]</sup><br />
| <code>phy-rockchip-inno-usb2</code><br />
| There's probably more to USB 2 than just the PHY but this is what I found for now<br />
|-<br />
! scope="row" | USB 3.0<br />
| colspan="2" style="background:#F99; text-align:center;"|?<br />
| <code>?</code><br />
|<br />
|-<br />
! scope="row" | SATA<br />
| colspan="2" style="background:PaleGreen; text-align:center;"|Linux Mainline<br />
| <code>ahci-dwc</code><br />
| Just needs the compatible added to the bindings, done in [https://patchwork.kernel.org/project/linux-rockchip/list/?series=749876]<br />
|-<br />
! scope="row" | Thermal<br />
| colspan="2" style="background:LightYellow; text-align:center;"|In review<sup>[https://patchwork.kernel.org/project/linux-rockchip/list/?series=687619]</sup><br />
| <code>rockchip-thermal</code><br />
|<br />
|-<br />
! scope="row" | Wifi & Bluetooth<br />
| colspan="2" style="background:#F99; text-align:center;"|?<br />
| <code>?</code><br />
|<br />
|-<br />
! scope="row" | HWRNG<br />
| colspan="2" style="background:#F99; text-align:center;"|Needs porting<br />
| <code>rockchip-rng</code><br />
| The code & DT work is easy to port & working<br />
|<br />
|-<br />
! scope="row" | RTC<br />
| colspan="2" style="background:PaleGreen; text-align:center;"|Linux Mainline<br />
| <code>hym8563</code><br />
| Should only need DT work (see [https://patchwork.kernel.org/project/linux-rockchip/list/?series=736799 here] for an example)<br />
|-<br />
! scope="row" | OTP<br />
| colspan="2" style="background:LightYellow; text-align:center;"|In review<sup>[https://patchwork.kernel.org/project/linux-rockchip/list/?series=744118]</sup><br />
| <code>rockchip-otp</code><br />
|<br />
|-<br />
! scope="row" | SARADC<br />
| colspan="2" style="background:LightYellow; text-align:center;"|In review<sup>[https://patchwork.kernel.org/project/linux-rockchip/list/?series=748188]</sup><br />
| <code>rockchip_saradc</code><br />
|<br />
|}<br />
<br />
== Hardware ==<br />
<br />
[[File:Quartzpro64_soc_and_ram_resized.jpeg|200px|thumb|right|The SoC and RAM packages]]<br />
<br />
=== General ===<br />
<br />
* RK3588 SoC (8 cores: 4x A76@2.4GHz + 4x A55@1.8GHz)<br />
* Mali G610MC4 GPU (4x Valhalla cores)<br />
* 16 GB LPDDR4X (SK hynix)<br />
* 64 GB eMMC (Foresee, soldered)<br />
* 1x USB-C (with video-alt mode)<br />
* 1x USB-C (FTDI debug UART, FT232RL)<br />
* 1x USB 3.0<br />
* 2x USB 2.0<br />
* 1x HDMI in<br />
* 2x HDMI out<br />
* 1x PCIe 3.0 slot (open-ended)<br />
* 1x SD / TF card slot<br />
* 2x SATA ports<br />
* 2x Gigabit ethernet (1x from SoC, 1x on PCIe, RTL8211F, RTL8111HS)<br />
* 1x WiFi & BT Module (AMPAK Tech AP6275PR3)<br />
* 2x SMA Antenna<br />
* 2x MIPI DPHY<br />
* 1x MIPI D/C PHY<br />
* 1x MIPI CSI<br />
* 1x PWM Fan header (4 pins)<br />
* 1x RTC battery socket (CR1220, 3V, see [[#Documentation|QuartzPro64 board schematics PDF]], page 21)<br />
* 1x MIC (soldered)<br />
* 1x audio output 3.5mm jack<br />
* Power in via DC 12V<br />
<br />
=== Cooler ===<br />
<br />
The board comes with two cooler mounts, a 4-hole mount that appears to be spaced 55x55mm apart, and the ~60mm diagonal "northbridge heatsink" mount the ROCKPro64 and Quartz64 Model A uses.<br />
<br />
RK3588 is slightly (<1mm?) taller than the DRAM chips, use a thick enough thermal pad instead of thermal compound.<br />
<br />
=== UART ===<br />
<br />
Plug in the USB-C port labelled "<tt>DEBUG PORT</tt>" on the QP64 board to another computer with a USB-A-to-C cable.<br />
<br />
It will show up as a FT232 USB Serial adapter in <code>lsusb</code>:<br />
<pre><br />
$ lsusb<br />
[...]<br />
Bus 005 Device 027: ID 0403:6001 Future Technology Devices International, Ltd FT232 Serial (UART) IC<br />
[...]<br />
</pre><br />
<br />
Baud rate is 1.5 mbauds or 1500000.<br />
<br />
Ensure you have the driver module loaded:<br />
<pre><br />
# modprobe ftdi_sio<br />
# lsmod | grep ftdi_sio<br />
ftdi_sio 61440 0<br />
usbserial 53248 1 ftdi_sio<br />
usbcore 290816 7 ftdi_sio,usbserial,xhci_hcd,usbhid,usbkbd,usbmouse,xhci_pci<br />
</pre><br />
<br />
If the above is not working, check the required driver is supported by your kernel, using one of the following commands:<br />
<pre><br />
$ zgrep FTDI_SIO /proc/config.gz<br />
CONFIG_USB_SERIAL_FTDI_SIO=m<br />
$ grep FTDI_SIO "/boot/config-$(uname -r)"<br />
CONFIG_USB_SERIAL_FTDI_SIO=m<br />
</pre><br />
<br />
Using the <code>dmesg</code> command, you should see something like the following:<br />
<pre><br />
[24784.535804] usb 5-3: new full-speed USB device number 3 using xhci_hcd<br />
[24784.710714] usb 5-3: New USB device found, idVendor=0403, idProduct=6001, bcdDevice= 6.00<br />
[24784.710723] usb 5-3: New USB device strings: Mfr=1, Product=2, SerialNumber=3<br />
[24784.710725] usb 5-3: Product: FT232R USB UART<br />
[24784.710727] usb 5-3: Manufacturer: FTDI<br />
[24784.710728] usb 5-3: SerialNumber: A10LLO86<br />
[24784.723858] usbcore: registered new interface driver usbserial_generic<br />
[24784.723865] usbserial: USB Serial support registered for generic<br />
[24784.725286] usbcore: registered new interface driver ftdi_sio<br />
[24784.725295] usbserial: USB Serial support registered for FTDI USB Serial Device<br />
[24784.725348] ftdi_sio 5-3:1.0: FTDI USB Serial Device converter detected<br />
[24784.725368] usb 5-3: Detected FT232RL<br />
[24784.731685] usb 5-3: FTDI USB Serial Device converter now attached to ttyUSB0<br />
</pre><br />
<br />
Then you can get console output from the QP64 with, for example:<br />
<br />
<pre><br />
screen /dev/ttyUSB0 1500000<br />
</pre><br />
<br />
=== Mounting Holes ===<br />
<br />
Can't be bothered to take a precise measurement of all the holes right now, just use [https://www.ebay.com/sch/i.html?kw=pc%20standoff%20kit some PC standoffs] and have the board sit on your desk, it's a dev board after all.<br />
<br />
See the PCB layout PDF files, linked in the [https://wiki.pine64.org/wiki/QuartzPro64_Development#Documentation Documentation] section.<br />
<br />
=== Storage ===<br />
<br />
[[File:Quartzpro64_emmc_resized.jpeg|200px|thumb|right|The eMMC on the dev board]]<br />
<br />
* Soldered on 64 GB FORESEE eMMC chip, it comes pre-flashed with some Android (you'll even get a brief bit of HDMI output)<br />
* microSD card slot<br />
* 2x SATA 3.0 (molex power connector for it not populated, but easy to remedy)<br />
<br />
=== Power ===<br />
<br />
[[File:Power_and_switch.jpg|100px|thumb|right|Power switch & barrel connector]]<br />
<br />
You can provide power to the board via the 12V barrel connector, it's 5.5mm OD/2.1mm ID barrel 'coaxial' type "M" centre-positive, the ROCKPro64 5A power supply from the PINE64 store will work. (TODO: add alternative ways).<br />
<br />
There is a hardware flip switch to power up / down the board.<br />
<br />
=== PMU ===<br />
<br />
[[File:Quartzpro64_pmu.jpeg|100px|thumb|right|The PMU]]<br />
<br />
2x RK806-2, not RK808 compatible. It's a dual PMU configuration where one PMU is a subordinate of the other.<br />
<br />
Verify this once we have access to SDK sources.<br />
<br />
=== Ethernet ===<br />
<br />
The RGMII ethernet port (near the SDCARD socket) is working if you use neg2led's linux-quartz64 repo.<br />
<br />
The other port (near the sound jack) is hooked to the SoC via PCIe and is currently reported working (on the matrix channel) with latest neggles kernel.<br />
<br />
== Boot ==<br />
<br />
The board can boot from the following interfaces:<br />
* SPI<br />
* eMMC<br />
* SD/MMC<br />
<br />
TODO: in which priority / order are those boot options tried ?<br />
<br />
== Recovery ==<br />
<br />
In the case you erase the eMMC and are unable to boot the board, you can use rkdeveloptool to recover the board. While you can use the [https://gitlab.com/pine64-org/quartz-bsp/rkdeveloptool Pine64 Fork], it is recommended to use [https://gitlab.com/cypheon/rkdeveloptool/-/tree/main?ref_type=heads cypheon's Fork] until some Pending PRs are merged in to [https://gitlab.com/pine64-org/quartz-bsp/rkdeveloptool/-/merge_requests?scope=all&state=opened&author_username=cypheon resolve issues] with larger files. This is important when working with the larger 64GB eMMC on the QuartzPro64.<br />
<br />
With rkdeveloptool installed, you will also need the rk3588_spl from rockchip to init the memory/flash when in maskrom mode. This can be downloaded from the [https://github.com/rockchip-linux/rkbin/blob/master/bin/rk35/rk3588_spl_v1.12.bin rockchip-linux/rkbin repo].<br />
<br />
To enter maskrom, enter rockusb mode and execute "rkdeveloptool reboot-maskrom".<br />
<br />
=== Dumping the eMMC ===<br />
<br />
Boot the device into maskrom mode, and then verify rkdeveloptool can see the board. <br />
'''# rkdeveloptool list'''<br />
DevNo=1 Vid=0x2207,Pid=0x350b,LocationID=503 Maskrom<br />
<br />
Once the board shows up, load the rk3588_spl you downloaded earlier, and verify that the eMMC can be seen.<br />
'''# rkdeveloptool boot ./rk3588_spl_loader_v1.08.111.bin'''<br />
Downloading bootloader succeeded.<br />
'''# rkdeveloptool read-flash-info'''<br />
Flash Info:<br />
Manufacturer: SAMSUNG, value=00<br />
Flash Size: 59000 MB<br />
Flash Size: 120832000 Sectors<br />
Block Size: 512 KB<br />
Page Size: 2 KB<br />
ECC Bits: 0<br />
Access Time: 40<br />
Flash CS: Flash<0><br />
<br />
You can now dump the eMMC using the read command. Note that first you have to calculate the eMMC size, which can be done using the output from the previous flash info command. You need to take the sector count, and times it by the sector size, to get the total number of bytes. So in the above example, 120832000*512 so the total flash size is 61865984000.<br />
<br />
Using the calculated size, you can now dump the eMMC. Please note this will take a while!!!<br />
'''# rkdeveloptool read 0x0 61865984000 ./quartzpro64_emmc_dump.bin'''<br />
Read LBA to file (0%)<br />
...<br />
Read LBA to file (100%)<br />
<br />
You now have a full dump of the entire eMMC. Note that you can also use the list-partitions and read-partition commands to dump specific partitions, but this only shows GPT partitions on the eMMC. Because of this, it will NOT include the spl_loader found in the first 4MB of the eMMC!<br />
<br />
=== Flasing the eMMC ===<br />
<br />
Boot the device into maskrom mode, and then verify rkdeveloptool can see the board. <br />
'''# rkdeveloptool list'''<br />
DevNo=1 Vid=0x2207,Pid=0x350b,LocationID=503 Maskrom<br />
<br />
Once the board shows up, load the rk3588_spl you downloaded earlier, and verify that the eMMC can be seen.<br />
'''# rkdeveloptool boot ./rk3588_spl_loader_v1.08.111.bin'''<br />
Downloading bootloader succeeded.<br />
'''# rkdeveloptool read-flash-info'''<br />
Flash Info:<br />
Manufacturer: SAMSUNG, value=00<br />
Flash Size: 59000 MB<br />
Flash Size: 120832000 Sectors<br />
Block Size: 512 KB<br />
Page Size: 2 KB<br />
ECC Bits: 0<br />
Access Time: 40<br />
Flash CS: Flash<0><br />
<br />
You can now flash the device using either the write command, or write-partition command, depending on what you are trying to do. If you are looking to restore the entire eMMC from a backup you made, you would use the command below to accomplish this.<br />
'''rkdeveloptool write 0 ./quartzpro64_emmc_dump.bin'''<br />
<br />
== Immediate TODOs ==<br />
<br />
=== Enable cpufreq Stuff ===<br />
<br />
Current neggles kernel has the CPU at 1.2 GHz, apparently SRE has patches to enable cpufreq? (see below, in [[QuartzPro64_Development#Kernel|Resources]])<br />
<br />
=== Add RK3588 Support To VOP2 ===<br />
<br />
VOP2 IP on the RK3588 is very similar to the one on the RK356x, but it still needs platform specific code added.<br />
<br />
== Ways To Do Things ==<br />
<br />
=== Using rkdeveloptool ===<br />
<br />
Use the [https://gitlab.com/pine64-org/quartz-bsp/rkdeveloptool PINE64 fork of rkdeveloptool].<br />
<br />
Connect a USB-C cable to the "DEBUG PORT" USB-C port, and a second to the "DOWNLOAD" USB-C port. '''Cable direction for the latter matters, so if it doesn't show up after entering download mode, try rotating the USB-C connector to the other side!'''<br />
<br />
Interrupt the boot by mashing Ctrl+C very quickly on the serial comms, then type <code>download</code> to enter rockusb download mode.<br />
<br />
$ rkdeveloptool list<br />
<br />
should now show you the device somewhat like this:<br />
<br />
'''$ rkdeveloptool list'''<br />
DevNo=1 Vid=0x2207,Pid=0x350b,LocationID=204 Loader<br />
<br />
{{Template:note|'''Note:''' If you receive an error about being unable to create the comms object in the following steps, make sure you have the udev rules installed with [https://gitlab.com/pine64-org/quartz-bsp/rkdeveloptool/-/merge_requests/19 CounterPillow's RK3588 device id patch], install them to <code>/etc/udev/rules.d/</code> and <code>udevadm control --reload</code>}}<br />
<br />
Now, we can e.g. show the partitions on the eMMC:<br />
<br />
'''$ rkdeveloptool list-partitions'''<br />
# LBA start (sectors) LBA end (sectors) Size (bytes) Name <br />
00 8192 16383 4194304 security<br />
01 16384 24575 4194304 uboot<br />
02 24576 32767 4194304 trust<br />
03 32768 40959 4194304 misc<br />
04 40960 49151 4194304 dtbo<br />
05 49152 51199 1048576 vbmeta<br />
06 51200 133119 41943040 boot<br />
07 133120 329727 100663296 recovery<br />
08 329728 1116159 402653184 backup<br />
09 1116160 1902591 402653184 cache<br />
10 1902592 1935359 16777216 metadata<br />
11 1935360 1937407 1048576 baseparameter<br />
12 1937408 8310783 3263168512 super<br />
13 8310784 120831935 57610829824 userdata<br />
<br />
You can now use <code>rkdeveloptool write-partition partitionname yourfile</code> to overwrite one of the eMMC partitions.<br />
<br />
=== U-Boot + Kernel On SD, RootFS On eMMC ===<br />
<br />
This is the setup [[User:CounterPillow]] currently uses. In short, you'll need a vendor U-Boot on your SD card, with a boot partition on it that contains your <tt>extlinux.conf</tt>, device tree and kernel.<br />
<br />
==== Setting Up The SD Card ====<br />
<br />
Assuming your SD card is <tt>/dev/sdX</tt>, partition as e.g. follows:<br />
<br />
# parted -s /dev/sdX mklabel gpt<br />
# parted -s /dev/sdX mkpart loader 64s 8MiB<br />
# parted -s /dev/sdX mkpart uboot 8MiB 16MiB<br />
# parted -s /dev/sdX mkpart env 16MiB 32MiB<br />
# parted -s /dev/sdX mkpart efi fat32 32MiB 544MiB # increase size as you wish<br />
# parted -s /dev/sdX set 4 boot on<br />
<br />
Flash SPL and u-boot:<br />
# dd if=rk3588_spl_loader_v1.06.109.bin of=/dev/sdX1<br />
# dd if=uboot.img of=/dev/sdX2<br />
<br />
Then make the filesystem:<br />
# mkfs.vfat -n "efi" /dev/sdX4<br />
<br />
Mount it to e.g. <tt>/mnt/sdcardboot</tt>:<br />
# mount /dev/sda4 /mnt/sdcardboot<br />
<br />
Put the following in <tt>/mnt/sdcardboot/extlinux/extlinux.conf</tt>:<br />
default l0<br />
menu title QuartzPro64 Boot Menu<br />
prompt 0<br />
timeout 50<br />
<br />
label l0<br />
menu label Boot Jank Kernel SDMMC<br />
linux /jank<br />
fdt /dtbs/rockchip/rk3588-evb1-v10.dtb<br />
append earlycon=uart8250,mmio32,0xfeb50000 console=ttyS2,1500000n8 root=/dev/mmcblk0p14 rw rootwait<br />
<br />
Copy your kernel to <tt>/mnt/sdcardboot/jank</tt> and your DTB to <tt>/mnt/sdcardboot/dtbs/rockchip/rk3588-evb1-v10.dtb</tt>.<br />
<br />
Unmount it, we're done with the SD card.<br />
<br />
==== Creating The Root File System ====<br />
<br />
First, allocate a file the size of your desired root partition (larger sizes will take longer to transfer, don't make the same mistakes as CounterPillow did), here we choose 16G:<br />
$ fallocate -l 16G rootpart.bin<br />
<br />
then, make the filesystem on it. CounterPillow went for ext4 because nobody has ever been fired for using ext4:<br />
$ mkfs.ext4 rootpart.bin<br />
<br />
Cool, now mount it:<br />
# mount rootpart.bin /mnt/emmc-root<br />
<br />
Now we'll download the Arch Linux ARM generic rootfs tarball and go to town:<br />
$ wget -N http://os.archlinuxarm.org/os/ArchLinuxARM-aarch64-latest.tar.gz{,.sig}<br />
$ curl 'https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x68b3537f39a313b3e574d06777193f152bdbe6a6' | gpg --import=- # in case you're lacking the key<br />
$ gpg --verify ArchLinuxARM-aarch64-latest.tar.gz.sig # don't you dare skip this<br />
# bsdtar -xpf ArchLinuxARM-aarch64-latest.tar.gz -C /mnt/emmc-root # notice that this is run as root<br />
<br />
Then we just need to edit fstab. Get the UUID (not PARTUUID) from lsblk:<br />
$ lsblk -o NAME,SIZE,MOUNTPOINTS,UUID<br />
<br />
and put it in <tt>/mnt/emmc-root/etc/fstab</tt> as follows:<br />
UUID=''root-uuid-here'' / ext4 defaults 0 1<br />
<br />
Unmount <tt>/mnt/emmc-root</tt>, we're done with it.<br />
<br />
==== Flashing The Root File System With RockUSB ====<br />
<br />
{{Template:warning|This '''will''' destroy whatever data is on that userdata partition. But you're here to run Linux, not Android, right?}}<br />
<br />
Plug one USB-C cable into the debug UART port, the other into the download port. Yes you will need two USB-C cables (or A-to-C cables) for this, get over it.<br />
<br />
Plug in your board, reset it while hammering Ctrl+c on the debug UART until you get into a u-boot command line. Now enter the <code>download</code> command.<br />
<br />
If your device doesn't show up in <code>lsusb</code> or <code>rkdeveloptool list</code> command, pull out the download USB-C plug, rotate it axially by 180 Euler degrees, and plug it back in.<br />
<br />
Next, flash the partition. Depending on the size of it, this can take over an hour:<br />
$ rkdeveloptool write-partition userdata rootpart.bin<br />
<br />
==== Booting ====<br />
<br />
Unplug the download USB-C cable once done.<br />
<br />
Put the SD card in the board. Reset it. You can now boot and your rootfs on eMMC will be mounted and contains an ALARM userland.<br />
<br />
To update kernels or the device tree, just shut down the board, take out the SD card, write a new kernel or dtb to it, and plug it back in. No more need for rkdeveloptool, yay.<br />
<br />
=== Using neg2led's kernel branch ===<br />
<br />
{{Template:note|'''Note:''' Boot hangs have been observed with latest code in this branch. Try to revert back to commit [https://github.com/neggles/linux-quartz64/commit/01f523af0fce727a0e0a37029bbb2d45626d209a arm64: dts: rockchip: rk3588: add pine64 quartzpro64 board] then retest.}}<br />
<br />
If you use the linux-quartz64 branch from neg2led's kernel fork (see Resources for a link). The uSD card reader is working and you can use a partition on it for the root FS. This will eliminate the need to use rkdeveloptool.<br />
<br />
Create the additionnal partition:<br />
<br />
# parted -s /dev/sdX mkpart root ext4 544MiB 4GiB<br />
<br />
Mount it:<br />
<br />
# mount /dev/sda4 /mnt/sdcardroot<br />
<br />
Extract the ALARM rootfs tarball in there:<br />
<br />
# bsdtar -xpf ArchLinuxARM-aarch64-latest.tar.gz -C /mnt/sdcardroot # notice that this is run as root<br />
<br />
Find the right device your SD card will be (by booting neg2led's kernel once and looking at the boot log). Then modify "root=" from extlinux/extlinux.conf, for example:<br />
<br />
root=/dev/mmcblk1p5<br />
<br />
== Resources ==<br />
<br />
=== Kernel ===<br />
<br />
* [http://lists.infradead.org/pipermail/linux-rockchip/ The linux-rockchip mailing list archives]<br />
* [https://patchwork.kernel.org/project/linux-rockchip/list/ linux-rockchip patchwork]<br />
* [https://github.com/neg2led/linux-quartz64 neggles / neg2led's mainline kernel repository with patches picked from the mailing list]<br />
* [https://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-misc.git/log/?h=rk3588 Sebastian Reichel's (SRE) rk3588 branch]<br />
* [https://github.com/rockchip-linux/kernel Rockchip BSP kernel tree]<br />
* [https://gitlab.collabora.com/hardware-enablement/rockchip-3588/linux Collabora RK3588 integration branch]<br />
* [https://gitlab.collabora.com/hardware-enablement/rockchip-3588/notes-for-rockchip-3588/-/blob/main/mainline-status.md Collabora Mainline Status Table]<br />
* [https://github.com/radxa/kernel/tree/stable-5.10-rock5 Radxa kernel tree, for reference, a lot is happening here]<br />
<br />
=== Misc ===<br />
<br />
* The quartz64 and quartz-dev channels on the PINE64 chats (bridged IRC, Matrix, Discord and Telegram)<br />
* [https://gitlab.com/pine64-org/quartz-bsp/rkdeveloptool PINE64 rkdeveloptool fork]<br />
* [https://github.com/CounterPillow/uboot-qp64 CounterPillow's uboot-qp64 repository], used with [https://github.com/rockchip-linux/rkbin/ the official rkbin repository]<br />
* [https://opensource.rock-chips.com/wiki_Main_Page Rockchip OpenSource wiki]<br />
* [https://github.com/collabora/rockchiprs rockchiprs] (rkdeveloptool replacement written in Rust)<br />
<br />
=== Documentation ===<br />
<br />
The various documents relating to the chips and board haven't been publicly released yet, but if you do have a QuartzPro64 board [[User:CounterPillow]] will happily provide the documentation for you if you ask him in the PINE64 chats. We have the following:<br />
* RK3588 TRM Part 1 and Part 2<br />
* RK860 datasheet including register descriptions<br />
* RK806 datasheet including register descriptions<br />
* RK3588 hardware design guide, machine translated to English from Chinese, and the original Chinese copy<br />
* [https://devzone.pine64.org/uploads/d392f228-d53b-11ec-9ab8-fe0395c0c83d/9fee695f-39a4-4858-a58a-c91b86d4fa2c/QuartzPro64-DevBoard-Schematic-V1.0_20220216.pdf QuartzPro64 schematics]<br />
* [https://devzone.pine64.org/uploads/d392f228-d53b-11ec-9ab8-fe0395c0c83d/cf368836-966e-4c3c-9e0d-04a82a705d45/QuartzPro64-DevBoard-PCB-V1.0_20220216_topplace.pdf QuartzPro64 PCB top layout]<br />
* [https://devzone.pine64.org/uploads/d392f228-d53b-11ec-9ab8-fe0395c0c83d/ec260213-d4f7-4c61-ad1f-40ee7b7b7a35/QuartzPro64-DevBoard-PCB-V1.0_20220216_bottomplace.pdf QuartzPro64 PCB bottom layout]<br />
* [https://datasheet.lcsc.com/lcsc/2203311530_AMPAK-Tech-AP6275PR3_C2984106.pdf AMPAK-Tech AP6275PR3 (WIFI & BT chip) datasheet]<br />
<br />
<br />
[[Category:Rockchip RK3588]] [[Category:QuartzPro64]]</div>Tomhttps://wiki.pine64.org/index.php?title=PinePhone_Pro&diff=13123PinePhone Pro2022-05-28T06:19:25Z<p>Tom: /* Specifications */ Add the NOR Flash to the specifications</p>
<hr />
<div>[[File:Pinephone_double.png|400px|thumb|right|Rendering of the PinePhone Pro]]<br />
<br />
The '''PinePhone Pro''' is PINE64's flagship smartphone announced on October 15, 2021. It features 4GB of RAM, an 128GB eMMC and is using an Rockchip RK3399S SoC, which is a specialized version of the RK3399 made specifically for the PinePhone Pro.<br />
<br />
== Introduction ==<br />
<br />
The PinePhone Pro is PINE64’s second smartphone and a successor to the original PinePhone. It does not, however, replace the original PinePhone. It should also not be considered a second generation PinePhone; it is a higher-end device, with much better specs, aimed at those who wish to daily-drive a open system stack. Achieving this goal will, however, take time as the software and overall smartphone software ecosystem needs to mature.<br />
<br />
More information about the PinePhone Pro can be found on the device [https://www.pine64.org/pinephonepro/ main page].<br />
<br />
=== State of the software ===<br />
<sup>([[PinePhone Pro Software State|view separately]])</sup><br />
<br />
{{:PinePhone Pro Software State}}<br />
<br />
=== Editions and revisions ===<br />
Similarly to the original PinePhone, various PinePhone Pro editions are planned, the first of which is the Developer Edition (aimed at developers, as the name entails) followed by the Explorer Edition, which is aimed at early adopters.<br />
<br />
* [[PinePhone Pro Developer Edition]]<br />
* [[PinePhone Pro Explorer Edition]]<br />
<br />
=== Help and support ===<br />
<br />
Still have any questions regarding software, shipping, or ordering after reading this Wiki? Please don't hesitate to contact the community in the bridged community channels for detailed answers or simply to chat with friendly people in the community! See [[Main Page#Community and Support]].<br />
<br />
Please keep in mind that PINE64 is not like a regular company (see the [https://www.pine64.org/philosophy/ PINE64 philosophy]) and that support resources are limited - the best way to get support quickly is to ask in the community chat! Please only contact the PINE64 support directly if questions couldn't be solved via the community chat or this wiki.<br />
<br />
== First time setup ==<br />
[[File:Pinephone_warning.png|320px|thumb|right|A protection foil isolates the battery for the shipping.]]<br />
<br />
When shipped the battery is isolated from the device using a protective plastic tab, which is required to be removed before using the phone. The battery '''will not''' charge or boot until it is removed and the battery is connected again. <br />
<br />
{{Info|To remove the sticker after unboxing the phone: Carefully remove the back panel using the notch in the corner of the back cover without overbending it. Then remove the battery. Peel off the clear plastic sticker below it, which isolates the charging contacts and reinsert the battery.}}<br />
<br />
The PinePhone's SIM slot only accepts a micro-SIM, please do not insert a nano-SIM without an adapter and make sure that the nano-SIM does not get released from its adapter. The SIM card has to be placed in the lower slot, while the microSD has to be placed in the upper slot.<br />
<br />
{{Info|Do not insert an empty micro-SIM adapter into the phone and do not release the nano-SIM inside the adapter, as it will get stuck on the contact pins. If the nano-SIM got released inside the adapter inside the phone, carefully reinsert the nano-SIM card without moving the adapter. In that case do not pull on the empty adapter as it will get stuck on the contact pins and damage them!}}<br />
<br />
[[File:Pinephone slots.png|600px|thumb|none|The microSD belongs in the upper slot, the micro-SIM in the lower slot.]]<br />
<br />
An adapter from a nano to a micro-SIM might be included under tape in the camera notch of the phone's packaging. Some nano-SIMs will not fit firmly into that adapter that comes with the PinePhone and if the included adapter is used without a well-fitting nano-SIM, the contact pins might get damaged. In that case it is highly recommended to acquire a better fitting adapter.<br />
<br />
== Software ==<br />
<br />
The software section explains how to install the available software releases for the PinePhone Pro to the internal eMMC or a microSD card, how to boot them and how to solve common booting issues.<br />
<br />
=== Software releases ===<br />
<br />
The [[PinePhone Pro Software Releases]] page has a complete list of currently supported phone-optimized operating system images that work with the PinePhone Pro.<br />
<br />
{{Info|Images of the regular PinePhone are not compatible with the PinePhone Pro.}}<br />
<br />
=== Boot order ===<br />
<br />
The RK3399S processor in the PinePhone Pro searches for the bootloader (such as ''U-Boot'') in the following order:<br />
<br />
# SPI flash<br />
# eMMC (the internal memory)<br />
# MicroSD card<br />
<br />
The bootloader uses its own boot order for loading the kernel and other core operating system components at boot, which for example may result in the boot loader residing on the eMMC loading and booting the kernel from a microSD card.<br />
<br />
The SPI flash and the eMMC chip can be bypassed during boot by temporarily disabling them at the hardware level using the following method, which can be used in cases such as having corrupted installation on the SPI flash or the eMMC:<br />
<br />
* On the '''Explorer Edition''' hold the ''RE'' button underneath the cover for a few seconds, while powering on the device.<br />
<br />
* On the '''Developer Edition''', which was an earlier revision intended for developers only, the SPI and the eMMC can be bypassed by shorting the bypass test points while booting. The process is explained in the article [[PinePhone Pro Developer Edition#Nuking the factory AOSP installation|PinePhone Pro Developer Edition]]. Please join the community chat for any questions regarding the process.<br />
<br />
The bypass disables the SPI and the eMMC while being applied and the PinePhone Pro will try to boot from the next available boot medium, which is the microSD card. Note: When holding the ''RE'' button (or when shorting the contact points in case of the ''Developer Edition'') for a longer time at boot the operating system will not initialize the SPI and eMMC and it will not be possible to write to these storage mediums until the next reboot.<br />
<br />
{{Info|The bootloader (such as ''U-Boot'') resides in the free space in front of the first partition. Wiping the bootloader from the eMMC to make the PinePhone Pro boot from microSD card can be done using <code>sudo dd if&#61;/dev/zero of&#61;/dev/mmcblk2 seek&#61;64 count&#61;400 conv&#61;fsync</code>. Formatting the drive or deleting the partition table is not sufficient to wipe the bootloader.}}<br />
<br />
See [[RK3399 boot sequence]] for details regarding the boot sequence.<br />
<br />
=== Installation instructions ===<br />
<br />
The software releases can be installed (the process is being referred to as ''flashing'') to the eMMC or to an microSD card.<br />
<br />
==== Flashing to microSD card ====<br />
To install an image to the microSD card:<br />
<br />
# Download a compatible image from [[PinePhone Pro Software Releases]]<br />
# Extract the compressed image<br />
# Write the image to your microSD card using your favorite method, examples:<br />
#* Using ''dd'': On the device you're flashing the microSD card from, find the correct device under <code>lsblk</code> and then flash the image to the microSD card using <code>sudo dd if='''IMAGE.img''' of=/dev/'''[DEVICE]''' bs=1M status=progress conv=fsync</code>. Make sure the target is the whole microSD card and not its first partition (''sdc1'' or ''mmcblk0p1'' are wrong!).<br />
#* Using ''bmaptool'': Make sure to select the correct device using <code>lsblk</code>. Then run bmaptool with the correct device: Download the ''IMAGE.xz'' and the ''IMAGE.bmap'' files, then run <code>bmaptool copy --bmap '''IMAGE.bmap''' '''IMAGE.xz''' /dev/'''[DEVICE]'''</code>. This takes around 2.5 minutes to flash a 4 GB file.<br />
#* Using ''a graphical tool'': A graphical tool such as Gnome Disks under Linux or Etcher under Windows may also be used.<br />
# Insert the microSD card into the top slot of the PinePhone Pro. Make sure the microSD card is inserted all the way and that the notch of the right side of the microSD card is not visible anymore, see [[:File:Pinephone_slots.png|here]].<br />
# Power on the PinePhone Pro. If there is an '''existing bootloader on the eMMC''' already you need to bypass or wipe the bootloader on the eMMC as explained in the section [[PinePhone Pro#Boot order|Boot order]].<br />
<br />
==== Flashing to the eMMC ====<br />
Flashing to the eMMC can be done by booting an operating system from the microSD (see the section [[PinePhone Pro#Flashing to microSD card|Flashing to microSD card]]) and by writing to the eMMC directly from there:<br />
<br />
# Boot an operating system [[PinePhone Pro#Flashing to microSD card|from the microSD card]]. If there is already a bootloader on the eMMC installed see the section [[PinePhone Pro#Boot order|Boot order]] to bypass it<br />
# Download or copy the desired image to the microSD card as file<br />
# Check if the eMMC appears under <code>lsblk</code>. If it doesn't appear in the output of the command, the eMMC wasn't initialized due to applying the above explained bypass method for a too long time during the boot<br />
# Extract the image<br />
# Flash the extracted image using <code>sudo dd if='''IMAGE.img''' of=/dev/mmcblk2 bs=1M status=progress conv=fsync</code><br />
# Reboot the PinePhone Pro<br />
<br />
=== Troubleshooting ===<br />
<br />
If the PinePhone Pro is not booting (either booting incompletely into a boot splash or tty or if the PinePhone Pro is showing no signs of life) this will typically have the following two reasons:<br />
<br />
==== The battery is fully drained ====<br />
The bootloader ''U-Boot'' is currently booting into a boot loop if the battery is fully drained. In that case it is not possible to charge the phone. The battery can be charged by interrupting the boot loop by booting the PinePhone Pro into ''Maskrom mode'' or by charging the battery externally. To boot the PinePhone Pro into ''Maskrom mode'':<br />
<br />
* Remove any microSD card from the phone and keep it removed for the below procedure<br />
* Remove the battery, any USB cable and any serial cable<br />
* Reinsert the battery<br />
* Hold the ''RE'' button underneath the back cover of your ''Explorer Edition'' (or short the bypass contact points on the ''Developer Edition'') <br />
* Connect the phone to an USB port of a computer, while still holding the button for some time<br />
* Check if the phone in Maskrom mode appears in the output of the terminal command <code>lsusb</code> on the computer, the expected ''VID:PID'' of the device is ''2207:330c'' (under ''Windows'' this can be checked using the ''Device Manager'' and checking the VID and PID of an appearing ''Unknown device'')<br />
* Let the phone charge for at least two hours<br />
<br />
{{Info|If the device doesn't appear under ''lsusb'' please try again with a different known good USB-C cable and make sure that there is no microSD card in the phone inserted.}}<br />
<br />
The device should now be able to boot from the boot medium again. If that is not the case the installation got corrupted, as explained below.<br />
<br />
==== The installation is corrupted ====<br />
The PinePhone Pro won't be able to boot if the installation on the SPI flash, the eMMC or the microSD card got corrupted. To boot a working operating system:<br />
<br />
* Prepare a microSD card as explained in the section [[PinePhone Pro#Flashing to microSD card|Flashing to microSD card]]<br />
* Remove any USB-C cable or device or add-on case from the PinePhone Pro<br />
* Make sure the device is powered off by shortly removing the battery for a second<br />
* Insert the microSD card into the top slot of the PinePhone Pro. Make sure the microSD card is inserted all the way and that the notch of the right side of the microSD card is not visible anymore.<br />
* Power on the device while bypassing the SPI and eMMC as explained under [[PinePhone Pro#Boot order|Boot order]]<br />
<br />
The device should now boot from the microSD card. If the phone does not boot from the microSD card the microSD card was flashed with an incompatible image or the battery got drained as explained above.<br />
<br />
=== Bootloaders ===<br />
The following section contains notes regarding compatible bootloaders with the PinePhone Pro.<br />
<br />
==== U-Boot ====<br />
The pre-installed operating system on the PinePhone Pro Explorer Edition is using ''U-Boot'' as default bootloader.<br />
<br />
==== Tow-Boot ====<br />
There are plans to possibly ship the PinePhone Pro with ''Tow-Boot'' pre-installed to the SPI flash in a future batch, which is an opinionated distribution of ''U-Boot'' and brings numerous advantages over stock ''U-Boot'', such as the possibility to choose from booting the eMMC or microSD card using the volume buttons during boot, as well as a ''USB Mass Storage mode'', where the device can be written to by connecting the device to a computer via USB.<br />
<br />
The user can flash Tow-Boot to the PinePhone Pro using the [https://tow-boot.org/devices/pine64-pinephonePro.html instructions on the Tow-Boot website].<br />
<br />
==== levinboot ====<br />
The levinboot bootloader is another upcoming option for the PinePhone Pro. The project repository can be found [https://gitlab.com/DeltaGem/levinboot/-/tree/master/ here].<br />
<br />
== Privacy switch configuration ==<br />
<br />
[[File:PinePhone Kill Interruptors de Maquinari del PinePhone 4529.jpg|320px|thumb|right|Picture of the privacy switches]]<br />
<br />
The PinePhone features six switches that can be used to configure its hardware. They are numbered 1-6, with switch 1 located nearest to the modem. Their "on" position is toward the top of the phone.<br />
<br />
{| class="wikitable"<br />
|-<br />
! Number<br />
! Name<br />
! Description<br />
|-<br />
| 1<br />
| Modem<br />
| "On" enables 2G/3G/4G communication and GNSS hardware, "off" disables it.<br />
|-<br />
| 2<br />
| WiFi / Bluetooth<br />
| "On" enables WiFi and Bluetooth communication hardware, "off" disables it.<br />
|-<br />
| 3<br />
| Microphone<br />
| "On" enables audio input from on-board microphones (not 3.5 mm jack), "off" disables it.<br />
|-<br />
| 4<br />
| Rear camera<br />
| "On" enables the rear camera, "off" disables it.<br />
|-<br />
| 5<br />
| Front camera<br />
| "On" enables the front camera, "off" disables it.<br />
|-<br />
| 6<br />
| Headphone<br />
| "On" enables audio input and output via the 3.5 mm audio jack, "off" switches the jack to hardware UART¹ mode.<br />
|}<br />
<br />
¹ Note: The baud rate may be 1500000 instead of 115200.<br />
<br />
== Specifications ==<br />
<br />
* '''Dimensions:''' 160.8 x 76.6 x 11.1mm<br />
* '''Weight:''' Approx. 220g<br />
* '''SIM Card:''' Micro-SIM<br />
* '''Display:'''<br />
** '''Size:''' 6 inches (151mm) diagonal<br />
** '''Type:''' 1440 x 720 in-cell IPS with Gorilla Glass 4™<br />
** '''Resolution:''' 1440x720, 18:9 ratio<br />
* '''System on Chip:''' Rockchip RK3399S 64bit SoC – 2x A72 and 4x A53 CPU cores @ 1.5GHz<br />
* '''RAM:''' 4GB LPDDR4 @ 800MHz<br />
* '''Internal Storage:''' 128GB eMMC, extendable up to 2TB via microSD, supports SDHC and SDXC<br />
* '''NOR Flash:''' Listed as [GigaDevices] GD25LQ128EWIGR, but physical inspection found a SiliconKaiser SK25LP128.<br />
* '''Back [[#Camera|Camera]]:''' 13MP Sony IMX258 with Gorilla Glass 4™ protective layer, LED Flash<br />
* '''Front Camera:''' 8MP, OmniVision OV8858 front-facing camera<br />
* '''Sound:''' Loudspeaker, 3.5mm jack & mic (jack doubles as hardware UART if hardware switch 6 is deactivated)<br />
* '''Communication:'''<br />
** '''[[#Modem|Modem]]:''' [https://www.quectel.com/product/lte-eg25-g/ Quectel EG25-G]<br />
** '''LTE-FDD''': B1, B2, B3, B4, B5, B7, B8, B12, B13, B18, B19, B20, B25, B26, B28<br />
** '''LTE-TDD''': B38, B39, B40, B41<br />
** '''WCDMA''': B1, B2, B4, B5, B6, B8, B19<br />
** '''GSM''': B2, B3, B5, B8 (850, 900, 1800, 1900 MHz)<br />
** '''WLAN & Bluetooth:''' Wi-Fi 802.11AC, hotspot capable + Bluetooth V5.0<br />
** '''GNSS:''' GPS/GLONASS/BeiDou/Galileo/QZSS, with A-GPS<br />
* '''Sensors:''' Accelerometer, gyroscope, proximity, ambient light, compass<br />
* '''Privacy switches:''' Modem, WiFi & Bluetooth, Microphone, Cameras<br />
* '''[[#Battery|Battery]]:''' Lithium-ion, rated capacity 2800mAh (10.64Wh), typical capacity 3000mAh (11.40Wh) (nominally replaceable with any Samsung J7 form-factor battery)<br />
* '''I/O:''' USB Type-C, USB Host, DisplayPort Alternate Mode output, 15W 5V 3A Quick Charge, follows USB PD specification<br />
<br />
== Components ==<br />
<br />
{| class="wikitable"<br />
! Component<br />
! Model<br />
|-<br />
| Touchscreen<br />
| Goodix GT917S<br />
|-<br />
| LCD<br />
| Himax HX8394 compatible<br />
|-<br />
| Rear camera<br />
| IMX258<br />
|-<br />
| Front camera<br />
| OV8858<br />
|-<br />
| Camera flash<br />
| AW3641EDNR<br />
|-<br />
| WiFi + Bluetooth<br />
| [https://www.azurewave.com/img/wireless-modules/AW_CM256SM_DS_Rev15_CYW.pdf AzureWave AW-CM256SM]<br />
|-<br />
| Modem<br />
| [http://static.abstore.pl/design/accounts/soyter/img/dokumentacje/quectel_eg25-g.pdf Quectel EG25-G]<br />
|-<br />
| GNSS/GPS<br />
| [http://static.abstore.pl/design/accounts/soyter/img/dokumentacje/quectel_eg25-g.pdf Quectel EG25-G]<br />
|-<br />
| 3 Axis Magnetometer<br />
| [https://www.st.com/en/mems-and-sensors/lis3mdl.html ST LIS3MDL]<br />
|-<br />
| Geo Magnetic Sensor<br />
| [http://www.voltafield.com/products01.html Voltafield AF8133J]<br />
|-<br />
| Ambient light / Proximity<br />
| STK3311-A<br />
|-<br />
| Accelerometer / Gyroscope<br />
| [https://invensense.tdk.com/products/motion-tracking/6-axis/mpu-6500/ TDK MPU-6500]<br />
|-<br />
| Vibration motor<br />
| <br />
|-<br />
| Notification LED<br />
| LED0603RGB<br />
|-<br />
| Audio Codec<br />
| ALC5616 and ALC5640<br />
|-<br />
| Volume buttons<br />
| Buttons connected to the KEYADC<br />
|-<br />
| Power button<br />
| <br />
|-<br />
| Battery fuel gauge<br />
| [https://rockchip.fr/RK818%20datasheet%20V1.0.pdf RK818]<br />
|}<br />
<br />
== Datasheets, schematics and certifications ==<br />
<br />
* PinePhone Pro mainboard schematic:<br />
** [https://files.pine64.org/doc/PinePhonePro/PinephonePro-Schematic-V1.0-20211127.pdf PinePhone Pro mainboard Explorer Edition Released Schematic ver 1.0 20211127]<br />
** [https://files.pine64.org/doc/PinePhonePro/PinephonePro_PCB_Component_Placement-V02_20211127-top.pdf PinePhone Pro mainboard Explorer Edition component top placement ver 1.0 20211127]<br />
** [https://files.pine64.org/doc/PinePhonePro/PinephonePro_PCB_Component_Placement-V02_20211127-bottom.pdf PinePhone Pro mainboard Explorer Edition component bottom placement ver 1.0 20211127]<br />
<br />
* PinePhone Pro USB-C small board schematic:<br />
** TBD<br />
<br />
* Certifications:<br />
** [https://files.pine64.org/doc/cert/PinePhone%20Pro%20FCC%20Certificate-S21101902805001.pdf PinePhone Pro FCC Certificate]<br />
** [https://files.pine64.org/doc/cert/PinePhonePro%20SAR%20Evaluation%20Report-S21101902806001.pdf PinePhone Pro SAR Evaluation Report]<br />
** [https://files.pine64.org/doc/cert/PinePhone%20Pro%20CE%20RED%20Certificate-S21101902802-R1.pdf PinePhone Pro CE RED Certificate]<br />
** [https://files.pine64.org/doc/cert/PinePhonePro%20RoHS%20Test%20Report.pdf PinePhone Pro ROHS Test Report]<br />
<br />
== Factory Test Build for Hardware Checking ==<br />
<br />
* Please note that this Android build solely for PinePhone Pro hardware checking purpose and solely used by support team. This is NOT a general release build.<br />
* DD image (for 8GB microSD Card or larger)<br />
** [http://files.pine64.org/os/PinePhonePro/pinephone_pro_dd_android9_QC_Test_SDboot_20220215-8GB.img.gz Direct download from pine64.org]<br />
*** MD5 (GZip file): 214e063c8205c1a98d44b2015a21bb5d<br />
*** File Size: 722MB<br />
<br />
* Download the build, extract the image and dd it to a 8 GB or larger microSD card, takes out the PinePhone Pro Explorer Edition then insert it into microSD slot (upper slot).<br />
* Insert battery, press RE button (bypass SPI and eMMC boot) while plug in USB-C power. After 3 seconds release RE button. <br />
* When power up, below battery icon screen show up and press power key for two second, the Rockchip logo screen shows up.<br />
<br />
[[File:PPP_Abdroid_Test_Utility-1.jpg|300px]][[File:PPP_Abdroid_Test_Utility-2.jpg|300px]]<br />
<br />
* Wait for home screen, double tap on the test app icon (mark red circuit) and this will bring up the factory test screen. Please note that SD test is disable due to this is a SD boot build.<br />
* After running particular test function, please snapshot test result and pass back to support team<br />
** Note: Please slot in functional Sim card when perform SIM test<br />
** Note: When perform GPS test, the first result may fail and please ignore this false message.<br />
** Note: For light sensing test, please have touch light shine to PinePhone Pro when perform test.<br />
<br />
[[File:PPP_Abdroid_Test_Utility-4.jpg|300px]][[File:PPP_Abdroid_Test_Utility-5.jpg|538px]]<br />
<br />
== Using Factory Test Build for Battery charging ==<br />
<br />
* Please note that this Android build solely for PinePhone Pro hardware checking purpose and solely used by support team. This is NOT a general release build.<br />
* DD image (for 8GB microSD Card or larger)<br />
** [http://files.pine64.org/os/PinePhonePro/pinephone_pro_dd_android9_QC_Test_SDboot_20220215-8GB.img.gz Direct download from pine64.org]<br />
*** MD5 (GZip file): 214e063c8205c1a98d44b2015a21bb5d<br />
*** File Size: 722MB<br />
<br />
* Download the build, extract the image and dd it to a 8 GB or larger microSD card, takes out the PinePhone Pro Explorer Edition then insert it into microSD slot (upper slot).<br />
* Insert battery, press RE button (bypass SPI and eMMC boot) while plug in USB-C power. After 3 seconds release RE button. <br />
* When power up, below battery icon screen show up and battery will start charging. <br />
* The battery icon display for few seconds and then LCD panel turn off while charging. To check charging status, just quick press power button (about 0.5 second) and battery icon will display progress.<br />
<br />
[[File:PPP_Abdroid_Test_Utility-1.jpg|300px]]<br />
<br />
== Press ==<br />
<br />
For an overview about media of the PinePhone Pro you can use for the news, blogs, or similar see [[PinePhone Press]].<br />
<br />
== External links ==<br />
* [https://www.pine64.org/pinephonepro/ Product Page]<br />
* [https://www.youtube.com/watch?v=wP2-6Z74W44 Announcement video]<br />
* [https://www.pine64.org/2021/10/15/october-update-introducing-the-pinephone-pro/ Blog post] with the announcement<br />
<br />
[[Category:PinePhone Pro]][[Category:Rockchip RK3399]]</div>Tomhttps://wiki.pine64.org/index.php?title=PineModems&diff=12702PineModems2022-03-25T05:50:51Z<p>Tom: Link Dylan's post on the modem</p>
<hr />
<div>== PINE64 position on alternative firmware ==<br />
<br />
PINE64 ships the PinePhone with a stock version of the Quectel EG25-G modem's firmware. Some administrative regions, in the EU and Asia in particular, require the entirety of the modem's firmware to be licensed. Therefore, the PinePhone cannot ship with an unlicensed firmware, and the PINE64 project cannot, officially encourage its userbase to use alternative modem firmware. <br />
<br />
== Quectel EG25-G Modem ==<br />
<br />
Quectel EG25-G is an LTE Cat 4 module optimized specially for M2M and IoT applications. It is used in the [[PinePhone]].<br />
<br />
* Specifications:<br>[[File:Quectel_EG25-G_LTE_Standard_Specification_V1.3.pdf]]<br />
* Hardware design:<br>[[File:Quectel_EG25-G_Hardware_Design_V1.4.pdf]]<br />
* AT Interface reference manual:<br />
** 1.3 for EC25:<br>[[File:Quectel_EC25&EC21_AT_Commands_Manual_V1.3.pdf]]<br />
** 2.0 for EC25 and EG25-G:<br>[[File:Quectel_EC2x&EG9x&EG2x-G&EM05_Series_AT_Commands_Manual_V2.0.pdf]]<br />
* AT Interface file operations:<br>[[File:Quectel_EC2xEG25-GEG9xEM05_FILE_AT_Commands_Manual_V1.0.pdf]]<br />
* GNSS Application note:<br>[[File:Quectel_EC2x&EG9x&EG2x-G&EM05_Series_GNSS_Application_Note_V1.3.pdf]]<br />
<br />
=== Specifications ===<br />
<br />
{| class="wikitable"<br />
| Processor Family || Qualcomm MDM9607<br />
|-<br />
| CPU || Qualcomm MDM9207<br />
|-<br />
| Cores || 1 ACPU Core, Qualcomm Hexagon DSP<br />
|-<br />
| Total RAM || 256Mb<br />
|-<br />
| Total flash space || 256Mb<br />
|-<br />
| Available RAM for the ACPU || 160Mb<br />
|}<br />
<br />
=== NAND Partition table layout ===<br />
<br />
{| class="wikitable"<br />
! Index<br />
! Name<br />
! Description<br />
|-<br />
| MTD0 || <code>SBL</code><br />
| Secondary Bootloader, called from the BootROM. Used to start the TrustZone kernel and the Application Bootloader (LK). Also used to enter Quectel's recovery mode<br />
|-<br />
| MTD1 || <code>mibib</code><br />
| NAND Partition table<br />
|-<br />
| MTD2 || <code>EFS2</code><br />
| IMEI and settings used by the ADSP are stored here<br />
|-<br />
| MTD3 || <code>sys_rev</code><br />
| Unexplored<br />
|-<br />
| MTD4 || <code>rawdata</code><br />
| This is where FOTA update data exists before being commited to system or recoveryfs partitions<br />
|-<br />
| MTD5 || <code>tz</code><br />
| TrustZone kernel<br />
|-<br />
| MTD6 || <code>rpm</code><br />
| Resource / Power Manager<br />
|-<br />
| MTD7 || <code>cust_info</code><br />
| Unexplored<br />
|-<br />
| MTD8 || <code>aboot</code><br />
| Application Bootloader. Uses [https://github.com/littlekernel/lk LK] (LittleKernel, LK embedded kernel) as the bootloader. By default it allows flashing unsigned images but won't allow booting them, soft-bricking the modem until you enter EDL mode<br />
|-<br />
| MTD9 || <code>boot</code><br />
| [https://www.openembedded.org/wiki/Main_Page OpenEmbedded] boot kernel + DTB<br />
|-<br />
| MTD10 || <code>recovery</code><br />
| Recovery kernel (used for FOTA updates)<br />
|-<br />
| MTD11 || <code>modem</code><br />
| ADSP firmware blobs<br />
|-<br />
| MTD12 || <code>misc</code><br />
| Some settings are stored here, along with commands that need to be picked by LK on next boot (to reboot to fastboot or recovery mode)<br />
|-<br />
| MTD13 || <code>recoveryfs</code><br />
| Recovery filesystem image (FOTA updates)<br />
|-<br />
| MTD14 || <code>usr_data</code><br />
| User data partition (<code>/data</code> when mounted by OpenEmbedded)<br />
|-<br />
| MTD15 || <code>sec</code><br />
| Used to blow fuses in the mdm9207 from images generated by Qualcomm Sectools<br />
|-<br />
| MTD16 || <code>system</code><br />
| Linux OpenEmbedded root image, formatted in UBIFS (Unsorted Block Image File System, [https://en.wikipedia.org/wiki/UBIFS Wikipedia])<br />
|}<br />
<br />
=== Firmware Recovery ===<br />
<br />
{{warning|1= The following instructions are directed towards expert-level users and developers!}}<br />
<br />
The System partition is mounted as read-only mode, but the data partition is writable. It might be possible, if there's an unexpected reset or power is lost while running, that the data partition gets corrupt and thus unable to boot.<br />
<br />
[[File:Pinephone-EG25-Recovery.jpg|thumb|right|PinePhone USB_BOOT test points]]<br />
<br />
The modem has 4 different boot modes:<br />
* Normal boot<br />
* Recovery mode (used by the modem usually to install a FOTA update)<br />
* Fastboot mode<br />
* Qualcomm EDL Mode<br />
<br />
If the modem is unable to boot, depending on the type of crash, it might:<br />
* not show anywhere (USB device missing)<br />
* or malfunction (no radio but USB working)<br />
* or enter EDL mode, if the entire flash is corrupt.<br />
<br />
'''Boot the device in EDL mode'''<br />
<br />
To check if the device is booted in EDL mode, run <code>lsusb</code> (a part of the <code>usbutils</code> package) in a terminal and inspect the output. You should see the following device listed:<br />
<br />
Bus 003 Device 003: ID 05c6:9008 Qualcomm, Inc. Gobi Wireless Modem (QDL mode)<br />
<br />
In any scenario, the modem can be triggered to enter EDL mode by shorting two test pins on the PinePhone motherboard.<br />
<br />
# Power off the phone<br />
# short the two test points<br />
# boot the phone while keeping the test points shorted until fully booted up, at least until you hear the camera clicking twice (which is normally when the modem is powered).<br />
<br />
'''Get the Firmware Recovery Package'''<br />
<br />
The Firmware Recovery Package is at: https://github.com/Biktorgj/quectel_eg25_recovery<br />
<br />
Either clone its repo with git, or download its archive & unzip it.<br />
<br />
As you should have no access to the Internet on PinePhone when its modem need a Recovery, you can fetch it on other devices and copy it to the Pinephone.<br />
<br />
'''Execute the Quectel QFirehose utility'''<br />
<br />
Once in EDL mode, open a terminal, navigate to the root directory of the recovery package, and run:<br />
<br />
* If you use an ARM64 distribution (most likely): <code>sudo ./qfirehose -f ./</code> or <code>sudo ./qfirehose_arm64 -f ./</code><br />
* If you use an ARMHF (32 bit) distribution: <code>sudo ./qfirehose_armhf -f ./</code><br />
<br />
It will reboot the modem after finished. After about 30 seconds, it will get back up and running. To check the firmware version after that, use an AT command <code>AT+QGMR</code> like at [[PinePhone#Firmware_update]].<br />
<br />
=== Bootloader unlocking ===<br />
<br />
{{warning|1= The following instructions are directed towards expert-level users and developers!}}<br />
<br />
The Modem has a locked bootloader. It won't allow to boot unsigned Kernel images, but will allow to flash them, making it easy to brick the modem. To fix this, you can flash an unlocked bootloader, which will then allow you to do as you please with the hardware.<br />
<br />
Unlocked bootloader:<br />
* Source code: https://github.com/Biktorgj/quectel_lk<br />
* Prebuilt binary releases: https://github.com/Biktorgj/quectel_lk/releases<br />
<br />
=== Custom Kernels and system images ===<br />
<br />
{{warning|1= The following instructions are directed towards expert-level users and developers!}}<br />
<br />
Custom kernel builds and system images can be created for the modem, though they require a couple of things to be correctly built and be bootable.<br />
<br />
* The source code release for the kernel provided by the manufacturer is incomplete and won't build<br />
* Common Android tools like mkbootimg and dtbtool won't build a bootable image, even if the kernel is correctly compiled and all the DTBs attached.<br />
* Further, there's no source for the OpenEmbedded parts, so building a new system image must be done from scratch, and retrieving the mandatory binary blobs to use the ADSP part of the modem.<br />
<br />
There's a '''work in progress''' SDK to allow creating custom kernels and system images, which can be downloaded from the following repository: https://github.com/Biktorgj/pinephone_modem_sdk<br />
<br />
See its readme for infomations and instructions. Once downloaded, you should run the <code>init.sh</code> script, which will create all the base directories and download all the different repositories required to build. After the initial setup is complete, run<code>make</code> without arguments to list the available options.<br />
<br />
=== Upgrade/switch firmware via fwupd ===<br />
<br />
https://fwupd.org/ is an open-source tool for managing the installation of firmware on Linux systems.<br />
<br />
fwupd >= 1.7.6 (with the ModemManager plugin) supports writing/upgrading the https://github.com/Biktorgj/pinephone_modem_sdk firmware on the Quectel EG25-G modem.<br />
<br />
https://wiki.postmarketos.org/wiki/Fwupd discusses how to use fwupd to do this.<br />
<br />
More context: <br />
* https://dylanvanassche.be/blog/2022/pinephone-modem-upgrade/<br />
* https://gitlab.com/postmarketOS/pmaports/-/merge_requests/2760<br />
* https://gitlab.com/linux-mobile/tracker/-/issues/11<br />
<br />
=== Modem management ===<br />
<br />
To allow PinePhones to receive calls while the PinePhone is suspended, the modem should be kept running. ModemManager and a eg25-specific manager must be used for the eg25-manager to work correctly.<br />
<br />
==== ModemManager ====<br />
<br />
[https://www.freedesktop.org/wiki/Software/ModemManager/ ModemManager] "is a DBus-activated daemon which controls mobile broadband (2G/3G/4G) devices and connections". Distributions should enable the <code>--test-quick-suspend-resume</code> flag, per https://gitlab.com/linux-mobile/tracker/-/issues/12.<br />
<br />
Context: https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/321<br />
<br />
==== eg25-specific manager ====<br />
<br />
Some functionality is not built into ModemManager, and is instead managed via eg25-specific software. There are two variants of this, but only one should be used.<br />
<br />
* [https://gitlab.com/mobian1/devices/eg25-manager eg25-manager] <b>recommended</b>, used in most distributions.<br />
* [https://xnux.eu/devices/feature/modem-pp.html modem-power]<br />
<br />
==== Testing ====<br />
<br />
When a distribution makes a significant change to their modem management setup, they should consider testing the following:<br />
<br />
* Modem is recognized by ModemManager on boot.<br />
* Can make a call<br />
* Can receive a call<br />
* Can receive a call when asleep: <code>systemctl suspend</code><br />
<br />
== See also ==<br />
<br />
* [https://dylanvanassche.be/blog/2021/pinephone-modem-myths/ "PinePhone modem myths" by Dylan Van Assche]<br />
<br />
[[Category:PinePhone]]</div>Tomhttps://wiki.pine64.org/index.php?title=PineModems&diff=12701PineModems2022-03-25T05:48:35Z<p>Tom: /* ModemManager */</p>
<hr />
<div>== PINE64 position on alternative firmware ==<br />
<br />
PINE64 ships the PinePhone with a stock version of the Quectel EG25-G modem's firmware. Some administrative regions, in the EU and Asia in particular, require the entirety of the modem's firmware to be licensed. Therefore, the PinePhone cannot ship with an unlicensed firmware, and the PINE64 project cannot, officially encourage its userbase to use alternative modem firmware. <br />
<br />
== Quectel EG25-G Modem ==<br />
<br />
Quectel EG25-G is an LTE Cat 4 module optimized specially for M2M and IoT applications. It is used in the [[PinePhone]].<br />
<br />
* Specifications:<br>[[File:Quectel_EG25-G_LTE_Standard_Specification_V1.3.pdf]]<br />
* Hardware design:<br>[[File:Quectel_EG25-G_Hardware_Design_V1.4.pdf]]<br />
* AT Interface reference manual:<br />
** 1.3 for EC25:<br>[[File:Quectel_EC25&EC21_AT_Commands_Manual_V1.3.pdf]]<br />
** 2.0 for EC25 and EG25-G:<br>[[File:Quectel_EC2x&EG9x&EG2x-G&EM05_Series_AT_Commands_Manual_V2.0.pdf]]<br />
* AT Interface file operations:<br>[[File:Quectel_EC2xEG25-GEG9xEM05_FILE_AT_Commands_Manual_V1.0.pdf]]<br />
* GNSS Application note:<br>[[File:Quectel_EC2x&EG9x&EG2x-G&EM05_Series_GNSS_Application_Note_V1.3.pdf]]<br />
<br />
=== Specifications ===<br />
<br />
{| class="wikitable"<br />
| Processor Family || Qualcomm MDM9607<br />
|-<br />
| CPU || Qualcomm MDM9207<br />
|-<br />
| Cores || 1 ACPU Core, Qualcomm Hexagon DSP<br />
|-<br />
| Total RAM || 256Mb<br />
|-<br />
| Total flash space || 256Mb<br />
|-<br />
| Available RAM for the ACPU || 160Mb<br />
|}<br />
<br />
=== NAND Partition table layout ===<br />
<br />
{| class="wikitable"<br />
! Index<br />
! Name<br />
! Description<br />
|-<br />
| MTD0 || <code>SBL</code><br />
| Secondary Bootloader, called from the BootROM. Used to start the TrustZone kernel and the Application Bootloader (LK). Also used to enter Quectel's recovery mode<br />
|-<br />
| MTD1 || <code>mibib</code><br />
| NAND Partition table<br />
|-<br />
| MTD2 || <code>EFS2</code><br />
| IMEI and settings used by the ADSP are stored here<br />
|-<br />
| MTD3 || <code>sys_rev</code><br />
| Unexplored<br />
|-<br />
| MTD4 || <code>rawdata</code><br />
| This is where FOTA update data exists before being commited to system or recoveryfs partitions<br />
|-<br />
| MTD5 || <code>tz</code><br />
| TrustZone kernel<br />
|-<br />
| MTD6 || <code>rpm</code><br />
| Resource / Power Manager<br />
|-<br />
| MTD7 || <code>cust_info</code><br />
| Unexplored<br />
|-<br />
| MTD8 || <code>aboot</code><br />
| Application Bootloader. Uses [https://github.com/littlekernel/lk LK] (LittleKernel, LK embedded kernel) as the bootloader. By default it allows flashing unsigned images but won't allow booting them, soft-bricking the modem until you enter EDL mode<br />
|-<br />
| MTD9 || <code>boot</code><br />
| [https://www.openembedded.org/wiki/Main_Page OpenEmbedded] boot kernel + DTB<br />
|-<br />
| MTD10 || <code>recovery</code><br />
| Recovery kernel (used for FOTA updates)<br />
|-<br />
| MTD11 || <code>modem</code><br />
| ADSP firmware blobs<br />
|-<br />
| MTD12 || <code>misc</code><br />
| Some settings are stored here, along with commands that need to be picked by LK on next boot (to reboot to fastboot or recovery mode)<br />
|-<br />
| MTD13 || <code>recoveryfs</code><br />
| Recovery filesystem image (FOTA updates)<br />
|-<br />
| MTD14 || <code>usr_data</code><br />
| User data partition (<code>/data</code> when mounted by OpenEmbedded)<br />
|-<br />
| MTD15 || <code>sec</code><br />
| Used to blow fuses in the mdm9207 from images generated by Qualcomm Sectools<br />
|-<br />
| MTD16 || <code>system</code><br />
| Linux OpenEmbedded root image, formatted in UBIFS (Unsorted Block Image File System, [https://en.wikipedia.org/wiki/UBIFS Wikipedia])<br />
|}<br />
<br />
=== Firmware Recovery ===<br />
<br />
{{warning|1= The following instructions are directed towards expert-level users and developers!}}<br />
<br />
The System partition is mounted as read-only mode, but the data partition is writable. It might be possible, if there's an unexpected reset or power is lost while running, that the data partition gets corrupt and thus unable to boot.<br />
<br />
[[File:Pinephone-EG25-Recovery.jpg|thumb|right|PinePhone USB_BOOT test points]]<br />
<br />
The modem has 4 different boot modes:<br />
* Normal boot<br />
* Recovery mode (used by the modem usually to install a FOTA update)<br />
* Fastboot mode<br />
* Qualcomm EDL Mode<br />
<br />
If the modem is unable to boot, depending on the type of crash, it might:<br />
* not show anywhere (USB device missing)<br />
* or malfunction (no radio but USB working)<br />
* or enter EDL mode, if the entire flash is corrupt.<br />
<br />
'''Boot the device in EDL mode'''<br />
<br />
To check if the device is booted in EDL mode, run <code>lsusb</code> (a part of the <code>usbutils</code> package) in a terminal and inspect the output. You should see the following device listed:<br />
<br />
Bus 003 Device 003: ID 05c6:9008 Qualcomm, Inc. Gobi Wireless Modem (QDL mode)<br />
<br />
In any scenario, the modem can be triggered to enter EDL mode by shorting two test pins on the PinePhone motherboard.<br />
<br />
# Power off the phone<br />
# short the two test points<br />
# boot the phone while keeping the test points shorted until fully booted up, at least until you hear the camera clicking twice (which is normally when the modem is powered).<br />
<br />
'''Get the Firmware Recovery Package'''<br />
<br />
The Firmware Recovery Package is at: https://github.com/Biktorgj/quectel_eg25_recovery<br />
<br />
Either clone its repo with git, or download its archive & unzip it.<br />
<br />
As you should have no access to the Internet on PinePhone when its modem need a Recovery, you can fetch it on other devices and copy it to the Pinephone.<br />
<br />
'''Execute the Quectel QFirehose utility'''<br />
<br />
Once in EDL mode, open a terminal, navigate to the root directory of the recovery package, and run:<br />
<br />
* If you use an ARM64 distribution (most likely): <code>sudo ./qfirehose -f ./</code> or <code>sudo ./qfirehose_arm64 -f ./</code><br />
* If you use an ARMHF (32 bit) distribution: <code>sudo ./qfirehose_armhf -f ./</code><br />
<br />
It will reboot the modem after finished. After about 30 seconds, it will get back up and running. To check the firmware version after that, use an AT command <code>AT+QGMR</code> like at [[PinePhone#Firmware_update]].<br />
<br />
=== Bootloader unlocking ===<br />
<br />
{{warning|1= The following instructions are directed towards expert-level users and developers!}}<br />
<br />
The Modem has a locked bootloader. It won't allow to boot unsigned Kernel images, but will allow to flash them, making it easy to brick the modem. To fix this, you can flash an unlocked bootloader, which will then allow you to do as you please with the hardware.<br />
<br />
Unlocked bootloader:<br />
* Source code: https://github.com/Biktorgj/quectel_lk<br />
* Prebuilt binary releases: https://github.com/Biktorgj/quectel_lk/releases<br />
<br />
=== Custom Kernels and system images ===<br />
<br />
{{warning|1= The following instructions are directed towards expert-level users and developers!}}<br />
<br />
Custom kernel builds and system images can be created for the modem, though they require a couple of things to be correctly built and be bootable.<br />
<br />
* The source code release for the kernel provided by the manufacturer is incomplete and won't build<br />
* Common Android tools like mkbootimg and dtbtool won't build a bootable image, even if the kernel is correctly compiled and all the DTBs attached.<br />
* Further, there's no source for the OpenEmbedded parts, so building a new system image must be done from scratch, and retrieving the mandatory binary blobs to use the ADSP part of the modem.<br />
<br />
There's a '''work in progress''' SDK to allow creating custom kernels and system images, which can be downloaded from the following repository: https://github.com/Biktorgj/pinephone_modem_sdk<br />
<br />
See its readme for infomations and instructions. Once downloaded, you should run the <code>init.sh</code> script, which will create all the base directories and download all the different repositories required to build. After the initial setup is complete, run<code>make</code> without arguments to list the available options.<br />
<br />
=== Upgrade/switch firmware via fwupd ===<br />
<br />
https://fwupd.org/ is an open-source tool for managing the installation of firmware on Linux systems.<br />
<br />
fwupd >= 1.7.6 (with the ModemManager plugin) supports writing/upgrading the https://github.com/Biktorgj/pinephone_modem_sdk firmware on the Quectel EG25-G modem.<br />
<br />
https://wiki.postmarketos.org/wiki/Fwupd discusses how to use fwupd to do this.<br />
<br />
More context: <br />
* https://dylanvanassche.be/blog/2022/pinephone-modem-upgrade/<br />
* https://gitlab.com/postmarketOS/pmaports/-/merge_requests/2760<br />
* https://gitlab.com/linux-mobile/tracker/-/issues/11<br />
<br />
=== Modem management ===<br />
<br />
To allow PinePhones to receive calls while the PinePhone is suspended, the modem should be kept running. ModemManager and a eg25-specific manager must be used for the eg25-manager to work correctly.<br />
<br />
==== ModemManager ====<br />
<br />
[https://www.freedesktop.org/wiki/Software/ModemManager/ ModemManager] "is a DBus-activated daemon which controls mobile broadband (2G/3G/4G) devices and connections". Distributions should enable the <code>--test-quick-suspend-resume</code> flag, per https://gitlab.com/linux-mobile/tracker/-/issues/12.<br />
<br />
Context: https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/321<br />
<br />
==== eg25-specific manager ====<br />
<br />
Some functionality is not built into ModemManager, and is instead managed via eg25-specific software. There are two variants of this, but only one should be used.<br />
<br />
* [https://gitlab.com/mobian1/devices/eg25-manager eg25-manager] <b>recommended</b>, used in most distributions.<br />
* [https://xnux.eu/devices/feature/modem-pp.html modem-power]<br />
<br />
==== Testing ====<br />
<br />
When a distribution makes a significant change to their modem management setup, they should consider testing the following:<br />
<br />
* Modem is recognized by ModemManager on boot.<br />
* Can make a call<br />
* Can receive a call<br />
* Can receive a call when asleep: <code>systemctl suspend</code><br />
<br />
[[Category:PinePhone]]</div>Tomhttps://wiki.pine64.org/index.php?title=PineModems&diff=12700PineModems2022-03-25T05:46:17Z<p>Tom: /* Modem management */ Document that flag --test-quick-suspend-resume should be set on ModemManager.</p>
<hr />
<div>== PINE64 position on alternative firmware ==<br />
<br />
PINE64 ships the PinePhone with a stock version of the Quectel EG25-G modem's firmware. Some administrative regions, in the EU and Asia in particular, require the entirety of the modem's firmware to be licensed. Therefore, the PinePhone cannot ship with an unlicensed firmware, and the PINE64 project cannot, officially encourage its userbase to use alternative modem firmware. <br />
<br />
== Quectel EG25-G Modem ==<br />
<br />
Quectel EG25-G is an LTE Cat 4 module optimized specially for M2M and IoT applications. It is used in the [[PinePhone]].<br />
<br />
* Specifications:<br>[[File:Quectel_EG25-G_LTE_Standard_Specification_V1.3.pdf]]<br />
* Hardware design:<br>[[File:Quectel_EG25-G_Hardware_Design_V1.4.pdf]]<br />
* AT Interface reference manual:<br />
** 1.3 for EC25:<br>[[File:Quectel_EC25&EC21_AT_Commands_Manual_V1.3.pdf]]<br />
** 2.0 for EC25 and EG25-G:<br>[[File:Quectel_EC2x&EG9x&EG2x-G&EM05_Series_AT_Commands_Manual_V2.0.pdf]]<br />
* AT Interface file operations:<br>[[File:Quectel_EC2xEG25-GEG9xEM05_FILE_AT_Commands_Manual_V1.0.pdf]]<br />
* GNSS Application note:<br>[[File:Quectel_EC2x&EG9x&EG2x-G&EM05_Series_GNSS_Application_Note_V1.3.pdf]]<br />
<br />
=== Specifications ===<br />
<br />
{| class="wikitable"<br />
| Processor Family || Qualcomm MDM9607<br />
|-<br />
| CPU || Qualcomm MDM9207<br />
|-<br />
| Cores || 1 ACPU Core, Qualcomm Hexagon DSP<br />
|-<br />
| Total RAM || 256Mb<br />
|-<br />
| Total flash space || 256Mb<br />
|-<br />
| Available RAM for the ACPU || 160Mb<br />
|}<br />
<br />
=== NAND Partition table layout ===<br />
<br />
{| class="wikitable"<br />
! Index<br />
! Name<br />
! Description<br />
|-<br />
| MTD0 || <code>SBL</code><br />
| Secondary Bootloader, called from the BootROM. Used to start the TrustZone kernel and the Application Bootloader (LK). Also used to enter Quectel's recovery mode<br />
|-<br />
| MTD1 || <code>mibib</code><br />
| NAND Partition table<br />
|-<br />
| MTD2 || <code>EFS2</code><br />
| IMEI and settings used by the ADSP are stored here<br />
|-<br />
| MTD3 || <code>sys_rev</code><br />
| Unexplored<br />
|-<br />
| MTD4 || <code>rawdata</code><br />
| This is where FOTA update data exists before being commited to system or recoveryfs partitions<br />
|-<br />
| MTD5 || <code>tz</code><br />
| TrustZone kernel<br />
|-<br />
| MTD6 || <code>rpm</code><br />
| Resource / Power Manager<br />
|-<br />
| MTD7 || <code>cust_info</code><br />
| Unexplored<br />
|-<br />
| MTD8 || <code>aboot</code><br />
| Application Bootloader. Uses [https://github.com/littlekernel/lk LK] (LittleKernel, LK embedded kernel) as the bootloader. By default it allows flashing unsigned images but won't allow booting them, soft-bricking the modem until you enter EDL mode<br />
|-<br />
| MTD9 || <code>boot</code><br />
| [https://www.openembedded.org/wiki/Main_Page OpenEmbedded] boot kernel + DTB<br />
|-<br />
| MTD10 || <code>recovery</code><br />
| Recovery kernel (used for FOTA updates)<br />
|-<br />
| MTD11 || <code>modem</code><br />
| ADSP firmware blobs<br />
|-<br />
| MTD12 || <code>misc</code><br />
| Some settings are stored here, along with commands that need to be picked by LK on next boot (to reboot to fastboot or recovery mode)<br />
|-<br />
| MTD13 || <code>recoveryfs</code><br />
| Recovery filesystem image (FOTA updates)<br />
|-<br />
| MTD14 || <code>usr_data</code><br />
| User data partition (<code>/data</code> when mounted by OpenEmbedded)<br />
|-<br />
| MTD15 || <code>sec</code><br />
| Used to blow fuses in the mdm9207 from images generated by Qualcomm Sectools<br />
|-<br />
| MTD16 || <code>system</code><br />
| Linux OpenEmbedded root image, formatted in UBIFS (Unsorted Block Image File System, [https://en.wikipedia.org/wiki/UBIFS Wikipedia])<br />
|}<br />
<br />
=== Firmware Recovery ===<br />
<br />
{{warning|1= The following instructions are directed towards expert-level users and developers!}}<br />
<br />
The System partition is mounted as read-only mode, but the data partition is writable. It might be possible, if there's an unexpected reset or power is lost while running, that the data partition gets corrupt and thus unable to boot.<br />
<br />
[[File:Pinephone-EG25-Recovery.jpg|thumb|right|PinePhone USB_BOOT test points]]<br />
<br />
The modem has 4 different boot modes:<br />
* Normal boot<br />
* Recovery mode (used by the modem usually to install a FOTA update)<br />
* Fastboot mode<br />
* Qualcomm EDL Mode<br />
<br />
If the modem is unable to boot, depending on the type of crash, it might:<br />
* not show anywhere (USB device missing)<br />
* or malfunction (no radio but USB working)<br />
* or enter EDL mode, if the entire flash is corrupt.<br />
<br />
'''Boot the device in EDL mode'''<br />
<br />
To check if the device is booted in EDL mode, run <code>lsusb</code> (a part of the <code>usbutils</code> package) in a terminal and inspect the output. You should see the following device listed:<br />
<br />
Bus 003 Device 003: ID 05c6:9008 Qualcomm, Inc. Gobi Wireless Modem (QDL mode)<br />
<br />
In any scenario, the modem can be triggered to enter EDL mode by shorting two test pins on the PinePhone motherboard.<br />
<br />
# Power off the phone<br />
# short the two test points<br />
# boot the phone while keeping the test points shorted until fully booted up, at least until you hear the camera clicking twice (which is normally when the modem is powered).<br />
<br />
'''Get the Firmware Recovery Package'''<br />
<br />
The Firmware Recovery Package is at: https://github.com/Biktorgj/quectel_eg25_recovery<br />
<br />
Either clone its repo with git, or download its archive & unzip it.<br />
<br />
As you should have no access to the Internet on PinePhone when its modem need a Recovery, you can fetch it on other devices and copy it to the Pinephone.<br />
<br />
'''Execute the Quectel QFirehose utility'''<br />
<br />
Once in EDL mode, open a terminal, navigate to the root directory of the recovery package, and run:<br />
<br />
* If you use an ARM64 distribution (most likely): <code>sudo ./qfirehose -f ./</code> or <code>sudo ./qfirehose_arm64 -f ./</code><br />
* If you use an ARMHF (32 bit) distribution: <code>sudo ./qfirehose_armhf -f ./</code><br />
<br />
It will reboot the modem after finished. After about 30 seconds, it will get back up and running. To check the firmware version after that, use an AT command <code>AT+QGMR</code> like at [[PinePhone#Firmware_update]].<br />
<br />
=== Bootloader unlocking ===<br />
<br />
{{warning|1= The following instructions are directed towards expert-level users and developers!}}<br />
<br />
The Modem has a locked bootloader. It won't allow to boot unsigned Kernel images, but will allow to flash them, making it easy to brick the modem. To fix this, you can flash an unlocked bootloader, which will then allow you to do as you please with the hardware.<br />
<br />
Unlocked bootloader:<br />
* Source code: https://github.com/Biktorgj/quectel_lk<br />
* Prebuilt binary releases: https://github.com/Biktorgj/quectel_lk/releases<br />
<br />
=== Custom Kernels and system images ===<br />
<br />
{{warning|1= The following instructions are directed towards expert-level users and developers!}}<br />
<br />
Custom kernel builds and system images can be created for the modem, though they require a couple of things to be correctly built and be bootable.<br />
<br />
* The source code release for the kernel provided by the manufacturer is incomplete and won't build<br />
* Common Android tools like mkbootimg and dtbtool won't build a bootable image, even if the kernel is correctly compiled and all the DTBs attached.<br />
* Further, there's no source for the OpenEmbedded parts, so building a new system image must be done from scratch, and retrieving the mandatory binary blobs to use the ADSP part of the modem.<br />
<br />
There's a '''work in progress''' SDK to allow creating custom kernels and system images, which can be downloaded from the following repository: https://github.com/Biktorgj/pinephone_modem_sdk<br />
<br />
See its readme for infomations and instructions. Once downloaded, you should run the <code>init.sh</code> script, which will create all the base directories and download all the different repositories required to build. After the initial setup is complete, run<code>make</code> without arguments to list the available options.<br />
<br />
=== Upgrade/switch firmware via fwupd ===<br />
<br />
https://fwupd.org/ is an open-source tool for managing the installation of firmware on Linux systems.<br />
<br />
fwupd >= 1.7.6 (with the ModemManager plugin) supports writing/upgrading the https://github.com/Biktorgj/pinephone_modem_sdk firmware on the Quectel EG25-G modem.<br />
<br />
https://wiki.postmarketos.org/wiki/Fwupd discusses how to use fwupd to do this.<br />
<br />
More context: <br />
* https://dylanvanassche.be/blog/2022/pinephone-modem-upgrade/<br />
* https://gitlab.com/postmarketOS/pmaports/-/merge_requests/2760<br />
* https://gitlab.com/linux-mobile/tracker/-/issues/11<br />
<br />
=== Modem management ===<br />
<br />
To allow PinePhones to receive calls while the PinePhone is suspended, the modem should be kept running. ModemManager and a eg25-specific manager must be used for the eg25-manager to work correctly.<br />
<br />
==== ModemManager ====<br />
<br />
[https://www.freedesktop.org/wiki/Software/ModemManager/ ModemManager] "is a DBus-activated daemon which controls mobile broadband (2G/3G/4G) devices and connections". Distributions should enable the <code>--test-quick-suspend-resume</code> flag, per https://gitlab.com/linux-mobile/tracker/-/issues/12.<br />
<br />
==== eg25-specific manager ====<br />
<br />
Some functionality is not built into ModemManager, and is instead managed via eg25-specific software. There are two variants of this, but only one should be used.<br />
<br />
* [https://gitlab.com/mobian1/devices/eg25-manager eg25-manager] <b>recommended</b>, used in most distributions.<br />
* [https://xnux.eu/devices/feature/modem-pp.html modem-power]<br />
<br />
==== Testing ====<br />
<br />
When a distribution makes a significant change to their modem management setup, they should consider testing the following:<br />
<br />
* Modem is recognized by ModemManager on boot.<br />
* Can make a call<br />
* Can receive a call<br />
* Can receive a call when asleep: <code>systemctl suspend</code><br />
<br />
[[Category:PinePhone]]</div>Tomhttps://wiki.pine64.org/index.php?title=PineModems&diff=12620PineModems2022-03-05T00:45:09Z<p>Tom: Add info about power management and testing</p>
<hr />
<div>== PINE64 position on alternative firmware ==<br />
<br />
PINE64 ships the PinePhone with a stock version of the Quectel EG25-G modem's firmware. Some administrative regions, in the EU and Asia in particular, require the entirety of the modem's firmware to be licensed. Therefore, the PinePhone cannot ship with an unlicensed firmware, and the PINE64 project cannot, officially encourage its userbase to use alternative modem firmware. <br />
<br />
== Quectel EG25-G Modem ==<br />
<br />
Quectel EG25-G is an LTE Cat 4 module optimized specially for M2M and IoT applications. It is used in the [[PinePhone]].<br />
<br />
* Specifications:<br>[[File:Quectel_EG25-G_LTE_Standard_Specification_V1.3.pdf]]<br />
* Hardware design:<br>[[File:Quectel_EG25-G_Hardware_Design_V1.4.pdf]]<br />
* AT Interface reference manual:<br />
** 1.3 for EC25:<br>[[File:Quectel_EC25&EC21_AT_Commands_Manual_V1.3.pdf]]<br />
** 2.0 for EC25 and EG25-G:<br>[[File:Quectel_EC2x&EG9x&EG2x-G&EM05_Series_AT_Commands_Manual_V2.0.pdf]]<br />
* AT Interface file operations:<br>[[File:Quectel_EC2xEG25-GEG9xEM05_FILE_AT_Commands_Manual_V1.0.pdf]]<br />
* GNSS Application note:<br>[[File:Quectel_EC2x&EG9x&EG2x-G&EM05_Series_GNSS_Application_Note_V1.3.pdf]]<br />
<br />
=== Specifications ===<br />
<br />
{| class="wikitable"<br />
| Processor Family || Qualcomm MDM9607<br />
|-<br />
| CPU || Qualcomm MDM9207<br />
|-<br />
| Cores || 1 ACPU Core, Qualcomm Hexagon DSP<br />
|-<br />
| Total RAM || 256Mb<br />
|-<br />
| Total flash space || 256Mb<br />
|-<br />
| Available RAM for the ACPU || 160Mb<br />
|}<br />
<br />
=== NAND Partition table layout ===<br />
<br />
{| class="wikitable"<br />
! Index<br />
! Name<br />
! Description<br />
|-<br />
| MTD0 || <code>SBL</code><br />
| Secondary Bootloader, called from the BootROM. Used to start the TrustZone kernel and the Application Bootloader (LK). Also used to enter Quectel's recovery mode<br />
|-<br />
| MTD1 || <code>mibib</code><br />
| NAND Partition table<br />
|-<br />
| MTD2 || <code>EFS2</code><br />
| IMEI and settings used by the ADSP are stored here<br />
|-<br />
| MTD3 || <code>sys_rev</code><br />
| Unexplored<br />
|-<br />
| MTD4 || <code>rawdata</code><br />
| This is where FOTA update data exists before being commited to system or recoveryfs partitions<br />
|-<br />
| MTD5 || <code>tz</code><br />
| TrustZone kernel<br />
|-<br />
| MTD6 || <code>rpm</code><br />
| Resource / Power Manager<br />
|-<br />
| MTD7 || <code>cust_info</code><br />
| Unexplored<br />
|-<br />
| MTD8 || <code>aboot</code><br />
| Application Bootloader. Uses [https://github.com/littlekernel/lk LK] (LittleKernel, LK embedded kernel) as the bootloader. By default it allows flashing unsigned images but won't allow booting them, soft-bricking the modem until you enter EDL mode<br />
|-<br />
| MTD9 || <code>boot</code><br />
| [https://www.openembedded.org/wiki/Main_Page OpenEmbedded] boot kernel + DTB<br />
|-<br />
| MTD10 || <code>recovery</code><br />
| Recovery kernel (used for FOTA updates)<br />
|-<br />
| MTD11 || <code>modem</code><br />
| ADSP firmware blobs<br />
|-<br />
| MTD12 || <code>misc</code><br />
| Some settings are stored here, along with commands that need to be picked by LK on next boot (to reboot to fastboot or recovery mode)<br />
|-<br />
| MTD13 || <code>recoveryfs</code><br />
| Recovery filesystem image (FOTA updates)<br />
|-<br />
| MTD14 || <code>usr_data</code><br />
| User data partition (<code>/data</code> when mounted by OpenEmbedded)<br />
|-<br />
| MTD15 || <code>sec</code><br />
| Used to blow fuses in the mdm9207 from images generated by Qualcomm Sectools<br />
|-<br />
| MTD16 || <code>system</code><br />
| Linux OpenEmbedded root image, formatted in UBIFS (Unsorted Block Image File System, [https://en.wikipedia.org/wiki/UBIFS Wikipedia])<br />
|}<br />
<br />
=== Firmware Recovery ===<br />
<br />
{{warning|1= The following instructions are directed towards expert-level users and developers!}}<br />
<br />
The System partition is mounted as read-only mode, but the data partition is writable. It might be possible, if there's an unexpected reset or power is lost while running, that the data partition gets corrupt and thus unable to boot.<br />
<br />
[[File:Pinephone-EG25-Recovery.jpg|thumb|right|PinePhone USB_BOOT test points]]<br />
<br />
The modem has 4 different boot modes:<br />
* Normal boot<br />
* Recovery mode (used by the modem usually to install a FOTA update)<br />
* Fastboot mode<br />
* Qualcomm EDL Mode<br />
<br />
If the modem is unable to boot, depending on the type of crash, it might:<br />
* not show anywhere (USB device missing)<br />
* or malfunction (no radio but USB working)<br />
* or enter EDL mode, if the entire flash is corrupt.<br />
<br />
'''Boot the device in EDL mode'''<br />
<br />
To check if the device is booted in EDL mode, run <code>lsusb</code> (a part of the <code>usbutils</code> package) in a terminal and inspect the output. You should see the following device listed:<br />
<br />
Bus 003 Device 003: ID 05c6:9008 Qualcomm, Inc. Gobi Wireless Modem (QDL mode)<br />
<br />
In any scenario, the modem can be triggered to enter EDL mode by shorting two test pins on the PinePhone motherboard.<br />
<br />
# Power off the phone<br />
# short the two test points<br />
# boot the phone while keeping the test points shorted until fully booted up, at least until you hear the camera clicking twice (which is normally when the modem is powered).<br />
<br />
'''Get the Firmware Recovery Package'''<br />
<br />
The Firmware Recovery Package is at: https://github.com/Biktorgj/quectel_eg25_recovery<br />
<br />
Either clone its repo with git, or download its archive & unzip it.<br />
<br />
As you should have no access to the Internet on PinePhone when its modem need a Recovery, you can fetch it on other devices and copy it to the Pinephone.<br />
<br />
'''Execute the Quectel QFirehose utility'''<br />
<br />
Once in EDL mode, open a terminal, navigate to the root directory of the recovery package, and run:<br />
<br />
* If you use an ARM64 distribution (most likely): <code>sudo ./qfirehose -f ./</code> or <code>sudo ./qfirehose_arm64 -f ./</code><br />
* If you use an ARMHF (32 bit) distribution: <code>sudo ./qfirehose_armhf -f ./</code><br />
<br />
It will reboot the modem after finished. After about 30 seconds, it will get back up and running. To check the firmware version after that, use an AT command <code>AT+QGMR</code> like at [[PinePhone#Firmware_update]].<br />
<br />
=== Bootloader unlocking ===<br />
<br />
{{warning|1= The following instructions are directed towards expert-level users and developers!}}<br />
<br />
The Modem has a locked bootloader. It won't allow to boot unsigned Kernel images, but will allow to flash them, making it easy to brick the modem. To fix this, you can flash an unlocked bootloader, which will then allow you to do as you please with the hardware.<br />
<br />
Unlocked bootloader:<br />
* Source code: https://github.com/Biktorgj/quectel_lk<br />
* Prebuilt binary releases: https://github.com/Biktorgj/quectel_lk/releases<br />
<br />
=== Custom Kernels and system images ===<br />
<br />
{{warning|1= The following instructions are directed towards expert-level users and developers!}}<br />
<br />
Custom kernel builds and system images can be created for the modem, though they require a couple of things to be correctly built and be bootable.<br />
<br />
* The source code release for the kernel provided by the manufacturer is incomplete and won't build<br />
* Common Android tools like mkbootimg and dtbtool won't build a bootable image, even if the kernel is correctly compiled and all the DTBs attached.<br />
* Further, there's no source for the OpenEmbedded parts, so building a new system image must be done from scratch, and retrieving the mandatory binary blobs to use the ADSP part of the modem.<br />
<br />
There's a '''work in progress''' SDK to allow creating custom kernels and system images, which can be downloaded from the following repository: https://github.com/Biktorgj/pinephone_modem_sdk<br />
<br />
See its readme for infomations and instructions. Once downloaded, you should run the <code>init.sh</code> script, which will create all the base directories and download all the different repositories required to build. After the initial setup is complete, run<code>make</code> without arguments to list the available options.<br />
<br />
=== Upgrade/switch firmware via fwupd ===<br />
<br />
https://fwupd.org/ is an open-source tool for managing the installation of firmware on Linux systems.<br />
<br />
fwupd >= 1.7.6 (with the ModemManager plugin) supports writing/upgrading the https://github.com/Biktorgj/pinephone_modem_sdk firmware on the Quectel EG25-G modem.<br />
<br />
https://wiki.postmarketos.org/wiki/Fwupd discusses how to use fwupd to do this.<br />
<br />
More context: <br />
* https://dylanvanassche.be/blog/2022/pinephone-modem-upgrade/<br />
* https://gitlab.com/postmarketOS/pmaports/-/merge_requests/2760<br />
* https://gitlab.com/linux-mobile/tracker/-/issues/11<br />
<br />
=== Modem management ===<br />
<br />
To allow PinePhones to receive calls while the PinePhone is suspended, the modem should be kept running.<br />
<br />
A <i>modem manager</i> controls this lifecycle. There are two known implementations:<br />
<br />
* [https://gitlab.com/mobian1/devices/eg25-manager eg25-manager] <b>recommended</b>, used in most distributions<br />
* [https://xnux.eu/devices/feature/modem-pp.html modem-power]<br />
<br />
==== Testing ====<br />
<br />
When a distribution makes a significant change to their modem management setup, they should consider testing the following:<br />
<br />
* Modem is recognized by ModemManager on boot.<br />
* Can make a call<br />
* Can receive a call<br />
* Can receive a call when asleep: <code>systemctl suspend</code><br />
<br />
[[Category:PinePhone]]</div>Tomhttps://wiki.pine64.org/index.php?title=PineModems&diff=12605PineModems2022-02-27T06:21:18Z<p>Tom: Mention fwupd support</p>
<hr />
<div>== PINE64 position on alternative firmware ==<br />
<br />
PINE64 ships the PinePhone with a stock version of the Quectel EG25-G modem's firmware. Some administrative regions, in the EU and Asia in particular, require the entirety of the modem's firmware to be licensed. Therefore, the PinePhone cannot ship with an unlicensed firmware, and the PINE64 project cannot, officially encourage its userbase to use alternative modem firmware. <br />
<br />
== Quectel EG25-G Modem ==<br />
<br />
Quectel EG25-G is an LTE Cat 4 module optimized specially for M2M and IoT applications. It is used in the [[PinePhone]].<br />
<br />
* Specifications:<br>[[File:Quectel_EG25-G_LTE_Standard_Specification_V1.3.pdf]]<br />
* Hardware design:<br>[[File:Quectel_EG25-G_Hardware_Design_V1.4.pdf]]<br />
* AT Interface reference manual:<br />
** 1.3 for EC25:<br>[[File:Quectel_EC25&EC21_AT_Commands_Manual_V1.3.pdf]]<br />
** 2.0 for EC25 and EG25-G:<br>[[File:Quectel_EC2x&EG9x&EG2x-G&EM05_Series_AT_Commands_Manual_V2.0.pdf]]<br />
* AT Interface file operations:<br>[[File:Quectel_EC2xEG25-GEG9xEM05_FILE_AT_Commands_Manual_V1.0.pdf]]<br />
* GNSS Application note:<br>[[File:Quectel_EC2x&EG9x&EG2x-G&EM05_Series_GNSS_Application_Note_V1.3.pdf]]<br />
<br />
=== Specifications ===<br />
<br />
{| class="wikitable"<br />
| Processor Family || Qualcomm MDM9607<br />
|-<br />
| CPU || Qualcomm MDM9207<br />
|-<br />
| Cores || 1 ACPU Core, Qualcomm Hexagon DSP<br />
|-<br />
| Total RAM || 256Mb<br />
|-<br />
| Total flash space || 256Mb<br />
|-<br />
| Available RAM for the ACPU || 160Mb<br />
|}<br />
<br />
=== NAND Partition table layout ===<br />
<br />
{| class="wikitable"<br />
! Index<br />
! Name<br />
! Description<br />
|-<br />
| MTD0 || <code>SBL</code><br />
| Secondary Bootloader, called from the BootROM. Used to start the TrustZone kernel and the Application Bootloader (LK). Also used to enter Quectel's recovery mode<br />
|-<br />
| MTD1 || <code>mibib</code><br />
| NAND Partition table<br />
|-<br />
| MTD2 || <code>EFS2</code><br />
| IMEI and settings used by the ADSP are stored here<br />
|-<br />
| MTD3 || <code>sys_rev</code><br />
| Unexplored<br />
|-<br />
| MTD4 || <code>rawdata</code><br />
| This is where FOTA update data exists before being commited to system or recoveryfs partitions<br />
|-<br />
| MTD5 || <code>tz</code><br />
| TrustZone kernel<br />
|-<br />
| MTD6 || <code>rpm</code><br />
| Resource / Power Manager<br />
|-<br />
| MTD7 || <code>cust_info</code><br />
| Unexplored<br />
|-<br />
| MTD8 || <code>aboot</code><br />
| Application Bootloader. Uses [https://github.com/littlekernel/lk LK] (LittleKernel, LK embedded kernel) as the bootloader. By default it allows flashing unsigned images but won't allow booting them, soft-bricking the modem until you enter EDL mode<br />
|-<br />
| MTD9 || <code>boot</code><br />
| [https://www.openembedded.org/wiki/Main_Page OpenEmbedded] boot kernel + DTB<br />
|-<br />
| MTD10 || <code>recovery</code><br />
| Recovery kernel (used for FOTA updates)<br />
|-<br />
| MTD11 || <code>modem</code><br />
| ADSP firmware blobs<br />
|-<br />
| MTD12 || <code>misc</code><br />
| Some settings are stored here, along with commands that need to be picked by LK on next boot (to reboot to fastboot or recovery mode)<br />
|-<br />
| MTD13 || <code>recoveryfs</code><br />
| Recovery filesystem image (FOTA updates)<br />
|-<br />
| MTD14 || <code>usr_data</code><br />
| User data partition (<code>/data</code> when mounted by OpenEmbedded)<br />
|-<br />
| MTD15 || <code>sec</code><br />
| Used to blow fuses in the mdm9207 from images generated by Qualcomm Sectools<br />
|-<br />
| MTD16 || <code>system</code><br />
| Linux OpenEmbedded root image, formatted in UBIFS (Unsorted Block Image File System, [https://en.wikipedia.org/wiki/UBIFS Wikipedia])<br />
|}<br />
<br />
=== Firmware Recovery ===<br />
<br />
{{warning|1= The following instructions are directed towards expert-level users and developers!}}<br />
<br />
The System partition is mounted as read-only mode, but the data partition is writable. It might be possible, if there's an unexpected reset or power is lost while running, that the data partition gets corrupt and thus unable to boot.<br />
<br />
[[File:Pinephone-EG25-Recovery.jpg|thumb|right|PinePhone USB_BOOT test points]]<br />
<br />
The modem has 4 different boot modes:<br />
* Normal boot<br />
* Recovery mode (used by the modem usually to install a FOTA update)<br />
* Fastboot mode<br />
* Qualcomm EDL Mode<br />
<br />
If the modem is unable to boot, depending on the type of crash, it might:<br />
* not show anywhere (USB device missing)<br />
* or malfunction (no radio but USB working)<br />
* or enter EDL mode, if the entire flash is corrupt.<br />
<br />
'''Boot the device in EDL mode'''<br />
<br />
To check if the device is booted in EDL mode, run <code>lsusb</code> (a part of the <code>usbutils</code> package) in a terminal and inspect the output. You should see the following device listed:<br />
<br />
Bus 003 Device 003: ID 05c6:9008 Qualcomm, Inc. Gobi Wireless Modem (QDL mode)<br />
<br />
In any scenario, the modem can be triggered to enter EDL mode by shorting two test pins on the PinePhone motherboard.<br />
<br />
# Power off the phone<br />
# short the two test points<br />
# boot the phone while keeping the test points shorted until fully booted up, at least until you hear the camera clicking twice (which is normally when the modem is powered).<br />
<br />
'''Get the Firmware Recovery Package'''<br />
<br />
The Firmware Recovery Package is at: https://github.com/Biktorgj/quectel_eg25_recovery<br />
<br />
Either clone its repo with git, or download its archive & unzip it.<br />
<br />
As you should have no access to the Internet on PinePhone when its modem need a Recovery, you can fetch it on other devices and copy it to the Pinephone.<br />
<br />
'''Execute the Quectel QFirehose utility'''<br />
<br />
Once in EDL mode, open a terminal, navigate to the root directory of the recovery package, and run:<br />
<br />
* If you use an ARM64 distribution (most likely): <code>sudo ./qfirehose -f ./</code> or <code>sudo ./qfirehose_arm64 -f ./</code><br />
* If you use an ARMHF (32 bit) distribution: <code>sudo ./qfirehose_armhf -f ./</code><br />
<br />
It will reboot the modem after finished. After about 30 seconds, it will get back up and running. To check the firmware version after that, use an AT command <code>AT+QGMR</code> like at [[PinePhone#Firmware_update]].<br />
<br />
=== Bootloader unlocking ===<br />
<br />
{{warning|1= The following instructions are directed towards expert-level users and developers!}}<br />
<br />
The Modem has a locked bootloader. It won't allow to boot unsigned Kernel images, but will allow to flash them, making it easy to brick the modem. To fix this, you can flash an unlocked bootloader, which will then allow you to do as you please with the hardware.<br />
<br />
Unlocked bootloader:<br />
* Source code: https://github.com/Biktorgj/quectel_lk<br />
* Prebuilt binary releases: https://github.com/Biktorgj/quectel_lk/releases<br />
<br />
=== Custom Kernels and system images ===<br />
<br />
{{warning|1= The following instructions are directed towards expert-level users and developers!}}<br />
<br />
Custom kernel builds and system images can be created for the modem, though they require a couple of things to be correctly built and be bootable.<br />
<br />
* The source code release for the kernel provided by the manufacturer is incomplete and won't build<br />
* Common Android tools like mkbootimg and dtbtool won't build a bootable image, even if the kernel is correctly compiled and all the DTBs attached.<br />
* Further, there's no source for the OpenEmbedded parts, so building a new system image must be done from scratch, and retrieving the mandatory binary blobs to use the ADSP part of the modem.<br />
<br />
There's a '''work in progress''' SDK to allow creating custom kernels and system images, which can be downloaded from the following repository: https://github.com/Biktorgj/pinephone_modem_sdk<br />
<br />
See its readme for infomations and instructions. Once downloaded, you should run the <code>init.sh</code> script, which will create all the base directories and download all the different repositories required to build. After the initial setup is complete, run<code>make</code> without arguments to list the available options.<br />
<br />
=== Upgrade/switch firmware via fwupd ===<br />
<br />
https://fwupd.org/ is an open-source tool for managing the installation of firmware on Linux systems.<br />
<br />
fwupd >= 1.7.6 (with the ModemManager plugin) supports writing/upgrading the https://github.com/Biktorgj/pinephone_modem_sdk firmware on the Quectel EG25-G modem.<br />
<br />
https://wiki.postmarketos.org/wiki/Fwupd discusses how to use fwupd to do this.<br />
<br />
More context: <br />
* https://dylanvanassche.be/blog/2022/pinephone-modem-upgrade/<br />
* https://gitlab.com/postmarketOS/pmaports/-/merge_requests/2760<br />
* https://gitlab.com/linux-mobile/tracker/-/issues/11<br />
<br />
<br />
[[Category:PinePhone]]</div>Tomhttps://wiki.pine64.org/index.php?title=PinePhone_Pro_Development&diff=11988PinePhone Pro Development2021-12-10T06:16:10Z<p>Tom: /* Current Status */ Merge Linux kernel section into "working"</p>
<hr />
<div>This page documents the current status of software support for the [[PinePhone Pro]], and provides links to resources to help prospective contributors get started.<br />
<br />
== Overview ==<br />
<br />
=== Upstreaming Status ===<br />
<br />
{| class="wikitable plainrowheaders" border="1"<br />
! scope="col" | Function<br />
! scope="col" colspan="2" | Status<br />
! scope="col" | Component<br />
! scope="col" | Notes<br />
|-<br />
! scope="row" | Bootloader (u-boot)<br />
| colspan="2" style="background:#FF0; text-align:center;"| Working. Not upstreamed.<br />
|<br />
| https://github.com/dreemurrs-embedded/Pine64-Arch/tree/master/PKGBUILDS/pine64/uboot-pinephonepro uses https://git.sr.ht/~martijnbraam/u-boot.<br />
|-<br />
! scope="row" | Modem<br />
| colspan="2" style="background:#FF0; text-align:center;"|Working. Not upstreamed.<br />
| <br />
| Support in https://gitlab.com/mobian1/devices/eg25-manager and Megi's kernel.<br />
|-<br />
! scope="row" | Sound<br />
| colspan="2" style="background:#F99; text-align:center;"|Unimplemented.<br />
|<br />
| See https://github.com/alsa-project/alsa-ucm-conf/issues/125.<br />
|}<br />
<br />
== Current Status ==<br />
<br />
The following sections give an overview over the current status of different parts of the phone. Some parts are waiting on a driver to be written or ported, others only need various adjustments.<br />
<br />
=== Working ===<br />
<br />
==== Kernel ====<br />
<br />
There's no canonical location for Pinephone Pro Linux kernel development, because Pinephone Pro DT is not mainline, yet. [https://xff.cz/git/linux/log/?h=orange-pi-5.16 megi's kernel tree] is the most complete one, as of November 2021.<br />
<br />
https://mainline.space/ tracks mainlining kernels for various phones.<br />
<br />
==== Firmware ====<br />
<br />
ATF? Likely working due to reuse of Pinebook Pro SoC?<br />
<br />
==== Display ====<br />
<br />
Working.<br />
<br />
==== Modem ====<br />
<br />
Working. Supported in:<br />
* Megi's orange-pi branches: https://megous.com/git/linux.<br />
* https://gitlab.com/mobian1/devices/eg25-manager<br />
<br />
=== Not working ===<br />
<br />
==== Sound ====<br />
<br />
See https://gitlab.com/pine64-org/pine64-alsa-ucm/-/issues/4.<br />
<br />
=== Unknown ===<br />
<br />
==== Front camera ====<br />
<br />
OV8858 camera. Unknown.<br />
<br />
Datasheet: http://www.ahdsensor.com/uploadfile/202008/55322e75316871.pdf<br />
<br />
==== Back camera ====<br />
<br />
Sony IMX258. Support unknown.<br />
<br />
==== Sensors ====<br />
<br />
?<br />
<br />
==== Bluetooth ====<br />
<br />
?<br />
<br />
== Levinboot Based Kernel Development Image ==<br />
<br />
This guide will help you get a comfortable environment for testing your kernel builds on Pinephone Pro. It assumes you either already know how to build or cross-build a Linux kernel for arm64, or if you have a way to get a pre-built kernel from somewhere. For a quick test that your setup works, you can use [https://xff.cz/kernels/ megi's pre-built kernels].<br />
<br />
Quick and easy way to get started with kernel development and testing is to use CrystalGamma's Levinboot patched with support for Pinephone Pro and 3-option boot selection using volume keys. [https://xnux.eu/log/#049 You will be able to switch between kernels quickly without swapping uSD cards, which is necessary for painless kernel development experience.]<br />
<br />
1) Create a following partitioning scheme on a uSD card using <code>sfdisk</code>:<br />
<br />
<pre><br />
label: gpt<br />
first-lba: 64<br />
table-length: 8<br />
<br />
start=64, size=8128, type=D7B1F817-AA75-2F4F-830D-84818A145370, name="sd-lboot"<br />
size=60M, type=E5AB07A0-8E5E-46F6-9CE8-41A518929B7C, name="sd-lpayload1"<br />
size=60M, type=5f04b556-c920-4b6d-bd77-804efe6fae01, name="sd-lpayload2"<br />
size=60M, type=c195cc59-d766-4b78-813f-a0e1519099d8, name="sd-lpayload3"<br />
size=14G name="sd-rootfs1"<br />
name="sd-rootfs2"<br />
</pre><br />
<br />
2) Write Levinboot to <code>sd-lboot</code> partition using <code>dd</code>. You can get a pre-built and tested version [https://xff.cz/kernels/pinephone-pro/ here] There are two options <code>levinboot-sd.img</code> and <code>levinboot-emmc.img</code> you can use either one of them for your <code>sd-lboot</code> partition. They differ in where they load the payloads from (either from SD or eMMC) and not in where they can be flashed to. For uSD card only workflow, you'll want <code>levinboot-sd.img</code>.<br />
<br />
3) Prepare payloads for Levinboot and copy them to appropriate partitions. Partition <code>sd-lpayload1</code> is used by default, <code>sd-lpayload2</code> when you hold a volume down key during powerup, and <code>sd-lpayload3</code> when you hold the volume up key.<br />
<br />
Preparing a payload involves getting a TF-A <code>bl31.elf</code> build, kernel <code>Image</code> build, <code>DTB</code> file for Pinephone Pro, and optionally an initramfs archive, modifying DTB to include kernel boot arguments, and compressing these using <code>lz4</code> in specific order, as shown below.<br />
<br />
<pre><br />
BOOTOPTS=(<br />
console=tty1<br />
<br />
earlycon=uart8250,mmio32,0xff1a0000<br />
console=ttyS2,1500000n8<br />
<br />
root=PARTLABEL=emmc-rootfs1<br />
rootfstype=f2fs<br />
rootflags=fastboot<br />
rootwait<br />
rw<br />
<br />
loglevel=7<br />
)<br />
<br />
BOOTOPTS="${BOOTOPTS[@]}"<br />
ALGO="lz4 -zc"<br />
<br />
cp -f rk3399-pinephone-pro.dtb board-cfg.dtb<br />
fdtput -pt s board-cfg.dtb /chosen bootargs "$BOOTOPTS"<br />
<br />
(<br />
$ALGO bl31.elf<br />
$ALGO board-cfg.dtb<br />
$ALGO Image<br />
# $ALGO initramfs.img<br />
) > payload.img<br />
<br />
dd if=payload.img of=/dev/disk/by-partlabel/sd-payload1 bs=4M oflag=direct<br />
</pre><br />
<br />
4) Prepare root filesystem. You can use any Linux distribution for aarch64 for development. For example if you want to use Arch Linux ARM, you would need to format the <code>sd-rootfs1</code> partition with <code>f2fs</code> filesystem and extract the Arch Linux ARM rootfs tarball there. That will give you a bootable SD card image for Pinephone Pro.<br />
<br />
5) Repeat steps 3 and 4 if you want either more kernel payloads, or more Linux distributions on the same uSD card. I recommend having at least some module-less working kernel in <code>sd-payload3</code> and perhaps a small userspace in <code>sd-rootfs1</code> with a pre-configured WiFi connection, that will allow you to always quickly recover if your development kernel fails to boot, just by pressing volume up key during boot and updating the the kernel in one of the primary payload partitions over WiFi.<br />
<br />
== Development discussion ==<br />
<br />
Most of the discussion happens in #pinedev channel on [https://www.pine64.org/web-irc/ Pine64 IRC server].<br />
<br />
See https://xnux.eu/log/ too.<br />
<br />
[[Category:Pinephone Pro]][[Category:Rockchip RK3399]]</div>Tomhttps://wiki.pine64.org/index.php?title=PinePhone_Pro_Development&diff=11987PinePhone Pro Development2021-12-10T06:14:55Z<p>Tom: /* Current Status */ Split out components by {working,not working,unknown}</p>
<hr />
<div>This page documents the current status of software support for the [[PinePhone Pro]], and provides links to resources to help prospective contributors get started.<br />
<br />
== Overview ==<br />
<br />
=== Upstreaming Status ===<br />
<br />
{| class="wikitable plainrowheaders" border="1"<br />
! scope="col" | Function<br />
! scope="col" colspan="2" | Status<br />
! scope="col" | Component<br />
! scope="col" | Notes<br />
|-<br />
! scope="row" | Bootloader (u-boot)<br />
| colspan="2" style="background:#FF0; text-align:center;"| Working. Not upstreamed.<br />
|<br />
| https://github.com/dreemurrs-embedded/Pine64-Arch/tree/master/PKGBUILDS/pine64/uboot-pinephonepro uses https://git.sr.ht/~martijnbraam/u-boot.<br />
|-<br />
! scope="row" | Modem<br />
| colspan="2" style="background:#FF0; text-align:center;"|Working. Not upstreamed.<br />
| <br />
| Support in https://gitlab.com/mobian1/devices/eg25-manager and Megi's kernel.<br />
|-<br />
! scope="row" | Sound<br />
| colspan="2" style="background:#F99; text-align:center;"|Unimplemented.<br />
|<br />
| See https://github.com/alsa-project/alsa-ucm-conf/issues/125.<br />
|}<br />
<br />
== Current Status ==<br />
<br />
The following sections give an overview over the current status of different parts of the phone. Some parts are waiting on a driver to be written or ported, others only need various adjustments.<br />
<br />
=== Working ===<br />
<br />
==== System on Chip ====<br />
<br />
Supported in Megi's orange-pi branches: https://megous.com/git/linux.<br />
<br />
ATF? Likely working due to reuse of Pinebook Pro SoC?<br />
<br />
==== Display ====<br />
<br />
Working.<br />
<br />
==== Modem ====<br />
<br />
Working. Supported in:<br />
* Megi's orange-pi branches: https://megous.com/git/linux.<br />
* https://gitlab.com/mobian1/devices/eg25-manager<br />
<br />
=== Not working ===<br />
<br />
==== Sound ====<br />
<br />
See https://gitlab.com/pine64-org/pine64-alsa-ucm/-/issues/4.<br />
<br />
=== Unknown ===<br />
<br />
==== Front camera ====<br />
<br />
OV8858 camera. Unknown.<br />
<br />
Datasheet: http://www.ahdsensor.com/uploadfile/202008/55322e75316871.pdf<br />
<br />
==== Back camera ====<br />
<br />
Sony IMX258. Support unknown.<br />
<br />
==== Sensors ====<br />
<br />
?<br />
<br />
==== Bluetooth ====<br />
<br />
?<br />
<br />
=== Linux kernel ===<br />
<br />
There's no canonical location for Pinephone Pro Linux kernel development, because Pinephone Pro DT is not mainline, yet. [https://xff.cz/git/linux/log/?h=orange-pi-5.16 megi's kernel tree] is the most complete one, as of November 2021.<br />
<br />
https://mainline.space/ tracks mainlining kernels for various phones.<br />
<br />
== Levinboot Based Kernel Development Image ==<br />
<br />
This guide will help you get a comfortable environment for testing your kernel builds on Pinephone Pro. It assumes you either already know how to build or cross-build a Linux kernel for arm64, or if you have a way to get a pre-built kernel from somewhere. For a quick test that your setup works, you can use [https://xff.cz/kernels/ megi's pre-built kernels].<br />
<br />
Quick and easy way to get started with kernel development and testing is to use CrystalGamma's Levinboot patched with support for Pinephone Pro and 3-option boot selection using volume keys. [https://xnux.eu/log/#049 You will be able to switch between kernels quickly without swapping uSD cards, which is necessary for painless kernel development experience.]<br />
<br />
1) Create a following partitioning scheme on a uSD card using <code>sfdisk</code>:<br />
<br />
<pre><br />
label: gpt<br />
first-lba: 64<br />
table-length: 8<br />
<br />
start=64, size=8128, type=D7B1F817-AA75-2F4F-830D-84818A145370, name="sd-lboot"<br />
size=60M, type=E5AB07A0-8E5E-46F6-9CE8-41A518929B7C, name="sd-lpayload1"<br />
size=60M, type=5f04b556-c920-4b6d-bd77-804efe6fae01, name="sd-lpayload2"<br />
size=60M, type=c195cc59-d766-4b78-813f-a0e1519099d8, name="sd-lpayload3"<br />
size=14G name="sd-rootfs1"<br />
name="sd-rootfs2"<br />
</pre><br />
<br />
2) Write Levinboot to <code>sd-lboot</code> partition using <code>dd</code>. You can get a pre-built and tested version [https://xff.cz/kernels/pinephone-pro/ here] There are two options <code>levinboot-sd.img</code> and <code>levinboot-emmc.img</code> you can use either one of them for your <code>sd-lboot</code> partition. They differ in where they load the payloads from (either from SD or eMMC) and not in where they can be flashed to. For uSD card only workflow, you'll want <code>levinboot-sd.img</code>.<br />
<br />
3) Prepare payloads for Levinboot and copy them to appropriate partitions. Partition <code>sd-lpayload1</code> is used by default, <code>sd-lpayload2</code> when you hold a volume down key during powerup, and <code>sd-lpayload3</code> when you hold the volume up key.<br />
<br />
Preparing a payload involves getting a TF-A <code>bl31.elf</code> build, kernel <code>Image</code> build, <code>DTB</code> file for Pinephone Pro, and optionally an initramfs archive, modifying DTB to include kernel boot arguments, and compressing these using <code>lz4</code> in specific order, as shown below.<br />
<br />
<pre><br />
BOOTOPTS=(<br />
console=tty1<br />
<br />
earlycon=uart8250,mmio32,0xff1a0000<br />
console=ttyS2,1500000n8<br />
<br />
root=PARTLABEL=emmc-rootfs1<br />
rootfstype=f2fs<br />
rootflags=fastboot<br />
rootwait<br />
rw<br />
<br />
loglevel=7<br />
)<br />
<br />
BOOTOPTS="${BOOTOPTS[@]}"<br />
ALGO="lz4 -zc"<br />
<br />
cp -f rk3399-pinephone-pro.dtb board-cfg.dtb<br />
fdtput -pt s board-cfg.dtb /chosen bootargs "$BOOTOPTS"<br />
<br />
(<br />
$ALGO bl31.elf<br />
$ALGO board-cfg.dtb<br />
$ALGO Image<br />
# $ALGO initramfs.img<br />
) > payload.img<br />
<br />
dd if=payload.img of=/dev/disk/by-partlabel/sd-payload1 bs=4M oflag=direct<br />
</pre><br />
<br />
4) Prepare root filesystem. You can use any Linux distribution for aarch64 for development. For example if you want to use Arch Linux ARM, you would need to format the <code>sd-rootfs1</code> partition with <code>f2fs</code> filesystem and extract the Arch Linux ARM rootfs tarball there. That will give you a bootable SD card image for Pinephone Pro.<br />
<br />
5) Repeat steps 3 and 4 if you want either more kernel payloads, or more Linux distributions on the same uSD card. I recommend having at least some module-less working kernel in <code>sd-payload3</code> and perhaps a small userspace in <code>sd-rootfs1</code> with a pre-configured WiFi connection, that will allow you to always quickly recover if your development kernel fails to boot, just by pressing volume up key during boot and updating the the kernel in one of the primary payload partitions over WiFi.<br />
<br />
== Development discussion ==<br />
<br />
Most of the discussion happens in #pinedev channel on [https://www.pine64.org/web-irc/ Pine64 IRC server].<br />
<br />
See https://xnux.eu/log/ too.<br />
<br />
[[Category:Pinephone Pro]][[Category:Rockchip RK3399]]</div>Tomhttps://wiki.pine64.org/index.php?title=PinePhone_Pro_Development&diff=11986PinePhone Pro Development2021-12-10T06:13:26Z<p>Tom: /* Current Status */ Remove mention of Crust: not needed for Rockchip</p>
<hr />
<div>This page documents the current status of software support for the [[PinePhone Pro]], and provides links to resources to help prospective contributors get started.<br />
<br />
== Overview ==<br />
<br />
=== Upstreaming Status ===<br />
<br />
{| class="wikitable plainrowheaders" border="1"<br />
! scope="col" | Function<br />
! scope="col" colspan="2" | Status<br />
! scope="col" | Component<br />
! scope="col" | Notes<br />
|-<br />
! scope="row" | Bootloader (u-boot)<br />
| colspan="2" style="background:#FF0; text-align:center;"| Working. Not upstreamed.<br />
|<br />
| https://github.com/dreemurrs-embedded/Pine64-Arch/tree/master/PKGBUILDS/pine64/uboot-pinephonepro uses https://git.sr.ht/~martijnbraam/u-boot.<br />
|-<br />
! scope="row" | Modem<br />
| colspan="2" style="background:#FF0; text-align:center;"|Working. Not upstreamed.<br />
| <br />
| Support in https://gitlab.com/mobian1/devices/eg25-manager and Megi's kernel.<br />
|-<br />
! scope="row" | Sound<br />
| colspan="2" style="background:#F99; text-align:center;"|Unimplemented.<br />
|<br />
| See https://github.com/alsa-project/alsa-ucm-conf/issues/125.<br />
|}<br />
<br />
== Current Status ==<br />
<br />
The following sections give an overview over the current status of different parts of the phone. Some parts are waiting on a driver to be written or ported, others only need various adjustments.<br />
<br />
=== Working ===<br />
<br />
==== System on Chip ====<br />
<br />
Supported in Megi's orange-pi branches: https://megous.com/git/linux.<br />
<br />
ATF? Likely working due to reuse of Pinebook Pro SoC?<br />
<br />
==== Display ====<br />
<br />
Working.<br />
<br />
==== Front camera ====<br />
<br />
OV8858 camera. Unknown.<br />
<br />
Datasheet: http://www.ahdsensor.com/uploadfile/202008/55322e75316871.pdf<br />
<br />
==== Back camera ====<br />
<br />
Sony IMX258. Support unknown.<br />
<br />
==== Sound ====<br />
<br />
Not working. See https://gitlab.com/pine64-org/pine64-alsa-ucm/-/issues/4<br />
<br />
==== Modem ====<br />
<br />
Working. Supported in:<br />
* Megi's orange-pi branches: https://megous.com/git/linux.<br />
* https://gitlab.com/mobian1/devices/eg25-manager<br />
<br />
==== Sensors ====<br />
<br />
?<br />
<br />
==== Bluetooth ====<br />
<br />
?<br />
<br />
=== Linux kernel ===<br />
<br />
There's no canonical location for Pinephone Pro Linux kernel development, because Pinephone Pro DT is not mainline, yet. [https://xff.cz/git/linux/log/?h=orange-pi-5.16 megi's kernel tree] is the most complete one, as of November 2021.<br />
<br />
https://mainline.space/ tracks mainlining kernels for various phones.<br />
<br />
== Levinboot Based Kernel Development Image ==<br />
<br />
This guide will help you get a comfortable environment for testing your kernel builds on Pinephone Pro. It assumes you either already know how to build or cross-build a Linux kernel for arm64, or if you have a way to get a pre-built kernel from somewhere. For a quick test that your setup works, you can use [https://xff.cz/kernels/ megi's pre-built kernels].<br />
<br />
Quick and easy way to get started with kernel development and testing is to use CrystalGamma's Levinboot patched with support for Pinephone Pro and 3-option boot selection using volume keys. [https://xnux.eu/log/#049 You will be able to switch between kernels quickly without swapping uSD cards, which is necessary for painless kernel development experience.]<br />
<br />
1) Create a following partitioning scheme on a uSD card using <code>sfdisk</code>:<br />
<br />
<pre><br />
label: gpt<br />
first-lba: 64<br />
table-length: 8<br />
<br />
start=64, size=8128, type=D7B1F817-AA75-2F4F-830D-84818A145370, name="sd-lboot"<br />
size=60M, type=E5AB07A0-8E5E-46F6-9CE8-41A518929B7C, name="sd-lpayload1"<br />
size=60M, type=5f04b556-c920-4b6d-bd77-804efe6fae01, name="sd-lpayload2"<br />
size=60M, type=c195cc59-d766-4b78-813f-a0e1519099d8, name="sd-lpayload3"<br />
size=14G name="sd-rootfs1"<br />
name="sd-rootfs2"<br />
</pre><br />
<br />
2) Write Levinboot to <code>sd-lboot</code> partition using <code>dd</code>. You can get a pre-built and tested version [https://xff.cz/kernels/pinephone-pro/ here] There are two options <code>levinboot-sd.img</code> and <code>levinboot-emmc.img</code> you can use either one of them for your <code>sd-lboot</code> partition. They differ in where they load the payloads from (either from SD or eMMC) and not in where they can be flashed to. For uSD card only workflow, you'll want <code>levinboot-sd.img</code>.<br />
<br />
3) Prepare payloads for Levinboot and copy them to appropriate partitions. Partition <code>sd-lpayload1</code> is used by default, <code>sd-lpayload2</code> when you hold a volume down key during powerup, and <code>sd-lpayload3</code> when you hold the volume up key.<br />
<br />
Preparing a payload involves getting a TF-A <code>bl31.elf</code> build, kernel <code>Image</code> build, <code>DTB</code> file for Pinephone Pro, and optionally an initramfs archive, modifying DTB to include kernel boot arguments, and compressing these using <code>lz4</code> in specific order, as shown below.<br />
<br />
<pre><br />
BOOTOPTS=(<br />
console=tty1<br />
<br />
earlycon=uart8250,mmio32,0xff1a0000<br />
console=ttyS2,1500000n8<br />
<br />
root=PARTLABEL=emmc-rootfs1<br />
rootfstype=f2fs<br />
rootflags=fastboot<br />
rootwait<br />
rw<br />
<br />
loglevel=7<br />
)<br />
<br />
BOOTOPTS="${BOOTOPTS[@]}"<br />
ALGO="lz4 -zc"<br />
<br />
cp -f rk3399-pinephone-pro.dtb board-cfg.dtb<br />
fdtput -pt s board-cfg.dtb /chosen bootargs "$BOOTOPTS"<br />
<br />
(<br />
$ALGO bl31.elf<br />
$ALGO board-cfg.dtb<br />
$ALGO Image<br />
# $ALGO initramfs.img<br />
) > payload.img<br />
<br />
dd if=payload.img of=/dev/disk/by-partlabel/sd-payload1 bs=4M oflag=direct<br />
</pre><br />
<br />
4) Prepare root filesystem. You can use any Linux distribution for aarch64 for development. For example if you want to use Arch Linux ARM, you would need to format the <code>sd-rootfs1</code> partition with <code>f2fs</code> filesystem and extract the Arch Linux ARM rootfs tarball there. That will give you a bootable SD card image for Pinephone Pro.<br />
<br />
5) Repeat steps 3 and 4 if you want either more kernel payloads, or more Linux distributions on the same uSD card. I recommend having at least some module-less working kernel in <code>sd-payload3</code> and perhaps a small userspace in <code>sd-rootfs1</code> with a pre-configured WiFi connection, that will allow you to always quickly recover if your development kernel fails to boot, just by pressing volume up key during boot and updating the the kernel in one of the primary payload partitions over WiFi.<br />
<br />
== Development discussion ==<br />
<br />
Most of the discussion happens in #pinedev channel on [https://www.pine64.org/web-irc/ Pine64 IRC server].<br />
<br />
See https://xnux.eu/log/ too.<br />
<br />
[[Category:Pinephone Pro]][[Category:Rockchip RK3399]]</div>Tomhttps://wiki.pine64.org/index.php?title=PinePhone_Pro_Development&diff=11985PinePhone Pro Development2021-12-10T06:12:58Z<p>Tom: /* Linux kernel */ Link to https://mainline.space/</p>
<hr />
<div>This page documents the current status of software support for the [[PinePhone Pro]], and provides links to resources to help prospective contributors get started.<br />
<br />
== Overview ==<br />
<br />
=== Upstreaming Status ===<br />
<br />
{| class="wikitable plainrowheaders" border="1"<br />
! scope="col" | Function<br />
! scope="col" colspan="2" | Status<br />
! scope="col" | Component<br />
! scope="col" | Notes<br />
|-<br />
! scope="row" | Bootloader (u-boot)<br />
| colspan="2" style="background:#FF0; text-align:center;"| Working. Not upstreamed.<br />
|<br />
| https://github.com/dreemurrs-embedded/Pine64-Arch/tree/master/PKGBUILDS/pine64/uboot-pinephonepro uses https://git.sr.ht/~martijnbraam/u-boot.<br />
|-<br />
! scope="row" | Modem<br />
| colspan="2" style="background:#FF0; text-align:center;"|Working. Not upstreamed.<br />
| <br />
| Support in https://gitlab.com/mobian1/devices/eg25-manager and Megi's kernel.<br />
|-<br />
! scope="row" | Sound<br />
| colspan="2" style="background:#F99; text-align:center;"|Unimplemented.<br />
|<br />
| See https://github.com/alsa-project/alsa-ucm-conf/issues/125.<br />
|}<br />
<br />
== Current Status ==<br />
<br />
The following sections give an overview over the current status of different parts of the phone. Some parts are waiting on a driver to be written or ported, others only need various adjustments.<br />
<br />
=== Working ===<br />
<br />
==== System on Chip ====<br />
<br />
Supported in Megi's orange-pi branches: https://megous.com/git/linux.<br />
<br />
ATF? Crust? Likely working due to reuse of Pinebook Pro SoC?<br />
<br />
==== Display ====<br />
<br />
Working.<br />
<br />
==== Front camera ====<br />
<br />
OV8858 camera. Unknown.<br />
<br />
Datasheet: http://www.ahdsensor.com/uploadfile/202008/55322e75316871.pdf<br />
<br />
==== Back camera ====<br />
<br />
Sony IMX258. Support unknown.<br />
<br />
==== Sound ====<br />
<br />
Not working. See https://gitlab.com/pine64-org/pine64-alsa-ucm/-/issues/4<br />
<br />
==== Modem ====<br />
<br />
Working. Supported in:<br />
* Megi's orange-pi branches: https://megous.com/git/linux.<br />
* https://gitlab.com/mobian1/devices/eg25-manager<br />
<br />
==== Sensors ====<br />
<br />
?<br />
<br />
==== Bluetooth ====<br />
<br />
?<br />
<br />
=== Linux kernel ===<br />
<br />
There's no canonical location for Pinephone Pro Linux kernel development, because Pinephone Pro DT is not mainline, yet. [https://xff.cz/git/linux/log/?h=orange-pi-5.16 megi's kernel tree] is the most complete one, as of November 2021.<br />
<br />
https://mainline.space/ tracks mainlining kernels for various phones.<br />
<br />
== Levinboot Based Kernel Development Image ==<br />
<br />
This guide will help you get a comfortable environment for testing your kernel builds on Pinephone Pro. It assumes you either already know how to build or cross-build a Linux kernel for arm64, or if you have a way to get a pre-built kernel from somewhere. For a quick test that your setup works, you can use [https://xff.cz/kernels/ megi's pre-built kernels].<br />
<br />
Quick and easy way to get started with kernel development and testing is to use CrystalGamma's Levinboot patched with support for Pinephone Pro and 3-option boot selection using volume keys. [https://xnux.eu/log/#049 You will be able to switch between kernels quickly without swapping uSD cards, which is necessary for painless kernel development experience.]<br />
<br />
1) Create a following partitioning scheme on a uSD card using <code>sfdisk</code>:<br />
<br />
<pre><br />
label: gpt<br />
first-lba: 64<br />
table-length: 8<br />
<br />
start=64, size=8128, type=D7B1F817-AA75-2F4F-830D-84818A145370, name="sd-lboot"<br />
size=60M, type=E5AB07A0-8E5E-46F6-9CE8-41A518929B7C, name="sd-lpayload1"<br />
size=60M, type=5f04b556-c920-4b6d-bd77-804efe6fae01, name="sd-lpayload2"<br />
size=60M, type=c195cc59-d766-4b78-813f-a0e1519099d8, name="sd-lpayload3"<br />
size=14G name="sd-rootfs1"<br />
name="sd-rootfs2"<br />
</pre><br />
<br />
2) Write Levinboot to <code>sd-lboot</code> partition using <code>dd</code>. You can get a pre-built and tested version [https://xff.cz/kernels/pinephone-pro/ here] There are two options <code>levinboot-sd.img</code> and <code>levinboot-emmc.img</code> you can use either one of them for your <code>sd-lboot</code> partition. They differ in where they load the payloads from (either from SD or eMMC) and not in where they can be flashed to. For uSD card only workflow, you'll want <code>levinboot-sd.img</code>.<br />
<br />
3) Prepare payloads for Levinboot and copy them to appropriate partitions. Partition <code>sd-lpayload1</code> is used by default, <code>sd-lpayload2</code> when you hold a volume down key during powerup, and <code>sd-lpayload3</code> when you hold the volume up key.<br />
<br />
Preparing a payload involves getting a TF-A <code>bl31.elf</code> build, kernel <code>Image</code> build, <code>DTB</code> file for Pinephone Pro, and optionally an initramfs archive, modifying DTB to include kernel boot arguments, and compressing these using <code>lz4</code> in specific order, as shown below.<br />
<br />
<pre><br />
BOOTOPTS=(<br />
console=tty1<br />
<br />
earlycon=uart8250,mmio32,0xff1a0000<br />
console=ttyS2,1500000n8<br />
<br />
root=PARTLABEL=emmc-rootfs1<br />
rootfstype=f2fs<br />
rootflags=fastboot<br />
rootwait<br />
rw<br />
<br />
loglevel=7<br />
)<br />
<br />
BOOTOPTS="${BOOTOPTS[@]}"<br />
ALGO="lz4 -zc"<br />
<br />
cp -f rk3399-pinephone-pro.dtb board-cfg.dtb<br />
fdtput -pt s board-cfg.dtb /chosen bootargs "$BOOTOPTS"<br />
<br />
(<br />
$ALGO bl31.elf<br />
$ALGO board-cfg.dtb<br />
$ALGO Image<br />
# $ALGO initramfs.img<br />
) > payload.img<br />
<br />
dd if=payload.img of=/dev/disk/by-partlabel/sd-payload1 bs=4M oflag=direct<br />
</pre><br />
<br />
4) Prepare root filesystem. You can use any Linux distribution for aarch64 for development. For example if you want to use Arch Linux ARM, you would need to format the <code>sd-rootfs1</code> partition with <code>f2fs</code> filesystem and extract the Arch Linux ARM rootfs tarball there. That will give you a bootable SD card image for Pinephone Pro.<br />
<br />
5) Repeat steps 3 and 4 if you want either more kernel payloads, or more Linux distributions on the same uSD card. I recommend having at least some module-less working kernel in <code>sd-payload3</code> and perhaps a small userspace in <code>sd-rootfs1</code> with a pre-configured WiFi connection, that will allow you to always quickly recover if your development kernel fails to boot, just by pressing volume up key during boot and updating the the kernel in one of the primary payload partitions over WiFi.<br />
<br />
== Development discussion ==<br />
<br />
Most of the discussion happens in #pinedev channel on [https://www.pine64.org/web-irc/ Pine64 IRC server].<br />
<br />
See https://xnux.eu/log/ too.<br />
<br />
[[Category:Pinephone Pro]][[Category:Rockchip RK3399]]</div>Tomhttps://wiki.pine64.org/index.php?title=PinePhone_Pro_Development&diff=11979PinePhone Pro Development2021-12-09T10:18:19Z<p>Tom: /* Front camera */ Fix camera to be ov8858. Citation: https://pine64.com/product/pinephone-pro-developer-edition-invitation-only/</p>
<hr />
<div>This page documents the current status of software support for the [[PinePhone Pro]], and provides links to resources to help prospective contributors get started.<br />
<br />
== Overview ==<br />
<br />
=== Upstreaming Status ===<br />
<br />
{| class="wikitable plainrowheaders" border="1"<br />
! scope="col" | Function<br />
! scope="col" colspan="2" | Status<br />
! scope="col" | Component<br />
! scope="col" | Notes<br />
|-<br />
! scope="row" | Bootloader (u-boot)<br />
| colspan="2" style="background:#FF0; text-align:center;"| Working. Not upstreamed.<br />
|<br />
| https://github.com/dreemurrs-embedded/Pine64-Arch/tree/master/PKGBUILDS/pine64/uboot-pinephonepro uses https://git.sr.ht/~martijnbraam/u-boot.<br />
|-<br />
! scope="row" | Modem<br />
| colspan="2" style="background:#FF0; text-align:center;"|Working. Not upstreamed.<br />
| <br />
| Support in https://gitlab.com/mobian1/devices/eg25-manager and Megi's kernel.<br />
|-<br />
! scope="row" | Sound<br />
| colspan="2" style="background:#F99; text-align:center;"|Unimplemented.<br />
|<br />
| See https://github.com/alsa-project/alsa-ucm-conf/issues/125.<br />
|}<br />
<br />
== Current Status ==<br />
<br />
The following sections give an overview over the current status of different parts of the phone. Some parts are waiting on a driver to be written or ported, others only need various adjustments.<br />
<br />
=== Working ===<br />
<br />
==== System on Chip ====<br />
<br />
Supported in Megi's orange-pi branches: https://megous.com/git/linux.<br />
<br />
ATF? Crust? Likely working due to reuse of Pinebook Pro SoC?<br />
<br />
==== Display ====<br />
<br />
Working.<br />
<br />
==== Front camera ====<br />
<br />
OV8858 camera. Unknown.<br />
<br />
Datasheet: http://www.ahdsensor.com/uploadfile/202008/55322e75316871.pdf<br />
<br />
==== Back camera ====<br />
<br />
Sony IMX258. Support unknown.<br />
<br />
==== Sound ====<br />
<br />
Not working. See https://gitlab.com/pine64-org/pine64-alsa-ucm/-/issues/4<br />
<br />
==== Modem ====<br />
<br />
Working. Supported in:<br />
* Megi's orange-pi branches: https://megous.com/git/linux.<br />
* https://gitlab.com/mobian1/devices/eg25-manager<br />
<br />
==== Sensors ====<br />
<br />
?<br />
<br />
==== Bluetooth ====<br />
<br />
?<br />
<br />
=== Linux kernel ===<br />
<br />
There's no canonical location for Pinephone Pro Linux kernel development, because Pinephone Pro DT is not mainline, yet. [https://xff.cz/git/linux/log/?h=orange-pi-5.16 megi's kernel tree] is the most complete one, as of November 2021.<br />
<br />
== Levinboot Based Kernel Development Image ==<br />
<br />
This guide will help you get a comfortable environment for testing your kernel builds on Pinephone Pro. It assumes you either already know how to build or cross-build a Linux kernel for arm64, or if you have a way to get a pre-built kernel from somewhere. For a quick test that your setup works, you can use [https://xff.cz/kernels/ megi's pre-built kernels].<br />
<br />
Quick and easy way to get started with kernel development and testing is to use CrystalGamma's Levinboot patched with support for Pinephone Pro and 3-option boot selection using volume keys. [https://xnux.eu/log/#049 You will be able to switch between kernels quickly without swapping uSD cards, which is necessary for painless kernel development experience.]<br />
<br />
1) Create a following partitioning scheme on a uSD card using <code>sfdisk</code>:<br />
<br />
<pre><br />
label: gpt<br />
first-lba: 64<br />
table-length: 8<br />
<br />
start=64, size=8128, type=D7B1F817-AA75-2F4F-830D-84818A145370, name="sd-lboot"<br />
size=60M, type=E5AB07A0-8E5E-46F6-9CE8-41A518929B7C, name="sd-lpayload1"<br />
size=60M, type=5f04b556-c920-4b6d-bd77-804efe6fae01, name="sd-lpayload2"<br />
size=60M, type=c195cc59-d766-4b78-813f-a0e1519099d8, name="sd-lpayload3"<br />
size=14G name="sd-rootfs1"<br />
name="sd-rootfs2"<br />
</pre><br />
<br />
2) Write Levinboot to <code>sd-lboot</code> partition using <code>dd</code>. You can get a pre-built and tested version [https://xff.cz/kernels/pinephone-pro/ here] There are two options <code>levinboot-sd.img</code> and <code>levinboot-emmc.img</code> you can use either one of them for your <code>sd-lboot</code> partition. They differ in where they load the payloads from (either from SD or eMMC) and not in where they can be flashed to. For uSD card only workflow, you'll want <code>levinboot-sd.img</code>.<br />
<br />
3) Prepare payloads for Levinboot and copy them to appropriate partitions. Partition <code>sd-lpayload1</code> is used by default, <code>sd-lpayload2</code> when you hold a volume down key during powerup, and <code>sd-lpayload3</code> when you hold the volume up key.<br />
<br />
Preparing a payload involves getting a TF-A <code>bl31.elf</code> build, kernel <code>Image</code> build, <code>DTB</code> file for Pinephone Pro, and optionally an initramfs archive, modifying DTB to include kernel boot arguments, and compressing these using <code>lz4</code> in specific order, as shown below.<br />
<br />
<pre><br />
BOOTOPTS=(<br />
console=tty1<br />
<br />
earlycon=uart8250,mmio32,0xff1a0000<br />
console=ttyS2,1500000n8<br />
<br />
root=PARTLABEL=emmc-rootfs1<br />
rootfstype=f2fs<br />
rootflags=fastboot<br />
rootwait<br />
rw<br />
<br />
loglevel=7<br />
)<br />
<br />
BOOTOPTS="${BOOTOPTS[@]}"<br />
ALGO="lz4 -zc"<br />
<br />
cp -f rk3399-pinephone-pro.dtb board-cfg.dtb<br />
fdtput -pt s board-cfg.dtb /chosen bootargs "$BOOTOPTS"<br />
<br />
(<br />
$ALGO bl31.elf<br />
$ALGO board-cfg.dtb<br />
$ALGO Image<br />
# $ALGO initramfs.img<br />
) > payload.img<br />
<br />
dd if=payload.img of=/dev/disk/by-partlabel/sd-payload1 bs=4M oflag=direct<br />
</pre><br />
<br />
4) Prepare root filesystem. You can use any Linux distribution for aarch64 for development. For example if you want to use Arch Linux ARM, you would need to format the <code>sd-rootfs1</code> partition with <code>f2fs</code> filesystem and extract the Arch Linux ARM rootfs tarball there. That will give you a bootable SD card image for Pinephone Pro.<br />
<br />
5) Repeat steps 3 and 4 if you want either more kernel payloads, or more Linux distributions on the same uSD card. I recommend having at least some module-less working kernel in <code>sd-payload3</code> and perhaps a small userspace in <code>sd-rootfs1</code> with a pre-configured WiFi connection, that will allow you to always quickly recover if your development kernel fails to boot, just by pressing volume up key during boot and updating the the kernel in one of the primary payload partitions over WiFi.<br />
<br />
== Development discussion ==<br />
<br />
Most of the discussion happens in #pinedev channel on [https://www.pine64.org/web-irc/ Pine64 IRC server].<br />
<br />
See https://xnux.eu/log/ too.<br />
<br />
[[Category:Pinephone Pro]][[Category:Rockchip RK3399]]</div>Tomhttps://wiki.pine64.org/index.php?title=PinePhone_Pro&diff=11978PinePhone Pro2021-12-09T10:16:31Z<p>Tom: /* Specifications */ Fix front camera to be ov8858. Citation https://pine64.com/product/pinephone-pro-developer-edition-invitation-only/</p>
<hr />
<div>[[File:Pinephone_double.png|400px|thumb|right|Rendering of the PinePhone Pro]]<br />
<br />
The '''PinePhone Pro''' is PINE64's flagship smartphone announced on October 15, 2021. It features 4GB of RAM, an 128GB eMMC and is using an Rockchip RK3399S SoC, which is a specialized version of the RK3399 made specifically for the PinePhone Pro.<br />
<br />
== Introduction ==<br />
<br />
The PinePhone Pro is PINE64’s second Linux-only smartphone and a successor to the original PinePhone. It does not, however, replace the original PinePhone. It should also not be considered a second generation PinePhone; it is a higher-end device, with much better specs, aimed at those who wish to daily-drive a fully open Linux Stack. Achieving this goal will, however, take time as the software and overall Linux smartphone ecosystem needs to mature. <br />
<br />
More information about the PinePhone Pro can be found on the device [https://www.pine64.org/pinephonepro/ main page]. <br />
<br />
=== State of the software ===<br />
<br />
Presently, at the time of writing (late 2021), the PinePhone Pro is aimed solely at early adopters and developers. It will take time for all the PinePhone Pro’s functionality to reach software parity with the original PinePhone and for mobile Linux, in more general, to reach a higher degree of maturity. <br />
<br />
Bear in mind that the software for Linux smartphones is still in a very early stage, with most of the software being in alpha or beta state. That's especially also the case for scalability of applications, their availability and practicability, any hardware function implementations and the firmware. The software is provided as is. There is no warranty for the software, not even for merchantability or fitness for a particular purpose.<br />
<br />
If you have any questions regarding the current state of the software or of specific features working, please don't hesitate to ask in the community chat (see [[Main Page#Community and Support]])!<br />
<br />
=== Editions and revisions ===<br />
Similarly to the original PinePhone, various PinePhone Pro editions are planned, the first of which is the Developer Edition (aimed at developers, as the name entails) followed by the Explorer Edition, which is aimed at early adopters. <br />
<br />
*[https://wiki.pine64.org/wiki/PinePhone_Pro_Developer_Edition Developer Edition] <br />
*Explorer Edition<br />
<br />
=== Help and support ===<br />
<br />
Still have any questions regarding software, shipping, or ordering after reading this Wiki? Please don't hesitate to contact the community in the bridged community channels for detailed answers or simply to chat with friendly people in the community! See [[Main Page#Community and Support]].<br />
<br />
Please keep in mind that PINE64 is not like a regular company (see [https://www.pine64.org/philosophy/ PINE64 philosophy]), and currently that support resources are sparse - the best way to get support quickly is to ask in the community chat! Please only contact PINE64 directly if questions couldn't be solved via the community chat or this wiki.<br />
<br />
== First time setup ==<br />
<br />
{{Hint|Do not insert an empty micro SIM adapter into the phone, as it will get stuck on the contact pins.}}<br />
<br />
When shipped the battery is isolated from the mainboard contacts using a protective plastic tab, which is required to be removed before using the phone. The battery '''will not''' charge until it is removed and some of the device’s functionality may not function properly.<br />
<br />
The PinePhone Pro's SIM slot only accepts a micro SIM, please do not insert a nano SIM without an adapter. The SIM card has to be placed in the lower slot, while the microSD has to be placed in the upper slot. Notice: Do not insert an empty micro SIM adapter into the phone, as it will get stuck on the contact pins. An adapter from a nano to a micro SIM is included in the box. <br />
<br />
To remove the sticker after unboxing the phone:<br />
<br />
# Carefully remove the back panel using the notch in the corner of the back cover without overbending it<br />
# Remove the battery (if the battery is stuck in the device please check [[PinePhone_FAQ#The_battery_is_stuck_inside_the_phone|this]] paragraph for a fix)<br />
# Peel off the clear plastic sticker below it, which isolates the charging contacts<br />
# Reinsert the battery<br />
<br />
<gallery mode="nolines" widths="400px" heights="400px"><br />
Image:Pinephone_warning.png|A protection foil isolates the battery for the shipping.<br />
Image:Pinephone_backside.png|The microSD belongs in the upper slot, the micro SIM in the lower slot.<br />
</gallery><br />
<br />
<br />
== Software ==<br />
<br />
At the time of the release, in late 2020, the PinePhone Pro is in an early development stage. That said, the device has benefited greatly from work done on the original PinePhone, which means that even early development images feature all core functionality, such as: functional UI, sensors and even the modem (to a degree). <br />
<br />
The development is expected to proceed very quickly compared to progress done on the original PinePhone as much of the fundamental work can carry over to the new device. <br />
You can follow development efforts on [https://xnux.eu/log/ Megi's blog], the dedicated [[PinePhone Pro Development]] section as well as on individual project’s Wiki’s and repositories. <br />
<br />
=== Boot order ===<br />
<br />
On the PinePhone Pro the eMMC (the internal storage of the phone) has a higher boot priority than the microSD card (see [[RK3399 boot sequence#Boot sequence details]] for details regarding the boot sequence). That behavior is in contrast to the original PinePhone with the Allwinner A64 SoC, where the microSD card has a higher boot priority.<br />
<br />
What this means: For the PinePhone Pro this means, that inserting a flashed microSD card to boot a new installation is not sufficient to boot a microSD card if there is already a valid installation of a bootloader on the eMMC present. The boot order behavior can be altered non-permanently by various way, for example by either not having a bootloader installed to the eMMC or by pointing the bootloader installed on the eMMC to the installation on the microSD card.<br />
<br />
=== Installation instructions ===<br />
<br />
Due to the above explained [[PinePhone Pro#Boot order|boot order]] of the PinePhone Pro, the eMMC has a higher boot priority than the microSD card and the user has to consider this behavior. This means that you cannot boot from a SD card with an OS present on the device's eMMC. <br />
<br />
{{Template:note|If you ordered a PinePhone Pro Developer Edition intended for developing and coming with an Android factory OS preinstalled, please see [[PinePhone Pro Developer Edition#Nuking the factory AOSP installation]] to learn how to remove the bootloader and the preinstalled OS of the eMMC, to be able to boot and test operating systems from the microSD card easily.<br />
}}<br />
<br />
That said, booting from SD can be achieved using a modified u-boot (or a different bootloader) on eMMC, which seeks out a bootable partition on SD first. At the time of writing, this hasn’t been achieved yet but is a planned feature.<br />
<br />
It is strongly recommended you perform all testing from a SD card, leaving the eMMC vacant.<br />
<br />
=== Software releases ===<br />
{{Hint|Developers, please add links to OS images, repositories or build instructions here.}}<br />
<br />
==== Arch Linux ARM ====<br />
[[File:Archlinux-logo.png|right|100px]]<br />
<br />
(Unofficial) Arch Linux ARM with choice of Phosh UI, Plasma Mobile, sxmo or barebones.<br />
Currently being maintained by the [https://danctnix.org/ DanctNIX] community (GitHub: [https://github.com/DanctNIX/danctnix danctnix], [https://github.com/dreemurrs-embedded dreemurrs-embedded]).<br />
<br />
* GitHub: [https://github.com/dreemurrs-embedded/Pine64-Arch/ dreemurrs-embedded/Pine64-Arch]<br />
<br />
'''Download location'''<br />
<br />
Get both stable and test builds at [https://github.com/dreemurrs-embedded/Pine64-Arch/releases GitHub releases].<br />
<br />
'''username/password'''<br />
<br />
{| class="wikitable"<br />
! Default user<br />
| <code>alarm/123456</code><br />
|-<br />
! root<br />
| <code>root/root</code><br />
|}<br />
<br />
==== Manjaro ARM ====<br />
[[File:Manjaro-logo.svg|right|100px]]<br />
<br />
Manjaro is a user-friendly Linux distribution based on the independently developed Arch operating system with the Plasma Mobile desktop environment.<br />
<br />
'''Download location'''<br />
<br />
* Phosh: [https://github.com/manjaro-pinephone/phosh-dev/releases Dev] <br />
* Plasma Mobile: [https://github.com/manjaro-pinephone/plasma-mobile-dev/releases Dev]<br />
<br />
'''username/password'''<br />
<br />
{| class="wikitable"<br />
! Default user<br />
| <code>manjaro/123456</code><br />
|-<br />
! root<br />
| <code>root/root</code><br />
|}<br />
<br />
==== postmarketOS ====<br />
[[File:PostmarketOS-logo.png|right|100px]]<br />
<br />
postmarketOS extends [https://www.alpinelinux.org/ Alpine Linux] to run on smartphones and other mobile devices.<br />
It offers various user interfaces (Phosh, Plasma Mobile, Sxmo, Plasma Desktop, Gnome 3, Kodi, XFCE4, ...).<br />
<br />
Official images for the PinePhone Pro will be available once it is in the "community" category of devices. Until then, build your own image with pmbootstrap.<br />
<br />
See the [https://wiki.postmarketos.org/wiki/PINE64_PinePhone_Pro_(pine64-pinephonepro) pine64-pinephonepro] page of the postmarketOS wiki for details.<br />
<br />
==== NixOS ====<br />
WIP. See https://github.com/NixOS/mobile-nixos/issues/440.<br />
<br />
== Specifications ==<br />
<br />
* '''Dimensions:''' 160.8 x 76.6 x 11.1mm<br />
* '''Weight:''' Approx. 220g<br />
* '''SIM Card:''' Micro-SIM<br />
* '''Display:'''<br />
** '''Size:''' 6 inches (151mm) diagonal<br />
** '''Type:''' 1440 x 720 in-cell IPS with Gorilla Glass 4™<br />
** '''Resolution:''' 1440x720, 18:9 ratio<br />
* '''System on Chip:''' Rockchip RK3399S 64bit SoC – 2x A72 and 4x A53 CPU cores @ 1.5GHz<br />
* '''RAM:''' 4GB LPDDR4 @ 800MHz<br />
* '''Internal Storage:''' 128GB eMMC, extendable up to 2TB via microSD, supports SDHC and SDXC<br />
* '''Back [[#Camera|Camera]]:''' 13MP Sony IMX258 with Gorilla Glass 4™ protective layer, LED Flash<br />
* '''Front Camera:''' 8MP, OmniVision OV8858 front-facing camera<br />
* '''Sound:''' Loudspeaker, 3.5mm jack & mic (jack doubles as hardware UART if hardware switch 6 is deactivated)<br />
* '''Communication:'''<br />
** '''[[#Modem|Modem]]:''' [https://www.quectel.com/product/lte-eg25-g/ Quectel EG25-G]<br />
** '''LTE-FDD''': B1, B2, B3, B4, B5, B7, B8, B12, B13, B18, B19, B20, B25, B26, B28<br />
** '''LTE-TDD''': B38, B39, B40, B41<br />
** '''WCDMA''': B1, B2, B4, B5, B6, B8, B19<br />
** '''GSM''': B2, B3, B5, B8 (850, 900, 1800, 1900 MHz)<br />
** '''WLAN & Bluetooth:''' AMPAK AP6255 WiFi 11ac + Bluetooth V4.1<br />
** '''GNSS:''' GPS/GLONASS/BeiDou/Galileo/QZSS, with A-GPS<br />
* '''Sensors:''' Accelerometer, gyroscope, proximity, ambient light, compass<br />
* '''Privacy switches:''' Modem, WiFi & Bluetooth, Microphone, Cameras<br />
* '''[[#Battery|Battery]]:''' Lithium-ion, rated capacity 2800mAh (10.64Wh), typical capacity 3000mAh (11.40Wh) (nominally replaceable with any Samsung J7 form-factor battery)<br />
* '''I/O:''' USB Type-C, USB Host, DisplayPort Alternate Mode output, 15W 5V 3A Quick Charge, follows USB PD specification<br />
<br />
== Privacy switch configuration ==<br />
<br />
[[File:PinePhone Kill Interruptors de Maquinari del PinePhone 4529.jpg|320px|thumb|right|Detail of DIP switch]]<br />
<br />
The PinePhone features six switches that can be used to configure its hardware. They are numbered 1-6, with switch 1 located nearest to the modem. Their "on" position is toward the top of the phone.<br />
<br />
{| class="wikitable"<br />
|-<br />
! Number<br />
! Name<br />
! Description<br />
|-<br />
| 1<br />
| Modem<br />
| "On" enables 2G/3G/4G communication and GNSS hardware, "off" disables it.<br />
|-<br />
| 2<br />
| WiFi / Bluetooth<br />
| "On" enables WiFi and Bluetooth communication hardware, "off" disables it.<br />
|-<br />
| 3<br />
| Microphone<br />
| "On" enables audio input from on-board microphones (not 3.5 mm jack), "off" disables it.<br />
|-<br />
| 4<br />
| Rear camera<br />
| "On" enables the rear camera, "off" disables it.<br />
|-<br />
| 5<br />
| Front camera<br />
| "On" enables the front camera, "off" disables it.<br />
|-<br />
| 6<br />
| Headphone<br />
| "On" enables audio input and output via the 3.5 mm audio jack, "off" switches the jack to hardware UART mode.<br />
|}<br />
<br />
== PinePhone board information, schematics and certifications ==<br />
<br />
== Datasheets for components and peripherals ==<br />
<br />
== Press ==<br />
<br />
For an overview about media of the PinePhone Pro you can use for the news, blogs, or similar see [[PinePhone Pro Press]].<br />
<br />
== External links ==<br />
* [https://www.pine64.org/pinephonepro/ Product Page]<br />
* [https://www.youtube.com/watch?v=wP2-6Z74W44 Announcement video]<br />
* [https://www.pine64.org/2021/10/15/october-update-introducing-the-pinephone-pro/ Blog post] with the announcement<br />
<br />
<br />
[[Category:PinePhone]] [[Category:PinePhone Pro]] [[Category:Rockchip RK3399]]</div>Tomhttps://wiki.pine64.org/index.php?title=PinePhone_Pro_Development&diff=11977PinePhone Pro Development2021-12-09T10:15:09Z<p>Tom: /* Development discussion */ Link to Megi's blog.</p>
<hr />
<div>This page documents the current status of software support for the [[PinePhone Pro]], and provides links to resources to help prospective contributors get started.<br />
<br />
== Overview ==<br />
<br />
=== Upstreaming Status ===<br />
<br />
{| class="wikitable plainrowheaders" border="1"<br />
! scope="col" | Function<br />
! scope="col" colspan="2" | Status<br />
! scope="col" | Component<br />
! scope="col" | Notes<br />
|-<br />
! scope="row" | Bootloader (u-boot)<br />
| colspan="2" style="background:#FF0; text-align:center;"| Working. Not upstreamed.<br />
|<br />
| https://github.com/dreemurrs-embedded/Pine64-Arch/tree/master/PKGBUILDS/pine64/uboot-pinephonepro uses https://git.sr.ht/~martijnbraam/u-boot.<br />
|-<br />
! scope="row" | Modem<br />
| colspan="2" style="background:#FF0; text-align:center;"|Working. Not upstreamed.<br />
| <br />
| Support in https://gitlab.com/mobian1/devices/eg25-manager and Megi's kernel.<br />
|-<br />
! scope="row" | Sound<br />
| colspan="2" style="background:#F99; text-align:center;"|Unimplemented.<br />
|<br />
| See https://github.com/alsa-project/alsa-ucm-conf/issues/125.<br />
|}<br />
<br />
== Current Status ==<br />
<br />
The following sections give an overview over the current status of different parts of the phone. Some parts are waiting on a driver to be written or ported, others only need various adjustments.<br />
<br />
=== Working ===<br />
<br />
==== System on Chip ====<br />
<br />
Supported in Megi's orange-pi branches: https://megous.com/git/linux.<br />
<br />
ATF? Crust? Likely working due to reuse of Pinebook Pro SoC?<br />
<br />
==== Display ====<br />
<br />
Working.<br />
<br />
==== Front camera ====<br />
<br />
OV5640 camera has a driver used by PinePhone.<br />
<br />
==== Back camera ====<br />
<br />
Sony IMX258. Support unknown.<br />
<br />
==== Sound ====<br />
<br />
Not working. See https://gitlab.com/pine64-org/pine64-alsa-ucm/-/issues/4<br />
<br />
==== Modem ====<br />
<br />
Working. Supported in:<br />
* Megi's orange-pi branches: https://megous.com/git/linux.<br />
* https://gitlab.com/mobian1/devices/eg25-manager<br />
<br />
==== Sensors ====<br />
<br />
?<br />
<br />
==== Bluetooth ====<br />
<br />
?<br />
<br />
=== Linux kernel ===<br />
<br />
There's no canonical location for Pinephone Pro Linux kernel development, because Pinephone Pro DT is not mainline, yet. [https://xff.cz/git/linux/log/?h=orange-pi-5.16 megi's kernel tree] is the most complete one, as of November 2021.<br />
<br />
== Levinboot Based Kernel Development Image ==<br />
<br />
This guide will help you get a comfortable environment for testing your kernel builds on Pinephone Pro. It assumes you either already know how to build or cross-build a Linux kernel for arm64, or if you have a way to get a pre-built kernel from somewhere. For a quick test that your setup works, you can use [https://xff.cz/kernels/ megi's pre-built kernels].<br />
<br />
Quick and easy way to get started with kernel development and testing is to use CrystalGamma's Levinboot patched with support for Pinephone Pro and 3-option boot selection using volume keys. [https://xnux.eu/log/#049 You will be able to switch between kernels quickly without swapping uSD cards, which is necessary for painless kernel development experience.]<br />
<br />
1) Create a following partitioning scheme on a uSD card using <code>sfdisk</code>:<br />
<br />
<pre><br />
label: gpt<br />
first-lba: 64<br />
table-length: 8<br />
<br />
start=64, size=8128, type=D7B1F817-AA75-2F4F-830D-84818A145370, name="sd-lboot"<br />
size=60M, type=E5AB07A0-8E5E-46F6-9CE8-41A518929B7C, name="sd-lpayload1"<br />
size=60M, type=5f04b556-c920-4b6d-bd77-804efe6fae01, name="sd-lpayload2"<br />
size=60M, type=c195cc59-d766-4b78-813f-a0e1519099d8, name="sd-lpayload3"<br />
size=14G name="sd-rootfs1"<br />
name="sd-rootfs2"<br />
</pre><br />
<br />
2) Write Levinboot to <code>sd-lboot</code> partition using <code>dd</code>. You can get a pre-built and tested version [https://xff.cz/kernels/pinephone-pro/ here] There are two options <code>levinboot-sd.img</code> and <code>levinboot-emmc.img</code> you can use either one of them for your <code>sd-lboot</code> partition. They differ in where they load the payloads from (either from SD or eMMC) and not in where they can be flashed to. For uSD card only workflow, you'll want <code>levinboot-sd.img</code>.<br />
<br />
3) Prepare payloads for Levinboot and copy them to appropriate partitions. Partition <code>sd-lpayload1</code> is used by default, <code>sd-lpayload2</code> when you hold a volume down key during powerup, and <code>sd-lpayload3</code> when you hold the volume up key.<br />
<br />
Preparing a payload involves getting a TF-A <code>bl31.elf</code> build, kernel <code>Image</code> build, <code>DTB</code> file for Pinephone Pro, and optionally an initramfs archive, modifying DTB to include kernel boot arguments, and compressing these using <code>lz4</code> in specific order, as shown below.<br />
<br />
<pre><br />
BOOTOPTS=(<br />
console=tty1<br />
<br />
earlycon=uart8250,mmio32,0xff1a0000<br />
console=ttyS2,1500000n8<br />
<br />
root=PARTLABEL=emmc-rootfs1<br />
rootfstype=f2fs<br />
rootflags=fastboot<br />
rootwait<br />
rw<br />
<br />
loglevel=7<br />
)<br />
<br />
BOOTOPTS="${BOOTOPTS[@]}"<br />
ALGO="lz4 -zc"<br />
<br />
cp -f rk3399-pinephone-pro.dtb board-cfg.dtb<br />
fdtput -pt s board-cfg.dtb /chosen bootargs "$BOOTOPTS"<br />
<br />
(<br />
$ALGO bl31.elf<br />
$ALGO board-cfg.dtb<br />
$ALGO Image<br />
# $ALGO initramfs.img<br />
) > payload.img<br />
<br />
dd if=payload.img of=/dev/disk/by-partlabel/sd-payload1 bs=4M oflag=direct<br />
</pre><br />
<br />
4) Prepare root filesystem. You can use any Linux distribution for aarch64 for development. For example if you want to use Arch Linux ARM, you would need to format the <code>sd-rootfs1</code> partition with <code>f2fs</code> filesystem and extract the Arch Linux ARM rootfs tarball there. That will give you a bootable SD card image for Pinephone Pro.<br />
<br />
5) Repeat steps 3 and 4 if you want either more kernel payloads, or more Linux distributions on the same uSD card. I recommend having at least some module-less working kernel in <code>sd-payload3</code> and perhaps a small userspace in <code>sd-rootfs1</code> with a pre-configured WiFi connection, that will allow you to always quickly recover if your development kernel fails to boot, just by pressing volume up key during boot and updating the the kernel in one of the primary payload partitions over WiFi.<br />
<br />
== Development discussion ==<br />
<br />
Most of the discussion happens in #pinedev channel on [https://www.pine64.org/web-irc/ Pine64 IRC server].<br />
<br />
See https://xnux.eu/log/ too.<br />
<br />
[[Category:Pinephone Pro]][[Category:Rockchip RK3399]]</div>Tomhttps://wiki.pine64.org/index.php?title=PinePhone_Pro_Development&diff=11976PinePhone Pro Development2021-12-09T10:12:53Z<p>Tom: /* Current Status */ Add uncertainty re bluetooth.</p>
<hr />
<div>This page documents the current status of software support for the [[PinePhone Pro]], and provides links to resources to help prospective contributors get started.<br />
<br />
== Overview ==<br />
<br />
=== Upstreaming Status ===<br />
<br />
{| class="wikitable plainrowheaders" border="1"<br />
! scope="col" | Function<br />
! scope="col" colspan="2" | Status<br />
! scope="col" | Component<br />
! scope="col" | Notes<br />
|-<br />
! scope="row" | Bootloader (u-boot)<br />
| colspan="2" style="background:#FF0; text-align:center;"| Working. Not upstreamed.<br />
|<br />
| https://github.com/dreemurrs-embedded/Pine64-Arch/tree/master/PKGBUILDS/pine64/uboot-pinephonepro uses https://git.sr.ht/~martijnbraam/u-boot.<br />
|-<br />
! scope="row" | Modem<br />
| colspan="2" style="background:#FF0; text-align:center;"|Working. Not upstreamed.<br />
| <br />
| Support in https://gitlab.com/mobian1/devices/eg25-manager and Megi's kernel.<br />
|-<br />
! scope="row" | Sound<br />
| colspan="2" style="background:#F99; text-align:center;"|Unimplemented.<br />
|<br />
| See https://github.com/alsa-project/alsa-ucm-conf/issues/125.<br />
|}<br />
<br />
== Current Status ==<br />
<br />
The following sections give an overview over the current status of different parts of the phone. Some parts are waiting on a driver to be written or ported, others only need various adjustments.<br />
<br />
=== Working ===<br />
<br />
==== System on Chip ====<br />
<br />
Supported in Megi's orange-pi branches: https://megous.com/git/linux.<br />
<br />
ATF? Crust? Likely working due to reuse of Pinebook Pro SoC?<br />
<br />
==== Display ====<br />
<br />
Working.<br />
<br />
==== Front camera ====<br />
<br />
OV5640 camera has a driver used by PinePhone.<br />
<br />
==== Back camera ====<br />
<br />
Sony IMX258. Support unknown.<br />
<br />
==== Sound ====<br />
<br />
Not working. See https://gitlab.com/pine64-org/pine64-alsa-ucm/-/issues/4<br />
<br />
==== Modem ====<br />
<br />
Working. Supported in:<br />
* Megi's orange-pi branches: https://megous.com/git/linux.<br />
* https://gitlab.com/mobian1/devices/eg25-manager<br />
<br />
==== Sensors ====<br />
<br />
?<br />
<br />
==== Bluetooth ====<br />
<br />
?<br />
<br />
=== Linux kernel ===<br />
<br />
There's no canonical location for Pinephone Pro Linux kernel development, because Pinephone Pro DT is not mainline, yet. [https://xff.cz/git/linux/log/?h=orange-pi-5.16 megi's kernel tree] is the most complete one, as of November 2021.<br />
<br />
== Levinboot Based Kernel Development Image ==<br />
<br />
This guide will help you get a comfortable environment for testing your kernel builds on Pinephone Pro. It assumes you either already know how to build or cross-build a Linux kernel for arm64, or if you have a way to get a pre-built kernel from somewhere. For a quick test that your setup works, you can use [https://xff.cz/kernels/ megi's pre-built kernels].<br />
<br />
Quick and easy way to get started with kernel development and testing is to use CrystalGamma's Levinboot patched with support for Pinephone Pro and 3-option boot selection using volume keys. [https://xnux.eu/log/#049 You will be able to switch between kernels quickly without swapping uSD cards, which is necessary for painless kernel development experience.]<br />
<br />
1) Create a following partitioning scheme on a uSD card using <code>sfdisk</code>:<br />
<br />
<pre><br />
label: gpt<br />
first-lba: 64<br />
table-length: 8<br />
<br />
start=64, size=8128, type=D7B1F817-AA75-2F4F-830D-84818A145370, name="sd-lboot"<br />
size=60M, type=E5AB07A0-8E5E-46F6-9CE8-41A518929B7C, name="sd-lpayload1"<br />
size=60M, type=5f04b556-c920-4b6d-bd77-804efe6fae01, name="sd-lpayload2"<br />
size=60M, type=c195cc59-d766-4b78-813f-a0e1519099d8, name="sd-lpayload3"<br />
size=14G name="sd-rootfs1"<br />
name="sd-rootfs2"<br />
</pre><br />
<br />
2) Write Levinboot to <code>sd-lboot</code> partition using <code>dd</code>. You can get a pre-built and tested version [https://xff.cz/kernels/pinephone-pro/ here] There are two options <code>levinboot-sd.img</code> and <code>levinboot-emmc.img</code> you can use either one of them for your <code>sd-lboot</code> partition. They differ in where they load the payloads from (either from SD or eMMC) and not in where they can be flashed to. For uSD card only workflow, you'll want <code>levinboot-sd.img</code>.<br />
<br />
3) Prepare payloads for Levinboot and copy them to appropriate partitions. Partition <code>sd-lpayload1</code> is used by default, <code>sd-lpayload2</code> when you hold a volume down key during powerup, and <code>sd-lpayload3</code> when you hold the volume up key.<br />
<br />
Preparing a payload involves getting a TF-A <code>bl31.elf</code> build, kernel <code>Image</code> build, <code>DTB</code> file for Pinephone Pro, and optionally an initramfs archive, modifying DTB to include kernel boot arguments, and compressing these using <code>lz4</code> in specific order, as shown below.<br />
<br />
<pre><br />
BOOTOPTS=(<br />
console=tty1<br />
<br />
earlycon=uart8250,mmio32,0xff1a0000<br />
console=ttyS2,1500000n8<br />
<br />
root=PARTLABEL=emmc-rootfs1<br />
rootfstype=f2fs<br />
rootflags=fastboot<br />
rootwait<br />
rw<br />
<br />
loglevel=7<br />
)<br />
<br />
BOOTOPTS="${BOOTOPTS[@]}"<br />
ALGO="lz4 -zc"<br />
<br />
cp -f rk3399-pinephone-pro.dtb board-cfg.dtb<br />
fdtput -pt s board-cfg.dtb /chosen bootargs "$BOOTOPTS"<br />
<br />
(<br />
$ALGO bl31.elf<br />
$ALGO board-cfg.dtb<br />
$ALGO Image<br />
# $ALGO initramfs.img<br />
) > payload.img<br />
<br />
dd if=payload.img of=/dev/disk/by-partlabel/sd-payload1 bs=4M oflag=direct<br />
</pre><br />
<br />
4) Prepare root filesystem. You can use any Linux distribution for aarch64 for development. For example if you want to use Arch Linux ARM, you would need to format the <code>sd-rootfs1</code> partition with <code>f2fs</code> filesystem and extract the Arch Linux ARM rootfs tarball there. That will give you a bootable SD card image for Pinephone Pro.<br />
<br />
5) Repeat steps 3 and 4 if you want either more kernel payloads, or more Linux distributions on the same uSD card. I recommend having at least some module-less working kernel in <code>sd-payload3</code> and perhaps a small userspace in <code>sd-rootfs1</code> with a pre-configured WiFi connection, that will allow you to always quickly recover if your development kernel fails to boot, just by pressing volume up key during boot and updating the the kernel in one of the primary payload partitions over WiFi.<br />
<br />
== Development discussion ==<br />
<br />
Most of the discussion happens in #pinedev channel on [https://www.pine64.org/web-irc/ Pine64 IRC server]<br />
<br />
[[Category:Pinephone Pro]][[Category:Rockchip RK3399]]</div>Tomhttps://wiki.pine64.org/index.php?title=PinePhone_Pro_Development&diff=11975PinePhone Pro Development2021-12-09T10:10:12Z<p>Tom: /* Working */ Add uncertainty around ATF and Crust</p>
<hr />
<div>This page documents the current status of software support for the [[PinePhone Pro]], and provides links to resources to help prospective contributors get started.<br />
<br />
== Overview ==<br />
<br />
=== Upstreaming Status ===<br />
<br />
{| class="wikitable plainrowheaders" border="1"<br />
! scope="col" | Function<br />
! scope="col" colspan="2" | Status<br />
! scope="col" | Component<br />
! scope="col" | Notes<br />
|-<br />
! scope="row" | Bootloader (u-boot)<br />
| colspan="2" style="background:#FF0; text-align:center;"| Working. Not upstreamed.<br />
|<br />
| https://github.com/dreemurrs-embedded/Pine64-Arch/tree/master/PKGBUILDS/pine64/uboot-pinephonepro uses https://git.sr.ht/~martijnbraam/u-boot.<br />
|-<br />
! scope="row" | Modem<br />
| colspan="2" style="background:#FF0; text-align:center;"|Working. Not upstreamed.<br />
| <br />
| Support in https://gitlab.com/mobian1/devices/eg25-manager and Megi's kernel.<br />
|-<br />
! scope="row" | Sound<br />
| colspan="2" style="background:#F99; text-align:center;"|Unimplemented.<br />
|<br />
| See https://github.com/alsa-project/alsa-ucm-conf/issues/125.<br />
|}<br />
<br />
== Current Status ==<br />
<br />
The following sections give an overview over the current status of different parts of the phone. Some parts are waiting on a driver to be written or ported, others only need various adjustments.<br />
<br />
=== Working ===<br />
<br />
==== System on Chip ====<br />
<br />
Supported in Megi's orange-pi branches: https://megous.com/git/linux.<br />
<br />
ATF? Crust? Likely working due to reuse of Pinebook Pro SoC?<br />
<br />
==== Display ====<br />
<br />
Working.<br />
<br />
==== Front camera ====<br />
<br />
OV5640 camera has a driver used by PinePhone.<br />
<br />
==== Back camera ====<br />
<br />
Sony IMX258. Support unknown.<br />
<br />
==== Sound ====<br />
<br />
Not working. See https://gitlab.com/pine64-org/pine64-alsa-ucm/-/issues/4<br />
<br />
==== Modem ====<br />
<br />
Working. Supported in:<br />
* Megi's orange-pi branches: https://megous.com/git/linux.<br />
* https://gitlab.com/mobian1/devices/eg25-manager<br />
<br />
==== Sensors ====<br />
<br />
?<br />
<br />
=== Linux kernel ===<br />
<br />
There's no canonical location for Pinephone Pro Linux kernel development, because Pinephone Pro DT is not mainline, yet. [https://xff.cz/git/linux/log/?h=orange-pi-5.16 megi's kernel tree] is the most complete one, as of November 2021.<br />
<br />
== Levinboot Based Kernel Development Image ==<br />
<br />
This guide will help you get a comfortable environment for testing your kernel builds on Pinephone Pro. It assumes you either already know how to build or cross-build a Linux kernel for arm64, or if you have a way to get a pre-built kernel from somewhere. For a quick test that your setup works, you can use [https://xff.cz/kernels/ megi's pre-built kernels].<br />
<br />
Quick and easy way to get started with kernel development and testing is to use CrystalGamma's Levinboot patched with support for Pinephone Pro and 3-option boot selection using volume keys. [https://xnux.eu/log/#049 You will be able to switch between kernels quickly without swapping uSD cards, which is necessary for painless kernel development experience.]<br />
<br />
1) Create a following partitioning scheme on a uSD card using <code>sfdisk</code>:<br />
<br />
<pre><br />
label: gpt<br />
first-lba: 64<br />
table-length: 8<br />
<br />
start=64, size=8128, type=D7B1F817-AA75-2F4F-830D-84818A145370, name="sd-lboot"<br />
size=60M, type=E5AB07A0-8E5E-46F6-9CE8-41A518929B7C, name="sd-lpayload1"<br />
size=60M, type=5f04b556-c920-4b6d-bd77-804efe6fae01, name="sd-lpayload2"<br />
size=60M, type=c195cc59-d766-4b78-813f-a0e1519099d8, name="sd-lpayload3"<br />
size=14G name="sd-rootfs1"<br />
name="sd-rootfs2"<br />
</pre><br />
<br />
2) Write Levinboot to <code>sd-lboot</code> partition using <code>dd</code>. You can get a pre-built and tested version [https://xff.cz/kernels/pinephone-pro/ here] There are two options <code>levinboot-sd.img</code> and <code>levinboot-emmc.img</code> you can use either one of them for your <code>sd-lboot</code> partition. They differ in where they load the payloads from (either from SD or eMMC) and not in where they can be flashed to. For uSD card only workflow, you'll want <code>levinboot-sd.img</code>.<br />
<br />
3) Prepare payloads for Levinboot and copy them to appropriate partitions. Partition <code>sd-lpayload1</code> is used by default, <code>sd-lpayload2</code> when you hold a volume down key during powerup, and <code>sd-lpayload3</code> when you hold the volume up key.<br />
<br />
Preparing a payload involves getting a TF-A <code>bl31.elf</code> build, kernel <code>Image</code> build, <code>DTB</code> file for Pinephone Pro, and optionally an initramfs archive, modifying DTB to include kernel boot arguments, and compressing these using <code>lz4</code> in specific order, as shown below.<br />
<br />
<pre><br />
BOOTOPTS=(<br />
console=tty1<br />
<br />
earlycon=uart8250,mmio32,0xff1a0000<br />
console=ttyS2,1500000n8<br />
<br />
root=PARTLABEL=emmc-rootfs1<br />
rootfstype=f2fs<br />
rootflags=fastboot<br />
rootwait<br />
rw<br />
<br />
loglevel=7<br />
)<br />
<br />
BOOTOPTS="${BOOTOPTS[@]}"<br />
ALGO="lz4 -zc"<br />
<br />
cp -f rk3399-pinephone-pro.dtb board-cfg.dtb<br />
fdtput -pt s board-cfg.dtb /chosen bootargs "$BOOTOPTS"<br />
<br />
(<br />
$ALGO bl31.elf<br />
$ALGO board-cfg.dtb<br />
$ALGO Image<br />
# $ALGO initramfs.img<br />
) > payload.img<br />
<br />
dd if=payload.img of=/dev/disk/by-partlabel/sd-payload1 bs=4M oflag=direct<br />
</pre><br />
<br />
4) Prepare root filesystem. You can use any Linux distribution for aarch64 for development. For example if you want to use Arch Linux ARM, you would need to format the <code>sd-rootfs1</code> partition with <code>f2fs</code> filesystem and extract the Arch Linux ARM rootfs tarball there. That will give you a bootable SD card image for Pinephone Pro.<br />
<br />
5) Repeat steps 3 and 4 if you want either more kernel payloads, or more Linux distributions on the same uSD card. I recommend having at least some module-less working kernel in <code>sd-payload3</code> and perhaps a small userspace in <code>sd-rootfs1</code> with a pre-configured WiFi connection, that will allow you to always quickly recover if your development kernel fails to boot, just by pressing volume up key during boot and updating the the kernel in one of the primary payload partitions over WiFi.<br />
<br />
== Development discussion ==<br />
<br />
Most of the discussion happens in #pinedev channel on [https://www.pine64.org/web-irc/ Pine64 IRC server]<br />
<br />
[[Category:Pinephone Pro]][[Category:Rockchip RK3399]]</div>Tomhttps://wiki.pine64.org/index.php?title=PinePhone_Pro_Development&diff=11974PinePhone Pro Development2021-12-09T10:08:33Z<p>Tom: /* Working */ Fill out the status section.</p>
<hr />
<div>This page documents the current status of software support for the [[PinePhone Pro]], and provides links to resources to help prospective contributors get started.<br />
<br />
== Overview ==<br />
<br />
=== Upstreaming Status ===<br />
<br />
{| class="wikitable plainrowheaders" border="1"<br />
! scope="col" | Function<br />
! scope="col" colspan="2" | Status<br />
! scope="col" | Component<br />
! scope="col" | Notes<br />
|-<br />
! scope="row" | Bootloader (u-boot)<br />
| colspan="2" style="background:#FF0; text-align:center;"| Working. Not upstreamed.<br />
|<br />
| https://github.com/dreemurrs-embedded/Pine64-Arch/tree/master/PKGBUILDS/pine64/uboot-pinephonepro uses https://git.sr.ht/~martijnbraam/u-boot.<br />
|-<br />
! scope="row" | Modem<br />
| colspan="2" style="background:#FF0; text-align:center;"|Working. Not upstreamed.<br />
| <br />
| Support in https://gitlab.com/mobian1/devices/eg25-manager and Megi's kernel.<br />
|-<br />
! scope="row" | Sound<br />
| colspan="2" style="background:#F99; text-align:center;"|Unimplemented.<br />
|<br />
| See https://github.com/alsa-project/alsa-ucm-conf/issues/125.<br />
|}<br />
<br />
== Current Status ==<br />
<br />
The following sections give an overview over the current status of different parts of the phone. Some parts are waiting on a driver to be written or ported, others only need various adjustments.<br />
<br />
=== Working ===<br />
<br />
==== System on Chip ====<br />
<br />
Supported in Megi's orange-pi branches: https://megous.com/git/linux.<br />
<br />
==== Display ====<br />
<br />
Working.<br />
<br />
==== Front camera ====<br />
<br />
OV5640 camera has a driver used by PinePhone.<br />
<br />
==== Back camera ====<br />
<br />
Sony IMX258. Support unknown.<br />
<br />
==== Sound ====<br />
<br />
Not working. See https://gitlab.com/pine64-org/pine64-alsa-ucm/-/issues/4<br />
<br />
==== Modem ====<br />
<br />
Working. Supported in:<br />
* Megi's orange-pi branches: https://megous.com/git/linux.<br />
* https://gitlab.com/mobian1/devices/eg25-manager<br />
<br />
==== Sensors ====<br />
<br />
?<br />
<br />
=== Linux kernel ===<br />
<br />
There's no canonical location for Pinephone Pro Linux kernel development, because Pinephone Pro DT is not mainline, yet. [https://xff.cz/git/linux/log/?h=orange-pi-5.16 megi's kernel tree] is the most complete one, as of November 2021.<br />
<br />
== Levinboot Based Kernel Development Image ==<br />
<br />
This guide will help you get a comfortable environment for testing your kernel builds on Pinephone Pro. It assumes you either already know how to build or cross-build a Linux kernel for arm64, or if you have a way to get a pre-built kernel from somewhere. For a quick test that your setup works, you can use [https://xff.cz/kernels/ megi's pre-built kernels].<br />
<br />
Quick and easy way to get started with kernel development and testing is to use CrystalGamma's Levinboot patched with support for Pinephone Pro and 3-option boot selection using volume keys. [https://xnux.eu/log/#049 You will be able to switch between kernels quickly without swapping uSD cards, which is necessary for painless kernel development experience.]<br />
<br />
1) Create a following partitioning scheme on a uSD card using <code>sfdisk</code>:<br />
<br />
<pre><br />
label: gpt<br />
first-lba: 64<br />
table-length: 8<br />
<br />
start=64, size=8128, type=D7B1F817-AA75-2F4F-830D-84818A145370, name="sd-lboot"<br />
size=60M, type=E5AB07A0-8E5E-46F6-9CE8-41A518929B7C, name="sd-lpayload1"<br />
size=60M, type=5f04b556-c920-4b6d-bd77-804efe6fae01, name="sd-lpayload2"<br />
size=60M, type=c195cc59-d766-4b78-813f-a0e1519099d8, name="sd-lpayload3"<br />
size=14G name="sd-rootfs1"<br />
name="sd-rootfs2"<br />
</pre><br />
<br />
2) Write Levinboot to <code>sd-lboot</code> partition using <code>dd</code>. You can get a pre-built and tested version [https://xff.cz/kernels/pinephone-pro/ here] There are two options <code>levinboot-sd.img</code> and <code>levinboot-emmc.img</code> you can use either one of them for your <code>sd-lboot</code> partition. They differ in where they load the payloads from (either from SD or eMMC) and not in where they can be flashed to. For uSD card only workflow, you'll want <code>levinboot-sd.img</code>.<br />
<br />
3) Prepare payloads for Levinboot and copy them to appropriate partitions. Partition <code>sd-lpayload1</code> is used by default, <code>sd-lpayload2</code> when you hold a volume down key during powerup, and <code>sd-lpayload3</code> when you hold the volume up key.<br />
<br />
Preparing a payload involves getting a TF-A <code>bl31.elf</code> build, kernel <code>Image</code> build, <code>DTB</code> file for Pinephone Pro, and optionally an initramfs archive, modifying DTB to include kernel boot arguments, and compressing these using <code>lz4</code> in specific order, as shown below.<br />
<br />
<pre><br />
BOOTOPTS=(<br />
console=tty1<br />
<br />
earlycon=uart8250,mmio32,0xff1a0000<br />
console=ttyS2,1500000n8<br />
<br />
root=PARTLABEL=emmc-rootfs1<br />
rootfstype=f2fs<br />
rootflags=fastboot<br />
rootwait<br />
rw<br />
<br />
loglevel=7<br />
)<br />
<br />
BOOTOPTS="${BOOTOPTS[@]}"<br />
ALGO="lz4 -zc"<br />
<br />
cp -f rk3399-pinephone-pro.dtb board-cfg.dtb<br />
fdtput -pt s board-cfg.dtb /chosen bootargs "$BOOTOPTS"<br />
<br />
(<br />
$ALGO bl31.elf<br />
$ALGO board-cfg.dtb<br />
$ALGO Image<br />
# $ALGO initramfs.img<br />
) > payload.img<br />
<br />
dd if=payload.img of=/dev/disk/by-partlabel/sd-payload1 bs=4M oflag=direct<br />
</pre><br />
<br />
4) Prepare root filesystem. You can use any Linux distribution for aarch64 for development. For example if you want to use Arch Linux ARM, you would need to format the <code>sd-rootfs1</code> partition with <code>f2fs</code> filesystem and extract the Arch Linux ARM rootfs tarball there. That will give you a bootable SD card image for Pinephone Pro.<br />
<br />
5) Repeat steps 3 and 4 if you want either more kernel payloads, or more Linux distributions on the same uSD card. I recommend having at least some module-less working kernel in <code>sd-payload3</code> and perhaps a small userspace in <code>sd-rootfs1</code> with a pre-configured WiFi connection, that will allow you to always quickly recover if your development kernel fails to boot, just by pressing volume up key during boot and updating the the kernel in one of the primary payload partitions over WiFi.<br />
<br />
== Development discussion ==<br />
<br />
Most of the discussion happens in #pinedev channel on [https://www.pine64.org/web-irc/ Pine64 IRC server]<br />
<br />
[[Category:Pinephone Pro]][[Category:Rockchip RK3399]]</div>Tomhttps://wiki.pine64.org/index.php?title=PinePhone_Pro_Development&diff=11971PinePhone Pro Development2021-12-09T10:02:38Z<p>Tom: /* Upstreaming Status */ Fix colour for modem: working but not upstreamed.</p>
<hr />
<div>This page documents the current status of software support for the [[PinePhone Pro]], and provides links to resources to help prospective contributors get started.<br />
<br />
== Overview ==<br />
<br />
=== Upstreaming Status ===<br />
<br />
{| class="wikitable plainrowheaders" border="1"<br />
! scope="col" | Function<br />
! scope="col" colspan="2" | Status<br />
! scope="col" | Component<br />
! scope="col" | Notes<br />
|-<br />
! scope="row" | Bootloader (u-boot)<br />
| colspan="2" style="background:#FF0; text-align:center;"| Working. Not upstreamed.<br />
|<br />
| https://github.com/dreemurrs-embedded/Pine64-Arch/tree/master/PKGBUILDS/pine64/uboot-pinephonepro uses https://git.sr.ht/~martijnbraam/u-boot.<br />
|-<br />
! scope="row" | Modem<br />
| colspan="2" style="background:#FF0; text-align:center;"|Working. Not upstreamed.<br />
| <br />
| Support in https://gitlab.com/mobian1/devices/eg25-manager and Megi's kernel.<br />
|-<br />
! scope="row" | Sound<br />
| colspan="2" style="background:#F99; text-align:center;"|Unimplemented.<br />
|<br />
| See https://github.com/alsa-project/alsa-ucm-conf/issues/125.<br />
|}<br />
<br />
== Current Status ==<br />
<br />
The following sections give an overview over the current status of different parts of the phone. Some parts are waiting on a driver to be written or ported, others only need various adjustments.<br />
<br />
=== Working ===<br />
<br />
TBD<br />
<br />
=== Linux kernel ===<br />
<br />
There's no canonical location for Pinephone Pro Linux kernel development, because Pinephone Pro DT is not mainline, yet. [https://xff.cz/git/linux/log/?h=orange-pi-5.16 megi's kernel tree] is the most complete one, as of November 2021.<br />
<br />
== Levinboot Based Kernel Development Image ==<br />
<br />
This guide will help you get a comfortable environment for testing your kernel builds on Pinephone Pro. It assumes you either already know how to build or cross-build a Linux kernel for arm64, or if you have a way to get a pre-built kernel from somewhere. For a quick test that your setup works, you can use [https://xff.cz/kernels/ megi's pre-built kernels].<br />
<br />
Quick and easy way to get started with kernel development and testing is to use CrystalGamma's Levinboot patched with support for Pinephone Pro and 3-option boot selection using volume keys. [https://xnux.eu/log/#049 You will be able to switch between kernels quickly without swapping uSD cards, which is necessary for painless kernel development experience.]<br />
<br />
1) Create a following partitioning scheme on a uSD card using <code>sfdisk</code>:<br />
<br />
<pre><br />
label: gpt<br />
first-lba: 64<br />
table-length: 8<br />
<br />
start=64, size=8128, type=D7B1F817-AA75-2F4F-830D-84818A145370, name="sd-lboot"<br />
size=60M, type=E5AB07A0-8E5E-46F6-9CE8-41A518929B7C, name="sd-lpayload1"<br />
size=60M, type=5f04b556-c920-4b6d-bd77-804efe6fae01, name="sd-lpayload2"<br />
size=60M, type=c195cc59-d766-4b78-813f-a0e1519099d8, name="sd-lpayload3"<br />
size=14G name="sd-rootfs1"<br />
name="sd-rootfs2"<br />
</pre><br />
<br />
2) Write Levinboot to <code>sd-lboot</code> partition using <code>dd</code>. You can get a pre-built and tested version [https://xff.cz/kernels/pinephone-pro/ here] There are two options <code>levinboot-sd.img</code> and <code>levinboot-emmc.img</code> you can use either one of them for your <code>sd-lboot</code> partition. They differ in where they load the payloads from (either from SD or eMMC) and not in where they can be flashed to. For uSD card only workflow, you'll want <code>levinboot-sd.img</code>.<br />
<br />
3) Prepare payloads for Levinboot and copy them to appropriate partitions. Partition <code>sd-lpayload1</code> is used by default, <code>sd-lpayload2</code> when you hold a volume down key during powerup, and <code>sd-lpayload3</code> when you hold the volume up key.<br />
<br />
Preparing a payload involves getting a TF-A <code>bl31.elf</code> build, kernel <code>Image</code> build, <code>DTB</code> file for Pinephone Pro, and optionally an initramfs archive, modifying DTB to include kernel boot arguments, and compressing these using <code>lz4</code> in specific order, as shown below.<br />
<br />
<pre><br />
BOOTOPTS=(<br />
console=tty1<br />
<br />
earlycon=uart8250,mmio32,0xff1a0000<br />
console=ttyS2,1500000n8<br />
<br />
root=PARTLABEL=emmc-rootfs1<br />
rootfstype=f2fs<br />
rootflags=fastboot<br />
rootwait<br />
rw<br />
<br />
loglevel=7<br />
)<br />
<br />
BOOTOPTS="${BOOTOPTS[@]}"<br />
ALGO="lz4 -zc"<br />
<br />
cp -f rk3399-pinephone-pro.dtb board-cfg.dtb<br />
fdtput -pt s board-cfg.dtb /chosen bootargs "$BOOTOPTS"<br />
<br />
(<br />
$ALGO bl31.elf<br />
$ALGO board-cfg.dtb<br />
$ALGO Image<br />
# $ALGO initramfs.img<br />
) > payload.img<br />
<br />
dd if=payload.img of=/dev/disk/by-partlabel/sd-payload1 bs=4M oflag=direct<br />
</pre><br />
<br />
4) Prepare root filesystem. You can use any Linux distribution for aarch64 for development. For example if you want to use Arch Linux ARM, you would need to format the <code>sd-rootfs1</code> partition with <code>f2fs</code> filesystem and extract the Arch Linux ARM rootfs tarball there. That will give you a bootable SD card image for Pinephone Pro.<br />
<br />
5) Repeat steps 3 and 4 if you want either more kernel payloads, or more Linux distributions on the same uSD card. I recommend having at least some module-less working kernel in <code>sd-payload3</code> and perhaps a small userspace in <code>sd-rootfs1</code> with a pre-configured WiFi connection, that will allow you to always quickly recover if your development kernel fails to boot, just by pressing volume up key during boot and updating the the kernel in one of the primary payload partitions over WiFi.<br />
<br />
== Development discussion ==<br />
<br />
Most of the discussion happens in #pinedev channel on [https://www.pine64.org/web-irc/ Pine64 IRC server]<br />
<br />
[[Category:Pinephone Pro]][[Category:Rockchip RK3399]]</div>Tomhttps://wiki.pine64.org/index.php?title=PinePhone_Pro_Development&diff=11970PinePhone Pro Development2021-12-09T10:02:17Z<p>Tom: /* Upstreaming Status */ Note modem support.</p>
<hr />
<div>This page documents the current status of software support for the [[PinePhone Pro]], and provides links to resources to help prospective contributors get started.<br />
<br />
== Overview ==<br />
<br />
=== Upstreaming Status ===<br />
<br />
{| class="wikitable plainrowheaders" border="1"<br />
! scope="col" | Function<br />
! scope="col" colspan="2" | Status<br />
! scope="col" | Component<br />
! scope="col" | Notes<br />
|-<br />
! scope="row" | Bootloader (u-boot)<br />
| colspan="2" style="background:#FF0; text-align:center;"| Working. Not upstreamed.<br />
|<br />
| https://github.com/dreemurrs-embedded/Pine64-Arch/tree/master/PKGBUILDS/pine64/uboot-pinephonepro uses https://git.sr.ht/~martijnbraam/u-boot.<br />
|-<br />
! scope="row" | Modem<br />
| colspan="2" style="background:#F99; text-align:center;"|Working. Not upstreamed.<br />
| <br />
| Support in https://gitlab.com/mobian1/devices/eg25-manager and Megi's kernel.<br />
|-<br />
! scope="row" | Sound<br />
| colspan="2" style="background:#F99; text-align:center;"|Unimplemented.<br />
|<br />
| See https://github.com/alsa-project/alsa-ucm-conf/issues/125.<br />
|}<br />
<br />
== Current Status ==<br />
<br />
The following sections give an overview over the current status of different parts of the phone. Some parts are waiting on a driver to be written or ported, others only need various adjustments.<br />
<br />
=== Working ===<br />
<br />
TBD<br />
<br />
=== Linux kernel ===<br />
<br />
There's no canonical location for Pinephone Pro Linux kernel development, because Pinephone Pro DT is not mainline, yet. [https://xff.cz/git/linux/log/?h=orange-pi-5.16 megi's kernel tree] is the most complete one, as of November 2021.<br />
<br />
== Levinboot Based Kernel Development Image ==<br />
<br />
This guide will help you get a comfortable environment for testing your kernel builds on Pinephone Pro. It assumes you either already know how to build or cross-build a Linux kernel for arm64, or if you have a way to get a pre-built kernel from somewhere. For a quick test that your setup works, you can use [https://xff.cz/kernels/ megi's pre-built kernels].<br />
<br />
Quick and easy way to get started with kernel development and testing is to use CrystalGamma's Levinboot patched with support for Pinephone Pro and 3-option boot selection using volume keys. [https://xnux.eu/log/#049 You will be able to switch between kernels quickly without swapping uSD cards, which is necessary for painless kernel development experience.]<br />
<br />
1) Create a following partitioning scheme on a uSD card using <code>sfdisk</code>:<br />
<br />
<pre><br />
label: gpt<br />
first-lba: 64<br />
table-length: 8<br />
<br />
start=64, size=8128, type=D7B1F817-AA75-2F4F-830D-84818A145370, name="sd-lboot"<br />
size=60M, type=E5AB07A0-8E5E-46F6-9CE8-41A518929B7C, name="sd-lpayload1"<br />
size=60M, type=5f04b556-c920-4b6d-bd77-804efe6fae01, name="sd-lpayload2"<br />
size=60M, type=c195cc59-d766-4b78-813f-a0e1519099d8, name="sd-lpayload3"<br />
size=14G name="sd-rootfs1"<br />
name="sd-rootfs2"<br />
</pre><br />
<br />
2) Write Levinboot to <code>sd-lboot</code> partition using <code>dd</code>. You can get a pre-built and tested version [https://xff.cz/kernels/pinephone-pro/ here] There are two options <code>levinboot-sd.img</code> and <code>levinboot-emmc.img</code> you can use either one of them for your <code>sd-lboot</code> partition. They differ in where they load the payloads from (either from SD or eMMC) and not in where they can be flashed to. For uSD card only workflow, you'll want <code>levinboot-sd.img</code>.<br />
<br />
3) Prepare payloads for Levinboot and copy them to appropriate partitions. Partition <code>sd-lpayload1</code> is used by default, <code>sd-lpayload2</code> when you hold a volume down key during powerup, and <code>sd-lpayload3</code> when you hold the volume up key.<br />
<br />
Preparing a payload involves getting a TF-A <code>bl31.elf</code> build, kernel <code>Image</code> build, <code>DTB</code> file for Pinephone Pro, and optionally an initramfs archive, modifying DTB to include kernel boot arguments, and compressing these using <code>lz4</code> in specific order, as shown below.<br />
<br />
<pre><br />
BOOTOPTS=(<br />
console=tty1<br />
<br />
earlycon=uart8250,mmio32,0xff1a0000<br />
console=ttyS2,1500000n8<br />
<br />
root=PARTLABEL=emmc-rootfs1<br />
rootfstype=f2fs<br />
rootflags=fastboot<br />
rootwait<br />
rw<br />
<br />
loglevel=7<br />
)<br />
<br />
BOOTOPTS="${BOOTOPTS[@]}"<br />
ALGO="lz4 -zc"<br />
<br />
cp -f rk3399-pinephone-pro.dtb board-cfg.dtb<br />
fdtput -pt s board-cfg.dtb /chosen bootargs "$BOOTOPTS"<br />
<br />
(<br />
$ALGO bl31.elf<br />
$ALGO board-cfg.dtb<br />
$ALGO Image<br />
# $ALGO initramfs.img<br />
) > payload.img<br />
<br />
dd if=payload.img of=/dev/disk/by-partlabel/sd-payload1 bs=4M oflag=direct<br />
</pre><br />
<br />
4) Prepare root filesystem. You can use any Linux distribution for aarch64 for development. For example if you want to use Arch Linux ARM, you would need to format the <code>sd-rootfs1</code> partition with <code>f2fs</code> filesystem and extract the Arch Linux ARM rootfs tarball there. That will give you a bootable SD card image for Pinephone Pro.<br />
<br />
5) Repeat steps 3 and 4 if you want either more kernel payloads, or more Linux distributions on the same uSD card. I recommend having at least some module-less working kernel in <code>sd-payload3</code> and perhaps a small userspace in <code>sd-rootfs1</code> with a pre-configured WiFi connection, that will allow you to always quickly recover if your development kernel fails to boot, just by pressing volume up key during boot and updating the the kernel in one of the primary payload partitions over WiFi.<br />
<br />
== Development discussion ==<br />
<br />
Most of the discussion happens in #pinedev channel on [https://www.pine64.org/web-irc/ Pine64 IRC server]<br />
<br />
[[Category:Pinephone Pro]][[Category:Rockchip RK3399]]</div>Tomhttps://wiki.pine64.org/index.php?title=PinePhone_Pro_Development&diff=11968PinePhone Pro Development2021-12-09T10:00:42Z<p>Tom: /* Upstreaming Status */</p>
<hr />
<div>This page documents the current status of software support for the [[PinePhone Pro]], and provides links to resources to help prospective contributors get started.<br />
<br />
== Overview ==<br />
<br />
=== Upstreaming Status ===<br />
<br />
{| class="wikitable plainrowheaders" border="1"<br />
! scope="col" | Function<br />
! scope="col" colspan="2" | Status<br />
! scope="col" | Component<br />
! scope="col" | Notes<br />
|-<br />
! scope="row" | Bootloader (u-boot)<br />
| colspan="2" style="background:#FF0; text-align:center;"| Working. Not upstreamed.<br />
|<br />
| https://github.com/dreemurrs-embedded/Pine64-Arch/tree/master/PKGBUILDS/pine64/uboot-pinephonepro uses https://git.sr.ht/~martijnbraam/u-boot.<br />
|-<br />
! scope="row" | Sound<br />
| colspan="2" style="background:#F99; text-align:center;"|Unimplemented.<br />
|<br />
| See https://github.com/alsa-project/alsa-ucm-conf/issues/125.<br />
|}<br />
<br />
== Current Status ==<br />
<br />
The following sections give an overview over the current status of different parts of the phone. Some parts are waiting on a driver to be written or ported, others only need various adjustments.<br />
<br />
=== Working ===<br />
<br />
TBD<br />
<br />
=== Linux kernel ===<br />
<br />
There's no canonical location for Pinephone Pro Linux kernel development, because Pinephone Pro DT is not mainline, yet. [https://xff.cz/git/linux/log/?h=orange-pi-5.16 megi's kernel tree] is the most complete one, as of November 2021.<br />
<br />
== Levinboot Based Kernel Development Image ==<br />
<br />
This guide will help you get a comfortable environment for testing your kernel builds on Pinephone Pro. It assumes you either already know how to build or cross-build a Linux kernel for arm64, or if you have a way to get a pre-built kernel from somewhere. For a quick test that your setup works, you can use [https://xff.cz/kernels/ megi's pre-built kernels].<br />
<br />
Quick and easy way to get started with kernel development and testing is to use CrystalGamma's Levinboot patched with support for Pinephone Pro and 3-option boot selection using volume keys. [https://xnux.eu/log/#049 You will be able to switch between kernels quickly without swapping uSD cards, which is necessary for painless kernel development experience.]<br />
<br />
1) Create a following partitioning scheme on a uSD card using <code>sfdisk</code>:<br />
<br />
<pre><br />
label: gpt<br />
first-lba: 64<br />
table-length: 8<br />
<br />
start=64, size=8128, type=D7B1F817-AA75-2F4F-830D-84818A145370, name="sd-lboot"<br />
size=60M, type=E5AB07A0-8E5E-46F6-9CE8-41A518929B7C, name="sd-lpayload1"<br />
size=60M, type=5f04b556-c920-4b6d-bd77-804efe6fae01, name="sd-lpayload2"<br />
size=60M, type=c195cc59-d766-4b78-813f-a0e1519099d8, name="sd-lpayload3"<br />
size=14G name="sd-rootfs1"<br />
name="sd-rootfs2"<br />
</pre><br />
<br />
2) Write Levinboot to <code>sd-lboot</code> partition using <code>dd</code>. You can get a pre-built and tested version [https://xff.cz/kernels/pinephone-pro/ here] There are two options <code>levinboot-sd.img</code> and <code>levinboot-emmc.img</code> you can use either one of them for your <code>sd-lboot</code> partition. They differ in where they load the payloads from (either from SD or eMMC) and not in where they can be flashed to. For uSD card only workflow, you'll want <code>levinboot-sd.img</code>.<br />
<br />
3) Prepare payloads for Levinboot and copy them to appropriate partitions. Partition <code>sd-lpayload1</code> is used by default, <code>sd-lpayload2</code> when you hold a volume down key during powerup, and <code>sd-lpayload3</code> when you hold the volume up key.<br />
<br />
Preparing a payload involves getting a TF-A <code>bl31.elf</code> build, kernel <code>Image</code> build, <code>DTB</code> file for Pinephone Pro, and optionally an initramfs archive, modifying DTB to include kernel boot arguments, and compressing these using <code>lz4</code> in specific order, as shown below.<br />
<br />
<pre><br />
BOOTOPTS=(<br />
console=tty1<br />
<br />
earlycon=uart8250,mmio32,0xff1a0000<br />
console=ttyS2,1500000n8<br />
<br />
root=PARTLABEL=emmc-rootfs1<br />
rootfstype=f2fs<br />
rootflags=fastboot<br />
rootwait<br />
rw<br />
<br />
loglevel=7<br />
)<br />
<br />
BOOTOPTS="${BOOTOPTS[@]}"<br />
ALGO="lz4 -zc"<br />
<br />
cp -f rk3399-pinephone-pro.dtb board-cfg.dtb<br />
fdtput -pt s board-cfg.dtb /chosen bootargs "$BOOTOPTS"<br />
<br />
(<br />
$ALGO bl31.elf<br />
$ALGO board-cfg.dtb<br />
$ALGO Image<br />
# $ALGO initramfs.img<br />
) > payload.img<br />
<br />
dd if=payload.img of=/dev/disk/by-partlabel/sd-payload1 bs=4M oflag=direct<br />
</pre><br />
<br />
4) Prepare root filesystem. You can use any Linux distribution for aarch64 for development. For example if you want to use Arch Linux ARM, you would need to format the <code>sd-rootfs1</code> partition with <code>f2fs</code> filesystem and extract the Arch Linux ARM rootfs tarball there. That will give you a bootable SD card image for Pinephone Pro.<br />
<br />
5) Repeat steps 3 and 4 if you want either more kernel payloads, or more Linux distributions on the same uSD card. I recommend having at least some module-less working kernel in <code>sd-payload3</code> and perhaps a small userspace in <code>sd-rootfs1</code> with a pre-configured WiFi connection, that will allow you to always quickly recover if your development kernel fails to boot, just by pressing volume up key during boot and updating the the kernel in one of the primary payload partitions over WiFi.<br />
<br />
== Development discussion ==<br />
<br />
Most of the discussion happens in #pinedev channel on [https://www.pine64.org/web-irc/ Pine64 IRC server]<br />
<br />
[[Category:Pinephone Pro]][[Category:Rockchip RK3399]]</div>Tomhttps://wiki.pine64.org/index.php?title=PinePhone_Pro_Development&diff=11967PinePhone Pro Development2021-12-09T09:53:46Z<p>Tom: /* Upstreaming Status */ Note sound support.</p>
<hr />
<div>This page documents the current status of software support for the [[PinePhone Pro]], and provides links to resources to help prospective contributors get started.<br />
<br />
== Overview ==<br />
<br />
=== Upstreaming Status ===<br />
<br />
{| class="wikitable plainrowheaders" border="1"<br />
! scope="col" | Function<br />
! scope="col" colspan="2" | Status<br />
! scope="col" | Component<br />
! scope="col" | Notes<br />
|-<br />
! scope="row" | Sound<br />
| colspan="2" style="background:#F99; text-align:center;"|Unimplemented.<br />
|<br />
| See https://github.com/alsa-project/alsa-ucm-conf/issues/125.<br />
|}<br />
<br />
== Current Status ==<br />
<br />
The following sections give an overview over the current status of different parts of the phone. Some parts are waiting on a driver to be written or ported, others only need various adjustments.<br />
<br />
=== Working ===<br />
<br />
TBD<br />
<br />
=== Linux kernel ===<br />
<br />
There's no canonical location for Pinephone Pro Linux kernel development, because Pinephone Pro DT is not mainline, yet. [https://xff.cz/git/linux/log/?h=orange-pi-5.16 megi's kernel tree] is the most complete one, as of November 2021.<br />
<br />
== Levinboot Based Kernel Development Image ==<br />
<br />
This guide will help you get a comfortable environment for testing your kernel builds on Pinephone Pro. It assumes you either already know how to build or cross-build a Linux kernel for arm64, or if you have a way to get a pre-built kernel from somewhere. For a quick test that your setup works, you can use [https://xff.cz/kernels/ megi's pre-built kernels].<br />
<br />
Quick and easy way to get started with kernel development and testing is to use CrystalGamma's Levinboot patched with support for Pinephone Pro and 3-option boot selection using volume keys. [https://xnux.eu/log/#049 You will be able to switch between kernels quickly without swapping uSD cards, which is necessary for painless kernel development experience.]<br />
<br />
1) Create a following partitioning scheme on a uSD card using <code>sfdisk</code>:<br />
<br />
<pre><br />
label: gpt<br />
first-lba: 64<br />
table-length: 8<br />
<br />
start=64, size=8128, type=D7B1F817-AA75-2F4F-830D-84818A145370, name="sd-lboot"<br />
size=60M, type=E5AB07A0-8E5E-46F6-9CE8-41A518929B7C, name="sd-lpayload1"<br />
size=60M, type=5f04b556-c920-4b6d-bd77-804efe6fae01, name="sd-lpayload2"<br />
size=60M, type=c195cc59-d766-4b78-813f-a0e1519099d8, name="sd-lpayload3"<br />
size=14G name="sd-rootfs1"<br />
name="sd-rootfs2"<br />
</pre><br />
<br />
2) Write Levinboot to <code>sd-lboot</code> partition using <code>dd</code>. You can get a pre-built and tested version [https://xff.cz/kernels/pinephone-pro/ here] There are two options <code>levinboot-sd.img</code> and <code>levinboot-emmc.img</code> you can use either one of them for your <code>sd-lboot</code> partition. They differ in where they load the payloads from (either from SD or eMMC) and not in where they can be flashed to. For uSD card only workflow, you'll want <code>levinboot-sd.img</code>.<br />
<br />
3) Prepare payloads for Levinboot and copy them to appropriate partitions. Partition <code>sd-lpayload1</code> is used by default, <code>sd-lpayload2</code> when you hold a volume down key during powerup, and <code>sd-lpayload3</code> when you hold the volume up key.<br />
<br />
Preparing a payload involves getting a TF-A <code>bl31.elf</code> build, kernel <code>Image</code> build, <code>DTB</code> file for Pinephone Pro, and optionally an initramfs archive, modifying DTB to include kernel boot arguments, and compressing these using <code>lz4</code> in specific order, as shown below.<br />
<br />
<pre><br />
BOOTOPTS=(<br />
console=tty1<br />
<br />
earlycon=uart8250,mmio32,0xff1a0000<br />
console=ttyS2,1500000n8<br />
<br />
root=PARTLABEL=emmc-rootfs1<br />
rootfstype=f2fs<br />
rootflags=fastboot<br />
rootwait<br />
rw<br />
<br />
loglevel=7<br />
)<br />
<br />
BOOTOPTS="${BOOTOPTS[@]}"<br />
ALGO="lz4 -zc"<br />
<br />
cp -f rk3399-pinephone-pro.dtb board-cfg.dtb<br />
fdtput -pt s board-cfg.dtb /chosen bootargs "$BOOTOPTS"<br />
<br />
(<br />
$ALGO bl31.elf<br />
$ALGO board-cfg.dtb<br />
$ALGO Image<br />
# $ALGO initramfs.img<br />
) > payload.img<br />
<br />
dd if=payload.img of=/dev/disk/by-partlabel/sd-payload1 bs=4M oflag=direct<br />
</pre><br />
<br />
4) Prepare root filesystem. You can use any Linux distribution for aarch64 for development. For example if you want to use Arch Linux ARM, you would need to format the <code>sd-rootfs1</code> partition with <code>f2fs</code> filesystem and extract the Arch Linux ARM rootfs tarball there. That will give you a bootable SD card image for Pinephone Pro.<br />
<br />
5) Repeat steps 3 and 4 if you want either more kernel payloads, or more Linux distributions on the same uSD card. I recommend having at least some module-less working kernel in <code>sd-payload3</code> and perhaps a small userspace in <code>sd-rootfs1</code> with a pre-configured WiFi connection, that will allow you to always quickly recover if your development kernel fails to boot, just by pressing volume up key during boot and updating the the kernel in one of the primary payload partitions over WiFi.<br />
<br />
== Development discussion ==<br />
<br />
Most of the discussion happens in #pinedev channel on [https://www.pine64.org/web-irc/ Pine64 IRC server]<br />
<br />
[[Category:Pinephone Pro]][[Category:Rockchip RK3399]]</div>Tomhttps://wiki.pine64.org/index.php?title=PinePhone_Pro_Developer_Edition&diff=11966PinePhone Pro Developer Edition2021-12-09T09:43:14Z<p>Tom: /* Introduction */ Note that Developer Editions come in a "Explorer Edition" box.</p>
<hr />
<div><br />
= Introduction =<br />
The Developer Edition was the first edition of the PinePhone Pro, shipped to developers in December 2021. The aim of the the Developer Edition was to give development community access to the hardware prior to end-users, boost development efforts and allow for porting of existing mobile Linux operating systems to the new hardware. <br />
It featured the same mainboard revision as the Explorer Edition that followed in early 2022, and came in a box that was labelled "Explorer Edition".<br />
<br />
= Getting started = <br />
This post is aimed strictly at developers receiving their PinePhone Pro dev units. Please note that the following instructions do not apply to Explorer Edition or other future editions of the PinePhone Pro - everything below is only pertinent to the dev phones. <br />
<br />
Consider this a crash course rather than a comprehensive overview; you are also welcome to participate in documenting the process (and everything else related to the PinePhone Pro) on the Wiki. You can either create a Wiki account or use your [forum.pine64.org PINE64 forum] credentials to log in. <br />
<br />
== Getting the hardware ready ==<br />
After unpacking the PinePhone Pro from its box, detach the back cover (looking at the back of the phone, there is a fingernail notch on the left leading edge) and remove the plastic tab between the battery and mainboard. You can also flip the headphone jack privacy switch at this point - this enables UART output via the headphone jack. Serial console works the [https://wiki.pine64.org/wiki/PinePhone#Serial_console same way as on the original PinePhone.] <br />
<br />
= Factory hardware test image =<br />
<br />
The PinePhone Pro developer edition ships with a BSP AOSP factory image flashed to the eMMC. This image includes a number of factory applications meant to validate operation of the sensors, the modem, cameras, LCD & touch panel, etc. You’ll have to nuke the AOSP build to run a Linux installation on the PinePhone Pro. Booting from SD with the AOSP factory build present on eMMC is not possible due to the SoCs native boot order. <br />
<br />
== Nuking the factory AOSP installation ==<br />
In the factory test image, navigate to setting (gear icon) > at the very bottom of the settings list you will find a phone icon with rk3999mid written underneath it > tap the last (bottom) setting 7 times in quick succession. Following this, you *may* need to do the following: open the Settings application and enable USB debugging in Settings > System > Developer Options > USB debugging. Then connect the PinePhone Pro to your PC with the supplied USB-C cable. <br />
<br />
Please note: It is recommended to charge the device to at least 50% before proceeding with wiping the eMMC. <br />
<br />
Note: You may have gotten a Chinese factory image; in the settings menu you can change the language to english by selecting the gray info icon (系统, one from bottom), then the first option (语言..), and again the first option (also 语言), then press +, English and drag it to the top of the list).<br />
<br />
Connect the phone to your computer and check <code>adb devices</code> in the terminal. The phone should be registered as attached. If the device doesn't show you may want to try a different port or cable. Then enter <code>adb shell</code> followed by <code>su</code> to gain root access. At this point you can erase the eMMC installation: <br />
<br />
<code>cat /dev/zero > /dev/block/mmcblk1</code><br />
<br />
The phone will freeze and then the screen will go blank. Let it sit for no less than 10 minutes and then power it off by holding down the power button. You’ll know the phone is powered down when the notification LED turns off.<br />
<br />
== Flashing Linux ==<br />
You will want to do all your testing and development on a SD card; you DO NOT want to flash an OS to eMMC at this time. Builds frequently break at this early development stage and recovering from a corrupted eMMC installation is presently time consuming and tedious. A fast 16-64GB micro SD card for $15 will work just fine. <br />
<br />
There are a handful of OS builds available for the PinePhone Pro already. These can be found under the [https://wiki.pine64.org/wiki/PinePhone_Pro#Software_releases Software Releases] Wiki section.<br />
<br />
If you are a developer porting your own distribution to the PinePhone Pro, please make sure to make an entry for it in the Software Releases section on the Wiki. If you want / need help with entering your build onto the Wiki please ping one of the mods or admins in the chats (see Forums and Chats drop-down menu).<br />
<br />
= Resources =<br />
Aside from the PINE64 Wiki there are also other useful resources scattered across different Wikis, repositories and blogs. In time these will be gathered into one place - the [https://gitlab.com/mobian1/devices/eg25-manager/-/merge_requests/41#note_744117720 DevZone] - which will help to streamline the development process. <br />
<br />
At the time of publishing, these are *some* of the notable resource, listed in no particular order: <br />
<br />
*[https://wiki.postmarketos.org/wiki/PINE64_PinePhone_Pro_(pine64-pinephonepro) postmarketOS Wiki] <br />
*[https://xnux.eu/log/ Megi’s (b)log] <br />
*[https://github.com/dreemurrs-embedded/Pine64-Arch/ DanctNIX repository]<br />
*[https://github.com/manjaro-pinephone Manjaro repository]<br />
<br />
= Development and discussion =<br />
You will run into issues, there’s just no way around it, and doing it ‘on your own’ isn’t really a viable option since you’re one of the first people to hold a PinePhone Pro. The development process on a device such as this is a collaborative process, and I therefore encourage you to participate in the community. There are many ways to interact with other developers, including [https://matrix.to/#/!LZirCxnkkeBudrQzPj:matrix.org?via=matrix.org Matrix], [https://t.me/pinephone Telegram], [https://discord.gg/pine64 Discord] and IRC. <br />
<br />
There is also a lesser known chat for developers only. Lesser known doesn’t mean top secret, but I will not be posting a link to it here to keep the number of non-dev participants to a minimum. If you join one of the general chats and let others know you received a dev phone, then I’m sure someone will point you in the right direction.</div>Tomhttps://wiki.pine64.org/index.php?title=PinePhone_Pro&diff=11965PinePhone Pro2021-12-09T09:35:50Z<p>Tom: /* Software releases */ Link to the NixOS's bug tracker.</p>
<hr />
<div>[[File:Pinephone_double.png|400px|thumb|right|Rendering of the PinePhone Pro]]<br />
<br />
The '''PinePhone Pro''' is PINE64's flagship smartphone announced on October 15, 2021. It features 4GB of RAM, an 128GB eMMC and is using an Rockchip RK3399S SoC, which is a specialized version of the RK3399 made specifically for the PinePhone Pro.<br />
<br />
== Introduction ==<br />
<br />
The PinePhone Pro is PINE64’s second Linux-only smartphone and a successor to the original PinePhone. It does not, however, replace the original PinePhone. It should also not be considered a second generation PinePhone; it is a higher-end device, with much better specs, aimed at those who wish to daily-drive a fully open Linux Stack. Achieving this goal will, however, take time as the software and overall Linux smartphone ecosystem needs to mature. <br />
<br />
More information about the PinePhone Pro can be found on the device [https://www.pine64.org/pinephonepro/ main page]. <br />
<br />
=== State of the software ===<br />
<br />
Presently, at the time of writing (late 2021), the PinePhone Pro is aimed solely at early adopters and developers. It will take time for all the PinePhone Pro’s functionality to reach software parity with the original PinePhone and for mobile Linux, in more general, to reach a higher degree of maturity. <br />
<br />
Bear in mind that the software for Linux smartphones is still in a very early stage, with most of the software being in alpha or beta state. That's especially also the case for scalability of applications, their availability and practicability, any hardware function implementations and the firmware. The software is provided as is. There is no warranty for the software, not even for merchantability or fitness for a particular purpose.<br />
<br />
If you have any questions regarding the current state of the software or of specific features working, please don't hesitate to ask in the community chat (see [[Main Page#Community and Support]])!<br />
<br />
=== Editions and revisions ===<br />
Similarly to the original PinePhone, various PinePhone Pro editions are planned, the first of which is the Developer Edition (aimed at developers, as the name entails) followed by the Explorer Edition, which is aimed at early adopters. <br />
<br />
*[https://wiki.pine64.org/wiki/PinePhone_Pro_Developer_Edition Developer Edition] <br />
*Explorer Edition<br />
<br />
=== Help and support ===<br />
<br />
Still have any questions regarding software, shipping, or ordering after reading this Wiki? Please don't hesitate to contact the community in the bridged community channels for detailed answers or simply to chat with friendly people in the community! See [[Main Page#Community and Support]].<br />
<br />
Please keep in mind that PINE64 is not like a regular company (see [https://www.pine64.org/philosophy/ PINE64 philosophy]), and currently that support resources are sparse - the best way to get support quickly is to ask in the community chat! Please only contact PINE64 directly if questions couldn't be solved via the community chat or this wiki.<br />
<br />
== First time setup ==<br />
<br />
{{Hint|Do not insert an empty micro SIM adapter into the phone, as it will get stuck on the contact pins.}}<br />
<br />
When shipped the battery is isolated from the mainboard contacts using a protective plastic tab, which is required to be removed before using the phone. The battery '''will not''' charge until it is removed and some of the device’s functionality may not function properly.<br />
<br />
The PinePhone Pro's SIM slot only accepts a micro SIM, please do not insert a nano SIM without an adapter. The SIM card has to be placed in the lower slot, while the microSD has to be placed in the upper slot. Notice: Do not insert an empty micro SIM adapter into the phone, as it will get stuck on the contact pins. An adapter from a nano to a micro SIM is included in the box. <br />
<br />
To remove the sticker after unboxing the phone:<br />
<br />
# Carefully remove the back panel using the notch in the corner of the back cover without overbending it<br />
# Remove the battery (if the battery is stuck in the device please check [[PinePhone_FAQ#The_battery_is_stuck_inside_the_phone|this]] paragraph for a fix)<br />
# Peel off the clear plastic sticker below it, which isolates the charging contacts<br />
# Reinsert the battery<br />
<br />
<gallery mode="nolines" widths="400px" heights="400px"><br />
Image:Pinephone_warning.png|A protection foil isolates the battery for the shipping.<br />
Image:Pinephone_backside.png|The microSD belongs in the upper slot, the micro SIM in the lower slot.<br />
</gallery><br />
<br />
<br />
== Software ==<br />
<br />
At the time of the release, in late 2020, the PinePhone Pro is in an early development stage. That said, the device has benefited greatly from work done on the original PinePhone, which means that even early development images feature all core functionality, such as: functional UI, sensors and even the modem (to a degree). <br />
<br />
The development is expected to proceed very quickly compared to progress done on the original PinePhone as much of the fundamental work can carry over to the new device. <br />
You can follow development efforts on [https://xnux.eu/log/ Megi's blog], the dedicated [[PinePhone Pro Development]] section as well as on individual project’s Wiki’s and repositories. <br />
<br />
=== Software releases ===<br />
{{Hint|Developers, please add links to OS images, repositories or build instructions here.}}<br />
<br />
==== Arch Linux ARM ====<br />
[[File:Archlinux-logo.png|right|100px]]<br />
<br />
(Unofficial) Arch Linux ARM with choice of Phosh UI, Plasma Mobile, sxmo or barebones.<br />
Currently being maintained by the [https://danctnix.org/ DanctNIX] community (GitHub: [https://github.com/DanctNIX/danctnix danctnix], [https://github.com/dreemurrs-embedded dreemurrs-embedded]).<br />
<br />
* GitHub: [https://github.com/dreemurrs-embedded/Pine64-Arch/ dreemurrs-embedded/Pine64-Arch]<br />
<br />
'''Download location'''<br />
<br />
Get both stable and test builds at [https://github.com/dreemurrs-embedded/Pine64-Arch/releases GitHub releases].<br />
<br />
'''username/password'''<br />
<br />
{| class="wikitable"<br />
! Default user<br />
| <code>alarm/123456</code><br />
|-<br />
! root<br />
| <code>root/root</code><br />
|}<br />
<br />
==== Manjaro ARM ====<br />
[[File:Manjaro-logo.svg|right|100px]]<br />
<br />
Manjaro is a user-friendly Linux distribution based on the independently developed Arch operating system with the Plasma Mobile desktop environment.<br />
<br />
'''Download location'''<br />
<br />
* Phosh: [https://github.com/manjaro-pinephone/phosh-dev/releases Dev] <br />
* Plasma Mobile: [https://github.com/manjaro-pinephone/plasma-mobile-dev/releases Dev]<br />
<br />
'''username/password'''<br />
<br />
{| class="wikitable"<br />
! Default user<br />
| <code>manjaro/123456</code><br />
|-<br />
! root<br />
| <code>root/root</code><br />
|}<br />
<br />
==== postmarketOS ====<br />
[[File:PostmarketOS-logo.png|right|100px]]<br />
<br />
postmarketOS extends [https://www.alpinelinux.org/ Alpine Linux] to run on smartphones and other mobile devices.<br />
It offers various user interfaces (Phosh, Plasma Mobile, Sxmo, Plasma Desktop, Gnome 3, Kodi, XFCE4, ...).<br />
<br />
Official images for the PinePhone Pro will be available once it is in the "community" category of devices. Until then, build your own image with pmbootstrap.<br />
<br />
See the [https://wiki.postmarketos.org/wiki/PINE64_PinePhone_Pro_(pine64-pinephonepro) pine64-pinephonepro] page of the postmarketOS wiki for details.<br />
<br />
==== NixOS ====<br />
WIP. See https://github.com/NixOS/mobile-nixos/issues/440.<br />
<br />
=== Boot order ===<br />
<br />
On the PinePhone Pro the eMMC (the internal storage of the phone) has a higher boot priority than the microSD card (see [[RK3399 boot sequence#Boot sequence details]] for details regarding the boot sequence). That behavior is in contrast to the original PinePhone with the Allwinner A64 SoC, where the microSD card has a higher boot priority.<br />
<br />
What this means: For the PinePhone Pro this means, that inserting a flashed microSD card to boot a new installation is not sufficient to boot a microSD card if there is already a valid installation of a bootloader on the eMMC present. The boot order behavior can be altered non-permanently by various way, for example by either not having a bootloader installed to the eMMC or by pointing the bootloader installed on the eMMC to the installation on the microSD card.<br />
<br />
=== Installation instructions ===<br />
<br />
Due to the above explained [[PinePhone Pro#Boot order|boot order]] of the PinePhone Pro, the eMMC has a higher boot priority than the microSD card and the user has to consider this behavior. This means that you cannot boot from a SD card with an OS present on the device's eMMC. <br />
<br />
{{Template:note|If you ordered a PinePhone Pro Developer Edition intended for developing and coming with an Android factory OS preinstalled, please see [[PinePhone Pro Developer Edition#Nuking the factory AOSP installation]] to learn how to remove the bootloader and the preinstalled OS of the eMMC, to be able to boot and test operating systems from the microSD card easily.<br />
}}<br />
<br />
That said, booting from SD can be achieved using a modified u-boot (or a different bootloader) on eMMC, which seeks out a bootable partition on SD first. At the time of writing, this hasn’t been achieved yet but is a planned feature.<br />
<br />
It is strongly recommended you perform all testing from a SD card, leaving the eMMC vacant.<br />
<br />
== Specifications ==<br />
<br />
* '''Dimensions:''' 160.8 x 76.6 x 11.1mm<br />
* '''Weight:''' Approx. 220g<br />
* '''SIM Card:''' Micro-SIM<br />
* '''Display:'''<br />
** '''Size:''' 6 inches (151mm) diagonal<br />
** '''Type:''' 1440 x 720 in-cell IPS with Gorilla Glass 4™<br />
** '''Resolution:''' 1440x720, 18:9 ratio<br />
* '''System on Chip:''' Rockchip RK3399S 64bit SoC – 2x A72 and 4x A53 CPU cores @ 1.5GHz<br />
* '''RAM:''' 4GB LPDDR4 @ 800MHz<br />
* '''Internal Storage:''' 128GB eMMC, extendable up to 2TB via microSD, supports SDHC and SDXC<br />
* '''Back [[#Camera|Camera]]:''' 13MP Sony IMX258 with Gorilla Glass 4™ protective layer, LED Flash<br />
* '''Front Camera:''' 5MP OmniVision OV5640 front-facing camera<br />
* '''Sound:''' Loudspeaker, 3.5mm jack & mic (jack doubles as hardware UART if hardware switch 6 is deactivated)<br />
* '''Communication:'''<br />
** '''[[#Modem|Modem]]:''' [https://www.quectel.com/product/lte-eg25-g/ Quectel EG25-G]<br />
** '''LTE-FDD''': B1, B2, B3, B4, B5, B7, B8, B12, B13, B18, B19, B20, B25, B26, B28<br />
** '''LTE-TDD''': B38, B39, B40, B41<br />
** '''WCDMA''': B1, B2, B4, B5, B6, B8, B19<br />
** '''GSM''': B2, B3, B5, B8 (850, 900, 1800, 1900 MHz)<br />
** '''WLAN & Bluetooth:''' AMPAK AP6255 WiFi 11ac + Bluetooth V4.1<br />
** '''GNSS:''' GPS/GLONASS/BeiDou/Galileo/QZSS, with A-GPS<br />
* '''Sensors:''' Accelerometer, gyroscope, proximity, ambient light, compass<br />
* '''Privacy switches:''' Modem, WiFi & Bluetooth, Microphone, Cameras<br />
* '''[[#Battery|Battery]]:''' Lithium-ion, rated capacity 2800mAh (10.64Wh), typical capacity 3000mAh (11.40Wh) (nominally replaceable with any Samsung J7 form-factor battery)<br />
* '''I/O:''' USB Type-C, USB Host, DisplayPort Alternate Mode output, 15W 5V 3A Quick Charge, follows USB PD specification<br />
<br />
<br />
<br />
== Privacy switch configuration ==<br />
<br />
[[File:PinePhone Kill Interruptors de Maquinari del PinePhone 4529.jpg|320px|thumb|right|Detail of DIP switch]]<br />
<br />
The PinePhone features six switches that can be used to configure its hardware. They are numbered 1-6, with switch 1 located nearest to the modem. Their "on" position is toward the top of the phone.<br />
<br />
{| class="wikitable"<br />
|-<br />
! Number<br />
! Name<br />
! Description<br />
|-<br />
| 1<br />
| Modem<br />
| "On" enables 2G/3G/4G communication and GNSS hardware, "off" disables it.<br />
|-<br />
| 2<br />
| WiFi / Bluetooth<br />
| "On" enables WiFi and Bluetooth communication hardware, "off" disables it.<br />
|-<br />
| 3<br />
| Microphone<br />
| "On" enables audio input from on-board microphones (not 3.5 mm jack), "off" disables it.<br />
|-<br />
| 4<br />
| Rear camera<br />
| "On" enables the rear camera, "off" disables it.<br />
|-<br />
| 5<br />
| Front camera<br />
| "On" enables the front camera, "off" disables it.<br />
|-<br />
| 6<br />
| Headphone<br />
| "On" enables audio input and output via the 3.5 mm audio jack, "off" switches the jack to hardware UART mode.<br />
|}<br />
<br />
== PinePhone board information, schematics and certifications ==<br />
<br />
== Datasheets for components and peripherals ==<br />
<br />
== Press ==<br />
<br />
For an overview about media of the PinePhone Pro you can use for the news, blogs, or similar see [[PinePhone Pro Press]].<br />
<br />
== External links ==<br />
* [https://www.pine64.org/pinephonepro/ Product Page]<br />
* [https://www.youtube.com/watch?v=wP2-6Z74W44 Announcement video]<br />
* [https://www.pine64.org/2021/10/15/october-update-introducing-the-pinephone-pro/ Blog post] with the announcement<br />
<br />
<br />
[[Category:PinePhone]] [[Category:PinePhone Pro]] [[Category:Rockchip RK3399]]</div>Tomhttps://wiki.pine64.org/index.php?title=PinePhone&diff=11856PinePhone2021-11-24T17:57:52Z<p>Tom: /* Developer works */</p>
<hr />
<div>[[File:PinePhone Beta Edition.png|400px|thumb|right|Rendering of the PinePhone Beta Edition]]<br />
<br />
The '''PinePhone''' is a smartphone created by PINE64. It is capable of running mainline Linux and is supported by many partner projects.<br />
<br />
The Braveheart Edition of the PinePhone was the first publicly available version of the phone. It shipped without a fully functional operating system and was geared specifically towards early adopters. The Braveheart Edition's successors were the Community Editions, which featured a branded backcover and box of selected community projects. The Community Editions became available in June 2020. The Beta Edition featuring Manjaro with Plasma Mobile is the latest edition, it became available in March 2021.<br />
<br />
== Introduction ==<br />
<br />
The PinePhone is not a regular phone and you might not get the latest and greatest hardware and this years' newest innovation. You will get a device with good mainline support with a great community behind it.<br />
<br />
=== State of the software ===<br />
<br />
First things first, the PinePhone is aimed solely at early adopters - more specifically, the units are solely intended to find their way into the hands of users with extensive Linux experience.<br />
<br />
Bear in mind that the software for Linux on phones is very early, with most of the software being in alpha or beta state. That's especially also the case for scalability of applications, their availability and practicability, any hardware function implementations and the firmware. The software is provided as is. There is no warranty for the software, not even for merchantability or fitness for a particular purpose.<br />
<br />
If you have any questions regarding the current state of the software or of specific features working, please don't hesitate to ask in the community chat (see [[Main Page#Community and Support]])!<br />
<br />
=== Help and support ===<br />
<br />
Still have any questions regarding software, shipping, or ordering after reading this wiki? Please don't hesitate to contact the community in the bridged community channels for detailed answers or simply to chat with friendly people in the community! See [[Main Page#Community and Support]]. <br />
<br />
Please keep in mind that PINE64 is not like a regular company (see [https://www.pine64.org/philosophy/ PINE64 philosophy]), and currently that support resources are sparse - the best way to get support quickly is to ask in the community chat! Please only contact PINE64 directly if questions couldn't be solved via the community chat or this wiki.<br />
<br />
== First time installation ==<br />
<br />
{{Hint|Do not insert an empty micro SIM adapter into the phone, as it will get stuck on the contact pins.}}<br />
<br />
When shipped the battery is isolated from the device using a protective plastic tab, which is required to be removed before using the phone. The battery '''will not''' charge until this is removed and the modem, WiFi and Bluetooth will not work until the battery is connected.<br />
<br />
The PinePhone's SIM slot only accepts a micro SIM, please do not insert a nano SIM without an adapter. The SIM card has to be placed in the lower slot, while the microSD has to be placed in the upper slot. Notice: Do not insert an empty micro SIM adapter into the phone, as it will get stuck on the contact pins.<br />
<br />
An adapter from a nano to a micro SIM might be included under tape in the camera notch of the phone's packaging. Some nano SIMs will not fit firmly into that adapter that comes with the PinePhone and if the included adapter is used without a well-fitting nano SIM, the contact pins might get damaged. In that case it is highly recommended to acquire a better fitting adapter.<br />
<br />
To remove the sticker after unboxing the phone:<br />
<br />
# Carefully remove the back panel using the notch in the corner of the back cover without overbending it<br />
# Remove the battery (if the battery is stuck in the device please check [[PinePhone_FAQ#The_battery_is_stuck_inside_the_phone|this]] paragraph for a fix)<br />
# Peel off the clear plastic sticker below it, which isolates the charging contacts<br />
# Reinsert the battery<br />
<br />
<gallery mode="nolines" widths="400px" heights="400px"><br />
Image:Pinephone_warning.png|A protection foil isolates the battery for the shipping.<br />
Image:Pinephone_backside.png|The microSD belongs in the upper slot, the micro SIM in the lower slot.<br />
</gallery><br />
<br />
== Operating systems ==<br />
<br />
The PinePhone will automatically boot from microSD if a bootable card is inserted. Although it is technically possible to use any ARM distribution (because the PinePhone uses the mainline kernel), there are a few that are designed specifically for mobile use on devices like the PinePhone.<br />
<br />
=== Software releases ===<br />
<br />
The [[PinePhone Software Releases]] page has a complete list of currently supported phone-optimized Operating System images that work with the PinePhone as well as other related software information. As soon as more patches get mainlined and distributions ship with the updated kernel, they will also be able to run unmodified on the device. To update any installed operating system please see [[PinePhone Updating Instructions]].<br />
<br />
=== Installation instructions ===<br />
<br />
For instructions on how to install the operating systems to the eMMC or SD card see [[PinePhone Installation Instructions]].<br />
<br />
Relevant subsections of the article for installing OSes to the PinePhone are:<br />
<br />
* [[PinePhone Installation Instructions#Boot_priority|Boot priority]]<br />
* [[PinePhone Installation Instructions#Installation_to_the_microSD|Installation to the microSD]]<br />
* [[PinePhone Installation Instructions#Installation_to_the_eMMC|Installation to the eMMC]]<br />
* [[PinePhone Installation Instructions#Resize_partition_to_fit_disk_space|Resize partition to fit disk space]]<br />
* [[PinePhone Installation Instructions#Reuse_SD_card_for_data_storage_on_system_booting_from_eMMC|Reuse SD card for data storage on system booting from eMMC]]<br />
<br />
== Specifications ==<br />
<br />
* '''Dimensions:''' 160.5 x 76.6 x 9.2mm<br />
* '''Weight:''' Between 180 ~ 200 grams<br />
* '''SIM Card:''' Micro-SIM<br />
* '''Display:'''<br />
** '''Size:''' 5.95 inches (151mm) diagonal<br />
** '''Type:''' HD IPS capacitive touchscreen, 16M colors<br />
** '''Resolution:''' 1440x720, 18:9 ratio<br />
* '''System on Chip:''' [https://linux-sunxi.org/A64 Allwinner A64]<br />
* '''RAM:''' 2GB or 3GB LPDDR3 SDRAM<br />
* '''Internal Storage:''' 16GB or 32GB eMMC, extendable up to 2TB via microSD, supports SDHC and SDXC<br />
* '''Back [[#Camera|Camera]]:''' Single 5MP, 1/4", LED Flash<br />
* '''Front Camera:''' Single 2MP, f/2.8, 1/5"<br />
* '''Sound:''' Loudspeaker, 3.5mm jack & mic (jack doubles as hardware UART if hardware switch 6 is deactivated)<br />
* '''Communication:'''<br />
** '''[[#Modem|Modem]]:''' [https://www.quectel.com/product/lte-eg25-g/ Quectel EG25-G]<br />
** '''LTE-FDD''': B1, B2, B3, B4, B5, B7, B8, B12, B13, B18, B19, B20, B25, B26, B28<br />
** '''LTE-TDD''': B38, B39, B40, B41<br />
** '''WCDMA''': B1, B2, B4, B5, B6, B8, B19<br />
** '''GSM''': B2, B3, B5, B8 (850, 900, 1800, 1900 MHz)<br />
** '''WLAN:''' Wi-Fi 802.11 b/g/n, single-band, hotspot<br />
** '''Bluetooth:''' 4.0, A2DP<br />
** '''GNSS:''' GPS/GLONASS/BeiDou/Galileo/QZSS, with A-GPS<br />
* '''Sensors:''' Accelerometer, gyroscope, proximity, ambient light, compass<br />
* '''Privacy switches:''' Modem, WiFi & Bluetooth, Microphone, Cameras<br />
* '''[[#Battery|Battery]]:''' Lithium-ion, rated capacity 2800mAh (10.64Wh), typical capacity 3000mAh (11.40Wh) (nominally replaceable with any Samsung J7 form-factor battery)<br />
* '''I/O:''' USB Type-C, USB Host, DisplayPort Alternate Mode output, 15W 5V 3A Quick Charge, follows USB PD specification<br />
<br />
== Components ==<br />
<br />
{| class="wikitable"<br />
! Component<br />
! Model<br />
|-<br />
| Touchscreen<br />
| Goodix GT917S<br />
|-<br />
| Rear camera<br />
| OmniVision OV5640<br />
|-<br />
| Camera flash<br />
| SGMICRO SGM3140<br />
|-<br />
| Front camera<br />
| GalaxyCore GC2145<br />
|-<br />
| LCD<br />
| Xingbangda XBD599<br />
|-<br />
| WiFi<br />
| Realtek RTL8723CS<br />
|-<br />
| Bluetooth<br />
| Realtek RTL8723CS<br />
|-<br />
| Modem<br />
| [http://static.abstore.pl/design/accounts/soyter/img/dokumentacje/quectel_eg25-g.pdf Quectel EG25-G]<br />
|-<br />
| GNSS/GPS<br />
| [http://static.abstore.pl/design/accounts/soyter/img/dokumentacje/quectel_eg25-g.pdf Quectel EG25-G]<br />
|-<br />
| Magnetometer<br />
| ST LIS3MDL<br />
|-<br />
| Ambient light / Proximity<br />
| SensorTek STK3335<br />
|-<br />
| Accelerometer / Gyroscope<br />
| InvenSense MPU-6050<br />
|-<br />
| Vibration motor<br />
| Unknown model<br />
|-<br />
| Notification LED<br />
| LED0603RGB<br />
|-<br />
| Volume buttons<br />
| Buttons connected to the KEYADC<br />
|-<br />
| Power button<br />
| X-Powers AXP803<br />
|-<br />
| Battery fuel gauge<br />
| X-Powers AXP803<br />
|}<br />
<br />
See the [[PinePhone_component_list|PinePhone Component List]].<br />
<br />
== Hardware revisions ==<br />
<br />
[[File:Pinephone_revisions.png|400px|thumb|right|The history of the PinePhone CEs]]<br />
<br />
The following are all hardware revisions of the PinePhone that have existed, ordered by the time of their releases:<br />
<br />
* [[Project Anakin]]<br />
* [[Project Don't be evil|"Project Don't Be Evil"]] &ndash; development kit (devkit)<br />
* [[PinePhone v1.0 - Dev|PinePhone v1.0]] &ndash; developer batch<br />
* [[PinePhone v1.1 - Braveheart|PinePhone v1.1]] &ndash; Braveheart<br />
* [[PinePhone v1.2]] &ndash; Ubports Community Edition<br />
* [[PinePhone v1.2a]] &ndash; postmarketOS Community Edition<br />
* [[PinePhone v1.2b]] &ndash; Manjaro Community Edition, KDE Community Edition, Mobian Community Edition and Beta Edition<br />
<br />
== Hardware accessory ==<br />
<br />
=== PinePhone Accessories ===<br />
See [[PinePhone Hardware Accessory Compatibility]] for a list of devices working with the PinePhone (depending on their OS support).<br />
<br />
The USB-C can be used to power the device, and offers USB2 host and OTG possibilities, and also can make use of the USB-C capability to integrate HDMI signals. Some USB-C hubs are available that offer power throughput, USB connection, HDMI port and Ethernet connection.<br />
<br />
=== Pogo pins ===<br />
<br />
[[File:Pinephone pogo.png|400px|thumb|right|The pogo pins, as visible under the back cover.]]<br />
<br />
The PinePhone has six pogo pins on the back allowing for custom hardware extensions such as wireless charging, an IR blaster, a keyboard extension or extended battery case. The pogo pins provide access to an interrupt line, power inputs/outputs and an I2C interface.<br />
<br />
{| class="wikitable"<br />
| Interrupt<br />
| SDA<br />
| SCL<br />
|-<br />
| DCIN<br />
| USB-5V<br />
| GND<br />
|}<br />
<br />
DCIN and USB-5V are the names used in the schematics. The actual behavior of these pogo pins is not obvious based on their names. DCIN is connected both to the VBUS line of the USB Type-C connector and to the ACIN/VBUS inputs on the PMIC. This means that, depending on a number of factors, DCIN may be at 0&nbsp;V or 5&nbsp;V. USB-5V is connected at the output of an LP6226 DC/DC boost converter (5&nbsp;V), which in turn is fed by the PS output of the PMIC. The boost converter is enabled or disabled by a GPIO output from the A64 SoC, controlled by software (e.g. the Linux kernel). Depending on inputs and decision made by the PMIC, PS may be at the battery voltage (fed "directly" by the battery through a [https://www.zxcompo.com/ transistor] controlled by the PMIC), or at the "USB" voltage (fed by the PMIC's ACIN/VBUS inputs). This means that depending on a number of factors, USB-5V may be at battery voltage (between 3.0&nbsp;V and 4.3&nbsp;V), or at 5&nbsp;V.<br />
<br />
Because the PinePhone may act as a USB host (providing 5&nbsp;V at the USB Type-C connector's VBUS to a connected device) or as a USB device (drawing from a 5&nbsp;V source on the USB Type-C connector's VBUS), DCIN is actually not strictly an input nor an output. Some community analysis of the PinePhone schematic (and some testing) indicates that you can connect a 5&nbsp;V power supply to DCIN in order to power the phone at the PMIC's ACIN/VBUS inputs (and, as a side effect, charge the battery). This may not be safe to do in all conditions, e.g., when the phone is acting as a USB host to a connected USB device. It should also be safe to use DCIN as a power output from the PinePhone, e.g., when a USB Type-C charger is connected, you can draw current directly from the USB Type-C port's VBUS, which is provided by the charger. Please note that, when using DCIN as an output from the PinePhone, DCIN isn't "always on"; it may be 0&nbsp;V. It is currently not documented on how much current can be safely drawn.<br />
<br />
USB-5V should be safe to use as an "always on" power output from the PinePhone. Depending on a number of factors, voltage may be from 3&nbsp;V to 5&nbsp;V; thus, if you are using USB-5V to power your pogo-pins expansion board, you will probably need to use DC/DC converters/regulators as appropriate. USB-5V is on even while the A64 SoC is powered down.<br />
<br />
The I2C and interrupt lines have pull-ups on the phone side. The I2C lines are pulled up to 3v3 by the phone.<br />
<br />
For a breakout board see [https://github.com/SMR404/PinephonePogoBreakout here]. For an example project see Martijn's blog post [https://blog.brixit.nl/making-a-backcover-extension-for-the-pinephone/ <i>"Making a backcover extension for the PinePhone"</i>].<br />
<br />
PINE64 store currently sells the [https://pine64.com/product/pinephone-flex-break-out-board/?v=0446c16e2e66 PinePhone Flex Breakout Board]. With the pitch being 2.54 mm, this Flex Breakout Board may have leads soldered directly to the contacts for use in a solderless board. A non-soldered solution would be to use a [https://www.digikey.com/en/products/detail/te-connectivity-amp-connectors/5-520315-6/2258879 TE AMP Connector] that will accept a Flat Flexible Cable 2.54 mm pitch.<br />
<br />
=== Back cover ===<br />
A step file for the back cover for creating custom cases is freely available [https://files.pine64.org/doc/PinePhone/PinePhone%20Back%20Cover%20ver%200.5.stp here].<br />
<br />
=== Serial console ===<br />
<br />
[[File:PinePhone_Serial_Cable.png|400px|thumb|right|Pinout of the serial adapter.]]<br />
<br />
The PinePhone has a serial port in the headphone connector, it's activated by the 6th contact on the dipswitch. If the switch is set to "on", the headphone connector is in audio mode, if it is set to "off" it's in UART mode. The UART serial connection can also be used for communication with other devices from the PinePhone.<br />
<br />
The UART is 115200n8.<br />
<br />
The pinout for the serial connector is:<br />
<br />
* Tip: RX<br />
* Ring: TX<br />
* Sleeve: GND<br />
<br />
You can buy a serial debug cable from the [https://pine64.com/product/pinebook-pinephone-pinetab-serial-console/ PINE64 Store]. The store cable uses a 4 ring plug, as seen in the [https://files.pine64.org/doc/pinebook/guide/Pinebook_Earphone_Serial_Console_Developer_Guide.pdf here], but a 3 ring plug works just as well. The cable uses a CH340 chipset based serial to USB converter, but any 3.3v serial connection can be used. Because it is a "host"/DTE it means that you need a ''cross modem cable'' ([https://en.wikipedia.org/wiki/Null_modem Null Modem]) with TX on Tip to be connected to RX. A cable like e.g. [https://www.ftdichip.com/Products/Cables/USBTTLSerial.htm FTDI TTL-232R-3V3-AJ] which has TX on Tip and RX on Ring fits perfectly.<br />
<br />
== Privacy switch configuration ==<br />
<br />
[[File:PinePhone Kill Interruptors de Maquinari del PinePhone 4529.jpg|320px|thumb|right|Detail of DIP switch]]<br />
<br />
The PinePhone features six switches that can be used to configure its hardware. They are numbered 1-6, with switch 1 located nearest to the modem. Their "on" position is toward the top of the phone.<br />
<br />
{| class="wikitable"<br />
|-<br />
! Number<br />
! Name<br />
! Explanation<br />
! Description<br />
|-<br />
| 1<br />
| Modem<br />
| Pulls Q1501 gate up (FET killing modem power)<br />
| "On" enables 2G/3G/4G communication and GNSS hardware, "off" disables it.<br />
|-<br />
| 2<br />
| WiFi / Bluetooth<br />
| Pulls up CHIP_EN<br />
| "On" enables WiFi and Bluetooth communication hardware, "off" disables it.<br />
|-<br />
| 3<br />
| Microphone<br />
| Breaks microphone bias voltage from the SoC<br />
| "On" enables audio input from on-board microphones (not 3.5 mm jack), "off" disables it.<br />
|-<br />
| 4<br />
| Rear camera<br />
| Pulls up PWDN on OV5640 <br />
| "On" enables the rear camera, "off" disables it.<br />
|-<br />
| 5<br />
| Front camera<br />
| Pulls up PWDN on GC2145<br />
| "On" enables the front camera, "off" disables it.<br />
|-<br />
| 6<br />
| Headphone<br />
| Pulls up IN2 on analog switch BCT4717ETB<br />
| "On" enables audio input and output via the 3.5 mm audio jack, "off" switches the jack to hardware UART mode.<br />
|}<br />
<br />
== Camera ==<br />
<br />
The PinePhone has two cameras, OmniVision OV5640 with 5MP (up to 2592 x 1944 pixels) as rear camera and GalaxyCore GC2145 with 2MP (up to 1600 x 1200 pixels) as front camera.<br />
<br />
[[File:Rose.jpg|400px|thumb|none|Example picture taken on the PinePhone's rear camera by Martijn Braam using his app ''Megapixels''.]]<br />
<br />
Further details regarding the camera and the Megapixels camera app can be found on [https://blog.brixit.nl/tag/phones/ Martijn's blog].<br />
<br />
== Battery ==<br />
{{Hint|The EG25-G modem and the RTL8723CS WiFi and Bluetooth combo do not work without battery power, even when enough power is supplied to the PinePhone via the USB Type-C port.}}<br />
<br />
The phone ships with a protective plastic sticker between the battery and the phone to protect the device from turning on during shipping. You need to gently open the back cover, then remove the battery and finally remove the sticker and check that the pins aren't bent. Note: If the battery is stuck inside the phone, the mid screw in the lower part of the midframe needs to be slightly loosened, see [[PinePhone_FAQ#The_battery_is_stuck_inside_the_phone|here]].<br />
<br />
The [https://files.pine64.org/doc/datasheet/pinephone/PinePhone%20QZ01%20Battery%20Specification.pdf supplied battery] is meant to be compatible with Samsung part number EB-BJ700BBC / BBE / CBE from the 2015 J7 phone. The extended life aftermarket BBU does fit, although it is a tight fit.<br />
<br />
The battery terminals, from the nearest to the battery edge to the nearest to the middle of battery, are as follows:<br />
<br />
{| class="wikitable" <br />
| style="min-width: 90px; text-align: center;" | +ve<br />
| style="min-width: 90px; text-align: center;" | thermistor<br />
| style="min-width: 90px; text-align: center;" | -ve<br />
| style="min-width: 90px; text-align: center;" | not connected<br />
|}<br />
<br />
The battery includes a protection circuit that isolates it in a number of fault conditions, including if it is discharged too far. The fully discharged battery can be recharged by connecting the phone to a charger with a sufficient output. Once it has charged sufficiently you will be able to boot the phone.<br />
<br />
== Modem ==<br />
<br />
The PinePhone uses Quectel EG25-G as modem. AT commands are used to communicate with the modem.<br />
<br />
=== AT commands ===<br />
<br />
A list of documented AT commands can be found for example in this [[:File:Quectel_EC2x&EG9x&EG2x-G&EM05_Series_AT_Commands_Manual_V2.0.pdf|AT commands documentation]] from Quectel. Further undocumented AT commands found by the developer megi, who reverse-engineered parts of the modem and its firmware, can be found on megi's website [http://xnux.eu/devices/feature/modem-pp-reveng.html#toc-un-der-documented-at-commands here].<br />
<br />
To send AT commands to the modem under Linux, <code>minicom</code> or the often-preinstalled <code>atinout</code> utility:<br />
<br />
<i>atinout</i> example:<br />
<pre><br />
sudo su<br />
atinout - /dev/EG25.AT out.txt << EOF<br />
> AT+... command here<br />
> EOF<br />
cat ./out.txt # to see the result of a command execution<br />
</pre><br />
<br />
<i>minicom</i> example:<br />
<br />
<code>minicom -D /dev/ttyUSB2</code><br />
<br />
=== VoLTE ===<br />
<br />
The PinePhone's modem supports VoLTE and comes with a few VoLTE profiles preloaded. Most OSes try to set the correct profile automatically.<br />
<br />
To list the available VoLTE profiles:<br />
<br />
<pre><br />
AT+QMBNCFG="list"<br />
<br />
+QMBNCFG: "List",0,1,1,"ROW_Generic_3GPP",0x0501081F,201901141<br />
+QMBNCFG: "List",1,0,0,"VoLTE-ATT",0x0501033C,201909271<br />
+QMBNCFG: "List",2,0,0,"hVoLTE-Verizon",0x05010141,201911251<br />
+QMBNCFG: "List",3,0,0,"Sprint-VoLTE",0x05010205,201908141<br />
+QMBNCFG: "List",4,0,0,"Commercial-TMO_VoLTE",0x05010505,201811231<br />
+QMBNCFG: "List",5,0,0,"Telus-Commercial_VoLTE",0x05800C43,201912031<br />
+QMBNCFG: "List",6,0,0,"Commercial-SBM",0x05011C18,201904021<br />
+QMBNCFG: "List",7,0,0,"Commercial-DT",0x05011F1C,201905311<br />
+QMBNCFG: "List",8,0,0,"Reliance_OpnMkt",0x05011B38,201910161<br />
+QMBNCFG: "List",9,0,0,"TF_Germany_VoLTE",0x05010C1B,201909201<br />
+QMBNCFG: "List",10,0,0,"TF_Spain_VoLTE",0x05010CFA,201909261<br />
+QMBNCFG: "List",11,0,0,"Volte_OpenMkt-Commercial-CMCC",0x05012071,201904281<br />
+QMBNCFG: "List",12,0,0,"OpenMkt-Commercial-CT",0x05011322,201911081<br />
+QMBNCFG: "List",13,0,0,"OpenMkt-Commercial-CU",0x05011505,201807052<br />
</pre><br />
<br />
To select a profile manually, select the best fitting one or a generic one if none fits:<br />
<br />
<pre><br />
AT+QMBNCFG="select","ROW_Generic_3GPP"<br />
</pre><br />
<br />
Then enable Voice over LTE using:<br />
<br />
<pre><br />
AT+QCFG="ims",1<br />
</pre><br />
<br />
And reboot the modem to apply the settings:<br />
<br />
<pre><br />
AT+CFUN=1,1<br />
</pre><br />
<br />
To check the status of VoLTE during a call, the AT command <code>CLCC</code> can be used:<br />
<br />
<pre><br />
AT+CLCC<br />
<br />
+CLCC: 1,1,0,1,0,"",128<br />
+CLCC: 2,1,0,1,0,"",128<br />
</pre><br />
<br />
In the fourth item of the list, "0" means voice and and "1" means data. If both rows have "1" then the voice call is being carried over VoLTE.<br />
<br />
=== APN settings ===<br />
<br />
The APN setting is only required for a public Internet connection ("data") on the phone. For tested APN settings and how to apply them see [[PinePhone APN Settings]].<br />
<br />
=== Carrier support ===<br />
The page [[PinePhone Carrier Support]] contains information about the frequency support of different carriers and hints on setting up cellular network connectivity.<br />
<br />
=== Documents ===<br />
<br />
Detailed information about the modem can be found on the [https://xnux.eu/devices/feature/modem-pp.html#toc-modem-on-pinephone page of the developer megi], including reverse-engineered parts of the firmware and its functions. There is also a document about using the modem from January 18th 2020 by megi [https://megous.com/dl/tmp/modem.txt here]. A script at the end of the document showcases a way to poweroff the modem before powering off the phone, which is integrated into most of the available OSes.<br />
<br />
=== Firmware update ===<br />
<br />
{{Hint|The following instructions are directed towards professional users. It is highly recommend to make sure the update process is not interrupted to prevent the modem from bricking.}}<br />
<br />
The modem firmware can be updated to a newer version if it is outdated. The firmware version can be checked using the following AT command (at the example of <code>atinout</code>, alternatively <code>minicom</code> can be used to communicate with the modem too):<br />
<br />
<pre><br />
sudo su<br />
atinout - /dev/EG25.AT out.txt << EOF<br />
> AT+QGMR<br />
> EOF<br />
cat ./out.txt # should output OK<br />
</pre><br />
<br />
If the version number is 01.001.01.001 ''(EG25GGBR07A08M2G_01.001.01.001)'' it is recommended to update the firmware to version 01.002.01.002 ''(EG25GGBR07A08M2G_01.002.01.002)'' due to various bug fixes.<br />
<br />
'''Pre-update checklist:'''<br />
<br />
Please make sure all requirements of the checklist are fulfilled. If the update process is interrupted it will lead to a corrupted firmware of the modem, causing it to brick. Recovering a bricked modem is exponentially more complicated and requires the user to boot a special mode by physically bridging test points on the modem.<br />
<br />
* The battery needs to be charged sufficiently<br />
* The phone needs to be plugged into a charger<br />
* Deep sleep is recommended to be disabled as it can interrupt the update process<br />
* It is recommended to close all other running applications<br />
* Use common sense while doing the update, don't do the update while being impaired in any way<br />
<br />
To get the latest firmware, clone the repository of user Biktorgj on the phone:<br />
<br />
<pre>git clone https://github.com/Biktorgj/quectel_eg25_recovery</pre><br />
<br />
After cloning the directory, open it with cd:<br />
<br />
<pre>cd quectel_eg25_recovery</pre><br />
<br />
Then run qfirehose, which starts the flashing process:<br />
<br />
<pre>sudo ./qfirehose -f ./</pre><br />
<br />
The modem will automatically reboot after the update process is done. The boot process takes around 30 to 60 seconds. After that it is highly recommended to reboot the device.<br />
<br />
=== Firmware modifications ===<br />
<br />
See [[PineModems]] for more information regarding modem bootloader unlocking, building a custom modem firmware and modem recovery.<br />
<br />
=== GPS / GNSS ===<br />
The GPS engine in the modem supports mutli-GNSS reception from GPS, GLONASS, BeiDou, Galileo and QZSS independent of a cellular connection. The operation of the GNSS subsystem is controlled via a separate set of AT commands. The AGPS data upload uses the file management AT commands, which also have their own manual. These are linked in the [[PinePhone#Datasheets for components and peripherals|documentation section]] below.<br />
<br />
As with most smartphones, the PinePhone has a small antenna and has difficulty getting a first fix without assistance data, a cold start can take 15 minutes under good conditions. While the hardware supports AGPS data upload, it isn't yet implemented in current distributions. There is a [https://gist.github.com/alastair-dm/263209b54d01209be28828e555fa6628 proof of concept script] which can be made to work, but support needs to be added to ModemManager, oFono etc. before it will be easy to use.<br />
<br />
Basic testing of GNSS reception can be done by using the AT command interface (/dev/ttyUSB2) from a terminal progam like minicom and the data output interface (/dev/ttyUSB1) to feed NMEA data into gpsmon or some other progam that can parse standard NMEA sentences.<br />
<br />
[[File:Gpsmon eg25g.png|400px|thumb|none|gpsmon decoding GPS data from /dev/ttyUSB1]]<br />
<br />
To check if GNSS data output is enabled, you can<br />
<br />
cat /dev/ttyUSB1<br />
<br />
this should display a stream of NMEA sentences<br />
<br />
$GPVTG,,T,,M,,N,,K,N*2C<br />
$GPGSA,A,1,,,,,,,,,,,,,,,,*32<br />
$GPGGA,,,,,,0,,,,,,,,*66<br />
<br />
=== Voice mail ===<br />
<br />
The operating systems of the PinePhone may not have support for accessing your voicemail by holding down the 1-key. Carriers might support accessing the voice mail via an external number however. If you are in Canada and using rogers or a rogers associated carrier (such as ''Chatr''), you can access your voice mail by calling an external number, see [https://www.howardforums.com/showthread.php/913346-Rogers-GSM-Voicemail-Retrieval-Numbers here]. In America, AT&T also has support for accessing your voicemail via an external phone number, see [https://www.att.com/support/article/wireless/KM1009101/ here].<br />
<br />
== Safety ==<br />
<br />
=== Charging safety ===<br />
<br />
The PinePhone supports up to 5V 3A (15W) Quick Charge, it follows the USB Power Delivery specification. Only compatible phone chargers may be used, charging the phone with incompatible chargers (for example laptop chargers with a higher voltage) is prohibited. Charging the phone releases heat, general safety recommendations must be followed, see the section ''Thermal safety''.<br />
<br />
=== Thermal safety ===<br />
<br />
With the Allwinner A64 being an older generation SoC with a large 40nm chip, the phone produces quite some heat with medium or higher use and especially also during charging or when using USB accessories, like a docking station. Measurements to prevent damage to the phone and to its surroundings need to be taken by the user. This includes especially a proper handling of the phone: do not charge the phone in a way where heat builds up around the phone without being able to escape. Especially don't charge your phone under a pillow, blankets, in pockets or bags. Charging the phone produces heat and charging the phone in a way, where the excessive heat can't dispose around the phone poses an immediate fire risk.<br />
<br />
The user might notice that the phone gets warm under usage, compared to phones with more up-to-date hardware. Under normal circumstances these temperatures don't pose a risk while being in the levels within the safe operating temperatures (which lay far beyond the point where components can be too hot to touch). Higher temperatures might especially be experienced on the top side of the screen and on the inside of the phone at the RF shield of the modem. The higher temperature of the RF shield of the modem is commonly caused by the SoC on the opposite side of the mainboard, the RF shield of the modem is used to disperse heat of the SoC. In newer mainboard revisions starting from 1.2a there are also thermal pads on the back cover and between the SoC's RF shield and the screen, dispersing heat on the screen and on the back cover. In the past there has been safety issues regarding thermal safety functions, causing temperature reads to not properly work over an extended period of time, which was causing heat damage in some cases (see the documentation of that issue by the developer Megous [http://xnux.eu/log/#018 here] and [http://xnux.eu/log/#017 here]). While the developers are working hard to prevent such issues, they can't be excluded under all circumstances (see [[PinePhone#State_of_the_software|state of the software]]). The users are expected to monitor their phones' thermal safety at every point at this state of the software.<br />
<br />
It is highly recommend to update the phone on a regular basis to always get the latest improvements. The default settings to throttle the performance and to shut down the phone when reaching critical temperatures might be set to a too high point depending on the specific usage and usage length. Under GNU/Linux the phone's thermal management behavior can be modified via the Thermal Sysfs driver to achieve lower temperatures and preventing the screen and other components to potentially take damage, see [[PinePhone Thermal Tweaks]] for the details.<br />
<br />
== Frequently asked questions ==<br />
<br />
For a list of frequently asked questions (including information regarding the shipping) see [[PinePhone FAQ]].<br />
<br />
== Modifications and repairs == <br />
<br />
=== Swapping in a new mainboard revision ===<br />
<br />
The mainboard can be replaced, for example for upgrading to a newer hardware revision or if it is faulty. The replacement board does not have an OS preinstalled, to test if everything is working after swapping the mainboard a flashed SD card is required. The mainboard also comes with a non-functional firmware on the ANX chip, a newer firmware version has to be flashed as explained below to get certain USB functionality to work.<br />
<br />
==== Replacing the mainboard ====<br />
<br />
{{Hint|Replacement boards come with an empty eMMC, which means that trying to boot from them looks like the board is faulty (no LEDs, no screen, no reaction of the phone). Please boot an OS from SD card.}}<br />
<br />
Prior to replacing your PinePhone’s mainboard please read the steps outlined in bullet points below and watch the attached video.<br />
<br />
# You’ll need a small Phillip’s screwdriver and a prying tool to swap out the PinePhone’s mainboard.<br />
# Remove the PinePhone’s back cover. See your quick start guide for details.<br />
# Remove the battery as well as any inserted SD and SIM cards.<br />
# Unscrew all 15 Phillip’s head screws around the midframe of the phone.<br />
# Gently pry up the midframe using a guitar pick or credit card corner. It is easiest to separate the midframe at one of the bottom edges. Work your way around all the sides of the phone until the midframe separates from the phone’s body.<br />
# Detach all ribbon cables and “Lego” connectors. List of things to detach: 1) two “Lego” connects at the bottom of the mainboard. 2) u.FL antenna connect and touchscreen digitizer on PCD left side. 3) LCD ribbon cable top of mainboard, next to audio/ UART jack.<br />
# Pry the mainboard up gently from the left-hand side.<br />
# Remove front and main cameras and reset them into the new mainboard.<br />
# Check that the rubber proximity sensor housing is in the chassis, not stuck to the removed mainboard.<br />
# Place the new mainboard in the chassis, hooking in on the plastic tabs on left side and pressing down firmly on opposite side, and follow the steps (7-2) in reverse. When reattaching the midframe take care that no cables are out of place or trapped, as they may be damaged when tightening screws.<br />
<br />
After swapping the mainboard the phone won't boot as there is no OS on the replacement board's eMMC preinstalled. To boot an OS insert a flashed SD card.<br />
<br />
A video tutorial by <i>Martijn Braam</i> can be found here (or alternatively a video tutorial by user <i>brigadan</i> with additional notes about the camera swap and proximity sensor isolator [https://www.youtube.com/watch?v=J3AJEF7akkw here]):<br />
[[File:Pinephone_martijn_pcb_replacement.png|thumb|none|600px|link=https://www.youtube.com/watch?v=5GbMoZ_zuZs|Watch Martijn Braam's video tutorial here: https://www.youtube.com/watch?v=5GbMoZ_zuZs.]]<br />
<br />
==== Flashing the ANX firmware ====<br />
<br />
===== Method 1 =====<br />
<br />
After swapping the mainboard the ANX7688 chip has to be flashed for full USB functionality.<br />
<br />
Download the latest ANX7688 firmware image on the phone:<br />
<br />
wget https://xff.cz/git/linux-firmware/plain/anx7688-fw.bin<br />
<br />
Execute as root ("sudo su") on the phone:<br />
<br />
cp anx7688-fw.bin /lib/firmware/<br />
echo 1 > /sys/class/typec/port0/device/flash_eeprom<br />
<br />
===== Method 2 =====<br />
<br />
Booting a factory test image will automatically flash the ANX7688 chip. See [[PinePhone Software Releases#Factory Test OS|Factory Test OS]] for such an image.<br />
<br />
=== Replacing the screen ===<br />
<br />
Before attempting to replace the screen be sure to review the section on [[#Swapping in a new mainboard revision|replacing the mainboard]] since that will get you most of the way there. Be aware that the replacement screen is actually the entire front frame of the phone and there are components that will need to be swapped from your old screen.<br />
<br />
* Make sure you have a precision screwdriver set that has the correct size Philips tip. The screws are very small and the heads can easily be stripped if the screwdriver is not correct - if you feel your screwdriver slipping, stop what you are doing and try one that is a better fit. A magnetized screwdriver will help in not losing screws, as will a magnetic parts holder to keep them in while working.<br />
<br />
* There are a number of components and cables as well as the insulator sheet under the battery that are glued in place. A hair dryer will loosen the glue and make them much easier to remove. You may want to order extra cables along with the screen just in case.<br />
<br />
* The vibration motor, which is part of the USB-C board assembly and glued into place, will come apart easily and be damaged if you pry it up in the wrong place. Make sure you pry from underneath the complete part, not midway on its housing. The ribbon cable attaching this to the USB-C board is small, thin, and fragile so be careful with that as well.<br />
<br />
* The new screen comes with new side switches and insulator sheet but there are a number of parts that need to be transferred from the old screen, like the thin coax cable running up the side, the phone ear speaker, proximity sensor gasket, and a gold-colored mesh glued in place that needs to be transferred to a flexible circuit included on the new screen. If you don't swap over the proximity sensor rubber gasket the screen will immediately turn off after logging in. Be careful when routing the coax cable that it goes around the screw holes or you may drive a screw right through the cable.<br />
<br />
Take your time, use the right tools, be careful and you should be rewarded with success.<br />
<br />
=== Spare parts not available in the PINE64 store ===<br />
<br />
* Earpiece dimensions: 12x6x2 mm. Compatible with Xiaomi Mi2 / Mi3 / Mi4 and others, see [https://forum.pine64.org/showthread.php?tid=12046&pid=85698#pid85698 here]<br />
* Loudspeaker dimensions: 15x11x3 mm. Compatible with Nokia N91, Lenovo A536 (requires soldering) and others, see [https://forum.pine64.org/showthread.php?tid=12046&pid=85698#pid85698 here]<br />
* Proximity sensor rubber isolator<br />
<br />
== Press ==<br />
<br />
For an overview about media of the PinePhone you can use for the news, blogs, or similar see [[PinePhone Press]].<br />
<br />
== PinePhone board information, schematics and certifications ==<br />
<br />
* PinePhone mainboard schematic:<br />
** [https://files.pine64.org/doc/PinePhone/PinePhone%20v1.2b%20Released%20Schematic.pdf PinePhone mainboard Released Schematic ver 1.2b]<br />
** [https://files.pine64.org/doc/PinePhone/PinePhone%20v1.2a%20Released%20Schematic.pdf PinePhone mainboard Released Schematic ver 1.2a]<br />
** [https://files.pine64.org/doc/PinePhone/PinePhone%20v1.2%20Released%20Schematic.pdf PinePhone mainboard Released Schematic ver 1.2]<br />
** [[PinePhone_v1.2|PinePhone schematic ver 1.2 change list]]<br />
** [https://files.pine64.org/doc/PinePhone/PinePhone%20Schematic%20v1.1%2020191031.pdf "Braveheart" PinePhone mainboard Schematic ver 1.1]<br />
** [https://files.pine64.org/doc/PinePhone/PinePhone%20mainboard%20top%20placement%20v1.1%2020191031.pdf "Braveheart" PinePhone mainboard component top placement drawing ver 1.1]<br />
** [https://files.pine64.org/doc/PinePhone/PinePhone%20mainboard%20bottom%20placement%20v1.1%2020191031.pdf "Braveheart" PinePhone mainboard component bottom placement drawing ver 1.1]<br />
** [[PinePhone component list]]<br />
* PinePhone USB-C small board schematic:<br />
** [https://files.pine64.org/doc/PinePhone/PinePhone%20USB-C%20small%20board%20schematic%20v1.0%2020190730.pdf PinePhone USB-C small board Schematic ver 1.0]<br />
** [https://files.pine64.org/doc/PinePhone/PinePhone%20USB-C%20small%20board%20top%20placement%20v1.0%2020190730.pdf PinePhone USB-C small board component top placement drawing ver 1.0]<br />
** [https://files.pine64.org/doc/PinePhone/PinePhone%20USB-C%20small%20board%20bottom%20placement%20v1.0%2020190730.pdf PinePhone USB-C small board component bottom placement drawing ver 1.0]<br />
* PinePhone certifications:<br />
** [https://files.pine64.org/doc/cert/PinePhone%20FCC%20SDOC%20Certificate-S19112602605001.pdf PinePhone FCC Certificate]<br />
** [https://fcc.report/FCC-ID/2AWAG-PINEPHONE RF Exposure SAR Information from FCC ID site]<br />
** [https://files.pine64.org/doc/cert/PinePhone%20CE%20RED%20Certificate-S19112602602.pdf PinePhone CE RED Certificate]<br />
** [https://files.pine64.org/doc/cert/PinePhone%20ROHS%20Report.pdf PinePhone ROHS Report]<br />
** Note: PinePhone's Type Allocation Code (TAC) is <i>86769804</i><br />
<br />
== Datasheets for components and peripherals ==<br />
<br />
* Allwinner A64 SoC information:<br />
** [https://files.pine64.org/doc/datasheet/pine64/A64%20brief%20v1.0%2020150323.pdf Allwinner A64 SoC brief introduction]<br />
** [https://files.pine64.org/doc/datasheet/pine64/A64_Datasheet_V1.1.pdf Allwinner A64 SoC Data Sheet V1.1 (Official Released Version)]<br />
** [https://files.pine64.org/doc/datasheet/pine64/Allwinner_A64_User_Manual_V1.0.pdf Allwinner A64 SoC User Manual V1.0 (Official Release Version)]<br />
<br />
* X-Powers AXP803 PMIC (Power Management IC) information:<br />
** [https://files.pine64.org/doc/datasheet/pine64/AXP803_Datasheet_V1.0.pdf AXP803 PMIC datasheet]<br />
<br />
* LPDDR3 (178 Balls) SDRAM:<br />
** [https://files.pine64.org/doc/datasheet/pinephone/ATL3A1632H12A_mobile_lpddr3_11x11.5_v1.0_1600.pdf Artmem LPDDR3 datasheet]<br />
<br />
* eMMC information:<br />
** [https://files.pine64.org/doc/datasheet/pinephone/Kimtigo_fbga153_16_32_64_eMMC_datasheet_v1.3.pdf Kimtigo eMMC datasheet]<br />
<br />
* CMOS camera module information:<br />
** [https://files.pine64.org/doc/datasheet/pinephone/QZ01-rear-2019-0717(HW)%20Model.pdf PinePhone 5M Pixel Real CMOS Image Sensor Module]<br />
** [https://files.pine64.org/doc/datasheet/pinephone/OV5640_datasheet.pdf OV5640 5MP CMOS Image Sensor SoC for Rear Module datasheet]<br />
** [https://usermanual.wiki/Document/OV5640FirmwareUserGuideV10.952852672.pdf OV5640 Embedded Firmware User Guide&nbsp;&ndash; VCM AF Module]<br />
** [https://files.pine64.org/doc/datasheet/pinephone/QZ01-front-2019-0717(HW)%20Model.pdf PinePhone 2M Pixel Front CMOS Image Sensor Module]<br />
** [https://files.pine64.org/doc/datasheet/pinephone/GC2145%20CSP%20DataSheet%20release%20V1.0_20131201.pdf GC2145 2MP CMOS Image Sensor SoC for Front Module datasheet]<br />
<br />
* LCD touch screen panel information:<br />
** [https://files.pine64.org/doc/datasheet/pinephone/PinePhone%20LCD-QZ01.pdf 5.99" 1440x720 LCD IPS Panel specification]<br />
** [https://files.pine64.org/doc/datasheet/pinephone/ST7703_DS_v01_20160128.pdf ST7703 LCD Controller datasheet]<br />
** [https://files.pine64.org/doc/datasheet/pinephone/GT917S-Datasheet.pdf GOODiX GT917S Capacitive Touch Controller datasheet]<br />
<br />
* Lithium battery information:<br />
** [https://files.pine64.org/doc/datasheet/pinephone/PinePhone%20QZ01%20Battery%20Specification.pdf PinePhone Lithium Battery specification]<br />
** [https://files.pine64.org/doc/datasheet/pinephone/PinePhone%20QZ01%20Battery%20ZCV%20Curve%20Chart.xlsx PinePhone Lithium Battery ZCV curve chart]<br />
** [https://cad.onshape.com/documents/5194d6303f021e6f300b70a0/w/7b63ac4c32ed63dfd78c7840/e/5d43c0ce5b665bae10082a08 PinePhone Lithium Battery 3D onshape drawing]<br />
<br />
* WiFi/BT module information:<br />
** [https://files.pine64.org/doc/datasheet/pine64/RTL8723BS.pdf RTL8723BS/RTL8723CS specification]<br />
<br />
* LTE module information:<br />
** [[File:Quectel_EG25-G_LTE_Standard_Specification_V1.3.pdf]]<br />
** [[File:Quectel_EG25-G_Hardware_Design_V1.4.pdf]]<br />
** [[File:Quectel_EC2x&EG9x&EG2x-G&EM05_Series_AT_Commands_Manual_V2.0.pdf]]<br />
** [[File:Quectel_EC2xEG25-GEG9xEM05_FILE_AT_Commands_Manual_V1.0.pdf]]<br />
** [[File:Quectel_EC2x&EG9x&EG2x-G&EM05_Series_GNSS_Application_Note_V1.3.pdf]]<br />
<br />
* Sensors:<br />
** [https://www.st.com/en/mems-and-sensors/lis3mdl.html ST LIS3MDL 3-axis Magnetometer Datasheet]<br />
** [https://www.invensense.com/products/motion-tracking/6-axis/mpu-6050/ InvenSense MPU-6050 Six-Axis (Gyro + Accelerometer) MEMS datasheet]<br />
** [https://www.sensortek.com.tw/en/product/Proximity_Sensor_with_ALS.html SensorTek STK3335 Ambient Light Sensor and Proximity Sensor]<br />
<br />
* Digital video to USB-C bridge:<br />
** [https://www.analogix.com/en/system/files/AA-002281-PB-6-ANX7688_Product_Brief.pdf ANX7688 product brief]<br />
<br />
* Case information:<br />
** [https://files.pine64.org/doc/datasheet/pinephone/PinePhone%20Exploded%20Diagram%20ver%201.0.pdf PinePhone case exploded diagram]<br />
** [https://files.pine64.org/doc/datasheet/pinephone/PinePhone%20Back%20Cover.stp PinePhone back cover 3D file]<br />
<br />
* Other components:<br />
** See the [[PinePhone_component_list|Component List]]<br />
<br />
== Developer works ==<br />
<br />
* The following resources have been made available by Ondřej Jirman, a developer for the Pinephone:<br />
** [https://xnux.eu/howtos/pine64-pinephone-getting-started.html Getting started with PinePhone Hardware]<br />
** [https://xnux.eu/devices/pine64-pinephone.html State of development progress]<br />
** [https://xnux.eu/log/ Development log]<br />
** [https://xnux.eu/news.html PinePhone Technical News and Update, also applies to other Allwinner devices including PINE A64 SBC]<br />
** [https://xnux.eu/contribute.html Contributions to the kernel development]<br />
* [[PinePhone Development]]<br />
<br />
== External links == <br />
* [https://pine64.com/product-category/pinephone/ The PinePhone on the official Pine store]<br />
* [https://pine64.com/product-category/smartphone-spare-parts/ PinePhone spare parts on the official Pine store]<br />
* [https://pine64.com/product-category/smartphone-accessories/ PinePhone accessories on the official Pine store]<br />
<br />
[[Category:PinePhone]] [[Category:Allwinner A64]]</div>Tom