Rockchip: new project

This commit is contained in:
Jonas Karlman 2017-11-01 22:57:41 +01:00
parent 20f2322755
commit 877fceee50
14 changed files with 488 additions and 0 deletions

View File

@ -0,0 +1,16 @@
# Rockchip
This project is for Rockchip SoC devices
## Devices
**My single-board computer is not listed, will it be added in the future?**<br />
If your single-board computer uses a current generation SoC listed on http://opensource.rock-chips.com/wiki_Main_Page the odds are in your favor.
**My Android device is not listed, will it be added in the future?**<br />
You may have luck if your device vendor is open source friendly, otherwise keep using Android for best support.
## Links
* https://github.com/rockchip-linux
* http://opensource.rock-chips.com

View File

@ -0,0 +1,24 @@
################################################################################
# This file is part of LibreELEC - https://libreelec.tv
# Copyright (C) 2017-present Team LibreELEC
#
# LibreELEC is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
# LibreELEC is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with LibreELEC. If not, see <http://www.gnu.org/licenses/>.
################################################################################
# Allow upgrades between arm and aarch64
if [ "$1" = "@PROJECT@.arm" -o "$1" = "@PROJECT@.aarch64" ]; then
exit 0
else
exit 1
fi

View File

@ -0,0 +1,68 @@
################################################################################
# This file is part of LibreELEC - https://libreelec.tv
# Copyright (C) 2017-present Team LibreELEC
#
# LibreELEC is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
# LibreELEC is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with LibreELEC. If not, see <http://www.gnu.org/licenses/>.
################################################################################
PKG_RKBIN="$(get_build_dir rkbin)"
case "$UBOOT_SYSTEM" in
rk3036)
PKG_DATAFILE="spl/u-boot-spl-nodtb.bin"
PKG_LOADER="u-boot-dtb.bin"
;;
rk3328)
PKG_DATAFILE="$PKG_RKBIN/rk33/rk3328_ddr_786MHz_v1.08.bin"
PKG_LOADER="$PKG_RKBIN/rk33/rk3328_miniloader_v2.44.bin"
PKG_BL31="$PKG_RKBIN/rk33/rk3328_bl31_v1.34.bin"
;;
rk3399)
PKG_DATAFILE="$PKG_RKBIN/rk33/rk3399_ddr_800MHz_v1.08.bin"
PKG_LOADER="$PKG_RKBIN/rk33/rk3399_miniloader_v1.06.bin"
PKG_BL31="$PKG_RKBIN/rk33/rk3399_bl31_v1.00.elf"
;;
*)
PKG_DATAFILE="spl/u-boot-spl-dtb.bin"
PKG_LOADER="u-boot-dtb.bin"
;;
esac
if [ -n "$PKG_DATAFILE" -a -n "$PKG_LOADER" ]; then
tools/mkimage -n $UBOOT_SYSTEM -T rksd -d "$PKG_DATAFILE" idbloader.img
cat "$PKG_LOADER" >> idbloader.img
cp -av idbloader.img $INSTALL/usr/share/bootloader
fi
if [ -n "$PKG_BL31" ]; then
$PKG_RKBIN/tools/loaderimage --pack --uboot u-boot-dtb.bin uboot.img 0x200000
cp -av uboot.img $INSTALL/usr/share/bootloader
cat >trust.ini <<EOF
[BL30_OPTION]
SEC=0
[BL31_OPTION]
SEC=1
PATH=$PKG_BL31
ADDR=0x00010000
[BL32_OPTION]
SEC=0
[BL33_OPTION]
SEC=0
[OUTPUT]
PATH=trust.img
EOF
$PKG_RKBIN/tools/trust_merger --verbose trust.ini
cp -av trust.img $INSTALL/usr/share/bootloader
fi

View File

@ -0,0 +1,30 @@
################################################################################
# This file is part of LibreELEC - https://libreelec.tv
# Copyright (C) 2017-present Team LibreELEC
#
# LibreELEC is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
# LibreELEC is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with LibreELEC. If not, see <http://www.gnu.org/licenses/>.
################################################################################
if [ -f "$RELEASE_DIR/3rdparty/bootloader/idbloader.img" ]; then
echo "image: burn idbloader.img to image..."
dd if="$RELEASE_DIR/3rdparty/bootloader/idbloader.img" of="$DISK" bs=32k seek=1 conv=fsync,notrunc >"$SAVE_ERROR" 2>&1 || show_error
fi
if [ -f "$RELEASE_DIR/3rdparty/bootloader/uboot.img" ]; then
echo "image: burn uboot.img to image..."
dd if="$RELEASE_DIR/3rdparty/bootloader/uboot.img" of="$DISK" bs=64k seek=128 conv=fsync,notrunc >"$SAVE_ERROR" 2>&1 || show_error
fi
if [ -f "$RELEASE_DIR/3rdparty/bootloader/trust.img" ]; then
echo "image: burn trust.img to image..."
dd if="$RELEASE_DIR/3rdparty/bootloader/trust.img" of="$DISK" bs=64k seek=192 conv=fsync,notrunc >"$SAVE_ERROR" 2>&1 || show_error
fi

View File

@ -0,0 +1,38 @@
################################################################################
# This file is part of LibreELEC - https://libreelec.tv
# Copyright (C) 2017-present Team LibreELEC
#
# LibreELEC is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
# LibreELEC is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with LibreELEC. If not, see <http://www.gnu.org/licenses/>.
################################################################################
mkdir -p $RELEASE_DIR/3rdparty/bootloader
if [ -n "$UBOOT_SYSTEM" ]; then
BOOTLOADER_DIR=$(get_build_dir $BOOTLOADER)
if [ -f $BOOTLOADER_DIR/idbloader.img ]; then
cp -a $BOOTLOADER_DIR/idbloader.img $RELEASE_DIR/3rdparty/bootloader
fi
if [ -f $BOOTLOADER_DIR/uboot.img ]; then
cp -a $BOOTLOADER_DIR/uboot.img $RELEASE_DIR/3rdparty/bootloader
fi
if [ -f $BOOTLOADER_DIR/trust.img ]; then
cp -a $BOOTLOADER_DIR/trust.img $RELEASE_DIR/3rdparty/bootloader
fi
fi
LINUX_DTS_DIR=$(get_build_dir linux)/arch/$TARGET_KERNEL_ARCH/boot/dts
for dtb in $LINUX_DTS_DIR/*.dtb $LINUX_DTS_DIR/*/*.dtb; do
if [ -f $dtb ]; then
cp -a $dtb $RELEASE_DIR/3rdparty/bootloader
fi
done

View File

@ -0,0 +1,65 @@
################################################################################
# This file is part of LibreELEC - https://libreelec.tv
# Copyright (C) 2017-present Team LibreELEC
#
# LibreELEC is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
# LibreELEC is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with LibreELEC. If not, see <http://www.gnu.org/licenses/>.
################################################################################
[ -z "$SYSTEM_ROOT" ] && SYSTEM_ROOT=""
[ -z "$BOOT_ROOT" ] && BOOT_ROOT="/flash"
[ -z "$BOOT_PART" ] && BOOT_PART=$(df "$BOOT_ROOT" | tail -1 | awk {' print $1 '})
if [ -z "$BOOT_DISK" ]; then
case $BOOT_PART in
/dev/sd[a-z][0-9]*)
BOOT_DISK=$(echo $BOOT_PART | sed -e "s,[0-9]*,,g")
;;
/dev/mmcblk*)
BOOT_DISK=$(echo $BOOT_PART | sed -e "s,p[0-9]*,,g")
;;
esac
fi
# mount $BOOT_ROOT r/w
mount -o remount,rw $BOOT_ROOT
# update device tree
for all_dtb in $BOOT_ROOT/*.dtb; do
dtb=$(basename $all_dtb)
if [ -f $SYSTEM_ROOT/usr/share/bootloader/$dtb ]; then
echo -n "Updating $dtb... "
cp -p $SYSTEM_ROOT/usr/share/bootloader/$dtb $BOOT_ROOT
echo "done"
fi
done
# update bootloader
if [ -f $SYSTEM_ROOT/usr/share/bootloader/idbloader.img ]; then
echo -n "Updating idbloader.img... "
dd if=$SYSTEM_ROOT/usr/share/bootloader/idbloader.img of=$BOOT_DISK bs=32k seek=1 conv=fsync &>/dev/null
echo "done"
fi
if [ -f $SYSTEM_ROOT/usr/share/bootloader/uboot.img ]; then
echo -n "Updating uboot.img... "
dd if=$SYSTEM_ROOT/usr/share/bootloader/uboot.img of=$BOOT_DISK bs=64k seek=128 conv=fsync &>/dev/null
echo "done"
fi
if [ -f $SYSTEM_ROOT/usr/share/bootloader/trust.img ]; then
echo -n "Updating trust.img... "
dd if=$SYSTEM_ROOT/usr/share/bootloader/trust.img of=$BOOT_DISK bs=64k seek=192 conv=fsync &>/dev/null
echo "done"
fi
# mount $BOOT_ROOT r/o
sync
mount -o remount,ro $BOOT_ROOT

View File

@ -0,0 +1,24 @@
[Unit]
Description=Debug Shell on /dev/ttyS2
DefaultDependencies=no
ConditionKernelCommandLine=|console=ttyS2
ConditionKernelCommandLine=|console=uart8250,mmio32,0xff130000
ConditionKernelCommandLine=|console=uart8250,mmio32,0xff1a0000
ConditionKernelCommandLine=|console=uart8250,mmio32,0xff690000
[Service]
WorkingDirectory=/storage
Environment="ENV=/etc/profile"
ExecStartPre=/bin/sh -c 'echo -en "\033[?25h"'
ExecStart=/bin/sh
Restart=always
RestartSec=0
StandardInput=tty
TTYPath=/dev/ttyS2
KillMode=process
IgnoreSIGPIPE=no
# bash ignores SIGTERM
KillSignal=SIGHUP
[Install]
WantedBy=sysinit.target

View File

@ -0,0 +1,34 @@
#
# Configuration for HDMI
#
<confdir:pcm/hdmi.conf>
HDMI.pcm.hdmi.0 {
@args [ CARD AES0 AES1 AES2 AES3 ]
@args.CARD { type string }
@args.AES0 { type integer }
@args.AES1 { type integer }
@args.AES2 { type integer }
@args.AES3 { type integer }
type hooks
slave.pcm {
type hw
card $CARD
device 0
}
hooks.0 {
type ctl_elems
hook_args [
{
interface MIXER
name "IEC958 Playback Default"
lock true
preserve true
optional true
value [ $AES0 $AES1 $AES2 $AES3 ]
}
]
}
hint.device 0
}

View File

@ -0,0 +1,12 @@
#
# Configuration for I2S
#
<confdir:pcm/front.conf>
I2S.pcm.front.0 {
@args [ CARD ]
@args.CARD { type string }
type hw
card $CARD
}

View File

@ -0,0 +1,34 @@
#
# Configuration for SPDIF
#
<confdir:pcm/iec958.conf>
SPDIF.pcm.iec958.0 {
@args [ CARD AES0 AES1 AES2 AES3 ]
@args.CARD { type string }
@args.AES0 { type integer }
@args.AES1 { type integer }
@args.AES2 { type integer }
@args.AES3 { type integer }
type hooks
slave.pcm {
type hw
card $CARD
device 0
}
hooks.0 {
type ctl_elems
hook_args [
{
interface MIXER
name "IEC958 Playback Default"
lock true
preserve true
optional true
value [ $AES0 $AES1 $AES2 $AES3 ]
}
]
}
hint.device 0
}

View File

@ -0,0 +1,37 @@
<?xml version="1.0" encoding="utf-8"?>
<settings version="1">
<section id="system">
<category id="display">
<group id="1">
<setting id="videoscreen.blankdisplays">
<visible>false</visible>
</setting>
<setting id="videoscreen.fakefullscreen">
<visible>false</visible>
</setting>
</group>
<group id="3">
<setting id="videoscreen.noofbuffers">
<default>2</default>
<visible>false</visible>
</setting>
</group>
</category>
<category id="logging">
<group id="1">
<setting id="debug.extralogging">
<default>false</default>
</setting>
</group>
</category>
</section>
<section id="player">
<category id="videoplayer">
<group id="2">
<setting id="videoplayer.adjustrefreshrate">
<default>2</default>
</setting>
</group>
</category>
</section>
</settings>

76
projects/Rockchip/options Normal file
View File

@ -0,0 +1,76 @@
################################################################################
# setup system defaults
################################################################################
# Bootloader to use (syslinux / u-boot / bcm2835-bootloader)
BOOTLOADER="u-boot"
# Kernel extra targets to build
KERNEL_UBOOT_EXTRA_TARGET=""
# Kernel to use. values can be:
# default: default mainline kernel
LINUX="${LINUX:-rockchip-4.4}"
################################################################################
# setup build defaults
################################################################################
# Project CFLAGS
PROJECT_CFLAGS=""
# SquashFS compression method (gzip / lzo / xz)
SQUASHFS_COMPRESSION="lzo"
################################################################################
# setup project defaults
################################################################################
# build and install ALSA Audio support (yes / no)
ALSA_SUPPORT="yes"
# OpenGL(X) implementation to use (no / mesa)
OPENGL="no"
# OpenGL-ES implementation to use (no / bcm2835-driver / gpu-viv-bin-mx6q)
OPENGLES="mali-rockchip"
# include uvesafb support (yes / no)
UVESAFB_SUPPORT="no"
# Displayserver to use (weston / no)
DISPLAYSERVER="no"
# Windowmanager to use (ratpoison / fluxbox / none)
WINDOWMANAGER="none"
# Xorg Graphic drivers to use (all / i915,i965,r200,r300,r600,nvidia)
# Space separated list is supported,
# e.g. GRAPHIC_DRIVERS="i915 i965 r300 r600 radeonsi nvidia"
GRAPHIC_DRIVERS=""
# KODI Player implementation to use (default / bcm2835-driver / libfslvpuwrap)
KODIPLAYER_DRIVER="rkmpp"
# Modules to install in initramfs for early boot
INITRAMFS_MODULES=""
# additional Firmware to use (dvb-firmware, misc-firmware, wlan-firmware)
# Space separated list is supported,
# e.g. FIRMWARE="dvb-firmware misc-firmware wlan-firmware"
FIRMWARE="misc-firmware wlan-firmware dvb-firmware"
# additional packages to install
ADDITIONAL_PACKAGES="dtc"
# build and install ATV IR remote support (yes / no)
ATVCLIENT_SUPPORT="no"
# build and install CEC framework support (yes / no)
CEC_FRAMEWORK_SUPPORT="yes"
# build with installer (yes / no)
INSTALLER_SUPPORT="no"
# Start boot partition at 16MiB, same as https://github.com/rockchip-linux/build images
SYSTEM_PART_START=32768

View File

@ -0,0 +1,27 @@
From a968000cae7b5d0c3c10b4e5a94fd187c891ee08 Mon Sep 17 00:00:00 2001
From: Jonas Karlman <jonas@kwiboo.se>
Date: Wed, 27 Dec 2017 22:01:06 +0100
Subject: [PATCH] Revert "rk: add gcc-wrapper"
This reverts part of commit 7a51384d24fe4da183fc15b2d17aa3c153b822e7.
---
Makefile | 6 ------
1 file changed, 6 deletions(-)
diff --git a/Makefile b/Makefile
index a785aeed4674..d34c20a89fb7 100644
--- a/Makefile
+++ b/Makefile
@@ -372,12 +372,6 @@ PERL = perl
PYTHON = python
CHECK = sparse
-# Use the wrapper for the compiler. This wrapper scans for new
-# warnings and causes the build to stop upon encountering them.
-ifneq ($(wildcard $(srctree)/scripts/gcc-wrapper.py),)
-CC = $(srctree)/scripts/gcc-wrapper.py $(CROSS_COMPILE)gcc
-endif
-
CHECKFLAGS := -D__linux__ -Dlinux -D__STDC__ -Dunix -D__unix__ \
-Wbitwise -Wno-return-void $(CF)
CFLAGS_MODULE =

View File

@ -8,6 +8,9 @@ devices = {
'board_name' : { 'dtb' : 'board_name.dtb', 'config' : 'board_name_defconfig' },
},
},
'Rockchip' : {
},
}
def usage():