Jump to content

Generic RK322X (rockchip-rk322x)

From postmarketOS Wiki
Rockchip RK322X
The RK322X port booting on an MXQ 4K Pro, which uses a Rockchip RK3228A SoC.
The RK322X port booting on an MXQ 4K Pro, which uses a Rockchip RK3228A SoC.
Manufacturer Rockchip
Name RK322X
Codename rockchip-rk322x
Released 2016
Type generic
Hardware
Chipset Rockchip RK322X
CPU 4x 1.2-1.5 GHz ARM Cortex-A7
GPU Mali-400 MP2
Display HDMI (up to 1920x1080, 4K possible?), Composite
Storage 8-32 GB
Memory 1-4 GB
Architecture armv7
Software
Original software
The software and version the device was shipped with.
Android (TV) 6.0
Extended version
The most recent supported version from the manufacturer.
Android (TV) 7.1
FOSS bootloader yes
postmarketOS
Category testing
Pre-built images
Whether pre-built images are available here.
no
Mainline
Instead of a Linux kernel fork, it is possible to run (Close to) Mainline.
yes
pmOS kernel
The kernel version that runs on the device's port.
6.6.102
Initial MR
Initial merge request.
pmaports!6982
Features
Flashing
It is possible to flash the device with pmbootstrap flasher.
Broken
USB Networking
After connecting the device with USB to your PC, you can connect to it via telnet (initramfs) or SSH (booted system).
Untested
Internal storage
eMMC, SD cards, UFS, ...
Works
SD card
Also includes other external storage cards
Works
Screen
Display works. Ideally with sleep mode and brightness control.
Works
Multimedia
3D Acceleration
Works
Audio
Audio playback, microphone, headset and buttons.
Works
IR RX
Works
Connectivity
WiFi
Partial
Bluetooth
Partial
Ethernet
Untested
Miscellaneous
FDE
Full disk encryption and unlocking with unl0kr.
Untested
USB-A
Full-sized USB-A port works (Usually applicable to SBCs and laptops).
Works
HDMI/DP
Video and audio output with HDMI or Display Port works.
Works
U-Boot
Primary Bootloader
It is possible to replace stock bootloader with U-Boot.
Untested
Secondary Bootloader
It is possible to chainload U-Boot from stock bootloader.
Untested
Mainline
Latest versions of U-Boot are not broken and it is possible to use them.
Works
Internal Storage
It is possible to boot from internal storage (e.g. eMMC or UFS).
Works
SD card
It is possible to boot from SD card.
Works
USB Host
It is possible to boot from a USB storage or connect a keyboard.
Untested
USB Peripheral
It is possible to use device as a peripheral in U-Boot, e.g. for fastboot mode.
Untested
Display
Broken
Keyboard
Broken

Contributors

Maintainers

Users owning this device

How to enter flash mode

  • Install rkdeveloptool and download rk322x_loader_v1.10.256.bin. A pre-built binary of the former is available on https://github.com/rockchip-linux/rkbin.
  • Unplug the power cord from the device.
  • Plug a USB A-to-A connector (yes, really, and it works, and it doesn't cause fire hazards, somehow) to the "OTG" port on the device. Usually it's the lone USB port on the same side as the Ethernet and HDMI ports. Any other USB ports will not work.
  • While you're doing that, press the hidden reset button with a toothpick at the same time as you plug the connector to your computer. It's usually found either on a hole on the back of the device or inside the AV jack.
  • If you see a device with the ID 2207:320b on lsusb, that means you're now booted to the maskrom.
  • Since we're technically not in flash mode yet, we need to make it boot the loader so that we could flash anything to the device. To do that, run rkdeveloptool db [path to rk322x_loader_v1.10.256.bin] as root.

Installation

On an SD card

Follow Installation/Using pmbootstrap#Installing to the SD card or USB storage. When asked for the device's vendor/codename, select rockchip as the vendor and rk322x as the codename.

After the installation is finished, we need to do some modifications so that it could boot without problems:

  • Mount the boot partition on the SD card
  • Make the following changes to extlinux/extlinux.conf:
 timeout 1
 default postmarketOS
-menu title boot prev kernel

 label postmarketOS
     kernel /vmlinuz
-    fdtdir /
+    fdt /rk322x-box.dtb # replace with the appropriate device tree for your device
     initrd /initramfs
     append ...

This is required as U-Boot would refuse to boot when menus are enabled due to broken display support and/or when the device tree isn't specified. Currently this is the only way to fix this issue as boot-deploy currently doesn't have a way to disable menus and specify device trees on extlinux.

  • Unmount the partition and eject the SD card.

Now insert the SD card to the device and you should see the postmarketOS boot screen on your display.

On the internal storage

Follow Installation/Using pmbootstrap#Generating a regular image. When asked for the device's vendor/codename, select rockchip as the vendor and rk322x as the codename.

Using multitool

multitool is an image made by jock at Armbian for doing maintenance on RK322X devices, such as backing up the firmware, flashing images to the internal storage, etc. multitool is meant to be flashed to an SD card and because it can be used to flash to the internal storage, it could be used on situations where entering flash mode impossible, such as when someone doesn't have a USB A-to-A connector or when the "OTG" port is broken.

To flash to the device using multitool:

  • Flash the multitool image to an SD card with a minimum capacity of 2 GB.
  • Use a partition manager to resize the MULTITOOL partition to fill all of the SD card.
  • Run pmbootstrap export to export your image and copy it from /tmp/postmarketOS-export/rockchip-rk322x.img to the MULTITOOL partition.
  • Eject the SD card, insert it to your device, and restart. You should see a screen with the GNU GPL license. Press enter and you will be greeted with a list of actions that multitool offers.
  • Optional but recommended: If you use an SD card with a capacity larger than the internal storage, you can backup the firmware on the internal storage by selecting "Backup flash", so that you can restore the system if multitool fails to flash the image.
  • Choose "Burn image to flash" and select the destination device (usually mmcblk1 for eMMC and rknand0 for NAND) and the image that you copied earlier.
  • After multitool finished flashing, choose "Drop to Bash shell" to make some modifications.
  • Mount the first partition on the internal storage and do the same extlinux.conf step as in the SD card installation guide.
  • Unmount the partition and exit the shell to drop back to the multitool menu.
  • Choose "Reboot" and eject the SD card.

Now you should see the postmarketOS boot screen on your display.

Using rkdeveloptool

Because we don't have a way to modify extlinux.conf through rkdeveloptool, we need to do it directly within the image we built:

  • Run pmbootstrap export to export your image. After you run this, you should see symlinks to the images on your pmbootstrap work path on /tmp/postmarketOS-export.
  • Set up a loop device of the image and mount the boot partition:
# losetup -Pf --show /tmp/postmarketOS-export/rockchip-rk322x.img
/dev/loop0
# mount /dev/loop0p1 /mnt
# umount /mnt
# losetup -d /dev/loop0

After you done that, we can flash the image to the device:

  • Enter flashing mode (see #How to enter flash mode)
  • Optional but recommended: You can backup the firmware on the internal storage by doing the following, so that you can restore the system if rkdeveloptool fails to flash the image.
    • Run rkdeveloptool rfi to get the internal storage information and take note of the capacity of the internal storage.
    • Run rkdeveloptool rl 0x0 $(([replace with the value you obtained earlier] * 2048)) backup.img to back up the internal storage.
  • Run rkdeveloptool wl 0x0 /tmp/postmarketOS-export/rockchip-rk322x.img to flash the image to the internal storage.

After rkdeveloptool finished flashing, unplug the USB A-to-A connector and plug back in the power cord. You should see the postmarketOS boot screen on your display.

Wi-Fi

Most RK322X-based devices uses either a Southern Silicon Valley SSV6051P or an ESP8089 for Wi-Fi, both currently doesn't work on the mainline kernel. However, some devices ship with a Realtek or Broadcom chip, which should theoretically work, though it's currently untested. USB Wi-Fi adapter should work on devices with unsupported Wi-Fi chipsets.

Hardware video decoding

The RK322X and many other Rockchip SoCs uses v4l2request for video decoding, which is available as a LibVA driver. However, it needs to be manually compiled, as it's currently unpackaged neither in Alpine aports nor postmarketOS pmaports.

Gallery

See also