• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/* SPDX-License-Identifier: GPL-2.0-only */
2
3Field (\_SB.PCI0.LPCB.PCIC, AnyAcc, NoLock, Preserve)
4{
5	Offset (0x60),	// Interrupt Routing Registers
6	PRTA,	8,
7	PRTB,	8,
8	PRTC,	8,
9	PRTD,	8,
10}
11
12Name(IRQB, ResourceTemplate(){
13	IRQ(Level,ActiveLow,Shared){15}
14})
15
16Name(IRQP, ResourceTemplate(){
17	IRQ(Level,ActiveLow,Exclusive){3, 4, 5, 6, 7, 10, 11, 12}
18})
19
20/* adapted from ma78gm/dsdt.asl */
21#define PCI_INTX_DEV(intx, pinx, uid)			\
22Device(intx) {						\
23	Name(_HID, EISAID("PNP0C0F"))			\
24	Name(_UID, uid)					\
25							\
26	Method(_STA, 0) {				\
27		If (pinx & 0x80) {			\
28			Return(0x09)			\
29		}					\
30		Return(0x0B)				\
31	}						\
32							\
33	Method(_DIS ,0) {				\
34		pinx = 0x80			\
35	}						\
36							\
37	Method(_PRS ,0) {				\
38		Return(IRQP)				\
39	}						\
40							\
41	Method(_CRS ,0) {				\
42		CreateWordField(IRQB, 1, IRQN)		\
43		IRQN = 1 << (pinx & 0x0f)		\
44		Return(IRQB)				\
45	}						\
46							\
47	Method(_SRS, 1) {				\
48		CreateWordField(ARG0, 1, IRQM)		\
49							\
50		/* Use lowest available IRQ */		\
51		FindSetRightBit(IRQM, Local0)		\
52		if (Local0) {				\
53			Local0--			\
54		}					\
55		pinx = Local0			\
56	}						\
57}							\
58
59PCI_INTX_DEV(LNKA, PRTA, 1)
60PCI_INTX_DEV(LNKB, PRTB, 2)
61PCI_INTX_DEV(LNKC, PRTC, 3)
62PCI_INTX_DEV(LNKD, PRTD, 4)
63