@@ -441,6 +441,13 @@ static int iop_reset(void)
return iop_reset_arg(IOP_RESET_ARGS);
}
+static int sif_cmd_init(dma_addr_t cmd_buffer)
+{
+ const struct sif_cmd_change_addr_packet cmd = { .addr = cmd_buffer };
+
+ return sif_cmd_opt(SIF_CMD_INIT_CMD, 0, &cmd, sizeof(cmd));
+}
+
static int sif_read_subaddr(dma_addr_t *subaddr)
{
if (!completed(sif_smflag_cmdinit))
@@ -584,6 +591,8 @@ EXPORT_SYMBOL_GPL(iop_error_message);
*
* 11. Service SIF0 RPCs via interrupts.
*
+ * 12. Enable the IOP to issue SIF commands.
+ *
* Return: 0 on success, otherwise a negative error number
*/
static int __init sif_init(void)
@@ -644,8 +653,17 @@ static int __init sif_init(void)
goto err_irq_sif0;
}
+ err = sif_cmd_init(virt_to_phys(sif0_buffer));
+ if (err) {
+ pr_err("sif: Failed to initialise commands with %d\n", err);
+ goto err_cmd_init;
+ }
+
return 0;
+err_cmd_init:
+ free_irq(IRQ_DMAC_SIF0, NULL);
+
err_irq_sif0:
sif_disable_dma();
Send the SIF_CMD_INIT_CMD command with option argument 0 to let the IOP issue SIF commands. The supplied address is the MAINADDR. Signed-off-by: Fredrik Noring <noring@nocrew.org> --- drivers/ps2/sif.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+)