Nokia N900 (nokia-n900)

Contributors

 * sicelo
 * Danct12
 * MartijnBraam
 * craftyguy
 * Pavel Machek
 * drebrez
 * FXKrait
 * ollieparanoid

Additional info
Cameras are supported in the kernel, but have very complex media pipelines. Megapixels has preliminary support for at least the rear/main camera.

The GPU is a PowerVR SGX530 which does not have FOSS drivers, so 3D acceleration does not work with the mainline kernel. However, the blobs, patched mesa, and patched wlroots that permit it to work on mainline with postmarketOS are maintained in the pvrports project. It packages the work of the linux openpvrsgx dev group, which maintains a "near-mainline" kernel fork with the required kernel driver.

Voice calls work, but need https://gitlab.com/libcmtspeechdata/libcmtspeechdata to route the speech data. Due to very tight timings involved in the associated protocol, the audio is very low quality unless additional processing is performed (Nokia had closed-source Pulseaudio modules for this).

There's bluetooth support at bluetooth-next, but that works on N950, not on N900. Bluetooth. The driver compiles fine and loads firmware correctly, then times out on the bluetooth 'read_BD_ADDR' HCI command.

OTG might work since the kernel has support. However, like Wileyfox_Swift_(wileyfox-crackling), there is a hardware limitation that prevents the N900 from automatically detecting that there's a connected device, and also detecting the USB version/speed it supports. With some work, it most likely should work with manual activation

Flash postmarketOS to SD card
Follow the instructions on the installation page for installing postmarketOS to the SD card. Running from internal storage is not supported and probably has no real benefit since it is quite slow.

If your phone does not jump from Nokia logo to U-Boot prompt when powered on and booted with the keyboard slider open, you'll need to install U-Boot by Pali, see.

The first boot takes longer, as the root partition gets resized to fit the whole SD card. There is a lot of kernel output during boot, just wait patiently until i3wm shows up. Read for the N900 specific keybindings, most importantly , then   to open a terminal. You can use  to connect to a Wi-Fi network (  can be used also: https://wiki.postmarketos.org/wiki/WiFi#Using_NetworkManager).

Boot from the SD card

 * 1) Install u-boot from pali on the n900 in Maemo. If this does not work in Hildon Application Manager, you may run   in maemo terminal (see  and ).  See Additional Info below for instructions on configuring pmos to boot by default.
 * 2) Place the sdcard into the n900 and boot it with the keyboard slide open
 * 3) Choose the u-boot shell
 * 4) enter   into the shell

Configuring U-boot (optional)
In order to configure pmos to boot by default on the N900, using U-boot, you will need to boot into Maemo and create a  file as the root user with these contents:

It can be set as the default boot option by creating a symlink:

root@Nokia-N900:~# ln -s /etc/bootmenu.d/10-pmos.item /etc/default/bootmenu.item Finally, run :

root@Nokia-N900:~# u-boot-update-bootmenu Default bootmenu entry is '/etc/bootmenu.d/10-pmos.item' Adding bootmenu entry for: 'Maemo 5 with attached kernel (Internal Nand)'

Configuration file: /etc/bootmenu.d/10-pmos.item Adding bootmenu entry for: 'postmarketOS' Configuring this bootmenu entry as default

Generating u-boot bootmenu script... Note: This will set pmos as the default boot option. Maemo will still be accessible when booting the N900 with the keyboard slide out and selecting the relevant boot option in the u-boot boot menu.

Wifi
The  package is required to provide the wl1251 firmware necessary for initializing the wifi device. (#1414) You get asked during  if you would like to install that proprietary firmware package.

Now you can use NetworkManager's console UI to connect to your network. Please note that  does not work properly when started from.

With iwd
From the 5.15.13 kernel package onwards, you are also able to use  to manage wireless, if you so prefer.

With ConnMan
If connman is already used for GPRS per instructions below, don't forget to unblacklist wlan in.

Power saving / ping times
It should be possible to disable power saving for better ping times, see.

Sound
Modules need not to be compiled, sound support is built into kernel. Install alsa-utils.

aplay /usr/share/sounds/alsa/Front_Left.wav

NikkSaan provided an advanced audio configuration in #702 (comment).

Keyboard Backlight
There are 6 keyboard backlight LEDs that can be adjusted, they are found under. To adjust brightness, write a value, $VAL between 0 and 255, to the  parameter as the root user:

for i in $(seq 1 6); do echo $VAL &gt; /sys/class/leds/lp5523\:kb$i/brightness done

Keyboard layout
The keyboard layout is asked during  after you select the   device.

Available keymaps:

Console

 * NOTE: during installation pmbootstrap will typically ask you for the desired keymap. The following is only for experimentation: normally all should just work fine after setting up the SD card from pmbootstrap. The following section may be dated and pmbootstrap has already done the job for you.

To obtain your desired language keymap file for the RX-51, such as this one:


 * On the N900, install, either by using   on the host system or by running   on the device itself.


 * The keymap must be in binary format, bmap. This can be accomplished using the  tool:


 * Compress it and copy it to  on the N900.


 * Log into the N900, and run, then select   and finally.

(TODO: Need to pull 'official' vconsole keymaps from Maemo5 if they exist..)

X11

 * NOTE: during installation pmbootstrap will typically ask you for the desired X11 xkb keymap. The following is only for experimentation: normally all should just work fine after setting up the SD card from pmbootstrap. The following section may be dated and pmbootstrap has already done the job for you.

In X11 you can use  to configure the desired layout.

Right now it's configured to use the  layout by default (see 40-xkb.conf) then the pmbootstrap script will patch this file to set the   to   where "nn" is your country code.

Console switching
You can use the  key in combination with the   to switch to a different virtual terminal.

If you installed postmarketOS with a UI, you first have to enable again the other VT by editing the  file and uncomment the following lines:

Display
With DRM enabled, the display can be managed at this location:

For example, the display can be turned off by:


 * 1) echo 1 &gt; /sys/devices/platform/omapdrm.0/graphics/fb0/blank

To adjust brightness:


 * 1) # Replace $VAL with a value from 0 to 255:
 * 2) echo $VAL > /sys/class/backlight/acx565akm/brightness

i3wm
I3wm is the recommended UI. It is lightweight and fast, and we have a custom N900 configuration that optimizes for its keyboard (photos). The most important keybindings are described below, for details see i3wm.conf. This file gets installed to  and of course you can customize it. If you have good additions, please make a merge request so everybody benefits from an improved default config.

default mode

 * shift + space: switch to "command mode"

command mode

 * t: open terminal
 * k: kill current program
 * w: workspace mode
 * r: restart i3wm (use after modifying the config)
 * q: go back to "default mode"

workspace mode

 * a/s/d/f/g: switch to workspace 1/2/3/4/5
 * q: go back to "command mode"

Xfce4
Xfce4 also works very well on the N900

Others
There are also Mate, etc.

Misc: Power button
If you want to make use of the power button, bind  to this script:

Misc: Middle click and right click
Obviously, you can't middle click with a touchscreen, but this can be annoying when it's one of the few ways to paste in the terminal. This script simulates a middle click:

For simulating right click button you can use this command:

You can bind it to any key you wish. is a good choice since it's fairly easy to reach and isn't used for anything.

Charging
Battery charging is fully supported by the kernel and does not need any special configuration.

Normally, the N900 will auto-detect the connected charger type, and pull an appropriate current from it. However, in the event that this does not work, you can adjust it manually as follows:

You can also directly set the current limit by writing one of: 100 500 800 1800 to. Any other value written will be rounded to the next higher number from this list.

Be sure that the charger/port can supply the amount of current safely

Hint: To disable the LED charging indication, do:

.

Datasheet for the bq24150 charging chip

Capacity Reporting
The current battery capacity can be found under, and is represented as a percentage. For example, a value of  equates to. To calibrate the battery and get a more accurate capacity report:


 * 1) Charge it up fully, using a wall power adapter.
 * 2) Unplug the device, then allow the battery to run all the way down. This may take quite a while to happen (&gt;24hrs, but can be made shorter by running a CPU intensive workload). Do not let it charge at all during this time. This means you may not use USB for example, as this automatically causes the device to start charging, albeit slowly.
 * 3) When the voltage reaches 3248mV, the battery charge gauge chip will be calibrated. You may charge it up again to use the device. Note it may require a number of learning cycles to more accurately learn the battery capacity

Datasheet for the bq27200 charge gauge chip

Battery Protection
Currently, when battery gets below suitable operating voltage, the device dies. This is bad for the battery and the file system. Here is a script that monitors the battery, and powers the device off before the battery reaches critical state. For suggested usage, read the program's comments.

Temperature
There's battery temperature sensor.

Setting the hardware clock
Since 49fd9e0e4efcf030ca47344858bdc74370a78603 the hardware clock works. If your hardware clock doesn't have the time set you can set it with:

Setting the hardware alarm clock
Realtime clock at /dev/rtc0 is on the twl4030 (PMU), and allows setting an alarm to wake the device from sleep, poweroff states.

Control trough  (Manual Page).

Manual control from sysfs:

SMS
You can use ofono test scripts

Here's an example using the test scripts to enable the modem and send an SMS:
 * 1) ./enable-modem
 * 2) ./online-modem
 * 3) ./send-sms 5033784582 "I like pizza." 0

Mass Storage
The Mass Storage class exposes a block device as a flash drive on your host machine.

For example, to use the "MyDocs" partition as Mass Storage Device, make sure you unmount the partition first (if mounted), then execute:

If you only need read permissions on the partition, you can set the read-only flag before exporting it:

GPRS
GPRS can be managed by connman. Either install connman using  or add it when installing pmOS by passing   to.

It's VERY important that you add the following to  BEFORE starting connman, else it will take over all network connection handling and disconnect you if you are connected over SSH:

Configure connman to start at boot:

Stop ofono in order to set APN:

Edit APN, where  should be replaced in the following commands with the IMSI from your SIM card. Replace  with the relevant APN for your cellular carrier (e.g. fast.t-mobile.com). This file should be created when ofono starts, so you should only need to add the APN.

Start ofono and power on modem.

$ sudo rc-service ofono start $ sudo connmanctl enable cellular

In some cases, it seems necessary to run a scan before the necessary service will show in connman, even though the scan is 'unsupported': $ sudo connmanctl scan cellular Error /net/connman/technology/cellular: Not supported $ sudo connmanctl services cellular_340369959729712_context1

Connect to the cellular service:

$ sudo connmanctl connect cellular_340369959729712_context1 Connected cellular_340369959729712_context1 $ ip addr show gprs0 10: gprs0:  mtu 1400 qdisc pfifo_fast state UNKNOWN qlen 10 link/[821] inet 33.238.141.172/32 brd 33.238.141.172 scope global gprs0 valid_lft forever preferred_lft forever

GPS
First, get network and date to work. Next, clone tui repository. it contains includes many goodies, including script for hardware testing, gps support, and graphical ofono control software.

mkdir /my cd /my git clone https://gitlab.com/tui/tui.git

Next, install packages necessary for compiling software and prepare gps2. enable-modem, online-modem and you should be able to run gps2. AGPS is not available, so expect long startup.

apk add gcc vala musl-dev make linux-headers gpsd cd /my/tui/ofone make gps2 ./gps2

gps2 reportedly can talk to gpsd. Needs further investigation.

FM Transmitter
The N900 contains an Si4713 FM transmitter, it's controlled by video4linux. To start transmitting:

Torch
The device has an ADP1653 flash controller, mainly for use with the camera. It drives two white power LEDs connected in series, and has an additional red indicator led (referred to as a privacy indicator). The ADP1653 has a driver in mainline kernel, and it probes fine. However, some DTS changes are needed to make it work, since the driver requires it to be tied to a camera.

In the meantime, the LEDs can be used as a torch manually using. However, BE WARNED: setting wrong values via i2c runs the risk of over-driving the LEDs and causing permanent hardware damage.

Resources

 * Kernel source
 * Images and Flashers for Maemo
 * issue about Wi-Fi Setup and Keyboard layout
 * ollieparanoid's efforts to use the N900 as music player
 * N900 rescueOS
 * Mobile phone battery emulator describes how to create a mock battery for Nokia phones of the n900 type so the phone can be run from a PSU
 * N900 rescueOS
 * Mobile phone battery emulator describes how to create a mock battery for Nokia phones of the n900 type so the phone can be run from a PSU

Helpful Links for Porting

 * Device schematic
 * Very detailed schematic
 * Arch Linux ARM - N900 hardware components list
 * N900 sensor access in Maemo
 * Hardware component specs / list
 * Kernel status