BQ Aquaris X5 (bq-paella)

== Contributors ==
* Lazzardo
== Maintainer(s) ==
* Lazzardo
== Users owning this device ==
== How to enter flash mode ==
The device is available in two variants: The normal edition from BQ and a special Cyanogen Edition that runs CyanogenOS. The hardware seems to be identical, but the firmware is different. How to enter Fastboot/Recovery mode depends on the firmware that is currently installed.
=== BQ bootloader ===
* Recovery: Power on the device with both Power and Volume Up buttons.
* Fastboot: Power on the device with both Power and Volume Down buttons.
=== Cyanogen bootloader ===
* Recovery: Power on the device with both Power and Volume Down buttons.
* Stock fastboot: Power on the device with both Power and Volume Up buttons.
* lk2nd Fastboot: Power on the device. After it vibrates, hold Volume Down.
== Installation ==
=== Unlock bootloader ===
To unlock your bootloader boot into Android, enable Developer Options from the settings and enable "Allow OEM unlock". Then boot into Fastboot and use fastboot oem unlock. You might need to use fastboot oem unlock-go. (Note: All your data will be erased!)
=== Firmware ===
It is recommended to flash to latest firmware from BQ before using postmarketOS. You can download it here: 5.2.0_20180228-1305-picmt-user-637-Fastboot-FW.zip 5.2.0_20180228-1305-picmt-user-637-Fastboot-FW.zip.
First flash the early boot firmware:
 $ fastboot flash sbl1 sbl1.mbn
 $ fastboot flash sbl1bak sbl1.mbn
 $ fastboot flash tz tz.mbn
 $ fastboot flash tzbak tz.mbn
 $ fastboot flash hyp hyp.mbn
 $ fastboot flash hypbak hyp.mbn
 $ fastboot flash rpm rpm.mbn
 $ fastboot flash rpmbak rpm.mbn
 $ fastboot flash modem NON-HLOS.bin
As a next step you also need to flash a Linux/Android bootloader (aboot). There are two different versions available:
* BQ bootloader: Can only boot downstream kernel
* Cyanogen bootloader: Can boot both downstream and mainline kernel
Therefore, you should flash the Cyanogen bootloader for postmarketOS. You can download it here: cm-13.1.4-ZNH2KAS5FE-paella-signed-fastboot-a6851b4fbe.zip cm-13.1.4-ZNH2KAS5FE-paella-signed-fastboot-a6851b4fbe.zip
 $ fastboot flash aboot emmc_appsboot.mbn
 $ fastboot flash splash splash.img
The bootloader has a splash screen with black background.
=== postmarketOS ===
The mainline kernel depends on an alternative bootloader (lk2nd). It does not replace the stock bootloader, but provides its own Fastboot interface. When using the mainline kernel you should always use lk2nd for flashing, not the stock Fastboot mode.
# Install lk2nd. (Just needed the first time).
#* Warning: lk2nd is installed to the boot partition, not the aboot partition you flashed earlier!
When you have lk2nd installed and running, follow Qualcomm_Snapdragon_410/412_(MSM8916)#Installation.
==== Downstream ====
There is an alternative device port using the downstream kernel, bq-paella-downstream. It can be selected by entering the name in pmbootstrap init.
== Using as a daily driver ==
Audio routing seems to work properly now, so you can make a call without switching anything in settings.
You need to watch battery drain as this soc, has no working CPU suspend mode.
Make sure you have checked bq-paella issues and fully read Qualcomm_Snapdragon_410/412_(MSM8916), as it contains information about important bugs related generally to this SoC (they are not mentioned directly here).
Cellular networking requires the package msm-modem-uim-selection and setting /etc/conf.d/msm-modem-uim-selection to sim_wait_time=30, this will automatically detect a sim card in one of the slots and activate it.
== Pictures ==
File:P 20200521 144800.jpg|thumb|left|xeyes running on Weston on bq-paella
File:P 20200521 144422.jpg|thumb|left|FDE, osk-sdl running on bq-paella
File:EsBLYj1VgAATpGw.jpeg|thumb|left|phosh running on bq-paella
File:EsBLYk2UcAAeMLt.jpeg|thumb|left|GNOME Settings running on bq-paella
File:EsBLYnuUcAAT-2N.jpeg|thumb|left|GNOME Terminal on bq-paella
File:EsBNMN8UwAAO363.jpeg|thumb|left|GNOME Clocks on bq-paella
File:EsBLYmRVoAA7ZjJ.jpeg|thumb|left|Wi-Fi on bq-paella
File:EsBNMMqVEAA3LBg.jpeg|thumb|left|Bluetooth on bq-paella
File:EsBNMMRVcAAn9i3.jpeg|thumb|left|Firefox with WebGL on bq-paella
File:Bq-paella-gtk-spotify-spot.jpg|thumb|left|Spot, a GTK Spotify client, running on bq-paella
File:Bq-paella-fractal.jpg|thumb|left|Fractal, a GTK Matrix client, running on bq-paella
File:Sxmo-bq-paella.jpg|thumb|left|Sxmo running on bq-paella
File:Bq-paella-appgrid.jpg|thumb|left|Custom app grid on bq-paella
File:Lollypop.jpg|thumb|left|Lollypop playing music on bq-paella
File:Bq-paella-lockscreen-lollypop.jpg|thumb|left|Custom lockscreen with Lollypop player on bq-paella
File:Bq-paella-retroarch.jpg|thumb|left|RetroArch on bq-paella
== See also ==
* Initial merge request
* Moving to community
* Chromium running with full hardware acceleration