Rockchip - RK3399 (RockPro64)#
RP64, what’s it all about?#
RockPro64 or RP64 is a single board nano/microcomputer, running on a 64 bits arm architecture.
Objectives#
Cover the OpenBSD installation process on RP64 for the following purposes:
- OpenBSD Current (6.7-beta):
- Installation media: usb stick
- Target: 64GB emmc card
- nas: 2 disks in raid 1
The OpenBSD standard installation process will not be covered.
RP64 installation process#
Rockpro64 start-up sequence:
- SPI NOR flash memory
- emmc
- sdcard
- U-Boot environment access
- Clear SPI flash memory
- Allow RP64 to boot USB media
- Follow standard installation process
Why choose RP64?#
- Low power consumption
- Low price vs. computer
- Small footprint
- Playful
- Less sensitive to threats: surface (quantitative footprint) of the ARM / OS architecture on the market
- 1 PCIe x4 port (gen 2.0)
- SATA card (nas)
- ethernet card
- USB card
- (…)
Find out more about: RP64
Hardware requirements for NAS / Home Automation use;
- 1 RP64 - 4Gb
- 1 usb / emmc adapter
- 1 emmc 64gb card
- 1 pretty nas box
- 1 high radiator
- 1 case fan
- 1 adaptor 12v 5A
- 1 serial (TTL) console adapter
Tested equipment :#
1. Cards / Chipsets OK:
- Startech.com PEXSATA32 2 port SATA controller
- ahci0 at pci1 dev 0 function 0 “Marvell 88SE9128 AHCI” rev 0x20: msi, AHCI 1.2
- QNINE NVME PCIe Adapter M.2 2280 w/Samsung 970 EVO
- nvme0 at pci1 dev 0 function 0 Samsung SM981/PM981 NVMe rev 0x00: msix, NVMe 1.3
2. Works but not recommended
- ROCKPro64 PCI-e to Dual SATA-II Interface Card
- ahci0 at pci1 dev 0 function 0 ASMedia ASM1061 AHCI rev 0x01: msi, AHCI 1.2
3. Does not work:
- HighPoint Rocket 640L
- ahci0 at pci1 dev 0 function 0 Marvell 88SE9230 AHCI rev 0x11: msi, AHCI 1.2
- Dell PERC 6/ir
- mpi0 at pci9 dev 0 function 0 Symbios Logic SAS1068E rev 0x08: msi
Current driver does not support pci-bridge-based boards
Technical requirements#
Pins jumper
- (16) : disable boot on emmc
- (23 & 25) : disable SPI flash on first boot.
In both cases, remove 2 seconds after boot, and before the white LED lights up.
Purpose: to enable sdcard boot for installation.
Present the technical tasks involved in downloading the OpenBSD version, as well as the integration of U-Boot and the Device Tree Blob required to boot and install the OpenBSD operating system on the arm64 RockPro64 platform.
Step 1: get resources#
- Image: miniroot68.img
code:
doas ftp -o miniroot68.img https://cdn.openbsd.org/pub/OpenBSD/6.8/arm64/miniroot68.img
- If not, install the following packages:
code:
doas pkg_add u-boot-aarch64
doas pkg_add dtb
Step 2: prepare installation USB key#
- Install the OpenBSD image on the USB key (if disk=sd1)
code:
doas dd if=miniroot68.img of=/dev/rsd1c bs=1m
- Install dtb firmware on USB key (if disk=sd1)
code:
doas mount /dev/sd1i /mnt
doas mkdir /mnt/rockchip
doas cp /usr/local/share/dtb/arm64/rockchip/rk3399-rockpro64.dtb /mnt/rockchip/
doas umount /mnt
Step 3: prepare eMMC card (if emmc=sd2)#
- Install emmc on USB key
- Install U-BOOT & firmware on emmc
code:
doas dd if=/usr/local/share/u-boot/rockpro64-rk3399/idbloader.img of=/dev/sd2c seek=64
doas dd if=/usr/local/share/u-boot/rockpro64-rk3399/u-boot.itb of=/dev/sd2c seek=16384
Step 4: connect components#
- install the emmc card in its final slot (board)
- insert the key into one of the RP64’s USB 2.0 ports
Startup & installation#
Process steps#
- Place a jumper on GPIO pins 23 and 25 to bypass SPI flash start-up.
- Position the USB TTL cable and connect it to the console.
- Start
- Remove jumper within 2 seconds
- Access u-boot
- Clear SPI flash memory (or leave jumper in place forever)
- Manually detect USB key
- Quit u-boot
- Start OpenBSD installation
Console via USB-TTL serial cable#
To connect via a USB-TTL serial cable, simply connect the cable and run the command below to interact with the RocPro64 board.
doas cu -s 115200 -l /dev/cuaU0
Once powered on, we can visualize and interact with the platform.
u-boot#
Hit any key to stop autoboot
U-Boot TPL 2020.01 (Mar 31 2020 - 18:19:43)
Channel 0: LPDDR4, 50MHz
BW=32 Col=10 Bk=8 CS0 Row=15 CS1 Row=15 CS=2 Die BW=16 Size=2048MB
Channel 1: LPDDR4, 50MHz
BW=32 Col=10 Bk=8 CS0 Row=15 CS1 Row=15 CS=2 Die BW=16 Size=2048MB
256B stride
256B stride
lpddr4_set_rate: change freq to 400000000 mhz 0, 1
lpddr4_set_rate: change freq to 800000000 mhz 1, 0
Trying to boot from BOOTROM
Returning to boot ROM...
U-Boot SPL 2020.01 (Mar 31 2020 - 18:19:43 -0600)
Trying to boot from MMC2
INFO: GICv3 with legacy support detected. ARM GICv3 driver initialized in EL3
INFO: BL31: cortex_a53: CPU workaround for 855873 was applied
INFO: BL31: Preparing for EL3 exit to normal world
INFO: Entry point address = 0x200000
INFO: SPSR = 0x3c9
U-Boot 2020.01 (Mar 31 2020 - 18:19:43 -0600)
Model: Pine64 RockPro64
DRAM: 3.9 GiB
PMIC: RK808
MMC: dwmmc@fe320000: 1, sdhci@fe330000: 0
Loading Environment from MMC... *** Warning - bad CRC, using default environment
In: serial@ff1a0000
Out: serial@ff1a0000
Err: serial@ff1a0000
Model: Pine64 RockPro64
rockchip_dnl_key_pressed: adc_channel_single_shot fail!
Net: eth0: ethernet@fe300000
Hit any key to stop autoboot: 0
u-boot: erase SPI flash#
Erase SPI flash, so that it is no longer used at boot time.
at the u-boot prompt:
sf probe
sf erase 0 400000
u-boot: detect the usb key#
at the u-boot prompt:
=> usb start
starting USB...
Bus usb@fe380000: USB EHCI 1.00
Bus usb@fe3c0000: USB EHCI 1.00
Bus dwc3: Register 2000140 NbrPorts 2
Starting the controller
USB XHCI 1.10
Bus dw3c:Register 2000140 NbrPorts 2
Starting the controller
USB XHCI 1.10
scanning bus usb@fe380000 for devices... 1 USB Device(s) found
scanning bus usb@fe3c0000 for devices... 2 USB Device(s) found
scanning bus dwc3 for devices... 1 USB Device(s) found
scanning bus dwc3 for devices... 1 USB Device(s) found
scanning usb for storage devices... 1 Storage Device(s) found
u-boot: boot phase#
At the u-boot prompt, issue the boot command.
=> boot
switch to partitions #0, OK
mmc0(part 0) is current device
Scanning mmc 0:1...
Found EFI removable media binary efi/boot/bootaa64.efi
libfdt fdt_check_header(): FDT_ERR_BADMAGIC
Card did not respond to voltage select!
Scanning disk dwmmc@fe320000.blk...
Disk dwmmc@fe320000.blk not ready
Scanning disk sdhci@fe330000.blk...
** Unrecognized filesystem type **
Scanning disk usb_mass_storage.lun0...
** Unrecognized filesystem type **
Found 6 disks
BootOrder not defined
EFI boot manager: Cannot load any image
168758 bytes read in 55 ms (2.9 MiB/s)
libfdt fdt_check_header(): FDT_ERR_BADMAGIC
disks: sd0* sd1
Schedule boot on USB#
>> OpenBSD/arm64 BOOTAA64 0.21
boot> boot sd1a:/bsd
(...)
bootfile: sd1a:/bsd
boot device: sd1
root on rd0a swap on rd0b dump on rd0b
erase ^?, werase ^W, kill ^U, intr ^C, status ^T
Welcome to the OpenBSD/arm64 6.7 installation program.
(I)nstall, (U)pgrade, (A)utoinstall or (S)hell?
Now it’s time to install OpenBSD using the classic installation procedure