How to setup linux on Thoshiba Satellite s5200-801.

About | ACPI | Bluetooth

About

Hi, i would like to introdcue you some technical information about my expiriences with Toshiba Satellite s5200-801 There are already a lot of information how to install some linux distribution on this laptop, so that's why i would like to show you how to setup bluetooth,irda, acpi and some other funny stuff on this laptop with kernel 2.6.8 and Debian 3.0 upgraded to testing version.
When u install Debian on that laptop, during installation when u will be asked about which kernel use, type bf24.
There is one very important thing which u need to do it, before rebooting, after instalation. I've noticed that there is some problem with pcmcia, it just freezed the kernel after bootup, so u need to remove from /etc/rc2.d/ this link to pcmcia.

ACPI

Laptop has to have acpi or apm, i decided to get up and run ACPI, when i upgraded debian from kernel 2.4 to 2.6.8 after instalation, ACPI works very well, there were some problems under 2.4, and if u need to use 2.4 it is recommended to patch acpi module from linux ACPI project.
Almost everyting worked as i wanted, but one thing didnt, it was bluetooth. Status of battery works great, processor speed changing works also very good, i just had to load module called p4_clockmod and install utility called cpufreqd, on debian it is really simple, just type apt-get install cpufreqd , and change few thing in /etc/cpufreqd.conf, that's it.
I use Gnome, so there are some applets, which allows u to watch cpuspeed, battery status, and so on.
It is also possible to Suspend our sytem, called SWSUSP, u can get it from http://swsusp.sourceforge.net but it is the part of kernel 2.6, and u dont need to install it.
For me Suspend to RAM works well, i dont have any trouble with booting system again, but on 2.6.4 i had some problems with freezing kernel.

Bluetooth

The bluetooth device, as u find out, is off by default and if u want to enable it u need to make a call to the Toshiba HCI interface. There are two ways to enable it, first is to get small program called dmabt, but it works only in kernel where is ACPI disable. I have rewritten patch from kernel 2.4 to kernel 2.6.8, coz i have this one on my laptop. You can download it here toshiba_acpi_module_2.6.8.diff.  
Now, we need to patch file called toshiba_acpi.c. So first thing is to copy this patch to /usr/src/linux and type patch -p1 < toshiba_acpi_module_2.6.8.diff, then we need to recomplie whole kernel or just that one module, so just go to the dir where this module is cd /usr/src/linux/drivers/acpi/ and type make -C /usr/src/linux SUBDIRS=$PWD modules . This command will compile all *.c files included in this dir.

Now, we need to copy file called toshiba_acpi.ko to the right place, so put in command line this cp /usr/src/linux/drivers/acpi/toshiba_acpi.ko /lib/modules/`uname -r`/kernel/drivers/acpi, then we can load this module to sytem so type so first unload this module if u have loaded it and then load it, rmmod toshiba_acpi; modprobe toshiba_acpi
Now we should get new files in /proc/acpi/toshiba
cat /proc/acpi/toshiba/bluetooth
present: 1
power: 0
attach: 0
wireless: 1
Now we've already got this file, we can enable from this file our bluetooth, we need to type command as below:
echo 'power:1' > /proc/acpi/toshiba/bluetooth
echo 'attach:1' > /proc/acpi/toshiba/bluetooth


AND it's done. Bluetooth works fine.

Added: 25/03/05 23:57 CEST
Some info about connected linux with SonyEricsson P800

laptop:/etc/bluetooth# hciconfig -a
hci0:   Type: USB
           BD Address: 00:03:7A:04:55:6B ACL MTU: 60:20 SCO MTU: 64:0
           UP RUNNING PSCAN ISCAN
           RX bytes:101 acl:0 sco:0 events:13 errors:0
           TX bytes:300 acl:0 sco:0 commands:13 errors:0
           Features: 0xff 0x02 0x04 0x00 0x00 0x00 0x00 0x00
           Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1
           Link policy: RSWITCH HOLD SNIFF PARK
           Link mode: SLAVE ACCEPT
           Name: 'GoDo-laptop 0'
           Class: 0x000100
           Service Classes: Unspecified
           Device Class: Computer, Uncategorized
           HCI Ver: 1.1 (0x1) HCI Rev: 0x0 LMP Ver: 1.1 (0x1) LMP Subver: 0x514
           Manufacturer: Silicon Wave (11)


And now:
hcid; sdpd; hciconfig hci0 piscan noauth up

To see the devices around you type:

laptop:/etc/bluetooth# hcitool inq
Inquiring ...
00:0A:D9:61:C3:D8 clock offset: 0x6ac6 class: 0x10220c

Ok, my P800's bluetooth address is 00:0A:D9:61:C3:D8 . You can ping the phone by issuing:

laptop:/etc/bluetooth# l2ping 00:0A:D9:61:C3:D8
Ping: 00:0A:D9:61:C3:D8 from 00:03:7A:04:55:6B (data size 20) ...
0 bytes from 00:0A:D9:61:C3:D8 id 0 time 56.18ms
0 bytes from 00:0A:D9:61:C3:D8 id 1 time 9.62ms
0 bytes from 00:0A:D9:61:C3:D8 id 2 time 10.61ms
0 bytes from 00:0A:D9:61:C3:D8 id 3 time 10.60ms
0 bytes from 00:0A:D9:61:C3:D8 id 4 time 11.57ms
0 bytes from 00:0A:D9:61:C3:D8 id 5 time 10.72ms
0 bytes from 00:0A:D9:61:C3:D8 id 6 time 11.55ms
7 sent, 7 received, 0% loss

Now browse the service tree of your phone by typing:

laptop:/etc/bluetooth# sdptool browse 00:0A:D9:61:C3:D8 Browsing 00:0A:D9:61:C3:D8 ... Service Name: Voice gateway Service Description: Voice gateway Service Provider: Sony Ericsson Service RecHandle: 0x10000 Service Class ID List: "Headset Audio Gateway" (0x1112) "Generic Audio" (0x1203) Protocol Descriptor List: "L2CAP" (0x0100) "RFCOMM" (0x0003) Channel: 3 Language Base Attr List: code_ISO639: 0x656e encoding: 0x6a base_offset: 0x100 Profile Descriptor List: "Headset" (0x1108) Version: 0x0100 Service Name: Bluetooth Serial Port Service Description: Bluetooth Serial Port Service Provider: Symbian Ltd. Service RecHandle: 0x10007 Service Class ID List: "Serial Port" (0x1101) Protocol Descriptor List: "L2CAP" (0x0100) "RFCOMM" (0x0003) Channel: 1 Language Base Attr List: code_ISO639: 0x656e encoding: 0x6a base_offset: 0x100 Service Name: Dial-up Networking Service Description: Dial-up Networking Service Provider: Sony Ericsson Service RecHandle: 0x10008 Service Class ID List: "Dialup Networking" (0x1103) Protocol Descriptor List: "L2CAP" (0x0100) "RFCOMM" (0x0003) Channel: 2 Language Base Attr List: code_ISO639: 0x656e encoding: 0x6a base_offset: 0x100 Profile Descriptor List: "Dialup Networking" (0x1103) Version: 0x0100 Service Name: OBEX Object Push Service RecHandle: 0x10009 Service Class ID List: "OBEX Object Push" (0x1105) Protocol Descriptor List: "L2CAP" (0x0100) "RFCOMM" (0x0003) Channel: 4 "OBEX" (0x0008) Profile Descriptor List: "OBEX Object Push" (0x1105) Version: 0x0100



ometimes the "OBEX Object Push" service doesn't show up. I don't why but if I run the Remote Sync program in my P800 and quit, then try sdptool browse again and it's shows.

Also, by default sdptool will show only SDP records and SDP attributes that it knows, and ignore all those that it doesn't know. Please use the "--tree" option of sdptool to get the *full* SDP record. (thanks Jean Tourrilhes, for the tip).

Now I've found this page with talks about OBEX over Bluez with RFCOMM. The author has an hacked version of obex push utility to work with Bluez's RFCOMM implementation that uses code from Affix's stack. Download it here. Compile this. Here's a binary version (depends on libglib-1.2.so.0 libopenobex-0.9.so.8).

Now do something like this:

rfcomm conn 1 00:0A:D9:17:7F:51 1

| | | |_ /dev/ttyU1 | |_ RFCOMM Channel for the "OBEX Object Push" service | BT address of your P800

Now you should have /dev/ttyU1 serial device connected to your P800. Try this:

ussp-push /dev/ttyU1 /tmp/Picture.gif Picture.gif


And voila, the file should be transferred to your phone. A progress windows will popup in your phone and you'll prompted to save or view the file once it's downloaded. You can send any kind of file to the phone, even .sis or .jar files for software for installation.
Rare problems are rfcomm lost background processes with abrupt exits and sometimes rfcomm is fine but ussp-push freezes or does nothing. Besides the bad english this document may have technical incorrections.
I'm doing other experiments with the P800, SyncML and Bluetooth. I'll post them when I find something.
That's it. Have fun.

Added: 08/03/05 22:08 CEST
If u want to get the toshiba function keys work u need to install following tool FnFx. Next Linux On Laptops

Owned by GoDo | updated: Fri Apr 08 22:08:30 2005