Xiaomi Poco F1 (xiaomi-beryllium)

From postmarketOS
Revision as of 05:45, 12 October 2021 by LesyCR (talk | contribs) (→‎Change Kernel parameters)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
Xiaomi Pocophone F1
Manufacturer Xiaomi
Name Pocophone F1
Codename xiaomi-beryllium
Released 2018
Category community
Original software MIUI 9.6 (based on Android 8.1)
Chipset Qualcomm SDM845 Snapdragon 845
CPU Octa-core (4x 2.8 GHz Kryo 385 Gold & 4x 1.8 GHz Kryo 385 Silver)
GPU Adreno 630
Display 1080x2246 LCD
Storage 64/128/256 GB
Memory 6/8 GB
Architecture aarch64
USB Networking
3D Acceleration
Mobile data

Another great phone based on Qualcomm_Snapdragon_845_(SDM845).

How to enter flash mode

You have to press Power + Volume Down to enter the bootloader.

Know your panel variant

There are two variant of Xiaomi Poco F1 with different display panel and touchscreen combo.

1. EBBG Panel - dsi_ebbg_fhd_ft8719_video_display

2. Tianma Panel - dsi_tianma_fhd_nt36672a_video_display

To know your panel variant, get into a terminal with root access (you can use TWRP recovery's terminal as it has root access or rooted android ROM)

1. Run su to make sure you have root access

2. Run cat /proc/cmdline. Output would be similar to:

rcupdate.rcu_expedited=1 console=tty0 earlycon=msm_geni_serial,0xA84000 androidboot.hardware=qcom androidboot.console=ttyMSM0 video=vfb:640x400,bpp=32,memsize=3072000 msm_rtb.filter=0x237 ehci-hcd.park=3 lpm_levels.sleep_disabled=1 service_locator.enable=1 swiotlb=2048 androidboot.configfs=true loop.max_part=7 androidboot.usbcontroller=a600000.dwc3 root=/dev/dm-0 dm="system none ro,0 1 android-verity /dev/sde48" androidboot.verifiedbootstate=orange androidboot.keymaster=1  androidboot.veritymode=enforcing androidboot.bootdevice=1d84000.ufshc androidboot.serialno=b79782d2 androidboot.baseband=sdm msm_drm.dsi_display0=dsi_tianma_fhd_nt36672a_video_display: androidboot.ramdump=disable androidboot.secureboot=1 androidboot.dp=0x0 androidboot.cpuid=0x205772eb androidboot.hwversion=4.19.0 androidboot.hwc=INDIA androidboot.cert=M1805E10A androidboot.hwlevel=MP

4. Note the value of msm_drm.dsi_display0. In the example above, it's dsi_tianma_fhd_nt36672a_video_display, i.e Tianma panel variant. For EBBG panel variant, it would be dsi_ebbg_fhd_ft8719_video_display

During pmbootstrap init select the kernel variant by choosing either tianma or ebbg based on the above output.


1. Run pmbootstrap init and select xiaomi as vendor and beryllium as device.

2. Select the Kernel variant based on the panel noted from the "Know your panel variant" section above.

3. Follow the onscreen instruction and configure as your needs.

Sample output:

[20:23:35] Location of the 'work' path. Multiple chroots (native, device arch, device rootfs) will be created in there.
[20:23:35] Work path [/home/joel/.local/var/pmbootstrap]: 
[20:23:36] NOTE: pmaports path: /home/joel/.local/var/pmbootstrap/cache_git/pmaports
[20:23:36] Choose the postmarketOS release channel.
[20:23:36] Available (3):
[20:23:36] * edge: Rolling release / Most devices / Occasional breakage: https://postmarketos.org/edge
[20:23:36] * stable-next: Latest release / Recommended for best stability
[20:23:36] * stable: Old release (unsupported)
[20:23:36] Channel [edge]: 
[20:23:36] Choose your target device vendor (either an existing one, or a new one for porting).
[20:23:36] Available vendors (59): acer, alcatel, amazon, arrow, asus, bq, chuwi, cubietech, essential, fairphone, finepower, fly, goclever, google, gp, hisense, htc, huawei, infocus, jolla, klipad, lark, leeco, lenovo, lg, medion, meizu, motorola, nextbit, nobby, nokia, nvidia, oneplus, oppo, ouya, pegatron, pine64, planet, purism, qemu, raspberry, samsung, semc, sharp, sony, surftab, t2m, tablet, teclast, tokio, trekstor, vernee, wexler, wiko, wileyfox, xiaomi, yu, zte, zuk
[20:23:36] Vendor [xiaomi]: xiaomi
[20:23:38] Available codenames (23): aries, armani, begonia, beryllium, cactus, cancro, clover, daisy, dior, ferrari, ido, kenzo, lavender, libra, mido, santoni, scorpio, tissot, vince, whyred, willow, wt88047, wt88047-downstream
[20:23:38] Device codename [beryllium]: beryllium
[20:23:42] Which kernel do you want to use with your device?
[20:23:42] Available kernels (2):
[20:23:42] * ebbg: EBBG Panel. To know the status of the port and which panel your device use, Visit the Poco F1 wiki page: https://wiki.postmarketos.org/wiki/Xiaomi_Poco_F1_(xiaomi-beryllium)
[20:23:42] * tianma: Tianma Panel. To know the status of the port and which panel your device use, Visit the Poco F1 wiki page: https://wiki.postmarketos.org/wiki/Xiaomi_Poco_F1_(xiaomi-beryllium)
[20:23:42] Kernel [tianma]: tianma
[20:23:45] This device has proprietary components, which trade some of your freedom with making more peripherals work.
[20:23:45] We would like to offer full functionality without hurting your freedom, but this is currently not possible for your device.
[20:23:45] device-xiaomi-beryllium-nonfree-firmware: GPU, venus, modem firmware
[20:23:45] Enable this package? (y/n) [y]: 

Mainline status


Works fine. MSM DRM based panel.

The Tianma variant is already in mainline Linux.

The EBBG panel variant is available in our kernel fork and works fine, but it is not upstreamed yet.

Brightness can be adjusted. The PMI8998 QCOM WLED driver from mainline is used for brightness adjustment.


For the Tianma variant, there are patches available for the NT36XXX touchscreen over here: https://lwn.net/ml/linux-kernel/20201028221302.66583-1-kholk11@gmail.com/ Its still not accepted. But works fine with some fixes and included in our fork.

For the EBBG variant, Venji10 has written downstream based driver for focaltech touchscreen. Its not upstreamed yet. Included in our fork and works fine.

3D GPU Acceleration

Since our panels are MSM DRM based, 3D acceleration works perfectly fine using the freedreno driver from mainline.


2Ghz WiFi connection works perfectly fine. However, 5Ghz WiFi network has poor signal reception. Requires fix.


The Bluetooth service crashes on boot and requires a restart in Phosh.

sudo service bluetooth restart

Now you should be able to see the devices show up in Settings->Bluetooth and Pair from the UI.

In case if you want to switch off and on the bluetooth in Phosh, use Settings->Power->Bluetooth toggle and not the Settings->Bluetooth toggle as it doesn't seem to work properly. Requires fix eventually.


All audio devices work perfectly fine. (Speakers, Earpiece, Headphones+Mic, Phone Internal Mic, Bluetooth headphones+Mic)

You can change the Audio devices from Settings->Sound.

The userspace ALSA UCM confs are available in our repo: https://gitlab.com/sdm845-mainline/alsa-ucm-conf. Need to be up-streamed eventually.

Headphones+Mic & Phone Internal Mic are already in mainline dts. The TAS2559 driver requires a rewrite and needs to be upstreamed. Included in our fork.


Caleb and Joel started writing a basic fuel guage driver with basic functionalities such as charge percentage, temperature, usb plug in and out detection, etc. Included in work. Still requires quite some rework to make it generic enough and extensible. Although charging works, there isn't a proper charging driver yet. It would also be needed to enable USB OTG feature.


In Phosh, using Gnome Maps app, its able to fetch the location data from ModemManager using Geoclue service. But I have not extensively tested whether the GPS data is coming from WiFi connection data or Mobile Tower CellID or the GPS itself. As far as I have tested, on a fresh rootfs, with a completely new WiFi AP, it's still able to fetch the location correctly. So I think it's not using the WiFi connection details as it's new. This requires testing and verification. But in the end, ModemManager basically supports fetching GPS data through modem. Might require some setup for QRTR maybe.


Able to configure the CAMSS and camera regulators properly and the IMX363 shows up on the I2C bus. A WIP IMX363 driver written initially by Mis012 is being developed over here: https://gitlab.com/sdm845-mainline/linux/-/commits/wip/sdm845-5.13.rc4-camss/. But currently it returns Broken Pipe error when trying to fetch image from the camera using v4l2-ctl.

The Camera register configurations can be observed by enabling CAMSS debug in downstream android kernel and noting the logs for lines similar to

CAM-CCI: cam_cci_data_queue: 741: cmd_size 24 addr 0x136 data 0x18

Will probably add more info on this in the SDM845 Mainlining wiki later.

The Poco F1 Camera Configuration I have noted so far:


CAM_IOVDD_EN | gpio50 | tlmm | vreg_s4a_1p8 | 1.8V

CAM_LDO_EN | gpio99 | tlmm | No idea | 1.35V

Front Cam 1 - Samsung S5K3T1 (20MP)

CAM_F1_RSTN | gpio104 | tlmm | -

FRONT_CAM1_AVDD_EN | gpio29 | tlmm | vreg_bob

FRONT_CAM1_DVDD_EN | gpio9 | pmi8998 | vreg_s3a_1p35

Rear Cam 1 - Sony IMX363 (12MP), I2C Address (0x10)

CAM_R1_RSTN | gpio80 | tlmm | -

REAR_CAM1_AVDD_EN | gpio40 | tlmm | vreg_bob | 2.8V

REAR_CAM1_DVDD_EN | gpio11 | pmi8998 | vreg_s3a_1p35 | 1.35V

Front Cam 2 - OV7251 ??

CAM_F2_RSTN | gpio25 | tlmm -

FRONT_CAM2_AVDD_EN | gpio91 | tlmm

FRONT_CAM2_DVDD_EN | gpio7 | tlmm

Rear Cam 2 - Samsung S5K5E8 (5MP)

CAM_R2_RSTN | gpio28 | tlmm -

REAR_CAM2_AVDD_EN | gpio79 | tlmm

REAR_CAM2_DVDD_EN | gpio92 | tlmm

Mobile Data, Calls and SMS

libqmi has support for QRTR+IPA based modems for quite some time, as seen in the repo: https://gitlab.freedesktop.org/mobile-broadband/libqmi/-/merge_requests?scope=all&search=qrtr&state=merged

ModemManager which uses libqmi to control the modem has added support for QRTR recently: https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/merge_requests/470

However, recent SoC like the MSM8998, SDM845, etc requires DPM service to open the port based on IPA TX/RX endpoint IDs. The initial support is added in libqmi over here: https://gitlab.freedesktop.org/mobile-broadband/libqmi/-/merge_requests/235. This is however requires manual configuration of the endpoint ids and thus ModemManager cant work out of the box. To fix the issue, Alex Elder from linaro is working on exposing the TX/RX endpoints through sysfs, so MM can read them and configure automatically during startup. The patches have been accepted in mainline over here: https://lore.kernel.org/patchwork/cover/1445266/. Once it lands, MM should work fine. This should enable mobile data and SMS access!

Inspite of all this, Joel and few other Poco F1 users have mobile data connection issues on some mobile networks. During mobile data connection, it fails with the following errors

[2441]: <info>  [024233428.438170] [modem0/bearer1] couldn't start network: QMI protocol error (14): 'CallFailed'
[2441]: <info>  [024233428.438253] [modem0/bearer1] call end reason (3): generic-no-service

Once reported about it over here: https://gitlab.freedesktop.org/mobile-broadband/libqmi/-/merge_requests/235#note_893224. Still have to properly submit a bug report on this.

As far as Calls, luckily the WWAN RPMSG driver being worked over here: https://github.com/msm8916-mainline/linux/commits/wwan-rpmsg exposes the modem AT port with some extra glink fixes!!!!! Calls were able to connect and disconnect properly. No audio over calls as it requires porting the MSM8916 q6voice driver https://github.com/msm8916-mainline/linux/blob/master/sound/soc/qcom/qdsp6/q6voice.c to SDM845. Yet to work on this. But, Aleksander Morgado from ModemManager has also hinted that he will work on the calls over QMI which would be great.

So ModemManager is like used for Phosh/GTK based OS and Ofono is used for plasma-mobile/lomiri/QT based OS. On the ofono front, there was QRTR port by the MSM8953 mainline guys over here: https://github.com/msm8953-mainline/ofono. When we tested, it wasn't quite working, but with possible introduction of DPM service in ofono too, it may possibly work. Work is yet to be done on this.

Change Kernel parameters

1, sudo vim /etc/deviceinfo

2, Change cmdline parameters to desired state

3, sudo apk fix linux-postmarketos-qcom-sdm845

Community Info


  • Venji10
  • Joel

Users owning this device

  • Ash
  • Brittle
  • Clamor (Notes: Tianma panel model)
  • Hilledkinged (Notes: EBBG display type)
  • Illen (Notes: daily driver, LineageOS/mainline "dual-boot")
  • Joel (Notes: Tianma-Panel)
  • Schrmh
  • SergDS
  • Sven (Notes: Running edge with Phosh, EBBG panel)
  • The Arjdroid (Notes: (Daily Driver) not running postmarketOS on it but in general it has very good custom ROM and custom Kernel and custom Recovery support so wouldn't be surprised if things run very well.)
  • TheBads
  • UnDevDeCatOS (Notes: tianma variant, daily driver)
  • Venji10
  • Wizzdom (Notes: Tianma-Panel, Tinkering with Sxmo)

See also