hc
2023-12-11 1f93a7dfd1f8d5ff7a5c53246c7534fe2332d6f4
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,9 +256,9 @@
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);
....@@ -277,9 +281,10 @@
277281 enum irq_domain_bus_token bus_token);
278282 extern bool irq_domain_check_msi_remap(void);
279283 extern void irq_set_default_host(struct irq_domain *host);
284
+extern struct irq_domain *irq_get_default_host(void);
280285 extern int irq_domain_alloc_descs(int virq, unsigned int nr_irqs,
281286 irq_hw_number_t hwirq, int node,
282
- const struct cpumask *affinity);
287
+ const struct irq_affinity_desc *affinity);
283288
284289 static inline struct fwnode_handle *of_node_to_fwnode(struct device_node *node)
285290 {
....@@ -385,10 +390,18 @@
385390 extern void irq_domain_disassociate(struct irq_domain *domain,
386391 unsigned int irq);
387392
388
-extern unsigned int irq_create_mapping(struct irq_domain *host,
389
- irq_hw_number_t hwirq);
393
+extern unsigned int irq_create_mapping_affinity(struct irq_domain *host,
394
+ irq_hw_number_t hwirq,
395
+ const struct irq_affinity_desc *affinity);
390396 extern unsigned int irq_create_fwspec_mapping(struct irq_fwspec *fwspec);
391397 extern void irq_dispose_mapping(unsigned int virq);
398
+
399
+static inline unsigned int irq_create_mapping(struct irq_domain *host,
400
+ irq_hw_number_t hwirq)
401
+{
402
+ return irq_create_mapping_affinity(host, hwirq, NULL);
403
+}
404
+
392405
393406 /**
394407 * irq_linear_revmap() - Find a linux irq from a hw irq number.
....@@ -431,6 +444,16 @@
431444 const u32 *intspec, unsigned int intsize,
432445 irq_hw_number_t *out_hwirq, unsigned int *out_type);
433446
447
+int irq_domain_translate_twocell(struct irq_domain *d,
448
+ struct irq_fwspec *fwspec,
449
+ unsigned long *out_hwirq,
450
+ unsigned int *out_type);
451
+
452
+int irq_domain_translate_onecell(struct irq_domain *d,
453
+ struct irq_fwspec *fwspec,
454
+ unsigned long *out_hwirq,
455
+ unsigned int *out_type);
456
+
434457 /* IPI functions */
435458 int irq_reserve_ipi(struct irq_domain *domain, const struct cpumask *dest);
436459 int irq_destroy_ipi(unsigned int irq, const struct cpumask *dest);
....@@ -442,6 +465,7 @@
442465 irq_hw_number_t hwirq, struct irq_chip *chip,
443466 void *chip_data, irq_flow_handler_t handler,
444467 void *handler_data, const char *handler_name);
468
+extern void irq_domain_reset_irq_data(struct irq_data *irq_data);
445469 #ifdef CONFIG_IRQ_DOMAIN_HIERARCHY
446470 extern struct irq_domain *irq_domain_create_hierarchy(struct irq_domain *parent,
447471 unsigned int flags, unsigned int size,
....@@ -462,7 +486,8 @@
462486
463487 extern int __irq_domain_alloc_irqs(struct irq_domain *domain, int irq_base,
464488 unsigned int nr_irqs, int node, void *arg,
465
- bool realloc, const struct cpumask *affinity);
489
+ bool realloc,
490
+ const struct irq_affinity_desc *affinity);
466491 extern void irq_domain_free_irqs(unsigned int virq, unsigned int nr_irqs);
467492 extern int irq_domain_activate_irq(struct irq_data *irq_data, bool early);
468493 extern void irq_domain_deactivate_irq(struct irq_data *irq_data);
....@@ -482,7 +507,6 @@
482507 irq_hw_number_t hwirq,
483508 struct irq_chip *chip,
484509 void *chip_data);
485
-extern void irq_domain_reset_irq_data(struct irq_data *irq_data);
486510 extern void irq_domain_free_irqs_common(struct irq_domain *domain,
487511 unsigned int virq,
488512 unsigned int nr_irqs);
....@@ -500,6 +524,9 @@
500524 unsigned int irq_base,
501525 unsigned int nr_irqs);
502526
527
+extern int irq_domain_disconnect_hierarchy(struct irq_domain *domain,
528
+ unsigned int virq);
529
+
503530 static inline bool irq_domain_is_hierarchy(struct irq_domain *domain)
504531 {
505532 return domain->flags & IRQ_DOMAIN_FLAG_HIERARCHY;