CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
orangepi-xunlong

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.

GitHub Repository: orangepi-xunlong/orangepi-build
Path: blob/next/external/config/sources/families/rockchip.conf
Views: 3960
1
ARCH=armhf
2
BOOTSCRIPT="boot-rockchip.cmd:boot.cmd"
3
BOOTENV_FILE='rockchip.txt'
4
OVERLAY_PREFIX='rockchip'
5
UBOOT_TARGET_MAP=";;$SRC/packages/blobs/rockchip/rk3288_boot.bin u-boot-rockchip-with-spl.bin"
6
BOOTDELAY=1
7
if [[ $BOARD == miqi ]]; then
8
BOOTBRANCH='tag:v2017.11'
9
elif [[ $BOARD == xt-q8l-v10 ]]; then
10
BOOTBRANCH='tag:v2020.04'
11
else
12
BOOTBRANCH='tag:v2018.11'
13
fi
14
15
SERIALCON=ttyS2
16
17
case $BRANCH in
18
19
legacy)
20
21
KERNELSOURCE='https://github.com/rockchip-linux/kernel.git'
22
KERNELBRANCH='branch:stable-4.4-rk3288-linux'
23
KERNELDIR='linux-rockchip'
24
25
;;
26
27
current)
28
29
KERNELBRANCH='branch:linux-5.7.y'
30
31
;;
32
33
dev)
34
35
KERNELBRANCH='branch:linux-5.7.y'
36
37
;;
38
39
esac
40
41
CPUMIN="600000"
42
CPUMAX="1900000"
43
GOVERNOR="ondemand"
44
45
write_uboot_platform()
46
{
47
dd if=/dev/zero of=$2 bs=1k count=1023 seek=1 status=noxfer > /dev/null 2>&1
48
dd if=$1/u-boot-rockchip-with-spl.bin of=$2 seek=64 conv=notrunc > /dev/null 2>&1
49
}
50
51
uboot_custom_postprocess()
52
{
53
54
# xt-q8l-v10 requires the original DDR init blob because u-boot does not support LPDDR2 initialization
55
# for rk3288 SoC (binary is in sources/rkbin-tools/rk32 path). U-boot is configured to produce a TPL
56
# which is thrown away. SPL does some more initial configurations, expecially pinmux for power hold,
57
# so reset works more reliably. U-boot image is set to be at sector 0x200 on the eMMC/SD,
58
# so we burn it 0x200-0x40 because of the rockchip 0x40 sectors offset.
59
if [[ $BOARD == xt-q8l-v10 ]]; then
60
tools/mkimage -n rk3288 -T rksd -d $SRC/cache/sources/rkbin-tools/rk32/rk3288_ddr_400MHz_v1.08.bin u-boot-rockchip-with-spl.bin
61
cat spl/u-boot-spl-dtb.bin >> u-boot-rockchip-with-spl.bin
62
dd if=u-boot-dtb.img of=u-boot-rockchip-with-spl.bin seek=$((0x200 - 0x40)) conv=notrunc
63
else
64
tools/mkimage -n rk3288 -T rksd -d spl/u-boot-spl-dtb.bin u-boot-rockchip-with-spl.bin
65
cat u-boot-dtb.bin >> u-boot-rockchip-with-spl.bin
66
fi
67
68
}
69
70
family_tweaks()
71
{
72
if [[ $BOARD == tinkerboard ]]; then
73
chroot $SDCARD /bin/bash -c "apt-get -y -qq install rfkill bluetooth bluez bluez-tools"
74
chroot $SDCARD /bin/bash -c "systemctl --no-reload enable tinker-bluetooth.service >/dev/null 2>&1"
75
sed -i -e "/#load-module module-alsa-sink/r $SRC/packages/bsp/rockchip/pulseaudio.txt" $SDCARD/etc/pulse/default.pa >/dev/null 2>&1
76
fi
77
78
if [[ $BOARD == xt-q8l-v10 ]]; then
79
mkdir -p $SDCARD/etc/firmware/
80
ln -sf /lib/firmware/brcm/BCM4330B1.hcd $SDCARD/etc/firmware
81
chroot $SDCARD /bin/bash -c "systemctl --no-reload enable ap6330-bluetooth.service >/dev/null 2>&1"
82
fi
83
}
84
85
family_tweaks_bsp()
86
{
87
#Graphics and media
88
mkdir -p $destination/etc/udev/rules.d
89
mkdir -p $destination/usr/local/bin
90
cp $SRC/packages/bsp/rockchip/hdmi.rules $destination/etc/udev/rules.d
91
cp $SRC/packages/bsp/rockchip/50-hevc.rules $destination/etc/udev/rules.d
92
cp $SRC/packages/bsp/rockchip/50-mali.rules $destination/etc/udev/rules.d
93
cp $SRC/packages/bsp/rockchip/50-vpu.rules $destination/etc/udev/rules.d
94
cp $SRC/packages/bsp/rockchip/60-media.rules $destination/etc/udev/rules.d
95
install -m 755 $SRC/packages/bsp/rockchip/hdmi-hotplug $destination/usr/local/bin
96
97
# Peripheral access for specific groups
98
addgroup --system --quiet --gid 997 gpio
99
addgroup --system --quiet --gid 998 i2c
100
cp $SRC/packages/bsp/rockchip/70-gpio.rules $destination/etc/udev/rules.d
101
cp $SRC/packages/bsp/rockchip/71-i2c.rules $destination/etc/udev/rules.d
102
103
# Bluetooth
104
install -m 755 $SRC/packages/bsp/rockchip/rtk_hciattach $destination/usr/bin
105
install -m 755 $SRC/packages/bsp/rockchip/start_bt.sh $destination/usr/local/bin
106
cp $SRC/packages/bsp/rockchip/tinker-bluetooth.service $destination/lib/systemd/system/
107
108
# Sound
109
cp $SRC/packages/bsp/rockchip/asound.conf $destination/etc/
110
cp $SRC/packages/bsp/rockchip/89-pulseaudio-usb.rules $destination/etc/udev/rules.d
111
112
# ap6330 bluetooth (required for xt-q8l-v10)
113
cp $SRC/packages/bsp/rockchip/ap6330-bluetooth.service $destination/lib/systemd/system/
114
115
}
116
117