1/*
2 * Copyright (C) 2007-2009 coresystems GmbH
3 * Copyright (C) 2013 Google Inc.
4 * Copyright (C) 2016 Bin Meng <bmeng.cn@gmail.com>
5 *
6 * Modified from coreboot src/soc/intel/baytrail/acpi/irqroute.asl
7 *
8 * SPDX-License-Identifier:	GPL-2.0+
9 */
10
11Name(\PICM, 0)
12
13/*
14 * The _PIC method is called by the OS to choose between interrupt
15 * routing via the i8259 interrupt controller or the APIC.
16 *
17 * _PIC is called with a parameter of 0 for i8259 configuration and
18 * with a parameter of 1 for Local APIC/IOAPIC configuration.
19 */
20Method(\_PIC, 1)
21{
22	/* Remember the OS' IRQ routing choice */
23	Store(Arg0, PICM)
24}
25
26/* PCI interrupt routing */
27Method(_PRT) {
28	If (PICM) {
29		Return (Package() {
30			#undef PIC_MODE
31			#include "irq_helper.h"
32			PCI_DEV_PIRQ_ROUTES
33		})
34	} Else {
35		Return (Package() {
36			#define PIC_MODE
37			#include "irq_helper.h"
38			PCI_DEV_PIRQ_ROUTES
39		})
40	}
41
42}
43
44/* PCIe downstream ports interrupt routing */
45PCIE_BRIDGE_IRQ_ROUTES
46#undef PIC_MODE
47#include "irq_helper.h"
48PCIE_BRIDGE_IRQ_ROUTES
49