blob: 620799cf2be42ff9ab88766c90f2c7d8ea7828ea [file] [log] [blame]
Kyösti Mälkki91162702011-11-03 15:22:01 +02001/*
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älkki91162702011-11-03 15:22:01 +020014 */
15
Elyes HAOUAS11949992019-03-12 10:40:08 +010016#include <arch/ioapic.h>
17
Kyösti Mälkki91162702011-11-03 15:22:01 +020018Name (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älkki3aff1a32012-04-11 12:19:03 +030045 0x00000000, 0x00000000, 0xFEBFFFFF,
46 0x00000000, IO_APIC_ADDR, ,, _Y08, AddressRangeMemory, TypeStatic)
Kyösti Mälkki91162702011-11-03 15:22:01 +020047})
48
49
50Method (_CRS, 0, NotSerialized)
51{
52
53 /* Top Of Lowmemory to IOAPIC */
54 CreateDWordField (PBRS, \_SB.PCI0._Y08._MIN, MEML)
Kyösti Mälkki3aff1a32012-04-11 12:19:03 +030055 CreateDWordField (PBRS, \_SB.PCI0._Y08._MAX, MEMH)
Kyösti Mälkki91162702011-11-03 15:22:01 +020056 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älkki3aff1a32012-04-11 12:19:03 +030060 Subtract (IO_APIC_ADDR, 0x01, MEMH)
61 Subtract (IO_APIC_ADDR, MEML, LENM)
Kyösti Mälkki91162702011-11-03 15:22:01 +020062
63 Return (PBRS)
64}
65
66Method (_STA, 0, NotSerialized)
67{
68 Return (0x0F)
69}