Skip to content

Commit d4b8470

Browse files
committed
Merge remote-tracking branch 'upstream/master'
2 parents 1deeb17 + 38e5ac0 commit d4b8470

20 files changed

+111
-38
lines changed

blobs/pine64.dts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3374,7 +3374,7 @@
33743374
lv3_volt = <0x4d8>;
33753375
lv4_freq = <0x3c14dc00>;
33763376
lv4_volt = <0x4b0>;
3377-
lv5_freq = "98p";
3377+
lv5_freq = <0x39387000>;
33783378
lv5_volt = <0x488>;
33793379
lv6_freq = <0x365c0400>;
33803380
lv6_volt = <0x460>;

blobs/pine64noplus.dts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3374,7 +3374,7 @@
33743374
lv3_volt = <0x4d8>;
33753375
lv4_freq = <0x3c14dc00>;
33763376
lv4_volt = <0x4b0>;
3377-
lv5_freq = "98p";
3377+
lv5_freq = <0x39387000>;
33783378
lv5_volt = <0x488>;
33793379
lv6_freq = <0x365c0400>;
33803380
lv6_volt = <0x460>;

blobs/pine64pinebook.dts

Lines changed: 26 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2650,15 +2650,18 @@
26502650
compatible = "allwinner,budget_cooling";
26512651
#cooling-cells = <0x2>;
26522652
status = "okay";
2653-
state_cnt = <0x7>;
2653+
state_cnt = <0xa>;
26542654
cluster_num = <0x1>;
26552655
state0 = <0x119400 0x4>;
26562656
state1 = <0x10d880 0x4>;
2657-
state2 = <0xf6180 0x4>;
2658-
state3 = <0xc7380 0x4>;
2659-
state4 = <0x9e340 0x4>;
2660-
state5 = <0x9e340 0x2>;
2661-
state6 = <0x9e340 0x1>;
2657+
state2 = <0x101d00 0x4>;
2658+
state3 = <0xf6180 0x4>;
2659+
state4 = <0xea600 0x4>;
2660+
state5 = <0xdea80 0x4>;
2661+
state6 = <0xc7380 0x4>;
2662+
state7 = <0x9e340 0x4>;
2663+
state8 = <0x9e340 0x2>;
2664+
state9 = <0x9e340 0x1>;
26622665
linux,phandle = <0x87>;
26632666
phandle = <0x87>;
26642667
};
@@ -2686,15 +2689,15 @@
26862689
trips {
26872690

26882691
t0 {
2689-
temperature = <0x41>;
2692+
temperature = <0x50>;
26902693
type = "passive";
26912694
hysteresis = <0x0>;
26922695
linux,phandle = <0x86>;
26932696
phandle = <0x86>;
26942697
};
26952698

26962699
t1 {
2697-
temperature = <0x50>;
2700+
temperature = <0x55>;
26982701
type = "passive";
26992702
hysteresis = <0x0>;
27002703
linux,phandle = <0x88>;
@@ -2710,7 +2713,7 @@
27102713
};
27112714

27122715
t3 {
2713-
temperature = <0x64>;
2716+
temperature = <0x5f>;
27142717
type = "passive";
27152718
hysteresis = <0x0>;
27162719
linux,phandle = <0x8a>;
@@ -2757,13 +2760,13 @@
27572760
bind2 {
27582761
contribution = <0x0>;
27592762
trip = <0x89>;
2760-
cooling-device = <0x87 0x3 0x4>;
2763+
cooling-device = <0x87 0x3 0x6>;
27612764
};
27622765

27632766
bind3 {
27642767
contribution = <0x0>;
27652768
trip = <0x8a>;
2766-
cooling-device = <0x87 0x5 0x6>;
2769+
cooling-device = <0x87 0x7 0x9>;
27672770
};
27682771

27692772
bind4 {
@@ -3155,7 +3158,7 @@
31553158
compatible = "arm,cortex-a53", "arm,armv8";
31563159
reg = <0x0 0x0>;
31573160
enable-method = "psci";
3158-
cpufreq_tbl = <0x75300 0x927c0 0xafc80 0xc7380 0xf6180 0x10d880 0x119400 0x124f80 0x148200>;
3161+
cpufreq_tbl = <0x75300 0x927c0 0xafc80 0xc7380 0xdea80 0xea600 0xf6180 0x101d00 0x10d880 0x119400 0x124f80 0x148200>;
31593162
clock-latency = <0x1e8480>;
31603163
clock-frequency = <0x3c14dc00>;
31613164
cpu-idle-states = <0x90 0x91 0x92>;
@@ -3358,17 +3361,17 @@
33583361
lv1_volt = <0x514>;
33593362
lv2_freq = <0x41cdb400>;
33603363
lv2_volt = <0x4ec>;
3361-
lv3_freq = <0x3c14dc00>;
3362-
lv3_volt = <0x4b0>;
3363-
lv4_freq = <0x30a32c00>;
3364-
lv4_volt = <0x44c>;
3365-
lv5_freq = <0x269fb200>;
3366-
lv5_volt = <0x410>;
3367-
lv6_freq = <0x0>;
3368-
lv6_volt = <0x410>;
3369-
lv7_freq = <0x0>;
3370-
lv7_volt = <0x410>;
3371-
lv8_freq = <0x0>;
3364+
lv3_freq = <0x3ef14800>;
3365+
lv3_volt = <0x4d8>;
3366+
lv4_freq = <0x3c14dc00>;
3367+
lv4_volt = <0x4b0>;
3368+
lv5_freq = <0x39387000>;
3369+
lv5_volt = <0x488>;
3370+
lv6_freq = <0x365c0400>;
3371+
lv6_volt = <0x460>;
3372+
lv7_freq = <0x30a32c00>;
3373+
lv7_volt = <0x438>;
3374+
lv8_freq = <0x269fb200>;
33723375
lv8_volt = <0x410>;
33733376
device_type = "dvfs_table";
33743377
};

blobs/pine64so.dts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3369,7 +3369,7 @@
33693369
lv3_volt = <0x4d8>;
33703370
lv4_freq = <0x3c14dc00>;
33713371
lv4_volt = <0x4b0>;
3372-
lv5_freq = "98p";
3372+
lv5_freq = <0x39387000>;
33733373
lv5_volt = <0x488>;
33743374
lv6_freq = <0x365c0400>;
33753375
lv6_volt = <0x460>;

bootlogo/battery/Makefile

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# https://github.com/longsleep/u-boot-pine64/blob/55c9c8c8ac005b1c00ac948386c60c4a741ebaa9/board/sunxi/common/power_check.c
2+
3+
SIZE := 1366x768
4+
5+
all: low_pwr.bmp bempty.bmp battery_charge.bmp
6+
7+
clean:
8+
rm -f icon-*.bmp
9+
rm -f low_pwr.bmp
10+
rm -f bempty.bmp
11+
rm -f battery_charge.bmp
12+
13+
low_pwr.bmp: icon-battery-low.bmp
14+
convert $< -gravity center -background black -extent $(SIZE) $@
15+
16+
bempty.bmp: icon-battery-empty.bmp
17+
convert $< -gravity center -background black -extent $(SIZE) $@
18+
19+
battery_charge.bmp: icon-charge.bmp
20+
convert $< -gravity center -background black -extent $(SIZE) $@
21+
22+
icon-%.bmp:
23+
convert $*.svg -size 128x128 -background black -flatten $@

bootlogo/battery/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
## Battery icons
2+
3+
This battery icons are loaded by u-boot in certain bootup stages. See
4+
https://github.com/longsleep/u-boot-pine64/blob/55c9c8c8ac005b1c00ac948386c60c4a741ebaa9/board/sunxi/common/power_check.c#L58-L81 for details.

bootlogo/battery/battery-empty.svg

Lines changed: 1 addition & 0 deletions
Loading

bootlogo/battery/battery-full.svg

Lines changed: 1 addition & 0 deletions
Loading

bootlogo/battery/battery-half.svg

Lines changed: 1 addition & 0 deletions
Loading

bootlogo/battery/battery-low.svg

Lines changed: 1 addition & 0 deletions
Loading

bootlogo/battery/battery_charge.bmp

4 MB
Binary file not shown.

bootlogo/battery/bempty.bmp

4 MB
Binary file not shown.

bootlogo/battery/charge.svg

Lines changed: 1 addition & 0 deletions
Loading
36.7 KB
Binary file not shown.

bootlogo/battery/icon-battery-low.bmp

21.5 KB
Binary file not shown.

bootlogo/battery/icon-charge.bmp

29 KB
Binary file not shown.

bootlogo/battery/low_pwr.bmp

4 MB
Binary file not shown.

kernel/install_kernel.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,14 @@ BLOBS="../blobs"
2222
LINUX="../linux"
2323
INITRD="./initrd.gz"
2424
BOOTLOGO="../bootlogo/bootlogo-pine64-1366x768.bmp"
25+
BATTERY="../bootlogo/battery"
2526

2627
# Targets file names as loaded by U-Boot.
2728
SUBFOLDER="pine64"
2829
KERNEL="kernel"
2930
INITRD_IMG="initrd.img"
3031
BOOTLOGO_TARGET="bootlogo.bmp"
32+
BATTERY_TARGET="bat"
3133

3234
if [ "$DEST" = "-" ]; then
3335
DEST="../build"
@@ -90,6 +92,11 @@ else
9092

9193
# Add bootlogo.
9294
cp -v "$BOOTLOGO" "$DEST/$BOOTLOGO_TARGET"
95+
# Add battery icons.
96+
mkdir -p "$DEST/$BATTERY_TARGET"
97+
cp -v "$BATTERY/bempty.bmp" "$DEST/$BATTERY_TARGET"
98+
cp -v "$BATTERY/low_pwr.bmp" "$DEST/$BATTERY_TARGET"
99+
cp -v "$BATTERY/battery_charge.bmp" "$DEST/$BATTERY_TARGET"
93100
fi
94101

95102
if [ ! -e "$DEST/uEnv.txt" ]; then

simpleimage/make_rootfs.sh

Lines changed: 31 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ if [ -z "$MODEL" ]; then
2323
MODEL="pine64"
2424
fi
2525

26-
if [ -z "$DEST" -o -z "$LINUX" ]; then
27-
echo "Usage: $0 <destination-folder> <linux-folder> <package.deb> [distro] [<boot-folder>] [model] [variant: mate, i3 or empty]"
26+
if [ -z "$DEST" ]; then
27+
echo "Usage: $0 <destination-folder> [<linux-tarball>] <package.deb> [distro] [<boot-folder>] [model] [variant: mate, i3 or empty]"
2828
exit 1
2929
fi
3030

@@ -34,7 +34,9 @@ if [ "$(id -u)" -ne "0" ]; then
3434
fi
3535

3636
DEST=$(readlink -f "$DEST")
37-
LINUX=$(readlink -f "$LINUX")
37+
if [ -n "$LINUX" -a "$LINUX" != "-" ]; then
38+
LINUX=$(readlink -f "$LINUX")
39+
fi
3840

3941
if [ ! -d "$DEST" ]; then
4042
echo "Destination $DEST not found or not a directory."
@@ -62,6 +64,7 @@ cleanup() {
6264
if [ -d "$DEST/sys/kernel" ]; then
6365
umount "$DEST/sys"
6466
fi
67+
umount "$DEST/tmp" || true
6568
if [ -d "$TEMP" ]; then
6669
rm -rf "$TEMP"
6770
fi
@@ -196,11 +199,13 @@ chmod a+x "$DEST/usr/sbin/policy-rc.d"
196199

197200
do_chroot() {
198201
cmd="$@"
199-
chroot "$DEST" mount -t proc proc /proc || true
200-
chroot "$DEST" mount -t sysfs sys /sys || true
202+
mount -o bind /tmp "$DEST/tmp"
203+
chroot "$DEST" mount -t proc proc /proc
204+
chroot "$DEST" mount -t sysfs sys /sys
201205
chroot "$DEST" $cmd
202206
chroot "$DEST" umount /sys
203207
chroot "$DEST" umount /proc
208+
umount "$DEST/tmp"
204209
}
205210

206211
add_debian_apt_sources() {
@@ -268,13 +273,21 @@ case $DISTRO in
268273
DEB=ubuntu
269274
DEBUSER=ubuntu
270275
DEBUSERPW=ubuntu
271-
EXTRADEBS="software-properties-common zram-config ubuntu-minimal nano"
272-
ADDPPACMD="apt-add-repository -y ppa:longsleep/ubuntu-pine64-flavour-makers"
273-
DISPTOOLCMD="apt-get -y install sunxi-disp-tool"
276+
ADDPPACMD="apt-get -y update && \
277+
apt-get install -y software-properties-common && \
278+
apt-add-repository -y ppa:longsleep/ubuntu-pine64-flavour-makers \
279+
"
280+
EXTRADEBS="\
281+
zram-config \
282+
ubuntu-minimal \
283+
sunxi-disp-tool \
284+
nano \
285+
"
274286
elif [ "$DISTRO" = "sid" -o "$DISTRO" = "jessie" ]; then
275287
DEB=debian
276288
DEBUSER=debian
277289
DEBUSERPW=debian
290+
ADDPPACMD=""
278291
EXTRADEBS="sudo"
279292
ADDPPACMD=
280293
DISPTOOLCMD=
@@ -292,14 +305,14 @@ case $DISTRO in
292305
add_${DEB}_apt_sources $DISTRO
293306
cat > "$DEST/second-phase" <<EOF
294307
#!/bin/sh
308+
set -ex
295309
export DEBIAN_FRONTEND=noninteractive
296310
locale-gen en_US.UTF-8
311+
$ADDPPACMD
297312
apt-get -y update
298313
apt-get -y install dosfstools curl xz-utils iw rfkill wpasupplicant openssh-server alsa-utils jq $EXTRADEBS
299314
apt-get -y remove --purge ureadahead
300-
$ADDPPACMD
301315
apt-get -y update
302-
$DISPTOOLCMD
303316
adduser --gecos $DEBUSER --disabled-login $DEBUSER --uid 1000
304317
chown -R 1000:1000 /home/$DEBUSER
305318
echo "$DEBUSER:$DEBUSERPW" | chpasswd
@@ -371,7 +384,9 @@ cat <<EOF > "$DEST/etc/fstab"
371384
/dev/mmcblk0p2 / ext4 defaults,noatime 0 1
372385
EOF
373386

374-
if [ -d "$LINUX" ]; then
387+
if [ -n "$LINUX" -a "$LINUX" != "-" -a -d "$LINUX" ]; then
388+
# NOTE(longsleep): Passing Kernel as folder is deprecated. Pass a tarball!
389+
375390
mkdir "$DEST/lib/modules"
376391
# Install Kernel modules
377392
make -C $LINUX ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- modules_install INSTALL_MOD_PATH="$DEST"
@@ -387,7 +402,7 @@ if [ -d "$LINUX" ]; then
387402
cp -v $LINUX/modules/gpu/mali400/kernel_mode/driver/src/devicedrv/mali/mali.ko $DEST/lib/modules/$v/kernel/extramodules
388403
depmod -b $DEST $v
389404
fi
390-
else
405+
elif [ -n "$LINUX" -a "$LINUX" != "-" ]; then
391406
# Install Kernel modules from tarball
392407
mkdir $TEMP/kernel
393408
tar -C $TEMP/kernel --numeric-owner -xJf "$LINUX"
@@ -415,6 +430,10 @@ else
415430

416431
depmod -b $DEST $VERSION
417432
fi
433+
434+
# Set Kernel and U-boot update version to current.
435+
do_chroot /usr/bin/env MARK_ONLY=1 /usr/local/sbin/pine64_update_kernel.sh
436+
do_chroot /usr/bin/env MARK_ONLY=1 /usr/local/sbin/pine64_update_uboot.sh
418437
fi
419438

420439
# Clean up
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/bin/sh
2+
3+
# Original code from https://github.com/ayufan-pine64/linux-build/blob/120285aa84c6b12db8eae043b4a17b746f29e7a8/package/root/usr/local/sbin/pinebook_restore_sound.sh - thanks!
4+
5+
set -e
6+
7+
if [ -x /usr/bin/amixer -a -e /sys/module/sunxi_sndcodec/initstate ]; then
8+
/usr/bin/amixer -q -c 'audiocodec' set 'DACL Mixer AIF1DA0L' on
9+
/usr/bin/amixer -q -c 'audiocodec' set 'DACR Mixer AIF1DA0R' on
10+
11+
echo "Sunxi audiocodec DACL/DACR enabled"
12+
fi

0 commit comments

Comments
 (0)