Donation from Maigurs Stalidzans. Thanks!
[ikiwiki.git] / docs / user / ThinkpadX61s.mdwn
1 # DragonFly on Lenovo Thinkpad X61s 
2
3 [[!toc levels=2]]
4
5 Following experience is from running DragonFly 1.11 development on laptop, so it should apply if you are running 1.12 stable and up.
6
7     $ sudo lspci -nn
8     00:00.0 Host bridge [0600]: Intel Corporation Mobile Memory Controller Hub [8086:2a00] (rev 0c)
9     00:02.0 VGA compatible controller [0300]: Intel Corporation Mobile Integrated Graphics Controller [8086:2a02] (rev 0c)
10     00:02.1 Display controller [0380]: Intel Corporation Mobile Integrated Graphics Controller [8086:2a03] (rev 0c)
11     00:19.0 Ethernet controller [0200]: Intel Corporation 82566MM Gigabit Network Connection [8086:1049] (rev 03)
12     00:1a.0 USB Controller [0c03]: Intel Corporation 82801H (ICH8 Family) USB UHCI Contoller #4 [8086:2834] (rev 03)
13     00:1a.1 USB Controller [0c03]: Intel Corporation 82801H (ICH8 Family) USB UHCI Controller #5 [8086:2835] (rev 03)
14     00:1a.7 USB Controller [0c03]: Intel Corporation 82801H (ICH8 Family) USB2 EHCI Controller #2 [8086:283a] (rev 03)
15     00:1b.0 Audio device [0403]: Intel Corporation 82801H (ICH8 Family) HD Audio Controller [8086:284b] (rev 03)
16     00:1c.0 PCI bridge [0604]: Intel Corporation 82801H (ICH8 Family) PCI Express Port 1 [8086:283f] (rev 03)
17     00:1c.1 PCI bridge [0604]: Intel Corporation 82801H (ICH8 Family) PCI Express Port 2 [8086:2841] (rev 03)
18     00:1d.0 USB Controller [0c03]: Intel Corporation 82801H (ICH8 Family) USB UHCI Controller #1 [8086:2830] (rev 03)
19     00:1d.1 USB Controller [0c03]: Intel Corporation 82801H (ICH8 Family) USB UHCI Controller #2 [8086:2831] (rev 03)
20     00:1d.7 USB Controller [0c03]: Intel Corporation 82801H (ICH8 Family) USB2 EHCI Controller #1 [8086:2836] (rev 03)
21     00:1e.0 PCI bridge [0604]: Intel Corporation 82801 Mobile PCI Bridge [8086:2448] (rev f3)
22     00:1f.0 ISA bridge [0601]: Intel Corporation Mobile LPC Interface Controller [8086:2811] (rev 03)
23     00:1f.2 IDE interface [0101]: Intel Corporation Mobile SATA IDE Controller [8086:2828] (rev 03)
24     00:1f.3 SMBus [0c05]: Intel Corporation 82801H (ICH8 Family) SMBus Controller [8086:283e] (rev 03)
25     03:00.0 Network controller [0280]: Atheros Communications, Inc. AR5418 802.11a/b/g/n Wireless PCI Express Adapter [168c:0024] (rev 01)
26     05:00.0 CardBus bridge [0607]: Ricoh Co Ltd RL5c476 II [1180:0476] (rev ba)
27     05:00.1 FireWire (IEEE 1394) [0c00]: Ricoh Co Ltd R5C832 IEEE 1394 Controller [1180:0832] (rev 04)
28     05:00.2 SD Host controller [0805]: Ricoh Co Ltd R5C822 SD/SDIO/MMC/MS/MSPro Host Adapter [1180:0822] (rev 21)
29
30 ## Kernel and system in general 
31
32 SMP kernel boots with IO_APIC disabled only. With IO_APIC support it panics early in boot. I haven't bothered yet to dig deeper into this issue.
33
34 I'm not able to boot machine with SATA controller in AHCI mode while running on battery (without AC). It boots fine with AHCI AC connected as it does SATA controller in IDE mode. As some brief benchmarks showed that there is no actual difference I'm using it SATA controller in IDE mode at the moment. The issue itself is related to interrupt routing probably, it really needs some love in DragonFly.
35
36 ##### Update from 20.05.2008
37
38 The BIOS update released in 18.05.2008 - 7NETB3WW (2.13) - solves most of problems mentioned here, but the kernel with IO_APIC is still no go.
39
40 * A kernel without IO_APIC option boots fine with SATA controller in any mode - AHCI or compatibility, with and without AC. So there is no need to switch SATA controller to compatibility mode any more.
41 * A kernel with IO_APIC boots with SATA controller in AHCI mode, but doesn't find any disks.
42 * A kernel with IO_APIC boots with SATA controller in compatibility mode, finds disks, but ath(4) doesn't work.
43
44 ## ACPI and power management
45
46 There is no issues in running with ACPI.
47
48     acpi0: <LENOVO TP-7N> on motherboard
49     acpi_ec0: <Embedded Controller: GPE 0x12, ECDT> port 0x66,0x62 on acpi0
50     acpi0: Power Button (fixed)
51     acpi_timer0: <24-bit timer at 3.579545MHz> port 0x1008-0x100b on acpi0
52     cpu0: <ACPI CPU (3 Cx states)> on acpi0
53     cpu1: <ACPI CPU (3 Cx states)> on acpi0
54     acpi_tz0: <Thermal Zone> on acpi0
55     acpi_tz1: <Thermal Zone> on acpi0
56     acpi_lid0: <Control Method Lid Switch> on acpi0
57     acpi_button0: <Sleep Button> on acpi0
58     atkbdc0: <Keyboard controller (i8042)> port 0x64,0x60 irq 1 on acpi0
59     acpi_cpu: throttling enabled, 8 steps (100% to 12.5%), currently 100.0%
60     acpi_cmbat0: <Control Method Battery> on acpi0
61     acpi_acad0: <AC Adapter> on acpi0
62
63 Suspend (S3) doesn't work though - panics on resume. Haven't time to dig into it yet. Throttling CPU speed works through ACPI, but it doesn't seem to have any impact to battery life, it makes system just slower. So I disabled automatic throttling while running on battery:
64
65     $ sysctl hw.acpi.cpu
66     hw.acpi.cpu.throttle_max: 8
67     hw.acpi.cpu.throttle_state: 8
68     hw.acpi.cpu.performance_speed: 8
69     hw.acpi.cpu.economy_speed: 8
70
71 [est(4)](http://leaf.dragonflybsd.org/cgi/web-man?command#est&section4) in DragonFly doesn't support Core family CPU's yet AFAIK. I have 8 cell battery and it lasts about 5 hours, which is enough for me at the moment. Therefore I haven't bothered to dig into power management issues yet.
72
73 For tuning/controlling/monitoring ACPI extras for Thinkpad laptops I have acpi_ibm(4) and acpi_video(4) ports from FreeBSD in work. Neither of them are rady to commit yet, but I can share the current state if you contact me privately. I'll work on them after 2.0 release probably.
74
75     $ sysctl hw.acpi.ibm
76     hw.acpi.ibm.initialmask: 2060
77     hw.acpi.ibm.availmask: 16777215
78     hw.acpi.ibm.events: 0
79     hw.acpi.ibm.eventmask: 2060
80     hw.acpi.ibm.hotkey: 2483
81     hw.acpi.ibm.lcd_brightness: 0
82     hw.acpi.ibm.volume: 0
83     hw.acpi.ibm.mute: 0
84     hw.acpi.ibm.thinklight: 0
85     hw.acpi.ibm.bluetooth: 1
86     hw.acpi.ibm.wlan: 1
87     hw.acpi.ibm.fan_speed: 4343
88     hw.acpi.ibm.fan_level: 0
89     hw.acpi.ibm.fan: 1
90     hw.acpi.ibm.thermal: 52 48 48 49 37 -1 35 -1
91
92 ## Video controller 
93
94 The chipset in use is Intel 965GM.
95
96     agp0: <Intel GM965 SVGA controller> port 0x1800-0x1807 mem 0xe0000000-0xefffffff,0xf8000000-0xf80fffff irq 10 at device 2.0 on pci0
97     agp0: detected 7676k stolen memory
98     agp0: aperture size is 256M
99     drmsub0: <Intel i965GM> on agp0
100
101 Although there are some issues with it, Intel chips are the best ones to use at the moment. I experimented a lot with Xorg and found that XAA acceleration architecture with DRI works best for me. DRM isn't in CVS yet, so you have to use info from [this mail](http://leaf.dragonflybsd.org/mailarchive/users/2008-01/msg00003.html).
102
103 + **XAA without DRI** - Works in general, but there are random XVideo related crashes - [this bug](https://bugs.freedesktop.org/show_bug.cgi?id=13976). Crashes seem to be specific to 965GM chipset, 965Q I'm using in desktops doesn't have this problem. 
104 + **EXA without DRI** - Unusably slow. Seems to be known problem (see [this bug](https://bugs.freedesktop.org/show_bug.cgi?id=13389) for example) Note, that EXA is default in new intel driver 2.2.0, so if you don't want to run DRI, switch to XAA.
105 + **XAA with DRI** - Best option so far. Running GL applications is problematic though - I'm able to crash X 100% with moving glxgears window (see [this bug](https://bugs.freedesktop.org/show_bug.cgi?id=13985) for details) and with trying to run second glxgears. The second issue is probably related to bugs in our DRM locking. XVideo crashes are rare, but they are there. 
106 + **EXA with DRI** - The speed is good, I can't crash X with moving glxgears windows, but opening second glxgears still crashes X. There are also some random crashes I'm not yet sure about.
107
108 ##### Update (20080228)
109
110 XVideo crases seems to be related Intel(R) Textured Video adaptor. Modified Xorg driver (2.2.1) which adds hardware overlay support for G965 chips works fine without crashes so far. See [this thread](http://thread.gmane.org/gmane.comp.freedesktop.xorg/26334) for details how to modify the driver.
111
112 ## Ethernet controller 
113
114 Works without any problem with em(4).
115
116     em0: <Intel(R) PRO/1000 Network Connection, Version - 6.2.9> port 0x1840-0x185f mem 0xf8225000-0xf8225fff,0xf8200000-0xf821ffff irq 11 at device 25.0 on pci0
117
118 ## Wireless card(s) 
119
120 AFAICS all X61(s) models have either Intel PRO/Wireless 3945ABG or Intel PRO/Wireless 4965AGN Mini-PCI Express WiFi adapters. Unfortunately neither of them is working in DragonFly at the moment. Situation isn't hopeless though, both of them are supported in OpenBSD via wpi(4) and iwn(4) drivers respectively. With some effort it would be possible to support them. There is also wpi(4) work in progress in FreeBSD which would be simpler to port than the driver from FreeBSD.
121
122 I haven't done any porting work yet, because I can use Atheros AR5418 802.11a/b/g/n Wireless Mini-PCI Express adapter for now. I'm not very happy with it though, because I have to use ath(4) driver with binary blob. Blob in DragonFly doesn't work either and I have to use the one from [[http://people.freebsd.org/~sam/]]. This one works without problems so far and has necessary for me WPA support.
123
124     ath0: <Atheros 5418> mem 0xf7f00000-0xf7f0ffff irq 11 at device 0.0 on pci3
125     ath0: mac 12.10 phy 8.1 radio 12.0
126
127 If you plan to change Mini-PCI Express card note that "unauthorised" ones don't work out of box. See [this link]( http://www.thinkwiki.org/wiki/Problem_with_unauthorized_MiniPCI_network_card) for more details.
128
129 ## Bluetooth 
130
131 Works with ubt(4) driver without problems. In fact all my bluetooth(4) work is done with this laptop.    
132
133     ubt0: <Broadcom Corp BCM2045B, class 224/1, rev 2.00/1.00, addr 3> on uhub0
134
135 ## Audio 
136
137 Works without problems.
138
139     pcm0: <Intel 82801H High Definition Audio Controller> mem 0xf8220000-0xf8223fff irq 11 at device 27.0 on pci0
140     pcm0: <HDA Codec: Analog Devices AD1984>
141     pcm0: <HDA Driver Revision: 20071129_0050>
142
143 ## Firewire 
144
145 Seems to work, but I haven't done any tests so far.    
146
147     fwohci0: vendor#1180, dev832
148     fwohci0: <1394 Open Host Controller Interface> mem 0xd7efe800-0xd7efefff irq 11 at device 0.1 on pci5
149     fwohci0: OHCI version 1.10 (ROM=0)
150     fwohci0: No. of Isochronous channel is 4.
151     fwohci0: EUI64 00:16:d3:ff:ff:c2:f7:57
152     fwohci0: Phy 1394a available S400, 1 ports.
153     fwohci0: Link S400, max_rec 2048 bytes.
154     firewire0: <IEEE1394(FireWire) bus> on fwohci0
155     fwe0: <Ethernet over FireWire> on firewire0
156     fwe0: MAC address: 02:16:d3:c2:f7:57
157     sbp0: <SBP-2/SCSI over FireWire> on firewire0
158     fwohci0: Initiate bus reset
159     fwohci0: node_id#0xc800ffc0, gen1, CYCLEMASTER mode
160     firewire0: 1 nodes, maxhop <# 0, cable IRM  0 (me)
161     firewire0: bus manager 0 (me)
162
163 ## SD card reader 
164
165 Isn't supported yet.