IBM/Lenovo T60 - Disk Anti-shock protection support ?

Vladimir Grebenschikov vova at fbsd.ru
Thu Dec 6 14:11:37 PST 2007


On Thu, 2007-12-06 at 13:48 +0100, Torfinn Ingolfsen wrote:
> On Thu, 06 Dec 2007 10:18:45 +0300
> Vladimir Grebenschikov <vova at sw.ru> wrote:
> 
> > Hi Mobile.
> > 
> > Does IBM's HDD anti-sock protection support works under FreeBSD ?
> > Probably there are some references ? 
> 
> The only useful refences to "Active Protection system" I could find
> were these:
> tp_smapi: http://www.thinkwiki.org/wiki/Tp_smapi
> Linux support: http://hdaps.sourceforge.net/
> There seems to be "hdaps-bsd" files for download too, but everythingis
> from 2005.

But it was for 7-CURRENT in 2005 and successfully built on my RELENG_7
now.
Even more, kernel driver looks like working:

accel0: Found Accelerometer, type 0x1, starting init.. (max. 10 seconds)
accel0: Init finished successful
accel0: Time needed: 1 s 59012 us
accel0: <Accelerometer> at port 0x1600-0x162f on isa0
accel0: initstate: 0x1

# sysctl hw.accel
hw.accel: 2 401 474 41 401 474 41 7 224
#

accelgraph draws nice acceleration graph in xterm, and it even very
looks as true.

Looks like it is time to find or write apsd, mentioned below.

some cut from driver sources:
-------------------------------------------------------------------
/*
 * Copyright (c) 2005 Maik Ehinger <m.ehinger at ltur.de>
 ...
 */

/*
 * Driver for Accelerometers found in most IBM Thinkpads
 * It's the base of the IBM Active Protection System
 * 
 * Based on a document by Mark A. Smith
 * http://www.almaden.ibm.com/cs/people/marksmith/tpaps.html
 *
 *
 * provides sysctl "hw.accel"
 *
 * This is the first device driver i wrote, so if there is something wrong or
 * things to do better, please let me know.
 *
 *
 * All hints are welcome.
 *
 * NOTICE: Tested so far only on one Thinkpad T42 M1G.
 *
 * I get rare lockups.
 *
 * Last syslog messages:
 *
 * Aug 14 10:59:43 Current kernel: accel0: initstate: 0x2
 * Aug 14 11:28:37 Current kernel: accel0: _wait_port timed out port: 0x1604 value: 0x50
 * Aug 14 11:28:41 Current last message repeated 74 times
 * Aug 14 11:28:41 Current kernel: acpi_ec0: info: new max delay is 101000 us
 * Aug 14 11:28:41 Current kernel: acpi_ec0: EcCommand: no response to 0x80
 * Aug 14 11:28:41 Current kernel: evregion-0501: *** Error: Handler for [EmbeddedControl] returned AE_NO_HARDWARE_RESPONSE
 *
 *
 * then i get endless ACPI errors and exceptions.
 * I have to remove the battery to turn the Thinkpad off.
 * Keyboard and power button doesn't work
 *
 * Any hints? Is this a "-current" related problem ?
 *
 */

/*
 * TODO
 * - fix lockups
 *              overlapping refresh requests?
 * - sysctl(8) returns garbage most of the time
 *              sysctl calls the accel_sysctl_read routine twice 
 * - locking
 * - write an "apsd" which will park hard disk drive heads on shocks
 * - cleanups
 * - man page 
 * - create mouse like device (accelm)
 */
/*
 * Changes
 *      Aug 16 2005 moe add _accel_ident() and make accel_identify() use it
 *                      removed __accel_ident()
 *                      wait for CMD finished before refresh request
 *                      in _request_refresh()
 *                      make _accel_getdata() aware of "state"
 */


> HTH
-- 
Vladimir B. Grebenschikov
vova at fbsd.ru


More information about the freebsd-mobile mailing list