| 1 |
/* SPDX-License-Identifier: GPL-2.0-only */ |
| 2 |
|
| 3 |
#include <arch/vga.h> |
| 4 |
|
| 5 |
/* System Bus */ |
| 6 |
/* _SB.PCI0 */ |
| 7 |
|
| 8 |
/* Operating System Capabilities Method */ |
| 9 |
Method(_OSC,4) |
| 10 |
{ |
| 11 |
/* Check for proper PCI/PCIe UUID */ |
| 12 |
If (Arg0 == ToUUID("33DB4D5B-1FF7-401C-9657-7441C03DD766")) |
| 13 |
{ |
| 14 |
/* Let OS control everything */ |
| 15 |
Return (Arg3) |
| 16 |
} Else { |
| 17 |
CreateDWordField(Arg3,0,CDW1) |
| 18 |
CDW1 |= 4 // Unrecognized UUID |
| 19 |
Return (Arg3) |
| 20 |
} |
| 21 |
} |
| 22 |
|
| 23 |
/* Describe the Southbridge devices */ |
| 24 |
|
| 25 |
/* 0:11.0 - SATA */ |
| 26 |
Device(STCR) { |
| 27 |
Name(_ADR, 0x00110000) |
| 28 |
} /* end STCR */ |
| 29 |
|
| 30 |
/* 0:14.0 - SMBUS */ |
| 31 |
Device(SBUS) { |
| 32 |
Name(_ADR, 0x00140000) |
| 33 |
} /* end SBUS */ |
| 34 |
|
| 35 |
#include "usb.asl" |
| 36 |
|
| 37 |
/* 0:14.2 - HD Audio */ |
| 38 |
#if !CONFIG(SOUTHBRIDGE_AMD_PI_KERN) |
| 39 |
#include "audio.asl" |
| 40 |
#endif |
| 41 |
|
| 42 |
/* 0:14.3 - LPC */ |
| 43 |
#include "lpc.asl" |
| 44 |
|
| 45 |
/* 0:14.7 - SD Controller */ |
| 46 |
Device(SDCN) { |
| 47 |
Name(_ADR, 0x00140007) |
| 48 |
} /* end SDCN */ |
| 49 |
|
| 50 |
Name(CRES, ResourceTemplate() { |
| 51 |
/* Set the Bus number and Secondary Bus number for the PCI0 device |
| 52 |
* The Secondary bus range for PCI0 lets the system |
| 53 |
* know what bus values are allowed on the downstream |
| 54 |
* side of this PCI bus if there is a PCI-PCI bridge. |
| 55 |
* PCI buses can have 256 secondary buses which |
| 56 |
* range from [0-0xFF] but they do not need to be |
| 57 |
* sequential. |
| 58 |
*/ |
| 59 |
WordBusNumber (ResourceProducer, MinFixed, MaxFixed, PosDecode, |
| 60 |
0x0000, /* address granularity */ |
| 61 |
0x0000, /* range minimum */ |
| 62 |
0x00FF, /* range maximum */ |
| 63 |
0x0000, /* translation */ |
| 64 |
0x0100, /* length */ |
| 65 |
,, PSB0) /* ResourceSourceIndex, ResourceSource, DescriptorName */ |
| 66 |
|
| 67 |
IO(Decode16, 0x0CF8, 0x0CF8, 1, 8) |
| 68 |
|
| 69 |
WORDIO(ResourceProducer, MinFixed, MaxFixed, PosDecode, EntireRange, |
| 70 |
0x0000, /* address granularity */ |
| 71 |
0x0000, /* range minimum */ |
| 72 |
0x0CF7, /* range maximum */ |
| 73 |
0x0000, /* translation */ |
| 74 |
0x0CF8 /* length */ |
| 75 |
) |
| 76 |
WORDIO(ResourceProducer, MinFixed, MaxFixed, PosDecode, EntireRange, |
| 77 |
0x0000, /* address granularity */ |
| 78 |
0x03B0, /* range minimum */ |
| 79 |
0x03DF, /* range maximum */ |
| 80 |
0x0000, /* translation */ |
| 81 |
0x0030 /* length */ |
| 82 |
) |
| 83 |
|
| 84 |
WORDIO(ResourceProducer, MinFixed, MaxFixed, PosDecode, EntireRange, |
| 85 |
0x0000, /* address granularity */ |
| 86 |
0x0D00, /* range minimum */ |
| 87 |
0xFFFF, /* range maximum */ |
| 88 |
0x0000, /* translation */ |
| 89 |
0xF300 /* length */ |
| 90 |
) |
| 91 |
|
| 92 |
Memory32Fixed(READONLY, VGA_MMIO_BASE, VGA_MMIO_SIZE, VGAM) /* VGA memory space */ |
| 93 |
Memory32Fixed(READONLY, 0x000C0000, 0x00020000, EMM1) /* Assume C0000-E0000 empty */ |
| 94 |
|
| 95 |
/* memory space for PCI BARs below 4GB */ |
| 96 |
Memory32Fixed(ReadOnly, 0x00000000, 0x00000000, MMIO) |
| 97 |
}) /* End Name(_SB.PCI0.CRES) */ |
| 98 |
|
| 99 |
Method(_CRS, 0) { |
| 100 |
/* DBGO("\\_SB\\PCI0\\_CRS\n") */ |
| 101 |
CreateDWordField(CRES, ^MMIO._BAS, MM1B) |
| 102 |
CreateDWordField(CRES, ^MMIO._LEN, MM1L) |
| 103 |
|
| 104 |
/* |
| 105 |
* Declare memory between TOM1 and 4GB as available |
| 106 |
* for PCI MMIO. |
| 107 |
* Use ShiftLeft to avoid 64bit constant (for XP). |
| 108 |
* This will work even if the OS does 32bit arithmetic, as |
| 109 |
* 32bit (0x00000000 - TOM1) will wrap and give the same |
| 110 |
* result as 64bit (0x100000000 - TOM1). |
| 111 |
*/ |
| 112 |
MM1B = TOM1 |
| 113 |
Local0 = 0x10000000 << 4 |
| 114 |
Local0 -= TOM1 |
| 115 |
MM1L = Local0 |
| 116 |
|
| 117 |
Return (CRES) /* note to change the Name buffer */ |
| 118 |
} /* end of Method(_SB.PCI0._CRS) */ |
| 119 |
|
| 120 |
#if CONFIG(HUDSON_IMC_FWM) |
| 121 |
/* TODO: It is unstable. |
| 122 |
* might be fixed by restructuring |
| 123 |
*/ |
| 124 |
#include "acpi/AmdImc.asl" /* Hudson IMC function */ |
| 125 |
#endif |
| 126 |
|
| 127 |
/* |
| 128 |
* |
| 129 |
* FIRST METHOD CALLED UPON BOOT |
| 130 |
* |
| 131 |
* 1. If debugging, print current OS and ACPI interpreter. |
| 132 |
* 2. Get PCI Interrupt routing from ACPI VSM, this |
| 133 |
* value is based on user choice in BIOS setup. |
| 134 |
*/ |
| 135 |
Method(_INI, 0) { |
| 136 |
/* DBGO("\\_SB\\_INI\n") */ |
| 137 |
/* DBGO(" DSDT.ASL code from ") */ |
| 138 |
/* DBGO(__DATE__) */ |
| 139 |
/* DBGO(" ") */ |
| 140 |
/* DBGO(__TIME__) */ |
| 141 |
/* DBGO("\n Sleep states supported: ") */ |
| 142 |
/* DBGO("\n") */ |
| 143 |
/* DBGO(" \\_OS=") */ |
| 144 |
/* DBGO(\_OS) */ |
| 145 |
/* DBGO("\n \\_REV=") */ |
| 146 |
/* DBGO(\_REV) */ |
| 147 |
/* DBGO("\n") */ |
| 148 |
|
| 149 |
} /* End Method(_SB._INI) */ |