summaryrefslogtreecommitdiffstats
path: root/src/northbridge/intel/i440bx/acpi/sb_pci0_crs.asl
blob: 856b3e83f22bbdba4e69f6ad345d72fa0c567ab4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
/* SPDX-License-Identifier: GPL-2.0-only */
/* This file is part of the coreboot project. */

/* i440bx Northbridge */
Device (NB)
{
	Name(_ADR, 0x00000000)
	OperationRegion(PCIC, PCI_Config, 0x00, 0x100)
}

Field (NB.PCIC, AnyAcc, NoLock, Preserve)
{
	Offset (0x67),	// DRB7
	DRB7,	8,
}

Method(TOM1, 0) {
	/* Multiply by 8MB to get TOM */
	Return(ShiftLeft(DRB7, 23))
}

Method(_CRS, 0) {
	Name(TMP, ResourceTemplate() {
		WordBusNumber(ResourceProducer, MinFixed, MaxFixed, PosDecode,
			0x0000,             // Granularity
			0x0000,             // Range Minimum
			0x00FF,             // Range Maximum
			0x0000,             // Translation Offset
			0x0100,             // Length
			,,
		)
		IO(Decode16, 0x0CF8, 0x0CF8, 1, 8)

		WORDIO(ResourceProducer, MinFixed, MaxFixed, PosDecode, EntireRange,
			0x0000,			/* address granularity */
			0x0000,			/* range minimum */
			0x0CF7,			/* range maximum */
			0x0000,			/* translation */
			0x0CF8			/* length */
		)

		WORDIO(ResourceProducer, MinFixed, MaxFixed, PosDecode, EntireRange,
			0x0000,			/* address granularity */
			0x0D00,			/* range minimum */
			0xFFFF,			/* range maximum */
			0x0000,			/* translation */
			0xF300			/* length */
		)

		/* memory space for PCI BARs below 4GB */
		Memory32Fixed(ReadOnly, 0x00000000, 0x00000000, MMIO)
	})
	CreateDWordField(TMP, MMIO._BAS, MM1B)
	CreateDWordField(TMP, MMIO._LEN, MM1L)
	/*
	 * Declare memory between TOM1 and 4GB as available
	 * for PCI MMIO.
	 *
	 * Use ShiftLeft to avoid 64bit constant (for XP).
	 * This will work even if the OS does 32bit arithmetic, as
	 * 32bit (0x00000000 - TOM1) will wrap and give the same
	 * result as 64bit (0x100000000 - TOM1).
	 */
	Store(TOM1, MM1B)
	ShiftLeft(0x10000000, 4, Local0)
	Subtract(Local0, TOM1, Local0)
	Store(Local0, MM1L)

	Return(TMP)
}