Difference between revisions of "Nokia N900"

From Maemo Leste Wiki
Jump to navigationJump to search
m (Make it clear that gpu driver isn't FOSS)
 
(33 intermediate revisions by 4 users not shown)
Line 1: Line 1:
{{Stub}}
{{Infobox Device
{{Infobox Device
|image=[[File:Nokia N900 - Leste pre-alpha.jpg|250px]]
|image=[[File:Nokia N900 - Leste pre-alpha.jpg|250px]]
Line 7: Line 5:
|dimensions=110.9mm x 59.8mm x 18mm
|dimensions=110.9mm x 59.8mm x 18mm
|release_date=2009-11-11
|release_date=2009-11-11
|category=Supported
|soc=TI OMAP 3430 @600MHz
|soc=TI OMAP 3430 @600MHz
|dram=256 MB Mobile DDR
|dram=256 MB Mobile DDR
Line 19: Line 18:
|sensors=
|sensors=
|other=
|other=
|headers=
|battery=1320mAh
|sw_kernel=5.1
|sw_serial=Yes, UART under battery, 2.7V max!
|sw_charging=Yes
|sw_usb_slave=Gadgets only
|sw_usb_host=With hacks
|sw_touchscreen=Yes, single-touch
|sw_keyboard=Yes
|sw_screen=Yes
|sw_hdmi=
|sw_tv=Yes
|sw_3daccel=Yes, closed driver
|sw_vibration=Yes
|sw_audio=Yes (complex, no ucm, no speaker protection)
|sw_calls=WIP
|sw_sms=Yes, no UI
|sw_wifi=Yes, firmware required
|sw_ethernet=
|sw_irda=Yes, actually CIR, not  IrDA
|sw_2g3gdata=Yes
|sw_4gdata=
|sw_bluetooth=No
|sw_fmtx=Yes
|sw_fmrx=No
|sw_nfc=
|sw_accelerometer=Yes
|sw_compass=
|sw_gyro=
|sw_proximity=Yes
|sw_als=Yes
|sw_gps=Yes
|sw_agps=No
|sw_frontcam=
|sw_backcam=
|sw_idlepower=300mW (needs kernel work)
|sw_standbytime=
}}
}}


The Nokia N900.
== Installation ==
 
== Status ==


{| class="wikitable"
The installation consists of two steps: copying the image to the microsd card, and setting up the bootloader on the phone.
! Feature
! Leste supported
! Notes
|-
| Kernel version || 5.1 || Mainline + PowerVR Patches: https://github.com/maemo-leste/n9xx-linux
|-
| Serial || Yes || Requires special hardware
|-
| Charging || Yes ||
|-
| Wireless || Yes || Firmware is non-free
|-
| Ethernet || N/A ||
|-
| Micro USB || Yes || USB Network, Mass Storage. OTG not working, although it might be possible
|-
| Keyboard || Yes ||
|-
| Screen || Yes || Uses omapfb, not omapdrmfb yet
|-
| 3D Acceleration || Yes || Works, using proprietary PowerVR SGX blobs
|-
| Touchscreen || Yes || Resistive
|-
| Audio || Yes || Works (minus speaker protection), but requires complex alsa configuration
|-
| 2G/3G data || Yes || Works with ofono; UI under way: https://github.com/maemo-leste/connui-cellular ; see https://github.com/maemo-leste/bugtracker/issues/76
|-
| SMS || Yes || Works with ofono, will be implemented using telepathy-ring, no UI yet
|-
| Phone calls || WIP || Works, no UI, poor quality for upstream audio, not enabled by default (might require pulseaudio audio filters)
|-
| Bluetooth || No || Driver problems in mainline
|-
| FM Transmitter || Yes || Install <code>v4l-utils</code>, then enable chip and set frequency using: <code>v4l2-ctl -d /dev/radio0 -c mute=0,tune_power_level=120 -f <freq></code>
|-
| FM Receiver || No || [https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/drivers/staging?id=757c2bf597a8e9f859f8efceda9c5108607fd98d Removed in Linux 5.4-rc1.]
|-
| Accelerometer || Yes || Available as input device, no integration yet. Needs MCE work
|-
| Compass || N/A || Missing in hardware
|-
| Proximity sensor || Yes || No integration yet
|-
| Ambient Light Sensor || Yes ||
|-
| Vibration Motor || Yes ||
|-
| HDMI-out || N/A || Missing in hardware
|-
| TV-out || Yes || Enable in alsamixer (Jack Function in alsamixer to TV OUT), enable with <code>xrandr --output TV --mode 800x480 --same-as LCD</code>. Set PAL/NTSC with <code>xrandr --output TV --set SignalProperties PAL</code>, and scale with <code>xrandr --output TV --set TVScale 90</code>.
|-
| GPS || WIP || Works using gps3 and gpsd, needs integration still, and work on a-gps
|-
| Infrared || Yes || TX only (hardware limitation).  
|-
| Camera ||  || Needs complex v4l work
|}


== Installation ==
=== Image installation ===


* Latest image: https://phoenix.maemo.org/job/leste-image-n900/lastSuccessfulBuild/artifact/arm-sdk/dist/
* Latest image: https://phoenix.maemo.org/job/leste-image-n900/lastSuccessfulBuild/artifact/arm-sdk/dist/
* Image archive: https://maedevu.maemo.org/images/n900/
* Image archive: https://maedevu.maemo.org/images/n900/


dd the image to an sd card. If using a Windows machine, you can use [https://etcher.io/ Etcher] '''NB:''' Etcher does not warn you before starting the flashing operation, so please be extra careful that you choose the correct device to flash to
dd the image to an sd card.
 
If using a Windows machine, you can use [https://etcher.io/ Etcher]
 
See the next section on how to boot. (using either 0xFFFF/flasher-3.5 or u-boot/bootmenu: http://talk.maemo.org/showthread.php?t=81613)
 
=== Bootloader (U-Boot) setup ===


Then boot from the sd card using either 0xFFFF/flasher-3.5 or u-boot/bootmenu: http://talk.maemo.org/showthread.php?t=81613
==== Quick ====


=== U-Boot setup ===
If you don't want to configure u-boot from Fremantle, or your Fremantle rootfs is broken), or you just want to install quickly:


==== If you don't want to configure u-boot from Fremantle, or your Fremantle rootfs is broken), or you just want to install quickly ====
1. Either download 0xFFFF (binary for x86) from https://maedevu.maemo.org/images/n900/tools/ or build from source from https://github.com/pali/0xFFFF/


1. Download 0xFFFF and u-boot from https://maedevu.maemo.org/images/n900/tools/
2. Download u-boot from https://maedevu.maemo.org/images/n900/tools/


2. Turn off Nokia N900, issue the following command on PC and connect Nokia N900 to the PC: '''sudo ./0xFFFF -m test/u-boot-2013.04-2.bin -l'''
3. Turn off Nokia N900, issue the following command on PC and connect Nokia N900 to the PC: <code>sudo ./0xFFFF -m test/u-boot-2013.04-2.bin -l</code>


3. Open the keyboard slider on the N900, and then issue following command on PC to test boot: '''./0xFFFF -b'''
4. Open the keyboard slider on the N900, and then issue following command on PC to test boot: <code>./0xFFFF -b</code>


This should present u-boot from which you can select external SD card and boot to Maemo Leste. If you are presented with a menu, select the option to boot from External SD card. If you just get a command prompt, type '''run sdboot'''.
This should present u-boot from which you can select external SD card and boot to Maemo Leste. If you are presented with a menu, select the option to boot from External SD card. If you just get a command prompt, type <code>run sdboot</code>.


To flash u-boot permanently, you can issue the following command
To flash u-boot permanently, you can issue the following command


'''(BE CAREFUL THOUGH. THIS WILL REPLACE THE EXISTING FREMANTLE KERNEL. ONLY DO THIS IF YOU DO NOT CARE ABOUT THE EXISTING MAEMO INSTALLATION OR YOU KNOW HOW TO RECOVER FROM THIS CONDITION)''':
'''(Be careful though. This will replace the existing fremantle kernel. Only do this if you do not care about the existing maemo installation or you know how to recover from this condition)''')


'''sudo ./0xFFFF -m test/u-boot-2013.04-2.bin -f'''
<code>sudo ./0xFFFF -m test/u-boot-2013.04-2.bin -f</code>


==== Existing Fremantle ====
==== Existing Fremantle ====
If you have a functional Fremantle installation, you can follow these steps instead:


1. Install "U-Boot with kernel 2.6.28-omap1"
1. Install "U-Boot with kernel 2.6.28-omap1"
Line 128: Line 112:


4. Reboot the device
4. Reboot the device


=== Increase filesystem size ===
=== Increase filesystem size ===
As of 2018/11, the latest pre-alpha image results in a 1.2GB root filesystem with about 100MB to spare. This can be extended, provided that your SD card is big enough.
Perform the following steps on a Linux machine with none of the SD card's partitions mounted:
* assumption: /dev/sda2 is Leste root partition
* e2fsck -f /dev/sda2
* use parted/gparted/cfdisk/... to enlarge /dev/sda2 to the desired size
* resize2fs -p /dev/sda2
* e2fsck -f /dev/sda2


The latest images have a script, <code>/etc/expandcard.sh</code> from https://github.com/maemo-leste/image-builder/blob/master/rootfs-overlay/common/etc/expandcard.sh
Run the following script: <code>/etc/expandcard.sh</code>


=== Serial ===
== Serial ==


http://n900.elektranox.org/serial-adapter.html
http://n900.elektranox.org/serial-adapter.html


http://wiki.maemo.org/N900_Hardware_Hacking#Debug_ports
http://wiki.maemo.org/N900_Hardware_Hacking#Debug_ports
Use this command line (specifically the part after rootwait):
<pre>
root=/dev/mmcblk0p2 rootwait console=ttyS2,115200 verbose earlyprintk debug
</pre>


== Notes ==
== Notes ==
Line 151: Line 135:


Also see: https://elinux.org/N900
Also see: https://elinux.org/N900


== Power Management ==
== Power Management ==
This ticket tracks hitting idle states for the N900: https://github.com/maemo-leste/bugtracker/issues/545


Power usage right now is reported to be about 80mA, which is quite a lot. On a good battery this will last for about 15 hours. Power management on the N900 is being worked on: https://github.com/maemo-leste/bugtracker/issues/170
Power usage right now is reported to be about 80mA, which is quite a lot. On a good battery this will last for about 15 hours. Power management on the N900 is being worked on: https://github.com/maemo-leste/bugtracker/issues/170
Line 172: Line 159:
Currently it does not yet reliably reach any sleep modes.
Currently it does not yet reliably reach any sleep modes.


 
See this code for a work in progress power management script: https://github.com/maemo-leste/n900-pm
This script can be used to decode idle states when this patch is applied: https://github.com/maemo-leste/n9xx-linux/blob/maemo/beowulf/debian/patches/0001_deeper_idle.patch
 
<pre>
$ cat idlest.py
"""
00001fff 48005020 (584be965) cm_idlest_per blocking bits: 0007e000
f7df3fb9 48004a20 (b32988a8) cm_idlest1_core blocking bits: 0020c046
0000000d 48004a28 (f7aa95e6) cm_idlest3_core
"""
 
# 31 to 0
cm_idlest1_core_bits = [
'RESERVED',
'ST_MMC3',
'ST_ICR',
'RESERVED',
'RESERVED',
'RESERVED',
'ST_MMC2',
'ST_MMC1',
'RESERVED',
'ST_HDQ',
'ST_MCSPI4',
'ST_MCSPI3',
'ST_MCSPI2',
'ST_MCSPI1',
'ST_I2C3',
'ST_I2C2',
'ST_I2C1',
'ST_UART2',
'ST_UART1',
'ST_GPT11',
'ST_GPT10',
'ST_MCBSP5',
'ST_MCBSP1',
'RESERVED',
'ST_MAILBOXES',
'ST_OMAPCTRL',
'ST_HSOTGUSB_IDLE',
'ST_HSOTGUSB_STDBY',
'RESERVED',
'ST_SDMA',
'ST_SDRC',
'RESERVED',
]
 
cm_idlest1_core_bits = list(reversed(cm_idlest1_core_bits))
 
#inp = '0020c046'
inp = '00208042' # after rmmod hci_nokia and hci_uart
 
v = int(inp, 16)
 
#print(v)
b= "{0:b}".format(v)
print((32-len(b))*'0' + b)
 
for i in range(0, 32):
    is_set = (v & (1 << i)) >> i
    if is_set:
        print(cm_idlest1_core_bits[i])
</pre>


== Battery calibration ==
== Battery calibration ==
Line 264: Line 189:
  ubiattach -p /dev/mtd5
  ubiattach -p /dev/mtd5
  mount -t ubifs ubi:rootfs /mnt/fremantle
  mount -t ubifs ubi:rootfs /mnt/fremantle
== Old status table ==
{| class="wikitable"
! Feature
! Leste supported
! Notes
|-
| Kernel version || 5.1 || Mainline + PowerVR Patches: https://github.com/maemo-leste/n9xx-linux
|-
| Serial || Yes || Requires special hardware
|-
| Charging || Yes ||
|-
| Wireless || Yes || Firmware is non-free
|-
| Ethernet || N/A ||
|-
| Micro USB || Yes || USB Network, Mass Storage. OTG not working, although it might be possible
|-
| Keyboard || Yes ||
|-
| Screen || Yes ||
|-
| 3D Acceleration || Yes || closed driver
|-
| Touchscreen || Yes || Resistive
|-
| Audio || Yes || Works (minus speaker protection), but requires complex alsa configuration and currently no ucm support
|-
| 2G/3G data || Yes || Works with ofono - UI is WIP, see https://github.com/maemo-leste/connui-cellular/
|-
| 4G data || N/A || no hardware
|-
| SMS || Yes || Works with ofono. Needs Leste UI
|-
| Phone calls || WIP || Works, no UI, poor quality for upstream audio, might require pulseaudio audio filters
|-
| Bluetooth || No || Driver needs some work
|-
| FM Transmitter || Yes || Install <code>v4l-utils</code>, then enable chip and set frequency using: <code>v4l2-ctl -d /dev/radio0 -c mute=0,tune_power_level=120 -f <freq></code>
|-
| FM Receiver || No ||
|-
| Accelerometer || Yes ||
|-
| Compass || N/A || No hardware
|-
| Gyro || N/A|| No hardware
|-
| Proximity sensor || Yes || evdev interface not supported in mce
|-
| Ambient Light Sensor || Yes ||
|-
| Vibration Motor || Yes ||
|-
| HDMI-out || N/A || No hardware
|-
| TV-out || Yes || Enable in alsamixer (Jack Function in alsamixer to TV OUT), enable with <code>xrandr --output TV --mode 800x480 --same-as LCD</code>. Set PAL/NTSC with <code>xrandr --output TV --set SignalProperties PAL</code>, and scale with <code>xrandr --output TV --set TVScale 90</code>.
|-
| GPS || Yes || Works with gpsd but is not integrated yet, see [[#GPS|GPS]]
|-
| Infrared || Yes || TX only (hardware limitation).
|-
| Camera || No || Needs complex v4l work, no leste integration
|-
| Idle power consumption || ~300mW || Device does not enter RET or OFF mode
|}




[[Category:Device]]
[[Category:Device]]

Latest revision as of 14:00, 28 November 2021

Nokia N900
Nokia N900 - Leste pre-alpha.jpg
Manufacturer Nokia
Codename Rover, RX-51
Dimensions 110.9mm x 59.8mm x 18mm
Release Date 2009-11-11
Category Supported
Specifications
SoC TI OMAP 3430 @600MHz
DRAM 256 MB Mobile DDR
Hardware Features
LCD 800x480 3.5" Resistive TFT
Video PowerVR SGX530
Network WL1251
Storage 32GB
USB (Host/OTG) Micro USB 2.0 Slave
Battery Capacity 1320mAh
Software Features
Kernel 5.1
Serial Yes, UART under battery, 2.7V max!
Charging Yes
USB Slave Gadgets only
USB Host With hacks
Touchscreen Yes, single-touch
Keyboard Yes
Screen Yes
TV-out Yes
3D acceleration Yes, closed driver
Vibration motor Yes
Audio Yes (complex, no ucm, no speaker protection)
Phone calls WIP
SMS Yes, no UI
Wifi Yes, firmware required
IrDA Yes, actually CIR, not IrDA
2G/3G data Yes
Bluetooth No
FM transmitter Yes
FM receiver No
Accelerometer Yes
Proximity Sensor Yes
Ambient Light Sensor Yes
GPS Yes
A-GPS No
Idle Power Consumption 300mW (needs kernel work)

Installation

The installation consists of two steps: copying the image to the microsd card, and setting up the bootloader on the phone.

Image installation

dd the image to an sd card.

If using a Windows machine, you can use Etcher

See the next section on how to boot. (using either 0xFFFF/flasher-3.5 or u-boot/bootmenu: http://talk.maemo.org/showthread.php?t=81613)

Bootloader (U-Boot) setup

Quick

If you don't want to configure u-boot from Fremantle, or your Fremantle rootfs is broken), or you just want to install quickly:

1. Either download 0xFFFF (binary for x86) from https://maedevu.maemo.org/images/n900/tools/ or build from source from https://github.com/pali/0xFFFF/

2. Download u-boot from https://maedevu.maemo.org/images/n900/tools/

3. Turn off Nokia N900, issue the following command on PC and connect Nokia N900 to the PC: sudo ./0xFFFF -m test/u-boot-2013.04-2.bin -l

4. Open the keyboard slider on the N900, and then issue following command on PC to test boot: ./0xFFFF -b

This should present u-boot from which you can select external SD card and boot to Maemo Leste. If you are presented with a menu, select the option to boot from External SD card. If you just get a command prompt, type run sdboot.

To flash u-boot permanently, you can issue the following command

(Be careful though. This will replace the existing fremantle kernel. Only do this if you do not care about the existing maemo installation or you know how to recover from this condition))

sudo ./0xFFFF -m test/u-boot-2013.04-2.bin -f

Existing Fremantle

If you have a functional Fremantle installation, you can follow these steps instead:

1. Install "U-Boot with kernel 2.6.28-omap1"

2. Install "Linux kernel for power user (boot image for U-Boot)". This is optional, but recommended.

3. Add Maemo Leste menu item (run as root):

cat > /etc/bootmenu.d/30-maemo-leste.item << "EOF" &&
ITEM_NAME="Maemo Leste"
ITEM_KERNEL="uImage"
ITEM_DEVICE="${EXT_CARD}p1"
ITEM_FSTYPE="ext2"
EOF
u-boot-update-bootmenu

4. Reboot the device


Increase filesystem size

Run the following script: /etc/expandcard.sh

Serial

http://n900.elektranox.org/serial-adapter.html

http://wiki.maemo.org/N900_Hardware_Hacking#Debug_ports

Use this command line (specifically the part after rootwait):

root=/dev/mmcblk0p2 rootwait console=ttyS2,115200 verbose earlyprintk debug

Notes

  • Speakers are enabled by default, but be careful of very high frequencies/levels - there are concerns regarding the possibility to blow them

Also see: https://elinux.org/N900


Power Management

This ticket tracks hitting idle states for the N900: https://github.com/maemo-leste/bugtracker/issues/545

Power usage right now is reported to be about 80mA, which is quite a lot. On a good battery this will last for about 15 hours. Power management on the N900 is being worked on: https://github.com/maemo-leste/bugtracker/issues/170


Run:

modprobe ledtrig-default-on

And:

echo default-on > /sys/class/leds/debug::sleep/trigger

To enable the OMAP sleep debug LEDs (on the keyboard). Open keyboard, turn off the screen with the slider, and the LEDs will turn off if the phone ever reaches sleep modes.

Currently it does not yet reliably reach any sleep modes.

See this code for a work in progress power management script: https://github.com/maemo-leste/n900-pm

Battery calibration

Nokia N900 has bq27200 integrated circuit for monitoring battery state. The datasheet can be found here: http://www.ti.com/lit/ds/symlink/bq27200.pdf. If you are curious, check the section called "Gas Gauge Operation" for how the battery calibration is done in a low level.

Here are described the steps necessary to calibrate your battery. This should help if you see "Battery not calibrated" message in the status applet.

  • Fully charge Nokia N900. Don't detach the charger immediately, give it some time after you see "Fully charged" message (10 minutes should be enough).
  • Detach the charger and don't attach it again until the battery is fully depleted. Remember: if you attach the charger (or USB cable) at least once, you will need to start the calibration from the beginning (fully charge the device again).
  • You may use the device as you normally do. You may power it off, power it on, reboot. All as usual. Just don't connect the device to a charger or a PC using the USB cable.
  • When your Nokia N900 has battery depleted, it will alarm you with the "battery low" sound.
  • Wait for about 20 seconds and attach the charger. If the device was powered off because of battery depletion, it's fine. The battery should have done the calibration cycle. Just attach the charger to the device, give it a minute and press power button to start booting.
  • If you still see "Battery not calibrated" message, reboot the device.

After the first calibration cycle you will see that it has ~1700 mAh for the fully charged battery. This value is wrong. It's how the battery calibration works in low level: it can't change the fully charged value of the battery in steps that exceed 12.5%. What this means for us: it's needed to repeat the calibration cycle several times to get more accurate value. It may take about 3-7 calibration cycles to get the proper mAh value for fully charged battery. If you spend some time on this process, you will get really accurate battery gauge and you will always know how much charge is remaining.

Tip 1. If for any reason you want to reset the battery calibration value to see the message “Battery is not calibrated” again, you should remove the battery from the device for about 6 hours. Tip 2. If you replace the battery, you may want to do 1-2 calibration cycles described above to update the gauge for your new battery.

Accessing MTD

List devices:

cat /proc/mtd

Mount:

apt install mtd-utils
mkdir -vp /mnt/fremantle
ubiattach -p /dev/mtd5
mount -t ubifs ubi:rootfs /mnt/fremantle


Old status table

Feature Leste supported Notes
Kernel version 5.1 Mainline + PowerVR Patches: https://github.com/maemo-leste/n9xx-linux
Serial Yes Requires special hardware
Charging Yes
Wireless Yes Firmware is non-free
Ethernet N/A
Micro USB Yes USB Network, Mass Storage. OTG not working, although it might be possible
Keyboard Yes
Screen Yes
3D Acceleration Yes closed driver
Touchscreen Yes Resistive
Audio Yes Works (minus speaker protection), but requires complex alsa configuration and currently no ucm support
2G/3G data Yes Works with ofono - UI is WIP, see https://github.com/maemo-leste/connui-cellular/
4G data N/A no hardware
SMS Yes Works with ofono. Needs Leste UI
Phone calls WIP Works, no UI, poor quality for upstream audio, might require pulseaudio audio filters
Bluetooth No Driver needs some work
FM Transmitter Yes Install v4l-utils, then enable chip and set frequency using: v4l2-ctl -d /dev/radio0 -c mute=0,tune_power_level=120 -f <freq>
FM Receiver No
Accelerometer Yes
Compass N/A No hardware
Gyro N/A No hardware
Proximity sensor Yes evdev interface not supported in mce
Ambient Light Sensor Yes
Vibration Motor Yes
HDMI-out N/A No hardware
TV-out Yes Enable in alsamixer (Jack Function in alsamixer to TV OUT), enable with xrandr --output TV --mode 800x480 --same-as LCD. Set PAL/NTSC with xrandr --output TV --set SignalProperties PAL, and scale with xrandr --output TV --set TVScale 90.
GPS Yes Works with gpsd but is not integrated yet, see GPS
Infrared Yes TX only (hardware limitation).
Camera No Needs complex v4l work, no leste integration
Idle power consumption ~300mW Device does not enter RET or OFF mode