Rockpro64 and stock arch linux
#1
I've gotten the stock rootfs running on the Rockpro64 SBC, using steps from a variety of sources. If desired, I'll try to hunt down the locations. Steps below:

Section 1 - Making a Good SPL

0. Perform these steps from a functional image, on the board, such as Armbian
    -note: may need to "apt-get install gcc-arm-none-eabi binutils-arm-none-eabi"

1. Get u-boot, cd into the folder
    #git clone https://gitlab.denx.de/u-boot/u-boot.git
    #cd u-boot
    #make clean

2. Get, make the Trusted code, copy it into the u-boot folder
    #git clone https://github.com/ARM-software/arm-trus...rmware.git atf
    #make -C atf PLAT=rk3399 bl31
    #cp bl31.elf ../

3. Make u-boot
    #make rockpro64-rk3399_defconfig
    #make ARCH=arm -j7


4. Write loaders to disk, or copy them to storage for Section 2
    #tools/mkimage -n rk3399 -T rksd -d tpl/u-boot-tpl-dtb.bin tpl-spl.img
    #cat spl/u-boot-spl-dtb.bin >> tpl-spl.img
    #dd if=tpl-spl.img of=/dev/mmcblkN seek=64 conv=fsync
    #dd if=u-boot.itb of=/dev/mmcblkN seek=16384 conv=fsync

Section 2 - Install Arch

0. This must be performed from a different computer, make sure uboot-tools is installed

1. Zero the beginning of the SD card:

    #dd if=/dev/zero of=/dev/sdX bs=1M count=32

2. Start fdisk to partition the SD card:

    #fdisk /dev/sdX

3. At the fdisk prompt, create the new partition:

    Type o. This will clear out any partitions on the drive.
    Type n, then p for primary, 1 for the first partition on the drive, 32768 for the first sector, and then +4G
    -this creates a 4G partition
    Write the partition table and exit by typing w.

4 . Create the ext4 filesystem:

    #mkfs.ext4 /dev/sdX1

5. Mount the filesystem:

    #mkdir something
    #mount /dev/sdX1 something

5. Download and extract the root filesystem (as root, not via sudo):

    #wget http://os.archlinuxarm.org/os/ArchLinuxA...est.tar.gz
    #tar -xpf ArchLinuxARM-aarch64-latest.tar.gz -C something

6. Use this as boot.txt, place in something/boot/
    
 
Code:
   # MAC address (use spaces instead of colons)
    setenv macaddr da 19 c8 7a 6d f4
    
    part uuid ${devtype} ${devnum}:${bootpart} uuid
    setenv bootargs console=ttyS2,1500000 root=PARTUUID=${uuid} rw rootwait
    setenv fdtfile rockchip/rk3399-rockpro64.dtb
    
    if load ${devtype} ${devnum}:${bootpart} ${kernel_addr_r} /boot/Image; then
      if load ${devtype} ${devnum}:${bootpart} ${fdt_addr_r} /boot/dtbs/${fdtfile}; then
        fdt addr ${fdt_addr_r}
        fdt resize
        fdt set /ethernet@fe300000 local-mac-address "[${macaddr}]"
        if load ${devtype} ${devnum}:${bootpart} ${ramdisk_addr_r} /boot/initramfs-linux.img; then
          # This upstream Uboot doesn't support compresses cpio initrd, use kernel option to
          # load initramfs
          setenv bootargs ${bootargs} initrd=${ramdisk_addr_r},20M ramdisk_size=10M
        fi;
        booti ${kernel_addr_r} - ${fdt_addr_r};
      fi;
    fi

7. in the something/boot/ directory, generate boot.scr from the boot.txt

    #mkimage -A arm -O linux -T script -C none -n "U-Boot boot script" -d boot.txt boot.scr

8. Unmount the partition

    #umount something

9. Write the bootloader to the sd card

    #dd if=tpl-spl.img of=/dev/sdX seek=64 conv=fsync
    #dd if=u-boot.itb of=/dev/sdX seek=16384 conv=fsync

10. Insert SD, apply voltage

11. Initialize the pacman keyring and populate the Arch Linux ARM package signing keys:

    #pacman-key --init
    #pacman-key --populate archlinuxarm

12. Update

    #pacman -Syu
    #pacman -S uboot-tools

Further Notes: hdmi may be kinda weird from the supplied boot.txt, depending on the monitor used.


Messages In This Thread
Rockpro64 and stock arch linux - by TaborFife - 09-21-2019, 04:29 PM
RE: Rockpro64 and stock arch linux - by Yoast - 11-29-2019, 12:18 PM
RE: Rockpro64 and stock arch linux - by Yoast - 01-02-2020, 09:25 AM
RE: Rockpro64 and stock arch linux - by dragop - 01-07-2020, 03:12 PM
RE: Rockpro64 and stock arch linux - by Yoast - 01-13-2020, 03:15 PM
RE: Rockpro64 and stock arch linux - by dragop - 01-15-2020, 05:17 PM
RE: Rockpro64 and stock arch linux - by abdel - 01-08-2020, 03:06 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  irradium (based on crux linux) RockPro64 riscv64, aarch64 mara 7 1,863 11-20-2024, 03:53 PM
Last Post: mara
  New OS for RockPro64 is here, TwisterOS Armbian jtremblant 92 105,589 08-17-2024, 02:32 PM
Last Post: taltamir
  OpenEuler OS on RockPro64 Yuriy Gavrilov 0 289 06-15-2024, 09:38 AM
Last Post: Yuriy Gavrilov
  yocto for RockPro64 Fide 1 1,108 01-16-2024, 10:01 AM
Last Post: Fide
  Installing Ubuntu Server on RockPro64 deutschlmao 2 3,458 10-29-2023, 04:43 PM
Last Post: brotherj4mes
Exclamation Ethernet regression on Linux Kernel 6.5.4? Deathcrow 3 1,482 09-22-2023, 04:27 AM
Last Post: diederik
  Vanilla mainline Debian 11 (Bullseye) on the RockPro64 Pete Tandy 22 21,257 08-16-2023, 01:34 AM
Last Post: varac
  slarm64 (unofficial slackware) ROCKPro64 RK3399 (aarch64) mara 54 92,844 08-11-2023, 11:13 AM
Last Post: mara
  Installing CH431SER on Ayufan 0.9.14: gitlab-ci-linux-build-159 Thisone 4 2,264 07-14-2023, 04:22 AM
Last Post: hunderteins
  How to enable CoreSight ETM trace on RockPro64 shpark 0 864 05-21-2023, 11:34 PM
Last Post: shpark

Forum Jump:


Users browsing this thread: 2 Guest(s)