Angel Pons | 4b42983 | 2020-04-02 23:48:50 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
Stefan Reinauer | cc46e73 | 2009-03-13 00:44:09 +0000 | [diff] [blame] | 2 | |
Patrick Georgi | 334328a | 2012-02-16 19:01:22 +0100 | [diff] [blame] | 3 | #include "hostbridge.asl" |
Stefan Reinauer | cc46e73 | 2009-03-13 00:44:09 +0000 | [diff] [blame] | 4 | |
Denis 'GNUtoo' Carikli | 4b213a8 | 2013-03-28 14:24:39 +0100 | [diff] [blame] | 5 | /* Operating System Capabilities Method */ |
| 6 | Method (_OSC, 4) |
| 7 | { |
Denis 'GNUtoo' Carikli | 4b213a8 | 2013-03-28 14:24:39 +0100 | [diff] [blame] | 8 | /* Check for proper PCI/PCIe UUID */ |
Elyes HAOUAS | e298391 | 2020-09-10 20:36:14 +0200 | [diff] [blame] | 9 | If (Arg0 == ToUUID("33DB4D5B-1FF7-401C-9657-7441C03DD766")) |
Denis 'GNUtoo' Carikli | 4b213a8 | 2013-03-28 14:24:39 +0100 | [diff] [blame] | 10 | { |
| 11 | /* Let OS control everything */ |
| 12 | Return(Arg3) |
| 13 | } Else { |
Marc Jones | 1faa11e | 2018-08-15 22:17:45 -0600 | [diff] [blame] | 14 | CreateDWordField(Arg3, 0, CDW1) |
Elyes HAOUAS | e298391 | 2020-09-10 20:36:14 +0200 | [diff] [blame] | 15 | CDW1 = CDW1 | 4 // Unrecognized UUID, so set bit 2 to 1 |
Denis 'GNUtoo' Carikli | 4b213a8 | 2013-03-28 14:24:39 +0100 | [diff] [blame] | 16 | Return(Arg3) |
| 17 | } |
| 18 | } |
| 19 | |
Stefan Reinauer | cc46e73 | 2009-03-13 00:44:09 +0000 | [diff] [blame] | 20 | /* PCI Device Resource Consumption */ |
| 21 | Device (PDRC) |
| 22 | { |
| 23 | Name (_HID, EISAID("PNP0C02")) |
| 24 | Name (_UID, 1) |
Stefan Reinauer | 71a3d96 | 2009-07-21 21:44:24 +0000 | [diff] [blame] | 25 | |
| 26 | // This does not seem to work correctly yet - set values statically for |
| 27 | // now. |
Stefan Reinauer | 109ab31 | 2009-08-12 16:08:05 +0000 | [diff] [blame] | 28 | |
Stefan Reinauer | 71a3d96 | 2009-07-21 21:44:24 +0000 | [diff] [blame] | 29 | //Name (PDRS, ResourceTemplate() { |
| 30 | // Memory32Fixed(ReadWrite, 0x00000000, 0x00004000, RCRB) // RCBA |
| 31 | // Memory32Fixed(ReadWrite, 0x00000000, 0x00004000, MCHB) // MCHBAR |
| 32 | // Memory32Fixed(ReadWrite, 0x00000000, 0x00001000, DMIB) // DMIBAR |
| 33 | // Memory32Fixed(ReadWrite, 0x00000000, 0x00001000, EGPB) // EPBAR |
| 34 | // Memory32Fixed(ReadWrite, 0x00000000, 0x00000000, PCIE) // PCIE BAR |
| 35 | // Memory32Fixed(ReadWrite, 0xfed20000, 0x00070000, ICHB) // Misc ICH |
| 36 | //}) |
| 37 | |
Stefan Reinauer | cc46e73 | 2009-03-13 00:44:09 +0000 | [diff] [blame] | 38 | Name (PDRS, ResourceTemplate() { |
Angel Pons | b70ff52 | 2021-01-28 14:27:46 +0100 | [diff] [blame] | 39 | Memory32Fixed(ReadWrite, CONFIG_FIXED_RCBA_MMIO_BASE, CONFIG_RCBA_LENGTH) |
Angel Pons | 4299cb4 | 2021-01-20 12:32:22 +0100 | [diff] [blame] | 40 | Memory32Fixed(ReadWrite, CONFIG_FIXED_MCHBAR_MMIO_BASE, 0x00004000) |
| 41 | Memory32Fixed(ReadWrite, CONFIG_FIXED_DMIBAR_MMIO_BASE, 0x00001000) |
| 42 | Memory32Fixed(ReadWrite, CONFIG_FIXED_EPBAR_MMIO_BASE, 0x00001000) |
Angel Pons | a6b0922 | 2021-01-20 13:00:02 +0100 | [diff] [blame] | 43 | Memory32Fixed(ReadWrite, CONFIG_MMCONF_BASE_ADDRESS, CONFIG_MMCONF_LENGTH) |
Stefan Reinauer | 71a3d96 | 2009-07-21 21:44:24 +0000 | [diff] [blame] | 44 | Memory32Fixed(ReadWrite, 0xfed20000, 0x00020000) // Misc ICH |
| 45 | Memory32Fixed(ReadWrite, 0xfed40000, 0x00005000) // Misc ICH |
| 46 | Memory32Fixed(ReadWrite, 0xfed45000, 0x0004b000) // Misc ICH |
Stefan Reinauer | cc46e73 | 2009-03-13 00:44:09 +0000 | [diff] [blame] | 47 | }) |
| 48 | |
| 49 | // Current Resource Settings |
| 50 | Method (_CRS, 0, Serialized) |
| 51 | { |
Stefan Reinauer | 71a3d96 | 2009-07-21 21:44:24 +0000 | [diff] [blame] | 52 | //CreateDwordField(PDRS, ^RCRB._BAS, RBR0) |
Elyes HAOUAS | e298391 | 2020-09-10 20:36:14 +0200 | [diff] [blame] | 53 | //RBR0 = \_SB.PCI0.LPCB.RCBA << 14 |
Stefan Reinauer | cc46e73 | 2009-03-13 00:44:09 +0000 | [diff] [blame] | 54 | |
Stefan Reinauer | 71a3d96 | 2009-07-21 21:44:24 +0000 | [diff] [blame] | 55 | //CreateDwordField(PDRS, ^MCHB._BAS, MBR0) |
Elyes HAOUAS | e298391 | 2020-09-10 20:36:14 +0200 | [diff] [blame] | 56 | //MBR0 = \_SB.PCI0.MCHC.MHBR << 14 |
Stefan Reinauer | cc46e73 | 2009-03-13 00:44:09 +0000 | [diff] [blame] | 57 | |
Stefan Reinauer | 71a3d96 | 2009-07-21 21:44:24 +0000 | [diff] [blame] | 58 | //CreateDwordField(PDRS, ^DMIB._BAS, DBR0) |
Elyes HAOUAS | e298391 | 2020-09-10 20:36:14 +0200 | [diff] [blame] | 59 | //DBR0 = \_SB.PCI0.MCHC.DMBR << 12 |
Stefan Reinauer | cc46e73 | 2009-03-13 00:44:09 +0000 | [diff] [blame] | 60 | |
Stefan Reinauer | 71a3d96 | 2009-07-21 21:44:24 +0000 | [diff] [blame] | 61 | //CreateDwordField(PDRS, ^EGPB._BAS, EBR0) |
Elyes HAOUAS | e298391 | 2020-09-10 20:36:14 +0200 | [diff] [blame] | 62 | //EBR0 = \_SB.PCI0.MCHC.EPBR << 12 |
Stefan Reinauer | cc46e73 | 2009-03-13 00:44:09 +0000 | [diff] [blame] | 63 | |
Stefan Reinauer | 71a3d96 | 2009-07-21 21:44:24 +0000 | [diff] [blame] | 64 | //CreateDwordField(PDRS, ^PCIE._BAS, PBR0) |
Elyes HAOUAS | e298391 | 2020-09-10 20:36:14 +0200 | [diff] [blame] | 65 | //PBR0 = \_SB.PCI0.MCHC.PXBR << 26 |
Stefan Reinauer | cc46e73 | 2009-03-13 00:44:09 +0000 | [diff] [blame] | 66 | |
Stefan Reinauer | 71a3d96 | 2009-07-21 21:44:24 +0000 | [diff] [blame] | 67 | //CreateDwordField(PDRS, ^PCIE._LEN, PSZ0) |
Elyes HAOUAS | e298391 | 2020-09-10 20:36:14 +0200 | [diff] [blame] | 68 | //PSZ0 = 0x10000000 << \_SB.PCI0.MCHC.PXSZ |
Stefan Reinauer | cc46e73 | 2009-03-13 00:44:09 +0000 | [diff] [blame] | 69 | |
| 70 | Return(PDRS) |
| 71 | } |
| 72 | } |
| 73 | |
| 74 | // PCIe graphics port 0:1.0 |
Patrick Georgi | 334328a | 2012-02-16 19:01:22 +0100 | [diff] [blame] | 75 | #include "peg.asl" |
Stefan Reinauer | cc46e73 | 2009-03-13 00:44:09 +0000 | [diff] [blame] | 76 | |
| 77 | // Integrated graphics 0:2.0 |
Matt DeVillier | c6589ae | 2020-11-28 13:17:54 -0600 | [diff] [blame] | 78 | #include <drivers/intel/gma/acpi/gfx.asl> |
Patrick Georgi | 334328a | 2012-02-16 19:01:22 +0100 | [diff] [blame] | 79 | #include "igd.asl" |