######################################################## Linux on the HTC Kaiser and other QCT msm7* based phones ######################################################## Breaking news ************* - New Wiki!! http://htc-linux.org/wiki - initial support for kaiser and polaris in htc-vogue branch. SD works well with a certain radio rom. - msm7200 compatibility in openmoko: qualcomm_msm modem support in frameworkd. => Make calls and use text messaging from within your favorite Linux distro. Expect some test images soon. Thanks to the OpenMoko Inc. devs for the cooperation. - msm machines and kernel updated in openembedded.org Build Angstrom and OpenMoko images for diamond raphael polaris kaiser vogue and titan easily. - Barry merged the 2.6.25 kaiser code plus raphael code from the htc-msm-2.6.25 branch with the g1 branch (android-msm-htc-2.6.25). see http://linuxtogo.org/~lgorris/diffs/g1-diff-18-11-08.diff . unfortunately kaiser doesn't boot there yet. - 2008-10-29 htc raphael and htc diamond code are now available at http://git.linuxtogo.org/?p=groups/mobile-linux/kernel.git;a=shortlog;h=refs/heads/htc-msm-2.6.25 based on the g1 branch - 2008-10-23 google released the source code to the g1 kernel. I uploaded a new diff with the previous kaiser code on top of it at at http://linuxtogo.org/~lgorris/git-diff-android-msm-htc-2.6.25_kaiser_20082210.diff apply it against android-msm-htc-2.6.25 (revision of today). a zImage build of the resulting tree can be found in this folder. polaris is not yet added. - http://linuxtogo.org/~lgorris/kernel-kaiser-2.6.25.tar.bz2 here's a snapshot of a git tree that adds the polaris code back to the git-diff-2.6.25-170908.diff . we might go 2.6.26 soon - dzo put his vogue kernel tree in the linuxtogo kernel git (branch htc-vogue) http://git.linuxtogo.org/?p=groups/mobile-linux/kernel.git;a=shortlog;h=refs/heads/htc-vogue - please use this newer git diff for the 2.6.25 kaiser/polaris kernel: http://headfuzz.co.uk/files/android/git-diff-2.6.25-170908.diff - http://www.headfuzz.co.uk/files/android/git-diff-110808-b.diff 2.6.25 code, for reference until it will get an own branch - zImage-pm-2.6.25 uploaded to bootkit, it has code to turn on/off the display and is based on 2.6.25. in android, press power button and select turn off display. - Barry ginge Carter ported the htc-msm (2.6.24) to android-msm-2.6.25, there will be htc-msm-2.6.25 in linuxtogo git soon. - marbalon ported and pushed the vogue RTC code to kaiser - There are DMA problems with the SD driver which cause hangups when larger file operations are done on the sd card. - Kaiser sd root filesystems to come. (in order to save contacts and so) zImage.bin already has the SD driver built in. - Polaris bootkit uploaded - Kaiser code updated and Polaris support added in git - SD now works so it is possible to boot off SD card. Also SDHC works well. This was test on kaiser and polaris and works well. - new SMD code now in git - major cleanup is in progress by martin ling. We're aiming at merging all currently supported devices (kaiser, polaris, vogue) into the kaiser tree and then keep in track of git.android.com. Also sms in android is in the work. - updated angstrom rootfs with smd and ppp nodes setup and ginge's ppp.sh script - gprs works thanks to premy (tested in angstrom and android) - making and receiving calls work (in android, other distros lack support at this point) thanks to premy Basic instructions to get going ******************************* Copy haret.exe, default.txt, zImage.bin and android.bin into one folder on your kaiser, run haret.exe, tap RUN button. To edit boot paramters, e.g. to change the initrd used, edit default.txt. To boot from SD check the SD folder. note: On some (stock but also modded) windows mobile roms, kaiser/polaris booting hangs in haret at 100%. If you have no luck at all try flashing one of the custom made roms found on forum.xda-developers.com I personally use a rom called "dutty's diamond rom, may 22nd" made by a guy named dutty in the xda forum. Linux boots 10 out of 10 times in it. Many other roms should work, too. Somebody said official wm 6.1 roms work on polaris. angstrom console instructions ***************************** Login with user root, password is blank. -Communicating with shared memory interfaces In the hosted angstrom angstrom.bin for kaiser, the device nodes required to communicate withthe shared memory interface devices are already present and ready to talk. Normally udev should make them. If you don't get the nodes for example in a rootfs without udev, you create them like this: For AT: mknod /dev/smd0 c 254 0 GPRS DATA mknod /dev/smd1 c 254 1 GPS: mknod /dev/smd7 c 254 7 E.g. use cat and echo to communicate with the devices. There is also cu and screen in angstrom.bin. cat /dev/smd0 & to simply watch what the modem has to offer then echo command sets in files or single commands to /dev/smd0. In order to get a direct two way conversation use cu -l /dev/smd0 if available use minicom: start 'minicom -s' to set device to /dev/smd0, baud rate to 38400 and turn flow control off. -Getting online The hosted angstrom console-image has a nifty script that sets up a gprs connection with your favourite provider, written by ginge/barry carter. Find it in /usr/bin/ppp.sh and use it like this: ppp.sh your_apn user password If it worked, you should get a network interface and DNS setup. android instrucions **************************** The android sets up all nodes and necessary magic on boot so just run it. In default.txt simply put "INITRD = android.bin". (lines starting with # in default.txt are commented out i.e. they aren't used by haret.) To place a call, just start up the Dialer application, type in your number (I suggest with the keyboard, doubble press fn to lock fn), press the green dial button. Receiving calls is quite self-explanatory. Please note ringtones and vibration alert are yet to come so make sure kaiser is insight when you are awaiting a call :P Find detailed research information including memory map, GPIO mapping, IRQ listing, dvice information, etc about the kaiser hardware here ***************************************************************************************************************************************** Most of it does also apply to polaris. http://wiki.xda-developers.com/index.php?pagename=KaiserResearch Kaiser kernel tree ****************** gitweb at http://git.linuxtogo.org/?p=groups/mobile-linux/kernel.git;a=shortlog;h=refs/heads/htc-msm This is the htc-msm branch in linuxtogo mobile-linux kernel git. This branch is derived from the msm7500A kernel tree at git.android.com (branch android-msm). Currently it is static which means we do not trace git.android.com until there is some progress with the problems described at the bottom. Note that the initial code, which makes the kernel boot on kaiser and on the other msm7x00 based htcs, is based on the work by dzo, who works with htc vogue. Contact him and find his work at http://it029000.massey.ac.nz/vogue/ To get the kaiser/polaris kernel source and build it simply get it and do clone linuxtogo kernel.git: git clone git://git.linuxtogo.org/home/groups/mobile-linux/kernel.git checkout htc-msm branch from ltg: git checkout -b htc-msm origin/htc-msm use the default kernel configuration for "htckaiser" or "htcpolaris" make ARCH=arm CROSSCOMPILE=/where's/your/toolchain- htckaiser_defconfig or make ARCH=arm CROSSCOMPILE=/where's/your/toolchain- htcpolaris_defconfig build the kernel (currently the defconfig produce a ~1M monolithic(no modules) kernel): make ARCH=arm CROSSCOMPILE=/where's/your/toolchain- zImage Kernel Status and Todo ********************** Required kernel level improvements: *get rid of DMA problems while using SD card this is how the error shows: http://headfuzz.co.uk/files/android/sderror-extrapolated.txt http://headfuzz.co.uk/files/android/sderror-extrapolated2.txt *make the LEDs work (the ones above the screen; green blue amber red..?) *make bluetooth work (its a HCI device using addr 0xa0200000 to talk to the a9 via SMD irq 0 and 1) *make touchscreen more precisely [arch-arm/mach-msm/tsc2003.c] *improve keyboard [arch-arm/mach-msm/board-kaiser-keypad.c] make use of light sensor prevent qwerty backlight from coming on when A) front keypad buttons are pressed B) qwerty is closed; frontMutex it out turn on front keypad backlight when front keypad buttosn are pressed some keyboard keys missing mapping (e.g. being able to change VTs would be handy in the console) no characters on press/odd characters until jogwheel is roated <- gpio problem. *power collapse needs looking at irq power collapse and restore GPIO power collapse (but not the power button) display mddi *system clocks need work CPU scaling => for the clock code see [arch/arm/mach-msm/ clocks.c clock-7x00.c kaiser-pm.c] *GPS How is GPS switched on/off? proc_comm? In the recent kernel, something broke the gps serial device. *audio (almost working) *battery charging level and detection, see http://wiki.xda-developers.com/index.php?pagename=KaiserBAT for referrence and the battery driver in trout and vogue kernel *irq: find correct triggering from VIC *find a solution for the android specific stuff; maybe using IFDEFs framebuffer: removal of android double height panning removal of kernel touchscreen calibration (prevents driver from being used as raw input event device with tslib) *USB *UARTs *NAND (internal memory) *use newer htc-egpio (present in mainline kernel in drivers/mfd/htc-egio.c) *merge as cleanly as possible back into android tree (with ifdefs for android/non android boot) *A WIP with htc-msm > android-msm-2.6.25 from Barry can be found at http://linuxtogo.org/~lgorris/diffs/g1-diff-18-11-08.diff *clean up and merge in htcvogue code (this would include use of htc-egpio, etc in the vogue tree) *move to .27 kernel *boot linux without needing to boot into WM first (SPL init) Userland Status and Todo ************************ OE images *map a key combination to change VTs in angstrom; add VTs in inittab (in order to eas switching between GUI and console) *provide a clean and working angstrom rootfs with the correct init in form of .cpio.gz < 20M for ramdisk and in .tar.gz and ext loopfile for SD card. *touchscreen doesn't work in openmoko/angstrom/etc due to problems with Xfbdev/tslib, see http://bugs.openembedded.net/show_bug.cgi?id=4448 *write ncurses based phone and pim application (hi pri!) *make msm7200/7500 AT communication work with gsmd and/or freesmartphone.org framework *looks over to shoragan* in order to make calls/get online note: this should be easy, the command sequences are all easy to get (for example, turn on AT logging in wince registry) *figure out how to initialize/turn off GPS (maybe that's related to the above point) Android: *make sms work *make phone calls more stable (if the other side hangs up, dialer is frozen and connection kept up) *get more overall stability (get rid of the random hangs; data connections always cause hang after some time) *wait for sourcecode or better working binary blobs Wanna get involved? ******************* Any help is appreaciated. Testing and feedback are as important as actual contributions to the above kernel and userspace problems. If you have any idea what's missing in the status pages or in this document in general please let me know Join #htc-linux on irc.freenode.net, that's where the linux development talks take place. Also topics about other htc devices can be discussed there. For android discussion use #android You can also email: barry.carter@gmail.com lukas.gorris@gmail.com (author of this document) A list of some contributors, alphabetically sorted. BabelO, baz/ginge (Barry Carter), cr2, dcordes (Lukas D. Gorris), dzo (Dr. Martin J. Johnson), marbalon (Marcin), marajin, martin_(Martin Ling), premy (Patrick Remy) PLEASE NOTE: Named persons do not take responsibility for anything you do with your phones.