@@ -24,6 +24,7 @@
#include <xen/irq.h>
#include <xen/sched.h>
#include <xen/errno.h>
+#include <xen/serial.h>
#include <xen/softirq.h>
#include <xen/list.h>
#include <xen/device_tree.h>
@@ -497,9 +498,20 @@ void gic_route_ppis(void)
void gic_route_spis(void)
{
+ int seridx;
+ const struct dt_irq *irq;
+
/* XXX should get these from DT */
/* UART */
gic_route_irq(37, 0, 1u << smp_processor_id(), 0xa0);
+
+ for ( seridx = 0; seridx <= SERHND_IDX; seridx++ )
+ {
+ if ( (irq = serial_dt_irq(seridx)) == NULL )
+ continue;
+
+ gic_route_dt_irq(irq, 1u << smp_processor_id(), 0xa0);
+ }
}
void __init release_irq(unsigned int irq)
@@ -482,6 +482,16 @@ int __init serial_irq(int idx)
return -1;
}
+const struct dt_irq __init *serial_dt_irq(int idx)
+{
+ if ( (idx >= 0) && (idx < ARRAY_SIZE(com)) &&
+ com[idx].driver && com[idx].driver->dt_irq_get )
+ return com[idx].driver->dt_irq_get(&com[idx]);
+
+ return NULL;
+}
+
+
void serial_suspend(void)
{
int i;
@@ -71,6 +71,8 @@ struct uart_driver {
int (*getc)(struct serial_port *, char *);
/* Get IRQ number for this port's serial line: returns -1 if none. */
int (*irq)(struct serial_port *);
+ /* Get IRQ device node for this port's serial line: returns NULL if none. */
+ const struct dt_irq *(*dt_irq_get)(struct serial_port *);
};
/* 'Serial handles' are composed from the following fields. */
@@ -120,6 +122,9 @@ void serial_end_log_everything(int handle);
/* Return irq number for specified serial port (identified by index). */
int serial_irq(int idx);
+/* Return irq device node for specified serial port (identified by index). */
+const struct dt_irq *serial_dt_irq(int idx);
+
/* Serial suspend/resume. */
void serial_suspend(void);
void serial_resume(void);