nyuuzyou/wikis huggingface dataset:
Samsung M12 (samsung-m12)

== Contributors ==
* Dust417
== Users owning this device ==
== How to unlock bootloader ==
# Go to Settings > About device and click on Build Number seven times
# Go to Settings > Enable OEM unlocking and turn it on
# Power down the device
# Hold down 
# Connect device to computer through a USB cable
# Long press 
# Press it again to confirm it
== How to enter flash mode ==
Power off the device, hold volume up and down together, then connect it to the computer and press volume up to continue.
== Installation ==
Backup your data.
The device package and modified pmbootstrap tool has not been merged yet, so it is needed to git clone it from below
git clone https://gitlab.com/Dust417/pmbootstrap.git -b heimdall-dtbo pmbootstrap
mkdir -p ~/.local/var/pmbootstrap/cache_git/
cd pmbootstrap
git clone https://gitlab.postmarketos.org/postmarketOS/pmaports.git ~/.local/var/pmbootstrap/cache_git/pmaports
git clone https://gitlab.com/Dust417/pmaports.git -b samsung-m12 aports
rm -r ~/.local/var/pmbootstrap/cache_git/pmaports/device/testing/
mv aports/device/testing ~/.local/var/pmbootstrap/cache_git/pmaports/device/
from now on you can use python3 pmbootstrap.py <command>
Use pmbootstrap to build your own installation image.
$ pmbootstrap init
If installing to sdcard
$ pmbootstrap install --sdcard=<example /dev/sdf>
If installing to the emmc
$ pmbootstrap install
before we start flashing, we must copy the directory with the generated install files because pmbootstrap looks for them at the wrong location for some reason
$ pmbootstrap chroot
# cp -r /mnt/chroot_rootfs_samsung-m12 /mnt/rootfs_samsung-m12/
# exit
$ pmbootstrap flasher flash_vbmeta
$ pmbootstrap flasher flash_kernel
$ pmbootstrap flasher flash_dtbo
== Display ==
== GPU acceleration ==
The odroid n2+ has the same gpu and support for linux, so it is possible to download and install the mali g52 proprietary driver (version 37 is the closest to the kernel version) however so far the acceleration has been working only when using ptitsebs gl4es compiled for odroid, the LIBGL_FB environment variable mustn't be set to 0 or it will cause kernel panic.
== Audio ==
Audio is working, but only when using the alsa devices directly, without pulseaudio or pipewire.
To enable speaker do
# alsaucm set _verb HiFi set _enadev Speaker
To enable headphones do
# alsaucm set _verb HiFi set _enadev Headphones
To test it
$ speaker-test -t sine -D sysdefault
== Other ==
To enable flashlight
# echo 1 > /sys/class/camera/flash/rear_flash
To enable vibration
# echo > /sys/class/timed_output/vibrator/enable
If using xfce4 this has to be disabled
== See also ==
* Samsung M12 Device package
* Modified pmbootstrap with heimdall dtbo flashing support
Samsung Modem

Samsung modems use three abstraction layers:
# Kernel interface (specific to each modem)
## This can be further divided into the power control of the modem, the kernel<->userspace interaction, and the kernel<->modem interaction
# Samsung IPC modem protocol (specific to Samsung devices)
# Radio Interface Layer
## On Android, this is via RIL, it could go via oFono on pmOS
The IPC protocol, libsamsung-ipc, has been reimplemented as free software by Replicant.
There have been patches to add libsamsung-ipc support to ofono, a potential RIL for postmarketOS, but it doesn't seem like they were merged due to licensing issues which have now been resolved. libsamsung-ipc has since been almost entirely re-written, but the patches have been forward-ported at https://github.com/xc-racer99/ofono and https://github.com/xc-racer99/libsamsung-ipc
There is a tool called samsungipcd (packaged in pmOS), that emulates an AT-compatible modem on top of a Samsung modem (using libsamsung-ipc). This tool uses a pair of legacy BSD pseudoterminals to emulate a serial port, so in order to use it you must have CONFIG_LEGACY_PTYS enabled in the kernel.
The kernel part of the driver for some Samsung modems has been ported to mainline, see discussion here. However if your modem is not an XMM626, you will have to use a downstream kernel to have working modem.
Category:Technical Reference
Samsung Z1 (samsung-kiran)

== Contributors ==
* peremen
== Maintainer(s) ==
== Users owning this device ==
== How to enter flash mode ==
Similar as Samsung's Android counterparts:
* Hold + + buttons to enter flash mode.
* Hold + + buttons to enter recovery mode.
/proc/cmdlines for different power on reasons:
* Normal mode: mem=768M ram=768M root=/dev/mmcblk0p24 ro rootfstype=ext4 rootwait bootmode=normal pwron.reason=0x0 ...
* Recovery mode: mem=768M ram=768M root=/dev/mmcblk0p24 ro rootfstype=ext4 rootwait systemd.unit=recovery-mode.target pwron.reason=0x0 ...
* Plugging in charger: mem=768M ram=768M root=/dev/mmcblk0p24 ro rootfstype=ext4 rootwait systemd.unit=charging-mode.target pwron.reason=0x0 ...
== Installation/Known Problems ==
Technically similar as Samsung's Android counterparts, however, there are some caveats. The stock Tizen boot image uses dzImage, basically vmlinuz + Spreadtrum dtb binary (can generate using dtbtool-sprd) with custom header. Because Tizen kernel does not enable initramfs, and S-BOOT on this device seems to lack support of it, we are using isorec. The current postmarketOS kernel will use KERNEL to store dzImage, RAMDISK to store initramfs. Make sure to flash both partitions when going from Tizen to postmarketOS and vice versa.
Booting non-stock kernel image will show a red exclamation mark on the top left of boot screen.
The sprdfb driver of Tizen kernel is different from Android devices using the same SoC: it has DRM driver for this SoC, predates what is in the mainline. Graphics memory management seems to be done using libtbm in Tizen and X.org proprietary driver. There is no memory region for sprdfb driver mentioned in the .dts file, thus mmap() to the framebuffer returns only an error. The postmarketOS kernel patch manually includes the memory region in the .dts file and modifies the memory allocation to make framebuffer work. Lack of proper Spreadtrum datasheet makes further progress hard.
== Components ==
* UART: 1.8 V, See Serial debugging:Cable schematics#Samsung_Galaxy_S7_and_S5. 150K Ohm resistor enables serial console.
* Wi-Fi: Broadcom BCM4343S, requires firmware (from either Tizen or any other)
* GPS: Broadcom BCM47520
* MUIC: Richtek SM5504
* Charger: Richtek SM5701
== See also ==
* Initial merge request
* 
* 
* Kernel source (mirrored from Samsung OSS Center)
Screen locker

== List of screen lockers ==
=== PhoshLockscreen ===
The lockscreen of Phosh is not a separate package but part of Phosh itself. It consists of three parts:
* lockscreen-manager: The singleton that manages screen locking (source)
* lockscreen: The main lock screen (source)
* lockshield: Lock shield for non primary screens (source)
=== kscreenlocker ===
Plasma mobile comes with KDE screen locker. Package name is kscreenlocker.
=== xfce4-screensaver ===
Default implementation on Xfce4. It can be configured in the screensaver preferences (documentation page).
The virtual keyboard for the unlocking screen is configured in the preferences by command onboard -e -l Phone. This uses the "Phone" layout, it could be changed to another onboard layout. It could also be changed to another virtual keyboard, however, it needs to be one that offers embedded mode (windowed mode doesn't work in xfce4-screensaver). An alternative would be matchbox-keyboard with option for embedded mode: matchbox-keyboard --xid.
Changes on the locking state can be monitored via dbus by: dbus-monitor --session "type='signal',interface='org.xfce.ScreenSaver'" However, the unlock signal is issued after entering the password at the unlocking screen – it monitors the state of lock, not the state of the screen. The lock state can also be checked by xfce4-screensaver-command --query.
An example draft script to use dbus-monitor to disable inputs and LEDs when locked can be found here: Screen_locker:Disable_inputs#Xfce4.
The command xflock4 is not a locker itself. It's a wrapper using either xfce4-screensaver, xscreensaver, gnome-screensaver, xlock or slock (source).
=== mate-screensaver ===
Similar to xfce4-screensaver. However, the settings doesn't offer virtual keyboard options. It can be done by gsettings, though.
* gesttings set org.mate.screensaver embedded-keyboard-enabled true
* gesettings set org.mate.screensaver embedded-keyboard-command 'onboard -e -l Phone'
For more options setting up the virtual keyboard, see MATE#Lock_screen. 
=== xscreensaver ===
XScreenSaver seems not be able to embed a virtual keyboard.
=== swaylock ===
Package description: Screen locker for Wayland.
=== i3lock ===
Locker of the i3wm user interface.
=== xautolock ===
Package description: An automatic X screen-locker/screen-saver.
=== slock ===
Package description: A simple screen locker for X.
=== boinc-screensaver ===
Package description: Open-source software for volunteer computing and grid computing. (screensaver)
=== gnome-screensaver ===
Not available at Alpine Linux or postmarketOS.
=== light-locker ===
Not available at Alpine Linux or postmarketOS.
== Disable inputs ==
Some of the screen lockers don't disable inputs. Possible solutions can be colleted at: Screen_locker:Disable_inputs
Category:Apps
Sensors

Devices usually have some sensors such as IMU, light or proximity sensors in them. This page is intended to provide various tips on enabling and testing those sensors.
== Accelerometer ==
The accelerometer is used for automatic screen rotation.
iio-sensor-proxy is used by some UI's to track the display orientation, you can use monitor-sensor tool to see, what it thinks the orientation of the device is.
If the rotation is reported incorrectly, you may need to define mount-matrix. See e.g. the device tree bindings.
A Python script to generate the mount matrix can be found here and here (Same script but with additional patches.)
== Magnetometer ==
See separate article on magnetometer.
== Proximity sensor ==
Proximity sensor is usually located behind the screen on top of the device and is used to blank the screen when the user takes the device near the ear.
=== iio-sensor-proxy ===
iio-sensor-proxy can report the "near" state to other programs on the device but it needs to know what's the "near" level to report it.
There are multiple ways to provide that information:
* Define proximity-near-level in the devicetree. The iio device driver must support reading and reporting that value.
* For those drivers that don't support the DT property, it's possible to add an udev rule like this: (Consider extending the driver like this instead)
As with other sensors that iio-sensor-proxy monitors, you can use monitor-sensor tool to check the proximity sensor.
== Hall sensor ==
Also known as Hall IC or flip cover sensor. When a piece of magnet approaches the sensor, the phone suspends. Note that suspending is not implemented on some SoCs yet.
Category:Technical Reference
Serial debugging/Serial Gadget

For devices where getting a physical UART cable is not possible, or not feasible, the kernels USB serial gadget can be a good option for debugging when you know that the kernel is booting.
== Enabling serial gadget ==
Turn on the following kernel config options:
CONFIG_USB_G_SERIAL=y
CONFIG_U_SERIAL_CONSOLE=y
CONFIG_USB_U_SERIAL=y
Add the following to your kernel cmdline to enable logging to the gadget console:
console=ttyGS0,115200
== Using the gadget ==
Now when booting your device, you should see a new serial device appear on your host, usually it's /dev/ttyACM0.
This one liner can make sure you don't miss anything (although usually the output is buffered until you open the device).
Sometimes the gadget buffer breaks down and it sends a lot of the same few characters over and over, when this includes newlines it can cause you to lose a lot of the logs, hence the grep below.
Leave this running in a console and the boot logs will be printed every boot.
while true; do test -e /dev/ttyACM0 && sleep 0.1 && cat /dev/ttyACM0 | grep -vE "^\s?\n$"; done
== Initramfs debugging ==
You may also drop a shell in the initramfs by adding pmos.debug-shell to your kernel cmdline. A shell will automatically be spawned on the USB serial gadget device.
== References ==
* sunxi wiki page documenting usb serial gadget usage
Setup WiFi with iproute2

Enable the wlan0 interface and set it up for networking
 $ sudo ip link set wlan0 up
 $ sudo iw wlan0 set type managed
Configure wpa_supplicant (only necessary on WPA/WPA2 encrypted networks):
 $ sudo su -
 # wpa_passphrase $YOUR_SSID > /etc/wpa_supplicant/wlan0.conf
 <enter passphrase here and press Enter>
 # exit
Connect to network using wpa_supplicant:
 $ sudo wpa_supplicant -Dwext -i wlan0 -c /etc/wpa_supplicant/wlan0.conf 
If your network uses DHCP, start the DHCP client:
 $ sudo udhcpc -i wlan0
Category:Guide
Shelli

This is a command line based user interface developed first for the Geeksphone Keon and later for several other Android devices. It is really just a collection of simple bash scripts to try and replicate the common features on a phone such as calling, answering, texting, contacts, calendar, note taking, etc.
For postmarketOS shelli is combined with gesture recognition software to provide for a non-UI alternative which uses the touch screen and the linux framebuffer console.
=== Status ===
Initial packaging is in the works at https://gitlab.postmarketos.org/postmarketOS/pmaports/merge_requests/397.
Only known to work on Nexus 5. Some changes would be needed for how big the screen is and which event device is the touchscreen.
A short description and demo is available here: https://gitlab.com/unrznbl/gesture/wikis/gesture---handwriting-for-linux-touchscreens
=== Known Issues ===
I am using `echo "mem" > /sys/power/state` to suspend-to-ram when the power button is pressed. There may be an issue with this strategy. Maybe has something to do with kernel/irqs/watchdog not being fed? See dmesg output at time of failure: https://gitlab.postmarketos.org/postmarketOS/pmaports/merge_requests/265#note_150745636.
* waking up sometimes takes a second or two so be patient. Sometimes the gesture recognition may not be responsive after wake-up. Press the power button again twice to suspend/wake-up and it usually works again.
* tty may freeze when screen is left on for a while. It seems about after 5 minutes this may occur. Press the power button twice to suspend/wake-up to workaround.
Battery capacity reporting is broken. It seems that `/sys/class/power_supply/battery/capacity` is not reporting a percentage but a value that ranges from 0 to around 35,000. Maybe a kernel fix is needed?
Category:Interface
Shutdown-clear-rtc-wakealarm

Some devices with an RTC wake alarm automatically turn on from powered-off state when they reach the alarm time. This includes, but may not be limited to, the PINE64 PinePhone. Some users may find this undesirable, especially if they use full disk encryption since the phone will power on to the osk-sdl screen and just stay there until the battery runs out.
The shutdown-clear-rtc-wakealarm package contains an OpenRC service that clears the RTC wake alarm. It can be enabled to run in the shutdown runlevel with:
$ rc-update add clear-rtc-wakealarm shutdown
 * service clear-rtc-wakealarm added to runlevel shutdown
Note that this service does not automatically restore the cleared wakealarm upon a reboot. It is expected that whatever set the wakealarm originally will restore it. The wakealarm is known to be restored by:
- gnome-clocks + waked, the combination used by Phosh.
== See also ==
- 
- 
Category:Guide
SiFive HiFive Unleashed (sifive-hifive-unleashed)

The HiFive Unleashed is one of the earliest RISC-V devboards. On its own, it has very few I/O options (SD-Card, Ethernet, serial, and that's about it), but it can be extended through the mezzanine connector on the bottom side, by connecting a ChipLink-capable southbridge. Microsemi sold one, the HiFive Unleashed Expansion Board, based on their PolarFire FPGA, for around 2000 USD.
== Users owning this device ==
== How to enter flash mode ==
== Installation ==
=== Using pmbootstrap ===
TODO
== See also ==
* SiFive HiFive Unleashed vendor documentation
* HiFive Unleashed Expansion Board vendor documentation
* HiFive Unleashed Expansion Board CrowdSupply campaign
Sipeed M1s DOCK (sipeed-m1sdock)

Sipeed M1s DOCK is a development board based on the Sipeed M1s module, it has two USB-C ports, a microphone, a white LED, an SD card slot and support for Wi-Fi 4, Bluetooth 5 (with LE). It runs FreeRTOS as the operating system.
Despite being a small board that fits on a breadboard, it has a MMU and can run Linux. A PoC Linux demo is available on Sipeed's Wiki.
1.69-inch IPS LCD and 2 MP camera is not included, however Sipeed sells a bundle that include the M1s DOCK, Display and Camera.
Mainline Linux support is actively being developed by the OpenBouffalo community, and this pmOS port uses that.
== Contributors ==
* Danct12
== Users owning this device ==
== How to enter flash mode ==
* BL808 Bootloader: Plug in the device then hold down BOOT and hit RST.
* BL702 Bootloader: While holding the BOOT key, plug in the device.
== Installation ==
=== Flash postmarketOS to SD card ===
The internal SPI flash is only 16MB, which isn't enough to fit a minimal postmarketOS installation. Even if it's possible through memory upgrades, it'll never be supported.
$ pmbootstrap init # vendor: sipeed, device: m1sdock
$ pmbootstrap install --sdcard=/dev/sdcard # replace /dev/sdcard with the main block device of the SD card reader
The first boot takes longer, as the root partition gets resized to fit the whole SD card. DO NOT REBOOT, POWER OFF OR UNPLUG THE BOARD WHILE IT IS RESIZING.
=== Install U-Boot to SPI ===
The Sipeed M1s firmware by default does not have any SD card functionality. In order to boot to Linux on the SD card, U-Boot needs to be installed.
* Download the latest version of Bouffalo Lab Dev Cube and Buildroot for BL808
* Open BLDevCube for your platform, select BL808 as platform and hit Finish.
==== BLDevCube - MCU ====
* Go to the MCU tab
* Set the following:
** M0 Group [Group0] Image Addr [0x58000000] m0_lowload_bl808_m0.bin]
** D0 Group [Group0] Image Addr [0x58100000] d0_lowload_bl808_d0.bin]
* Set port to /dev/ttyACM1 and hit 'Create & Download'
When it finishes, switch to IOT tab.
==== BLDevCube - IOT ====
* Enable 'Single Download', set Address with 0x800000, choose bl808-firmware.bin
* Click 'Create & Download' again and wait until it's done
If you're having trouble following the text-based guide, check out these images:
File:Uboot-bldevcube1.jpg|MCU Tab
File:Uboot-bldevcube2.jpg|IOT Tab
Once everything is done, use PuTTY or Minicom and connect to the lower serial port (/dev/ttyACM0) with baudrate 2000000 8n1. Then hit the RST button on the board, if you see U-Boot then it is installed!
== See also ==
* initial MR
* 
*
Software OpenGL

Some interfaces, like Plasma-Mobile or simple games require 3D acceleration, even though they are only rendering fancy 2D graphics. With postmarketOS, we have a lot of devices, where 3d acceleration does not work, or does not work with open source drivers. As a workaround, it is possible to do that kind of rendering in software with mesa-swrast. But that is too slow to be usable in most cases. This article lists some alternatives, that will hopefully be more performant.
== TinyGLES ==
TinyGLES was originally written and optimized for the Pandora, which uses the same chipset as the N900. Upstream told us, that it is worth trying at least.
We've tried a bit to get Hildon working, but we did not get very far with it yet.
Current stack:
(hardware) - mesa (swrast) - cogl - clutter - hildon
New stack:
(hardware) - tinygles - glshim - cogl - clutter - hildon
It makes sense to run cogl demos with tinygles before trying anything hildon or clutter related, as Clutter depends on cogl.
More information:
* glshim
* Packaging glshim for pmOS/alpine
* Asking upstream if this is possible
* Unable to run hildon-desktop: Failed to create texture 2d due to size/format constraints
* Pandora thread about glshim (contains debug environment variables etc!)
== OpenSWR ==
OpenSWR does not work on non-x86 architectures due to its usage of , see 
== Others ==
Not much research has gone into these, please expand.
* swiftshader (see ), packaging efforts in 
Category:Technical Reference
Solidrun CuBox (solidrun-cubox)

The Solidrun CuBox is the first in a series of small and fanless nettop-class computers manufactured by the Israeli company SolidRun Ltd. 
This port covers the Marvell Armada 510 (88AP510) based first revision. 
== Installation ==
Use pmbootstrap to build your own installation image, install to sd-card is currently the only option.
$ pmbootstrap init
# select edge, solidrun, cubox
$ pmbootstrap install --disk /dev/sdX
Note: installation to USB-memory or HDD should also be possible, but would require a modified `boot.src`
== TODO ==
* HDMI: investigate to get working
* SPDIF/TOSLink (audio-out): investigate to get working
* ESATA: tested, works when CONFIG_SATA_MV=m is set in kernel config, needs to be added to latest pmaports config.
* Kernel: optimize config (community-config check passes, could still need optimization for auxiliary modules)
== Contributors ==
* Longnoserob
== Users owning this device ==
== See also ==
* Initial merge request
* 
* 
* Wikipedia - CuBox
Sony Ericsson Live With Walkman (sony-coconut)

== Contributors ==
* praticamentetilde
== What works ==
The device does boot fine. SSH via USB is available. The display and touchscreen work.
== What does not work ==
Other features not mentioned are untested.
== How to enter flash mode ==
With the device powered off, hold the "volume up" button while connecting the USB cable. The LED should turn blue.
== Installation ==
Due to the insufficent capacity of the internal memory, the rootfs image must be installed on an microSD card.
It is suggested to install using the netcat method, using
as target device the entire microSD card (/dev/mmcblk0).
== See also ==
* Initial pull request
* Touchscreen support merge request
* !178 16-bit depth fix for display merge request
* 
*
Sony Ericsson Satio (semc-kokoro)

== Users owning this device ==
== How to enter flash mode ==
* S1 Flash mode: While the phone is off, hold the green answer button on the front and connect a USB cable. The phone will connect as "SEMC USB Flash" with VID 0x0fce and PID 0xadde.
Not much about the S1 protocol the Satio uses is known apart from this document. There is a tool called SEMCTool for Windows which can interact with the phone. A Linux tool compatible with Satio does not appear to exist.
== Miscellaneous info ==
=== Boot configuration ===
The boot order is being defined by a set of pull-up and pull-down resistors on the board. If we read the existing pull-up resistors as "1" and the pull-down resistors as "0" we get the following (from the OMAP3430 reference manual):
sys_boot [4:0]	First 	Second	Third	Fourth	Fifth
0b10000 	OneNAND	USB 	UART3	MMC1 	-
If sys_boot5 is HIGH (pin is called "SERVICE" in the schematics), the boot configuration will be the following:
sys_boot [4:0]	First	Second	Third	Fourth 	Fifth
0b10000 	USB 	UART3 	MMC1 	OneNAND	-
It is possible to achieve USB boot by shorting sys_boot5 directly to 1.8 V. It seems like there is a 220 kΩ pull-up resistor at R2512, which is meant for sys_boot5, but measuring with a multimeter shows that sys_boot5 is still low. Note that connecting sys_boot5 directly to 1.8V without resistors could be dangerous.
If successful, the phone will connect with VID 0x0451 and PID 0xd009:
[71525.876081] usb 1-2.4: new high-speed USB device number 19 using xhci_hcd
[71525.997596] usb 1-2.4: unable to get BOS descriptor or descriptor too short
[71526.012347] usb 1-2.4: New USB device found, idVendor=0451, idProduct=d009, bcdDevice= 0.00
[71526.012354] usb 1-2.4: New USB device strings: Mfr=33, Product=37, SerialNumber=0
[71526.012357] usb 1-2.4: Product: OMAP3430
[71526.012360] usb 1-2.4: Manufacturer: Texas Instruments
Sadly, the SoC on this phone is HS (High Security), thus we won't be able to load unsigned binaries from USB.
== See also ==
* GSMArena page
* 
* Schematics and service manual
* SEMCTool for flashing
* Firmware archive
* OMAP3430 Technical reference manual