vimwiki/tech/pinephone.wiki

86 lines
2.0 KiB
Plaintext
Raw Normal View History

2021-12-04 02:00:01 +00:00
= Pinephone =
The pinephone is a cheap generic linux phone.
2021-12-04 22:30:01 +00:00
== u-boot ==
2021-12-04 03:45:01 +00:00
2022-05-07 16:15:01 +00:00
See [[u-boot]]
2021-12-04 02:00:01 +00:00
== Gentoo ==
2022-05-07 19:00:01 +00:00
=== Filesystem layout ===
Iteration one, using the following layout
* gpt disklabel
* 2048 + 128M BIOS boot (ext4)
* +4G Linux Swap
* +-1 Linux filesystem (ext4)
Choose to use the stage3-arm64-systemd
2022-05-07 19:15:01 +00:00
=== Chrooting ===
In order to chroot into the system, you may need to use qemu to emulate the
system architecture. This can be done using `qemu-user-static` and
`binfmt-qemu-static`. These allow you to chroot into an enviroment of a
different architecture.
2022-05-07 20:15:01 +00:00
To chroot into the enviroment, in the root of the to be chrooted filesystem,
run
{{{
#replace * with the architecture
cp $(which qemu-*-static) usr/bin/
chroot . qemu-*-static /bin/bash
}}}
2021-12-04 02:00:01 +00:00
=== Cross compiler ===
First, we will be compiling on a host gentoo system. To do this, first install
2022-05-07 16:00:01 +00:00
crossdev and the needed toolchain (See [[cross_toolchain]]).
If your host system is not gentoo, be sure to install a cross compiler for
aarch64.
*The pinephone triple is aarch64-unknown-linux-gnu*
2021-12-04 02:00:01 +00:00
{{{
emerge -av git ninja crossdev
crossdev --target arm-none-eabi
}}}
2022-05-06 21:15:01 +00:00
2021-12-04 02:00:01 +00:00
=== GPU Support ===
2021-12-04 02:15:01 +00:00
The pinephone pro uses a Mali T860 quadcore CPU, and therefore is run using the
lima drivers. In the phones make.conf, be sure to add
{{{
#/etc/portage/make.conf (chroot in phone)
VIDEO_CARDS="lima"
}}}
2022-05-06 21:15:01 +00:00
2021-12-04 02:15:01 +00:00
In your global use, be sure to add
{{{
#/etc/portage/make.conf (chroot in phone)
USE="gles gles2-only"
}}}
This ensures that we will only compile programs using OpenGL ES, or OpenGL for
embedded systems.
2022-05-06 21:15:01 +00:00
== Troubleshooting ==
=== Phone not booting due to fully drained battery ===
Battery voltage will be ~2.4V when dead in my experience. To get the phone to
boot
1) Remove SDcard
2) Remove battery, serial, and usb cables
3) Reinstert the battery
4) Hold down the RESET button
5) While holding the button down, connect the USB port to a computer
6) let go of the button
7) in `lsusb` you should see `2207:330c Rockship electrions`