This commit is contained in:
Thomas Kaiser 2016-02-26 12:49:52 +01:00
commit 01eea439f1
9 changed files with 107 additions and 18 deletions

Binary file not shown.

View file

@ -168,9 +168,9 @@ compile_sunxi_tools (){
cp fex2bin bin2fex /usr/local/bin/
make -s clean >/dev/null 2>&1
rm -f sunxi-fexc sunxi-nand-part
make $CTHREADS 'sunxi-nand-part' CC=arm-linux-gnueabihf-gcc >> $DEST/debug/install.log
make $CTHREADS 'sunxi-fexc' CC=arm-linux-gnueabihf-gcc >> $DEST/debug/install.log
make $CTHREADS 'meminfo' CC=arm-linux-gnueabihf-gcc >> $DEST/debug/install.log
make $CTHREADS 'sunxi-nand-part' CC=arm-linux-gnueabihf-gcc >> $DEST/debug/install.log 2>&1
make $CTHREADS 'sunxi-fexc' CC=arm-linux-gnueabihf-gcc >> $DEST/debug/install.log 2>&1
make $CTHREADS 'meminfo' CC=arm-linux-gnueabihf-gcc >> $DEST/debug/install.log 2>&1
}

View file

@ -27,7 +27,7 @@
# common options
REVISION="5.03" # all boards have same revision
REVISION="5.04" # all boards have same revision
ROOTPWD="1234" # Must be changed @first login
MAINTAINER="Igor Pecovnik" # deb signature
MAINTAINERMAIL="igor.pecovnik@****l.com" # deb signature
@ -438,7 +438,7 @@
KERNEL_DEFAULT_BRANCH="s500-master"
KERNEL_DEFAULT_SOURCE="linux-s500"
KERNEL_NEXT='https://github.com/LeMaker/linux-actions'
KERNEL_NEXT_BRANCH="linux-linaro-3.10.94-test"
KERNEL_NEXT_BRANCH="linux-3.10.y"
KERNEL_NEXT_SOURCE="linux-s500"
UBOOT_DEFAULT="https://github.com/LeMaker/u-boot-actions"
UBOOT_DEFAULT_BRANCH="s500-master"

View file

@ -229,7 +229,7 @@ EOF
module-init-tools mtp-tools nano ntfs-3g ntp parted pkg-config pciutils pv python-smbus rfkill rsync screen stress sudo subversion \
sysfsutils toilet u-boot-tools unattended-upgrades unzip usbutils vlan wireless-tools weather-util weather-util-data wget wpasupplicant \
iptables dvb-apps libdigest-sha-perl libproc-processtable-perl w-scan apt-transport-https sysbench libusb-dev dialog fake-hwclock \
console-setup console-data kbd console-common unicode-data openssh-server"
console-setup console-data kbd console-common unicode-data openssh-server man-db"
# release specific packages
# NOTE: wheezy doen't have f2fs-tools package available

View file

@ -135,7 +135,7 @@ device-tree-compiler dosfstools evtest figlet fbset fping git haveged hddtemp hd
iperf ir-keytable iotop iozone3 iw less libbluetooth-dev libbluetooth3 libtool libwrap0-dev libfuse2 libssl-dev lirc lsof makedev \
module-init-tools mtp-tools nano ntfs-3g ntp parted pkg-config pciutils pv python-smbus rfkill rsync screen stress sudo subversion \
sysfsutils toilet u-boot-tools unattended-upgrades unzip usbutils vlan wireless-tools weather-util weather-util-data wget \
wpasupplicant iptables dvb-apps libdigest-sha-perl libproc-processtable-perl w-scan apt-transport-https sysbench libusb-dev dialog fake-hwclock"
wpasupplicant iptables dvb-apps libdigest-sha-perl libproc-processtable-perl w-scan apt-transport-https sysbench libusb-dev dialog fake-hwclock man-db"
# additional distributios-specific packages
case $RELEASE in

View file

@ -185,4 +185,9 @@ touch $DEST/cache/sdcard/root/.not_logged_in_yet
# remove hostapd because it's replaced with ours
chroot $DEST/cache/sdcard /bin/bash -c "apt-get -y -qq remove hostapd >/dev/null 2>&1"
# install sunxi-tools
cp $SRC/lib/bin/sunxi-tools_1.3-1_armhf.deb $DEST/cache/sdcard/tmp/
# libusb dependency should already be satisfied by usbutils
chroot $DEST/cache/sdcard /bin/bash -c "dpkg -i /tmp/sunxi-tools_1.3-1_armhf.deb"
}

View file

@ -0,0 +1,12 @@
diff -Nur a/drivers/mmc/sunxi_mmc.c b/drivers/mmc/sunxi_mmc.c
--- a/drivers/mmc/sunxi_mmc.c 2016-02-25 10:30:30.000000000 +0800
+++ b//drivers/mmc/sunxi_mmc.c 2016-02-25 10:46:07.723851155 +0800
@@ -269,6 +269,6 @@
unsigned i;
unsigned *buff = (unsigned int *)(reading ? data->dest : data->src);
unsigned byte_cnt = data->blocksize * data->blocks;
- unsigned timeout_msecs = byte_cnt >> 8;
+ unsigned timeout_msecs = byte_cnt >> 6;
if (timeout_msecs < 2000)
timeout_msecs = 2000;

View file

@ -0,0 +1,12 @@
diff -Nur a/drivers/mmc/sunxi_mmc.c b/drivers/mmc/sunxi_mmc.c
--- a/drivers/mmc/sunxi_mmc.c 2016-02-25 10:30:30.000000000 +0800
+++ b//drivers/mmc/sunxi_mmc.c 2016-02-25 10:46:07.723851155 +0800
@@ -269,6 +269,6 @@
unsigned i;
unsigned *buff = (unsigned int *)(reading ? data->dest : data->src);
unsigned byte_cnt = data->blocksize * data->blocks;
- unsigned timeout_msecs = byte_cnt >> 8;
+ unsigned timeout_msecs = byte_cnt >> 6;
if (timeout_msecs < 2000)
timeout_msecs = 2000;

View file

@ -25,6 +25,10 @@
#
# CHANGES:
#
# v0.3: Added the ability to set the colour-range HDMI-output and spruced the
# output of h3disp in general with a splash of colour. Also, don't spit
# out so much text by default.
#
# v0.2: Added non-interactive mode. You can provide one or two arguments on
# the command line, eg. 'h3disp -m 1080p60 -d' (1920x1080@60Hz DVI) or
# 'h3disp -m 720i' (1280x720@30Hz HDMI). Complete list of modes via
@ -72,6 +76,17 @@ Main() {
:
else
ParseOptions "$@"
if [ -v ColourRange ]; then
re='^[0-9]+$'
if ! [[ ${ColourRange} =~ ${re} ]] ; then
echo "$0: Invalid colour-range specified, only values 0-2 are supported for now!"
exit 1
fi
if [[ ${ColourRange} -lt 0 || ${ColourRange} -gt 2 ]] ; then
echo "$0: Invalid colour-range specified, only values 0-2 are supported for now!"
exit 1
fi
fi
case ${VideoMode} in
0|480i) # res
HDMIMode=0
@ -134,8 +149,13 @@ Main() {
} # Main
ParseOptions() {
while getopts 'hvVdDm:M:' c ; do
while getopts 'hHvVdDm:M:c:C:' c ; do
case ${c} in
H)
export FullUsage=TRUE
DisplayUsage
exit 0
;;
h)
DisplayUsage
exit 0
@ -158,33 +178,64 @@ ParseOptions() {
# The HDMI mode in question
export VideoMode=${OPTARG}
;;
c|C)
# The colour-range in question
export ColourRange=${OPTARG}
;;
esac
done
} # ParseOptions
DisplayUsage() {
echo -e "Usage: ${0##*/} -m [video mode] [-d]\n"
echo -e "############################################################################\n"
echo "Detailed Description:"
# check if stdout is a terminal...
if test -t 1; then
# see if it supports colors...
ncolors=$(tput colors)
if test -n "$ncolors" && test $ncolors -ge 8; then
BOLD="$(tput bold)"
NC='\033[0m' # No Color
LGREEN='\033[1;32m'
fi
fi
echo -e "Usage: ${BOLD}${0##*/} [-h/-H] -m [video mode] [-d] [-c [0-2]]${NC}\n"
echo -e "############################################################################"
if [ ${FullUsage} ]; then
echo -e "\nDetailed Description:"
grep "^#" "$0" | grep -v "^#\!/bin/bash" | sed 's/^#//'
echo -e "\n Short summary: This is a tool to set the display resolution of your Orange"
fi
echo -e "\n This is a tool to set the display resolution of your Orange"
echo -e " Pi by patching script.bin.\n\n In case you use an HDMI-to-DVI converter\c"
echo -e " please use the -d switch.\n\n The resolution can be set using the -m switch.\c"
echo -e " please use the ${LGREEN}-d${NC} switch.\n\n The resolution can be set using the ${LGREEN}-m${NC} switch.\c"
echo -e " The following resolutions\n are currently supported:\n"
ShowVideoModes
echo -e " You can also specify the colour-range for your HDMI-display with the ${LGREEN}-c${NC} switch."
echo -e "\n The following values for ${LGREEN}-c${NC} are currently supported:\n"
echo -e " ${BOLD}0${NC} -- RGB range 16-255 (Default, use \"${LGREEN}-c 0${NC}\")"
echo -e " ${BOLD}1${NC} -- RGB range 0-255 (Full range, use \"${LGREEN}-c 1${NC}\")"
echo -e " ${BOLD}2${NC} -- RGB range 16-235 (Limited video, \"${LGREEN}-c 2${NC}\")\n"
echo -e "############################################################################\n"
} # DisplayUsage
ShowVideoModes() {
# check if stdout is a terminal...
if test -t 1; then
# see if it supports colors...
ncolors=$(tput colors)
if test -n "$ncolors" && test $ncolors -ge 8; then
BOLD="$(tput bold)"
NC='\033[0m' # No Color
LGREEN='\033[1;32m'
fi
fi
OIFS=${IFS}
IFS="|"
awk -F" " '/ # res/ {print $1}' <"${0}" | tr -d ')' | grep -v 'awk' | while read ; do
set ${REPLY}
echo -e " ${2}\tuse \"-m ${2}\" or \"-m ${1}\""
echo -e " ${BOLD}${2}${NC}\tuse \"${LGREEN}-m ${2}${NC}\" or \"${LGREEN}-m ${1}${NC}\""
done
IFS=${OIFS}
echo -e "\n Two examples:\n\n ${0##*/} -m 1080p60 -d' (1920x1080@60Hz DVI)"
echo -e " ${0##*/} -m 720i' (1280x720@30Hz HDMI)\n"
echo -e "\n Two examples:\n\n '${BOLD}${0##*/}${NC} ${LGREEN}-m 1080p60 -d${NC}' (1920x1080@60Hz DVI)"
echo -e " '${BOLD}${0##*/}${NC} ${LGREEN}-m 720i${NC}' (1280x720@30Hz HDMI)\n"
} # ShowVideoModes
PatchScriptBin() {
@ -217,7 +268,10 @@ PatchScriptBin() {
MyTmpFile="$(mktemp /tmp/${0##*/}.XXXXXX)"
# convert script.bin to temporary fex file
bin2fex <"${ScriptBin}" 2>/dev/null | grep -v "^screen0_output" \
local filter="^screen0_output"
if [ -v ColourRange ]; then
filter="^screen0_out"; fi
bin2fex <"${ScriptBin}" 2>/dev/null | grep -v ${filter} \
| grep -v "^screen1_output" | grep -v "hdcp_enable" \
| grep -v "hdmi_cts_compatibility" >"${MyTmpFile}"
if [ $? -ne 0 ]; then
@ -229,6 +283,10 @@ PatchScriptBin() {
cp -p "${ScriptBin}" "${Path2ScriptBin}/script.bin.bak"
sed -i "/\[disp_init\]/a screen0_output_type = 3\nscreen0_output_mode = $1\nscreen1_output_type = 3\nscreen1_output_mode = $1" "${MyTmpFile}"
if [ -v ColourRange ]; then
sed -i "/\[disp_init\]/a screen0_out_color_range = ${ColourRange}" "${MyTmpFile}"
fi
if [ "X$2" = "XTRUE" ]; then
# add entries necessary for HDMI-to-DVI adapters
@ -239,9 +297,11 @@ PatchScriptBin() {
fex2bin "${MyTmpFile}" "${ScriptBin}" 2>/dev/null
if [ $? -ne 0 ]; then
mv "${Path2ScriptBin}/script.bin.bak" "${ScriptBin}"
echo -e "Aborted\nWriting script.bin went wrong. Nothing changed" >&2
echo -e "Aborted\nWriting script.bin went wrong. Nothing changed." >&2
echo -e "You may look at ${MyTmpFile} to see if there is an error there." >&2
logger "Writing script.bin went wrong. Nothing changed"
exit 1
else rm "${MyTmpFile}"
fi
} # PatchScriptBin