armbian-build/config/sources/families/rk322x.conf
Paolo 23604e8a0d
Introducing Rockchip RK322X SoC support (#2032)
* Introducing Rockchip rk322x SoC support

Main features:

- Legacy kernel flavour based upon stable v2.x rk3288 Rockchip branch (https://github.com/rockchip-linux/kernel/tree/stable-4.4-rk3288-linux-v2.x)
- Current kernel flavour based on mainline 5.6.y kernel
- Mainline u-boot (v2020.04)
- Single generic tv box target (rk322x-box) which boots on all the known tv boxes
- Hardware devices (eMMC/NAND, led wiring configuration, SoC variant selection) modulation done by user at runtime via device tree overlays - a script (rk322x-config) is provided for autodetection and simple configuration by inexperienced users;
- Bits added to armbian-hardware-optimization to set affinity for irq handlers
- rk322x-box targets already added to targets.conf for automatic image creation

* Removed disabled patches
* Restored mysteriously removed comment character
2020-06-19 17:27:27 +02:00

121 lines
3.9 KiB
Plaintext

BOOTSCRIPT="boot-rk322x.cmd:boot.cmd"
BOOTENV_FILE='rk322x-default.txt'
OVERLAY_PREFIX='rk322x'
UBOOT_TARGET_MAP="all u-boot.itb;;u-boot-rk322x-with-spl.bin"
UBOOT_USE_GCC='< 9.0'
BOOTDELAY=0
BOOTBRANCH='tag:v2020.04'
SERIALCON=ttyS2
case $BRANCH in
legacy)
KERNELSOURCE='https://github.com/rockchip-linux/kernel.git'
KERNELBRANCH='branch:stable-4.4-rk3288-linux-v2.x'
KERNELDIR='linux-rockchip'
KERNEL_USE_GCC='> 8.0'
;;
current)
KERNELBRANCH='branch:linux-5.6.y'
AUFS=no
;;
dev)
KERNELBRANCH='branch:master'
;;
esac
CPUMIN="600000"
CPUMAX="1500000"
GOVERNOR="ondemand"
write_uboot_platform()
{
dd if=/dev/zero of=$2 bs=1k count=1023 seek=1 status=noxfer > /dev/null 2>&1
dd if=$1/u-boot-rk322x-with-spl.bin of=$2 seek=64 conv=notrunc > /dev/null 2>&1
}
uboot_custom_postprocess()
{
# We use the rockchip proprietary blob to initialize memory chips
# instead of letting u-boot doing the job. Such devices, like xt-mx4vr-v01, have DDR2
# or LPDDR2 memories and the blob is better suited for the job.
# Also it may come handy when there are different memory flavours among boards, with
# different timings, specs and frequencies.
# The rockchip proprietary blob is a drop-in substitute for the u-boot tpl.
# In case you want to use the u-boot TPL remember to set the proper timing
# registers in device tree and this command line instead of the other one:
#
# tools/mkimage -n rk322x -T rksd -d tpl/u-boot-tpl.bin u-boot-rk322x-with-spl.bin
#
tools/mkimage -n rk322x -T rksd -d $SRC/packages/blobs/rockchip/rk322x_ddr2_300_ddr3_600_v1.09.bin u-boot-rk322x-with-spl.bin
cat spl/u-boot-spl.bin >> u-boot-rk322x-with-spl.bin
dd if=u-boot.itb of=u-boot-rk322x-with-spl.bin seek=$((0x200 - 0x40)) conv=notrunc
}
family_tweaks()
{
true
}
family_tweaks_bsp()
{
#Graphics and media
mkdir -p $destination/etc/udev/rules.d
mkdir -p $destination/usr/local/bin
cp $SRC/packages/bsp/rockchip/hdmi.rules $destination/etc/udev/rules.d
cp $SRC/packages/bsp/rockchip/50-hevc.rules $destination/etc/udev/rules.d
cp $SRC/packages/bsp/rockchip/50-mali.rules $destination/etc/udev/rules.d
cp $SRC/packages/bsp/rockchip/50-vpu.rules $destination/etc/udev/rules.d
cp $SRC/packages/bsp/rk322x/50-rkvdec.rules $destination/etc/udev/rules.d
cp $SRC/packages/bsp/rockchip/60-media.rules $destination/etc/udev/rules.d
install -m 755 $SRC/packages/bsp/rockchip/hdmi-hotplug $destination/usr/local/bin
# Peripheral access for specific groups
addgroup --system --quiet --gid 997 gpio
addgroup --system --quiet --gid 998 i2c
cp $SRC/packages/bsp/rockchip/70-gpio.rules $destination/etc/udev/rules.d
cp $SRC/packages/bsp/rockchip/71-i2c.rules $destination/etc/udev/rules.d
# Bluetooth
install -m 755 $SRC/packages/bsp/rockchip/rtk_hciattach $destination/usr/bin
install -m 755 $SRC/packages/bsp/rockchip/start_bt.sh $destination/usr/local/bin
cp $SRC/packages/bsp/rockchip/tinker-bluetooth.service $destination/lib/systemd/system/
# Sound
cp $SRC/packages/bsp/rockchip/asound.conf $destination/etc/
cp $SRC/packages/bsp/rockchip/89-pulseaudio-usb.rules $destination/etc/udev/rules.d
# For rk322x boards copy ssv6051 wifi firmware files to /etc/firmware
# We don't want to copy it into /lib/firmware to not interfere with armbian
# firmware deb package, so for now put them in a separate position
mkdir -p $destination/etc/firmware
cp $SRC/packages/blobs/ssv6051/ssv6051-wifi.cfg $destination/etc/firmware
cp $SRC/packages/blobs/ssv6051/ssv6051-sw.bin $destination/etc/firmware
echo "options ssv6051 stacfgpath=/etc/firmware/ssv6051-wifi.cfg cfgfirmwarepath=/etc/firmware/" > $destination/etc/modprobe.d/ssv6051.conf
# Board selection script
install -m 755 $SRC/packages/bsp/rk322x/rk322x-config $destination/usr/local/bin
# Fix for bad device detection for x.org when lima driver is in use
if [[ "$BRANCH" != "legacy" ]]; then
mkdir -p $destination/etc/X11/xorg.conf.d
cp $SRC/packages/bsp/rk322x/40-serverflags.conf $destination/etc/X11/xorg.conf.d
fi
}