blob: ed321f3e32aff434ac55b6dc67925e66ca96fbc5 [file] [log] [blame]
Angel Ponsae593872020-04-04 18:50:57 +02001/* SPDX-License-Identifier: GPL-2.0-only */
Martin Roth5c354b92019-04-22 14:55:16 -06002
Raul E Rangelc3d78462021-01-22 15:23:02 -07003#include <arch/ioapic.h>
4
Martin Roth5c354b92019-04-22 14:55:16 -06005External(\_SB.ALIB, MethodObj)
6
7/* System Bus */
8/* _SB.PCI0 */
9
10/* Operating System Capabilities Method */
11Method(_OSC,4)
12{
13 /* Check for proper PCI/PCIe UUID */
Elyes HAOUAS28b68ae2020-09-24 20:18:26 +020014 If (Arg0 == ToUUID("33DB4D5B-1FF7-401C-9657-7441C03DD766"))
Martin Roth5c354b92019-04-22 14:55:16 -060015 {
16 /* Let OS control everything */
17 Return (Arg3)
18 } Else {
19 CreateDWordField(Arg3,0,CDW1)
Elyes HAOUAS28b68ae2020-09-24 20:18:26 +020020 CDW1 |= 4 // Unrecognized UUID
21 Return (Arg3)
Martin Roth5c354b92019-04-22 14:55:16 -060022 }
23}
24
Martin Roth5c354b92019-04-22 14:55:16 -060025/* 0:14.3 - LPC */
26#include <soc/amd/common/acpi/lpc.asl>
Josie Nordrumda4d9da2020-10-22 17:50:20 -060027#include <soc/amd/common/acpi/platform.asl>
Martin Roth5c354b92019-04-22 14:55:16 -060028
Martin Roth5c354b92019-04-22 14:55:16 -060029Name(CRES, ResourceTemplate() {
30 /* Set the Bus number and Secondary Bus number for the PCI0 device
31 * The Secondary bus range for PCI0 lets the system
32 * know what bus values are allowed on the downstream
33 * side of this PCI bus if there is a PCI-PCI bridge.
34 * PCI busses can have 256 secondary busses which
35 * range from [0-0xFF] but they do not need to be
36 * sequential.
37 */
38 WordBusNumber (ResourceProducer, MinFixed, MaxFixed, PosDecode,
39 0x0000, /* address granularity */
40 0x0000, /* range minimum */
41 0x00ff, /* range maximum */
42 0x0000, /* translation */
43 0x0100, /* length */
44 ,, PSB0) /* ResourceSourceIndex, ResourceSource, DescriptorName */
45
46 IO(Decode16, 0x0cf8, 0x0cf8, 1, 8)
47
48 WORDIO(ResourceProducer, MinFixed, MaxFixed, PosDecode, EntireRange,
49 0x0000, /* address granularity */
50 0x0000, /* range minimum */
51 0x0cf7, /* range maximum */
52 0x0000, /* translation */
53 0x0cf8 /* length */
54 )
Martin Roth5c354b92019-04-22 14:55:16 -060055
56 WORDIO(ResourceProducer, MinFixed, MaxFixed, PosDecode, EntireRange,
57 0x0000, /* address granularity */
58 0x0d00, /* range minimum */
59 0xffff, /* range maximum */
60 0x0000, /* translation */
61 0xf300 /* length */
62 )
63
64 Memory32Fixed(READONLY, 0x000a0000, 0x00020000, VGAM) /* VGA memory space */
65 Memory32Fixed(READONLY, 0x000c0000, 0x00020000, EMM1) /* Assume C0000-E0000 empty */
66
67 /* memory space for PCI BARs below 4GB */
68 Memory32Fixed(ReadOnly, 0x00000000, 0x00000000, MMIO)
69}) /* End Name(_SB.PCI0.CRES) */
70
71Method(_CRS, 0) {
72 /* DBGO("\\_SB\\PCI0\\_CRS\n") */
73 CreateDWordField(CRES, ^MMIO._BAS, MM1B)
74 CreateDWordField(CRES, ^MMIO._LEN, MM1L)
75
Raul E Rangelc3d78462021-01-22 15:23:02 -070076 /* Declare memory between TOM1 and IOAPIC as available for PCI MMIO. */
Elyes HAOUAS28b68ae2020-09-24 20:18:26 +020077 MM1B = TOM1
Raul E Rangelc3d78462021-01-22 15:23:02 -070078 Local0 = IO_APIC_ADDR /* This is the first MMIO device after TOM1. */
Elyes HAOUAS28b68ae2020-09-24 20:18:26 +020079 Local0 -= TOM1
80 MM1L = Local0
Martin Roth5c354b92019-04-22 14:55:16 -060081
Aaron Durbin8c28e512020-06-23 13:49:21 -060082 CreateWordField(CRES, ^PSB0._MAX, BMAX)
83 CreateWordField(CRES, ^PSB0._LEN, BLEN)
Elyes HAOUAS28b68ae2020-09-24 20:18:26 +020084 BMAX = CONFIG_MMCONF_BUS_NUMBER - 1
85 BLEN = CONFIG_MMCONF_BUS_NUMBER
Aaron Durbin8c28e512020-06-23 13:49:21 -060086
Martin Roth5c354b92019-04-22 14:55:16 -060087 Return(CRES) /* note to change the Name buffer */
88} /* end of Method(_SB.PCI0._CRS) */