Jump to content

Purism Librem5 Devkit (purism-librem5dev): Difference between revisions

From postmarketOS Wiki
mNo edit summary
mNo edit summary
Line 38: Line 38:


== Contributors ==
== Contributors ==
* ''[https://github.com/craftyguy craftyguy]''
* ''[https://gitlab.com/craftyguy craftyguy]''


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

Revision as of 23:50, 22 February 2019

Purism Librem 5 Devkit
Manufacturer Purism
Name Librem 5 Devkit
Codename purism-librem5dev
Released 2018
Hardware
Chipset Emcraft NXP i.MX8M
CPU NXP i.MX8M
GPU Vivante GC7000Lite
Display 1440x720
Storage 32 GB EMMC
Memory 3 GB
Architecture aarch64
Software
Original software PureOS
postmarketOS
Category testing
Pre-built images no
Features
Flashing
No data
USB Networking
No data
Internal storage
No data
SD card
No data
Battery
No data
Screen
Works
Touchscreen
Works
Multimedia
3D Acceleration
Partial
Audio
Partial
Camera
No data
Camera Flash
No data
Connectivity
WiFi
Partial
Bluetooth
Partial
GPS
Works
NFC
No data
Modem
Calls
No data
SMS
No data
Mobile data
No data
Miscellaneous
FDE
No data
USB OTG
Partial
HDMI/DP
No data
Sensors
Accelerometer
No data
Magnetometer
No data
Ambient Light
No data
Proximity
No data
Hall Effect
No data
Haptics
No data
Barometer
No data


Contributors

How to enter flash mode

The devkit has a switch on the same side as the reboot button, wifi switch, camera switch, and modem switch. Move it to the "USB Mode" position and hit the reboot button next to it in order to put the device into 'flash' mode.

Installation

Flashing

The process for flashing postmarketOS on Librem5 Devkit is not yet automated with pmbootstrap's flasher capabilities, therefore flashing must be performed manually.

The Librem5 Devkit uses a utility called uuu. The source code for this tool can be downloaded here.

Unfortunately the u-boot image currently built with the u-boot-librem5dev does not work for placing the device into the appropriate mode for receiving the emmc image. At this time, you will need to download a u-boot image that will work, I recommend grabbing the latest from Purism here. At this location, the file is named u-boot-devkit-recovery.imx

Once this tool is built and the required u-boot image is downloaded, you can use it to install a postmarketOS image using the following uuu script:

uuu_version 1.0.1
SDP: boot -f /REPLACE/WITH/PATH/TO/u-boot-devkit-recovery.imx
SDPU: delay 1000
SDPU: write -f /REPLACE/WITH/PATH/TO/u-boot-devkit-recovery.imx -offset 0x57c00
SDPU: jump
SDPU: delay 1000
FB: ucmd setenv fastboot_dev mmc
FB: ucmd setenv mmcdev 0
FB: flash -raw2sparse all /home/YOU/.local/var/pmbootstrap-out/chroot_native/home/pmos/rootfs/purism-librem5dev.img
FB: Done

Save this script and use it by passing it directly to uuu:

$ uuu pmos.lst
...

Once the image has been flashed, place the device into emmc mode and hit the reboot button to start booting postmarketOS. The first boot can take a few minutes as it resizes the rootfs to fill all available space on the emmc disk.


Graphics

The Vivante GPU in the devkit is not fully currently supported upstream in Mesa. In order to achieve preliminary 3D acceleration on this device, you can use the 'librem5_playground' branch in craftyguy's repo. This builds a Purism branch of Mesa with not-yet-upstream patches.

The device-librem5-devkit package does not include this newer Mesa as a dependency.

If you select a GUI during pmbootstrap init and have this pmaports branch checked out under the aports directory, then the main Mesa packages (excluding mesa-dri-*) will automatically built into the rootfs image. The following mesa-dri-* packages will need to be copied to device manually and installed. To copy the Mesa packages built by this branch (ignoring mesa-dev and swrast/osmesa) to the device:

$ scp /home/YOU/.local/var/pmbootstrap-out/packages/aarch64/mesa-19.0.0-r999.apk \
    /home/YOU/.local/var/pmbootstrap-out/packages/aarch64/mesa-dri-etnaviv-19.0.0-r999.apk \
    /home/YOU/.local/var/pmbootstrap-out/packages/aarch64/mesa-dri-imx-19.0.0-r999.apk \
    /home/YOU/.local/var/pmbootstrap-out/packages/aarch64/mesa-egl-19.0.0-r999.apk \
    /home/YOU/.local/var/pmbootstrap-out/packages/aarch64/mesa-gl-19.0.0-r999.apk \
    /home/YOU/.local/var/pmbootstrap-out/packages/aarch64/mesa-glapi-19.0.0-r999.apk \
    /home/YOU/.local/var/pmbootstrap-out/packages/aarch64/mesa-gles-19.0.0-r999.apk \
    user@<IP OF DEVKIT>:~/

These can be easily installed/upgraded by running the following when logged into the device:

$ sudo apk add mesa*.apk

Note: The Mesa package in this branch disables all other GPU drivers to help reduce compile time, and may also be buggy since it's based off of the Mesa master branch, so it's not likely to be merged into mainline pmaports.

Todo

  • Add uuu as a supported 'flasher' in pmbootstrap
    • Include a uuu script for flashing rootfs. Note: It will likely need to be a template, with pmb injecting path to rootfs and u-boot.
  • Bring up cellular modem
  • Resolve issues with Wifi
    • Interface shows up in OS, and wpa_supplicant seems to connect(?), but no IP.
  • Resolve issues with Bluetooth
    • Bluetooth can be started by loading the rsi_91x module with dev_oper_mode=14 but this disables Wifi station/client mode and enables Wifi AP mode. It doesn't seem to work with dev_oper_mode=13, which enables Wifi client mode.
  • Current dts enables usb host but doesn't enable LCD display
    • Some of us are not lucky enough to have a working LCD display.. so the default uses a dts that enables usb host mode for attaching keyboard/mouse for interacting with an HDMI display connected to the devkit. Others are lucky enough to have a working LCD display. There is no known dts file that includes both LCD display enabling magic and usb host enabling magic. This would be ideal.
  • Test/enable camera
  • Test/enable ambient light sensor


See also