Jump to content

Fairphone 2 (fairphone-fp2): Difference between revisions

From postmarketOS Wiki
Audio!
m Installation: source -> syntaxhighlight
 
(24 intermediate revisions by 11 users not shown)
Line 1: Line 1:
{{Infobox device
{{Infobox device
| manufacturer = Fairphone
| manufacturer = Fairphone
| name = Fairphone 2
| name = 2
| codename = fairphone-fp2
| codename = fairphone-fp2
| image = File:Fairphone 2.jpg
| image = File:Fairphone 2.jpg
| imagecaption = Fairphone 2
| imagecaption = Fairphone 2
| releaseyear = 2015
| releaseyear = 2015
| originalsoftware = Android 5.1 on Linux 3.4
| category = testing
| chipset = Qualcomm MSM8974AB-AB Snapdragon 801
| originalsoftware = Android
| cpu = Quad-core 2.26 GHz
| originalversion = 5.1
| chipset = Qualcomm Snapdragon 801 (MSM8974AB-AB)
| cpu = 4x 2.26 GHz Krait 400
| gpu = Adreno 330
| gpu = Adreno 330
| display = 1080x1920 IPS
| storage = 32 GB
| storage = 32 GB
| display = 1080x1920 IPS
| memory = 2 GB
| memory = 2 GB
| architecture = armhf
| architecture = armv7
| type = handset
<!-- Features -->
| status_usbnet = Y
| status_usbnet = Y
| status_flashing = Y
| status_flashing = Y
Line 20: Line 24:
| status_wifi = Y
| status_wifi = Y
| status_xwayland = Y
| status_xwayland = Y
| status_fde =  
| status_fde = Y
| status_mainline = P
| status_mainline = Y
| status_battery =
| status_battery = N
| status_3d =  
| status_3d = Y
| status_accel =
| status_audio = N
| status_audio = Y
| status_bluetooth = Y
| status_bluetooth =
| status_camera = P
| status_camera =
| status_gps = P
| status_gps =  
| status_mobiledata = Y
| status_mobiledata =  
| status_sms = Y
| status_sms =  
| status_calls = P
| status_calls =  
| status_otg = Y
| status_nfc = -
<!-- Sensors -->
| status_accel = N
| status_magnet = N
| status_light = N
| status_proximity = N
| status_hall = -
| status_barometer = -
| status_powersensor = -
<!-- Misc -->
| status_cameraflash = N
| status_keyboard = -
| status_touchpad = -
| status_usba = N
| status_hdmidp = -
| status_irtx = -
| status_irrx = -
| status_stylus = -
| status_haptics = Y
| status_ethernet = -
| status_fossbootloader = Y
 
| booting = yes
| booting = yes
}}
}}
{{Note|This wiki page is made for <code>mainline</code> kernel. The <code>downstream</code> kernel in the <code>pmbootstrap init</code> selection is not covered here, see the [[Fairphone_2_(fairphone-fp2)/Downstream_kernel|dedicated wiki page for downstream]].}}


== Contributors ==
== Contributors ==
* Luca Weiss (z3ntu)
* Luca Weiss (z3ntu)


== Maintainer(s) ==
== Device owners ==
 
{{Device owners}}
* Luca Weiss (z3ntu)


== How to enter flash mode ==
== How to enter flash mode ==


Hold vol-down while booting the device. The splash screen doesn't indicate, that the phone is in fastboot mode, but you can test it by running <code>fastboot devices</code> on a PC that's connected via USB to the phone.
Hold {{button|Volume Down}} while booting the device. The notification LED will blink blue when in fastboot mode.


== Installation ==
== Installation ==


Note, that you have to have a recent bootloader installed, you can download a zip to flash from the recovery [https://github.com/WeAreFairphone/modem_zip_generator/releases at this link].
{{Note|If you have a very old bootloader installed, installation might fail. Flash any recent stock software onto the device first if you experience any such problem.}}
 
Installation procedure is the same as with most other devices and isn't special for this phone.
 
== WiFi ==
 
Using NetworkManager (preinstalled) doesn't work for me / my WiFi network because of some dhcp issue.
 
Enable the <code>device-fairphone-fp2-nonfree-firmware</code> package during <code>pmbootstrap init</code>
 
Then run as root on the device:
 
<source>
# Stop NetworkManager as it interferes with wpa_supplicant
service networkmanager stop
# Start wpa_supplicant
wpa_supplicant -Dnl80211 -iwlan0 -c/etc/wpa_supplicant/wpa_supplicant.conf
</source>
 
Connect to a network using [https://wiki.archlinux.org/index.php/WPA_supplicant#Connecting_with_wpa_cli this guide].
 
<source>
# Start a DHCP client on the wlan0 interface to get an IP address
udhcpc -iwlan0
</source>
 
Then you should have a working WiFi connection!
 
== Audio ==
 
For audio, read {{MR|38|pmaports}} for now until it's more integrated.
 
== Input devices ==
<source>
# Input device
/dev/input/event0:      synaptics_dsx
 
# Touchscreen events
</source>
 
<source>
# Input device
/dev/input/event1:      qpnp_pon
 
# Power button
Event: time 7644.433669, type 1 (EV_KEY), code 116 (KEY_POWER), value 1
Event: time 7644.433673, -------------- SYN_REPORT ------------
Event: time 7644.682747, type 1 (EV_KEY), code 116 (KEY_POWER), value 0
Event: time 7644.682750, -------------- SYN_REPORT ------------
</source>
 
<source>
# Input device
/dev/input/event2:      gpio-keys
 
# Volume up
Event: time 7575.930067, type 1 (EV_KEY), code 115 (KEY_VOLUMEUP), value 1
Event: time 7575.930083, -------------- SYN_REPORT ------------
Event: time 7576.100068, type 1 (EV_KEY), code 115 (KEY_VOLUMEUP), value 0
Event: time 7576.100083, -------------- SYN_REPORT ------------


# Volume down
For installation you need to flash [[lk2nd]] and flash the rootfs. Do not flash the <code>boot</code> partition since lk2nd uses [https://github.com/msm8916-mainline/lk2nd/issues/113 fs-boot] functionality to boot the kernel from the <code>/boot</code> partition of the rootfs.
Event: time 7577.650077, type 1 (EV_KEY), code 114 (KEY_VOLUMEDOWN), value 1
Event: time 7577.650093, -------------- SYN_REPORT ------------
Event: time 7577.840067, type 1 (EV_KEY), code 114 (KEY_VOLUMEDOWN), value 0
Event: time 7577.840082, -------------- SYN_REPORT ------------


# Camera
<syntaxhighlight lang="shell-session">
Event: time 7579.180072, type 1 (EV_KEY), code 766 (?), value 1
$ pmbootstrap flasher flash_lk2nd
Event: time 7579.180089, -------------- SYN_REPORT ------------
$ pmbootstrap flasher flash_rootfs --partition userdata
Event: time 7579.430052, type 1 (EV_KEY), code 766 (?), value 0
</syntaxhighlight>
Event: time 7579.430067, -------------- SYN_REPORT ------------
</source>


<source>
Phosh and Plasma Mobile UIs have been shown to work.
# Input device
/dev/input/event3:      msm8974-taiko-mtp-snd-card Button Jack


# Button on headphones
== Device status ==
Event: time 7490.180845, type 1 (EV_KEY), code 226 (KEY_MEDIA), value 1
Event: time 7490.180865, -------------- SYN_REPORT ------------
Event: time 7492.228265, type 1 (EV_KEY), code 226 (KEY_MEDIA), value 0
Event: time 7492.228270, -------------- SYN_REPORT ------------
</source>


<source>
While the infobox gives a general overview, there's some important extra notes here.
# Input device
/dev/input/event4:      msm8974-taiko-mtp-snd-card Headset Jack


# Plug in headphones Nr.1
=== Stability ===
Event: time 7329.700387, type 5 (EV_SW), code 2 (SW_HEADPHONE_INSERT), value 1
Event: time 7329.700389, type 5 (EV_SW), code 4 (SW_MICROPHONE_INSERT), value 1
Event: time 7329.700394, type 5 (EV_SW), code 17 (?), value 1
Event: time 7329.700396, -------------- SYN_REPORT ------------


# Unplug headphones Nr.1
In general msm8974 devices on mainline kernel aren't particularly stable. You may find random reboots which can lead to data loss. IOMMU is not yet supported so there's no memory protection for components like GPU. No CPU frequency scaling is supported so your device might run hot. No fuel gauge (for battery percentage reporting) is supported so you won't see if your battery runs below 0% and won't turn off, which might damage your battery.
Event: time 7336.406334, type 5 (EV_SW), code 2 (SW_HEADPHONE_INSERT), value 0
Event: time 7336.406337, type 5 (EV_SW), code 4 (SW_MICROPHONE_INSERT), value 0
Event: time 7336.406339, type 5 (EV_SW), code 17 (?), value 0
Event: time 7336.406341, -------------- SYN_REPORT ------------


# Plug in headphones Nr.2
=== Display module (panel/touchscreen) ===
Event: time 7406.442631, type 5 (EV_SW), code 2 (SW_HEADPHONE_INSERT), value 1
Event: time 7406.442636, -------------- SYN_REPORT ------------


# Unplug headphones Nr.2
The kernel should support both the old and new display modules. You can identify the display module on your device based on [https://forum.fairphone.com/t/how-to-recognize-the-new-fp2-display-module/35519/13 this forum post]. However if you have the old display module, the touchscreen might not work due to issues with power sequencing (turning screen off turns touchscreen off, however turning screen on doesn't reinitialize the touchscreen).
Event: time 7433.144596, type 5 (EV_SW), code 2 (SW_HEADPHONE_INSERT), value 0
Event: time 7433.144600, -------------- SYN_REPORT ------------
</source>
== Photos ==


* [https://wiki.postmarketos.org/images/7/7e/Fairphone_2.jpg Weston running]
Lk2nd should automatically detect which display panel is installed and adjust the Linux dtb accordingly.


== Links ==
== Links ==


* [[Fairphone_2_(fairphone-fp2)/Downstream_kernel|postmarketOS wiki page for downstream kernel only]]
* [https://github.com/LineageOS/android_kernel_fairphone_msm8974/ LineageOS kernel source]
* [https://github.com/LineageOS/android_kernel_fairphone_msm8974/ LineageOS kernel source]
* [https://github.com/FairphoneMirrors/android_kernel_lk_fairphone_fp2 Bootloader/lk source]
* [https://github.com/FairphoneMirrors/android_kernel_lk_fairphone_fp2 Bootloader/lk source]
* [https://forum.fairphone.com/t/postmarketos-ten-years-support/32279/10 Fairphone Forum thread]
* [https://forum.fairphone.com/t/postmarketos-ten-years-support/32279/10 Fairphone Forum thread]

Latest revision as of 21:57, 4 September 2024

Fairphone 2
Fairphone 2
Fairphone 2
Manufacturer Fairphone
Name 2
Codename fairphone-fp2
Released 2015
Type handset
Hardware
Chipset Qualcomm Snapdragon 801 (MSM8974AB-AB)
CPU 4x 2.26 GHz Krait 400
GPU Adreno 330
Display 1080x1920 IPS
Storage 32 GB
Memory 2 GB
Architecture armv7
Software
Original software Android
Original version 5.1
FOSS bootloader yes
postmarketOS
Category testing
Pre-built images no
Mainline yes
Features
Flashing
Works
USB Networking
Works
Internal storage
No data
SD card
No data
Battery
Broken
Screen
Works
Touchscreen
Works
Multimedia
3D Acceleration
Works
Audio
Broken
Camera
Partial
Camera Flash
Broken
Connectivity
WiFi
Works
Bluetooth
Works
GPS
Partial
Modem
Calls
Partial
SMS
Works
Mobile data
Works
Miscellaneous
FDE
Works
USB-A
Broken
USB OTG
Works
Sensors
Accelerometer
Broken
Magnetometer
Broken
Ambient Light
Broken
Proximity
Broken
Haptics
Works


Note This wiki page is made for mainline kernel. The downstream kernel in the pmbootstrap init selection is not covered here, see the dedicated wiki page for downstream.

Contributors

  • Luca Weiss (z3ntu)

Device owners

  • DancesWithCycles (Notes: orange coat: tbd)
  • DancesWithCycles (Notes: white coat: tbd)
  • Jrfern (Notes: Panel otm1902b, original cameras)
  • Kbingham (Notes: Camera Set A)
  • Kbingham (Notes: Camera Set B)
  • Roboe (Notes: (borrowed) physically broken radio or modem, I don't recall right now)
  • Roboe (Notes: mostly unused after 7 years daily driving; first revision display module, a spare upgraded one available; running Lineage OS)
  • Rudloff
  • TPJS (Notes: stock, unknown screen type)
  • UltrasonicMadness (Notes: Runs Ubuntu Touch 16.04, has occasional problems with screen flickering and unreliable touch screen)
  • Unrznbl (Notes: 2022-09-21 old hardware panel so not supported in mainline and no touchscreen, though display works)
  • Vladuwka12 (Notes: Running Ubuntu Touch 16.04)
  • Z3ntu


How to enter flash mode

Hold Volume Down while booting the device. The notification LED will blink blue when in fastboot mode.

Installation

Note If you have a very old bootloader installed, installation might fail. Flash any recent stock software onto the device first if you experience any such problem.

For installation you need to flash lk2nd and flash the rootfs. Do not flash the boot partition since lk2nd uses fs-boot functionality to boot the kernel from the /boot partition of the rootfs.

$ pmbootstrap flasher flash_lk2nd
$ pmbootstrap flasher flash_rootfs --partition userdata

Phosh and Plasma Mobile UIs have been shown to work.

Device status

While the infobox gives a general overview, there's some important extra notes here.

Stability

In general msm8974 devices on mainline kernel aren't particularly stable. You may find random reboots which can lead to data loss. IOMMU is not yet supported so there's no memory protection for components like GPU. No CPU frequency scaling is supported so your device might run hot. No fuel gauge (for battery percentage reporting) is supported so you won't see if your battery runs below 0% and won't turn off, which might damage your battery.

Display module (panel/touchscreen)

The kernel should support both the old and new display modules. You can identify the display module on your device based on this forum post. However if you have the old display module, the touchscreen might not work due to issues with power sequencing (turning screen off turns touchscreen off, however turning screen on doesn't reinitialize the touchscreen).

Lk2nd should automatically detect which display panel is installed and adjust the Linux dtb accordingly.

Links