Project

General

Profile

PinePhonev1x » History » Version 69

dl lud, 06/25/2024 09:48 PM
Mention that GNSS supports gpsOneXTRA

1 24 Denis 'GNUtoo' Carikli
h1. PinePhone
2 1 Denis 'GNUtoo' Carikli
3 51 dl lud
The PinePhone is an AllWinner A64 based smartphone designed and produced by PINE64 that strives to be compatible with fully free software. It is documented in detail at "PINE64's wiki":https://wiki.pine64.org/index.php/PinePhone
4 1 Denis 'GNUtoo' Carikli
5 51 dl lud
h2. Components overview
6
7 28 dl lud
|_. Feature |_. Hardware |_. Comments |_. TODO |
8 42 dl lud
| System on a chip | Allwinner A64 Quad Core[9] | * The bootloader should be fully free software[7] including ARM Trusted Firmware[8].
9 1 Denis 'GNUtoo' Carikli
* The code should be upstream already[7]. | TODO:
10 23 Denis 'GNUtoo' Carikli
* Look at the code. |
11 42 dl lud
| GPU | Mali 400 MP2 GPU[1] | * A "pipe" driver is in Linux since 5.2
12 51 dl lud
* Has support in Mesa. | |
13 1 Denis 'GNUtoo' Carikli
| Modem |/2. Quectel EG-25G[1] with[2] worldwide bands[4] | * The EG-25G is an international version of the EC25.
14 39 dl lud
* Runs GNU/Linux[18].
15
* USB connection for data and I2S connection for audio[18].
16 29 dl lud
* Audio connected to both PCM interfaces on the A64[14].
17 49 Denis 'GNUtoo' Carikli
* PCM audio still experimental: sending to the modem works fine, receiving produces mangled samples[14]. 
18
* AT support commands look unusable[20], so we need to use QMI which is way more robust anyway. | TODO:
19 1 Denis 'GNUtoo' Carikli
* What's the similarity with the EC-25? |
20 69 dl lud
| GNSS[1]: GPS, GPS-A, GLONASS[4] | * Part of the modem (Qualcomm chip).
21 1 Denis 'GNUtoo' Carikli
                                    * It's NMEA protocol variant is already supported by GNU/Linux's gpsd[21].
22 69 dl lud
                                    * Supports regular [[GNSSResearch#SUPL|A-GNSS]] and Qualcomm's [[GNSSResearch#PSDS|gpsOneXTRA[22]]].
23
                                    * Reception is poor. |
24 42 dl lud
| WiFi |/2. RTL8723cs[3] | * Requires a nonfree loadable firmware[3].
25 52 dl lud
* Connected via SDIO[18]. |/2. TODO:
26 54 dl lud
* Check if firmware is provided under GPLv2 within the Linux driver as "happened in similar chips":https://libreplanet.org/wiki/Group:Hardware/Computers/e-readers/Kobo/Aura_H2O_Edition_2#Firmwares. |
27 52 dl lud
| Bluetooth: 4.0, A2DP[1] | * Requires a nonfree firmware[3].
28
* Connected via UART[18]. |
29 1 Denis 'GNUtoo' Carikli
| USB – C[1] (Power, Data and Video Out) | |* USB 2.0[9]
30 39 dl lud
* Serial console is only available in the headphone connector (activated by the 6th contact on the dipswitch[10])| |
31 51 dl lud
| RAM | 2 or 3 GB of LPDDR3 RAM | * Initialized by u-boot SPL[18]. | |
32 39 dl lud
| Main Camera | Single OmniVision OV6540, 5MP, 1/4″, LED Flash[1] | * Mainline driver[5]
33
* No firmware required[5]
34
* There's an optional non-free firmware for the auto-focus[18]. | |
35
| Selfie Camera | Single GC2035[1], 2MP, f/2.8, 1/5″ | | |
36 44 dl lud
| Storage | Bootable microSD slot[1]
37
 16GB eMMC[1] | * Boot order: microSD -> eMMC[6]| |
38 26 Andrés D
| Sensors accelerator, gyro, proximity, compass, barometer, ambient light[1] | | | TODO:
39 42 dl lud
* Which chips are used? |
40 28 dl lud
| LCD panel and touchscreen | 5.95″ LCD 1440×720
41 42 dl lud
18:9 aspect ratio (hardened glass) | Probably works with free software[11]. | |
42 36 dl lud
| Power Management IC (PMIC) | AXP803[13] | | |
43
| Power Management coprocessor | AR100[15] | * The proprietary firmware can be replaced with Crust[16].
44 38 dl lud
* Allows deep power-saving modes and later wake-up.
45 30 dl lud
* Use case: receive signal from modem to wake-up device[17]. | |
46
47 45 Denis 'GNUtoo' Carikli
h2. Downstream reference code
48 1 Denis 'GNUtoo' Carikli
49
*Downstream Linux*: -https://gitlab.com/pine64-org/linux- https://xff.cz/git/linux pp-x.xx branches (mirror: https://codeberg.org/megi/linux)
50 58 dl lud
*Downstream u-boot*: -https://gitlab.com/pine64-org/u-boot- (can now use upstream)
51
*Downstream arm-trusted-firmware*: https://gitlab.com/pine64-org/arm-trusted-firmware
52 45 Denis 'GNUtoo' Carikli
53
h2. Upstream status
54
55
h3. Linux
56
57 56 dl lud
Current upstreaming work is being led by Ondřej Jirman (aka "megi"): "megi's PinePhone Development Log":https://xnux.eu/log/index.html.
58 63 dl lud
megi publishes kernels after each release with the not-yet-upstreamed patches rebased on top. The commit log thus serves as the best available "to upstream" list: "example for Linux 6.10":https://xff.cz/git/linux/log/?h=pp-6.10
59
A now (2024) outdated status can be seen at: "megi's feature/driver support matrix":https://xnux.eu/devices/pine64-pinephone.html#toc-feature-driver-support-matrix.
60 56 dl lud
61
Current upstreaming path looks like this: megi -> sunxi-next -> linux-next -> torvalds
62 45 Denis 'GNUtoo' Carikli
Patches relevant to all A64 devices should be directly sent to sunxi-next.
63 1 Denis 'GNUtoo' Carikli
Patches only relevant to PinePhone may be sent to megi
64 45 Denis 'GNUtoo' Carikli
65 63 dl lud
Previous upstreaming work was done at "PINE64's GitLab":https://gitlab.com/pine64-org/linux/.
66 45 Denis 'GNUtoo' Carikli
67 59 dl lud
h3. U-Boot
68 45 Denis 'GNUtoo' Carikli
69 59 dl lud
PinePhone support was "upstreamed on November 2020":https://source.denx.de/u-boot/u-boot/-/commit/a575c55d1e8a06173c323cac40e3942af8512c85
70 40 dl lud
71 64 dl lud
h2. Audio routing
72
73
Check "megi's Audio on PinePhone":https://xnux.eu/devices/feature/audio-pp.html#toc-audio-on-pinephone.
74
75 40 dl lud
h2. Hardware kill switches
76
77
The PinePhone has 6 hardware switches[19] that allow turning on/off different hardware components: modem, WiFi/Bluetooth, microphone, rear camera, front camera and headphones. Unfortunately these are located under the back cover, which needs to be taken out to operate them.
78 41 dl lud
79 65 dl lud
h2. Poor GPS/GNSS reception
80
81 68 dl lud
There are "many reports":https://forum.pine64.org/showthread.php?tid=11680&page=6 of poor GPS reception on the PinePhone. The "official cause":https://wiki.pine64.org/wiki/PinePhone_FAQ#GPS_doesn't_work is the small antenna in the PinePhone and the suggested fix is to use [[GNSSResearch#Assisted-GNSS-A-GNSS|Assisted GNSS (A-GNSS)]].
82 65 dl lud
83 67 dl lud
A-GNSS "has already been added into Mobian's eg25-manager":https://gitlab.com/mobian1/eg25-manager/-/merge_requests/15/diffs and there is also a "proof of concept script available":https://gist.github.com/alastair-dm/263209b54d01209be28828e555fa6628.
84 1 Denis 'GNUtoo' Carikli
85 67 dl lud
Unfortunately, A-GNSS alone, will not solve the full issue we are experiencing. A-GNSS can only improve the Time To First Fix (TTFF). On GNUtoo's tests with the PinePhone, after the first fix was acquired, just going under some trees in a town sufficed to loose the signal. This hints that, besides being small, the GNSS antenna may suffer some design fault.
86 1 Denis 'GNUtoo' Carikli
87 68 dl lud
On top of that, there exists no [[GNSSResearch#SUPL|SUPL server]] server running free software (that we know of), as such we cannot implement A-GNSS on Replicant.
88
89
The Openmoko Freerunner had working A-GNSS but used it only to save and inject back the almanac data, e.g. for faster fixes after closing and opening a navigation app in a short time interval. Unfortunately the almanac and ephemeris data is only valid for a limited period.
90 66 dl lud
91
In general to make GPS work fine with free software we need the best GPS chips available. What's inside the PinePhone does not seem to be up to par. More testing and tweaking is needed though.
92
93 41 dl lud
h2. Schematics
94
95 53 dl lud
All listed at "PinePhone board information, schematics and certifications on PINE64 wiki":https://wiki.pine64.org/index.php/PinePhone#PinePhone_board_information,_schematics_and_certifications.
96 3 Denis 'GNUtoo' Carikli
97 32 dl lud
h2. References
98 1 Denis 'GNUtoo' Carikli
99 28 dl lud
fn1. Some specifications are available at the "device page":https://www.pine64.org/pinephone/ and "wiki page":https://wiki.pine64.org/index.php/PinePhone.
100 4 Denis 'GNUtoo' Carikli
101 34 dl lud
fn2. PinePhone discussion in Replicant's mailing list: https://lists.osuosl.org/pipermail/replicant/2019-July/001997.html
102 18 Denis 'GNUtoo' Carikli
103 34 dl lud
fn3. From #replicant channel on Freenode: <pre><MoeIcenowy> The Wi-Fi changed to RTL8723CS (this chip also does BT), which needs non-free firmware to be feed</pre>
104 1 Denis 'GNUtoo' Carikli
105 34 dl lud
fn4. From #replicant channel on Freenode: <pre><MoeIcenowy> The GNSS should be also done by EG25-G</pre>
106 1 Denis 'GNUtoo' Carikli
107 34 dl lud
fn5. From #replicant channel on Freenode: <pre><MoeIcenowy> The OV5640 camera doesn't need firmware and its driver is mainlined</pre>
108 1 Denis 'GNUtoo' Carikli
109 34 dl lud
fn6. From #replicant channel on Freenode: <pre><MoeIcenowy> The boot order is strictly MicroSD->eMMC, which is set in the A64's boot ROM</pre>
110 1 Denis 'GNUtoo' Carikli
111
fn7. From #replicant channel on Freenode: <pre><MoeIcenowy> The bootloader (U-Boot SPL + ATF + U-Boot) is free software, all mainlined now (and the downstream dirty U-Boot cannot boot upstream Linux kernel)</pre>
112 60 dl lud
113 25 Andrés D
fn8. From #replicant channel on Freenode: <pre><MoeIcenowy> https://github.com/ARM-software/arm-trusted-firmware</pre>
114 1 Denis 'GNUtoo' Carikli
115
fn9. Allwinner A64 Datasheet: http://files.pine64.org/doc/datasheet/pine64/A64_Datasheet_V1.1.pdf
116 25 Andrés D
117 27 Denis 'GNUtoo' Carikli
fn10. PostmarketOS Pinephone page: https://wiki.postmarketos.org/wiki/PINE64_PinePhone_(pine64-pinephone)#Serial_console
118
119
fn11. From #replicant channel on Freenode: <pre>
120 1 Denis 'GNUtoo' Carikli
01:48 <adjtm> GNUtoo, lukasz confirmed me that the lcd doesn't require proprietary firmware to be uploaded
121
01:49 <adjtm> the conversation between pine64 staff about the lcd that someone posted on irc was probably before deciding in
122 28 dl lud
               the last lcd</pre>
123 1 Denis 'GNUtoo' Carikli
124
fn13. From Xalius on "PINE64 IRC":https://forum.pine64.org/showthread.php?tid=892. Details at: https://linux-sunxi.org/AXP803
125 29 dl lud
126 1 Denis 'GNUtoo' Carikli
fn14. From Xalius.
127 36 dl lud
128
fn15. https://linux-sunxi.org/AR100
129
130
fn16. https://github.com/crust-firmware/crust
131
132 39 dl lud
fn17. From Xalius.
133 1 Denis 'GNUtoo' Carikli
134
fn18. PinePhone Misconceptions: https://www.pine64.org/2020/01/24/setting-the-record-straight-pinephone-misconceptions/
135 47 Denis 'GNUtoo' Carikli
136 1 Denis 'GNUtoo' Carikli
fn19. PinePhone at PINE64 wiki: https://wiki.pine64.org/index.php/PinePhone#Killswitch_configuration
137 50 Denis 'GNUtoo' Carikli
138 62 dl lud
fn20. According to Pavel Machek, "there is no RING indication on the AT side":https://pavelmachek.livejournal.com/143504.html ("archive":https://web.archive.org/web/20210913155020/https://pavelmachek.livejournal.com/143504.html) so we might be required to use QMI. QMI is probably a better long term solution anyway.
139 1 Denis 'GNUtoo' Carikli
140
fn21. GNUtoo tested it with gpsd + some configuration on top of a Mobian image.
141 69 dl lud
142
fn22. Quectel EG25-G GNSS Application Note: https://wiki.pine64.org/wiki/File:Quectel_EC2x%26EG9x%26EG2x-G%26EM05_Series_GNSS_Application_Note_V1.3.pdf