<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-5208538475966737187</id><updated>2011-04-22T11:39:27.356+10:00</updated><category term='qemu'/><category term='alsa'/><category term='gsm'/><category term='wm9712'/><category term='website'/><category term='linux4palm'/><category term='oe'/><category term='palmt650'/><category term='ideas'/><category term='initramfs'/><category term='howto'/><title type='text'>Alex's Handheld Tinkering</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://hhtinker.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5208538475966737187/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://hhtinker.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Alex</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>16</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-5208538475966737187.post-3995404139155248713</id><published>2008-11-06T19:41:00.006+11:00</published><updated>2008-11-06T19:58:20.728+11:00</updated><title type='text'>Kernel changes for USB host</title><content type='html'>&lt;p&gt;Oh, in case anyone wants to experiment with this, just add this to your machine file (arch/arm/mach-pxa/palmXX.c).  I'm not going to post binaries or even a full patch now as this is still pretty experimental and you'll need to compile your own kernel with the drivers for whatever you want to connect anyway.  Add the following headers, functions and a call in machine_init().  This should work on most of the PXA270 Palms.&lt;/p&gt;

&lt;pre&gt;
#include &amp;lt;mach/pxa27x-udc.h&amp;gt;
#include &amp;lt;mach/ohci.h&amp;gt;

/*
 * USB Host (OHCI)
 */
static int palmt650_ohci_init(struct device *dev)
{
       UP2OCR = UP2OCR_HXS | UP2OCR_HXOE;
       UHCRHDA |= UHCRHDA_NOCP;
       UHCHR &amp;= ~(UHCHR_SSEP2 | UHCHR_SSE);
       return 0;
}

static struct pxaohci_platform_data palmt650_ohci_platform_data = {
       .port_mode      = PMM_NPS_MODE,
       .init           = palmt650_ohci_init,
};

static void __init palmt650_init(void)
{
        ...
        pxa_set_ohci_info(&amp;palmt650_ohci_platform_data);
}
&lt;/pre&gt;

&lt;p&gt;You'll need to enable OHCI under USB host.  I have been disabling USB gadget (client) support and I haven't tested what happens if you have both host and client enabled.  I assume though that host probably takes precedence.&lt;/p&gt;

&lt;p&gt;The easiest way to get a full speed device to enumerate is to plug the device in and use the "USB console" menu in Cocoboot before starting Linux.  That'll turn on the USB pullups which will trick Linux into realizing there's a full speed device connected.  You can also try turning on/off the pullups directly in Linux (GPIO 114 on the Treo 650).  You can use &lt;a href="http://git.hackndev.com/?p=tools;a=tree"&gt;gpio-val.c&lt;/a&gt; to control them within Linux (or a kernel module like GPIOed if you're using our older linux-hnd kernels).&lt;/p&gt;

&lt;p&gt;Plus, someone was asking for a copy of the rootfs I use.  For development work I just have an SD card with Debian/armel installed on it.  This is not completely suitable for mobile devices but Debian has a ton of precompiled packages which you can just install with apt-get.  This saves mucking around compiling.  A few weeks ago I wrote some &lt;a href="http://hackndev.com/node/212#comment-781"&gt;instructions in the forum&lt;/a&gt; including a tarball of a bare bones Debian image.  I just install gcc, git-core and such on there and compile stuff on the device itself must of the time.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5208538475966737187-3995404139155248713?l=hhtinker.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hhtinker.blogspot.com/feeds/3995404139155248713/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5208538475966737187&amp;postID=3995404139155248713' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5208538475966737187/posts/default/3995404139155248713'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5208538475966737187/posts/default/3995404139155248713'/><link rel='alternate' type='text/html' href='http://hhtinker.blogspot.com/2008/11/kernel-changes-for-usb-host.html' title='Kernel changes for USB host'/><author><name>Alex</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5208538475966737187.post-3241222118488161466</id><published>2008-11-06T19:15:00.006+11:00</published><updated>2008-11-06T20:57:14.556+11:00</updated><title type='text'>First attempt at a wifi dongle</title><content type='html'>&lt;p&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_7zXusCFNoZI/SRKoa5-aGYI/AAAAAAAAABQ/s2CjR4BToIc/s1600-h/wifi1.jpg"&gt;&lt;img style="float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand;width: 320px; height: 238px;" src="http://2.bp.blogspot.com/_7zXusCFNoZI/SRKoa5-aGYI/AAAAAAAAABQ/s2CjR4BToIc/s320/wifi1.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5265456094542174594" /&gt;&lt;/a&gt; ...was unfortunately only partially successful.  I picked up a few cheap link cables and the smallest USB wifi dongle I found in a brief search.  The wifi dongles turned out to be based on the Zydas ZD1211 chipset (actually rebranded as Atheros AR5524) which is excellent for two reasons: they have drivers in the mainstream Linux kernel and they can run fine off a 3.3V power source.  I went for the cheap after-market link cables (actually retractable ones) as they have easy to solder connectors which have all the pins.&lt;/p&gt;

&lt;p&gt;I chopped the ends off one of each and soldered the GND, USB+ and USB- appropriately.  For the dongles' power supply I tried the "EXT_POWER" pin on the multiconnector, which is supposed to be for powering accessories.  To make Palm OS activate the power pin, tie the serial pins on the multiconnector to ground.  In Linux on the Treo 650 you can toggle it with GPIO 37.&lt;/p&gt;

&lt;p&gt;The dongle was detected fine by Linux and the driver sucessfully uploaded the firmware.  Unfortunately on powering up the radio though the device appears to hang and the driver starts reporting timeouts.  My guess was the "EXT_POWER" pin cannot supply enough current.  To check this, I used my usual trick of stealing power from a molex connector in my PC.  Sure enough, it started working fine and I was able to scan and connect to a network and then SSH in from my PC.&lt;/p&gt;

&lt;p&gt;This is unfortunate as I'll probably end up having to add a battery pack of some sort.  It's much neater a tidier without one.  Oh well, probably a smallish &lt;a href="http://www.sparkfun.com/commerce/product_info.php?products_id=341"&gt;Polymer Lithium-ion battery&lt;/a&gt; would be suitable.  However, the fact that the device enumerates and can have the firmware uploaded while powered by "EXT_POWER" means it may be suitable for lower power USB devices, like flash drives or mice.&lt;/p&gt;

&lt;p&gt;Yes, I have heard of SDIO, but it's more fun this way.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5208538475966737187-3241222118488161466?l=hhtinker.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hhtinker.blogspot.com/feeds/3241222118488161466/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5208538475966737187&amp;postID=3241222118488161466' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5208538475966737187/posts/default/3241222118488161466'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5208538475966737187/posts/default/3241222118488161466'/><link rel='alternate' type='text/html' href='http://hhtinker.blogspot.com/2008/11/first-attempt-at-wifi-dongle.html' title='First attempt at a wifi dongle'/><author><name>Alex</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_7zXusCFNoZI/SRKoa5-aGYI/AAAAAAAAABQ/s2CjR4BToIc/s72-c/wifi1.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5208538475966737187.post-5495222900820829903</id><published>2008-10-17T19:47:00.007+11:00</published><updated>2008-10-18T18:44:18.960+11:00</updated><title type='text'>USB host mode on the Treo 650</title><content type='html'>Previously I'd always just assumed the USB host pins were separate from the USB client ones, so we wouldn't be able to use the USB port on the multiconnector as a host.  Turns out I was wrong.  Sleep_Walker pointed out that the PXA27x's USB client pins can the routed to the host controller.  I had to try it.

So I cut the USB connectors of an old dead motherboard with a jigsaw and soldered the D+ pins and D- pins of each connector respectively together.  I then ran +5V from my PC because the Treo can't supply it.  Any +5V source should do, so a battery pack or some kind of charge powered by the treo's 3.7V output would also work, the PC was just the closest handy source.

I then configured USB port 2 in host mode and powered it up.

&lt;pre&gt;
UP2OCR = UP2OCR_HXS | UP2OCR_HXOE;
UHCRHDA |= UHCRHDA_NOCP;
UHCHR &amp;= ~(UHCHR_SSEP2 | UHCHR_SSE);
&lt;/pre&gt;

I found low-speed devices (like old mice) just work, but full-speed (USB1.1+ devices) fail to detect.  There seems to be an extra strong pull-down on the USB+ pin, probably as part of the USB client hardware.  To get around this we can turn on the Treo's own usb client pullups and trick itself into realising there's a full-speed device attached. ;-)

Anyway here's the result, a USB keyboard (with builtin hub) and mouse controlling the Treo directly:

&lt;p&gt;&lt;object width="425" height="344"&gt;&lt;param name="movie" value="http://www.youtube.com/v/fWEzaPk-baM&amp;hl=en&amp;fs=1"&gt;&lt;/param&gt;&lt;param name="allowFullScreen" value="true"&gt;&lt;/param&gt;&lt;embed src="http://www.youtube.com/v/fWEzaPk-baM&amp;hl=en&amp;fs=1" type="application/x-shockwave-flash" allowfullscreen="true" width="425" height="344"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;/p&gt;

Virtually every USB device with a Linux driver I've tried works.  I'm looking to get a USB wifi dongle.  Not sure it'll be so easy to mount inside as the &lt;a href="http://beta.ivancover.com/wiki/index.php/Eee_PC_Internal_Upgrades"&gt;Eee PC upgrades&lt;/a&gt; are. ;-)

&lt;b&gt;Update&lt;/b&gt;: Sleep_Walker has now tried the same thing on the 680.  He reports that there's no pulldown problems on the 680 so full-speed devices detect correctly without any hacks.  He also tried a slightly easy way of doing it, all you need is standard powered USB hub (to supply the +5V) and a USB gender changer, no soldering required.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5208538475966737187-5495222900820829903?l=hhtinker.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hhtinker.blogspot.com/feeds/5495222900820829903/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5208538475966737187&amp;postID=5495222900820829903' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5208538475966737187/posts/default/5495222900820829903'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5208538475966737187/posts/default/5495222900820829903'/><link rel='alternate' type='text/html' href='http://hhtinker.blogspot.com/2008/10/usb-host-on-treo-650.html' title='USB host mode on the Treo 650'/><author><name>Alex</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5208538475966737187.post-786943144825098253</id><published>2008-10-10T20:00:00.006+11:00</published><updated>2008-10-10T20:57:59.932+11:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='gsm'/><category scheme='http://www.blogger.com/atom/ns#' term='palmt650'/><category scheme='http://www.blogger.com/atom/ns#' term='alsa'/><category scheme='http://www.blogger.com/atom/ns#' term='wm9712'/><title type='text'>Success: Two-way phone call with Treo 650 in Linux</title><content type='html'>Now that I have a VOIP account that can make unmetered calls to mobiles I decided to try having a play with getting two-way phone calls working from Linux on the Treo 650.  I turned on the phone part in Palm OS, booted &lt;a href="http://git.hackndev.com/?p=ato/linux-2.6-arm;a=commit;h=aa8e82ad4c0906627538771e1b44962b8a6a1fec"&gt;this kernel&lt;/a&gt; and reset the power on the gsm module with:

&lt;pre&gt;echo 0 &gt; /sys/devices/platform/palmt650-pm-gsm/power_on
echo 1 &gt; /sys/devices/platform/palmt650-pm-gsm/power_on
echo 1 &gt; /sys/devices/platform/palmt650-pm-gsm/wake&lt;/pre&gt;
I then fired open minicom and opened /dev/ttyS0 at baud 460800 without flow control.  I then connected the modem to the network and entered my subsidy unlock pin:

&lt;pre&gt;AT+CFUN=1
AT+CPIN="xxxxxxxxx"&lt;/pre&gt;
Once connected, I called my phone via VOIP and then answered with the &lt;tt&gt;ATA&lt;/tt&gt; command:
&lt;pre&gt;RING
RING

ATA
OK&lt;/pre&gt;
At that point I opened up a few terminal windows and started fiddling with ALSA.  I first started playing some white noise so I could heer when I started transmitting:

&lt;pre&gt;cat /dev/urandom &gt; /dev/dsp&lt;/pre&gt;

I discovered you can divert PCM to be transmitted by the phone using:

&lt;pre&gt;
      Master Mono: Enable, set transmit volume
              PCM: Enable, set PCM volume
PCM Play to Phone: Enable to route PCM signal to the phone module
&lt;/pre&gt;

After some more fiddling I routed the microphone to the phone.  The labeling of the Mic controls in the ALSA driver is rather strange but here are the key settings:
&lt;pre&gt;
      Master Mono: Enable, set transmit volume
Mic Select Source: mic1=handset, mic2=headset
            Mic 2: Selected mic volume
   Mic 1 to phone: Enable/disable handset mic 
   Mic 2 to phone: Enable/disable oheadset mic
   Mic 20dB Boost: Useful in speakerphone mode, you can talk from quite a distance.

Mic 1: [irrelevant?]
Mic select:  [irrelevant?]&lt;/pre&gt;

After that I managed to get the incoming audio going out the handset earpiece with these settings:

&lt;pre&gt;
         Master: Enable, earpiece volume
Master Left Inv: Enable
          Phone: Seems you don't need to unmute, but need to set volume.
Phone to Master: Enable
            Aux: Set a high volume (weird stuff happens if low)
    Out3 LR Mux: Master Mix (mislabeled, it's actually out2)
&lt;/pre&gt;

I've made an ALSA &lt;a href="http://releases.hackndev.com/config/palmt650-phonecall.state"&gt;state file&lt;/a&gt; for working two-way phone audio with the handset.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5208538475966737187-786943144825098253?l=hhtinker.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hhtinker.blogspot.com/feeds/786943144825098253/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5208538475966737187&amp;postID=786943144825098253' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5208538475966737187/posts/default/786943144825098253'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5208538475966737187/posts/default/786943144825098253'/><link rel='alternate' type='text/html' href='http://hhtinker.blogspot.com/2008/10/sucess-two-way-phone-call-with-treo-650.html' title='Success: Two-way phone call with Treo 650 in Linux'/><author><name>Alex</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5208538475966737187.post-717943483107521503</id><published>2008-08-14T21:16:00.001+10:00</published><updated>2008-08-14T21:18:22.314+10:00</updated><title type='text'>Hang on palmt650 first printk</title><content type='html'>Locks up in kernel/printk.c with time enabled:
&lt;pre&gt;
asmlinkage int vprintk(const char *fmt, va_list args)
{
...
                        if (printk_time) {
                                /* Follow the token with the time */
                                char tbuf[50], *tp;
                                unsigned tlen;
                                unsigned long long t;
                                unsigned long nanosec_rem;

                                t = cpu_clock(printk_cpu);
                                nanosec_rem = do_div(t, 1000000000);
                                tlen = sprintf(tbuf, "[%5lu.%06lu] ",
                                                (unsigned long) t,
                                                nanosec_rem / 1000);

                                for (tp = tbuf; tp &lt; tbuf + tlen; tp++)
                                        emit_log_char(*tp);
                                printed_len += tlen;
                        }
&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5208538475966737187-717943483107521503?l=hhtinker.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hhtinker.blogspot.com/feeds/717943483107521503/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5208538475966737187&amp;postID=717943483107521503' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5208538475966737187/posts/default/717943483107521503'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5208538475966737187/posts/default/717943483107521503'/><link rel='alternate' type='text/html' href='http://hhtinker.blogspot.com/2008/08/hang-on-palmt650-first-printk.html' title='Hang on palmt650 first printk'/><author><name>Alex</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5208538475966737187.post-1783385330857062282</id><published>2008-04-18T23:36:00.006+10:00</published><updated>2008-04-19T00:16:22.721+10:00</updated><title type='text'>Palm Tungsten C wifi in Linux</title><content type='html'>Just noting this before I forget it.

Use fc447e3213efb31cb16b5d9a2b0ebb77fbafd131 from git://git.hackndev.com/linux-2.6 with the &lt;a href="http://git.hackndev.com/?p=linux-2.6;a=blob;f=arch/arm/configs/palmtc_defconfig;h=89126a865cf20649644f51f0b0e7779f3c73aab8;hb=fc447e3213efb31cb16b5d9a2b0ebb77fbafd131"&gt;defconfig&lt;/a&gt;.

You'll need to load standard RAM prism firmware (pm010102.hex and rf010804.hex should work), but prism2_srec has to be patched as the production data area ("PDA") has an invalid CRC.  A patch like this should do the trick:

&lt;pre&gt;diff -ru hostap-utils-0.4.7/util.c hostap-utils-0.4.7-hacked/util.c
--- hostap-utils-0.4.7/util.c   2004-02-14 18:50:12.000000000 +0000
+++ hostap-utils-0.4.7-hacked/util.c    2008-04-18 21:32:17.000000000 +0000
 -372,7 +372,7 @@
 
        fclose(f);
 
-       return parse_wlan_pda(pda_info, 0);
+       return parse_wlan_pda(pda_info, 1);
 }&lt;/pre&gt;

Add to /etc/pcmcia/hostap_cs.conf (or equivalent)

&lt;pre&gt;card "PRISM ISL37101P-SSF Adapter"                                                                                                 
  manfid 0x000b, 0x7110
  bind "hostap_cs"&lt;/pre&gt;

Then start the "cardmgr" daemon.  It should detect and bind the card to hostap_cs, so you can see it as "wlan0" and "wifi0" in "ifconfig -a".

You should then be able to load firmware using something like:
&lt;pre&gt;prism2_srec -gs wlan0 pm010102.hex
prism2_srec -gp wlan0 pm010102.hex
prism2_srec -rp wlan0 rf010804.hex&lt;/pre&gt;

You can then configure and use as normal:

&lt;pre&gt;ifconfig wifi0 up
ifconfig wlan0 up
iwconfig mode wlan0 managed
iwlist scan
...or whatever&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5208538475966737187-1783385330857062282?l=hhtinker.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hhtinker.blogspot.com/feeds/1783385330857062282/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5208538475966737187&amp;postID=1783385330857062282' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5208538475966737187/posts/default/1783385330857062282'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5208538475966737187/posts/default/1783385330857062282'/><link rel='alternate' type='text/html' href='http://hhtinker.blogspot.com/2008/04/palm-tungsten-c-wifi-in-linux.html' title='Palm Tungsten C wifi in Linux'/><author><name>Alex</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5208538475966737187.post-4440302182507214688</id><published>2007-07-31T23:40:00.000+10:00</published><updated>2007-08-02T22:45:35.644+10:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='gsm'/><category scheme='http://www.blogger.com/atom/ns#' term='palmt650'/><category scheme='http://www.blogger.com/atom/ns#' term='alsa'/><category scheme='http://www.blogger.com/atom/ns#' term='wm9712'/><title type='text'>Hello! Hello?!</title><content type='html'>&lt;p&gt;Well there's been much progress. I've basically finished off the kernel driver aside from waking the CPU from suspend upon an incoming call. Also adding basic BCM2132 to gsmd turned out to be a fairly simple procedure aside from some strangenesses of the platform. See the &lt;a href="http://lists.openmoko.org/mailman/listinfo/gsmd-devel"&gt;gsmd list&lt;/a&gt; for my patches.  So now we can make and receive calls and SMS with the only remaining problem being routing of audio.&lt;/p&gt;

&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_7zXusCFNoZI/Rq88xZBZuEI/AAAAAAAAAAc/eDExqrvF6QQ/s1600-h/pamt650-audio-wiring.png"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer;" src="http://4.bp.blogspot.com/_7zXusCFNoZI/Rq88xZBZuEI/AAAAAAAAAAc/eDExqrvF6QQ/s320/pamt650-audio-wiring.png" alt="" id="BLOGGER_PHOTO_ID_5093356522807343170" border="0"&gt;&lt;/a&gt; &lt;p&gt;I've setup a skeleton SoC audio driver. This is enough after some fiddling with alsamixer to at least be able to hear what the other person says but outgoing sound doesn't work. The diagram to the left shows how I &lt;i&gt;think&lt;/i&gt; things are wired up and should be of use to anyone trying to understand the huge number of alsamixer controls. At the moment I'm trying to get OE building an OpenMoko image with MACHINE=palmt650. :-)&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5208538475966737187-4440302182507214688?l=hhtinker.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hhtinker.blogspot.com/feeds/4440302182507214688/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5208538475966737187&amp;postID=4440302182507214688' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5208538475966737187/posts/default/4440302182507214688'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5208538475966737187/posts/default/4440302182507214688'/><link rel='alternate' type='text/html' href='http://hhtinker.blogspot.com/2007/07/hello-hello.html' title='Hello! Hello?!'/><author><name>Alex</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_7zXusCFNoZI/Rq88xZBZuEI/AAAAAAAAAAc/eDExqrvF6QQ/s72-c/pamt650-audio-wiring.png' height='72' width='72'/><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5208538475966737187.post-7252300818595575358</id><published>2007-07-27T22:35:00.000+10:00</published><updated>2007-07-27T23:38:46.266+10:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='gsm'/><category scheme='http://www.blogger.com/atom/ns#' term='palmt650'/><title type='text'>Wake up!</title><content type='html'>&lt;p&gt;I've been playing around with the Treo's GPIOs and I've finally discovered how to prevent the GSM module from going to sleep! Setting GPIO 57 high seems to force the module to stay awake. I also discovered GPIO 11 is a wake signal from the GSM to the CPU. This GPIO has a rising edge whenever some message is sent (or is ready to be sent) .&lt;/p&gt;

&lt;p&gt;Also, while CTS seems to be always set when the GSM is powered, it will queue data while RTS is deasserted.  So while in sleep we should probably deassert RTS, wait for GPIO 11 to awaken us (on eg incoming call) and then assert RTS to receive our data.&lt;/p&gt;

&lt;p&gt;Trying to put all this information into a driver is going to be interesting. I wonder how pluggable the PXA serial driver is. Maybe I'll have to resort to just keeping the modem constantly awake for now.&lt;/p&gt;

&lt;p&gt;Update: On first glance &lt;tt&gt;set_txrx()&lt;/tt&gt; may do the trick.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5208538475966737187-7252300818595575358?l=hhtinker.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hhtinker.blogspot.com/feeds/7252300818595575358/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5208538475966737187&amp;postID=7252300818595575358' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5208538475966737187/posts/default/7252300818595575358'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5208538475966737187/posts/default/7252300818595575358'/><link rel='alternate' type='text/html' href='http://hhtinker.blogspot.com/2007/07/wake-up.html' title='Wake up!'/><author><name>Alex</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5208538475966737187.post-3100314317127908110</id><published>2007-07-22T22:06:00.001+10:00</published><updated>2007-07-27T22:44:39.901+10:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='gsm'/><category scheme='http://www.blogger.com/atom/ns#' term='palmt650'/><title type='text'>*Ring* *Ring*</title><content type='html'>&lt;p&gt;I figured out the trick to making calls with the GSM modem in the Treo 650, you just need to give it the subsidy unlock code with AT+CPIN="xxxxxxx". I also found something else interesting:&lt;/p&gt;

&lt;pre&gt;
AT+CFUN=6
The handset is in Calibration Mode:
                                   

********Main Menu:********
                          
0  HELP                   
1  ARFCN arfcn
2  MODULATION 0=GMSK/1=8PSK
3  DACVAL FREQ_DAC_ZERO    
4  ALL_RAMPS           
5  RAMP_SELECT txlev(0-19)
6  AGC rxlev              
7  GSYS band step
8  START 0=norm/1=rach
9  STOP               
10 OAKWR addr val
11 ARMWR size addr val
12 ISPCS 1=TRUE       
13 OAKRD? addr 
14 ARMRD? size addr
15 RXLEV?          
16 GSYS? band index
17 MULTISLOT       
18 EN_AUTO_SIM 
19 L1 TEST     
20 EDGE/GPRS TEST 
21 TXDB_WRITE Row(0-7) [v0 v2 v3 ....v15]
22 CHANGEMODE mode :0=normal,1=cal,2=download
&lt;/pre&gt;

&lt;p&gt;It doesn't respond to commands after that. I guess it may be expecting some binary protocol.&lt;/p&gt;

&lt;p&gt;I'm still having the problem of after receiving *MRDY: 3 after powering on the radio the connection seems to freeze up.  Messages are still received it's just outgoing keypresses that seem to be ignored. I found if I hold down a key long enough it'll eventually receive it and I can issue commands like that. Something strange must be going, perhaps there's some time window which it will receive in.&lt;/p&gt;

&lt;p&gt;If I pull out the SIM the device will drop to MRDY: 5 and the AT console becomes usable again. Curious.&lt;/p&gt;

&lt;p&gt;Update: Ah. I've found references to something called &lt;a href="http://www.google.com/search?q=at+cfun%20cyclic%20sleep"&gt;cyclic sleep mode&lt;/a&gt;. So perhaps the baseband goes to sleep for some cycles and then wakes up and can receive commands again.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5208538475966737187-3100314317127908110?l=hhtinker.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hhtinker.blogspot.com/feeds/3100314317127908110/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5208538475966737187&amp;postID=3100314317127908110' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5208538475966737187/posts/default/3100314317127908110'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5208538475966737187/posts/default/3100314317127908110'/><link rel='alternate' type='text/html' href='http://hhtinker.blogspot.com/2007/07/ring-ring.html' title='*Ring* *Ring*'/><author><name>Alex</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5208538475966737187.post-5149337038530976872</id><published>2007-07-21T18:02:00.000+10:00</published><updated>2007-07-21T18:11:45.421+10:00</updated><title type='text'>A cure for insomnia</title><content type='html'>&lt;p&gt;Our &lt;a href="http://hhtinker.blogspot.com/2007/06/testing-linux4palm-on-qemu.html"&gt;qemu tree&lt;/a&gt; has finally made itself really useful. By running the Treo's bootloader inside it I was able to figure out how to get suspend to ram working properly. It turns out to be really easy, all you have to do is set PSPR to some non-zero value and put the code you want to run on resume at 0xa000000.&lt;/p&gt;


&lt;p&gt;Also after a lot of messing with qemu, Sergey Lapin and I also figured out how to resume Zire 72.  Probably.  It's untested on a physical device yet.  On going to sleep you need to point PSPR at the physical address of the structure below.  Set resume_addr to the argument passed into pxa_ll_pm_suspend().  It may be the same or similar for other devices with the "SmallROM" bootloader (such as T3).&lt;/p&gt;

&lt;pre&gt;
static struct {                                                                                                                                                                       
        u32 magic0;             /* 0x0 */                                                                                                                                             
        u32 magic1;             /* 0x4 */                                                                                                                                             
        u32 resume_addr;        /* 0x8 */                                                                                                                                             
        u32 pad[11];            /* 0xc..0x37 */                                                                                                                                       
                                                                                                                                                                                      
        /* bootloader will configure co-processor 15 with these values: */
        u32 arm_control;        /* 0x38 */                                                                                                                                            
        u32 aux_control;        /* 0x3c */                                                                                                                                            
        u32 ttb;                /* 0x40 */                                                                                                                                            
        u32 domain_access;      /* 0x44 */                                                                                                                                            
        u32 process_id;         /* 0x48 */                                                                                                                                            
} palmz72_resume_info = {                                                                                                                                                             
        .magic0 = 0xb4e6,                                                                                                                                                             
        .magic1 = 1,                                                                                                                                                                  
                                                                                                                                                                                      
        /* reset state, MMU off etc */                                                                                                                                                
        .arm_control = 0,                                                                                                                                                             
        .aux_control = 0,                                                                                                                                                             
        .ttb = 0,                                                                                                                                                                     
        .domain_access = 0,                                                                                                                                                           
        .process_id = 0,                                                                                                                                                              
}; &lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5208538475966737187-5149337038530976872?l=hhtinker.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hhtinker.blogspot.com/feeds/5149337038530976872/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5208538475966737187&amp;postID=5149337038530976872' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5208538475966737187/posts/default/5149337038530976872'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5208538475966737187/posts/default/5149337038530976872'/><link rel='alternate' type='text/html' href='http://hhtinker.blogspot.com/2007/07/cure-for-insomnia.html' title='A cure for insomnia'/><author><name>Alex</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5208538475966737187.post-8946500041187064860</id><published>2007-07-21T10:33:00.000+10:00</published><updated>2007-07-21T11:13:57.061+10:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='oe'/><category scheme='http://www.blogger.com/atom/ns#' term='initramfs'/><title type='text'>How to bake a loopy initramfs</title><content type='html'>&lt;p&gt;If you follow &lt;a href="http://pfalcon-oe.blogspot.com/2007/07/modular-initramfs-for-oe.html"&gt;Paul Sokolovsky's blog&lt;/a&gt; you'll know we've been developing some recipes for building initramfs images using OE. I won't repeat the details here, check Paul's blog for an overview but I will describe the loopback booting module (since he hinted so politely).&lt;/p&gt;

&lt;p&gt;First, why would you want to boot off a loopback device?  The most difficult thing for new users coming to Linux is probably installing it.  You have to understand how to partition a disk and hope you don't accidentally wipe all your data in the first place.  To make things quick for testing and easy for new users, over at &lt;a href="http://www.hackndev.com/"&gt;Hack&amp;amp;Dev&lt;/a&gt; we usually release a boot pack which contains a kernel zImage, an initramfs and a root filesytem image.  The user just unpacks all these files into the root directory of a memory card, installs Cocoboot and taps boot, no dangerous and confusing partitioning required.  So after Paul showed me his nifty method for building an NFS booting initramfs I couldn't resist adding another recipe that you can use for loopback booting.  We later went on to merge them into a nice modular system that you can plug in whatever boot methods you need.&lt;/p&gt;

&lt;p&gt;Okay, how to use it?  First build an initramfs image with the initramfs-module-loop package installed.  The easiest way to do this is just &lt;tt&gt;bitbake initramfs-image&lt;/tt&gt;.  Next pop the initramfs in the appropriate place for your bootloader (or compile it into the kernel) and add to the kernel command-line something like&lt;/p&gt;

&lt;pre&gt;root=/dev/loop looproot=/dev/mmcblk0p1:rootfs.ext2&lt;/pre&gt;

&lt;p&gt;The initramfs will note the root option and start the loopboot module which will mount partition one of the MMC card (mmcblk0p1), then loopback mount the rootfs.ext2 and finally &lt;tt&gt;switch_root&lt;/tt&gt; to it. The full syntax for the looproot option is&lt;/p&gt;

&lt;pre&gt;looproot=[device:]file[:offset]&lt;/pre&gt;

&lt;p&gt;&lt;tt&gt;device&lt;/tt&gt; is the device file resides on, &lt;tt&gt;file&lt;/tt&gt; is a filesystem image and &lt;tt&gt;offset&lt;/tt&gt; is the offset into the image to mount from (see losetup(8) manpage, the &lt;tt&gt;-o&lt;/tt&gt; option).  In theory you should be able to include multiple &lt;tt&gt;looproot&lt;/tt&gt; options and to allow recursive mounting (ie an image within an image), but this is untested.  So to boot an image off the LifeDrive's data partition you might use something like:&lt;/p&gt;

&lt;pre&gt;root=/dev/loop
looproot=:/dev/hda:91814912
looproot=rootfs.ext2&lt;/pre&gt;

&lt;p&gt;Note I'm giving a block device as the &lt;tt&gt;file&lt;/tt&gt; argument here. This is because Palm OS writes an invalid partition table (their partition start/end offset calculations are wrong) to the HDD so we have to use a loopback device to manually specify the offset into the disk. The second &lt;tt&gt;looproot&lt;/tt&gt; option then will mount the filesystem image.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5208538475966737187-8946500041187064860?l=hhtinker.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hhtinker.blogspot.com/feeds/8946500041187064860/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5208538475966737187&amp;postID=8946500041187064860' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5208538475966737187/posts/default/8946500041187064860'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5208538475966737187/posts/default/8946500041187064860'/><link rel='alternate' type='text/html' href='http://hhtinker.blogspot.com/2007/07/how-to-bake-loopy-initramfs.html' title='How to bake a loopy initramfs'/><author><name>Alex</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5208538475966737187.post-7244197545751723500</id><published>2007-07-14T13:25:00.000+10:00</published><updated>2007-07-14T14:54:48.540+10:00</updated><title type='text'>Treo650 gpios</title><content type='html'>Been doing some playing with GPIOs

Clearing outputs:
23 turns of backlight, LEDs and causes palmos to think battery is dead.
24 turns off LEDs and causes palmos to think battery is dead.
25 as well...

79 - backlight power
114 - disables usb

USB detect is in ASIC:
bit 3 of register 0x36. High when disconnected.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5208538475966737187-7244197545751723500?l=hhtinker.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hhtinker.blogspot.com/feeds/7244197545751723500/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5208538475966737187&amp;postID=7244197545751723500' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5208538475966737187/posts/default/7244197545751723500'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5208538475966737187/posts/default/7244197545751723500'/><link rel='alternate' type='text/html' href='http://hhtinker.blogspot.com/2007/07/treo650-gpios.html' title='Treo650 gpios'/><author><name>Alex</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5208538475966737187.post-4363773922872495771</id><published>2007-07-09T12:35:00.000+10:00</published><updated>2007-07-09T14:14:50.814+10:00</updated><title type='text'>Possibly power reg for T650 bluetooth</title><content type='html'>BT on:
&lt;pre&gt;
08000044: 001f00fa001800bc
&lt;/pre&gt;

BT off:
&lt;pre&gt;
08000044: 001f00ff00180080
                        ^^
&lt;/pre&gt;

Writing the ff into 0x44 had no effect, but 0x80 into 0x48 killed the connection. :D

&lt;pre&gt;
bit 2: no effect
bit 3: no effect
bit 4: breaks connection
bit 5: breaks connection
&lt;/pre&gt;

Bingo! I'd say 4 and 5 are BT power and reset (although which is which?).

Overwriting 0x0 (RBR/THR) also kills the connection while powering down BTUART has no effect indicating it's definately connect to ASIC UART.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5208538475966737187-4363773922872495771?l=hhtinker.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hhtinker.blogspot.com/feeds/4363773922872495771/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5208538475966737187&amp;postID=4363773922872495771' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5208538475966737187/posts/default/4363773922872495771'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5208538475966737187/posts/default/4363773922872495771'/><link rel='alternate' type='text/html' href='http://hhtinker.blogspot.com/2007/07/possibly-power-reg-for-t650-bluetooth.html' title='Possibly power reg for T650 bluetooth'/><author><name>Alex</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5208538475966737187.post-1729998953120390280</id><published>2007-07-07T14:55:00.001+10:00</published><updated>2007-07-07T15:30:44.308+10:00</updated><title type='text'>LifeDrive necromancy</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_7zXusCFNoZI/Ro8c-z9s1TI/AAAAAAAAAAM/scQUzfQe-6A/s1600-h/ld-corpse.jpg"&gt;&lt;img style="float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand;" src="http://1.bp.blogspot.com/_7zXusCFNoZI/Ro8c-z9s1TI/AAAAAAAAAAM/scQUzfQe-6A/s200/ld-corpse.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5084314369751045426" /&gt;&lt;/a&gt;
I've just had some success in bringing my poor LifeDrive back from the grave.  While the HDD is still unusable due to a broken cable, I was able to get the Linux kernel to boot.  I chopped the end off a Nokia DKU-5 data cable (USB -&gt; TTL serial converter) and soldered it to some test points corresponding to the serial port on the LD's mainboard. You might be able to make out the tiny red wires in bottom-left corner of the photo. (The yellow stuff is &lt;a href="http://en.wikipedia.org/wiki/Blu_Tack"&gt;Blu Tack&lt;/a&gt;, preventing things from moving around).

By holding down the hotsync button and resetting the device, minicom at 115200 baud and no flow control on my PC gets me to the "Sandal" recovery console:
&lt;pre&gt;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  Sandal
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
&gt;&lt;/pre&gt;
There are a couple of different commands you can use in the Sandal console but the important ones are "w" which reads and writes memory and "x" which executes code at the given address.  I wrote a small script &lt;tt&gt;bin2sandal.py&lt;/tt&gt; which converts a binary image into a series of Sandal commands enabling you to upload and execute a tiny bootloader I wrote in ARM assembly called &lt;tt&gt;quickload&lt;/tt&gt;:
&lt;pre&gt;&lt;font color="#3030cc"&gt;$ ./bin2sandal.py -d quickload.bin &gt; /dev/ttyUSB0&lt;/font&gt;
...
&gt;w 0xa00000e8=0xe5950000                                                                                                                                                              
0xA00000E8 : 0xE5950000                                                                                                                                                               
&gt;w 0xa00000ec=0xe1a0f00e                                                                                                                                                              
0xA00000EC : 0xE1A0F00E                                                                                                                                                               
&gt;x 0xa0000000                                                                                                                                                                         
Executing at 0xA0000000                                                                                                                                                               
Q?&lt;/pre&gt;
The &lt;tt&gt;Q?&lt;/tt&gt; prompt is &lt;tt&gt;quickload&lt;/tt&gt; asking us to upload a kernel image.  Well we'd better give it what it wants:
&lt;pre&gt;&lt;font color="#3030cc"&gt;$ ./ql.py &lt; zImage &gt; /dev/ttyUSB0&lt;/font&gt;
Q?
  ql.py: uploading image...                                                                                                                                                           
G.............................

&lt;b&gt;A little while later:&lt;/b&gt;
.............................D
Uncompressing Linux..........................................
........................... done, booting the kernel.                                                                                           
Linux version 2.6.21-hnd2 (ato@shion) (gcc version 4.1.2) 
#38 Sat Jul 7 12:50:15 EST 2007                                                                                   
CPU: XScale-PXA270 [69054117] revision 7 (ARMv5TE), cr=0000397f                                                                                                                       
Machine: Palm LifeDrive
&lt;b&gt;... boot messages ...&lt;/b&gt;
# echo "I'm alive!"
I'm alive!                                                                                                                           
#&lt;/pre&gt;
Unfortunately neither LCD nor MMC is working. I suspect this is because we normally rely on Palm OS to configure and power them up. I'll try overwriting the GPIO configuration with that from a working device later.

The tools I used are in &lt;a href="http://hackndev.svn.sourceforge.net/viewvc/hackndev/linux4palm/tools/serial-loader/"&gt;&lt;tt&gt;linux4palm/tools/serial-loader&lt;/tt&gt;&lt;/a&gt; in Hack&amp;amp;Dev's SVN. Quickload should work on any PXA device, however you'll need to change the machine code that's passed to the kernel.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5208538475966737187-1729998953120390280?l=hhtinker.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hhtinker.blogspot.com/feeds/1729998953120390280/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5208538475966737187&amp;postID=1729998953120390280' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5208538475966737187/posts/default/1729998953120390280'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5208538475966737187/posts/default/1729998953120390280'/><link rel='alternate' type='text/html' href='http://hhtinker.blogspot.com/2007/07/lifedrive-necromancy.html' title='LifeDrive necromancy'/><author><name>Alex</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_7zXusCFNoZI/Ro8c-z9s1TI/AAAAAAAAAAM/scQUzfQe-6A/s72-c/ld-corpse.jpg' height='72' width='72'/><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5208538475966737187.post-5563176631147908365</id><published>2007-06-24T15:05:00.001+10:00</published><updated>2007-06-24T19:17:18.405+10:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='qemu'/><category scheme='http://www.blogger.com/atom/ns#' term='howto'/><category scheme='http://www.blogger.com/atom/ns#' term='linux4palm'/><title type='text'>Testing Linux4Palm on qemu</title><content type='html'>Anyone who's done some handheld hacking will know that testing on a physical device is usually a real pain.  If the lack of decent input and tiny screen don't get to you then it's the tiring compile, copy-to-sd, put-sd-in-handheld, test, reboot, put-sd-back-in-pc, fix-code cycle.  Today I'm going to explain how you can boot an unmodified linux4palm kernel zImage and rootfs inside the emulator &lt;a href="http://fabrice.bellard.free.fr/qemu/"&gt;qemu&lt;/a&gt;. First though a big thanks to Andrzej "balrog-kun" Zaborowski who as part of his work for &lt;a href="http://o-hand.com/blog/?p=19"&gt;OpenedHand&lt;/a&gt; added support for XScale processors to qemu and helped Marek and I get the Hack&amp;amp;Dev kernel working properly within it.
&lt;h2&gt;Installing qemu (with H&amp;D patches)&lt;/h2&gt;&lt;h3&gt;Windows&lt;/h3&gt; It's your lucky day, we're making things easy. Grab &lt;a href="http://sourceforge.net/project/showfiles.php?group_id=155828&amp;package_id=236515&amp;release_id=518283"&gt;these binaries&lt;/a&gt; and unzip them somewhere.
&lt;h3&gt;Linux and others&lt;/h3&gt; Today I committed the &lt;a href="http://wiki.openmoko.org/wiki/OpenMoko_under_QEMU"&gt;OpenMoko qemu tree&lt;/a&gt; with the palm machine support patches into H&amp;D &lt;a href="http://hackndev.svn.sourceforge.net/viewvc/hackndev/qemu/"&gt;SVN&lt;/a&gt;. So the first step is to grab a copy of tree:
&lt;pre&gt;svn co https://hackndev.svn.sourceforge.net/svnroot/hackndev/qemu/trunk qemu-hnd
cd qemu-hnd&lt;/pre&gt;
Alternatively get &lt;a href="http://sourceforge.net/project/showfiles.php?group_id=155828&amp;package_id=236515&amp;release_id=518283"&gt;the version&lt;/a&gt; I wrote this guide against from the SF release page.

Next you'll need to make sure you have gcc 3.x installed (look for /usr/bin/gcc-3.*). Unfortunately qemu will not build with gcc 4. Gentoo users can grab 3.4.6 with:
&lt;pre&gt;emerge -av =gcc-3.4.6-r2&lt;/pre&gt;
Next we configure and make, choosing only to build the arm-softmmu target and using the 3.4.6 compiler:
&lt;pre&gt;./configure --disable-system --disable-user --target-list=arm-softmmu --cc=gcc-3.4.6
make -j3&lt;/pre&gt;
Once the build is complete, you'll find a &lt;tt&gt;qemu-system-arm&lt;/tt&gt; executable in &lt;tt&gt;arm-softmmu/&lt;/tt&gt;.

&lt;h2&gt;Booting qemu&lt;/h2&gt;
You can check which machines qemu supports using this command:
&lt;pre&gt;./arm-softmmu/qemu-system-arm -M ?&lt;/pre&gt;
As of this writing the partially supported palms are palmld, palmt650, palmt680, palmtc, palmz72 and palmtx. Grab and unpack a bootpack for your desired machine. I'm going to use Stepan's &lt;a href="http://trac.hackndev.com/projects/palmld/wiki/ReleaseFnW"&gt;Fire and Water 0.0.3&lt;/a&gt; palmld bootpack as an example.

&lt;p&gt;Now simply fire up qemu, telling it to use the kernel and rootfs from the bootpack. I'm omitting the initrd since the palmld bootpack expects to boot off the HDD but it's easier to boot it off the SD card in qemu. The &lt;tt&gt;psplash=false&lt;/tt&gt; option is to disable the OE splash screen so that I can view the startup messages.&lt;/p&gt;
&lt;pre&gt;./arm-softmmu/qemu-system-arm -M palmld -kernel zImage \
    -sd Angstrom-opie-image-palmld-0.0.3-alpha.rootfs.ext2 \
    -append "root=/dev/mmcblk0 psplash=false"&lt;/pre&gt;
It may take a while to boot so be patient. Eventually you should see the OPIE touchscreen callibration screen:
&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://hackndev.com/~ato/tmp/fnw-qemu/qemu-palmld-fnw-welcome.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 200px;" src="http://hackndev.com/~ato/tmp/fnw-qemu/qemu-palmld-fnw-welcome.png" border="0" alt="" /&gt;&lt;/a&gt;

&lt;p&gt;Since qemu doesn't currently support the palms' touchscreens press Ctrl+Alt+3 to get to the serial console. You can then login as root. Press Ctrl+Alt+1 if you want to get back to the graphical output.&lt;/p&gt;

&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://hackndev.com/~ato/tmp/fnw-qemu/qemu-palmld-fnw-serial2.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 200px;" src="http://hackndev.com/~ato/tmp/fnw-qemu/qemu-palmld-fnw-serial2.png" border="0" alt="" /&gt;&lt;/a&gt;

Edit: &lt;a href="http://hackndev.com/~ato/tmp/fnw-qemu/"&gt;More screenshots&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5208538475966737187-5563176631147908365?l=hhtinker.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hhtinker.blogspot.com/feeds/5563176631147908365/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5208538475966737187&amp;postID=5563176631147908365' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5208538475966737187/posts/default/5563176631147908365'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5208538475966737187/posts/default/5563176631147908365'/><link rel='alternate' type='text/html' href='http://hhtinker.blogspot.com/2007/06/testing-linux4palm-on-qemu.html' title='Testing Linux4Palm on qemu'/><author><name>Alex</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5208538475966737187.post-7850282277505775704</id><published>2007-06-23T13:03:00.000+10:00</published><updated>2007-06-23T15:24:33.659+10:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ideas'/><category scheme='http://www.blogger.com/atom/ns#' term='website'/><title type='text'>Hack&amp;Dev Upgrades</title><content type='html'>Lately I've been discussing the problems with &lt;a href="http://hackndev.com"&gt;Hack&amp;amp;Dev&lt;/a&gt;. We have a major communication problem, the only way anybody finds out what's going on is if they jump on IRC and ask people. Even then it's not all that helpful. Since I've got a couple of weeks relatively relaxed at the moment, I thought I'd have a shot at this problem. See the &lt;a href="http://hackndev.com/node/814"&gt;forum&lt;/a&gt; for the current ideas. I'd mention &lt;a href="http://planet.hackndev.com/"&gt;Planet Hack&amp;Dev&lt;/a&gt; here but you're probably reading this post from there. ;-)

Email me &lt;i&gt;alex (at-sign) hackndev (dot) com&lt;/i&gt; if you write or know of a Hack&amp;Dev developer's blog (with RSS) that should be added to the planet.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5208538475966737187-7850282277505775704?l=hhtinker.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hhtinker.blogspot.com/feeds/7850282277505775704/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5208538475966737187&amp;postID=7850282277505775704' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5208538475966737187/posts/default/7850282277505775704'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5208538475966737187/posts/default/7850282277505775704'/><link rel='alternate' type='text/html' href='http://hhtinker.blogspot.com/2007/06/hack-upgrades.html' title='Hack&amp;Dev Upgrades'/><author><name>Alex</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
