summaryrefslogtreecommitdiffstats
path: root/recipes-kernel/linux/linux-hierofalcon/412-6-styx-linux-tracking.git-1c9b07fb461d87b41854fef3a07fff65e0d95113.patch
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-kernel/linux/linux-hierofalcon/412-6-styx-linux-tracking.git-1c9b07fb461d87b41854fef3a07fff65e0d95113.patch')
-rw-r--r--recipes-kernel/linux/linux-hierofalcon/412-6-styx-linux-tracking.git-1c9b07fb461d87b41854fef3a07fff65e0d95113.patch159
1 files changed, 159 insertions, 0 deletions
diff --git a/recipes-kernel/linux/linux-hierofalcon/412-6-styx-linux-tracking.git-1c9b07fb461d87b41854fef3a07fff65e0d95113.patch b/recipes-kernel/linux/linux-hierofalcon/412-6-styx-linux-tracking.git-1c9b07fb461d87b41854fef3a07fff65e0d95113.patch
new file mode 100644
index 0000000..6f5b57b
--- /dev/null
+++ b/recipes-kernel/linux/linux-hierofalcon/412-6-styx-linux-tracking.git-1c9b07fb461d87b41854fef3a07fff65e0d95113.patch
@@ -0,0 +1,159 @@
1From 4f0837d4d1274b6e25d6bd76ac448e25592d6ea0 Mon Sep 17 00:00:00 2001
2From: Adrian Calianu <adrian.calianu@enea.com>
3Date: Tue, 11 Aug 2015 13:37:41 +0200
4Subject: [PATCH] [PATCH] DO NOT UPSTREAM YET: irqdomain
5
6From: Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com>
7Date: Tue, 20 Jan 2015 20:02:28 -0600
8
9Signed-off-by: Adrian Calianu <adrian.calianu@enea.com>
10---
11 include/linux/irqdomain.h | 14 +++++++++++++-
12 kernel/irq/irqdomain.c | 44 ++++++++++++++++++++++++++++++++++++--------
13 2 files changed, 49 insertions(+), 9 deletions(-)
14
15diff --git a/include/linux/irqdomain.h b/include/linux/irqdomain.h
16index 676d730..ddd6602 100644
17--- a/include/linux/irqdomain.h
18+++ b/include/linux/irqdomain.h
19@@ -45,6 +45,11 @@ struct irq_data;
20 /* Number of irqs reserved for a legacy isa controller */
21 #define NUM_ISA_INTERRUPTS 16
22
23+enum irq_domain_ref_type {
24+ IRQ_DOMAIN_REF_OF_DEV_NODE = 0,
25+ IRQ_DOMAIN_REF_ACPI_MSI_FRAME,
26+};
27+
28 /**
29 * struct irq_domain_ops - Methods for irq_domain objects
30 * @match: Match an interrupt controller device node to a host, returns
31@@ -61,7 +66,7 @@ struct irq_data;
32 * to setup the irq_desc when returning from map().
33 */
34 struct irq_domain_ops {
35- int (*match)(struct irq_domain *d, struct device_node *node);
36+ int (*match)(struct irq_domain *d, enum irq_domain_ref_type type, void *data);
37 int (*map)(struct irq_domain *d, unsigned int virq, irq_hw_number_t hw);
38 void (*unmap)(struct irq_domain *d, unsigned int virq);
39 int (*xlate)(struct irq_domain *d, struct device_node *node,
40@@ -116,6 +121,11 @@ struct irq_domain {
41
42 /* Optional data */
43 struct device_node *of_node;
44+ enum irq_domain_ref_type type;
45+ union {
46+ struct device_node *of_node;
47+ void *acpi_ref;
48+ };
49 struct irq_domain_chip_generic *gc;
50 #ifdef CONFIG_IRQ_DOMAIN_HIERARCHY
51 struct irq_domain *parent;
52@@ -163,6 +173,8 @@ struct irq_domain *irq_domain_add_legacy(struct device_node *of_node,
53 void *host_data);
54 extern struct irq_domain *irq_find_host(struct device_node *node);
55 extern void irq_set_default_host(struct irq_domain *host);
56+extern struct irq_domain *irq_find_domain(enum irq_domain_ref_type type,
57+ void *ref);
58
59 /**
60 * irq_domain_add_linear() - Allocate and register a linear revmap irq_domain.
61diff --git a/kernel/irq/irqdomain.c b/kernel/irq/irqdomain.c
62index 7fac311..0f0559f 100644
63--- a/kernel/irq/irqdomain.c
64+++ b/kernel/irq/irqdomain.c
65@@ -1,5 +1,6 @@
66 #define pr_fmt(fmt) "irq: " fmt
67
68+#include <linux/acpi.h>
69 #include <linux/debugfs.h>
70 #include <linux/hardirq.h>
71 #include <linux/interrupt.h>
72@@ -187,10 +188,11 @@ struct irq_domain *irq_domain_add_legacy(struct device_node *of_node,
73 EXPORT_SYMBOL_GPL(irq_domain_add_legacy);
74
75 /**
76- * irq_find_host() - Locates a domain for a given device node
77- * @node: device-tree node of the interrupt controller
78+ * irq_find_domain() - Locates a domain for a given a refence pointer
79+ * @type: specify irq domain reference pointer type to be match
80+ * @ref: pointer to the reference data structure to be matched
81 */
82-struct irq_domain *irq_find_host(struct device_node *node)
83+struct irq_domain *irq_find_domain(enum irq_domain_ref_type type, void *ref)
84 {
85 struct irq_domain *h, *found = NULL;
86 int rc;
87@@ -202,10 +204,16 @@ struct irq_domain *irq_find_host(struct device_node *node)
88 */
89 mutex_lock(&irq_domain_mutex);
90 list_for_each_entry(h, &irq_domain_list, link) {
91- if (h->ops->match)
92- rc = h->ops->match(h, node);
93- else
94- rc = (h->of_node != NULL) && (h->of_node == node);
95+ if (h->ops->match) {
96+ rc = h->ops->match(h, type, ref);
97+ } else if (type == IRQ_DOMAIN_REF_OF_DEV_NODE ||
98+ type == IRQ_DOMAIN_REF_ACPI_MSI_FRAME) {
99+ /* Here, we just need to compare reference pointer */
100+ rc = (h->of_node != NULL) && (h->of_node == ref);
101+ } else {
102+ /* For non-DT and non-ACPI reference, must specify match */
103+ BUG();
104+ }
105
106 if (rc) {
107 found = h;
108@@ -215,6 +223,16 @@ struct irq_domain *irq_find_host(struct device_node *node)
109 mutex_unlock(&irq_domain_mutex);
110 return found;
111 }
112+EXPORT_SYMBOL_GPL(irq_find_domain);
113+
114+/**
115+ * irq_find_host() - Locates a domain for a given device node
116+ * @node: device-tree node of the interrupt controller
117+ */
118+struct irq_domain *irq_find_host(struct device_node *node)
119+{
120+ return irq_find_domain(IRQ_DOMAIN_REF_OF_DEV_NODE, node);
121+}
122 EXPORT_SYMBOL_GPL(irq_find_host);
123
124 /**
125@@ -464,12 +482,16 @@ int irq_create_strict_mappings(struct irq_domain *domain, unsigned int irq_base,
126 }
127 EXPORT_SYMBOL_GPL(irq_create_strict_mappings);
128
129+//SURAVEE: HACK
130+#include <linux/irqchip/arm-gic.h>
131+
132 unsigned int irq_create_of_mapping(struct of_phandle_args *irq_data)
133 {
134 struct irq_domain *domain;
135 irq_hw_number_t hwirq;
136 unsigned int type = IRQ_TYPE_NONE;
137 int virq;
138+ struct gic_irq_alloc_info info;
139
140 domain = irq_data->np ? irq_find_host(irq_data->np) : irq_default_domain;
141 if (!domain) {
142@@ -496,7 +518,13 @@ unsigned int irq_create_of_mapping(struct of_phandle_args *irq_data)
143 if (virq)
144 return virq;
145
146- virq = irq_domain_alloc_irqs(domain, 1, NUMA_NO_NODE, irq_data);
147+//SURAVEE: TODO: Need to make this as part of irqdomain ops
148+ if (gic_init_irq_alloc_info(irq_data->args[0], irq_data->args[1],
149+ irq_data->args[2], irq_data->np,
150+ &info))
151+ return 0;
152+
153+ virq = irq_domain_alloc_irqs(domain, 1, NUMA_NO_NODE, &info);
154 if (virq <= 0)
155 return 0;
156 } else {
157--
1581.9.1
159