TerraMaster F2-210 code
This repo contains various bits of code related to the TerraMaster F2-210.
!!!!! Development has stalled !!!!!
Assuming cross-compile installed.
export CROSS_COMPILE=aarch64-linux-gnu-
ARCH=arm64 make distclean
ARCH=arm64 make realtek_defconfig
ARCH=arm64 make -j 8
For testing purposes, a kernel image can be loaded by:
mkimage -A arm64 -O linux -T kernel -C gzip -a 0x04000000 -e 0x04000000 -n "Test kernel" -d <kernel dir>/arch/arm64/boot/Image.gz uImage.krnl
Load Kernel:
loady 0x08000000 (kernel uImage)
loady 0x02100000 (fdt dtb)
setenv bootargs 'earlycon=uart8250,mmio32,0x98007800 console=ttyS0,115200 loglevel=7 debug clk_ignore_unused pd_ignore_unused'
bootm 0x08000000 - 0x02100000
Installing Debian. From the ARM64 installer ISO, get 'initrd.gz' from '/install.a64/'.
mkimage -A arm64 -O linux -T kernel -C gzip -a 0x06000000 -e 0x06000000 -n "5.4 kernel" -d Image.gz uImage.F2-210.kernel
mkimage -A arm64 -O linux -T ramdisk -C none -a 0x2200000 -n "Debian Installer" -d initrd.gz uImage.F2-210.di-initrd
Load Kernel/InitRD:
loady 0x08000000 (kernel uImage)
loady 0x18000000 (initrd uImage)
loady 0x02100000 (fdt dtb)
setenv initrd_high 0xffffffffffffffff
setenv bootargs 'earlycon=uart8250,mmio32,0x98007800 console=ttyS0,115200 loglevel=7 debug clk_ignore_unused pd_ignore_unused'
bootm 0x08000000 0x18000000 0x02100000
Add 'DEBIAN_FRONTEND=text' to the bootargs, to get a simpler interface (if you've only got a basic terminal that doesn't support ncurses).
loady 0x08000000 (kernel) loady 0x02100000 (fdt) setenv bootargs 'earlycon=uart8250,mmio32,0x98007800 console=ttyS0,115200 clk_ignore_unused pd_ignore_unused root=/dev/sda2 ro' bootm 0x08000000 - 0x02100000
Drivers already exist for:
- RTC
- Watchdog
- R8169 (PCI)
Should probably replace Realtek's, with main line drivers.
Code stub to write an 'H' to the serial port (good for debugging early stage kernel).
mov x23, #'H'
# mov x24, #0x98007800
ldr x24, =(0x98007800)
strb w23, [x24]