[[samsung.m40]]
 
Table des Matières

Samsung M40 XWM 725

So far this laptop works perfectly with a Debian GNU/Linux. There’s just a couple of features which are still disabled:

If you find anything wrong in this page (technical or typo…), please feel free to report it to me at julienpauthier at yahoo fr.

If you need information lacking here, maybe you should try to search these websites:

UPDATE: i re-installed the system to reorganize the drives a bit, and the Debian 4.0 turns out to work perfectly out-of-the-box (compiz, battery, speedstep… everything is set and works without any source to compile: great!).

Hardware

Technical specifications

Specifications from manufacturer

lspci output

0000:00:00.0 Host bridge: Intel Corp. 82855PM Processor to I/O Controller (rev 03)
0000:00:01.0 PCI bridge: Intel Corp. 82855PM Processor to AGP Controller (rev 03)
0000:00:1d.0 USB Controller: Intel Corp. 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) USB UHCI Controller #1 (rev 01)
0000:00:1d.1 USB Controller: Intel Corp. 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) USB UHCI Controller #2 (rev 01)
0000:00:1d.2 USB Controller: Intel Corp. 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) USB UHCI Controller #3 (rev 01)
0000:00:1d.7 USB Controller: Intel Corp. 82801DB/DBM (ICH4/ICH4-M) USB 2.0 EHCI Controller (rev 01)
0000:00:1e.0 PCI bridge: Intel Corp. 82801 PCI Bridge (rev 81)
0000:00:1f.0 ISA bridge: Intel Corp. 82801DBM LPC Interface Controller (rev 01)
0000:00:1f.1 IDE interface: Intel Corp. 82801DBM (ICH4) Ultra ATA Storage Controller (rev 01)
0000:00:1f.3 SMBus: Intel Corp. 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) SMBus Controller (rev 01)
0000:00:1f.5 Multimedia audio controller: Intel Corp. 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) AC'97 Audio Controller (rev 01)
0000:00:1f.6 Modem: Intel Corp. 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) AC'97 Modem Controller (rev 01)
0000:01:00.0 VGA compatible controller: nVidia Corporation NV34M [GeForce FX Go 5200] (rev a1)
0000:02:03.0 CardBus bridge: Ricoh Co Ltd RL5c476 II (rev ac)
0000:02:03.1 CardBus bridge: Ricoh Co Ltd RL5c476 II (rev ac)
0000:02:03.2 FireWire (IEEE 1394): Ricoh Co Ltd R5C552 IEEE 1394 Controller (rev 04)
0000:02:05.0 Ethernet controller: Broadcom Corporation BCM4401 100Base-T (rev 01)
0000:02:07.0 Network controller: Intel Corp. PRO/Wireless 2200BG (rev 05)

External resources

Most of information given here comes from these pages:

Linux distribution

I installed a Debian Woody 3.0 with bf24 flavor to get the 2.4.18 kernel. Once i got network operational, i dist-upgraded to Etch and compiled a 2.6.8 kernel.

Networking

LAN

2.6.x kernels

2.6 kernels offer b44 driver to handle Broadcom network adapter.

See /etc/modules for 2.6.x kernels

2.4.x kernels

When running 2.4.18 kernel, I didn’t find any suitable driver, I downloaded the Broadcom driver bcm4400 from their website. Using kernel-headers-2.4.18-bf2.4 package, I recompiled only the driver. Nothing to report: it works properly!

When switching to 2.4.27 Debian kernel, it’s possible to use the free driver b44 instead.

See /etc/modules for 2.4.x kernels

Wifi

ipw2200-source Debian package provides sources to build wireless adapter driver. You need to download ipw2200 firmware and untar its content in /usr/lib/hotplug/firmware/ (meaning hotplug package must be installed)

Once module is built, hotplug loads ipw2200 module with required firmware as system boots up. Now iwconfig (provided by wireless-tools package) should get a new network device.

Note: Module (and thus kernel itself) must be built with gcc-3.x to compile ipw2200 module properly.

Graphics

Graphical device

I simply installed nVidia driver (I used version 1.0-6111).

Here is the device section in my X configuration file:

Section "Device"
	Identifier	"Generic Video Card"
	Driver		"nvidia"
	Option		"NoLogo"	"on"
	BusID		"PCI:1:0:0"
EndSection

Monitor

Then configure 17” monitor and add modeline to get 1440×900 resolution:

Section "Monitor"
	Identifier	"Generic Monitor"
	HorizSync	30-64
	VertRefresh	50-100
	Option		"DPMS"
	ModeLine	"1440x900@60" 97.54 1440 1472 1840 1872 900 919 927 946
EndSection

Here is the complete configuration files: /etc/X11/XF86Config-4 and /etc/X11/xorg.conf

TV-Out

Here’s nVidia documentation concerning TV-Out configuration.

in progress…

Section "Monitor"
	Identifier	"TV"
	HorizSync	30-50
	VertRefresh	60
	Option		"TVStandard"		"PAL-N"
	#Option		"TVOutFormat"		"SVIDEO"
	#Option		"TVOutFormat"		"COMPOSITE"
	#Option		"ConnectedMonitor"	"TV"
EndSection

Input devices

I use the touchpad as well as an USB mouse. Here’s the appropriate section needed to handle this properly:

Section "InputDevice"
	Identifier	"Generic Mouse"
	Driver		"mouse"
	Option		"Device"		"/dev/input/mice"
	Option		"Protocol"		"ImPS/2"
	Option		"Emulate3Buttons"	"true"
	Option		"ZAxisMapping"		"4 5"
EndSection

So far I didn’t experience any problem using touchpad with regular mouse drive. Maybe it’d be better to use Synaptic package…

Note: When switching to kernel 2.6.8, touchpad’s scroll aptitude wasn’t operational anymore. To get this behavior back, I simply add proto=imps option for psmouse module (see /etc/modules).

Power management

ACPI

The DSDT is bugged. So I looked at this awesome tutorial describing how to detect and fix a DSDT.

Dumping and fixing DSDT

Here is the buggy DSDT (grabbed from /proc/acpi/dsdt and decompiled with iasl): dsdt.dsl.buggy

iasl output

Intel ACPI Component Architecture
ASL Optimizing Compiler / AML Disassembler version 20041203 [Dec  3 2004]
Copyright (C) 2000 - 2004 Intel Corporation
Supports ACPI Specification Revision 2.0c

dsdt.dsl   312:     Method (_WAK, 1, NotSerialized)
Warning  2026 -                ^ Reserved method must return a value (_WAK)

dsdt.dsl  2575:                     Field (ECR, DWordAcc, Lock, Preserve)
Error    1048 -                              ^ Host Operation Region requires ByteAcc access

dsdt.dsl  2621:                     Method (_GLK, 1, NotSerialized)
Warning  2024 -                                ^ Reserved method has too many arguments ( _GLK requires 0)

ASL Input:  dsdt.dsl - 3817 lines, 128061 bytes, 1825 keywords
Compilation complete. 1 Errors, 2 Warnings, 0 Remarks, 423 Optimizations

Thanks to the tutorial, it’s easy to get a ‘fixed’ one: dsdt.dsl

iasl output

Intel ACPI Component Architecture
ASL Optimizing Compiler / AML Disassembler version 20041203 [Dec  3 2004]
Copyright (C) 2000 - 2004 Intel Corporation
Supports ACPI Specification Revision 2.0c

ASL Input:  dsdt.dsl - 3819 lines, 128079 bytes, 1826 keywords
AML Output: DSDT.aml - 14834 bytes 492 named objects 1334 executable opcodes

Compilation complete. 0 Errors, 0 Warnings, 0 Remarks, 425 Optimizations

Note: I couldn’t manage to compile iasl with provided sources. So I simply downloaded win32 binary and ran it using regular wine from Debian repository (yes, I do feel shameful).

Patching kernel

As explained in the tutorial, I patched the kernel and added fixed DSDT file dsdt_table.h (HEX format generated by iasl) in include/acpi/. But, since the provided acpi_patch_2.4.23.diff is meant for 2.4.23, I didn’t use patch command and updated file drivers/acpi/osl.c manually (there’re only a few lines to update…).

Then, I simply compiled the 2.4.27 kernel. Here is the kernel configuration file I used: config-2.4.27.

Finally, I can access battery, thermal information… through appropriated ACPI modules (see /etc/modules file). ACPI-linked buttons (battery level on screen display, disable touchpad…) work as well. The box also shutdowns properly. You can now bind power button to shutdown command by installing acpid.

Speedstep

Well… it’s time to switch to a 2.6 kernel, if it’s not already done! First you have to patch file drivers/acpi/osl.c in the same way, and to add dsdt_table.h in include/acpi/ to override BIOS DSDT with a ‘fixed’ one.

Patching kernel for Dothan CPU

Then compiling the kernel would work, but speedstep-centrino module wouldn’t be loadable (“No such device”). Here’s explained how to fix this issue. You just have to patch arch/i386/kernel/cpu/cpufreq/speedstep-centrino.c by replacing :

static const struct cpu_id cpu_id_dothan_a1 = {
	.x86_vendor = X86_VENDOR_INTEL,
	.x86 = 6,
	.x86_model = 13,
	.x86_mask = 1,
};

with:

static const struct cpu_id cpu_id_dothan_a1 = {
	.x86_vendor = X86_VENDOR_INTEL,
	.x86 = 6,
	.x86_model = 13,
	.x86_mask = 6,
};

According to this page, new 6 value stands for stepping value provided by cat /proc/cpuinfo:

processor       : 0
vendor_id       : GenuineIntel
cpu family      : 6
model           : 13
model name      : Intel(R) Pentium(R) M processor 1.60GHz
stepping        : 6
cpu MHz         : 1595.868
cache size      : 2048 KB
fdiv_bug        : no
hlt_bug         : no
f00f_bug        : no
coma_bug        : no
fpu             : yes
fpu_exception   : yes
cpuid level     : 2
wp              : yes
flags           : fpu vme de pse tsc msr mce cx8 apic sep mtrr pge mca cmov pat clflush dts acpi mmx fxsr sse sse2 ss tm pbe tm2 est
bogomips        : 3162.11

Making CPU silent

I noticed that CPU produced a weird noise when running on its battery and decreasing speed. There’s a patch for this in kernel bug tracker. It consists of changing HZ value in file include/asm-i386/param.h from:

#ifdef __KERNEL__
# define HZ			1000		/* Internal kernel timer frequency */
# define USER_HZ		100		/* .. some user interfaces are in "ticks" */
# define CLOCKS_PER_SEC		(USER_HZ)	/* like times() */
#endif 
 

to:

#ifdef __KERNEL__
# define HZ			100		/* Internal kernel timer frequency */
# define USER_HZ		100		/* .. some user interfaces are in "ticks" */
# define CLOCKS_PER_SEC		(USER_HZ)	/* like times() */
#endif 
 

Building kernel

Here is the config file I used: config-2.6.8.

After reboot, speedstep-centrino module should now be loadable (then acpi doesn’t need to be loaded anymore since speedstep-centrino replaces it). Then install cpufreqd to let kernel decrease CPU frequency when appropriated!

See /etc/modules for 2.6.x kernels

Sound

OSS

Well, module i810_audio (needs ac97_codec) works properly if you want to listen a few audio files.

Since there’s no mixer support, some softwares can’t use sound with this device. So I guess it’s better to switch quickly to ALSA…

ALSA

I simply compiled ALSA from Debian package alsa-source for 2.4.27 kernel ; for 2.6.8 of course I used ALSA modules from kernel’s source.

Once ALSA is properly installed, load modules snd-ac97-codec, snd-intel8×0, snd-intel8×0m.

See /etc/modules file

Hotkeys

I simply read hotkey’s codes using xev. Then I could either use hotkeys (providing some cool OSD features) or xmodmap.

Using hotkeys...

When running 2.4 kernel, I installed hotkeys package to handle special keyboard buttons (browser, email client, volume Fn keys…) with newly created file /usr/share/hotkeys/samsung.def:

<?xml version="1.0"?>
<definition>
	<config model="Samsung M40">
		<Play         keycode="124"/>
		
		<VolUp        keycode="176" adj="2"/>
		<VolDown      keycode="174" adj="2"/>
		<Mute         keycode="160"/>
		
		<WebBrowser   keycode="125"/>
		<Email        keycode="128"/>
	</config>
	<contributor>
		<name>Julien Pauthier</name>
		<email>julienpauthier at yahoo fr</email>
	</contributor>
</definition>

Please note that Play entry is linked to the custom button which is at the same place than email and browser keys on the keyboard.

That’s it! Type this to get hotkeys operational:

/usr/bin/hotkeys -Z -t samsung

Using xmodmap...

2.4.x kernels

Here is the .xmodmaprc file:

keycode 128 = XF86Mail
keycode 125 = XF86WWW
keycode 124 = XF86AudioMedia
keycode 160 = XF86AudioMute
keycode 176 = XF86AudioRaiseVolume
keycode 174 = XF86AudioLowerVolume

Then launch xmodmap (use your ~/.xsession file for example):

/usr/bin/X11/xmodmap .xmodmaprc

You can now capture these keycodes and bind them with any application through your windowmanager’s configuration tool.

2.6.x kernels

I couldn’t use browser and custom button when running 2.6.8 kernel. I got this error message when I pressed one of these buttons:

atkbd.c: Unknown key released (translated set 2, code 0x74 on isa0060/serio0).
atkbd.c: Use 'setkeycodes 74 <keycode>' to make it known. 
atkbd.c: Unknown key released (translated set 2, code 0x75 on isa0060/serio0).
atkbd.c: Use 'setkeycodes 75 <keycode>' to make it known. 

This problem is explained (and resolved) here.

So, I added a script in init.d/ that is launched when my laptop boots up:

#! /bin/sh
NAME=sethotkeys
DESC="Setting key codes"
 
set -e
 
case "$1" in
  start)
        echo -n "$DESC... "
        /usr/bin/setkeycodes 74 200
        /usr/bin/setkeycodes 75 218
        echo "done."
        ;;
  *)
        N=/etc/init.d/$NAME
        echo "Usage: $N {start}" >&2
        exit 1
        ;;
esac
 
exit 0

Note: I chose keycodes 200 and 218 because they don’t match any key I use on my keyboard (see include/linux/input.h).

Then I slightly updated .xmodmaprc file according to new codes captured by xev:

keycode 128 = XF86Mail
keycode 194 = XF86WWW
keycode 168 = XF86AudioMedia
keycode 160 = XF86AudioMute
keycode 176 = XF86AudioRaiseVolume
keycode 174 = XF86AudioLowerVolume

Now hotkeys work properly with 2.6 kernel!

Modem

According to several reports seen on tuxmobil.org, this internal 56k modem would be supported by slmodem driver provided by SmartLink.

MemoryStick card reader

I haven’t tested yet since I don’t have any Sony camera. But according to many reports I could read, it seems pretty hard to make that kind of stuff working since there’s no driver available for Linux kernels.

Files

/etc/X11/xorg.conf

Section "Files"
	FontPath	"unix/:7100"
	FontPath	"/usr/lib/X11/fonts/misc"
	FontPath	"/usr/lib/X11/fonts/cyrillic"
	FontPath	"/usr/lib/X11/fonts/100dpi/:unscaled"
	FontPath	"/usr/lib/X11/fonts/75dpi/:unscaled"
	FontPath	"/usr/lib/X11/fonts/Type1"
	FontPath	"/usr/lib/X11/fonts/CID"
	FontPath	"/usr/lib/X11/fonts/100dpi"
	FontPath	"/usr/lib/X11/fonts/75dpi"
EndSection

Section "Module"
	Load	"bitmap"
	Load	"dbe"
	Load	"ddc"
	Load	"dri"
	Load	"extmod"
	Load	"freetype"
	Load	"glx"
	Load	"int10"
	Load	"record"
	Load	"type1"
	Load	"v4l"
	Load	"vbe"
EndSection

Section "InputDevice"
	Identifier	"Generic Keyboard"
	Driver		"keyboard"
	Option		"CoreKeyboard"
	Option		"XkbRules"	"xorg"
	Option		"XkbModel"	"pc105"
	Option		"XkbLayout"	"fr"
EndSection

Section "InputDevice"
	Identifier	"Configured Mouse"
	Driver		"mouse"
	Option		"CorePointer"
	Option		"Device"		"/dev/input/mice"
	Option		"Protocol"		"ImPS/2"
	Option		"Emulate3Buttons"	"true"
	Option		"ZAxisMapping"		"4 5"
EndSection
Section "InputDevice"
	Identifier	"Synaptics Touchpad"
	Driver		"synaptics"
	Option		"SendCoreEvents"	"true"
	Option		"Device"		"/dev/psaux"
	Option		"Protocol"		"auto-dev"
	Option		"HorizScrollDelta"	"0"
EndSection

Section "Device"
	Identifier	"Carte vidéo générique"
	Driver		"nvidia"
	Option          "NoLogo"        "on"
	BusID		"PCI:1:0:0"
EndSection

Section "Monitor"
	Identifier	"Écran générique"
	Option		"DPMS"
        HorizSync       30-64
        VertRefresh     50-100
        ModeLine        "1440x900@60" 97.54 1440 1472 1840 1872 900 919 927 946
EndSection

Section "Screen"
	Identifier	"Default Screen"
	Device		"Carte vidéo générique"
	Monitor		"Écran générique"
	DefaultDepth	24
	SubSection "Display"
		Depth		1
		Modes		"1440x900" "1024x768" "800x600" "640x480"
	EndSubSection
	SubSection "Display"
		Depth		4
		Modes		"1440x900" "1024x768" "800x600" "640x480"
	EndSubSection
	SubSection "Display"
		Depth		8
		Modes		"1440x900" "1024x768" "800x600" "640x480"
	EndSubSection
	SubSection "Display"
		Depth		15
		Modes		"1440x900" "1024x768" "800x600" "640x480"
	EndSubSection
	SubSection "Display"
		Depth		16
		Modes		"1440x900@60" "1024x768" "800x600" "640x480"
	EndSubSection
	SubSection "Display"
		Depth		24
		Modes		"1440x900@60" "1024x768" "800x600" "640x480"
	EndSubSection
EndSection

Section "ServerLayout"
	Identifier	"Default Layout"
	Screen		"Default Screen"
	InputDevice	"Generic Keyboard"
	InputDevice	"Configured Mouse"
	InputDevice	"Synaptics Touchpad"
EndSection

Section "DRI"
	Mode	0666
EndSection

/etc/X11/XF86Config-4

Section "Files"
	FontPath	"unix/:7100"
	FontPath	"/usr/lib/X11/fonts/misc"
	FontPath	"/usr/lib/X11/fonts/cyrillic"
	FontPath	"/usr/lib/X11/fonts/100dpi/:unscaled"
	FontPath	"/usr/lib/X11/fonts/75dpi/:unscaled"
	FontPath	"/usr/lib/X11/fonts/Type1"
	FontPath	"/usr/lib/X11/fonts/CID"
	FontPath	"/usr/lib/X11/fonts/Speedo"
	FontPath	"/usr/lib/X11/fonts/100dpi"
	FontPath	"/usr/lib/X11/fonts/75dpi"
EndSection

Section "Module"
	Load	"GLcore"
	Load	"bitmap"
	Load	"dbe"
	Load	"ddc"
	Load	"dri"
	Load	"extmod"
	Load	"freetype"
	Load	"glx"
	Load	"int10"
	Load	"record"
	Load	"speedo"
	Load	"type1"
	Load	"vbe"
EndSection

Section "InputDevice"
	Identifier	"Generic Keyboard"
	Driver		"keyboard"
	Option		"CoreKeyboard"
	Option		"XkbRules"	"xfree86"
	Option		"XkbModel"	"pc105"
	Option		"XkbLayout"	"fr"
EndSection

Section "InputDevice"
	Identifier	"Generic Mouse"
	Driver		"mouse"
	Option		"Device"		"/dev/input/mice"
	Option		"Protocol"		"ImPS/2"
	Option		"Emulate3Buttons"	"true"
	Option		"ZAxisMapping"		"4 5"
EndSection

Section "Device"
	Identifier	"Generic Video Card"
	Driver		"nvidia"
	Option		"NvAGP"		"1"
	Option		"NoLogo"	"on"
	Option		"IgnoreEDID"	"true"
	Option		"UseEdidFreqs"	"0"
	Option		"HWCursor"	"0"
EndSection

Section "Monitor"
	Identifier	"Generic Monitor"
	HorizSync	30-64
	VertRefresh	50-100
	Option		"DPMS"
	ModeLine	"1440x900@60" 97.54 1440 1472 1840 1872 900 919 927 946
EndSection

Section "Screen"
	Identifier	"Default Screen"
	Device		"Generic Video Card"
	Monitor		"Generic Monitor"
	DefaultDepth	24
	SubSection "Display"
		Depth		1
		Modes		"1024x768" "640x480"
	EndSubSection
	SubSection "Display"
		Depth		4
		Modes		"1024x768" "640x480"
	EndSubSection
	SubSection "Display"
		Depth		8
		Modes		"1024x768" "640x480"
	EndSubSection
	SubSection "Display"
		Depth		15
		Modes		"1024x768" "640x480"
	EndSubSection
	SubSection "Display"
		Depth		16
		Modes		"1024x768" "640x480"
	EndSubSection
	SubSection "Display"
		Depth		24
		Modes		"1440x900@60" "1024x768" "640x480"
	EndSubSection
EndSection

Section "ServerLayout"
	Identifier	"Default Layout"
	Screen		"Default Screen"
	InputDevice	"Generic Keyboard"
	InputDevice	"Generic Mouse"
EndSection

Section "DRI"
	Mode	0666
EndSection

/etc/modules

For 2.6.x kernels

cpufreq_powersave
cpufreq_userspace
speedstep-lib
speedstep-centrino

uhci-hcd

mousedev
usbmouse
psmouse proto=imps

usb-storage

b44

ide-cd

soundcore
snd-ac97-codec
snd-intel8x0
snd-intel8x0m

nvidia

/etc/modules.2.4

For 2.4.x kernels

acpi
battery
ac
thermal
processor
button
fan

usb-uhci

input
hid
mousedev
usbmouse

usb-storage

b44

ide-scsi

soundcore
snd-ac97-codec
snd-intel8x0
snd-intel8x0m

nvidia
 
  samsung.m40.txt · Dernier changement: 2009/01/24 11:48
 
Recent changes RSS feed Creative Commons License Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki