Kyösti Mälkki | 9116270 | 2011-11-03 15:22:01 +0200 | [diff] [blame] | 1 | /* |
| 2 | * This file is part of the coreboot project. |
| 3 | * |
| 4 | * Copyright (C) 2011 Kyösti Mälkki <kyosti.malkki@gmail.com> |
| 5 | * |
| 6 | * This program is free software; you can redistribute it and/or modify |
| 7 | * it under the terms of the GNU General Public License as published by |
| 8 | * the Free Software Foundation; version 2 of the License. |
| 9 | * |
| 10 | * This program is distributed in the hope that it will be useful, |
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 | * GNU General Public License for more details. |
Kyösti Mälkki | 9116270 | 2011-11-03 15:22:01 +0200 | [diff] [blame] | 14 | */ |
| 15 | |
Elyes HAOUAS | 1194999 | 2019-03-12 10:40:08 +0100 | [diff] [blame^] | 16 | #include <arch/ioapic.h> |
| 17 | |
Kyösti Mälkki | 9116270 | 2011-11-03 15:22:01 +0200 | [diff] [blame] | 18 | Name (PBRS, ResourceTemplate () |
| 19 | { |
| 20 | WordBusNumber (ResourceProducer, MinFixed, MaxFixed, PosDecode, |
| 21 | 0x0000, 0x0000, 0x00FF, 0x0000, 0x0100, ,, ) |
| 22 | |
| 23 | /* System IO */ |
| 24 | DWordIO (ResourceProducer, MinFixed, MaxFixed, PosDecode, EntireRange, |
| 25 | 0x0, 0x0, 0xffff, 0x0000, 0x10000, ,,, TypeStatic) |
| 26 | IO (Decode16, 0x0CF8, 0x0CF8, 0x08, 0x08, ) |
| 27 | |
| 28 | /* Video RAM */ |
| 29 | DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, Cacheable, ReadWrite, |
| 30 | 0x00000000, 0x000A0000, 0x000BFFFF, |
| 31 | 0x00000000, 0x00020000, ,,, AddressRangeMemory, TypeStatic) |
| 32 | |
| 33 | /* Video ROM */ |
| 34 | DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, Cacheable, ReadWrite, |
| 35 | 0x00000000, 0x000C0000, 0x000C7FFF, |
| 36 | 0x00000000, 0x00008000, ,,, AddressRangeMemory, TypeStatic) |
| 37 | |
| 38 | /* Option ROMs ? */ |
| 39 | DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, Cacheable, ReadWrite, |
| 40 | 0x00000000, 0x000C8000, 0x000DFFFF, |
| 41 | 0x00000000, 0x00018000, ,,, AddressRangeMemory, TypeStatic) |
| 42 | |
| 43 | /* Top Of Lowmemory to IOAPIC */ |
| 44 | DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, Cacheable, ReadWrite, |
Kyösti Mälkki | 3aff1a3 | 2012-04-11 12:19:03 +0300 | [diff] [blame] | 45 | 0x00000000, 0x00000000, 0xFEBFFFFF, |
| 46 | 0x00000000, IO_APIC_ADDR, ,, _Y08, AddressRangeMemory, TypeStatic) |
Kyösti Mälkki | 9116270 | 2011-11-03 15:22:01 +0200 | [diff] [blame] | 47 | }) |
| 48 | |
| 49 | |
| 50 | Method (_CRS, 0, NotSerialized) |
| 51 | { |
| 52 | |
| 53 | /* Top Of Lowmemory to IOAPIC */ |
| 54 | CreateDWordField (PBRS, \_SB.PCI0._Y08._MIN, MEML) |
Kyösti Mälkki | 3aff1a3 | 2012-04-11 12:19:03 +0300 | [diff] [blame] | 55 | CreateDWordField (PBRS, \_SB.PCI0._Y08._MAX, MEMH) |
Kyösti Mälkki | 9116270 | 2011-11-03 15:22:01 +0200 | [diff] [blame] | 56 | CreateDWordField (PBRS, \_SB.PCI0._Y08._LEN, LENM) |
| 57 | And (\_SB.PCI0.TOLM, 0xF800, Local1) |
| 58 | ShiftRight (Local1, 0x04, Local1) |
| 59 | ShiftLeft (Local1, 0x14, MEML) |
Kyösti Mälkki | 3aff1a3 | 2012-04-11 12:19:03 +0300 | [diff] [blame] | 60 | Subtract (IO_APIC_ADDR, 0x01, MEMH) |
| 61 | Subtract (IO_APIC_ADDR, MEML, LENM) |
Kyösti Mälkki | 9116270 | 2011-11-03 15:22:01 +0200 | [diff] [blame] | 62 | |
| 63 | Return (PBRS) |
| 64 | } |
| 65 | |
| 66 | Method (_STA, 0, NotSerialized) |
| 67 | { |
| 68 | Return (0x0F) |
| 69 | } |