[FSO] add QCT msm7* modem support

Lukas Gorris lukas.gorris at googlemail.com
Sat Nov 22 18:53:16 CET 2008


Hello,

Of course the thing with the list was pebcam. I registered with
gmail.com domain but sent with googlemail.com.

###### Original mail which did not go to the list yet is following

Hi,

Everyone feel free to add infos here. I will do as
> well over the next days:
> http://www.freesmartphone.org/index.php/HW_Platforms

I will update the msm section there.

>> msm7200 devices (for gsm networks): (htc-msm branch)
>> kaiser (aka HTC TyTn II; buildable machine type in OE), polaris (aka
>> HTC Touch Cruise; also in OE), nike, neon, sedna, wings, ...
>
> Are there plans to have machine support for more devices in OE?

I will sit down and add some more. atm there are only kaiser and
polaris with msm7200 chipset. I'll try adding everything we have a
machine type and working git for. The older htc machines could use
some updating I think.

>> msm7500 devices (for cdma networks): (htc-vogue branch)
>> vogue (aka HTC Touch), titan (Sprint Mogul), ...
>
> So far we don't have any devices with cdma on our agenda. This is not very
> likely driven by us  as we live in GSM countries. Not sure what mickeys opinion
> is on this, but if anybody would came up with clean support for CDMA in FSO we
> could discuss this.

I see no problem about no OM devs living in CDMA countries. I will
talk to people who have the devices and live in cdma areas.

>>... All of the AT commands go through /dev/smd0 . Then there
>> is /dev/smd1 for gprs data and /dev/smd7 for the GPS NMEA data, etc
>> ...
>
> So that would be the interfaces FSO would mostly be interested in.
>
> As long as the GPS device provides NMEA over a char device that is easy.

Yes it is normal NMEA dataflow through the char devices as are AT and
the other relevant channels.

> Modem is, as always, a bit more difficult. Does the modem support standard TS 07.10
> muxer support on these devices?

Afaik we don't have any muxing here because all the data goes through
different serial channels. That was also the first thing mickey asked
about the msm7* modems. I don't know exactly how the 3g stuff works,
because in angstrom I only use gprs on the kaiser. Never tried the
other data connections. But it must be very similar.

> What kind of propriatary AT commands do they
> support e.g. for call in progress indication?

I think calling is 100% standard. (at least when you have the phone
init. from wince since I don't know about proprietary commands in the
init sequences). You just run ATD and optionally set speaker/earpiece
mode etc. That works for me in angstrom when I use minicom.

>.....
> Afterwards working together with you guys to help you and integrate your stuff.
>

That would be nice. I don't know much about programming. I have some
old revision of the framework tree on my hard driver with msm7200
modem added as a copy of the neptune modem where I ripped out some
things.

> OK, that sounds not to bad. I would suggest something like the following to slay
> the monster:
>
> * Good development setup
> ** framework-console-image with cli-framework mdbus, mickeyterm, etc
>

Already have one. For the kaiser and polaris, just build a
framework-console-image for machine htckaiser or htcpolaris.

btw I only have got the kaiser.

A whole different aspect here, not really radio related: There are
problems with X and the framebuffer driver of the htc msm devices
(msm_fb). Somehow only one frame gets drawn. You don't get further
than the standard checkered X wallpaper and the cursor pixmap.
Sometimes not even the wallpaper gets drawn entirely. I think it is
some refresh problem. The android gui which accesses the framebuffer
more directly works fine. Any hints appreaciated.

> * Seek as much information about the modem as possible.
> ** Datasheets would be great
> ** AT command references
> ** Used muxer protocols
> ** Special handling for powermanagement, etc

Will put some first bits of info I found. Here is the "V0 init
sequence". There are more of these, only found the v0 on my hd.

ATZE0S0=0Q0V0X3&C1&D1|+GTKC=2
+CMEE=1
+CRC=1
+CR=1
+CREG=1
+FCLASS=0
+CMGF=0
+CSCS="HEX"
+CSSN=0,1
+CLIP=1
+COLP=0
+CCWA=1
+CMUT=0
+CLIR=0
+CNMI=1,2,2,2,0
+CGREG=1
+CUSD=1
+CPPP=1|@v
+RADIOVER|@HTCCSQ=1
+ENCSQ=1|@HTCDIS=1
@HTCSAP=1|

Here is the ppp script from barry carter (
http://headfuzz.co.uk/files/android/ppp.notsh ) we've been using to
get online with the kaiser and polaris in angstrom. It always works
for me on the kais.

#!/bin/sh
if [ -z "$1" ]; then
   echo "invalid args: ppp accessPointName Username Password"
   echo "GSM ppp up script"
   exit 1
fi
echo "Setting up the modem..."
# Store the password
echo "* * $3" > /etc/ppp/papsecrets
echo "* * $3" > /etc/ppp/chapsecrets

# Send the modem init and access point name
/bin/echo -e "AT+CGDCONT=1,\"IP\",\"$1\",\"\",0,0\r" > /dev/smd0
sleep 1
# Dial up the connection
/bin/echo -e 'ATD*99***1#\r' > /dev/smd0
sleep 1
echo "Initialising pppd..."
# start pppd
pppd /dev/smd1 debug defaultroute local usepeerdns name $2 noipdefault
unit 0 linkname gprs novj persist
# A hack because my provider doesnt give me working dns!
# These are OpenDNS servers. Replace with your own.
echo "ppp initialised! Please wait for the net to come up..."
sleep 30
echo "setting up nameservers"
/bin/echo -e "nameserver 208.67.222.222\n\r nameserver
208.67.220.220\n\r" > /etc/resolv.conf
echo "done! check ifconfig"

As you can see we send the AT commands to smd0 and pppd is ran on smd1
where the gprs data flows.

Regards,

Lukas



########



On Sat, Nov 22, 2008 at 5:01 PM, Stefan Schmidt <stefan at openmoko.org> wrote:

> How different are these machines? Do you have some multimachine kernel? Or one
> kernel per machine?

The polaris is kaiser without keyboard and different touchscreen
driver, Slightly different framebuffer geometry and without the
qwerty. Which is why both use linux-kaiser_2.6.24+git.bb and just get
a different defconfig per machine name. (see htckaiser.conf
htcpolaris.conf). Basically what you propose.
The branch linux-kaiser builds from (htc-msm) is horribly outdated and
we have no alternative in a vcs yet.

That is because we are working on a merge of the newer (raphael,
diamond..) and the older machines (kaiser, polaris..) in the
htc-msm-2.6.25 branch. raphael and friends already work there. When
kaiser and raphael both work in one tree we have a unified branch and
most devices can be build from it using the defconfig-copying-method.

>> I see no problem about no OM devs living in CDMA countries. I will
>> talk to people who have the devices and live in cdma areas.
>
> Sure, we would welcome support for it.

Ok

> So it is:
> /dev/smd0 for AT commands. (Any restriction, or all all comand allowed?)
> /dev/smd1 for GPRS
> /dev/smd7 for GPS

yes

> What it about about /dev/smd{2,3,4,5,6} ? does they exist?

Yes, there is the AGPS garbage and so. I think for all the data
connections smd1 is used. I think also for 3g but I'm not 100% on
that.

> If yes it could good
> be that we really need to userspace muxer for this as it is all handled inside
> the kernel. We have a similar setup for EZX. The kernel driver already does the
> multiplexing, a heavily modified variant of TS07.10 from Moto, and just exports
> the char devices to userspace.

I don't understand. What would need muxing?

> How do you set the speaker or earpiece mode? Is this over alsa mixer controls or
> AT commands?

AT

> That is already a start. If you get to the point where frameword talks to the
> device nodes and goes through all the init fine we can loo k at your patch and
> help you to get it into good shape.

it's useless, only the folder structure. I will grab an uptodate
checkout and restart the approach in the new tree.


> As the modem are pretty similar one device is already enough to get started. I
> would not worry about tis. Once you have done some basics it is very likely that
> other people jump on.

That's no problem anyway. I can always pester some people asking them to test.

> Hmm, the first thing I would to is to look at what kind of ioctl() the Android
> UI is using and comapre it to what X is doing.

ok thanks. I will look into that.

>> > * Seek as much information about the modem as possible.
>> > ** Datasheets would be great
>> > ** AT command references
>> > ** Used muxer protocols
>> > ** Special handling for powermanagement, etc
>>
>> Will put some first bits of info I found. Here is the "V0 init
>> sequence". There are more of these, only found the v0 on my hd.
>>
>> ATZE0S0=0Q0V0X3&C1&D1|+GTKC=2
>> +CMEE=1
>> +CRC=1
>> +CR=1
>> +CREG=1
>> +FCLASS=0
>> +CMGF=0
>> +CSCS="HEX"
>> +CSSN=0,1
>> +CLIP=1
>> +COLP=0
>> +CCWA=1
>> +CMUT=0
>> +CLIR=0
>> +CNMI=1,2,2,2,0
>> +CGREG=1
>> +CUSD=1
>> +CPPP=1|@v
>
>> +RADIOVER|@HTCCSQ=1
>> +ENCSQ=1|@HTCDIS=1
>> @HTCSAP=1|
>
> The three above are for sure HTC specific.[..]

tmzt found doku about some htc specific commands

http://wiki.xda-developers.com/index.php?pagename=HTC_GSM
it should be extended by the newer commands if neccessary.

>> # Send the modem init and access point name
>> /bin/echo -e "AT+CGDCONT=1,\"IP\",\"$1\",\"\",0,0\r" > /dev/smd0
>
> Mickey, normal?
>
>> # Dial up the connection
>> /bin/echo -e 'ATD*99***1#\r' > /dev/smd0
>
> Standard
> We should save this kind of infos in some central place. Feel free to add a new
> wiki site about it.

When I have a useful amount of info I can do that.

I did some AT logging in wince. The two commands above, extracted from
the ppp.sh script, are also used for HSDPA connection setup in wince.
This is the AT log of the HSDPA net dial on:

12:10:45 Tx:	AT+CGDCONT=1,"IP","web.mokofone.org","",0,0\r

12:10:45 Rx:	0\r

12:10:46 Tx:	AT+CGQREQ=1\r

12:10:46 Rx:	0\r

12:10:46 Tx:	AT+CGQMIN=1\r

12:10:46 Rx:	0\r

12:10:46 Tx:	ATD*99***1#\r

12:10:46 Rx:	1\r+PCD: 1,1\r\n

Since that procedure is the same for gprs and hsdpa, something must
set the hsdpa mode before.

Got one huge log which I don't want to post. I will try to boil it
down the commands that switch between 3g(/hsdpa?) and normal (gsm?)
mode. Sorry, I'm confused abotu the terminology.

Here is what happens when the HSDPA data connection is cut. this log
might not be that helpful exactly but gives some further insight. I
tried commenting this a bit with the help of this table
http://gatling.ikk.sztaki.hu/~kissg/gsm/at+c.html Kensan pointed me
to.

12:46:23 	Rx:	+CGACT: 1,0\r\n0\r				//PDP context activate/deactivate

12:46:51 	Tx:	AT+CGACT?\r					//PDP context activate/deactivate

12:46:51 	Rx:	+CGACT: 1,0\r\n0\r				//PDP context activate/deactivate

12:46:51 	Tx:	AT+CLCC\r						//List current calls

12:46:51 	Rx:	0\r				

12:46:54 	Tx:	AT+COPS=2\r					//Operator selection; 2: sign off network

12:46:54 	Rx:	+CREG: 2\r\n					//Network registration; 2: enable
network registration and location information

12:46:54 	Rx:	+CGREG: 2\r\n					//Network registration; 2: enable
network registration and location information

12:46:55 	Rx:	0\r

12:46:55 	Tx:	AT+CGAATT=2,1,1\r				//GPRS Attach/Detach Mode 		

12:46:55 	Rx:	0\r

12:46:55 	Tx:	AT+COPS=0\r					//Operator selection; 0: automatic (oper ignored)

12:47:4 	Rx:	+CREG: 1,"xxxx","xxxx"\r\n			//Network registration; 1:
enable network registration

12:47:4 	Rx:	0\r

12:47:4 	Tx:	AT+COPS=0\r					//Operator selection; 0: automatic (oper ignored)

12:47:4 	Rx:	0\r

12:47:4 	Rx:	@HTCCSQ: 2\r\n					//prop. HTC Signal Quality

12:47:4 	Tx:	AT+COPS=0\r					//Operator selection; 0: automatic (oper ignored)

12:47:4 	Rx:	0\r

12:47:4 	Tx:	AT+COPS=0\r					//Operator selection; 0: automatic (oper ignored)

12:47:4 	Rx:	0\r

12:47:4 	Tx:	AT+COPS=0\r					//Operator selection; 0: automatic (oper ignored)

12:47:4 	Rx:	0\r

12:47:4 	Tx:	AT+CSQ\r						//Signal quality

12:47:4 	Rx:	+CSQ: 12,99\r\n0\r				//Signal quality

12:47:4 	Tx:	AT+COPS=3,2;+COPS?\r				//Operator selection; 3: set
format only, 2: sign off network

12:47:4 	Rx:	@HTCCSQ: 2\r\n					//Signal quality

12:47:4 	Rx:	+COPS: 0,2,"xxxxx",0\r\n0\r			//Operator selection; 0:
automatic (oper ignored), 2: sign off network

12:47:4 	Tx:	AT+CIMI\r						//International Mobile Subscriber Identifier

12:47:4 	Rx:	xxxxxxxxxxxxxxx\r\n0\r				//International Mobile
Subscriber Identifier

12:47:6 	Rx:	@HTCCSQ: 4\r\n					//prop. HTC Signal Quality

12:47:12 	Rx:	+CGREG: 1\r\n					//Network registration; 1: enable
network registration

12:47:17 	Tx:	AT at SYSTEMTIME=12,47,17,2008,11,22\r		

12:47:17 	Rx:	0\r

> Thanks a lot for stepping up and bringing the msm7* support forward in FSO.

No, thank you for willing to add more machines. It will be nice to
come up with a competitor to android (tm) on the new htc devices. With
all the google pr, the attention on the linux on msm is big. But as of
now, most people only know about the android userspace in that
context.



More information about the devel mailing list