diff options
author | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2016-08-09 16:38:05 +1000 |
---|---|---|
committer | Stewart Smith <stewart@linux.vnet.ibm.com> | 2016-08-11 19:54:22 +1000 |
commit | 8b6d05d9b2cd187e05ff0aa27942f07d04c8d4d6 (patch) | |
tree | 5a3dad0ac8c8fcdb0f72d9a2b82ff51af0e0fdb5 /include | |
parent | c6a6391892539450a84d3dd69f4d83ea1a1b04d6 (diff) | |
download | skiboot-8b6d05d9b2cd187e05ff0aa27942f07d04c8d4d6.zip skiboot-8b6d05d9b2cd187e05ff0aa27942f07d04c8d4d6.tar.gz skiboot-8b6d05d9b2cd187e05ff0aa27942f07d04c8d4d6.tar.bz2 |
interrupts: Add new source ->attributes callback
This allows a given source to provide per-interrupt attributes
such as whether it targets OPAL or Linux and it's estimated
frequency.
The former allows to get rid of the double set of ops used to
decide which interrupts go where on some modules like the PHBs
and the latter will be eventually used to implement smart
caching of the source lookups.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/interrupts.h | 35 |
1 files changed, 21 insertions, 14 deletions
diff --git a/include/interrupts.h b/include/interrupts.h index 3fba9d9..23d785c 100644 --- a/include/interrupts.h +++ b/include/interrupts.h @@ -208,21 +208,16 @@ uint32_t p8_irq_to_phb(uint32_t irq); #define P8_IRQ_MISC_PSI_BASE 0x10 /* 0x10..0x17 */ /* These are handled by skiboot */ -#define P8_IRQ_PSI_SKIBOOT_BASE 0 #define P8_IRQ_PSI_FSP 0 #define P8_IRQ_PSI_OCC 1 #define P8_IRQ_PSI_FSI 2 #define P8_IRQ_PSI_LPC 3 #define P8_IRQ_PSI_LOCAL_ERR 4 -#define P8_IRQ_PSI_LOCAL_COUNT 5 -#define P8_IRQ_PSI_ALL_COUNT 6 +#define P8_IRQ_PSI_HOST_ERR 5 +#define P8_IRQ_PSI_IRQ_COUNT 6 /* TBD: NX, AS, ... */ -/* These are passed onto Linux */ -#define P8_IRQ_PSI_LINUX_BASE 5 -#define P8_IRQ_PSI_HOST_ERR 5 /* Used for UART */ -#define P8_IRQ_PSI_LINUX_COUNT 1 /* Note about interrupt numbers on P9 * ================================== @@ -259,19 +254,31 @@ uint32_t p8_irq_to_phb(uint32_t irq); struct irq_source; /* - * IRQ sources register themselves here. If an "interrupts" callback - * is provided, then all interrupts in that source will appear in - * 'opal-interrupts' and will be handled by us. - * - * The "eoi" callback is optional and can be used for interrupts - * requiring a special EOI at the source level. Typically will - * be used for XIVE interrupts coming from PHBs. + * IRQ sources register themselves here. + * + * The "attributes" callback provides various attributes specific to + * a given interrupt, such as whether it's targetted at OPAL or the + * OS, or whether it's frequent or infrequent. The latter will be used + * later to optimize the lookup of the sources array by providing a small + * cache of the frequent interrupts. + * + * The "eoi" callback is used for XIVE interrupts in XICS emulation + * though we might expose it at some point in XIVE native mode for + * interrupts that require special EOI operations such as possibly + * the LPC interrupts on P9 that need a latch cleared in the LPCHC. */ struct irq_source_ops { int64_t (*set_xive)(struct irq_source *is, uint32_t isn, uint16_t server, uint8_t priority); int64_t (*get_xive)(struct irq_source *is, uint32_t isn, uint16_t *server, uint8_t *priority); + uint64_t (*attributes)(struct irq_source *is, uint32_t isn); +/* LSB is the target */ +#define IRQ_ATTR_TARGET_OPAL 0x0 +#define IRQ_ATTR_TARGET_LINUX 0x1 +/* For OPAL interrupts, estimate frequency */ +#define IRQ_ATTR_TARGET_RARE 0x0 +#define IRQ_ATTR_TARGET_FREQUENT 0x2 void (*interrupt)(struct irq_source *is, uint32_t isn); void (*eoi)(struct irq_source *is, uint32_t isn); }; |