diff options
author | Patrick Georgi <patrick.georgi@coresystems.de> | 2010-02-08 15:46:37 +0000 |
---|---|---|
committer | Patrick Georgi <patrick.georgi@coresystems.de> | 2010-02-08 15:46:37 +0000 |
commit | af97d33ec426b9414133fd82d958cf9ab52a390f (patch) | |
tree | d99f6480914df848dabb0ec197864e0c8f64d939 /src/mainboard/via/epia-n/acpi/irq_links.asl | |
parent | 0e92974904703272b55d66dc4959d95adba6f30c (diff) | |
download | coreboot-af97d33ec426b9414133fd82d958cf9ab52a390f.tar.xz |
Clean up ACPI:
- unify all iasl related rules into the toplevel Makefile
- build a filesystem standard for ACPI files and use it
- pass ACPI sources through cpp, so constants can be shared
between C and ACPI more easily
- use cpp's #include instead of ACPI's Include() so cpp gets
the whole picture
Signed-off-by: Patrick Georgi <patrick.georgi@coresystems.de>
Acked-by: Stefan Reinauer <stepan@coresystems.de>
git-svn-id: svn://svn.coreboot.org/coreboot/trunk@5094 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'src/mainboard/via/epia-n/acpi/irq_links.asl')
-rw-r--r-- | src/mainboard/via/epia-n/acpi/irq_links.asl | 571 |
1 files changed, 571 insertions, 0 deletions
diff --git a/src/mainboard/via/epia-n/acpi/irq_links.asl b/src/mainboard/via/epia-n/acpi/irq_links.asl new file mode 100644 index 0000000000..fc93e760b5 --- /dev/null +++ b/src/mainboard/via/epia-n/acpi/irq_links.asl @@ -0,0 +1,571 @@ +/* + * Minimalist ACPI DSDT table for EPIA-N / NL + * Basic description of PCI Interrupt Assignments. + * This is expected to be included into _SB.PCI0 namespace + * (C) Copyright 2009 Jon Harrison <jon.harrison@blueyonder.co.uk> + * + */ + + /* PCI PnP Routing Links */ + + /* Define how interrupt Link A is plumbed in */ + Device (LNKA) + { + Name (_HID, EisaId ("PNP0C0F")) + Name (_UID, 0x01) + /* Status - always return ready */ + Method (_STA, 0, NotSerialized) + { + /* See If Coreboot has allocated INTA# */ + And (PIRA, 0xF0, Local0) + If (LEqual (Local0, 0x00)) + { + Return (0x09) + } + Else + { + Return (0x0B) + } + } + + Method (_PRS, 0, NotSerialized) + { + Name (BUFA, ResourceTemplate () + { + IRQ (Level, ActiveLow, Shared, ) + {3,4,6,7,10,11,12} + }) + Return (BUFA) + } + + Method (_CRS, 0, NotSerialized) + { + Name (BUFA, ResourceTemplate () + { + IRQ (Level, ActiveLow, Shared, _Y07) + {} + }) + /* Read the Binary Encoded Field and Map this */ + /* onto the bitwise _INT field in the IRQ descriptor */ + /* See ACPI Spec for detail of _IRQ Descriptor */ + CreateByteField (BUFA, \_SB.PCI0.LNKA._CRS._Y07._INT, IRA1) + CreateByteField (BUFA, 0x02, IRA2) + Store (0x00, Local3) + Store (0x00, Local4) + And (PIRA, 0xF0, Local1) + ShiftRight (Local1, 0x04, Local1) + If (LNotEqual (Local1, 0x00)) + { + If (LGreater (Local1, 0x07)) + { + Subtract (Local1, 0x08, Local2) + ShiftLeft (One, Local2, Local4) + } + Else + { + If (LGreater (Local1, 0x00)) + { + ShiftLeft (One, Local1, Local3) + } + } + + Store (Local3, IRA1) + Store (Local4, IRA2) + } + Return (BUFA) + } + + /* Set Resources - dummy function to keep Linux ACPI happy + * Linux is more than happy not to tinker with irq + * assignments as long as the CRS and STA functions + * return good values + */ + Method (_SRS, 1, NotSerialized) {} + /* Disable - Set PnP Routing Reg to 0 */ + Method (_DIS, 0, NotSerialized ) + { + And (PIRA, 0x0F, PIRA) + } + } // End of LNKA + + Device (LNKB) + { + Name (_HID, EisaId ("PNP0C0F")) + Name (_UID, 0x02) + Method (_STA, 0, NotSerialized) + { + /* See If Coreboot has allocated INTB# */ + And (PIBC, 0x0F, Local0) + If (LEqual (Local0, 0x00)) + { + Return (0x09) + } + Else + { + Return (0x0B) + } + } + + Method (_PRS, 0, NotSerialized) + { + Name (BUFB, ResourceTemplate () + { + IRQ (Level, ActiveLow, Shared, ) + {3,4,6,7,10,11,12} + }) + Return (BUFB) + } + + Method (_CRS, 0, NotSerialized) + { + Name (BUFB, ResourceTemplate () + { + IRQ (Level, ActiveLow, Shared, _Y08) + {} + }) + /* Read the Binary Encoded Field and Map this */ + /* onto the bitwise _INT field in the IRQ descriptor */ + /* See ACPI Spec for detail of _IRQ Descriptor */ + CreateByteField (BUFB, \_SB.PCI0.LNKB._CRS._Y08._INT, IRB1) + CreateByteField (BUFB, 0x02, IRB2) + Store (0x00, Local3) + Store (0x00, Local4) + And (PIBC, 0x0F, Local1) + If (LNotEqual (Local1, 0x00)) + { + If (LGreater (Local1, 0x07)) + { + Subtract (Local1, 0x08, Local2) + ShiftLeft (One, Local2, Local4) + } + Else + { + If (LGreater (Local1, 0x00)) + { + ShiftLeft (One, Local1, Local3) + } + } + + Store (Local3, IRB1) + Store (Local4, IRB2) + } + Return (BUFB) + } + + /* Set Resources - dummy function to keep Linux ACPI happy + * Linux is more than happy not to tinker with irq + * assignments as long as the CRS and STA functions + * return good values + */ + Method (_SRS, 1, NotSerialized) {} + /* Disable - Set PnP Routing Reg to 0 */ + Method (_DIS, 0, NotSerialized ) + { + And (PIBC, 0xF0, PIBC) + } + + } // End of LNKB + + Device (LNKC) + { + Name (_HID, EisaId ("PNP0C0F")) + Name (_UID, 0x03) + Method (_STA, 0, NotSerialized) + { + /* See If Coreboot has allocated INTC# */ + And (PIBC, 0xF0, Local0) + If (LEqual (Local0, 0x00)) + { + Return (0x09) + } + Else + { + Return (0x0B) + } + } + + Method (_PRS, 0, NotSerialized) + { + Name (BUFC, ResourceTemplate () + { + IRQ (Level, ActiveLow, Shared, ) + {3,4,6,7,10,11,12} + }) + Return (BUFC) + } + + Method (_CRS, 0, NotSerialized) + { + Name (BUFC, ResourceTemplate () + { + IRQ (Level, ActiveLow, Shared, _Y09) + {} + }) + /* Read the Binary Encoded Field and Map this */ + /* onto the bitwise _INT field in the IRQ descriptor */ + /* See ACPI Spec for detail of _IRQ Descriptor */ + CreateByteField (BUFC, \_SB.PCI0.LNKC._CRS._Y09._INT, IRC1) + CreateByteField (BUFC, 0x02, IRC2) + Store (0x00, Local3) + Store (0x00, Local4) + And (PIBC, 0xF0, Local1) + ShiftRight (Local1, 0x04, Local1) + If (LNotEqual (Local1, 0x00)) + { + If (LGreater (Local1, 0x07)) + { + Subtract (Local1, 0x08, Local2) + ShiftLeft (One, Local2, Local4) + } + Else + { + If (LGreater (Local1, 0x00)) + { + ShiftLeft (One, Local1, Local3) + } + } + + Store (Local3, IRC1) + Store (Local4, IRC2) + } + Return (BUFC) + } + + /* Set Resources - dummy function to keep Linux ACPI happy + * Linux is more than happy not to tinker with irq + * assignments as long as the CRS and STA functions + * return good values + */ + Method (_SRS, 1, NotSerialized) {} + /* Disable - Set PnP Routing Reg to 0 */ + Method (_DIS, 0, NotSerialized ) + { + And (PIBC, 0x0F, PIBC) + } + +} // End of LNKC + +Device (LNKD) +{ + Name (_HID, EisaId ("PNP0C0F")) + Name (_UID, 0x04) + Method (_STA, 0, NotSerialized) + { + /* See If Coreboot has allocated INTD# */ + And (PIRD, 0xF0, Local0) + If (LEqual (Local0, 0x00)) + { + Return (0x09) + } + Else + { + Return (0x0B) + } + } + + Method (_PRS, 0, NotSerialized) + { + Name (BUFD, ResourceTemplate () + { + IRQ (Level, ActiveLow, Shared, ) + {3,4,6,7,10,11,12} + }) + Return (BUFD) + } + + Method (_CRS, 0, NotSerialized) + { + Name (BUFD, ResourceTemplate () + { + IRQ (Level, ActiveLow, Shared, _Y0A) + {} + }) + /* Read the Binary Encoded Field and Map this */ + /* onto the bitwise _INT field in the IRQ descriptor */ + /* See ACPI Spec for detail of _IRQ Descriptor */ + CreateByteField (BUFD, \_SB.PCI0.LNKD._CRS._Y0A._INT, IRD1) + CreateByteField (BUFD, 0x02, IRD2) + Store (0x00, Local3) + Store (0x00, Local4) + And (PIRD, 0xF0, Local1) + ShiftRight (Local1, 0x04, Local1) + If (LNotEqual (Local1, 0x00)) + { + If (LGreater (Local1, 0x07)) + { + Subtract (Local1, 0x08, Local2) + ShiftLeft (One, Local2, Local4) + } + Else + { + If (LGreater (Local1, 0x00)) + { + ShiftLeft (One, Local1, Local3) + } + } + + Store (Local3, IRD1) + Store (Local4, IRD2) + } + Return (BUFD) + } + + /* Set Resources - dummy function to keep Linux ACPI happy + * Linux is more than happy not to tinker with irq + * assignments as long as the CRS and STA functions + * return good values + */ + Method (_SRS, 1, NotSerialized) {} + /* Disable - Set PnP Routing Reg to 0 */ + Method (_DIS, 0, NotSerialized ) + { + And (PIRD, 0x0F, PIRD) + } + +} // End of LNKD + + +/* APIC IRQ Links */ + +Device (ATAI) +{ + Name (_HID, EisaId ("PNP0C0F")) + Name (_UID, 0x05) + Method (_STA, 0, NotSerialized) + { + /* ATFL == 0x02 if SATA Enabled */ + If (LNotEqual (ATFL, 0x02)) + { + /* Double Check By Reading SATA VID */ + /* Otherwise Compatibility Mode */ + If (LNotEqual (\_SB.PCI0.SATA.VID, 0x1106)) + { + Return (0x09) + } + Else + { + Return (0x0B) + } + } + Else + { + /* Serial ATA Enabled Check if PATA is in */ + /* Compatibility Mode */ + If (LEqual (\_SB.PCI0.PATA.ENAT, 0x0A)) + { + Return (0x09) + } + Else + { + Return (0x0B) + } + } + } + + Method (_PRS, 0, NotSerialized) + { + Name (ATAN, ResourceTemplate () + { + Interrupt (ResourceConsumer, Level, ActiveLow, Shared, ,, ) + { + 0x00000014, + } + }) + Return (ATAN) + } + + Method (_CRS, 0, NotSerialized) + { + Name (ATAB, ResourceTemplate () + { + Interrupt (ResourceConsumer, Level, ActiveLow, Shared, ,, _Y10) + { + 0x00000000, + } + }) + CreateByteField (ATAB, \_SB.PCI0.ATAI._CRS._Y10._INT, IRAI) + Store (0x14, IRAI) + Return (ATAB) + + } + + /* Set Resources - dummy function to keep Linux ACPI happy + * Linux is more than happy not to tinker with irq + * assignments as long as the CRS and STA functions + * return good values + */ + Method (_SRS, 1, NotSerialized) {} + /* Disable - dummy function to keep Linux ACPI happy */ + Method (_DIS, 0, NotSerialized ) {} + +} // End of ATA Interface Link + + +Device (USBI) +{ + Name (_HID, EisaId ("PNP0C0F")) + Name (_UID, 0x0A) + Method (_STA, 0, NotSerialized) + { + /* Check that at least one of the USB */ + /* functions is enabled */ + And (IDEB, 0x37, Local0) + If (LEqual (Local0, 0x37)) + { + Return (0x09) + } + Else + { + Return (0x0B) + } + } + + Method (_PRS, 0, NotSerialized) + { + Name (USBB, ResourceTemplate () + { + Interrupt (ResourceConsumer, Level, ActiveLow, Shared, ,, ) + { + 0x00000015, + } + }) + + Return(USBB) + } + + Method (_CRS, 0, NotSerialized) + { + Name (USBB, ResourceTemplate () + { + Interrupt (ResourceConsumer, Level, ActiveLow, Shared, ,, _Y12) + { + 0x00000000, + } + }) + CreateByteField (USBB, \_SB.PCI0.USBI._CRS._Y12._INT, IRBI) + Store (0x15, IRBI) + Return (USBB) + } + + + /* Set Resources - dummy function to keep Linux ACPI happy + * Linux is more than happy not to tinker with irq + * assignments as long as the CRS and STA functions + * return good values + */ + Method (_SRS, 1, NotSerialized) {} + /* Disable - dummy function to keep Linux ACPI happy */ + Method (_DIS, 0, NotSerialized ) {} +} + +Device (VT8I) +{ + Name (_HID, EisaId ("PNP0C0F")) + Name (_UID, 0x0B) + Method (_STA, 0, NotSerialized) + { + /* Check Whether Sound and/or Modem are Activated */ + If (LEqual (EAMC, 0x03)) + { + Return (0x09) + } + Else + { + Return (0x0B) + } + } + + Method (_PRS, 0, NotSerialized) + { + Name (A97C, ResourceTemplate () + { + Interrupt (ResourceConsumer, Level, ActiveLow, Shared, ,, ) + { + 0x00000016, + } + }) + Return (A97C) + } + + Method (_CRS, 0, NotSerialized) + { + Name (A97B, ResourceTemplate () + { + Interrupt (ResourceConsumer, Level, ActiveLow, Shared, ,, _Y14) + { + 0x00000000, + } + }) + CreateByteField (A97B, \_SB.PCI0.VT8I._CRS._Y14._INT, IRCI) + Store (0x16, IRCI) + Return (A97B) + } + + /* Set Resources - dummy function to keep Linux ACPI happy + * Linux is more than happy not to tinker with irq + * assignments as long as the CRS and STA functions + * return good values + */ + Method (_SRS, 1, NotSerialized) {} + /* Disable - dummy function to keep Linux ACPI happy */ + Method (_DIS, 0, NotSerialized ) {} + +} + + +Device (NICI) +{ + Name (_HID, EisaId ("PNP0C0F")) + Name (_UID, 0x0C) + Method (_STA, 0, NotSerialized) + { + /* Check if LAN Function is Enabled */ + /* Note that LAN Enable Polarity is different */ + /* from other functions in VT8237R !? */ + If (LEqual (ELAN, 0x00)) + { + Return (0x09) + } + Else + { + Return (0x0B) + } + } + + Method (_PRS, 0, NotSerialized) + { + Name (NICB, ResourceTemplate () + { + Interrupt (ResourceConsumer, Level, ActiveLow, Shared, ,, ) + { + 0x00000017, + } + }) + Return (NICB) + } + + Method (_CRS, 0, NotSerialized) + { + Name (NICD, ResourceTemplate () + { + Interrupt (ResourceConsumer, Level, ActiveLow, Shared, ,, _Y16) + { + 0x00000000, + } + }) + CreateByteField (NICD, \_SB.PCI0.NICI._CRS._Y16._INT, IRDI) + Store (0x17, IRDI) + Return (NICD) + } + + /* Set Resources - dummy function to keep Linux ACPI happy + * Linux is more than happy not to tinker with irq + * assignments as long as the CRS and STA functions + * return good values + */ + Method (_SRS, 1, NotSerialized) {} + /* Disable - dummy function to keep Linux ACPI happy */ + Method (_DIS, 0, NotSerialized ) {} + + +} |