Tobias Diedrich | e87c38e | 2010-11-27 09:40:16 +0000 | [diff] [blame] | 1 | /* |
| 2 | * This file is part of the coreboot project. |
| 3 | * |
Tobias Diedrich | e87c38e | 2010-11-27 09:40:16 +0000 | [diff] [blame] | 4 | * |
| 5 | * This program is free software; you can redistribute it and/or modify |
| 6 | * it under the terms of the GNU General Public License as published by |
| 7 | * the Free Software Foundation; version 2 of the License. |
| 8 | * |
| 9 | * This program is distributed in the hope that it will be useful, |
| 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 | * GNU General Public License for more details. |
Tobias Diedrich | e87c38e | 2010-11-27 09:40:16 +0000 | [diff] [blame] | 13 | */ |
| 14 | |
| 15 | /* i440bx Northbridge */ |
| 16 | Device (NB) |
| 17 | { |
| 18 | Name(_ADR, 0x00000000) |
| 19 | OperationRegion(PCIC, PCI_Config, 0x00, 0x100) |
| 20 | } |
| 21 | |
| 22 | Field (NB.PCIC, AnyAcc, NoLock, Preserve) |
| 23 | { |
| 24 | Offset (0x67), // DRB7 |
| 25 | DRB7, 8, |
| 26 | } |
| 27 | |
| 28 | Method(TOM1, 0) { |
| 29 | /* Multiply by 8MB to get TOM */ |
| 30 | Return(ShiftLeft(DRB7, 23)) |
| 31 | } |
| 32 | |
| 33 | Method(_CRS, 0) { |
| 34 | Name(TMP, ResourceTemplate() { |
| 35 | WordBusNumber(ResourceProducer, MinFixed, MaxFixed, PosDecode, |
| 36 | 0x0000, // Granularity |
| 37 | 0x0000, // Range Minimum |
| 38 | 0x00FF, // Range Maximum |
| 39 | 0x0000, // Translation Offset |
| 40 | 0x0100, // Length |
| 41 | ,, |
| 42 | ) |
| 43 | IO(Decode16, 0x0CF8, 0x0CF8, 1, 8) |
| 44 | |
| 45 | WORDIO(ResourceProducer, MinFixed, MaxFixed, PosDecode, EntireRange, |
| 46 | 0x0000, /* address granularity */ |
| 47 | 0x0000, /* range minimum */ |
| 48 | 0x0CF7, /* range maximum */ |
| 49 | 0x0000, /* translation */ |
| 50 | 0x0CF8 /* length */ |
| 51 | ) |
| 52 | |
| 53 | WORDIO(ResourceProducer, MinFixed, MaxFixed, PosDecode, EntireRange, |
| 54 | 0x0000, /* address granularity */ |
| 55 | 0x0D00, /* range minimum */ |
| 56 | 0xFFFF, /* range maximum */ |
| 57 | 0x0000, /* translation */ |
| 58 | 0xF300 /* length */ |
| 59 | ) |
| 60 | |
| 61 | /* memory space for PCI BARs below 4GB */ |
| 62 | Memory32Fixed(ReadOnly, 0x00000000, 0x00000000, MMIO) |
| 63 | }) |
| 64 | CreateDWordField(TMP, MMIO._BAS, MM1B) |
| 65 | CreateDWordField(TMP, MMIO._LEN, MM1L) |
| 66 | /* |
| 67 | * Declare memory between TOM1 and 4GB as available |
| 68 | * for PCI MMIO. |
| 69 | * |
| 70 | * Use ShiftLeft to avoid 64bit constant (for XP). |
| 71 | * This will work even if the OS does 32bit arithmetic, as |
| 72 | * 32bit (0x00000000 - TOM1) will wrap and give the same |
| 73 | * result as 64bit (0x100000000 - TOM1). |
| 74 | */ |
| 75 | Store(TOM1, MM1B) |
| 76 | ShiftLeft(0x10000000, 4, Local0) |
| 77 | Subtract(Local0, TOM1, Local0) |
| 78 | Store(Local0, MM1L) |
| 79 | |
| 80 | Return(TMP) |
| 81 | } |