[ltp] Re: ThinkPad Batteries

Henrique de Moraes Holschuh linux-thinkpad@linux-thinkpad.org
Tue, 18 Nov 2008 09:56:55 -0200


On Tue, 18 Nov 2008, Michael Karcher wrote:
> The EC is *not* part of your BIOS that does things behind your back,
> this is called the SMBIOS (and accessed via smapi), but a tiny low-power

Acessed via smapi, SMI traps (about half the ACPI table in a ThinkPad are
SMI traps), and all sort of nasty crap that gets in the way of proper kernel
timekeeping, proper kernel hardware handling, proper kernel watchdog
handling, etc :(

Heck, IBM (and now Lenovo) uses SMBIOS code to even update the CMOS nvram...
on one hand, that means the ThinkPad just works well most of the time, even
in MS-DOS mode...  On the other hand, if you manage to do *anything* to the
machine the SMBIOS wouldn't like, you have misterious crashes and hangs that
are extremely hard to reproduce.

One thing that is guaranteed to upset the SMBIOS is the NMI watchdog, and
also any attempts to reboot the box via the chipset watchdog (available
since the T42, I think. Check the Intel MCH datasheets).

> processor that works completely independent from the main processor, and
> handles at least the following things (on a T20, T60 might be different)

It is the same chip family since the T20, yes.  A Renesas H8S/300
microcontroller, family 2600.  The specific chip changes, depending on the
number of IO pins IBM/Lenovo wanted, etc.

The firmware (both EC and SMBIOS) is likely the same basic core, with
continuous updates as features are added and fixed.  That's what makes it
possible for us to support so many ThinkPad models with minimum hassle: IBM
took great pains to keep the interface constant, and Lenovo is keeping up
with that tradition reasonably well.

>  - Hardware volume control

Dropped on new thinkpads, someone in Lenovo is going cheap here. I have
complained to them, but unless a lot of people start making a fuss about it,
we will be dealing with Dell-style "just in software" muting, which is
horrible (ever needed to mute the BIOS in a hurry?).

>  - Brightness control

On software, nowadays, because that control moved to the GPU and the O.S.
needs to be able to control the GPU without conflicts with the firmware.

>  - Thermal supervision, shutdown of the system if way too hot.
>  - Beeping signals (for example on critical battery), this does NOT
>    include the usual PC speaker beeping.

And seems to be changed on new Lenovo ThinkPads as well :-(  Probably part
of their "let's do it cheap like Dells" move on the audio control.

> All these things are completely independent from the host processor,
> even if the EC stops performing may of the tasks when the host processor
> is not running.

IME, when the EC goes crazy, the machine will lock down hard really soon.
Probably the SMBIOS goes berserk as well while trying to talk to the
misbehaving EC, and ends up locking down the host CPU too.

-- 
  "One disk to rule them all, One disk to find them. One disk to bring
  them all and in the darkness grind them. In the Land of Redmond
  where the shadows lie." -- The Silicon Valley Tarot
  Henrique Holschuh