Nokia N9 is a relatively FLOSS friendly phone running on top of Linux + freedesktop.org + Qt stack, with partially open UI or "User eXperience" layer.
A lot of progress on free OS for Nokia N9 (and its developer sibling Nokia N950) has been made in the hardware adaptation and UX project formerly known as MeeGo CE, now "Nemo Mobile" running on top of Mer core (continuation of MeeGo).
The first available bootloader was "moslo" (MeeGo OS loader, sources included but behind license agreement page): http://tablets-dev.nokia.com/moslo.php ; it was meant for N950. Community maintains a version suitable for N9 as well / OBS page (moslo-0.*), which however has a problem of requiring booting with a flasher command every time - see persistent bootloader nowadays.
The easier moslo bootloader is explained at http://wiki.merproject.org/wiki/Nemo/Installing#Nokia_N9, while a more "from ground up" booting approach is explained at http://jon.severinsson.net/NemoN9/Nemo-Mobile-N9-instructions.txt.
Hardware adaptation for Nokia N9 and N950 is mostly done in upstream Linux kernel for the TI OMAP3 support, and the most complete adaptation including various sensors et cetera is available in source (where available) and binary forms at the Nemo Mobile repositories:
Newer kernel (3.5 instead of 2.6.32) is being developed at github:
It was successfully used as part of Nemo Mobile (formerly MeeGo CE) release, so it should be possible to bring to Debian. Also, Debian user space should boot with Nemo kernel.
Among else phone calls work with oFono.
Appendix: UI layers and Apps
Not directly related to hardware, but the MeeGo Touch Framework used also in the partially proprietary shipping software on Nokia N9 is/was free software, although without future plans as Qt5/QML are taking its place. It was however productized and is used as part of Nemo. It is located (repository/source package wise) at http://repo.merproject.org/obs/nemo:/devel:/mw/ (middleware, including libmeegotouch) and http://repo.merproject.org/obs/nemo:/devel:/ux/ (control panel among else). Some of the Nemo MW/UX work is nowadays not MTF based anymore, ie works with normal Qt5, but some remain non-ported as requiring the whole MTF stack.
KDE Plasma Active and associated libraries for Mer is at: http://repo.merproject.org/obs/kde:/devel:/ux/latest_armv7hl/src/
See all current Mer / Nemo projects at https://build.merproject.org/project/list_public
A kickstart file used in the RPM world is attached to this page, explaining all the repositories and packages that are used for a functional software image. It should be guiding in getting Debian support as well.
Various applications from Mer/Nemo would also be suitable for Debian, see eg. http://repo.merproject.org/obs/nemo:/devel:/apps/latest_armv7hl/src/
Crude hacking of Debian based rootfs
It should be possible to get a Debian booting with Nemo's kernel without big issues. That means unpacking Nemo's kernel & kernel modules on top of a Debian rootfs (debootstrap armhf, chroot in and expand, or use a ready made rootfs from somewhere). Anything extra besides a black screen and possibly configured SSH + USB network will be a matter of either copying files from inside Nemo rpm:s and/or recompiling them from sources when available. The following is a list of packages in Nemo that should be interesting for hacking some hardware functionality in on top of Debian rootfs on N9:
- bme-libs-rm-680-bin # battery loading
- dsme # device state management
- mtdev # needed for xorg input driver
- ti-omap3-sgx # binary blobs for OpenGL ES
Some configuration files that may be helpful at http://people.debian.org/~timo/N9/
Corruption in filesystem?
Possibly helping black magic on how to boot, if you encounter corrupted filesystem:
- Run the bootloader flasher command (nowadays there's the persistent bootloader method as well)
- Attach USB which also powers on N9, drive gets mounted to host
- Play around in the mounted partition
- Unmount partition(s)
- Detach USB cable (causes boot to start)
- Attach the cable back in 2-3 seconds.
- Unmount the partition(s) again if they get remounted, before the actual boot begins
MeeGo wiki (might move at some point as MeeGo as a brand name is shutting itself down): http://wiki.meego.com/ARM/N9
N9:s default software stack (?MeeGo compatible "Harmattan") free software components, mostly in Debian already: http://harmattan-dev.nokia.com/pool/harmattan/free/ (no longer available, backups made by maemo.org people in various places)
The upstream for hw adaptation and UX: http://wiki.merproject.org/wiki/Nemo (Nemo Mobile)