hc
2024-05-10 37f49e37ab4cb5d0bc4c60eb5c6d4dd57db767bb
kernel/include/linux/irqdomain.h
....@@ -44,6 +44,7 @@
4444 struct irq_data;
4545 struct cpumask;
4646 struct seq_file;
47
+struct irq_affinity_desc;
4748
4849 /* Number of irqs reserved for a legacy isa controller */
4950 #define NUM_ISA_INTERRUPTS 16
....@@ -76,12 +77,15 @@
7677 enum irq_domain_bus_token {
7778 DOMAIN_BUS_ANY = 0,
7879 DOMAIN_BUS_WIRED,
80
+ DOMAIN_BUS_GENERIC_MSI,
7981 DOMAIN_BUS_PCI_MSI,
8082 DOMAIN_BUS_PLATFORM_MSI,
8183 DOMAIN_BUS_NEXUS,
8284 DOMAIN_BUS_IPI,
8385 DOMAIN_BUS_FSL_MC_MSI,
86
+ DOMAIN_BUS_TI_SCI_INTA_MSI,
8487 DOMAIN_BUS_WAKEUP,
88
+ DOMAIN_BUS_VMD_MSI,
8589 };
8690
8791 /**
....@@ -231,7 +235,7 @@
231235
232236 #ifdef CONFIG_IRQ_DOMAIN
233237 struct fwnode_handle *__irq_domain_alloc_fwnode(unsigned int type, int id,
234
- const char *name, void *data);
238
+ const char *name, phys_addr_t *pa);
235239
236240 enum {
237241 IRQCHIP_FWNODE_REAL,
....@@ -252,13 +256,17 @@
252256 NULL);
253257 }
254258
255
-static inline struct fwnode_handle *irq_domain_alloc_fwnode(void *data)
259
+static inline struct fwnode_handle *irq_domain_alloc_fwnode(phys_addr_t *pa)
256260 {
257
- return __irq_domain_alloc_fwnode(IRQCHIP_FWNODE_REAL, 0, NULL, data);
261
+ return __irq_domain_alloc_fwnode(IRQCHIP_FWNODE_REAL, 0, NULL, pa);
258262 }
259263
260264 void irq_domain_free_fwnode(struct fwnode_handle *fwnode);
265
+#ifdef __GENKSYMS__ /* Android KABI hack to preserve CRC checker */
261266 struct irq_domain *__irq_domain_add(struct fwnode_handle *fwnode, int size,
267
+#else
268
+struct irq_domain *__irq_domain_add(struct fwnode_handle *fwnode, unsigned int size,
269
+#endif
262270 irq_hw_number_t hwirq_max, int direct_max,
263271 const struct irq_domain_ops *ops,
264272 void *host_data);
....@@ -277,9 +285,10 @@
277285 enum irq_domain_bus_token bus_token);
278286 extern bool irq_domain_check_msi_remap(void);
279287 extern void irq_set_default_host(struct irq_domain *host);
288
+extern struct irq_domain *irq_get_default_host(void);
280289 extern int irq_domain_alloc_descs(int virq, unsigned int nr_irqs,
281290 irq_hw_number_t hwirq, int node,
282
- const struct cpumask *affinity);
291
+ const struct irq_affinity_desc *affinity);
283292
284293 static inline struct fwnode_handle *of_node_to_fwnode(struct device_node *node)
285294 {
....@@ -385,10 +394,18 @@
385394 extern void irq_domain_disassociate(struct irq_domain *domain,
386395 unsigned int irq);
387396
388
-extern unsigned int irq_create_mapping(struct irq_domain *host,
389
- irq_hw_number_t hwirq);
397
+extern unsigned int irq_create_mapping_affinity(struct irq_domain *host,
398
+ irq_hw_number_t hwirq,
399
+ const struct irq_affinity_desc *affinity);
390400 extern unsigned int irq_create_fwspec_mapping(struct irq_fwspec *fwspec);
391401 extern void irq_dispose_mapping(unsigned int virq);
402
+
403
+static inline unsigned int irq_create_mapping(struct irq_domain *host,
404
+ irq_hw_number_t hwirq)
405
+{
406
+ return irq_create_mapping_affinity(host, hwirq, NULL);
407
+}
408
+
392409
393410 /**
394411 * irq_linear_revmap() - Find a linux irq from a hw irq number.
....@@ -431,6 +448,16 @@
431448 const u32 *intspec, unsigned int intsize,
432449 irq_hw_number_t *out_hwirq, unsigned int *out_type);
433450
451
+int irq_domain_translate_twocell(struct irq_domain *d,
452
+ struct irq_fwspec *fwspec,
453
+ unsigned long *out_hwirq,
454
+ unsigned int *out_type);
455
+
456
+int irq_domain_translate_onecell(struct irq_domain *d,
457
+ struct irq_fwspec *fwspec,
458
+ unsigned long *out_hwirq,
459
+ unsigned int *out_type);
460
+
434461 /* IPI functions */
435462 int irq_reserve_ipi(struct irq_domain *domain, const struct cpumask *dest);
436463 int irq_destroy_ipi(unsigned int irq, const struct cpumask *dest);
....@@ -442,6 +469,7 @@
442469 irq_hw_number_t hwirq, struct irq_chip *chip,
443470 void *chip_data, irq_flow_handler_t handler,
444471 void *handler_data, const char *handler_name);
472
+extern void irq_domain_reset_irq_data(struct irq_data *irq_data);
445473 #ifdef CONFIG_IRQ_DOMAIN_HIERARCHY
446474 extern struct irq_domain *irq_domain_create_hierarchy(struct irq_domain *parent,
447475 unsigned int flags, unsigned int size,
....@@ -462,7 +490,8 @@
462490
463491 extern int __irq_domain_alloc_irqs(struct irq_domain *domain, int irq_base,
464492 unsigned int nr_irqs, int node, void *arg,
465
- bool realloc, const struct cpumask *affinity);
493
+ bool realloc,
494
+ const struct irq_affinity_desc *affinity);
466495 extern void irq_domain_free_irqs(unsigned int virq, unsigned int nr_irqs);
467496 extern int irq_domain_activate_irq(struct irq_data *irq_data, bool early);
468497 extern void irq_domain_deactivate_irq(struct irq_data *irq_data);
....@@ -482,7 +511,6 @@
482511 irq_hw_number_t hwirq,
483512 struct irq_chip *chip,
484513 void *chip_data);
485
-extern void irq_domain_reset_irq_data(struct irq_data *irq_data);
486514 extern void irq_domain_free_irqs_common(struct irq_domain *domain,
487515 unsigned int virq,
488516 unsigned int nr_irqs);
....@@ -500,6 +528,9 @@
500528 unsigned int irq_base,
501529 unsigned int nr_irqs);
502530
531
+extern int irq_domain_disconnect_hierarchy(struct irq_domain *domain,
532
+ unsigned int virq);
533
+
503534 static inline bool irq_domain_is_hierarchy(struct irq_domain *domain)
504535 {
505536 return domain->flags & IRQ_DOMAIN_FLAG_HIERARCHY;