1 /* SPDX-License-Identifier: GPL-2.0-only */
3 #ifndef SOC_INTEL_COMMON_BLOCK_ITSS_H
4 #define SOC_INTEL_COMMON_BLOCK_ITSS_H
6 #define ITSS_MAX_IRQ 119
7 #define IRQS_PER_IPC 32
8 #define NUM_IPC_REGS ((ITSS_MAX_IRQ + IRQS_PER_IPC - 1)/IRQS_PER_IPC)
10 /* PIRQA Routing Control Register */
11 #define PCR_ITSS_PIRQA_ROUT 0x3100
12 /* PIRQB Routing Control Register */
13 #define PCR_ITSS_PIRQB_ROUT 0x3101
14 /* PIRQC Routing Control Register */
15 #define PCR_ITSS_PIRQC_ROUT 0x3102
16 /* PIRQD Routing Control Register */
17 #define PCR_ITSS_PIRQD_ROUT 0x3103
18 /* PIRQE Routing Control Register */
19 #define PCR_ITSS_PIRQE_ROUT 0x3104
20 /* PIRQF Routing Control Register */
21 #define PCR_ITSS_PIRQF_ROUT 0x3105
22 /* PIRQG Routing Control Register */
23 #define PCR_ITSS_PIRQG_ROUT 0x3106
24 /* PIRQH Routing Control Register */
25 #define PCR_ITSS_PIRQH_ROUT 0x3107
26 /* ITSS Interrupt Route */
27 #define PCR_ITSS_PIR 0x3140
28 #define PCI_ITSS_PIR(i) (PCR_ITSS_PIR + (i) * 2)
29 /* ITSS Interrupt polarity control */
30 #define PCR_ITSS_IPC0_CONF 0x3200
31 /* ITSS Power reduction control */
32 #define PCR_ITSS_ITSSPRC 0x3300
34 #if !defined(__ACPI__)
36 #include <device/device.h>
37 #include <southbridge/intel/common/acpi_pirq_gen.h>
40 /* Set the interrupt polarity for provided IRQ to the APIC. */
41 void itss_set_irq_polarity(int irq
, int active_low
);
43 /* Snapshot and restore IRQ polarity settings for the inclusive range. */
44 void itss_snapshot_irq_polarities(int start
, int end
);
45 void itss_restore_irq_polarities(int start
, int end
);
47 void itss_irq_init(const uint8_t pch_interrupt_routing
[PIRQ_COUNT
]);
48 void itss_clock_gate_8254(void);
50 /* SoC implementation to return corresponding PIR register offset. */
51 uint32_t itss_soc_get_on_chip_dev_pir(const struct device
*dev
);
53 /* Return which PIRQx the device's INTx is connected to. */
54 enum pirq
itss_get_on_chip_dev_pirq(const struct device
*dev
, enum pci_pin pin
);
56 #endif /* !defined(__ACPI__) */
58 #endif /* SOC_INTEL_COMMON_BLOCK_ITSS_H */