Re: newbus questions

From: Nate Lawson <nate_at_root.org>
Date: Mon, 14 Jul 2003 20:21:09 -0700 (PDT)
On Mon, 14 Jul 2003, M. Warner Losh wrote:
> Let's take a step back.  What are you trying to do?

I need to install a temporary EC handler before the namespace is
evaluated.  This is because various other ACPI routines will call the EC
before acpi_ec_attach is called (just after sio1 attach on my laptop).
The way to do this (according to the ACPI 2.0 spec and Linux code) is to
read the ECDT and use its values for registers and the GPE bit until the
proper attach routine is called.

Here are the errors that are reported when acpica attempts to access the
EC before it has been attached:

acpi0: <IBM    TP-1A   > on motherboard
pcibios: BIOS version 2.10
Using $PIR table, 14 entries at 0xc00fdeb0
ACPI-1287: *** Error: Method execution failed [\\_SB_.PCI0.LPC_.FDC_._INI] (Node 0xc32e2020), AE_NOT_EXIST
ACPI-1287: *** Error: Method execution failed [\\_SB_.PCI0.LPC_.EC__._INI] (Node 0xc32d8160), AE_NOT_EXIST
ACPI-1287: *** Error: Method execution failed [\\_SB_.PCI0.LPC_.EC__.BAT0._STA] (Node 0xc32da960), AE_NOT_EXIST
ACPI-0175: *** Error: Method execution failed [\\_SB_.PCI0.LPC_.EC__.BAT0._STA] (Node 0xc32da960), AE_NOT_EXIST
ACPI-1287: *** Error: Method execution failed [\\_SB_.PCI0.LPC_.EC__.BAT1._STA] (Node 0xc32da7e0), AE_NOT_EXIST

My current approach is to have a routine which is called early on (perhaps
by the probe for acpi0 so it is before the $PIR enumeration).  It finds
the ECDT and sets up temporary mappings for the command and data
registers.  These registers are 8 bit IO ports (0x66 and 0x62 usually but
the ECDT specifies these).  I need to be able to call bus_alloc_resource()
for those registers so that bus_space_read() can be used on them.

So my questions basically are:

1. What's the most proper place to call the ECDT attach routine?  (It's
currently device_identify but that's not quite right).  According to
takawata-san, the best place now is acpi_attach().  That seems ok to me.

2. What's the most proper way to enable access to the command and data
registers so early on, hopefully without bypassing newbus?

-Nate
Received on Mon Jul 14 2003 - 18:21:08 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:37:15 UTC