diff mbox series

[074/120] MIPS: PS2: SIF: Request RPC IRQ command

Message ID 109dfd3e0eee7af923c8451c8f0e1f8f665375f1.1567326213.git.noring@nocrew.org (mailing list archive)
State RFC
Headers show
Series Linux for the PlayStation 2 | expand

Commit Message

Fredrik Noring Sept. 1, 2019, 4:16 p.m. UTC
Signed-off-by: Fredrik Noring <noring@nocrew.org>
---
 arch/mips/include/asm/mach-ps2/irq.h |  5 +++++
 arch/mips/ps2/intc-irq.c             |  6 ++++++
 drivers/ps2/sif.c                    | 11 +++++++++++
 3 files changed, 22 insertions(+)
diff mbox series

Patch

diff --git a/arch/mips/include/asm/mach-ps2/irq.h b/arch/mips/include/asm/mach-ps2/irq.h
index 16c96aa7ca09..64d3fbf4789e 100644
--- a/arch/mips/include/asm/mach-ps2/irq.h
+++ b/arch/mips/include/asm/mach-ps2/irq.h
@@ -74,4 +74,9 @@ 
 int __init intc_irq_init(void);
 int __init dmac_irq_init(void);
 
+/*
+ * IRQs asserted by the I/O processor (IOP) via the sub-system interface (SIF).
+ */
+void intc_sif_irq(unsigned int irq);
+
 #endif /* __ASM_MACH_PS2_IRQ_H */
diff --git a/arch/mips/ps2/intc-irq.c b/arch/mips/ps2/intc-irq.c
index 36cdc3dd31ca..08659758e85f 100644
--- a/arch/mips/ps2/intc-irq.c
+++ b/arch/mips/ps2/intc-irq.c
@@ -85,6 +85,12 @@  static struct irqaction cascade_intc_irqaction = {
 	.handler = intc_cascade,
 };
 
+void intc_sif_irq(unsigned int irq)
+{
+	do_IRQ(irq);
+}
+EXPORT_SYMBOL_GPL(intc_sif_irq);
+
 int __init intc_irq_init(void)
 {
 	size_t i;
diff --git a/drivers/ps2/sif.c b/drivers/ps2/sif.c
index 5c3866c460af..a7f4f00a539c 100644
--- a/drivers/ps2/sif.c
+++ b/drivers/ps2/sif.c
@@ -568,6 +568,16 @@  int sif_request_cmd(u32 cmd_id, sif_cmd_cb cb, void *arg)
 }
 EXPORT_SYMBOL_GPL(sif_request_cmd);
 
+static void cmd_irq_relay(const struct sif_cmd_header *header,
+	const void *data, void *arg)
+{
+	const struct {
+		u32 irq;
+	} *packet = data;
+
+	intc_sif_irq(packet->irq);
+}
+
 static int iop_reset_arg(const char *arg)
 {
 	const size_t arglen = strlen(arg) + 1;
@@ -664,6 +674,7 @@  static int sif_request_cmds(void)
 		struct cmd_data *arg;
 	} cmds[] = {
 		{ SIF_CMD_WRITE_SREG, cmd_write_sreg, NULL },
+		{ SIF_CMD_IRQ_RELAY,  cmd_irq_relay,  NULL },
 
 		{ SIF_CMD_RPC_END,    cmd_rpc_end,    NULL },
 		{ SIF_CMD_RPC_BIND,   cmd_rpc_bind,   NULL },