User:Brendlefly62/Rockchip RK3288 Asus Tinker Board S

From Gentoo Wiki
Jump to:navigation Jump to:search

Construction of this page began 5 November 2023 (Work in Progress)

This is an inexpensive armv7 SBC made by a very popular motherboard manufacturer (Asus). See details below. This system runs Gentoo Linux, with further objectives, as described below. It seems to have been discontinued and according to this source, it is no longer available.

Asus Tinkerboard s, shown here in an old Raspberry Pi 2 case modified (for ventilation fan used with a Raspberry Pi 3 Model B+ a few years ago). This board has the same I/O layout at RPi 2/3 and is therefor compatible with those old cases. Also visible here is an RPi camera mdule (tested only with Tinkerboard's distributed Android OS), an SPDT switch wired to the Tinkerboard S's "maskrom" jumper - allowing easier selection of either eMMC or SD Card as primary boot device, an LED used to automate a status indicator useful in headless operation, and an external usb mass storage device.

Overall status

This will eventually be a complete built-from-scratch system. Currently, the board has a Gentoo rootfs system, a custom amd64-cross-compiled kernel built using lernel.org upstream sources The board is currently still using the bootloader installed on the boot device by a distributed Debian image. The author's intent is to create a custom amd64-cross-compiled u-boot bootloader to replace the last remaining component "built by others."

Hardware

Make/model Notes
Board
Asus Tinkerboard S dtb: rk3288-tinker-s.dtb
SoC
Rockchip RK3399-T datasheet
RAM
4GB Dual-CH LPDDR3 2GB
Firmware
** Currently as provided by distributed Debian Image To do: Custom-cross compile u-boot by on gentoo amd64 desktop PC
Boot media
eMMC*, SD Card
  • model s has eMMC
System will boot from either eMMC or SD Card, depending on position of "maskrom" jumper header. Note that author has replace the jumper with a SPDT switch, to facilitate easy selection of boot device. PXE not tested but should be available once custom u-boot is developed (supported by u-boot standard). USB boot option also exists in u-boot documentation, but it was not tested (and there may be issues with that).[1][2]

SoC

Rockchip RK3288

  • kernel: Author's custom amd64-cross-compiled 6.5.4 (Linux tinker04 6.5.4 #1 SMP Tue Sep 19 15:28:12 EDT 2023 armv7l ARMv7 Processor rev 1 (v7l) Rockchip (Device Tree) GNU/Linux)
Device Make/model* Status kernel drivers Notes
CPU Rockchip RK3288 Cortex-A17 Quad-core SoC* Works The CPU will operate at full capacity, but requires heat

dissipation and AC adapter stability

GPU ARM MaliTM-T760 MP4 GPU

1 x HDMI* supports up to 4K

1 x 15-pin MIPI DSI supports up to HD

Works midgard HDMI supports a maximum resolution of up to 4K, and the iGPU

only supports H.264/H.265 4K hardware decoders

Memory Dual-CH LPDDR3 2GB Works
Storage 16GB eMMC

μSD card

Works
Audio RTL ALC4040 Codec with 1 x 3.5mm audio jack (192k/24bit HD Audio) Not tested
Camera MIPI CSI 2 lanes via FPC connector, support up to 800 MP camera (0.3mm pitch connector). Works Works - but tested with distributed Android OS only
Wireless AW-NB177NF 802.11 b/g/n wireless

BT 4.0 + EDR

Not tested r8723bs
USB 4 x USB 2.0 ports Works usbhid,

usb-storage, dwc2_hsotg

Ethernet RTL8211E-VB-CG GB LAN Works st_gmac
IO 1 x 40-pin header includes: up to 28 x GPIO pins; up to 2 x SPI bus; up to 2 x I2C bus; up to 2 x PWM; up to 1 x PCM/I2S; 2 x 5V power pins; 2 x 3.3V power pins; 8 x ground pins

1 x 4-pin header for Power On and eMMC Recovery (author employs with spdt boot dev select switch)

1 x 2-pin contact point includes 1 x PWM signal; 1 x S/PDIF signal

Works
Others RTC Not tested
Power MicroUSB Works Recommneded to use with 5V/3A PSU

Accessories

  • Standard (shipped in kit): heat sinks
  • Added my author - case, fan, and power supply.
  • (optional) Keyboard, mouse, HDMI cable, and FTDIboard-with-miniUSB cable

Peripherals

Component Make/model Status Kernel driver(s) Notes
PMIC Rockchip RK808 Works rk808 Power Management Integrated Circuit (Regulators, Clocking)[3][4]
Ethernet PHY RTL8211E-VB-CG Works realtek_phy via RGMII
Analog Audio  ?

Board Layout

20231106 130829.jpg

Mask ROM, eMMC Recovery jumpers

The TinkerBoard and TinkerBoard S come with a four-pin header for setting jumper(s) to enable recovery of the contents of the eMMC. When set to "Mask ROM" and connected via USB to a PC, the board's boot process will bypass the bootloader on the eMMC and the board will appear as a USB-attached flash storage device. This enables the user to easily (re)flash write an OS image to the eMMC.

Jumper configurations

board  "default disable"        "eMMC Recovery"
edge       aka "Park"           aka "Mask ROM"  
  |     jumper position         jumper position
  |                                                                                         
  |         +      +                +      +
  |                                        |
  |                                        |
  |         +------+                +      +  

Alternatively, with the jumper in this position while a bootable SD card is inserted in the SD card reader, then the board will boot from the SD card. Thus, the author has replaced the normal jumper with a SPDT switch, to enable easy selection of one of two bootable storage devices.

Boot device select switch

               "eMMC
board         Recovery"
edge       (boot SD card)
  |              |
  |              |
  |       +      +
  |            \
  |             \
  |       +      + ---- COM
  |       |
  |       |
  |    default
  |    disable
  |  (boot eMMC)

There is also a "Power ON" jumper setting that documentation indicates can be used when the DC power supply is not switchable, to power down the board. The author has not tested this.

board      "Power On"   
edge       (untested)   
  |     jumper position
  |
  |         +      +
  |         |
  |         |              
  |         +      + 

Serial Console Setup

To use for troubleshooting and viewing bootloader console output, connect UART3 RX/TX to a serial/USB converter as described in the TinkerBoard Developer Guide.

Tip
The TInkerBoard defconfig sets up the bootloader to use UART3 on physical pins 36, 37 of the 40 pin GPIO header (unlike some other boards which default-setup UART serial I/O on pins 8, 10.

GCC optimization[5]

FILE /etc/portage/make.confRK3399 example
COMMON_FLAGS="-march=armv7-a -mfpu=vfpv3-d16 -mfloat-abi=hard -O2"
CFLAGS="${COMMON_FLAGS}"
CXXFLAGS="${COMMON_FLAGS}"
Note
For a hardened system consider appending -fstack-protector-all
Warning
hardfloat flags will result in complied code that will not run on (or integrate well with code that was compiled for) softfloat cpus. If error messages about vfp differences are observed, this could be the cause.

Gentoo Installation Options and Procedures

Getting to Know the Board

The purpose of this guide is to document "from scratch" procedures for installing a pure gentoo system on this SBC. However the quicker way to get Gentoo up and running is to install another distribution, and replace the root file system contents. Start by consulting User:Brendlefly62/Rockchip_RK3288_Asus_Tinker_Board_S/Getting to Know the Board

Bootloader Build and Installation

To build a U-Boot bootloader from sources, see User:Brendlefly62/Rockchip_RK3288_Asus_Tinker_Board_S/Build-Install-U-Boot

Assemble a Working Gentoo System

To assemble a working Gentoo system with minimal effort, using resources developed above, consult User:Brendlefly62/Rockchip_RK3288_Asus_Tinker_Board_S/Assemble a Gentoo System

Kernel Build and Installation

To build a gentoo linux kernel (including modules, device tree blobs, etc) from sources, see User:Brendlefly62/Rockchip_RK3288_Asus_Tinker_Board_S/build_install_kernel

Install a Gentoo System "From Scratch"

By Hand

To "manually" build a linux system from scratch, see linkname_tbd

With some automation...

To build a gentoo linux system with tools that automate many of the steps entailed in procedures described above, see linkname_tbd

Binary Kernel/Firmware packages

To use pre-built binary packages for linux kernel, molules, dtbs, and bootloader, see linkname_tbd/Pre-built-binary-packages

Bootable gentoo system images

To use pre-built bootable system images files, see linkname_tbd/Bootable-System-Images

Issue 1

When X happens, Y is how you fix it.

See also

(Optional section.)

External resources

References (Footnotes in the text above)