public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
* How ACPI is actually implemented?
@ 2006-11-26 17:35 Eric Benton
  2006-11-27  5:55 ` Len Brown
  0 siblings, 1 reply; 13+ messages in thread
From: Eric Benton @ 2006-11-26 17:35 UTC (permalink / raw)
  To: linux-acpi

Hi,

I'm trying to figure out how ACPI is implemented, I don't know if this
list is the right one to ask but I'm sure there are kind people in
this place that will help me in my quest :)
I tried to look for resources but I couldn't find too many. I'm
interested to know how ACPI works in the hardware level... so, after a
lot of reading I left with these questions, any knowledge provided is
greatly appreciated.

By looking at /proc/irq and /proc/ioports I can see that ACPI is
allocated with IRQ9 and I/O ports 0x400-0x42F.
1. How does exactly a hardware device generates an event?
2. How does the OS asks a device to change it's state? what *exactly* happens?

I read that the BIOS supplies all the ACPI tables.
3. Are they are being built in compile time (this is what I understand
from the FAQ at Intel's website)?
4. What happens If a new PCI device is being added to the system, how
the DSDT is being updated? (If at all...)

I saw a note about an ACPI Controller.
5. What exactly is the role of this controller? How it operates? And who
6. In general, I'm looking to find out what is the role (in respect to
"talking with the hardware") of these entities: the driver, the
device, the OS (including the CA)? Who reads/writes to the I/O ports.
Who sets the IRQ? the controller? or is it the device itself? What
happens exactly?

I tried reading the ACPI spec, but it's 600+ pages that doesn't answer
these questions...

Thanks in advance,
Eric.

^ permalink raw reply	[flat|nested] 13+ messages in thread
* RE: How ACPI is actually implemented?
@ 2006-11-28  1:07 Yuan, Kein
  0 siblings, 0 replies; 13+ messages in thread
From: Yuan, Kein @ 2006-11-28  1:07 UTC (permalink / raw)
  To: Len Brown, Eric Benton; +Cc: linux-acpi

> eg. the SCI handler might run a GPE handler, which will run the _Lxx
> method in AML, which might send a Notify() to an AML device object.
> The OS might have registered a driver on that object which
> will receive the event and do some action, such as sending an event
> to user-space.  see button.c for an even simpler example.

The SCI handler, which will run a GPE handler as you said here,  Who is
belongs to? I mean, is it part of OS? Or BIOS?  ACPI spec seems says if
the OS is ACPI compatible and ACPI was enabled,  EC will trigger SCI,
then handled by OS otherwise it will trigger SMI which handled by BIOS,
is this true?

>> I read that the BIOS supplies all the ACPI tables.
>> 3. Are they are being built in compile time (this is what I
understand
>> from the FAQ at Intel's website)?

> the ACPI tables are built by the OEM and with an ASL->AML compiler
> and are burned into the BIOS.

Does it means every time if need to verify the ASL is correct or not,
you need to build the BIOS again and program the binary to FWH?   Is
there any quicker way to do that? Or in another words, what's the normal
way/steps to debug ASL?

Thanks,

Kein

^ permalink raw reply	[flat|nested] 13+ messages in thread
* RE: How ACPI is actually implemented?
@ 2006-11-28  1:19 Wu, Cody
  2006-11-28 11:37 ` Eric Benton
  0 siblings, 1 reply; 13+ messages in thread
From: Wu, Cody @ 2006-11-28  1:19 UTC (permalink / raw)
  To: Yuan, Kein, Len Brown, Eric Benton; +Cc: linux-acpi

Hi Kein,

>The SCI handler, which will run a GPE handler as you said here,  Who is
>belongs to? I mean, is it part of OS? Or BIOS?  ACPI spec seems says if
>the OS is ACPI compatible and ACPI was enabled,  EC will trigger SCI,
>then handled by OS otherwise it will trigger SMI which handled by BIOS,
>is this true?

GPE handler is provided by Bios originally in the form of AML. Os's AcPI
driver will parse it and link it to SCI interrupt processing. Whether EC
will trigger SCI or SMI depends on how you want it to be done as well as
what OS you are working with. For OS supporting ACPI it will enable ACPI
controller on the chipset and SCI will take precedence over SMI.

>Does it means every time if need to verify the ASL is correct or not,
>you need to build the BIOS again and program the binary to FWH?   Is
>there any quicker way to do that? Or in another words, what's the
normal
>way/steps to debug ASL?

This is the rawest form of debugging ACPI. However, different OS may
provide different strategies to facilitate this process. I don't know
how Linux handles this but on Windows they can enable you to muck about
this with Registry and WinDbg.

Best regards,
Cody

-----Original Message-----
From: linux-acpi-owner@vger.kernel.org
[mailto:linux-acpi-owner@vger.kernel.org] On Behalf Of Yuan, Kein
Sent: Tuesday, November 28, 2006 9:08 AM
To: Len Brown; Eric Benton
Cc: linux-acpi@vger.kernel.org
Subject: RE: How ACPI is actually implemented?

> eg. the SCI handler might run a GPE handler, which will run the _Lxx
> method in AML, which might send a Notify() to an AML device object.
> The OS might have registered a driver on that object which
> will receive the event and do some action, such as sending an event
> to user-space.  see button.c for an even simpler example.

The SCI handler, which will run a GPE handler as you said here,  Who is
belongs to? I mean, is it part of OS? Or BIOS?  ACPI spec seems says if
the OS is ACPI compatible and ACPI was enabled,  EC will trigger SCI,
then handled by OS otherwise it will trigger SMI which handled by BIOS,
is this true?

>> I read that the BIOS supplies all the ACPI tables.
>> 3. Are they are being built in compile time (this is what I
understand
>> from the FAQ at Intel's website)?

> the ACPI tables are built by the OEM and with an ASL->AML compiler
> and are burned into the BIOS.

Does it means every time if need to verify the ASL is correct or not,
you need to build the BIOS again and program the binary to FWH?   Is
there any quicker way to do that? Or in another words, what's the normal
way/steps to debug ASL?

Thanks,

Kein
-
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 13+ messages in thread
* RE: How ACPI is actually implemented?
@ 2006-11-29  1:22 Wu, Cody
  2006-11-29  7:05 ` Eric Benton
  0 siblings, 1 reply; 13+ messages in thread
From: Wu, Cody @ 2006-11-29  1:22 UTC (permalink / raw)
  To: Eric Benton; +Cc: Yuan, Kein, Len Brown, linux-acpi

Hi Eric,
>But, the thing is, I didn't see in any place
>that the actual USB1 device is being associated with the 3rd bit of
>this GPE register block. Is it defined in some other ACPI table or is
>it dectated by the system platform?

This is made stiff in the board hardware layout especially how it
connects onboard USB controller to the ACPI Chipset. You can find the
details illustrations such as which USB port is for which bit in the ICH
spec. 

Best regards,
Cody
-----Original Message-----
From: Eric Benton [mailto:benton71@gmail.com] 
Sent: Tuesday, November 28, 2006 7:37 PM
To: Wu, Cody
Cc: Yuan, Kein; Len Brown; linux-acpi@vger.kernel.org
Subject: Re: How ACPI is actually implemented?

Hi All,


On 11/28/06, Wu, Cody <cody.wu@intel.com> wrote:
> Hi Kein,
>
> >The SCI handler, which will run a GPE handler as you said here,  Who
is
> >belongs to? I mean, is it part of OS? Or BIOS?  ACPI spec seems says
if
> >the OS is ACPI compatible and ACPI was enabled,  EC will trigger SCI,
> >then handled by OS otherwise it will trigger SMI which handled by
BIOS,
> >is this true?
>
> GPE handler is provided by Bios originally in the form of AML. Os's
AcPI
> driver will parse it and link it to SCI interrupt processing. Whether
EC
> will trigger SCI or SMI depends on how you want it to be done as well
as
> what OS you are working with. For OS supporting ACPI it will enable
ACPI
> controller on the chipset and SCI will take precedence over SMI.
>

If we will go back again to the GPEs, In my DSDT (Lenovo Laptop),
under the _GPE scope, there is a method that assigns itself to the 3rd
bit of the GPE register block. It's code is the following:

Method (_L03, 0, NotSerialized)
{
    Notify (\_SB.PCI0.USB1, 0x02)
}

Now, it tells the OSPM to notify the native device driver of the USB1
device to Wake (0x02). But, the thing is, I didn't see in any place
that the actual USB1 device is being associated with the 3rd bit of
this GPE register block. Is it defined in some other ACPI table or is
it dectated by the system platform?

Thanks,
Eric.

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2006-11-29  7:05 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-11-26 17:35 How ACPI is actually implemented? Eric Benton
2006-11-27  5:55 ` Len Brown
2006-11-27 10:27   ` Eric Benton
2006-11-27 11:07     ` Takanori Watanabe
2006-11-27 13:21       ` Eric Benton
2006-11-27 11:18     ` Alexey Starikovskiy
2006-11-27 14:46       ` Eric Benton
2006-11-27 15:08         ` Alexey Starikovskiy
  -- strict thread matches above, loose matches on Subject: below --
2006-11-28  1:07 Yuan, Kein
2006-11-28  1:19 Wu, Cody
2006-11-28 11:37 ` Eric Benton
2006-11-29  1:22 Wu, Cody
2006-11-29  7:05 ` Eric Benton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox